From 2d104e7a25f7cde4adecd00c14b77fe8739e951c Mon Sep 17 00:00:00 2001 From: radxnl Date: Mon, 21 May 2012 16:05:52 +0200 Subject: [PATCH] initial import --- .gitignore | 8 + .gitmodules | 16 + LICENSE | 340 + Makefile | 153 + bitbake | 1 + meta-openembedded | 1 + meta-openpli/classes/git-project.bbclass | 7 + meta-openpli/classes/image_types_nfi.bbclass | 61 + .../classes/openpli-distutils.bbclass | 111 + meta-openpli/classes/schwerkraft-git.bbclass | 5 + .../include/openpli-unstable-versions.inc | 26 + meta-openpli/conf/distro/openpli.conf | 91 + meta-openpli/conf/layer.conf | 11 + meta-openpli/conf/license/openpli-gplv2.inc | 2 + meta-openpli/conf/machine/dm500hd.conf | 15 + meta-openpli/conf/machine/dm7020hd.conf | 14 + meta-openpli/conf/machine/dm8000.conf | 13 + meta-openpli/conf/machine/dm800se.conf | 15 + meta-openpli/conf/machine/et5x00.conf | 5 + meta-openpli/conf/machine/et6x00.conf | 5 + meta-openpli/conf/machine/et9x00.conf | 5 + .../machine/include/dreambox-brcmnand.inc | 1 + .../conf/machine/include/dreambox-hw-ecc.inc | 2 + .../machine/include/dreambox-jffs2-sum.inc | 3 + .../conf/machine/include/dreambox-jffs2.inc | 3 + .../machine/include/dreambox-legacy-wlan.inc | 1 + .../machine/include/dreambox-mips32el-nf.inc | 11 + .../machine/include/dreambox-mips32el.inc | 11 + .../machine/include/dreambox-nand-1024mb.inc | 3 + .../machine/include/dreambox-nand-256mb.inc | 3 + .../machine/include/dreambox-nand-64mb.inc | 3 + .../machine/include/dreambox-part-256mb.inc | 4 + .../machine/include/dreambox-part-64mb.inc | 4 + .../conf/machine/include/dreambox.inc | 45 + meta-openpli/conf/machine/include/etxx00.inc | 115 + .../dreambox/dreambox-blindscan-utils_1.7.bb | 24 + .../dreambox/dreambox-buildimage_1.4.bb | 23 + ...eambox-dvb-modules-dm500hd_3.2-20120415.bb | 6 + ...ambox-dvb-modules-dm7020hd_3.2-20120415.bb | 6 + ...reambox-dvb-modules-dm8000_3.2-20120417.bb | 8 + ...eambox-dvb-modules-dm800se_3.2-20120415.bb | 6 + .../dreambox/dreambox-dvb-modules.inc | 45 + .../dreambox-dvb-modules/dm500hd/modules | 2 + .../dreambox-dvb-modules/dm7020hd/modules | 3 + .../dreambox-dvb-modules/dm8000/modules | 3 + .../dreambox-dvb-modules/dm800se/modules | 3 + .../dreambox/dreambox-secondstage-base.inc | 36 + .../dreambox-secondstage-dm500hd_84.bb | 6 + .../dreambox-secondstage-dm7020hd_86.bb | 6 + .../dreambox-secondstage-dm8000_84.bb | 6 + .../dreambox-secondstage-dm800se_84.bb | 6 + .../dreambox/dreambox-secondstage.inc | 5 + .../etxx00/et-blindscan-dvbs-utils.bb | 27 + .../recipes-bsp/etxx00/et-dvb-modules.bb | 35 + .../recipes-bsp/etxx00/et-fpupdate.bb | 63 + .../vuplus/vuplus-blindscan-utils.bb | 28 + ...uto_net_path_sortlocale_mountoptions.patch | 19 + ...37_let_debian_rules_decide_on_CFLAGS.patch | 34 + ...efault_auto_master_all_commented_out.patch | 18 + .../060_non_replicated_ping.patch | 228 + .../autofs-4.1.4/061_multi_parse_fix.patch | 60 + .../autofs-4.1.4/062_fix_memory_leak.patch | 32 + .../autofs/autofs-4.1.4/063_misc_fixes.patch | 82 + .../064_support_options_on_nis_maps.patch | 45 + .../065_fix_master_map_in_ldap.patch | 22 + .../066_canonicalise_mount_points.patch | 24 + .../067_allow_disabling_bind_mounts.patch | 77 + .../067_ldap_no_first_message.patch | 28 + .../068_fix_invalid_rpcgen_code.patch | 21 + ...69_support_spaces_in_smb_share_names.patch | 19 + .../autofs-4.1.4/070_fix_regex_typo.patch | 19 + .../autofs-4.1.4/071_fix_ldap_mounts.patch | 19 + .../autofs-4.1.4/072_fix_auto_net_sort.patch | 19 + .../073_configurable_locking.patch | 173 + .../autofs-4.1.4/074_auto_smb_cifs.patch | 19 + .../075_auto_net_escape_hash.patch | 16 + .../autofs-4.1.4/076_ldap_deprecated.patch | 265 + .../autofs-4.1.4/078_locking_fix_1.patch | 82 + .../autofs-4.1.4/079_no_unlink_upstream.patch | 55 + .../080_auto_smb_probe_credentials.patch | 37 + .../081_auto_net_showmount_quotes.patch | 19 + .../082_samples_makefile_typo.patch | 18 + ...083_clarify_program_map_outputsyntax.patch | 19 + .../autofs-4.1.4/084_init_lsb_header.patch | 26 + .../autofs-4.1.4/085_auto_net_lp111612.patch | 20 + .../autofs-4.1.4/Makefile.rules-cross.patch | 19 + .../autofs/autofs-4.1.4/auto.hotplug | 1 + .../autofs/autofs-4.1.4/auto.master | 11 + .../autofs/autofs-4.1.4/auto.network | 2 + .../autofs/autofs-4.1.4/autofs.default | 2 + .../autofs/autofs-4.1.4/autofs.init | 803 + .../autofs/autofs-4.1.4/cross.patch | 42 + .../autofs/autofs-4.1.4/install.patch | 71 + .../autofs/autofs-4.1.4/no-bash.patch | 18 + .../autofs/autofs-4.1.4/volatiles.99_autofs | 2 + .../autofs/autofs_4.1.4.bb | 80 + .../bluez/bluez4_4.99.bbappend | 5 + .../ctorrent/ctorrent.inc | 10 + .../ctorrent/ctorrent_3.3.1.bb | 14 + .../ctorrent/files/CVE-2009-1759.patch | 88 + .../ctorrent/files/extended_ctorrent.diff | 15445 +++ .../inadyn-mt/files/inadyn-mt.sh | 27 + .../inadyn-mt/files/inadyn.conf | 13 + .../files/remove_host_include_paths.patch | 11 + .../inadyn-mt/inadyn-mt.bb | 33 + .../madwifi/files/ath-rate-ctlname.patch | 108 + .../madwifi/files/fix-build-3.1.patch | 22 + .../madwifi/files/fix-build-3.2.patch | 41 + .../madwifi/files/fix-module-autoload.patch | 11 + .../madwifi/files/fix-target-mips32.patch | 16 + .../madwifi/files/madwifi-smp-affinity | 18 + .../madwifi/files/remove-wprobe.patch | 115 + .../madwifi/files/set-affinity-hint.patch | 45 + .../madwifi/madwifi-ng_r.inc | 35 + .../madwifi/madwifi-ng_r3314-20080131.bb | 50 + .../minidlna/default_sqlite_caches.diff | 20 + .../minidlna/minidlna_cvs.bb | 20 + .../ofono/ofono_1.5.bbappend | 5 + .../openresolv-3.5.2/000resolvconf.if-up | 22 + .../000resolvconf.ppp.ip-down | 6 + .../openresolv-3.5.2/000resolvconf.ppp.ip-up | 12 + .../openresolv-3.5.2/resolvconf.conf | 1 + .../openresolv-3.5.2/resolvconf.if-down | 11 + .../openresolv-3.5.2/volatiles.99_openresolv | 2 + .../openresolv/openresolv_3.5.2.bb | 60 + .../openssl-0.9.8w/configure-targets.patch | 25 + .../openssl/openssl-0.9.8w/debian/ca.patch | 22 + .../openssl-0.9.8w/debian/config-hurd.patch | 17 + .../debian/debian-targets.patch | 56 + .../openssl-0.9.8w/debian/engines-path.patch | 49 + .../openssl-0.9.8w/debian/kfreebsd-pipe.patch | 15 + .../openssl-0.9.8w/debian/make-targets.patch | 15 + .../openssl-0.9.8w/debian/man-dir.patch | 15 + .../openssl-0.9.8w/debian/man-section.patch | 34 + .../openssl-0.9.8w/debian/no-rpath.patch | 15 + .../openssl-0.9.8w/debian/no-symbolic.patch | 15 + .../openssl-0.9.8w/debian/perl-path.diff | 762 + .../openssl/openssl-0.9.8w/debian/pic.patch | 303 + .../openssl-0.9.8w/debian/pkg-config.patch | 36 + .../openssl-0.9.8w/debian/rc4-amd64.patch | 16 + .../openssl-0.9.8w/debian/rehash-crt.patch | 35 + .../openssl-0.9.8w/debian/rehash_pod.patch | 62 + .../openssl/openssl-0.9.8w/debian/series | 20 + .../debian/shared-lib-ext.patch | 16 + .../openssl-0.9.8w/debian/stddef.patch | 14 + .../debian/version-script.patch | 35 + .../openssl-0.9.8w/parallel-make-fix.patch | 20 + .../openssl/openssl-0.9.8w/shared-libs.patch | 50 + .../openssl/openssl_0.9.8w.bb | 38 + .../rtl8192cu/additional_productids.patch | 19 + .../realtek/rtl8192cu_3.3.0.bb | 29 + .../sabnzbd/sabnzbd/sabnzbd | 22 + .../sabnzbd/sabnzbd_0.5.6.bb | 43 + ...nt-Push-the-domain-and-netbios-name-.patch | 31 + .../samba/samba-3.0.37/configure.patch | 213 + .../samba/samba-3.0.37/kernel-oplocks.patch | 20 + .../samba-3.0-CVE-2012-0870.patch | 91 + .../samba-3.0.37-CVE-2012-1182.patch | 59 + .../samba-3.0.37/uclibc-strlcpy-strlcat.patch | 46 + .../samba/samba/01samba-kill | 5 + .../samba/samba/01samba-start | 3 + .../samba/samba/config-lfs.patch | 47 + .../recipes-connectivity/samba/samba/init | 58 + .../samba/samba/quota.patch | 11 + .../recipes-connectivity/samba/samba/smb.conf | 28 + .../recipes-connectivity/samba/samba/tdb.pc | 11 + .../samba/samba/volatiles.03_samba | 2 + .../samba/samba_3.0.37.bb | 20 + .../samba/samba_3.0.37.bbappend | 31 + .../upnp/libupnp_1.6.5.bb | 14 + .../ushare/files/remove-lsb-dependency.patch | 29 + .../ushare/ushare_1.1a.bb | 27 + .../vsftpd/vsftpd/01-builddefs.patch | 18 + .../vsftpd/vsftpd/02-config.patch | 120 + .../vsftpd/vsftpd/03-db-doc.patch | 19 + .../vsftpd/vsftpd/04-link-local.patch | 91 + .../vsftpd/vsftpd/05-whitespaces.patch | 81 + .../vsftpd/vsftpd/06-greedy.patch | 32 + .../vsftpd/vsftpd/07-utf8.patch | 58 + .../vsftpd/vsftpd/08-manpage.patch | 23 + .../vsftpd/vsftpd/09-s390.patch | 15 + .../vsftpd/vsftpd/10-remote-dos.patch | 69 + .../vsftpd/vsftpd/vsftpd.conf | 105 + .../vsftpd/vsftpd_2.3.5.bb | 89 + .../wakelan/wakelan_1.1.bb | 20 + .../wpa-supplicant-0.5.10/defconfig-gnutls | 176 + .../wpa-supplicant-0.5.10/driver-ralink.patch | 2167 + .../wpa-supplicant-0.5.10/driver-zydas.patch | 738 + .../wpa-supplicant-0.5.10/functions.sh | 841 + .../wpa-supplicant-0.5.10/ifupdown.sh | 132 + .../wpa-supplicant-0.7.3/action_wpa.sh | 50 + .../wpa-supplicant-0.7.3/functions.sh | 1015 + .../wpa-supplicant-0.7.3/ifupdown.sh | 172 + .../wpa-supplicant-0.7.3/wpa_action | 81 + .../wpa-supplicant-0.7.3/wpa_action.8 | 148 + .../wpa-supplicant/wpa-supplicant_0.5.10.bb | 73 + .../wpa-supplicant_0.7.3.bbappend | 40 + .../zd1211/zd1211b/cross_compile.patch | 41 + .../zd1211/zd1211b/zdiface.patch | 12 + .../zd1211/zd1211b_2.22.0.0.bb | 32 + .../zeroconf/zeroconf_0.9.bbappend | 5 + .../recipes-core/base-files/base-files/fstab | 5 + .../base-files/base-files_3.0.14.bbappend | 13 + ...pdown-support-post-up-pre-down-hooks.patch | 60 + ...work-around-linux-ext2_fs.h-breakage.patch | 50 + ...-use-our-own-copy-of-linux-ext2_fs.h.patch | 607 + .../0002-ifupdown-code-shrink.patch | 122 + ...linux_ext2_fs.h-use-existing-e2fspro.patch | 1877 + ...interface-from-state_list-if-iface_u.patch | 31 + ...support-metric-for-static-default-gw.patch | 64 + ...wn-improve-compatibility-with-Debian.patch | 97 + ...x_version_code-don-t-fail-on-3.0-foo.patch | 43 + .../busybox/busybox-1.19.4/defconfig | 1013 + .../recipes-core/busybox/busybox-1.19.4/inetd | 33 + .../busybox/busybox-1.19.4/inetd.conf | 22 + .../recipes-core/busybox/busybox-1.19.4/mdev | 11 + .../busybox/busybox-1.19.4/mdev-mount.sh | 99 + .../busybox/busybox-1.19.4/mdev.conf | 49 + .../busybox/busybox_1.19.4.bbappend | 39 + .../libsigc++-1.2-1.2.5/autofoo.patch | 125 + .../libsigc++-1.2-1.2.5/fix-install.patch | 15 + .../libsigc++-1.2-1.2.5/pkgconfig.patch | 13 + .../libsigc++-1.2-1.2.5/to_1.2.7.patch | 159 + .../libsigc++-1.2/libsigc++-1.2_1.2.5.bb | 21 + .../sysvinit/sysvinit-inittab/inittab | 32 + .../sysvinit/sysvinit-inittab_2.88dsf.bb | 20 + .../udev-124/41-od-linux-2.6.18-misc.rules | 21 + .../udev/udev-124/50-hostap_cs.rules | 4 + .../recipes-core/udev/udev-124/default | 4 + .../udev/udev-124/devfs-udev.rules | 108 + .../recipes-core/udev/udev-124/flags.patch | 56 + meta-openpli/recipes-core/udev/udev-124/init | 79 + .../udev/udev-124/libvolume-id-soname.patch | 12 + .../recipes-core/udev/udev-124/links.conf | 24 + .../recipes-core/udev/udev-124/local.rules | 32 + .../udev/udev-124/mount.blacklist | 3 + .../recipes-core/udev/udev-124/mount.sh | 72 + .../udev-124/mtd-exclude-persistent.patch | 13 + .../recipes-core/udev/udev-124/network.sh | 60 + .../udev/udev-124/noasmlinkage.patch | 45 + .../udev/udev-124/permissions.rules | 119 + .../recipes-core/udev/udev-124/run.rules | 14 + .../udev/udev-124/udev-compat-wrapper-patch | 35 + .../recipes-core/udev/udev-124/udev.rules | 113 + .../udev/udev-124/udev_network_queue.sh | 35 + .../udev/udev-124/udevsynthesize.patch | 776 + .../udev/udev-124/udevsynthesize.sh | 51 + .../udevtrigger_add_devname_filtering.patch | 99 + .../udev/udev-124/vol_id_ld.patch | 17 + meta-openpli/recipes-core/udev/udev-182/init | 45 + meta-openpli/recipes-core/udev/udev_124.bb | 70 + meta-openpli/recipes-core/udev/udev_124.inc | 102 + .../recipes-core/udev/udev_182.bbappend | 18 + .../recipes-devtools/devshell/devshell.bb | 69 + .../opkg/opkg/sanity-check-provides.patch | 12 + .../recipes-devtools/opkg/opkg_svn.bbappend | 5 + .../python/python-coherence_git.bb | 33 + .../python/python-daap/python-daap.patch | 57 + .../python/python-daap_0.7.1.bb | 17 + .../python/python-daap_0.7.1.bbappend | 5 + .../python/python-flickrapi_1.4.2.bb | 25 + .../python/python-gdata_2.0.14.bb | 21 + .../python/python-mutagen/patch.diff | 12 + .../python/python-mutagen_1.18.bb | 22 + .../python/python-native_2.7.2.bbappend | 4 + .../python-pycrypto/no-usr-include.patch | 11 + .../python/python-pycrypto_2.5.bb | 17 + .../python/python-pysnmp-se_3.5.2.bb | 16 + .../python/python-transmissionrpc_hg.bb | 14 + .../python/python-twisted_12.0.0.bb | 256 + .../python/python-wifi_0.5.0.bb | 31 + .../python/python-yenc_0.3.bb | 17 + .../python-zopeinterface_3.5.1.bbappend | 21 + .../python/ctypes-error-handling-fix.patch | 40 + .../python/python/fix_pthread_site.patch | 38 + .../python/python/no-ldconfig.patch | 23 + .../python/python/some_configure_fixes.patch | 32 + .../python/python_2.7.2.bbappend | 30 + .../python/twistedsnmp_0.3.13.bb | 16 + .../recipes-devtools/swig/swig_2.0.4.bb | 11 + .../hddtemp/hddtemp-no-nls-support.patch | 66 + .../hddtemp/hddtemp_0.3-beta15.bb | 22 + .../irqbalance/irqbalance_0.56.bb | 12 + meta-openpli/recipes-extended/joe/joe_3.7.bb | 14 + .../recipes-extended/ncdu/ncdu_1.8.bb | 11 + .../recipes-extended/sdparm/sdparm_1.07.bb | 11 + .../shadow/shadow-securetty/securetty | 275 + .../shadow/shadow-securetty_4.1.4.3.bbappend | 3 + .../smartmontools/smartmontools.inc | 10 + .../smartmontools/smartmontools_5.42.bb | 6 + .../tzdata/tzdata_2012b.bbappend | 76 + .../linux-firmwares/firmware-af9005.bb | 10 + .../firmware-as102-data1-st.bb | 10 + .../firmware-as102-data2-st.bb | 12 + .../firmware-atheros-ar9271.bb | 11 + .../firmware-carl9170_1.9.5.bb | 11 + .../linux-firmwares/firmware-drx397xd.a2.bb | 10 + .../linux-firmwares/firmware-drx397xd.b1.bb | 10 + .../linux-firmwares/firmware-drxd-a2-1.1.bb | 10 + .../linux-firmwares/firmware-drxd-b1-1.1.bb | 10 + .../linux-firmwares/firmware-dvb-fe-af9013.bb | 10 + .../linux-firmwares/firmware-dvb-fe-ds3000.bb | 10 + .../firmware-dvb-fe-tda10071.bb | 10 + .../firmware-dvb-fe-xc5000-1.1.bb | 10 + .../firmware-dvb-fe-xc5000-1.6.114.bb | 10 + .../firmware-dvb-nova-12mhz-b0.bb | 10 + .../linux-firmwares/firmware-dvb-siano.bb | 13 + .../firmware-dvb-usb-adstech-usb2-02.bb | 10 + .../firmware-dvb-usb-af9015.bb | 10 + .../firmware-dvb-usb-af9035-01.bb | 10 + .../firmware-dvb-usb-avertv-a800-02.bb | 10 + .../firmware-dvb-usb-bluebird-01.bb | 10 + .../firmware-dvb-usb-bluebird-02.bb | 10 + .../firmware-dvb-usb-dib0700-01.bb | 10 + .../firmware-dvb-usb-dib0700-03-pre1.bb | 10 + .../firmware-dvb-usb-dib0700-1.10.bb | 10 + .../firmware-dvb-usb-dib0700-1.20.bb | 10 + .../firmware-dvb-usb-dibusb-5.0.0.11.bb | 10 + .../firmware-dvb-usb-dibusb-6.0.0.8.bb | 10 + .../firmware-dvb-usb-dibusb-an2235-01.bb | 10 + .../firmware-dvb-usb-digitv-02.bb | 10 + .../firmware-dvb-usb-digivox-02.bb | 10 + .../firmware-dvb-usb-dposh-01.bb | 10 + .../firmware-dvb-usb-dtt200u-01.bb | 10 + .../linux-firmwares/firmware-dvb-usb-ec168.bb | 10 + .../firmware-dvb-usb-it9135.bb | 10 + .../firmware-dvb-usb-it913x.bb | 12 + .../firmware-dvb-usb-megasky-02.bb | 10 + .../firmware-dvb-usb-nova-t-usb2-01.bb | 10 + .../firmware-dvb-usb-nova-t-usb2-02.bb | 10 + .../linux-firmwares/firmware-dvb-usb-s660.bb | 10 + .../firmware-dvb-usb-tvwalkert.bb | 10 + .../firmware-dvb-usb-umt-010-02.bb | 10 + .../firmware-dvb-usb-wt220u-02.bb | 10 + .../firmware-dvb-usb-wt220u-fc03.bb | 10 + .../firmware-dvb-usb-wt220u-miglia-01.bb | 10 + .../firmware-dvb-usb-wt220u-zl0353-01.bb | 10 + .../linux-firmwares/firmware-htc7010.bb | 10 + .../linux-firmwares/firmware-htc9271.bb | 10 + .../firmware-isdbt-nova-12mhz-b0.bb | 10 + .../firmware-marvell-sd8688_10.38.1-p25.bb | 11 + .../linux-firmwares/firmware-rt2870.bb | 10 + .../linux-firmwares/firmware-rt73.bb | 10 + .../linux-firmwares/firmware-rtl8192cu.bb | 10 + .../linux-firmwares/firmware-rtl8712u.bb | 10 + .../firmware-sms1xxx-hcw-114xxx-cmmb-01.bb | 10 + .../firmware-sms1xxx-hcw-55xxx-dvbt-01.bb | 10 + .../firmware-sms1xxx-hcw-55xxx-dvbt-02.bb | 10 + .../firmware-sms1xxx-hcw-55xxx-dvbt-03.bb | 10 + .../firmware-sms1xxx-hcw-55xxx-isdbt-02.bb | 10 + .../firmware-sms1xxx-hcw-55xxx-isdbt-03.bb | 10 + .../firmware-sms1xxx-nova-a-dvbt-01.bb | 10 + .../firmware-sms1xxx-nova-b-dvbt-01.bb | 10 + .../firmware-xc3028-dvico-au-01.bb | 10 + .../linux-firmwares/firmware-xc3028-v27.bb | 10 + .../linux-firmwares/firmware-xc3028l-v36.bb | 10 + .../linux-firmwares/firmware-zd1211.bb | 10 + .../linux-firmwares/linux-firmware.inc | 11 + .../linux-libc-headers/linux-libc-headers.inc | 66 + .../connector-msg-size-fix.patch | 29 + .../linux-libc-headers_3.3.bb | 6 + .../brcmnand-buildfix.patch | 12 + ...nd-fixed-corr-uncorr-error-detection.patch | 70 + ...and-fixed-non-hwecc-first-workaround.patch | 321 + .../linux-dreambox-3.2/clear_sublevel.patch | 11 + .../linux-dreambox-3.2/dm500hd/defconfig | 2938 + .../linux-dreambox-3.2/dm7020hd/defconfig | 2942 + .../linux/linux-dreambox-3.2/dm8000/defconfig | 2958 + .../linux-dreambox-3.2/dm800se/defconfig | 2939 + .../fadvise_dontneed_change.patch | 142 + .../linux-dreambox-3.2/fix-proc-cputype.patch | 22 + .../linux-dreambox-3.2/make-3.82-hack.patch | 48 + .../rtl8712-backport-a.patch | 56 + .../rtl8712-backport-b.patch | 35 + .../rtl8712-backport-c.patch | 45 + .../rtl8712-backport-d.patch | 41 + .../threaded-interrupt-support.patch | 98 + .../recipes-linux/linux/linux-dreambox.inc | 58 + .../recipes-linux/linux/linux-dreambox_3.2.bb | 37 + .../add-dmx-source-timecode.patch | 14 + .../af9015-output-full-range-SNR.patch | 39 + .../as102-adjust-signal-strength-report.patch | 31 + .../as102-backports-from-kernel-3.4.patch | 462 + .../as102-scale-MER-to-full-range.patch | 68 + .../linux-etxx00/cinergy_s2_usb_r2.patch | 57 + ...ion-to-break-out-from-wait-lock-loop.patch | 30 + .../cxd2820r-enable-LNA-for-DVB-T.patch | 17 + .../cxd2820r-output-full-range-SNR.patch | 155 + .../linux/linux-etxx00/disable_early_fb.patch | 11 + .../linux/linux-etxx00/dvb-usb-a867.patch | 44121 +++++++ .../linux/linux-etxx00/dvb-usb-af9035.patch | 15495 +++ .../linux/linux-etxx00/dvb-usb-rtl2832.patch | 101202 +++++++++++++++ ...top-URBs-when-stopping-the-streaming.patch | 87 + ...re-allocate-DVB-iso-transfer-buffers.patch | 447 + ...e-allocate-DVB-isoc-transfer-buffers.patch | 454 + .../linux/linux-etxx00/et5x00/defconfig | 2877 + .../linux/linux-etxx00/et6x00/defconfig | 2877 + .../linux/linux-etxx00/et9x00/defconfig | 2877 + .../linux/linux-etxx00/fix-proc-cputype.patch | 13 + .../linux-etxx00/iosched-slice_idle-1.patch | 15 + .../it913x-backports-from-kernel-3.4.patch | 730 + .../it913x-backports-from-kernel-3.5.patch | 108 + ...13x-switch-off-PID-filter-by-default.patch | 29 + .../rtl8712-release-firmware-fix.patch | 44 + .../tda10071-BUGFIX-delivery-system.patch | 21 + .../linux-etxx00/tda18218-7mhz-lopass.patch | 16 + .../recipes-linux/linux/linux-etxx00_3.3.0.bb | 81 + meta-openpli/recipes-linux/linux/linux.inc | 263 + .../recipes-multimedia/aio-grab/aio-grab.bb | 18 + .../cdparanoia/cdparanoia/Makefile.in.patch | 13 + .../cdparanoia-III-10.2-privatefix.patch | 561 + .../cdparanoia/cdparanoia/configure.in.patch | 13 + .../cdparanoia/cdparanoia/fixes10.patch | 25 + .../cdparanoia/interface_Makefile.in.patch | 11 + .../cdparanoia/paranoia_Makefile.in.patch | 11 + .../cdparanoia/cdparanoia_svn.bb | 43 + .../recipes-multimedia/dvbsnoop/dvbsnoop.bb | 13 + .../dvb-apps-1.1.1/update-to-tip.diff | 37589 ++++++ .../dvb-apps-1.1.1/update-to-trunk.diff | 84321 ++++++++++++ .../dvbtools/dvb-apps_1.1.1.bb | 112 + .../dvbtools/dvbstream_cvs.bb | 18 + .../dvbtools/dvbtune_cvs.bb | 23 + .../dvbtools/wscan_20101204.bb | 15 + .../dvdbackup/dvdbackup_0.4.1.bb | 14 + .../fuse/dvdfs/crosscompile.patch | 27 + .../fuse/dvdfs/defaultdevicesr0.patch | 13 + .../recipes-multimedia/fuse/dvdfs_0.2.bb | 21 + .../gstreamer/gst-plugin-dvbmediasink.bb | 28 + ...mux-fix-bd-streamtype-detection.diff.patch | 201 + ...abilities-to-generate-a-SPN-PTS-map-.patch | 423 + .../0003-mpegpsdemux_speedup.diff.patch | 112 + .../gst-plugins-bad_0.10.23.bbappend | 16 + .../gst-plugins-base_0.10.36.bbappend | 6 + .../audioparser-raise-ranks.patch | 19 + .../gst-plugins-good_0.10.31.bbappend | 10 + .../dvdsubdec-addproperty-singlebuffer.patch | 103 + .../gst-plugins-ugly_0.10.19.bbappend | 9 + .../recipes-multimedia/libao/libao_0.8.8.bb | 40 + .../libcddb/libcddb_1.3.2.bb | 18 + .../libdreamdvd/libdreamdvd_0.9.bb | 8 + .../libdvbsi++/libdvbsi++_0.3.6.bb | 12 + ...avmini.pc-link-against-libdvdnavmini.patch | 25 + .../libdvdnav/libdvdnav_svn.bb | 24 + .../libdvdread/libdvdread_svn.bb | 13 + .../libungif/libungif-native_4.1.3.bb | 7 + .../libungif/libungif_4.1.3.bb | 16 + .../mjpegtools-2.0.0/no-includedir.patch | 63 + .../mjpegtools/mjpegtools_2.0.0.bb | 23 + .../recipes-multimedia/musicpd/mpd/mpd.conf | 338 + .../recipes-multimedia/musicpd/mpd/mpd.init | 32 + .../musicpd/mpd/openpli/mpd.conf | 338 + .../musicpd/mpd/save-volume-state.patch | 31 + .../recipes-multimedia/musicpd/mpd_0.16.6.bb | 54 + .../opencore-amr/opencore-amr_0.1.2.bb | 15 + .../pngcrush/pngcrush_1.7.16.bb | 26 + .../recipes-multimedia/rtmp/librtmp.bb | 25 + .../showiframe/showiframe.bb | 21 + .../showiframe/showiframe/showiframe.c | 94 + .../streamripper/streamripper_1.64.6.bb | 17 + .../tuxbox/tuxbox-common_0.1.bb | 39 + .../recipes-multimedia/tuxtxt/libtuxtxt.bb | 21 + .../tuxtxt/tuxtxt-enigma2.bb | 26 + .../recipes-multimedia/vlc/libaacs_git.bb | 14 + .../recipes-multimedia/vlc/libbluray_git.bb | 13 + .../recipes-multimedia/vlc/libdca_0.0.5-5.bb | 20 + meta-openpli/recipes-openpli/ambx/ambx.bb | 31 + .../ambx/enigma2-plugin-extensions-ambx.bb | 35 + .../recipes-openpli/ambx/python-pyambx.bb | 19 + .../bootlogo/openpli-bootlogo.bb | 77 + .../bootlogo/openpli-bootlogo/bootlogo-hd.mvi | Bin 0 -> 99877 bytes .../bootlogo/openpli-bootlogo/bootlogo.jpg | Bin 0 -> 457522 bytes .../bootlogo/openpli-bootlogo/bootlogo.mvi | Bin 0 -> 99877 bytes .../bootlogo/openpli-bootlogo/bootlogo.sh | 8 + .../bootlogo/openpli-bootlogo/switchoff.mvi | Bin 0 -> 83210 bytes meta-openpli/recipes-openpli/e2openplugins | 1 + .../channelsettings-enigma2-meta.bb | 23 + .../enigma2-channelsettings/e2settings.inc | 23 + ...-hans-13e-19e-23e-28e-rotating_20120501.bb | 8 + ...-settings-hans-13e-19e-23e-28e_20120501.bb | 8 + ...2-plugin-settings-hans-19e-23e_20120501.bb | 8 + ...ksat-13e-19e-23e-28e-4.8e-0.8w_20120201.bb | 8 + ...ttings-henksat-13e-19e-23e-28e_20120201.bb | 8 + ...lugin-settings-henksat-13e-19e_20120201.bb | 8 + ...n-settings-henksat-19e-23e-28e_20120201.bb | 8 + ...lugin-settings-henksat-19e-23e_20120201.bb | 8 + ...a2-plugin-settings-henksat-19e_20120201.bb | 8 + ...henksat-7e-13e-19e-23e-28e-42e_20110919.bb | 8 + ...ugin-settings-henksat-rotating_20120201.bb | 8 + ...-settings-henksat-wavefrontier_20120201.bb | 8 + ...in-settings-rytec-13e19e23e28e_20120502.bb | 8 + ...a2-plugin-settings-rytec-motor_20120502.bb | 8 + .../bouquets | 324 + .../services | 1041 + .../userbouquet.dbe00.radio | 21 + .../userbouquet.dbe00.tv | 19 + .../userbouquet.dbe01.radio | 19 + .../userbouquet.dbe01.tv | 18 + .../userbouquet.dbe02.radio | 9 + .../userbouquet.dbe02.tv | 3 + .../userbouquet.dbe03.radio | 22 + .../userbouquet.dbe03.tv | 9 + .../userbouquet.dbe04.radio | 21 + .../userbouquet.dbe04.tv | 9 + .../userbouquet.dbe05.radio | 22 + .../userbouquet.dbe05.tv | 4 + .../userbouquet.dbe06.tv | 5 + .../userbouquet.dbe07.tv | 10 + .../userbouquet.dbe08.tv | 9 + .../userbouquet.dbe09.tv | 12 + .../userbouquet.dbe10.tv | 17 + .../userbouquet.dbe11.tv | 8 + .../userbouquet.dbe12.tv | 15 + .../userbouquet.dbe13.tv | 3 + .../userbouquet.dbe14.tv | 9 + .../userbouquet.dbe15.tv | 6 + .../userbouquet.dbe16.tv | 17 + .../userbouquet.dbe17.tv | 5 + .../userbouquet.dbe18.tv | 3 + .../userbouquet.dbe19.tv | 13 + .../userbouquet.dbe20.tv | 5 + .../userbouquet.dbe21.tv | 10 + .../userbouquets.radio.epl | 19 + .../userbouquets.tv.epl | 67 + ...gin-settings-ziggo-casema-west_20110326.bb | 24 + .../enigma2-channelsettings/hans.inc | 9 + .../enigma2-channelsettings/henksat.inc | 9 + .../rytec-settings.inc | 22 + .../enigma2-channelsettings/settings.inc | 44 + ...enigma2-plugin-extensions-et-livestream.bb | 26 + .../enigma2-et-plugins/gst-plugin-libxt.bb | 21 + .../enigma2-plugin-picons-sat_20110907.bb | 23 + ...ma2-plugin-picons-ziggo.casema_20120520.bb | 10 + ...ma2-plugin-picons-ziggo.tvhome_20120320.bb | 10 + .../enigma2-picons/enigma2-plugin-picons.inc | 90 + .../enigma2-picons/picons-enigma2-meta.bb | 9 + .../enigma2-softcams/cardserver-support.bb | 25 + .../enigma2-softcams/cardserver.inc | 86 + .../enigma2-softcams/cardserveroscam.inc | 102 + .../enigma2-softcams/cccam-old.inc | 22 + .../enigma2-plugin-softcams-cccam/CCcam.xml | 13 + .../enigma2-plugin-softcams-cccam/plimgr.conf | 4 + .../enigma2-plugin-softcams-cccam209_2.0.9.bb | 6 + .../enigma2-plugin-softcams-cccam221_2.2.1.bb | 6 + .../enigma2-plugin-softcams-cccam_2.3.0.bb | 28 + .../CustomCAM | 6 + .../enigma2-plugin-softcams-evocamd_2.17.bb | 30 + .../enigma2-plugin-softcams-mgcamd_1.30d.bb | 49 + .../enigma2-plugin-softcams-newcs_1.67RC1.bb | 32 + ...2-plugin-softcams-oscam-experimental-cs.bb | 25 + .../config/oscam-experimental/oscam.ac | 7 + .../config/oscam-experimental/oscam.cert | 6 + .../config/oscam-experimental/oscam.conf | 91 + .../config/oscam-experimental/oscam.dvbapi | 28 + .../config/oscam-experimental/oscam.guess | 6 + .../config/oscam-experimental/oscam.ird | 7 + .../config/oscam-experimental/oscam.pem | 37 + .../config/oscam-experimental/oscam.provid | 33 + .../config/oscam-experimental/oscam.server | 105 + .../config/oscam-experimental/oscam.services | 23 + .../config/oscam-experimental/oscam.srvid | 172 + .../config/oscam-experimental/oscam.tiers | 7 + .../config/oscam-experimental/oscam.user | 49 + ...gma2-plugin-softcams-oscam-experimental.bb | 10 + ...enigma2-plugin-softcams-oscam-stable-cs.bb | 25 + .../config/oscam-stable/oscam.ac | 7 + .../config/oscam-stable/oscam.cert | 6 + .../config/oscam-stable/oscam.conf | 91 + .../config/oscam-stable/oscam.dvbapi | 28 + .../config/oscam-stable/oscam.guess | 6 + .../config/oscam-stable/oscam.ird | 7 + .../config/oscam-stable/oscam.pem | 37 + .../config/oscam-stable/oscam.provid | 33 + .../config/oscam-stable/oscam.server | 105 + .../config/oscam-stable/oscam.services | 23 + .../config/oscam-stable/oscam.srvid | 172 + .../config/oscam-stable/oscam.tiers | 7 + .../config/oscam-stable/oscam.user | 49 + .../enigma2-plugin-softcams-oscam-stable.bb | 10 + ...igma2-plugin-softcams-oscam-unstable-cs.bb | 25 + .../config/oscam-unstable/oscam.ac | 7 + .../config/oscam-unstable/oscam.cert | 6 + .../config/oscam-unstable/oscam.conf | 91 + .../config/oscam-unstable/oscam.dvbapi | 28 + .../config/oscam-unstable/oscam.guess | 6 + .../config/oscam-unstable/oscam.ird | 7 + .../config/oscam-unstable/oscam.pem | 37 + .../config/oscam-unstable/oscam.provid | 33 + .../config/oscam-unstable/oscam.server | 105 + .../config/oscam-unstable/oscam.services | 23 + .../config/oscam-unstable/oscam.srvid | 172 + .../config/oscam-unstable/oscam.tiers | 7 + .../config/oscam-unstable/oscam.user | 49 + .../enigma2-plugin-softcams-oscam-unstable.bb | 10 + .../enigma2-plugin-softcams-rqcamd_1.31.bb | 23 + .../enigma2-plugin-softcams-scam_3.53.bb | 25 + .../enigma2-softcams/files/oscam.ac | 7 + .../enigma2-softcams/files/oscam.cert | 6 + .../enigma2-softcams/files/oscam.conf | 92 + .../enigma2-softcams/files/oscam.dvbapi | 36 + .../enigma2-softcams/files/oscam.guess | 6 + .../enigma2-softcams/files/oscam.ird | 7 + .../enigma2-softcams/files/oscam.pem | 37 + .../enigma2-softcams/files/oscam.provid | 33 + .../enigma2-softcams/files/oscam.server | 105 + .../enigma2-softcams/files/oscam.services | 23 + .../enigma2-softcams/files/oscam.srvid | 172 + .../enigma2-softcams/files/oscam.tiers | 7 + .../enigma2-softcams/files/oscam.user | 49 + .../enigma2-softcams/oscam-bin.inc | 54 + .../enigma2-softcams/oscam-experimental.bb | 13 + .../enigma2-softcams/oscam-stable.bb | 12 + .../enigma2-softcams/oscam-unstable.bb | 12 + .../enigma2-softcams/softcam-support.bb | 27 + .../enigma2-softcams/softcam.inc | 95 + .../enigma2-softcams/softcamoscam.inc | 117 + .../enigma2-softcams/softcams-enigma2-meta.bb | 22 + .../enigma2/3rd-party-feed-configs.bb | 21 + .../enigma2/early-configure.bb | 14 + .../early-configure/early-configure.sh | 5 + .../enigma2/enigma2-pliplugins.bb | 51 + .../enigma2-pliplugins/pythonpaths.patch | 54 + .../enigma2-plugin-drivers-usbserial.bb | 10 + .../enigma2-plugin-extensions-tuxcom.bb | 30 + .../add_advanced_rc.diff | 92 + .../enigma2-plugin-extensions-tuxterm.bb | 17 + ...n-extensions-xmltvimport-rytec_20120123.bb | 29 + .../enigma2-plugin-extensions-xmltvimport.bb | 69 + .../enigma2-plugin-security-firewall.bb | 25 + .../firewall.sh | 95 + .../firewall.users | 3 + .../enigma2/enigma2-plugin-skins-magic.bb | 34 + .../enigma2/enigma2-plugin-skins-pli-hd.bb | 36 + .../enigma2/enigma2-plugins.bb | 105 + .../recipes-openpli/enigma2/enigma2-skins.bb | 40 + .../enigma2/enigma2-skins/blackbox.diff | 28 + .../enigma2/enigma2-skins/brushedaluhd.diff | 14 + .../enigma2/enigma2-skins/dtvhd.diff | 40 + .../recipes-openpli/enigma2/enigma2.bb | 187 + .../enigma2/gst-plugin-subsink.bb | 25 + .../enigma2/hotplug-e2-helper.bb | 22 + .../recipes-openpli/enigma2/kernel-params.bb | 17 + .../enigma2/kernel-params/sysctl.conf | 3 + .../enigma2/settings-autorestore.bb | 35 + .../settings-autorestore/autoinstall.sh | 69 + .../settings-restore.old.sh | 59 + .../settings-autorestore/settings-restore.sh | 106 + .../recipes-openpli/enigma2/tuxbox-links.bb | 21 + .../recipes-openpli/enigma2/tuxterm.bb | 20 + .../recipes-openpli/enigma2/usbserial.bb | 9 + .../recipes-openpli/fakelocale/fakelocale.bb | 37 + .../fakelocale/files/lctimelocales.tar.gz | Bin 0 -> 21406 bytes .../fakelocale/files/locale.alias | 35 + .../images/openpli-enigma2-feed.bb | 7 + .../images/openpli-enigma2-image.bb | 90 + .../recipes-openpli/images/openpli-image.bb | 55 + .../volatile-media/volatile-media.bb | 25 + .../volatile-media/volatile-media.sh | 16 + .../recipes-support/libpar2/libpar2_0.2.bb | 15 + .../libxmlccwrap/files/disable_libxslt.patch | 96 + .../files/dont_build_unneeded.patch | 6 + .../files/fix_assignment_operator.patch | 10 + .../libxmlccwrap/libxmlccwrap_0.0.12.bb | 21 + .../par2cmdline/par2-softlink.patch | 17 + .../par2cmdline/par2cmdline-0.4-gcc4.patch | 62 + .../par2cmdline/par2cmdline_0.4.bb | 20 + .../unrar/files/makefile-nostrip.patch | 13 + .../unrar/files/makefile.unix.patch | 21 + .../recipes-support/unrar/unrar_4.0.4.bb | 27 + openembedded-core | 1 + 669 files changed, 356231 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 Makefile create mode 160000 bitbake create mode 160000 meta-openembedded create mode 100644 meta-openpli/classes/git-project.bbclass create mode 100644 meta-openpli/classes/image_types_nfi.bbclass create mode 100644 meta-openpli/classes/openpli-distutils.bbclass create mode 100644 meta-openpli/classes/schwerkraft-git.bbclass create mode 100644 meta-openpli/conf/distro/include/openpli-unstable-versions.inc create mode 100644 meta-openpli/conf/distro/openpli.conf create mode 100644 meta-openpli/conf/layer.conf create mode 100644 meta-openpli/conf/license/openpli-gplv2.inc create mode 100644 meta-openpli/conf/machine/dm500hd.conf create mode 100644 meta-openpli/conf/machine/dm7020hd.conf create mode 100644 meta-openpli/conf/machine/dm8000.conf create mode 100644 meta-openpli/conf/machine/dm800se.conf create mode 100644 meta-openpli/conf/machine/et5x00.conf create mode 100644 meta-openpli/conf/machine/et6x00.conf create mode 100644 meta-openpli/conf/machine/et9x00.conf create mode 100644 meta-openpli/conf/machine/include/dreambox-brcmnand.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-hw-ecc.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-jffs2-sum.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-jffs2.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-legacy-wlan.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-mips32el-nf.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-mips32el.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-nand-1024mb.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-nand-256mb.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-nand-64mb.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-part-256mb.inc create mode 100644 meta-openpli/conf/machine/include/dreambox-part-64mb.inc create mode 100644 meta-openpli/conf/machine/include/dreambox.inc create mode 100644 meta-openpli/conf/machine/include/etxx00.inc create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-blindscan-utils_1.7.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-buildimage_1.4.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm500hd_3.2-20120415.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm7020hd_3.2-20120415.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm8000_3.2-20120417.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm800se_3.2-20120415.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules.inc create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm500hd/modules create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm7020hd/modules create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm8000/modules create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm800se/modules create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-base.inc create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm500hd_84.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm7020hd_86.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm8000_84.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm800se_84.bb create mode 100644 meta-openpli/recipes-bsp/dreambox/dreambox-secondstage.inc create mode 100644 meta-openpli/recipes-bsp/etxx00/et-blindscan-dvbs-utils.bb create mode 100644 meta-openpli/recipes-bsp/etxx00/et-dvb-modules.bb create mode 100644 meta-openpli/recipes-bsp/etxx00/et-fpupdate.bb create mode 100644 meta-openpli/recipes-bsp/vuplus/vuplus-blindscan-utils.bb create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/020_auto_net_path_sortlocale_mountoptions.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/037_let_debian_rules_decide_on_CFLAGS.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/042_default_auto_master_all_commented_out.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/060_non_replicated_ping.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/061_multi_parse_fix.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/062_fix_memory_leak.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/063_misc_fixes.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/064_support_options_on_nis_maps.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/065_fix_master_map_in_ldap.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/066_canonicalise_mount_points.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_allow_disabling_bind_mounts.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_ldap_no_first_message.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/068_fix_invalid_rpcgen_code.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/069_support_spaces_in_smb_share_names.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/070_fix_regex_typo.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/071_fix_ldap_mounts.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/072_fix_auto_net_sort.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/073_configurable_locking.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/074_auto_smb_cifs.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/075_auto_net_escape_hash.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/076_ldap_deprecated.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/078_locking_fix_1.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/079_no_unlink_upstream.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/080_auto_smb_probe_credentials.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/081_auto_net_showmount_quotes.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/082_samples_makefile_typo.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/083_clarify_program_map_outputsyntax.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/084_init_lsb_header.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/085_auto_net_lp111612.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/Makefile.rules-cross.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.hotplug create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.master create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.network create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.default create mode 100755 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.init create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/cross.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/install.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/no-bash.patch create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/volatiles.99_autofs create mode 100644 meta-openpli/recipes-connectivity/autofs/autofs_4.1.4.bb create mode 100644 meta-openpli/recipes-connectivity/bluez/bluez4_4.99.bbappend create mode 100644 meta-openpli/recipes-connectivity/ctorrent/ctorrent.inc create mode 100644 meta-openpli/recipes-connectivity/ctorrent/ctorrent_3.3.1.bb create mode 100644 meta-openpli/recipes-connectivity/ctorrent/files/CVE-2009-1759.patch create mode 100644 meta-openpli/recipes-connectivity/ctorrent/files/extended_ctorrent.diff create mode 100755 meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn-mt.sh create mode 100644 meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn.conf create mode 100644 meta-openpli/recipes-connectivity/inadyn-mt/files/remove_host_include_paths.patch create mode 100644 meta-openpli/recipes-connectivity/inadyn-mt/inadyn-mt.bb create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/ath-rate-ctlname.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.1.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.2.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/fix-module-autoload.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/fix-target-mips32.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/madwifi-smp-affinity create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/remove-wprobe.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/files/set-affinity-hint.patch create mode 100644 meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r.inc create mode 100644 meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r3314-20080131.bb create mode 100644 meta-openpli/recipes-connectivity/minidlna/minidlna/default_sqlite_caches.diff create mode 100644 meta-openpli/recipes-connectivity/minidlna/minidlna_cvs.bb create mode 100644 meta-openpli/recipes-connectivity/ofono/ofono_1.5.bbappend create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.if-up create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-down create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-up create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.conf create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.if-down create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/volatiles.99_openresolv create mode 100644 meta-openpli/recipes-connectivity/openresolv/openresolv_3.5.2.bb create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/configure-targets.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/ca.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/config-hurd.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/debian-targets.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/engines-path.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/kfreebsd-pipe.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/make-targets.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-dir.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-section.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-rpath.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-symbolic.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/perl-path.diff create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pic.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pkg-config.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rc4-amd64.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash-crt.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash_pod.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/series create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/shared-lib-ext.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/stddef.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/version-script.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/parallel-make-fix.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/shared-libs.patch create mode 100644 meta-openpli/recipes-connectivity/openssl/openssl_0.9.8w.bb create mode 100644 meta-openpli/recipes-connectivity/realtek/rtl8192cu/additional_productids.patch create mode 100644 meta-openpli/recipes-connectivity/realtek/rtl8192cu_3.3.0.bb create mode 100644 meta-openpli/recipes-connectivity/sabnzbd/sabnzbd/sabnzbd create mode 100644 meta-openpli/recipes-connectivity/sabnzbd/sabnzbd_0.5.6.bb create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/0001-s3-schannel-client-Push-the-domain-and-netbios-name-.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/configure.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/kernel-oplocks.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0-CVE-2012-0870.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0.37-CVE-2012-1182.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba-3.0.37/uclibc-strlcpy-strlcat.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba/01samba-kill create mode 100644 meta-openpli/recipes-connectivity/samba/samba/01samba-start create mode 100644 meta-openpli/recipes-connectivity/samba/samba/config-lfs.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba/init create mode 100644 meta-openpli/recipes-connectivity/samba/samba/quota.patch create mode 100644 meta-openpli/recipes-connectivity/samba/samba/smb.conf create mode 100644 meta-openpli/recipes-connectivity/samba/samba/tdb.pc create mode 100644 meta-openpli/recipes-connectivity/samba/samba/volatiles.03_samba create mode 100644 meta-openpli/recipes-connectivity/samba/samba_3.0.37.bb create mode 100644 meta-openpli/recipes-connectivity/samba/samba_3.0.37.bbappend create mode 100644 meta-openpli/recipes-connectivity/upnp/libupnp_1.6.5.bb create mode 100644 meta-openpli/recipes-connectivity/ushare/files/remove-lsb-dependency.patch create mode 100644 meta-openpli/recipes-connectivity/ushare/ushare_1.1a.bb create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/01-builddefs.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/02-config.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/03-db-doc.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/04-link-local.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/05-whitespaces.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/06-greedy.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/07-utf8.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/08-manpage.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/09-s390.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/10-remote-dos.patch create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd/vsftpd.conf create mode 100644 meta-openpli/recipes-connectivity/vsftpd/vsftpd_2.3.5.bb create mode 100644 meta-openpli/recipes-connectivity/wakelan/wakelan_1.1.bb create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/defconfig-gnutls create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-ralink.patch create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-zydas.patch create mode 100755 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/functions.sh create mode 100755 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/ifupdown.sh create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/action_wpa.sh create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/functions.sh create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/ifupdown.sh create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action.8 create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.5.10.bb create mode 100644 meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bbappend create mode 100644 meta-openpli/recipes-connectivity/zd1211/zd1211b/cross_compile.patch create mode 100644 meta-openpli/recipes-connectivity/zd1211/zd1211b/zdiface.patch create mode 100644 meta-openpli/recipes-connectivity/zd1211/zd1211b_2.22.0.0.bb create mode 100644 meta-openpli/recipes-connectivity/zeroconf/zeroconf_0.9.bbappend create mode 100644 meta-openpli/recipes-core/base-files/base-files/fstab create mode 100644 meta-openpli/recipes-core/base-files/base-files_3.0.14.bbappend create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-ifupdown-support-post-up-pre-down-hooks.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-work-around-linux-ext2_fs.h-breakage.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-Create-and-use-our-own-copy-of-linux-ext2_fs.h.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-ifupdown-code-shrink.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-Drop-include-bb_linux_ext2_fs.h-use-existing-e2fspro.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-ifupdown-remove-interface-from-state_list-if-iface_u.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0004-ifupdown-support-metric-for-static-default-gw.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0005-ifupdown-improve-compatibility-with-Debian.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/0006-get_linux_version_code-don-t-fail-on-3.0-foo.patch create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/defconfig create mode 100755 meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd.conf create mode 100755 meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev-mount.sh create mode 100644 meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev.conf create mode 100644 meta-openpli/recipes-core/busybox/busybox_1.19.4.bbappend create mode 100644 meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/autofoo.patch create mode 100644 meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/fix-install.patch create mode 100644 meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/pkgconfig.patch create mode 100644 meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/to_1.2.7.patch create mode 100644 meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2_1.2.5.bb create mode 100644 meta-openpli/recipes-core/sysvinit/sysvinit-inittab/inittab create mode 100644 meta-openpli/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb create mode 100644 meta-openpli/recipes-core/udev/udev-124/41-od-linux-2.6.18-misc.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/50-hostap_cs.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/default create mode 100644 meta-openpli/recipes-core/udev/udev-124/devfs-udev.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/flags.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/init create mode 100644 meta-openpli/recipes-core/udev/udev-124/libvolume-id-soname.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/links.conf create mode 100644 meta-openpli/recipes-core/udev/udev-124/local.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/mount.blacklist create mode 100644 meta-openpli/recipes-core/udev/udev-124/mount.sh create mode 100644 meta-openpli/recipes-core/udev/udev-124/mtd-exclude-persistent.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/network.sh create mode 100644 meta-openpli/recipes-core/udev/udev-124/noasmlinkage.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/permissions.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/run.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/udev-compat-wrapper-patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/udev.rules create mode 100644 meta-openpli/recipes-core/udev/udev-124/udev_network_queue.sh create mode 100644 meta-openpli/recipes-core/udev/udev-124/udevsynthesize.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/udevsynthesize.sh create mode 100644 meta-openpli/recipes-core/udev/udev-124/udevtrigger_add_devname_filtering.patch create mode 100644 meta-openpli/recipes-core/udev/udev-124/vol_id_ld.patch create mode 100644 meta-openpli/recipes-core/udev/udev-182/init create mode 100644 meta-openpli/recipes-core/udev/udev_124.bb create mode 100644 meta-openpli/recipes-core/udev/udev_124.inc create mode 100644 meta-openpli/recipes-core/udev/udev_182.bbappend create mode 100644 meta-openpli/recipes-devtools/devshell/devshell.bb create mode 100644 meta-openpli/recipes-devtools/opkg/opkg/sanity-check-provides.patch create mode 100644 meta-openpli/recipes-devtools/opkg/opkg_svn.bbappend create mode 100644 meta-openpli/recipes-devtools/python/python-coherence_git.bb create mode 100644 meta-openpli/recipes-devtools/python/python-daap/python-daap.patch create mode 100644 meta-openpli/recipes-devtools/python/python-daap_0.7.1.bb create mode 100644 meta-openpli/recipes-devtools/python/python-daap_0.7.1.bbappend create mode 100644 meta-openpli/recipes-devtools/python/python-flickrapi_1.4.2.bb create mode 100644 meta-openpli/recipes-devtools/python/python-gdata_2.0.14.bb create mode 100644 meta-openpli/recipes-devtools/python/python-mutagen/patch.diff create mode 100644 meta-openpli/recipes-devtools/python/python-mutagen_1.18.bb create mode 100644 meta-openpli/recipes-devtools/python/python-native_2.7.2.bbappend create mode 100644 meta-openpli/recipes-devtools/python/python-pycrypto/no-usr-include.patch create mode 100644 meta-openpli/recipes-devtools/python/python-pycrypto_2.5.bb create mode 100644 meta-openpli/recipes-devtools/python/python-pysnmp-se_3.5.2.bb create mode 100644 meta-openpli/recipes-devtools/python/python-transmissionrpc_hg.bb create mode 100644 meta-openpli/recipes-devtools/python/python-twisted_12.0.0.bb create mode 100644 meta-openpli/recipes-devtools/python/python-wifi_0.5.0.bb create mode 100644 meta-openpli/recipes-devtools/python/python-yenc_0.3.bb create mode 100644 meta-openpli/recipes-devtools/python/python-zopeinterface_3.5.1.bbappend create mode 100644 meta-openpli/recipes-devtools/python/python/ctypes-error-handling-fix.patch create mode 100644 meta-openpli/recipes-devtools/python/python/fix_pthread_site.patch create mode 100644 meta-openpli/recipes-devtools/python/python/no-ldconfig.patch create mode 100644 meta-openpli/recipes-devtools/python/python/some_configure_fixes.patch create mode 100644 meta-openpli/recipes-devtools/python/python_2.7.2.bbappend create mode 100644 meta-openpli/recipes-devtools/python/twistedsnmp_0.3.13.bb create mode 100644 meta-openpli/recipes-devtools/swig/swig_2.0.4.bb create mode 100644 meta-openpli/recipes-extended/hddtemp/hddtemp/hddtemp-no-nls-support.patch create mode 100644 meta-openpli/recipes-extended/hddtemp/hddtemp_0.3-beta15.bb create mode 100644 meta-openpli/recipes-extended/irqbalance/irqbalance_0.56.bb create mode 100644 meta-openpli/recipes-extended/joe/joe_3.7.bb create mode 100644 meta-openpli/recipes-extended/ncdu/ncdu_1.8.bb create mode 100644 meta-openpli/recipes-extended/sdparm/sdparm_1.07.bb create mode 100644 meta-openpli/recipes-extended/shadow/shadow-securetty/securetty create mode 100644 meta-openpli/recipes-extended/shadow/shadow-securetty_4.1.4.3.bbappend create mode 100644 meta-openpli/recipes-extended/smartmontools/smartmontools.inc create mode 100644 meta-openpli/recipes-extended/smartmontools/smartmontools_5.42.bb create mode 100644 meta-openpli/recipes-extended/tzdata/tzdata_2012b.bbappend create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-af9005.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data1-st.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data2-st.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-atheros-ar9271.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-carl9170_1.9.5.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.a2.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.b1.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-a2-1.1.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-b1-1.1.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-af9013.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-ds3000.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-tda10071.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.1.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.6.114.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-nova-12mhz-b0.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-siano.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-adstech-usb2-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9015.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9035-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-avertv-a800-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-03-pre1.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.10.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.20.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-5.0.0.11.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-6.0.0.8.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-an2235-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digitv-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digivox-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dposh-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dtt200u-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-ec168.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it9135.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it913x.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-megasky-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-s660.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-tvwalkert.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-umt-010-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-fc03.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-miglia-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-zl0353-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-htc7010.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-htc9271.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-isdbt-nova-12mhz-b0.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-marvell-sd8688_10.38.1-p25.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-rt2870.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-rt73.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8192cu.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8712u.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-114xxx-cmmb-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-03.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-02.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-03.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-a-dvbt-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-b-dvbt-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-dvico-au-01.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-v27.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028l-v36.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/firmware-zd1211.bb create mode 100644 meta-openpli/recipes-linux/linux-firmwares/linux-firmware.inc create mode 100644 meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers.inc create mode 100644 meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch create mode 100644 meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers_3.3.bb create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-buildfix.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-corr-uncorr-error-detection.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-non-hwecc-first-workaround.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/clear_sublevel.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm500hd/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm7020hd/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm8000/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm800se/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fadvise_dontneed_change.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fix-proc-cputype.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/make-3.82-hack.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-a.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-b.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-c.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-d.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox-3.2/threaded-interrupt-support.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox.inc create mode 100644 meta-openpli/recipes-linux/linux/linux-dreambox_3.2.bb create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/add-dmx-source-timecode.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/af9015-output-full-range-SNR.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/as102-adjust-signal-strength-report.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/as102-backports-from-kernel-3.4.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/as102-scale-MER-to-full-range.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/cinergy_s2_usb_r2.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-changed-condition-to-break-out-from-wait-lock-loop.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-enable-LNA-for-DVB-T.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-output-full-range-SNR.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/disable_early_fb.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-a867.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-af9035.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-rtl2832.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-dvb-stop-URBs-when-stopping-the-streaming.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-iso-transfer-buffers.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-isoc-transfer-buffers.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/et5x00/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/et6x00/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/et9x00/defconfig create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/fix-proc-cputype.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/iosched-slice_idle-1.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.4.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.5.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/it913x-switch-off-PID-filter-by-default.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/rtl8712-release-firmware-fix.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/tda10071-BUGFIX-delivery-system.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00/tda18218-7mhz-lopass.patch create mode 100644 meta-openpli/recipes-linux/linux/linux-etxx00_3.3.0.bb create mode 100644 meta-openpli/recipes-linux/linux/linux.inc create mode 100644 meta-openpli/recipes-multimedia/aio-grab/aio-grab.bb create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/Makefile.in.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/cdparanoia-III-10.2-privatefix.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/configure.in.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/fixes10.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/interface_Makefile.in.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/paranoia_Makefile.in.patch create mode 100644 meta-openpli/recipes-multimedia/cdparanoia/cdparanoia_svn.bb create mode 100644 meta-openpli/recipes-multimedia/dvbsnoop/dvbsnoop.bb create mode 100644 meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-tip.diff create mode 100644 meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-trunk.diff create mode 100644 meta-openpli/recipes-multimedia/dvbtools/dvb-apps_1.1.1.bb create mode 100644 meta-openpli/recipes-multimedia/dvbtools/dvbstream_cvs.bb create mode 100644 meta-openpli/recipes-multimedia/dvbtools/dvbtune_cvs.bb create mode 100644 meta-openpli/recipes-multimedia/dvbtools/wscan_20101204.bb create mode 100644 meta-openpli/recipes-multimedia/dvdbackup/dvdbackup_0.4.1.bb create mode 100644 meta-openpli/recipes-multimedia/fuse/dvdfs/crosscompile.patch create mode 100644 meta-openpli/recipes-multimedia/fuse/dvdfs/defaultdevicesr0.patch create mode 100644 meta-openpli/recipes-multimedia/fuse/dvdfs_0.2.bb create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugin-dvbmediasink.bb create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0001-mpegtsdemux-fix-bd-streamtype-detection.diff.patch create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0002-add-indexing-capabilities-to-generate-a-SPN-PTS-map-.patch create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0003-mpegpsdemux_speedup.diff.patch create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.bbappend create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-base_0.10.36.bbappend create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-good-0.10.31/audioparser-raise-ranks.patch create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-good_0.10.31.bbappend create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-ugly-0.10.19/dvdsubdec-addproperty-singlebuffer.patch create mode 100644 meta-openpli/recipes-multimedia/gstreamer/gst-plugins-ugly_0.10.19.bbappend create mode 100644 meta-openpli/recipes-multimedia/libao/libao_0.8.8.bb create mode 100644 meta-openpli/recipes-multimedia/libcddb/libcddb_1.3.2.bb create mode 100644 meta-openpli/recipes-multimedia/libdreamdvd/libdreamdvd_0.9.bb create mode 100644 meta-openpli/recipes-multimedia/libdvbsi++/libdvbsi++_0.3.6.bb create mode 100644 meta-openpli/recipes-multimedia/libdvdnav/libdvdnav/0001-dvdnavmini.pc-link-against-libdvdnavmini.patch create mode 100644 meta-openpli/recipes-multimedia/libdvdnav/libdvdnav_svn.bb create mode 100644 meta-openpli/recipes-multimedia/libdvdread/libdvdread_svn.bb create mode 100644 meta-openpli/recipes-multimedia/libungif/libungif-native_4.1.3.bb create mode 100644 meta-openpli/recipes-multimedia/libungif/libungif_4.1.3.bb create mode 100644 meta-openpli/recipes-multimedia/mjpegtools/mjpegtools-2.0.0/no-includedir.patch create mode 100644 meta-openpli/recipes-multimedia/mjpegtools/mjpegtools_2.0.0.bb create mode 100644 meta-openpli/recipes-multimedia/musicpd/mpd/mpd.conf create mode 100644 meta-openpli/recipes-multimedia/musicpd/mpd/mpd.init create mode 100644 meta-openpli/recipes-multimedia/musicpd/mpd/openpli/mpd.conf create mode 100644 meta-openpli/recipes-multimedia/musicpd/mpd/save-volume-state.patch create mode 100644 meta-openpli/recipes-multimedia/musicpd/mpd_0.16.6.bb create mode 100644 meta-openpli/recipes-multimedia/opencore-amr/opencore-amr_0.1.2.bb create mode 100644 meta-openpli/recipes-multimedia/pngcrush/pngcrush_1.7.16.bb create mode 100644 meta-openpli/recipes-multimedia/rtmp/librtmp.bb create mode 100644 meta-openpli/recipes-multimedia/showiframe/showiframe.bb create mode 100644 meta-openpli/recipes-multimedia/showiframe/showiframe/showiframe.c create mode 100644 meta-openpli/recipes-multimedia/streamripper/streamripper_1.64.6.bb create mode 100644 meta-openpli/recipes-multimedia/tuxbox/tuxbox-common_0.1.bb create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/libtuxtxt.bb create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/tuxtxt-enigma2.bb create mode 100644 meta-openpli/recipes-multimedia/vlc/libaacs_git.bb create mode 100644 meta-openpli/recipes-multimedia/vlc/libbluray_git.bb create mode 100644 meta-openpli/recipes-multimedia/vlc/libdca_0.0.5-5.bb create mode 100644 meta-openpli/recipes-openpli/ambx/ambx.bb create mode 100644 meta-openpli/recipes-openpli/ambx/enigma2-plugin-extensions-ambx.bb create mode 100644 meta-openpli/recipes-openpli/ambx/python-pyambx.bb create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo.bb create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo/bootlogo-hd.mvi create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo/bootlogo.jpg create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo/bootlogo.mvi create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo/bootlogo.sh create mode 100644 meta-openpli/recipes-openpli/bootlogo/openpli-bootlogo/switchoff.mvi create mode 160000 meta-openpli/recipes-openpli/e2openplugins create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/channelsettings-enigma2-meta.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/e2settings.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-hans-13e-19e-23e-28e-rotating_20120501.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-hans-13e-19e-23e-28e_20120501.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-hans-19e-23e_20120501.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-13e-19e-23e-28e-4.8e-0.8w_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-13e-19e-23e-28e_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-13e-19e_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-19e-23e-28e_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-19e-23e_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-19e_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-7e-13e-19e-23e-28e-42e_20110919.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-rotating_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-henksat-wavefrontier_20120201.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-rytec-13e19e23e28e_20120502.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-rytec-motor_20120502.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/bouquets create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/services create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe00.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe00.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe01.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe01.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe02.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe02.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe03.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe03.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe04.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe04.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe05.radio create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe05.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe06.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe07.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe08.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe09.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe10.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe11.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe12.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe13.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe14.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe15.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe16.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe17.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe18.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe19.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe20.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquet.dbe21.tv create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquets.radio.epl create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west/userbouquets.tv.epl create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/enigma2-plugin-settings-ziggo-casema-west_20110326.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/hans.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/henksat.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/rytec-settings.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-channelsettings/settings.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-et-plugins/enigma2-plugin-extensions-et-livestream.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-et-plugins/gst-plugin-libxt.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-picons/enigma2-plugin-picons-sat_20110907.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-picons/enigma2-plugin-picons-ziggo.casema_20120520.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-picons/enigma2-plugin-picons-ziggo.tvhome_20120320.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-picons/enigma2-plugin-picons.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-picons/picons-enigma2-meta.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/cardserver-support.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/cardserver.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/cardserveroscam.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/cccam-old.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-cccam/CCcam.xml create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-cccam/plimgr.conf create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-cccam209_2.0.9.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-cccam221_2.2.1.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-cccam_2.3.0.bb create mode 100755 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-customcam/CustomCAM create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-evocamd_2.17.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-mgcamd_1.30d.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-newcs_1.67RC1.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.ac create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.cert create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.conf create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.dvbapi create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.guess create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.ird create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.pem create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.provid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.server create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.services create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.srvid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.tiers create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental-cs/config/oscam-experimental/oscam.user create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-experimental.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.ac create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.cert create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.conf create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.dvbapi create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.guess create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.ird create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.pem create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.provid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.server create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.services create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.srvid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.tiers create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable-cs/config/oscam-stable/oscam.user create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-stable.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.ac create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.cert create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.conf create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.dvbapi create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.guess create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.ird create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.pem create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.provid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.server create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.services create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.srvid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.tiers create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable-cs/config/oscam-unstable/oscam.user create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-oscam-unstable.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-rqcamd_1.31.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/enigma2-plugin-softcams-scam_3.53.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.ac create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.cert create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.conf create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.dvbapi create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.guess create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.ird create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.pem create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.provid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.server create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.services create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.srvid create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.tiers create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/files/oscam.user create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/oscam-bin.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/oscam-experimental.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/oscam-stable.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/oscam-unstable.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/softcam-support.bb create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/softcam.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/softcamoscam.inc create mode 100644 meta-openpli/recipes-openpli/enigma2-softcams/softcams-enigma2-meta.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/3rd-party-feed-configs.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/early-configure.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/early-configure/early-configure.sh create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-pliplugins.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-pliplugins/pythonpaths.patch create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-drivers-usbserial.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-extensions-tuxcom.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-extensions-tuxcom/add_advanced_rc.diff create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-extensions-tuxterm.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-extensions-xmltvimport-rytec_20120123.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-extensions-xmltvimport.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-security-firewall.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-security-firewall/firewall.sh create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-security-firewall/firewall.users create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-skins-magic.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-plugin-skins-pli-hd.bb create mode 100755 meta-openpli/recipes-openpli/enigma2/enigma2-plugins.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-skins.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-skins/blackbox.diff create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-skins/brushedaluhd.diff create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2-skins/dtvhd.diff create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/gst-plugin-subsink.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/hotplug-e2-helper.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/kernel-params.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/kernel-params/sysctl.conf create mode 100644 meta-openpli/recipes-openpli/enigma2/settings-autorestore.bb create mode 100755 meta-openpli/recipes-openpli/enigma2/settings-autorestore/autoinstall.sh create mode 100755 meta-openpli/recipes-openpli/enigma2/settings-autorestore/settings-restore.old.sh create mode 100755 meta-openpli/recipes-openpli/enigma2/settings-autorestore/settings-restore.sh create mode 100644 meta-openpli/recipes-openpli/enigma2/tuxbox-links.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/tuxterm.bb create mode 100644 meta-openpli/recipes-openpli/enigma2/usbserial.bb create mode 100644 meta-openpli/recipes-openpli/fakelocale/fakelocale.bb create mode 100644 meta-openpli/recipes-openpli/fakelocale/files/lctimelocales.tar.gz create mode 100644 meta-openpli/recipes-openpli/fakelocale/files/locale.alias create mode 100644 meta-openpli/recipes-openpli/images/openpli-enigma2-feed.bb create mode 100644 meta-openpli/recipes-openpli/images/openpli-enigma2-image.bb create mode 100644 meta-openpli/recipes-openpli/images/openpli-image.bb create mode 100644 meta-openpli/recipes-openpli/volatile-media/volatile-media.bb create mode 100755 meta-openpli/recipes-openpli/volatile-media/volatile-media/volatile-media.sh create mode 100644 meta-openpli/recipes-support/libpar2/libpar2_0.2.bb create mode 100644 meta-openpli/recipes-support/libxmlccwrap/files/disable_libxslt.patch create mode 100644 meta-openpli/recipes-support/libxmlccwrap/files/dont_build_unneeded.patch create mode 100644 meta-openpli/recipes-support/libxmlccwrap/files/fix_assignment_operator.patch create mode 100644 meta-openpli/recipes-support/libxmlccwrap/libxmlccwrap_0.0.12.bb create mode 100644 meta-openpli/recipes-support/par2cmdline/par2cmdline/par2-softlink.patch create mode 100644 meta-openpli/recipes-support/par2cmdline/par2cmdline/par2cmdline-0.4-gcc4.patch create mode 100644 meta-openpli/recipes-support/par2cmdline/par2cmdline_0.4.bb create mode 100644 meta-openpli/recipes-support/unrar/files/makefile-nostrip.patch create mode 100644 meta-openpli/recipes-support/unrar/files/makefile.unix.patch create mode 100644 meta-openpli/recipes-support/unrar/unrar_4.0.4.bb create mode 160000 openembedded-core diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..41e8bfb015 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/build-* +/.deps/ +/meta-*/ +!/meta-openpli/ +/openembedded-core/ +/sources/ +*.swp +site.conf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..76c509b05e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,16 @@ +[submodule "openembedded-core"] + path = openembedded-core + url = git://git.openembedded.org/openembedded-core-contrib + ignore = dirty +[submodule "meta-openembedded"] + path = meta-openembedded + url = git://git.openembedded.org/meta-openembedded-contrib + ignore = dirty +[submodule "bitbake"] + path = bitbake + url = git://git.openembedded.org/bitbake + ignore = dirty +[submodule "meta-openpli/recipes-openpli/e2openplugins"] + path = meta-openpli/recipes-openpli/e2openplugins + url = git://github.com/E2OpenPlugins/e2openplugins.git + ignore = dirty diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3912109b5c --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..ecf7069fda --- /dev/null +++ b/Makefile @@ -0,0 +1,153 @@ +#!/usr/bin/make -f + +# MACHINE examples: et5x00 et6x00 et9x00 dm500hd dm800se dm7020hd dm8000 +MACHINE ?= et9x00 + +# Adjust according to the number CPU cores to use for parallel build. +# Default: Number of processors in /proc/cpuinfo, if present, or 1. +NR_CPU := $(shell [ -f /proc/cpuinfo ] && grep -c '^processor\s*:' /proc/cpuinfo || echo 1) +BB_NUMBER_THREADS ?= $(NR_CPU) +PARALLEL_MAKE ?= -j $(NR_CPU) + +XSUM ?= md5sum + +BUILD_DIR = $(CURDIR)/build-$(MACHINE) +TOPDIR = $(BUILD_DIR) +DL_DIR = $(CURDIR)/sources +SSTATE_DIR = $(TOPDIR)/sstate-cache +TMPDIR = $(TOPDIR)/tmp +DEPDIR = $(TOPDIR)/.deps + +BBLAYERS ?= \ + $(CURDIR)/meta-openembedded/meta-oe \ + $(CURDIR)/openembedded-core/meta \ + $(CURDIR)/meta-openpli \ + +CONFFILES = \ + $(TOPDIR)/env.source \ + $(TOPDIR)/conf/openpli.conf \ + $(TOPDIR)/conf/bblayers.conf \ + $(TOPDIR)/conf/local.conf \ + $(TOPDIR)/conf/site.conf + +CONFDEPS = \ + $(DEPDIR)/.env.source.$(BITBAKE_ENV_HASH) \ + $(DEPDIR)/.openpli.conf.$(OPENPLI_CONF_HASH) \ + $(DEPDIR)/.bblayers.conf.$(MACHINE).$(BBLAYERS_CONF_HASH) \ + $(DEPDIR)/.local.conf.$(MACHINE).$(LOCAL_CONF_HASH) + +GIT ?= git +GIT_REMOTE := $(shell $(GIT) remote) +GIT_USER_NAME := $(shell $(GIT) config user.name) +GIT_USER_EMAIL := $(shell $(GIT) config user.email) + +hash = $(shell echo $(1) | $(XSUM) | awk '{print $$1}') + +.DEFAULT_GOAL := all +all: init + @echo + @echo "Openembedded for the OpenPLi 3.0 environment has been initialized" + @echo "properly. Now you can start building your image, by doing either:" + @echo + @echo " make -f Makefile image" + @echo " or" + @echo " cd $(BUILDDIR) ; source env.source ; bitbake openpli-enigma2-image" + @echo + +$(BBLAYERS): + [ -d $@ ] || $(MAKE) $(MFLAGS) update + +init: $(BBLAYERS) $(CONFFILES) + +image: init + @echo 'Building image for $(MACHINE)' + @. $(TOPDIR)/env.source && cd $(TOPDIR) && bitbake openpli-enigma2-image + +update: + @echo 'Updating Git repositories...' + @HASH=`$(XSUM) $(MAKEFILE_LIST)`; \ + if [ -n "$(GIT_REMOTE)" ]; then \ + $(GIT) pull --ff-only || $(GIT) pull --rebase; \ + fi; \ + if [ "$$HASH" != "`$(XSUM) $(MAKEFILE_LIST)`" ]; then \ + echo 'Makefile changed. Restarting...'; \ + $(MAKE) $(MFLAGS) --no-print-directory $(MAKECMDGOALS); \ + else \ + $(GIT) submodule sync && \ + $(GIT) submodule update --init && \ + echo "The openpli OE is now up-to-date."; \ + fi + +.PHONY: all image init update usage + +BITBAKE_ENV_HASH := $(call hash, \ + 'BITBAKE_ENV_VERSION = "0"' \ + 'CURDIR = "$(CURDIR)"' \ + ) + +$(TOPDIR)/env.source: $(DEPDIR)/.env.source.$(BITBAKE_ENV_HASH) + @echo 'Generating $@' + @echo 'export PATH=$(CURDIR)/openembedded-core/scripts:$(CURDIR)/bitbake/bin:$${PATH}' >> $@ + +OPENPLI_CONF_HASH := $(call hash, \ + 'OPENPLI_CONF_VERSION = "1"' \ + 'CURDIR = "$(CURDIR)"' \ + 'BB_NUMBER_THREADS = "$(BB_NUMBER_THREADS)"' \ + 'PARALLEL_MAKE = "$(PARALLEL_MAKE)"' \ + 'DL_DIR = "$(DL_DIR)"' \ + 'SSTATE_DIR = "$(SSTATE_DIR)"' \ + 'TMPDIR = "$(TMPDIR)"' \ + ) + +$(TOPDIR)/conf/openpli.conf: $(DEPDIR)/.openpli.conf.$(OPENPLI_CONF_HASH) + @echo 'Generating $@' + @test -d $(@D) || mkdir -p $(@D) + @echo 'SSTATE_DIR = "$(SSTATE_DIR)"' >> $@ + @echo 'TMPDIR = "$(TMPDIR)"' >> $@ + @echo 'BB_GENERATE_MIRROR_TARBALLS = "0"' >> $@ + @echo 'BBINCLUDELOGS = "yes"' >> $@ + @echo 'CONF_VERSION = "1"' >> $@ + @echo 'DISTRO = "openpli"' >> $@ + @echo 'EXTRA_IMAGE_FEATURES = "debug-tweaks"' >> $@ + @echo 'USER_CLASSES = "buildstats"' >> $@ + +LOCAL_CONF_HASH := $(call hash, \ + 'LOCAL_CONF_VERSION = "0"' \ + 'CURDIR = "$(CURDIR)"' \ + 'TOPDIR = "$(TOPDIR)"' \ + 'MACHINE = "$(MACHINE)"' \ + ) + +$(TOPDIR)/conf/local.conf: $(DEPDIR)/.local.conf.$(MACHINE).$(LOCAL_CONF_HASH) + @echo 'Generating $@' + @test -d $(@D) || mkdir -p $(@D) + @echo 'TOPDIR = "$(TOPDIR)"' >> $@ + @echo 'MACHINE = "$(MACHINE)"' >> $@ + @echo 'require $(TOPDIR)/conf/openpli.conf' >> $@ + +$(TOPDIR)/conf/site.conf: $(CURDIR)/site.conf + @ln -s ../../site.conf $@ + +$(CURDIR)/site.conf: + @echo 'SCONF_VERSION = "1"' >> $@ + @echo 'BB_NUMBER_THREADS = "$(BB_NUMBER_THREADS)"' >> $@ + @echo 'PARALLEL_MAKE = "$(PARALLEL_MAKE)"' >> $@ + @echo 'DL_DIR = "$(DL_DIR)"' >> $@ + +BBLAYERS_CONF_HASH := $(call hash, \ + 'BBLAYERS_CONF_VERSION = "0"' \ + 'CURDIR = "$(CURDIR)"' \ + 'BBLAYERS = "$(BBLAYERS)"' \ + ) + +$(TOPDIR)/conf/bblayers.conf: $(DEPDIR)/.bblayers.conf.$(MACHINE).$(BBLAYERS_CONF_HASH) + @echo 'Generating $@' + @test -d $(@D) || mkdir -p $(@D) + @echo 'LCONF_VERSION = "4"' >> $@ + @echo 'BBFILES = ""' >> $@ + @echo 'BBLAYERS = "$(BBLAYERS)"' >> $@ + +$(CONFDEPS): + @test -d $(@D) || mkdir -p $(@D) + @$(RM) $(basename $@).* + @touch $@ diff --git a/bitbake b/bitbake new file mode 160000 index 0000000000..270a05b0b4 --- /dev/null +++ b/bitbake @@ -0,0 +1 @@ +Subproject commit 270a05b0b4ba0959fe0624d2a4885d7b70426da5 diff --git a/meta-openembedded b/meta-openembedded new file mode 160000 index 0000000000..99f12509d0 --- /dev/null +++ b/meta-openembedded @@ -0,0 +1 @@ +Subproject commit 99f12509d090ad3dcfdca693b4c8765482d16621 diff --git a/meta-openpli/classes/git-project.bbclass b/meta-openpli/classes/git-project.bbclass new file mode 100644 index 0000000000..68b9825c9e --- /dev/null +++ b/meta-openpli/classes/git-project.bbclass @@ -0,0 +1,7 @@ +S = "${WORKDIR}/git" + +inherit gitpkgv + +VERSION := "${PV}" +PV = "${VERSION}+git${SRCPV}" +PKGV = "${VERSION}+git${GITPKGV}" diff --git a/meta-openpli/classes/image_types_nfi.bbclass b/meta-openpli/classes/image_types_nfi.bbclass new file mode 100644 index 0000000000..8c19f2a0c1 --- /dev/null +++ b/meta-openpli/classes/image_types_nfi.bbclass @@ -0,0 +1,61 @@ +inherit image_types + +IMAGE_CMD_jffs2.nfi = " \ + mkfs.jffs2 \ + --root=${IMAGE_ROOTFS}/boot \ + --disable-compressor=lzo \ + --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + ${EXTRA_IMAGECMD}; \ + rm -rf ${IMAGE_ROOTFS}/boot/*; \ + printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \ + mkfs.jffs2 \ + --root=${IMAGE_ROOTFS} \ + --disable-compressor=lzo \ + --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ + ${EXTRA_IMAGECMD}; \ + ${DREAMBOX_BUILDIMAGE} \ + --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \ + --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ + > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ +" + +IMAGE_CMD_sum.jffs2.nfi = " \ + mkfs.jffs2 \ + --root=${IMAGE_ROOTFS}/boot \ + --disable-compressor=lzo \ + --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + ${EXTRA_IMAGECMD}; \ + sumtool \ + -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \ + ${EXTRA_IMAGECMD}; \ + rm -rf ${IMAGE_ROOTFS}/boot/*; \ + printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \ + mkfs.jffs2 \ + --root=${IMAGE_ROOTFS} \ + --disable-compressor=lzo \ + --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ + ${EXTRA_IMAGECMD}; \ + sumtool \ + -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ + -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \ + ${EXTRA_IMAGECMD}; \ + ${DREAMBOX_BUILDIMAGE} \ + --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \ + --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \ + --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \ + > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ +" + +EXTRA_IMAGECMD_jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l" +EXTRA_IMAGECMD_sum.jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l" + +IMAGE_DEPENDS_jffs2.nfi = "${IMAGE_DEPENDS_jffs2} dreambox-buildimage-native" +IMAGE_DEPENDS_sum.jffs2.nfi = "${IMAGE_DEPENDS_sum.jffs2} dreambox-buildimage-native" + +IMAGE_TYPES += "jffs2.nfi sum.jffs2.nfi" diff --git a/meta-openpli/classes/openpli-distutils.bbclass b/meta-openpli/classes/openpli-distutils.bbclass new file mode 100644 index 0000000000..a940815fe8 --- /dev/null +++ b/meta-openpli/classes/openpli-distutils.bbclass @@ -0,0 +1,111 @@ +inherit distutils-base + +DISTUTILS_BUILD_ARGS ?= "" +DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" +DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ + --install-data=${STAGING_DATADIR}" +DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ + --install-data=${D}/${datadir}" + +distutils_do_compile() { + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python setup.py build ${DISTUTILS_BUILD_ARGS} || \ + bbfatal "python setup.py build_ext execution failed." +} + +distutils_stage_headers() { + install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ + bbfatal "python setup.py install_headers execution failed." +} + +distutils_stage_all() { + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} + PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ + bbfatal "python setup.py install (stage) execution failed." +} + +distutils_do_install() { + install -d ${D}${PYTHON_SITEPACKAGES_DIR} + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \ + bbfatal "python setup.py install execution failed." + + for i in `find ${D} -name "*.py"` ; do \ + sed -i -e s:${D}::g $i + done + + if test -e ${D}${bindir} ; then + for i in ${D}${bindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + if test -e ${D}${sbindir}; then + for i in ${D}${sbindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth + + # + # FIXME: Bandaid against wrong datadir computation + # + if test -e ${D}${datadir}/share; then + mv -f ${D}${datadir}/share/* ${D}${datadir}/ + fi + + # These are generated files, on really slow systems the storage/speed trade off + # might be worth it, but in general it isn't + find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \; +} + +distutils_do_install_keep() { + install -d ${D}${PYTHON_SITEPACKAGES_DIR} + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \ + bbfatal "python setup.py install execution failed." + + for i in `find ${D} -name "*.py"` ; do \ + sed -i -e s:${D}::g $i + done + + if test -e ${D}${bindir} ; then + for i in ${D}${bindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + if test -e ${D}${sbindir}; then + for i in ${D}${sbindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth + + # + # FIXME: Bandaid against wrong datadir computation + # + if test -e ${D}${datadir}/share; then + mv -f ${D}${datadir}/share/* ${D}${datadir}/ + fi +} + +EXPORT_FUNCTIONS do_compile do_install do_install_keep + +export LDSHARED="${CCLD} -shared" diff --git a/meta-openpli/classes/schwerkraft-git.bbclass b/meta-openpli/classes/schwerkraft-git.bbclass new file mode 100644 index 0000000000..312a8e181a --- /dev/null +++ b/meta-openpli/classes/schwerkraft-git.bbclass @@ -0,0 +1,5 @@ +SCHWERKRAFT_PROJECT ?= "${BPN}" + +SRC_URI += "git://schwerkraft.elitedvb.net/${SCHWERKRAFT_PROJECT}/${SCHWERKRAFT_PROJECT}.git;protocol=git" + +inherit git-project diff --git a/meta-openpli/conf/distro/include/openpli-unstable-versions.inc b/meta-openpli/conf/distro/include/openpli-unstable-versions.inc new file mode 100644 index 0000000000..9b43802c7f --- /dev/null +++ b/meta-openpli/conf/distro/include/openpli-unstable-versions.inc @@ -0,0 +1,26 @@ +# git +SRCREV_pn-enigma2-plugin-skins-magic ?= "${AUTOREV}" +SRCREV_pn-enigma2 ?= "${AUTOREV}" +SRCREV_pn-aio-grab ?= "${AUTOREV}" +SRCREV_pn-ambx ?= "${AUTOREV}" +SRCREV_pn-python-pyambx ?= "${AUTOREV}" +SRCREV_pn-enigma2-plugin-extensions-ambx ?= "${AUTOREV}" +SRCREV_pn-enigma2-pliplugins ?= "${AUTOREV}" +SRCREV_pn-enigma2-plugin-extensions-xmltvimport ?= "${AUTOREV}" +SRCREV_pn-enigma2-plugins ?= "${AUTOREV}" +SRCREV_pn-enigma2-skins ?= "${AUTOREV}" +SRCREV_pn-hotplug-e2-helper ?= "${AUTOREV}" +SRCREV_pn-libdreamdvd ?= "${AUTOREV}" +SRCREV_pn-usbtunerhelper ?= "${AUTOREV}" +SRCREV_pn-gst-plugin-dvbmediasink ?= "${AUTOREV}" +SRCREV_pn-libtuxtxt ?= "${AUTOREV}" +SRCREV_pn-tuxtxt-enigma2 ?= "${AUTOREV}" +SRCREV_pn-libdvbsi++ ?= "bf0c2bb7b326b93713629dbf74f63a0a54ffe59d" +SRCREV_pn-gst-plugin-subsink ?= "${AUTOREV}" +SRCREV_pn-librtmp ?= "${AUTOREV}" + +# svn +SRCREV_pn-tuxbox-common ?= "${AUTOREV}" +SRCREV_pn-tuxterm ?= "${AUTOREV}" +SRCREV_pn-enigma2-plugin-extensions-tuxcom ?= "${AUTOREV}" +SRCREV_pn-enigma2-plugin-extensions-tuxterm ?= "${AUTOREV}" diff --git a/meta-openpli/conf/distro/openpli.conf b/meta-openpli/conf/distro/openpli.conf new file mode 100644 index 0000000000..fad93d16ad --- /dev/null +++ b/meta-openpli/conf/distro/openpli.conf @@ -0,0 +1,91 @@ +#@TYPE: Distribution +#@NAME: OpenPLi +#@DESCRIPTION: Embedded Linux Distribution Configuration for STB's + +DISTRO_NAME ?= "openpli" +DISTRO_VERSION = "3.0" +DISTRO_TYPE ?= "release" + +PLISVNURL ?= "svn://openpli.svn.sourceforge.net/svnroot/openpli" +PLISVNPROTO ?= "https" +PLISVNBRANCH ?= "trunk" + +IPKG_VARIANT = "opkg" + +FEED_NAME ?= "${DISTRO_NAME}-${DISTRO_VERSION}" +DISTRO_FEED_URI ?= "http://downloads.pli-images.org/feeds/${FEED_NAME}/${MACHINE}" +DISTRO_FEED_PREFIX = "openpli" + +IMAGE_NAME = "${IMAGE_BASENAME}-${DISTRO_VERSION}-${MACHINE}" +CACHE ?= "${TMPDIR}/cache/${LIBC}/${MACHINE}" +DEPLOY_DIR ?= "${TMPDIR}/deploy/${LIBC}" +DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}" + +require conf/distro/include/openpli-unstable-versions.inc + +VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" +VIRTUAL-RUNTIME_login_manager = "busybox" +VIRTUAL-RUNTIME_init_manager = "sysvinit" +VIRTUAL-RUNTIME_initscripts = "initscripts" + +PREFERRED_PROVIDER_jpeg = "jpeg" +PREFERRED_PROVIDER_jpeg-native = "jpeg-native" +PREFERRED_PROVIDER_libfribidi = "libfribidi" + +PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" +PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}gcc-intermediate:gcc-cross-intermediate" +PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}gcc:gcc-cross" +PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}g++:gcc-cross" + +LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly commercial_lame commercial_libmad commercial_mpeg2dec" +COMMERCIAL_AUDIO_PLUGINS ?= "gst-plugins-ugly-mad gst-plugins-ugly-mpegaudioparse" +COMMERCIAL_VIDEO_PLUGINS ?= "gst-plugins-ugly-mpeg2dec gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse" + +# build some core libs with better compiler optimization for better performance +O3_OPT = "-O3 -pipe ${DEBUG_FLAGS}" +FULL_OPTIMIZATION_pn-flac = "${O3_OPT}" +FULL_OPTIMIZATION_pn-jpeg = "${O3_OPT}" +FULL_OPTIMIZATION_pn-lame = "${O3_OPT}" +FULL_OPTIMIZATION_pn-liba52 = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libdca = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libgcrypt = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libmad = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libogg = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libpng = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libsamplerate = "${O3_OPT}" +FULL_OPTIMIZATION_pn-libvorbis = "${O3_OPT}" +FULL_OPTIMIZATION_pn-tremor = "${O3_OPT}" +FULL_OPTIMIZATION_pn-zlib = "${O3_OPT}" + +PYTHON_BASEVERSION ?= "2.7" +PREFERRED_VERSION_python ?= "2.7.2" +PREFERRED_VERSION_python-native ?= "2.7.2" + +# Force the older version of liberation-fonts until we fix the fontforge issue +PREFERRED_VERSION_liberation-fonts ?= "1.04" + +PREFERRED_VERSION_udev ?= "182" + +DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci ${DISTRO_FEATURES_LIBC}" + +QA_LOGFILE = "${TMPDIR}/qa.log" + +OEINCLUDELOGS ?= "yes" +KERNEL_CONSOLE ?= "ttyS0" + +BB_GENERATE_MIRROR_TARBALLS ??= "0" + +NO32LIBS ??= "1" + +# Missing checksums should raise an error +BB_STRICT_CHECKSUM = "0" + +TCLIBC = "eglibc" +TCLIBCAPPEND = "" + +# Drop unused PACKAGE_EXTRA_ARCHS +PACKAGE_EXTRA_ARCHS = "${TUNE_PKGARCH}" + +LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly commercial_lame commercial_libmad commercial_mpeg2dec" +COMMERCIAL_AUDIO_PLUGINS ?= "gst-plugins-ugly-mad gst-plugins-ugly-mpegaudioparse" +COMMERCIAL_VIDEO_PLUGINS ?= "gst-plugins-ugly-mpeg2dec gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse" diff --git a/meta-openpli/conf/layer.conf b/meta-openpli/conf/layer.conf new file mode 100644 index 0000000000..60ff38bc96 --- /dev/null +++ b/meta-openpli/conf/layer.conf @@ -0,0 +1,11 @@ +# We have a conf and classes directory, append to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "openpli-layer" +BBFILE_PATTERN_openpli-layer := "^${LAYERDIR}/" +BBFILE_PRIORITY_openpli-layer = "7" + +OPENPLI_BASE := '${@os.path.normpath("${LAYERDIR}/../")}' \ No newline at end of file diff --git a/meta-openpli/conf/license/openpli-gplv2.inc b/meta-openpli/conf/license/openpli-gplv2.inc new file mode 100644 index 0000000000..0320e17bab --- /dev/null +++ b/meta-openpli/conf/license/openpli-gplv2.inc @@ -0,0 +1,2 @@ +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${OPENPLI_BASE}/LICENSE;md5=eb723b61539feef013de476e68b5c50a" diff --git a/meta-openpli/conf/machine/dm500hd.conf b/meta-openpli/conf/machine/dm500hd.conf new file mode 100644 index 0000000000..9c20945bc3 --- /dev/null +++ b/meta-openpli/conf/machine/dm500hd.conf @@ -0,0 +1,15 @@ +#@TYPE: Machine +#@NAME: Dreambox DM500HD +#@DESCRIPTION: Machine configuration for the Dreambox DM500HD + +DREAMBOX_FEATURES = "fan libpassthrough usbconsole xvid" +MACHINE_FEATURES += "modem" + +require conf/machine/include/dreambox-brcmnand.inc +require conf/machine/include/dreambox-nand-64mb.inc +require conf/machine/include/dreambox-part-64mb.inc +require conf/machine/include/dreambox-jffs2.inc +require conf/machine/include/dreambox-mips32el.inc +require conf/machine/include/dreambox-legacy-wlan.inc + +DVBMEDIASINK_CONFIG = "--with-dtsdownmix" diff --git a/meta-openpli/conf/machine/dm7020hd.conf b/meta-openpli/conf/machine/dm7020hd.conf new file mode 100644 index 0000000000..dbc4400747 --- /dev/null +++ b/meta-openpli/conf/machine/dm7020hd.conf @@ -0,0 +1,14 @@ +#@TYPE: Machine +#@NAME: Dreambox DM7020HD +#@DESCRIPTION: Machine configuration for the Dreambox DM7020HD + +DREAMBOX_FEATURES = "ci dvd libpassthrough usbconsole xvid" +MACHINE_FEATURES += "modem" + +require conf/machine/include/dreambox-hw-ecc.inc +require conf/machine/include/dreambox-nand-1024mb.inc +require conf/machine/include/dreambox-part-256mb.inc +require conf/machine/include/dreambox-jffs2-sum.inc +require conf/machine/include/dreambox-mips32el.inc + +DVBMEDIASINK_CONFIG = "--with-dtsdownmix" diff --git a/meta-openpli/conf/machine/dm8000.conf b/meta-openpli/conf/machine/dm8000.conf new file mode 100644 index 0000000000..9f315b4aa1 --- /dev/null +++ b/meta-openpli/conf/machine/dm8000.conf @@ -0,0 +1,13 @@ +#@TYPE: Machine +#@NAME: Dreambox DM 8000 HD PVR +#@DESCRIPTION: Machine configuration for the Dreambox DM 8000 HD PVR + +DREAMBOX_FEATURES = "ci dvd libpassthrough xvid" +MACHINE_FEATURES += "pci" + +require conf/machine/include/dreambox-nand-256mb.inc +require conf/machine/include/dreambox-part-256mb.inc +require conf/machine/include/dreambox-jffs2-sum.inc +require conf/machine/include/dreambox-mips32el.inc + +DVBMEDIASINK_CONFIG = "--with-dtsdownmix --with-limited-mpeg4v2" diff --git a/meta-openpli/conf/machine/dm800se.conf b/meta-openpli/conf/machine/dm800se.conf new file mode 100644 index 0000000000..05eef84f52 --- /dev/null +++ b/meta-openpli/conf/machine/dm800se.conf @@ -0,0 +1,15 @@ +#@TYPE: Machine +#@NAME: Dreambox DM800se +#@DESCRIPTION: Machine configuration for the Dreambox DM800se + +DREAMBOX_FEATURES = "fan libpassthrough usbconsole xvid" +MACHINE_FEATURES += "modem" + +require conf/machine/include/dreambox-brcmnand.inc +require conf/machine/include/dreambox-nand-64mb.inc +require conf/machine/include/dreambox-part-64mb.inc +require conf/machine/include/dreambox-jffs2.inc +require conf/machine/include/dreambox-mips32el.inc +require conf/machine/include/dreambox-legacy-wlan.inc + +DVBMEDIASINK_CONFIG = "--with-dtsdownmix" diff --git a/meta-openpli/conf/machine/et5x00.conf b/meta-openpli/conf/machine/et5x00.conf new file mode 100644 index 0000000000..dfce658297 --- /dev/null +++ b/meta-openpli/conf/machine/et5x00.conf @@ -0,0 +1,5 @@ +#@TYPE: Machine +#@NAME: Xtrend et5x00 +#@DESCRIPTION: Machine configuration for the Xtrend et5x00 + +require conf/machine/include/etxx00.inc \ No newline at end of file diff --git a/meta-openpli/conf/machine/et6x00.conf b/meta-openpli/conf/machine/et6x00.conf new file mode 100644 index 0000000000..45260984a5 --- /dev/null +++ b/meta-openpli/conf/machine/et6x00.conf @@ -0,0 +1,5 @@ +#@TYPE: Machine +#@NAME: Xtrend et6x00 +#@DESCRIPTION: Machine configuration for the Xtrend et6x00 + +require conf/machine/include/etxx00.inc \ No newline at end of file diff --git a/meta-openpli/conf/machine/et9x00.conf b/meta-openpli/conf/machine/et9x00.conf new file mode 100644 index 0000000000..9f20773dc4 --- /dev/null +++ b/meta-openpli/conf/machine/et9x00.conf @@ -0,0 +1,5 @@ +#@TYPE: Machine +#@NAME: Xtrend et9x00 +#@DESCRIPTION: Machine configuration for the Xtrend et9x00 + +require conf/machine/include/etxx00.inc \ No newline at end of file diff --git a/meta-openpli/conf/machine/include/dreambox-brcmnand.inc b/meta-openpli/conf/machine/include/dreambox-brcmnand.inc new file mode 100644 index 0000000000..83ea7f8ce9 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-brcmnand.inc @@ -0,0 +1 @@ +EXTRA_BUILDCMD += "--brcmnand" diff --git a/meta-openpli/conf/machine/include/dreambox-hw-ecc.inc b/meta-openpli/conf/machine/include/dreambox-hw-ecc.inc new file mode 100644 index 0000000000..18a7bcf71d --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-hw-ecc.inc @@ -0,0 +1,2 @@ +EXTRA_BUILDCMD += "--hw-ecc" +require conf/machine/include/dreambox-brcmnand.inc diff --git a/meta-openpli/conf/machine/include/dreambox-jffs2-sum.inc b/meta-openpli/conf/machine/include/dreambox-jffs2-sum.inc new file mode 100644 index 0000000000..3db6574441 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-jffs2-sum.inc @@ -0,0 +1,3 @@ +inherit image_types_nfi + +IMAGE_FSTYPES ?= "sum.jffs2.nfi" diff --git a/meta-openpli/conf/machine/include/dreambox-jffs2.inc b/meta-openpli/conf/machine/include/dreambox-jffs2.inc new file mode 100644 index 0000000000..102dede27d --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-jffs2.inc @@ -0,0 +1,3 @@ +inherit image_types_nfi + +IMAGE_FSTYPES ?= "jffs2.nfi" diff --git a/meta-openpli/conf/machine/include/dreambox-legacy-wlan.inc b/meta-openpli/conf/machine/include/dreambox-legacy-wlan.inc new file mode 100644 index 0000000000..011ae7d844 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-legacy-wlan.inc @@ -0,0 +1 @@ +PREFERRED_VERSION_wpa-supplicant ?= "${@base_version_less_or_equal('DREAMBOX_KERNEL_VERSION', '2.6.18', '0.5.10', '0.7.3', d)}" diff --git a/meta-openpli/conf/machine/include/dreambox-mips32el-nf.inc b/meta-openpli/conf/machine/include/dreambox-mips32el-nf.inc new file mode 100644 index 0000000000..a04fb5af4b --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-mips32el-nf.inc @@ -0,0 +1,11 @@ +# dreambox-mips32el-nf.inc + +DREAMBOX_KERNEL_VERSION = "2.6.18" +LINUXLIBCVERSION = "2.6.18" +OLDEST_KERNEL = "2.6.18" + +TARGET_ARCH = "mipsel" +DEFAULTTUNE = "mips32el-nf" + +require conf/machine/include/dreambox.inc +require conf/machine/include/tune-mips32.inc diff --git a/meta-openpli/conf/machine/include/dreambox-mips32el.inc b/meta-openpli/conf/machine/include/dreambox-mips32el.inc new file mode 100644 index 0000000000..24aadab197 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-mips32el.inc @@ -0,0 +1,11 @@ +# dreambox-mips32el.inc + +DREAMBOX_KERNEL_VERSION = "3.2" +LINUXLIBCVERSION = "3.2" +OLDEST_KERNEL = "3.2" + +TARGET_ARCH = "mipsel" +DEFAULTTUNE = "mips32el" + +require conf/machine/include/dreambox.inc +require conf/machine/include/tune-mips32.inc diff --git a/meta-openpli/conf/machine/include/dreambox-nand-1024mb.inc b/meta-openpli/conf/machine/include/dreambox-nand-1024mb.inc new file mode 100644 index 0000000000..1bdcd9c9c6 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-nand-1024mb.inc @@ -0,0 +1,3 @@ +DREAMBOX_ERASE_BLOCK_SIZE = "0x40000" +DREAMBOX_FLASH_SIZE = "0x40000000" +DREAMBOX_SECTOR_SIZE = "4096" diff --git a/meta-openpli/conf/machine/include/dreambox-nand-256mb.inc b/meta-openpli/conf/machine/include/dreambox-nand-256mb.inc new file mode 100644 index 0000000000..9e15f6e420 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-nand-256mb.inc @@ -0,0 +1,3 @@ +DREAMBOX_ERASE_BLOCK_SIZE = "0x20000" +DREAMBOX_FLASH_SIZE = "0x10000000" +DREAMBOX_SECTOR_SIZE = "2048" diff --git a/meta-openpli/conf/machine/include/dreambox-nand-64mb.inc b/meta-openpli/conf/machine/include/dreambox-nand-64mb.inc new file mode 100644 index 0000000000..68b493de50 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-nand-64mb.inc @@ -0,0 +1,3 @@ +DREAMBOX_ERASE_BLOCK_SIZE = "0x4000" +DREAMBOX_FLASH_SIZE = "0x4000000" +DREAMBOX_SECTOR_SIZE = "512" diff --git a/meta-openpli/conf/machine/include/dreambox-part-256mb.inc b/meta-openpli/conf/machine/include/dreambox-part-256mb.inc new file mode 100644 index 0000000000..d56420197a --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-part-256mb.inc @@ -0,0 +1,4 @@ +DREAMBOX_IMAGE_SIZE = "256" +DREAMBOX_PART0_SIZE = "0x100000" +DREAMBOX_PART1_SIZE = "0x700000" +DREAMBOX_PART2_SIZE = "0xF800000" diff --git a/meta-openpli/conf/machine/include/dreambox-part-64mb.inc b/meta-openpli/conf/machine/include/dreambox-part-64mb.inc new file mode 100644 index 0000000000..c32c80acec --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox-part-64mb.inc @@ -0,0 +1,4 @@ +DREAMBOX_IMAGE_SIZE = "64" +DREAMBOX_PART0_SIZE = "0x40000" +DREAMBOX_PART1_SIZE = "0x3C0000" +DREAMBOX_PART2_SIZE = "0x3C00000" diff --git a/meta-openpli/conf/machine/include/dreambox.inc b/meta-openpli/conf/machine/include/dreambox.inc new file mode 100644 index 0000000000..82b783eab5 --- /dev/null +++ b/meta-openpli/conf/machine/include/dreambox.inc @@ -0,0 +1,45 @@ +# dreambox.inc + +EXTRA_IMAGEDEPENDS += "dreambox-secondstage-${MACHINE}" + +GLIBC_EXTRA_OECONF = "--with-tls --with-__thread" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "dreambox-dvb-modules-${MACHINE}" + +MACHINE_FEATURES += "alsa kernel26 wifi" +MACHINE_FEATURES += "blindscan-dvbc" + +PREFERRED_PROVIDER_virtual/bootloader = "dreambox-secondstage-${MACHINE}" +PREFERRED_PROVIDER_virtual/kernel = "linux-dreambox" + +PREFERRED_PROVIDER_virtual/blindscan-dvbs = "dreambox-blindscan-utils" +PREFERRED_PROVIDER_virtual/blindscan-dvbc = "dreambox-blindscan-utils" + +PREFERRED_VERSION_linux-dreambox = "${DREAMBOX_KERNEL_VERSION}" + +KERNEL_IMAGETYPE = "vmlinux" +KERNEL_OUTPUT = "${KERNEL_IMAGETYPE}" +KERNEL_CONSOLE = "${@base_contains('DREAMBOX_FEATURES', 'usbconsole', 'ttyS0,115200', 'null', d)}" + +# XXX: That's just copied from somewhere else. Need to get +# correct values! + +# do ubiattach /dev/ubi_ctrl -m 4 +# From dmesg: +# UBI: smallest flash I/O unit: 2048 +# UBI: logical eraseblock size: 129024 bytes +# from ubiattach stdout: +# UBI device number 0, total 1996 LEBs +MKUBIFS_ARGS = "-m 2048 -e 129024 -c 1996 -x favor_lzo -X 1" + +# do ubiattach /dev/ubi_ctrl -m 4 +# from dmesg: +# UBI: smallest flash I/O unit: 2048 +# UBI: physical eraseblock size: 131072 bytes (128 KiB) +# UBI: sub-page size: 512 +UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512" + +DREAMBOX_BUILDIMAGE = "buildimage --arch ${MACHINE} ${EXTRA_BUILDCMD} \ + --erase-block-size ${DREAMBOX_ERASE_BLOCK_SIZE} \ + --flash-size ${DREAMBOX_FLASH_SIZE} \ + --sector-size ${DREAMBOX_SECTOR_SIZE}" diff --git a/meta-openpli/conf/machine/include/etxx00.inc b/meta-openpli/conf/machine/include/etxx00.inc new file mode 100644 index 0000000000..e90faab650 --- /dev/null +++ b/meta-openpli/conf/machine/include/etxx00.inc @@ -0,0 +1,115 @@ +MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\ + et-dvb-modules \ + " + +DVBPROVIDER = "kernel" + +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS = "\ + kernel-module-cdfs \ + " + +# WIFI modules +module_autoload_ath9k = "ath9k" +module_autoload_ath9k_htc = "ath9k_htc" +module_autoload_carl9170 = "carl9170" +module_autoload_prism2_usb = "prism2_usb" +module_autoload_rt73usb = "rt73usb" +module_autoload_rt2500usb = "rt2500usb" +module_autoload_rt2800usb = "rt2800usb" +module_autoload_r8192u_usb = "r8192u_usb" +module_autoload_rtl8192cu = "rtl8192cu" +module_autoload_rtl8187 = "rtl8187" +module_autoload_r8712u = "r8712u" +module_autoload_w35und = "w35und" +module_autoload_zd1211rw = "zd1211rw" + +# DVB modules +module_autoload_em28xx-dvb = "em28xx-dvb" +module_autoload_dvb-as102 = "dvb-as102" +module_autoload_dvb-usb-a800 = "dvb-usb-a800" +module_autoload_dvb-usb-a867 = "dvb-usb-a867" +module_autoload_dvb-usb-af9005 = "dvb-usb-af9005" +module_autoload_dvb-usb-af9015 = "dvb-usb-af9015" +module_autoload_dvb-usb-af9035 = "dvb-usb-af9035" +module_autoload_dvb-usb-anysee = "dvb-usb-anysee" +module_autoload_dvb-usb-au6610 = "dvb-usb-au6610" +module_autoload_dvb-usb-az6027 = "dvb-usb-az6027" +module_autoload_dvb-usb-ce6230 = "dvb-usb-ce6230" +module_autoload_dvb-usb-cxusb = "dvb-usb-cxusb" +module_autoload_dvb-usb-cinergyT2 = "dvb-usb-cinergyT2" +module_autoload_dvb-usb-digitv = "dvb-usb-digitv" +module_autoload_dvb-usb-dib0700 = "dvb-usb-dib0700" +module_autoload_dvb-usb-dibusb-mb = "dvb-usb-dibusb-mb" +module_autoload_dvb-usb-dibusb-mc = "dvb-usb-dibusb-mc" +module_autoload_dvb-usb-dtv5100 = "dvb-usb-dtv5100" +module_autoload_dvb-usb-dtt200u = "dvb-usb-dtt200u" +module_autoload_dvb-usb-dw2102 = "dvb-usb-dw2102" +module_autoload_dvb-usb-ec168 = "dvb-usb-ec168" +module_autoload_dvb-usb-friio = "dvb-usb-friio" +module_autoload_dvb-usb-gl861 = "dvb-usb-gl861" +module_autoload_dvb-usb-gp8psk = "dvb-usb-gp8psk" +module_autoload_dvb-usb-it913x = "dvb-usb-it913x" +module_autoload_dvb-usb-m920x = "dvb-usb-m920x" +module_autoload_dvb-usb-opera = "dvb-usb-opera" +module_autoload_dvb-usb-pctv452e = "dvb-usb-pctv452e" +module_autoload_dvb-usb-rtl2832 = "dvb-usb-rtl2832" +module_autoload_dvb-usb-technisat-usb2 = "dvb-usb-technisat-usb2" +module_autoload_dvb-usb-ttusb2 = "dvb-usb-ttusb2" +module_autoload_dvb-ttusb-budget = "dvb-ttusb-budget" +module_autoload_dvb-usb-nova-t-usb2 = "dvb-usb-nova-t-usb2" +module_autoload_dvb-usb-umt-010 = "dvb-usb-umt-010" +module_autoload_dvb-usb-vp702x = "dvb-usb-vp702x" +module_autoload_dvb-usb-vp7045 = "dvb-usb-vp7045" +module_autoload_smsusb = "smsdvb smsusb" + +MACHINE_EXTRA_RRECOMMENDS = " \ + gst-plugin-dvbmediasink \ + ntfs-3g \ + " + +CHIPSET = "bcm7413" + +DVBMEDIASINK_CONFIG = "--with-wma --with-wmv --with-pcm --with-dtsdownmix" + +TARGET_ARCH = "mipsel" +DEFAULTTUNE = "mips32el" + +GLIBC_EXTRA_OECONF = "--with-tls --with-__thread" + +PREFERRED_PROVIDER_virtual/kernel = "linux-etxx00" +PREFERRED_PROVIDER_virtual/blindscan-dvbs = "et-blindscan-dvbs-utils" + +PREFERRED_VERSION_linux-etxx00 = "3.3.0" +PREFERRED_VERSION_linux-libc-headers = "3.3" + +KERNEL_IMAGETYPE = "vmlinux" +KERNEL_OUTPUT = "${KERNEL_IMAGETYPE}" +KERNEL_CONSOLE = "null" + +IMAGE_FSTYPES ?= "ubi" + +UBI_VOLNAME = "rootfs" +MKUBIFS_ARGS = "-m 2048 -e 126976 -c 4096" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" + +IMAGE_CMD_ubi_append = " \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGEDIR}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGEDIR}/rootfs.bin; \ + gzip -c ${DEPLOY_DIR_IMAGE}/vmlinux-${MACHINE}.bin > ${DEPLOY_DIR_IMAGE}/${IMAGEDIR}/kernel.bin; \ + echo ${DISTRO_NAME}-${DISTRO_VERSION}-${DATE} > ${DEPLOY_DIR_IMAGE}/${IMAGEDIR}/imageversion; \ + echo "rename this file to 'force' to force an update without confirmation" > ${DEPLOY_DIR_IMAGE}/${IMAGEDIR}/noforce; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${DISTRO_NAME}-${DISTRO_VERSION}-${MACHINE}-${DATETIME}_usb.zip ${IMAGEDIR}/*; \ + rm -Rf ${IMAGEDIR}; \ + " + +TARGET_FPU = "hard" + +MACHINE_FEATURES += "kernel26 alsa wifi nl80211" +MACHINE_FEATURES += "32bpp hdtv 3dtv switchoff lpcm textlcd dvbapi5 blindscan-dvbs" + +require conf/machine/include/tune-mips32.inc + +MACHINE_KERNEL_PR = "r0" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-blindscan-utils_1.7.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-blindscan-utils_1.7.bb new file mode 100644 index 0000000000..a14e1dbbf6 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-blindscan-utils_1.7.bb @@ -0,0 +1,24 @@ +SUMMARY = "Utilities needed to do transponder blindscan with dreambox dvb receivers" +LICENSE = "CLOSED" + +PROVIDES += "virtual/blindscan-dvbs virtual/blindscan-dvbc" +RPROVIDES_${PN} += "virtual/blindscan-dvbs virtual/blindscan-dvbc" + +PR = "r0" + +SRC_URI += "http://dreamboxupdate.com/download/opendreambox/2.0.0/blindscan-utils/blindscan-utils_${PV}_${PACKAGE_ARCH}.tar.bz2;name=${PACKAGE_ARCH}" + +S = "${WORKDIR}/blindscan-utils_${PV}_${PACKAGE_ARCH}" + +PACKAGES = "${PN}" + +SRC_URI[mips32el-nf.md5sum] = "428d439eab7c300c1842be5564c07e70" +SRC_URI[mips32el-nf.sha256sum] = "190f2264f11cbe70169f3d94688320067a049fd6d670658a5157fc53bd1371a5" +SRC_URI[mips32el.md5sum] = "6a1a681f65e3ba302aaa20e4155140cb" +SRC_URI[mips32el.sha256sum] = "1664be1afa512bed1ff120693a997c564add49a97bac8e013dc8b90ed4eaced1" + +do_install() { + cp -r * ${D} +} + +INHIBIT_PACKAGE_STRIP = "1" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-buildimage_1.4.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-buildimage_1.4.bb new file mode 100644 index 0000000000..05bc1e69d6 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-buildimage_1.4.bb @@ -0,0 +1,23 @@ +SUMMARY = "create Dreambox NAND boot images" +SECTION = "console/utils" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://src/buildimage.c;endline=17;md5=ea8d8cabec86117939480a328ac3a34b" +PR = "r1" + +inherit gitpkgv + +VERSION := "${PV}" +PV = "${VERSION}+git${SRCPV}" +PKGV = "${VERSION}+git${GITPKGV}" + +SRCREV = "8f00307fdaa5d1ce3d6ffbe92e0f90c219a10500" + +SRC_URI = "git://git.opendreambox.org/git/buildimage.git;protocol=git" + +S = "${WORKDIR}/git" + +inherit autotools + +BBCLASSEXTEND = "native" + +OPENDREAMBOX_PROJECT = "buildimage" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm500hd_3.2-20120415.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm500hd_3.2-20120415.bb new file mode 100644 index 0000000000..b2d9650882 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm500hd_3.2-20120415.bb @@ -0,0 +1,6 @@ +require dreambox-dvb-modules.inc + +PR = "${INC_PR}.0" + +SRC_URI[modules.md5sum] = "768a0bab6ce70157ee1ff0ea5d1d298a" +SRC_URI[modules.sha256sum] = "0fb2d0b657efaea3a67d7600fd40b336dc0abcf6577297cb54aa70c8eeb17c3e" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm7020hd_3.2-20120415.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm7020hd_3.2-20120415.bb new file mode 100644 index 0000000000..19e8567753 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm7020hd_3.2-20120415.bb @@ -0,0 +1,6 @@ +require dreambox-dvb-modules.inc + +PR = "${INC_PR}.0" + +SRC_URI[modules.md5sum] = "44bc0ec09808e0bff00ef4a098774e57" +SRC_URI[modules.sha256sum] = "df35361c21849cb44084b1122342d1f4893dda9bf3ab2ce3de0efa1e0bedb0f2" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm8000_3.2-20120417.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm8000_3.2-20120417.bb new file mode 100644 index 0000000000..189bdd44c8 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm8000_3.2-20120417.bb @@ -0,0 +1,8 @@ +require dreambox-dvb-modules.inc + +PR = "${INC_PR}.0" + +SRC_URI[modules.md5sum] = "7d429ab1f0620efe3763dbdf8cdbafda" +SRC_URI[modules.sha256sum] = "5d14fb82fefe2b7c9a7ceec6f6ac255d4d2a3b4ec9099efc17943bff3c53057e" + +RDEPENDS_${PN} += "kernel-module-stv0299" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm800se_3.2-20120415.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm800se_3.2-20120415.bb new file mode 100644 index 0000000000..d13be31861 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules-dm800se_3.2-20120415.bb @@ -0,0 +1,6 @@ +require dreambox-dvb-modules.inc + +PR = "${INC_PR}.0" + +SRC_URI[modules.md5sum] = "826b8fd26d97a33d63210acb273cec64" +SRC_URI[modules.sha256sum] = "d212bc96b993263126b1fabc71dee0faafab8abd769d5899fc07f5a4ee3919b7" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules.inc b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules.inc new file mode 100644 index 0000000000..3e4f5a4446 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules.inc @@ -0,0 +1,45 @@ +SUMMARY = "Hardware drivers for Dreambox" +SECTION = "base" +LICENSE = "CLOSED" +DEPENDS += "virtual/kernel" +PRIORITY = "required" +INC_PR = "r7" + +DREAMBOX_DVB_MODULES_MIRROR ?= "http://sources.dreamboxupdate.com/download/opendreambox/2.0.0/dreambox-dvb-modules" + +SRC_URI = " \ + ${DREAMBOX_DVB_MODULES_MIRROR}/dreambox-dvb-modules-${MACHINE}-${DM_LOCALVERSION}-${DRIVERDATE}.tar.bz2;name=modules \ + file://modules \ +" + +inherit module + +do_compile() { +} + +do_install() { + install -d ${D}${sysconfdir}/modules-load.d + install -m 0644 ${WORKDIR}/modules ${D}${sysconfdir}/modules-load.d/${PN}.conf + install -d ${D}/lib/modules/${DM_LOCALVERSION}/extra + install -m 0644 ${WORKDIR}/LICENSE ${D}/lib/modules/${DM_LOCALVERSION}/extra + install -m 0644 ${WORKDIR}/*.ko ${D}/lib/modules/${DM_LOCALVERSION}/extra +} + +PACKAGES = "${PN}" + +RDEPENDS_${PN} += "dreambox-secondstage-${MACHINE} kernel-${DM_LOCALVERSION}" + +python __anonymous () { + import bb, re + kv = d.getVar('DREAMBOX_KERNEL_VERSION', True) + pv = d.getVar('PV', True) + if kv != pv.split('-')[0]: + raise bb.parse.SkipPackage("incompatible with kernel version %s" % kv) +} + +# We don't use KERNEL_VERSION in this recipe, because the +# precompiled modules depend on a specific version. +DM_LOCALVERSION = "${@'-'.join('${PV}'.split('-')[:-1])}-${MACHINE}" +DRIVERDATE = "${@'${PV}'.split('-')[-1]}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/dreambox-dvb-modules:" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm500hd/modules b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm500hd/modules new file mode 100644 index 0000000000..8fd4f772e8 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm500hd/modules @@ -0,0 +1,2 @@ +bcm7405 +dreambox_keyboard diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm7020hd/modules b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm7020hd/modules new file mode 100644 index 0000000000..47f5b96a57 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm7020hd/modules @@ -0,0 +1,3 @@ +lcd +bcm7405 +dreambox_keyboard diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm8000/modules b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm8000/modules new file mode 100644 index 0000000000..b8be417cf0 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm8000/modules @@ -0,0 +1,3 @@ +lcd +bcm7400 +dreambox_keyboard diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm800se/modules b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm800se/modules new file mode 100644 index 0000000000..47f5b96a57 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-dvb-modules/dm800se/modules @@ -0,0 +1,3 @@ +lcd +bcm7405 +dreambox_keyboard diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-base.inc b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-base.inc new file mode 100644 index 0000000000..2019df6874 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-base.inc @@ -0,0 +1,36 @@ +SUMMARY = "Dreambox second stage bootloader" +SECTION = "base" +LICENSE = "CLOSED" +DEPENDS += "dreambox-buildimage-native" +PROVIDES = "virtual/bootloader" +PRIORITY = "required" +INC_PR = "r12" + +do_compile() { + ${DREAMBOX_BUILDIMAGE} \ + --boot-partition ${DREAMBOX_PART0_SIZE}:secondstage-${MACHINE}-${PV}.bin \ + --raw \ + > secondstage-${MACHINE}-${PV}.nand +} +do_install() { + install -d ${D}${datadir}/dreambox-secondstage + install -m 0644 secondstage-${MACHINE}-${PV}.bin ${D}${datadir}/dreambox-secondstage/secondstage-${MACHINE}.bin + install -m 0644 secondstage-${MACHINE}-${PV}.nand ${D}${datadir}/dreambox-secondstage/secondstage-${MACHINE}.nand +} + +PACKAGES = "${PN} ${PN}-bin" + +PACKAGE_ARCH := "${MACHINE_ARCH}" + +RDEPENDS_${PN} = "mtd-utils" + +FILES_${PN} = "${datadir}/dreambox-secondstage/secondstage-${MACHINE}.nand" +FILES_${PN}-bin = "${datadir}/dreambox-secondstage/secondstage-${MACHINE}.bin" + +pkg_postinst_${PN}() { +if [ -z "$D" ]; then + flash_erase /dev/mtd1 0 $((${DREAMBOX_PART0_SIZE} / ${DREAMBOX_ERASE_BLOCK_SIZE})) + nandwrite -m -n -o /dev/mtd1 ${datadir}/dreambox-secondstage/secondstage-${MACHINE}.nand + sync +fi +} diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm500hd_84.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm500hd_84.bb new file mode 100644 index 0000000000..de8bdaf40c --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm500hd_84.bb @@ -0,0 +1,6 @@ +require dreambox-secondstage.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "d13c2713f4062a7de53f02f6ae8dba48" +SRC_URI[sha256sum] = "4280e588f85689fca109aeeabd54a98e22674ce0f98fb10c23878d72de54a227" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm7020hd_86.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm7020hd_86.bb new file mode 100644 index 0000000000..e2f57e859b --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm7020hd_86.bb @@ -0,0 +1,6 @@ +require dreambox-secondstage.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "51d43de794388a0fc07a6b4a3392d6d6" +SRC_URI[sha256sum] = "203bc73ee14a71f7b94229185e34886eece566d5a6aa6540b1cf434bbcb61d84" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm8000_84.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm8000_84.bb new file mode 100644 index 0000000000..906cdb5c4c --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm8000_84.bb @@ -0,0 +1,6 @@ +require dreambox-secondstage.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "8a6d83a266f88ec8fa5d130083f46d25" +SRC_URI[sha256sum] = "b5dbfe00674e8dea38b5069b1bfde3fe6b4486d4c4556ac775b3127e8454ca98" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm800se_84.bb b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm800se_84.bb new file mode 100644 index 0000000000..2cf53106bf --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage-dm800se_84.bb @@ -0,0 +1,6 @@ +require dreambox-secondstage.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "3c335e3d1da39b4275ea2489f218f39b" +SRC_URI[sha256sum] = "a378b1eb56780c0a0d19d9380d359b41556983508da05c4a1617f3c6cf702bd2" diff --git a/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage.inc b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage.inc new file mode 100644 index 0000000000..862bde1887 --- /dev/null +++ b/meta-openpli/recipes-bsp/dreambox/dreambox-secondstage.inc @@ -0,0 +1,5 @@ +SRC_URI = "http://sources.dreamboxupdate.com/download/7020/secondstage-${MACHINE}-${PV}.bin" + +S = "${WORKDIR}" + +require dreambox-secondstage-base.inc diff --git a/meta-openpli/recipes-bsp/etxx00/et-blindscan-dvbs-utils.bb b/meta-openpli/recipes-bsp/etxx00/et-blindscan-dvbs-utils.bb new file mode 100644 index 0000000000..3c902ad68f --- /dev/null +++ b/meta-openpli/recipes-bsp/etxx00/et-blindscan-dvbs-utils.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "Utils for DVB-S blindscan" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "CLOSED" + +SRC_URI = "http://www.et-view.com/download.php?no=81" + +PROVIDES += "virtual/blindscan-dvbs" +RPROVIDES_${PN} += "virtual/blindscan-dvbs" + +PV = "1.0" +PR = "r0" + +S = "${WORKDIR}" + +do_compile() { + mv "download.php?no=81" "et-blindscan-utils.ipkg" + ar x "et-blindscan-utils.ipkg" data.tar.gz + tar xvfz data.tar.gz usr/bin/avl_xtrend_blindscan +} + +do_install() { + install -d "${D}/${bindir}" + install -m 0755 "${S}/usr/bin/avl_xtrend_blindscan" "${D}/${bindir}" +} + +INHIBIT_PACKAGE_STRIP = "1" diff --git a/meta-openpli/recipes-bsp/etxx00/et-dvb-modules.bb b/meta-openpli/recipes-bsp/etxx00/et-dvb-modules.bb new file mode 100644 index 0000000000..d0ae8ccbd4 --- /dev/null +++ b/meta-openpli/recipes-bsp/etxx00/et-dvb-modules.bb @@ -0,0 +1,35 @@ +DESCRIPTION = "Hardware drivers for ${MACHINE}" +SECTION = "base" +PRIORITY = "required" +LICENSE = "CLOSED" + +KV = "3.3.0" +SRCDATE = "20120331" + +PV = "${KV}+${SRCDATE}" +MACHINE_KERNEL_PR_append = ".1" + +RDEPENDS_${PN} += "et-fpupdate" + +SRC_URI = "http://www.et-view.com/download/drivers/${MACHINE}-drivers-${KV}-${SRCDATE}.zip" + +SRC_URI[md5sum] = "1986366e1b5b5c430e634f0fe6cd150d" +SRC_URI[sha256sum] = "043452fdd04a8165a0edce9cbad7f08f6fbb5a68410a5ce06797cf04e5d83f3a" + +S = "${WORKDIR}" + +INHIBIT_PACKAGE_STRIP = "1" + +inherit module + +do_compile() { +} + +do_install() { + install -d ${D}/lib/modules/${KV}/extra + install -d ${D}/${sysconfdir}/modules-load.d + for i in tpm modloader modloader2 dvb; do + install -m 0755 ${WORKDIR}/$i.ko ${D}/lib/modules/${KV}/extra + echo $i >> ${D}/${sysconfdir}/modules-load.d/_${MACHINE}.conf + done +} diff --git a/meta-openpli/recipes-bsp/etxx00/et-fpupdate.bb b/meta-openpli/recipes-bsp/etxx00/et-fpupdate.bb new file mode 100644 index 0000000000..609e674973 --- /dev/null +++ b/meta-openpli/recipes-bsp/etxx00/et-fpupdate.bb @@ -0,0 +1,63 @@ +DESCRIPTION = "frontpanel update" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "CLOSED" + +PR = "r4" + +FPVERSION = "15" +FPUPDATE = "1.0" + +PV = "${FPVERSION}" + +SRC_URI = " \ + http://www.et-view.com/download/fpupdate-${FPUPDATE}.zip \ + http://www.et-view.com/download/avrmain-${MACHINE}-${FPVERSION}.zip;name=avrmain \ + " + +SRC_URI[md5sum] = "cd49ff31cda0c5ede8c346f7963b7042" +SRC_URI[sha256sum] = "46c36e9b4b5a59ca9ea54dcb618ccfeac496b20fcc060cf3e27bf5b7849b7a08" + +SRC_URI[avrmain.md5sum] = "56c1e74eaf019d57fa29e64bb7755023" +SRC_URI[avrmain.sha256sum] = "dca85d2d990f9b718e75b9445ee8d2d2a8851733fd59569c2b4b22045ffa9bc9" + +S = "${WORKDIR}" + +inherit update-rc.d + +INITSCRIPT_NAME = "fpupdate" +INITSCRIPT_PARAMS = "start 22 S ." + +FILES_${PN} = "/${bindir} /lib/firmware /etc/init.d" + +do_install() { + install -d ${D}/${bindir} + install -d ${D}/lib/firmware + install -m 0755 ${S}/fpupdate ${D}/${bindir} + install -m 0644 ${S}/avrmain-* ${D}/lib/firmware/ + + echo "#!/bin/sh" > ${S}/fpupdate.sh + echo "boxtype=\`cat /proc/stb/info/boxtype\`" >> ${S}/fpupdate.sh + echo "if ! [ -f /lib/firmware/avrmain-\$boxtype.hex ]; then" >> ${S}/fpupdate.sh + echo " exit 0" >> ${S}/fpupdate.sh + echo "fi" >> ${S}/fpupdate.sh + echo "if ! [ -x ${bindir}/fpupdate ]; then" >> ${S}/fpupdate.sh + echo " exit 0" >> ${S}/fpupdate.sh + echo "fi" >> ${S}/fpupdate.sh + echo "${bindir}/fpupdate /lib/firmware/avrmain-\$boxtype.hex ${FPVERSION} && rm /lib/firmware/avrmain*.hex" >> ${S}/fpupdate.sh + + install -d ${D}/etc/init.d + install -m 0755 ${S}/fpupdate.sh ${D}/etc/init.d/fpupdate +} + +pkg_postinst_${PN}_append() { + if test -z "$D" + then + # force update without requiring reboot + # (update-rc.d does not restart the script, when it was already installed) + /etc/init.d/fpupdate + fi + true +} + +PACKAGE_ARCH := "${MACHINE_ARCH}" diff --git a/meta-openpli/recipes-bsp/vuplus/vuplus-blindscan-utils.bb b/meta-openpli/recipes-bsp/vuplus/vuplus-blindscan-utils.bb new file mode 100644 index 0000000000..d3a1c5cf4f --- /dev/null +++ b/meta-openpli/recipes-bsp/vuplus/vuplus-blindscan-utils.bb @@ -0,0 +1,28 @@ +DESCRIPTION = "Utils for DVB-C blindscan" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "CLOSED" + +PACKAGES = "vuplus-blindscan-dvbs-utils vuplus-blindscan-dvbc-utils" + +PROVIDES += "virtual/blindscan-dvbs virtual/blindscan-dvbc" +RPROVIDES_vuplus-blindscan-dvbs-utils += "virtual/blindscan-dvbs" +RPROVIDES_vuplus-blindscan-dvbc-utils += "virtual/blindscan-dvbc" + +SRC_URI = "http://archive.vuplus.com/download/utils/vuplus-blindscan-utils-${MACHINE}-${PV}.tar.bz2" + +PV = "2.0" +PR = "r0" + +S = "${WORKDIR}/blindscan-utils" + +do_install() { + install -d "${D}/${bindir}" + install -m 0755 "${S}/tda1002x" "${D}/${bindir}" + install -m 0755 "${S}/vuplus_blindscan" "${D}/${bindir}" +} + +FILES_vuplus-blindscan-dvbs-utils = "${bindir}/vuplus_blindscan" +FILES_vuplus-blindscan-dvbc-utils = "${bindir}/tda1002x" + +INHIBIT_PACKAGE_STRIP = "1" diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/020_auto_net_path_sortlocale_mountoptions.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/020_auto_net_path_sortlocale_mountoptions.patch new file mode 100644 index 0000000000..ed747b3a82 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/020_auto_net_path_sortlocale_mountoptions.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 020_auto_net_path_sortlocale_mountoptions.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.net .A/samples/auto.net +--- .B/samples/auto.net 2005-04-05 13:02:09.000000000 +0000 ++++ .A/samples/auto.net 2007-01-07 21:36:35.000000000 +0000 +@@ -11,7 +11,7 @@ + + # add "nosymlink" here if you want to suppress symlinking local filesystems + # add "nonstrict" to make it OK for some filesystems to not mount +-opts="-fstype=nfs,hard,intr,nodev,nosuid" ++opts="-fstype=nfs,hard,intr,nodev,nosuid,nonstrict,async" + + # Showmount comes in a number of names and varieties. "showmount" is + # typically an older version which accepts the '--no-headers' flag diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/037_let_debian_rules_decide_on_CFLAGS.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/037_let_debian_rules_decide_on_CFLAGS.patch new file mode 100644 index 0000000000..d0a129fdcd --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/037_let_debian_rules_decide_on_CFLAGS.patch @@ -0,0 +1,34 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 037_let_debian_rules_decide_on_CFLAGS.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/Makefile.rules .A/Makefile.rules +--- .B/Makefile.rules 2004-01-29 16:01:22.000000000 +0000 ++++ .A/Makefile.rules 2007-01-07 21:36:35.000000000 +0000 +@@ -17,15 +17,15 @@ + # Compilers, linkers and flags + # The STRIP defined here *must not* remove any dynamic-loading symbols + +-ifdef DEBUG +-CFLAGS = -O2 -g -DDEBUG +-LDFLAGS = -g ++#ifdef DEBUG ++#CFLAGS = -O2 -g -DDEBUG ++#LDFLAGS = -g + STRIP = : +-else +-CFLAGS = -O3 -fomit-frame-pointer -Wall +-LDFLAGS = -s +-STRIP = strip --strip-debug +-endif ++#else ++#CFLAGS = -O3 -fomit-frame-pointer -Wall ++#LDFLAGS = -s ++#STRIP = strip --strip-debug ++#endif + + CC = gcc + CXX = g++ diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/042_default_auto_master_all_commented_out.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/042_default_auto_master_all_commented_out.patch new file mode 100644 index 0000000000..e3986cd64e --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/042_default_auto_master_all_commented_out.patch @@ -0,0 +1,18 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 042_default_auto_master_all_commented_out.dpatch by +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.master .A/samples/auto.master +--- .B/samples/auto.master 2005-01-04 14:36:54.000000000 +0000 ++++ .A/samples/auto.master 2007-01-07 21:36:35.000000000 +0000 +@@ -7,5 +7,5 @@ + # For details of the format look at autofs(5). + #/misc /etc/auto.misc --timeout=60 + #/smb /etc/auto.smb +-/misc /etc/auto.misc +-/net /etc/auto.net ++#/misc /etc/auto.misc ++#/net /etc/auto.net diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/060_non_replicated_ping.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/060_non_replicated_ping.patch new file mode 100644 index 0000000000..c8493da5b2 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/060_non_replicated_ping.patch @@ -0,0 +1,228 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 060_non_replicated_ping.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/modules/mount_nfs.c .A/modules/mount_nfs.c +--- .B/modules/mount_nfs.c 2005-04-05 12:42:42.000000000 +0000 ++++ .A/modules/mount_nfs.c 2007-01-07 21:36:35.000000000 +0000 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #define MODULE_MOUNT + #include "automount.h" +@@ -105,28 +106,117 @@ + + return 1; + } ++ ++/* ++ * If the entry doesn't contain a ',' or doesn't contain more than ++ * one ':' then @what is not a replicated server entry. ++ */ ++static int inline is_replicated_entry(char *what) ++{ ++ return strchr(what, ',') || ++ (strchr(what, ':') != strrchr(what, ':')); ++} ++ ++/* ++ * Check to see if the 'host:path' or 'host' is on the local machine ++ * Returns < 0 if there is a host lookup problem, otherwise returns 0 ++ * if it's not a local mount, and returns > 0 if it is a local mount. ++ */ ++int is_local_mount(const char *hostpath) ++{ ++ struct hostent *he; ++ char **haddr; ++ char *delim; ++ char *hostname; ++ int hostnamelen; ++ int local = 0; ++ ++ debug(MODPREFIX "is_local_mount: %s", hostpath); ++ delim = strpbrk(hostpath,":"); ++ ++ if (delim) ++ hostnamelen = delim - hostpath; ++ else ++ hostnamelen = strlen(hostpath); ++ ++ hostname = malloc(hostnamelen+1); ++ strncpy(hostname, hostpath, hostnamelen); ++ hostname[hostnamelen] = '\0'; ++ he = gethostbyname(hostname); ++ if (!he) { ++ error(MODPREFIX "host %s: lookup failure", hostname); ++ return -1; ++ } ++ ++ for (haddr = he->h_addr_list; *haddr; haddr++) { ++ local = is_local_addr(hostname, *haddr, he->h_length); ++ if (local < 0) ++ return local; ++ if (local) { ++ debug(MODPREFIX "host %s: is localhost", ++ hostname); ++ return local; ++ } ++ } ++ return 0; ++} ++ + /* + * Given a mount string, return (in the same string) the +- * best mount to use based on weight/locality/rpctime ++ * best mount to use based on locality/weight/rpctime. ++ * ++ * If longtimeout is set to 0 then we only do 100 ms pings to hosts. In ++ * the event that this fails, we call ourself recursively with the ++ * longtimeout option set to 1. In this case we ping for up to 10s and ++ * skip logic for detecting if a localhost has been passed. (if a local ++ * host had been passed, we would have returned that mount as the best ++ * mount. The skipping of local maps in this case is an optimization). ++ * + * - return -1 and what = '\0' on error, + * 1 and what = local mount path if local bind, + * else 0 and what = remote mount path + */ +-int get_best_mount(char *what, const char *original, int longtimeout, int skiplocal) ++int get_best_mount(char *what, const char *original, int longtimeout) + { + char *p = what; + char *winner = NULL; + int winner_weight = INT_MAX, local = 0; + double winner_time = 0; +- char *delim; ++ char *delim, *pstrip; + int sec = (longtimeout) ? 10 : 0; + int micros = (longtimeout) ? 0 : 100000; ++ int skiplocal = longtimeout; /* clearly local is not available */ + + if (!p) { + *what = '\0'; + return -1; + } + ++ /* ++ * If only one mountpoint has been passed in, we don't need to ++ * do anything except strip whitespace from the end of the string. ++ */ ++ if (!is_replicated_entry(p)) { ++ for (pstrip = p+strlen(p) - 1; pstrip >= p; pstrip--) ++ if (isspace(*pstrip)) ++ *pstrip = '\0'; ++ ++ /* Check if the host is the localhost */ ++ if (is_local_mount(p) > 0) { ++ debug(MODPREFIX "host %s: is localhost", p); ++ ++ /* Strip off hostname and ':' */ ++ delim = strchr(p,':'); ++ while (delim && *delim != '\0') { ++ delim++; ++ *what = *delim; ++ what++; ++ } ++ return 1; ++ } ++ return 0; ++ } ++ + while (p && *p) { + char *next; + unsigned int ping_stat = 0; +@@ -171,37 +261,17 @@ + /* p points to a server, "next is our next parse point */ + if (!skiplocal) { + /* Check if it's localhost */ +- struct hostent *he; +- char **haddr; +- +- he = gethostbyname(p); +- if (!he) { +- error(MODPREFIX "host %s: lookup failure", p); +- p = next; +- continue; +- } +- +- /* Check each host in round robin list */ +- for (haddr = he->h_addr_list; *haddr; haddr++) { +- local = is_local_addr(p, *haddr, he->h_length); +- +- if (local < 0) +- continue; +- +- if (local) { +- winner = p; +- break; +- } +- } +- ++ local = is_local_mount(p); + if (local < 0) { + local = 0; + p = next; + continue; + } + +- if (local) ++ if (local) { ++ winner = p; + break; ++ } + } + + /* ping each (or the) entry to see if it's alive. */ +@@ -214,6 +284,7 @@ + /* First unweighted or only host is alive so set winner */ + if (!winner) { + winner = p; ++ winner_time = 1; + /* No more to check, return it */ + if (!next || !*next) + break; +@@ -256,7 +327,7 @@ + */ + if (!local && winner_weight == INT_MAX) { + /* We had more than one contender and none responded in time */ +- if (winner_time != 0 && winner_time > 500) { ++ if (winner_time == 0 || winner_time > 500) { + /* We've already tried a longer timeout */ + if (!longtimeout) { + /* Reset string and try again */ +@@ -267,16 +338,14 @@ + "retrying with longer timeout", + original); + +- return get_best_mount(what, original, 1, 1); ++ return get_best_mount(what, original, 1); + } + } + } + +- /* No winner found so bail */ +- if (!winner) { +- *what = '\0'; +- return 0; +- } ++ /* No winner found so return first */ ++ if (!winner) ++ winner = what; + + /* + * We now have our winner, copy it to the front of the string, +@@ -395,7 +464,7 @@ + /* No colon, take this as a bind (local) entry */ + local = 1; + } else if (!nosymlink) { +- local = get_best_mount(whatstr, what, 0, 0); ++ local = get_best_mount(whatstr, what, 0); + if (!*whatstr) { + warn(MODPREFIX "no host elected"); + return 1; diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/061_multi_parse_fix.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/061_multi_parse_fix.patch new file mode 100644 index 0000000000..8b11264b1a --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/061_multi_parse_fix.patch @@ -0,0 +1,60 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 061_multi_parse_fix.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/modules/parse_sun.c .A/modules/parse_sun.c +--- .B/modules/parse_sun.c 2005-04-05 12:42:42.000000000 +0000 ++++ .A/modules/parse_sun.c 2007-01-07 21:36:35.000000000 +0000 +@@ -766,7 +766,16 @@ + { + const char *p = (char *) mapent; + int multi = 0; +- int first_chunk = 0; ++ int not_first_chunk = 0; ++ ++ if (!p) { ++ crit("check_is_multi: unexpected NULL map entry pointer"); ++ return 0; ++ } ++ ++ /* If first character is "/" it's a multi-mount */ ++ if (*p == '/') ++ return 1; + + while (*p) { + p = skipspace(p); +@@ -779,7 +788,7 @@ + * path that begins with '/' indicates a mutil-mount + * entry. + */ +- if (first_chunk) { ++ if (not_first_chunk) { + if (*p == '/' || *p == '-') { + multi = 1; + break; +@@ -796,7 +805,7 @@ + * after which it's a multi mount. + */ + p += chunklen(p, check_colon(p)); +- first_chunk++; ++ not_first_chunk++; + } + + return multi; +@@ -883,7 +892,12 @@ + return 1; + } + +- path = dequote(p, l = chunklen(p, 0)); ++ if (*p != '/') { ++ l = 0; ++ path = dequote("/", 1); ++ } else ++ path = dequote(p, l = chunklen(p, 0)); ++ + if (!path) { + error(MODPREFIX "out of memory"); + free(myoptions); diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/062_fix_memory_leak.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/062_fix_memory_leak.patch new file mode 100644 index 0000000000..1ba0ceadaa --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/062_fix_memory_leak.patch @@ -0,0 +1,32 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 062_fix_memory_leak.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/modules/mount_nfs.c .A/modules/mount_nfs.c +--- .B/modules/mount_nfs.c 2007-01-07 21:36:35.000000000 +0000 ++++ .A/modules/mount_nfs.c 2007-01-07 21:36:35.000000000 +0000 +@@ -145,16 +145,20 @@ + he = gethostbyname(hostname); + if (!he) { + error(MODPREFIX "host %s: lookup failure", hostname); ++ free(hostname); + return -1; + } + + for (haddr = he->h_addr_list; *haddr; haddr++) { + local = is_local_addr(hostname, *haddr, he->h_length); +- if (local < 0) ++ if (local < 0) { ++ free(hostname); + return local; ++ } + if (local) { + debug(MODPREFIX "host %s: is localhost", + hostname); ++ free(hostname); + return local; + } + } diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/063_misc_fixes.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/063_misc_fixes.patch new file mode 100644 index 0000000000..fcfc8a204d --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/063_misc_fixes.patch @@ -0,0 +1,82 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 063_misc_fixes.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/lib/cache.c .A/lib/cache.c +--- .B/lib/cache.c 2005-02-06 06:00:53.000000000 +0000 ++++ .A/lib/cache.c 2007-01-07 21:36:35.000000000 +0000 +@@ -337,8 +337,10 @@ + if (!path) + return; + +- if (is_mounted(_PATH_MOUNTED, path)) ++ if (is_mounted(_PATH_MOUNTED, path)) { ++ free(path); + continue; ++ } + + if (me->age < age) { + mapent_hash[i] = me->next; +diff -Naur .B/modules/lookup_file.c .A/modules/lookup_file.c +--- .B/modules/lookup_file.c 2005-04-06 15:14:23.000000000 +0000 ++++ .A/modules/lookup_file.c 2007-01-07 21:36:35.000000000 +0000 +@@ -157,6 +157,10 @@ + break; + + case st_compare: ++ if (kptr - key > KEY_MAX_LEN) { ++ state = st_badent; ++ break; ++ } + if (ch == '\n') + state = st_begin; + else if (isspace(ch) && !escape) { +diff -Naur .B/modules/parse_sun.c .A/modules/parse_sun.c +--- .B/modules/parse_sun.c 2007-01-07 21:36:35.000000000 +0000 ++++ .A/modules/parse_sun.c 2007-01-07 21:36:35.000000000 +0000 +@@ -680,6 +680,10 @@ + "mounting root %s, mountpoint %s, what %s, fstype %s, options %s\n", + root, mountpoint, what, fstype, options); + ++ /* A malformed entry of the form key /xyz will trigger this case */ ++ if (!what || *what == '\0') ++ return 1; ++ + if (!strcmp(fstype, "nfs")) { + rv = mount_nfs->mount_mount(root, mountpoint, strlen(mountpoint), + what, fstype, options, mount_nfs->context); +@@ -695,6 +699,18 @@ + return rv; + } + ++static int key_exists(struct multi_mnt *list, char *path, int pathlen) ++{ ++ struct multi_mnt *mmptr = list; ++ ++ while (mmptr && pathlen == strlen(mmptr->path)) { ++ if (!strncmp(mmptr->path, path, pathlen)) ++ return 1; ++ mmptr = mmptr->next; ++ } ++ return 0; ++} ++ + /* + * Build list of mounts in shortest -> longest order. + * Pass in list head and return list head. +@@ -725,6 +741,12 @@ + mmptr = mmptr->next; + } + ++ /* if a multimount entry has duplicate keys, it is invalid */ ++ if (key_exists(mmptr, path, plen)) { ++ free(new); ++ return NULL; ++ } ++ + if (old) + old->next = new; + new->next = mmptr; diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/064_support_options_on_nis_maps.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/064_support_options_on_nis_maps.patch new file mode 100644 index 0000000000..b71d9f5b42 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/064_support_options_on_nis_maps.patch @@ -0,0 +1,45 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 064_support_options_on_nis_maps.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in +--- .B/samples/rc.autofs.in 2005-04-11 11:30:54.000000000 +0000 ++++ .A/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 +@@ -129,7 +129,17 @@ + else + map="$1" + fi +- /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d' ++ ++ # Append the map's options at the _start_ if there are any options already ++ # (ie. myopt -> $2,myopt), otherwise just append them at the end. ++ if [ -z "$2" ]; then ++ /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d' ++ else ++ /usr/bin/ypcat -k "$map" 2> /dev/null | ++ sed -e '/^#/d' -e '/^$/d' \ ++ -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]\+-\([^ \t]\+\)/\1 \2 $2,\3/" \ ++ -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]*$/\1 \2 $2/" ++ fi + } + + function getfilemounts() +@@ -141,10 +151,11 @@ + if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then + echo $auto_master_in + else +- for nismap in `cat /etc/auto.master | grep '^\+' | +- sed -e '/^#/d' -e '/^$/d'`; do +- catnismap `echo "$nismap" | sed -e 's/^\+//'` +- done ++ cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | ( ++ while read map options; do ++ catnismap `echo "$map" | sed -e 's/^\+//'` $options ++ done ++ ) + fi + done + ) diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/065_fix_master_map_in_ldap.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/065_fix_master_map_in_ldap.patch new file mode 100644 index 0000000000..1898571700 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/065_fix_master_map_in_ldap.patch @@ -0,0 +1,22 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 065_fix_master_map_in_ldap.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in +--- .B/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 ++++ .A/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 +@@ -175,7 +175,11 @@ + function getldapmounts() + { + if [ -x @@autofslibdir@@/autofs-ldap-auto-master ]; then ++ [ ! -z $LDAPURI ] && export LDAPURI="$LDAPURI" ++ [ ! -z $LDAPBASE ] && export LDAPBASE="$LDAPBASE" + @@autofslibdir@@/autofs-ldap-auto-master 2> /dev/null ++ @@autofslibdir@@/autofs-ldap-auto-master -m automountMap \ ++ -e automount -n ou -k cn -v automountInformation 2> /dev/null + fi + } + diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/066_canonicalise_mount_points.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/066_canonicalise_mount_points.patch new file mode 100644 index 0000000000..0d1588c6ed --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/066_canonicalise_mount_points.patch @@ -0,0 +1,24 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 066_canonicalise_mount_points.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in +--- .B/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 ++++ .A/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 +@@ -244,6 +244,13 @@ + continue + fi + ++ # If possible, canonicalise the path so it will always unmount ++ # cleanly. ++ link=`readlink -f "$dir"` ++ if [ ! -z "$link" ]; then ++ dir="$link" ++ fi ++ + # Do not include a map if it is a duplicate, maps on top of + # another map or another map, maps on top of it. + for knownmap in $knownmaps diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_allow_disabling_bind_mounts.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_allow_disabling_bind_mounts.patch new file mode 100644 index 0000000000..71ed3f115d --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_allow_disabling_bind_mounts.patch @@ -0,0 +1,77 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 067_allow_disabling_bind_mounts.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/modules/mount_bind.c .A/modules/mount_bind.c +--- .B/modules/mount_bind.c 2005-01-10 13:28:29.000000000 +0000 ++++ .A/modules/mount_bind.c 2007-01-07 21:36:35.000000000 +0000 +@@ -107,7 +107,7 @@ + if (options == NULL || *options == '\0') + options = "defaults"; + +- if (bind_works) { ++ if (bind_works && strcmp(options, "symlink") != 0) { + int status, existed = 1; + + debug(MODPREFIX "calling mkdir_path %s", fullpath); +diff -Naur .B/modules/mount_nfs.c .A/modules/mount_nfs.c +--- .B/modules/mount_nfs.c 2007-01-07 21:36:35.000000000 +0000 ++++ .A/modules/mount_nfs.c 2007-01-07 21:36:35.000000000 +0000 +@@ -391,7 +391,8 @@ + char *whatstr; + char *nfsoptions = NULL; + int local, err; +- int nosymlink = 0; ++ int nosymlink = 0; /* Actually misnamed, should be "nobind" now */ ++ int symlink = 0; /* Prefer symlinks to bind mounts? */ + int ro = 0; /* Set if mount bind should be read-only */ + + debug(MODPREFIX "root=%s name=%s what=%s, fstype=%s, options=%s", +@@ -405,7 +406,10 @@ + strcpy(whatstr, what); + + /* Extract "nosymlink" pseudo-option which stops local filesystems +- from being symlinked */ ++ from being bind mounted, and "symlink" pseudo-option which does not ++ do the exact opposite, but rather makes any bind mount into a ++ symlink instead. (Both nosymlink and symlink at the same time ++ make no sense, of course.) */ + if (options) { + const char *comma; + char *nfsp; +@@ -446,6 +450,8 @@ + #endif + if (strncmp("nosymlink", cp, end - cp + 1) == 0) + nosymlink = 1; ++ else if (strncmp("symlink", cp, end - cp + 1) == 0) ++ symlink = 1; + else { + /* Check for options that also make sense + with bind mounts */ +@@ -457,8 +463,8 @@ + } + } + +- debug(MODPREFIX "nfs options=\"%s\", nosymlink=%d, ro=%d", +- nfsoptions, nosymlink, ro); ++ debug(MODPREFIX "nfs options=\"%s\", nosymlink=%d, symlink=%d, ro=%d", ++ nfsoptions, nosymlink, symlink, ro); + } + + local = 0; +@@ -490,7 +496,11 @@ + if (local) { + /* Local host -- do a "bind" */ + +- const char *bind_options = ro ? "ro" : ""; ++ const char *bind_options; ++ if (symlink) ++ bind_options = "symlink"; ++ else ++ bind_options = ro ? "ro" : ""; + + debug(MODPREFIX "%s is local, doing bind", name); + diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_ldap_no_first_message.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_ldap_no_first_message.patch new file mode 100644 index 0000000000..e85d37bb1e --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/067_ldap_no_first_message.patch @@ -0,0 +1,28 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 067_ldap_no_first_message.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/modules/lookup_ldap.c .A/modules/lookup_ldap.c +--- .B/modules/lookup_ldap.c 2005-02-27 05:37:14.000000000 +0000 ++++ .A/modules/lookup_ldap.c 2007-01-07 21:36:35.000000000 +0000 +@@ -437,7 +437,7 @@ + + e = ldap_first_entry(ldap, result); + if (!e) { +- crit(MODPREFIX "got answer, but no first entry for %s", query); ++ debug(MODPREFIX "got answer, but no first entry for %s", query); + ldap_msgfree(result); + ldap_unbind(ldap); + return CHE_MISSING; +@@ -545,7 +545,7 @@ + + e = ldap_first_entry(ldap, result); + if (!e) { +- crit(MODPREFIX "got answer, but no first entry for %s", query); ++ debug(MODPREFIX "got answer, but no first entry for %s", query); + ldap_msgfree(result); + ldap_unbind(ldap); + return CHE_MISSING; diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/068_fix_invalid_rpcgen_code.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/068_fix_invalid_rpcgen_code.patch new file mode 100644 index 0000000000..abb61eaab1 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/068_fix_invalid_rpcgen_code.patch @@ -0,0 +1,21 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 068_fix_invalid_rpcgen_code.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/lib/Makefile .A/lib/Makefile +--- .B/lib/Makefile 2005-01-09 09:16:43.000000000 +0000 ++++ .A/lib/Makefile 2007-01-07 21:36:36.000000000 +0000 +@@ -39,6 +39,10 @@ + + mount_xdr.c: mount.h + $(RPCGEN) -c -o mount_xdr.c mount.x ++ sed -i -e 's/IXDR_GET_LONG(\([^)]*\))/((long)IXDR_GET_U_INT32(\1))/' mount_xdr.c ++ sed -i -e 's/IXDR_PUT_LONG(\([^)]*\),\([^)]*\))/((long)IXDR_PUT_INT32(\1,(long)(\2)))/' mount_xdr.c ++ sed -i -e 's/IXDR_GET_SHORT(\([^)]*\))/((short)IXDR_GET_U_INT32(\1))/' mount_xdr.c ++ sed -i -e 's/IXDR_PUT_SHORT(\([^)]*\),\([^)]*\))/((long)IXDR_PUT_INT32(\1,(long)(\2)))/' mount_xdr.c + + mount_xdr.o: mount_xdr.c + $(CC) $(CFLAGS) -Wno-unused-variable -o mount_xdr.o -c mount_xdr.c diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/069_support_spaces_in_smb_share_names.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/069_support_spaces_in_smb_share_names.patch new file mode 100644 index 0000000000..a07e9662ea --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/069_support_spaces_in_smb_share_names.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 069_support_spaces_in_smb_share_names.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.smb .A/samples/auto.smb +--- .B/samples/auto.smb 2005-04-05 13:02:09.000000000 +0000 ++++ .A/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000 +@@ -20,7 +20,7 @@ + + $SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- ' + BEGIN { ORS=""; first=1 } +- /Disk/ { if (first) { print opts; first=0 }; print " \\\n\t /" $2, "://" key "/" $2 } ++ /Disk/ { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); print " \\\n\t /" $2, "://" key "/" $2 } + END { if (!first) print "\n"; else exit 1 } + ' + diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/070_fix_regex_typo.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/070_fix_regex_typo.patch new file mode 100644 index 0000000000..46f2159da3 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/070_fix_regex_typo.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 070_fix_regex_typo.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in +--- .B/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000 ++++ .A/samples/rc.autofs.in 2007-01-07 21:36:36.000000000 +0000 +@@ -148,7 +148,7 @@ + cat /etc/auto.master | awk '{print $0}' | sed -e '/^#/d' -e '/^$/d' | ( + while read auto_master_in + do +- if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then ++ if [ "`echo $auto_master_in | grep '^\+'`" = "" ]; then + echo $auto_master_in + else + cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | ( diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/071_fix_ldap_mounts.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/071_fix_ldap_mounts.patch new file mode 100644 index 0000000000..ee0c4ef257 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/071_fix_ldap_mounts.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 071_fix_ldap_mounts.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in +--- .B/samples/rc.autofs.in 2007-01-07 21:36:36.000000000 +0000 ++++ .A/samples/rc.autofs.in 2007-01-07 21:36:36.000000000 +0000 +@@ -319,7 +319,7 @@ + maptype=`echo $map | cut -f1 -d:` + # Handle degenerate map specifiers + if [ "$maptype" = "$map" ] ; then +- if [ "$map" = "hesiod" -o "$map" = "userhome" ] ; then ++ if [ "$map" = "hesiod" -o "$map" = "userhome" -o "$map" = "ldap" ] ; then + maptype=$map + map= + elif [ "$map" = "multi" ] ; then diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/072_fix_auto_net_sort.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/072_fix_auto_net_sort.patch new file mode 100644 index 0000000000..5edec83d17 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/072_fix_auto_net_sort.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 072_fix_auto_net_sort.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.net .A/samples/auto.net +--- .B/samples/auto.net 2007-01-07 21:36:35.000000000 +0000 ++++ .A/samples/auto.net 2007-01-07 21:36:36.000000000 +0000 +@@ -37,7 +37,7 @@ + # Newer distributions get this right + SHOWMOUNT="$SMNT --no-headers -e $key" + +-$SHOWMOUNT | LC_ALL=C sort +0 | \ ++$SHOWMOUNT | LC_ALL=C sort -k 1 | \ + awk -v key="$key" -v opts="$opts" -- ' + BEGIN { ORS=""; first=1 } + { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/073_configurable_locking.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/073_configurable_locking.patch new file mode 100644 index 0000000000..94058cac97 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/073_configurable_locking.patch @@ -0,0 +1,173 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 073_configurable_locking.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/configure .A/configure +--- .B/configure 2005-04-06 15:24:37.000000000 +0000 ++++ .A/configure 2007-01-07 21:36:36.000000000 +0000 +@@ -842,6 +842,7 @@ + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-ext-env disable search in environment for substitution variable ++--disable-mount-locking disable use of locking when spawning mount command + + Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +@@ -4308,6 +4309,23 @@ + fi + + # ++# Disable use of locking when spawning mount command ++# ++# Check whether --enable-mount-locking or --disable-mount-locking was given. ++if test "${enable_mount_locking+set}" = set; then ++ enableval="$enable_mount_locking" ++ ++else ++ enableval=yes ++fi; ++if test x$enable_mount_locking = xyes -o x$enableval = xyes; then ++ cat >>confdefs.h <<\_ACEOF ++#define ENABLE_MOUNT_LOCKING 1 ++_ACEOF ++ ++fi ++ ++# + # Write Makefile.conf and include/config.h + # + ac_config_headers="$ac_config_headers include/config.h" +diff -Naur .B/configure.in .A/configure.in +--- .B/configure.in 2005-04-06 15:24:37.000000000 +0000 ++++ .A/configure.in 2007-01-07 21:36:36.000000000 +0000 +@@ -167,6 +167,16 @@ + fi + + # ++# Disable use of locking when spawning mount command ++# ++AC_ARG_ENABLE(mount-locking, ++--disable-mount-locking disable use of locking when spawning mount command,, ++ enableval=yes) ++if test x$enable_mount_locking = xyes -o x$enableval = xyes; then ++ AC_DEFINE(ENABLE_MOUNT_LOCKING, 1) ++fi ++ ++# + # Write Makefile.conf and include/config.h + # + AC_CONFIG_HEADER(include/config.h) +diff -Naur .B/daemon/spawn.c .A/daemon/spawn.c +--- .B/daemon/spawn.c 2005-02-10 12:56:53.000000000 +0000 ++++ .A/daemon/spawn.c 2007-01-07 21:36:36.000000000 +0000 +@@ -322,6 +322,7 @@ + return do_spawn(logpri, 0, prog, (const char **) argv); + } + ++#ifdef ENABLE_MOUNT_LOCKING + int spawnll(int logpri, const char *prog, ...) + { + va_list arg; +@@ -342,3 +343,4 @@ + + return do_spawn(logpri, 1, prog, (const char **) argv); + } ++#endif +diff -Naur .B/include/automount.h .A/include/automount.h +--- .B/include/automount.h 2005-01-26 13:03:02.000000000 +0000 ++++ .A/include/automount.h 2007-01-07 21:36:36.000000000 +0000 +@@ -121,9 +121,13 @@ + + int aquire_lock(void); + void release_lock(void); +-int spawnll(int logpri, const char *prog, ...); + int spawnl(int logpri, const char *prog, ...); +-int spawnv(int logpri, const char *prog, const char *const *argv); ++#ifdef ENABLE_MOUNT_LOCKING ++int spawnll(int logpri, const char *prog, ...); ++#else ++#define spawnll spawnl ++#endif ++int spawnv(int ogpri, const char *prog, const char *const *argv); + void reset_signals(void); + void ignore_signals(void); + void discard_pending(int sig); +diff -Naur .B/include/config.h.in .A/include/config.h.in +--- .B/include/config.h.in 2004-02-03 15:23:21.000000000 +0000 ++++ .A/include/config.h.in 2007-01-07 21:36:36.000000000 +0000 +@@ -25,3 +25,5 @@ + #undef HAVE_SLOPPY_MOUNT + + #undef ENABLE_EXT_ENV ++ ++#undef ENABLE_MOUNT_LOCKING +diff -Naur .B/patches/util-linux-2.12a-flock.patch .A/patches/util-linux-2.12a-flock.patch +--- .B/patches/util-linux-2.12a-flock.patch 1970-01-01 00:00:00.000000000 +0000 ++++ .A/patches/util-linux-2.12a-flock.patch 2007-01-07 21:36:36.000000000 +0000 +@@ -0,0 +1,30 @@ ++--- util-linux-2.12a/mount/fstab.c.flock 2005-09-17 01:36:03.000000000 +0800 +++++ util-linux-2.12a/mount/fstab.c 2005-09-17 01:41:12.000000000 +0800 ++@@ -488,7 +488,7 @@ lock_mtab (void) { ++ } ++ /* proceed anyway */ ++ } ++- we_created_lockfile = 1; +++ we_created_lockfile = fd; ++ } else { ++ static int tries = 0; ++ ++@@ -510,9 +510,8 @@ lock_mtab (void) { ++ MOUNTED_LOCK); ++ sleep(1); ++ } +++ close(fd); ++ } ++- ++- close(fd); ++ } ++ } ++ ++@@ -520,6 +519,7 @@ lock_mtab (void) { ++ void ++ unlock_mtab (void) { ++ if (we_created_lockfile) { +++ close(we_created_lockfile); ++ unlink (MOUNTED_LOCK); ++ we_created_lockfile = 0; ++ } +diff -Naur .B/patches/util-linux-2.12q-flock.patch .A/patches/util-linux-2.12q-flock.patch +--- .B/patches/util-linux-2.12q-flock.patch 1970-01-01 00:00:00.000000000 +0000 ++++ .A/patches/util-linux-2.12q-flock.patch 2007-01-07 21:36:36.000000000 +0000 +@@ -0,0 +1,29 @@ ++--- util-linux-2.12q/mount/fstab.c.flock 2005-09-17 01:10:37.000000000 +0800 +++++ util-linux-2.12q/mount/fstab.c 2005-09-17 01:16:51.000000000 +0800 ++@@ -417,6 +417,7 @@ ++ unlock_mtab (void) { ++ if (we_created_lockfile) { ++ unlink (MOUNTED_LOCK); +++ close(we_created_lock_file); ++ we_created_lockfile = 0; ++ } ++ } ++@@ -528,6 +529,7 @@ ++ } ++ /* proceed anyway */ ++ } +++ we_created_lock_file = fd; ++ } else { ++ static int tries = 0; ++ ++@@ -549,9 +551,8 @@ ++ MOUNTED_LOCK); ++ sleep(1); ++ } +++ close(fd); ++ } ++- ++- close(fd); ++ } ++ } ++ diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/074_auto_smb_cifs.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/074_auto_smb_cifs.patch new file mode 100644 index 0000000000..28590ee41c --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/074_auto_smb_cifs.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 074_auto_smb_cifs.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.smb .A/samples/auto.smb +--- .B/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000 ++++ .A/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000 +@@ -5,7 +5,7 @@ + # This file must be executable to work! chmod 755! + + key="$1" +-opts="-fstype=smbfs" ++opts="-fstype=cifs" + + for P in /bin /sbin /usr/bin /usr/sbin + do diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/075_auto_net_escape_hash.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/075_auto_net_escape_hash.patch new file mode 100644 index 0000000000..09c0ccb330 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/075_auto_net_escape_hash.patch @@ -0,0 +1,16 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 075_auto_net_escape_hash.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.net .A/samples/auto.net +--- .B/samples/auto.net 2007-01-07 21:36:36.000000000 +0000 ++++ .A/samples/auto.net 2007-01-07 21:36:36.000000000 +0000 +@@ -42,4 +42,4 @@ + BEGIN { ORS=""; first=1 } + { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } + END { if (!first) print "\n"; else exit 1 } +- ' ++ ' | sed 's/#/\\#/g' diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/076_ldap_deprecated.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/076_ldap_deprecated.patch new file mode 100644 index 0000000000..93cfc05556 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/076_ldap_deprecated.patch @@ -0,0 +1,265 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 076_ldap_deprecated.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/aclocal.m4 .A/aclocal.m4 +--- .B/aclocal.m4 2003-09-29 08:22:35.000000000 +0000 ++++ .A/aclocal.m4 2007-01-07 21:36:36.000000000 +0000 +@@ -9,8 +9,8 @@ + AC_DEFUN(AF_PATH_INCLUDE, + [AC_PATH_PROGS($1,$2,$3,$4) + if test -n "$$1"; then +- AC_DEFINE(HAVE_$1) +- AC_DEFINE_UNQUOTED(PATH_$1, "$$1") ++ AC_DEFINE(HAVE_$1,1,[define if you have $1]) ++ AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1]) + HAVE_$1=1 + else + HAVE_$1=0 +@@ -28,7 +28,7 @@ + [if test -n "$MOUNT" ; then + AC_MSG_CHECKING([if mount accepts the -s option]) + if "$MOUNT" -s > /dev/null 2>&1 ; then +- AC_DEFINE(HAVE_SLOPPY_MOUNT) ++ AC_DEFINE(HAVE_SLOPPY_MOUNT, 1, [define if the mount command supports the -s option]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +diff -Naur .B/configure .A/configure +--- .B/configure 2007-01-07 21:36:36.000000000 +0000 ++++ .A/configure 2007-01-07 21:36:36.000000000 +0000 +@@ -1359,11 +1359,13 @@ + test -n "$MOUNT" || MOUNT="/bin/mount" + + if test -n "$MOUNT"; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define HAVE_MOUNT 1 + _ACEOF + +- cat >>confdefs.h <<_ACEOF ++ ++cat >>confdefs.h <<_ACEOF + #define PATH_MOUNT "$MOUNT" + _ACEOF + +@@ -1418,11 +1420,13 @@ + test -n "$UMOUNT" || UMOUNT="/bin/umount" + + if test -n "$UMOUNT"; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define HAVE_UMOUNT 1 + _ACEOF + +- cat >>confdefs.h <<_ACEOF ++ ++cat >>confdefs.h <<_ACEOF + #define PATH_UMOUNT "$UMOUNT" + _ACEOF + +@@ -1476,11 +1480,13 @@ + done + + if test -n "$E2FSCK"; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define HAVE_E2FSCK 1 + _ACEOF + +- cat >>confdefs.h <<_ACEOF ++ ++cat >>confdefs.h <<_ACEOF + #define PATH_E2FSCK "$E2FSCK" + _ACEOF + +@@ -1534,11 +1540,13 @@ + done + + if test -n "$E3FSCK"; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define HAVE_E3FSCK 1 + _ACEOF + +- cat >>confdefs.h <<_ACEOF ++ ++cat >>confdefs.h <<_ACEOF + #define PATH_E3FSCK "$E3FSCK" + _ACEOF + +@@ -1556,7 +1564,8 @@ + echo "$as_me:$LINENO: checking if mount accepts the -s option" >&5 + echo $ECHO_N "checking if mount accepts the -s option... $ECHO_C" >&6 + if "$MOUNT" -s > /dev/null 2>&1 ; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define HAVE_SLOPPY_MOUNT 1 + _ACEOF + +@@ -3403,6 +3412,7 @@ + fi; + if test -z "$HAVE_LDAP"; then + HAVE_LDAP=0 ++ LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1" + echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5 + echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6 + if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then +@@ -4302,7 +4312,8 @@ + enableval=yes + fi; + if test x$enable_ext_env = xyes; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define ENABLE_EXT_ENV 1 + _ACEOF + +@@ -4319,7 +4330,8 @@ + enableval=yes + fi; + if test x$enable_mount_locking = xyes -o x$enableval = xyes; then +- cat >>confdefs.h <<\_ACEOF ++ ++cat >>confdefs.h <<\_ACEOF + #define ENABLE_MOUNT_LOCKING 1 + _ACEOF + +diff -Naur .B/configure.in .A/configure.in +--- .B/configure.in 2007-01-07 21:36:36.000000000 +0000 ++++ .A/configure.in 2007-01-07 21:36:36.000000000 +0000 +@@ -118,6 +118,7 @@ + ) + if test -z "$HAVE_LDAP"; then + HAVE_LDAP=0 ++ LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1" + AC_CHECK_LIB(ldap, ldap_init, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv", , + -llber -lresolv $LIBS) + fi +@@ -163,7 +164,7 @@ + --disable-ext-env disable search in environment for substitution variable,, + enableval=yes) + if test x$enable_ext_env = xyes; then +- AC_DEFINE(ENABLE_EXT_ENV, 1) ++ AC_DEFINE(ENABLE_EXT_ENV, 1, [leave this alone]) + fi + + # +@@ -173,7 +174,7 @@ + --disable-mount-locking disable use of locking when spawning mount command,, + enableval=yes) + if test x$enable_mount_locking = xyes -o x$enableval = xyes; then +- AC_DEFINE(ENABLE_MOUNT_LOCKING, 1) ++ AC_DEFINE(ENABLE_MOUNT_LOCKING, 1, [disable mount table locking -- use this if your maps contain recursive mounts -- EXPERIMENTAL]) + fi + + # +diff -Naur .B/include/config.h.in .A/include/config.h.in +--- .B/include/config.h.in 2007-01-07 21:36:36.000000000 +0000 ++++ .A/include/config.h.in 2007-01-07 21:36:36.000000000 +0000 +@@ -1,29 +1,80 @@ +-#ident "$Id: config.h.in,v 1.4 2004/02/03 15:23:21 raven Exp $" +-/* -*- c -*- +- * +- * config.h.in: Pattern file for autofs to be filled in by configure +- * +- */ ++/* include/config.h.in. Generated from configure.in by autoheader. */ + +-/* Program paths */ ++/* leave this alone */ ++#undef ENABLE_EXT_ENV ++ ++/* disable mount table locking -- use this if your maps contain recursive ++ mounts -- EXPERIMENTAL */ ++#undef ENABLE_MOUNT_LOCKING ++ ++/* define if you have E2FSCK */ ++#undef HAVE_E2FSCK ++ ++/* define if you have E3FSCK */ ++#undef HAVE_E3FSCK ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_INTTYPES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_MEMORY_H ++ ++/* define if you have MOUNT */ + #undef HAVE_MOUNT +-#undef PATH_MOUNT + ++/* define if the mount command supports the -s option */ ++#undef HAVE_SLOPPY_MOUNT ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDINT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDLIB_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STRINGS_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STRING_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_STAT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_TYPES_H ++ ++/* define if you have UMOUNT */ + #undef HAVE_UMOUNT +-#undef PATH_UMOUNT + +-#undef HAVE_SMBMOUNT +-#undef PATH_SMBMOUNT ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UNISTD_H + +-#undef HAVE_E2FSCK ++/* Define to the address where bug reports for this package should be sent. */ ++#undef PACKAGE_BUGREPORT ++ ++/* Define to the full name of this package. */ ++#undef PACKAGE_NAME ++ ++/* Define to the full name and version of this package. */ ++#undef PACKAGE_STRING ++ ++/* Define to the one symbol short name of this package. */ ++#undef PACKAGE_TARNAME ++ ++/* Define to the version of this package. */ ++#undef PACKAGE_VERSION ++ ++/* define if you have E2FSCK */ + #undef PATH_E2FSCK + +-#undef HAVE_E3FSCK ++/* define if you have E3FSCK */ + #undef PATH_E3FSCK + +-/* Define this option if mount(8) supports the -s (sloppy) option */ +-#undef HAVE_SLOPPY_MOUNT ++/* define if you have MOUNT */ ++#undef PATH_MOUNT + +-#undef ENABLE_EXT_ENV ++/* define if you have UMOUNT */ ++#undef PATH_UMOUNT + +-#undef ENABLE_MOUNT_LOCKING ++/* Define to 1 if you have the ANSI C header files. */ ++#undef STDC_HEADERS diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/078_locking_fix_1.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/078_locking_fix_1.patch new file mode 100644 index 0000000000..eb22a2baa1 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/078_locking_fix_1.patch @@ -0,0 +1,82 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 078_locking_fix_1.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/daemon/spawn.c .A/daemon/spawn.c +--- .B/daemon/spawn.c 2007-01-07 21:36:36.000000000 +0000 ++++ .A/daemon/spawn.c 2007-01-07 21:36:36.000000000 +0000 +@@ -214,14 +214,15 @@ + sigfillset(&allsignals); + sigprocmask(SIG_BLOCK, &allsignals, &oldsig); + +- if (pipe(pipefd)) ++ if (pipe(pipefd)) { ++ if (use_lock) ++ release_lock(); ++ sigprocmask(SIG_SETMASK, &oldsig, NULL); + return -1; ++ } + + f = fork(); +- if (f < 0) { +- sigprocmask(SIG_SETMASK, &oldsig, NULL); +- return -1; +- } else if (f == 0) { ++ if (f == 0) { + reset_signals(); + close(pipefd[0]); + dup2(pipefd[1], STDOUT_FILENO); +@@ -243,6 +244,8 @@ + + if (f < 0) { + close(pipefd[0]); ++ if (use_lock) ++ release_lock(); + sigprocmask(SIG_SETMASK, &oldsig, NULL); + return -1; + } +@@ -287,11 +290,11 @@ + if (waitpid(f, &status, 0) != f) + status = -1; /* waitpid() failed */ + +- sigprocmask(SIG_SETMASK, &oldsig, NULL); +- + if (use_lock) + release_lock(); + ++ sigprocmask(SIG_SETMASK, &oldsig, NULL); ++ + return status; + } + } +diff -Naur .B/lib/lock.c .A/lib/lock.c +--- .B/lib/lock.c 2005-01-17 15:09:28.000000000 +0000 ++++ .A/lib/lock.c 2007-01-07 21:36:36.000000000 +0000 +@@ -208,9 +208,6 @@ + */ + static int wait_for_lockf(const char *lockf) + { +- struct timespec t = { 0, WAIT_INTERVAL }; +- struct timespec r; +- int ts_size = sizeof(struct timespec); + int tries = WAIT_TRIES; + int status = 0; + struct stat st; +@@ -218,10 +215,13 @@ + while (tries-- && !status) { + status = stat(lockf, &st); + if (!status) { ++ struct timespec t = { 0, WAIT_INTERVAL }; ++ struct timespec r; ++ + while (nanosleep(&t, &r) == -1 && errno == EINTR) { + if (got_term) + return 0; +- memcpy(&t, &r, ts_size); ++ memcpy(&t, &r, sizeof(struct timespec)); + } + } + } diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/079_no_unlink_upstream.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/079_no_unlink_upstream.patch new file mode 100644 index 0000000000..eb062e449f --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/079_no_unlink_upstream.patch @@ -0,0 +1,55 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 079_no_unlink_upstream.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/daemon/automount.c .A/daemon/automount.c +--- .B/daemon/automount.c 2007-01-07 21:36:36.000000000 +0000 ++++ .A/daemon/automount.c 2007-01-07 21:36:37.000000000 +0000 +@@ -232,16 +232,38 @@ + static int rm_unwanted_fn(const char *file, const struct stat *st, int when, void *arg) + { + int rmsymlink = *(int *) arg; ++ struct stat newst; + + if (when == 0) { + if (st->st_dev != ap.dev) + return 0; +- } else { +- info("rm_unwanted: %s\n", file); +- if (S_ISDIR(st->st_mode)) +- rmdir(file); +- else if (!S_ISLNK(st->st_mode) || rmsymlink) +- unlink(file); ++ return 1; ++ } ++ ++ if (lstat(file, &newst)) { ++ crit ("rm_unwanted: unable to stat file, possible race " ++ "condition."); ++ return 0; ++ } ++ ++ if (newst.st_dev != ap.dev) { ++ crit ("rm_unwanted: file %s has the wrong device, possible " ++ "race condition.",file); ++ return 0; ++ } ++ ++ if (S_ISDIR(newst.st_mode)) { ++ if (rmdir(file)) { ++ info ("rm_unwanted: unable to remove directory" ++ " %s", file); ++ return 0; ++ } ++ } else if (S_ISREG(newst.st_mode)) { ++ crit ("rm_unwanted: attempting to remove files from a mounted " ++ "directory."); ++ return 0; ++ } else if (S_ISLNK(newst.st_mode) && rmsymlink) { ++ unlink(file); + } + + return 1; diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/080_auto_smb_probe_credentials.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/080_auto_smb_probe_credentials.patch new file mode 100644 index 0000000000..0b6ca44810 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/080_auto_smb_probe_credentials.patch @@ -0,0 +1,37 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 080_auto_smb_probe_credentials.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.smb .A/samples/auto.smb +--- .B/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000 ++++ .A/samples/auto.smb 2007-01-07 21:36:37.000000000 +0000 +@@ -5,7 +5,9 @@ + # This file must be executable to work! chmod 755! + + key="$1" +-opts="-fstype=cifs" ++mountopts="-fstype=cifs" ++smbopts="" ++credfile="/etc/auto.smb.$key" + + for P in /bin /sbin /usr/bin /usr/sbin + do +@@ -18,7 +20,14 @@ + + [ -x $SMBCLIENT ] || exit 1 + +-$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- ' ++if [ -e $credfile ]; then ++ mountopts="$mountopts,credentials=$credfile" ++ smbopts="-A $credfile" ++else ++ smbopts="-N" ++fi ++ ++$SMBCLIENT $smbopts -gL $key 2>/dev/null| awk -v key="$key" -v opts="$mountopts" -F'|' -- ' + BEGIN { ORS=""; first=1 } + /Disk/ { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); print " \\\n\t /" $2, "://" key "/" $2 } + END { if (!first) print "\n"; else exit 1 } diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/081_auto_net_showmount_quotes.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/081_auto_net_showmount_quotes.patch new file mode 100644 index 0000000000..25d5ec8b0e --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/081_auto_net_showmount_quotes.patch @@ -0,0 +1,19 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 081_auto_net_showmount_quotes.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/auto.net .A/samples/auto.net +--- .B/samples/auto.net 2007-01-07 21:36:36.000000000 +0000 ++++ .A/samples/auto.net 2007-01-07 21:36:37.000000000 +0000 +@@ -32,7 +32,7 @@ + done + done + +-[ -x $SMNT ] || exit 1 ++[ -x "$SMNT" ] || exit 1 + + # Newer distributions get this right + SHOWMOUNT="$SMNT --no-headers -e $key" diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/082_samples_makefile_typo.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/082_samples_makefile_typo.patch new file mode 100644 index 0000000000..56672328c6 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/082_samples_makefile_typo.patch @@ -0,0 +1,18 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 082_samples_makefile_typo.dpatch +## +## DP: No description. + +@DPATCH@ + +diff -Naur .B/samples/Makefile .A/samples/Makefile +--- .B/samples/Makefile 2005-01-04 14:36:54.000000000 +0000 ++++ .A/samples/Makefile 2007-01-07 21:36:37.000000000 +0000 +@@ -42,6 +42,6 @@ + install -c autofs-ldap-auto-master -m 755 $(INSTALLROOT)$(autofslibdir) + endif + +-clean): ++clean: + rm -f *.o *.s autofs-ldap-auto-master rc.autofs + diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/083_clarify_program_map_outputsyntax.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/083_clarify_program_map_outputsyntax.patch new file mode 100644 index 0000000000..e772b90989 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/083_clarify_program_map_outputsyntax.patch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 083_clarify_program_map_outputsyntax.dpatch +## +## DP: Explicitly mention that the queried key has to be omitted in the output of +## DP: program maps. + +@DPATCH@ +--- autofs-4.1.4+debian.orig/man/autofs.5 2007-06-30 00:29:12.000000000 +0200 ++++ autofs-4.1.4+debian/man/autofs.5 2007-06-30 00:30:27.000000000 +0200 +@@ -153,7 +153,8 @@ + .B program + map will be called as a script with the key as an argument. It may + return no lines of output if there's an error, or one or more lines +-containing a map (with \\ quoting line breaks). ++containing a map (starting with the second column, i.e. omitting the ++key, and quoting line breaks with \\). + .P + To use a + .B program diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/084_init_lsb_header.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/084_init_lsb_header.patch new file mode 100644 index 0000000000..8a07693cda --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/084_init_lsb_header.patch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 84_init_lsb_header.dpatch by +## +## DP: Add an LSB-conformant header to the initscript. + +@DPATCH@ + +--- autofs-4.1.4+debian/samples/rc.autofs.in.orig 2007-07-05 16:43:32.000000000 +0200 ++++ autofs-4.1.4+debian/samples/rc.autofs.in 2007-07-05 16:43:42.000000000 +0200 +@@ -9,6 +9,16 @@ + # On most distributions, this file should be called: + # /etc/rc.d/init.d/autofs or /etc/init.d/autofs + # ++### BEGIN INIT INFO ++# Provides: autofs ++# Required-Start: $local_fs ++# Required-Stop: $local_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: automount daemon ++# Description: daemon to mount (possibly remote) filesystems ++# automatically upon entering the mountpoint ++### END INIT INFO + + # For Redhat-ish systems + # diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/085_auto_net_lp111612.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/085_auto_net_lp111612.patch new file mode 100644 index 0000000000..23e455ba96 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/085_auto_net_lp111612.patch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 085-auto.net-lp111612 by Morten Kjeldgaard +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix problem with directories exported multiple times to different +## DP: hosts (LP: #111612). + +@DPATCH@ + +--- samples/auto.net 2008-04-09 16:32:59.000000000 +0200 ++++ foo/samples/auto.net 2008-04-09 16:34:29.000000000 +0200 +@@ -37,7 +37,7 @@ + # Newer distributions get this right + SHOWMOUNT="$SMNT --no-headers -e $key" + +-$SHOWMOUNT | LC_ALL=C sort -k 1 | \ ++$SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -k 1 | \ + awk -v key="$key" -v opts="$opts" -- ' + BEGIN { ORS=""; first=1 } + { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/Makefile.rules-cross.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/Makefile.rules-cross.patch new file mode 100644 index 0000000000..1f9ea4176f --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/Makefile.rules-cross.patch @@ -0,0 +1,19 @@ +Index: autofs-4.1.4/Makefile.rules +=================================================================== +--- autofs-4.1.4.orig/Makefile.rules ++++ autofs-4.1.4/Makefile.rules +@@ -27,10 +27,10 @@ STRIP = : + #STRIP = strip --strip-debug + #endif + +-CC = gcc +-CXX = g++ +-CXXFLAGS = $(CFLAGS) +-LD = ld ++CC ?= gcc ++CXX ?= g++ ++CXXFLAGS ?= $(CFLAGS) ++LD ?= ld + SOLDFLAGS = -shared -Xlinker -rpath -Xlinker $(autofslibdir) + + # Standard rules diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.hotplug b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.hotplug new file mode 100644 index 0000000000..67cf4c52bf --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.hotplug @@ -0,0 +1 @@ +* -fstype=auto,rw,sync :/dev/& diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.master b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.master new file mode 100644 index 0000000000..41c2389b02 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.master @@ -0,0 +1,11 @@ +# +# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ +# +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +#/smb /etc/auto.smb +#/net /etc/auto.net +/autofs /etc/auto.hotplug +/media/net /etc/auto.network diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.network b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.network new file mode 100644 index 0000000000..c1835d9c95 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/auto.network @@ -0,0 +1,2 @@ +# automatically generated by enigma 2 +# do NOT change manually! diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.default b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.default new file mode 100644 index 0000000000..e8619eb688 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.default @@ -0,0 +1,2 @@ +daemonoptions='--ghost' +TIMEOUT=5 diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.init b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.init new file mode 100755 index 0000000000..c32d08ef4c --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/autofs.init @@ -0,0 +1,803 @@ +#!/bin/sh +# +# $Id: rc.autofs.in,v 1.58 2005/04/11 11:30:54 raven Exp $ +# +# rc file for automount using a Sun-style "master map". +# We first look for a local /etc/auto.master, then a YP +# map with that name +# +# On most distributions, this file should be called: +# /etc/rc.d/init.d/autofs or /etc/init.d/autofs +# +### BEGIN INIT INFO +# Provides: autofs +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: automount daemon +# Description: daemon to mount (possibly remote) filesystems +# automatically upon entering the mountpoint +### END INIT INFO + +# For Redhat-ish systems +# +# chkconfig: 345 28 72 +# processname: /usr/sbin/automount +# config: /etc/auto.master +# description: Automounts filesystems on demand + +# This is used in the Debian distribution to determine the proper +# location for the S- and K-links to this init file. +# The following value is extracted by debstd to figure out how to +# generate the postinst script. Edit the field to change the way the +# script is registered through update-rc.d (see the manpage for +# update-rc.d!) +# +FLAGS="defaults 21" + +# +# Location of the automount daemon and the init directory +# +DAEMON=/usr/sbin/automount +prog=`basename $DAEMON` +initdir=/etc/init.d + +test -e $DAEMON || exit 0 + +# +# Determine which kind of configuration we're using +# +system=debian +if [ -f /etc/redhat-release ]; then + system=redhat +fi + +if [ $system = redhat ]; then + . $initdir/functions +fi + +if [ $system = debian ]; then + thisscript="$0" + if [ ! -f "$thisscript" ]; then + echo "$0: Cannot find myself" 1>&2 + exit 1 + fi +fi + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +export PATH + +# +# We can add local options here +# e.g. localoptions='rsize=8192,wsize=8192' +# +localoptions='' + +# +# Daemon options +# e.g. --timeout=60 +# +daemonoptions='' + +# +# load custom settings +# +if [ "$system" = "redhat" ]; then + LOCALOPTIONS="" + DAEMONOPTIONS="" + UNDERSCORETODOT=1 + DISABLE_DIRECT=1 + DAEMON_EXIT_WAIT=20 + + [ -f /etc/sysconfig/autofs ] && . /etc/sysconfig/autofs + + # Over-ride localoptions if set + if [ -n "$LOCALOPTIONS" ]; then + localoptions=$LOCALOPTIONS + fi + + # Over-ride daemonoptions if set + if [ -n "$DAEMONOPTIONS" ]; then + daemonoptions=$DAEMONOPTIONS + fi +elif [ "$system" = "debian" ]; then + TIMEOUT=300 + DISABLE_DIRECT=1 + DAEMON_EXIT_WAIT=20 + + [ -f /etc/default/autofs ] && . /etc/default/autofs + + daemonoptions="$daemonoptions --timeout=$TIMEOUT" +fi + +# +# Check for all maps that are to be loaded +# +getschemes() +{ + SOURCES=`grep ^automount: /etc/nsswitch.conf | \ + sed -e 's/^.*://' -e 's/\[.*\]/ /g'` + + if [ `echo $SOURCES | awk '{print NF}'` -gt 0 ] + then + echo ${SOURCES} + else + echo files + fi +} + +catnismap() +{ + if [ -z "$1" ] ; then + map="auto_master" + else + map="$1" + fi + + # Append the map's options at the _start_ if there are any options already + # (ie. myopt -> $2,myopt), otherwise just append them at the end. + if [ -z "$2" ]; then + /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d' + else + /usr/bin/ypcat -k "$map" 2> /dev/null | + sed -e '/^#/d' -e '/^$/d' \ + -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]\+-\([^ \t]\+\)/\1 \2 $2,\3/" \ + -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]*$/\1 \2 $2/" + fi +} + +getfilemounts() +{ + if [ -f /etc/auto.master ] ; then + cat /etc/auto.master | awk '{print $0}' | sed -e '/^#/d' -e '/^$/d' | ( + while read auto_master_in + do + if [ "`echo $auto_master_in | grep '^\+'`" = "" ]; then + echo $auto_master_in + else + cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | ( + while read map options; do + catnismap `echo "$map" | sed -e 's/^\+//'` $options + done + ) + fi + done + ) + fi +} + +getnismounts() +{ + YPMAP=`catnismap auto.master` + if [ -z "$YPMAP" ]; then + catnismap + else + catnismap auto.master + fi +} + +getldapmounts() +{ + if [ -x /usr/lib/autofs/autofs-ldap-auto-master ]; then + [ ! -z $LDAPURI ] && export LDAPURI="$LDAPURI" + [ ! -z $LDAPBASE ] && export LDAPBASE="$LDAPBASE" + /usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null + /usr/lib/autofs/autofs-ldap-auto-master -m automountMap \ + -e automount -n ou -k cn -v automountInformation 2> /dev/null + fi +} + +getrawmounts() +{ + for scheme in `getschemes` ; do + case "$scheme" in + files) + if [ -z "$filescheme" ] ; then + getfilemounts + filescheme=1 + export filescheme + fi + ;; + nis) + if [ -z "$nisscheme" ] ; then + getnismounts + nisscheme=1 + export nisscheme + fi + ;; + ldap*) + if [ -z "$ldapscheme" ] ; then + getldapmounts + ldapscheme=1 + export ldapscheme + fi + ;; + esac + done +} + + +# +# This function will build a list of automount commands to execute in +# order to activate all the mount points. It is used to figure out +# the difference of automount points in case of a reload +# +getmounts() +{ + local LC_ALL=C + export LC_ALL + knownmaps=" " + getrawmounts | ( + while read dir map options + do + # These checks screen out duplicates and skip over directories + # where the map is '-'. + # We can't do empty or direct host maps, so don't bother trying. + + # Strip trailing slashes from the dir line if it exists to aid + # in checking for duplicate maps + dir=`echo "$dir" | sed -e "s/\/*$//"` + + if [ ! -z "$map" -a "$map" = "-hosts" ] ; then + continue + fi + + if [ $DISABLE_DIRECT -eq 1 \ + -a x`echo $dir | grep -E "^/-"` != 'x' ] + then + continue + fi + + # If possible, canonicalise the path so it will always unmount + # cleanly. + link=`readlink -f "$dir"` + if [ ! -z "$link" ]; then + dir="$link" + fi + + # Do not include a map if it is a duplicate, maps on top of + # another map or another map, maps on top of it. + for knownmap in $knownmaps + do + if [ "`echo $dir/ | grep ^$knownmap`" != "" \ + -o "`echo $knownmap | grep ^$dir/`" != "" \] + then + continue 2 + fi + done + + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + # If the options include a -t or --timeout, a -g or --ghost, + # a -v or --verbose or a -d or --debug paramter, then pull + # those particular options out. + : echo DAEMONOPTIONS OPTIONS $daemonoptions $options + startupoptions= + if echo "$options" | grep -qE -- '\B-(t\b|-timeout\b=)' ; + then + startupoptions="--timeout=$(echo $options |\ + sed 's/.*-\(t[^0-9]*\|-timeout\)[ \t=]*\([0-9][0-9]*\).*$/\2/g')" + elif echo "$daemonoptions" | grep -q -- '-t' ; + then + # It's okay to be sloppy with DAEMONOPTIONS as there is no + # possibility of conflicting with mount or map options. + startupoptions="--timeout=$(echo $daemonoptions | \ + sed 's/.*--*t\(imeout\)*[ \t=]*\([0-9][0-9]*\).*$/\2/g')" + fi + + # Check for the ghost option + if echo "$daemonoptions $options" | grep -qE -- '\B-(g\b|-ghost\b)' ; + then + startupoptions="$startupoptions --ghost" + fi + # Dont even deal with conflicts between --ghost and [no]browse + # Its just insane to configure things like that. + if echo "$options" | grep -qE -- '\B-browse\b' ; + then + startupoptions="$startupoptions --ghost" + fi + # Check for verbose + if echo "$daemonoptions $options" | \ + grep -qE -- '\B-(v\b|-verbose\b)' ; + then + startupoptions="$startupoptions --verbose" + fi + + # Check for debug + if echo "$daemonoptions $options" | \ + grep -qE -- '\B-(d\b|-debug\b)' ; + then + startupoptions="$startupoptions --debug" + fi + + # Other option flags are intended for maps. + mapoptions="$(echo "$daemonoptions $options" |\ + sed 's/-\(t[^0-9]*\|-timeout\)[ \t=]*\([0-9][0-9]*\)//g' | + sed 's/-\(g\b\|-ghost\b\)//g' | + sed 's/-\(v\b\|-verbose\b\)//g' | + sed 's/-\(d\b\|-debug\b\)//g' | + sed 's/-\b\(no\)\?browse\b//g')" + + # Break up the maptype and map, if the map type is specified + maptype=`echo $map | cut -f1 -d:` + # Handle degenerate map specifiers + if [ "$maptype" = "$map" ] ; then + if [ "$map" = "hesiod" -o "$map" = "userhome" -o "$map" = "ldap" ] ; then + maptype=$map + map= + elif [ "$map" = "multi" ] ; then + maptype=$map + map= +# elif echo "$map" | grep -q '^!'; then +# map=`echo "$map"| sed -e 's/^!//g'` + elif `echo $map | grep -q "^/"` && [ -x "$map" ]; then + maptype=program + elif [ -x "/etc/$map" ]; then + maptype=program + map=`echo /etc/$map | sed 's^//^/^g'` + elif `echo $map | grep -q "^/"` && [ -f "$map" ]; then + maptype=file + elif [ -f "/etc/$map" ]; then + maptype=file + map=`echo /etc/$map | sed 's^//^/^g'` + else + maptype=yp + if [ "$UNDERSCORETODOT" = "1" ] ; then + map=`basename $map | sed -e s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/` + else + map=`basename $map | sed 's^//^/^g'` + fi + fi + fi + map=`echo $map | cut -f2- -d:` + + : echo STARTUPOPTIONS $startupoptions + : echo DIR $dir + : echo MAPTYPE $maptype + : echo MAP $map + : echo MAPOPTIONS $mapoptions + : echo LOCALOPTIONS $localoptions + + NEWOPTIONS="" + for m in $mapoptions + do + if [ x"$m" = x"--" ]; then + NEWOPTIONS="$NEWOPTIONS $localoptions --" + else + NEWOPTIONS="$NEWOPTIONS $m" + fi + done + mapoptions=$NEWOPTIONS + + echo "$DAEMON $startupoptions $dir $maptype $map $mapoptions $localoptions" | sed -e 's/ / /g' -e 's/ */ /g' + + : echo ------------------------ + knownmaps=" $dir/ $knownmaps" + fi + done + ) +} + +# +# Status lister. +# +status() +{ + echo -e $"Configured Mount Points:\n------------------------" + getmounts + echo "" + echo -e $"Active Mount Points:\n--------------------" + ps axwww|grep "[0-9]:[0-9][0-9] $DAEMON " | ( + while read pid tt stat time command; do echo $command; done + ) +} + +get_command_from_pid() +{ + ps ax | grep "[0-9]:[0-9][0-9] $DAEMON " | ( + while read pid tt stat time command; do + if [ "$pid" = "$1" ] ; then + echo `echo "$command" | \ + sed 's/--pid-file.*\.pid/ /'` + return 0 + fi + done + ) + return 0 +} + +# return true if at least one pid is alive +alive() +{ + if [ -z "$*" ]; then + return 1 + fi + for i in $*; do + if kill -0 $i 2> /dev/null; then + return 0 + fi + done + + return 1 +} + +# +# Find pids of process group leaders +# +get_pgrp_pids() +{ + ps -eo pid,pgrp,cmd|grep $DAEMON|\ + awk '{print $1,$2}'|\ + while read pid pgrp + do + if [ $pid -eq $pgrp ] + then + echo $pid + fi + done +} + +# +# Signal each automount process group leader +# +signal_automounts() +{ + RETVAL=0 + pgrp_pids=`get_pgrp_pids` + for pid in $pgrp_pids + do + kill -USR2 $pid 2 > /dev/null + count=0 + while ps ax|grep -v grep|grep $pid >/dev/null + do + sleep 1 + count=$(expr $count + 1) + if [ $count -gt $DAEMON_EXIT_WAIT ]; then + break; + fi + done + done + + if [ -n "`pidof $DAEMON`" ] ; then + RETVAL=1 + fi + + return $RETVAL +} + +umount_loopback() +{ + loops=`LC_ALL=C awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` + automounts=`LC_ALL=C awk '!/^#/ && $1 ~ /^automount/ {print $2}' /proc/mounts` + + for l in $loops + do + # If a loop device is mounted into a subdir of the automount point, + # umount it here. + for a in $automounts + do + match=`echo $l | grep -E "^$a[\$|/]" || true` + if [ -n "$match" ]; then + echo "" + echo -n $"Unmounting loopback filesystem $match: " + loopdev=`LC_ALL=C grep $l /proc/mounts | awk '{print $1}'` + umount -d $match + if [ $? -eq 0 ]; then + echo "done" + else + echo "failed ($?)" + fi + fi + done + done + + # If the loop device file exists under the automount point, umount + # it here. + loopmnts=`LC_ALL=C awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` + for l in $loopmnts + do + loopmnt=`losetup $l | awk -F\( '{print $2}' | awk -F\) '{print $1}'` + for a in $automounts + do + match=`echo $loopmnt | grep -E "^$a[\$|/]" || true` + if [ -n "$match" ]; then + echo "" + echo -n $"Unmounting loopback filesystem $match: " + umount -d $match + if [ $? -eq 0 ]; then + echo "done" + else + echo "failed ($?)" + fi + fi + done + done +} + +# +# Redhat start/stop function. +# +redhat() +{ + +# +# See how we were called. +# +case "$1" in + start) + # Make sure the autofs filesystem type is available. + (grep -q autofs /proc/filesystems || /sbin/modprobe -k autofs4 || /sbin/modprobe -k autofs) 2> /dev/null + echo -n $"Starting $prog: " + TMP=`mktemp /tmp/autofs.XXXXXX` || { echo $"could not make temp file" >& 2; exit 1; } + getmounts | tee $TMP | sh + RETVAL=$? + if [ -s $TMP ] ; then + if [ $RETVAL -eq 0 ] ; then + success "$prog startup" + else + failure "$prog startup" + fi + [ $RETVAL = 0 ] && touch /var/lock/subsys/autofs + else + echo -n $"No Mountpoints Defined" + success "$prog startup" + fi + rm -f $TMP + echo + ;; + stop) + echo -n $"Stopping $prog:" + if [ -z "`pidofproc $prog`" -a -z "`getmounts`" ]; then + RETVAL=0 + else + umount_loopback + signal_automounts + RETVAL=$? + fi + count=0 + while [ -n "`/sbin/pidof $DAEMON`" -a $count -lt 10 ] ; do + killproc $DAEMON -USR2 >& /dev/null + RETVAL=$? + [ $RETVAL = 0 -a -z "`/sbin/pidof $DAEMON`" ] || sleep 3 + count=`expr $count + 1` + done + umount -a -f -t autofs + rm -f /var/lock/subsys/autofs + if [ -n "`/sbin/pidof $DAEMON`" ] ; then + failure "$prog shutdown" + else + success "$prog shutdown" + fi + echo + ;; + restart) + redhat stop + redhat start + ;; + reload) + if [ ! -f /var/lock/subsys/autofs ]; then + echo $"$prog not running" + RETVAL=1 + return + fi + echo $"Checking for changes to /etc/auto.master ...." + TMP1=`mktemp /tmp/autofs.XXXXXX` || { echo $"could not make temp file" >& 2; exit 1; } + TMP2=`mktemp /tmp/autofs.XXXXXX` || { echo $"could not make temp file" >& 2; exit 1; } + getmounts >$TMP1 + ps axwww|grep "[0-9]:[0-9][0-9] $DAEMON " | ( + while read pid tt stat time command; do + echo "$command" >>$TMP2 + if ! grep -q "^$command" $TMP1; then + if ! echo "$command" | grep -q -e --submount; then + kill -USR2 $pid 2> /dev/null + echo $"Stop $command" + fi + else + kill -HUP $pid 2> /dev/null + echo $"Reload map $command" + fi + done + ) + cat $TMP1 | ( while read x; do + if ! grep -q "^$x" $TMP2; then + $x + echo $"Start $x" + fi + done ) + rm -f $TMP1 $TMP2 + ;; + status) + status + ;; + condrestart) + [ -f /var/lock/subsys/autofs ] && redhat restart + RETVAL=0 + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=0 +esac +} + +# +# Debian start/stop functions. +# +debian() +{ + +case "$1" in +start) + echo -n 'Starting automounter:' + + # make sure autofs4 is loaded + if ! grep -q autofs /proc/filesystems + then + # autofs filesystem support not loaded + echo -n ' loading autofs4 kernel module,' + modprobe autofs4 || true + elif ([ -f /proc/modules ] && lsmod) | grep -q autofs[^4]; then + # wrong autofs filesystem module loaded + echo + echo "WARNING: autofs kernel module is loaded, autofs4 needed" + echo " for correct behaviour. You might experience mount failures." + fi + + # Check that maps exist + if [ -z "$(getrawmounts)" ] + then + echo " no automount maps defined." + exit 0 + fi + + # ensure pid file directory exists + if [ ! -e /var/run/autofs ] + then + mkdir /var/run/autofs + fi + + getmounts | while read cmd rest + do + mnt=`echo $rest | sed 's/^.* \(\/[^ ]*\) [A-Za-z].*$/\1/'` + pidfile=/var/run/autofs/`echo $mnt | sed 's,/,_,g'`.pid + + start-stop-daemon --start --pidfile $pidfile --quiet \ + --exec $DAEMON -- --pid-file=$pidfile $rest + + ret=$? + + if [ $ret -ne 0 ] + then + echo + echo " failed to start automount point $mnt" + fi + done + + echo " done." + ;; +stop) + echo -n 'Stopping automounter:' + + umount_loopback + + any=0 + for file in `ls /var/run/autofs/*.pid 2>/dev/null` + do + if [ -e "$file" ] + then + any=1 + pid=`head -n 1 $file` + mnt=`ps -wwo 'cmd=' $pid | sed -e \ + 's,.* --pid-file=/var/run/autofs/\([^ ]*\)\.pid.*,\1,; s,_,/,g'` + dname=`basename $DAEMON` + + start-stop-daemon --stop --quiet \ + --retry USR2/$DAEMON_EXIT_WAIT \ + --pidfile $file --name $dname + + ret=$? + + case $ret in + 0) +# echo -n " $mnt" + rm -f $file + ;; + 1) + echo -n -e "\n No process for automount $mnt" + rm -f $file + ;; + 2) + echo -n -e "\n Couldn't stop automount for $mnt" + ;; + *) + echo -n -e \ + "\n Strange start-stop-daemon exit status: $ret" + ;; + esac + fi + done + + echo " done." + ;; +reload) + echo "Reloading automounter: checking for changes ... " + + TMP1=`mktemp -t autofs.XXXXXX` + TMP2=`mktemp -t autofs.XXXXXX` + + getmounts >$TMP1 + + for i in `ls /var/run/autofs/*.pid 2>/dev/null` + do + pid=`head -n 1 $i 2>/dev/null` + [ "$pid" = "" ] && continue + + cmd=`get_command_from_pid $pid` + echo $cmd >>$TMP2 + + mnt=`ps -wwo 'cmd=' $pid | sed -e \ + 's,.* --pid-file=/var/run/autofs/\([^ ]*\)\.pid.*,\1,; s,_,/,g'` + + if ! grep -q "$cmd" $TMP1; then + echo "Stopping automounter for: $mnt" + kill -USR2 $pid 2> /dev/null + else + echo "Reloading automounter map for: $mnt" + kill -HUP $pid 2> /dev/null + fi + done + + cat $TMP1 | (while read x; do + if ! grep -q "^$x" $TMP2; then + echo $x | while read cmd rest; do + + mnt=`echo $rest | sed 's/^.* \(\/[^ ]*\) [A-Za-z].*$/\1/'` + pidfile=/var/run/autofs/`echo $mnt | sed 's,/,_,g'`.pid + + start-stop-daemon --start --pidfile $pidfile --quiet \ + --exec $DAEMON -- --pid-file=$pidfile $rest + + ret=$? + + if [ $ret -ne 0 ] + then + echo + echo " failed to start automount point $mnt" + else + echo "Started automounter: $mnt" + fi + done + fi + done) + + rm -f $TMP1 $TMP2 + ;; +force-reload|restart) + debian stop + debian start + ;; +status) + status + ;; +getmounts) + getmounts + ;; +active) + alive + ;; +*) + echo "Usage: $initdir/autofs {start|stop|restart|reload|status|getmounts|active}" >&2 + exit 1 + ;; +esac +} + +RETVAL=0 +if [ $system = debian ]; then + debian "$@" +elif [ $system = redhat ]; then + redhat "$@" +fi + +exit $RETVAL diff --git a/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/cross.patch b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/cross.patch new file mode 100644 index 0000000000..f27cc0ae9e --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs-4.1.4/cross.patch @@ -0,0 +1,42 @@ +Index: autofs-4.1.4/aclocal.m4 +=================================================================== +--- autofs-4.1.4.orig/aclocal.m4 ++++ autofs-4.1.4/aclocal.m4 +@@ -9,6 +9,8 @@ dnl ------------------------------------ + AC_DEFUN(AF_PATH_INCLUDE, + [AC_PATH_PROGS($1,$2,$3,$4) + if test -n "$$1"; then ++ AH_TEMPLATE([HAVE_$1], [Have $2]) ++ AH_TEMPLATE([PATH_$1], [Have $2]) + AC_DEFINE(HAVE_$1,1,[define if you have $1]) + AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1]) + HAVE_$1=1 +Index: autofs-4.1.4/configure.in +=================================================================== +--- autofs-4.1.4.orig/configure.in ++++ autofs-4.1.4/configure.in +@@ -135,12 +135,14 @@ AC_PROG_CC + cat > pietest.c < +d root root 0700 /var/run/autofs none diff --git a/meta-openpli/recipes-connectivity/autofs/autofs_4.1.4.bb b/meta-openpli/recipes-connectivity/autofs/autofs_4.1.4.bb new file mode 100644 index 0000000000..f8d9bffc17 --- /dev/null +++ b/meta-openpli/recipes-connectivity/autofs/autofs_4.1.4.bb @@ -0,0 +1,80 @@ +SUMMARY = "kernel-based automounter for Linux" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" +PR = "r10" + +SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v4/${BP}.tar.bz2 \ + file://020_auto_net_path_sortlocale_mountoptions.patch \ + file://037_let_debian_rules_decide_on_CFLAGS.patch \ + file://042_default_auto_master_all_commented_out.patch \ + file://060_non_replicated_ping.patch \ + file://061_multi_parse_fix.patch \ + file://062_fix_memory_leak.patch \ + file://063_misc_fixes.patch \ + file://064_support_options_on_nis_maps.patch \ + file://065_fix_master_map_in_ldap.patch \ + file://066_canonicalise_mount_points.patch \ + file://067_allow_disabling_bind_mounts.patch \ + file://067_ldap_no_first_message.patch \ + file://068_fix_invalid_rpcgen_code.patch \ + file://069_support_spaces_in_smb_share_names.patch \ + file://070_fix_regex_typo.patch \ + file://071_fix_ldap_mounts.patch \ + file://072_fix_auto_net_sort.patch \ + file://073_configurable_locking.patch \ + file://074_auto_smb_cifs.patch \ + file://075_auto_net_escape_hash.patch \ + file://076_ldap_deprecated.patch \ + file://078_locking_fix_1.patch \ + file://079_no_unlink_upstream.patch \ + file://080_auto_smb_probe_credentials.patch \ + file://081_auto_net_showmount_quotes.patch \ + file://082_samples_makefile_typo.patch \ + file://083_clarify_program_map_outputsyntax.patch \ + file://084_init_lsb_header.patch \ + file://085_auto_net_lp111612.patch \ + file://cross.patch \ + file://Makefile.rules-cross.patch \ + file://install.patch \ + file://no-bash.patch \ + file://auto.hotplug \ + file://auto.master \ + file://auto.network \ + file://autofs.default \ + file://autofs.init \ + file://volatiles.99_autofs \ +" +SRC_URI[md5sum] = "7e3949114c00665b4636f0c318179657" +SRC_URI[sha256sum] = "e25caa0e9639ea54dd7c4f21e8146ac9859a61fa126f397edf874b5fdc147430" + +S = "${WORKDIR}/${BP}" + +inherit autotools update-rc.d + +do_configure_prepend () { + if [ ! -e acinclude.m4 ]; then + cp aclocal.m4 acinclude.m4 + fi +} +do_install () { + oe_runmake 'INSTALLROOT=${D}' install + install -d ${D}${sysconfdir}/default + install -m 644 ${WORKDIR}/autofs.default ${D}${sysconfdir}/default/autofs + install -d ${D}${sysconfdir}/init.d + install -m 755 ${WORKDIR}/autofs.init ${D}${sysconfdir}/init.d/autofs + install -m 644 ${WORKDIR}/auto.hotplug ${D}${sysconfdir}/auto.hotplug + install -m 644 ${WORKDIR}/auto.master ${D}${sysconfdir}/auto.master + install -m 644 ${WORKDIR}/auto.network ${D}${sysconfdir}/auto.network + install -d ${D}${sysconfdir}/default/volatiles + install -m 644 ${WORKDIR}/volatiles.99_autofs ${D}${sysconfdir}/default/volatiles/99_autofs +} + +RDEPENDS_${PN} = "procps" + +INITSCRIPT_NAME = "autofs" +INITSCRIPT_PARAMS = "defaults" + +PARALLEL_MAKE = "" + +INSANE_SKIP_${PN} = "dev-so" diff --git a/meta-openpli/recipes-connectivity/bluez/bluez4_4.99.bbappend b/meta-openpli/recipes-connectivity/bluez/bluez4_4.99.bbappend new file mode 100644 index 0000000000..49bc4cf2ad --- /dev/null +++ b/meta-openpli/recipes-connectivity/bluez/bluez4_4.99.bbappend @@ -0,0 +1,5 @@ +PRINC = "1" + +EXTRA_OECONF += " --disable-udevrules" + +DEPENDS := "${@oe_filter_out('udev', '${DEPENDS}', d)}" \ No newline at end of file diff --git a/meta-openpli/recipes-connectivity/ctorrent/ctorrent.inc b/meta-openpli/recipes-connectivity/ctorrent/ctorrent.inc new file mode 100644 index 0000000000..df84275861 --- /dev/null +++ b/meta-openpli/recipes-connectivity/ctorrent/ctorrent.inc @@ -0,0 +1,10 @@ +DESCRIPTION = "CTorrent is a console BitTorrent client \ + with a focus on being lightweight and quick." +HOMEPAGE = "http://www.rahul.net/dholmes/ctorrent/" +SECTION = "network" +LICENSE = "GPLv2+" +DEPENDS = "openssl" + +SRC_URI = "${SOURCEFORGE_MIRROR}/ctorrent/ctorrent-${PV}.tar.bz2" + +inherit autotools diff --git a/meta-openpli/recipes-connectivity/ctorrent/ctorrent_3.3.1.bb b/meta-openpli/recipes-connectivity/ctorrent/ctorrent_3.3.1.bb new file mode 100644 index 0000000000..2dc4530581 --- /dev/null +++ b/meta-openpli/recipes-connectivity/ctorrent/ctorrent_3.3.1.bb @@ -0,0 +1,14 @@ +require ctorrent.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +DESCRIPTION += "This is the Enhanced version from the dtorrent project" + +SRC_URI = "${SOURCEFORGE_MIRROR}/dtorrent/ctorrent-dnh${PV}.tar.gz \ + file://CVE-2009-1759.patch;striplevel=0 " + +S = "${WORKDIR}/${PN}-dnh${PV}" +PR="r1" + +SRC_URI[md5sum] = "9bfe42c2dd6a6aabd545fe332bc23e87" +SRC_URI[sha256sum] = "e65d9c7a4da499314126d979a0a79ce5123e0f969c786bfddcee261f14cb648b" diff --git a/meta-openpli/recipes-connectivity/ctorrent/files/CVE-2009-1759.patch b/meta-openpli/recipes-connectivity/ctorrent/files/CVE-2009-1759.patch new file mode 100644 index 0000000000..2f61c92852 --- /dev/null +++ b/meta-openpli/recipes-connectivity/ctorrent/files/CVE-2009-1759.patch @@ -0,0 +1,88 @@ +CVE-2009-1759 + +http://sourceforge.net/tracker/?func=detail&aid=2782875&group_id=202532&atid=981959 + +Index: bencode.h +=================================================================== +--- bencode.h (revision 301) ++++ bencode.h (revision 302) +@@ -25,7 +25,7 @@ + size_t decode_list(const char *b,size_t len,const char *keylist); + size_t decode_rev(const char *b,size_t len,const char *keylist); + size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method); +-size_t decode_list2path(const char *b, size_t n, char *pathname); ++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen); + size_t bencode_buf(const char *str,size_t len,FILE *fp); + size_t bencode_str(const char *str, FILE *fp); + size_t bencode_int(const uint64_t integer, FILE *fp); +Index: bencode.cpp +=================================================================== +--- bencode.cpp (revision 301) ++++ bencode.cpp (revision 302) +@@ -233,22 +233,28 @@ + return bencode_end_dict_list(fp); + } + +-size_t decode_list2path(const char *b, size_t n, char *pathname) ++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen) + { + const char *pb = b; + const char *s = (char *) 0; ++ const char *endmax = pathname + maxlen - 1; + size_t r,q; + + if( 'l' != *pb ) return 0; + pb++; + n--; + if( !n ) return 0; +- for(; n;){ ++ while( n && pathname < endmax ){ + if(!(r = buf_str(pb, n, &s, &q)) ) return 0; ++ if( q >= maxlen ) return 0; + memcpy(pathname, s, q); + pathname += q; +- pb += r; n -= r; +- if( 'e' != *pb ){*pathname = PATH_SP, pathname++;} else break; ++ maxlen -= q; ++ pb += r; ++ n -= r; ++ if( 'e' == *pb ) break; ++ if( pathname >= endmax ) return 0; ++ *pathname++ = PATH_SP; + } + *pathname = '\0'; + return (pb - b + 1); +Index: btfiles.cpp +=================================================================== +--- btfiles.cpp (revision 301) ++++ btfiles.cpp (revision 302) +@@ -471,6 +471,8 @@ + BTFILE *pbf_last = (BTFILE*) 0; + BTFILE *pbf = (BTFILE*) 0; + size_t dl; ++ unsigned long nfiles = 0; ++ + if( decode_query(metabuf,metabuf_len,"info|length", + (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ) + return -1; +@@ -524,12 +526,18 @@ + #ifndef WINDOWS + if( !pbf ) return -1; + #endif ++ nfiles++; + pbf->bf_length = t; + m_total_files_length += t; + r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0, + QUERY_POS); +- if( !r ) return -1; +- if(!decode_list2path(p + r, n, path)) return -1; ++ if( !r || !decode_list2path(p + r, n, path, sizeof(path)) ){ ++ CONSOLE.Warning(1, ++ "error, invalid path in torrent data for file %lu at offset %llu", ++ nfiles, m_total_files_length - t); ++ delete pbf; ++ return -1; ++ } + + int f_conv; + char *tmpfn = new char[strlen(path)*2+5]; diff --git a/meta-openpli/recipes-connectivity/ctorrent/files/extended_ctorrent.diff b/meta-openpli/recipes-connectivity/ctorrent/files/extended_ctorrent.diff new file mode 100644 index 0000000000..ca016fe037 --- /dev/null +++ b/meta-openpli/recipes-connectivity/ctorrent/files/extended_ctorrent.diff @@ -0,0 +1,15445 @@ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/aclocal.m4 ctorrent-1.3.4/aclocal.m4 +--- ctorrent-1.3.4.sav/aclocal.m4 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/aclocal.m4 2006-06-28 19:30:02.000000000 +0200 +@@ -1,6 +1,6 @@ +-# generated automatically by aclocal 1.7.6 -*- Autoconf -*- ++# generated automatically by aclocal 1.9.1 -*- Autoconf -*- + +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + # Free Software Foundation, Inc. + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -11,132 +11,9 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + +-# Do all the work for Automake. -*- Autoconf -*- +- +-# This macro actually does too much some checks are only needed if +-# your package does certain things. But this isn't really a big deal. +- +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +-# Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +-# serial 10 +- +-AC_PREREQ([2.54]) +- +-# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +-# the ones we care about. +-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +- +-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +-# AM_INIT_AUTOMAKE([OPTIONS]) +-# ----------------------------------------------- +-# The call with PACKAGE and VERSION arguments is the old style +-# call (pre autoconf-2.50), which is being phased out. PACKAGE +-# and VERSION should now be passed to AC_INIT and removed from +-# the call to AM_INIT_AUTOMAKE. +-# We support both call styles for the transition. After +-# the next Automake release, Autoconf can make the AC_INIT +-# arguments mandatory, and then we can depend on a new Autoconf +-# release and drop the old call support. +-AC_DEFUN([AM_INIT_AUTOMAKE], +-[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +- AC_REQUIRE([AC_PROG_INSTALL])dnl +-# test to see if srcdir already configured +-if test "`cd $srcdir && pwd`" != "`pwd`" && +- test -f $srcdir/config.status; then +- AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +-fi +- +-# test whether we have cygpath +-if test -z "$CYGPATH_W"; then +- if (cygpath --version) >/dev/null 2>/dev/null; then +- CYGPATH_W='cygpath -w' +- else +- CYGPATH_W=echo +- fi +-fi +-AC_SUBST([CYGPATH_W]) +- +-# Define the identity of the package. +-dnl Distinguish between old-style and new-style calls. +-m4_ifval([$2], +-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +- AC_SUBST([PACKAGE], [$1])dnl +- AC_SUBST([VERSION], [$2])], +-[_AM_SET_OPTIONS([$1])dnl +- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl +- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl +- +-_AM_IF_OPTION([no-define],, +-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +- +-# Some tools Automake needs. +-AC_REQUIRE([AM_SANITY_CHECK])dnl +-AC_REQUIRE([AC_ARG_PROGRAM])dnl +-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +-AM_MISSING_PROG(AUTOCONF, autoconf) +-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +-AM_MISSING_PROG(AUTOHEADER, autoheader) +-AM_MISSING_PROG(MAKEINFO, makeinfo) +-AM_MISSING_PROG(AMTAR, tar) +-AM_PROG_INSTALL_SH +-AM_PROG_INSTALL_STRIP +-# We need awk for the "check" target. The system "awk" is bad on +-# some platforms. +-AC_REQUIRE([AC_PROG_AWK])dnl +-AC_REQUIRE([AC_PROG_MAKE_SET])dnl +-AC_REQUIRE([AM_SET_LEADING_DOT])dnl +- +-_AM_IF_OPTION([no-dependencies],, +-[AC_PROVIDE_IFELSE([AC_PROG_CC], +- [_AM_DEPENDENCIES(CC)], +- [define([AC_PROG_CC], +- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +-AC_PROVIDE_IFELSE([AC_PROG_CXX], +- [_AM_DEPENDENCIES(CXX)], +- [define([AC_PROG_CXX], +- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +-]) +-]) +- +- +-# When config.status generates a header, we must update the stamp-h file. +-# This file resides in the same directory as the config header +-# that is generated. The stamp files are numbered to have different names. +- +-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +-# loop where config.status creates the headers, so we can generate +-# our stamp files there. +-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +-[# Compute $1's index in $config_headers. +-_am_stamp_count=1 +-for _am_header in $config_headers :; do +- case $_am_header in +- $1 | $1:* ) +- break ;; +- * ) +- _am_stamp_count=`expr $_am_stamp_count + 1` ;; +- esac +-done +-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +- +-# Copyright 2002 Free Software Foundation, Inc. ++# -*- Autoconf -*- ++# Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++# Generated from amversion.in; do not edit by hand. + + # 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 +@@ -156,18 +33,18 @@ + # ---------------------------- + # Automake X.Y traces this macro to ensure aclocal.m4 has been + # generated from the m4 files accompanying Automake X.Y. +-AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) ++AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + + # AM_SET_CURRENT_AUTOMAKE_VERSION + # ------------------------------- + # Call AM_AUTOMAKE_VERSION so it can be traced. + # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +- [AM_AUTOMAKE_VERSION([1.7.6])]) ++ [AM_AUTOMAKE_VERSION([1.9.1])]) + +-# Helper functions for option handling. -*- Autoconf -*- ++# AM_AUX_DIR_EXPAND + +-# Copyright 2001, 2002 Free Software Foundation, Inc. ++# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + + # 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 +@@ -184,36 +61,54 @@ + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + +-# serial 2 +- +-# _AM_MANGLE_OPTION(NAME) +-# ----------------------- +-AC_DEFUN([_AM_MANGLE_OPTION], +-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +- +-# _AM_SET_OPTION(NAME) +-# ------------------------------ +-# Set option NAME. Presently that only means defining a flag for this option. +-AC_DEFUN([_AM_SET_OPTION], +-[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +- +-# _AM_SET_OPTIONS(OPTIONS) +-# ---------------------------------- +-# OPTIONS is a space-separated list of Automake options. +-AC_DEFUN([_AM_SET_OPTIONS], +-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +- +-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +-# ------------------------------------------- +-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +-AC_DEFUN([_AM_IF_OPTION], +-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +- ++# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets ++# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to ++# `$srcdir', `$srcdir/..', or `$srcdir/../..'. + # +-# Check to make sure that the build environment is sane. ++# Of course, Automake must honor this variable whenever it calls a ++# tool from the auxiliary directory. The problem is that $srcdir (and ++# therefore $ac_aux_dir as well) can be either absolute or relative, ++# depending on how configure is run. This is pretty annoying, since ++# it makes $ac_aux_dir quite unusable in subdirectories: in the top ++# source directory, any form will work fine, but in subdirectories a ++# relative path needs to be adjusted first. ++# ++# $ac_aux_dir/missing ++# fails when called from a subdirectory if $ac_aux_dir is relative ++# $top_srcdir/$ac_aux_dir/missing ++# fails if $ac_aux_dir is absolute, ++# fails when called from a subdirectory in a VPATH build with ++# a relative $ac_aux_dir ++# ++# The reason of the latter failure is that $top_srcdir and $ac_aux_dir ++# are both prefixed by $srcdir. In an in-source build this is usually ++# harmless because $srcdir is `.', but things will broke when you ++# start a VPATH build or use an absolute $srcdir. ++# ++# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, ++# iff we strip the leading $srcdir from $ac_aux_dir. That would be: ++# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` ++# and then we would define $MISSING as ++# MISSING="\${SHELL} $am_aux_dir/missing" ++# This will work as long as MISSING is not called from configure, because ++# unfortunately $(top_srcdir) has no meaning in configure. ++# However there are other variables, like CC, which are often used in ++# configure, and could therefore not use this "fixed" $ac_aux_dir. + # ++# Another solution, used here, is to always expand $ac_aux_dir to an ++# absolute PATH. The drawback is that using absolute paths prevent a ++# configured tree to be moved without reconfiguration. ++ ++AC_DEFUN([AM_AUX_DIR_EXPAND], ++[dnl Rely on autoconf to set up CDPATH properly. ++AC_PREREQ([2.50])dnl ++# expand $ac_aux_dir to an absolute path ++am_aux_dir=`cd $ac_aux_dir && pwd` ++]) + +-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. ++# AM_CONDITIONAL -*- Autoconf -*- ++ ++# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + + # 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 +@@ -230,53 +125,34 @@ + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + +-# serial 3 +- +-# AM_SANITY_CHECK +-# --------------- +-AC_DEFUN([AM_SANITY_CHECK], +-[AC_MSG_CHECKING([whether build environment is sane]) +-# Just in case +-sleep 1 +-echo timestamp > conftest.file +-# Do `set' in a subshell so we don't clobber the current shell's +-# arguments. Must try -L first in case configure is actually a +-# symlink; some systems play weird games with the mod time of symlinks +-# (eg FreeBSD returns the mod time of the symlink's containing +-# directory). +-if ( +- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` +- if test "$[*]" = "X"; then +- # -L didn't work. +- set X `ls -t $srcdir/configure conftest.file` +- fi +- rm -f conftest.file +- if test "$[*]" != "X $srcdir/configure conftest.file" \ +- && test "$[*]" != "X conftest.file $srcdir/configure"; then +- +- # If neither matched, then we have a broken ls. This can happen +- # if, for instance, CONFIG_SHELL is bash and it inherits a +- # broken ls alias from the environment. This has actually +- # happened. Such a system could not be considered "sane". +- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +-alias in your environment]) +- fi ++# serial 6 + +- test "$[2]" = conftest.file +- ) +-then +- # Ok. +- : ++# AM_CONDITIONAL(NAME, SHELL-CONDITION) ++# ------------------------------------- ++# Define a conditional. ++AC_DEFUN([AM_CONDITIONAL], ++[AC_PREREQ(2.52)dnl ++ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], ++ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl ++AC_SUBST([$1_TRUE]) ++AC_SUBST([$1_FALSE]) ++if $2; then ++ $1_TRUE= ++ $1_FALSE='#' + else +- AC_MSG_ERROR([newly created file is older than distributed files! +-Check your system clock]) ++ $1_TRUE='#' ++ $1_FALSE= + fi +-AC_MSG_RESULT(yes)]) +- +-# -*- Autoconf -*- ++AC_CONFIG_COMMANDS_PRE( ++[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then ++ AC_MSG_ERROR([[conditional "$1" was never defined. ++Usually this means the macro was only invoked conditionally.]]) ++fi])]) + ++# serial 7 -*- Autoconf -*- + +-# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. ++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 ++# Free Software Foundation, Inc. + + # 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 +@@ -293,220 +169,12 @@ + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + +-# serial 3 + +-# AM_MISSING_PROG(NAME, PROGRAM) +-# ------------------------------ +-AC_DEFUN([AM_MISSING_PROG], +-[AC_REQUIRE([AM_MISSING_HAS_RUN]) +-$1=${$1-"${am_missing_run}$2"} +-AC_SUBST($1)]) +- +- +-# AM_MISSING_HAS_RUN +-# ------------------ +-# Define MISSING if not defined so far and test if it supports --run. +-# If it does, set am_missing_run to use it, otherwise, to nothing. +-AC_DEFUN([AM_MISSING_HAS_RUN], +-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +-# Use eval to expand $SHELL +-if eval "$MISSING --run true"; then +- am_missing_run="$MISSING --run " +-else +- am_missing_run= +- AC_MSG_WARN([`missing' script is too old or missing]) +-fi +-]) +- +-# AM_AUX_DIR_EXPAND +- +-# Copyright 2001 Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +-# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +-# +-# Of course, Automake must honor this variable whenever it calls a +-# tool from the auxiliary directory. The problem is that $srcdir (and +-# therefore $ac_aux_dir as well) can be either absolute or relative, +-# depending on how configure is run. This is pretty annoying, since +-# it makes $ac_aux_dir quite unusable in subdirectories: in the top +-# source directory, any form will work fine, but in subdirectories a +-# relative path needs to be adjusted first. +-# +-# $ac_aux_dir/missing +-# fails when called from a subdirectory if $ac_aux_dir is relative +-# $top_srcdir/$ac_aux_dir/missing +-# fails if $ac_aux_dir is absolute, +-# fails when called from a subdirectory in a VPATH build with +-# a relative $ac_aux_dir +-# +-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +-# are both prefixed by $srcdir. In an in-source build this is usually +-# harmless because $srcdir is `.', but things will broke when you +-# start a VPATH build or use an absolute $srcdir. +-# +-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +-# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +-# and then we would define $MISSING as +-# MISSING="\${SHELL} $am_aux_dir/missing" +-# This will work as long as MISSING is not called from configure, because +-# unfortunately $(top_srcdir) has no meaning in configure. +-# However there are other variables, like CC, which are often used in +-# configure, and could therefore not use this "fixed" $ac_aux_dir. +-# +-# Another solution, used here, is to always expand $ac_aux_dir to an +-# absolute PATH. The drawback is that using absolute paths prevent a +-# configured tree to be moved without reconfiguration. +- +-# Rely on autoconf to set up CDPATH properly. +-AC_PREREQ([2.50]) +- +-AC_DEFUN([AM_AUX_DIR_EXPAND], [ +-# expand $ac_aux_dir to an absolute path +-am_aux_dir=`cd $ac_aux_dir && pwd` +-]) +- +-# AM_PROG_INSTALL_SH +-# ------------------ +-# Define $install_sh. +- +-# Copyright 2001 Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +-AC_DEFUN([AM_PROG_INSTALL_SH], +-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +-install_sh=${install_sh-"$am_aux_dir/install-sh"} +-AC_SUBST(install_sh)]) +- +-# AM_PROG_INSTALL_STRIP +- +-# Copyright 2001 Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +-# One issue with vendor `install' (even GNU) is that you can't +-# specify the program used to strip binaries. This is especially +-# annoying in cross-compiling environments, where the build's strip +-# is unlikely to handle the host's binaries. +-# Fortunately install-sh will honor a STRIPPROG variable, so we +-# always use install-sh in `make install-strip', and initialize +-# STRIPPROG with the value of the STRIP variable (set by the user). +-AC_DEFUN([AM_PROG_INSTALL_STRIP], +-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +-# Installed binaries are usually stripped using `strip' when the user +-# run `make install-strip'. However `strip' might not be the right +-# tool to use in cross-compilation environments, therefore Automake +-# will honor the `STRIP' environment variable to overrule this program. +-dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +-if test "$cross_compiling" != no; then +- AC_CHECK_TOOL([STRIP], [strip], :) +-fi +-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +-AC_SUBST([INSTALL_STRIP_PROGRAM])]) +- +-# -*- Autoconf -*- +-# Copyright (C) 2003 Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +-# serial 1 +- +-# Check whether the underlying file-system supports filenames +-# with a leading dot. For instance MS-DOS doesn't. +-AC_DEFUN([AM_SET_LEADING_DOT], +-[rm -rf .tst 2>/dev/null +-mkdir .tst 2>/dev/null +-if test -d .tst; then +- am__leading_dot=. +-else +- am__leading_dot=_ +-fi +-rmdir .tst 2>/dev/null +-AC_SUBST([am__leading_dot])]) +- +-# serial 5 -*- Autoconf -*- +- +-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +- +-# 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, or (at your option) +-# any later version. +- +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +- +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +-# 02111-1307, USA. +- +- +-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +-# written in clear, in which case automake, when reading aclocal.m4, +-# will think it sees a *use*, and therefore will trigger all it's +-# C support machinery. Also note that it means that autoscan, seeing +-# CC etc. in the Makefile, will ask for an AC_PROG_CC use... ++# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be ++# written in clear, in which case automake, when reading aclocal.m4, ++# will think it sees a *use*, and therefore will trigger all it's ++# C support machinery. Also note that it means that autoscan, seeing ++# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +@@ -568,7 +236,9 @@ + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c +- : > sub/conftst$i.h ++ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with ++ # Solaris 8's {/usr,}/bin/sh. ++ touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + +@@ -596,9 +266,14 @@ + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings +- # (even with -Werror). So we grep stderr for any message +- # that says an option was ignored. +- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else ++ # or remarks (even with -Werror). So we grep stderr for any message ++ # that says an option was ignored or not supported. ++ # When given -MP, icc 7.0 and 7.1 complain thusly: ++ # icc: Command line warning: ignoring option '-M'; no argument required ++ # The diagnosis changed in icc 8.0: ++ # icc: Command line remark: option '-MP' not supported ++ if (grep 'ignoring option' conftest.err || ++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi +@@ -632,8 +307,8 @@ + # ------------ + AC_DEFUN([AM_DEP_TRACK], + [AC_ARG_ENABLE(dependency-tracking, +-[ --disable-dependency-tracking Speeds up one-time builds +- --enable-dependency-tracking Do not reject slow dependency extractors]) ++[ --disable-dependency-tracking speeds up one-time build ++ --enable-dependency-tracking do not reject slow dependency extractors]) + if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +@@ -644,7 +319,8 @@ + + # Generate code to set up dependency tracking. -*- Autoconf -*- + +-# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 ++# Free Software Foundation, Inc. + + # 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 +@@ -680,27 +356,21 @@ + else + continue + fi +- grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue +- # Extract the definition of DEP_FILES from the Makefile without +- # running `make'. +- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` ++ # Extract the definition of DEPDIR, am__include, and am__quote ++ # from the Makefile without running `make'. ++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue ++ am__include=`sed -n 's/^am__include = //p' < "$mf"` ++ test -z "am__include" && continue ++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it +- U=`sed -n -e '/^U = / s///p' < "$mf"` +- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" +- # We invoke sed twice because it is the simplest approach to +- # changing $(DEPDIR) to its actual value in the expansion. +- for file in `sed -n -e ' +- /^DEP_FILES = .*\\\\$/ { +- s/^DEP_FILES = // +- :loop +- s/\\\\$// +- p +- n +- /\\\\$/ b loop +- p +- } +- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ ++ U=`sed -n 's/^U = //p' < "$mf"` ++ # Find all dependency output files, they are included files with ++ # $(DEPDIR) in their names. We invoke sed twice because it is the ++ # simplest approach to changing $(DEPDIR) to its actual value in the ++ # expansion. ++ for file in `sed -n " ++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue +@@ -726,9 +396,13 @@ + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) + ]) + +-# Check to see how 'make' treats includes. -*- Autoconf -*- ++# Do all the work for Automake. -*- Autoconf -*- + +-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++# This macro actually does too much some checks are only needed if ++# your package does certain things. But this isn't really a big deal. ++ ++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 ++# Free Software Foundation, Inc. + + # 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 +@@ -745,43 +419,223 @@ + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + +-# serial 2 ++# serial 11 + +-# AM_MAKE_INCLUDE() +-# ----------------- +-# Check to see how make treats includes. +-AC_DEFUN([AM_MAKE_INCLUDE], +-[am_make=${MAKE-make} +-cat > confinc << 'END' +-am__doit: +- @echo done +-.PHONY: am__doit +-END +-# If we don't find an include directive, just comment out the code. +-AC_MSG_CHECKING([for style of include used by $am_make]) +-am__include="#" +-am__quote= +-_am_result=none +-# First try GNU make style include. +-echo "include confinc" > confmf +-# We grep out `Entering directory' and `Leaving directory' +-# messages which can occur if `w' ends up in MAKEFLAGS. +-# In particular we don't look at `^make:' because GNU make might +-# be invoked under some other name (usually "gmake"), in which +-# case it prints its new name instead of `make'. +-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then +- am__include=include +- am__quote= +- _am_result=GNU +-fi +-# Now try BSD make style include. +-if test "$am__include" = "#"; then +- echo '.include "confinc"' > confmf +- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then +- am__include=.include +- am__quote="\"" +- _am_result=BSD +- fi ++# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) ++# AM_INIT_AUTOMAKE([OPTIONS]) ++# ----------------------------------------------- ++# The call with PACKAGE and VERSION arguments is the old style ++# call (pre autoconf-2.50), which is being phased out. PACKAGE ++# and VERSION should now be passed to AC_INIT and removed from ++# the call to AM_INIT_AUTOMAKE. ++# We support both call styles for the transition. After ++# the next Automake release, Autoconf can make the AC_INIT ++# arguments mandatory, and then we can depend on a new Autoconf ++# release and drop the old call support. ++AC_DEFUN([AM_INIT_AUTOMAKE], ++[AC_PREREQ([2.58])dnl ++dnl Autoconf wants to disallow AM_ names. We explicitly allow ++dnl the ones we care about. ++m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl ++AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl ++AC_REQUIRE([AC_PROG_INSTALL])dnl ++# test to see if srcdir already configured ++if test "`cd $srcdir && pwd`" != "`pwd`" && ++ test -f $srcdir/config.status; then ++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) ++fi ++ ++# test whether we have cygpath ++if test -z "$CYGPATH_W"; then ++ if (cygpath --version) >/dev/null 2>/dev/null; then ++ CYGPATH_W='cygpath -w' ++ else ++ CYGPATH_W=echo ++ fi ++fi ++AC_SUBST([CYGPATH_W]) ++ ++# Define the identity of the package. ++dnl Distinguish between old-style and new-style calls. ++m4_ifval([$2], ++[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl ++ AC_SUBST([PACKAGE], [$1])dnl ++ AC_SUBST([VERSION], [$2])], ++[_AM_SET_OPTIONS([$1])dnl ++ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl ++ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl ++ ++_AM_IF_OPTION([no-define],, ++[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) ++ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl ++ ++# Some tools Automake needs. ++AC_REQUIRE([AM_SANITY_CHECK])dnl ++AC_REQUIRE([AC_ARG_PROGRAM])dnl ++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) ++AM_MISSING_PROG(AUTOCONF, autoconf) ++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) ++AM_MISSING_PROG(AUTOHEADER, autoheader) ++AM_MISSING_PROG(MAKEINFO, makeinfo) ++AM_PROG_INSTALL_SH ++AM_PROG_INSTALL_STRIP ++AC_REQUIRE([AM_PROG_MKDIR_P])dnl ++# We need awk for the "check" target. The system "awk" is bad on ++# some platforms. ++AC_REQUIRE([AC_PROG_AWK])dnl ++AC_REQUIRE([AC_PROG_MAKE_SET])dnl ++AC_REQUIRE([AM_SET_LEADING_DOT])dnl ++_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], ++ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], ++ [_AM_PROG_TAR([v7])])]) ++_AM_IF_OPTION([no-dependencies],, ++[AC_PROVIDE_IFELSE([AC_PROG_CC], ++ [_AM_DEPENDENCIES(CC)], ++ [define([AC_PROG_CC], ++ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl ++AC_PROVIDE_IFELSE([AC_PROG_CXX], ++ [_AM_DEPENDENCIES(CXX)], ++ [define([AC_PROG_CXX], ++ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ++]) ++]) ++ ++ ++# When config.status generates a header, we must update the stamp-h file. ++# This file resides in the same directory as the config header ++# that is generated. The stamp files are numbered to have different names. ++ ++# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the ++# loop where config.status creates the headers, so we can generate ++# our stamp files there. ++AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], ++[# Compute $1's index in $config_headers. ++_am_stamp_count=1 ++for _am_header in $config_headers :; do ++ case $_am_header in ++ $1 | $1:* ) ++ break ;; ++ * ) ++ _am_stamp_count=`expr $_am_stamp_count + 1` ;; ++ esac ++done ++echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) ++ ++# AM_PROG_INSTALL_SH ++# ------------------ ++# Define $install_sh. ++ ++# Copyright (C) 2001, 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++AC_DEFUN([AM_PROG_INSTALL_SH], ++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl ++install_sh=${install_sh-"$am_aux_dir/install-sh"} ++AC_SUBST(install_sh)]) ++ ++# -*- Autoconf -*- ++# Copyright (C) 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# serial 1 ++ ++# Check whether the underlying file-system supports filenames ++# with a leading dot. For instance MS-DOS doesn't. ++AC_DEFUN([AM_SET_LEADING_DOT], ++[rm -rf .tst 2>/dev/null ++mkdir .tst 2>/dev/null ++if test -d .tst; then ++ am__leading_dot=. ++else ++ am__leading_dot=_ ++fi ++rmdir .tst 2>/dev/null ++AC_SUBST([am__leading_dot])]) ++ ++# Check to see how 'make' treats includes. -*- Autoconf -*- ++ ++# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# serial 2 ++ ++# AM_MAKE_INCLUDE() ++# ----------------- ++# Check to see how make treats includes. ++AC_DEFUN([AM_MAKE_INCLUDE], ++[am_make=${MAKE-make} ++cat > confinc << 'END' ++am__doit: ++ @echo done ++.PHONY: am__doit ++END ++# If we don't find an include directive, just comment out the code. ++AC_MSG_CHECKING([for style of include used by $am_make]) ++am__include="#" ++am__quote= ++_am_result=none ++# First try GNU make style include. ++echo "include confinc" > confmf ++# We grep out `Entering directory' and `Leaving directory' ++# messages which can occur if `w' ends up in MAKEFLAGS. ++# In particular we don't look at `^make:' because GNU make might ++# be invoked under some other name (usually "gmake"), in which ++# case it prints its new name instead of `make'. ++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then ++ am__include=include ++ am__quote= ++ _am_result=GNU ++fi ++# Now try BSD make style include. ++if test "$am__include" = "#"; then ++ echo '.include "confinc"' > confmf ++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then ++ am__include=.include ++ am__quote="\"" ++ _am_result=BSD ++ fi + fi + AC_SUBST([am__include]) + AC_SUBST([am__quote]) +@@ -789,9 +643,10 @@ + rm -f confinc confmf + ]) + +-# AM_CONDITIONAL -*- Autoconf -*- ++# -*- Autoconf -*- ++ + +-# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. ++# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + + # 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 +@@ -808,28 +663,358 @@ + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + +-# serial 5 ++# serial 3 + +-AC_PREREQ(2.52) ++# AM_MISSING_PROG(NAME, PROGRAM) ++# ------------------------------ ++AC_DEFUN([AM_MISSING_PROG], ++[AC_REQUIRE([AM_MISSING_HAS_RUN]) ++$1=${$1-"${am_missing_run}$2"} ++AC_SUBST($1)]) + +-# AM_CONDITIONAL(NAME, SHELL-CONDITION) +-# ------------------------------------- +-# Define a conditional. +-AC_DEFUN([AM_CONDITIONAL], +-[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], +- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +-AC_SUBST([$1_TRUE]) +-AC_SUBST([$1_FALSE]) +-if $2; then +- $1_TRUE= +- $1_FALSE='#' ++ ++# AM_MISSING_HAS_RUN ++# ------------------ ++# Define MISSING if not defined so far and test if it supports --run. ++# If it does, set am_missing_run to use it, otherwise, to nothing. ++AC_DEFUN([AM_MISSING_HAS_RUN], ++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl ++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" ++# Use eval to expand $SHELL ++if eval "$MISSING --run true"; then ++ am_missing_run="$MISSING --run " + else +- $1_TRUE='#' +- $1_FALSE= ++ am_missing_run= ++ AC_MSG_WARN([`missing' script is too old or missing]) + fi +-AC_CONFIG_COMMANDS_PRE( +-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then +- AC_MSG_ERROR([conditional "$1" was never defined. +-Usually this means the macro was only invoked conditionally.]) +-fi])]) ++]) ++ ++# AM_PROG_MKDIR_P ++# --------------- ++# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. ++ ++# Copyright (C) 2003, 2004 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories ++# created by `make install' are always world readable, even if the ++# installer happens to have an overly restrictive umask (e.g. 077). ++# This was a mistake. There are at least two reasons why we must not ++# use `-m 0755': ++# - it causes special bits like SGID to be ignored, ++# - it may be too restrictive (some setups expect 775 directories). ++# ++# Do not use -m 0755 and let people choose whatever they expect by ++# setting umask. ++# ++# We cannot accept any implementation of `mkdir' that recognizes `-p'. ++# Some implementations (such as Solaris 8's) are not thread-safe: if a ++# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' ++# concurrently, both version can detect that a/ is missing, but only ++# one can create it and the other will error out. Consequently we ++# restrict ourselves to GNU make (using the --version option ensures ++# this.) ++AC_DEFUN([AM_PROG_MKDIR_P], ++[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then ++ # We used to keeping the `.' as first argument, in order to ++ # allow $(mkdir_p) to be used without argument. As in ++ # $(mkdir_p) $(somedir) ++ # where $(somedir) is conditionally defined. However this is wrong ++ # for two reasons: ++ # 1. if the package is installed by a user who cannot write `.' ++ # make install will fail, ++ # 2. the above comment should most certainly read ++ # $(mkdir_p) $(DESTDIR)$(somedir) ++ # so it does not work when $(somedir) is undefined and ++ # $(DESTDIR) is not. ++ # To support the latter case, we have to write ++ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), ++ # so the `.' trick is pointless. ++ mkdir_p='mkdir -p --' ++else ++ # On NextStep and OpenStep, the `mkdir' command does not ++ # recognize any option. It will interpret all options as ++ # directories to create, and then abort because `.' already ++ # exists. ++ for d in ./-p ./--version; ++ do ++ test -d $d && rmdir $d ++ done ++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. ++ if test -f "$ac_aux_dir/mkinstalldirs"; then ++ mkdir_p='$(mkinstalldirs)' ++ else ++ mkdir_p='$(install_sh) -d' ++ fi ++fi ++AC_SUBST([mkdir_p])]) ++ ++# Helper functions for option handling. -*- Autoconf -*- ++ ++# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# serial 2 ++ ++# _AM_MANGLE_OPTION(NAME) ++# ----------------------- ++AC_DEFUN([_AM_MANGLE_OPTION], ++[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) ++ ++# _AM_SET_OPTION(NAME) ++# ------------------------------ ++# Set option NAME. Presently that only means defining a flag for this option. ++AC_DEFUN([_AM_SET_OPTION], ++[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) ++ ++# _AM_SET_OPTIONS(OPTIONS) ++# ---------------------------------- ++# OPTIONS is a space-separated list of Automake options. ++AC_DEFUN([_AM_SET_OPTIONS], ++[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) ++ ++# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) ++# ------------------------------------------- ++# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. ++AC_DEFUN([_AM_IF_OPTION], ++[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) ++ ++# ++# Check to make sure that the build environment is sane. ++# ++ ++# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# serial 3 ++ ++# AM_SANITY_CHECK ++# --------------- ++AC_DEFUN([AM_SANITY_CHECK], ++[AC_MSG_CHECKING([whether build environment is sane]) ++# Just in case ++sleep 1 ++echo timestamp > conftest.file ++# Do `set' in a subshell so we don't clobber the current shell's ++# arguments. Must try -L first in case configure is actually a ++# symlink; some systems play weird games with the mod time of symlinks ++# (eg FreeBSD returns the mod time of the symlink's containing ++# directory). ++if ( ++ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` ++ if test "$[*]" = "X"; then ++ # -L didn't work. ++ set X `ls -t $srcdir/configure conftest.file` ++ fi ++ rm -f conftest.file ++ if test "$[*]" != "X $srcdir/configure conftest.file" \ ++ && test "$[*]" != "X conftest.file $srcdir/configure"; then ++ ++ # If neither matched, then we have a broken ls. This can happen ++ # if, for instance, CONFIG_SHELL is bash and it inherits a ++ # broken ls alias from the environment. This has actually ++ # happened. Such a system could not be considered "sane". ++ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken ++alias in your environment]) ++ fi ++ ++ test "$[2]" = conftest.file ++ ) ++then ++ # Ok. ++ : ++else ++ AC_MSG_ERROR([newly created file is older than distributed files! ++Check your system clock]) ++fi ++AC_MSG_RESULT(yes)]) ++ ++# AM_PROG_INSTALL_STRIP ++ ++# Copyright (C) 2001, 2003 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# One issue with vendor `install' (even GNU) is that you can't ++# specify the program used to strip binaries. This is especially ++# annoying in cross-compiling environments, where the build's strip ++# is unlikely to handle the host's binaries. ++# Fortunately install-sh will honor a STRIPPROG variable, so we ++# always use install-sh in `make install-strip', and initialize ++# STRIPPROG with the value of the STRIP variable (set by the user). ++AC_DEFUN([AM_PROG_INSTALL_STRIP], ++[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl ++# Installed binaries are usually stripped using `strip' when the user ++# run `make install-strip'. However `strip' might not be the right ++# tool to use in cross-compilation environments, therefore Automake ++# will honor the `STRIP' environment variable to overrule this program. ++dnl Don't test for $cross_compiling = yes, because it might be `maybe'. ++if test "$cross_compiling" != no; then ++ AC_CHECK_TOOL([STRIP], [strip], :) ++fi ++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" ++AC_SUBST([INSTALL_STRIP_PROGRAM])]) ++ ++# Check how to create a tarball. -*- Autoconf -*- ++ ++# Copyright (C) 2004 Free Software Foundation, Inc. ++ ++# 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, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++# 02111-1307, USA. ++ ++# serial 1 ++ ++ ++# _AM_PROG_TAR(FORMAT) ++# -------------------- ++# Check how to create a tarball in format FORMAT. ++# FORMAT should be one of `v7', `ustar', or `pax'. ++# ++# Substitute a variable $(am__tar) that is a command ++# writing to stdout a FORMAT-tarball containing the directory ++# $tardir. ++# tardir=directory && $(am__tar) > result.tar ++# ++# Substitute a variable $(am__untar) that extract such ++# a tarball read from stdin. ++# $(am__untar) < result.tar ++AC_DEFUN([_AM_PROG_TAR], ++[# Always define AMTAR for backward compatibility. ++AM_MISSING_PROG([AMTAR], [tar]) ++m4_if([$1], [v7], ++ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], ++ [m4_case([$1], [ustar],, [pax],, ++ [m4_fatal([Unknown tar format])]) ++AC_MSG_CHECKING([how to create a $1 tar archive]) ++# Loop over all known methods to create a tar archive until one works. ++_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' ++_am_tools=${am_cv_prog_tar_$1-$_am_tools} ++# Do not fold the above two line into one, because Tru64 sh and ++# Solaris sh will not grok spaces in the rhs of `-'. ++for _am_tool in $_am_tools ++do ++ case $_am_tool in ++ gnutar) ++ for _am_tar in tar gnutar gtar; ++ do ++ AM_RUN_LOG([$_am_tar --version]) && break ++ done ++ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' ++ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' ++ am__untar="$_am_tar -xf -" ++ ;; ++ plaintar) ++ # Must skip GNU tar: if it does not support --format= it doesn't create ++ # ustar tarball either. ++ (tar --version) >/dev/null 2>&1 && continue ++ am__tar='tar chf - "$$tardir"' ++ am__tar_='tar chf - "$tardir"' ++ am__untar='tar xf -' ++ ;; ++ pax) ++ am__tar='pax -L -x $1 -w "$$tardir"' ++ am__tar_='pax -L -x $1 -w "$tardir"' ++ am__untar='pax -r' ++ ;; ++ cpio) ++ am__tar='find "$$tardir" -print | cpio -o -H $1 -L' ++ am__tar_='find "$tardir" -print | cpio -o -H $1 -L' ++ am__untar='cpio -i -H $1 -d' ++ ;; ++ none) ++ am__tar=false ++ am__tar_=false ++ am__untar=false ++ ;; ++ esac ++ ++ # If the value was cached, stop now. We just wanted to have am__tar ++ # and am__untar set. ++ test -n "${am_cv_prog_tar_$1}" && break ++ ++ # tar/untar a dummy directory, and stop if the command works ++ rm -rf conftest.dir ++ mkdir conftest.dir ++ echo GrepMe > conftest.dir/file ++ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) ++ rm -rf conftest.dir ++ if test -s conftest.tar; then ++ AM_RUN_LOG([$am__untar /dev/null 2>&1 && break ++ fi ++done ++rm -rf conftest.dir ++ ++AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) ++AC_MSG_RESULT([$am_cv_prog_tar_$1])]) ++AC_SUBST([am__tar]) ++AC_SUBST([am__untar]) ++]) # _AM_PROG_TAR + +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bencode.cpp ctorrent-1.3.4/bencode.cpp +--- ctorrent-1.3.4.sav/bencode.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bencode.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,6 +1,6 @@ ++#include "./def.h" + #include + +-#include "./def.h" + #include "bencode.h" + + #ifndef WINDOWS +@@ -29,7 +29,7 @@ + return keylen; + } + +-size_t buf_int(const char *b,size_t len,char beginchar,char endchar,size_t *pi) ++size_t buf_long(const char *b,size_t len,char beginchar,char endchar,int64_t *pi) + { + const char *p = b; + const char *psave; +@@ -46,12 +46,26 @@ + if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0; + + if( pi ){ +- if( beginchar ) *pi = (size_t)strtol(b + 1,(char**) 0,10); +- else *pi=(size_t)strtol(b,(char**) 0,10); ++ if( beginchar ) *pi = strtoll(b + 1,(char**) 0,10); ++ else *pi=strtoll(b,(char**) 0,10); + } + return (size_t)( p - b + 1 ); + } + ++size_t buf_int(const char *b,size_t len,char beginchar,char endchar,size_t *pi) ++{ ++ size_t r; ++ ++ if( pi ){ ++ int64_t pl; ++ r = buf_long(b,len,beginchar,endchar,&pl); ++ *pi = (size_t) pl; ++ }else{ ++ r = buf_long(b,len,beginchar,endchar,(int64_t*) 0); ++ } ++ return r; ++} ++ + size_t buf_str(const char *b,size_t len,const char **pstr,size_t* slen) + { + size_t rl,sl; +@@ -69,7 +83,7 @@ + + size_t decode_int(const char *b,size_t len) + { +- return(buf_int(b,len,'i','e',(size_t*) 0)); ++ return(buf_long(b,len,'i','e',(int64_t*) 0)); + } + + size_t decode_str(const char *b,size_t len) +@@ -136,7 +150,7 @@ + } + } + +-size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int method) ++size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method) + { + size_t pos; + char kl[KEYNAME_LISTSIZ]; +@@ -147,8 +161,9 @@ + case QUERY_STR: return(buf_str(b + pos,len - pos, ps, pi)); + case QUERY_INT: return(buf_int(b + pos,len - pos, 'i', 'e', pi)); + case QUERY_POS: +- if(pi) *pi = decode_rev(b + pos, len - pos, (const char*) 0); +- return pos; ++ if(pi) *pi = decode_rev(b + pos, len - pos, (const char*) 0); ++ return pos; ++ case QUERY_LONG: return(buf_long(b + pos,len - pos, 'i', 'e', pl)); + default: return 0; + } + } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bencode.h ctorrent-1.3.4/bencode.h +--- ctorrent-1.3.4.sav/bencode.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bencode.h 2006-06-28 19:30:02.000000000 +0200 +@@ -13,7 +13,9 @@ + #define QUERY_STR 0 + #define QUERY_INT 1 + #define QUERY_POS 2 ++#define QUERY_LONG 3 + ++size_t buf_long(const char *b,size_t len,char beginchar,char endchar,int64_t *pi); + size_t buf_int(const char *b,size_t len,char beginchar,char endchar,size_t *pi); + size_t buf_str(const char *b,size_t len,const char **pstr,size_t* slen); + size_t decode_int(const char *b,size_t len); +@@ -21,7 +23,7 @@ + size_t decode_dict(const char *b,size_t len,const char *keylist); + size_t decode_list(const char *b,size_t len,const char *keylist); + size_t decode_rev(const char *b,size_t len,const char *keylist); +-size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int method); ++size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method); + size_t decode_list2path(const char *b, size_t n, char *pathname); + size_t bencode_buf(const char *str,size_t len,FILE *fp); + size_t bencode_str(const char *str, FILE *fp); +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bitfield.cpp ctorrent-1.3.4/bitfield.cpp +--- ctorrent-1.3.4.sav/bitfield.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bitfield.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -143,8 +143,8 @@ + size_t s = nset; + for( ; i < nbytes - 1; i++ ) b[i] = ~b[i]; + +- if( nbits % nbytes ){ +- for( i = 8 * (nbytes - 1); i < nbits; i++ ) if( _isset(i) ) UnSet(i); else Set(i); ++ if( nbits % 8 ){ ++ for( i = 8 * (nbytes - 1); i < nbits; i++ ) if( _isset(i) ) UnSet(i); else _set(i); + }else + b[nbytes - 1] = ~b[nbytes - 1]; + +@@ -152,6 +152,16 @@ + } + } + ++// _set() sets the bit but doesn't increment nset or set the isfull case. ++// Use instead of Set() when you know nset is incorrect and will be corrected ++// afterward (as in Invert or by _recalc), ++// and either bitfield won't get full or you'll _recalc() afterward to fix it. ++void BitField::_set(size_t idx) ++{ ++ if( idx < nbits && !_isfull() && !_isset(idx) ) ++ b[idx / 8] |= BIT_HEX[idx % 8]; ++} ++ + void BitField::Comb(const BitField &bf) + { + size_t i; +@@ -167,7 +177,10 @@ + { + size_t i; + char c; +- if( bf.nset != 0 ){ ++ if( _isfull_sp(bf) ){ ++ SetAll(); ++ Invert(); ++ }else if( bf.nset != 0 ){ + if( nset >= nbits ){ + b = new unsigned char[nbytes]; + #ifndef WINDOWS +@@ -184,6 +197,26 @@ + } + } + ++void BitField::And(const BitField &bf) ++{ ++ size_t i; ++ ++ if( bf.nset == 0 ){ ++ SetAll(); ++ Invert(); ++ }else if( !_isfull_sp(bf) ){ ++ if( nset >= nbits ){ ++ b = new unsigned char[nbytes]; ++#ifndef WINDOWS ++ if( !b ) throw 9; ++#endif ++ _setall(b); ++ } ++ for(i = 0; i < nbytes; i++) b[i] &= bf.b[i]; ++ _recalc(); ++ } ++} ++ + size_t BitField::Random() const + { + size_t idx; +@@ -300,3 +333,4 @@ + fclose(fp); + return -1; + } ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bitfield.h ctorrent-1.3.4/bitfield.h +--- ctorrent-1.3.4.sav/bitfield.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bitfield.h 2006-06-28 19:30:02.000000000 +0200 +@@ -14,6 +14,7 @@ + + inline void _recalc(); + inline void _setall(unsigned char* buf); ++ inline void _set(size_t idx); + + public: + BitField(); +@@ -40,6 +41,7 @@ + void Comb(const BitField &bf); + void Except(const BitField &bf); + void Invert(); ++ void And(const BitField &bf); + + int WriteToFile(const char *fname); + int SetReferFile(const char *fname); +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btconfig.cpp ctorrent-1.3.4/btconfig.cpp +--- ctorrent-1.3.4.sav/btconfig.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btconfig.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,19 +1,23 @@ + #include + +-size_t cfg_req_slice_size = 32768; ++size_t cfg_req_slice_size = 16384; ++size_t cfg_req_queue_length = 74; + + size_t cfg_cache_size = 16; + + size_t cfg_max_peers = 100; +-size_t cfg_min_peers = 40; ++size_t cfg_min_peers = 1; + ++unsigned long cfg_listen_ip = 0; + int cfg_listen_port = 0; + int cfg_max_listen_port = 2706; + int cfg_min_listen_port = 2106; + +-int cfg_max_bandwidth = -1; ++int cfg_max_bandwidth_down = -1; ++int cfg_max_bandwidth_up = -1; + + time_t cfg_seed_hours = 72; ++double cfg_seed_ratio = 0; + + // arguments global value + char *arg_metainfo_file = (char*) 0; +@@ -25,6 +29,12 @@ + unsigned char arg_flg_check_only = 0; + unsigned char arg_flg_exam_only = 0; + unsigned char arg_flg_make_torrent = 0; ++size_t arg_file_to_download = 0; ++unsigned char arg_verbose = 0; + + size_t arg_piece_length = 262144; + char *arg_announce = (char*) 0; ++ ++char *arg_ctcs = (char*) 0; ++int cfg_exit_zero_peers = 0; ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btconfig.h ctorrent-1.3.4/btconfig.h +--- ctorrent-1.3.4.sav/btconfig.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btconfig.h 2006-06-28 19:30:02.000000000 +0200 +@@ -4,24 +4,32 @@ + extern size_t cfg_req_slice_size; + + #define MAX_METAINFO_FILESIZ 4194304 +-#define cfg_max_slice_size 131072 +-#define cfg_req_queue_length 64 ++// According to specs the max slice size is 128K. But most clients do not ++// accept a value that large, so we limit to 64K. Note that there is a ++// comparison in RequestQueue::IsValidRequest() (see btrequest.cpp) that ++// doubles the value so that we will accept a request for 128K. ++#define cfg_max_slice_size 65536 ++extern size_t cfg_req_queue_length; + #define MAX_PF_LEN 8 + #define PEER_ID_LEN 20 +-#define PEER_PFX "-CT1304-" ++#define PEER_PFX "-CD0200-" + + extern size_t cfg_cache_size; + + extern size_t cfg_max_peers; + extern size_t cfg_min_peers; + ++extern unsigned long cfg_listen_ip; + extern int cfg_listen_port; + extern int cfg_max_listen_port; + extern int cfg_min_listen_port; + + extern time_t cfg_seed_hours; ++extern double cfg_seed_ratio; + + extern int cfg_max_bandwidth; ++extern int cfg_max_bandwidth_down; ++extern int cfg_max_bandwidth_up; + + // arguments global value + extern char *arg_metainfo_file; +@@ -33,7 +41,12 @@ + extern unsigned char arg_flg_check_only; + extern unsigned char arg_flg_exam_only; + extern unsigned char arg_flg_make_torrent; ++extern size_t arg_file_to_download; ++extern unsigned char arg_verbose; + + extern size_t arg_piece_length; + extern char *arg_announce; ++ ++extern char *arg_ctcs; ++extern int cfg_exit_zero_peers; + #endif +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btcontent.cpp ctorrent-1.3.4/btcontent.cpp +--- ctorrent-1.3.4.sav/btcontent.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btcontent.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -9,8 +9,12 @@ + #else + #include + #include ++#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBMD) || defined(HAVE_LIBCRYPTO) ++#include ++#elif defined(HAVE_LIBSSL) + #include + #endif ++#endif + + #include + #include +@@ -23,10 +27,15 @@ + #include "bencode.h" + #include "peer.h" + #include "httpencode.h" ++#include "tracker.h" ++ ++#if defined(USE_STANDALONE_SHA1) ++#include "sha1.h" ++#endif + +-#define meta_str(keylist,pstr,pint) decode_query(b,flen,(keylist),(pstr),(pint),QUERY_STR) +-#define meta_int(keylist,pint) decode_query(b,flen,(keylist),(const char**) 0,(pint),QUERY_INT) +-#define meta_pos(keylist) decode_query(b,flen,(keylist),(const char**) 0,(size_t*) 0,QUERY_POS) ++#define meta_str(keylist,pstr,pint) decode_query(b,flen,(keylist),(pstr),(pint),(int64_t*) 0,QUERY_STR) ++#define meta_int(keylist,pint) decode_query(b,flen,(keylist),(const char**) 0,(pint),(int64_t*) 0,QUERY_INT) ++#define meta_pos(keylist) decode_query(b,flen,(keylist),(const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_POS) + + #define CACHE_FIT(ca,roff,rlen) \ + (max_u_int64_t((ca)->bc_off,(roff)) <= \ +@@ -38,6 +47,12 @@ + + static void Sha1(char *ptr,size_t len,unsigned char *dm) + { ++#if defined(USE_STANDALONE_SHA1) ++ SHA1_CTX context; ++ SHA1Init(&context); ++ SHA1Update(&context,(unsigned char*)ptr,len); ++ SHA1Final(dm,&context); ++#else + #ifdef WINDOWS + ; + #else +@@ -46,6 +61,7 @@ + SHA1_Update(&context,(unsigned char*)ptr,len); + SHA1_Final(dm,&context); + #endif ++#endif + } + + btContent::btContent() +@@ -53,6 +69,7 @@ + m_announce = global_piece_buffer = (char*) 0; + m_hash_table = (unsigned char *) 0; + pBF = (BitField*) 0; ++ pBFilter = (BitField*) 0; + m_create_date = m_seed_timestamp = (time_t) 0; + time(&m_start_timestamp); + m_cache = (BTCACHE*) 0; +@@ -121,7 +138,8 @@ + m_piece_length *= 65536; + } + +- if( !m_piece_length || m_piece_length > cfg_req_queue_length * cfg_req_slice_size ) ++ // This is really just a sanity check on the piece length to create. ++ if( !m_piece_length || m_piece_length > 4096*1024 ) + m_piece_length = 262144; + + m_announce = ann_url; +@@ -209,26 +227,24 @@ + if(!meta_int("info|piece length",&m_piece_length)) ERR_RETURN(); + m_npieces = m_hashtable_length / 20; + +- if( m_piece_length > cfg_max_slice_size * cfg_req_queue_length ){ +- fprintf(stderr,"error, piece length too long[%u]. please recompile CTorrent with a larger cfg_max_slice_size in .\n", m_piece_length); +- ERR_RETURN(); +- } ++ cfg_req_queue_length = (m_piece_length / cfg_req_slice_size) * 2 - 1; + + if( m_piece_length < cfg_req_slice_size ) + cfg_req_slice_size = m_piece_length; +- else{ +- for( ;(m_piece_length / cfg_req_slice_size) >= cfg_req_queue_length; ){ +- cfg_req_slice_size *= 2; +- if( cfg_req_slice_size > cfg_max_slice_size ) ERR_RETURN(); +- } +- } + + if( m_btfiles.BuildFromMI(b, flen, saveas) < 0) ERR_RETURN(); + + delete []b; +- PrintOut(); ++ b = (char *)0; + +- if( arg_flg_exam_only ) return 0; ++ if( arg_flg_exam_only ){ ++ PrintOut(); ++ return 0; ++ }else{ ++ arg_flg_exam_only = 1; ++ PrintOut(); ++ arg_flg_exam_only = 0; ++ } + + if( ( r = m_btfiles.CreateFiles() ) < 0) ERR_RETURN(); + +@@ -242,6 +258,17 @@ + if( !pBF ) ERR_RETURN(); + #endif + ++ //create the file filter ++ pBFilter = new BitField(m_npieces); ++#ifndef WINDOWS ++ if( !pBFilter ) ERR_RETURN(); ++#endif ++ if(arg_file_to_download>0){ ++ m_btfiles.SetFilter(arg_file_to_download,pBFilter,m_piece_length); ++ } ++ ++ ++ + m_left_bytes = m_btfiles.GetTotalLength() / m_piece_length; + if( m_btfiles.GetTotalLength() % m_piece_length ) m_left_bytes++; + if( m_left_bytes != m_npieces ) ERR_RETURN(); +@@ -252,13 +279,13 @@ + + if( !arg_flg_check_only ){ + if( pBF->SetReferFile(arg_bitfield_file) >= 0){ +- size_t idx; +- r = 0; +- for( idx = 0; idx < m_npieces; idx++ ) +- if( pBF->IsSet(idx) ) m_left_bytes -= GetPieceLength(idx); ++ size_t idx; ++ r = 0; ++ for( idx = 0; idx < m_npieces; idx++ ) ++ if( pBF->IsSet(idx) ) m_left_bytes -= GetPieceLength(idx); + } + else{ +- fprintf(stderr,"warn, couldn't set bit field refer file %s.\n",arg_bitfield_file); ++ fprintf(stderr,"warn, couldn't set bit field refer file %s.\n",arg_bitfield_file); + } + } + +@@ -271,7 +298,9 @@ + CheckExist(); + } + +- printf("Already/Total: %u/%u\n",pBF->Count(),m_npieces); ++ PrintOut(); ++ printf("Already/Total: %u/%u (%d%%)\n",pBF->Count(),m_npieces, ++ 100 * pBF->Count() / m_npieces); + + if( arg_flg_check_only ){ + if( arg_bitfield_file ) pBF->WriteToFile(arg_bitfield_file); +@@ -285,11 +314,11 @@ + memset(ptr,0,8); // reserved set zero. + + { // peer id +- char *sptr = arg_user_agent; +- char *dptr = (char *)m_shake_buffer + 48; +- char *eptr = dptr + PEER_ID_LEN; +- while (*sptr) *dptr++ = *sptr++; +- while (dptr < eptr) *dptr++ = (unsigned char)random(); ++ char *sptr = arg_user_agent; ++ char *dptr = (char *)m_shake_buffer + 48; ++ char *eptr = dptr + PEER_ID_LEN; ++ while (*sptr) *dptr++ = *sptr++; ++ while (dptr < eptr) *dptr++ = (unsigned char)random(); + } + return 0; + } +@@ -309,7 +338,8 @@ + + ssize_t btContent::ReadSlice(char *buf,size_t idx,size_t off,size_t len) + { +- u_int64_t offset = idx * m_piece_length + off; ++ //changed ++ u_int64_t offset = (u_int64_t)idx * (u_int64_t)m_piece_length + (u_int64_t)off; + + if( !m_cache_size ) return m_btfiles.IO(buf, offset, len, 0); + else{ +@@ -322,16 +352,16 @@ + for( ; len && p && CACHE_FIT(p, offset, len);){ + flg_rescan = 0; + if( offset < p->bc_off ){ +- len2 = p->bc_off - offset; +- if( CacheIO(buf, offset, len2, 0) < 0) return -1; +- flg_rescan = 1; ++ len2 = p->bc_off - offset; ++ if( CacheIO(buf, offset, len2, 0) < 0) return -1; ++ flg_rescan = 1; + }else if( offset > p->bc_off ){ +- len2 = p->bc_off + p->bc_len - offset; +- if( len2 > len ) len2 = len; +- memcpy(buf, p->bc_buf + offset - p->bc_off, len2); ++ len2 = p->bc_off + p->bc_len - offset; ++ if( len2 > len ) len2 = len; ++ memcpy(buf, p->bc_buf + offset - p->bc_off, len2); + }else{ +- len2 = (len > p->bc_len) ? p->bc_len : len; +- memcpy(buf, p->bc_buf, len2); ++ len2 = (len > p->bc_len) ? p->bc_len : len; ++ memcpy(buf, p->bc_buf, len2); + } + + buf += len2; +@@ -339,14 +369,14 @@ + len -= len2; + + if( len ){ +- if( flg_rescan ){ +- for( p = m_cache; +- p && (offset + len) > p->bc_off && !CACHE_FIT(p,offset,len); +- p = p->bc_next) ; +- }else{ +- time(&p->bc_last_timestamp); +- p = p->bc_next; +- } ++ if( flg_rescan ){ ++ for( p = m_cache; ++ p && (offset + len) > p->bc_off && !CACHE_FIT(p,offset,len); ++ p = p->bc_next) ; ++ }else{ ++ time(&p->bc_last_timestamp); ++ p = p->bc_next; ++ } + } + }// end for; + +@@ -399,13 +429,17 @@ + if( p->bc_f_flush ){ + p->bc_f_flush = 0; + if(m_btfiles.IO(p->bc_buf, p->bc_off, p->bc_len, 1) < 0) +- fprintf(stderr,"warn, write file failed while flush cache.\n"); ++ fprintf(stderr,"warn, write file failed while flush cache.\n"); + } + } + + ssize_t btContent::WriteSlice(char *buf,size_t idx,size_t off,size_t len) + { +- u_int64_t offset = (u_int64_t)(idx * m_piece_length + off); ++ //u_int64_t offset = (u_int64_t)(idx * m_piece_length + off); ++ //changed ++ u_int64_t offset = (u_int64_t)idx * (u_int64_t)m_piece_length + (u_int64_t)off; ++ ++ // printf("\nOffset-write: %lu - Piece:%lu\n",offset,(unsigned long)idx); + + if( !m_cache_size ) return m_btfiles.IO(buf, offset, len, 1); + else{ +@@ -418,18 +452,18 @@ + for( ; len && p && CACHE_FIT(p, offset, len);){ + flg_rescan = 0; + if( offset < p->bc_off ){ +- len2 = p->bc_off - offset; +- if( CacheIO(buf, offset, len2, 1) < 0) return -1; +- flg_rescan = 1; ++ len2 = p->bc_off - offset; ++ if( CacheIO(buf, offset, len2, 1) < 0) return -1; ++ flg_rescan = 1; + }else if( offset > p->bc_off ){ +- len2 = p->bc_off + p->bc_len - offset; +- if( len2 > len ) len2 = len; +- memcpy(p->bc_buf + offset - p->bc_off, buf, len2); +- p->bc_f_flush = 1; ++ len2 = p->bc_off + p->bc_len - offset; ++ if( len2 > len ) len2 = len; ++ memcpy(p->bc_buf + offset - p->bc_off, buf, len2); ++ p->bc_f_flush = 1; + }else{ +- len2 = (len > p->bc_len) ? p->bc_len : len; +- memcpy(p->bc_buf, buf, len2); +- p->bc_f_flush = 1; ++ len2 = (len > p->bc_len) ? p->bc_len : len; ++ memcpy(p->bc_buf, buf, len2); ++ p->bc_f_flush = 1; + } + + buf += len2; +@@ -437,12 +471,12 @@ + len -= len2; + + if( len ){ +- if( flg_rescan ){ +- for( p = m_cache; p && (offset + len) > p->bc_off && !CACHE_FIT(p,offset,len); p = p->bc_next) ; +- }else{ +- time(&p->bc_last_timestamp); +- p = p->bc_next; +- } ++ if( flg_rescan ){ ++ for( p = m_cache; p && (offset + len) > p->bc_off && !CACHE_FIT(p,offset,len); p = p->bc_next) ; ++ }else{ ++ time(&p->bc_last_timestamp); ++ p = p->bc_next; ++ } + } + }// end for; + +@@ -514,12 +548,12 @@ + if( !percent ) percent = 1; + + for( ; idx < m_npieces; idx++){ +- if( GetHashValue(idx, md) == 0 && memcmp(md, m_hash_table + idx * 20, 20) == 0){ +- m_left_bytes -= GetPieceLength(idx); +- pBF->Set(idx); ++ if( GetHashValue(idx, md) == 0 && memcmp(md, m_hash_table + idx * 20, 20) == 0){ ++ m_left_bytes -= GetPieceLength(idx); ++ pBF->Set(idx); + } +- if(idx % percent == 0){ +- printf("\rCheck exist: %d/%d",idx,pBF->NBits()); ++ if(idx % percent == 0 || idx == m_npieces-1){ ++ printf("\rCheck exist: %d/%d",idx+1,pBF->NBits()); + fflush(stdout); + } + } +@@ -575,7 +609,6 @@ + fprintf(stderr,"warn,piece %d hash check failed.\n",idx); + return 0; + } +- + pBF->Set(idx); + m_left_bytes -= GetPieceLength(idx); + return 1; +@@ -590,8 +623,10 @@ + + int btContent::SeedTimeout(const time_t *pnow) + { ++ u_int64_t dl; + if( pBF->IsFull() ){ + if( !m_seed_timestamp ){ ++ Tracker.Reset(1); + Self.ResetDLTimer(); + Self.ResetULTimer(); + ReleaseHashTable(); +@@ -599,9 +634,27 @@ + FlushCache(); + printf("\nDownload complete.\n"); + printf("Total time used: %lu minutes.\n",(*pnow - m_start_timestamp) / 60); +- printf("Seed for other %lu hours.\n\n", cfg_seed_hours); ++ printf("Seed for other %lu hours", cfg_seed_hours); ++ if(cfg_seed_ratio) printf(" or to ratio of %f", cfg_seed_ratio); ++ printf(".\n\n"); + } +- if( (*pnow - m_seed_timestamp) >= (cfg_seed_hours * 60 * 60) ) return 1; ++ dl = (Self.TotalDL() > 0) ? Self.TotalDL() : GetTotalFilesLength(); ++ if( (cfg_seed_ratio == 0 && cfg_seed_hours == 0) || ++ (cfg_seed_hours > 0 && ++ (*pnow - m_seed_timestamp) >= (cfg_seed_hours * 60 * 60)) || ++ (cfg_seed_ratio > 0 && ++ cfg_seed_ratio <= Self.TotalUL() / dl) ) return 1; + } + return 0; + } ++ ++ ++size_t btContent::getFilePieces(size_t nfile){ ++ return m_btfiles.getFilePieces(nfile); ++} ++ ++ ++void btContent::SetFilter(){ ++ m_btfiles.SetFilter(arg_file_to_download,pBFilter,m_piece_length); ++} ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btcontent.h ctorrent-1.3.4/btcontent.h +--- ctorrent-1.3.4.sav/btcontent.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btcontent.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,9 +1,8 @@ + #ifndef BTCONTENT_H + #define BTCONTENT_H + +-#include +- + #include "def.h" ++#include + + #include + #include "bitfield.h" +@@ -60,6 +59,7 @@ + + public: + BitField *pBF; ++ BitField *pBFilter; + char *global_piece_buffer; + + btContent(); +@@ -93,6 +93,15 @@ + + int PrintOut(); + int SeedTimeout(const time_t *pnow); ++ ++ ++ void SetFilter(); ++ void SetTmpFilter(int nfile, BitField *pFilter) { m_btfiles.SetFilter(nfile, pFilter, m_piece_length); } ++ size_t getFilePieces(size_t nfile); ++ ++ BTFILE *GetNextFile(BTFILE *file) { return m_btfiles.GetNextFile(file); } ++ time_t GetStartTime() { return m_start_timestamp; } ++ time_t GetSeedTime() { return m_seed_timestamp; } + }; + + extern btContent BTCONTENT; +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btfiles.cpp ctorrent-1.3.4/btfiles.cpp +--- ctorrent-1.3.4.sav/btfiles.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btfiles.cpp 2006-06-28 19:30:13.000000000 +0200 +@@ -8,8 +8,12 @@ + #include + #include + #include ++#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBMD) || defined(HAVE_LIBCRYPTO) ++#include ++#elif defined(HAVE_LIBSSL) + #include + #endif ++#endif + + #include + #include +@@ -19,6 +23,9 @@ + #include + + #include "bencode.h" ++#include "btconfig.h" ++#include "btcontent.h" ++#include "bitfield.h" + + #define MAX_OPEN_FILES 20 + +@@ -66,7 +73,7 @@ + for(pbf_n = m_btfhead; pbf_n ; pbf_n = pbf_n->bf_next){ + if(!pbf_n->bf_flag_opened) continue; // file not been opened. + if( !pbf_close || pbf_n->bf_last_timestamp < pbf_close->bf_last_timestamp) +- pbf_close = pbf_n; ++ pbf_close = pbf_n; + } + if(!pbf_close || fclose(pbf_close->bf_fp) < 0) return -1; + pbf_close->bf_flag_opened = 0; +@@ -90,7 +97,7 @@ + ssize_t btFiles::IO(char *buf, u_int64_t off, size_t len, const int iotype) + { + u_int64_t n = 0; +- size_t pos,nio; ++ off_t pos,nio; + BTFILE *pbf = m_btfhead; + + if( ( off + (u_int64_t)len ) > m_total_files_length) return -1; +@@ -102,16 +109,21 @@ + + if( !pbf ) return -1; + +- pos = (size_t) (off - (n - pbf->bf_length)); ++ pos = off - (n - pbf->bf_length); + + for(; len ;){ ++ + if( !pbf->bf_flag_opened ){ + if( _btf_open(pbf) < 0 ) return -1; + } + + if( m_flag_automanage ) time(&pbf->bf_last_timestamp); + ++#ifdef HAVE_FSEEKO ++ if( fseeko(pbf->bf_fp,pos,SEEK_SET) < 0) return -1; ++#else + if( fseek(pbf->bf_fp,(long) pos,SEEK_SET) < 0) return -1; ++#endif + + nio = (len < pbf->bf_length - pos) ? len : (pbf->bf_length - pos); + +@@ -119,6 +131,7 @@ + if( 1 != fread(buf,nio,1,pbf->bf_fp) ) return -1; + }else{ + if( 1 != fwrite(buf,nio,1,pbf->bf_fp) ) return -1; ++ fflush(pbf->bf_fp); + } + + len -= nio; +@@ -149,14 +162,21 @@ + return 0; + } + +-int btFiles::_btf_ftruncate(int fd,size_t length) ++int btFiles::_btf_ftruncate(int fd,int64_t length) + { + #ifdef WINDOWS + char c = (char)0; + if(lseek(fd,length - 1, SEEK_SET) < 0 ) return -1; + return write(fd, &c, 1); + #else +- return ftruncate(fd,length); ++ // ftruncate() not allowed on [v]fat under linux ++ int retval = ftruncate(fd,length); ++ if( retval < 0 ) { ++ char c = (char)0; ++ if(lseek(fd,length - 1, SEEK_SET) < 0 ) return -1; ++ return write(fd, &c, 1); ++ } ++ else return retval; + #endif + } + +@@ -169,7 +189,7 @@ + DIR *dp; + BTFILE *pbf; + +- if( !getwd(full_cur) ) return -1; ++ if( !getcwd(full_cur,MAXPATHLEN) ) return -1; + + if( cur_path ){ + strcpy(fn, full_cur); +@@ -185,12 +205,12 @@ + while( (struct dirent*) 0 != (dirp = readdir(dp)) ){ + + if( 0 == strcmp(dirp->d_name, ".") || +- 0 == strcmp(dirp->d_name, "..") ) continue; ++ 0 == strcmp(dirp->d_name, "..") ) continue; + + if( cur_path ){ + if(MAXPATHLEN < snprintf(fn, MAXPATHLEN, "%s%c%s", cur_path, PATH_SP, dirp->d_name)){ +- fprintf(stderr,"error, pathname too long\n"); +- return -1; ++ fprintf(stderr,"error, pathname too long\n"); ++ return -1; + } + }else{ + strcpy(fn, dirp->d_name); +@@ -232,7 +252,7 @@ + return 0; + } + +-int btFiles::_btf_creat_by_path(const char *pathname, size_t file_length) ++int btFiles::_btf_creat_by_path(const char *pathname, int64_t file_length) + { + struct stat sb; + int fd; +@@ -251,17 +271,17 @@ + *p = '\0'; + if(stat(sp,&sb) < 0){ + if( ENOENT == errno ){ +- if( !last ){ ++ if( !last ){ + #ifdef WINDOWS +- if(mkdir(sp) < 0) break; ++ if(mkdir(sp) < 0) break; + #else +- if(mkdir(sp,0755) < 0) break; ++ if(mkdir(sp,0755) < 0) break; + #endif +- }else{ +- if((fd = creat(sp,0644)) < 0) { last = 0; break; } +- if(file_length && _btf_ftruncate(fd, file_length) < 0){close(fd); last = 0; break;} +- close(fd); +- } ++ }else{ ++ if((fd = creat(sp,0644)) < 0) { last = 0; break; } ++ if(file_length && _btf_ftruncate(fd, file_length) < 0){close(fd); last = 0; break;} ++ close(fd); ++ } + }else{last = 0; break;} + } + if( !last ){ *p = PATH_SP; pnext = p + 1;} +@@ -293,7 +313,7 @@ + m_btfhead = pbf; + }else if( S_IFDIR & sb.st_mode ){ + char wd[MAXPATHLEN]; +- if( !getwd(wd) ) return -1; ++ if( !getcwd(wd,MAXPATHLEN) ) return -1; + m_directory = new char[strlen(pathname) + 1]; + #ifndef WINDOWS + if( !m_directory ) return -1; +@@ -319,20 +339,21 @@ + char path[MAXPATHLEN]; + const char *s, *p; + size_t r,q,n; +- if( !decode_query(metabuf, metabuf_len, "info|name",&s,&q,QUERY_STR) || ++ int64_t t; ++ if( !decode_query(metabuf, metabuf_len, "info|name",&s,&q,(int64_t*) 0,QUERY_STR) || + MAXPATHLEN <= q) return -1; + + memcpy(path, s, q); + path[q] = '\0'; + +- r = decode_query(metabuf,metabuf_len,"info|files",(const char**) 0, &q,QUERY_POS); ++ r = decode_query(metabuf,metabuf_len,"info|files",(const char**) 0, &q,(int64_t*) 0,QUERY_POS); + + if( r ){ + BTFILE *pbf_last = (BTFILE*) 0; + BTFILE *pbf = (BTFILE*) 0; + size_t dl; + if( decode_query(metabuf,metabuf_len,"info|length", +- (const char**) 0,(size_t*) 0,QUERY_INT) ) ++ (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ) + return -1; + + if( saveas ){ +@@ -355,14 +376,14 @@ + for(; q && 'e' != *p; p += dl, q -= dl){ + if(!(dl = decode_dict(p, q, (const char*) 0)) ) return -1; + if( !decode_query(p, dl, "length", (const char**) 0, +- &r,QUERY_INT) ) return -1; ++ (size_t*) 0,&t,QUERY_LONG) ) return -1; + pbf = _new_bfnode(); + #ifndef WINDOWS + if( !pbf ) return -1; + #endif +- pbf->bf_length = r; +- m_total_files_length += r; +- r = decode_query(p, dl, "path", (const char **) 0, &n,QUERY_POS); ++ pbf->bf_length = t; ++ m_total_files_length += t; ++ r = decode_query(p, dl, "path", (const char **) 0, &n,(int64_t*) 0,QUERY_POS); + if( !r ) return -1; + if(!decode_list2path(p + r, n, path)) return -1; + pbf->bf_filename = new char[strlen(path) + 1]; +@@ -375,13 +396,13 @@ + } + }else{ + if( !decode_query(metabuf,metabuf_len,"info|length", +- (const char**) 0,(size_t*) &q,QUERY_INT) ) ++ (const char**) 0,(size_t*) 0,&t,QUERY_LONG) ) + return -1; + m_btfhead = _new_bfnode(); + #ifndef WINDOWS + if( !m_btfhead) return -1; + #endif +- m_btfhead->bf_length = m_total_files_length = q; ++ m_btfhead->bf_length = m_total_files_length = t; + if( saveas ){ + m_btfhead->bf_filename = new char[strlen(saveas) + 1]; + #ifndef WINDOWS +@@ -409,31 +430,31 @@ + for(; pbt; pbt = pbt->bf_next){ + if( m_directory ){ + if( MAXPATHLEN <= snprintf(fn, MAXPATHLEN, "%s%c%s", m_directory, PATH_SP, pbt->bf_filename) ) +- return -1; ++ return -1; + }else{ + strcpy(fn, pbt->bf_filename); + } + + if(stat(fn ,&sb) < 0){ + if(ENOENT == errno){ +- if( !_btf_creat_by_path(fn,pbt->bf_length)){ +- fprintf(stderr,"error, create file %s failed.\n",fn); +- return -1; +- } ++ if( !_btf_creat_by_path(fn,pbt->bf_length)){ ++ fprintf(stderr,"error, create file %s failed.\n",fn); ++ return -1; ++ } + }else{ +- fprintf(stderr,"error, couldn't create file %s\n", fn); +- return -1; ++ fprintf(stderr,"error, couldn't create file %s\n", fn); ++ return -1; + } + }else{ + if( !check_exist) check_exist = 1; + if( !(S_IFREG & sb.st_mode) ){ +- fprintf(stderr,"error, file %s not a regular file.\n", fn); +- return -1; ++ fprintf(stderr,"error, file %s not a regular file.\n", fn); ++ return -1; + } + if(sb.st_size != pbt->bf_length){ +- fprintf(stderr,"error, file %s 's size not match. must be %u\n", +- fn, pbt->bf_length); +- return -1; ++ fprintf(stderr,"error, file %s 's size not match. must be %u\n", ++ fn, pbt->bf_length); ++ return -1; + } + } + } //end for +@@ -445,10 +466,21 @@ + BTFILE *p = m_btfhead; + size_t id = 1; + printf("FILES INFO\n"); ++ BitField tmpBitField, tmpFilter; + if(m_directory) printf("Directory: %s\n",m_directory); + for( ; p ; p = p->bf_next ){ +- printf("<%d> %c%s [%u]\n",id++, +- m_directory ? '\t': ' ',p->bf_filename, p->bf_length); ++ printf("<%d> %c%s [%llu]",id, ++ m_directory ? '\t': ' ',p->bf_filename, p->bf_length); ++ if( !arg_flg_exam_only ){ ++ BTCONTENT.SetTmpFilter(id, &tmpFilter); ++ tmpBitField = *BTCONTENT.pBF; ++ tmpBitField.Except(tmpFilter); ++ printf(" %u/%u (%d%%)", ++ tmpBitField.Count(), BTCONTENT.getFilePieces(id), ++ 100 * tmpBitField.Count() / BTCONTENT.getFilePieces(id)); ++ } ++ ++id; ++ printf("\n"); + } + printf("Total: %lu MB\n\n",(unsigned long)(m_total_files_length / 1024 / 1024)); + } +@@ -488,3 +520,73 @@ + } + return 1; + } ++ ++ ++void btFiles::SetFilter(int nfile, BitField *pFilter, size_t pieceLength) ++{ ++ //set the filter ++ ++ BTFILE *p = m_btfhead; ++ size_t id = 1; ++ u_int64_t sizeBuffer=0; ++ size_t index; ++ ++ ++ pFilter->SetAll(); ++ for( ; p ; p = p->bf_next ){ ++ if(id++ == nfile){ ++ size_t start,stop; ++ start = sizeBuffer/pieceLength; ++ stop = (sizeBuffer+p->bf_length)/pieceLength; ++ // This "if" cuts down on false prints with CTCS. ++ if(arg_file_to_download == nfile){ ++ printf ("\rDownloading file: <%d> %s \nPieces: %d - %d (%d)\n",nfile,p->bf_filename,start,stop,stop-start+1); ++ } ++ p->bf_npieces = stop-start+1; ++ for(index=sizeBuffer/pieceLength;index<=(sizeBuffer+p->bf_length)/pieceLength;index++){ ++ pFilter->UnSet(index); ++ } ++ } ++ sizeBuffer+=(u_int64_t) p->bf_length; ++ } ++ if(nfile>=id || nfile==0){ ++ printf("\nEnd of files list. Resuming normal behaviour\n"); ++ pFilter->Invert(); ++ arg_file_to_download = 0; ++ } ++} ++ ++size_t btFiles::getFilePieces(size_t nfile) ++{ ++ //returns the pieces of the file already gotten ++ ++ BTFILE *p = m_btfhead; ++ size_t id = 1; ++ ++ for( ; p ; p = p->bf_next ){ ++ if(id++ == nfile){ ++ return p->bf_npieces; ++ } ++ } ++return 0; ++} ++ ++BTFILE *btFiles::GetNextFile(BTFILE *file) ++{ ++ static BTFILE *p = m_btfhead; ++ ++ if( 0==file ) p = m_btfhead; ++ else if( p==file ){ ++ p = p->bf_next; ++ }else{ ++ for( p=m_btfhead; p && (p != file); p = p->bf_next); ++ if( 0==p ){ ++ p = m_btfhead; ++ }else{ ++ p = p->bf_next; ++ } ++ } ++ return p; ++} ++ ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btfiles.h ctorrent-1.3.4/btfiles.h +--- ctorrent-1.3.4.sav/btfiles.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btfiles.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,18 +1,22 @@ + #ifndef BTFILES_H + #define BTFILES_H + ++#include "./def.h" + #include + #include +-#include "./def.h" ++ ++#include "bitfield.h" + + typedef struct _btfile{ + char *bf_filename; // full path of file. +- size_t bf_length; //single file length limits to 4 GB ++ u_int64_t bf_length; + FILE *bf_fp; + + time_t bf_last_timestamp; // last io timestamp. + +- size_t bf_completed; // already downloaded length ++ u_int64_t bf_completed; // already downloaded length ++ ++ size_t bf_npieces; //number of pieces + + unsigned char bf_flag_opened:1; + unsigned char bf_flag_need:1; +@@ -36,8 +40,8 @@ + + BTFILE* _new_bfnode(); + int _btf_open(BTFILE *sbf_p); +- int _btf_ftruncate(int fd,size_t length); +- int _btf_creat_by_path(const char *pathname, size_t file_length); ++ int _btf_ftruncate(int fd,int64_t length); ++ int _btf_creat_by_path(const char *pathname, int64_t file_length); + int _btf_destroy(); + int _btf_recurses_directory(const char *cur_path, BTFILE *lastnode); + +@@ -53,9 +57,14 @@ + u_int64_t GetTotalLength() const { return m_total_files_length; } + ssize_t IO(char *buf, u_int64_t off, size_t len, const int iotype); + size_t FillMetaInfo(FILE* fp); ++ ++ void SetFilter(int nfile, BitField *pFilter,size_t pieceLength); ++ size_t getFilePieces(size_t nfile); ++ + #ifndef WINDOWS + void PrintOut(); + #endif ++ BTFILE *GetNextFile(BTFILE *file); + }; + + #endif +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btrequest.cpp ctorrent-1.3.4/btrequest.cpp +--- ctorrent-1.3.4.sav/btrequest.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btrequest.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -24,24 +24,179 @@ + RequestQueue::RequestQueue() + { + rq_head = (PSLICE) 0; ++ rq_send = rq_head; + } + + void RequestQueue::Empty() + { + if(rq_head) _empty_slice_list(&rq_head); ++ rq_send = rq_head; + } + + void RequestQueue::SetHead(PSLICE ps) + { + if( rq_head ) _empty_slice_list(&rq_head); + rq_head = ps; ++ rq_send = rq_head; + } + + void RequestQueue::operator=(RequestQueue &rq) + { ++ PSLICE n, u = (PSLICE) 0; ++ size_t idx; ++ int flag = 0; ++ + if( rq_head ) _empty_slice_list(&rq_head); + rq_head = rq.rq_head; +- rq.rq_head = (PSLICE) 0; ++ rq_send = rq_head; ++ ++ // Reassign only the first piece represented in the queue. ++ n = rq_head; ++ idx = n->index; ++ for( ; n ; u = n,n = u->next){ ++ if( rq.rq_send == n ) flag = 1; ++ if( n->index != idx ) break; ++ } ++ if(n){ ++ u->next = (PSLICE) 0; ++ rq.rq_head = n; ++ if(flag) rq.rq_send = rq.rq_head; ++ }else{ ++ rq.rq_head = (PSLICE) 0; ++ rq.rq_send = rq.rq_head; ++ } ++} ++ ++int RequestQueue::Copy(RequestQueue *prq) ++{ ++ PSLICE n, u=(PSLICE)0, ps; ++ size_t idx; ++ ++ if( prq->IsEmpty() ) return 0; ++ ++ ps = prq->GetHead(); ++ idx = ps->index; ++ for ( ; ps; ps = ps->next) { ++ if( ps->index != idx ) break; ++ if( Add(ps->index, ps->offset, ps->length) < 0 ) return -1; ++ } ++ return 0; ++} ++ ++int RequestQueue::CopyShuffle(RequestQueue *prq, size_t piece) ++{ ++ PSLICE n, u=(PSLICE)0, ps, start; ++ size_t idx; ++ unsigned long rndbits; ++ int i=0; ++ ++ if( prq->IsEmpty() ) return 0; ++ ++ n = rq_head; ++ for( ; n ; u = n,n = u->next); // move to end ++ ++ ps = prq->GetHead(); ++ for ( ; ps && ps->index != piece; ps = ps->next); ++ start = ps; ++ ++ idx = ps->index; ++ ++ // First, skip to the slices that haven't been sent to the original peer. ++ if( prq->rq_send && prq->rq_send->index == idx ){ ++ ps = prq->rq_send; ++ for ( ; ps; ps = ps->next){ ++ if( ps->index != idx ) break; ++ if( !i-- ){ ++ rndbits = random(); ++ i = 30; ++ } ++ if( (rndbits>>=1)&01 ){ ++ if( Add(ps->index, ps->offset, ps->length) < 0 ) return -1; ++ } ++ else if( Insert(u, ps->index, ps->offset, ps->length) < 0 ) return -1; ++ } ++ if(u) n = u->next; ++ else n = rq_head; ++ for( ; n ; u = n,n = u->next); // move to end ++ } ++ ++ // Now put the already-requested slices at the end. ++ ps = start; ++ for ( ; ps && ps != prq->rq_send; ps = ps->next){ ++ if( ps->index != idx ) break; ++ if( !i-- ){ ++ rndbits = random(); ++ i = 30; ++ } ++ if( (rndbits>>=1)&01 ){ ++ if( Add(ps->index, ps->offset, ps->length) < 0 ) return -1; ++ } ++ else if( Insert(u, ps->index, ps->offset, ps->length) < 0 ) return -1; ++ } ++ return 0; ++} ++ ++// Counts all queued slices. ++size_t RequestQueue::Qsize() ++{ ++ size_t cnt = 0; ++ PSLICE n = rq_head; ++ PSLICE u = (PSLICE) 0; ++ ++ for( ; n ; u = n,n = u->next) cnt++; // move to end ++ return cnt; ++} ++ ++// Counts only slices from one piece. ++size_t RequestQueue::Qlen(size_t piece) ++{ ++ size_t cnt = 0; ++ PSLICE n = rq_head; ++ PSLICE u = (PSLICE) 0; ++ size_t idx; ++ ++ for ( ; n && n->index != piece; n = n->next); ++ ++ if(n) idx = n->index; ++ for( ; n ; u = n,n = u->next){ ++ if( n->index != idx ) break; ++ cnt++; ++ } ++ return cnt; ++} ++ ++int RequestQueue::Insert(PSLICE ps,size_t idx,size_t off,size_t len) ++{ ++ size_t cnt = 0; ++ PSLICE n = rq_head; ++ PSLICE u = (PSLICE) 0; ++ ++ for( ; n ; u = n,n = u->next) cnt++; // move to end (count) ++ ++ if( cnt >= cfg_req_queue_length ) return -1; // already full ++ ++ n = new SLICE; ++ ++#ifndef WINDOWS ++ if( !n ) return -1; ++#endif ++ ++ n->index = idx; ++ n->offset = off; ++ n->length = len; ++ ++ // ps is the slice to insert after; if 0, insert at the head. ++ if(ps){ ++ n->next = ps->next; ++ ps->next = n; ++ if( rq_send == n->next ) rq_send = n; ++ }else{ ++ n->next = rq_head; ++ rq_head = n; ++ rq_send = rq_head; ++ } ++ ++ return 0; + } + + int RequestQueue::Add(size_t idx,size_t off,size_t len) +@@ -64,8 +219,33 @@ + n->index = idx; + n->offset = off; + n->length = len; ++ n->reqtime = (time_t) 0; ++ ++ if( u ) u->next = n; ++ else{ ++ rq_head = n; ++ rq_send = rq_head; ++ } + +- if( u ) u->next = n; else rq_head = n; ++ if( !rq_send ) rq_send = n; ++ ++ return 0; ++} ++ ++int RequestQueue::Append(PSLICE ps) ++{ ++ size_t cnt = 0; ++ PSLICE n = rq_head; ++ PSLICE u = (PSLICE) 0; ++ ++ for( ; n ; u = n,n = u->next) cnt++; // move to end ++ ++ if( cnt >= cfg_req_queue_length ) return -1; // already full ++ ++ if(u) u->next = ps; ++ else rq_head = ps; ++ ++ if( !rq_send ) rq_send = ps; + + return 0; + } +@@ -82,11 +262,41 @@ + if( !n ) return -1; /* not found */ + + if( u ) u->next = n->next; else rq_head = n->next; ++ if( rq_send == n ) rq_send = n->next; + delete n; + + return 0; + } + ++int RequestQueue::HasIdx(size_t idx) ++{ ++ PSLICE n = rq_head; ++ ++ for( ; n ; n = n->next){ ++ if(n->index == idx) break; ++ } ++ ++ return n ? 1 : 0; ++} ++ ++time_t RequestQueue::GetReqTime(size_t idx,size_t off,size_t len) ++{ ++ PSLICE n = rq_head; ++ ++ for( ; n ; n = n->next){ ++ if(n->index == idx && n->offset == off && n->length == len ) break; ++ } ++ ++ if( !n ) return -1; /* not found */ ++ ++ return n->reqtime; ++} ++ ++void RequestQueue::SetReqTime(PSLICE n,time_t t) ++{ ++ n->reqtime = t; ++} ++ + int RequestQueue::Pop(size_t *pidx,size_t *poff,size_t *plen) + { + PSLICE n; +@@ -99,6 +309,7 @@ + if(poff) *poff = rq_head->offset; + if(plen) *plen = rq_head->length; + ++ if( rq_send == rq_head ) rq_send = n; + delete rq_head; + + rq_head = n; +@@ -121,8 +332,6 @@ + { + size_t i,off,len,ns; + +- if( rq_head ) _empty_slice_list(&rq_head); +- + ns = NSlices(idx); + + for( i = off = 0; i < ns; i++){ +@@ -154,9 +363,11 @@ + int RequestQueue::IsValidRequest(size_t idx,size_t off,size_t len) + { + return ( idx < BTCONTENT.GetNPieces() && +- len && +- (off + len) <= BTCONTENT.GetPieceLength(idx) && +- len <= cfg_max_slice_size) ? ++ len && ++ (off + len) <= BTCONTENT.GetPieceLength(idx) && ++// len <= cfg_max_slice_size) ? ++ // See note for cfg_max_slice_size in btconfig.h ++ len <= 2 * cfg_max_slice_size) ? + 1 : 0; + } + +@@ -196,20 +407,51 @@ + + int PendingQueue::Pending(RequestQueue *prq) + { +- int i = 0; ++ int i = 0, j = 0; ++ PSLICE n, u = (PSLICE) 0; ++ size_t idx, off, len; ++ RequestQueue tmprq; + + if( pq_count >= PENDING_QUEUE_SIZE ){ + prq->Empty(); + return -1; + } ++ if( prq->Qlen(prq->GetRequestIdx()) >= ++ BTCONTENT.GetPieceLength() / cfg_req_slice_size ){ ++ // This shortcut relies on the fact that we don't add to a queue if it ++ // already contains a full piece. ++ prq->Empty(); ++ return 0; ++ } + +- for( ; i < PENDING_QUEUE_SIZE; i++) ++ for( ; i < PENDING_QUEUE_SIZE; i++){ + if(pending_array[i] == (PSLICE) 0){ +- pending_array[i] = prq->GetHead(); +- prq->Release(); +- pq_count++; +- break; ++ // Don't add a piece to Pending more than once. ++ if(!j) j = i; ++ }else if(prq->GetRequestIdx() == pending_array[i]->index){ ++ while( !prq->IsEmpty() && ++ prq->GetRequestIdx() == pending_array[i]->index ) ++ prq->Pop(&idx,&off,&len); ++ if( prq->IsEmpty() ) return 0; ++ i = 0; + } ++ } ++ i = j; ++ pending_array[i] = prq->GetHead(); ++ prq->Release(); ++ pq_count++; ++ ++ // If multiple pieces are queued, break up the queue separately. ++ n = pending_array[i]; ++ idx = n->index; ++ for( ; n ; u = n, n = u->next) ++ if( n->index != idx ) break; ++ if(n){ ++ u->next = (PSLICE) 0; ++ tmprq.SetHead(n); ++ Pending(&tmprq); ++ tmprq.Release(); ++ } + + return 0; + } +@@ -218,16 +460,57 @@ + { + int i = 0; + size_t sc = pq_count; ++ size_t idx; + for( ; i < PENDING_QUEUE_SIZE && sc; i++){ + if( pending_array[i] != (PSLICE) 0){ ++ if( bf.IsSet(pending_array[i]->index) && ++ !prq->HasIdx(pending_array[i]->index) ){ ++ idx = pending_array[i]->index; ++ prq->Append(pending_array[i]); ++ pending_array[i] = (PSLICE) 0; ++ pq_count--; ++ Delete(idx); // delete any copies from Pending ++ break; ++ } + sc--; +- if( bf.IsSet(pending_array[i]->index) ){ +- prq->SetHead(pending_array[i]); +- pending_array[i] = (PSLICE) 0; +- pq_count--; +- break; ++ } ++ } ++ // Return value now indicates whether a piece was assigned. ++ return sc; ++} ++ ++// This routine should no longer be necessary, but keeping it as a failsafe. ++int PendingQueue::Delete(size_t idx) ++{ ++ int i = 0; ++ for ( ; i < PENDING_QUEUE_SIZE && pq_count; i++){ ++ if( (PSLICE) 0 != pending_array[i] && idx == pending_array[i]->index){ ++ if(arg_verbose) fprintf(stderr, "PQD found %d\n", (int)idx); ++ _empty_slice_list(&(pending_array[i])); ++ pq_count--; ++ break; ++ } ++ } ++ return 0; ++} ++ ++int PendingQueue::DeleteSlice(size_t idx, size_t off, size_t len) ++{ ++ int i = 0; ++ RequestQueue rq; ++ for ( ; i < PENDING_QUEUE_SIZE && pq_count; i++){ ++ if( (PSLICE) 0 != pending_array[i] && idx == pending_array[i]->index){ ++ //check if off & len match any slice ++ //remove the slice if so ++ rq.SetHead(pending_array[i]); ++ if( rq.Remove(idx, off, len) == 0 ){ ++ pending_array[i] = rq.GetHead(); ++ if( (PSLICE) 0 == pending_array[i] ) pq_count--; ++ i = PENDING_QUEUE_SIZE; // exit loop + } ++ rq.Release(); + } + } + return 0; + } ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btrequest.h ctorrent-1.3.4/btrequest.h +--- ctorrent-1.3.4.sav/btrequest.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btrequest.h 2006-06-28 19:30:02.000000000 +0200 +@@ -2,6 +2,7 @@ + #define SLICE_H + + #include ++#include + #include "btcontent.h" + #include "bitfield.h" + +@@ -9,6 +10,7 @@ + size_t index; + size_t offset; + size_t length; ++ time_t reqtime; + struct _slice *next; + }SLICE,*PSLICE; + +@@ -17,6 +19,7 @@ + private: + PSLICE rq_head; + public: ++ PSLICE rq_send; // next slice to request + + RequestQueue(); + ~RequestQueue(); +@@ -24,18 +27,30 @@ + void Empty(); + + void SetHead(PSLICE ps); ++ void SetNextSend(PSLICE ps) { rq_send = ps; } + PSLICE GetHead() const { return rq_head; } ++ PSLICE NextSend() const { return rq_send; } + size_t GetRequestIdx(){ return rq_head ? rq_head->index : BTCONTENT.GetNPieces(); } + size_t GetRequestLen(){ return rq_head ? rq_head->length : 0; } +- void Release(){ rq_head = (PSLICE) 0; } ++ void Release(){ rq_head = rq_send = (PSLICE) 0; } + int IsValidRequest(size_t idx,size_t off,size_t len); + + void operator=(RequestQueue &rq); ++ int Copy(RequestQueue *prq); ++ int CopyShuffle(RequestQueue *prq, size_t piece); ++ size_t Qsize(); ++ size_t Qlen(size_t piece); + + int IsEmpty() const { return rq_head ? 0 : 1; } + ++ int Insert(PSLICE ps,size_t idx,size_t off,size_t len); + int Add(size_t idx,size_t off,size_t len); ++ int Append(PSLICE ps); + int Remove(size_t idx,size_t off,size_t len); ++ int HasIdx(size_t idx); ++ time_t GetReqTime(size_t idx,size_t off,size_t len); ++ void SetReqTime(PSLICE n,time_t t); ++ + + int Pop(size_t *pidx,size_t *poff,size_t *plen); + int Peek(size_t *pidx,size_t *poff,size_t *plen) const; +@@ -60,6 +75,8 @@ + int Pending(RequestQueue *prq); + int ReAssign(RequestQueue *prq, BitField &bf); + int Exist(size_t idx); ++ int Delete(size_t idx); ++ int DeleteSlice(size_t idx, size_t off, size_t len); + }; + + extern PendingQueue PENDINGQUEUE; +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/btstream.cpp ctorrent-1.3.4/btstream.cpp +--- ctorrent-1.3.4.sav/btstream.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/btstream.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,5 +1,6 @@ + #include + #include "btstream.h" ++#include "peer.h" + #include "msgencode.h" + #include "btconfig.h" + +@@ -11,22 +12,21 @@ + ssize_t btStream::Send_State(unsigned char state) + { + char msg[H_BASE_LEN + 4]; +- *(size_t*)msg = htonl(H_BASE_LEN); ++ ++ set_nl(msg, H_BASE_LEN); + msg[4] = (char)state; +- return out_buffer.PutFlush(sock,msg,H_BASE_LEN + 4); ++ return out_buffer.Put(sock,msg,H_BASE_LEN + 4); + } + + ssize_t btStream::Send_Have(size_t idx) + { + char msg[H_HAVE_LEN + 4]; +- size_t *p = (size_t*)msg; + +- *p = htonl(H_HAVE_LEN); ++ set_nl(msg, H_HAVE_LEN); + msg[4] = (char)M_HAVE; +- p = (size_t*)(msg + 5); +- *p = htonl(idx); ++ set_nl(msg + 5, idx); + +- return out_buffer.PutFlush(sock,msg,H_HAVE_LEN + 4); ++ return out_buffer.Put(sock,msg,H_HAVE_LEN + 4); + } + + ssize_t btStream::Send_Bitfield(char *bit_buf,size_t len) +@@ -37,20 +37,18 @@ + if(r < 0) return r; + r = out_buffer.Put(sock,(char*)&t,1); + if(r < 0) return r; +- return out_buffer.PutFlush(sock,bit_buf,len); ++ return out_buffer.Put(sock,bit_buf,len); + } + + ssize_t btStream::Send_Cancel(size_t idx,size_t off,size_t len) + { + char msg[H_CANCEL_LEN + 4]; +- size_t *p = (size_t*)msg; + +- *p = htonl(H_CANCEL_LEN); ++ set_nl(msg, H_CANCEL_LEN); + msg[4] = M_CANCEL; +- p = (size_t*)(msg + 5); +- *p = htonl(idx); p++; +- *p = htonl(off); p++; +- *p = htonl(len); ++ set_nl(msg + 5, idx); ++ set_nl(msg + 9, off); ++ set_nl(msg + 13, len); + return out_buffer.Put(sock,msg,H_CANCEL_LEN + 4); + } + +@@ -72,21 +70,19 @@ + ssize_t btStream::Send_Request(size_t idx, size_t off,size_t len) + { + char msg[H_REQUEST_LEN + 4]; +- size_t *p = (size_t*) msg; + +- *p = htonl(H_REQUEST_LEN); ++ set_nl(msg, H_REQUEST_LEN); + msg[4] = (char)M_REQUEST; +- p = (size_t*)(msg + 5); +- *p = htonl(idx); p++; +- *p = htonl(off); p++; +- *p = htonl(len); ++ set_nl(msg + 5, idx); ++ set_nl(msg + 9, off); ++ set_nl(msg + 13, len); + return out_buffer.Put(sock,msg,H_REQUEST_LEN + 4); + } + + ssize_t btStream::Send_Keepalive() + { + size_t i = 0; +- return out_buffer.PutFlush(sock,(char*)&i,4); ++ return out_buffer.Put(sock,(char*)&i,4); + } + + int btStream::HaveMessage() +@@ -94,7 +90,7 @@ + // if message arrived. + size_t r; + if( 4 <= in_buffer.Count() ){ +- r = ntohl(*(size_t*)in_buffer.BasePointer()); ++ r = get_nl(in_buffer.BasePointer()); + if( (cfg_max_slice_size + H_PIECE_LEN + 4) < r) return -1; //message too long + if( (r + 4) <= in_buffer.Count() ) return 1; + } +@@ -113,5 +109,5 @@ + + ssize_t btStream::Send_Buffer(char *buf, size_t len) + { +- return out_buffer.PutFlush(sock,buf,len); ++ return out_buffer.Put(sock,buf,len); + } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bttime.h ctorrent-1.3.4/bttime.h +--- ctorrent-1.3.4.sav/bttime.h 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/bttime.h 2006-06-28 19:30:02.000000000 +0200 +@@ -0,0 +1,7 @@ ++#ifndef BTTIME_H ++#define BTTIME_H ++ ++extern time_t now; ++ ++#endif ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bufio.cpp ctorrent-1.3.4/bufio.cpp +--- ctorrent-1.3.4.sav/bufio.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bufio.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -61,7 +61,7 @@ + #ifndef WINDOWS + if(errno == EINTR) continue; + #endif +- return (EWOULDBLOCK == errno) ? (ssize_t)t : -1; ++ return (EWOULDBLOCK == errno || EAGAIN == errno) ? (ssize_t)t : -1; + }else if( 0 == r ){ + return t; // no possible??? + }else{ +@@ -83,7 +83,7 @@ + #ifndef WINDOWS + if(errno == EINTR) continue; + #endif +- return (EWOULDBLOCK == errno) ? (ssize_t)t : -1; ++ return (EWOULDBLOCK == errno || EAGAIN == errno) ? (ssize_t)t : -1; + }else if( 0 == r ){ + f_socket_remote_closed = 1; + return t; //connection closed by remote. +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/bufio.h ctorrent-1.3.4/bufio.h +--- ctorrent-1.3.4.sav/bufio.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/bufio.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,8 +1,8 @@ + #ifndef BUFIO_H + #define BUFIO_H + +-#include + #include "def.h" ++#include + + #ifdef WINDOWS + #include +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/ChangeLog ctorrent-1.3.4/ChangeLog +--- ctorrent-1.3.4.sav/ChangeLog 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/ChangeLog 2006-06-28 19:30:02.000000000 +0200 +@@ -1 +1,379 @@ +-*EMPTY* ++ ++ Enhanced CTorrent Change Log ++ _________________________________________________________________ ++ ++ Changes for "dnh2" Release ++ ++ Patches ++ * The following patches or their functionality are incorporated: ++ 1380164 [dnh1.2] ++ 1357832 [invert] (included in dnh1.2) ++ 1352866 [dnh1.1] ++ 1266767 [passkey2] ++ 1239547 [dnh1] ++ 1170457 [standalone-sha1] Added as a fallback case in configure if ++ OpenSSL is not found. To force it to be used, define ++ USE_STANDALONE_SHA1 in config.h (after running configure). ++ 1164454 [ip] ++ 1119610 [vfat] This bug appears to be linux-specific; I've tried ++ to handle it in a more general way that may apply to similar ++ situations on other platforms and filesystems, but I have limited ++ capability to test this. ++ 1067196 [lfs] This is the large-file support that many have asked ++ for. ++ ++ Optimization ++ * Use fewer call to random() by shifting the previously unused bits. ++ * Time() calls have been greatly reduced; a global timestamp ++ variable "now" is set once per main loop interation and referenced ++ in functions that need a timestamp (except the caching I/O ++ routines which were left alone). ++ * Overall current bandwidth rates are now computed only once per ++ main loop and referenced in any routines that evaluate or control ++ bandwidth. ++ * Avoid flushing peer output buffers except in SendModule. This ++ allows for some consolidation of messages to reduce network ++ overhead. ++ ++ Code Fixes ++ * Fixed use of cfg_req_queue_length to be the actual queue size ++ (queue was half of this value). ++ * Fixed: "peer is" verbose output could fubar the terminal. ++ * Formatting: Replaced indentation tabs with spaces for consistency. ++ ++ Operational Enhancements ++ * Improved piece selection methods to include rarity as a factor. ++ This is not strictly "rarest-first", as we do not make a ++ comprehensive effort to find the "rarest" piece or rank pieces by ++ rarity. Rather, we use a more efficient compromise and try to find ++ the set of pieces that have "trade value" (another peer needs ++ them) and make a random choice from that set. Here is the current ++ preference order used in each mode: ++ Trade Value is defined as: ++ 1. Piece that only this peer has (not considering other ++ seeders), that a peer in which we're interested needs. ++ 2. Piece that not every peer in which we're interested has. ++ 3. Piece that only this peer has (not considering other ++ seeders). ++ 4. Piece that not every peer has. ++ Normal Mode ++ 1. Piece we tried to get from another peer but stopped due to ++ choking or lost connection. (We have part of the piece ++ already.) ++ 2. Piece most recently acquired by the peer (possibly/probably ++ rare). ++ 3. Piece with trade value. ++ 4. Any piece not yet requested. ++ Initial-piece Mode ++ 1. Piece with trade value which is already in progress. ++ 2. Piece with trade value that more than one peer has. ++ 3. Piece with trade value. ++ 4. Any piece not yet requested. ++ Endgame Mode ++ 1. Piece with trade value which is already in progress, of which ++ we have the least amount. ++ 2. Piece already in progress of which we have the least amount. ++ * Advanced request queueing system. ++ + Instead of requesting all of the slices for a piece at one ++ time, we now measure latency to the peer and send requests ++ based on how long it takes the data to arrive. This avoids ++ wasting upload banwidth by having too many outstanding ++ requests: If we get choked or lose the connection, the extra ++ requests were wasted; in initial or endgame modes, more ++ requests would have to be cancelled when we completed the ++ piece. ++ + A new piece will be queued for download when there is space ++ in the queue and we've requested the slices that have been ++ queued already. We also don't wait for the current piece to ++ complete before sending requests for a new piece. This helps ++ to maintain a continuous flow of data in the download ++ pipeline. ++ + When duplicating a request in initial or endgame mode, slices ++ that have already been requested are queued last. ++ * Don't send HAVE messages to seeders (to save UL bandwidth). ++ + Since we maintain interested state, and know the peer is a ++ seeder, we'll do the right thing when we become a seeder. ++ + Not sending HAVE to all peers (leechers) that already have ++ the piece is a bad idea IMO. If everyone takes the same ++ attitude, none of us will know when another becomes a seeder ++ and connections will remain open/occupied. ++ + We do send a HAVE to seeders upon completing our first piece ++ so that we don't continue to appear empty. ++ * Endgame strategy is used in get1file mode to complete the file. ++ * Queue management: ++ + Don't accept requests from choked peers. ++ + Discard peer's reponse_q when we choke them. ++ + Don't send cancels when we get choked (according to spec & ++ discussions). ++ + Don't put full piece queues in pending. ++ + Move closing peer's request queue to pending instead of ++ discarding it. ++ * Prefer uploading to or downloading from a peer after we skip them ++ due to bandwidth limiting. This is done via the g_next_up and ++ g_defer_up global variables in peer.cpp (for UL; s/up/dn for the ++ DL versions). The peerlist Sort() function and peer "click" ++ variables have been removed since they are not needed with this ++ feature. ++ ++ Options & Features ++ * The -c option now reports file completion status. ++ + As a side effect the metainfo details are printed twice. This ++ allows you to view the torrent contents while pieces are ++ being verified. ++ + Total percentage completion is also added to the output. ++ * "-E" option to seed to a specified UL:DL ratio. Seeding will stop ++ when this ratio or the timeout (-e) is reached. If CTorrent starts ++ as a seeder, the ratio is interpreted as UL:[torrent size]. ++ * If "-e 0" is specified (explicitly) and -E is used, there will be ++ no timeout; seeding will continue until the ratio is reached. ++ * The "-m" option previously didn't do anything, and it isn't clear ++ what it was originally going to do. Now the default value is 1, ++ and CTorrent will try to maintain at least this many peers by ++ contacting the tracker early if the peer count falls below this ++ value. This feature was present in release dnh1 but the value was ++ not changeable. ++ Actually it seems likely that this was to be number of peers that ++ the client would try to obtain (by initiating connections), as the ++ "official" client does; this is mentioned as a note in the online ++ specification. I don't really see the value in that though. That ++ said, the option as implemented here should rarely be used. It ++ might be useful only with torrents that have significantly more ++ than max_peers total peers and use a long tracker update interval ++ (such that you tend to drop a lot of peers betwen updates). ++ * "-z" option to set the slice size (the unit of a request, i.e. the ++ discrete amount of data that will be requested from a peer at one ++ time). The slice size now defaults to 16K regardless of the piece ++ length. Request queue size is computed and set based on the slice ++ size, as it now affects only system resources (though not a lot) ++ and not the way that requests are sent. ++ * Add support for "key" and "trackerid" tracker interaction ++ parameters. ++ * Support/display tracker warning message ++ * Now able to handle torrents with more than 255 files. ++ * Support for [1]CTorrent Control Server, an application and ++ protocol for monitoring and managing multiple Enhanced CTorrent ++ clients. The "-S" option is used to connect to CTCS, as in "-S ++ localhost:2780" if CTCS is listening at port 2780 on the local ++ system. Appending a colon ("-S localhost:2780:") will prompt for a ++ password to authenticate with CTCS. ++ ++ Peer Handling ++ * Count immediate choke-unchoke (either order) as an error (two ++ errors actually, since it's so wasteful). ++ It may be that some clients do this to stimulate the peer when ++ they think it hasn't responded to their last unchoke (due to high ++ latency). It would be better for them to just repeat the unchoke ++ rather than choke-unchoke, as by choking they will cause the peer ++ to send the requests again. ++ * Detect unresponsive peer connections and try to fix them or ++ disconnect them. Basically, if a peer doesn't respond to our ++ request in a reasonable time then we first assume that our request ++ was lost in transmission; if it happens again then we assume the ++ connection is unreliable. ++ * Handle peers that suppress HAVE messages so we don't always think ++ that they're empty (and thus give them preferential treatment for ++ uploading). If we've sent the peer an amount of data equivalent to ++ two pieces, assume that they now have at least one complete piece. ++ _________________________________________________________________ ++ ++ Changes for "dnh1.2" Release ++ ++ These are just corrections to the previous release that I felt were ++ necessary. Much more improvement is coming in the dnh2 release. ++ ++ Bug/code fixes ++ * Bitfield::Invert patch [1357832 on sourceforge] described below. ++ * Fixed "piece length too long" check to reflect the actual queue ++ length used. ++ * Accept 128K slice size for peer requests. ++ * "Return" keyword in Random_init() removed due to potential compile ++ error. ++ * Modified longer-wait test in the optimistic unchoke routine to ++ consider whether the peer is currently choked. ++ _________________________________________________________________ ++ ++ Bitfield::Invert bug ++ ++ There is a bug in the Bitfield::Invert() function that affects the ++ ctorrent-1.3.4 base code as well as releases dnh1 and dnh1.1. This can ++ cause the application to fail (segmentation fault) or may affect ++ downloading of all pieces of the torrent. A patch is available in the ++ Download secion. ++ _________________________________________________________________ ++ ++ Changes for "dnh1.1" Release ++ ++ These are just corrections to the previous release that I felt were ++ necessary. Much more improvement is coming in the next release. ++ ++ Bug/code fixes ++ * Peer count would increase on each tracker update if there were no ++ seeders. ++ * RequestQueue::CopyShuffle() changed to use a pointer argument. ++ * Fixed some incorrectness in PendingQueue::Delete() and ++ PendingQueue::DeleteSlice() which could cause a memory leak. ++ * Fixed random-chance inversion bug in PeerList::UnChokeCheck() ++ affecting choice for optimistic unchoking. ++ ++ Improvements ++ * Move StopDLTimer() call from RequestPiece() to RequestCheck(), ++ which could occasionally affect peer download rate measurement. ++ * Most clients do not like a slice size of 128K even though it is ++ the max allowed by the BT specification. Changed max slice size to ++ 64K. Note that the maximum piece length is 2MB (2097152); if you ++ need to download a torrent with a larger piece size you can change ++ the value of cfg_req_queue_length in btconfig.h from 64 to 128. ++ * Contact tracker immediately upon becoming (or starting as) a ++ seeder. ++ * Changed SendModule() to send only one slice at a time. This will ++ help with fairly distributing upload bandwidth among the unchoked ++ peers. ++ * Changed default peer ID prefix to '-CD0101-', indicating ++ CTorrent-dnh1.1 release. ++ _________________________________________________________________ ++ ++ Changes for "dnh1" Release ++ ++ This is the first release. "dnh" identifies this patchset, and "1" ++ indicates release version 1 of the patchset. ++ ++ Patches ++ * Incorporates the following patches. The number is the Request ID ++ from the [2]SourceForge patches page, which you can reference for ++ the details of each patch. The name in brackets is the name of the ++ patch file or a name I chose to refer to the patch. Some of these ++ names are used below (in brackets) to describe a fix or change to ++ a particular patch. ++ 1042808 [getcwd] (incorporated in get1file patch) ++ 1084776 [passkey] (incorporated in udlimit patch) ++ 1109266 [align] ++ 1109287 [tracker/tracker2] ++ 1114197 [fmt] (incorporated in get1file patch) ++ 1114364 [resetdl] ++ 1116448 [get1file] ++ 1118597 [crash] ++ 1119467 [stall] ++ 1119492 [rate] ++ 1119497 [flush] ++ 1119519 [opt] ++ 1119689 [status] ++ 1124342 [udlimit] ++ ++ Download performance ++ * If a peer socket is ready for reading and writing, perform both. ++ Previously the cases were exclusive, with preference given to ++ reading. ++ * Download requests are now made to peers when they are ready for ++ writing (in addition to the existing event-driven cases). This ++ fixes peer stalls when a request couldn't be sent in an ++ event-triggered case due to bandwidth limiting or other ++ circumstances. ++ * Additional tests added so that the above request checking doesn't ++ create hard loops. ++ ++ Bandwidth measurement/management ++ * [rate] Bandwidth reporting is now not capped. Also, only the time ++ used for the samples taken is used in the calculation rather than ++ the maximum interval (this affects rate calculation for individual ++ peers). ++ * Additional upload and download bandwidth limit checks added so ++ that bw management is more accurate. ++ * Corrected condition inversion bug in Rate::StopTimer(), which ++ affects peer rate calculations. ++ ++ Peer count ++ * Request our max number of peers from the tracker each time rather ++ than just taking the tracker's default, so we can try to fill up. ++ * The tracker will be contacted early if all peers disconnect so ++ that we can actively try to establish some more peer connections. ++ To avoid hammering the tracker, we must have at least one peer for ++ 15 seconds in order for this to be invoked. ++ * Some clients use nonzero bytes in the "reserved" part of the ++ handshake. Added code to ignore the reserved bytes if the rest of ++ the handshake is as expected. This includes Azureus 2300 thru 2304 ++ (latest) which gives 0x80 as the first reserved byte and BitComet ++ which gives 0x6578 ("ex") as the first two bytes. ++ * Update peer's timestamp on any message, not just keepalives. Any ++ receipt of data from a peer now resets its timeout, preventing ++ early disconnect. ++ ++ Parallel requests ++ * Initial-piece and endgame cases have been improved so that pieces ++ will be requested from multiple peers. Cancels are sent as slices ++ (subpieces) are received. This endgame strategy is described in ++ the BitTorrent online spec. The startup strategy is also described ++ in posts and facilitates obtaining a single piece more rapidly in ++ order to obtain some trade value. In initial mode, the piece of ++ which we need the least parts is targeted. In endgame mode, the ++ piece of which we need the most parts is targeted. Slices that are ++ cancelled are also removed from the "pending" queue, as are pieces ++ that are completed. ++ * When duplicating a piece request, the slice request order is also ++ shuffled in order to minimize duplication of effort. ++ ++ Tracker info ++ * [status] Seems to be missing tracker.cpp diff. Added code to get ++ tracker's total peers, but not all trackers report these fields in ++ the normal response. Also added code to count successful updates ++ from the tracker. ++ * Added tracker connection state to status line (when ++ connecting/connected). ++ ++ Tracker contact ++ * When interrupting (ctrl-C), connect to the tracker immediately ++ rather than waiting 15 seconds. ++ * Contact tracker "soon" after transitioning to seeder state. ++ ++ Peer interaction ++ * Manage our interested state for each peer dynamically as content ++ changes. ++ * Unchoking ++ + Use the peer's interested state (confirming via the bitfield ++ that it needs our data) to consider unchoking. Using only the ++ bitfield could cause us to waste an upload slot on a peer ++ that doesn't have all content but isn't interested (like a ++ single-file downloader). ++ + Choke peers that become uninterested or don't need our data. ++ + Try unchoking new peers only as slots open or the optimistic ++ unchoke rotates. Unchoking too many peers can temporarily ++ reduce per-peer upload rates, which would make uploading to ++ us unappealing for good peers. ++ + In a tie for download speed, prefer to unchoke the peer to ++ whom we've uploaded the least data relative to what we've ++ downloaded from him. ++ * Optimistic unchoking ++ + Fixed condition inversion bug causing opt unchoking to occur ++ too often. ++ + A peer who has no pieces is now preferred 75% vs. a peer who ++ already has at least one piece, in order to help the new peer ++ become productive. This is documented in the online spec. ++ + Set peer's last-unchoke-time when choking the peer to get ++ better rotation of the optimistic unchoke. The value is now ++ the last time that a peer was in the unchoked state rather ++ than the time of the last unchoke event. ++ ++ Miscellaneous items ++ * [tracker] Fixed normal program end (stop) process, which was ++ crashing. ++ * [get1file] Restore compact tracker response support. ++ * [get1file] Made display of the status line info dependent on ++ whether the option is in use. ++ * [get1file] Apply the filter when checking for what we need from a ++ peer instead of when recording what the peer has; this prevents ++ stalls when we move on to the next file. Update interested state ++ for each peer when we begin a new file. Also move the file-done ++ check into the piece completion code and check whether the next ++ file(s) has also been completed. ++ * Reduced the slice size from 32K to 16K (same as BT & Azureus). ++ This provides more precise DL rate measurement, and helps insure ++ that we receive a productive amount of data (i.e. a complete ++ slice) even if we are unchoked by a peer for only one cycle. See ++ [3]http://groups.yahoo.com/group/BitTorrent/message/1260 for more ++ discussion/analysis on this. ++ * Added -v (verbose) option for additional debugging output. ++ ++References ++ ++ 1. http://www.rahul.net/dholmes/ctorrent/ctcs.html ++ 2. http://sourceforge.net/tracker/?atid=598034&group_id=91688&func=browse ++ 3. http://groups.yahoo.com/group/BitTorrent/message/1260 +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/config.h.in ctorrent-1.3.4/config.h.in +--- ctorrent-1.3.4.sav/config.h.in 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/config.h.in 2006-06-28 19:30:02.000000000 +0200 +@@ -10,6 +10,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_FCNTL_H + ++/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ ++#undef HAVE_FSEEKO ++ + /* Define to 1 if you have the `ftruncate' function. */ + #undef HAVE_FTRUNCATE + +@@ -31,6 +34,9 @@ + /* Define to 1 if you have the `crypt' library (-lcrypt). */ + #undef HAVE_LIBCRYPT + ++/* Define to 1 if you have the `crypto' library (-lcrypto). */ ++#undef HAVE_LIBCRYPTO ++ + /* Define to 1 if you have the `md' library (-lmd). */ + #undef HAVE_LIBMD + +@@ -107,6 +113,9 @@ + /* Define to 1 if you have the `strtol' function. */ + #undef HAVE_STRTOL + ++/* Define to 1 if you have the `strtoll' function. */ ++#undef HAVE_STRTOLL ++ + /* Define to 1 if you have the header file, and it defines `DIR'. + */ + #undef HAVE_SYS_DIR_H +@@ -164,15 +173,29 @@ + /* Define to 1 if you can safely include both and . */ + #undef TIME_WITH_SYS_TIME + ++/* Define to 1 to use the Steve Reid's public-domain SHA-1 code. */ ++#undef USE_STANDALONE_SHA1 ++ + /* Version number of package */ + #undef VERSION + ++/* Number of bits in a file offset, on hosts where this is settable. */ ++#undef _FILE_OFFSET_BITS ++ ++/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ ++#undef _LARGEFILE_SOURCE ++ ++/* Define for large files, on AIX-style hosts. */ ++#undef _LARGE_FILES ++ + /* Define to empty if `const' does not conform to ANSI C. */ + #undef const + +-/* Define as `__inline' if that's what the C compiler calls it, or to nothing +- if it is not supported. */ ++/* Define to `__inline__' or `__inline' if that's what the C compiler ++ calls it, or to nothing if 'inline' is not supported under any name. */ ++#ifndef __cplusplus + #undef inline ++#endif + + /* Define to `unsigned' if does not define. */ + #undef size_t +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/configure ctorrent-1.3.4/configure +--- ctorrent-1.3.4.sav/configure 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/configure 2006-06-28 19:30:02.000000000 +0200 +@@ -1,11 +1,10 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.57 for CTorrent devel. ++# Generated by GNU Autoconf 2.59 for CTorrent dnh2. + # +-# Report bugs to . ++# Report bugs to . + # +-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-# Free Software Foundation, Inc. ++# Copyright (C) 2003 Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + ## --------------------- ## +@@ -22,9 +21,10 @@ + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi ++DUALCASE=1; export DUALCASE # for MKS sh + + # Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false +@@ -43,7 +43,7 @@ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME + do +- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var +@@ -220,16 +220,17 @@ + if mkdir -p . 2>/dev/null; then + as_mkdir_p=: + else ++ test -d ./-p && rmdir ./-p + as_mkdir_p=false + fi + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + + # Sed expression to map a string onto a valid variable name. +-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + # IFS +@@ -268,9 +269,9 @@ + # Identity of this package. + PACKAGE_NAME='CTorrent' + PACKAGE_TARNAME='ctorrent' +-PACKAGE_VERSION='devel' +-PACKAGE_STRING='CTorrent devel' +-PACKAGE_BUGREPORT='bsdi@sina.com' ++PACKAGE_VERSION='dnh2' ++PACKAGE_STRING='CTorrent dnh2' ++PACKAGE_BUGREPORT='dholmes@ct.boxmail.com' + + ac_unique_file="ctorrent.cpp" + # Factoring default headers for most tests. +@@ -310,7 +311,7 @@ + # include + #endif" + +-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' + ac_subst_files='' + + # Initialize some variables set by options. +@@ -669,7 +670,7 @@ + + # Be sure to have absolute paths. + for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ +- localstatedir libdir includedir oldincludedir infodir mandir ++ localstatedir libdir includedir oldincludedir infodir mandir + do + eval ac_val=$`echo $ac_var` + case $ac_val in +@@ -709,10 +710,10 @@ + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || + $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$0" : 'X\(//\)[^/]' \| \ +- X"$0" : 'X\(//\)$' \| \ +- X"$0" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$0" : 'X\(//\)[^/]' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -787,7 +788,7 @@ + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +-\`configure' configures CTorrent devel to adapt to many kinds of systems. ++\`configure' configures CTorrent dnh2 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + +@@ -812,9 +813,9 @@ + cat <<_ACEOF + Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX +- [$ac_default_prefix] ++ [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +- [PREFIX] ++ [PREFIX] + + By default, \`make install' will install all the files in + \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +@@ -849,15 +850,16 @@ + + if test -n "$ac_init_help"; then + case $ac_init_help in +- short | recursive ) echo "Configuration of CTorrent devel:";; ++ short | recursive ) echo "Configuration of CTorrent dnh2:";; + esac + cat <<\_ACEOF + + Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +- --disable-dependency-tracking Speeds up one-time builds +- --enable-dependency-tracking Do not reject slow dependency extractors ++ --disable-dependency-tracking speeds up one-time build ++ --enable-dependency-tracking do not reject slow dependency extractors ++ --disable-largefile omit support for large files + + Some influential environment variables: + CXX C++ compiler command +@@ -873,7 +875,7 @@ + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. + +-Report bugs to . ++Report bugs to . + _ACEOF + fi + +@@ -907,12 +909,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. +@@ -923,7 +958,7 @@ + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || +- test -f $ac_srcdir/configure.in; then ++ test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else +@@ -936,11 +971,10 @@ + test -n "$ac_init_help" && exit 0 + if $ac_init_version; then + cat <<\_ACEOF +-CTorrent configure devel +-generated by GNU Autoconf 2.57 ++CTorrent configure dnh2 ++generated by GNU Autoconf 2.59 + +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-Free Software Foundation, Inc. ++Copyright (C) 2003 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -951,8 +985,8 @@ + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +-It was created by CTorrent $as_me devel, which was +-generated by GNU Autoconf 2.57. Invocation command line was ++It was created by CTorrent $as_me dnh2, which was ++generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +@@ -1029,19 +1063,19 @@ + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then +- ac_must_keep_next=false # Got value, back to normal. ++ ac_must_keep_next=false # Got value, back to normal. + else +- case $ac_arg in +- *=* | --config-cache | -C | -disable-* | --disable-* \ +- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ +- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ +- | -with-* | --with-* | -without-* | --without-* | --x) +- case "$ac_configure_args0 " in +- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; +- esac +- ;; +- -* ) ac_must_keep_next=true ;; +- esac ++ case $ac_arg in ++ *=* | --config-cache | -C | -disable-* | --disable-* \ ++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ ++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ ++ | -with-* | --with-* | -without-* | --without-* | --x) ++ case "$ac_configure_args0 " in ++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; ++ esac ++ ;; ++ -* ) ac_must_keep_next=true ;; ++ esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. +@@ -1075,12 +1109,12 @@ + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ +- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; +- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; + } +@@ -1109,7 +1143,7 @@ + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` +- echo "$ac_var='"'"'$ac_val'"'"'" ++ echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi +@@ -1128,7 +1162,7 @@ + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 +- rm -f core core.* *.core && ++ rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +@@ -1208,7 +1242,7 @@ + # value. + ac_cache_corrupted=false + for ac_var in `(set) 2>&1 | +- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do ++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" +@@ -1225,13 +1259,13 @@ + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then +- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 ++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} +- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 ++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + echo "$as_me: former value: $ac_old_val" >&2;} +- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 ++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + echo "$as_me: current value: $ac_new_val" >&2;} +- ac_cache_corrupted=: ++ ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. +@@ -1287,7 +1321,7 @@ + + + +-am__api_version="1.7" ++am__api_version="1.9" + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then +@@ -1324,6 +1358,7 @@ + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. + echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 + echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +@@ -1340,6 +1375,7 @@ + case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +@@ -1347,20 +1383,20 @@ + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then +- if test $ac_prog = install && +- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then +- # AIX install. It has an incompatible calling convention. +- : +- elif test $ac_prog = install && +- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then +- # program-specific install script used by HP pwplus--don't use. +- : +- else +- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" +- break 3 +- fi +- fi ++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then ++ if test $ac_prog = install && ++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ elif test $ac_prog = install && ++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ # program-specific install script used by HP pwplus--don't use. ++ : ++ else ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 ++ fi ++ fi + done + done + ;; +@@ -1448,7 +1484,6 @@ + program_transform_name=`echo $program_transform_name | sed -f conftest.sed` + rm conftest.sed + +- + # expand $ac_aux_dir to an absolute path + am_aux_dir=`cd $ac_aux_dir && pwd` + +@@ -1462,6 +1497,39 @@ + echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + fi + ++if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then ++ # We used to keeping the `.' as first argument, in order to ++ # allow $(mkdir_p) to be used without argument. As in ++ # $(mkdir_p) $(somedir) ++ # where $(somedir) is conditionally defined. However this is wrong ++ # for two reasons: ++ # 1. if the package is installed by a user who cannot write `.' ++ # make install will fail, ++ # 2. the above comment should most certainly read ++ # $(mkdir_p) $(DESTDIR)$(somedir) ++ # so it does not work when $(somedir) is undefined and ++ # $(DESTDIR) is not. ++ # To support the latter case, we have to write ++ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), ++ # so the `.' trick is pointless. ++ mkdir_p='mkdir -p --' ++else ++ # On NextStep and OpenStep, the `mkdir' command does not ++ # recognize any option. It will interpret all options as ++ # directories to create, and then abort because `.' already ++ # exists. ++ for d in ./-p ./--version; ++ do ++ test -d $d && rmdir $d ++ done ++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. ++ if test -f "$ac_aux_dir/mkinstalldirs"; then ++ mkdir_p='$(mkinstalldirs)' ++ else ++ mkdir_p='$(install_sh) -d' ++ fi ++fi ++ + for ac_prog in gawk mawk nawk awk + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -1504,7 +1572,7 @@ + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 + echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` ++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` + if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +@@ -1540,7 +1608,7 @@ + fi + rmdir .tst 2>/dev/null + +- # test to see if srcdir already configured ++# test to see if srcdir already configured + if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +@@ -1560,7 +1628,7 @@ + + # Define the identity of the package. + PACKAGE=ctorrent +- VERSION=devel ++ VERSION=dnh2 + + + cat >>confdefs.h <<_ACEOF +@@ -1588,9 +1656,6 @@ + + MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +- +-AMTAR=${AMTAR-"${am_missing_run}tar"} +- + install_sh=${install_sh-"$am_aux_dir/install-sh"} + + # Installed binaries are usually stripped using `strip' when the user +@@ -1683,6 +1748,13 @@ + + # We need awk for the "check" target. The system "awk" is bad on + # some platforms. ++# Always define AMTAR for backward compatibility. ++ ++AMTAR=${AMTAR-"${am_missing_run}tar"} ++ ++am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ++ ++ + + + +@@ -1806,7 +1878,6 @@ + (exit $ac_status); } + + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -1826,8 +1897,8 @@ + # Try to create an executable without -o first, disregard a.out. + # It will help us diagnose broken compilers, and finding out an intuition + # of exeext. +-echo "$as_me:$LINENO: checking for C++ compiler default output" >&5 +-echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 ++echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 + ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 +@@ -1847,23 +1918,23 @@ + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) +- ;; ++ ;; + conftest.$ac_ext ) +- # This is the source file. +- ;; ++ # This is the source file. ++ ;; + [ab].out ) +- # We found the default executable, but exeext='' is most +- # certainly right. +- break;; ++ # We found the default executable, but exeext='' is most ++ # certainly right. ++ break;; + *.* ) +- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- # FIXME: I believe we export ac_cv_exeext for Libtool, +- # but it would be cool to find out if it's true. Does anybody +- # maintain Libtool? --akim. +- export ac_cv_exeext +- break;; ++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ # FIXME: I believe we export ac_cv_exeext for Libtool, ++ # but it would be cool to find out if it's true. Does anybody ++ # maintain Libtool? --akim. ++ export ac_cv_exeext ++ break;; + * ) +- break;; ++ break;; + esac + done + else +@@ -1937,8 +2008,8 @@ + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- export ac_cv_exeext +- break;; ++ export ac_cv_exeext ++ break;; + * ) break;; + esac + done +@@ -1963,7 +2034,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2014,7 +2084,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2034,11 +2103,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_cxx_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2051,7 +2130,7 @@ + + ac_compiler_gnu=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + + fi +@@ -2067,7 +2146,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2084,11 +2162,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_cxx_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2101,7 +2189,7 @@ + + ac_cv_prog_cxx_g=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 + echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +@@ -2121,8 +2209,7 @@ + fi + fi + for ac_declaration in \ +- ''\ +- '#include ' \ ++ '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -2130,14 +2217,13 @@ + 'void exit (int);' + do + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ +-#include + $ac_declaration ++#include + int + main () + { +@@ -2148,11 +2234,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_cxx_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2165,9 +2261,8 @@ + + continue + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2184,11 +2279,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_cxx_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2200,7 +2305,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + rm -f conftest* + if test -n "$ac_declaration"; then +@@ -2321,7 +2426,9 @@ + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c +- : > sub/conftst$i.h ++ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with ++ # Solaris 8's {/usr,}/bin/sh. ++ touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + +@@ -2349,9 +2456,14 @@ + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings +- # (even with -Werror). So we grep stderr for any message +- # that says an option was ignored. +- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else ++ # or remarks (even with -Werror). So we grep stderr for any message ++ # that says an option was ignored or not supported. ++ # When given -MP, icc 7.0 and 7.1 complain thusly: ++ # icc: Command line warning: ignoring option '-M'; no argument required ++ # The diagnosis changed in icc 8.0: ++ # icc: Command line remark: option '-MP' not supported ++ if (grep 'ignoring option' conftest.err || ++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi +@@ -2723,7 +2835,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2743,11 +2854,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2760,7 +2881,7 @@ + + ac_compiler_gnu=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_c_compiler_gnu=$ac_compiler_gnu + + fi +@@ -2776,7 +2897,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2793,11 +2913,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2810,7 +2940,7 @@ + + ac_cv_prog_cc_g=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 + echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +@@ -2837,7 +2967,6 @@ + ac_cv_prog_cc_stdc=no + ac_save_CC=$CC + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2865,6 +2994,16 @@ + va_end (v); + return s; + } ++ ++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has ++ function prototypes and stuff, but not '\xHH' hex character constants. ++ These don't provoke an error unfortunately, instead are silently treated ++ as 'x'. The following induces an error, until -std1 is added to get ++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an ++ array size at least. It's necessary to write '\x00'==0 to get something ++ that's true only with -std1. */ ++int osf4_cc_array ['\x00' == 0 ? 1 : -1]; ++ + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; +@@ -2891,11 +3030,21 @@ + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2908,7 +3057,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext ++rm -f conftest.err conftest.$ac_objext + done + rm -f conftest.$ac_ext conftest.$ac_objext + CC=$ac_save_CC +@@ -2936,19 +3085,28 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ +- ''\ +- '#include ' \ ++ '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -2956,14 +3114,13 @@ + 'void exit (int);' + do + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ +-#include + $ac_declaration ++#include + int + main () + { +@@ -2974,11 +3131,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2991,9 +3158,8 @@ + + continue + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3010,11 +3176,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3026,7 +3202,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + rm -f conftest* + if test -n "$ac_declaration"; then +@@ -3040,7 +3216,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -3088,7 +3264,9 @@ + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c +- : > sub/conftst$i.h ++ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with ++ # Solaris 8's {/usr,}/bin/sh. ++ touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + +@@ -3116,9 +3294,14 @@ + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings +- # (even with -Werror). So we grep stderr for any message +- # that says an option was ignored. +- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else ++ # or remarks (even with -Werror). So we grep stderr for any message ++ # that says an option was ignored or not supported. ++ # When given -MP, icc 7.0 and 7.1 complain thusly: ++ # icc: Command line warning: ignoring option '-M'; no argument required ++ # The diagnosis changed in icc 8.0: ++ # icc: Command line remark: option '-MP' not supported ++ if (grep 'ignoring option' conftest.err || ++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi +@@ -3161,7 +3344,6 @@ + ac_check_lib_save_LIBS=$LIBS + LIBS="-lssl $LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3185,11 +3367,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3202,7 +3394,8 @@ + + ac_cv_lib_ssl_SHA1_Init=no + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi + echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SHA1_Init" >&5 +@@ -3224,7 +3417,6 @@ + ac_check_lib_save_LIBS=$LIBS + LIBS="-lcrypt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3248,11 +3440,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3265,7 +3467,8 @@ + + ac_cv_lib_crypt_SHA1_Init=no + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi + echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_SHA1_Init" >&5 +@@ -3279,6 +3482,79 @@ + + else + ++echo "$as_me:$LINENO: checking for SHA1_Init in -lcrypto" >&5 ++echo $ECHO_N "checking for SHA1_Init in -lcrypto... $ECHO_C" >&6 ++if test "${ac_cv_lib_crypto_SHA1_Init+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lcrypto $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char SHA1_Init (); ++int ++main () ++{ ++SHA1_Init (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_crypto_SHA1_Init=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_crypto_SHA1_Init=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_SHA1_Init" >&5 ++echo "${ECHO_T}$ac_cv_lib_crypto_SHA1_Init" >&6 ++if test $ac_cv_lib_crypto_SHA1_Init = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBCRYPTO 1 ++_ACEOF ++ ++ LIBS="-lcrypto $LIBS" ++ ++else ++ + echo "$as_me:$LINENO: checking for SHA1_Init in -lmd" >&5 + echo $ECHO_N "checking for SHA1_Init in -lmd... $ECHO_C" >&6 + if test "${ac_cv_lib_md_SHA1_Init+set}" = set; then +@@ -3287,7 +3563,6 @@ + ac_check_lib_save_LIBS=$LIBS + LIBS="-lmd $LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3311,11 +3586,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3328,7 +3613,8 @@ + + ac_cv_lib_md_SHA1_Init=no + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi + echo "$as_me:$LINENO: result: $ac_cv_lib_md_SHA1_Init" >&5 +@@ -3341,9 +3627,13 @@ + LIBS="-lmd $LIBS" + + else +- { { echo "$as_me:$LINENO: error: error, Please install OpenSSL first!" >&5 +-echo "$as_me: error: error, Please install OpenSSL first!" >&2;} +- { (exit 1); exit 1; }; } ++ ++cat >>confdefs.h <<\_ACEOF ++#define USE_STANDALONE_SHA1 ++_ACEOF ++ ++fi ++ + fi + + fi +@@ -3366,7 +3656,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3386,11 +3675,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3403,7 +3702,7 @@ + + eval "$as_ac_Header=no" + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +@@ -3426,7 +3725,6 @@ + ac_func_search_save_LIBS=$LIBS + ac_cv_search_opendir=no + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3450,11 +3748,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3466,12 +3774,12 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3495,11 +3803,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3512,7 +3830,8 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + done + fi + LIBS=$ac_func_search_save_LIBS +@@ -3533,7 +3852,6 @@ + ac_func_search_save_LIBS=$LIBS + ac_cv_search_opendir=no + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3557,11 +3875,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3573,12 +3901,12 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3602,11 +3930,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3619,7 +3957,8 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + done + fi + LIBS=$ac_func_search_save_LIBS +@@ -3661,7 +4000,6 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3672,7 +4010,7 @@ + #else + # include + #endif +- Syntax error ++ Syntax error + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +@@ -3684,6 +4022,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3704,7 +4043,6 @@ + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3722,6 +4060,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3768,7 +4107,6 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3779,7 +4117,7 @@ + #else + # include + #endif +- Syntax error ++ Syntax error + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +@@ -3791,6 +4129,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3811,7 +4150,6 @@ + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3829,6 +4167,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3889,7 +4228,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3910,11 +4248,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3927,12 +4275,11 @@ + + ac_cv_header_stdc=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3954,7 +4301,6 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3979,7 +4325,6 @@ + : + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3991,9 +4336,9 @@ + # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #else + # define ISLOWER(c) \ +- (('a' <= (c) && (c) <= 'i') \ +- || ('j' <= (c) && (c) <= 'r') \ +- || ('s' <= (c) && (c) <= 'z')) ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) + # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) + #endif + +@@ -4004,7 +4349,7 @@ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) +- || toupper (i) != TOUPPER (i)) ++ || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); + } +@@ -4029,7 +4374,7 @@ + ( exit $ac_status ) + ac_cv_header_stdc=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + fi +@@ -4054,7 +4399,7 @@ + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ +- inttypes.h stdint.h unistd.h ++ inttypes.h stdint.h unistd.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_header" >&5 +@@ -4063,7 +4408,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4075,11 +4419,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4092,7 +4446,7 @@ + + eval "$as_ac_Header=no" + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +@@ -4135,7 +4489,6 @@ + echo "$as_me:$LINENO: checking $ac_header usability" >&5 + echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4146,16 +4499,26 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then + ac_header_compiler=yes + else + echo "$as_me: failed program was:" >&5 +@@ -4163,7 +4526,7 @@ + + ac_header_compiler=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 + echo "${ECHO_T}$ac_header_compiler" >&6 + +@@ -4171,7 +4534,6 @@ + echo "$as_me:$LINENO: checking $ac_header presence" >&5 + echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4189,6 +4551,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -4208,33 +4571,32 @@ + echo "${ECHO_T}$ac_header_preproc" >&6 + + # So? What about this header? +-case $ac_header_compiler:$ac_header_preproc in +- yes:no ) ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 + echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- ( +- cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to bug-autoconf@gnu.org. ## +-## ------------------------------------ ## +-_ASBOX +- ) | +- sed "s/^/$as_me: WARNING: /" >&2 ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes + ;; +- no:yes ) ++ no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 + echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +-## ------------------------------------ ## +-## Report this to bug-autoconf@gnu.org. ## +-## ------------------------------------ ## ++## ------------------------------------- ## ++## Report this to dholmes@ct.boxmail.com ## ++## ------------------------------------- ## + _ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 +@@ -4245,7 +4607,7 @@ + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- eval "$as_ac_Header=$ac_header_preproc" ++ eval "$as_ac_Header=\$ac_header_preproc" + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +@@ -4268,7 +4630,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4331,11 +4692,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4348,7 +4719,7 @@ + + ac_cv_c_const=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 + echo "${ECHO_T}$ac_cv_c_const" >&6 +@@ -4368,7 +4739,6 @@ + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4383,11 +4753,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4399,23 +4779,27 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + + fi + echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 + echo "${ECHO_T}$ac_cv_c_inline" >&6 ++ ++ + case $ac_cv_c_inline in + inline | yes) ;; +- no) +-cat >>confdefs.h <<\_ACEOF +-#define inline +-_ACEOF +- ;; +- *) cat >>confdefs.h <<_ACEOF +-#define inline $ac_cv_c_inline ++ *) ++ case $ac_cv_c_inline in ++ no) ac_val=;; ++ *) ac_val=$ac_cv_c_inline;; ++ esac ++ cat >>confdefs.h <<_ACEOF ++#ifndef __cplusplus ++#define inline $ac_val ++#endif + _ACEOF +- ;; ++ ;; + esac + + echo "$as_me:$LINENO: checking for size_t" >&5 +@@ -4424,7 +4808,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4444,11 +4827,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4461,7 +4854,7 @@ + + ac_cv_type_size_t=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 + echo "${ECHO_T}$ac_cv_type_size_t" >&6 +@@ -4481,7 +4874,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4502,11 +4894,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4519,7 +4921,7 @@ + + ac_cv_header_time=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 + echo "${ECHO_T}$ac_cv_header_time" >&6 +@@ -4541,7 +4943,6 @@ + else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4561,7 +4962,6 @@ + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4594,13 +4994,12 @@ + ac_cv_func_memcmp_working=no + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ +- ++$ac_includes_default + int + main () + { +@@ -4619,12 +5018,12 @@ + int i; + for (i = 0; i < 4; i++) + { +- char *a = foo + i; +- char *b = bar + i; +- strcpy (a, "--------01111111"); +- strcpy (b, "--------10000000"); +- if (memcmp (a, b, 16) >= 0) +- exit (1); ++ char *a = foo + i; ++ char *b = bar + i; ++ strcpy (a, "--------01111111"); ++ strcpy (b, "--------10000000"); ++ if (memcmp (a, b, 16) >= 0) ++ exit (1); + } + exit (0); + } +@@ -4653,12 +5052,19 @@ + ( exit $ac_status ) + ac_cv_func_memcmp_working=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 + echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 +-test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext" ++test $ac_cv_func_memcmp_working = no && case $LIBOBJS in ++ "memcmp.$ac_objext" | \ ++ *" memcmp.$ac_objext" | \ ++ "memcmp.$ac_objext "* | \ ++ *" memcmp.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; ++esac ++ + + echo "$as_me:$LINENO: checking return type of signal handlers" >&5 + echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +@@ -4666,7 +5072,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4693,11 +5098,21 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4710,7 +5125,7 @@ + + ac_cv_type_signal=int + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 + echo "${ECHO_T}$ac_cv_type_signal" >&6 +@@ -4732,7 +5147,6 @@ + ac_cv_func_lstat_dereferences_slashed_symlink=no + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4744,8 +5158,8 @@ + { + struct stat sbuf; + /* Linux will dereference the symlink and fail. +- That is better in the sense that it means we will not +- have to compile and use the lstat wrapper. */ ++ That is better in the sense that it means we will not ++ have to compile and use the lstat wrapper. */ + exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); + ; + return 0; +@@ -4771,7 +5185,7 @@ + ( exit $ac_status ) + ac_cv_func_lstat_dereferences_slashed_symlink=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + else + # If the `ln -s' command failed, then we probably don't even +@@ -4792,7 +5206,14 @@ + + + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then +- LIBOBJS="$LIBOBJS lstat.$ac_objext" ++ case $LIBOBJS in ++ "lstat.$ac_objext" | \ ++ *" lstat.$ac_objext" | \ ++ "lstat.$ac_objext "* | \ ++ *" lstat.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; ++esac ++ + fi + + echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +@@ -4804,7 +5225,6 @@ + ac_cv_func_stat_empty_string_bug=yes + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4840,13 +5260,20 @@ + ( exit $ac_status ) + ac_cv_func_stat_empty_string_bug=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 + echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6 + if test $ac_cv_func_stat_empty_string_bug = yes; then +- LIBOBJS="$LIBOBJS stat.$ac_objext" ++ case $LIBOBJS in ++ "stat.$ac_objext" | \ ++ *" stat.$ac_objext" | \ ++ "stat.$ac_objext "* | \ ++ *" stat.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; ++esac ++ + + cat >>confdefs.h <<_ACEOF + #define HAVE_STAT_EMPTY_STRING_BUG 1 +@@ -4871,7 +5298,8 @@ + + + +-for ac_func in ftruncate gethostbyname gettimeofday getwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strnstr ++ ++for ac_func in ftruncate gethostbyname gettimeofday getwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strtoll strnstr + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_func" >&5 +@@ -4880,21 +5308,28 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case declares $ac_func. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ ++ + #ifdef __STDC__ + # include + #else + # include + #endif ++ ++#undef $ac_func ++ + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" +@@ -4925,11 +5360,21 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -s conftest$ac_exeext' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4942,7 +5387,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -4955,6 +5401,547 @@ + done + + ++# Enable/check large file support ++# Check whether --enable-largefile or --disable-largefile was given. ++if test "${enable_largefile+set}" = set; then ++ enableval="$enable_largefile" ++ ++fi; ++if test "$enable_largefile" != no; then ++ ++ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 ++echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 ++if test "${ac_cv_sys_largefile_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_sys_largefile_CC=no ++ if test "$GCC" != yes; then ++ ac_save_CC=$CC ++ while :; do ++ # IRIX 6.2 and later do not support large files by default, ++ # so use the C compiler's -n32 option if that helps. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext ++ CC="$CC -n32" ++ rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_sys_largefile_CC=' -n32'; break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext ++ break ++ done ++ CC=$ac_save_CC ++ rm -f conftest.$ac_ext ++ fi ++fi ++echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 ++echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 ++ if test "$ac_cv_sys_largefile_CC" != no; then ++ CC=$CC$ac_cv_sys_largefile_CC ++ fi ++ ++ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 ++echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 ++if test "${ac_cv_sys_file_offset_bits+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ while :; do ++ ac_cv_sys_file_offset_bits=no ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#define _FILE_OFFSET_BITS 64 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_sys_file_offset_bits=64; break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ break ++done ++fi ++echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 ++echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 ++if test "$ac_cv_sys_file_offset_bits" != no; then ++ ++cat >>confdefs.h <<_ACEOF ++#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits ++_ACEOF ++ ++fi ++rm -f conftest* ++ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 ++echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 ++if test "${ac_cv_sys_large_files+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ while :; do ++ ac_cv_sys_large_files=no ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#define _LARGE_FILES 1 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_sys_large_files=1; break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ break ++done ++fi ++echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 ++echo "${ECHO_T}$ac_cv_sys_large_files" >&6 ++if test "$ac_cv_sys_large_files" != no; then ++ ++cat >>confdefs.h <<_ACEOF ++#define _LARGE_FILES $ac_cv_sys_large_files ++_ACEOF ++ ++fi ++rm -f conftest* ++fi ++ ++echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 ++echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 ++if test "${ac_cv_sys_largefile_source+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ while :; do ++ ac_cv_sys_largefile_source=no ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++return !fseeko; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#define _LARGEFILE_SOURCE 1 ++#include ++int ++main () ++{ ++return !fseeko; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_sys_largefile_source=1; break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++ break ++done ++fi ++echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 ++echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 ++if test "$ac_cv_sys_largefile_source" != no; then ++ ++cat >>confdefs.h <<_ACEOF ++#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source ++_ACEOF ++ ++fi ++rm -f conftest* ++ ++# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug ++# in glibc 2.1.3, but that breaks too many other things. ++# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. ++echo "$as_me:$LINENO: checking for fseeko" >&5 ++echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 ++if test "${ac_cv_func_fseeko+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++return fseeko && fseeko (stdin, 0, 0); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_func_fseeko=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_func_fseeko=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5 ++echo "${ECHO_T}$ac_cv_func_fseeko" >&6 ++if test $ac_cv_func_fseeko = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_FSEEKO 1 ++_ACEOF ++ ++fi ++ ++ + ac_config_files="$ac_config_files Makefile" + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -4984,13 +5971,13 @@ + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ +- "s/'/'\\\\''/g; +- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ++ "s/'/'\\\\''/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; + } | +@@ -5020,13 +6007,13 @@ + # trailing colons and then remove the whole line if VPATH becomes empty + # (actually we leave an empty line to preserve line numbers). + if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=/{ ++ ac_vpsub='/^[ ]*VPATH[ ]*=/{ + s/:*\$(srcdir):*/:/; + s/:*\${srcdir}:*/:/; + s/:*@srcdir@:*/:/; +-s/^\([^=]*=[ ]*\):*/\1/; ++s/^\([^=]*=[ ]*\):*/\1/; + s/:*$//; +-s/^[^=]*=[ ]*$//; ++s/^[^=]*=[ ]*$//; + }' + fi + +@@ -5037,7 +6024,7 @@ + for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | +- sed 's/\$U\././;s/\.o$//;s/\.obj$//'` ++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +@@ -5102,9 +6089,10 @@ + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi ++DUALCASE=1; export DUALCASE # for MKS sh + + # Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false +@@ -5123,7 +6111,7 @@ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME + do +- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var +@@ -5302,16 +6290,17 @@ + if mkdir -p . 2>/dev/null; then + as_mkdir_p=: + else ++ test -d ./-p && rmdir ./-p + as_mkdir_p=false + fi + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + + # Sed expression to map a string onto a valid variable name. +-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + # IFS +@@ -5337,8 +6326,8 @@ + } >&5 + cat >&5 <<_CSEOF + +-This file was extended by CTorrent $as_me devel, which was +-generated by GNU Autoconf 2.57. Invocation command line was ++This file was extended by CTorrent $as_me dnh2, which was ++generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -5382,9 +6371,9 @@ + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] +- instantiate the configuration file FILE ++ instantiate the configuration file FILE + --header=FILE[:TEMPLATE] +- instantiate the configuration header FILE ++ instantiate the configuration header FILE + + Configuration files: + $config_files +@@ -5400,12 +6389,11 @@ + + cat >>$CONFIG_STATUS <<_ACEOF + ac_cs_version="\\ +-CTorrent config.status devel +-configured by $0, generated by GNU Autoconf 2.57, ++CTorrent config.status dnh2 ++configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 2003 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + srcdir=$srcdir +@@ -5610,14 +6598,17 @@ + s,@AUTOMAKE@,$AUTOMAKE,;t t + s,@AUTOHEADER@,$AUTOHEADER,;t t + s,@MAKEINFO@,$MAKEINFO,;t t +-s,@AMTAR@,$AMTAR,;t t + s,@install_sh@,$install_sh,;t t + s,@STRIP@,$STRIP,;t t + s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t + s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t ++s,@mkdir_p@,$mkdir_p,;t t + s,@AWK@,$AWK,;t t + s,@SET_MAKE@,$SET_MAKE,;t t + s,@am__leading_dot@,$am__leading_dot,;t t ++s,@AMTAR@,$AMTAR,;t t ++s,@am__tar@,$am__tar,;t t ++s,@am__untar@,$am__untar,;t t + s,@CXX@,$CXX,;t t + s,@CXXFLAGS@,$CXXFLAGS,;t t + s,@LDFLAGS@,$LDFLAGS,;t t +@@ -5673,9 +6664,9 @@ + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then +- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" ++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else +- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" ++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end +@@ -5693,21 +6684,21 @@ + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ cat >$tmp/stdin ++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || + $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$ac_file" : 'X\(//\)[^/]' \| \ +- X"$ac_file" : 'X\(//\)$' \| \ +- X"$ac_file" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$ac_file" : 'X\(//\)[^/]' \| \ ++ X"$ac_file" : 'X\(//\)$' \| \ ++ X"$ac_file" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -5723,10 +6714,10 @@ + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || + $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$as_dir" : 'X\(//\)[^/]' \| \ +- X"$as_dir" : 'X\(//\)$' \| \ +- X"$as_dir" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -5764,12 +6755,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + + case $INSTALL in +@@ -5791,7 +6815,7 @@ + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | +- sed 's,.*/,,'` by configure." ++ sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. +@@ -5800,24 +6824,24 @@ + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++ # Absolute (can't be DOS-style, as IFS=:) ++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- echo $f;; ++ echo "$f";; + *) # Relative +- if test -f "$f"; then +- # Build tree +- echo $f +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo $srcdir/$f +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++ if test -f "$f"; then ++ # Build tree ++ echo "$f" ++ elif test -f "$srcdir/$f"; then ++ # Source tree ++ echo "$srcdir/$f" ++ else ++ # /dev/null tree ++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- fi;; ++ fi;; + esac + done` || { (exit 1); exit 1; } + _ACEOF +@@ -5859,12 +6883,12 @@ + # NAME is the cpp macro being defined and VALUE is the value it is being given. + # + # ac_d sets the value in "#define NAME VALUE" lines. +-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +-ac_dB='[ ].*$,\1#\2' ++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ++ac_dB='[ ].*$,\1#\2' + ac_dC=' ' + ac_dD=',;t' + # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_uB='$,\1#\2define\3' + ac_uC=' ' + ac_uD=',;t' +@@ -5873,11 +6897,11 @@ + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ cat >$tmp/stdin ++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; ++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + +@@ -5891,28 +6915,29 @@ + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++ # Absolute (can't be DOS-style, as IFS=:) ++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- echo $f;; ++ # Do quote $f, to prevent DOS paths from being IFS'd. ++ echo "$f";; + *) # Relative +- if test -f "$f"; then +- # Build tree +- echo $f +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo $srcdir/$f +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 ++ if test -f "$f"; then ++ # Build tree ++ echo "$f" ++ elif test -f "$srcdir/$f"; then ++ # Source tree ++ echo "$srcdir/$f" ++ else ++ # /dev/null tree ++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- fi;; ++ fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. +- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in ++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + + _ACEOF + +@@ -5935,9 +6960,9 @@ + s,[\\$`],\\&,g + t clear + : clear +-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp ++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp + t end +-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp ++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp + : end + _ACEOF + # If some macros were called several times there might be several times +@@ -5951,13 +6976,13 @@ + # example, in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + cat >>conftest.undefs <<\_ACEOF +-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, ++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, + _ACEOF + + # Break up conftest.defines because some shells have a limit on the size + # of here documents, and old seds have small limits too (100 cmds). + echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS ++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS + echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS + echo ' :' >>$CONFIG_STATUS + rm -f conftest.tail +@@ -5966,7 +6991,7 @@ + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. +- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS ++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS +@@ -5993,7 +7018,7 @@ + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' +- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS ++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS +@@ -6027,10 +7052,10 @@ + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || + $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$ac_file" : 'X\(//\)[^/]' \| \ +- X"$ac_file" : 'X\(//\)$' \| \ +- X"$ac_file" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$ac_file" : 'X\(//\)[^/]' \| \ ++ X"$ac_file" : 'X\(//\)$' \| \ ++ X"$ac_file" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -6046,10 +7071,10 @@ + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || + $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$as_dir" : 'X\(//\)[^/]' \| \ +- X"$as_dir" : 'X\(//\)$' \| \ +- X"$as_dir" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -6081,10 +7106,10 @@ + done + echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || + $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X$ac_file : 'X\(//\)[^/]' \| \ +- X$ac_file : 'X\(//\)$' \| \ +- X$ac_file : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X$ac_file : 'X\(//\)[^/]' \| \ ++ X$ac_file : 'X\(//\)$' \| \ ++ X$ac_file : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -6103,16 +7128,41 @@ + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || + $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$ac_dest" : 'X\(//\)[^/]' \| \ +- X"$ac_dest" : 'X\(//\)$' \| \ +- X"$ac_dest" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$ac_dest" : 'X\(//\)[^/]' \| \ ++ X"$ac_dest" : 'X\(//\)$' \| \ ++ X"$ac_dest" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` ++ { if $as_mkdir_p; then ++ mkdir -p "$ac_dir" ++ else ++ as_dir="$ac_dir" ++ as_dirs= ++ while test ! -d "$as_dir"; do ++ as_dirs="$as_dir $as_dirs" ++ as_dir=`(dirname "$as_dir") 2>/dev/null || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || ++echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } ++ /^X\(\/\/\)[^/].*/{ s//\1/; q; } ++ /^X\(\/\/\)$/{ s//\1/; q; } ++ /^X\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ done ++ test ! -n "$as_dirs" || mkdir $as_dirs ++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 ++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} ++ { (exit 1); exit 1; }; }; } ++ + ac_builddir=. + + if test "$ac_dir" != .; then +@@ -6138,12 +7188,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +@@ -6161,10 +7244,10 @@ + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || + $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$mf" : 'X\(//\)[^/]' \| \ +- X"$mf" : 'X\(//\)$' \| \ +- X"$mf" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$mf" : 'X\(//\)[^/]' \| \ ++ X"$mf" : 'X\(//\)$' \| \ ++ X"$mf" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -6174,36 +7257,30 @@ + else + continue + fi +- grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue +- # Extract the definition of DEP_FILES from the Makefile without +- # running `make'. +- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` ++ # Extract the definition of DEPDIR, am__include, and am__quote ++ # from the Makefile without running `make'. ++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue ++ am__include=`sed -n 's/^am__include = //p' < "$mf"` ++ test -z "am__include" && continue ++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it +- U=`sed -n -e '/^U = / s///p' < "$mf"` +- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" +- # We invoke sed twice because it is the simplest approach to +- # changing $(DEPDIR) to its actual value in the expansion. +- for file in `sed -n -e ' +- /^DEP_FILES = .*\\\\$/ { +- s/^DEP_FILES = // +- :loop +- s/\\\\$// +- p +- n +- /\\\\$/ b loop +- p +- } +- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ ++ U=`sed -n 's/^U = //p' < "$mf"` ++ # Find all dependency output files, they are included files with ++ # $(DEPDIR) in their names. We invoke sed twice because it is the ++ # simplest approach to changing $(DEPDIR) to its actual value in the ++ # expansion. ++ for file in `sed -n " ++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || + $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$file" : 'X\(//\)[^/]' \| \ +- X"$file" : 'X\(//\)$' \| \ +- X"$file" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$file" : 'X\(//\)[^/]' \| \ ++ X"$file" : 'X\(//\)$' \| \ ++ X"$file" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +@@ -6219,10 +7296,10 @@ + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || + $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$as_dir" : 'X\(//\)[^/]' \| \ +- X"$as_dir" : 'X\(//\)$' \| \ +- X"$as_dir" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || + echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/configure.ac ctorrent-1.3.4/configure.ac +--- ctorrent-1.3.4.sav/configure.ac 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/configure.ac 2006-06-28 19:30:02.000000000 +0200 +@@ -1,6 +1,6 @@ + # Process this file with autoconf to produce a configure script. +-AC_INIT([CTorrent], [devel], [bsdi@sina.com]) +-AM_INIT_AUTOMAKE(ctorrent,devel) ++AC_INIT([CTorrent], [dnh2], [dholmes@ct.boxmail.com]) ++AM_INIT_AUTOMAKE(ctorrent,dnh2) + AC_CONFIG_HEADER([config.h]) + + AC_CONFIG_SRCDIR([ctorrent.cpp]) +@@ -14,7 +14,7 @@ + [AC_CHECK_LIB([crypt],[SHA1_Init],, + [AC_CHECK_LIB([crypto],[SHA1_Init],, + [AC_CHECK_LIB([md],[SHA1_Init],, +- [AC_MSG_ERROR([error, Please install OpenSSL first!])])])])]) ++ [AC_DEFINE([USE_STANDALONE_SHA1],,[Define to 1 to use the Steve Reid's public-domain SHA-1 code.])])])])]) + + # Checks for header files. + AC_HEADER_DIRENT +@@ -32,6 +32,10 @@ + AC_FUNC_MEMCMP + AC_TYPE_SIGNAL + AC_FUNC_STAT +-AC_CHECK_FUNCS([ftruncate gethostbyname gettimeofday getwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strnstr]) ++AC_CHECK_FUNCS([ftruncate gethostbyname gettimeofday getwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strtoll strnstr]) ++ ++# Enable/check large file support ++AC_SYS_LARGEFILE ++AC_FUNC_FSEEKO + + AC_OUTPUT(Makefile) +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/ctcs.cpp ctorrent-1.3.4/ctcs.cpp +--- ctorrent-1.3.4.sav/ctcs.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/ctcs.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -0,0 +1,540 @@ ++#ifndef WINDOWS ++#include ++#include ++#include ++#include ++#endif ++ ++#include ++#include ++#include ++ ++#include ++ ++#include "ctcs.h" ++#include "btcontent.h" ++#include "setnonblock.h" ++#include "connect_nonb.h" ++#include "tracker.h" ++#include "peerlist.h" ++#include "peer.h" ++#include "btconfig.h" ++#include "bttime.h" ++ ++#define compset(a,member) ( (a.member==member)? 0 : ((a.member = member)||1) ) ++ ++Ctcs CTCS; ++ ++ ++Ctcs::Ctcs() ++{ ++ memset(m_host,0,MAXHOSTNAMELEN); ++ ++ m_sock = INVALID_SOCKET; ++ m_port = 2780; ++ m_status = T_FREE; ++ m_interval = 1; ++ ++ m_last_timestamp = m_sent_ctstatus_time = (time_t) 0; ++ m_sent_ctstatus = 0; ++ m_sent_ctbw = 0; ++} ++ ++ ++Ctcs::~Ctcs() ++{ ++ if( m_sock != INVALID_SOCKET) CLOSE_SOCKET(m_sock); ++} ++ ++ ++void Ctcs::Reset(time_t new_interval) ++{ ++ if(new_interval) m_interval = new_interval; ++ ++ if( INVALID_SOCKET != m_sock ){ ++ CLOSE_SOCKET(m_sock); ++ m_sock = INVALID_SOCKET; ++ } ++ ++ in_buffer.Reset(); ++ out_buffer.Reset(); ++ m_last_timestamp = now; ++ m_sent_ctstatus = 0; ++ m_sent_ctbw = 0; ++ m_status = T_FREE; ++} ++ ++ ++// borrowed from tracker.cpp (with changes) ++int Ctcs:: _s2sin(char *h,int p,struct sockaddr_in *psin) ++{ ++ psin->sin_family = AF_INET; ++ psin->sin_port = htons(p); ++ psin->sin_addr.s_addr = inet_addr(h); ++ if(psin->sin_addr.s_addr == INADDR_NONE){ ++ struct hostent *ph = gethostbyname(h); ++ if( !ph || ph->h_addrtype != AF_INET){ ++ memset(psin,0,sizeof(struct sockaddr_in)); ++ return -1; ++ } ++ memcpy(&psin->sin_addr,ph->h_addr_list[0],sizeof(struct in_addr)); ++ } ++ return ( psin->sin_addr.s_addr == INADDR_NONE ) ? -1 : 0; ++} ++ ++ ++int Ctcs::CheckMessage() ++{ ++ ssize_t r; ++ size_t q; ++ ++ r = in_buffer.FeedIn(m_sock); ++ ++ if( r == 0 ) return 0; // no data ++ if( r < 0 ){ Reset(1); return -1; } // error ++ ++ q = in_buffer.Count(); ++ ++ if( !q ){ ++ int error = 0; ++ socklen_t n = sizeof(error); ++ if(getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n) < 0 || ++ error != 0 ){ ++ fprintf(stderr,"warn, received nothing from CTCS! %s\n",strerror(error)); ++ } ++ Reset(0); ++ return -1; ++ } ++ ++ char *s, *msgbuf; ++ while(in_buffer.Count() && (s=strchr(msgbuf=in_buffer.BasePointer(), '\n'))){ ++// msgbuf = in_buffer.BasePointer(); ++// if( s=strchr(msgbuf, '\n') ){ //have a complete message ++ *s = '\0'; ++ if(arg_verbose) fprintf(stderr, "CTCS: %s\n", msgbuf); ++ if( !strncmp("SETDLIMIT",msgbuf,9) ){ ++ cfg_max_bandwidth_down = (int)(strtod(msgbuf+10, NULL)); ++ if(arg_verbose) fprintf(stderr, "DLimit=%d\n", cfg_max_bandwidth_down); ++ }else if( !strncmp("SETULIMIT",msgbuf,9) ){ ++ cfg_max_bandwidth_up = (int)(strtod(msgbuf+10, NULL)); ++ if(arg_verbose) fprintf(stderr, "ULimit=%d\n", cfg_max_bandwidth_up); ++ }else if( !strncmp("SENDPEERS",msgbuf,9) ){ ++ Send_Peers(); ++ }else if( !strncmp("SENDSTATUS",msgbuf,10) ){ ++ Send_Status(); ++ }else if( !strncmp("SENDCONF",msgbuf,8) ){ ++ Send_Config(); ++ }else if( !strncmp("CTCONFIG",msgbuf,8) ){ ++ Set_Config(msgbuf); ++ }else if( !strncmp("SENDDETAIL",msgbuf,10) ){ ++ Send_Detail(); ++ }else if( !strncmp("CTQUIT",msgbuf,6) ){ ++ printf("CTCS sent Quit command\n"); ++ Tracker.SetStoped(); ++ }else if( !strncmp("CTRESTART",msgbuf,9) ){ ++ RestartTracker(); ++ }else if( !strncmp("CTUPDATE",msgbuf,8) ){ ++ Tracker.Reset(1); ++ }else if( !strncmp("PROTOCOL",msgbuf,8) ){ ++ // nothing yet ++ }else{ ++ if(arg_verbose) fprintf(stderr, "unknown CTCS message: %s", msgbuf); ++ } ++ in_buffer.PickUp(s-msgbuf + 1); ++ } ++ return 0; ++} ++ ++ ++int Ctcs::SendMessage(char *message) ++{ ++ int len, r=0; ++ char buf[CTCS_BUFSIZE]; ++ ++ if( m_status == T_READY ){ ++ len = strlen(message); ++ strncpy(buf, message, len); ++ if( len+1 < CTCS_BUFSIZE ){ ++ buf[len] = '\n'; ++ buf[len+1] = '\0'; ++ }else{ ++ buf[CTCS_BUFSIZE-2] = '\n'; ++ buf[CTCS_BUFSIZE-1] = '\0'; ++ } ++ r = out_buffer.Put(m_sock, buf, len+1); ++ if( r<0 ) Reset(1); ++ } ++ return r; ++} ++ ++ ++int Ctcs::Send_Auth() ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ if(!*m_pass) return 0; ++ snprintf(message, CTCS_BUFSIZE, "AUTH %s", m_pass); ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Send_Protocol() ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ snprintf(message, CTCS_BUFSIZE, "PROTOCOL %s", CTCS_PROTOCOL); ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Send_Torrent(unsigned char *peerid, char *torrent) ++{ ++ char message[CTCS_BUFSIZE]; ++ char txtid[PEER_ID_LEN*2+3]; ++ ++ TextPeerID(peerid, txtid); ++ ++ snprintf(message, CTCS_BUFSIZE, "CTORRENT %s %ld %ld %s", txtid, ++ (long)(BTCONTENT.GetStartTime()), (long)now, torrent); ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Report_Status(size_t seeders, size_t leechers, size_t nhave, ++ size_t ntotal, size_t navail, size_t dlrate, size_t ulrate, ++ u_int64_t dltotal, u_int64_t ultotal, size_t dlimit, size_t ulimit) ++{ ++ int changebw=0,change=0; ++ int r; ++ size_t nhad; ++ ++ if( T_READY != m_status ) return 0; ++ ++ nhad = m_ctstatus.nhave; ++ ++ changebw = ( ++ compset(m_ctstatus, dlrate) | ++ compset(m_ctstatus, ulrate) | ++ compset(m_ctstatus, dlimit) | ++ compset(m_ctstatus, ulimit) ); ++ change = ( changebw | ++ compset(m_ctstatus, seeders) | ++ compset(m_ctstatus, leechers) | ++ compset(m_ctstatus, nhave) | ++ compset(m_ctstatus, ntotal) | ++ compset(m_ctstatus, navail) | ++ compset(m_ctstatus, dltotal) | ++ compset(m_ctstatus, ultotal) ); ++ ++ if( ( !m_sent_ctstatus || (nhad now) ) && ++ (r=Send_Status()) != 0 ) return r; ++ else return (changebw || !m_sent_ctbw) ? Send_bw() : 0; ++} ++ ++ ++int Ctcs::Send_Status() ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ if( m_sent_ctstatus_time + 1 > now ) { ++ m_sent_ctstatus = 0; ++ return 0; ++ } ++ snprintf(message, CTCS_BUFSIZE, "CTSTATUS %u/%u %u/%u/%u %u,%u %llu,%llu %u,%u", ++ m_ctstatus.seeders, m_ctstatus.leechers, ++ m_ctstatus.nhave, m_ctstatus.ntotal, m_ctstatus.navail, ++ m_ctstatus.dlrate, m_ctstatus.ulrate, ++ m_ctstatus.dltotal, m_ctstatus.ultotal, ++ m_ctstatus.dlimit, m_ctstatus.ulimit ); ++ m_sent_ctstatus = 1; ++ m_sent_ctstatus_time = now; ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Send_bw() ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ snprintf(message, CTCS_BUFSIZE, "CTBW %u,%u %u,%u", ++ m_ctstatus.dlrate, m_ctstatus.ulrate, ++ m_ctstatus.dlimit, m_ctstatus.ulimit ); ++ m_sent_ctbw = 1; ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Send_Config() ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ snprintf(message, CTCS_BUFSIZE, "CTCONFIG %d %d %f %d %d %d %d %d %d", ++ (int)arg_verbose, (int)cfg_seed_hours, cfg_seed_ratio, ++ (int)cfg_max_peers, (int)cfg_min_peers, (int)arg_file_to_download, ++ (int)cfg_exit_zero_peers, Tracker.IsPaused(), Tracker.IsQuitting()); ++ return SendMessage(message); ++} ++ ++int Ctcs::Set_Config(char *msgbuf) ++{ ++ unsigned char foo; ++ ++ if(msgbuf[9] != '.') arg_verbose = atoi(msgbuf+9); ++ if(msgbuf[11] != '.') cfg_seed_hours = atoi(msgbuf+11); ++ msgbuf = strchr(msgbuf+11, ' ') + 1; ++ if(msgbuf[0] != '.') cfg_seed_ratio = atof(msgbuf); ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.') cfg_max_peers = atoi(msgbuf); ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.') cfg_min_peers = atoi(msgbuf); ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.'){ ++ foo = atoi(msgbuf); ++ if(foo != arg_file_to_download){ ++ arg_file_to_download = foo; ++ BTCONTENT.FlushCache(); ++ BTCONTENT.SetFilter(); ++ WORLD.CheckInterest(); ++ } ++ } ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.') cfg_exit_zero_peers = atoi(msgbuf); ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.'){ ++ if(atoi(msgbuf)){ ++ if( !Tracker.IsPaused() ) Tracker.SetPause(); ++ }else if( Tracker.IsPaused() ) Tracker.Resume(); ++ } ++ msgbuf = strchr(msgbuf, ' ') + 1; ++ if(msgbuf[0] != '.'){ ++ if(atoi(msgbuf)) Tracker.SoftQuit(); ++ else Tracker.DontQuit(); ++ if(atoi(msgbuf)){ ++ if( !Tracker.IsQuitting() ) Tracker.SoftQuit(); ++ }else if( Tracker.IsQuitting() ) Tracker.DontQuit(); ++ } ++ ++ return 0; ++} ++ ++ ++int Ctcs::Send_Detail() ++{ ++ char message[CTCS_BUFSIZE]; ++ int r=0; ++ size_t n=0; ++ BTFILE *file=0; ++ BitField tmpFilter; ++ ++ snprintf( message, CTCS_BUFSIZE, "CTDETAIL %lld %d %ld %ld", ++ BTCONTENT.GetTotalFilesLength(), ++ (int)(BTCONTENT.GetPieceLength()), (long)now, ++ (long)(BTCONTENT.GetSeedTime()) ); ++ r = SendMessage(message); ++ ++ if(r==0) r = SendMessage("CTFILES"); ++ ++ while( r==0 && (file = BTCONTENT.GetNextFile(file)) ){ ++ ++n; ++ BTCONTENT.SetTmpFilter(n, &tmpFilter); ++ BitField tmpBitField = *BTCONTENT.pBF; ++ tmpBitField.Except(tmpFilter); ++ ++ snprintf( message, CTCS_BUFSIZE, "CTFILE %u %d %d %llu %s", ++ n, (int)(BTCONTENT.getFilePieces(n)), ++ (int)(tmpBitField.Count()), ++ file->bf_length, file->bf_filename ); ++ r = SendMessage(message); ++ } ++ if(r==0) r = SendMessage("CTFDONE"); ++ return r; ++} ++ ++ ++int Ctcs::Send_Peers() ++{ ++ btPeer *peer=0; ++ char message[CTCS_BUFSIZE]; ++ char txtid[PEER_ID_LEN*2+3]; ++ struct sockaddr_in psin; ++ int r=0; ++ ++ r=SendMessage("CTPEERS"); ++ while( r==0 && (peer = WORLD.GetNextPeer(peer)) ){ ++ TextPeerID(peer->id, txtid); ++ peer->GetAddress(&psin); ++ ++ snprintf(message, CTCS_BUFSIZE, "CTPEER %s %s %c%c%c%c %d %d %llu %llu %d", ++ txtid, inet_ntoa(psin.sin_addr), ++ peer->Is_Remote_UnChoked() ? 'U' : 'C', ++ peer->Is_Local_Interested() ? 'i' : 'n', ++ peer->Is_Local_UnChoked() ? 'U' : 'C', ++ peer->Is_Remote_Interested() ? 'i' : 'n', ++ peer->RateDL(), peer->RateUL(), ++ peer->TotalDL(), peer->TotalUL(), ++ peer->bitfield.Count() ); ++ r = SendMessage(message); ++ } ++ if(r==0) r = SendMessage("CTPDONE"); ++ return r; ++} ++ ++ ++int Ctcs::Send_Info(const char *info) ++{ ++ char message[CTCS_BUFSIZE]; ++ ++ snprintf(message, CTCS_BUFSIZE, "CTINFO %s", info); ++ return SendMessage(message); ++} ++ ++ ++int Ctcs::Initial() ++{ ++ char *s; ++ ++ strncpy(m_host, arg_ctcs, MAXHOSTNAMELEN-1); ++ m_host[MAXHOSTNAMELEN-1] = '\0'; ++ if( s = strchr(m_host, ':') ) *s='\0'; ++ m_port = atoi(s=(strchr(arg_ctcs, ':')+1)); ++ if(strchr(s, ':')){ ++ printf("Enter CTCS password: "); fflush(stdout); ++ fgets(m_pass, CTCS_PASS_SIZE, stdin); ++ } else *m_pass = '\0'; ++ ++ return 0; ++} ++ ++ ++int Ctcs::Connect() ++{ ++ ssize_t r; ++ m_last_timestamp = now; ++ ++ if(_s2sin(m_host,m_port,&m_sin) < 0) { ++ fprintf(stderr,"warn, get CTCS ip address failed."); ++ return -1; ++ } ++ ++ m_sock = socket(AF_INET,SOCK_STREAM,0); ++ if(INVALID_SOCKET == m_sock) return -1; ++ ++ if(setfd_nonblock(m_sock) < 0) {CLOSE_SOCKET(m_sock); return -1; } ++ ++ r = connect_nonb(m_sock,(struct sockaddr*)&m_sin); ++ ++ if( r == -1 ){ CLOSE_SOCKET(m_sock); return -1;} ++ else if( r == -2 ) m_status = T_CONNECTING; ++ else{ ++ m_status = T_READY; ++ if( Send_Protocol() != 0 ){ ++ fprintf(stderr,"warn, send protocol to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ if( Send_Auth() != 0) { ++ fprintf(stderr,"warn, send password to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ if( Send_Torrent(BTCONTENT.GetPeerId(), arg_metainfo_file) != 0 ){ ++ fprintf(stderr,"warn, send torrent to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ } ++ return 0; ++} ++ ++ ++int Ctcs::IntervalCheck(const time_t *pnow, fd_set *rfdp, fd_set *wfdp) ++{ ++ if( T_FREE == m_status ){ ++ if(*pnow - m_last_timestamp >= m_interval){ ++ if(Connect() < 0){ Reset(15); return -1; } ++ ++ if( m_status == T_CONNECTING ){ ++ FD_SET(m_sock, rfdp); ++ FD_SET(m_sock, wfdp); ++ }else{ ++ FD_SET(m_sock, rfdp); ++ } ++ } ++ }else{ ++ if( m_status == T_CONNECTING ){ ++ FD_SET(m_sock, rfdp); ++ FD_SET(m_sock, wfdp); ++ }else if (INVALID_SOCKET != m_sock){ ++ FD_SET(m_sock, rfdp); ++ if( out_buffer.Count() ) FD_SET(m_sock, wfdp); ++ } ++ } ++ return m_sock; ++} ++ ++ ++int Ctcs::SocketReady(fd_set *rfdp, fd_set *wfdp, int *nfds) ++{ ++ if( T_FREE == m_status ) return 0; ++ ++ if( T_CONNECTING == m_status && FD_ISSET(m_sock,wfdp) ){ ++ int error = 0; ++ socklen_t n = sizeof(error); ++ (*nfds)--; ++ FD_CLR(m_sock, wfdp); ++ if(getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n) < 0 || ++ error != 0 ){ ++ if( ECONNREFUSED != error ) ++ fprintf(stderr,"warn, connect to CTCS failed. %s\n",strerror(error)); ++ Reset(15); ++ return -1; ++ }else{ ++ m_status = T_READY; ++ if( Send_Protocol() != 0 ){ ++ fprintf(stderr,"warn, send protocol to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ if( Send_Auth() != 0) { ++ fprintf(stderr,"warn, send password to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ if( Send_Torrent(BTCONTENT.GetPeerId(), arg_metainfo_file) == 0 ){ ++ fprintf(stderr,"warn, send torrent to CTCS failed. %s\n",strerror(errno)); ++ return -1; ++ } ++ } ++ }else if( T_CONNECTING == m_status && FD_ISSET(m_sock,rfdp) ){ ++ int error = 0; ++ socklen_t n = sizeof(error); ++ (*nfds)--; ++ FD_CLR(m_sock, rfdp); ++ getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n); ++ fprintf(stderr,"warn, connect to CTCS failed. %s\n",strerror(error)); ++ Reset(15); ++ return -1; ++ }else if( INVALID_SOCKET != m_sock ){ ++ if( FD_ISSET(m_sock, rfdp) ){ ++ (*nfds)--; ++ FD_CLR(m_sock,rfdp); ++ CheckMessage(); ++ } ++ if( INVALID_SOCKET != m_sock && FD_ISSET(m_sock, wfdp) ){ ++ (*nfds)--; ++ FD_CLR(m_sock,wfdp); ++ if( out_buffer.Count() && out_buffer.FlushOut(m_sock) < 0){ ++ Reset(1); ++ return -1; ++ } ++ } ++ } ++ return 0; ++} ++ ++ ++void Ctcs::RestartTracker() ++{ ++ Tracker.SetPause(); // prevents downloader from exiting ++ Tracker.SetStoped(); // finish the tracker ++ // Now we need to wait until the tracker updates (T_FINISHED == m_status), ++ // then Tracker.Resume(). ++ Tracker.SetRestart(); ++} ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/ctcs.h ctorrent-1.3.4/ctcs.h +--- ctorrent-1.3.4.sav/ctcs.h 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/ctcs.h 2006-06-28 19:30:02.000000000 +0200 +@@ -0,0 +1,78 @@ ++#include "tracker.h" // for its includes/defines ++ ++#define CTCS_PROTOCOL "0001" ++ ++#define CTCS_BUFSIZE 200 ++#define CTCS_PASS_SIZE 21 ++ ++#define C_TORRENT 1 ++#define C_STATUS 2 ++#define C_PEERS 3 ++ ++struct ctstatus { ++ public: ++ size_t seeders, leechers, nhave, ntotal, navail, dlrate, ulrate, ++ dlimit, ulimit; ++ u_int64_t dltotal, ultotal; ++ ctstatus() { ++ seeders=leechers=nhave=ntotal=navail=dlrate=ulrate=dltotal= ++ ultotal=dlimit=ulimit = 0; ++ } ++}; ++ ++class Ctcs ++{ ++ private: ++ char m_host[MAXHOSTNAMELEN]; ++ int m_port; ++ char m_pass[CTCS_PASS_SIZE]; ++ ++ struct sockaddr_in m_sin; ++ ++ unsigned char m_status:2; ++ ++ time_t m_interval; ++ time_t m_last_timestamp; ++ time_t m_sent_ctstatus_time; ++ ++ SOCKET m_sock; ++ BufIo in_buffer; ++ BufIo out_buffer; ++ struct ctstatus m_ctstatus; ++ int m_sent_ctstatus; ++ int m_sent_ctbw; ++ ++ int SendMessage(char *buf); ++ ++ public: ++ Ctcs(); ++ ~Ctcs(); ++ ++ void Reset(time_t new_interval); ++ int _s2sin(char *h,int p,struct sockaddr_in *psin); ++ int Initial(); ++ int Connect(); ++ int CheckMessage(); ++ int Send_Protocol(); ++ int Send_Auth(); ++ int Send_Torrent(unsigned char *peerid, char *torrent); ++ int Report_Status(size_t seeders, size_t leechers, size_t nhave, ++ size_t ntotal, size_t navail, size_t dlrate, size_t ulrate, ++ u_int64_t dltotal, u_int64_t ultotal, size_t dlimit, size_t ulimit); ++ int Send_Status(); ++ int Send_bw(); ++ int Send_Config(); ++ int Set_Config(char *msgbuf); ++ int Send_Detail(); ++ int Send_Peers(); ++ int Send_Info(const char *info); ++ int IntervalCheck(const time_t *pnow, fd_set *rfdp, fd_set *wfdp); ++ int SocketReady(fd_set *rfdp, fd_set *wfdp, int *nfds); ++ void RestartTracker(); ++ ++ SOCKET GetSocket() { return m_sock; } ++ unsigned char GetStatus() { return m_status;} ++}; ++ ++extern Ctcs CTCS; ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/ctorrent.cpp ctorrent-1.3.4/ctorrent.cpp +--- ctorrent-1.3.4.sav/ctorrent.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/ctorrent.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,6 +1,5 @@ +-#include +- + #include "./def.h" ++#include + + #ifdef WINDOWS + #include +@@ -20,6 +19,7 @@ + #include "downloader.h" + #include "peerlist.h" + #include "tracker.h" ++#include "ctcs.h" + + #include "./config.h" + +@@ -46,7 +46,7 @@ + struct timeval tv; + gettimeofday(&tv,(struct timezone*) 0); + unsigned int seed = tv.tv_usec + tv.tv_sec + getpid(); +- return srandom(seed); ++ srandom(seed); + } + + int main(int argc, char **argv) +@@ -65,7 +65,7 @@ + if( !arg_announce ){ fprintf(stderr,"please use -u to specify a announce url!\n"); exit(1);} + if( !arg_save_as ){ fprintf(stderr,"please use -s to specify a metainfo file name!\n"); exit(1);} + if( BTCONTENT.InitialFromFS(arg_metainfo_file, arg_announce, arg_piece_length) < 0 || +- BTCONTENT.CreateMetainfoFile(arg_save_as) < 0){ ++ BTCONTENT.CreateMetainfoFile(arg_save_as) < 0){ + fprintf(stderr,"create metainfo failed.\n"); + exit(1); + } +@@ -81,15 +81,19 @@ + if( !arg_flg_exam_only && !arg_flg_check_only){ + if(WORLD.Initial_ListenPort() < 0){ + fprintf(stderr,"warn, you couldn't accept connection.\n"); +- }else +- printf("Listen on: %d\n",cfg_listen_port); ++ } + +- Tracker.Initial(); ++ if( arg_ctcs ) CTCS.Initial(); ++ Tracker.Initial(); + +- signal(SIGPIPE,SIG_IGN); +- signal(SIGINT,sigint_catch); ++ signal(SIGPIPE,SIG_IGN); ++ signal(SIGINT,sig_catch); ++ signal(SIGTERM,sig_catch); + Downloader(); + } ++ if( cfg_cache_size ) BTCONTENT.FlushCache(); ++ if( arg_bitfield_file ) BTCONTENT.pBF->WriteToFile(arg_bitfield_file); ++ WORLD.CloseAll(); + + exit(0); + } +@@ -99,7 +103,8 @@ + int param_check(int argc, char **argv) + { + int c, l; +- while ( ( c = getopt(argc,argv,"b:B:cC:e:fl:M:m:P:p:s:tu:xhH")) != -1) ++ char *s; ++ while ( ( c = getopt(argc,argv,"b:cC:D:e:E:fi:l:M:m:n:P:p:s:S:tu:U:vxz:hH")) != -1) + switch( c ){ + case 'b': + arg_bitfield_file = new char[strlen(optarg) + 1]; +@@ -109,6 +114,10 @@ + strcpy(arg_bitfield_file, optarg); + break; + ++ case 'i': // listen on ip XXXX ++ cfg_listen_ip = inet_addr(optarg); ++ break; ++ + case 'p': // listen on Port XXXX + cfg_listen_port = atoi(optarg); + break; +@@ -126,6 +135,10 @@ + cfg_seed_hours = atoi(optarg); + break; + ++ case 'E': // target seed ratio ++ cfg_seed_ratio = atof(optarg); ++ break; ++ + case 'c': // Check exist only + arg_flg_check_only = 1; + break; +@@ -137,32 +150,47 @@ + case 'M': // Max peers + cfg_max_peers = atoi(optarg); + if( cfg_max_peers > 1000 || +- cfg_max_peers < 20){ +- return -1; ++ cfg_max_peers < 20){ ++ return -1; + } + break; + + case 'm': // Min peers + cfg_min_peers = atoi(optarg); + if( cfg_min_peers > 1000 || +- cfg_min_peers < 20){ +- return -1; ++ cfg_min_peers < 1){ ++ return -1; + } + break; + ++ case 'z': // slice size ++ cfg_req_slice_size = atoi(optarg) * 1024; ++ if( cfg_req_slice_size < 1024 || cfg_req_slice_size > 128*1024 ) ++ return -1; ++ break; ++ ++ case 'n': // Which file download ++ arg_file_to_download = atoi(optarg); ++ break; ++ ++ + case 'f': // force seed mode, skip sha1 check when startup. + arg_flg_force_seed_mode = 1; + break; + +- case 'B': +- cfg_max_bandwidth = atoi(optarg); ++ case 'D': ++ cfg_max_bandwidth_down = (int)(strtod(optarg, NULL) * 1024); ++ break; ++ ++ case 'U': ++ cfg_max_bandwidth_up = (int)(strtod(optarg, NULL) * 1024); + break; + + case 'P': +- l = strlen(optarg); +- if (l > MAX_PF_LEN) {printf("-P arg must be 8 or less characters\n"); exit(1);} +- if (l == 1 && *optarg == '-') *arg_user_agent = (char) 0; +- else strcpy(arg_user_agent,optarg); ++ l = strlen(optarg); ++ if (l > MAX_PF_LEN) {printf("-P arg must be 8 or less characters\n"); exit(1);} ++ if (l == 1 && *optarg == '-') *arg_user_agent = (char) 0; ++ else strcpy(arg_user_agent,optarg); + break; + + // BELLOW OPTIONS USED FOR CREATE TORRENT. +@@ -179,17 +207,29 @@ + case 'l': // piece Length (default 262144) + arg_piece_length = atoi(optarg); + if( arg_piece_length < 65536 || +- arg_piece_length > 1310720 ){ +- // warn message: +- // piece length range is 65536 =>> 1310720 +- return -1; ++ arg_piece_length > 1310720 ){ ++ // warn message: ++ // piece length range is 65536 =>> 1310720 ++ return -1; + } + break; ++ // ABOVE OPTIONS USED FOR CREATE TORRENT. + + case 'x': + arg_flg_exam_only = 1; + break; + ++ case 'S': // CTCS server ++ if( arg_ctcs ) return -1; ++ arg_ctcs = new char[strlen(optarg) + 1]; ++ if( !strchr(optarg, ':') ) return -1; ++ strcpy(arg_ctcs, optarg); ++ break; ++ ++ case 'v': ++ arg_verbose = 1; ++ break; ++ + case 'h': + case 'H': + default: +@@ -211,14 +251,17 @@ + + void usage() + { +- fprintf(stderr,"%s Copyright: YuHong(992126018601033)",PACKAGE_STRING); ++ fprintf(stderr,"%s Original code Copyright: YuHong(992126018601033)",PACKAGE_STRING); + fprintf(stderr,"\nWARNING: THERE IS NO WARRANTY FOR CTorrent. USE AT YOUR OWN RISK!!!\n"); + fprintf(stderr,"\nGeneric Options:\n"); + fprintf(stderr,"-h/-H\t\tShow this message.\n"); + fprintf(stderr,"-x\t\tDecode metainfo(torrent) file only, don't download.\n"); + fprintf(stderr,"-c\t\tCheck exist only. don't download.\n"); ++ fprintf(stderr,"-v\t\tVerbose output (for debugging).\n"); + fprintf(stderr,"\nDownload Options:\n"); + fprintf(stderr,"-e int\t\tExit while seed hours later. (default 72 hours)\n"); ++ fprintf(stderr,"-E num\t\tExit after seeding to ratio (UL:DL).\n"); ++ fprintf(stderr,"-i ip\t\tListen for connection on ip. (default all ip's)\n"); + fprintf(stderr,"-p port\t\tListen port. (default 2706 -> 2106)\n"); + fprintf(stderr,"-s save_as\tSave file/directory/metainfo as... \n"); + fprintf(stderr,"-C cache_size\tCache size,unit MB. (default 16MB)\n"); +@@ -226,8 +269,12 @@ + fprintf(stderr,"-b bf_filename\tBit field filename. (use it carefully)\n"); + fprintf(stderr,"-M max_peers\tMax peers count.\n"); + fprintf(stderr,"-m min_peers\tMin peers count.\n"); +- fprintf(stderr,"-B rate\t\tMax bandwidth (unit KB/s)\n"); ++ fprintf(stderr,"-z slice_size\tDownload slice/block size, unit KB. (default 16, max 128).\n"); ++ fprintf(stderr,"-n file_number\tWhich file download.\n"); ++ fprintf(stderr,"-D rate\t\tMax bandwidth down (unit KB/s)\n"); ++ fprintf(stderr,"-U rate\t\tMax bandwidth up (unit KB/s)\n"); + fprintf(stderr,"-P peer_id\tSet Peer ID ["PEER_PFX"]\n"); ++ fprintf(stderr,"-S host:port\tUse CTCS server\n"); + fprintf(stderr,"\nMake metainfo(torrent) file Options:\n"); + fprintf(stderr,"-t\t\tWith make torrent. must specify this option.\n"); + fprintf(stderr,"-u url\t\tTracker's url.\n"); +@@ -235,5 +282,7 @@ + fprintf(stderr,"\neg.\n"); + fprintf(stderr,"hong> ctorrent -s new_filename -e 12 -C 32 -p 6881 eg.torrent\n\n"); + fprintf(stderr,"home page: http://ctorrent.sourceforge.net/\n"); +- fprintf(stderr,"bug report: %s\n\n",PACKAGE_BUGREPORT); ++ fprintf(stderr,"see also: http://www.rahul.net/dholmes/ctorrent/\n"); ++ fprintf(stderr,"bug report: %s\n",PACKAGE_BUGREPORT); ++ fprintf(stderr,"original author: bsdi@sina.com\n\n"); + } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/bencode.Po ctorrent-1.3.4/.deps/bencode.Po +--- ctorrent-1.3.4.sav/.deps/bencode.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/bencode.Po 2006-06-28 19:24:11.000000000 +0200 +@@ -0,0 +1,137 @@ ++bencode.o bencode.o: bencode.cpp def.h config.h /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h bencode.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/fcntl.h \ ++ /usr/include/bits/fcntl.h /usr/include/sys/stat.h \ ++ /usr/include/bits/stat.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/xlocale.h \ ++ /usr/include/alloca.h /usr/include/string.h /usr/include/ctype.h ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++bencode.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/fcntl.h: ++ ++/usr/include/bits/fcntl.h: ++ ++/usr/include/sys/stat.h: ++ ++/usr/include/bits/stat.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/ctype.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/bitfield.Po ctorrent-1.3.4/.deps/bitfield.Po +--- ctorrent-1.3.4.sav/.deps/bitfield.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/bitfield.Po 2006-06-28 19:24:12.000000000 +0200 +@@ -0,0 +1,135 @@ ++bitfield.o bitfield.o: bitfield.cpp bitfield.h /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/param.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h \ ++ /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/string.h \ ++ /usr/include/xlocale.h /usr/include/stdlib.h \ ++ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ ++ /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \ ++ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ ++ /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h ++ ++bitfield.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++/usr/include/sys/stat.h: ++ ++/usr/include/bits/stat.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/btconfig.Po ctorrent-1.3.4/.deps/btconfig.Po +--- ctorrent-1.3.4.sav/.deps/btconfig.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/btconfig.Po 2006-06-28 19:24:12.000000000 +0200 +@@ -0,0 +1,46 @@ ++btconfig.o btconfig.o: btconfig.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/btcontent.Po ctorrent-1.3.4/.deps/btcontent.Po +--- ctorrent-1.3.4.sav/.deps/btcontent.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/btcontent.Po 2006-06-28 19:24:12.000000000 +0200 +@@ -0,0 +1,223 @@ ++btcontent.o btcontent.o: btcontent.cpp btcontent.h def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h bitfield.h btfiles.h def.h \ ++ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/param.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/linux/param.h /usr/include/asm/param.h \ ++ /usr/include/asm-i386/param.h /usr/include/xlocale.h \ ++ /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/stdlib.h \ ++ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ ++ /usr/include/alloca.h /usr/include/string.h /usr/include/fcntl.h \ ++ /usr/include/bits/fcntl.h /usr/include/errno.h \ ++ /usr/include/bits/errno.h /usr/include/linux/errno.h \ ++ /usr/include/asm/errno.h /usr/include/asm-i386/errno.h btconfig.h \ ++ bencode.h peer.h /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ ++ /usr/include/asm-i386/socket.h /usr/include/asm/sockios.h \ ++ /usr/include/asm-i386/sockios.h /usr/include/arpa/inet.h \ ++ /usr/include/netinet/in.h /usr/include/stdint.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h btrequest.h btstream.h bufio.h def.h \ ++ rate.h httpencode.h tracker.h /usr/include/sys/time.h sha1.h ++ ++btcontent.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++def.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/sys/stat.h: ++ ++/usr/include/bits/stat.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/fcntl.h: ++ ++/usr/include/bits/fcntl.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++btconfig.h: ++ ++bencode.h: ++ ++peer.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++btrequest.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++def.h: ++ ++rate.h: ++ ++httpencode.h: ++ ++tracker.h: ++ ++/usr/include/sys/time.h: ++ ++sha1.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/btfiles.Po ctorrent-1.3.4/.deps/btfiles.Po +--- ctorrent-1.3.4.sav/.deps/btfiles.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/btfiles.Po 2006-06-28 19:24:13.000000000 +0200 +@@ -0,0 +1,172 @@ ++btfiles.o btfiles.o: btfiles.cpp btfiles.h def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h bitfield.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h \ ++ /usr/include/dirent.h /usr/include/bits/dirent.h \ ++ /usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h \ ++ /usr/include/linux/limits.h /usr/include/sys/param.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix2_lim.h \ ++ /usr/include/bits/xopen_lim.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h \ ++ /usr/include/xlocale.h /usr/include/sys/stat.h /usr/include/bits/stat.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ ++ /usr/include/string.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ ++ /usr/include/errno.h /usr/include/bits/errno.h \ ++ /usr/include/linux/errno.h /usr/include/asm/errno.h \ ++ /usr/include/asm-i386/errno.h bencode.h btconfig.h btcontent.h def.h ++ ++btfiles.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/dirent.h: ++ ++/usr/include/bits/dirent.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/sys/stat.h: ++ ++/usr/include/bits/stat.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/fcntl.h: ++ ++/usr/include/bits/fcntl.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++bencode.h: ++ ++btconfig.h: ++ ++btcontent.h: ++ ++def.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/btrequest.Po ctorrent-1.3.4/.deps/btrequest.Po +--- ctorrent-1.3.4.sav/.deps/btrequest.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/btrequest.Po 2006-06-28 19:24:13.000000000 +0200 +@@ -0,0 +1,100 @@ ++btrequest.o btrequest.o: btrequest.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/xlocale.h \ ++ /usr/include/alloca.h btrequest.h btcontent.h def.h config.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h bitfield.h btfiles.h def.h btconfig.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/alloca.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++def.h: ++ ++btconfig.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/btstream.Po ctorrent-1.3.4/.deps/btstream.Po +--- ctorrent-1.3.4.sav/.deps/btstream.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/btstream.Po 2006-06-28 19:24:13.000000000 +0200 +@@ -0,0 +1,176 @@ ++btstream.o btstream.o: btstream.cpp /usr/include/arpa/inet.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h \ ++ /usr/include/bits/wordsize.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/sys/types.h \ ++ /usr/include/bits/types.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/bits/in.h /usr/include/bits/byteswap.h btstream.h def.h \ ++ config.h bufio.h def.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h peer.h \ ++ /usr/include/unistd.h /usr/include/string.h /usr/include/xlocale.h \ ++ btrequest.h btcontent.h def.h /usr/include/stdio.h /usr/include/libio.h \ ++ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h rate.h btconfig.h msgencode.h ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++btstream.h: ++ ++def.h: ++ ++config.h: ++ ++bufio.h: ++ ++def.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++peer.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++msgencode.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/bufio.Po ctorrent-1.3.4/.deps/bufio.Po +--- ctorrent-1.3.4.sav/.deps/bufio.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/bufio.Po 2006-06-28 19:24:13.000000000 +0200 +@@ -0,0 +1,178 @@ ++bufio.o bufio.o: bufio.cpp bufio.h def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/time.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/bits/uio.h \ ++ /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/arpa/inet.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/string.h \ ++ /usr/include/xlocale.h /usr/include/errno.h /usr/include/bits/errno.h \ ++ /usr/include/linux/errno.h /usr/include/asm/errno.h \ ++ /usr/include/asm-i386/errno.h btrequest.h btcontent.h def.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h def.h ++ ++bufio.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++def.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/connect_nonb.Po ctorrent-1.3.4/.deps/connect_nonb.Po +--- ctorrent-1.3.4.sav/.deps/connect_nonb.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/connect_nonb.Po 2006-06-28 19:24:13.000000000 +0200 +@@ -0,0 +1,112 @@ ++connect_nonb.o connect_nonb.o: connect_nonb.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ connect_nonb.h def.h config.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/bits/uio.h \ ++ /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/errno.h /usr/include/bits/errno.h \ ++ /usr/include/linux/errno.h /usr/include/asm/errno.h \ ++ /usr/include/asm-i386/errno.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++connect_nonb.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/ctcs.Po ctorrent-1.3.4/.deps/ctcs.Po +--- ctorrent-1.3.4.sav/.deps/ctcs.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/ctcs.Po 2006-06-28 19:24:14.000000000 +0200 +@@ -0,0 +1,246 @@ ++ctcs.o ctcs.o: ctcs.cpp /usr/include/unistd.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/time.h /usr/include/time.h \ ++ /usr/include/bits/time.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/xlocale.h /usr/include/netdb.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h \ ++ /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/sys/types.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/bits/in.h /usr/include/bits/byteswap.h \ ++ /usr/include/rpc/netdb.h /usr/include/bits/siginfo.h \ ++ /usr/include/bits/netdb.h /usr/include/stdlib.h \ ++ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ ++ /usr/include/alloca.h /usr/include/string.h /usr/include/errno.h \ ++ /usr/include/bits/errno.h /usr/include/linux/errno.h \ ++ /usr/include/asm/errno.h /usr/include/asm-i386/errno.h \ ++ /usr/include/ctype.h ctcs.h tracker.h def.h config.h bufio.h def.h \ ++ /usr/include/arpa/inet.h /usr/include/sys/param.h \ ++ /usr/include/linux/param.h /usr/include/asm/param.h \ ++ /usr/include/asm-i386/param.h btconfig.h btcontent.h def.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h setnonblock.h connect_nonb.h peerlist.h peer.h def.h \ ++ btrequest.h btcontent.h bitfield.h btstream.h bufio.h rate.h btconfig.h \ ++ rate.h peer.h bttime.h ++ ++/usr/include/unistd.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/time.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/netdb.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/rpc/netdb.h: ++ ++/usr/include/bits/siginfo.h: ++ ++/usr/include/bits/netdb.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++/usr/include/ctype.h: ++ ++ctcs.h: ++ ++tracker.h: ++ ++def.h: ++ ++config.h: ++ ++bufio.h: ++ ++def.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++btconfig.h: ++ ++btcontent.h: ++ ++def.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++setnonblock.h: ++ ++connect_nonb.h: ++ ++peerlist.h: ++ ++peer.h: ++ ++def.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++bitfield.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++peer.h: ++ ++bttime.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/ctorrent.Po ctorrent-1.3.4/.deps/ctorrent.Po +--- ctorrent-1.3.4.sav/.deps/ctorrent.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/ctorrent.Po 2006-06-28 19:24:14.000000000 +0200 +@@ -0,0 +1,246 @@ ++ctorrent.o ctorrent.o: ctorrent.cpp def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/signal.h /usr/include/bits/signum.h \ ++ /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ ++ /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ ++ /usr/include/asm-i386/sigcontext.h /usr/include/bits/sigstack.h \ ++ /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \ ++ /usr/include/sys/time.h /usr/include/xlocale.h /usr/include/string.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h /usr/include/stdlib.h \ ++ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ ++ /usr/include/alloca.h btconfig.h btcontent.h def.h bitfield.h btfiles.h \ ++ downloader.h peerlist.h peer.h def.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/bits/uio.h \ ++ /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ ++ /usr/include/asm-i386/socket.h /usr/include/asm/sockios.h \ ++ /usr/include/asm-i386/sockios.h /usr/include/arpa/inet.h \ ++ /usr/include/netinet/in.h /usr/include/stdint.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h btrequest.h btcontent.h bitfield.h \ ++ btstream.h bufio.h def.h rate.h def.h btconfig.h rate.h tracker.h \ ++ bufio.h /usr/include/sys/param.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h ctcs.h config.h \ ++ sigint.h ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/signal.h: ++ ++/usr/include/bits/signum.h: ++ ++/usr/include/bits/siginfo.h: ++ ++/usr/include/bits/sigaction.h: ++ ++/usr/include/bits/sigcontext.h: ++ ++/usr/include/asm/sigcontext.h: ++ ++/usr/include/asm-i386/sigcontext.h: ++ ++/usr/include/bits/sigstack.h: ++ ++/usr/include/sys/ucontext.h: ++ ++/usr/include/bits/sigthread.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/string.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++btconfig.h: ++ ++btcontent.h: ++ ++def.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++downloader.h: ++ ++peerlist.h: ++ ++peer.h: ++ ++def.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++bitfield.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++def.h: ++ ++rate.h: ++ ++def.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++tracker.h: ++ ++bufio.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++ctcs.h: ++ ++config.h: ++ ++sigint.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/downloader.Po ctorrent-1.3.4/.deps/downloader.Po +--- ctorrent-1.3.4.sav/.deps/downloader.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/downloader.Po 2006-06-28 19:24:14.000000000 +0200 +@@ -0,0 +1,214 @@ ++downloader.o downloader.o: downloader.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/xlocale.h /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/sys/time.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h \ ++ /usr/include/netinet/in.h /usr/include/stdint.h \ ++ /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/arpa/inet.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ ++ /usr/include/string.h peerlist.h def.h config.h peer.h def.h \ ++ btrequest.h btcontent.h def.h bitfield.h btfiles.h btstream.h bufio.h \ ++ def.h rate.h btconfig.h rate.h tracker.h bufio.h \ ++ /usr/include/sys/param.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h btconfig.h \ ++ btcontent.h ctcs.h bttime.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++peerlist.h: ++ ++def.h: ++ ++config.h: ++ ++peer.h: ++ ++def.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++def.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++tracker.h: ++ ++bufio.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++btconfig.h: ++ ++btcontent.h: ++ ++ctcs.h: ++ ++bttime.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/httpencode.Po ctorrent-1.3.4/.deps/httpencode.Po +--- ctorrent-1.3.4.sav/.deps/httpencode.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/httpencode.Po 2006-06-28 19:24:14.000000000 +0200 +@@ -0,0 +1,72 @@ ++httpencode.o httpencode.o: httpencode.cpp def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h httpencode.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/xlocale.h \ ++ /usr/include/alloca.h /usr/include/ctype.h /usr/include/string.h \ ++ config.h ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++httpencode.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/ctype.h: ++ ++/usr/include/string.h: ++ ++config.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/iplist.Po ctorrent-1.3.4/.deps/iplist.Po +--- ctorrent-1.3.4.sav/.deps/iplist.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/iplist.Po 2006-06-28 19:24:14.000000000 +0200 +@@ -0,0 +1,130 @@ ++iplist.o iplist.o: iplist.cpp /usr/include/string.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/xlocale.h iplist.h def.h config.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/arpa/inet.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h ++ ++/usr/include/string.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/xlocale.h: ++ ++iplist.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/peerlist.Po ctorrent-1.3.4/.deps/peerlist.Po +--- ctorrent-1.3.4.sav/.deps/peerlist.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/peerlist.Po 2006-06-28 19:24:16.000000000 +0200 +@@ -0,0 +1,237 @@ ++peerlist.o peerlist.o: peerlist.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h peerlist.h \ ++ def.h config.h peer.h def.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h \ ++ /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/arpa/inet.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/string.h \ ++ /usr/include/xlocale.h btrequest.h btcontent.h def.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h btstream.h bufio.h def.h rate.h btconfig.h rate.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ ++ /usr/include/errno.h /usr/include/bits/errno.h \ ++ /usr/include/linux/errno.h /usr/include/asm/errno.h \ ++ /usr/include/asm-i386/errno.h btconfig.h connect_nonb.h setnonblock.h \ ++ btcontent.h msgencode.h iplist.h def.h tracker.h bufio.h \ ++ /usr/include/sys/time.h /usr/include/sys/param.h \ ++ /usr/include/linux/param.h /usr/include/asm/param.h \ ++ /usr/include/asm-i386/param.h ctcs.h bttime.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++peerlist.h: ++ ++def.h: ++ ++config.h: ++ ++peer.h: ++ ++def.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++def.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++btconfig.h: ++ ++connect_nonb.h: ++ ++setnonblock.h: ++ ++btcontent.h: ++ ++msgencode.h: ++ ++iplist.h: ++ ++def.h: ++ ++tracker.h: ++ ++bufio.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++ctcs.h: ++ ++bttime.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/peer.Po ctorrent-1.3.4/.deps/peer.Po +--- ctorrent-1.3.4.sav/.deps/peer.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/peer.Po 2006-06-28 19:24:15.000000000 +0200 +@@ -0,0 +1,201 @@ ++peer.o peer.o: peer.cpp peer.h def.h config.h /usr/include/unistd.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/arpa/inet.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/string.h \ ++ /usr/include/xlocale.h btrequest.h btcontent.h def.h \ ++ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ ++ /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h btstream.h bufio.h def.h rate.h btconfig.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ ++ /usr/include/ctype.h btcontent.h msgencode.h peerlist.h def.h peer.h \ ++ rate.h btconfig.h bttime.h ++ ++peer.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++def.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++def.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/ctype.h: ++ ++btcontent.h: ++ ++msgencode.h: ++ ++peerlist.h: ++ ++def.h: ++ ++peer.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++bttime.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/rate.Po ctorrent-1.3.4/.deps/rate.Po +--- ctorrent-1.3.4.sav/.deps/rate.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/rate.Po 2006-06-28 19:24:16.000000000 +0200 +@@ -0,0 +1,57 @@ ++rate.o rate.o: rate.cpp rate.h def.h config.h /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/xlocale.h bttime.h ++ ++rate.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/xlocale.h: ++ ++bttime.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/setnonblock.Po ctorrent-1.3.4/.deps/setnonblock.Po +--- ctorrent-1.3.4.sav/.deps/setnonblock.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/setnonblock.Po 2006-06-28 19:24:16.000000000 +0200 +@@ -0,0 +1,120 @@ ++setnonblock.o setnonblock.o: setnonblock.cpp setnonblock.h def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/sys/socket.h /usr/include/sys/uio.h \ ++ /usr/include/bits/uio.h /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ ++ /usr/include/sys/stat.h /usr/include/bits/stat.h ++ ++setnonblock.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/fcntl.h: ++ ++/usr/include/bits/fcntl.h: ++ ++/usr/include/sys/stat.h: ++ ++/usr/include/bits/stat.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/sha1.Po ctorrent-1.3.4/.deps/sha1.Po +--- ctorrent-1.3.4.sav/.deps/sha1.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/sha1.Po 2006-06-28 19:24:17.000000000 +0200 +@@ -0,0 +1,57 @@ ++sha1.o sha1.o: sha1.c /usr/include/string.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/string.h /usr/include/bits/string2.h \ ++ /usr/include/endian.h /usr/include/bits/endian.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/include/bits/typesizes.h /usr/include/stdlib.h sha1.h \ ++ /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h ++ ++/usr/include/string.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/string.h: ++ ++/usr/include/bits/string2.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/stdlib.h: ++ ++sha1.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/time.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/sigint.Po ctorrent-1.3.4/.deps/sigint.Po +--- ctorrent-1.3.4.sav/.deps/sigint.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/sigint.Po 2006-06-28 19:24:16.000000000 +0200 +@@ -0,0 +1,228 @@ ++sigint.o sigint.o: sigint.cpp /usr/include/sys/types.h \ ++ /usr/include/features.h /usr/include/sys/cdefs.h \ ++ /usr/include/gnu/stubs.h /usr/include/bits/types.h \ ++ /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ ++ /usr/include/signal.h /usr/include/bits/signum.h \ ++ /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ ++ /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ ++ /usr/include/asm-i386/sigcontext.h /usr/include/bits/sigstack.h \ ++ /usr/include/sys/ucontext.h /usr/include/bits/sigthread.h btcontent.h \ ++ def.h config.h /usr/include/stdio.h /usr/include/libio.h \ ++ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ ++ /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h bitfield.h btfiles.h def.h tracker.h bufio.h \ ++ def.h /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/time.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/bits/uio.h \ ++ /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ ++ /usr/include/asm-i386/socket.h /usr/include/asm/sockios.h \ ++ /usr/include/asm-i386/sockios.h /usr/include/netinet/in.h \ ++ /usr/include/stdint.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/arpa/inet.h \ ++ /usr/include/sys/param.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h btconfig.h \ ++ peerlist.h peer.h def.h /usr/include/string.h /usr/include/xlocale.h \ ++ btrequest.h btcontent.h bitfield.h btstream.h bufio.h rate.h btconfig.h \ ++ rate.h sigint.h ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++/usr/include/signal.h: ++ ++/usr/include/bits/signum.h: ++ ++/usr/include/bits/siginfo.h: ++ ++/usr/include/bits/sigaction.h: ++ ++/usr/include/bits/sigcontext.h: ++ ++/usr/include/asm/sigcontext.h: ++ ++/usr/include/asm-i386/sigcontext.h: ++ ++/usr/include/bits/sigstack.h: ++ ++/usr/include/sys/ucontext.h: ++ ++/usr/include/bits/sigthread.h: ++ ++btcontent.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++def.h: ++ ++tracker.h: ++ ++bufio.h: ++ ++def.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++btconfig.h: ++ ++peerlist.h: ++ ++peer.h: ++ ++def.h: ++ ++/usr/include/string.h: ++ ++/usr/include/xlocale.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++bitfield.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++sigint.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/.deps/tracker.Po ctorrent-1.3.4/.deps/tracker.Po +--- ctorrent-1.3.4.sav/.deps/tracker.Po 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/.deps/tracker.Po 2006-06-28 19:24:17.000000000 +0200 +@@ -0,0 +1,244 @@ ++tracker.o tracker.o: tracker.cpp tracker.h def.h config.h \ ++ /usr/include/sys/types.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ ++ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h \ ++ /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ ++ /usr/include/bits/endian.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h bufio.h \ ++ def.h /usr/include/unistd.h /usr/include/bits/posix_opt.h \ ++ /usr/include/bits/environments.h /usr/include/bits/confname.h \ ++ /usr/include/getopt.h /usr/include/sys/time.h /usr/include/sys/socket.h \ ++ /usr/include/sys/uio.h /usr/include/bits/uio.h \ ++ /usr/include/bits/socket.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sockaddr.h \ ++ /usr/include/asm/socket.h /usr/include/asm-i386/socket.h \ ++ /usr/include/asm/sockios.h /usr/include/asm-i386/sockios.h \ ++ /usr/include/netinet/in.h /usr/include/stdint.h \ ++ /usr/include/bits/wchar.h /usr/include/bits/in.h \ ++ /usr/include/bits/byteswap.h /usr/include/arpa/inet.h \ ++ /usr/include/sys/param.h /usr/include/linux/param.h \ ++ /usr/include/asm/param.h /usr/include/asm-i386/param.h btconfig.h \ ++ /usr/include/xlocale.h /usr/include/netdb.h /usr/include/rpc/netdb.h \ ++ /usr/include/bits/siginfo.h /usr/include/bits/netdb.h \ ++ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ ++ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ ++ /usr/include/string.h /usr/include/errno.h /usr/include/bits/errno.h \ ++ /usr/include/linux/errno.h /usr/include/asm/errno.h \ ++ /usr/include/asm-i386/errno.h peerlist.h peer.h def.h btrequest.h \ ++ btcontent.h /usr/include/stdio.h /usr/include/libio.h \ ++ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/gconv.h \ ++ /usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h \ ++ /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h bitfield.h \ ++ btfiles.h btstream.h bufio.h rate.h btconfig.h rate.h httpencode.h \ ++ bencode.h setnonblock.h connect_nonb.h btcontent.h iplist.h def.h \ ++ ctcs.h ++ ++tracker.h: ++ ++def.h: ++ ++config.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stddef.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/time.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/bits/sched.h: ++ ++bufio.h: ++ ++def.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/sys/socket.h: ++ ++/usr/include/sys/uio.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/socket.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/limits.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sockaddr.h: ++ ++/usr/include/asm/socket.h: ++ ++/usr/include/asm-i386/socket.h: ++ ++/usr/include/asm/sockios.h: ++ ++/usr/include/asm-i386/sockios.h: ++ ++/usr/include/netinet/in.h: ++ ++/usr/include/stdint.h: ++ ++/usr/include/bits/wchar.h: ++ ++/usr/include/bits/in.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/arpa/inet.h: ++ ++/usr/include/sys/param.h: ++ ++/usr/include/linux/param.h: ++ ++/usr/include/asm/param.h: ++ ++/usr/include/asm-i386/param.h: ++ ++btconfig.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/netdb.h: ++ ++/usr/include/rpc/netdb.h: ++ ++/usr/include/bits/siginfo.h: ++ ++/usr/include/bits/netdb.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-i386/errno.h: ++ ++peerlist.h: ++ ++peer.h: ++ ++def.h: ++ ++btrequest.h: ++ ++btcontent.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/include/gconv.h: ++ ++/usr/lib/gcc/i486-linux-gnu/4.0.3/include/stdarg.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++bitfield.h: ++ ++btfiles.h: ++ ++btstream.h: ++ ++bufio.h: ++ ++rate.h: ++ ++btconfig.h: ++ ++rate.h: ++ ++httpencode.h: ++ ++bencode.h: ++ ++setnonblock.h: ++ ++connect_nonb.h: ++ ++btcontent.h: ++ ++iplist.h: ++ ++def.h: ++ ++ctcs.h: +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/downloader.cpp ctorrent-1.3.4/downloader.cpp +--- ctorrent-1.3.4.sav/downloader.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/downloader.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -21,21 +21,37 @@ + #include "peerlist.h" + #include "tracker.h" + #include "btcontent.h" ++#include "ctcs.h" ++#include "btconfig.h" ++#include "bttime.h" ++ ++time_t now = (time_t) 0; + + void Downloader() + { + int nfds,maxfd,r; + struct timeval timeout; +- time_t now; + fd_set rfd; + fd_set wfd; ++ int stopped = 0; + +- for(;;){ +- time(&now); +- if( BTCONTENT.SeedTimeout(&now) ) break; ++ time(&now); ++ do{ ++ if( !stopped && ++ ( BTCONTENT.SeedTimeout(&now) || ++ (( cfg_exit_zero_peers || Tracker.IsQuitting() ) && ++ !WORLD.TotalPeers()) ) ){ ++ Tracker.SetStoped(); ++ stopped = 1; ++ if( arg_ctcs ) CTCS.Send_Status(); ++ } + + FD_ZERO(&rfd); FD_ZERO(&wfd); + maxfd = Tracker.IntervalCheck(&now,&rfd, &wfd); ++ if( arg_ctcs ){ ++ r = CTCS.IntervalCheck(&now,&rfd, &wfd); ++ if( r > maxfd ) maxfd = r; ++ } + r = WORLD.FillFDSET(&now,&rfd,&wfd); + if( r > maxfd ) maxfd = r; + +@@ -43,10 +59,13 @@ + timeout.tv_usec = 0; + + nfds = select(maxfd + 1,&rfd,&wfd,(fd_set*) 0,&timeout); ++ time(&now); + +- if(nfds > 0){ ++ if(nfds > 0){ + if(T_FREE != Tracker.GetStatus()) Tracker.SocketReady(&rfd,&wfd,&nfds); +- if( nfds ) WORLD.AnyPeerReady(&rfd,&wfd,&nfds); +- } +- }/* end for(;;) */ ++ if(nfds > 0 && T_FREE != CTCS.GetStatus()) ++ CTCS.SocketReady(&rfd,&wfd,&nfds); ++ if(nfds > 0) WORLD.AnyPeerReady(&rfd,&wfd,&nfds); ++ } ++ } while(Tracker.GetStatus() != T_FINISHED || Tracker.IsPaused()); + } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/httpencode.cpp ctorrent-1.3.4/httpencode.cpp +--- ctorrent-1.3.4.sav/httpencode.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/httpencode.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,6 +1,6 @@ ++#include "./def.h" + #include + +-#include "./def.h" + #include "./httpencode.h" + + #include +@@ -88,7 +88,7 @@ + + /* path */ + if( *p != '/' ) return -1; +- for( ; *p && *p != '?'; p++,path++) *path = *p; ++ for( ; *p; p++,path++) *path = *p; + *path = '\0'; + return 0; + } +@@ -115,7 +115,7 @@ + hlen = p - b; + *pd = ( p + addtion ); + *dlen = n - hlen - addtion; +- }else{ // ֻײϢ???? ++ }else{ // ֻײϢ???? + hlen = n; + *pd = (char*) 0; + *dlen = 0; +@@ -131,8 +131,8 @@ + for(; n && *b != ' ' && *b != '\n'; b++,n--) ; + if( !n || *b != ' ') r = -1; + else{ +- r = atoi(b); +- if( r < 100 || r > 600 ) r = -1; ++ r = atoi(b); ++ if( r < 100 || r > 600 ) r = -1; + } + return r; + } +@@ -160,11 +160,11 @@ + + if( r > header_len ){ + if( strncasecmp(b, h, header_len) == 0){ +- /* header founded */ +- b += header_len; +- for(; *b != '\n'; v++,b++) *v = *b; +- *v = '\0'; +- return 0; ++ /* header founded */ ++ b += header_len; ++ for(; *b != '\n'; v++,b++) *v = *b; ++ *v = '\0'; ++ return 0; + } + } + b += r; +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/httpencode.h ctorrent-1.3.4/httpencode.h +--- ctorrent-1.3.4.sav/httpencode.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/httpencode.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,9 +1,13 @@ + #ifndef HTTPENCODE_H + #define HTTPENCODE_H + +-#define REQ_URL_P1_FMT "GET %s?info_hash=%s&peer_id=%s&port=%d" +-#define REQ_URL_P2_FMT "%s&uploaded=%d&downloaded=%d&left=%d&event=%s&compact=1 HTTP/1.0" +-#define REQ_URL_P3_FMT "%s&uploaded=%d&downloaded=%d&left=%d&compact=1 HTTP/1.0" ++#define REQ_URL_P1_FMT "GET %s?info_hash=%s&peer_id=%s&port=%d&key=%s" ++#define REQ_URL_P1A_FMT "GET %s&info_hash=%s&peer_id=%s&port=%d&key=%s" ++//#define REQ_URL_P2_FMT "%s&uploaded=%d&downloaded=%d&left=%d&event=%s&compact=1 HTTP/1.0" ++//#define REQ_URL_P3_FMT "%s&uploaded=%d&downloaded=%d&left=%d&compact=1 HTTP/1.0" ++#define REQ_URL_P2_FMT "%s&uploaded=%llu&downloaded=%llu&left=%llu&compact=1&event=%s&numwant=%u&key=%s HTTP/1.0" ++#define REQ_URL_P3_FMT "%s&uploaded=%llu&downloaded=%llu&left=%llu&compact=1&numwant=%u&key=%s HTTP/1.0" ++ + + char* Http_url_encode(char *s,char *b,size_t n); + int Http_url_analyse(char *url,char *host,int *port,char *path); +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/iplist.cpp ctorrent-1.3.4/iplist.cpp +--- ctorrent-1.3.4.sav/iplist.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/iplist.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -8,8 +8,8 @@ + IPLIST *node = ipl_head; + for(; ipl_head;){ + node = ipl_head; +- delete ipl_head; + ipl_head = node->next; ++ delete node; + } + count = 0; + } +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/Makefile.am ctorrent-1.3.4/Makefile.am +--- ctorrent-1.3.4.sav/Makefile.am 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/Makefile.am 2006-06-28 19:30:02.000000000 +0200 +@@ -1,2 +1,2 @@ + bin_PROGRAMS = ctorrent +-ctorrent_SOURCES = bencode.cpp bitfield.cpp btconfig.cpp btcontent.cpp btfiles.cpp btrequest.cpp btstream.cpp bufio.cpp connect_nonb.cpp ctorrent.cpp downloader.cpp httpencode.cpp iplist.cpp peer.cpp peerlist.cpp rate.cpp setnonblock.cpp sigint.cpp tracker.cpp bencode.h bitfield.h btconfig.h btcontent.h btfiles.h btrequest.h btstream.h bufio.h connect_nonb.h def.h downloader.h httpencode.h iplist.h msgencode.h peer.h peerlist.h rate.h setnonblock.h sigint.h tracker.h ++ctorrent_SOURCES = bencode.cpp bitfield.cpp btconfig.cpp btcontent.cpp btfiles.cpp btrequest.cpp btstream.cpp bufio.cpp connect_nonb.cpp ctcs.cpp ctorrent.cpp downloader.cpp httpencode.cpp iplist.cpp peer.cpp peerlist.cpp rate.cpp setnonblock.cpp sigint.cpp tracker.cpp sha1.c bencode.h bitfield.h btconfig.h btcontent.h btfiles.h btrequest.h btstream.h bufio.h connect_nonb.h ctcs.h def.h downloader.h httpencode.h iplist.h msgencode.h peer.h peerlist.h rate.h setnonblock.h sigint.h tracker.h sha1.h +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/Makefile.in ctorrent-1.3.4/Makefile.in +--- ctorrent-1.3.4.sav/Makefile.in 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/Makefile.in 2006-06-28 19:30:02.000000000 +0200 +@@ -1,8 +1,8 @@ +-# Makefile.in generated by automake 1.7.6 from Makefile.am. ++# Makefile.in generated by automake 1.9.1 from Makefile.am. + # @configure_input@ + +-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +-# Free Software Foundation, Inc. ++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ++# 2003, 2004 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. +@@ -14,6 +14,8 @@ + + @SET_MAKE@ + ++SOURCES = $(ctorrent_SOURCES) ++ + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ +@@ -21,7 +23,6 @@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + top_builddir = . +- + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd + INSTALL = @INSTALL@ + install_sh_DATA = $(install_sh) -c -m 644 +@@ -35,6 +36,61 @@ + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : ++bin_PROGRAMS = ctorrent$(EXEEXT) ++subdir = . ++DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ ++ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ ++ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ ++ depcomp install-sh missing mkinstalldirs ++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ++am__aclocal_m4_deps = $(top_srcdir)/configure.ac ++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ ++ $(ACLOCAL_M4) ++am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ ++ configure.lineno configure.status.lineno ++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs ++CONFIG_HEADER = config.h ++CONFIG_CLEAN_FILES = ++am__installdirs = "$(DESTDIR)$(bindir)" ++binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) ++PROGRAMS = $(bin_PROGRAMS) ++am_ctorrent_OBJECTS = bencode.$(OBJEXT) bitfield.$(OBJEXT) \ ++ btconfig.$(OBJEXT) btcontent.$(OBJEXT) btfiles.$(OBJEXT) \ ++ btrequest.$(OBJEXT) btstream.$(OBJEXT) bufio.$(OBJEXT) \ ++ connect_nonb.$(OBJEXT) ctcs.$(OBJEXT) ctorrent.$(OBJEXT) \ ++ downloader.$(OBJEXT) httpencode.$(OBJEXT) iplist.$(OBJEXT) \ ++ peer.$(OBJEXT) peerlist.$(OBJEXT) rate.$(OBJEXT) \ ++ setnonblock.$(OBJEXT) sigint.$(OBJEXT) tracker.$(OBJEXT) \ ++ sha1.$(OBJEXT) ++ctorrent_OBJECTS = $(am_ctorrent_OBJECTS) ++ctorrent_LDADD = $(LDADD) ++DEFAULT_INCLUDES = -I. -I$(srcdir) -I. ++depcomp = $(SHELL) $(top_srcdir)/depcomp ++am__depfiles_maybe = depfiles ++COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ ++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ++CCLD = $(CC) ++LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ ++CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ ++ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) ++CXXLD = $(CXX) ++CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ ++ -o $@ ++SOURCES = $(ctorrent_SOURCES) ++DIST_SOURCES = $(ctorrent_SOURCES) ++ETAGS = etags ++CTAGS = ctags ++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ++distdir = $(PACKAGE)-$(VERSION) ++top_distdir = $(distdir) ++am__remove_distdir = \ ++ { test ! -d $(distdir) \ ++ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ ++ && rm -fr $(distdir); }; } ++DIST_ARCHIVES = $(distdir).tar.gz ++GZIP_ENV = --best ++distuninstallcheck_listfiles = find . -type f -print ++distcleancheck_listfiles = find . -type f -print + ACLOCAL = @ACLOCAL@ + AMDEP_FALSE = @AMDEP_FALSE@ + AMDEP_TRUE = @AMDEP_TRUE@ +@@ -90,6 +146,8 @@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ + am__quote = @am__quote@ ++am__tar = @am__tar@ ++am__untar = @am__untar@ + bindir = @bindir@ + build_alias = @build_alias@ + datadir = @datadir@ +@@ -102,6 +160,7 @@ + libexecdir = @libexecdir@ + localstatedir = @localstatedir@ + mandir = @mandir@ ++mkdir_p = @mkdir_p@ + oldincludedir = @oldincludedir@ + prefix = @prefix@ + program_transform_name = @program_transform_name@ +@@ -109,76 +168,44 @@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-bin_PROGRAMS = ctorrent +-ctorrent_SOURCES = bencode.cpp bitfield.cpp btconfig.cpp btcontent.cpp btfiles.cpp btrequest.cpp btstream.cpp bufio.cpp connect_nonb.cpp ctorrent.cpp downloader.cpp httpencode.cpp iplist.cpp peer.cpp peerlist.cpp rate.cpp setnonblock.cpp sigint.cpp tracker.cpp bencode.h bitfield.h btconfig.h btcontent.h btfiles.h btrequest.h btstream.h bufio.h connect_nonb.h def.h downloader.h httpencode.h iplist.h msgencode.h peer.h peerlist.h rate.h setnonblock.h sigint.h tracker.h +-subdir = . +-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +-CONFIG_HEADER = config.h +-CONFIG_CLEAN_FILES = +-bin_PROGRAMS = ctorrent$(EXEEXT) +-PROGRAMS = $(bin_PROGRAMS) +- +-am_ctorrent_OBJECTS = bencode.$(OBJEXT) bitfield.$(OBJEXT) \ +- btconfig.$(OBJEXT) btcontent.$(OBJEXT) btfiles.$(OBJEXT) \ +- btrequest.$(OBJEXT) btstream.$(OBJEXT) bufio.$(OBJEXT) \ +- connect_nonb.$(OBJEXT) ctorrent.$(OBJEXT) downloader.$(OBJEXT) \ +- httpencode.$(OBJEXT) iplist.$(OBJEXT) peer.$(OBJEXT) \ +- peerlist.$(OBJEXT) rate.$(OBJEXT) setnonblock.$(OBJEXT) \ +- sigint.$(OBJEXT) tracker.$(OBJEXT) +-ctorrent_OBJECTS = $(am_ctorrent_OBJECTS) +-ctorrent_LDADD = $(LDADD) +-ctorrent_DEPENDENCIES = +-ctorrent_LDFLAGS = +- +-DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +-depcomp = $(SHELL) $(top_srcdir)/depcomp +-am__depfiles_maybe = depfiles +-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bencode.Po ./$(DEPDIR)/bitfield.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/btconfig.Po ./$(DEPDIR)/btcontent.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/btfiles.Po ./$(DEPDIR)/btrequest.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/btstream.Po ./$(DEPDIR)/bufio.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/connect_nonb.Po ./$(DEPDIR)/ctorrent.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/downloader.Po ./$(DEPDIR)/httpencode.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/iplist.Po ./$(DEPDIR)/peer.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/peerlist.Po ./$(DEPDIR)/rate.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/setnonblock.Po ./$(DEPDIR)/sigint.Po \ +-@AMDEP_TRUE@ ./$(DEPDIR)/tracker.Po +-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +-CXXLD = $(CXX) +-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ +- -o $@ +-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +-CCLD = $(CC) +-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +-DIST_SOURCES = $(ctorrent_SOURCES) +-DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +- Makefile.in NEWS aclocal.m4 config.h.in configure configure.ac \ +- depcomp install-sh missing mkinstalldirs +-SOURCES = $(ctorrent_SOURCES) +- ++ctorrent_SOURCES = bencode.cpp bitfield.cpp btconfig.cpp btcontent.cpp btfiles.cpp btrequest.cpp btstream.cpp bufio.cpp connect_nonb.cpp ctcs.cpp ctorrent.cpp downloader.cpp httpencode.cpp iplist.cpp peer.cpp peerlist.cpp rate.cpp setnonblock.cpp sigint.cpp tracker.cpp sha1.c bencode.h bitfield.h btconfig.h btcontent.h btfiles.h btrequest.h btstream.h bufio.h connect_nonb.h ctcs.h def.h downloader.h httpencode.h iplist.h msgencode.h peer.h peerlist.h rate.h setnonblock.h sigint.h tracker.h sha1.h + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + + .SUFFIXES: +-.SUFFIXES: .cpp .o .obj +- +-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ +- configure.lineno +-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) ++.SUFFIXES: .c .cpp .o .obj ++am--refresh: ++ @: ++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) ++ @for dep in $?; do \ ++ case '$(am__configure_deps)' in \ ++ *$$dep*) \ ++ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ ++ cd $(srcdir) && $(AUTOMAKE) --gnu \ ++ && exit 0; \ ++ exit 1;; \ ++ esac; \ ++ done; \ ++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) ++.PRECIOUS: Makefile ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ++ @case '$?' in \ ++ *config.status*) \ ++ echo ' $(SHELL) ./config.status'; \ ++ $(SHELL) ./config.status;; \ ++ *) \ ++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ ++ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ ++ esac; + +-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +-$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) +- cd $(srcdir) && $(AUTOCONF) + +-$(ACLOCAL_M4): configure.ac ++$(top_srcdir)/configure: $(am__configure_deps) ++ cd $(srcdir) && $(AUTOCONF) ++$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + + config.h: stamp-h1 +@@ -190,24 +217,23 @@ + stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +- +-$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) ++$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) +- touch $(srcdir)/config.h.in ++ rm -f stamp-h1 ++ touch $@ + + distclean-hdr: + -rm -f config.h stamp-h1 +-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) +- $(mkinstalldirs) $(DESTDIR)$(bindir) ++ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ +- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ +- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ ++ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ ++ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +@@ -215,8 +241,8 @@ + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ +- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ +- rm -f $(DESTDIR)$(bindir)/$$f; \ ++ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ ++ rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + + clean-binPROGRAMS: +@@ -226,7 +252,7 @@ + $(CXXLINK) $(ctorrent_LDFLAGS) $(ctorrent_OBJECTS) $(ctorrent_LDADD) $(LIBS) + + mostlyclean-compile: +- -rm -f *.$(OBJEXT) core *.core ++ -rm -f *.$(OBJEXT) + + distclean-compile: + -rm -f *.tab.c +@@ -240,6 +266,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btstream.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufio.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect_nonb.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctcs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctorrent.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/downloader.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpencode.Po@am__quote@ +@@ -248,43 +275,39 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peerlist.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rate.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setnonblock.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigint.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tracker.Po@am__quote@ + +-distclean-depend: +- -rm -rf ./$(DEPDIR) ++.c.o: ++@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(COMPILE) -c $< ++ ++.c.obj: ++@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + + .cpp.o: +-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +-@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +-@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +-@am__fastdepCXX_TRUE@ fi ++@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ++@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< ++@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + + .cpp.obj: +-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +-@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +-@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +-@am__fastdepCXX_TRUE@ fi ++@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ ++@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` ++@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + uninstall-info-am: + +-ETAGS = etags +-ETAGSFLAGS = +- +-CTAGS = ctags +-CTAGSFLAGS = +- +-tags: TAGS +- + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ +@@ -293,6 +316,7 @@ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique ++tags: TAGS + + TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) +@@ -304,10 +328,11 @@ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ +- test -z "$(ETAGS_ARGS)$$tags$$unique" \ +- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ +- $$tags $$unique +- ++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ ++ test -n "$$unique" || unique=$$empty_fix; \ ++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ ++ $$tags $$unique; \ ++ fi + ctags: CTAGS + CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) +@@ -330,19 +355,6 @@ + + distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +- +-top_distdir = . +-distdir = $(PACKAGE)-$(VERSION) +- +-am__remove_distdir = \ +- { test ! -d $(distdir) \ +- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ +- && rm -fr $(distdir); }; } +- +-GZIP_ENV = --best +-distuninstallcheck_listfiles = find . -type f -print +-distcleancheck_listfiles = find . -type f -print + + distdir: $(DISTFILES) + $(am__remove_distdir) +@@ -358,7 +370,7 @@ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ +- $(mkinstalldirs) "$(distdir)$$dir"; \ ++ $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ +@@ -379,19 +391,46 @@ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) + dist-gzip: distdir +- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz ++ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz ++ $(am__remove_distdir) ++ ++dist-bzip2: distdir ++ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 ++ $(am__remove_distdir) ++ ++dist-tarZ: distdir ++ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z ++ $(am__remove_distdir) ++ ++dist-shar: distdir ++ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz ++ $(am__remove_distdir) ++ ++dist-zip: distdir ++ -rm -f $(distdir).zip ++ zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + + dist dist-all: distdir +- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz ++ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + + # This target untars the dist file and tries a VPATH configuration. Then + # it guarantees that the distribution is self-contained by making another + # tarfile. + distcheck: dist +- $(am__remove_distdir) +- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ++ case '$(DIST_ARCHIVES)' in \ ++ *.tar.gz*) \ ++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ ++ *.tar.bz2*) \ ++ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ ++ *.tar.Z*) \ ++ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ ++ *.shar.gz*) \ ++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ ++ *.zip*) \ ++ unzip $(distdir).zip ;;\ ++ esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst +@@ -411,19 +450,20 @@ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ +- (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ ++ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ +- && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ +- && rm -f $(distdir).tar.gz \ ++ && $(MAKE) $(AM_MAKEFLAGS) dist \ ++ && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) +- @echo "$(distdir).tar.gz is ready for distribution" | \ +- sed 'h;s/./=/g;p;x;p;x' ++ @(echo "$(distdir) archives ready for distribution: "; \ ++ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ ++ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ +@@ -445,9 +485,10 @@ + check-am: all-am + check: check-am + all-am: Makefile $(PROGRAMS) config.h +- + installdirs: +- $(mkinstalldirs) $(DESTDIR)$(bindir) ++ for dir in "$(DESTDIR)$(bindir)"; do \ ++ test -z "$$dir" || $(mkdir_p) "$$dir"; \ ++ done + install: install-am + install-exec: install-exec-am + install-data: install-data-am +@@ -459,7 +500,7 @@ + installcheck: installcheck-am + install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ +- INSTALL_STRIP_FLAG=-s \ ++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + mostlyclean-generic: +@@ -467,7 +508,7 @@ + clean-generic: + + distclean-generic: +- -rm -f Makefile $(CONFIG_CLEAN_FILES) ++ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + + maintainer-clean-generic: + @echo "This command is intended for maintainers to use" +@@ -478,13 +519,17 @@ + + distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +-distclean-am: clean-am distclean-compile distclean-depend \ +- distclean-generic distclean-hdr distclean-tags ++ -rm -rf ./$(DEPDIR) ++ -rm -f Makefile ++distclean-am: clean-am distclean-compile distclean-generic \ ++ distclean-hdr distclean-tags + + dvi: dvi-am + + dvi-am: + ++html: html-am ++ + info: info-am + + info-am: +@@ -502,6 +547,8 @@ + maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache ++ -rm -rf ./$(DEPDIR) ++ -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-generic + + mostlyclean: mostlyclean-am +@@ -518,11 +565,12 @@ + + uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ +- clean-generic ctags dist dist-all dist-gzip distcheck distclean \ +- distclean-compile distclean-depend distclean-generic \ +- distclean-hdr distclean-tags distcleancheck distdir \ +- distuninstallcheck dvi dvi-am info info-am install install-am \ ++.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ ++ clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ ++ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ ++ distclean-compile distclean-generic distclean-hdr \ ++ distclean-tags distcleancheck distdir distuninstallcheck dvi \ ++ dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/peer.cpp ctorrent-1.3.4/peer.cpp +--- ctorrent-1.3.4.sav/peer.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/peer.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -2,14 +2,74 @@ + + #include + #include ++#include + ++#include "btstream.h" + #include "./btcontent.h" + #include "./msgencode.h" + #include "./peerlist.h" + #include "./btconfig.h" ++#include "bttime.h" + ++size_t get_nl(char *sfrom) ++{ ++ unsigned char *from = (unsigned char *)sfrom; ++ size_t t; ++ t = (*from++) << 24; ++ t |= (*from++) << 16; ++ t |= (*from++) << 8; ++ t |= *from; ++ return t; ++} ++ ++void set_nl(char *sto, size_t from) ++{ ++ unsigned char *to = (unsigned char *)sto; ++ *to++ = (from >> 24) & 0xff; ++ *to++ = (from >> 16) & 0xff; ++ *to++ = (from >> 8) & 0xff; ++ *to = from & 0xff; ++} ++ ++// Convert a peer ID to a printable string. ++int TextPeerID(unsigned char *peerid, char *txtid) ++{ ++ int i, j; ++ ++ for(i=j=0; i < PEER_ID_LEN; i++){ ++ if( i==j && isprint(peerid[i]) && !isspace(peerid[i]) ) ++ txtid[j++] = peerid[i]; ++ else{ ++ if(i==j){ sprintf(txtid+j, "0x"); j+=2; } ++ snprintf(txtid+j, 3, "%.2X", (int)(peerid[i])); ++ j += 2; ++ } ++ } ++ txtid[j] = '\0'; ++ ++ return 0; ++} ++ ++ ++/* g_next_up is used to rotate uploading. If we have the opportunity to ++ upload to a peer but skip it due to bw limiting, the var is set to point to ++ that peer and it will be given priority at the next opportunity. ++ g_next_dn is similar, but for downloading. ++ g_defer_up/dn is used to let the g_next peer object know if it skipped. ++*/ ++btPeer *g_next_up = (btPeer *)0; ++btPeer *g_next_dn = (btPeer *)0; ++unsigned char g_defer_up = 0; ++unsigned char g_defer_dn = 0; + btBasic Self; + ++void btBasic::SetCurrentRates() ++{ ++ m_current_dl = rate_dl.RateMeasure(); ++ m_current_ul = rate_ul.RateMeasure(); ++ m_use_current = 1; ++} ++ + void btBasic::SetIp(struct sockaddr_in addr) + { + memcpy(&m_sin.sin_addr,&addr.sin_addr,sizeof(struct in_addr)); +@@ -24,7 +84,7 @@ + { + // fprintf(stdout,"IpEquiv: %s <=> ", inet_ntoa(m_sin.sin_addr)); + // fprintf(stdout,"%s\n", inet_ntoa(addr.sin_addr)); +- return (memcmp(&m_sin.sin_addr,&addr.sin_addr,sizeof(struct in_addr)) == 0) ? ++ return (memcmp(&m_sin.sin_addr,&addr.sin_addr,sizeof(struct in_addr)) == 0) ? + 1 : 0; + } + +@@ -44,11 +104,13 @@ + + int btPeer::Need_Remote_Data() + { ++ + if( BTCONTENT.pBF->IsFull()) return 0; + else if( bitfield.IsFull() ) return 1; + else{ + BitField tmpBitfield = bitfield; + tmpBitfield.Except(*BTCONTENT.pBF); ++ tmpBitfield.Except(*BTCONTENT.pBFilter); + return tmpBitfield.IsEmpty() ? 0 : 1; + } + return 0; +@@ -59,12 +121,19 @@ + m_f_keepalive = 0; + m_status = P_CONNECTING; + m_unchoke_timestamp = (time_t) 0; +- time(&m_last_timestamp); ++ m_last_timestamp = now; + m_state.remote_choked = m_state.local_choked = 1; + m_state.remote_interested = m_state.local_interested = 0; + + m_err_count = 0; + m_cached_idx = BTCONTENT.GetNPieces(); ++ m_standby = 0; ++ m_req_send = 5; ++ m_req_out = 0; ++ m_latency = 0; ++ m_prev_dlrate = 0; ++ m_health_time = m_receive_time = m_choketime = m_last_timestamp; ++ m_bad_health = 0; + } + + int btPeer::SetLocal(unsigned char s) +@@ -72,21 +141,37 @@ + switch(s){ + case M_CHOKE: + if( m_state.local_choked ) return 0; ++ m_unchoke_timestamp = now; ++// if(arg_verbose) fprintf(stderr, "Choking %p\n", this); ++ if(arg_verbose) fprintf(stderr, "Choking %p (D=%lluMB@%uK/s)\n", this, ++ TotalDL() >> 20, RateDL() >> 10); + m_state.local_choked = 1; ++ if( g_next_up == this ) g_next_up = (btPeer *)0; ++ if( !reponse_q.IsEmpty()) reponse_q.Empty(); + break; + case M_UNCHOKE: + if( !reponse_q.IsEmpty() ) StartULTimer(); + if( !m_state.local_choked ) return 0; +- time(&m_unchoke_timestamp); ++ m_unchoke_timestamp = now; ++// if(arg_verbose) fprintf(stderr, "Unchoking %p\n", this); ++ if(arg_verbose) fprintf(stderr, "Unchoking %p (D=%lluMB@%uK/s)\n", this, ++ TotalDL() >> 20, RateDL() >> 10); + m_state.local_choked = 0; + break; + case M_INTERESTED: ++ m_standby = 0; + if( m_state.local_interested ) return 0; ++ if(arg_verbose) fprintf(stderr, "Interested in %p\n", this); + m_state.local_interested = 1; + break; + case M_NOT_INTERESTED: + if( !m_state.local_interested ) return 0; ++ if(arg_verbose) fprintf(stderr, "Not interested in %p\n", this); + m_state.local_interested = 0; ++ if( !request_q.IsEmpty() ){ ++ CancelRequest(request_q.GetHead()); ++ request_q.Empty(); ++ } + break; + default: + return -1; // BUG ??? +@@ -97,103 +182,195 @@ + int btPeer::RequestPiece() + { + size_t idx; ++ int endgame = 0; + +- PENDINGQUEUE.ReAssign(&request_q,bitfield); ++ size_t qsize = request_q.Qsize(); ++ size_t psize = BTCONTENT.GetPieceLength() / cfg_req_slice_size; + +- if( !request_q.IsEmpty() ) return SendRequest(); ++ // See if there's room in the queue for a new piece. ++ // Also, don't queue another piece if we still have a full piece queued. ++ if( cfg_req_queue_length - qsize < psize || qsize >= psize ){ ++ m_req_send = m_req_out; // don't come back until you receive something. ++ return 0; ++ } ++ ++ if( PENDINGQUEUE.ReAssign(&request_q,bitfield) ){ ++ if(arg_verbose) fprintf(stderr, "Assigning to %p from Pending\n", this); ++ return SendRequest(); ++ } + +- if( m_cached_idx < BTCONTENT.GetNPieces() ){ ++ if( m_cached_idx < BTCONTENT.GetNPieces() && !BTCONTENT.pBF->IsEmpty() ){ ++ // A HAVE msg already selected what we want from this peer ++ // but ignore it in initial-piece mode. + idx = m_cached_idx; + m_cached_idx = BTCONTENT.GetNPieces(); + if( !BTCONTENT.pBF->IsSet(idx) && +- !PENDINGQUEUE.Exist(idx) && +- !WORLD.AlreadyRequested(idx) ){ ++ !PENDINGQUEUE.Exist(idx) && ++ !WORLD.AlreadyRequested(idx) ){ ++ if(arg_verbose) fprintf(stderr, "Assigning #%u to %p\n", idx, this); + return (request_q.CreateWithIdx(idx) < 0) ? -1 : SendRequest(); + } +- }else{ ++ } // If we didn't want the cached piece, select another. ++ if( BTCONTENT.pBF->IsEmpty() ){ ++ // If we don't have a complete piece yet, try to get one that's already ++ // in progress. (Initial-piece mode) ++ BitField tmpBitField = bitfield; ++ idx = WORLD.What_Can_Duplicate(tmpBitField, this, BTCONTENT.GetNPieces()); ++ if( idx < BTCONTENT.GetNPieces() ){ ++ if(arg_verbose) fprintf(stderr, "Want to dup #%u to %p\n", idx, this); ++ btPeer *peer = WORLD.WhoHas(idx); ++ if(peer){ ++ if(arg_verbose) fprintf( stderr, "Duping: %p to %p (#%u)\n", ++ peer, this, idx ); ++ return (request_q.CopyShuffle(&peer->request_q, idx) < 0) ? ++ -1 : SendRequest(); ++ } ++ }else if(arg_verbose) fprintf(stderr, "Nothing to dup to %p\n", this); ++ } // Doesn't have a piece that's already in progress--choose another. + BitField tmpBitField; + if( bitfield.IsFull() ){ ++ // peer is a seed + tmpBitField = *BTCONTENT.pBF; + tmpBitField.Invert(); + }else{ + tmpBitField = bitfield; + tmpBitField.Except(*BTCONTENT.pBF); + } ++ // The filter tells what we don't want. ++ tmpBitField.Except(*BTCONTENT.pBFilter); ++ // tmpBitField tells what we need from this peer... + + if( !tmpBitField.IsEmpty() ){ +- WORLD.CheckBitField(tmpBitField); +- if(tmpBitField.IsEmpty()){ +- +- btPeer *peer = WORLD.Who_Can_Abandon(this); +- if(peer){ +- peer->StopDLTimer(); +- request_q = peer->request_q; +- +- if(peer->CancelRequest(request_q.GetHead()) < 0 || +- peer->RequestCheck() < 0){ +- peer->CloseConnection(); +- } +- +- return SendRequest(); +- } +- ++ BitField tmpBitField2 = tmpBitField; ++ WORLD.CheckBitField(tmpBitField2); ++ // [tmpBitField2]... that we haven't requested from anyone. ++ if(tmpBitField2.IsEmpty()){ ++ // Everything this peer has that I want, I've already requested. ++ if( arg_file_to_download ){ ++ BitField afdBitField = *BTCONTENT.pBF; ++ afdBitField.Except(*BTCONTENT.pBFilter); ++ endgame = ( BTCONTENT.getFilePieces(arg_file_to_download) ++ - afdBitField.Count() ) < WORLD.TotalPeers(); ++ }else ++ endgame = ( WORLD.Pieces_I_Can_Get() - BTCONTENT.pBF->Count() ) ++ < WORLD.TotalPeers(); ++ if(endgame){ // OK to duplicate a request. ++// idx = tmpBitField.Random(); ++ idx = 0; // flag for Who_Can_Duplicate() ++ BitField tmpBitField3 = tmpBitField2; ++ idx = WORLD.What_Can_Duplicate(tmpBitField3, this, idx); ++ if( idx < BTCONTENT.GetNPieces() ){ ++ if(arg_verbose) fprintf(stderr,"Want to dup #%u to %p\n",idx,this); ++ btPeer *peer = WORLD.WhoHas(idx); ++ if(peer){ ++ if(arg_verbose) fprintf( stderr, "Duping: %p to %p (#%u)\n", ++ peer, this, idx ); ++ return (request_q.CopyShuffle(&peer->request_q, idx) < 0) ? ++ -1 : SendRequest(); ++ } ++ }else if(arg_verbose) fprintf(stderr, "Nothing to dup to %p\n",this); ++ }else{ // not endgame mode ++ btPeer *peer = WORLD.Who_Can_Abandon(this); // slowest choice ++ if(peer){ ++ // Cancel a request to the slowest peer & request it from this one. ++ if(arg_verbose) fprintf( stderr, "Reassigning %p to %p (#%u)\n", ++ peer, this, peer->request_q.GetRequestIdx() ); ++ // RequestQueue class "moves" rather than "copies" in assignment! ++ if( request_q.Copy(&peer->request_q) < 0 ) return -1; ++ if(peer->CancelPiece() < 0 || peer->RequestCheck() < 0) ++ peer->CloseConnection(); ++ return SendRequest(); ++ }else{ ++ if(arg_verbose) fprintf(stderr, "%p standby\n", this); ++ m_standby = 1; // nothing to do at the moment ++ } ++ } + }else{ +- idx = tmpBitField.Random(); +- return (request_q.CreateWithIdx(idx) < 0) ? -1 : SendRequest(); ++ // Request something that we haven't requested yet (most common case). ++ // Try to make it something that has good trade value. ++ BitField tmpBitField3 = tmpBitField2; ++ WORLD.FindValuedPieces(tmpBitField3, this, BTCONTENT.pBF->IsEmpty()); ++ if( tmpBitField3.IsEmpty() ) tmpBitField3 = tmpBitField2; ++ idx = tmpBitField3.Random(); ++ if(arg_verbose) fprintf(stderr, "Assigning #%u to %p\n", idx, this); ++ return (request_q.CreateWithIdx(idx) < 0) ? -1 : SendRequest(); + } ++ }else{ ++ // We don't need anything from the peer. How'd we get here? ++ return SetLocal(M_NOT_INTERESTED); + } +- } + return 0; + } + + int btPeer::MsgDeliver() + { + size_t r,idx,off,len; ++ int retval = 0; + + char *msgbuf = stream.in_buffer.BasePointer(); + +- r = ntohl(*(size_t*) msgbuf); ++ r = get_nl(msgbuf); + ++ // Don't require keepalives if we're receiving other messages. ++ m_last_timestamp = now; + if( 0 == r ){ +- time(&m_last_timestamp); + if( !m_f_keepalive ) if( stream.Send_Keepalive() < 0 ) return -1; + m_f_keepalive = 0; +- return (!m_state.remote_choked && request_q.IsEmpty()) ? RequestCheck() : 0; ++ return 0; + }else{ + switch(msgbuf[4]){ + case M_CHOKE: + if(H_BASE_LEN != r){ return -1;} ++ if(arg_verbose) fprintf(stderr, "%p choked me\n", this); ++ if( m_lastmsg == M_UNCHOKE && m_last_timestamp <= m_choketime+1 ){ ++ m_err_count+=2; ++ if(arg_verbose) fprintf(stderr,"err: %p (%d) Choke oscillation\n", ++ this, m_err_count); ++ } ++ m_choketime = m_last_timestamp; + m_state.remote_choked = 1; + StopDLTimer(); ++ if( g_next_dn == this ) g_next_dn = (btPeer *)0; + if( !request_q.IsEmpty()){ +- PSLICE ps = request_q.GetHead(); +- PENDINGQUEUE.Pending(&request_q); +- if( CancelRequest(ps) < 0) return -1; ++ m_req_out = 0; ++ PENDINGQUEUE.Pending(&request_q); + } +- return 0; ++ break; ++ + case M_UNCHOKE: + if(H_BASE_LEN != r){return -1;} ++ if(arg_verbose) fprintf(stderr, "%p unchoked me\n", this); ++ if( m_lastmsg == M_CHOKE && m_last_timestamp <= m_choketime+1 ){ ++ m_err_count+=2; ++ if(arg_verbose) fprintf(stderr,"err: %p (%d) Choke oscillation\n", ++ this, m_err_count); ++ } ++ m_choketime = m_last_timestamp; + m_state.remote_choked = 0; +- return RequestCheck(); ++ retval = RequestCheck(); ++ break; + + case M_INTERESTED: + if(H_BASE_LEN != r){return -1;} ++ if(arg_verbose) fprintf(stderr, "%p is interested\n", this); + m_state.remote_interested = 1; + break; + + case M_NOT_INTERESTED: + if(r != H_BASE_LEN){return -1;} ++ if(arg_verbose) fprintf(stderr, "%p is not interested\n", this); + + m_state.remote_interested = 0; + StopULTimer(); + + /* remove peer's reponse queue */ + if( !reponse_q.IsEmpty()) reponse_q.Empty(); +- return 0; ++ break; ++ + case M_HAVE: + if(H_HAVE_LEN != r){return -1;} + +- idx = ntohl(*(size_t*) (msgbuf + 5)); ++ idx = get_nl(msgbuf + 5); + + if( idx >= BTCONTENT.GetNPieces() || bitfield.IsSet(idx)) return -1; + +@@ -201,54 +378,90 @@ + + if( bitfield.IsFull() && BTCONTENT.pBF->IsFull() ){ return -2; } + +- if( !BTCONTENT.pBF->IsSet(idx) ) m_cached_idx = idx; ++ if( !BTCONTENT.pBF->IsSet(idx) && !BTCONTENT.pBFilter->IsSet(idx) ){ ++ m_cached_idx = idx; ++ if(arg_verbose && m_standby) fprintf(stderr, "%p un-standby\n", this); ++ m_standby = 0; ++ } ++ // if( !BTCONTENT.pBF->IsSet(idx) ) m_cached_idx = idx; + +- return ( !m_state.remote_choked && request_q.IsEmpty() ) ? RequestCheck() : 0; ++ // see if we're Interested now ++ if(!m_standby) retval = RequestCheck(); ++ break; + + case M_REQUEST: + if(H_REQUEST_LEN != r || !m_state.remote_interested){ return -1; } + +- idx = ntohl(*(size_t*)(msgbuf + 5)); ++ idx = get_nl(msgbuf + 5); + + if( !BTCONTENT.pBF->IsSet(idx) ) return -1; + +- off = ntohl(*(size_t*)(msgbuf + 9)); +- len = ntohl(*(size_t*)(msgbuf + 13)); ++ off = get_nl(msgbuf + 9); ++ len = get_nl(msgbuf + 13); + + if( !reponse_q.IsValidRequest(idx, off, len) ) return -1; +- +- return reponse_q.Add(idx, off, len); ++ ++ if( m_state.local_choked ){ ++ if( (m_latency && m_last_timestamp - m_unchoke_timestamp > m_latency) || ++ (!m_latency && m_last_timestamp - m_unchoke_timestamp > 60) ){ ++ m_err_count++; ++ if(arg_verbose) fprintf(stderr,"err: %p (%d) choked request\n", ++ this, m_err_count); ++ if( stream.Send_State(M_CHOKE) < 0 ) return -1; ++ // This will mess with the unchoke rotation (to this peer's ++ // disadvantage), but otherwise we may spam them with choke msgs. ++ m_unchoke_timestamp = m_last_timestamp; ++ } ++ }else retval = reponse_q.Add(idx, off, len); ++ break; + + case M_PIECE: ++ m_receive_time = m_last_timestamp; + if( request_q.IsEmpty() || !m_state.local_interested){ +- m_err_count++; +- return 0; +- } +- return PieceDeliver(r); ++ m_err_count++; ++ if(arg_verbose) fprintf(stderr,"err: %p (%d) Unwanted piece\n", ++ this, m_err_count); ++ }else retval = PieceDeliver(r); ++ break; + + case M_BITFIELD: + if( (r - 1) != bitfield.NBytes() || !bitfield.IsEmpty()) return -1; + bitfield.SetReferBuffer(msgbuf + 5); +- if(bitfield.IsFull() && BTCONTENT.pBF->IsFull()) return -2; +- return 0; ++ if(bitfield.IsFull()){ ++ if(arg_verbose) fprintf(stderr, "%p is a seed\n", this); ++ if(BTCONTENT.pBF->IsFull()) return -2; ++ } ++ ++ //This is needed in order to set our Interested state ++ retval = RequestCheck(); // fixed client stall ++ break; + + case M_CANCEL: + if(r != H_CANCEL_LEN || !m_state.remote_interested) return -1; + +- idx = ntohl(*(size_t*)(msgbuf + 5)); +- off = ntohl(*(size_t*)(msgbuf + 9)); +- len = ntohl(*(size_t*)(msgbuf + 13)); ++ idx = get_nl(msgbuf + 5); ++ off = get_nl(msgbuf + 9); ++ len = get_nl(msgbuf + 13); + if( reponse_q.Remove(idx,off,len) < 0 ){ +- m_err_count++; +- return 0; ++ m_err_count++; ++ if(arg_verbose) fprintf(stderr, "err: %p (%d) Bad cancel\n", ++ this, m_err_count); ++ }else{ ++ if( reponse_q.IsEmpty() ) StopULTimer(); ++ if( reponse_q.IsEmpty() || !CouldReponseSlice() ){ ++ if( g_next_up == this ) g_next_up = (btPeer *)0; ++ } + } +- if( reponse_q.IsEmpty() ) StopULTimer(); +- return 0; ++ break; ++ + default: +- return -1; // unknow message type +- } ++ if(arg_verbose) fprintf(stderr, "Unknown message type %u from peer %p\n", ++ msgbuf[4], this); ++ } // switch ++ ++ if( retval >= 0 ) m_lastmsg = msgbuf[4]; + } +- return 0; ++ return retval; + } + + int btPeer::ReponseSlice() +@@ -270,6 +483,8 @@ + + Self.DataSended(len); + DataSended(len); ++ if(arg_verbose) fprintf(stderr, "Sending %d/%d/%d to %p\n", ++ (int)idx, (int)off, (int)len, this); + return stream.Send_Piece(idx,off,BTCONTENT.global_piece_buffer,len); + } + +@@ -278,32 +493,153 @@ + + int btPeer::SendRequest() + { ++ int first = 1; ++ PSLICE ps = request_q.NextSend(); ++ ++ if( m_req_out > cfg_req_queue_length ){ ++ if(arg_verbose) ++ fprintf(stderr, "ERROR@5: %p m_req_out underflow, resetting\n", this); ++ m_req_out = 0; ++ } ++ if( ps && m_req_out < m_req_send ){ ++ if(arg_verbose) ++ fprintf(stderr, "Requesting #%u from %p (%d left, %d slots):", ++ ps->index, this, request_q.Qsize(), m_req_send); ++ for( int i=0; ps && m_req_out < m_req_send && i<5; ps = ps->next, i++ ){ ++ if( first && (!RateDL() || ++ 0 >= (m_req_out+1) * ps->length / (double)RateDL() - m_latency) ){ ++ request_q.SetReqTime(ps, now); ++ first = 0; ++ } else request_q.SetReqTime(ps, (time_t)0); ++ if(arg_verbose) fprintf(stderr, "."); ++ if(stream.Send_Request(ps->index,ps->offset,ps->length) < 0){ return -1; } ++ request_q.SetNextSend(ps->next); ++ m_req_out++; ++ } ++ if(arg_verbose) fprintf(stderr, "\n"); ++ m_receive_time = now; ++ } ++ return ( m_req_out < m_req_send ) ? RequestPiece() : 0; ++} ++ ++int btPeer::CancelPiece() ++{ + PSLICE ps = request_q.GetHead(); +- for( ; ps ; ps = ps->next ) +- if(stream.Send_Request(ps->index,ps->offset,ps->length) < 0){ return -1; } ++ size_t idx; ++ int cancel = 1; ++ int retval; ++ ++ idx = ps->index; ++ for( ; ps; ps = ps->next){ ++ if( ps->index != idx ) break; ++ if( ps == request_q.NextSend() ) cancel = 0; ++ if( cancel ){ ++ if(stream.Send_Cancel(ps->index,ps->offset,ps->length) < 0) ++ return -1; ++ m_req_out--; ++ if( m_req_out > cfg_req_queue_length ){ ++ if(arg_verbose) ++ fprintf(stderr, "ERROR@1: %p m_req_out underflow, resetting\n", this); ++ m_req_out = 0; ++ } ++ } ++ request_q.Remove(ps->index, ps->offset, ps->length); ++ } ++ if( !m_req_out && g_next_dn == this ) g_next_dn = (btPeer *)0; + +- return stream.Flush(); ++ return 0; + } + + int btPeer::CancelRequest(PSLICE ps) + { ++ int retval; ++ + for( ; ps; ps = ps->next){ ++ if( ps == request_q.NextSend() ) break; + if(stream.Send_Cancel(ps->index,ps->offset,ps->length) < 0) + return -1; ++ m_req_out--; ++ if( m_req_out > cfg_req_queue_length ){ ++ if(arg_verbose) ++ fprintf(stderr, "ERROR@2: %p m_req_out underflow, resetting\n", this); ++ m_req_out = 0; ++ } + } +- return stream.Flush(); ++ if( !m_req_out && g_next_dn == this ) g_next_dn = (btPeer *)0; ++ ++ return 0; ++} ++ ++int btPeer::CancelSliceRequest(size_t idx, size_t off, size_t len) ++{ ++ PSLICE ps; ++ int cancel = 1; ++ int idxfound = 0; ++ int retval; ++ ++ for(ps = request_q.GetHead() ; ps; ps = ps->next){ ++ if( ps == request_q.NextSend() ) cancel = 0; ++ if( idx == ps->index ){ ++ if( off == ps->offset && len == ps->length ){ ++ if( request_q.Remove(idx,off,len) < 0 ){ ++ m_err_count++; ++ if(arg_verbose) fprintf(stderr,"err: %p (%d) Bad CS remove\n", ++ this, m_err_count); ++ } ++ if(cancel){ ++ if(stream.Send_Cancel(idx,off,len) < 0) ++ return -1; ++ m_req_out--; ++ if( m_req_out > cfg_req_queue_length ){ ++ if(arg_verbose) fprintf(stderr, ++ "ERROR@3: %p m_req_out underflow, resetting\n", this); ++ m_req_out = 0; ++ } ++ if( !m_req_out && g_next_dn == this ) g_next_dn = (btPeer *)0; ++ ++ // Don't call RequestCheck() here since that could cause the slice ++ // we're cancelling to be dup'd from another peer. ++ return 0; ++ } ++ break; ++ } ++ idxfound = 1; ++ }else if( idxfound ) break; ++ } ++ return 0; + } + + int btPeer::ReportComplete(size_t idx) + { + if( BTCONTENT.APieceComplete(idx) ){ ++ if(arg_verbose) fprintf(stderr, "Piece #%u completed\n", idx); + WORLD.Tell_World_I_Have(idx); ++ PENDINGQUEUE.Delete(idx); + if( BTCONTENT.pBF->IsFull() ){ + ResetDLTimer(); + WORLD.CloseAllConnectionToSeed(); + } +- }else ++ ++ if( arg_file_to_download ){ ++ BitField tmpBitField = *BTCONTENT.pBF; ++ tmpBitField.Except(*BTCONTENT.pBFilter); ++ ++ while( arg_file_to_download && ++ tmpBitField.Count() >= BTCONTENT.getFilePieces(arg_file_to_download) ){ ++ //when the file is complete, we go after the next ++ ++arg_file_to_download; ++ BTCONTENT.FlushCache(); ++ BTCONTENT.SetFilter(); ++ tmpBitField = *BTCONTENT.pBF; ++ tmpBitField.Except(*BTCONTENT.pBFilter); ++ } ++ WORLD.CheckInterest(); ++ } ++ }else{ + m_err_count++; ++ if(arg_verbose) fprintf(stderr, "err: %p (%d) Bad complete\n", ++ this, m_err_count); ++ } + return (P_FAILED == m_status) ? -1 : RequestCheck(); + } + +@@ -311,17 +647,37 @@ + { + size_t idx,off,len; + char *msgbuf = stream.in_buffer.BasePointer(); ++ time_t t; ++ int dup = 0, requested = 1; + +- idx = ntohl(*(size_t*) (msgbuf + 5)); +- off = ntohl(*(size_t*) (msgbuf + 9)); ++ idx = get_nl(msgbuf + 5); ++ off = get_nl(msgbuf + 9); + len = mlen - 9; + ++ if(arg_verbose) fprintf(stderr, "Receiving piece %d/%d/%d from %p\n", ++ (int)idx, (int)off, (int)len, this); ++ ++ t = request_q.GetReqTime(idx,off,len); ++ ++ PSLICE ps = request_q.GetHead(); ++ if( request_q.NextSend() ) ++ for( ; ps; ps = ps->next){ ++ if( ps == request_q.NextSend() ){ ++ requested = 0; ++ break; ++ } ++ if( idx==ps->index && off==ps->offset && len==ps->length ) break; ++ } ++ + if( request_q.Remove(idx,off,len) < 0 ){ + m_err_count++; ++ if(arg_verbose) fprintf(stderr, "err: %p (%d) Bad remove\n", ++ this, m_err_count); + return 0; + } + + if(BTCONTENT.WriteSlice((char*)(msgbuf + 13),idx,off,len) < 0){ ++ fprintf(stderr, "warn, WriteSlice failed; is filesystem full?\n"); + return 0; + } + +@@ -329,48 +685,172 @@ + Self.DataRecved(len); + DataRecved(len); + ++ // Check for & cancel requests for this slice from other peers in initial ++ // and endgame modes. ++ if( BTCONTENT.pBF->Count() < 2 || ++ WORLD.Pieces_I_Can_Get() - BTCONTENT.pBF->Count() < WORLD.TotalPeers() ) ++ dup = 1; ++ else if( arg_file_to_download ){ ++ BitField afdBitField = *BTCONTENT.pBF; ++ afdBitField.Except(*BTCONTENT.pBFilter); ++ if( BTCONTENT.getFilePieces(arg_file_to_download) - afdBitField.Count() ++ < WORLD.TotalPeers() ) ++ dup = 1; ++ } ++ if( dup ){ ++ WORLD.CancelSlice(idx, off, len); ++ PENDINGQUEUE.DeleteSlice(idx, off, len); ++ } ++ ++ // Determine how many outstanding requests we should maintain, roughly: ++ // (request turnaround latency) / (time to transmit one slice) ++ if(t){ ++ m_latency = (m_last_timestamp <= t) ? 1 : m_last_timestamp - t; ++ if(arg_verbose) fprintf(stderr, "%p latency is %d sec\n", ++ this, (int)m_latency); ++ m_latency_timestamp = m_last_timestamp; ++ } ++ ++ if( RateDL() > len/20 ){ ++ m_req_send = (int)( m_latency / (len / (double)RateDL()) + 1 ); ++ m_req_send = (m_req_send < 2) ? 2 : m_req_send; ++ ++ // If latency increases, we will see this as a dlrate decrease. ++ if( RateDL() < m_prev_dlrate ) m_req_send++; ++ else if( m_last_timestamp - m_latency_timestamp >= 30 && ++ // Try to force latency measurement every 30 seconds. ++ m_req_out == m_req_send - 1 ){ ++ m_req_send--; ++ m_latency_timestamp = m_last_timestamp; ++ } ++ m_prev_dlrate = RateDL(); ++ }else if (m_req_send < 5) m_req_send = 5; ++ ++ if( requested ) m_req_out--; ++ + /* if piece download complete. */ +- return request_q.IsEmpty() ? ReportComplete(idx) : 0; ++ return ( request_q.IsEmpty() || !request_q.HasIdx(idx) ) ? ++ ReportComplete(idx) : RequestCheck(); + } + + int btPeer::RequestCheck() + { +- if( BandWidthLimit() ) return 0; +- + if( BTCONTENT.pBF->IsFull() ){ +- if( bitfield.IsFull() ){ return -1; } ++ if( bitfield.IsFull() ){ return -2; } + return SetLocal(M_NOT_INTERESTED); + } + + if( Need_Remote_Data() ){ + if(!m_state.local_interested && SetLocal(M_INTERESTED) < 0) return -1; +- if(request_q.IsEmpty() && !m_state.remote_choked){ +- if( RequestPiece() < 0 ) return -1; ++ if( !m_state.remote_choked ){ ++ if( m_req_out > cfg_req_queue_length ){ ++ if(arg_verbose) ++ fprintf(stderr, "ERROR@4: %p m_req_out underflow, resetting\n", this); ++ m_req_out = 0; ++ } ++ if( request_q.IsEmpty() && RequestPiece() < 0 ) return -1; ++ else if( m_req_out < m_req_send && ++ (m_req_out < 2 || !RateDL() || ++ 1 >= (m_req_out+1) * request_q.GetRequestLen() / ++ (double)RateDL() - m_latency) ++ // above formula is to try to allow delay between sending batches of reqs ++ && SendRequest() < 0 ) return -1; + } +- } ++ }else ++ if(m_state.local_interested && SetLocal(M_NOT_INTERESTED) < 0) return -1; + + if(!request_q.IsEmpty()) StartDLTimer(); ++ else StopDLTimer(); + return 0; + } + + void btPeer::CloseConnection() + { ++ if(arg_verbose) fprintf(stderr, "%p closed\n", this); + if( P_FAILED != m_status ){ + m_status = P_FAILED; + stream.Close(); ++ if( !request_q.IsEmpty() ) ++ PENDINGQUEUE.Pending(&request_q); + } ++ if( g_next_up == this ) g_next_up = (btPeer *)0; ++ if( g_next_dn == this ) g_next_dn = (btPeer *)0; + } + + int btPeer::HandShake() + { ++ char txtid[PEER_ID_LEN*2+3]; + ssize_t r = stream.Feed(); +- if( r < 0 ) return -1; ++ if( r < 0 ){ ++// if(arg_verbose) fprintf(stderr, "hs: r<0 (%d)\n", r); ++ return -1; ++ } + else if( r < 68 ){ +- if(r && memcmp(stream.in_buffer.BasePointer(),BTCONTENT.GetShakeBuffer(),r) != 0) return -1; ++ if(r >= 21){ // Ignore 8 reserved bytes following protocol ID. ++ if( memcmp(stream.in_buffer.BasePointer()+20, ++ BTCONTENT.GetShakeBuffer()+20, (r<28) ? r-20 : 8) != 0 ){ ++ if(arg_verbose){ ++ fprintf( stderr, "\npeer %p gave 0x", this); ++ for(int i=20; i48 ){ ++ TextPeerID((unsigned char *)(stream.in_buffer.BasePointer()+48), ++ txtid); ++ fprintf(stderr, "peer is %s\n", txtid); ++ } ++ } ++ return -1; ++ } + return 0; + } + +- if( memcmp(stream.in_buffer.BasePointer(),BTCONTENT.GetShakeBuffer(),48) != 0 ) return -1; ++ // If the reserved bytes differ, make them the same. ++ // If they mean anything important, the handshake is likely to fail anyway. ++ if( memcmp(stream.in_buffer.BasePointer()+20, BTCONTENT.GetShakeBuffer()+20, ++ 8) != 0 ){ ++ if(arg_verbose){ ++ fprintf(stderr, "\npeer %p gave 0x", this); ++ for(int i=20; i<27; i++) fprintf(stderr, "%2.2hx", ++ (unsigned short)(unsigned char)(stream.in_buffer.BasePointer()[i])); ++ fprintf( stderr, " as reserved bytes\n" ); ++ } ++ memcpy(stream.in_buffer.BasePointer()+20, BTCONTENT.GetShakeBuffer()+20, 8); ++ } ++ if( memcmp(stream.in_buffer.BasePointer(), ++ BTCONTENT.GetShakeBuffer(),48) != 0 ){ ++ if(arg_verbose){ ++ fprintf(stderr, "\nmine: 0x"); ++ for(int i=0; i<48; i++) fprintf(stderr, "%2.2hx", ++ (unsigned short)(unsigned char)(BTCONTENT.GetShakeBuffer()[i])); ++ fprintf(stderr, "\npeer: 0x"); ++ for(int i=0; i<48; i++) fprintf(stderr, "%2.2hx", ++ (unsigned short)(unsigned char)(stream.in_buffer.BasePointer()[i])); ++ fprintf(stderr, "\n"); ++ } ++ return -1; ++ } ++ ++ memcpy(id, stream.in_buffer.BasePointer()+48, PEER_ID_LEN); ++ if(arg_verbose){ ++ TextPeerID((unsigned char *)(stream.in_buffer.BasePointer()+48), txtid); ++ fprintf(stderr, "Peer %p ID: %s\n", this, txtid); ++ } + + // ignore peer id verify + if( !BTCONTENT.pBF->IsEmpty()){ +@@ -395,20 +875,63 @@ + return stream.Send_Buffer((char*)BTCONTENT.GetShakeBuffer(),68); + } + +-int btPeer::BandWidthLimit() ++int btPeer::BandWidthLimitUp() + { +- if( cfg_max_bandwidth <= 0 ) return 0; +- return ((Self.RateDL() + Self.RateUL()*2) / 1024 >= cfg_max_bandwidth) ? ++ if( cfg_max_bandwidth_up <= 0 ) return 0; ++ return ((Self.RateUL()) >= cfg_max_bandwidth_up) ? ++ 1:0; ++} ++ ++int btPeer::BandWidthLimitDown() ++{ ++ if( cfg_max_bandwidth_down <= 0 ) return 0; ++ return ((Self.RateDL()) >= cfg_max_bandwidth_down) ? + 1:0; + } + + int btPeer::NeedWrite() + { + int yn = 0; ++ ++ if( m_standby && WORLD.Endgame() ){ ++ if(arg_verbose) fprintf(stderr, "%p un-standby (endgame)\n", this); ++ m_standby = 0; ++ } ++ + if( stream.out_buffer.Count() || // data need send in buffer. +- (!reponse_q.IsEmpty() && CouldReponseSlice() && !BandWidthLimit()) || +- P_CONNECTING == m_status ) // peer is connecting ++ // can upload a slice ++ (!reponse_q.IsEmpty() && CouldReponseSlice() && !BandWidthLimitUp()) || ++ ++ ( (request_q.NextSend() && m_req_out < m_req_send && ++ (m_req_out < 2 || !RateDL() || ++ 1 >= (m_req_out+1) * request_q.GetRequestLen() / ++ (double)RateDL() - m_latency)) // can send queued request ++ || ++ (request_q.IsEmpty() && !m_state.remote_choked ++ && m_state.local_interested && !m_standby) // can request a new piece ++ ) // ok to send requests ++ ++ || P_CONNECTING == m_status ){ // peer is connecting ++ + yn = 1; ++ ++ if( g_next_up==this && g_defer_up ){ ++ if(arg_verbose) fprintf(stderr, "%p skipped UL\n", this); ++ g_next_up = (btPeer *)0; ++ } ++ } ++ return yn; ++} ++ ++int btPeer::NeedRead() ++{ ++ int yn = 1; ++ if( !request_q.IsEmpty() && BandWidthLimitDown() ) ++ yn = 0; ++ else if( g_next_dn==this && g_defer_dn ){ ++ if(arg_verbose) fprintf(stderr, "%p skipped DL\n", this); ++ g_next_dn = (btPeer *)0; ++ } + return yn; + } + +@@ -432,20 +955,35 @@ + ssize_t r; + + if ( 64 < m_err_count ) return -1; +- +- r = stream.Feed(); + +- if( r < 0 && r != -2 ) +- return -1; +- else if ( r == -2 ) +- f_peer_closed = 1; ++ if( request_q.IsEmpty() || !BandWidthLimitDown() ){ ++ if ( request_q.IsEmpty() || !g_next_dn || g_next_dn==this ){ ++ if( g_next_dn ) g_next_dn = (btPeer *)0; ++ ++ r = stream.Feed(); ++ ++ if( r < 0 && r != -2 ) ++ return -1; ++ else if ( r == -2 ) ++ f_peer_closed = 1; + +- r = stream.HaveMessage(); +- for( ; r;){ +- if( r < 0 ) return -1; +- if(MsgDeliver() < 0 || stream.PickMessage() < 0) return -1; +- r = stream.HaveMessage(); ++ r = stream.HaveMessage(); ++ for( ; r;){ ++ if( r < 0 ) return -1; ++ if(MsgDeliver() < 0 || stream.PickMessage() < 0) return -1; ++ r = stream.HaveMessage(); ++ } ++ }else{ ++ if(arg_verbose) ++ fprintf(stderr, "%p deferring DL to %p\n", this, g_next_dn); ++ if( !g_defer_dn ) g_defer_dn = 1; ++ } ++ }else if( !g_next_dn ){ ++ if(arg_verbose) fprintf(stderr, "%p waiting for DL bandwidth\n", this); ++ g_next_dn = this; ++ if( g_defer_dn ) g_defer_dn = 0; + } ++ + return f_peer_closed ? -1 : 0; + } + +@@ -453,27 +991,80 @@ + { + if( stream.out_buffer.Count() && stream.Flush() < 0) return -1; + +- if(! reponse_q.IsEmpty() && CouldReponseSlice() ) { +- StartULTimer(); +- Self.StartULTimer(); +- } ++ if( !reponse_q.IsEmpty() && CouldReponseSlice() ) { ++ if( !BandWidthLimitUp() ){ ++ if( !g_next_up || g_next_up==this ){ ++ if( g_next_up ) g_next_up = (btPeer *)0; ++ ++ StartULTimer(); ++ Self.StartULTimer(); ++ if( ReponseSlice() < 0 ) return -1; ++ }else{ ++ if(arg_verbose) ++ fprintf(stderr, "%p deferring UL to %p\n", this, g_next_up); ++ if( !g_defer_up ) g_defer_up = 1; ++ } ++ }else if( !g_next_up ){ ++ if(arg_verbose) fprintf(stderr, "%p waiting for UL bandwidth\n", this); ++ g_next_up = this; ++ if( g_defer_up ) g_defer_up = 0; ++ } ++ }else if( g_next_up == this ) g_next_up = (btPeer *)0; + +- for(; !reponse_q.IsEmpty() && CouldReponseSlice(); ) +- if( ReponseSlice() < 0) return -1; ++ return (!m_state.remote_choked) ? RequestCheck() : 0; ++} + ++// Prevent a peer object from holding g_next_up when it's not ready to write. ++void btPeer::CheckSendStatus() ++{ ++ if( g_next_up == this && !BandWidthLimitUp() ){ ++ if(arg_verbose) fprintf(stderr, "%p is not write-ready\n", this); ++ g_next_up = (btPeer *)0; ++ } ++} ++ ++/* Detect if a peer ignored, discarded, or lost my request and we're waiting ++ for a piece that may never arrive. */ ++int btPeer::HealthCheck(time_t now) ++{ ++ if( m_health_time <= now - 60 ){ ++ m_health_time = now; ++ if( !m_state.remote_choked && m_req_out && ++ m_receive_time < now - (!m_latency ? 300 : ++ ((m_latency < 30) ? 60 : 2*m_latency)) ){ ++ // if a repeat occurrence, get rid of the peer ++ if( m_bad_health ) return -1; ++ m_bad_health = 1; ++ if(arg_verbose) ++ fprintf(stderr, "%p unresponsive; resetting request queue\n", this); ++ PSLICE ps = request_q.GetHead(); ++ int retval = CancelRequest(ps); ++ PENDINGQUEUE.Pending(&request_q); ++ return (retval < 0) ? -1 : RequestCheck(); ++ } else m_bad_health = 0; ++ } + return 0; + } + ++// This handles peers that suppress HAVE messages so that we don't always think ++// that they're empty. If we've sent the peer an amount of data equivalent to ++// two pieces, assume that they now have at least one complete piece. ++int btPeer::IsEmpty() const ++{ ++ return ( bitfield.IsEmpty() && TotalUL() < BTCONTENT.GetPieceLength()*2 ) ? ++ 1:0; ++} ++ + void btPeer::dump() + { + struct sockaddr_in sin; + + GetAddress(&sin); + printf("%s: %d -> %d:%d %lud:%lud\n", inet_ntoa(sin.sin_addr), +- bitfield.Count(), +- Is_Remote_UnChoked() ? 1 : 0, +- request_q.IsEmpty() ? 0 : 1, +- (unsigned long)TotalDL(), +- (unsigned long)TotalUL()); ++ bitfield.Count(), ++ Is_Remote_UnChoked() ? 1 : 0, ++ request_q.IsEmpty() ? 0 : 1, ++ (unsigned long)TotalDL(), ++ (unsigned long)TotalUL()); + } + +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/peer.h ctorrent-1.3.4/peer.h +--- ctorrent-1.3.4.sav/peer.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/peer.h 2006-06-28 19:30:02.000000000 +0200 +@@ -19,6 +19,7 @@ + #include "btstream.h" + #include "bitfield.h" + #include "rate.h" ++#include "btconfig.h" + + #define P_CONNECTING (unsigned char) 0 // connecting + #define P_HANDSHAKE (unsigned char) 1 // handshaking +@@ -34,14 +35,24 @@ + unsigned char reserved:4; /* unused */ + }BTSTATUS; + ++size_t get_nl(char *from); ++void set_nl(char *to, size_t from); ++ ++int TextPeerID(unsigned char *peerid, char *txtid); ++ + class btBasic + { + private: + Rate rate_dl; + Rate rate_ul; ++ size_t m_current_dl, m_current_ul; ++ unsigned char m_use_current:1; ++ unsigned char m_reserved:7; + public: + struct sockaddr_in m_sin; + ++ btBasic() { m_use_current = 0; } ++ + //IPַغ + int IpEquiv(struct sockaddr_in addr); + void SetIp(struct sockaddr_in addr); +@@ -60,8 +71,10 @@ + void DataRecved(size_t nby) { rate_dl.CountAdd(nby); } + void DataSended(size_t nby) { rate_ul.CountAdd(nby); } + +- size_t RateDL() const { return rate_dl.RateMeasure(); } +- size_t RateUL() const { return rate_ul.RateMeasure();} ++ size_t RateDL() const { return m_use_current ? m_current_dl : rate_dl.RateMeasure(); } ++ size_t RateUL() const { return m_use_current ? m_current_ul : rate_ul.RateMeasure(); } ++ void SetCurrentRates(); ++ void ClearCurrentRates() { m_use_current = 0; } + + void StartDLTimer() { rate_dl.StartTimer(); } + void StartULTimer() { rate_ul.StartTimer(); } +@@ -78,17 +91,28 @@ + + unsigned char m_f_keepalive:1; + unsigned char m_status:4; +- unsigned char m_reserved:3; ++ unsigned char m_bad_health:1; ++ unsigned char m_standby:1; ++ unsigned char m_reserved:1; + + BTSTATUS m_state; + + size_t m_cached_idx; + size_t m_err_count; ++ size_t m_req_send; // target number of outstanding requests ++ size_t m_req_out; // actual number of outstanding requests ++ size_t m_latency; ++ size_t m_prev_dlrate; ++ time_t m_latency_timestamp; ++ time_t m_health_time, m_receive_time; ++ char m_lastmsg; ++ time_t m_choketime; + + int PieceDeliver(size_t mlen); + int ReportComplete(size_t idx); + int RequestCheck(); + int SendRequest(); ++ int CancelPiece(); + int CancelRequest(PSLICE ps); + int ReponseSlice(); + int RequestPiece(); +@@ -96,7 +120,10 @@ + int CouldReponseSlice(); + + int BandWidthLimit(); ++ int BandWidthLimitUp(); ++ int BandWidthLimitDown(); + public: ++ unsigned char id[PEER_ID_LEN]; + BitField bitfield; + btStream stream; + RequestQueue request_q; +@@ -106,6 +133,8 @@ + + int RecvModule(); + int SendModule(); ++ int HealthCheck(time_t now); ++ void CheckSendStatus(); + + time_t SetLastTimestamp() { return time(&m_last_timestamp); } + time_t GetLastTimestamp() const { return m_last_timestamp; } +@@ -118,10 +147,14 @@ + int Is_Local_UnChoked() const { return m_state.local_choked ? 0 : 1; } + int SetLocal(unsigned char s); + ++ int IsEmpty() const; ++ ++ int CancelSliceRequest(size_t idx, size_t off, size_t len); + + void SetStatus(unsigned char s){ m_status = s; } + unsigned char GetStatus() const { return m_status; } + int NeedWrite(); ++ int NeedRead(); + + + void CloseConnection(); +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/peerlist.cpp ctorrent-1.3.4/peerlist.cpp +--- ctorrent-1.3.4.sav/peerlist.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/peerlist.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -5,6 +5,7 @@ + #include + + #include ++#include + + #include + +@@ -16,11 +17,15 @@ + + #include "iplist.h" + #include "tracker.h" ++#include "ctcs.h" ++#include "bttime.h" + + + #define MAX_UNCHOKE 3 + #define UNCHOKE_INTERVAL 10 + ++#define OPT_INTERVAL 30 ++ + #define KEEPALIVE_INTERVAL 117 + + #define LISTEN_PORT_MAX 2706 +@@ -36,12 +41,13 @@ + + PeerList::PeerList() + { +- m_unchoke_check_timestamp = +- m_keepalive_check_timestamp = time((time_t*) 0); ++ m_unchoke_check_timestamp = ++ m_keepalive_check_timestamp = ++ m_opt_timestamp = time((time_t*) 0); + + m_head = (PEERNODE*) 0; + m_listen_sock = INVALID_SOCKET; +- m_peers_count = 0; ++ m_peers_count = m_seeds_count = 0; + m_live_idx = 0; + } + +@@ -61,25 +67,6 @@ + return m_peers_count ? 0 : 1; + } + +-void PeerList::Sort() +-{ +- PEERNODE *newhead = (PEERNODE*) 0; +- PEERNODE *p, *pp, *spn; +- +- if( m_peers_count < 10 ) return; +- +- for(; m_head;){ +- pp = (PEERNODE*) 0; +- for(p = newhead; p && m_head->click < p->click; pp = p, p = p->next) ; +- +- spn = m_head->next; +- m_head->next = p; +- if( pp ) pp->next = m_head; else newhead = m_head; +- m_head = spn; +- } +- m_head = newhead; +-} +- + void PeerList::CloseAll() + { + PEERNODE *p; +@@ -118,6 +105,8 @@ + + if( setfd_nonblock(sk) < 0) goto err; + ++ if(arg_verbose) fprintf(stderr, "Connecting to %s:%hu\n", ++ inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); + if( -1 == (r = connect_nonb(sk,(struct sockaddr*)&addr)) ) return -1; + + peer = new btPeer; +@@ -154,7 +143,6 @@ + m_peers_count++; + + p->peer = peer; +- p->click = 0; + + p->next = m_head; + m_head = p; +@@ -177,28 +165,65 @@ + struct sockaddr_in addr; + btPeer * UNCHOKER[MAX_UNCHOKE + 1]; + +- for( ;NEED_MORE_PEERS() && !IPQUEUE.IsEmpty(); ){ +- if(IPQUEUE.Pop(&addr) < 0) break; +- if(NewPeer(addr,INVALID_SOCKET) == -4) break; +- } ++ if( !Tracker.IsPaused() && !Tracker.IsQuitting() ) ++ for( ;NEED_MORE_PEERS() && !IPQUEUE.IsEmpty(); ){ ++ if(IPQUEUE.Pop(&addr) < 0) break; ++ if(NewPeer(addr,INVALID_SOCKET) == -4) break; ++ } ++ ++ Self.SetCurrentRates(); + + // show status line. + if( m_pre_dlrate.TimeUsed(pnow) ){ +- printf("\r "); +- printf("\r%c %u,[%u/%u/%u],%u,%u | %u,%u E:%u", +- LIVE_CHAR[m_live_idx], +- m_peers_count, +- BTCONTENT.pBF->Count(), +- BTCONTENT.pBF->NBits(), +- Pieces_I_Can_Get(), +- Self.RateDL(), Self.RateUL(), +- m_pre_dlrate.RateMeasure(Self.GetDLRate()), +- m_pre_ulrate.RateMeasure(Self.GetULRate()), +- Tracker.GetRefuseClick()); ++ char partial[30] = ""; ++ if(arg_file_to_download){ ++ BitField tmpBitField = *BTCONTENT.pBF; ++ tmpBitField.Except(*BTCONTENT.pBFilter); ++ sprintf( partial, "P:%u/%u ", ++ tmpBitField.Count(), ++ BTCONTENT.getFilePieces(arg_file_to_download) ); ++ } ++ printf("\r "); ++ printf("\r%c %u/%u/%u [%u/%u/%u] %lluMB,%lluMB | %u,%uK/s | %u,%uK E:%u,%u %s%s ", ++ LIVE_CHAR[m_live_idx], ++ ++ m_seeds_count, ++ m_peers_count - m_seeds_count, ++ Tracker.GetPeersCount(), ++ ++ BTCONTENT.pBF->Count(), ++ BTCONTENT.pBF->NBits(), ++ Pieces_I_Can_Get(), ++ ++ Self.TotalDL() >> 20, Self.TotalUL() >> 20, ++ ++ Self.RateDL() >> 10, Self.RateUL() >> 10, ++ ++ m_pre_dlrate.RateMeasure(Self.GetDLRate()) >> 10, ++ m_pre_ulrate.RateMeasure(Self.GetULRate()) >> 10, ++ ++ Tracker.GetRefuseClick(), ++ Tracker.GetOkClick(), ++ ++ partial, ++ ++ (Tracker.GetStatus()==T_CONNECTING) ? "Connecting" : ++ ( (Tracker.GetStatus()==T_READY) ? "Connected" : ++ (Tracker.IsPaused() ? ++ ((Tracker.GetStatus()==T_FINISHED) ? "Paused" : "Pausing") : ++ (Tracker.IsQuitting() ? "Quitting" : "")) ) ++ ); + fflush(stdout); + m_pre_dlrate = Self.GetDLRate(); + m_pre_ulrate = Self.GetULRate(); + m_live_idx++; ++ ++ if(arg_ctcs) CTCS.Report_Status( ++ m_seeds_count, m_peers_count - m_seeds_count, ++ BTCONTENT.pBF->Count(), BTCONTENT.pBF->NBits(), Pieces_I_Can_Get(), ++ Self.RateDL(), Self.RateUL(), ++ Self.TotalDL(), Self.TotalUL(), ++ cfg_max_bandwidth_down, cfg_max_bandwidth_up); + } + + if(KEEPALIVE_INTERVAL <= (*pnow - m_keepalive_check_timestamp)){ +@@ -211,11 +236,14 @@ + m_unchoke_check_timestamp = *pnow; + f_unchoke_check = 1; + +- Sort(); + } + +- if( f_unchoke_check ) memset(UNCHOKER, 0, (MAX_UNCHOKE + 1) * sizeof(btPeer*)); ++ if( f_unchoke_check ) { ++ memset(UNCHOKER, 0, (MAX_UNCHOKE + 1) * sizeof(btPeer*)); ++ if (OPT_INTERVAL <= *pnow - m_opt_timestamp) m_opt_timestamp = 0; ++ } + ++ m_seeds_count = 0; + for(p = m_head; p;){ + if( PEER_IS_FAILED(p->peer)){ + if( pp ) pp->next = p->next; else m_head = p->next; +@@ -225,38 +253,38 @@ + if( pp ) p = pp->next; else p = m_head; + continue; + }else{ ++ if (p->peer->bitfield.IsFull()) m_seeds_count++; + if( f_keepalive_check ){ + +- if(3 * KEEPALIVE_INTERVAL <= (*pnow - p->peer->GetLastTimestamp())){ +- p->peer->CloseConnection(); +- goto skip_continue; +- } +- +- if(PEER_IS_SUCCESS(p->peer) && +- KEEPALIVE_INTERVAL <= (*pnow - p->peer->GetLastTimestamp()) && +- p->peer->AreYouOK() < 0){ +- p->peer->CloseConnection(); +- goto skip_continue; +- } +- } +- +- if( f_unchoke_check ){ +- +- if(PEER_IS_SUCCESS(p->peer) && p->peer->Need_Local_Data()){ +- +- if((time_t) 0 == p->peer->GetLastUnchokeTime()){ +- if(p->peer->SetLocal(M_UNCHOKE) < 0){ +- p->peer->CloseConnection(); +- goto skip_continue; +- } +- }else +- UnChokeCheck(p->peer, UNCHOKER); +- } ++ if(3 * KEEPALIVE_INTERVAL <= (*pnow - p->peer->GetLastTimestamp())){ ++ if(arg_verbose) fprintf(stderr, "close: keepalive expired\n"); ++ p->peer->CloseConnection(); ++ goto skip_continue; ++ } ++ ++ if(PEER_IS_SUCCESS(p->peer) && ++ KEEPALIVE_INTERVAL <= (*pnow - p->peer->GetLastTimestamp()) && ++ p->peer->AreYouOK() < 0){ ++ if(arg_verbose) fprintf(stderr, "close: keepalive death\n"); ++ p->peer->CloseConnection(); ++ goto skip_continue; ++ } ++ } ++ ++ if( f_unchoke_check && PEER_IS_SUCCESS(p->peer) ){ ++ ++ if( p->peer->Is_Remote_Interested() && p->peer->Need_Local_Data() ) ++ UnChokeCheck(p->peer, UNCHOKER); ++ else if(p->peer->SetLocal(M_CHOKE) < 0){ ++ if(arg_verbose) fprintf(stderr, "close: Can't choke peer\n"); ++ p->peer->CloseConnection(); ++ goto skip_continue; ++ } + } + + sk = p->peer->stream.GetSocket(); + if(maxfd < sk) maxfd = sk; +- FD_SET(sk,rfdp); ++ if( p->peer->NeedRead() ) FD_SET(sk,rfdp); + + if( p->peer->NeedWrite() ) FD_SET(sk,wfdp); + skip_continue: +@@ -272,25 +300,40 @@ + } + + if( f_unchoke_check ){ ++ if(arg_verbose) fprintf(stderr, "\nUnchoker "); ++ if (!m_opt_timestamp){ ++ if(arg_verbose) fprintf(stderr, "(opt) "); ++ m_opt_timestamp = *pnow; ++ } + for( i = 0; i < MAX_UNCHOKE + 1; i++){ + + if( (btPeer*) 0 == UNCHOKER[i]) break; + + if( PEER_IS_FAILED(UNCHOKER[i]) ) continue; + ++ if(arg_verbose){ ++ fprintf(stderr, "D=%lluMB@%uK/s:U=%lluMB ", ++ UNCHOKER[i]->TotalDL() >> 20, UNCHOKER[i]->RateDL() >> 10, ++ UNCHOKER[i]->TotalUL() >> 20); ++ if( UNCHOKER[i]->bitfield.IsEmpty() ) fprintf(stderr, "(empty) "); ++ } + if( UNCHOKER[i]->SetLocal(M_UNCHOKE) < 0){ +- UNCHOKER[i]->CloseConnection(); +- continue; ++ if(arg_verbose) fprintf(stderr, "close: Can't unchoke peer\n"); ++ UNCHOKER[i]->CloseConnection(); ++ continue; + } + + sk = UNCHOKER[i]->stream.GetSocket(); + + if(!FD_ISSET(sk,wfdp) && UNCHOKER[i]->NeedWrite()){ +- FD_SET(sk,wfdp); +- if( maxfd < sk) maxfd = sk; ++ FD_SET(sk,wfdp); ++ if( maxfd < sk) maxfd = sk; + } + } // end for ++ if(arg_verbose) fprintf(stderr, "\n"); + } ++ ++ Self.ClearCurrentRates(); + + return maxfd; + } +@@ -305,15 +348,148 @@ + + if(proposer->bitfield.IsSet(p->peer->request_q.GetRequestIdx())){ + if(!peer){ +- if( p->peer->RateDL() < proposer->RateDL() ) peer = p->peer; ++ if( p->peer->RateDL() < proposer->RateDL() ) peer = p->peer; + }else{ +- if( p->peer->RateDL() < peer->RateDL() ) peer = p->peer; ++ if( p->peer->RateDL() < peer->RateDL() ) peer = p->peer; + } + } + }//end for + return peer; + } + ++// This takes an index parameter to facilitate modification of the function to ++// allow targeting of a specific piece. It's currently only used as a flag to ++// specify endgame or initial-piece mode though. ++size_t PeerList::What_Can_Duplicate(BitField &bf, btPeer *proposer, size_t idx) ++{ ++ PEERNODE *p; ++ btPeer *peer = (btPeer*) 0; ++ int endgame; ++ PSLICE ps; ++ size_t piece, piece1, qsize, mark, bench; ++ unsigned long rndbits; ++ int r=0; ++ ++ endgame = idx < BTCONTENT.GetNPieces(); // else initial-piece mode ++ if(endgame) mark = 0; ++ else mark = cfg_req_queue_length; ++ bench = BTCONTENT.GetNPieces(); ++ ++ // In initial mode, only dup a piece with trade value. ++ // In endgame mode, dup any if there are no pieces with trade value. ++ FindValuedPieces(bf, proposer, !endgame); ++ if( bf.IsEmpty() ){ ++ if(endgame) bf = proposer->bitfield; ++ else return BTCONTENT.GetNPieces(); ++ } ++ ++ /* In endgame mode, select from peers with the longest request queue. ++ In initial mode, select from peers with the shortest non-empty request ++ queue. */ ++ for(p = m_head; p; p = p->next){ ++ if( !PEER_IS_SUCCESS(p->peer) || p->peer == proposer ) continue; ++ ++ if( p->peer->request_q.IsEmpty() ) continue; ++ ++ piece = BTCONTENT.GetNPieces(); ++ ps = p->peer->request_q.GetHead(); ++ for( ; ps; ps = ps->next){ ++ if( piece == ps->index || bench == ps->index || piece1 == ps->index || ++ !bf.IsSet(ps->index) || proposer->request_q.HasIdx(ps->index) ) ++ continue; ++ piece = ps->index; ++ ++ qsize = p->peer->request_q.Qlen(piece); ++ if( (endgame && qsize > mark) || ++ (!endgame && (qsize < mark || !peer)) ){ ++ mark = qsize; ++ peer = p->peer; ++ piece1 = piece; ++ }else if( qsize == mark ){ ++ if( !r-- ){ ++ rndbits = random(); ++ r = 30; ++ } ++ if( bench != piece && (rndbits>>=1)&01 ){ ++ bench = piece1; ++ peer = p->peer; ++ piece1 = piece; ++ } ++ } ++ } ++ } ++ return peer ? piece1 : BTCONTENT.GetNPieces(); ++} ++ ++void PeerList::FindValuedPieces(BitField &bf, btPeer *proposer, int initial) ++{ ++ PEERNODE *p; ++ BitField bf_all_have = bf, bf_int_have = bf, ++ bf_others_have, bf_only_he_has = bf, bf_prefer; ++ ++ for(p = m_head; p; p = p->next){ ++ if( !PEER_IS_SUCCESS(p->peer) || p->peer == proposer ) continue; ++ if( p->peer->Need_Remote_Data() ) ++ bf_int_have.And(p->peer->bitfield); ++ bf_all_have.And(p->peer->bitfield); ++ if( !initial && !p->peer->bitfield.IsFull() ) ++ bf_only_he_has.Except(p->peer->bitfield); ++ else bf_others_have.Comb(p->peer->bitfield); ++ } ++ /* bf_all_have is now pertinent pieces that all peers have ++ bf_int_have is pertinent pieces that all peers in which I'm interested have ++ We prefer to get pieces that those peers need, if we can. Otherwise go ++ for pieces that any peer needs in hopes of future reciprocation. */ ++ if( !bf_int_have.IsFull() ) ++ bf_all_have = bf_int_have; ++ bf_all_have.Invert(); ++ bf.And(bf_all_have); // bf is now pertinent pieces that not everyone has ++ ++ bf_prefer = initial ? bf_others_have : bf_only_he_has; ++ ++ BitField tmpBitField = bf; ++ tmpBitField.And(bf_prefer); ++ /* If initial mode, tmpBitField is now pertinent pieces that more than one ++ peer has, but not everyone. ++ Otherwise, it's pertinent pieces that only the proposer has (not ++ considering what other seeders have). ++ In either case if there are no such pieces, revert to the simple answer.*/ ++ if( !tmpBitField.IsEmpty() ) bf = tmpBitField; ++} ++ ++/* Find a peer with the given piece in its request queue. ++ Duplicating a request queue that's in progress rather than creating a new ++ one helps avoid requesting slices that we already have. */ ++btPeer *PeerList::WhoHas(size_t idx) ++{ ++ PEERNODE *p; ++ btPeer *peer = (btPeer*) 0; ++ ++ for( p = m_head; p; p = p->next){ ++ if( p->peer->request_q.HasIdx(idx) ){ ++ peer = p->peer; ++ break; ++ } ++ } ++ return peer; ++} ++ ++void PeerList::CancelSlice(size_t idx, size_t off, size_t len) ++{ ++ PEERNODE *p; ++ PSLICE ps; ++ ++ for( p = m_head; p; p = p->next){ ++ ++ if( !PEER_IS_SUCCESS(p->peer) ) continue; ++ ++ if (p->peer->CancelSliceRequest(idx,off,len) < 0) { ++ if(arg_verbose) fprintf(stderr, "close: CancelSlice\n"); ++ p->peer->CloseConnection(); ++ } ++ } ++} ++ + void PeerList::Tell_World_I_Have(size_t idx) + { + PEERNODE *p; +@@ -325,12 +501,18 @@ + + if( !PEER_IS_SUCCESS(p->peer) ) continue; + +- if( p->peer->stream.Send_Have(idx) < 0) ++ // Don't send HAVE to seeders, except for our first piece. ++ if( (!p->peer->bitfield.IsFull() || 1==BTCONTENT.pBF->Count()) && ++ p->peer->stream.Send_Have(idx) < 0) + p->peer->CloseConnection(); + + if( f_seed ){ + if( !p->peer->request_q.IsEmpty() ) p->peer->request_q.Empty(); +- if(p->peer->SetLocal(M_NOT_INTERESTED) < 0) p->peer->CloseConnection(); ++ if(p->peer->SetLocal(M_NOT_INTERESTED) < 0) { ++ if(arg_verbose) ++ fprintf(stderr, "close: Can't set self not interested (T_W_I_H)\n"); ++ p->peer->CloseConnection(); ++ } + } + + } // end for +@@ -350,6 +532,11 @@ + CLOSE_SOCKET(newsk); + return -1; + } ++ ++ if( Tracker.IsPaused() || Tracker.IsQuitting() ){ ++ CLOSE_SOCKET(newsk); ++ return -1; ++ } + + return NewPeer(addr,newsk); + } +@@ -359,18 +546,23 @@ + int r = 0; + struct sockaddr_in lis_addr; + memset(&lis_addr,0, sizeof(sockaddr_in)); ++ lis_addr.sin_family = AF_INET; + lis_addr.sin_addr.s_addr = INADDR_ANY; + + m_listen_sock = socket(AF_INET,SOCK_STREAM,0); + + if( INVALID_SOCKET == m_listen_sock ) return -1; + ++ if ( cfg_listen_ip != 0 ) ++ lis_addr.sin_addr.s_addr = cfg_listen_ip; ++ + if(cfg_listen_port && cfg_listen_port != LISTEN_PORT_MAX){ + lis_addr.sin_port = htons(cfg_listen_port); + if(bind(m_listen_sock,(struct sockaddr*)&lis_addr,sizeof(struct sockaddr_in)) == 0) + r = 1; + else +- fprintf(stderr,"warn,couldn't bind on specified port: %d\n",cfg_listen_port); ++ fprintf(stderr,"warn,couldn't bind on specified port %d: %s\n", ++ cfg_listen_port,strerror(errno)); + } + + if( !r ){ +@@ -380,20 +572,21 @@ + lis_addr.sin_port = htons(cfg_listen_port); + r = bind(m_listen_sock,(struct sockaddr*)&lis_addr,sizeof(struct sockaddr_in)); + if(r != 0){ +- cfg_listen_port--; +- if(cfg_listen_port < cfg_min_listen_port){ +- CLOSE_SOCKET(m_listen_sock); +- fprintf(stderr,"error,couldn't bind port from %d to %d.\n", +- cfg_min_listen_port,cfg_max_listen_port); +- return -1; +- } ++ cfg_listen_port--; ++ if(cfg_listen_port < cfg_min_listen_port){ ++ CLOSE_SOCKET(m_listen_sock); ++ fprintf(stderr,"error,couldn't bind port from %d to %d: %s\n", ++ cfg_min_listen_port,cfg_max_listen_port,strerror(errno)); ++ return -1; ++ } + } + } /* end for(; r != 0;) */ + } + + if(listen(m_listen_sock,5) == -1){ + CLOSE_SOCKET(m_listen_sock); +- fprintf(stderr,"error, couldn't listen on port %d.\n",cfg_listen_port); ++ fprintf(stderr,"error, couldn't listen on port %d: %s\n", ++ cfg_listen_port,strerror(errno)); + return -1; + } + +@@ -402,6 +595,9 @@ + fprintf(stderr,"error, couldn't set socket to nonblock mode.\n"); + return -1; + } ++ ++ printf("Listening on %s:%d\n", inet_ntoa(lis_addr.sin_addr), ++ ntohs(lis_addr.sin_port)); + + return 0; + } +@@ -425,7 +621,7 @@ + PEERNODE *p; + for(p = m_head; p; p = p->next){ + if( !PEER_IS_SUCCESS(p->peer) || p->peer->request_q.IsEmpty()) continue; +- if( idx == p->peer->request_q.GetRequestIdx() ) return 1; ++ if( p->peer->request_q.HasIdx(idx) ) return 1; + } + return 0; + } +@@ -433,9 +629,18 @@ + void PeerList::CheckBitField(BitField &bf) + { + PEERNODE *p; ++ PSLICE ps; ++ size_t idx; + for(p = m_head; p ; p = p->next){ + if( !PEER_IS_SUCCESS(p->peer) || p->peer->request_q.IsEmpty()) continue; +- bf.UnSet(p->peer->request_q.GetRequestIdx()); ++ ps = p->peer->request_q.GetHead(); ++ idx = BTCONTENT.GetNPieces(); ++ for( ; ps; ps = ps->next){ ++ if( ps->index != idx ){ ++ bf.UnSet(ps->index); ++ idx = ps->index; ++ } ++ } + } + } + +@@ -445,8 +650,8 @@ + struct sockaddr_in sin; + printf("\nPEER LIST\n"); + for( ; p ; p = p->next){ +- if(PEER_IS_FAILED(p->peer)) continue; +- p->peer->dump(); ++ if(PEER_IS_FAILED(p->peer)) continue; ++ p->peer->dump(); + } + } + +@@ -470,42 +675,55 @@ + + if( P_CONNECTING == peer->GetStatus()){ + if(FD_ISSET(sk,wfdp)){ +- (*nready)--; +- FD_CLR(sk,wfdp); ++ (*nready)--; ++ FD_CLR(sk,wfdp); + +- if(FD_ISSET(sk,rfdp)){ // connect failed. +- FD_CLR(sk,rfdp); +- peer->CloseConnection(); +- }else{ +- if(peer->Send_ShakeInfo() < 0){ +- peer->CloseConnection(); +- } +- else +- peer->SetStatus(P_HANDSHAKE); +- } ++ if(FD_ISSET(sk,rfdp)){ // connect failed. ++ (*nready)--; ++ FD_CLR(sk,rfdp); ++ peer->CloseConnection(); ++ }else{ ++ if(peer->Send_ShakeInfo() < 0){ ++ if(arg_verbose) fprintf(stderr, "close: Sending handshake\n"); ++ peer->CloseConnection(); ++ } ++ else ++ peer->SetStatus(P_HANDSHAKE); ++ } ++ }else if(FD_ISSET(sk,rfdp)){ ++ (*nready)--; ++ peer->CloseConnection(); + } + }else{ + if(FD_ISSET(sk,rfdp)){ +- p->click++; +- if( !(p->click) ) +- for(p2 = m_head; p2; p2=p2->next) p2->click = 0; +- +- (*nready)--; +- FD_CLR(sk,rfdp); +- if(peer->GetStatus() == P_HANDSHAKE){ +- if( peer->HandShake() < 0 ) peer->CloseConnection(); +- }else{ +- if( peer->RecvModule() < 0 ) peer->CloseConnection(); +- } +- }else if(PEER_IS_SUCCESS(peer) && FD_ISSET(sk,wfdp)){ +- p->click++; +- if( !(p->click) ) +- for(p2 = m_head; p2; p2=p2->next) p2->click = 0; +- +- (*nready)--; +- FD_CLR(sk,wfdp); +- if( peer->SendModule() < 0 ) peer->CloseConnection(); ++ (*nready)--; ++ FD_CLR(sk,rfdp); ++ if(peer->GetStatus() == P_HANDSHAKE){ ++ if( peer->HandShake() < 0 ) { ++ if(arg_verbose) fprintf(stderr, "close: bad handshake\n"); ++ peer->CloseConnection(); ++ } ++ } // fixed client stall ++ if(peer->GetStatus() == P_SUCCESS){ ++ if( peer->RecvModule() < 0 ) { ++ if(arg_verbose) fprintf(stderr, "close: receive\n"); ++ peer->CloseConnection(); ++ } ++ } ++ }else if( peer->HealthCheck(now) < 0 ){ ++ if(arg_verbose) fprintf(stderr, "close: unresponsive\n"); ++ peer->CloseConnection(); + } ++ ++ if( (PEER_IS_SUCCESS(peer) || peer->GetStatus() == P_HANDSHAKE) && ++ FD_ISSET(sk,wfdp) ){ ++ (*nready)--; ++ FD_CLR(sk,wfdp); ++ if( peer->SendModule() < 0 ) { ++ if(arg_verbose) fprintf(stderr, "close: send\n"); ++ peer->CloseConnection(); ++ } ++ }else peer->CheckSendStatus(); + } + }// end for + } +@@ -514,7 +732,10 @@ + { + PEERNODE *p = m_head; + for( ; p; p = p->next) +- if(p->peer->bitfield.IsFull()) p->peer->CloseConnection(); ++ if(p->peer->bitfield.IsFull()) { ++ if(arg_verbose) fprintf(stderr, "close: seed<->seed\n"); ++ p->peer->CloseConnection(); ++ } + } + + void PeerList::UnChokeCheck(btPeer* peer, btPeer *peer_array[]) +@@ -523,51 +744,170 @@ + int cancel_idx = 0; + btPeer *loster = (btPeer*) 0; + int f_seed = BTCONTENT.pBF->IsFull(); +- +- for( cancel_idx = i = 0; i < MAX_UNCHOKE; i++ ){ +- if((btPeer*) 0 == peer_array[i] || PEER_IS_FAILED(peer_array[i]) ){ // пλ ++ int no_opt = 0; ++ unsigned long rndbits; ++ int r=0; ++ ++ if (m_opt_timestamp) no_opt = 1; ++ ++// Find my 3 or 4 fastest peers. ++// The MAX_UNCHOKE+1 (4th) slot is for the optimistic unchoke when it happens. ++ ++ // Find a slot for the candidate--the slowest peer, or an available slot. ++ for( cancel_idx = i = 0; i < MAX_UNCHOKE+no_opt; i++ ){ ++ if((btPeer*) 0 == peer_array[i] || ++ PEER_IS_FAILED(peer_array[i]) ){ // пλ + cancel_idx = i; + break; + }else{ + if(cancel_idx == i) continue; + + if(f_seed){ +- // compare upload rate. +- if(peer_array[cancel_idx]->RateUL() > peer_array[i]->RateUL()) +- cancel_idx = i; ++ // compare upload rate. ++ if(peer_array[cancel_idx]->RateUL() > peer_array[i]->RateUL()) ++ cancel_idx = i; + }else{ +- // compare download rate. +- if(peer_array[cancel_idx]->RateDL() > peer_array[i]->RateDL()) +- cancel_idx = i; ++ // compare download rate. ++ if( peer_array[cancel_idx]->RateDL() > peer_array[i]->RateDL() ++ //if equal, reciprocate to the peer we've sent less to, proportionally ++ ||(peer_array[cancel_idx]->RateDL() == peer_array[i]->RateDL() ++ && peer_array[cancel_idx]->TotalUL() ++ / (peer_array[cancel_idx]->TotalDL()+.001) ++ < peer_array[i]->TotalUL() / (peer_array[i]->TotalDL()+.001)) ) ++ cancel_idx = i; + } + } + } // end for + +- if( (btPeer*) 0 != peer_array[cancel_idx] && PEER_IS_SUCCESS(peer_array[cancel_idx]) ){ ++ if( (btPeer*) 0 != peer_array[cancel_idx] && ++ PEER_IS_SUCCESS(peer_array[cancel_idx]) ){ + if(f_seed){ + if(peer->RateUL() > peer_array[cancel_idx]->RateUL()){ +- loster = peer_array[cancel_idx]; +- peer_array[cancel_idx] = peer; ++ loster = peer_array[cancel_idx]; ++ peer_array[cancel_idx] = peer; + }else +- loster = peer; ++ loster = peer; + }else{ +- if(peer->RateDL() > peer_array[cancel_idx]->RateDL()){ +- loster = peer_array[cancel_idx]; +- peer_array[cancel_idx] = peer; ++ if( peer->RateDL() > peer_array[cancel_idx]->RateDL() ++ // If equal, reciprocate to the peer we've sent less to, proportionally ++ ||(peer_array[cancel_idx]->RateDL() == peer->RateDL() ++ && peer_array[cancel_idx]->TotalUL() ++ / (peer_array[cancel_idx]->TotalDL()+.001) ++ > peer->TotalUL() / (peer->TotalDL()+.001)) ){ ++ loster = peer_array[cancel_idx]; ++ peer_array[cancel_idx] = peer; + }else +- loster = peer; ++ loster = peer; + } + + // opt unchoke +- if((btPeer*) 0 == peer_array[MAX_UNCHOKE] || PEER_IS_FAILED(peer_array[MAX_UNCHOKE]) ) ++ if (no_opt) { ++ if(loster->SetLocal(M_CHOKE) < 0) loster->CloseConnection(); ++ } ++ else ++ // The last slot is for the optimistic unchoke. ++ if( (btPeer*) 0 == peer_array[MAX_UNCHOKE] || ++ PEER_IS_FAILED(peer_array[MAX_UNCHOKE]) ) + peer_array[MAX_UNCHOKE] = loster; +- else{ +- if(loster->GetLastUnchokeTime() < peer_array[MAX_UNCHOKE]->GetLastUnchokeTime()) +- peer_array[MAX_UNCHOKE] = loster; +- else{ +- if(loster->SetLocal(M_CHOKE) < 0) loster->CloseConnection(); ++ else { ++ if( !r-- ){ ++ rndbits = random(); ++ r = 15; ++ } ++ // if loser is empty and current is not, loser gets 75% chance. ++ if( loster->IsEmpty() && !peer_array[MAX_UNCHOKE]->IsEmpty() ++ && (rndbits>>=2)&3 ) { ++ btPeer* tmp = peer_array[MAX_UNCHOKE]; ++ peer_array[MAX_UNCHOKE] = loster; ++ loster = tmp; ++ } else ++ // This mess chooses the loser: ++ // if loser is choked and current is not ++ // OR if both are choked and loser has waited longer ++ // OR if both are unchoked and loser has had less time unchoked. ++ if( (!loster->Is_Local_UnChoked() && ++ ( peer_array[MAX_UNCHOKE]->Is_Local_UnChoked() || ++ loster->GetLastUnchokeTime() < ++ peer_array[MAX_UNCHOKE]->GetLastUnchokeTime() )) || ++ (peer_array[MAX_UNCHOKE]->Is_Local_UnChoked() && ++ peer_array[MAX_UNCHOKE]->GetLastUnchokeTime() < ++ loster->GetLastUnchokeTime()) ){ ++ // if current is empty and loser is not, loser gets 25% chance; ++ // else loser wins. ++ // transformed to: if loser is empty or current isn't, or 25% chance, ++ // then loser wins. ++ if( !peer_array[MAX_UNCHOKE]->IsEmpty() || loster->IsEmpty() ++ || !((rndbits>>=2)&3) ) { ++ btPeer* tmp = peer_array[MAX_UNCHOKE]; ++ peer_array[MAX_UNCHOKE] = loster; ++ loster = tmp; ++ } + } ++ if(loster->SetLocal(M_CHOKE) < 0) loster->CloseConnection(); + } + }else //else if((btPeer*) 0 != peer_array[cancel_idx]..... + peer_array[cancel_idx] = peer; + } ++ ++// When we change what we're going after, we need to evaluate & set our ++// interest with each peer appropriately. ++void PeerList::CheckInterest() ++{ ++ PEERNODE *p = m_head; ++ for( ; p; p = p->next) { ++ // Don't shortcut by checking Is_Local_Interested(), as we need to let ++ // SetLocal() reset the m_standby flag. ++ if( p->peer->Need_Remote_Data() ) { ++ if( p->peer->SetLocal(M_INTERESTED) < 0 ) ++ p->peer->CloseConnection(); ++ } else { ++ if( p->peer->SetLocal(M_NOT_INTERESTED) < 0 ) ++ p->peer->CloseConnection(); ++ } ++ } ++} ++ ++btPeer* PeerList::GetNextPeer(btPeer *peer) ++{ ++ static PEERNODE *p = m_head; ++ ++ if( 0==peer ) p = m_head; ++ else if( p->peer == peer ){ ++ p = p->next; ++ }else{ ++ for( p=m_head; p && (p->peer != peer); p = p->next); ++ if( 0 == p->peer ){ ++ p = m_head; ++ }else{ ++ p = p->next; ++ } ++ } ++ for( ; p; p = p->next) ++ if( p->peer && PEER_IS_SUCCESS(p->peer) ) break; ++ ++ if(p) return p->peer; ++ else return (btPeer*) 0; ++} ++ ++// This is used to un-standby peers when we enter endgame mode. ++// It re-evaluates at most once per second for CPU efficiency, so isn't used ++// when greatest accuracy is desired. ++int PeerList::Endgame() ++{ ++ static time_t timestamp = 0; ++ static int endgame = 0; ++ ++ if( now > timestamp ){ ++ timestamp = now; ++ if( arg_file_to_download ){ ++ BitField afdBitField = *BTCONTENT.pBF; ++ afdBitField.Except(*BTCONTENT.pBFilter); ++ endgame = ( BTCONTENT.getFilePieces(arg_file_to_download) ++ - afdBitField.Count() ) < WORLD.TotalPeers(); ++ }else ++ endgame = ( WORLD.Pieces_I_Can_Get() - BTCONTENT.pBF->Count() ) ++ < WORLD.TotalPeers(); ++ } ++ return endgame; ++} ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/peerlist.h ctorrent-1.3.4/peerlist.h +--- ctorrent-1.3.4.sav/peerlist.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/peerlist.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,14 +1,13 @@ + #ifndef PEERLIST_H + #define PEERLIST_H + +-#include + #include "./def.h" ++#include + #include "./peer.h" + #include "./rate.h" + + typedef struct _peernode{ + btPeer *peer; +- size_t click; + struct _peernode *next; + }PEERNODE; + +@@ -18,7 +17,8 @@ + SOCKET m_listen_sock; + PEERNODE *m_head; + size_t m_peers_count; +- time_t m_unchoke_check_timestamp, m_keepalive_check_timestamp, m_last_progress_timestamp; ++ size_t m_seeds_count; ++ time_t m_unchoke_check_timestamp, m_keepalive_check_timestamp, m_last_progress_timestamp, m_opt_timestamp; + + unsigned char m_live_idx:2; + unsigned char m_reserved:6; +@@ -26,7 +26,6 @@ + Rate m_pre_dlrate, m_pre_ulrate; + + int Accepter(); +- void Sort(); + void UnChokeCheck(btPeer* peer,btPeer *peer_array[]); + + public: +@@ -50,9 +49,16 @@ + + void Tell_World_I_Have(size_t idx); + btPeer* Who_Can_Abandon(btPeer *proposer); ++ size_t What_Can_Duplicate(BitField &bf, btPeer *proposer, size_t idx); ++ void FindValuedPieces(BitField &bf, btPeer *proposer, int initial); ++ btPeer *WhoHas(size_t idx); ++ void CancelSlice(size_t idx, size_t off, size_t len); + void CheckBitField(BitField &bf); + int AlreadyRequested(size_t idx); + size_t Pieces_I_Can_Get(); ++ void CheckInterest(); ++ btPeer* GetNextPeer(btPeer *peer); ++ int Endgame(); + }; + + extern PeerList WORLD; +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/rate.cpp ctorrent-1.3.4/rate.cpp +--- ctorrent-1.3.4.sav/rate.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/rate.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -1,14 +1,17 @@ + #include "rate.h" ++#include "bttime.h" ++ ++#define RATE_INTERVAL 20 + + void Rate::StartTimer() + { +- if( !m_last_timestamp ) time(&m_last_timestamp); ++ if( !m_last_timestamp ) m_last_timestamp = now; + } + + void Rate::StopTimer() + { +- if( !m_last_timestamp ){ +- m_total_timeused += (time((time_t*) 0) - m_last_timestamp); ++ if( m_last_timestamp ){ ++ m_total_timeused += (now - m_last_timestamp); + m_last_timestamp = 0; + } + } +@@ -16,27 +19,61 @@ + void Rate::CountAdd(size_t nbytes) + { + m_count_bytes += nbytes; ++ ++ // save bandwidth history data ++ for (int i=0; i <= n_samples; i++) ++ { ++ if (i < MAX_SAMPLES) ++ { ++ if (now == m_timestamp_sample[i]) { ++ m_bytes_sample[i] += nbytes; ++ break; ++ } ++ else if (now - RATE_INTERVAL > m_timestamp_sample[i]) { ++ m_timestamp_sample[i] = now; ++ m_bytes_sample[i] = nbytes; ++ if (n_samples < MAX_SAMPLES) n_samples++; ++ break; ++ } ++ } ++ } + } + + void Rate::operator=(const Rate &ra) + { +- m_last_timestamp = time((time_t*) 0); ++ m_last_timestamp = now; + m_count_bytes = ra.m_count_bytes; + } + + size_t Rate::RateMeasure() const + { +- time_t timeused = m_total_timeused; +- if( m_last_timestamp ) timeused += (time((time_t*) 0) - m_last_timestamp); ++ // calculate rate based on bandwidth history data ++ time_t timestamp = now; ++ u_int64_t countbytes = 0; ++ time_t timeused = 0; ++ ++ if( !m_last_timestamp ) return 0; // no current rate ++ ++ timeused = (TimeUsed(×tamp) < RATE_INTERVAL) ? ++ TimeUsed(×tamp) : RATE_INTERVAL; + if( timeused < 1 ) timeused = 1; +- return (size_t)(m_count_bytes / timeused); ++ ++ for (int i=0; i0) ? (tmp/timeused) : 0 ); + } + + time_t Rate::TimeUsed(const time_t *pnow) const +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/rate.h ctorrent-1.3.4/rate.h +--- ctorrent-1.3.4.sav/rate.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/rate.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,18 +1,33 @@ + #ifndef RATE_H + #define RATE_H + ++#include "def.h" + #include + #include +-#include "def.h" ++ ++#define MAX_SAMPLES 20 + + class Rate{ + private: + time_t m_last_timestamp; + time_t m_total_timeused; + u_int64_t m_count_bytes; ++ u_int64_t m_recent_base; ++ ++ // bandwidth history data ++ size_t n_samples; ++ time_t m_timestamp_sample[MAX_SAMPLES]; ++ u_int64_t m_bytes_sample[MAX_SAMPLES]; ++ + public: +- Rate(){ m_last_timestamp = m_total_timeused = (time_t)0; m_count_bytes = 0; } +- void Reset(){ m_last_timestamp = m_total_timeused = (time_t)0; m_count_bytes = 0;} ++ Rate(){ m_last_timestamp = m_total_timeused = (time_t)0; ++ m_recent_base = m_count_bytes = 0; ++ n_samples=0; for(int i=0;i2GB) and large torrents (>255 files) ++ * Strategic selection of pieces to request for download ++ * Continuous queueing of download requests, tuned based on latency ++ and throughput for each peer ++ * Improved download performance, including parallel requests in ++ initial and endgame modes ++ * Improved bandwidth regulation ++ * Improved compatibility with other peers ++ * Performance optimization and bug fixes ++ * An interface for monitoring and managing multiple clients ++ ++ Status Line ++ ++ The status line that is output by the client has changed since the ++ original and deserves some explanation. ++ ++ / 0/33/110 [672/672/672] 0MB,1130MB | 0,20K/s | 0,0K E:0,31 ++ - - -- --- --- --- --- --- ------ - -- - - - -- ++ A B C D E F G H I J K L M N O ++ ++ A: Ticker; this character changes to indicate that the client is ++ running. ++ B: Number of seeders (complete peers) to which you are connected. ++ C: Number of leechers (incomplete peers) to which you are connected. ++ D: Total number of peers in the swarm, as last reported by the ++ tracker. ++ E: Number of pieces of the torrent that you have completed. ++ F: Number of pieces currently available from you and your connected ++ peers. ++ G: Total number of pieces in the torrent. ++ H: Total amount of data you have downloaded. ++ I: Total amount of data you have uploaded. ++ J: Your current total download rate. ++ K: Your current total upload rate. ++ L: Amount of data downloaded since the last status line update. ++ M: Amount of data uploaded since the last status line update. ++ N: Number of tracker connection errors. ++ O: Number of successful tracker connections. ++ ++ Peer ID ++ ++ Beginning with dnh1.1 the default peer ID has been changed for ++ convenience, as some other clients and trackers assume that Ctorrent ++ is "buggy" and won't cooperate with it. [Guess what, there are plenty ++ of others with bugs too.] The -P option is still available if you wish ++ to use a different peer ID, but it is no longer necessary to do so in ++ order to avoid this "ban". ++ ++ The new default peer ID prefix is "-CDversion-", where version is an ++ indication of the version number (0101 for dnh1.1). ++ ++ CTCS ++ ++ [11]CTorrent Control Server (CTCS) is an interface for monitoring and ++ managing Enhanced CTorrent clients. It can manage allocation of ++ bandwidth, provide status information, and allow changes to the ++ running configuration of each client. Support for this interface was ++ added in the dnh2 release. ++ _________________________________________________________________ ++ ++ News ++ ++ 2006-01-15 ++ Version dnh2 is released! This version includes a number of ++ significant [12]changes, including large file support, piece ++ selection, tuned request queue depth, and support for ++ [13]CTorrent Control Server. ++ _________________________________________________________________ ++ ++ Changes ++ ++ For a list of changes in the current and previous versions, see the ++ [14]ChangeLog file. ++ _________________________________________________________________ ++ ++ Download ++ ++ Release dnh2 ++ The patch files for this version are significantly larger ++ than in previous releases. It will be faster and easier to just ++ download the patched source distribution below. ++ ++ [15]dnh1.2 to dnh2 patch file ++ A patch file of changes to release dnh1.2 to bring it up to dnh2. ++ ++ [16]Patch file ++ A patch file of changes to the CTorrent 1.3.4 base. ++ ++ [17]Patched source ++ A complete source distribution for all platforms. ++ ___________________________________ ++ ++ Release dnh1.2 ++ Note: If you get a message about needing to install OpenSSL, you might ++ want to try the FreeBSD patch/version even if you are not using ++ FreeBSD. ++ ++ [18]dnh1.1 to dnh1.2 patch file ++ A patch file of changes to release dnh1.1 to bring it up to dnh1.2. ++ ++ [19]FreeBSD patch file ++ A patch file of changes to the CTorrent 1.3.4 base, including the ++ patches from the FreeBSD ports tree. ++ ++ [20]Patch file ++ A patch file of changes to the CTorrent 1.3.4 base. ++ ++ [21]FreeBSD patched source ++ This includes the patches from the FreeBSD ports tree. ++ ++ [22]Linux/Windows/Other patched source ++ Please [23]let me know if you encounter any portability issues, as I ++ don't have a test environment set up for these platforms. ++ ___________________________________ ++ ++ Bitfield::Invert patch ++ ++ [24]Bitfield::Invert patch ++ See notes in the change log; this is needed if you are using dnh1.1, ++ dnh1, or ctorrent-1.3.4. ++ ___________________________________ ++ ++ Release dnh1.1 ++ ++ [25]dnh1 to dnh1.1 patch file ++ A patch file of changes to release dnh1 to bring it up to dnh1.1. ++ ___________________________________ ++ ++ Release dnh1 ++ ++ [26]FreeBSD patch file ++ A patch file of changes to the CTorrent 1.3.4 base, including the ++ patches from the FreeBSD ports tree. ++ Note: Thanks to Florent Thoumie, as of 29 Jul 2005 this patchset is ++ included in the FreeBSD port. If you update your ports tree (or at ++ least net/ctorrent) and install from there, you will have these ++ updates without downloading the file and patching manually. ++ ++ [27]Patch file ++ A patch file of changes to the CTorrent 1.3.4 base. ++ ++ [28]FreeBSD patched source ++ This includes the patches from the FreeBSD ports tree. ++ ++ [29]Linux/Windows/Other patched source ++ Please [30]let me know if you encounter any portability issues, as I ++ don't have a test environment set up for these platforms. ++ _________________________________________________________________ ++ ++ Resources ++ ++ [31]CTorrent Home Page ++ Outdated, but you may find some useful info (particularly the FAQ). ++ ++ [32]CTorrent SourceForge Project ++ Hosts the CTorrent codebase, bug reports, patches, and forum. ++ ++ [33]Custom CTorrent ++ A page by the author of the "get1file" patch and other fixes. It ++ contains a custom version and a GUI for CTorrent. ++ ++ [34]BitTorrent ++ The official BitTorrent home page. ++ ++ [35]BitTorrent wiki ++ Various documentation. ++ ++ [36]BitTorrent protocol specification (official version) ++ ++ [37]BitTorrent protocol specification (wiki version) ++ ++References ++ ++ 1. http://www.rahul.net/dholmes/ctorrent/index.html#info ++ 2. http://www.rahul.net/dholmes/ctorrent/index.html#news ++ 3. http://www.rahul.net/dholmes/ctorrent/changelog.html ++ 4. http://www.rahul.net/dholmes/ctorrent/ctcs.html ++ 5. http://www.rahul.net/dholmes/ctorrent/index.html#download ++ 6. http://www.rahul.net/dholmes/ctorrent/index.html#resources ++ 7. mailto:dholmes@ct.boxmail.com ++ 8. http://ctorrent.sourceforge.net/ ++ 9. http://www.bittorrent.com/ ++ 10. http://sourceforge.net/projects/ctorrent/ ++ 11. http://www.rahul.net/dholmes/ctorrent/ctcs.html ++ 12. http://www.rahul.net/dholmes/ctorrent/changelog.html ++ 13. http://www.rahul.net/dholmes/ctorrent/ctcs.html ++ 14. http://www.rahul.net/dholmes/ctorrent/changelog.html ++ 15. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-dnh1.2-dnh2.diff ++ 16. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-1.3.4-dnh2.diff ++ 17. http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh2.tar.gz ++ 18. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-dnh1.1-dnh1.2.diff ++ 19. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-1.3.4-dnh1.2-fbsd.diff ++ 20. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-1.3.4-dnh1.2.diff ++ 21. http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh1.2-fbsd.tar.gz ++ 22. http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh1.2.tar.gz ++ 23. mailto:dholmes@ct.boxmail.com ++ 24. http://www.rahul.net/dholmes/ctorrent/patch-invert.diff ++ 25. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-dnh1-dnh1.1.diff ++ 26. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-1.3.4-dnh1-fbsd.diff ++ 27. http://www.rahul.net/dholmes/ctorrent/patchset-ctorrent-1.3.4-dnh1.diff ++ 28. http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh1-fbsd.tar.gz ++ 29. http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh1.tar.gz ++ 30. mailto:dholmes@ct.boxmail.com ++ 31. http://ctorrent.sourceforge.net/ ++ 32. http://sourceforge.net/projects/ctorrent/ ++ 33. http://customctorrent.ifreepages.com/ ++ 34. http://bittorrent.com/ ++ 35. http://wiki.theory.org/CategoryBitTorrent ++ 36. http://www.bittorrent.com/protocol.html ++ 37. http://wiki.theory.org/BitTorrentSpecification +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/sha1.c ctorrent-1.3.4/sha1.c +--- ctorrent-1.3.4.sav/sha1.c 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/sha1.c 2006-06-28 19:30:02.000000000 +0200 +@@ -0,0 +1,146 @@ ++#include ++ ++#include "sha1.h" ++ ++#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) ++ ++/* blk0() and blk() perform the initial expand. */ ++/* I got the idea of expanding during the round function from SSLeay */ ++#if (defined(BYTE_ORDER) && BYTE_ORDER==LITTLE_ENDIAN) || (!defined(BYTE_ORDER) && defined(LITTLE_ENDIAN)) ++#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ ++ |(rol(block->l[i],8)&0x00FF00FF)) ++#else ++#define blk0(i) block->l[i] ++#endif ++#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ++ ^block->l[(i+2)&15]^block->l[i&15],1)) ++ ++/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ ++#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); ++#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); ++#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); ++#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); ++#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); ++ ++ ++/* Hash a single 512-bit block. This is the core of the algorithm. */ ++ ++void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) ++{ ++unsigned long a, b, c, d, e; ++typedef union { ++ unsigned char c[64]; ++ unsigned long l[16]; ++} CHAR64LONG16; ++CHAR64LONG16* block; ++#ifdef SHA1HANDSOFF ++static unsigned char workspace[64]; ++ block = (CHAR64LONG16*)workspace; ++ memcpy(block, buffer, 64); ++#else ++ block = (CHAR64LONG16*)buffer; ++#endif ++ /* Copy context->state[] to working vars */ ++ a = state[0]; ++ b = state[1]; ++ c = state[2]; ++ d = state[3]; ++ e = state[4]; ++ /* 4 rounds of 20 operations each. Loop unrolled. */ ++ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); ++ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); ++ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); ++ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); ++ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); ++ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); ++ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); ++ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); ++ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); ++ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); ++ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); ++ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); ++ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); ++ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); ++ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); ++ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); ++ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); ++ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); ++ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); ++ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); ++ /* Add the working vars back into context.state[] */ ++ state[0] += a; ++ state[1] += b; ++ state[2] += c; ++ state[3] += d; ++ state[4] += e; ++ /* Wipe variables */ ++ a = b = c = d = e = 0; ++} ++ ++ ++/* SHA1Init - Initialize new context */ ++ ++void SHA1Init(SHA1_CTX* context) ++{ ++ /* SHA1 initialization constants */ ++ context->state[0] = 0x67452301; ++ context->state[1] = 0xEFCDAB89; ++ context->state[2] = 0x98BADCFE; ++ context->state[3] = 0x10325476; ++ context->state[4] = 0xC3D2E1F0; ++ context->count[0] = context->count[1] = 0; ++} ++ ++ ++/* Run your data through this. */ ++ ++void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) ++{ ++unsigned int i, j; ++ ++ j = (context->count[0] >> 3) & 63; ++ if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; ++ context->count[1] += (len >> 29); ++ if ((j + len) > 63) { ++ memcpy(&context->buffer[j], data, (i = 64-j)); ++ SHA1Transform(context->state, context->buffer); ++ for ( ; i + 63 < len; i += 64) { ++ SHA1Transform(context->state, &data[i]); ++ } ++ j = 0; ++ } ++ else i = 0; ++ memcpy(&context->buffer[j], &data[i], len - i); ++} ++ ++ ++/* Add padding and return the message digest. */ ++ ++void SHA1Final(unsigned char digest[20], SHA1_CTX* context) ++{ ++unsigned long i, j; ++unsigned char finalcount[8]; ++ ++ for (i = 0; i < 8; i++) { ++ finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] ++ >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ ++ } ++ SHA1Update(context, (unsigned char *)"\200", 1); ++ while ((context->count[0] & 504) != 448) { ++ SHA1Update(context, (unsigned char *)"\0", 1); ++ } ++ SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ ++ for (i = 0; i < 20; i++) { ++ digest[i] = (unsigned char) ++ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); ++ } ++ /* Wipe variables */ ++ i = j = 0; ++ memset(context->buffer, 0, 64); ++ memset(context->state, 0, 20); ++ memset(context->count, 0, 8); ++ memset(&finalcount, 0, 8); ++#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ ++ SHA1Transform(context->state, context->buffer); ++#endif ++} +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/sha1.h ctorrent-1.3.4/sha1.h +--- ctorrent-1.3.4.sav/sha1.h 1970-01-01 01:00:00.000000000 +0100 ++++ ctorrent-1.3.4/sha1.h 2006-06-28 19:30:02.000000000 +0200 +@@ -0,0 +1,43 @@ ++#ifndef SHA1_H ++#define SHA1_H ++ ++/* ++SHA-1 in C ++By Steve Reid ++100% Public Domain ++ ++Test Vectors (from FIPS PUB 180-1) ++"abc" ++ A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D ++"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" ++ 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 ++A million repetitions of "a" ++ 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F ++*/ ++ ++#include ++ ++/* #define LITTLE_ENDIAN * This should be #define'd if true. */ ++/* #define SHA1HANDSOFF * Copies data before messing with it. */ ++#define SHA1HANDSOFF ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef struct { ++ unsigned long state[5]; ++ unsigned long count[2]; ++ unsigned char buffer[64]; ++} SHA1_CTX; ++ ++void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); ++void SHA1Init(SHA1_CTX* context); ++void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); ++void SHA1Final(unsigned char digest[20], SHA1_CTX* context); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/sigint.cpp ctorrent-1.3.4/sigint.cpp +--- ctorrent-1.3.4.sav/sigint.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/sigint.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -4,17 +4,28 @@ + #include + + #include "btcontent.h" ++#include "tracker.h" + #include "peerlist.h" + #include "btconfig.h" ++#include "sigint.h" + +-void sigint_catch(int sig_no) ++void sig_catch(int sig_no) + { +- if(SIGINT == sig_no){ ++ if(SIGINT == sig_no || SIGTERM == sig_no){ ++ if( Tracker.IsPaused() ) Tracker.ClearPause(); ++ Tracker.SetStoped(); ++ signal(sig_no,sig_catch2); ++ } ++} ++ ++static void sig_catch2(int sig_no) ++{ ++ if(SIGINT == sig_no || SIGTERM == sig_no){ + if( cfg_cache_size ) BTCONTENT.FlushCache(); + if( arg_bitfield_file ) BTCONTENT.pBF->WriteToFile(arg_bitfield_file); + WORLD.CloseAll(); +- signal(SIGINT,SIG_DFL); +- raise(SIGINT); ++ signal(sig_no,SIG_DFL); ++ raise(sig_no); + } + } + +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/sigint.h ctorrent-1.3.4/sigint.h +--- ctorrent-1.3.4.sav/sigint.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/sigint.h 2006-06-28 19:30:02.000000000 +0200 +@@ -2,7 +2,8 @@ + #define SIGINT_H + + #ifndef WINDOWS +-void sigint_catch(int sig_no); ++void sig_catch(int sig_no); ++static void sig_catch2(int sig_no); + #endif + + #endif +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/tracker.cpp ctorrent-1.3.4/tracker.cpp +--- ctorrent-1.3.4.sav/tracker.cpp 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/tracker.cpp 2006-06-28 19:30:02.000000000 +0200 +@@ -20,6 +20,7 @@ + #include "iplist.h" + + #include "btconfig.h" ++#include "ctcs.h" + + btTracker Tracker; + +@@ -27,15 +28,19 @@ + { + memset(m_host,0,MAXHOSTNAMELEN); + memset(m_path,0,MAXPATHLEN); ++ memset(m_trackerid,0,PEER_ID_LEN+1); + + m_sock = INVALID_SOCKET; + m_port = 80; + m_status = T_FREE; +- m_f_started = m_f_stoped = m_f_pause = 0; ++ m_f_started = m_f_stoped = m_f_pause = m_f_completed = 0; ++ m_f_softquit = m_f_restart = 0; ++ + m_interval = 15; + + m_connect_refuse_click = 0; + m_last_timestamp = (time_t) 0; ++ m_prevpeers = 0; + } + + btTracker::~btTracker() +@@ -54,7 +59,11 @@ + + m_reponse_buffer.Reset(); + time(&m_last_timestamp); +- m_status = T_FREE; ++ if (m_f_stoped){ ++ m_status = T_FINISHED; ++ if( m_f_restart ) Resume(); ++ } ++ else m_status = T_FREE; + } + + int btTracker:: _IPsin(char *h, int p, struct sockaddr_in *psin) +@@ -74,8 +83,8 @@ + if(psin->sin_addr.s_addr == INADDR_NONE){ + struct hostent *ph = gethostbyname(h); + if( !ph || ph->h_addrtype != AF_INET){ +- memset(psin,0,sizeof(struct sockaddr_in)); +- return -1; ++ memset(psin,0,sizeof(struct sockaddr_in)); ++ return -1; + } + memcpy(&psin->sin_addr,ph->h_addr_list[0],sizeof(struct in_addr)); + } +@@ -93,7 +102,7 @@ + + struct sockaddr_in addr; + +- if( decode_query(buf,bufsiz,"failure reason",&ps,&i,QUERY_STR) ){ ++ if( decode_query(buf,bufsiz,"failure reason",&ps,&i,(int64_t*) 0,QUERY_STR) ){ + char failreason[1024]; + if( i < 1024 ){ + memcpy(failreason, ps, i); +@@ -104,14 +113,55 @@ + strcat(failreason,"..."); + } + fprintf(stderr,"TRACKER FAILURE REASON: %s\n",failreason); ++ if(arg_ctcs){ ++ char ctcsinfo[1048]; ++ snprintf(ctcsinfo,1048,"TRACKER FAILURE REASON: %s",failreason); ++ CTCS.Send_Info(ctcsinfo); ++ } + return -1; + } ++ if( decode_query(buf,bufsiz,"warning message",&ps,&i,(int64_t*) 0,QUERY_STR) ){ ++ char warnmsg[1024]; ++ if( i < 1024 ){ ++ memcpy(warnmsg, ps, i); ++ warnmsg[i] = '\0'; ++ }else{ ++ memcpy(warnmsg, ps, 1000); ++ warnmsg[1000] = '\0'; ++ strcat(warnmsg,"..."); ++ } ++ fprintf(stderr,"TRACKER WARNING: %s\n",warnmsg); ++ if(arg_ctcs){ ++ char ctcsinfo[1048]; ++ snprintf(ctcsinfo,1048,"TRACKER WARNING: %s",warnmsg); ++ CTCS.Send_Info(ctcsinfo); ++ } ++ } + +- if(!decode_query(buf,bufsiz,"interval",(const char**) 0,&i,QUERY_INT)){return -1;} ++ m_peers_count = 0; ++ ++ if( decode_query(buf,bufsiz,"tracker id",&ps,&i,(int64_t*) 0,QUERY_STR) ){ ++ if( i <= PEER_ID_LEN ){ ++ memcpy(m_trackerid, ps, i); ++ m_trackerid[i] = '\0'; ++ }else{ ++ memcpy(m_trackerid, ps, PEER_ID_LEN); ++ m_trackerid[PEER_ID_LEN] = '\0'; ++ } ++ } ++ ++ if(!decode_query(buf,bufsiz,"interval",(const char**) 0,&i,(int64_t*) 0,QUERY_INT)){return -1;} + + if(m_interval != (time_t)i) m_interval = (time_t)i; + +- pos = decode_query(buf,bufsiz,"peers",(const char**) 0,(size_t *) 0,QUERY_POS); ++ if(decode_query(buf,bufsiz,"complete",(const char**) 0,&i,(int64_t*) 0,QUERY_INT)) { ++ m_peers_count += i; ++ } ++ if(decode_query(buf,bufsiz,"incomplete",(const char**) 0,&i,(int64_t*) 0,QUERY_INT)) { ++ m_peers_count += i; ++ } ++ ++ pos = decode_query(buf,bufsiz,"peers",(const char**) 0,(size_t *) 0,(int64_t*) 0,QUERY_POS); + + if( !pos ){ + return -1; +@@ -123,32 +173,32 @@ + + ps = buf-1; + if (*ps != 'l') { // binary peers section if not 'l' +- addr.sin_family = AF_INET; +- i = 0; +- while (*ps != ':' ) i = i * 10 + (*ps++ - '0'); +- i /= 6; +- ps++; +- while (i-- > 0) { +- // if peer is not us +- if(memcmp(&Self.m_sin.sin_addr,ps,sizeof(struct in_addr))) { +- memcpy(&addr.sin_addr,ps,sizeof(struct in_addr)); +- memcpy(&addr.sin_port,ps+sizeof(struct in_addr),sizeof(unsigned short)); +- cnt++; +- IPQUEUE.Add(&addr); +- } +- ps += 6; +- } ++ addr.sin_family = AF_INET; ++ i = 0; ++ while (*ps != ':' ) i = i * 10 + (*ps++ - '0'); ++ i /= 6; ++ ps++; ++ while (i-- > 0) { ++ // if peer is not us ++ if(memcmp(&Self.m_sin.sin_addr,ps,sizeof(struct in_addr))) { ++ memcpy(&addr.sin_addr,ps,sizeof(struct in_addr)); ++ memcpy(&addr.sin_port,ps+sizeof(struct in_addr),sizeof(unsigned short)); ++ cnt++; ++ IPQUEUE.Add(&addr); ++ } ++ ps += 6; ++ } + } + else + for( ;bufsiz && *buf!='e'; buf += pos, bufsiz -= pos ){ + pos = decode_dict(buf,bufsiz,(char*) 0); + if(!pos) break; +- if(!decode_query(buf,pos,"ip",&ps,&i,QUERY_STR) || MAXHOSTNAMELEN < i) continue; ++ if(!decode_query(buf,pos,"ip",&ps,&i,(int64_t*) 0,QUERY_STR) || MAXHOSTNAMELEN < i) continue; + memcpy(tmphost,ps,i); tmphost[i] = '\0'; + +- if(!decode_query(buf,pos,"port",(const char**) 0,&tmpport,QUERY_INT)) continue; ++ if(!decode_query(buf,pos,"port",(const char**) 0,&tmpport,(int64_t*) 0,QUERY_INT)) continue; + +- if(!decode_query(buf,pos,"peer id",&ps,&i,QUERY_STR) && i != 20 ) continue; ++ if(!decode_query(buf,pos,"peer id",&ps,&i,(int64_t*) 0,QUERY_STR) && i != 20 ) continue; + + if(_IPsin(tmphost,tmpport,&addr) < 0){ + fprintf(stderr,"warn, detected invalid ip address %s.\n",tmphost); +@@ -161,14 +211,17 @@ + } + } + +- if( !cnt ) fprintf(stderr,"warn, peers list received from tracker is empty.\n"); ++ if(arg_verbose) ++ fprintf(stderr, "\nnew peers=%u; next check in %u sec\n", cnt, m_interval); ++// moved to CheckResponse--this function isn't called if no peer data. ++// if( !cnt ) fprintf(stderr,"warn, peers list received from tracker is empty.\n"); + return 0; + } + + int btTracker::CheckReponse() + { + #define MAX_LINE_SIZ 32 +- char *pdata; ++ char *pdata, *format; + ssize_t r; + size_t q, hlen, dlen; + +@@ -186,6 +239,12 @@ + if(getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n) < 0 || + error != 0 ){ + fprintf(stderr,"warn, received nothing from tracker! %s\n",strerror(error)); ++ if(arg_ctcs){ ++ char ctcsinfo[256]; ++ snprintf(ctcsinfo,256, ++ "warn, received nothing from tracker! %s",strerror(error)); ++ CTCS.Send_Info(ctcsinfo); ++ } + } + return -1; + } +@@ -194,6 +253,8 @@ + + if( !hlen ){ + fprintf(stderr,"warn, tracker reponse invalid. No html header found.\n"); ++ if(arg_ctcs) ++ CTCS.Send_Info("warn, tracker reponse invalid. No html header found."); + return -1; + } + +@@ -202,21 +263,32 @@ + if( r == 301 || r == 302 ){ + char redirect[MAXPATHLEN],ih_buf[20 * 3 + 1],pi_buf[20 * 3 + 1],tmppath[MAXPATHLEN]; + if( Http_get_header(m_reponse_buffer.BasePointer(), hlen, "Location", redirect) < 0 ) +- return -1; ++ return -1; + + if( Http_url_analyse(redirect,m_host,&m_port,m_path) < 0){ +- fprintf(stderr,"warn, tracker redirect to an invalid url %s!\n", redirect); +- return -1; ++ fprintf(stderr,"warn, tracker redirect to an invalid url %s!\n", redirect); ++ if(arg_ctcs){ ++ char ctcsinfo[256]; ++ snprintf(ctcsinfo,256, ++ "warn, tracker redirect to an invalid url %s!", redirect); ++ CTCS.Send_Info(ctcsinfo); ++ } ++ return -1; + } + + strcpy(tmppath,m_path); ++ ++ if(strchr(m_path, '?')) ++ format=REQ_URL_P1A_FMT; ++ else format=REQ_URL_P1_FMT; + +- if(MAXPATHLEN < snprintf(m_path,MAXPATHLEN,REQ_URL_P1_FMT, +- tmppath, +- Http_url_encode(ih_buf, (char*)BTCONTENT.GetInfoHash(), 20), +- Http_url_encode(pi_buf, (char*)BTCONTENT.GetPeerId(), 20), +- cfg_listen_port)){ +- return -1; ++ if(MAXPATHLEN < snprintf(m_path,MAXPATHLEN,format, ++ tmppath, ++ Http_url_encode(ih_buf, (char*)BTCONTENT.GetInfoHash(), 20), ++ Http_url_encode(pi_buf, (char*)BTCONTENT.GetPeerId(), 20), ++ cfg_listen_port, ++ m_key)){ ++ return -1; + } + + return Connect(); +@@ -230,10 +302,14 @@ + return 0; + } + +- if ( !pdata ) return 0; ++ if ( !pdata ){ ++ fprintf(stderr,"warn, peers list received from tracker is empty.\n"); ++ return 0; ++ } + + if( !m_f_started ) m_f_started = 1; + m_connect_refuse_click = 0; ++ m_ok_click++; + + return _UpdatePeerList(pdata,dlen); + } +@@ -241,6 +317,7 @@ + int btTracker::Initial() + { + char ih_buf[20 * 3 + 1],pi_buf[20 * 3 + 1],tmppath[MAXPATHLEN]; ++ char *format; + + if(Http_url_analyse(BTCONTENT.GetAnnounce(),m_host,&m_port,m_path) < 0){ + fprintf(stderr,"error, invalid tracker url format!\n"); +@@ -249,40 +326,50 @@ + + strcpy(tmppath,m_path); + +- if(MAXPATHLEN < snprintf((char*)m_path,MAXPATHLEN,REQ_URL_P1_FMT, +- tmppath, +- Http_url_encode(ih_buf,(char*)BTCONTENT.GetInfoHash(),20), +- Http_url_encode(pi_buf,(char*)BTCONTENT.GetPeerId(),20), +- cfg_listen_port)){ ++ if(strchr(m_path, '?')) ++ format=REQ_URL_P1A_FMT; ++ else format=REQ_URL_P1_FMT; ++ ++ char chars[37] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ++ for(int i=0; i<8; i++) ++ m_key[i] = chars[random()%36]; ++ m_key[8] = 0; ++ ++ if(MAXPATHLEN < snprintf((char*)m_path,MAXPATHLEN,format, ++ tmppath, ++ Http_url_encode(ih_buf,(char*)BTCONTENT.GetInfoHash(),20), ++ Http_url_encode(pi_buf,(char*)BTCONTENT.GetPeerId(),20), ++ cfg_listen_port, ++ m_key)){ + return -1; + } +- ++ + /* get local ip address */ + // 1st: if behind firewall, this only gets local side + { + struct sockaddr_in addr; + socklen_t addrlen = sizeof(struct sockaddr_in); + if(getsockname(m_sock,(struct sockaddr*)&addr,&addrlen) == 0) +- Self.SetIp(addr); ++ Self.SetIp(addr); + } + // 2nd: better to use addr of our domain + { +- struct hostent *h; +- char hostname[128]; +- char *hostdots[2]={0,0}, *hdptr=hostname; +- +- if (gethostname(hostname, 128) == -1) return -1; +-// printf("%s\n", hostname); +- while(*hdptr) if(*hdptr++ == '.') { +- hostdots[0] = hostdots[1]; +- hostdots[1] = hdptr; +- } +- if (hostdots[0] == 0) return -1; +-// printf("%s\n", hostdots[0]); +- if ((h = gethostbyname(hostdots[0])) == NULL) return -1; +- //printf("Host domain : %s\n", h->h_name); +- //printf("IP Address : %s\n", inet_ntoa(*((struct in_addr *)h->h_addr))); +- memcpy(&Self.m_sin.sin_addr,h->h_addr,sizeof(struct in_addr)); ++ struct hostent *h; ++ char hostname[128]; ++ char *hostdots[2]={0,0}, *hdptr=hostname; ++ ++ if (gethostname(hostname, 128) == -1) return -1; ++// printf("%s\n", hostname); ++ while(*hdptr) if(*hdptr++ == '.') { ++ hostdots[0] = hostdots[1]; ++ hostdots[1] = hdptr; ++ } ++ if (hostdots[0] == 0) return -1; ++// printf("%s\n", hostdots[0]); ++ if ((h = gethostbyname(hostdots[0])) == NULL) return -1; ++ //printf("Host domain : %s\n", h->h_name); ++ //printf("IP Address : %s\n", inet_ntoa(*((struct in_addr *)h->h_addr))); ++ memcpy(&Self.m_sin.sin_addr,h->h_addr,sizeof(struct in_addr)); + } + return 0; + } +@@ -294,12 +381,33 @@ + + if(_s2sin(m_host,m_port,&m_sin) < 0) { + fprintf(stderr,"warn, get tracker's ip address failed."); ++ if(arg_ctcs) CTCS.Send_Info("warn, get tracker's ip address failed."); + return -1; + } + + m_sock = socket(AF_INET,SOCK_STREAM,0); + if(INVALID_SOCKET == m_sock) return -1; + ++ // we only need to bind if we have specified an ip ++ // we need it to bind here before the connect!!!! ++ if ( cfg_listen_ip != 0 ) { ++ struct sockaddr_in addr; ++ // clear the struct as requested in the manpages ++ memset(&addr,0, sizeof(sockaddr_in)); ++ // set the type ++ addr.sin_family = AF_INET; ++ // we want the system to choose port ++ addr.sin_port = 0; ++ // set the defined ip from the commandline ++ addr.sin_addr.s_addr = cfg_listen_ip; ++ // bind it or return... ++ if(bind(m_sock,(struct sockaddr*)&addr,sizeof(struct sockaddr_in)) != 0){ ++ fprintf(stderr, "warn, can't set up tracker connection: %s\n", ++ strerror(errno)); ++ return -1; ++ } ++ } ++ + if(setfd_nonblock(m_sock) < 0) {CLOSE_SOCKET(m_sock); return -1; } + + r = connect_nonb(m_sock,(struct sockaddr*)&m_sin); +@@ -329,34 +437,42 @@ + // fprintf(stdout,"Old Set Self:"); + // fprintf(stdout,"%s\n", inet_ntoa(Self.m_sin.sin_addr)); + +- if( m_f_stoped ) /* stopped */ +- event = str_event[1]; +- else if( BTCONTENT.pBF->IsFull()) /* download complete */ +- event = str_event[2]; +- else if( m_f_started ) /* interval */ +- event = (char*) 0; +- else ++ if( m_f_stoped ) ++ event = str_event[1]; /* stopped */ ++ else if( m_f_started == 0 ) { ++ if( BTCONTENT.pBF->IsFull() ) m_f_completed = 1; + event = str_event[0]; /* started */ ++ } else if( BTCONTENT.pBF->IsFull() && !m_f_completed){ ++ event = str_event[2]; /* download complete */ ++ m_f_completed = 1; /* only send download complete once */ ++ } else ++ event = (char*) 0; /* interval */ + + if(event){ + if(MAXPATHLEN < snprintf(REQ_BUFFER,MAXPATHLEN,REQ_URL_P2_FMT, +- m_path, +- (size_t)Self.TotalUL(), +- (size_t)Self.TotalDL(), +- (size_t)BTCONTENT.GetLeftBytes(), +- event)){ ++ m_path, ++ Self.TotalUL(), ++ Self.TotalDL(), ++ BTCONTENT.GetLeftBytes(), ++ event, ++ cfg_max_peers, ++ m_key)){ + return -1; + } + }else{ + if(MAXPATHLEN < snprintf(REQ_BUFFER,MAXPATHLEN,REQ_URL_P3_FMT, +- m_path, +- (size_t)Self.TotalUL(), +- (size_t)Self.TotalDL(), +- (size_t)BTCONTENT.GetLeftBytes() +- )){ ++ m_path, ++ Self.TotalUL(), ++ Self.TotalDL(), ++ BTCONTENT.GetLeftBytes(), ++ cfg_max_peers, ++ m_key)){ + return -1; + } + } ++ if( *m_trackerid && ++ MAXPATHLEN - strlen(m_path) > 11 + strlen(m_trackerid) ) ++ strcat(strcat(m_path, "&trackerid="), m_trackerid); + + if(_IPsin(m_host, m_port, &addr) < 0){ + char REQ_HOST[MAXHOSTNAMELEN]; +@@ -370,6 +486,12 @@ + + if( 0 != m_reponse_buffer.PutFlush(m_sock,REQ_BUFFER,strlen((char*)REQ_BUFFER))){ + fprintf(stderr,"warn, send request to tracker failed. %s\n",strerror(errno)); ++ if(arg_ctcs){ ++ char ctcsinfo[256]; ++ snprintf(ctcsinfo,256, ++ "warn, send request to tracker failed. %s",strerror(errno)); ++ CTCS.Send_Info(ctcsinfo); ++ } + return -1; + } + +@@ -380,23 +502,29 @@ + { + /* tracker communication */ + if( T_FREE == m_status ){ +- if((*pnow - m_last_timestamp >= m_interval) && +- (cfg_min_peers > WORLD.TotalPeers())){ ++ if( *pnow - m_last_timestamp >= m_interval || ++ // Connect to tracker early if we run low on peers. ++ (WORLD.TotalPeers() < cfg_min_peers && m_prevpeers >= cfg_min_peers && ++ *pnow - m_last_timestamp >= 15) || ++ (m_f_pause && !WORLD.TotalPeers()) ){ ++ m_prevpeers = WORLD.TotalPeers(); + + if(Connect() < 0){ Reset(15); return -1; } + + if( m_status == T_CONNECTING ){ +- FD_SET(m_sock, rfdp); +- FD_SET(m_sock, wfdp); ++ FD_SET(m_sock, rfdp); ++ FD_SET(m_sock, wfdp); + }else{ +- FD_SET(m_sock, rfdp); ++ FD_SET(m_sock, rfdp); + } ++ ++ if( m_f_pause && !WORLD.TotalPeers() ) m_f_stoped = 1; + } + }else{ + if( m_status == T_CONNECTING ){ + FD_SET(m_sock, rfdp); + FD_SET(m_sock, wfdp); +- }else{ ++ }else if (INVALID_SOCKET != m_sock){ + FD_SET(m_sock, rfdp); + } + } +@@ -407,28 +535,60 @@ + { + if( T_FREE == m_status ) return 0; + +- if( T_CONNECTING == m_status && +- (FD_ISSET(m_sock, wfdp) || FD_ISSET(m_sock,wfdp)) ){ ++ if( T_CONNECTING == m_status && FD_ISSET(m_sock,wfdp) ){ + int error = 0; + socklen_t n = sizeof(error); + (*nfds)--; + FD_CLR(m_sock, wfdp); + if(getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n) < 0 || + error != 0 ){ +- if( ECONNREFUSED != error ) +- fprintf(stderr,"warn, connect to tracker failed. %s\n",strerror(error)); +- else +- m_connect_refuse_click++; ++ if( ECONNREFUSED != error ){ ++ fprintf(stderr,"warn, connect to tracker failed. %s\n",strerror(error)); ++ if(arg_ctcs){ ++ char ctcsinfo[256]; ++ snprintf(ctcsinfo,256, ++ "warn, connect to tracker failed. %s\n",strerror(error)); ++ CTCS.Send_Info(ctcsinfo); ++ } ++ }else ++ m_connect_refuse_click++; + Reset(15); + return -1; + }else{ + if( SendRequest() == 0 ) m_status = T_READY; + else { Reset(15); return -1; } + } +- }else if(FD_ISSET(m_sock, rfdp) ){ ++ }else if( T_CONNECTING == m_status && FD_ISSET(m_sock,rfdp) ){ ++ int error = 0; ++ socklen_t n = sizeof(error); ++ (*nfds)--; ++ FD_CLR(m_sock, rfdp); ++ getsockopt(m_sock, SOL_SOCKET,SO_ERROR,&error,&n); ++ fprintf(stderr,"warn, connect to tracker failed. %s\n",strerror(error)); ++ if(arg_ctcs){ ++ char ctcsinfo[256]; ++ snprintf(ctcsinfo,256, ++ "warn, connect to tracker failed. %s\n",strerror(error)); ++ CTCS.Send_Info(ctcsinfo); ++ } ++ Reset(15); ++ return -1; ++ }else if(INVALID_SOCKET != m_sock && FD_ISSET(m_sock, rfdp) ){ + (*nfds)--; + FD_CLR(m_sock,rfdp); + CheckReponse(); + } + return 0; + } ++ ++void btTracker::Resume() ++{ ++ m_f_pause = m_f_stoped = 0; ++ ++ if( T_FINISHED == m_status ){ ++ m_status = T_FREE; ++ m_f_started = 0; ++ m_interval = 15; ++ } ++} ++ +diff -ur --unidirectional-new-file ctorrent-1.3.4.sav/tracker.h ctorrent-1.3.4/tracker.h +--- ctorrent-1.3.4.sav/tracker.h 2006-06-28 19:00:54.000000000 +0200 ++++ ctorrent-1.3.4/tracker.h 2006-06-28 19:30:02.000000000 +0200 +@@ -1,9 +1,9 @@ + #ifndef TRACKER_H + #define TRACKER_H + ++#include "./def.h" + #include + +-#include "./def.h" + #include "./bufio.h" + + #ifdef WINDOWS +@@ -18,9 +18,12 @@ + #include + #endif + ++#include "btconfig.h" ++ + #define T_FREE 0 + #define T_CONNECTING 1 + #define T_READY 2 ++#define T_FINISHED 3 + + class btTracker + { +@@ -28,21 +31,29 @@ + char m_host[MAXHOSTNAMELEN]; + char m_path[MAXPATHLEN]; + int m_port; ++ char m_key[9]; ++ char m_trackerid[PEER_ID_LEN+1]; + + struct sockaddr_in m_sin; + + unsigned char m_status:2; + unsigned char m_f_started:1; + unsigned char m_f_stoped:1; ++ unsigned char m_f_completed:1; + + unsigned char m_f_pause:1; +- unsigned char m_f_reserved:3; ++ unsigned char m_f_softquit:1; ++ unsigned char m_f_restart:1; + + + time_t m_interval; // Trackerͨŵʱ + time_t m_last_timestamp; // һγɹTrackerͨŵʱ + size_t m_connect_refuse_click; + ++ size_t m_ok_click; // tracker ok response counter ++ size_t m_peers_count; // total number of peers ++ size_t m_prevpeers; // number of peers previously seen ++ + SOCKET m_sock; + BufIo m_reponse_buffer; + +@@ -65,6 +76,14 @@ + + void SetPause() { m_f_pause = 1; } + void ClearPause() { m_f_pause = 0; } ++ int IsPaused() const { return m_f_pause; } ++ void Resume(); ++ void SoftQuit() { m_f_softquit = 1; } ++ void DontQuit() { m_f_softquit = 0; } ++ int IsQuitting() const { return m_f_softquit; } ++ void SetRestart() { m_f_restart = 1; } ++ ++ void SetStoped() { Reset(15); m_f_stoped = 1; m_last_timestamp -= 15;} + + int Connect(); + int SendRequest(); +@@ -73,6 +92,8 @@ + int SocketReady(fd_set *rfdp, fd_set *wfdp, int *nfds); + + size_t GetRefuseClick() const { return m_connect_refuse_click; } ++ size_t GetOkClick() const { return m_ok_click; } ++ size_t GetPeersCount() const { return m_peers_count; } + }; + + extern btTracker Tracker; diff --git a/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn-mt.sh b/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn-mt.sh new file mode 100755 index 0000000000..113325489b --- /dev/null +++ b/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn-mt.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# start/stop inadyn-mt + +if ! [ -x /usr/bin/inadyn-mt ]; then + exit 0 +fi + +case "$1" in + start) + start-stop-daemon -S -b -x /usr/bin/inadyn-mt + ;; + stop) + start-stop-daemon -K -x /usr/bin/inadyn-mt + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 + diff --git a/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn.conf b/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn.conf new file mode 100644 index 0000000000..e4f997a6b4 --- /dev/null +++ b/meta-openpli/recipes-connectivity/inadyn-mt/files/inadyn.conf @@ -0,0 +1,13 @@ +# Check for a new IP every 54000 seconds (24 hours) +update_period_sec 54000 + +# Enter your DynDNS.com username and password here +username your-login +password your-password + +# What kind of host is being updated? Choices are dyndns@dyndns.org, statdns@dyndns.org, custom@dyndns.org +dyndns_system dyndns@dyndns.org + +# The hosts you want to update (uncomment the lines below) +#alias your-dynamic-host.dyndns.org +#alias another-dynamic-host.homeip.net diff --git a/meta-openpli/recipes-connectivity/inadyn-mt/files/remove_host_include_paths.patch b/meta-openpli/recipes-connectivity/inadyn-mt/files/remove_host_include_paths.patch new file mode 100644 index 0000000000..ceb333c113 --- /dev/null +++ b/meta-openpli/recipes-connectivity/inadyn-mt/files/remove_host_include_paths.patch @@ -0,0 +1,11 @@ +--- ~/makefile-deprecated~ 2009-11-21 06:06:45.000000000 +0100 ++++ ~/makefile-deprecated 2012-05-11 21:37:06.125458393 +0200 +@@ -109,8 +109,6 @@ + CFLAGS += -g -DDEBUG + endif + +-CFLAGS += -I /usr/local/include -L /usr/local/lib -L /usr/lib +- + ifndef USE_SOUND + ifdef USE_THREADS + diff --git a/meta-openpli/recipes-connectivity/inadyn-mt/inadyn-mt.bb b/meta-openpli/recipes-connectivity/inadyn-mt/inadyn-mt.bb new file mode 100644 index 0000000000..2020a05bbd --- /dev/null +++ b/meta-openpli/recipes-connectivity/inadyn-mt/inadyn-mt.bb @@ -0,0 +1,33 @@ +MAINTAINER = "Narcis Ilisei" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=3c34afdc3adf82d2448f12715a255122" + +SRCDATE = "20100519" +PV = "v.02.18.24+cvs${SRCDATE}" +PR = "r3" + +SRC_URI = "cvs://anonymous@inadyn-mt.cvs.sourceforge.net/cvsroot/inadyn-mt;module=${PN};tag=unicows;date=${SRCDATE} \ + file://inadyn-mt.sh \ + file://inadyn.conf \ + file://remove_host_include_paths.patch \ + " + +S = "${WORKDIR}/${PN}" + +inherit autotools update-rc.d + +INITSCRIPT_NAME = "inadyn-mt" +CONFFILES_${PN} = "/etc/inadyn.conf" + +do_compile() { + make -f makefile-deprecated +} + +do_install() { + install -d ${D}/usr/bin + install -m 755 ${S}/bin/linux/inadyn-mt ${D}/usr/bin + install -d ${D}/etc + install -m 644 ${WORKDIR}/inadyn.conf ${D}/etc/ + install -d ${D}/etc/init.d + install -m 755 ${WORKDIR}/inadyn-mt.sh ${D}/etc/init.d/inadyn-mt +} diff --git a/meta-openpli/recipes-connectivity/madwifi/files/ath-rate-ctlname.patch b/meta-openpli/recipes-connectivity/madwifi/files/ath-rate-ctlname.patch new file mode 100644 index 0000000000..bdd2b7b772 --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/ath-rate-ctlname.patch @@ -0,0 +1,108 @@ +--- madwifi-ng-r3314-20080131/ath_rate/amrr/amrr.c.orig 2012-03-23 22:35:59.470179233 +0100 ++++ madwifi-ng-r3314-20080131/ath_rate/amrr/amrr.c 2012-03-23 22:36:09.654179557 +0100 +@@ -482,7 +482,7 @@ + */ + + static ctl_table ath_rate_static_sysctls[] = { +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "interval", + .mode = 0644, + .data = &ath_rateinterval, +@@ -491,7 +491,7 @@ + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "max_success_threshold", + .mode = 0644, + .data = &ath_rate_max_success_threshold, +@@ -500,7 +500,7 @@ + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "min_success_threshold", + .mode = 0644, + .data = &ath_rate_min_success_threshold, +@@ -512,21 +512,21 @@ + { 0 } + }; + static ctl_table ath_rate_table[] = { +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "rate", + .mode = 0555, + .child = ath_rate_static_sysctls + }, { 0 } + }; + static ctl_table ath_ath_table[] = { +- { .ctl_name = DEV_ATH, ++ { CTLNAME(DEV_ATH) + .procname = "ath", + .mode = 0555, + .child = ath_rate_table + }, { 0 } + }; + static ctl_table ath_root_table[] = { +- { .ctl_name = CTL_DEV, ++ { CTLNAME(CTL_DEV) + .procname = "dev", + .mode = 0555, + .child = ath_ath_table +--- madwifi-ng-r3314-20080131/ath_rate/onoe/onoe.c.orig 2012-03-23 22:32:40.918174219 +0100 ++++ madwifi-ng-r3314-20080131/ath_rate/onoe/onoe.c 2012-03-23 22:35:37.146178724 +0100 +@@ -427,7 +427,7 @@ + * Static (i.e. global) sysctls. + */ + static ctl_table ath_rate_static_sysctls[] = { +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "interval", + .mode = 0644, + .data = &ath_rateinterval, +@@ -436,7 +436,7 @@ + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "raise", + .mode = 0644, + .data = &ath_rate_raise, +@@ -445,7 +445,7 @@ + .extra2 = &maxpercent, + .proc_handler = proc_dointvec_minmax + }, +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "raise_threshold", + .mode = 0644, + .data = &ath_rate_raise_threshold, +@@ -455,21 +455,21 @@ + { 0 } + }; + static ctl_table ath_rate_table[] = { +- { .ctl_name = CTL_AUTO, ++ { CTLNAME(CTL_AUTO) + .procname = "rate", + .mode = 0555, + .child = ath_rate_static_sysctls + }, { 0 } + }; + static ctl_table ath_ath_table[] = { +- { .ctl_name = DEV_ATH, ++ { CTLNAME(DEV_ATH) + .procname = "ath", + .mode = 0555, + .child = ath_rate_table + }, { 0 } + }; + static ctl_table ath_root_table[] = { +- { .ctl_name = CTL_DEV, ++ { CTLNAME(CTL_DEV) + .procname = "dev", + .mode = 0555, + .child = ath_ath_table diff --git a/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.1.patch b/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.1.patch new file mode 100644 index 0000000000..64907c783f --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.1.patch @@ -0,0 +1,22 @@ +diff -Naur madwifi-ng-r3314-20080131-org/net80211/ieee80211_input.c madwifi-ng-r3314-20080131/net80211/ieee80211_input.c +--- madwifi-ng-r3314-20080131-org/net80211/ieee80211_input.c 2012-01-28 19:27:10.000000000 +0100 ++++ madwifi-ng-r3314-20080131/net80211/ieee80211_input.c 2012-01-28 19:47:34.109104724 +0100 +@@ -1223,6 +1223,7 @@ + #endif + vap->iv_devstats.rx_packets++; + vap->iv_devstats.rx_bytes += skb->len; ++#if IEEE80211_VLAN_TAG_USED + if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) { + /* attach vlan tag */ + struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; +@@ -1236,7 +1237,9 @@ + vap->iv_devstats.rx_dropped++; + } + skb = NULL; /* SKB is no longer ours */ +- } else { ++ } else ++#endif ++ { + struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni; + if (netif_receive_skb(skb) == NET_RX_DROP) { + /* If netif_receive_skb dropped the packet because diff --git a/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.2.patch b/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.2.patch new file mode 100644 index 0000000000..2bdc158d64 --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/fix-build-3.2.patch @@ -0,0 +1,41 @@ +diff -Naur madwifi-ng-r3314-20080131.org/ath/if_ath.c madwifi-ng-r3314-20080131/ath/if_ath.c +--- madwifi-ng-r3314-20080131.org/ath/if_ath.c 2012-01-29 01:46:37.000000000 +0100 ++++ madwifi-ng-r3314-20080131/ath/if_ath.c 2012-01-29 02:00:12.433682375 +0100 +@@ -566,7 +566,11 @@ + .ndo_stop = ath_stop, + .ndo_start_xmit = ath_hardstart, + .ndo_tx_timeout = ath_tx_timeout, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) ++ .ndo_set_rx_mode = ath_mode_init, ++#else + .ndo_set_multicast_list = ath_mode_init, ++#endif + .ndo_do_ioctl = ath_ioctl, + .ndo_get_stats = ath_getstats, + .ndo_set_mac_address = ath_set_mac_address, +diff -Naur madwifi-ng-r3314-20080131.org/net80211/ieee80211.c madwifi-ng-r3314-20080131/net80211/ieee80211.c +--- madwifi-ng-r3314-20080131.org/net80211/ieee80211.c 2012-01-29 01:46:37.000000000 +0100 ++++ madwifi-ng-r3314-20080131/net80211/ieee80211.c 2012-01-29 02:03:42.505687801 +0100 +@@ -459,7 +459,11 @@ + .ndo_open = ieee80211_open, + .ndo_stop = ieee80211_stop, + .ndo_start_xmit = ieee80211_hardstart, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) ++ .ndo_set_rx_mode = ieee80211_set_multicast_list, ++#else + .ndo_set_multicast_list = ieee80211_set_multicast_list, ++#endif + .ndo_change_mtu = ieee80211_change_mtu, + .ndo_do_ioctl = ieee80211_ioctl, + }; +@@ -1843,7 +1847,9 @@ + IEEE80211_UNLOCK_IRQ(ic); + + /* XXX: Merge multicast list into parent device */ +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) ++ parent->netdev_ops->ndo_set_rx_mode(ic->ic_dev); ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) + parent->set_multicast_list(ic->ic_dev); + #else + parent->netdev_ops->ndo_set_multicast_list(ic->ic_dev); diff --git a/meta-openpli/recipes-connectivity/madwifi/files/fix-module-autoload.patch b/meta-openpli/recipes-connectivity/madwifi/files/fix-module-autoload.patch new file mode 100644 index 0000000000..d5f7dbe9f2 --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/fix-module-autoload.patch @@ -0,0 +1,11 @@ +--- a/net80211/ieee80211_linux.c 2012-01-27 22:35:51.890501496 +0100 ++++ b/net80211/ieee80211_linux.c 2012-01-27 22:35:03.806502081 +0100 +@@ -405,7 +405,7 @@ + int + ieee80211_load_module(const char *modname) + { +-#ifdef CONFIG_KMOD ++#if defined(CONFIG_KMOD) || LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28) + int rv; + rv = request_module(modname); + if (rv < 0) diff --git a/meta-openpli/recipes-connectivity/madwifi/files/fix-target-mips32.patch b/meta-openpli/recipes-connectivity/madwifi/files/fix-target-mips32.patch new file mode 100644 index 0000000000..743930455f --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/fix-target-mips32.patch @@ -0,0 +1,16 @@ +Upstream: unmaintained version + +diff -Naur madwifi-ng-r3314-20080131.orig/ath_hal/ah_target.inc madwifi-ng-r3314-20080131/ath_hal/ah_target.inc +--- madwifi-ng-r3314-20080131.orig/ath_hal/ah_target.inc 2006-11-17 23:34:30.000000000 +0000 ++++ madwifi-ng-r3314-20080131/ath_hal/ah_target.inc 2010-10-26 01:36:47.000000000 +0000 +@@ -26,8 +26,8 @@ + # Determine the target (i.e. which HAL to use). + # The default is $(ARCH)-elf + TARGET-$(CONFIG_CPU_32v4) = armv4-$(ENDIAN)-elf +-TARGET-$(CONFIG_CPU_MIPS32_R1) = mips1-$(ENDIAN)-elf +-TARGET-$(CONFIG_CPU_MIPS32_R2) = mips-$(ENDIAN)-elf ++TARGET-$(CONFIG_CPU_MIPS32_R1) = mips32-$(ENDIAN)-elf ++TARGET-$(CONFIG_CPU_MIPS32_R2) = mips32r2-$(ENDIAN)-elf + TARGET-$(CONFIG_CPU_R4X00) = mipsisa32-$(ENDIAN)-elf + TARGET-$(CONFIG_CPU_TX49XX) = mipsisa32-$(ENDIAN)-elf + TARGET-$(CONFIG_PPC32) = powerpc-be-elf diff --git a/meta-openpli/recipes-connectivity/madwifi/files/madwifi-smp-affinity b/meta-openpli/recipes-connectivity/madwifi/files/madwifi-smp-affinity new file mode 100644 index 0000000000..9504ee73a7 --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/madwifi-smp-affinity @@ -0,0 +1,18 @@ +#!/bin/sh +# HACK! ... FIXME! +# The interrupt handler if madwifi-ng seems to be too slow respectively disable +# interrups for too long. To prevent this, we are moving madwifi-ng interrupt to +# CPU1, which will never be running audio/video specific code. +if [ $IFACE != "ath0" ]; then + exit 0 +fi + +if [ $MODE = "start" ]; then + echo "move irq 33 to CPU1" + echo 2 > /proc/irq/33/smp_affinity +elif [ $MODE = "stop" ]; then + echo "move irq 33 to CPU0" + echo 1 > /proc/irq/33/smp_affinity +fi + +exit 0 diff --git a/meta-openpli/recipes-connectivity/madwifi/files/remove-wprobe.patch b/meta-openpli/recipes-connectivity/madwifi/files/remove-wprobe.patch new file mode 100644 index 0000000000..b251461dad --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/remove-wprobe.patch @@ -0,0 +1,115 @@ +Upstream: OE-only + +Wprobe is "a module that exports measurement data from wireless driver to user space", +which requires an additional out-of-tree kernel module. + +See https://dev.openwrt.org/browser/trunk/package/wprobe/. + +diff -Naur madwifi-ng-r3314-20080131.orig/ath/if_ath.c madwifi-ng-r3314-20080131/ath/if_ath.c +--- madwifi-ng-r3314-20080131.orig/ath/if_ath.c 2010-10-26 11:15:51.000000000 +0000 ++++ madwifi-ng-r3314-20080131/ath/if_ath.c 2010-10-26 11:19:02.000000000 +0000 +@@ -396,7 +396,6 @@ + static int rfkill = 0; + static int tpc = 1; + static int xchanmode = -1; +-#include "ath_wprobe.c" + + static const struct ath_hw_detect generic_hw_info = { + .vendor_name = "Unknown", +@@ -1539,7 +1538,6 @@ + ath_hal_intrset(ah, sc->sc_imask); + } + +- ath_init_wprobe_dev(avp); + return vap; + } + +@@ -1621,7 +1619,6 @@ + decrease = 0; + + ieee80211_vap_detach(vap); +- ath_remove_wprobe_dev(ATH_VAP(vap)); + /* NB: memory is reclaimed through dev->destructor callback */ + if (decrease) + sc->sc_nvaps--; +@@ -6008,7 +6005,6 @@ + /* Clean up node-specific rate things - this currently appears to + * always be a no-op */ + sc->sc_rc->ops->node_cleanup(sc, ATH_NODE(ni)); +- ath_wprobe_node_leave(ni->ni_vap, ni); + + ATH_NODE_UAPSD_LOCK_IRQ(an); + #ifdef IEEE80211_DEBUG_REFCNT +@@ -7046,8 +7042,6 @@ + goto lookup_slowpath; + } + ATH_RSSI_LPF(ATH_NODE(ni)->an_avgrssi, rs->rs_rssi); +- ath_node_sample_rx(ni, rs); +- ath_wprobe_report_rx(ni->ni_vap, rs, skb); + type = ieee80211_input(ni->ni_vap, ni, skb, rs->rs_rssi, bf->bf_tsf); + ieee80211_unref_node(&ni); + } else { +@@ -7063,12 +7057,8 @@ + vap = ieee80211_find_rxvap(ic, wh->i_addr1); + + if (vap) { +- ath_wprobe_report_rx(vap, rs, skb); + ni = ieee80211_find_rxnode(ic, vap, wh); + } else { +- TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { +- ath_wprobe_report_rx(vap, rs, skb); +- } + ni = NULL; + } + +@@ -7076,7 +7066,6 @@ + ieee80211_keyix_t keyix; + + ATH_RSSI_LPF(ATH_NODE(ni)->an_avgrssi, rs->rs_rssi); +- ath_node_sample_rx(ni, rs); + type = ieee80211_input(vap, ni, skb, rs->rs_rssi, bf->bf_tsf); + /* + * If the station has a key cache slot assigned +@@ -8662,7 +8651,6 @@ + sc->sc_stats.ast_tx_rssi = ts->ts_rssi; + ATH_RSSI_LPF(an->an_halstats.ns_avgtxrssi, + ts->ts_rssi); +- ath_node_sample_tx(&an->an_node, ts, bf->bf_skb); + if (bf->bf_skb->priority == WME_AC_VO || + bf->bf_skb->priority == WME_AC_VI) + ni->ni_ic->ic_wme.wme_hipri_traffic++; +@@ -10175,7 +10163,6 @@ + struct ath_softc *sc = netdev_priv(ic->ic_dev); + + sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew); +- ath_wprobe_node_join(ni->ni_vap, ni); + + /* are we supporting compression? */ + if (!(vap->iv_ath_cap & ni->ni_ath_flags & IEEE80211_NODE_COMP)) +diff -Naur madwifi-ng-r3314-20080131.orig/ath/if_athvar.h madwifi-ng-r3314-20080131/ath/if_athvar.h +--- madwifi-ng-r3314-20080131.orig/ath/if_athvar.h 2010-10-26 11:15:51.000000000 +0000 ++++ madwifi-ng-r3314-20080131/ath/if_athvar.h 2010-10-26 11:17:20.000000000 +0000 +@@ -46,7 +46,6 @@ + #include "ah_desc.h" + #include "ah_os.h" + #include "if_athioctl.h" +-#include + #include "net80211/ieee80211.h" /* XXX for WME_NUM_AC */ + #include + #include +@@ -361,7 +360,6 @@ + /* driver-specific node state */ + struct ath_node { + struct ieee80211_node an_node; /* base class */ +- struct wprobe_link an_wplink; + uint8_t an_wplink_active; + struct work_struct an_destroy; + u_int16_t an_decomp_index; /* decompression mask index */ +@@ -533,7 +531,6 @@ + #else + unsigned int av_beacon_alloc; + #endif +- struct wprobe_iface av_wpif; + u32 av_rxframes; + u32 av_rxprobereq; + }; diff --git a/meta-openpli/recipes-connectivity/madwifi/files/set-affinity-hint.patch b/meta-openpli/recipes-connectivity/madwifi/files/set-affinity-hint.patch new file mode 100644 index 0000000000..71c2686dd2 --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/files/set-affinity-hint.patch @@ -0,0 +1,45 @@ +--- madwifi-ng-r3313-20080131.orig/ath/if_ath_pci.c 2012-04-11 19:58:53.000000000 +0200 ++++ madwifi-ng-r3314-20080131/ath/if_ath_pci.c 2012-04-11 20:18:55.473141295 +0200 +@@ -148,6 +148,11 @@ + { ubnt, "SR9", 0x168c, 0x0013, 0x7777, 0x2009, 12 }, + }; + ++#define CPU_MASK_CPU1 \ ++(cpumask_t) { { \ ++ [0] = 2UL \ ++} } ++ + static int + ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) + { +@@ -285,6 +290,13 @@ + goto bad4; + } + ++#if defined(CONFIG_DREAMBOX_DM8000) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ++ { ++ static cpumask_t m = CPU_MASK_CPU1; ++ irq_set_affinity_hint(dev->irq, &m); ++ } ++#endif ++ + athname = ath_hal_probe(id->vendor, vdevice); + printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n", + dev_info, dev->name, athname ? athname : "Atheros ???", phymem, dev->irq); +@@ -317,8 +329,15 @@ + struct ath_pci_softc *sc = netdev_priv(dev); + + ath_detach(dev); +- if (dev->irq) ++ if (dev->irq) { + free_irq(dev->irq, dev); ++#if defined(CONFIG_DREAMBOX_DM8000) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ++ { ++ static cpumask_t m = CPU_MASK_ALL; ++ irq_set_affinity_hint(dev->irq, &m); ++ } ++#endif ++ } + iounmap(sc->aps_sc.sc_iobase); + release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); + pci_disable_device(pdev); diff --git a/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r.inc b/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r.inc new file mode 100644 index 0000000000..2cdf21da7e --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r.inc @@ -0,0 +1,35 @@ +SUMMARY = "Linux driver for 802.11a/b/g universal NIC cards using Atheros chip sets" +SECTION = "base" +LICENSE = "BSD-3-Clause | GPLv2" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=58383ec8217e551da24db177e27a6ff2" +INC_PR = "r2" + +SRC_URI = "http://snapshots.madwifi-project.org/madwifi-trunk/${BP}.tar.gz" + +S = "${WORKDIR}/${BP}" + +inherit module + +EXTRA_OEMAKE = "KERNELPATH=${STAGING_KERNEL_DIR} KERNELRELEASE=${KERNEL_VERSION} TOOLPREFIX=${TARGET_PREFIX}" + +do_compile() { + oe_runmake tools + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake modules +} +do_install() { + oe_runmake DESTDIR=${D} BINDIR=${sbindir} MANDIR=${mandir} install-tools + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake DESTDIR=${D} BINDIR=${sbindir} MANDIR=${mandir} install-modules + install -d ${D}${includedir}/${BPN}/include + install -m 644 include/compat.h ${D}${includedir}/${BPN}/include + install -d ${D}${includedir}/${BPN}/net80211 + install -m 644 net80211/*.h ${D}${includedir}/${BPN}/net80211 +} + +PACKAGES =+ "${PN}-modules ${PN}-tools" + +RDEPENDS_${PN}-modules = "kernel-module-aes-generic" + +FILES_${PN}-modules = "/lib/modules/" +FILES_${PN}-tools = "${sbindir}/*" diff --git a/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r3314-20080131.bb b/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r3314-20080131.bb new file mode 100644 index 0000000000..d6fb5f544d --- /dev/null +++ b/meta-openpli/recipes-connectivity/madwifi/madwifi-ng_r3314-20080131.bb @@ -0,0 +1,50 @@ +SRCREV = "30414" +PR = "${INC_PR}.1" + +# versions of OpenWrt backfire (10.03) +HAL_VERSION = "20090508" + +require madwifi-ng_r.inc + +SRC_URI += " \ + svn://svn.openwrt.org/openwrt/trunk/package/madwifi;module=patches \ + http://mirror2.openwrt.org/sources/ath_hal-${HAL_VERSION}.tgz;name=hal \ + file://fix-target-mips32.patch \ + file://remove-wprobe.patch;apply=no \ + file://fix-module-autoload.patch;apply=no \ + file://fix-build-3.1.patch;apply=no \ + file://fix-build-3.2.patch;apply=no \ + file://ath-rate-ctlname.patch;apply=no \ + file://set-affinity-hint.patch;apply=no \ + file://madwifi-smp-affinity \ + " +SRC_URI[md5sum] = "2c7352cbbdac995de8c3bce5b80db5f2" +SRC_URI[sha256sum] = "0599c75b95ba63bdc554cb8124192e62c75fbeb71b9e8a5a7bc351c8e0666758" +SRC_URI[hal.md5sum] = "4ab7ae8bdb96c0be388c98bf8f92d5ca" +SRC_URI[hal.sha256sum] = "ced93d25aea7ee43807147a0269e69a072e718d59e7dab904bbe48b900409483" + +addtask postpatch after do_patch before do_configure + +do_postpatch() { + rm -rf hal + cp -a ${WORKDIR}/ath_hal-${HAL_VERSION} hal + rm -f ${WORKDIR}/patches/104-autocreate_none.patch + rm -f ${WORKDIR}/patches/446-single_module.patch + rm -f ${WORKDIR}/patches/470-mac_addresss_from_ath5k_platform_data.patch + for i in ${WORKDIR}/patches/*.patch; do + patch -p1 -i $i + done + patch -p1 -i ${WORKDIR}/remove-wprobe.patch + patch -p1 -i ${WORKDIR}/fix-module-autoload.patch + patch -p1 -i ${WORKDIR}/fix-build-3.1.patch + patch -p1 -i ${WORKDIR}/fix-build-3.2.patch + patch -p1 -i ${WORKDIR}/ath-rate-ctlname.patch + patch -p1 -i ${WORKDIR}/set-affinity-hint.patch +} + +do_install_append() { + install -d ${D}/etc/network/if-pre-up.d + install -m 0755 ${WORKDIR}/madwifi-smp-affinity ${D}/etc/network/if-pre-up.d + install -d ${D}/etc/network/if-post-down.d + ln -sf ../if-pre-up.d/madwifi-smp-affinity ${D}/etc/network/if-post-down.d +} diff --git a/meta-openpli/recipes-connectivity/minidlna/minidlna/default_sqlite_caches.diff b/meta-openpli/recipes-connectivity/minidlna/minidlna/default_sqlite_caches.diff new file mode 100644 index 0000000000..e117d5db25 --- /dev/null +++ b/meta-openpli/recipes-connectivity/minidlna/minidlna/default_sqlite_caches.diff @@ -0,0 +1,20 @@ +#Don't increase page_size and default_cache_size. +#This patch reduces the memory footprint by about 50% without any major performance hits. +Index: minidlna.c +=================================================================== +RCS file: /cvsroot/minidlna/minidlna/minidlna.c,v +retrieving revision 1.78 +diff -u -r1.78 minidlna.c +--- a/minidlna.c 10 Jan 2012 02:50:33 -0000 1.78 ++++ b/minidlna.c 23 Jan 2012 13:12:02 -0000 +@@ -320,10 +320,8 @@ + DPRINTF(E_FATAL, L_GENERAL, "ERROR: Failed to open sqlite database! Exiting...\n"); + } + sqlite3_busy_timeout(db, 5000); +- sql_exec(db, "pragma page_size = 4096"); + sql_exec(db, "pragma journal_mode = OFF"); + sql_exec(db, "pragma synchronous = OFF;"); +- sql_exec(db, "pragma default_cache_size = 8192;"); + return new_db; + } + diff --git a/meta-openpli/recipes-connectivity/minidlna/minidlna_cvs.bb b/meta-openpli/recipes-connectivity/minidlna/minidlna_cvs.bb new file mode 100644 index 0000000000..abb2927a8d --- /dev/null +++ b/meta-openpli/recipes-connectivity/minidlna/minidlna_cvs.bb @@ -0,0 +1,20 @@ +SUMMARY = "lightweight DLNA/UPnP-AV server targeted at embedded systems" +HOMEPAGE = "http://sourceforge.net/projects/minidlna/" +SECTION = "network" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b1a795ac1a06805cf8fd74920bc46b5c" +DEPENDS = "libexif jpeg libid3tag flac libvorbis sqlite3 libav util-linux" +SRCDATE = "20120408" +PV = "1.0.99+cvs${SRCDATE}" +PR = "r0" + +SRC_URI = "cvs://anonymous@minidlna.cvs.sourceforge.net/cvsroot/minidlna;module=minidlna \ + file://default_sqlite_caches.diff" + +S = "${WORKDIR}/${PN}" + +inherit autotools gettext + +PACKAGES =+ "${PN}-utils" + +FILES_${PN}-utils = "${bindir}/test*" diff --git a/meta-openpli/recipes-connectivity/ofono/ofono_1.5.bbappend b/meta-openpli/recipes-connectivity/ofono/ofono_1.5.bbappend new file mode 100644 index 0000000000..1a5f013f2b --- /dev/null +++ b/meta-openpli/recipes-connectivity/ofono/ofono_1.5.bbappend @@ -0,0 +1,5 @@ +PRINC = "1" + +EXTRA_OECONF += " --disable-udev" + +DEPENDS := "${@oe_filter_out('udev', '${DEPENDS}', d)}" diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.if-up b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.if-up new file mode 100644 index 0000000000..f8d079e4f2 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.if-up @@ -0,0 +1,22 @@ +#!/bin/sh +# ifup hook script for resolvconf +# Written by Roy Marples under the BSD-2 license + +[ -x /sbin/resolvconf ] || exit 0 +case "$ADDRFAM" in + inet|inet6) : ;; + *) exit 0;; +esac + +conf= +[ -n "$IF_DNS_DOMAIN" ] && conf="${conf}domain $IF_DNS_DOMAIN\n" +[ -n "$IF_DNS_SEARCH" ] && conf="${conf}search $IF_DNS_SEARCH\n" +[ -n "$IF_DNS_SORTLIST" ] && conf="${conf}sortlist $IF_DNS_SORTLIST\n" +[ -n "$IF_DNS_OPTIONS" ] && conf="${conf}options $IF_DNS_OPTIONS\n" +for nameserver in $IF_DNS_NAMESERVERS; do + conf="${conf}nameserver $nameserver\n" +done +if [ -n "$conf" ]; then + conf="# Generated by ifup for $IFACE.$ADDRFAM\n$conf" + printf "$conf" | /sbin/resolvconf -a "$IFACE.$ADDRFAM" +fi diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-down b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-down new file mode 100644 index 0000000000..b4f26cb749 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-down @@ -0,0 +1,6 @@ +#!/bin/sh +# ppp.ip-down hook script for resolvconf +# Written by Roy Marples under the BSD-2 license + +[ -x /sbin/resolvconf ] || exit 0 +/sbin/resolvconf -f -d "$PPP_IFACE" diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-up b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-up new file mode 100644 index 0000000000..e2963c07cf --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/000resolvconf.ppp.ip-up @@ -0,0 +1,12 @@ +#!/bin/sh +# ppp.ip-up hook script for resolvconf +# Written by Roy Marples under the BSD-2 license + +[ -x /sbin/resolvconf ] || exit 0 + +if [ -n "$DNS1" -o -n "$DNS2" ]; then + conf="# Generated by ppp.ip-up for $PPP_IFACE\n" + [ -n "$DNS1" ] && conf="${conf}nameserver $DNS1\n" + [ -n "$DNS2" ] && conf="${conf}nameserver $DNS2\n" + printf "$conf" | /sbin/resolvconf -a "$PPP_IFACE" +fi diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.conf b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.conf new file mode 100644 index 0000000000..e4d177f129 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.conf @@ -0,0 +1 @@ +resolv_conf=/var/run/resolv.conf diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.if-down b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.if-down new file mode 100644 index 0000000000..acba208c7b --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/resolvconf.if-down @@ -0,0 +1,11 @@ +#!/bin/sh +# ifdown hook script for resolvconf +# Written by Roy Marples under the BSD-2 license + +[ -x /sbin/resolvconf ] || exit 0 +case "$ADDRFAM" in + inet|inet6) : ;; + *) exit 0;; +esac +[ "$METHOD" = dhcp ] && /sbin/resolvconf -f -d "$IFACE" +/sbin/resolvconf -f -d "$IFACE.$ADDRFAM" diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/volatiles.99_openresolv b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/volatiles.99_openresolv new file mode 100644 index 0000000000..0c6f514f42 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv-3.5.2/volatiles.99_openresolv @@ -0,0 +1,2 @@ +# +d root root 0755 /var/run/resolvconf none diff --git a/meta-openpli/recipes-connectivity/openresolv/openresolv_3.5.2.bb b/meta-openpli/recipes-connectivity/openresolv/openresolv_3.5.2.bb new file mode 100644 index 0000000000..bfb6c8a3b7 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openresolv/openresolv_3.5.2.bb @@ -0,0 +1,60 @@ +SUMMARY = "management framework for resolv.conf" +AUTHOR = "Roy Marples " +HOMEPAGE = "http://roy.marples.name/projects/openresolv" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://resolvconf.in;beginline=4;endline=26;md5=e962049f535f7385f0f2a0ac9638cd43" +PR = "r0" + +SRC_URI = "http://roy.marples.name/downloads/${BPN}/${BP}.tar.bz2 \ + file://000resolvconf.if-up \ + file://000resolvconf.ppp.ip-down \ + file://000resolvconf.ppp.ip-up \ + file://resolvconf.conf \ + file://resolvconf.if-down \ + file://volatiles.99_openresolv" +SRC_URI[md5sum] = "76337107ff56d7450d4ed622630c5574" +SRC_URI[sha256sum] = "4a4cf4ef20a1ce207937fb669bbae43f9db36f6298090b5e074c80ed2fe4a996" + +inherit allarch + +do_configure() { + echo "SYSCONFDIR=${sysconfdir}" > config.mk + echo "SBINDIR=${base_sbindir}" >> config.mk + echo "LIBEXECDIR=/lib/resolvconf" >> config.mk + echo "VARDIR=${localstatedir}/run/resolvconf" >> config.mk + echo "MANDIR=${mandir}" >> config.mk + echo "RCDIR=${sysconfdir}/init.d" >> config.mk + echo "RESTARTCMD=if ${sysconfdir}/init.d/\1 status >/dev/null 2>\&1; then ${sysconfdir}/init.d/\1 restart; fi" >> config.mk +} +do_install() { + oe_runmake "DESTDIR=${D}" install + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/resolvconf.conf ${D}${sysconfdir}/resolvconf.conf + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${WORKDIR}/volatiles.99_openresolv ${D}${sysconfdir}/default/volatiles/99_openresolv + install -d ${D}${sysconfdir}/network/if-down.d + install -m 0755 ${WORKDIR}/resolvconf.if-down ${D}${sysconfdir}/network/if-down.d/resolvconf + install -d ${D}${sysconfdir}/network/if-up.d + install -m 0755 ${WORKDIR}/000resolvconf.if-up ${D}${sysconfdir}/network/if-up.d/000resolvconf + install -d ${D}${sysconfdir}/ppp/ip-down.d + install -m 0755 ${WORKDIR}/000resolvconf.ppp.ip-down ${D}${sysconfdir}/ppp/ip-down.d/000resolvconf + install -d ${D}${sysconfdir}/ppp/ip-up.d + install -m 0755 ${WORKDIR}/000resolvconf.ppp.ip-up ${D}${sysconfdir}/ppp/ip-up.d/000resolvconf +} + +RPROVIDES_${PN} = "resolvconf" + +RCONFLICTS_${PN} = "resolvconf" + +FILES_${PN} += "/lib/resolvconf" + +pkg_postinst_${PN}() { +if [ -z "$D" -a -x ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update +fi +} +pkg_postrm_${PN}() { +if [ -z "$D" -a -x ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update +fi +} diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/configure-targets.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/configure-targets.patch new file mode 100644 index 0000000000..2317949a87 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/configure-targets.patch @@ -0,0 +1,25 @@ +Upstream-Status: Inappropriate [embedded specific] + +The number of colons are important :) + +Index: openssl-0.9.8g/Configure +=================================================================== +--- openssl-0.9.8g.orig/Configure 2008-04-12 04:27:22.000000000 +0200 ++++ openssl-0.9.8g/Configure 2008-04-12 04:38:56.000000000 +0200 +@@ -395,6 +395,16 @@ + "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", + "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", + ++ # Linux on ARM ++"linux-elf-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-elf-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-gnueabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++ ++"linux-avr32","$ENV{'CC'}:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).", ++ + #### *BSD [do see comment about ${BSDthreads} above!] + "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/ca.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/ca.patch new file mode 100644 index 0000000000..aba4d42983 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/ca.patch @@ -0,0 +1,22 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8m/apps/CA.pl.in +=================================================================== +--- openssl-0.9.8m.orig/apps/CA.pl.in 2006-04-28 00:28:51.000000000 +0000 ++++ openssl-0.9.8m/apps/CA.pl.in 2010-02-27 00:36:51.000000000 +0000 +@@ -65,6 +65,7 @@ + foreach (@ARGV) { + if ( /^(-\?|-h|-help)$/ ) { + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; ++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n"; + exit 0; + } elsif (/^-newcert$/) { + # create a certificate +@@ -165,6 +166,7 @@ + } else { + print STDERR "Unknown arg $_\n"; + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; ++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n"; + exit 1; + } + } diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/config-hurd.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/config-hurd.patch new file mode 100644 index 0000000000..2359d158d1 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/config-hurd.patch @@ -0,0 +1,17 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/config +=================================================================== +--- openssl-0.9.8k.orig/config 2009-02-16 09:43:41.000000000 +0100 ++++ openssl-0.9.8k/config 2009-07-19 11:32:41.000000000 +0200 +@@ -162,8 +162,8 @@ + echo "${MACHINE}-whatever-linux1"; exit 0 + ;; + +- GNU*) +- echo "hurd-x86"; exit 0; ++ GNU:*|GNU/*:*) ++ echo "${MACHINE}-gnuish"; exit 0; + ;; + + LynxOS:*) diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/debian-targets.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/debian-targets.patch new file mode 100644 index 0000000000..5720988a08 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/debian-targets.patch @@ -0,0 +1,56 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Configure +=================================================================== +--- openssl-0.9.8k.orig/Configure 2009-12-09 16:09:41.000000000 +0000 ++++ openssl-0.9.8k/Configure 2009-12-09 16:09:55.000000000 +0000 +@@ -320,6 +320,49 @@ + "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so", + "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so", + ++# Debian GNU/* (various architectures) ++"debian-alpha","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-alpha-ev4","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev4 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-alpha-ev5","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev5 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-arm","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-armeb","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-armel","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++#"debian-amd64","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm_linux}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++#"debian-freebsd-alpha","gcc:-DTERMIOS -O -Wa,--noexecstack -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-hppa","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-ia64","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++#"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC", ++"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i486 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i586 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-m68k","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-netbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-netbsd-m68k", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mv8 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-openbsd-alpha","gcc:-DTERMIOS -O3 -Wa,--noexecstack -g::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-openbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-openbsd-mips","gcc:-O2 -Wa,--noexecstack -g -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_UNROLL DES_RISC2 DES_PTR MD2_CHAR RC4_INDEX::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-s390","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sh3", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sh4", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sh3eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sh4eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-m32r","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sparc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -mcpu=v8 -g -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v9 -Wa,--noexecstack -Wa,-Av8plus -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-sparc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++ + #### + #### Variety of LINUX:-) + #### diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/engines-path.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/engines-path.patch new file mode 100644 index 0000000000..5b4c7d5f77 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/engines-path.patch @@ -0,0 +1,49 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8m/Makefile.org +=================================================================== +--- openssl-0.9.8m.orig/Makefile.org 2010-01-27 16:06:36.000000000 +0000 ++++ openssl-0.9.8m/Makefile.org 2010-02-27 00:43:04.000000000 +0000 +@@ -620,7 +620,7 @@ + install_sw: + @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ + $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ +- $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ ++ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines \ + $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \ + $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ + $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ +Index: openssl-0.9.8m/engines/Makefile +=================================================================== +--- openssl-0.9.8m.orig/engines/Makefile 2009-11-10 01:53:02.000000000 +0000 ++++ openssl-0.9.8m/engines/Makefile 2010-02-27 00:45:03.000000000 +0000 +@@ -101,13 +101,13 @@ + *DSO_DL*) sfx="sl";; \ + *) sfx="bad";; \ + esac; \ +- cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \ ++ cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new; \ + else \ + sfx="so"; \ + cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \ + fi; \ +- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \ +- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx ); \ ++ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new; \ ++ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx ); \ + done; \ + fi + +Index: openssl-0.9.8m/Configure +=================================================================== +--- openssl-0.9.8m.orig/Configure 2010-02-27 00:40:42.000000000 +0000 ++++ openssl-0.9.8m/Configure 2010-02-27 00:46:47.000000000 +0000 +@@ -1738,7 +1738,7 @@ + # $foo is to become "$prefix/lib$multilib/engines"; + # as Makefile.org and engines/Makefile are adapted for + # $multilib suffix. +- my $foo = "$prefix/lib/engines"; ++ my $foo = "$prefix/lib/ssl/engines"; + $foo =~ s/\\/\\\\/g; + print OUT "#define ENGINESDIR \"$foo\"\n"; + } diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/kfreebsd-pipe.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/kfreebsd-pipe.patch new file mode 100644 index 0000000000..b0312f3bf1 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/kfreebsd-pipe.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/crypto/perlasm/x86_64-xlate.pl +=================================================================== +--- openssl-0.9.8k.orig/crypto/perlasm/x86_64-xlate.pl 2008-02-13 21:01:48.000000000 +0100 ++++ openssl-0.9.8k/crypto/perlasm/x86_64-xlate.pl 2009-07-19 11:37:23.000000000 +0200 +@@ -62,7 +62,7 @@ + my ($outdev,$outino,@junk)=stat($output); + + open STDOUT,">$output" || die "can't open $output: $!" +- if ($stddev!=$outdev || $stdino!=$outino); ++# if ($stddev!=$outdev || $stdino!=$outino); + } + + my $masmref=8 + 50727*2**-32; # 8.00.50727 shipped with VS2005 diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/make-targets.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/make-targets.patch new file mode 100644 index 0000000000..91207d8454 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/make-targets.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.org +=================================================================== +--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:32:41.000000000 +0200 ++++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:31.000000000 +0200 +@@ -131,7 +131,7 @@ + + BASEADDR= + +-DIRS= crypto fips ssl engines apps test tools ++DIRS= crypto fips ssl engines apps tools + SHLIBDIRS= crypto ssl fips + + # dirs in crypto to build diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-dir.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-dir.patch new file mode 100644 index 0000000000..358f8cd8a1 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-dir.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.org +=================================================================== +--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:32:41.000000000 +0200 ++++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:29.000000000 +0200 +@@ -152,7 +152,7 @@ + + MAKEFILE= Makefile + +-MANDIR=$(OPENSSLDIR)/man ++MANDIR=/usr/share/man + MAN1=1 + MAN3=3 + MANSUFFIX= diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-section.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-section.patch new file mode 100644 index 0000000000..b74b12e752 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/man-section.patch @@ -0,0 +1,34 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.org +=================================================================== +--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:34:06.000000000 +0200 ++++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:21.000000000 +0200 +@@ -155,7 +155,8 @@ + MANDIR=/usr/share/man + MAN1=1 + MAN3=3 +-MANSUFFIX= ++MANSUFFIX=ssl ++MANSECTION=SSL + SHELL=/bin/sh + + TOP= . +@@ -694,7 +695,7 @@ + echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ + (cd `$(PERL) util/dirname.pl $$i`; \ + sh -c "$$pod2man \ +- --section=$$sec --center=OpenSSL \ ++ --section=$${sec}$(MANSECTION) --center=OpenSSL \ + --release=$(VERSION) `basename $$i`") \ + > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ + $(PERL) util/extract-names.pl < $$i | \ +@@ -711,7 +712,7 @@ + echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ + (cd `$(PERL) util/dirname.pl $$i`; \ + sh -c "$$pod2man \ +- --section=$$sec --center=OpenSSL \ ++ --section=$${sec}$(MANSECTION) --center=OpenSSL \ + --release=$(VERSION) `basename $$i`") \ + > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ + $(PERL) util/extract-names.pl < $$i | \ diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-rpath.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-rpath.patch new file mode 100644 index 0000000000..53b761442b --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-rpath.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.shared +=================================================================== +--- openssl-0.9.8k.orig/Makefile.shared 2008-09-17 17:56:40.000000000 +0200 ++++ openssl-0.9.8k/Makefile.shared 2009-07-19 11:37:25.000000000 +0200 +@@ -151,7 +151,7 @@ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" + +-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)" ++DO_GNU_APP=LDFLAGS="$(CFLAGS)" + + #This is rather special. It's a special target with which one can link + #applications without bothering with any features that have anything to diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-symbolic.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-symbolic.patch new file mode 100644 index 0000000000..87eadaccc5 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/no-symbolic.patch @@ -0,0 +1,15 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.shared +=================================================================== +--- openssl-0.9.8k.orig/Makefile.shared 2009-07-19 11:35:02.000000000 +0200 ++++ openssl-0.9.8k/Makefile.shared 2009-07-19 11:35:48.000000000 +0200 +@@ -149,7 +149,7 @@ + SHLIB_SUFFIX=; \ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ +- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" ++ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" + + DO_GNU_APP=LDFLAGS="$(CFLAGS)" + diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/perl-path.diff b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/perl-path.diff new file mode 100644 index 0000000000..ced45a338d --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/perl-path.diff @@ -0,0 +1,762 @@ +Upstream-Status: Backport [debian] + +From: Kurt Roeckx +Subject: Change the perl path's to /usr/bin/perl + +This is the result of running: +perl util/perlpath.pl /usr/bin + +The upstream sources have this set to various different paths. + +--- openssl-0.9.8m.orig/Configure ++++ openssl-0.9.8m/Configure +@@ -1,4 +1,4 @@ +-: ++#!/usr/bin/perl + eval 'exec perl -S $0 ${1+"$@"}' + if $running_under_some_shell; + ## +--- openssl-0.9.8m.orig/VMS/VMSify-conf.pl ++++ openssl-0.9.8m/VMS/VMSify-conf.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl ++#!/usr/bin/perl + + use strict; + use warnings; +--- openssl-0.9.8m.orig/Netware/do_tests.pl ++++ openssl-0.9.8m/Netware/do_tests.pl +@@ -1,4 +1,4 @@ +-# perl script to run OpenSSL tests ++#!/usr/bin/perl + + + my $base_path = "\\openssl"; +--- openssl-0.9.8m.orig/apps/progs.pl ++++ openssl-0.9.8m/apps/progs.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + print "/* apps/progs.h */\n"; + print "/* automatically generated by progs.pl for openssl.c */\n\n"; +--- openssl-0.9.8m.orig/os2/backwardify.pl ++++ openssl-0.9.8m/os2/backwardify.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/perl + use strict; + + # Use as $0 +--- openssl-0.9.8m.orig/times/091/mips-rel.pl ++++ openssl-0.9.8m/times/091/mips-rel.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + &doit(100,"Pentium 100 32",0.0195,0.1000,0.6406,4.6100); # pentium-100 + &doit(200,"PPro 200 32",0.0070,0.0340,0.2087,1.4700); # pentium-100 +--- openssl-0.9.8m.orig/fips/mkfipsscr.pl ++++ openssl-0.9.8m/fips/mkfipsscr.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + # Quick & dirty utility to generate a script for executing the + # FIPS 140-2 CMVP algorithm tests based on the pathnames of + # input algorithm test files actually present (the unqualified +--- openssl-0.9.8m.orig/fips/fipsalgtest.pl ++++ openssl-0.9.8m/fips/fipsalgtest.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/perl + # Perl utility to run or verify FIPS 140-2 CMVP algorithm tests based on the + # pathnames of input algorithm test files actually present (the unqualified + # file names are consistent but the pathnames are not). +--- openssl-0.9.8m.orig/ms/uplink.pl ++++ openssl-0.9.8m/ms/uplink.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # For Microsoft CL this is implemented as inline assembler. So that + # even though this script can generate even Win32 code, we'll be +--- openssl-0.9.8m.orig/ms/segrenam.pl ++++ openssl-0.9.8m/ms/segrenam.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + my $quiet = 1; + +--- openssl-0.9.8m.orig/ms/cmp.pl ++++ openssl-0.9.8m/ms/cmp.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + ($#ARGV == 1) || die "usage: cmp.pl \n"; + +--- openssl-0.9.8m.orig/test/cms-test.pl ++++ openssl-0.9.8m/test/cms-test.pl +@@ -1,4 +1,4 @@ +-# test/cms-test.pl ++#!/usr/bin/perl + # Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + # project. + # +--- openssl-0.9.8m.orig/test/cms-examples.pl ++++ openssl-0.9.8m/test/cms-examples.pl +@@ -1,4 +1,4 @@ +-# test/cms-examples.pl ++#!/usr/bin/perl + # Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + # project. + # +--- openssl-0.9.8m.orig/demos/b64.pl ++++ openssl-0.9.8m/demos/b64.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # + # Make PEM encoded data have lines of 64 bytes of data +--- openssl-0.9.8m.orig/demos/tunala/configure.in ++++ openssl-0.9.8m/demos/tunala/configure.in +@@ -1,4 +1,4 @@ +-dnl Process this file with autoconf to produce a configure script. ++#!/usr/bin/perl + AC_INIT(tunala.c) + AM_CONFIG_HEADER(config.h) + AM_INIT_AUTOMAKE(tunala, 0.0.1-dev) +--- openssl-0.9.8m.orig/crypto/x86cpuid.pl ++++ openssl-0.9.8m/crypto/x86cpuid.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + push(@INC,"perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/x86_64cpuid.pl ++++ openssl-0.9.8m/crypto/x86_64cpuid.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + $output=shift; + $masm=1 if ($output =~ /\.asm/); +--- openssl-0.9.8m.orig/crypto/md5/asm/md5-586.pl ++++ openssl-0.9.8m/crypto/md5/asm/md5-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # Normal is the + # md5_block_x86(MD5_CTX *c, ULONG *X); +--- openssl-0.9.8m.orig/crypto/md5/asm/md5-x86_64.pl ++++ openssl-0.9.8m/crypto/md5/asm/md5-x86_64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/perl + # + # MD5 optimized for AMD64. + # +--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-ia64.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha1-ia64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-x86_64.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha1-x86_64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-sse2.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha512-sse2.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-ia64.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha512-ia64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-x86_64.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha512-x86_64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-586.pl ++++ openssl-0.9.8m/crypto/sha/asm/sha1-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + # ==================================================================== + # [Re]written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/des/asm/des-586.pl ++++ openssl-0.9.8m/crypto/des/asm/des-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # The inner loop instruction sequence and the IP/FP modifications are from + # Svend Olaf Mikkelsen +--- openssl-0.9.8m.orig/crypto/des/asm/desboth.pl ++++ openssl-0.9.8m/crypto/des/asm/desboth.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + $L="edi"; + $R="esi"; +--- openssl-0.9.8m.orig/crypto/des/asm/des686.pl ++++ openssl-0.9.8m/crypto/des/asm/des686.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + $prog="des686.pl"; + +--- openssl-0.9.8m.orig/crypto/des/asm/crypt586.pl ++++ openssl-0.9.8m/crypto/des/asm/crypt586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # The inner loop instruction sequence and the IP/FP modifications are from + # Svend Olaf Mikkelsen +--- openssl-0.9.8m.orig/crypto/lhash/num.pl ++++ openssl-0.9.8m/crypto/lhash/num.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + #node 10 -> 4 + +--- openssl-0.9.8m.orig/crypto/ripemd/asm/rmd-586.pl ++++ openssl-0.9.8m/crypto/ripemd/asm/rmd-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # Normal is the + # ripemd160_block_asm_data_order(RIPEMD160_CTX *c, ULONG *X,int blocks); +--- openssl-0.9.8m.orig/crypto/rc4/asm/rc4-586.pl ++++ openssl-0.9.8m/crypto/rc4/asm/rc4-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # At some point it became apparent that the original SSLeay RC4 + # assembler implementation performs suboptimaly on latest IA-32 +--- openssl-0.9.8m.orig/crypto/rc4/asm/rc4-x86_64.pl ++++ openssl-0.9.8m/crypto/rc4/asm/rc4-x86_64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/cast/asm/cast-586.pl ++++ openssl-0.9.8m/crypto/cast/asm/cast-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # define for pentium pro friendly version + $ppro=1; +--- openssl-0.9.8m.orig/crypto/rc5/asm/rc5-586.pl ++++ openssl-0.9.8m/crypto/rc5/asm/rc5-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/perlasm/x86ms.pl ++++ openssl-0.9.8m/crypto/perlasm/x86ms.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + package x86ms; + +--- openssl-0.9.8m.orig/crypto/perlasm/x86asm.pl ++++ openssl-0.9.8m/crypto/perlasm/x86asm.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # require 'x86asm.pl'; + # &asm_init("cpp","des-586.pl"); +--- openssl-0.9.8m.orig/crypto/perlasm/x86nasm.pl ++++ openssl-0.9.8m/crypto/perlasm/x86nasm.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + package x86nasm; + +--- openssl-0.9.8m.orig/crypto/perlasm/x86unix.pl ++++ openssl-0.9.8m/crypto/perlasm/x86unix.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + package x86unix; # GAS actually... + +--- openssl-0.9.8m.orig/crypto/perlasm/cbc.pl ++++ openssl-0.9.8m/crypto/perlasm/cbc.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # void des_ncbc_encrypt(input, output, length, schedule, ivec, enc) + # des_cblock (*input); +--- openssl-0.9.8m.orig/crypto/perlasm/x86_64-xlate.pl ++++ openssl-0.9.8m/crypto/perlasm/x86_64-xlate.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + # Ascetic x86_64 AT&T to MASM assembler translator by . + # +--- openssl-0.9.8m.orig/crypto/bf/asm/bf-686.pl ++++ openssl-0.9.8m/crypto/bf/asm/bf-686.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/bf/asm/bf-586.pl ++++ openssl-0.9.8m/crypto/bf/asm/bf-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/objects/objects.pl ++++ openssl-0.9.8m/crypto/objects/objects.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]"; + $max_nid=0; +--- openssl-0.9.8m.orig/crypto/objects/obj_dat.pl ++++ openssl-0.9.8m/crypto/objects/obj_dat.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # fixes bug in floating point emulation on sparc64 when + # this script produces off-by-one output on sparc64 +--- openssl-0.9.8m.orig/crypto/conf/keysets.pl ++++ openssl-0.9.8m/crypto/conf/keysets.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + $NUMBER=0x01; + $UPPER=0x02; +--- openssl-0.9.8m.orig/crypto/bn/bn_prime.pl ++++ openssl-0.9.8m/crypto/bn/bn_prime.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # bn_prime.pl + + $num=2048; +--- openssl-0.9.8m.orig/crypto/bn/asm/x86.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/bn/asm/ppc.pl ++++ openssl-0.9.8m/crypto/bn/asm/ppc.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # Implemented as a Perl wrapper as we want to support several different + # architectures with single file. We pick up the target based on the +--- openssl-0.9.8m.orig/crypto/bn/asm/co-586.pl ++++ openssl-0.9.8m/crypto/bn/asm/co-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/bn/asm/bn-586.pl ++++ openssl-0.9.8m/crypto/bn/asm/bn-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; +--- openssl-0.9.8m.orig/crypto/bn/asm/mo-586.pl ++++ openssl-0.9.8m/crypto/bn/asm/mo-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + # This is crypto/bn/asm/x86-mont.pl (with asciz from crypto/perlasm/x86asm.pl) + # from OpenSSL 0.9.9-dev +--- openssl-0.9.8m.orig/crypto/bn/asm/x86_64-mont.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86_64-mont.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/comba.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/comba.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub mul_add_c +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/add.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/add.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_add_words +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/mul.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/mul.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_mul_words +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/mul_add.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/mul_add.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_mul_add_words +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/sqr.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/sqr.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_sqr_words +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/sub.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/sub.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_sub_words +--- openssl-0.9.8m.orig/crypto/bn/asm/x86/div.pl ++++ openssl-0.9.8m/crypto/bn/asm/x86/div.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # x86 assember + + sub bn_div_words +--- openssl-0.9.8m.orig/crypto/aes/asm/aes-586.pl ++++ openssl-0.9.8m/crypto/aes/asm/aes-586.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/aes/asm/aes-x86_64.pl ++++ openssl-0.9.8m/crypto/aes/asm/aes-x86_64.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#!/usr/bin/perl + # + # ==================================================================== + # Written by Andy Polyakov for the OpenSSL +--- openssl-0.9.8m.orig/crypto/asn1/charmap.pl ++++ openssl-0.9.8m/crypto/asn1/charmap.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + + use strict; + +--- openssl-0.9.8m.orig/util/mksdef.pl ++++ openssl-0.9.8m/util/mksdef.pl +@@ -1,4 +1,4 @@ +- ++#!/usr/bin/perl + # Perl script to split libeay32.def into two distinct DEF files for use in + # fipdso mode. It works out symbols in each case by running "link" command and + # parsing the output to find the list of missing symbols then splitting +--- openssl-0.9.8m.orig/util/dirname.pl ++++ openssl-0.9.8m/util/dirname.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + if ($#ARGV < 0) { + die "dirname.pl: too few arguments\n"; +--- openssl-0.9.8m.orig/util/tab_num.pl ++++ openssl-0.9.8m/util/tab_num.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + $num=1; + $width=40; +--- openssl-0.9.8m.orig/util/sp-diff.pl ++++ openssl-0.9.8m/util/sp-diff.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # This file takes as input, the files that have been output from + # ssleay speed. +--- openssl-0.9.8m.orig/util/mkerr.pl ++++ openssl-0.9.8m/util/mkerr.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + + my $config = "crypto/err/openssl.ec"; + my $debug = 0; +--- openssl-0.9.8m.orig/util/clean-depend.pl ++++ openssl-0.9.8m/util/clean-depend.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + # Clean the dependency list in a makefile of standard includes... + # Written by Ben Laurie 19 Jan 1999 + +--- openssl-0.9.8m.orig/util/add_cr.pl ++++ openssl-0.9.8m/util/add_cr.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # This adds a copyright message to a souce code file. + # It also gets the file name correct. +--- openssl-0.9.8m.orig/util/pod2man.pl ++++ openssl-0.9.8m/util/pod2man.pl +@@ -1,4 +1,4 @@ +-: #!/usr/bin/perl-5.005 ++#!/usr/bin/perl + eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' + if $running_under_some_shell; + +--- openssl-0.9.8m.orig/util/mkstack.pl ++++ openssl-0.9.8m/util/mkstack.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + + # This is a utility that searches out "DECLARE_STACK_OF()" + # declarations in .h and .c files, and updates/creates/replaces +--- openssl-0.9.8m.orig/util/selftest.pl ++++ openssl-0.9.8m/util/selftest.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + # + # Run the test suite and generate a report + # +--- openssl-0.9.8m.orig/util/ck_errf.pl ++++ openssl-0.9.8m/util/ck_errf.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # This is just a quick script to scan for cases where the 'error' + # function name in a XXXerr() macro is wrong. +--- openssl-0.9.8m.orig/util/mklink.pl ++++ openssl-0.9.8m/util/mklink.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # mklink.pl + +--- openssl-0.9.8m.orig/util/src-dep.pl ++++ openssl-0.9.8m/util/src-dep.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # we make up an array of + # $file{function_name}=filename; +--- openssl-0.9.8m.orig/util/deleof.pl ++++ openssl-0.9.8m/util/deleof.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + while (<>) + { +--- openssl-0.9.8m.orig/util/arx.pl ++++ openssl-0.9.8m/util/arx.pl +@@ -1,4 +1,4 @@ +-#!/bin/perl ++#!/usr/bin/perl + + # Simple perl script to wrap round "ar" program and exclude any + # object files in the environment variable EXCL_OBJ +--- openssl-0.9.8m.orig/util/copy.pl ++++ openssl-0.9.8m/util/copy.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + use Fcntl; + +--- openssl-0.9.8m.orig/util/mkdir-p.pl ++++ openssl-0.9.8m/util/mkdir-p.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + + # mkdir-p.pl + +--- openssl-0.9.8m.orig/util/mkdef.pl ++++ openssl-0.9.8m/util/mkdef.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl + # + # generate a .def file + # +--- openssl-0.9.8m.orig/util/files.pl ++++ openssl-0.9.8m/util/files.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # used to generate the file MINFO for use by util/mk1mf.pl + # It is basically a list of all variables from the passed makefile +--- openssl-0.9.8m.orig/util/mkfiles.pl ++++ openssl-0.9.8m/util/mkfiles.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # This is a hacked version of files.pl for systems that can't do a 'make files'. + # Do a perl util/mkminfo.pl >MINFO to build MINFO +--- openssl-0.9.8m.orig/util/perlpath.pl ++++ openssl-0.9.8m/util/perlpath.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # modify the '#!/usr/local/bin/perl' + # line in all scripts that rely on perl. +--- openssl-0.9.8m.orig/util/mk1mf.pl ++++ openssl-0.9.8m/util/mk1mf.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # A bit of an evil hack but it post processes the file ../MINFO which + # is generated by `make files` in the top directory. + # This script outputs one mega makefile that has no shell stuff or any +--- openssl-0.9.8m.orig/util/err-ins.pl ++++ openssl-0.9.8m/util/err-ins.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # tack error codes onto the end of a file + # +--- openssl-0.9.8m.orig/util/pl/Mingw32.pl ++++ openssl-0.9.8m/util/pl/Mingw32.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # Mingw32.pl -- Mingw + # +--- openssl-0.9.8m.orig/util/pl/unix.pl ++++ openssl-0.9.8m/util/pl/unix.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # unix.pl - the standard unix makefile stuff. + # +--- openssl-0.9.8m.orig/util/pl/netware.pl ++++ openssl-0.9.8m/util/pl/netware.pl +@@ -1,4 +1,4 @@ +-# Metrowerks Codewarrior or gcc / nlmconv for NetWare ++#!/usr/bin/perl + # + + $version_header = "crypto/opensslv.h"; +--- openssl-0.9.8m.orig/util/pl/VC-32.pl ++++ openssl-0.9.8m/util/pl/VC-32.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # VC-32.pl - unified script for Microsoft Visual C++, covering Win32, + # Win64 and WinCE [follow $FLAVOR variable to trace the differences]. + # +--- openssl-0.9.8m.orig/util/pl/OS2-EMX.pl ++++ openssl-0.9.8m/util/pl/OS2-EMX.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # OS2-EMX.pl - for EMX GCC on OS/2 + # +--- openssl-0.9.8m.orig/util/pl/ultrix.pl ++++ openssl-0.9.8m/util/pl/ultrix.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # linux.pl - the standard unix makefile stuff. + # +--- openssl-0.9.8m.orig/util/pl/linux.pl ++++ openssl-0.9.8m/util/pl/linux.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # linux.pl - the standard unix makefile stuff. + # +--- openssl-0.9.8m.orig/util/pl/BC-32.pl ++++ openssl-0.9.8m/util/pl/BC-32.pl +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # Borland C++ builder 3 and 4 -- Janez Jere + # + diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pic.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pic.patch new file mode 100644 index 0000000000..5fc8f658f0 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pic.patch @@ -0,0 +1,303 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8o/crypto/Makefile +=================================================================== +--- openssl-0.9.8o.orig/crypto/Makefile 2008-09-17 17:10:55.000000000 +0000 ++++ openssl-0.9.8o/crypto/Makefile 2010-06-06 13:09:28.000000000 +0000 +@@ -57,7 +57,7 @@ + echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \ + echo '#endif' ) >buildinf.h + +-x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl ++x86cpuid-elf.S: x86cpuid.pl perlasm/x86asm.pl + $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@ + x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl + $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@ +@@ -70,7 +70,7 @@ + uplink-cof.s: ../ms/uplink.pl + $(PERL) ../ms/uplink.pl coff > $@ + +-x86_64cpuid.s: x86_64cpuid.pl ++x86_64cpuid.S: x86_64cpuid.pl + $(PERL) x86_64cpuid.pl $@ + ia64cpuid.s: ia64cpuid.S + $(CC) $(CFLAGS) -E ia64cpuid.S > $@ +Index: openssl-0.9.8o/crypto/x86_64cpuid.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/x86_64cpuid.pl 2007-11-11 16:25:00.000000000 +0000 ++++ openssl-0.9.8o/crypto/x86_64cpuid.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -95,7 +95,11 @@ + .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu + + .section .init ++#ifdef OPENSSL_PIC ++ call OPENSSL_cpuid_setup\@PLT ++#else + call OPENSSL_cpuid_setup ++#endif + + ___ + +Index: openssl-0.9.8o/crypto/md5/Makefile +=================================================================== +--- openssl-0.9.8o.orig/crypto/md5/Makefile 2008-09-17 17:11:02.000000000 +0000 ++++ openssl-0.9.8o/crypto/md5/Makefile 2010-06-06 13:09:28.000000000 +0000 +@@ -52,7 +52,8 @@ + mx86-out.s: asm/md5-586.pl ../perlasm/x86asm.pl + (cd asm; $(PERL) md5-586.pl a.out $(CFLAGS) > ../$@) + +-md5-x86_64.s: asm/md5-x86_64.pl; $(PERL) asm/md5-x86_64.pl $@ ++md5-x86_64.s: asm/md5-x86_64.pl ++ $(PERL) asm/md5-x86_64.pl $@ + + files: + $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO +Index: openssl-0.9.8o/crypto/des/asm/desboth.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/des/asm/desboth.pl 2001-10-24 21:20:56.000000000 +0000 ++++ openssl-0.9.8o/crypto/des/asm/desboth.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -16,6 +16,11 @@ + + &push("edi"); + ++ &call (&label("pic_point0")); ++ &set_label("pic_point0"); ++ &blindpop("ebp"); ++ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]"); ++ + &comment(""); + &comment("Load the data words"); + &mov($L,&DWP(0,"ebx","",0)); +@@ -47,15 +52,21 @@ + &mov(&swtmp(2), (DWC(($enc)?"1":"0"))); + &mov(&swtmp(1), "eax"); + &mov(&swtmp(0), "ebx"); +- &call("DES_encrypt2"); ++ &exch("ebx", "ebp"); ++ &call("DES_encrypt2\@PLT"); ++ &exch("ebx", "ebp"); + &mov(&swtmp(2), (DWC(($enc)?"0":"1"))); + &mov(&swtmp(1), "edi"); + &mov(&swtmp(0), "ebx"); +- &call("DES_encrypt2"); ++ &exch("ebx", "ebp"); ++ &call("DES_encrypt2\@PLT"); ++ &exch("ebx", "ebp"); + &mov(&swtmp(2), (DWC(($enc)?"1":"0"))); + &mov(&swtmp(1), "esi"); + &mov(&swtmp(0), "ebx"); +- &call("DES_encrypt2"); ++ &exch("ebx", "ebp"); ++ &call("DES_encrypt2\@PLT"); ++ &exch("ebx", "ebp"); + + &stack_pop(3); + &mov($L,&DWP(0,"ebx","",0)); +Index: openssl-0.9.8o/crypto/rc4/Makefile +=================================================================== +--- openssl-0.9.8o.orig/crypto/rc4/Makefile 2008-11-19 16:03:50.000000000 +0000 ++++ openssl-0.9.8o/crypto/rc4/Makefile 2010-06-06 13:09:28.000000000 +0000 +@@ -51,7 +51,7 @@ + rx86-out.s: asm/rc4-586.pl ../perlasm/x86asm.pl + (cd asm; $(PERL) rc4-586.pl a.out $(CFLAGS) > ../$@) + +-rc4-x86_64.s: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@ ++rc4-x86_64.S: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@ + + rc4-ia64.s: asm/rc4-ia64.S + @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ +Index: openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/rc4/asm/rc4-x86_64.pl 2008-09-16 10:47:27.000000000 +0000 ++++ openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -270,7 +270,11 @@ + xor %r10,%r10 + xor %r11,%r11 + ++#ifdef OPENSSL_PIC ++ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d ++#else + mov OPENSSL_ia32cap_P(%rip),$idx#d ++#endif + bt \$20,$idx#d + jnc .Lw1stloop + bt \$30,$idx#d +@@ -338,7 +342,11 @@ + RC4_options: + .picmeup %rax + lea .Lopts-.(%rax),%rax ++#ifdef OPENSSL_PIC ++ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx ++#else + mov OPENSSL_ia32cap_P(%rip),%edx ++#endif + bt \$20,%edx + jnc .Ldone + add \$12,%rax +Index: openssl-0.9.8o/crypto/perlasm/x86unix.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/perlasm/x86unix.pl 2008-05-01 23:11:32.000000000 +0000 ++++ openssl-0.9.8o/crypto/perlasm/x86unix.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -400,6 +400,29 @@ + $stack=4; + } + ++sub main'function_begin_B_static ++ { ++ local($func,$extra)=@_; ++ ++ &main'external_label($func); ++ $func=$under.$func; ++ ++ local($tmp)=<<"EOF"; ++.text ++EOF ++ push(@out,$tmp); ++ if ($main'cpp) ++ { push(@out,"TYPE($func,\@function)\n"); } ++ elsif ($main'coff) ++ { $tmp=push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } ++ elsif ($main'aout and !$main'pic) ++ { } ++ else { push(@out,".type $func,\@function\n"); } ++ push(@out,".align\t$align\n"); ++ push(@out,"$func:\n"); ++ $stack=4; ++ } ++ + sub main'function_end + { + local($func)=@_; +@@ -694,7 +717,17 @@ + { + $tmp=<<___; + .section .init ++#ifdef OPENSSL_PIC ++ pushl %ebx ++ call .pic_point0 ++.pic_point0: ++ popl %ebx ++ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx ++ call $under$f\@PLT ++ popl %ebx ++#else + call $under$f ++#endif + jmp .Linitalign + .align $align + .Linitalign: +Index: openssl-0.9.8o/crypto/perlasm/cbc.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/perlasm/cbc.pl 2005-05-09 21:48:00.000000000 +0000 ++++ openssl-0.9.8o/crypto/perlasm/cbc.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -122,7 +122,11 @@ + &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call + &mov(&DWP($data_off+4,"esp","",0), "ebx"); # + +- &call($enc_func); ++ &call (&label("pic_point0")); ++ &set_label("pic_point0"); ++ &blindpop("ebx"); ++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]"); ++ &call("$enc_func\@PLT"); + + &mov("eax", &DWP($data_off,"esp","",0)); + &mov("ebx", &DWP($data_off+4,"esp","",0)); +@@ -187,7 +191,11 @@ + &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call + &mov(&DWP($data_off+4,"esp","",0), "ebx"); # + +- &call($enc_func); ++ &call (&label("pic_point1")); ++ &set_label("pic_point1"); ++ &blindpop("ebx"); ++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]"); ++ &call("$enc_func\@PLT"); + + &mov("eax", &DWP($data_off,"esp","",0)); + &mov("ebx", &DWP($data_off+4,"esp","",0)); +@@ -220,7 +228,11 @@ + &mov(&DWP($data_off,"esp","",0), "eax"); # put back + &mov(&DWP($data_off+4,"esp","",0), "ebx"); # + +- &call($dec_func); ++ &call (&label("pic_point2")); ++ &set_label("pic_point2"); ++ &blindpop("ebx"); ++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]"); ++ &call("$dec_func\@PLT"); + + &mov("eax", &DWP($data_off,"esp","",0)); # get return + &mov("ebx", &DWP($data_off+4,"esp","",0)); # +@@ -263,7 +275,11 @@ + &mov(&DWP($data_off,"esp","",0), "eax"); # put back + &mov(&DWP($data_off+4,"esp","",0), "ebx"); # + +- &call($dec_func); ++ &call (&label("pic_point3")); ++ &set_label("pic_point3"); ++ &blindpop("ebx"); ++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]"); ++ &call("$dec_func\@PLT"); + + &mov("eax", &DWP($data_off,"esp","",0)); # get return + &mov("ebx", &DWP($data_off+4,"esp","",0)); # +Index: openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:00.000000000 +0000 ++++ openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -435,7 +435,7 @@ + + chomp($line); + +- $line =~ s|[#!].*$||; # get rid of asm-style comments... ++# $line =~ s|[#!].*$||; # get rid of asm-style comments... + $line =~ s|/\*.*\*/||; # ... and C-style comments... + $line =~ s|^\s+||; # ... and skip white spaces in beginning + +Index: openssl-0.9.8o/crypto/aes/asm/aes-586.pl +=================================================================== +--- openssl-0.9.8o.orig/crypto/aes/asm/aes-586.pl 2008-12-17 14:14:51.000000000 +0000 ++++ openssl-0.9.8o/crypto/aes/asm/aes-586.pl 2010-06-06 13:09:28.000000000 +0000 +@@ -250,7 +250,7 @@ + sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } } + + &public_label("AES_Te"); +-&function_begin_B("_x86_AES_encrypt"); ++&function_begin_B_static("_x86_AES_encrypt"); + if ($vertical_spin) { + # I need high parts of volatile registers to be accessible... + &exch ($s1="edi",$key="ebx"); +@@ -539,7 +539,7 @@ + } + + &public_label("AES_Td"); +-&function_begin_B("_x86_AES_decrypt"); ++&function_begin_B_static("_x86_AES_decrypt"); + # note that caller is expected to allocate stack frame for me! + &mov (&DWP(12,"esp"),$key); # save key + +@@ -1461,15 +1461,22 @@ + &public_label("AES_Td"); + &public_label("AES_Te"); + &function_begin_B("AES_set_decrypt_key"); ++ &push ("ebx"); + &mov ("eax",&wparam(0)); + &mov ("ecx",&wparam(1)); + &mov ("edx",&wparam(2)); + &sub ("esp",12); ++ ++ &call (&label("pic_point0")); ++ &set_label("pic_point0"); ++ &blindpop("ebx"); ++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]"); + &mov (&DWP(0,"esp"),"eax"); + &mov (&DWP(4,"esp"),"ecx"); + &mov (&DWP(8,"esp"),"edx"); +- &call ("AES_set_encrypt_key"); ++ &call ("AES_set_encrypt_key\@PLT"); + &add ("esp",12); ++ &pop ("ebx"); + &cmp ("eax",0); + &je (&label("proceed")); + &ret (); diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pkg-config.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pkg-config.patch new file mode 100644 index 0000000000..46c6f03e3d --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/pkg-config.patch @@ -0,0 +1,36 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Makefile.org +=================================================================== +--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:34:56.000000000 +0200 ++++ openssl-0.9.8k/Makefile.org 2009-07-19 11:36:02.000000000 +0200 +@@ -444,7 +444,8 @@ + echo 'Description: OpenSSL cryptography library'; \ + echo 'Version: '$(VERSION); \ + echo 'Requires: '; \ +- echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \ ++ echo 'Libs: -L$${libdir} -lcrypto'; \ ++ echo 'Libs.private: $(EX_LIBS)'; \ + echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc + + libssl.pc: Makefile +@@ -457,7 +458,8 @@ + echo 'Description: Secure Sockets Layer and cryptography libraries'; \ + echo 'Version: '$(VERSION); \ + echo 'Requires: '; \ +- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ ++ echo 'Libs: -L$${libdir} -lssl'; \ ++ echo 'Libs.private: -lcrypto $(EX_LIBS)'; \ + echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc + + openssl.pc: Makefile +@@ -470,7 +472,8 @@ + echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ + echo 'Version: '$(VERSION); \ + echo 'Requires: '; \ +- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ ++ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \ ++ echo 'Libs.private: $(EX_LIBS)'; \ + echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc + + Makefile: Makefile.org Configure config diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rc4-amd64.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rc4-amd64.patch new file mode 100644 index 0000000000..f57fbc9352 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rc4-amd64.patch @@ -0,0 +1,16 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Configure +=================================================================== +--- openssl-0.9.8k.orig/Configure 2009-07-19 11:32:41.000000000 +0200 ++++ openssl-0.9.8k/Configure 2009-07-19 11:37:10.000000000 +0200 +@@ -128,6 +128,9 @@ + my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o MAYBE-MO86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o rc4_skey.o:rm86-out.o:r586-out.o"; + + my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o::"; ++# rc4 asm is disabled on amd64 because we configured it with RC4_CHAR while ++# the assembler only works with int ++my $x86_64_asm_linux="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::::"; + my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o::"; + + my $no_asm="::::::::::"; diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash-crt.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash-crt.patch new file mode 100644 index 0000000000..d9d6b70b30 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash-crt.patch @@ -0,0 +1,35 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/tools/c_rehash.in +=================================================================== +--- openssl-0.9.8k.orig/tools/c_rehash.in 2002-10-11 22:31:27.000000000 +0200 ++++ openssl-0.9.8k/tools/c_rehash.in 2009-07-19 11:36:26.000000000 +0200 +@@ -59,12 +59,15 @@ + } + } + closedir DIR; +- FILE: foreach $fname (grep {/\.pem$/} @flist) { ++ FILE: foreach $fname (grep {/\.pem$|\.crt$/} @flist) { + # Check to see if certificates and/or CRLs present. + my ($cert, $crl) = check_file($fname); + if(!$cert && !$crl) { +- print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n"; +- next; ++ ($cert, $crl) = check_file("$openssl x509 -in \"$fname\" -inform der -outform pem | "); ++ if(!$cert && !$crl) { ++ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n"; ++ next; ++ } + } + link_hash_cert($fname) if($cert); + link_hash_crl($fname) if($crl); +@@ -102,6 +105,9 @@ + my $fname = $_[0]; + $fname =~ s/'/'\\''/g; + my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname'`; ++ if(!$hash || !fprint) { ++ ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname' -inform der`; ++ } + chomp $hash; + chomp $fprint; + $fprint =~ s/^.*=//; diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash_pod.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash_pod.patch new file mode 100644 index 0000000000..3426ba8168 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/rehash_pod.patch @@ -0,0 +1,62 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/doc/apps/c_rehash.pod +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8k/doc/apps/c_rehash.pod 2009-07-19 11:36:27.000000000 +0200 +@@ -0,0 +1,55 @@ ++ ++=pod ++ ++=head1 NAME ++ ++c_rehash - Create symbolic links to files named by the hash values ++ ++=head1 SYNOPSIS ++ ++B ++[directory] ... ++ ++=head1 DESCRIPTION ++ ++c_rehash scans directories and takes a hash value of each .pem and .crt file in the directory. It then creates symbolic links for each of the files named by the hash value. This is useful as many programs require directories to be set up like this in order to find the certificates they require. ++ ++If any directories are named on the command line then these directories are processed in turn. If not then and the environment variable SSL_CERT_DIR is defined then that is consulted. This variable should be a colon (:) separated list of directories, all of which will be processed. If neither of these conditions are true then /usr/lib/ssl/certs is processed. ++ ++For each directory that is to be processed he user must have write permissions on the directory, if they do not then nothing will be printed for that directory. ++ ++Note that this program deletes all the symbolic links that look like ones that it creates before processing a directory. Beware that if you run the program on a directory that contains symbolic links for other purposes that are named in the same format as those created by this program they will be lost. ++ ++The hashes for certificate files are of the form . where n is an integer. If the hash value already exists then n will be incremented, unless the file is a duplicate. Duplicates are detected using the fingerprint of the certificate. A warning will be printed if a duplicate is detected. The hashes for CRL files are of the form .r and have the same behavior. ++ ++The program will also warn if there are files with extension .pem which are not certificate or CRL files. ++ ++The program uses the openssl program to compute the hashes and fingerprints. It expects the executable to be named openssl and be on the PATH, or in the /usr/lib/ssl/bin directory. If the OPENSSL environment variable is defined then this is used instead as the executable that provides the hashes and fingerprints. When called as $OPENSSL x509 -hash -fingerprint -noout -in $file it must output the hash of $file on the first line followed by the fingerprint on the second line, optionally prefixed with some text and an equals sign (=). ++ ++=head1 OPTIONS ++ ++None ++ ++=head1 ENVIRONMENT ++ ++=over 4 ++ ++=item B ++ ++The name (and path) of an executable to use to generate hashes and fingerprints (see above). ++ ++=item B ++ ++Colon separated list of directories to operate on. Ignored if directories are listed on the command line. ++ ++=head1 SEE ALSO ++ ++L, L ++ ++=back ++ ++=head1 BUGS ++ ++No known bugs ++ ++=cut diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/series b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/series new file mode 100644 index 0000000000..b764c0414d --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/series @@ -0,0 +1,20 @@ +ca.patch +config-hurd.patch +debian-targets.patch +engines-path.patch +kfreebsd-pipe.patch +make-targets.patch +man-dir.patch +man-section.patch +no-rpath.patch +no-symbolic.patch +pic.patch +pkg-config.patch +valgrind.patch +rc4-amd64.patch +rehash-crt.patch +rehash_pod.patch +shared-lib-ext.patch +stddef.patch +version-script.patch +perl-path.diff diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/shared-lib-ext.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/shared-lib-ext.patch new file mode 100644 index 0000000000..79eb39f79b --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/shared-lib-ext.patch @@ -0,0 +1,16 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/Configure +=================================================================== +--- openssl-0.9.8k.orig/Configure 2009-07-19 11:36:24.000000000 +0200 ++++ openssl-0.9.8k/Configure 2009-07-19 11:37:03.000000000 +0200 +@@ -1568,7 +1568,8 @@ + elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/) + { + my $sotmp = $1; +- s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/; ++# s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/; ++ s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/; + } + elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/) + { diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/stddef.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/stddef.patch new file mode 100644 index 0000000000..3436b29937 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/stddef.patch @@ -0,0 +1,14 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8k/crypto/sha/sha.h +=================================================================== +--- openssl-0.9.8k.orig/crypto/sha/sha.h 2008-09-16 12:47:28.000000000 +0200 ++++ openssl-0.9.8k/crypto/sha/sha.h 2009-07-19 11:36:28.000000000 +0200 +@@ -59,6 +59,7 @@ + #ifndef HEADER_SHA_H + #define HEADER_SHA_H + ++#include + #include + #include + diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/version-script.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/version-script.patch new file mode 100644 index 0000000000..6fa3d75d4b --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/debian/version-script.patch @@ -0,0 +1,35 @@ +Upstream-Status: Backport [debian] + +Index: openssl-0.9.8m/Configure +=================================================================== +--- openssl-0.9.8m.orig/Configure 2010-02-27 12:28:32.000000000 +0100 ++++ openssl-0.9.8m/Configure 2010-02-27 12:28:35.000000000 +0100 +@@ -1512,6 +1512,8 @@ + } + } + ++$shared_ldflag .= " -Wl,--version-script=openssl.ld"; ++ + open(IN,'$Makefile.new") || die "unable to create $Makefile.new:$!\n"; +Index: openssl-0.9.8m/openssl.ld +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8m/openssl.ld 2010-02-27 12:28:35.000000000 +0100 +@@ -0,0 +1,5 @@ ++OPENSSL_0.9.8 { ++ global: ++ *; ++}; ++ +Index: openssl-0.9.8m/engines/openssl.ld +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ openssl-0.9.8m/engines/openssl.ld 2010-02-27 12:28:35.000000000 +0100 +@@ -0,0 +1,5 @@ ++OPENSSL_0.9.8 { ++ global: ++ *; ++}; ++ diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/parallel-make-fix.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/parallel-make-fix.patch new file mode 100644 index 0000000000..82857f5744 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/parallel-make-fix.patch @@ -0,0 +1,20 @@ +Upstream-Status: Submitted + +fix the parallel build regarding shared libraries. + +Signed-off-by: Qing He + +diff --git a/Makefile.org b/Makefile.org +index 2fb0309..8bec3d0 100644 +--- a/Makefile.org ++++ b/Makefile.org +@@ -352,6 +352,9 @@ all_testapps: build_libs build_testapps + build_testapps: + @dir=crypto; target=testapps; $(BUILD_ONE_CMD) + ++libcrypto.a: build_crypto ++libssl.a: build_ssl ++ + build_shared: $(SHARED_LIBS) + libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS) + @if [ "$(SHLIB_TARGET)" != "" ]; then \ diff --git a/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/shared-libs.patch b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/shared-libs.patch new file mode 100644 index 0000000000..19de11243a --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl-0.9.8w/shared-libs.patch @@ -0,0 +1,50 @@ +Upstream-Status: Inappropriate [configuration] + +diff --git a/Makefile.org b/Makefile.org +index e87d623..25ff367 100644 +--- a/Makefile.org ++++ b/Makefile.org +@@ -355,7 +355,7 @@ libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS) + @if [ "$(SHLIB_TARGET)" != "" ]; then \ + if [ "$(FIPSCANLIB)" = "libfips" ]; then \ + $(ARD) libcrypto.a fipscanister.o ; \ +- $(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \ ++ $(MAKE) -e SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \ + $(AR) libcrypto.a fips/fipscanister.o ; \ + else \ + if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ +@@ -373,7 +373,7 @@ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a + @if [ "$(SHLIB_TARGET)" != "" ]; then \ + shlibdeps=-lcrypto; \ + [ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \ +- $(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \ ++ $(MAKE) -e SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \ + else \ + echo "There's no support for shared libraries on this platform" >&2 ; \ + exit 1; \ +diff --git a/crypto/Makefile b/crypto/Makefile +index 6557f2b..a69bf7c 100644 +--- a/crypto/Makefile ++++ b/crypto/Makefile +@@ -103,7 +103,7 @@ $(LIB): $(LIBOBJ) + + shared: buildinf.h lib subdirs + if [ -n "$(SHARED_LIBS)" ]; then \ +- (cd ..; $(MAKE) $(SHARED_LIB)); \ ++ (cd ..; $(MAKE) -e $(SHARED_LIB)); \ + fi + + libs: +diff --git a/ssl/Makefile b/ssl/Makefile +index 5ac3507..77ea2bd 100644 +--- a/ssl/Makefile ++++ b/ssl/Makefile +@@ -62,7 +62,7 @@ lib: $(LIBOBJ) + + shared: lib + if [ -n "$(SHARED_LIBS)" ]; then \ +- (cd ..; $(MAKE) $(SHARED_LIB)); \ ++ (cd ..; $(MAKE) -e $(SHARED_LIB)); \ + fi + + files: diff --git a/meta-openpli/recipes-connectivity/openssl/openssl_0.9.8w.bb b/meta-openpli/recipes-connectivity/openssl/openssl_0.9.8w.bb new file mode 100644 index 0000000000..0a8f6667d7 --- /dev/null +++ b/meta-openpli/recipes-connectivity/openssl/openssl_0.9.8w.bb @@ -0,0 +1,38 @@ +require recipes-connectivity/openssl/openssl.inc + +PR = "${INC_PR}.0" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" + +SRC_URI += "file://debian/ca.patch \ + file://debian/config-hurd.patch;apply=no \ + file://debian/debian-targets.patch \ + file://debian/engines-path.patch \ + file://debian/kfreebsd-pipe.patch;apply=no \ + file://debian/make-targets.patch \ + file://debian/man-dir.patch \ + file://debian/man-section.patch \ + file://debian/no-rpath.patch \ + file://debian/no-symbolic.patch \ + file://debian/pic.patch \ + file://debian/pkg-config.patch \ + file://debian/rc4-amd64.patch \ + file://debian/rehash-crt.patch \ + file://debian/rehash_pod.patch \ + file://debian/shared-lib-ext.patch \ + file://debian/stddef.patch \ + file://debian/version-script.patch \ + file://debian/perl-path.diff" + +SRC_URI += "file://configure-targets.patch \ + file://shared-libs.patch \ + file://parallel-make-fix.patch" + +SRC_URI[md5sum] = "4ceb7d570e42c094b360cc7b8e848a0b" +SRC_URI[sha256sum] = "537411fe2cfe249a8a5b98b3f809a07ed5f913b94a216b3c510fd353318e4593" + +EXTRA_OECONF += "no-idea no-mdc2 no-rc5" + +BBCLASSEXTEND = "native nativesdk" + +PARALLEL_MAKEINST = "" diff --git a/meta-openpli/recipes-connectivity/realtek/rtl8192cu/additional_productids.patch b/meta-openpli/recipes-connectivity/realtek/rtl8192cu/additional_productids.patch new file mode 100644 index 0000000000..5e822bee9c --- /dev/null +++ b/meta-openpli/recipes-connectivity/realtek/rtl8192cu/additional_productids.patch @@ -0,0 +1,19 @@ +--- a/os_dep/linux/usb_intf.c 2012-04-04 22:21:58.952093091 +0200 ++++ b/os_dep/linux/usb_intf.c 2012-04-04 22:22:01.108093195 +0200 +@@ -114,6 +114,8 @@ + {USB_DEVICE(0x4856, 0x0091)},//NetweeN - Feixun + {USB_DEVICE(0x2019, 0x4902)},//Planex - Etop + {USB_DEVICE(0x2019, 0xAB2E)},//SW-WF02-AD15 -Abocom ++ {USB_DEVICE(0x0846, 0x9041)},//NetGear WNA1000M ++ {USB_DEVICE(0x07b8, 0x8188)},//Abocom - Abocom + + /****** 8188 RU ********/ + {USB_DEVICE(0x0BDA, 0x317F)},//Netcore,Netcore +@@ -121,6 +123,7 @@ + /****** 8188CE-VAU ********/ + {USB_DEVICE(0x13D3, 0x3359)},// - Azwave + {USB_DEVICE(0x13D3, 0x3358)},// - Azwave ++ {USB_DEVICE(0x9846, 0x9041)},//Netgear Cameo + + /****** 8188CUS Slim Solo********/ + {USB_DEVICE(0x04F2, 0xAFF7)},//XAVI - XAVI diff --git a/meta-openpli/recipes-connectivity/realtek/rtl8192cu_3.3.0.bb b/meta-openpli/recipes-connectivity/realtek/rtl8192cu_3.3.0.bb new file mode 100644 index 0000000000..9fd79cea3b --- /dev/null +++ b/meta-openpli/recipes-connectivity/realtek/rtl8192cu_3.3.0.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "driver for Realtek USB wireless devices" +SECTION = "kernel/modules" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://hal/hal_init.c;beginline=1;endline=19;md5=f8d10a6bd2fdfa240c0634a7c660c57f" + +RREPLACES_${PN} = "kernel-module-rtl8192cu" + +inherit module + +SRC_URI = "http://downloads.pli-images.org/misc/rtl8188C_8192C_8192D_usb_linux_v3.3.0_2971.20111128.tar.gz \ + file://additional_productids.patch \ + " + +S = "${WORKDIR}/rtl8188C_8192C_8192D_usb_linux_v3.3.0_2971.20111128" + +MACHINE_KERNEL_PR_append = ".2" + +EXTRA_OEMAKE = "KSRC=${STAGING_KERNEL_DIR}" + +do_install() { + install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless + install -m 0644 ${S}/8192cu.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless + install -d ${D}/etc/modutils + echo 8192cu > ${D}/etc/modutils/r8192cu +} + +SRC_URI[md5sum] = "6d5bd5f94d9d6d6667393839c1861101" +SRC_URI[sha256sum] = "fab0db3ee9fa60beff5ca18248e0ed20bf439873f94461c47e0deda28d184b2b" diff --git a/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd/sabnzbd b/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd/sabnzbd new file mode 100644 index 0000000000..e7964eee79 --- /dev/null +++ b/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd/sabnzbd @@ -0,0 +1,22 @@ +#!/bin/sh + +# hmm, todo... + +stopit() { + CFG="/home/root/.sabnzbd/sabnzbd.ini" + APIKEY=`grep '^api_key =' $CFG | cut -b 11-` + /usr/bin/wget -q -O - "http://localhost:8085/sabnzbd/api?mode=shutdown&apikey=${APIKEY}" +} + +case "$1" in + start) + /usr/lib/sabnzbd/SABnzbd.py -d + ;; + stop) + stopit + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 +esac + diff --git a/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd_0.5.6.bb b/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd_0.5.6.bb new file mode 100644 index 0000000000..fd9d0cf162 --- /dev/null +++ b/meta-openpli/recipes-connectivity/sabnzbd/sabnzbd_0.5.6.bb @@ -0,0 +1,43 @@ +MAINTAINER = "team@sabnzbd.org" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYRIGHT.txt;md5=f2b0e8d69071fdbf437ab1e542ffdf77" + +PR = "r1" + +DEPENDS = "python" +RDEPENDS_${PN} = "\ + python-core python-shell python-compression python-crypt python-ctypes python-sqlite3 \ + python-cheetah python-misc python-subprocess python-html python-email python-yenc \ + " +RRECOMMENDS_${PN} = "par2cmdline unrar" + +SRC_URI = "${SOURCEFORGE_MIRROR}/sabnzbdplus/sabnzbdplus/sabnzbd-${PV}/SABnzbd-${PV}-src.tar.gz \ + file://sabnzbd" + +SRC_URI[md5sum] = "6a43179f42e31bed3faa0135a213bc65" +SRC_URI[sha256sum] = "dc83f3e2f9af2d3cd32cd02e88de7522e37b5d0732e59498b67244cca1d5cb22" + +S = "${WORKDIR}/SABnzbd-${PV}" + +INSTALLDIR = "/usr/lib/${PN}" + +PACKAGES = "${PN}-doc ${PN}-src ${PN}" + +FILES_${PN}-src = "${INSTALLDIR}/*/*.py ${INSTALLDIR}/*/*/*.py" +FILES_${PN}-doc = "${INSTALLDIR}/*.txt ${INSTALLDIR}/licenses ${INSTALLDIR}/interfaces/*/licenses" +FILES_${PN} = "${INSTALLDIR} /etc/init.d/sabnzbd" + +inherit update-rc.d +INITSCRIPT_NAME = "sabnzbd" +INITSCRIPT_PARAMS = "defaults" + +do_compile() { + python -m compileall . +} + +do_install() { + install -d ${D}${INSTALLDIR} + cp -r . ${D}${INSTALLDIR}/ + install -d ${D}/etc/init.d + install -m 755 ${WORKDIR}/sabnzbd ${D}/etc/init.d/sabnzbd +} diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/0001-s3-schannel-client-Push-the-domain-and-netbios-name-.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/0001-s3-schannel-client-Push-the-domain-and-netbios-name-.patch new file mode 100644 index 0000000000..832ce9d6d9 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/0001-s3-schannel-client-Push-the-domain-and-netbios-name-.patch @@ -0,0 +1,31 @@ +From 51aaf9c6812430975dcd2cf9a632eb8d241ec41e Mon Sep 17 00:00:00 2001 +From: Andrew Bartlett +Date: Thu, 3 Jun 2010 09:35:31 +1000 +Subject: [PATCH] s3:schannel client Push the domain and netbios name into the DOS charset + +If the netbios name is not just ASCII, then we have to get it into the +right character set. + +Andrew Bartlett +--- + source/rpc_parse/parse_rpc.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git source/rpc_parse/parse_rpc.c source/rpc_parse/parse_rpc.c +index 2d166c7..7b4b8e8 100644 +--- source/rpc_parse/parse_rpc.c ++++ source/rpc_parse/parse_rpc.c +@@ -786,8 +786,8 @@ void init_rpc_auth_schannel_neg(RPC_AUTH_SCHANNEL_NEG *neg, + { + neg->type1 = 0; + neg->type2 = 0x3; +- fstrcpy(neg->domain, domain); +- fstrcpy(neg->myname, myname); ++ push_ascii_fstring(neg->domain, domain); ++ push_ascii_fstring(neg->myname, myname); + } + + /******************************************************************* +-- +1.7.0.1 + diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/configure.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/configure.patch new file mode 100644 index 0000000000..ddcb9e9a15 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/configure.patch @@ -0,0 +1,213 @@ +diff -urN source.old//aclocal.m4 source//aclocal.m4 +--- source.old//aclocal.m4 2008-08-25 22:09:21.000000000 +0100 ++++ source//aclocal.m4 2008-11-23 17:44:58.050646210 +0000 +@@ -1,5 +1,5 @@ + dnl test whether dirent has a d_off member +-AC_DEFUN(AC_DIRENT_D_OFF, ++AC_DEFUN([AC_DIRENT_D_OFF], + [AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off, + [AC_TRY_COMPILE([ + #include +@@ -13,7 +13,7 @@ + + dnl Mark specified module as shared + dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared) +-AC_DEFUN(SMB_MODULE, ++AC_DEFUN([SMB_MODULE], + [ + AC_MSG_CHECKING([how to build $1]) + if test "$[MODULE_][$1]"; then +@@ -44,7 +44,7 @@ + fi + ]) + +-AC_DEFUN(SMB_SUBSYSTEM, ++AC_DEFUN([SMB_SUBSYSTEM], + [ + AC_SUBST($1_STATIC) + AC_SUBST($1_MODULES) +@@ -229,7 +229,7 @@ + + dnl Define an AC_DEFINE with ifndef guard. + dnl AC_N_DEFINE(VARIABLE [, VALUE]) +-define(AC_N_DEFINE, ++define([AC_N_DEFINE], + [cat >> confdefs.h <<\EOF + [#ifndef] $1 + [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) +@@ -239,14 +239,14 @@ + + dnl Add an #include + dnl AC_ADD_INCLUDE(VARIABLE) +-define(AC_ADD_INCLUDE, ++define([AC_ADD_INCLUDE], + [cat >> confdefs.h <<\EOF + [#include] $1 + EOF + ]) + + dnl Copied from libtool.m4 +-AC_DEFUN(AC_PROG_LD_GNU, ++AC_DEFUN([AC_PROG_LD_GNU], + [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, + [# I'd rather use --version here, but apparently some GNU ld's only accept -v. + if $LD -v 2>&1 &5; then +@@ -257,7 +257,7 @@ + ]) + + dnl Removes -I/usr/include/? from given variable +-AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[ ++AC_DEFUN([CFLAGS_REMOVE_USR_INCLUDE],[ + ac_new_flags="" + for i in [$]$1; do + case [$]i in +@@ -270,7 +270,7 @@ + + dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]' + dnl and '-Wl,-rpath -Wl,/usr/lib[/]' from given variable +-AC_DEFUN(LIB_REMOVE_USR_LIB,[ ++AC_DEFUN([LIB_REMOVE_USR_LIB],[ + ac_new_flags="" + l="" + for i in [$]$1; do +@@ -301,7 +301,7 @@ + + dnl From Bruno Haible. + +-AC_DEFUN(jm_ICONV, ++AC_DEFUN([jm_ICONV], + [ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable libiconv installed). +@@ -387,7 +387,7 @@ + fi + ]) + +-AC_DEFUN(rjs_CHARSET,[ ++AC_DEFUN([rjs_CHARSET],[ + dnl Find out if we can convert from $1 to UCS2-LE + AC_MSG_CHECKING([can we convert from $1 to UCS2-LE?]) + AC_TRY_RUN([ +@@ -405,7 +405,7 @@ + + dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR) + dnl This function doesn't add -I/usr/include into CFLAGS +-AC_DEFUN(CFLAGS_ADD_DIR,[ ++AC_DEFUN([CFLAGS_ADD_DIR],[ + if test "$2" != "/usr/include" ; then + $1="$$1 -I$2" + fi +@@ -413,7 +413,7 @@ + + dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR) + dnl This function doesn't add -L/usr/lib into LDFLAGS +-AC_DEFUN(LIB_ADD_DIR,[ ++AC_DEFUN([LIB_ADD_DIR],[ + if test "$2" != "/usr/lib" ; then + $1="$$1 -L$2" + fi +@@ -486,7 +486,7 @@ + dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS, + dnl [ACTION-IF-TRUE],[ACTION-IF-FALSE], + dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) +-AC_DEFUN( [AC_TRY_RUN_STRICT], ++AC_DEFUN([AC_TRY_RUN_STRICT], + [ + old_CFLAGS="$CFLAGS"; + CFLAGS="$2"; +diff -urN source.old//configure.in source//configure.in +--- source.old//configure.in 2008-08-25 22:09:21.000000000 +0100 ++++ source//configure.in 2008-11-23 17:22:17.108791515 +0000 +@@ -1402,7 +1402,7 @@ + #endif + exit(0); + } +-], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no]) ++], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no], [linux_getgrouplist_ok=cross]) + if test x"$linux_getgrouplist_ok" = x"yes"; then + AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) + fi +diff -urN source.old//lib/replace/libreplace.m4 source//lib/replace/libreplace.m4 +--- source.old//lib/replace/libreplace.m4 2008-08-25 22:09:21.000000000 +0100 ++++ source//lib/replace/libreplace.m4 2008-11-23 17:54:27.942153096 +0000 +@@ -1,4 +1,4 @@ +-AC_DEFUN_ONCE(AC_LIBREPLACE_LOCATION_CHECKS, ++AC_DEFUN_ONCE([AC_LIBREPLACE_LOCATION_CHECKS], + [ + echo "LIBREPLACE_LOCATION_CHECKS: START" + +@@ -27,7 +27,7 @@ + ]) dnl end AC_LIBREPLACE_LOCATION_CHECKS + + +-AC_DEFUN_ONCE(AC_LIBREPLACE_BROKEN_CHECKS, ++AC_DEFUN_ONCE([AC_LIBREPLACE_BROKEN_CHECKS], + [ + echo "LIBREPLACE_BROKEN_CHECKS: START" + +@@ -325,25 +325,25 @@ + AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) + fi + +-m4_include(system/config.m4) ++m4_include(lib/replace/system/config.m4) + +-m4_include(dlfcn.m4) +-m4_include(getpass.m4) +-m4_include(strptime.m4) +-m4_include(win32.m4) +-m4_include(timegm.m4) +-m4_include(repdir.m4) ++m4_include(lib/replace/dlfcn.m4) ++m4_include(lib/replace/getpass.m4) ++m4_include(lib/replace/strptime.m4) ++m4_include(lib/replace/win32.m4) ++m4_include(lib/replace/timegm.m4) ++m4_include(lib/replace/repdir.m4) + + AC_CHECK_FUNCS([syslog memset memcpy],,[AC_MSG_ERROR([Required function not found])]) + + echo "LIBREPLACE_BROKEN_CHECKS: END" + ]) dnl end AC_LIBREPLACE_BROKEN_CHECKS + +-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_START, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ALL_CHECKS_START], + [ + #LIBREPLACE_ALL_CHECKS: START" + ]) +-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_END, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ALL_CHECKS_END], + [ + #LIBREPLACE_ALL_CHECKS: END" + ]) +@@ -356,6 +356,6 @@ + AC__LIBREPLACE_ALL_CHECKS_END + ]) + +-m4_include(libreplace_cc.m4) +-m4_include(libreplace_macros.m4) +-m4_include(autoconf-2.60.m4) ++m4_include(lib/replace/libreplace_cc.m4) ++m4_include(lib/replace/libreplace_macros.m4) ++m4_include(lib/replace/autoconf-2.60.m4) +diff -urN source.old//lib/replace/libreplace_macros.m4 source//lib/replace/libreplace_macros.m4 +--- source.old//lib/replace/libreplace_macros.m4 2008-08-25 22:09:21.000000000 +0100 ++++ source//lib/replace/libreplace_macros.m4 2008-11-23 17:31:08.269791372 +0000 +@@ -76,7 +76,7 @@ + ]) + + dnl AC_PROG_CC_FLAG(flag) +-AC_DEFUN(AC_PROG_CC_FLAG, ++AC_DEFUN([AC_PROG_CC_FLAG], + [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1, + [echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then +@@ -103,7 +103,7 @@ + dnl see if a declaration exists for a function or variable + dnl defines HAVE_function_DECL if it exists + dnl AC_HAVE_DECL(var, includes) +-AC_DEFUN(AC_HAVE_DECL, ++AC_DEFUN([AC_HAVE_DECL], + [ + AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[ + AC_TRY_COMPILE([$2],[int i = (int)$1], diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/kernel-oplocks.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/kernel-oplocks.patch new file mode 100644 index 0000000000..bee0f1dc04 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/kernel-oplocks.patch @@ -0,0 +1,20 @@ +Linux oplock support is conditional on HAVE_KERNEL_OPLOCKS_LINUX, +not plain old LINUX. + +http://websvn.samba.org/cgi-bin/viewcvs.cgi?rev=23962&view=rev +--- source/modules/vfs_default.c.orig 2010-09-06 17:37:48.256826182 +0200 ++++ source/modules/vfs_default.c 2010-09-06 17:38:25.300843377 +0200 +@@ -813,10 +813,11 @@ + + START_PROFILE(syscall_linux_setlease); + +-#ifdef LINUX ++#ifdef HAVE_KERNEL_OPLOCKS_LINUX + /* first set the signal handler */ +- if(linux_set_lease_sighandler(fd) == -1) ++ if(linux_set_lease_sighandler(fd) == -1) { + return -1; ++ } + + result = linux_setlease(fd, leasetype); + #else diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0-CVE-2012-0870.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0-CVE-2012-0870.patch new file mode 100644 index 0000000000..4144a9eb50 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0-CVE-2012-0870.patch @@ -0,0 +1,91 @@ +From f781c9c693462b89b60a3662d2a1224c9387a725 Mon Sep 17 00:00:00 2001 +From: Volker Lendecke +Date: Fri, 10 Feb 2012 08:10:39 +0100 +Subject: [PATCH 1/2] v3-3: AndX offsets are increasing strictly monotonically + +--- + source/smbd/process.c | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +diff --git source/smbd/process.c source/smbd/process.c +index e861e16..f64e1ce 100644 +--- source/smbd/process.c ++++ source/smbd/process.c +@@ -1160,7 +1160,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) + static char *orig_inbuf; + static char *orig_outbuf; + int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0); +- unsigned smb_off2 = SVAL(inbuf,smb_vwv1); ++ static unsigned smb_off2; + char *inbuf2, *outbuf2; + int outsize2; + int new_size; +@@ -1178,8 +1178,16 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) + /* this is the first part of the chain */ + orig_inbuf = inbuf; + orig_outbuf = outbuf; ++ smb_off2 = 0; + } + ++ if (SVAL(inbuf,smb_vwv1) <= smb_off2) { ++ DEBUG(1, ("AndX offset not increasing\n")); ++ SCVAL(outbuf, smb_vwv0, 0xFF); ++ return outsize; ++ } ++ smb_off2 = SVAL(inbuf, smb_vwv1); ++ + /* + * The original Win95 redirector dies on a reply to + * a lockingX and read chain unless the chain reply is +-- +1.7.3.4 + + +From 009bb0be7383777a650a3bc6af1c0d3ab7476ebc Mon Sep 17 00:00:00 2001 +From: Volker Lendecke +Date: Fri, 10 Feb 2012 08:39:33 +0100 +Subject: [PATCH 2/2] v3-0-test: Port back some packet consistency checks + +--- + source/smbd/process.c | 18 ++++++++++++++++++ + 1 files changed, 18 insertions(+), 0 deletions(-) + +diff --git source/smbd/process.c source/smbd/process.c +index f64e1ce..8aabef8 100644 +--- source/smbd/process.c ++++ source/smbd/process.c +@@ -1025,6 +1025,7 @@ static int construct_reply(char *inbuf,char *outbuf,int size,int bufsize) + int outsize = 0; + int msg_type = CVAL(inbuf,0); + uint16_t mid = SVAL(inbuf, smb_mid); ++ uint8_t wct = CVAL(inbuf, smb_wct); + + chain_size = 0; + file_chain_reset(); +@@ -1033,6 +1034,23 @@ static int construct_reply(char *inbuf,char *outbuf,int size,int bufsize) + if (msg_type != 0) + return(reply_special(inbuf,outbuf)); + ++ /* Ensure we have at least wct words and 2 bytes of bcc. */ ++ if (smb_size + wct*2 > size) { ++ DEBUG(0,("init_smb_request: invalid wct number %u (size %u)\n", ++ (unsigned int)wct, ++ (unsigned int)size)); ++ exit_server_cleanly("Invalid SMB request"); ++ } ++ /* Ensure bcc is correct. */ ++ if (((uint8 *)smb_buf(inbuf)) + smb_buflen(inbuf) > inbuf + size) { ++ DEBUG(0,("init_smb_request: invalid bcc number %u " ++ "(wct = %u, size %u)\n", ++ (unsigned int)smb_buflen(inbuf), ++ (unsigned int)wct, ++ (unsigned int)size)); ++ exit_server_cleanly("Invalid SMB request"); ++ } ++ + construct_reply_common(inbuf, outbuf); + + outsize = switch_message(type,inbuf,outbuf,size,bufsize); +-- +1.7.3.4 + diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0.37-CVE-2012-1182.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0.37-CVE-2012-1182.patch new file mode 100644 index 0000000000..bbe38e44b3 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/samba-3.0.37-CVE-2012-1182.patch @@ -0,0 +1,59 @@ +From e11637c2c89c2d38963311416c34a4767b19e175 Mon Sep 17 00:00:00 2001 +From: Stefan Metzmacher +Date: Sat, 17 Mar 2012 01:22:27 +0100 +Subject: [PATCH] s3:librpc/gen_ndr: fix array checks (bug #8815 / CVE-2012-1182) + +An Anonymous researcher working with HP's Zero Day Initiative program +has found this and notified us. + +metze +--- + source/librpc/gen_ndr/ndr_wkssvc.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +diff --git source/librpc/gen_ndr/ndr_wkssvc.c source/librpc/gen_ndr/ndr_wkssvc.c +index 2af3587..07cf1a1 100644 +--- source/librpc/gen_ndr/ndr_wkssvc.c ++++ source/librpc/gen_ndr/ndr_wkssvc.c +@@ -1385,10 +1385,10 @@ NTSTATUS ndr_pull_USER_INFO_0_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str + NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0)); + _mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); +- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { ++ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) { + NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1])); + } +- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { ++ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) { + NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0); +@@ -1631,10 +1631,10 @@ NTSTATUS ndr_pull_USER_INFO_1_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str + NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1)); + _mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); +- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { ++ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) { + NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1])); + } +- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { ++ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) { + NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0); +@@ -1953,10 +1953,10 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportCtr0(struct ndr_pull *ndr, int ndr_fla + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); +- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { ++ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } +- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { ++ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); +-- +1.7.4.1 + diff --git a/meta-openpli/recipes-connectivity/samba/samba-3.0.37/uclibc-strlcpy-strlcat.patch b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/uclibc-strlcpy-strlcat.patch new file mode 100644 index 0000000000..b10a1b1084 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba-3.0.37/uclibc-strlcpy-strlcat.patch @@ -0,0 +1,46 @@ +diff --git source.old/client/mount.cifs.c source/client/mount.cifs.c +index 3b56e5f..b7a76c6 100644 +--- source.old/client/mount.cifs.c ++++ source/client/mount.cifs.c +@@ -56,6 +56,10 @@ + #endif /* _SAMBA_BUILD_ */ + #endif /* MOUNT_CIFS_VENDOR_SUFFIX */ + ++#ifdef _SAMBA_BUILD_ ++#include "include/config.h" ++#endif ++ + #ifndef MS_MOVE + #define MS_MOVE 8192 + #endif +@@ -94,6 +98,8 @@ char * prefixpath = NULL; + + /* like strncpy but does not 0 fill the buffer and always null + * terminates. bufsize is the size of the destination buffer */ ++ ++#ifndef HAVE_STRLCPY + static size_t strlcpy(char *d, const char *s, size_t bufsize) + { + size_t len = strlen(s); +@@ -104,10 +110,13 @@ static size_t strlcpy(char *d, const char *s, size_t bufsize) + d[len] = 0; + return ret; + } ++#endif + + /* like strncat but does not 0 fill the buffer and always null + * terminates. bufsize is the length of the buffer, which should + * be one more than the maximum resulting string length */ ++ ++#ifndef HAVE_STRLCAT + static size_t strlcat(char *d, const char *s, size_t bufsize) + { + size_t len1 = strlen(d); +@@ -126,6 +135,7 @@ static size_t strlcat(char *d, const char *s, size_t bufsize) + } + return ret; + } ++#endif + + /* BB finish BB + diff --git a/meta-openpli/recipes-connectivity/samba/samba/01samba-kill b/meta-openpli/recipes-connectivity/samba/samba/01samba-kill new file mode 100644 index 0000000000..41f77818f0 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/01samba-kill @@ -0,0 +1,5 @@ +#!/bin/sh +killall -9 smbd +rm -rf /var/log/log.smbd +killall -9 nmbd +rm -rf /var/log/log.nmbd diff --git a/meta-openpli/recipes-connectivity/samba/samba/01samba-start b/meta-openpli/recipes-connectivity/samba/samba/01samba-start new file mode 100644 index 0000000000..ce397ad5a6 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/01samba-start @@ -0,0 +1,3 @@ +#!/bin/sh +nmbd -D +smbd -D diff --git a/meta-openpli/recipes-connectivity/samba/samba/config-lfs.patch b/meta-openpli/recipes-connectivity/samba/samba/config-lfs.patch new file mode 100644 index 0000000000..b37ed690ce --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/config-lfs.patch @@ -0,0 +1,47 @@ +Cache the check for Linux LFS support, so it can be prepopulated from +the site cache for configure variables for cross-compiling. Without this, +samba gets the idea that it can use dirent64 and friends without defining +the flags it needs to get it, such as _GNU_SOURCE and _LARGEFILE64_SOURCE. + +Symptoms of getting the configuration wrong on cross-compile inculde +warnings such as + + smbd/trans2.c: In function `get_lanman2_dir_entry': + smbd/trans2.c:1065: warning: right shift count >= width of type + +and errors like + + smbd/vfs.c:630: error: dereferencing pointer to incomplete type + +(when trying to dereference dirent64.) + +--- source/configure.in.orig 2005-05-29 14:46:18.000000000 -0700 ++++ source/configure.in 2005-05-29 14:51:57.000000000 -0700 +@@ -588,7 +588,7 @@ + # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support. + # + *linux*) +- AC_MSG_CHECKING([for LFS support]) ++ AC_CACHE_CHECK([for LFS support], samba_cv_LINUX_LFS_SUPPORT,[ + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" + AC_TRY_RUN([ +@@ -627,15 +627,14 @@ + exit(1); + #endif + } +-], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross]) +- CPPFLAGS="$old_CPPFLAGS" +- if test x$LINUX_LFS_SUPPORT = xyes ; then ++], [samba_cv_LINUX_LFS_SUPPORT=yes], [samba_cv_LINUX_LFS_SUPPORT=no], [samba_cv_LINUX_LFS_SUPPORT=cross]) ++ CPPFLAGS="$old_CPPFLAGS"]) ++ if test x"$samba_cv_LINUX_LFS_SUPPORT" = x"yes" ; then + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) + AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) + fi +- AC_MSG_RESULT([$LINUX_LFS_SUPPORT]) + ;; + + # diff --git a/meta-openpli/recipes-connectivity/samba/samba/init b/meta-openpli/recipes-connectivity/samba/samba/init new file mode 100644 index 0000000000..cb57b17de4 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/init @@ -0,0 +1,58 @@ +#! /bin/sh +# +# This is an init script for openembedded +# Copy it to /etc/init.d/samba and type +# > update-rc.d samba defaults 60 +# + + +smbd=/usr/sbin/smbd +test -x "$smbd" || exit 0 +nmbd=/usr/sbin/nmbd +test -x "$nmbd" || exit 0 + + +case "$1" in + start) + echo -n "Starting Samba: smbd" + start-stop-daemon --start --quiet --exec $smbd + echo -n " nmbd" + start-stop-daemon --start --quiet --exec $nmbd + echo "." + ;; + stop) + echo -n "Stopping Samba: smbd" + start-stop-daemon --stop --quiet --pidfile /var/run/smbd.pid + echo -n " nmbd" + start-stop-daemon --stop --quiet --pidfile /var/run/nmbd.pid + echo "." + ;; + reload|force-reload) + start-stop-daemon --stop --quiet --signal 1 --exec $smbd + start-stop-daemon --stop --quiet --signal 1 --exec $nmbd + ;; + restart) + echo -n "Stopping Samba: smbd" + start-stop-daemon --stop --quiet --pidfile /var/run/smbd.pid + echo -n " nmbd" + start-stop-daemon --stop --quiet --pidfile /var/run/nmbd.pid + echo "" + echo -n "Waiting for samba processes to die off" + for i in 1 2 3 ; + do + sleep 1 + echo -n "." + done + echo "" + echo -n "Starting Samba: smbd" + start-stop-daemon --start --quiet --exec $smbd + echo -n " nmbd" + start-stop-daemon --start --quiet --exec $nmbd + echo "." + ;; + *) + echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload}" + exit 1 +esac + +exit 0 \ No newline at end of file diff --git a/meta-openpli/recipes-connectivity/samba/samba/quota.patch b/meta-openpli/recipes-connectivity/samba/samba/quota.patch new file mode 100644 index 0000000000..6f42ff868f --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/quota.patch @@ -0,0 +1,11 @@ +--- lib/sysquotas_4A.c.old 2005-07-03 17:16:00.000000000 +0200 ++++ lib/sysquotas_4A.c 2005-07-03 17:10:09.000000000 +0200 +@@ -28,6 +28,8 @@ + /* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */ + /* this is used by: HPUX,IRIX */ + ++ #define _LINUX_QUOTA_VERSION 1 ++ + #ifdef HAVE_SYS_TYPES_H + #include + #endif diff --git a/meta-openpli/recipes-connectivity/samba/samba/smb.conf b/meta-openpli/recipes-connectivity/samba/samba/smb.conf new file mode 100644 index 0000000000..e05ce2a132 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/smb.conf @@ -0,0 +1,28 @@ +[global] + load printers = no + guest account = root + log file = /tmp/smb.log + log level = 1 + security = share + server string = Dreambox %h network services + workgroup = Dream + netbios name = %h + case sensitive=yes + preserve case=yes + short preserve case=yes + socket options = TCP_NODELAY + preferred master = no ;(These stop the machine being master browser, which means that it doesn't waste time there.) + +[Configuration] + comment = Configuration files - take care! + path = /var + read only = no + public = yes + guest ok = yes + +[Harddisk] + comment = The harddisk + path = /media/hdd + read only = no + public = yes + guest ok = yes diff --git a/meta-openpli/recipes-connectivity/samba/samba/tdb.pc b/meta-openpli/recipes-connectivity/samba/samba/tdb.pc new file mode 100644 index 0000000000..6307a20a03 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/tdb.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=/usr +libdir=/usr/lib +includedir=/usr/include + +Name: tdb +Description: A trivial database +Version: 1.1.2 +Libs: -L${libdir} -ltdb +Cflags: -I${includedir} +URL: http://tdb.samba.org/ diff --git a/meta-openpli/recipes-connectivity/samba/samba/volatiles.03_samba b/meta-openpli/recipes-connectivity/samba/samba/volatiles.03_samba new file mode 100644 index 0000000000..469bc9e7b0 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba/volatiles.03_samba @@ -0,0 +1,2 @@ +# +d root root 0755 /var/log/samba none diff --git a/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bb b/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bb new file mode 100644 index 0000000000..eb05c7196e --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bb @@ -0,0 +1,20 @@ +require recipes-connectivity/samba/samba.inc +require recipes-connectivity/samba/samba-basic.inc +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://../COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +PR = "r2" + +SRC_URI += "file://configure.patch \ + file://kernel-oplocks.patch \ + file://0001-s3-schannel-client-Push-the-domain-and-netbios-name-.patch \ + file://samba-3.0-CVE-2012-0870.patch \ + file://samba-3.0.37-CVE-2012-1182.patch" +SRC_URI_append_linux-uclibc = "file://uclibc-strlcpy-strlcat.patch" +SRC_URI_append_linux-uclibceabi = "file://uclibc-strlcpy-strlcat.patch" + +EXTRA_OECONF += "\ + SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \ + " + +SRC_URI[md5sum] = "11ed2bfef4090bd5736b194b43f67289" +SRC_URI[sha256sum] = "bb67c0e13d4ccbd84b9200c8739393fdd9b3145b5aad216934dc670f0fcea266" diff --git a/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bbappend b/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bbappend new file mode 100644 index 0000000000..e1361ad7a9 --- /dev/null +++ b/meta-openpli/recipes-connectivity/samba/samba_3.0.37.bbappend @@ -0,0 +1,31 @@ +PRINC = "1" + +SRC_URI += " \ + file://01samba-kill \ + file://01samba-start \ +" + +PACKAGES =+ "smbfs smbfs-doc sambaserver libpopt libtalloc" + +FILES_smbfs = "${bindir}/smbmount ${bindir}/smbumount ${bindir}/smbmnt ${base_sbindir}/mount.smbfs ${base_sbindir}/mount.smb" +FILES_smbfs-doc = "${mandir}/man8/smbmount.8 ${mandir}/man8/smbumount.8 ${mandir}/man8/smbmnt.8" +FILES_sambaserver = "${sbindir}/smbd ${sbindir}/nmbd ${libdir}/charset/*.so ${libdir}/*.dat \ + ${sysconfdir}/samba/smb.conf ${sysconfdir}/samba/private \ + ${sysconfdir}/network/if-up.d/01samba-start ${sysconfdir}/network/if-down.d/01samba-kill" +FILES_libpopt = "${libdir}/libpopt.so.*" +FILES_libtalloc = "${libdir}/libtalloc.so.*" + +CONFFILES_${PN} = "" +CONFFILES_sambaserver = "${sysconfdir}/samba/smb.conf" + +do_install_prepend() { + install -c -m 644 ${WORKDIR}/smb.conf ../examples/smb.conf.default +} + +do_install_append() { + install -d ${D}${sysconfdir}/samba/private + install -d ${D}${sysconfdir}/network/if-down.d + install -m 0755 ${WORKDIR}/01samba-kill ${D}${sysconfdir}/network/if-down.d + install -d ${D}${sysconfdir}/network/if-up.d + install -m 0755 ${WORKDIR}/01samba-start ${D}${sysconfdir}/network/if-up.d +} diff --git a/meta-openpli/recipes-connectivity/upnp/libupnp_1.6.5.bb b/meta-openpli/recipes-connectivity/upnp/libupnp_1.6.5.bb new file mode 100644 index 0000000000..0f9a4302d5 --- /dev/null +++ b/meta-openpli/recipes-connectivity/upnp/libupnp_1.6.5.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "The portable SDK for UPnP* Devices (libupnp) provides developers with an API and open source code for building control points, devices, and bridges that are compliant with Version 1.0 of the Universal Plug and Play Device Architecture Specification." +HOMEPAGE = "http://pupnp.sourceforge.net/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b3190d5244e08e78e4c8ee78544f4863" + +PR = "r1" + +LEAD_SONAME = "libupnp" +SRC_URI = "${SOURCEFORGE_MIRROR}/pupnp/${P}.tar.bz2" + +inherit autotools + +SRC_URI[md5sum] = "2b0370e7c405a5bc80880085e6d7d827" +SRC_URI[sha256sum] = "95b11e2db04c2e714c2f4fb05d9d31351d3388dababd4e1dd5300f4b0d5e8767" diff --git a/meta-openpli/recipes-connectivity/ushare/files/remove-lsb-dependency.patch b/meta-openpli/recipes-connectivity/ushare/files/remove-lsb-dependency.patch new file mode 100644 index 0000000000..91aee9978c --- /dev/null +++ b/meta-openpli/recipes-connectivity/ushare/files/remove-lsb-dependency.patch @@ -0,0 +1,29 @@ +diff --git a/scripts/ushare b/scripts/ushare +index c06c658..6154e1a +--- a/scripts/ushare ++++ b/scripts/ushare +@@ -26,12 +26,22 @@ CONFIGFILE=/etc/ushare.conf + # abort if no executable exists + [ -x $DAEMON ] || exit 0 + +-# Get lsb functions +-. /lib/lsb/init-functions + . /etc/default/rcS + + [ -f /etc/default/ushare ] && . /etc/default/ushare + ++log_daemon_msg() { ++ echo -n $1 ++} ++ ++log_warning_msg() { ++ echo -n $1 ++} ++ ++log_end_msg() { ++ echo ++} ++ + checkpid() { + [ -e $PIDFILE ] || touch $PIDFILE + } diff --git a/meta-openpli/recipes-connectivity/ushare/ushare_1.1a.bb b/meta-openpli/recipes-connectivity/ushare/ushare_1.1a.bb new file mode 100644 index 0000000000..410314ad87 --- /dev/null +++ b/meta-openpli/recipes-connectivity/ushare/ushare_1.1a.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "ushare is a UPnP media server" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" + +HOMEPAGE = "http://ushare.geexbox.org/" +DEPENDS = "libupnp virtual/libiconv virtual/libintl gettext" +SRC_URI = "http://ushare.geexbox.org/releases/ushare-${PV}.tar.bz2 \ + file://remove-lsb-dependency.patch" +S = "${WORKDIR}/ushare-${PV}" + +PR = "r1" + +inherit autotools + +# the configure script is hand-crafted, it rejects some of the usual +# configure arguments +do_configure () { + ${S}/configure \ + --prefix=${prefix} \ + --bindir=${bindir} \ + --localedir=${datadir}/locale \ + --sysconfdir=${sysconfdir} \ + --cross-compile +} + +SRC_URI[md5sum] = "5bbcdbf1ff85a9710fa3d4e82ccaa251" +SRC_URI[sha256sum] = "7b9b85c79968d4f4560f02a99e33c6a33ff58f9d41d8faea79e31cce2ee78665" diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/01-builddefs.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/01-builddefs.patch new file mode 100644 index 0000000000..a757d990bf --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/01-builddefs.patch @@ -0,0 +1,18 @@ +Author: Daniel Jacobowitz +Description: Build with tcpwrapper and SSL support. + +diff -Naurp vsftpd.orig/builddefs.h vsftpd/builddefs.h +--- vsftpd.orig/builddefs.h 2009-01-31 00:02:36.000000000 +0000 ++++ vsftpd/builddefs.h 2009-01-31 00:26:34.000000000 +0000 +@@ -1,9 +1,9 @@ + #ifndef VSF_BUILDDEFS_H + #define VSF_BUILDDEFS_H + +-#undef VSF_BUILD_TCPWRAPPERS ++#define VSF_BUILD_TCPWRAPPERS 1 + #define VSF_BUILD_PAM +-#undef VSF_BUILD_SSL ++#define VSF_BUILD_SSL + + #endif /* VSF_BUILDDEFS_H */ + diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/02-config.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/02-config.patch new file mode 100644 index 0000000000..6d7965d02f --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/02-config.patch @@ -0,0 +1,120 @@ +Author: Daniel Jacobowitz +Description: Set default configuration. + +diff -Naurp vsftpd.orig/tunables.c vsftpd/tunables.c +--- vsftpd.orig/tunables.c 2009-07-15 22:08:27.000000000 +0200 ++++ vsftpd/tunables.c 2009-11-06 13:33:34.000000000 +0100 +@@ -246,7 +246,7 @@ tunables_load_defaults() + /* -rw------- */ + tunable_chown_upload_mode = 0600; + +- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); ++ install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir); + install_str_setting("ftp", &tunable_ftp_username); + install_str_setting("root", &tunable_chown_username); + install_str_setting("/var/log/xferlog", &tunable_xferlog_file); +@@ -256,7 +256,7 @@ tunables_load_defaults() + install_str_setting(0, &tunable_ftpd_banner); + install_str_setting("/etc/vsftpd.banned_emails", &tunable_banned_email_file); + install_str_setting("/etc/vsftpd.chroot_list", &tunable_chroot_list_file); +- install_str_setting("ftp", &tunable_pam_service_name); ++ install_str_setting("vsftpd", &tunable_pam_service_name); + install_str_setting("ftp", &tunable_guest_username); + install_str_setting("/etc/vsftpd.user_list", &tunable_userlist_file); + install_str_setting(0, &tunable_anon_root); +diff -Naurp vsftpd.orig/vsftpd.conf vsftpd/vsftpd.conf +--- vsftpd.orig/vsftpd.conf 2009-11-06 08:41:11.000000000 +0100 ++++ vsftpd/vsftpd.conf 2009-11-06 13:35:37.000000000 +0100 +@@ -8,6 +8,17 @@ + # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's + # capabilities. + # ++# ++# Run standalone? vsftpd can run either from an inetd or as a standalone ++# daemon started from an initscript. ++listen=YES ++# ++# Run standalone with IPv6? ++# Like the listen parameter, except vsftpd will listen on an IPv6 socket ++# instead of an IPv4 one. This parameter and the listen parameter are mutually ++# exclusive. ++#listen_ipv6=YES ++# + # Allow anonymous FTP? (Beware - allowed by default if you comment this out). + anonymous_enable=YES + # +@@ -34,6 +45,12 @@ anonymous_enable=YES + # go into a certain directory. + dirmessage_enable=YES + # ++# If enabled, vsftpd will display directory listings with the time ++# in your local time zone. The default is to display GMT. The ++# times returned by the MDTM FTP command are also affected by this ++# option. ++use_localtime=YES ++# + # Activate logging of uploads/downloads. + xferlog_enable=YES + # +@@ -89,6 +106,11 @@ connect_from_port_20=YES + # (default follows) + #banned_email_file=/etc/vsftpd.banned_emails + # ++# You may restrict local users to their home directories. See the FAQ for ++# the possible risks in this before using chroot_local_user or ++# chroot_list_enable below. ++#chroot_local_user=YES ++# + # You may specify an explicit list of local users to chroot() to their home + # directory. If chroot_local_user is YES, then this list becomes a list of + # users to NOT chroot(). +@@ -103,12 +125,20 @@ connect_from_port_20=YES + # the presence of the "-R" option, so there is a strong case for enabling it. + #ls_recurse_enable=YES + # +-# When "listen" directive is enabled, vsftpd runs in standalone mode and +-# listens on IPv4 sockets. This directive cannot be used in conjunction +-# with the listen_ipv6 directive. +-listen=YES ++# Customization + # +-# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 +-# sockets, you must run two copies of vsftpd with two configuration files. +-# Make sure, that one of the listen options is commented !! +-#listen_ipv6=YES ++# Some of vsftpd's settings don't fit the filesystem layout by ++# default. ++# ++# This option should be the name of a directory which is empty. Also, the ++# directory should not be writable by the ftp user. This directory is used ++# as a secure chroot() jail at times vsftpd does not require filesystem ++# access. ++secure_chroot_dir=/var/run/vsftpd/empty ++# ++# This string is the name of the PAM service vsftpd will use. ++pam_service_name=vsftpd ++# ++# This option specifies the location of the RSA certificate to use for SSL ++# encrypted connections. ++rsa_cert_file=/etc/ssl/private/vsftpd.pem +diff -Naurp vsftpd.orig/vsftpd.conf.5 vsftpd/vsftpd.conf.5 +--- vsftpd.orig/vsftpd.conf.5 2009-11-06 08:41:11.000000000 +0100 ++++ vsftpd/vsftpd.conf.5 2009-11-06 13:37:10.000000000 +0100 +@@ -940,7 +940,7 @@ Default: nobody + .B pam_service_name + This string is the name of the PAM service vsftpd will use. + +-Default: ftp ++Default: vsftpd + .TP + .B pasv_address + Use this option to override the IP address that vsftpd will advertise in +@@ -969,7 +969,7 @@ This option should be the name of a dire + directory should not be writable by the ftp user. This directory is used + as a secure chroot() jail at times vsftpd does not require filesystem access. + +-Default: /usr/share/empty ++Default: /var/run/vsftpd/empty + .TP + .B ssl_ciphers + This option can be used to select which SSL ciphers vsftpd will allow for diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/03-db-doc.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/03-db-doc.patch new file mode 100644 index 0000000000..d544ef0c1a --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/03-db-doc.patch @@ -0,0 +1,19 @@ +Author: shaul Karl +Description: + A short explanation how to find out the right db version (Closes: #478282). + +diff -Naurp vsftpd.orig/EXAMPLE/VIRTUAL_USERS/README vsftpd/EXAMPLE/VIRTUAL_USERS/README +--- vsftpd.orig/EXAMPLE/VIRTUAL_USERS/README 2009-01-31 00:02:36.000000000 +0000 ++++ vsftpd/EXAMPLE/VIRTUAL_USERS/README 2009-01-31 01:38:11.000000000 +0000 +@@ -21,7 +21,10 @@ NOTE: Many systems have multiple version + need to use e.g. db3_load for correct operation. This is known to affect + some Debian systems. The core issue is that pam_userdb expects its login + database to be a specific db version (often db3, whereas db4 may be installed +-on your system). ++on your system). You might check ahead what specific db version you'll need ++by looking at the dependcies of the pam module. Some methods to do that is to ++run ldd on the pam_userdb.so or look at the dependencies of the package with ++the pam modules. + + This will create /etc/vsftpd_login.db. Obviously, you may want to make sure + the permissions are restricted: diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/04-link-local.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/04-link-local.patch new file mode 100644 index 0000000000..53b3735610 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/04-link-local.patch @@ -0,0 +1,91 @@ +Author: Michael Stapelberg +Description: + vsftpd does not accept IPv6 scope identifier in listen_address6 + (Closes: #544993). + . + When specifying a link-local address, you need a scope identifier (tha name of + the index usually), thus you cannot use the following: + listen_address6=fe80::21f:16ff:fe06:3aab + but you have to use: + listen_address6=fe80::21f:16ff:fe06:3aab%eth0 + so that it is clear on which interface this link-local address should be used. + . + Unfortunately, vsftpd does not correctly parse the address mentioned above and + thus fails to be useful in link-local-only environments. + . + This patch fixes it. + +diff -Naurp vsftpd.orig/standalone.c vsftpd/standalone.c +--- vsftpd.orig/standalone.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/standalone.c 2009-10-17 17:10:02.000000000 +0200 +@@ -7,6 +7,8 @@ + * Code to listen on the network and launch children servants. + */ + ++#include ++ + #include "standalone.h" + + #include "parseconf.h" +@@ -111,8 +113,17 @@ vsf_standalone_main(void) + else + { + struct mystr addr_str = INIT_MYSTR; ++ struct mystr scope_id = INIT_MYSTR; + const unsigned char* p_raw_addr; ++ unsigned int if_index = 0; ++ ++ /* See if we got a scope id */ + str_alloc_text(&addr_str, tunable_listen_address6); ++ str_split_char(&addr_str, &scope_id, '%'); ++ if (str_getlen(&scope_id) > 0) { ++ if_index = if_nametoindex(str_getbuf(&scope_id)); ++ str_free(&scope_id); ++ } + p_raw_addr = vsf_sysutil_parse_ipv6(&addr_str); + str_free(&addr_str); + if (!p_raw_addr) +@@ -120,6 +131,7 @@ vsf_standalone_main(void) + die2("bad listen_address6: ", tunable_listen_address6); + } + vsf_sysutil_sockaddr_set_ipv6addr(p_sockaddr, p_raw_addr); ++ vsf_sysutil_sockaddr_set_ipv6scope(p_sockaddr, if_index); + } + retval = vsf_sysutil_bind(listen_sock, p_sockaddr); + vsf_sysutil_free(p_sockaddr); +diff -Naurp vsftpd.orig/sysutil.c vsftpd/sysutil.c +--- vsftpd.orig/sysutil.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/sysutil.c 2009-10-17 17:10:02.000000000 +0200 +@@ -2039,6 +2039,19 @@ vsf_sysutil_sockaddr_set_ipv6addr(struct + } + } + ++int ++vsf_sysutil_sockaddr_get_ipv6scope(struct vsf_sysutil_sockaddr* p_sockptr) ++{ ++ return p_sockptr->u.u_sockaddr_in6.sin6_scope_id; ++} ++ ++void ++vsf_sysutil_sockaddr_set_ipv6scope(struct vsf_sysutil_sockaddr* p_sockptr, ++ const int scope_id) ++{ ++ p_sockptr->u.u_sockaddr_in6.sin6_scope_id = scope_id; ++} ++ + const void* + vsf_sysutil_sockaddr_ipv6_v4(const struct vsf_sysutil_sockaddr* p_addr) + { +diff -Naurp vsftpd.orig/sysutil.h vsftpd/sysutil.h +--- vsftpd.orig/sysutil.h 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/sysutil.h 2009-10-17 17:10:02.000000000 +0200 +@@ -228,6 +228,9 @@ void vsf_sysutil_sockaddr_set_ipv4addr(s + const unsigned char* p_raw); + void vsf_sysutil_sockaddr_set_ipv6addr(struct vsf_sysutil_sockaddr* p_sockptr, + const unsigned char* p_raw); ++void vsf_sysutil_sockaddr_set_ipv6scope(struct vsf_sysutil_sockaddr* p_sockptr, ++ const int scope_id); ++int vsf_sysutil_sockaddr_get_ipv6scope(struct vsf_sysutil_sockaddr* p_sockptr); + void vsf_sysutil_sockaddr_set_any(struct vsf_sysutil_sockaddr* p_sockaddr); + unsigned short vsf_sysutil_sockaddr_get_port( + const struct vsf_sysutil_sockaddr* p_sockptr); diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/05-whitespaces.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/05-whitespaces.patch new file mode 100644 index 0000000000..569ce38ed4 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/05-whitespaces.patch @@ -0,0 +1,81 @@ +Author: Jiri Skala +Description: trim white spaces from option values (Closes: #419857, #536803). + +diff -Naurp vsftpd.orig/parseconf.c vsftpd/parseconf.c +--- vsftpd.orig/parseconf.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/parseconf.c 2009-10-18 11:28:31.000000000 +0200 +@@ -275,7 +275,7 @@ vsf_parseconf_load_setting(const char* p + } + else + { +- *p_curr_setting = str_strdup(&s_value_str); ++ *p_curr_setting = str_strdup_trimmed(&s_value_str); + } + return; + } +diff -Naurp vsftpd.orig/str.c vsftpd/str.c +--- vsftpd.orig/str.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/str.c 2009-10-18 11:28:31.000000000 +0200 +@@ -89,6 +89,18 @@ str_strdup(const struct mystr* p_str) + return vsf_sysutil_strdup(str_getbuf(p_str)); + } + ++const char* ++str_strdup_trimmed(const struct mystr* p_str) ++{ ++ const char* p_trimmed = str_getbuf(p_str); ++ int h, t, newlen; ++ ++ for (h = 0; h < (int)str_getlen(p_str) && vsf_sysutil_isspace(p_trimmed[h]); h++) ; ++ for (t = str_getlen(p_str) - 1; t >= 0 && vsf_sysutil_isspace(p_trimmed[t]); t--) ; ++ newlen = t - h + 1; ++ return newlen ? vsf_sysutil_strndup(p_trimmed+h, (unsigned int)newlen) : 0L; ++} ++ + void + str_alloc_alt_term(struct mystr* p_str, const char* p_src, char term) + { +diff -Naurp vsftpd.orig/str.h vsftpd/str.h +--- vsftpd.orig/str.h 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/str.h 2009-10-18 11:28:31.000000000 +0200 +@@ -31,6 +31,7 @@ void str_alloc_ulong(struct mystr* p_str + void str_alloc_filesize_t(struct mystr* p_str, filesize_t the_filesize); + void str_copy(struct mystr* p_dest, const struct mystr* p_src); + const char* str_strdup(const struct mystr* p_str); ++const char* str_strdup_trimmed(const struct mystr* p_str); + void str_empty(struct mystr* p_str); + void str_free(struct mystr* p_str); + void str_trunc(struct mystr* p_str, unsigned int trunc_len); +diff -Naurp vsftpd.orig/sysutil.c vsftpd/sysutil.c +--- vsftpd.orig/sysutil.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/sysutil.c 2009-10-18 11:28:31.000000000 +0200 +@@ -1033,6 +1033,18 @@ vsf_sysutil_strdup(const char* p_str) + return strdup(p_str); + } + ++char* ++vsf_sysutil_strndup(const char* p_str, unsigned int p_len) ++{ ++ char *new = (char *)malloc(p_len+1); ++ ++ if (new == NULL) ++ return NULL; ++ ++ new[p_len]='\0'; ++ return (char *)memcpy(new, p_str, p_len); ++} ++ + void + vsf_sysutil_memclr(void* p_dest, unsigned int size) + { +diff -Naurp vsftpd.orig/sysutil.h vsftpd/sysutil.h +--- vsftpd.orig/sysutil.h 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/sysutil.h 2009-10-18 11:28:31.000000000 +0200 +@@ -186,6 +186,7 @@ int vsf_sysutil_wait_get_exitcode( + /* Various string functions */ + unsigned int vsf_sysutil_strlen(const char* p_text); + char* vsf_sysutil_strdup(const char* p_str); ++char* vsf_sysutil_strndup(const char* p_str, unsigned int p_len); + void vsf_sysutil_memclr(void* p_dest, unsigned int size); + void vsf_sysutil_memcpy(void* p_dest, const void* p_src, + const unsigned int size); diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/06-greedy.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/06-greedy.patch new file mode 100644 index 0000000000..ff73c9c285 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/06-greedy.patch @@ -0,0 +1,32 @@ +Author: Martin Nagy +Description: Fix file listing issue with wildcard (Bugzilla: #392181). + +diff -Naurp vsftpd.orig/ls.c vsftpd/ls.c +--- vsftpd.orig/ls.c 2009-10-02 14:15:18.000000000 +0200 ++++ vsftpd/ls.c 2009-10-18 11:48:29.000000000 +0200 +@@ -281,6 +281,25 @@ vsf_filename_passes_filter(const struct + { + goto out; + } ++ if (!must_match_at_current_pos) ++ { ++ struct mystr scan_fwd = INIT_MYSTR; ++ ++ str_mid_to_end(&name_remain_str, &scan_fwd, ++ indexx + str_getlen(&s_match_needed_str)); ++ /* We're allowed to be greedy, test if it match further along ++ * keep advancing indexx while we can still match. ++ */ ++ while( (locate_result = str_locate_str(&scan_fwd, &s_match_needed_str)), ++ locate_result.found ) ++ { ++ indexx += locate_result.index + str_getlen(&s_match_needed_str); ++ str_mid_to_end(&scan_fwd, &temp_str, ++ locate_result.index + str_getlen(&s_match_needed_str)); ++ str_copy(&scan_fwd, &temp_str); ++ } ++ str_free(&scan_fwd); ++ } + /* Chop matched string out of remainder */ + str_mid_to_end(&name_remain_str, &temp_str, + indexx + str_getlen(&s_match_needed_str)); diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/07-utf8.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/07-utf8.patch new file mode 100644 index 0000000000..cf03e08ad3 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/07-utf8.patch @@ -0,0 +1,58 @@ +Author: Chuck Short +Description: Adding support for UTF8. + +diff -Naurp vsftpd.orig/features.c vsftpd/features.c +--- vsftpd.orig/features.c 2008-12-04 06:00:47.000000000 +0000 ++++ vsftpd/features.c 2010-02-25 13:28:06.000000000 +0000 +@@ -21,6 +21,10 @@ handle_feat(struct vsf_session* p_sess) + vsf_cmdio_write_raw(p_sess, " AUTH SSL\r\n"); + vsf_cmdio_write_raw(p_sess, " AUTH TLS\r\n"); + } ++ if (tunable_utf8_filesystem) ++ { ++ vsf_cmdio_write_raw(p_sess, " UTF8\r\n"); ++ } + if (tunable_port_enable) + { + vsf_cmdio_write_raw(p_sess, " EPRT\r\n"); +diff -Naurp vsftpd.orig/parseconf.c vsftpd/parseconf.c +--- vsftpd.orig/parseconf.c 2009-08-07 18:46:40.000000000 +0000 ++++ vsftpd/parseconf.c 2010-02-25 13:28:06.000000000 +0000 +@@ -28,6 +28,7 @@ static struct parseconf_bool_setting + parseconf_bool_array[] = + { + { "anonymous_enable", &tunable_anonymous_enable }, ++ { "utf8_filesystem", &tunable_utf8_filesystem }, + { "local_enable", &tunable_local_enable }, + { "pasv_enable", &tunable_pasv_enable }, + { "port_enable", &tunable_port_enable }, +diff -Naurp vsftpd.orig/tunables.c vsftpd/tunables.c +--- vsftpd.orig/tunables.c 2009-07-15 20:08:27.000000000 +0000 ++++ vsftpd/tunables.c 2010-02-25 13:28:06.000000000 +0000 +@@ -10,6 +10,7 @@ + + int tunable_anonymous_enable; + int tunable_local_enable; ++int tunable_utf8_filesystem; + int tunable_pasv_enable; + int tunable_port_enable; + int tunable_chroot_local_user; +@@ -146,6 +147,7 @@ tunables_load_defaults() + { + tunable_anonymous_enable = 1; + tunable_local_enable = 0; ++ tunable_utf8_filesystem = 0; + tunable_pasv_enable = 1; + tunable_port_enable = 1; + tunable_chroot_local_user = 0; +diff -Naurp vsftpd.orig/tunables.h vsftpd/tunables.h +--- vsftpd.orig/tunables.h 2009-07-07 01:37:28.000000000 +0000 ++++ vsftpd/tunables.h 2010-02-25 13:28:06.000000000 +0000 +@@ -11,6 +11,7 @@ void tunables_load_defaults(); + /* Booleans */ + extern int tunable_anonymous_enable; /* Allow anon logins */ + extern int tunable_local_enable; /* Allow local logins */ ++extern int tunable_utf8_filesystem; /* Server uses UTF8 Filesystem */ + extern int tunable_pasv_enable; /* Allow PASV */ + extern int tunable_port_enable; /* Allow PORT */ + extern int tunable_chroot_local_user; /* Restrict local to home dir */ diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/08-manpage.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/08-manpage.patch new file mode 100644 index 0000000000..3a4f9620dc --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/08-manpage.patch @@ -0,0 +1,23 @@ +Author: Daniel Baumann +Description: Fixing manpage formating. + +diff -Naurp vsftpd.orig/vsftpd.8 vsftpd/vsftpd.8 +--- vsftpd.orig/vsftpd.8 2009-07-17 20:56:23.000000000 +0000 ++++ vsftpd/vsftpd.8 2010-04-08 05:18:00.000000000 +0000 +@@ -57,4 +57,3 @@ setting and any identical setting that w + .Pa /etc/vsftpd.conf + .Sh SEE ALSO + .Xr vsftpd.conf 5 +-.end +diff -Naurp vsftpd.orig/vsftpd.conf.5 vsftpd/vsftpd.conf.5 +--- vsftpd.orig/vsftpd.conf.5 2009-10-19 02:46:30.000000000 +0000 ++++ vsftpd/vsftpd.conf.5 2010-04-08 05:18:08.000000000 +0000 +@@ -404,7 +404,7 @@ reuse (which proves that they know the s + channel). Although this is a secure default, it may break many FTP clients, + so you may want to disable it. For a discussion of the consequences, see + http://scarybeastsecurity.blogspot.com/2009/02/vsftpd-210-released.html +-(Added in v2.1.0). ++ (Added in v2.1.0). + + Default: YES + .TP diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/09-s390.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/09-s390.patch new file mode 100644 index 0000000000..4711f9bc68 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/09-s390.patch @@ -0,0 +1,15 @@ +Author: Philipp Kern +Description: Fix vsftpd on s390 (Closes: #602726). + +diff -Naurp vsftpd.orig/sysdeputil.c vsftpd/sysdeputil.c +--- vsftpd.orig/sysdeputil.c 2011-09-05 16:03:18.728857644 +0200 ++++ vsftpd/sysdeputil.c 2011-09-05 16:05:12.909423834 +0200 +@@ -64,7 +64,7 @@ + #include + + /* BEGIN config */ +-#if defined(__linux__) ++#if defined(__linux__) && !defined(__s390__) + #include + #include + #define VSF_SYSDEP_HAVE_LINUX_CLONE diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/10-remote-dos.patch b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/10-remote-dos.patch new file mode 100644 index 0000000000..fee3ebe3ef --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/10-remote-dos.patch @@ -0,0 +1,69 @@ +Author: Ben Hutchings +Description: Remote DoS on Linux 2.6.32 (Closes: #629373). + +diff -Naurp vsftpd.orig/sysdeputil.c vsftpd/sysdeputil.c +--- vsftpd.orig/sysdeputil.c 2010-03-26 04:25:33.000000000 +0100 ++++ vsftpd/sysdeputil.c 2011-09-05 15:16:05.347070790 +0200 +@@ -25,6 +25,11 @@ + #define _LARGEFILE64_SOURCE 1 + #endif + ++#ifdef __linux__ ++ #include ++ #include ++#endif ++ + /* For INT_MAX */ + #include + +@@ -1259,11 +1264,36 @@ vsf_set_term_if_parent_dies() + #endif + } + ++#ifdef VSF_SYSDEP_HAVE_LINUX_CLONE ++/* On Linux versions <2.6.35, netns cleanup may be so slow that ++ * creating a netns per connection allows a remote denial-of-service. ++ * We therefore do not use CLONE_NEWNET on these versions. ++ */ ++static int ++vsf_sysutil_netns_cleanup_is_fast(void) ++{ ++#ifdef __linux__ ++ struct utsname utsname; ++ int r1, r2, r3 = 0; ++ return (uname(&utsname) == 0 && ++ sscanf(utsname.release, "%d.%d.%d", &r1, &r2, &r3) >= 2 && ++ ((r1 << 16) | (r2 << 8) | r3) >= ((2 << 16) | (6 << 8) | 35)); ++#else ++ /* Assume any other kernel that has the feature don't have this problem */ ++ return 1; ++#endif ++} ++#endif ++ + int + vsf_sysutil_fork_isolate_all_failok() + { + #ifdef VSF_SYSDEP_HAVE_LINUX_CLONE +- static int cloneflags_work = 1; ++ static int cloneflags_work = -1; ++ if (cloneflags_work < 0) ++ { ++ cloneflags_work = vsf_sysutil_netns_cleanup_is_fast(); ++ } + if (cloneflags_work) + { + int ret = syscall(__NR_clone, +@@ -1309,7 +1339,11 @@ int + vsf_sysutil_fork_newnet() + { + #ifdef VSF_SYSDEP_HAVE_LINUX_CLONE +- static int cloneflags_work = 1; ++ static int cloneflags_work = -1; ++ if (cloneflags_work < 0) ++ { ++ cloneflags_work = vsf_sysutil_netns_cleanup_is_fast(); ++ } + if (cloneflags_work) + { + int ret = syscall(__NR_clone, CLONE_NEWNET | SIGCHLD, NULL); diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd/vsftpd.conf b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/vsftpd.conf new file mode 100644 index 0000000000..3005368646 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd/vsftpd.conf @@ -0,0 +1,105 @@ +# Opendreambox /etc/vsftpd.conf +# +# Please see vsftpd.conf.5 for all compiled in defaults. +# +# READ THIS: This example file is NOT an exhaustive list of vsftpd options. +# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's +# capabilities. +# +# Allow anonymous FTP? (Beware - allowed by default if you comment this out). +anonymous_enable=NO +# +# Uncomment this to allow local users to log in. +local_enable=YES +# +# Uncomment this to enable any form of FTP write command. +write_enable=YES +# +# Default umask for local users is 077. You may wish to change this to 022, +# if your users expect that (022 is used by most other ftpd's) +#local_umask=022 +# +# Uncomment this to allow the anonymous FTP user to upload files. This only +# has an effect if the above global write enable is activated. Also, you will +# obviously need to create a directory writable by the FTP user. +#anon_upload_enable=YES +# +# Uncomment this if you want the anonymous FTP user to be able to create +# new directories. +#anon_mkdir_write_enable=YES +# +# Activate directory messages - messages given to remote users when they +# go into a certain directory. +dirmessage_enable=YES +# +# Activate logging of uploads/downloads. +#xferlog_enable=YES +# +# Make sure PORT transfer connections originate from port 20 (ftp-data). +connect_from_port_20=YES +# +# If you want, you can arrange for uploaded anonymous files to be owned by +# a different user. Note! Using "root" for uploaded files is not +# recommended! +#chown_uploads=YES +#chown_username=whoever +# +# You may override where the log file goes if you like. The default is shown +# below. +#xferlog_file=/var/log/vsftpd.log +# +# If you want, you can have your log file in standard ftpd xferlog format +#xferlog_std_format=YES +# +# You may change the default value for timing out an idle session. +#idle_session_timeout=600 +# +# You may change the default value for timing out a data connection. +#data_connection_timeout=120 +# +# It is recommended that you define on your system a unique user which the +# ftp server can use as a totally isolated and unprivileged user. +#nopriv_user=ftpsecure +# +# Enable this and the server will recognise asynchronous ABOR requests. Not +# recommended for security (the code is non-trivial). Not enabling it, +# however, may confuse older FTP clients. +async_abor_enable=YES +# +# By default the server will pretend to allow ASCII mode but in fact ignore +# the request. Turn on the below options to have the server actually do ASCII +# mangling on files when in ASCII mode. +# Beware that turning on ascii_download_enable enables malicious remote parties +# to consume your I/O resources, by issuing the command "SIZE /big/file" in +# ASCII mode. +# These ASCII options are split into upload and download because you may wish +# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), +# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be +# on the client anyway.. +#ascii_upload_enable=YES +#ascii_download_enable=YES +# +# You may fully customise the login banner string: +ftpd_banner=Welcome to the OpenPLi FTP service. +# +# You may specify a file of disallowed anonymous e-mail addresses. Apparently +# useful for combatting certain DoS attacks. +#deny_email_enable=YES +# (default follows) +#banned_email_file=/etc/vsftpd.banned_emails +# +# You may specify an explicit list of local users to chroot() to their home +# directory. If chroot_local_user is YES, then this list becomes a list of +# users to NOT chroot(). +#chroot_list_enable=YES +# (default follows) +#chroot_list_file=/etc/vsftpd.chroot_list +# +# You may activate the "-R" option to the builtin ls. This is disabled by +# default to avoid remote users being able to cause excessive I/O on large +# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume +# the presence of the "-R" option, so there is a strong case for enabling it. +ls_recurse_enable=YES +# +secure_chroot_dir=/dev/shm +local_root=/ diff --git a/meta-openpli/recipes-connectivity/vsftpd/vsftpd_2.3.5.bb b/meta-openpli/recipes-connectivity/vsftpd/vsftpd_2.3.5.bb new file mode 100644 index 0000000000..82acd98d31 --- /dev/null +++ b/meta-openpli/recipes-connectivity/vsftpd/vsftpd_2.3.5.bb @@ -0,0 +1,89 @@ +SUMMARY = "lightweight, efficient FTP server written for security" +HOMEPAGE = "https://security.appspot.com/vsftpd.html" +SECTION = "console/network" +LICENSE = "GPL-2.0-with-OpenSSL-exception" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" +DEPENDS = "libcap openssl" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" +PR = "r2" + +SRC_URI = " \ + https://security.appspot.com/downloads/${BP}.tar.gz \ + file://01-builddefs.patch \ + file://02-config.patch \ + file://03-db-doc.patch \ + file://04-link-local.patch \ + file://05-whitespaces.patch \ + file://06-greedy.patch \ + file://07-utf8.patch \ + file://08-manpage.patch \ + file://09-s390.patch \ + file://10-remote-dos.patch \ +" +SRC_URI[md5sum] = "01398a5bef8e85b6cf2c213a4b011eca" +SRC_URI[sha256sum] = "d87ee2987df8f03e1dbe294905f7907b2798deb89c67ca965f6e2f60879e54f1" + +S = "${WORKDIR}/${BP}" + +inherit useradd + +CFLAGS = "${TARGET_CFLAGS}" +CFLAGS += "-DVSF_BUILD_SSL=1" +CFLAGS += "${@base_contains('DISTRO_FEATURES', 'pam', '-DVSF_BUILD_PAM=1', '', d)}" + +LIBS = "-lcap -lcrypt -lssl -lcrypto" +LIBS += "${@base_contains('DISTRO_FEATURES', 'pam', '-lpam', '', d)}" + +LINK = "${TARGET_LDFLAGS}" + +SECURE_CHROOT_DIR = "${datadir}/${BPN}/chroot" +RSA_CERT_FILE = "${sysconfdir}/ssl/private/${BPN}.pem" + +do_configure() { + rm -f builddefs.h + touch builddefs.h + set_default() { + NAME=$1 + VALUE=$2 + sed -e "s,^#\?${NAME}=.*,${NAME}=${VALUE}," -i vsftpd.conf + } + set_default listen NO + set_default listen_ipv6 NO + set_default anonymous_enable NO + set_default local_enable YES + set_default write_enable YES + set_default anon_upload_enable NO + set_default anon_mkdir_write_enable NO + set_default dirmessage_enable NO + set_default use_localtime YES + set_default xferlog_enable NO + set_default connect_from_port_20 YES + set_default chown_uploads NO + set_default nopriv_user vsftpd + set_default async_abor_enable YES + set_default ascii_upload_enable NO + set_default ascii_download_enable NO + set_default ftpd_banner "Welcome to the ${DISTRO_NAME} FTP service!" + set_default chroot_local_user NO + set_default chroot_list_enable NO + set_default ls_recurse_enable YES + set_default secure_chroot_dir "${SECURE_CHROOT_DIR}" + set_default rsa_cert_file "${RSA_CERT_FILE}" +} +do_compile() { + oe_runmake 'CFLAGS=${CFLAGS}' 'LIBS=${LIBS}' 'LINK=${LINK}' +} +do_install() { + install -d ${D}${sysconfdir} + install -m 644 vsftpd.conf ${D}${sysconfdir} + install -d ${D}${sbindir} + install -m 755 vsftpd ${D}${sbindir}/vsftpd + install -d ${D}${mandir}/man8 + install -m 644 vsftpd.8 ${D}${mandir}/man8/vsftpd.8 + install -d ${D}${mandir}/man5 + install -m 644 vsftpd.conf.5 ${D}${mandir}/man5/vsftpd.conf.5 + install -d ${D}${SECURE_CHROOT_DIR} +} + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--home-dir ${SECURE_CHROOT_DIR} --no-create-home --system --shell /bin/false --user-group vsftpd" diff --git a/meta-openpli/recipes-connectivity/wakelan/wakelan_1.1.bb b/meta-openpli/recipes-connectivity/wakelan/wakelan_1.1.bb new file mode 100644 index 0000000000..ae36860312 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wakelan/wakelan_1.1.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Wakelan sends a magic packet to wake up remote PC's" +LICENSE = "GPLv2+" +PR = "r2" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +SRC_URI = "http://www.ibiblio.org/pub/Linux/system/network/misc/${PN}-${PV}.tar.gz" + +inherit autotools + +do_install () { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/${PN}-${PV}/wakelan ${D}${bindir}/wakelan +} + +FILES = "${bindir}/wakelan" + +INHIBIT_AUTO_STAGE = "1" + +SRC_URI[md5sum] = "4a3a31d874967cd6ac761b7d4323e0d5" +SRC_URI[sha256sum] = "3df5eb8f877648799ab623cf1718ecc6f86eb0c2f51d344d8e860442dcc5cd6f" diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/defconfig-gnutls b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/defconfig-gnutls new file mode 100644 index 0000000000..2df5e51df8 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/defconfig-gnutls @@ -0,0 +1,176 @@ +# This file lists the configuration options that are used when building the +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. +# +# This file is included in Makefile, so variables like CFLAGS and LIBS can also +# be modified from here. In most cass, these lines should use += in order not +# to override previous values of the variables. + +CFLAGS = $(TARGET_CFLAGS) -I../hostapd -I../utils -I../driver/modules -Wall -MMD +LIBS = $(TARGET_LDFLAGS) + +# Driver interface for Host AP driver +CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=n + +# Driver interface for madwifi driver +#CONFIG_DRIVER_MADWIFI=y + +# Driver interface for Prism54 driver +#CONFIG_DRIVER_PRISM54=y + +# Driver interface for ndiswrapper +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +#CONFIG_DRIVER_ATMEL=y + +# Driver interface for Broadcom driver +#CONFIG_DRIVER_BROADCOM=y + +# Driver interface for Intel ipw2100 driver +#CONFIG_DRIVER_IPW2100=y + +# Driver interface for generic Linux wireless extensions +CONFIG_DRIVER_WEXT=y + +# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) +#CONFIG_DRIVER_BSD=y +#CFLAGS += -I/usr/local/include +#LIBS += -L/usr/local/lib + +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Driver interface for wired Ethernet drivers +CONFIG_DRIVER_WIRED=y + +# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is +# included) +CONFIG_IEEE8021X_EAPOL=y + +# EAP-MD5 (automatically included if EAP-TTLS is enabled) +CONFIG_EAP_MD5=y + +# EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled) +CONFIG_EAP_MSCHAPV2=y + +# EAP-TLS +CONFIG_EAP_TLS=y + +# EAL-PEAP +CONFIG_EAP_PEAP=y + +# EAP-TTLS +CONFIG_EAP_TTLS=y + +# EAP-GTC +CONFIG_EAP_GTC=y + +# EAP-OTP +CONFIG_EAP_OTP=y + +# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) +#CONFIG_EAP_SIM=y + +# EAP-PSK (experimental; this is _not_ needed for WPA-PSK) +#CONFIG_EAP_PSK=y + +# EAP-PAX +#CONFIG_EAP_PAX=y + +# LEAP +CONFIG_EAP_LEAP=y + +# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) +#CONFIG_EAP_AKA=y + +# PKCS#12 (PFX) support (used to read private key and certificate file from +# a file that usually has extension .p12 or .pfx) +CONFIG_PKCS12=y + +# Smartcard support (i.e., private key on a smartcard), e.g., with openssl +# engine. +CONFIG_SMARTCARD=y + +# PC/SC interface for smartcards (USIM, GSM SIM) +# Enable this if EAP-SIM or EAP-AKA is included +#CONFIG_PCSC=y + +# Development testing +#CONFIG_EAPOL_TEST=y + +# Replace native Linux implementation of packet sockets with libdnet/libpcap. +# This will be automatically set for non-Linux OS. +#CONFIG_DNET_PCAP=y + +# Include control interface for external programs, e.g, wpa_cli +CONFIG_CTRL_IFACE=y + +# Include support for GNU Readline and History Libraries in wpa_cli. +# When building a wpa_cli binary for distribution, please note that these +# libraries are licensed under GPL and as such, BSD license may not apply for +# the resulting binary. +#CONFIG_READLINE=y + +# Remove debugging code that is printing out debug message to stdout. +# This can be used to reduce the size of the wpa_supplicant considerably +# if debugging code is not needed. The size reduction can be around 35% +# (e.g., 90 kB). +#CONFIG_NO_STDOUT_DEBUG=y + +# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save +# 35-50 kB in code size. +#CONFIG_NO_WPA=y + +# Select configuration backend: +# file = text file (e.g., wpa_supplicant.conf) +# winreg = Windows registry (see win_example.reg for an example) +CONFIG_BACKEND=file + +# Select program entry point implementation: +# main = UNIX/POSIX like main() function (default) +# main_winsvc = Windows service (read parameters from registry) +# main_none = Very basic example (development use only) +#CONFIG_MAIN=main + +# Select wrapper for operatins system and C library specific functions +# unix = UNIX/POSIX like systems (default) +# win32 = Windows systems +# none = Empty template +#CONFIG_OS=unix + +# Select event loop implementation +# eloop = select() loop (default) +# eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template +#CONFIG_ELOOP=eloop + +# Select layer 2 packet implementation +# linux = Linux packet socket (default) +# pcap = libpcap/libdnet/WinPcap +# freebsd = FreeBSD libpcap +# winpcap = WinPcap with receive thread +# none = Empty template +#CONFIG_L2_PACKET=linux + +# IEEE 802.11i/IEEE 802.11e STAKey negotiation for direct link connection +#CONFIG_STAKEY=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# none = Empty template +CONFIG_TLS=gnutls + +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +CONFIG_GNUTLS_EXTRA=y + diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-ralink.patch b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-ralink.patch new file mode 100644 index 0000000000..77de08b1ac --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-ralink.patch @@ -0,0 +1,2167 @@ +diff -NaurEbB wpa_supplicant-0.5.10/Makefile wpa_supplicant-0.5.10_RALINK/Makefile +--- wpa_supplicant-0.5.10/Makefile 2008-12-05 01:45:50.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/Makefile 2008-12-05 01:36:46.000000000 +0100 +@@ -31,6 +31,7 @@ + echo CONFIG_DRIVER_WEXT=y >> .config + echo CONFIG_WIRELESS_EXTENSION=y >> .config + echo CONFIG_DRIVER_ZYDAS=y >> .config ++ echo CONFIG_DRIVER_RALINK=y >> .config + + install: all + mkdir -p $(DESTDIR)/usr/local/sbin/ +@@ -145,6 +146,11 @@ + CONFIG_WIRELESS_EXTENSION=y + endif + ++ifdef CONFIG_DRIVER_RALINK ++CFLAGS += -DCONFIG_DRIVER_RALINK ++OBJS_d += driver_ralink.o ++endif ++ + ifdef CONFIG_DRIVER_BSD + CFLAGS += -DCONFIG_DRIVER_BSD + OBJS_d += driver_bsd.o +diff -NaurEbB wpa_supplicant-0.5.10/driver.h wpa_supplicant-0.5.10_RALINK/driver.h +--- wpa_supplicant-0.5.10/driver.h 2007-03-25 04:09:49.000000000 +0200 ++++ wpa_supplicant-0.5.10_RALINK/driver.h 2008-12-05 01:36:46.000000000 +0100 +@@ -581,6 +581,10 @@ + */ + void (*poll)(void *priv); + ++#ifdef CONFIG_DRIVER_RALINK ++ void (*poll_ralink)(void *priv, void *ctx); ++#endif ++ + /** + * get_ifname - Get interface name + * @priv: private driver interface data +diff -NaurEbB wpa_supplicant-0.5.10/driver_ralink.c wpa_supplicant-0.5.10_RALINK/driver_ralink.c +--- wpa_supplicant-0.5.10/driver_ralink.c 1970-01-01 01:00:00.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/driver_ralink.c 2008-12-05 01:36:46.000000000 +0100 +@@ -0,0 +1,1502 @@ ++/* ++ *************************************************************************** ++ * Ralink Tech Inc. ++ * 5F, No. 36 Taiyuan St. ++ * Jhubei City ++ * Hsinchu County 302, Taiwan, R.O.C. ++ * ++ * (c) Copyright 2002-2008, Ralink Technology, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify * ++ * it under the terms of the GNU General Public License as published by * ++ * the Free Software Foundation; either version 2 of the License, or * ++ * (at your option) any later version. * ++ * * ++ * This program is distributed in the hope that it will be useful, * ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of * ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ++ * GNU General Public License for more details. * ++ * * ++ * You should have received a copy of the GNU General Public License * ++ * along with this program; if not, write to the * ++ * Free Software Foundation, Inc., * ++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ++ * * ++ ************************************************************************/ ++/* ++ * WPA Supplicant - driver interaction with Ralink rt73.o driver ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include /* The L2 protocols */ ++#include ++//#include ++#include "wireless_copy.h" ++ ++#include "common.h" ++#include "driver.h" ++#include "l2_packet.h" ++#include "eloop.h" ++#include "wpa_supplicant.h" ++#include "priv_netlink.h" ++#include "wpa.h" ++#include "driver_ralink.h" ++#include "wpa_supplicant_i.h" ++#include "config_ssid.h" ++#include "config.h" ++ ++static int scanning_done = 1; ++ ++struct wpa_driver_ralink_data { ++ void *ctx; ++ int ioctl_sock; ++ int event_sock; ++ char ifname[IFNAMSIZ + 1]; ++ u8 *assoc_req_ies; ++ size_t assoc_req_ies_len; ++ u8 *assoc_resp_ies; ++ size_t assoc_resp_ies_len; ++ int no_of_pmkid; ++ struct ndis_pmkid_entry *pmkid; ++ int we_version_compiled; ++}; ++ ++static int ralink_set_oid(struct wpa_driver_ralink_data *drv, unsigned short oid, ++ char *data, int len) ++{ ++ char *buf; ++ struct iwreq iwr; ++ ++ buf = os_malloc(len); ++ if (buf == NULL) ++ return -1; ++ memset(buf, 0,len); ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ iwr.u.data.flags = oid; ++ iwr.u.data.flags |= OID_GET_SET_TOGGLE; ++ ++ if (data) ++ memcpy(buf, data, len); ++ ++ iwr.u.data.pointer = (caddr_t) buf; ++ iwr.u.data.length = len; ++ ++ if (ioctl(drv->ioctl_sock, RT_PRIV_IOCTL, &iwr) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%d) failed", ++ __func__, oid, len); ++ os_free(buf); ++ return -1; ++ } ++ os_free(buf); ++ return 0; ++} ++ ++static int wpa_driver_ralink_get_bssid(void *priv, u8 *bssid) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct iwreq iwr; ++ int ret = 0; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ ++ if (ioctl(drv->ioctl_sock, SIOCGIWAP, &iwr) < 0) ++ { ++ perror("ioctl[SIOCGIWAP]"); ++ ret = -1; ++ } ++ memcpy(bssid, iwr.u.ap_addr.sa_data, ETH_ALEN); ++ ++ return ret; ++} ++ ++static int wpa_driver_ralink_get_ssid(void *priv, u8 *ssid) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct wpa_supplicant *wpa_s = drv->ctx; ++ struct wpa_ssid *entry; ++ int ssid_len; ++ u8 bssid[ETH_ALEN]; ++ u8 ssid_str[MAX_SSID_LEN]; ++ struct iwreq iwr; ++ int result = 0; ++ int ret = 0; ++ BOOLEAN ieee8021x_mode = FALSE; ++ BOOLEAN ieee8021x_required_key = FALSE; ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ iwr.u.essid.pointer = (caddr_t) ssid; ++ iwr.u.essid.length = 32; ++ ++ if (ioctl(drv->ioctl_sock, SIOCGIWESSID, &iwr) < 0) ++ { ++ perror("ioctl[SIOCGIWESSID]"); ++ ret = -1; ++ } else ++ ret = iwr.u.essid.length; ++ ++ if(ret <= 0) ++ return ret; ++ ++ ssid_len = ret; ++ memset(ssid_str, 0, MAX_SSID_LEN); ++ memcpy(ssid_str, ssid, ssid_len); ++ ++ if(wpa_s->conf->ap_scan == 0) ++ { ++ // Read BSSID form driver ++ if (wpa_driver_ralink_get_bssid(priv, bssid) < 0) ++ { ++ wpa_printf(MSG_WARNING, "Could not read BSSID from driver."); ++ return ret; ++ } ++ ++ entry = wpa_s->conf->ssid; ++ while (entry) ++ { ++ if (!entry->disabled && ssid_len == entry->ssid_len && memcmp(ssid_str, entry->ssid, ssid_len) == 0 && ++ (!entry->bssid_set || memcmp(bssid, entry->bssid, ETH_ALEN) == 0)) ++ { ++ // match the config of driver ++ result = 1; ++ break; ++ } ++ entry = entry->next; ++ } ++ ++ if(result) ++ { ++ wpa_printf(MSG_DEBUG, "Ready to set 802.1x mode and ieee_required_keys parameters to driver"); ++ ++ // set 802.1x mode and ieee_required_keys parameter ++ if(entry->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) ++ { ++ if ((entry->eapol_flags & (EAPOL_FLAG_REQUIRE_KEY_UNICAST | EAPOL_FLAG_REQUIRE_KEY_BROADCAST))) ++ ieee8021x_required_key = TRUE; ++ ++ ieee8021x_mode = TRUE; ++ } ++ ++ if (ralink_set_oid(drv, OID_802_11_SET_IEEE8021X, (char *) &ieee8021x_mode, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set OID_802_11_SET_IEEE8021X(%d)", (int) ieee8021x_mode); ++ } ++ else ++ { ++ wpa_printf(MSG_DEBUG, "ieee8021x_mode is %s", ieee8021x_mode ? "TRUE" : "FALSE"); ++ } ++ ++ ++ if (ralink_set_oid(drv, OID_802_11_SET_IEEE8021X_REQUIRE_KEY, (char *) &ieee8021x_required_key, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "ERROR: Failed to set OID_802_11_SET_IEEE8021X_REQUIRE_KEY(%d)", (int) ieee8021x_required_key); ++ } ++ else ++ { ++ wpa_printf(MSG_DEBUG, "ieee8021x_required_key is %s and eapol_flag(%d)", ieee8021x_required_key ? "TRUE" : "FALSE", ++ entry->eapol_flags); ++ } ++ } ++ } ++ ++ return ret; ++} ++ ++static int wpa_driver_ralink_set_ssid(struct wpa_driver_ralink_data *drv, ++ const u8 *ssid, size_t ssid_len) ++{ ++ NDIS_802_11_SSID *buf; ++ int ret = 0; ++ struct iwreq iwr; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ buf = (NDIS_802_11_SSID *)os_malloc(sizeof(NDIS_802_11_SSID)); ++ if (buf == NULL) ++ return -1; ++ memset(buf, 0, sizeof(buf)); ++ buf->SsidLength = ssid_len; ++ memcpy(buf->Ssid, ssid, ssid_len); ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ ++ iwr.u.data.flags = OID_802_11_SSID; ++ iwr.u.data.flags |= OID_GET_SET_TOGGLE; ++ iwr.u.data.pointer = (caddr_t) buf; ++ iwr.u.data.length = sizeof(NDIS_802_11_SSID); ++ ++ if (ioctl(drv->ioctl_sock, RT_PRIV_IOCTL, &iwr) < 0) ++ { ++ perror("ioctl[RT_PRIV_IOCTL] -- OID_802_11_SSID"); ++ ret = -1; ++ } ++ os_free(buf); ++ return ret; ++} ++ ++static void wpa_driver_ralink_event_pmkid(struct wpa_driver_ralink_data *drv, ++ const u8 *data, size_t data_len) ++{ ++ NDIS_802_11_PMKID_CANDIDATE_LIST *pmkid; ++ int i; ++ union wpa_event_data event; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (data_len < 8) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Too short PMKID Candidate List " ++ "Event (len=%d)", data_len); ++ return; ++ } ++ pmkid = (NDIS_802_11_PMKID_CANDIDATE_LIST *) data; ++ wpa_printf(MSG_DEBUG, "RALINK: PMKID Candidate List Event - Version %d " ++ "NumCandidates %d", ++ (int) pmkid->Version, (int) pmkid->NumCandidates); ++ ++ if (pmkid->Version != 1) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Unsupported PMKID Candidate List " ++ "Version %d", (int) pmkid->Version); ++ return; ++ } ++ ++ if (data_len < 8 + pmkid->NumCandidates * sizeof(PMKID_CANDIDATE)) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: PMKID Candidate List underflow"); ++ ++ return; ++ } ++ ++ ++ ++ memset(&event, 0, sizeof(event)); ++ for (i = 0; i < pmkid->NumCandidates; i++) ++ { ++ PMKID_CANDIDATE *p = &pmkid->CandidateList[i]; ++ wpa_printf(MSG_DEBUG, "RALINK: %d: " MACSTR " Flags 0x%x", ++ i, MAC2STR(p->BSSID), (int) p->Flags); ++ memcpy(event.pmkid_candidate.bssid, p->BSSID, ETH_ALEN); ++ event.pmkid_candidate.index = i; ++ event.pmkid_candidate.preauth = ++ p->Flags & NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; ++ wpa_supplicant_event(drv->ctx, EVENT_PMKID_CANDIDATE, ++ &event); ++ } ++} ++ ++static int wpa_driver_ralink_set_pmkid(struct wpa_driver_ralink_data *drv) ++{ ++ int len, count, i, ret; ++ struct ndis_pmkid_entry *entry; ++ NDIS_802_11_PMKID *p; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ count = 0; ++ entry = drv->pmkid; ++ while (entry) ++ { ++ count++; ++ if (count >= drv->no_of_pmkid) ++ break; ++ entry = entry->next; ++ } ++ len = 8 + count * sizeof(BSSID_INFO); ++ p = os_malloc(len); ++ if (p == NULL) ++ return -1; ++ memset(p, 0, len); ++ p->Length = len; ++ p->BSSIDInfoCount = count; ++ entry = drv->pmkid; ++ for (i = 0; i < count; i++) ++ { ++ memcpy(&p->BSSIDInfo[i].BSSID, entry->bssid, ETH_ALEN); ++ memcpy(&p->BSSIDInfo[i].PMKID, entry->pmkid, 16); ++ entry = entry->next; ++ } ++ wpa_hexdump(MSG_MSGDUMP, "NDIS: OID_802_11_PMKID", (const u8 *) p, len); ++ ret = ralink_set_oid(drv, OID_802_11_PMKID, (char *) p, len); ++ os_free(p); ++ return ret; ++} ++ ++static int wpa_driver_ralink_add_pmkid(void *priv, const u8 *bssid, ++ const u8 *pmkid) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct ndis_pmkid_entry *entry, *prev; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (drv->no_of_pmkid == 0) ++ return 0; ++ ++ prev = NULL; ++ entry = drv->pmkid; ++ while (entry) ++ { ++ if (memcmp(entry->bssid, bssid, ETH_ALEN) == 0) ++ break; ++ prev = entry; ++ entry = entry->next; ++ } ++ ++ if (entry) ++ { ++ /* Replace existing entry for this BSSID and move it into the ++ * beginning of the list. */ ++ memcpy(entry->pmkid, pmkid, 16); ++ if (prev) ++ { ++ prev->next = entry->next; ++ entry->next = drv->pmkid; ++ drv->pmkid = entry; ++ } ++ } ++ else ++ { ++ entry = os_malloc(sizeof(*entry)); ++ if (entry) ++ { ++ memcpy(entry->bssid, bssid, ETH_ALEN); ++ memcpy(entry->pmkid, pmkid, 16); ++ entry->next = drv->pmkid; ++ drv->pmkid = entry; ++ } ++ } ++ ++ return wpa_driver_ralink_set_pmkid(drv); ++} ++ ++ ++static int wpa_driver_ralink_remove_pmkid(void *priv, const u8 *bssid, ++ const u8 *pmkid) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct ndis_pmkid_entry *entry, *prev; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (drv->no_of_pmkid == 0) ++ return 0; ++ ++ entry = drv->pmkid; ++ prev = NULL; ++ drv->pmkid = NULL; ++ while (entry) ++ { ++ if (memcmp(entry->bssid, bssid, ETH_ALEN) == 0 && ++ memcmp(entry->pmkid, pmkid, 16) == 0) ++ { ++ if (prev) ++ prev->next = entry->next; ++ else ++ drv->pmkid = entry->next; ++ os_free(entry); ++ break; ++ } ++ prev = entry; ++ entry = entry->next; ++ } ++ return wpa_driver_ralink_set_pmkid(drv); ++} ++ ++ ++static int wpa_driver_ralink_flush_pmkid(void *priv) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ NDIS_802_11_PMKID p; ++ struct ndis_pmkid_entry *pmkid, *prev; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (drv->no_of_pmkid == 0) ++ return 0; ++ ++ pmkid = drv->pmkid; ++ drv->pmkid = NULL; ++ while (pmkid) ++ { ++ prev = pmkid; ++ pmkid = pmkid->next; ++ os_free(prev); ++ } ++ ++ memset(&p, 0, sizeof(p)); ++ p.Length = 8; ++ p.BSSIDInfoCount = 0; ++ wpa_hexdump(MSG_MSGDUMP, "NDIS: OID_802_11_PMKID (flush)", ++ (const u8 *) &p, 8); ++ return ralink_set_oid(drv, OID_802_11_PMKID, (char *) &p, 8); ++} ++ ++static void ++wpa_driver_ralink_event_wireless_custom(struct wpa_driver_ralink_data *drv, ++ void *ctx, char *custom) ++{ ++ union wpa_event_data data; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ wpa_printf(MSG_DEBUG, "Custom wireless event: '%s'", custom); ++ ++ memset(&data, 0, sizeof(data)); ++ /* Host AP driver */ ++ if (strncmp(custom, "MLME-MICHAELMICFAILURE.indication", 33) == 0) ++ { ++ //receive a MICFAILURE report ++ data.michael_mic_failure.unicast = ++ strstr(custom, " unicast ") != NULL; ++ /* TODO: parse parameters(?) */ ++ wpa_supplicant_event(ctx, EVENT_MICHAEL_MIC_FAILURE, &data); ++ } ++ else if (strncmp(custom, "ASSOCINFO_ReqIEs=", 17) == 0) ++ { ++ //receive assoc. req. IEs ++ char *spos; ++ int bytes; ++ ++ spos = custom + 17; ++ //get IE's length ++ //bytes = strlen(spos); ++ bytes = drv->assoc_req_ies_len + drv->assoc_resp_ies_len; ++ ++ if (!bytes) ++ return; ++ ++ ++ data.assoc_info.req_ies = os_malloc(bytes); ++ if (data.assoc_info.req_ies == NULL) ++ return; ++ ++ data.assoc_info.req_ies_len = bytes; ++ memcpy(data.assoc_info.req_ies, spos, bytes); ++ ++ //skip the '\0' byte ++ spos += bytes + 1; ++ ++ data.assoc_info.resp_ies = NULL; ++ data.assoc_info.resp_ies_len = 0; ++ ++ if (strncmp(spos, " RespIEs=", 9) == 0) ++ { ++ //receive assoc. resp. IEs ++ spos += 9; ++ //get IE's length ++ bytes = strlen(spos); ++ if (!bytes) ++ goto done; ++ ++ ++ data.assoc_info.resp_ies = os_malloc(bytes); ++ if (data.assoc_info.resp_ies == NULL) ++ goto done; ++ ++ data.assoc_info.resp_ies_len = bytes; ++ memcpy(data.assoc_info.resp_ies, spos, bytes); ++ } ++ ++ wpa_supplicant_event(ctx, EVENT_ASSOCINFO, &data); ++ ++ //free allocated memory ++ done: ++ if(data.assoc_info.resp_ies != NULL) ++ os_free(data.assoc_info.resp_ies); ++ if(data.assoc_info.req_ies != NULL) ++ os_free(data.assoc_info.req_ies); ++ } ++} ++ ++static void wpa_driver_ralink_event_wireless(struct wpa_driver_ralink_data *drv, ++ void *ctx, char *data, int len) ++{ ++ struct iw_event iwe_buf, *iwe = &iwe_buf; ++ char *pos, *end, *custom, *buf, *assoc_info_buf, *info_pos; ++ struct wpa_supplicant *wpa_s = ctx; ++ BOOLEAN ieee8021x_required_key = FALSE; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ assoc_info_buf = info_pos = NULL; ++ pos = data; ++ end = data + len; ++ ++ while (pos + IW_EV_LCP_LEN <= end) ++ { ++ /* Event data may be unaligned, so make a local, aligned copy ++ * before processing. */ ++ memcpy(&iwe_buf, pos, IW_EV_LCP_LEN); ++ wpa_printf(MSG_DEBUG, "Wireless event: cmd=0x%x len=%d", ++ iwe->cmd, iwe->len); ++ if (iwe->len <= IW_EV_LCP_LEN) ++ return; ++ ++ custom = pos + IW_EV_POINT_LEN; ++ ++ if (drv->we_version_compiled > 18 && ++ (iwe->cmd == IWEVCUSTOM)) ++ { ++ /* WE-19 removed the pointer from struct iw_point */ ++ char *dpos = (char *) &iwe_buf.u.data.length; ++ int dlen = dpos - (char *) &iwe_buf; ++ memcpy(dpos, pos + IW_EV_LCP_LEN, ++ sizeof(struct iw_event) - dlen); ++ } ++ else ++ { ++ memcpy(&iwe_buf, pos, sizeof(struct iw_event)); ++ custom += IW_EV_POINT_OFF; ++ } ++ ++ switch (iwe->cmd) ++ { ++ ++ case IWEVCUSTOM: ++ if (custom + iwe->u.data.length > end) ++ return; ++ buf = os_malloc(iwe->u.data.length + 1); ++ if (buf == NULL) ++ return; ++ memcpy(buf, custom, iwe->u.data.length); ++ buf[iwe->u.data.length] = '\0'; ++ ++ if (wpa_s->conf->ap_scan == 1) ++ { ++ if ((iwe->u.data.flags == RT_ASSOC_EVENT_FLAG) || (iwe->u.data.flags == RT_REQIE_EVENT_FLAG) || ++ (iwe->u.data.flags == RT_RESPIE_EVENT_FLAG) || (iwe->u.data.flags == RT_ASSOCINFO_EVENT_FLAG)) ++ { ++ if (scanning_done == 0) ++ { ++ //free(buf); //<--carella modify ++ //return; //--> ++ } ++ } ++ } ++ ++ if (iwe->u.data.flags == RT_ASSOC_EVENT_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive ASSOCIATED_EVENT !!!"); ++ wpa_drv_get_bssid(wpa_s, wpa_s->bssid); ++ // determine whether the dynamic-WEP is used or not ++ if(wpa_s && wpa_s->current_ssid && wpa_s->current_ssid->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) ++ { ++ if ((wpa_s->current_ssid->eapol_flags & ++ (EAPOL_FLAG_REQUIRE_KEY_UNICAST | EAPOL_FLAG_REQUIRE_KEY_BROADCAST))) ++ { ++ //wpa_printf(MSG_DEBUG, "The current ssid - (%s), eapol_flag = %d.\n", ++ // wpa_ssid_txt(wpa_s->current_ssid->ssid, wpa_s->current_ssid->ssid_len),wpa_s->current_ssid->eapol_flags); ++ ieee8021x_required_key = TRUE; ++ } ++ ++ if (ralink_set_oid(drv, OID_802_11_SET_IEEE8021X_REQUIRE_KEY, (char *) &ieee8021x_required_key, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "ERROR: Failed to set OID_802_11_SET_IEEE8021X_REQUIRE_KEY(%d)", ++ (int) ieee8021x_required_key); ++ } ++ ++ wpa_printf(MSG_DEBUG, "ieee8021x_required_key is %s and eapol_flag(%d).\n", ieee8021x_required_key ? "TRUE" : "FALSE", ++ wpa_s->current_ssid->eapol_flags); ++ } ++ ++ wpa_supplicant_event(ctx, EVENT_ASSOC, NULL); ++ } ++ else if (iwe->u.data.flags == RT_REQIE_EVENT_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive ReqIEs !!!"); ++ drv->assoc_req_ies = os_malloc(iwe->u.data.length); ++ ++ if (drv->assoc_req_ies == NULL) ++ return; ++ ++ drv->assoc_req_ies_len = iwe->u.data.length; ++ memcpy(drv->assoc_req_ies, custom, iwe->u.data.length); ++ } ++ else if (iwe->u.data.flags == RT_RESPIE_EVENT_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive RespIEs !!!"); ++ drv->assoc_resp_ies = os_malloc(iwe->u.data.length); ++ ++ if (drv->assoc_resp_ies == NULL) ++ { ++ if (drv->assoc_req_ies != NULL) ++ os_free(drv->assoc_req_ies); ++ return; ++ } ++ ++ drv->assoc_resp_ies_len = iwe->u.data.length; ++ memcpy(drv->assoc_resp_ies, custom, iwe->u.data.length); ++ } ++ else if (iwe->u.data.flags == RT_ASSOCINFO_EVENT_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive ASSOCINFO_EVENT !!!"); ++ assoc_info_buf = os_malloc(drv->assoc_req_ies_len + drv->assoc_resp_ies_len + 1); ++ ++ if (assoc_info_buf == NULL) ++ { ++ if (drv->assoc_req_ies != NULL) ++ os_free(drv->assoc_req_ies); ++ if (drv->assoc_resp_ies != NULL) ++ os_free(drv->assoc_resp_ies); ++ os_free(buf); ++ return; ++ } ++ ++ memcpy(assoc_info_buf, drv->assoc_req_ies, drv->assoc_req_ies_len); ++ info_pos = assoc_info_buf + drv->assoc_req_ies_len; ++ memcpy(info_pos , drv->assoc_resp_ies, drv->assoc_resp_ies_len); ++ assoc_info_buf[drv->assoc_req_ies_len + drv->assoc_resp_ies_len] = '\0'; ++ wpa_driver_ralink_event_wireless_custom(drv, ctx, assoc_info_buf); ++ os_free(drv->assoc_req_ies); ++ os_free(drv->assoc_resp_ies); ++ os_free(assoc_info_buf); ++ } ++ else if (iwe->u.data.flags == RT_DISASSOC_EVENT_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive DISASSOCIATED_EVENT !!!"); ++ wpa_supplicant_event(ctx, EVENT_DISASSOC, NULL); ++ } ++ else if (iwe->u.data.flags == RT_PMKIDCAND_FLAG) ++ { ++ wpa_printf(MSG_DEBUG, "Custom wireless event: receive PMKIDCAND_EVENT !!!"); ++ wpa_driver_ralink_event_pmkid(drv, (const u8 *)custom, iwe->u.data.length); ++ } ++ else ++ { ++ wpa_driver_ralink_event_wireless_custom(drv, ctx, buf); ++ } ++ os_free(buf); ++ break; ++ ++ } ++ ++ pos += iwe->len; ++ } ++} ++ ++static void wpa_driver_ralink_event_rtm_newlink(struct wpa_driver_ralink_data *drv, ++ void *ctx, struct nlmsghdr *h, ++ int len) ++{ ++ struct ifinfomsg *ifi; ++ int attrlen, nlmsg_len, rta_len; ++ struct rtattr * attr; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (len < sizeof(*ifi)) ++ return; ++ ++ ifi = NLMSG_DATA(h); ++ wpa_hexdump(MSG_DEBUG, "ifi: ", (u8 *)ifi, sizeof(struct ifinfomsg)); ++ ++ nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg)); ++ ++ attrlen = h->nlmsg_len - nlmsg_len; ++ printf("attrlen=%d\n",attrlen); ++ if (attrlen < 0) ++ return; ++ ++ attr = (struct rtattr *) (((char *) ifi) + nlmsg_len); ++ wpa_hexdump(MSG_DEBUG, "attr1: ", (u8 *)attr,sizeof(struct rtattr)); ++ rta_len = RTA_ALIGN(sizeof(struct rtattr)); ++ wpa_hexdump(MSG_DEBUG, "attr2: ", (u8 *)attr,rta_len); ++ while (RTA_OK(attr, attrlen)) ++ { ++ printf("rta_type=%02x\n",attr->rta_type); ++ if (attr->rta_type == IFLA_WIRELESS) ++ { ++ wpa_driver_ralink_event_wireless(drv, ctx, ((char *) attr) + rta_len, attr->rta_len - rta_len); ++ } ++ attr = RTA_NEXT(attr, attrlen); ++ wpa_hexdump(MSG_DEBUG, "attr3: ", (u8 *)attr,sizeof(struct rtattr)); ++ } ++} ++ ++static void wpa_driver_ralink_event_receive(int sock, void *ctx, ++ void *sock_ctx) ++{ ++ char buf[8192]; ++ int left; ++ struct sockaddr_nl from; ++ socklen_t fromlen; ++ struct nlmsghdr *h; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ fromlen = sizeof(from); ++ left = recvfrom(sock, buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr *) &from, &fromlen); ++ ++ if (left < 0) ++ { ++ if (errno != EINTR && errno != EAGAIN) ++ perror("recvfrom(netlink)"); ++ return; ++ } ++ ++ h = (struct nlmsghdr *) buf; ++ wpa_hexdump(MSG_DEBUG, "h: ", (u8 *)h, h->nlmsg_len); ++ ++ while (left >= sizeof(*h)) ++ { ++ int len, plen; ++ ++ len = h->nlmsg_len; ++ plen = len - sizeof(*h); ++ if (len > left || plen < 0) ++ { ++ wpa_printf(MSG_DEBUG, "Malformed netlink message: " ++ "len=%d left=%d plen=%d", len, left, plen); ++ break; ++ } ++ ++ switch (h->nlmsg_type) ++ { ++ case RTM_NEWLINK: ++ wpa_driver_ralink_event_rtm_newlink(ctx, sock_ctx, h, plen); ++ break; ++ } ++ ++ len = NLMSG_ALIGN(len); ++ left -= len; ++ h = (struct nlmsghdr *) ((char *) h + len); ++ } ++ ++ if (left > 0) ++ { ++ wpa_printf(MSG_DEBUG, "%d extra bytes in the end of netlink " ++ "message", left); ++ } ++ ++} ++ ++static int ++ralink_get_we_version_compiled(struct wpa_driver_ralink_data *drv) ++{ ++ struct iwreq iwr; ++ UINT we_version_compiled = 0; ++ ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ iwr.u.data.pointer = (caddr_t) &we_version_compiled; ++ iwr.u.data.flags = RT_OID_WE_VERSION_COMPILED; ++ ++ if (ioctl(drv->ioctl_sock, RT_PRIV_IOCTL, &iwr) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "%s: failed", __func__); ++ return -1; ++ } ++ ++ drv->we_version_compiled = we_version_compiled; ++ ++ return 0; ++} ++ ++static int ++ralink_set_iface_flags(void *priv, int dev_up) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct ifreq ifr; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (drv->ioctl_sock < 0) ++ return -1; ++ ++ memset(&ifr, 0, sizeof(ifr)); ++ snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->ifname); ++ ++ if (ioctl(drv->ioctl_sock, SIOCGIFFLAGS, &ifr) != 0) ++ { ++ perror("ioctl[SIOCGIFFLAGS]"); ++ return -1; ++ } ++ ++ if (dev_up) ++ ifr.ifr_flags |= IFF_UP; ++ else ++ ifr.ifr_flags &= ~IFF_UP; ++ ++ if (ioctl(drv->ioctl_sock, SIOCSIFFLAGS, &ifr) != 0) ++ { ++ perror("ioctl[SIOCSIFFLAGS]"); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static void * wpa_driver_ralink_init(void *ctx, const char *ifname) ++{ ++ int s; ++ struct wpa_driver_ralink_data *drv; ++ struct ifreq ifr; ++ struct sockaddr_nl local; ++ BOOLEAN enable_wpa_supplicant; ++ struct wpa_supplicant *wpa_s = NULL; ++ struct wpa_ssid *entry; ++ int prio; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ /* open socket to kernel */ ++ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) ++ { ++ perror("socket"); ++ return NULL; ++ } ++ /* do it */ ++ strncpy(ifr.ifr_name, ifname, IFNAMSIZ); ++ ++ if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) ++ { ++ perror(ifr.ifr_name); ++ return NULL; ++ } ++ ++ ++ drv = os_malloc(sizeof(*drv)); ++ ++ if (drv == NULL) ++ return NULL; ++ ++ memset(drv, 0, sizeof(*drv)); ++ drv->ctx = ctx; ++ strncpy(drv->ifname, ifname, sizeof(drv->ifname)); ++ drv->ioctl_sock = s; ++ ++ //use netlink like this ++ ++ s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); ++ ++ if (s < 0) ++ { ++ perror("socket(PF_NETLINK,SOCK_RAW,NETLINK_ROUTE)"); ++ close(drv->ioctl_sock); ++ os_free(drv); ++ return NULL; ++ } ++ ++ memset(&local, 0, sizeof(local)); ++ local.nl_family = AF_NETLINK; ++ local.nl_groups = RTMGRP_LINK; ++ ++ if (bind(s, (struct sockaddr *) &local, sizeof(local)) < 0) ++ { ++ perror("bind(netlink)"); ++ close(s); ++ close(drv->ioctl_sock); ++ os_free(drv); ++ return NULL; ++ } ++ ++ eloop_register_read_sock(s, wpa_driver_ralink_event_receive, drv, ctx); ++ drv->event_sock = s; ++ drv->no_of_pmkid = 4; // Number of PMKID saved supporte ++ ++ ralink_set_iface_flags(drv, 1); /* mark up during setup */ ++ ralink_get_we_version_compiled(drv); ++ wpa_driver_ralink_flush_pmkid(drv); ++ ++ enable_wpa_supplicant = TRUE; ++ // trigger driver support wpa_supplicant ++ if (ralink_set_oid(drv, RT_OID_WPA_SUPPLICANT_SUPPORT, (char *) &enable_wpa_supplicant, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "RT_OID_WPA_SUPPLICANT_SUPPORT(%d)", ++ (int) enable_wpa_supplicant); ++ } ++ ++ wpa_s = drv->ctx; ++ ++ if (wpa_s->conf->ap_scan == 1) ++ scanning_done = 0; ++ ++ for(prio=0; prioconf->num_prio; prio++) ++ { ++ for(entry=wpa_s->conf->pssid[prio]; entry; entry=entry->next) ++ { ++ if(entry->disabled) ++ continue; ++ wpa_driver_ralink_set_ssid(drv, entry->ssid, entry->ssid_len); ++ prio = wpa_s->conf->num_prio + 1; ++ break; ++ } ++ } ++ return drv; ++} ++ ++static void wpa_driver_ralink_deinit(void *priv) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ BOOLEAN enable_wpa_supplicant; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ enable_wpa_supplicant = FALSE; ++ ++ // trigger driver disable wpa_supplicant support ++ if (ralink_set_oid(drv, RT_OID_WPA_SUPPLICANT_SUPPORT, (char *) &enable_wpa_supplicant, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "RT_OID_WPA_SUPPLICANT_SUPPORT(%d)", ++ (int) enable_wpa_supplicant); ++ } ++ ++ wpa_driver_ralink_flush_pmkid(drv); ++ sleep(1); ++ ralink_set_iface_flags(drv, 0); ++ ++ eloop_unregister_read_sock(drv->event_sock); ++ close(drv->event_sock); ++ close(drv->ioctl_sock); ++ os_free(drv); ++} ++ ++static void wpa_driver_ralink_scan_timeout(void *eloop_ctx, ++ void *timeout_ctx) ++{ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ wpa_printf(MSG_DEBUG, "Scan timeout - try to get results"); ++ wpa_supplicant_event(timeout_ctx, EVENT_SCAN_RESULTS, NULL); ++ ++ scanning_done = 1; ++ ++} ++ ++static int wpa_driver_ralink_scan(void *priv, const u8 *ssid, ++ size_t ssid_len) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct iwreq iwr; ++ int ret = 0; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (ssid_len > IW_ESSID_MAX_SIZE) { ++ wpa_printf(MSG_DEBUG, "%s: too long SSID (%lu)", ++ __FUNCTION__, (unsigned long) ssid_len); ++ return -1; ++ } ++ ++ wpa_driver_ralink_set_ssid(drv, ssid, ssid_len); ++ ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ ++ if (ioctl(drv->ioctl_sock, SIOCSIWSCAN, &iwr) < 0) ++ { ++ perror("ioctl[SIOCSIWSCAN]"); ++ ret = -1; ++ } ++ ++ /* Not all drivers generate "scan completed" wireless event, so try to ++ * read results after a timeout. */ ++ eloop_register_timeout(4, 0, wpa_driver_ralink_scan_timeout, drv, drv->ctx); ++ ++ scanning_done = 0; ++ ++ return ret; ++} ++ ++static int ++wpa_driver_ralink_get_scan_results(void *priv, ++ struct wpa_scan_result *results, ++ size_t max_size) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ UCHAR *buf = NULL; ++ //NDIS_802_11_BSSID_LIST_EX *wsr = (NDIS_802_11_BSSID_LIST_EX *) buf; //<--carella modify ++ NDIS_802_11_BSSID_LIST_EX *wsr = NULL; //-->carella ++ NDIS_WLAN_BSSID_EX *wbi; ++ struct iwreq iwr; ++ int ap_num; ++ u8 *pos,*end; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ buf = (UCHAR *) os_malloc(RT_MAX_802_11_BSSID_LIST_EX); ++ if (buf == NULL) ++ return -1; ++ ++ memset(buf, 0, RT_MAX_802_11_BSSID_LIST_EX); ++ ++ wsr = (NDIS_802_11_BSSID_LIST_EX *) buf; ++ ++ wsr->NumberOfItems = 0; ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ iwr.u.data.pointer = (caddr_t) buf; ++ iwr.u.data.flags = OID_802_11_BSSID_LIST; ++ ++ if (ioctl(drv->ioctl_sock, RT_PRIV_IOCTL, &iwr) < 0) ++ { ++ os_free(buf); ++ return -1; ++ } ++ ++ memset(results, 0, max_size * sizeof(struct wpa_scan_result)); ++ ++ for (ap_num = 0, wbi = wsr->Bssid; ap_num < wsr->NumberOfItems; ++ap_num) ++ { ++ memcpy(results[ap_num].bssid, &wbi->MacAddress, ETH_ALEN); ++ memcpy(results[ap_num].ssid, wbi->Ssid.Ssid, wbi->Ssid.SsidLength); ++ results[ap_num].ssid_len = wbi->Ssid.SsidLength; ++ results[ap_num].freq = (wbi->Configuration.DSConfig / 1000); ++ ++ /* get ie's */ ++ wpa_hexdump(MSG_DEBUG, "RALINK: AP IEs", ++ (u8 *) wbi + sizeof(*wbi) - 1, wbi->IELength); ++ ++ pos = (u8 *) wbi + sizeof(*wbi) - 1; ++ end = (u8 *) wbi + sizeof(*wbi) + wbi->IELength; ++ ++ if (wbi->IELength < sizeof(NDIS_802_11_FIXED_IEs)) ++ break; ++ ++ pos += sizeof(NDIS_802_11_FIXED_IEs) - 2; ++ memcpy(&results[ap_num].caps, pos, 2); ++ pos += 2; ++ ++ while (pos + 1 < end && pos + 2 + pos[1] <= end) ++ { ++ u8 ielen = 2 + pos[1]; ++ ++ if (ielen > SSID_MAX_WPA_IE_LEN) ++ { ++ pos += ielen; ++ continue; ++ } ++ ++ if (pos[0] == GENERIC_INFO_ELEM && pos[1] >= 4 && ++ memcmp(pos + 2, "\x00\x50\xf2\x01", 4) == 0) ++ { ++ memcpy(results[ap_num].wpa_ie, pos, ielen); ++ results[ap_num].wpa_ie_len = ielen; ++ } ++ else if (pos[0] == RSN_INFO_ELEM) ++ { ++ memcpy(results[ap_num].rsn_ie, pos, ielen); ++ results[ap_num].rsn_ie_len = ielen; ++ } ++ pos += ielen; ++ } ++ ++ wbi = (NDIS_WLAN_BSSID_EX *) ((u8 *) wbi + wbi->Length); ++ } ++ ++ os_free(buf); ++ return ap_num; ++} ++ ++static int ralink_set_auth_mode(struct wpa_driver_ralink_data *drv, NDIS_802_11_AUTHENTICATION_MODE mode) ++{ ++ NDIS_802_11_AUTHENTICATION_MODE auth_mode = mode; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (ralink_set_oid(drv, OID_802_11_AUTHENTICATION_MODE, ++ (char *) &auth_mode, sizeof(auth_mode)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "OID_802_11_AUTHENTICATION_MODE (%d)", ++ (int) auth_mode); ++ return -1; ++ } ++ return 0; ++} ++ ++static int wpa_driver_ralink_remove_key(struct wpa_driver_ralink_data *drv, ++ int key_idx, const u8 *addr, ++ const u8 *bssid, int pairwise) ++{ ++ NDIS_802_11_REMOVE_KEY rkey; ++ NDIS_802_11_KEY_INDEX index; ++ int res, res2; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ memset(&rkey, 0, sizeof(rkey)); ++ ++ rkey.Length = sizeof(rkey); ++ rkey.KeyIndex = key_idx; ++ ++ if (pairwise) ++ rkey.KeyIndex |= 1 << 30; ++ ++ memcpy(rkey.BSSID, bssid, ETH_ALEN); ++ ++ res = ralink_set_oid(drv, OID_802_11_REMOVE_KEY, (char *) &rkey, ++ sizeof(rkey)); ++ ++//AlbertY@20060210 removed it ++ if(0)//if (!pairwise) ++ { ++ res2 = ralink_set_oid(drv, OID_802_11_REMOVE_WEP, ++ (char *) &index, sizeof(index)); ++ } ++ else ++ res2 = 0; ++ ++ if (res < 0 && res2 < 0) ++ return res; ++ return 0; ++} ++ ++static int wpa_driver_ralink_add_wep(struct wpa_driver_ralink_data *drv, ++ int pairwise, int key_idx, int set_tx, ++ const u8 *key, size_t key_len) ++{ ++ NDIS_802_11_WEP *wep; ++ size_t len; ++ int res; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ len = 12 + key_len; ++ wep = os_malloc(len); ++ ++ if (wep == NULL) ++ return -1; ++ ++ memset(wep, 0, len); ++ wep->Length = len; ++ wep->KeyIndex = key_idx; ++ ++ if (set_tx) ++ wep->KeyIndex |= 1 << 31; ++#if 0 /* Setting bit30 does not seem to work with some NDIS drivers */ ++ if (pairwise) ++ wep->KeyIndex |= 1 << 30; ++#endif ++ wep->KeyLength = key_len; ++ memcpy(wep->KeyMaterial, key, key_len); ++ ++ wpa_hexdump_key(MSG_MSGDUMP, "RALINK: OID_802_11_ADD_WEP", ++ (const u8 *) wep, len); ++ res = ralink_set_oid(drv, OID_802_11_ADD_WEP, (char *) wep, len); ++ ++ os_free(wep); ++ ++ return res; ++} ++ ++static int wpa_driver_ralink_set_key(void *priv, wpa_alg alg, const u8 *addr, ++ int key_idx, int set_tx, ++ const u8 *seq, size_t seq_len, ++ const u8 *key, size_t key_len) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ size_t len; ++ NDIS_802_11_KEY *nkey; ++ int i, res, pairwise; ++ u8 bssid[ETH_ALEN]; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (addr == NULL || memcmp(addr, "\xff\xff\xff\xff\xff\xff", ++ ETH_ALEN) == 0) ++ { ++ /* Group Key */ ++ pairwise = 0; ++ wpa_driver_ralink_get_bssid(drv, bssid); ++ } ++ else ++ { ++ /* Pairwise Key */ ++ pairwise = 1; ++ memcpy(bssid, addr, ETH_ALEN); ++ } ++ ++ if (alg == WPA_ALG_NONE || key_len == 0) ++ { ++ return wpa_driver_ralink_remove_key(drv, key_idx, addr, bssid, ++ pairwise); ++ } ++ ++ if (alg == WPA_ALG_WEP) ++ { ++ return wpa_driver_ralink_add_wep(drv, pairwise, key_idx, set_tx, ++ key, key_len); ++ } ++ ++ len = 12 + 6 + 6 + 8 + key_len; ++ ++ nkey = os_malloc(len); ++ ++ if (nkey == NULL) ++ return -1; ++ ++ memset(nkey, 0, len); ++ ++ nkey->Length = len; ++ nkey->KeyIndex = key_idx; ++ ++ if (set_tx) ++ nkey->KeyIndex |= 1 << 31; ++ ++ if (pairwise) ++ nkey->KeyIndex |= 1 << 30; ++ ++ if (seq && seq_len) ++ nkey->KeyIndex |= 1 << 29; ++ ++ nkey->KeyLength = key_len; ++ memcpy(nkey->BSSID, bssid, ETH_ALEN); ++ ++ if (seq && seq_len) ++ { ++ for (i = 0; i < seq_len; i++) ++ nkey->KeyRSC |= seq[i] << (i * 8); ++ } ++ if (alg == WPA_ALG_TKIP && key_len == 32) ++ { ++ memcpy(nkey->KeyMaterial, key, 16); ++ memcpy(nkey->KeyMaterial + 16, key + 24, 8); ++ memcpy(nkey->KeyMaterial + 24, key + 16, 8); ++ } ++ else ++ { ++ memcpy(nkey->KeyMaterial, key, key_len); ++ } ++ ++ wpa_hexdump_key(MSG_MSGDUMP, "RALINK: OID_802_11_ADD_KEY", ++ (const u8 *) nkey, len); ++ res = ralink_set_oid(drv, OID_802_11_ADD_KEY, (char *) nkey, len); ++ os_free(nkey); ++ ++ return res; ++} ++ ++static int wpa_driver_ralink_disassociate(void *priv, const u8 *addr, ++ int reason_code) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ if (ralink_set_oid(drv, OID_802_11_DISASSOCIATE, ++ " ", 4) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "OID_802_11_DISASSOCIATE"); ++ } ++ ++ return 0; ++} ++ ++static int wpa_driver_ralink_deauthenticate(void *priv, const u8 *addr, ++ int reason_code) ++{ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ return wpa_driver_ralink_disassociate(priv, addr, reason_code); ++} ++ ++static int ++wpa_driver_ralink_associate(void *priv, ++ struct wpa_driver_associate_params *params) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ ++ NDIS_802_11_NETWORK_INFRASTRUCTURE mode; ++ NDIS_802_11_AUTHENTICATION_MODE auth_mode; ++ NDIS_802_11_WEP_STATUS encr, group; ++ BOOLEAN ieee8021xMode; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ if (params->mode == IEEE80211_MODE_IBSS) ++ mode = Ndis802_11IBSS; ++ else ++ mode = Ndis802_11Infrastructure; ++ ++ if (ralink_set_oid(drv, OID_802_11_INFRASTRUCTURE_MODE, ++ (char *) &mode, sizeof(mode)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "OID_802_11_INFRASTRUCTURE_MODE (%d)", ++ (int) mode); ++ /* Try to continue anyway */ ++ } ++ ++ if (params->wpa_ie == NULL || params->wpa_ie_len == 0) ++ { ++ if (params->auth_alg & AUTH_ALG_SHARED_KEY) ++ { ++ if (params->auth_alg & AUTH_ALG_OPEN_SYSTEM) ++ auth_mode = Ndis802_11AuthModeAutoSwitch; ++ else ++ auth_mode = Ndis802_11AuthModeShared; ++ } ++ else ++ auth_mode = Ndis802_11AuthModeOpen; ++ } ++ else if (params->wpa_ie[0] == RSN_INFO_ELEM) ++ { ++ if (params->key_mgmt_suite == KEY_MGMT_PSK) ++ auth_mode = Ndis802_11AuthModeWPA2PSK; ++ else ++ auth_mode = Ndis802_11AuthModeWPA2; ++ } ++ else ++ { ++ if (params->key_mgmt_suite == KEY_MGMT_WPA_NONE) ++ auth_mode = Ndis802_11AuthModeWPANone; ++ else if (params->key_mgmt_suite == KEY_MGMT_PSK) ++ auth_mode = Ndis802_11AuthModeWPAPSK; ++ else ++ auth_mode = Ndis802_11AuthModeWPA; ++ } ++ ++ switch (params->pairwise_suite) ++ { ++ case CIPHER_CCMP: ++ encr = Ndis802_11Encryption3Enabled; ++ break; ++ case CIPHER_TKIP: ++ encr = Ndis802_11Encryption2Enabled; ++ break; ++ case CIPHER_WEP40: ++ case CIPHER_WEP104: ++ encr = Ndis802_11Encryption1Enabled; ++ break; ++ case CIPHER_NONE: ++ if (params->group_suite == CIPHER_CCMP) ++ encr = Ndis802_11Encryption3Enabled; ++ else if (params->group_suite == CIPHER_TKIP) ++ encr = Ndis802_11Encryption2Enabled; ++ else ++ encr = Ndis802_11EncryptionDisabled; ++ break; ++ default: ++ encr = Ndis802_11EncryptionDisabled; ++ }; ++ ++ ralink_set_auth_mode(drv, auth_mode); ++ ++ // notify driver that IEEE8021x mode is enabled ++ if(params->key_mgmt_suite == KEY_MGMT_802_1X_NO_WPA) ++ ieee8021xMode = TRUE; ++ else ++ ieee8021xMode = FALSE; ++ ++ if (ralink_set_oid(drv, OID_802_11_SET_IEEE8021X, (char *) &ieee8021xMode, sizeof(BOOLEAN)) < 0) ++ { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "OID_802_11_SET_IEEE8021X(%d)", ++ (int) ieee8021xMode); ++ } ++ ++ if (ralink_set_oid(drv, OID_802_11_WEP_STATUS, ++ (char *) &encr, sizeof(encr)) < 0) { ++ wpa_printf(MSG_DEBUG, "RALINK: Failed to set " ++ "OID_802_11_WEP_STATUS(%d)", ++ (int) encr); ++ } ++ ++ return wpa_driver_ralink_set_ssid(drv, params->ssid, params->ssid_len); ++} ++ ++static int wpa_driver_ralink_get_associnfo(struct wpa_driver_ralink_data *drv) ++{ ++ NDIS_802_11_ASSOCIATION_INFORMATION *buf; ++ int ret = 0; ++ struct iwreq iwr; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ buf = (NDIS_802_11_ASSOCIATION_INFORMATION *)os_malloc(sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); ++ if (buf == NULL) ++ return -1; ++ memset(buf, 0, sizeof(buf)); ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ ++ iwr.u.data.flags = OID_802_11_STATE; ++ iwr.u.data.flags |= OID_GET_SET_TOGGLE; ++ iwr.u.data.pointer = (caddr_t) buf; ++ iwr.u.data.length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); ++ ++ if (ioctl(drv->ioctl_sock, RT_PRIV_IOCTL, &iwr) < 0) ++ { ++ perror("ioctl[RT_PRIV_IOCTL] -- OID_802_11_SSID"); ++ ret = -1; ++ } ++ ++ if(((NDIS_802_11_ASSOCIATION_INFORMATION *)iwr.u.data.pointer)->AssociateResponseToMe) ++ { ++ printf("wpa_driver_ralink_get_associnfo: association success\n"); ++ ret = 1; ++ } ++ else ++ printf("wpa_driver_ralink_get_associnfo: association fail\n"); ++ os_free(buf); ++ return ret; ++} ++ ++static int wpa_driver_ralink_poll_timeout(void *eloop_ctx, void *ctx) ++{ ++ struct wpa_driver_ralink_data *drv = eloop_ctx; ++ struct wpa_supplicant *wpa_s = ctx; ++ u8 bssid[ETH_ALEN]; ++ ++ if (wpa_driver_ralink_get_bssid(drv, bssid)) { ++ /* Disconnected */ ++ wpa_printf(MSG_DEBUG, "%s: Disconnected!!", __FUNCTION__); ++ } else { ++ /* Connected */ ++ ++ if(wpa_driver_ralink_get_associnfo(drv) == 1) ++ { ++ wpa_printf(MSG_DEBUG, "%s: Connected!!", __FUNCTION__); ++ wpa_drv_get_bssid(wpa_s, wpa_s->bssid); ++ wpa_s->associate_state = 1; ++ wpa_supplicant_event(ctx, EVENT_ASSOC, NULL); ++ } ++ else ++ wpa_s->associate_state = 0; ++ } ++} ++ ++static void wpa_driver_ralink_poll(void *priv, void *ctx) ++{ ++ struct wpa_driver_ralink_data *drv = priv; ++ struct wpa_supplicant *wpa_s = ctx; ++ ++ if(wpa_s->wpa_state < WPA_ASSOCIATED) ++ wpa_driver_ralink_poll_timeout(drv, ctx); ++} ++ ++const struct wpa_driver_ops wpa_driver_ralink_ops = { ++ .name = "ralink", ++ .desc = "Ralink rt73 driver", ++ .get_bssid = wpa_driver_ralink_get_bssid, ++ .get_ssid = wpa_driver_ralink_get_ssid, ++ .set_key = wpa_driver_ralink_set_key, ++ .init = wpa_driver_ralink_init, ++ .deinit = wpa_driver_ralink_deinit, ++ .scan = wpa_driver_ralink_scan, ++ .get_scan_results = wpa_driver_ralink_get_scan_results, ++ .deauthenticate = wpa_driver_ralink_deauthenticate, ++ .disassociate = wpa_driver_ralink_disassociate, ++ .associate = wpa_driver_ralink_associate, ++ .add_pmkid = wpa_driver_ralink_add_pmkid, ++ .remove_pmkid = wpa_driver_ralink_remove_pmkid, ++ .flush_pmkid = wpa_driver_ralink_flush_pmkid, ++ .poll_ralink = wpa_driver_ralink_poll, ++}; +diff -NaurEbB wpa_supplicant-0.5.10/driver_ralink.h wpa_supplicant-0.5.10_RALINK/driver_ralink.h +--- wpa_supplicant-0.5.10/driver_ralink.h 1970-01-01 01:00:00.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/driver_ralink.h 2008-12-05 01:36:46.000000000 +0100 +@@ -0,0 +1,394 @@ ++/* ++ *************************************************************************** ++ * Ralink Tech Inc. ++ * 5F, No. 36 Taiyuan St. ++ * Jhubei City ++ * Hsinchu County 302, Taiwan, R.O.C. ++ * ++ * (c) Copyright 2002-2008, Ralink Technology, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify * ++ * it under the terms of the GNU General Public License as published by * ++ * the Free Software Foundation; either version 2 of the License, or * ++ * (at your option) any later version. * ++ * * ++ * This program is distributed in the hope that it will be useful, * ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of * ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ++ * GNU General Public License for more details. * ++ * * ++ * You should have received a copy of the GNU General Public License * ++ * along with this program; if not, write to the * ++ * Free Software Foundation, Inc., * ++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ++ * * ++ ************************************************************************/ ++ ++/* ++ * WPA Supplicant - driver interaction with Ralink rt73 driver driver ++ * ++ * ++ * ++ */ ++ ++//#include ++ ++// Ralink defined OIDs ++#if WIRELESS_EXT <= 11 ++#ifndef SIOCDEVPRIVATE ++#define SIOCDEVPRIVATE 0x8BE0 ++#endif ++#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE ++#endif ++ ++#define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x0E) ++#define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02) ++ ++// IEEE 802.11 OIDs & Ralink defined OIDs ****** ++ ++// (RaConfig Set/QueryInform) ==> ++#define OID_GET_SET_TOGGLE 0x8000 ++ ++#define OID_802_11_ADD_WEP 0x0112 ++#define OID_802_11_REMOVE_WEP 0x0113 ++#define OID_802_11_DISASSOCIATE 0x0114 ++#define OID_802_11_PRIVACY_FILTER 0x0118 ++#define OID_802_11_ASSOCIATION_INFORMATION 0x011E ++#define OID_802_11_BSSID_LIST_SCAN 0x0508 ++#define OID_802_11_SSID 0x0509 ++#define OID_802_11_BSSID 0x050A ++#define OID_802_11_WEP_STATUS 0x0510 ++#define OID_802_11_AUTHENTICATION_MODE 0x0511 ++#define OID_802_11_INFRASTRUCTURE_MODE 0x0512 ++#define OID_802_11_TX_POWER_LEVEL 0x0517 ++#define OID_802_11_REMOVE_KEY 0x0519 ++#define OID_802_11_ADD_KEY 0x0520 ++#define OID_802_11_BSSID_LIST 0x0609 ++#define OID_802_3_CURRENT_ADDRESS 0x060A ++#define OID_SET_COUNTERMEASURES 0x0616 ++#define OID_802_11_SET_IEEE8021X 0x0617 // For IEEE8021x mode ++#define OID_802_11_SET_IEEE8021X_REQUIRE_KEY 0x0618 // For DynamicWEP in IEEE802.1x mode ++#define OID_802_11_PMKID 0x0620 ++#define RT_OID_WPA_SUPPLICANT_SUPPORT 0x0621 // for trigger driver enable/disable wpa_supplicant support ++#define RT_OID_WE_VERSION_COMPILED 0x0622 ++#define OID_802_11_STATE 0x0623 ++ ++#define PACKED __attribute__ ((packed)) ++ ++//wpa_supplicant event flags ++#define RT_ASSOC_EVENT_FLAG 0x0101 ++#define RT_DISASSOC_EVENT_FLAG 0x0102 ++#define RT_REQIE_EVENT_FLAG 0x0103 ++#define RT_RESPIE_EVENT_FLAG 0x0104 ++#define RT_ASSOCINFO_EVENT_FLAG 0x0105 ++#define RT_PMKIDCAND_FLAG 0x0106 ++ ++#define RT_MAX_802_11_BSSID_LIST_EX 16384 ++// ++// IEEE 802.11 Structures and definitions ++// ++// new types for Media Specific Indications ++ ++#ifndef ULONG ++#define CHAR char ++#define INT int ++#define SHORT int ++#define UINT u32 ++#define ULONG u32 ++#define USHORT u16 ++#define UCHAR u8 ++ ++#define uint32 u32 ++#define uint8 u8 ++ ++ ++#define BOOLEAN u8 ++//#define LARGE_INTEGER s64 ++#define VOID void ++#define LONG int ++#define LONGLONG s64 ++#define ULONGLONG u64 ++typedef VOID *PVOID; ++typedef CHAR *PCHAR; ++typedef UCHAR *PUCHAR; ++typedef USHORT *PUSHORT; ++typedef LONG *PLONG; ++typedef ULONG *PULONG; ++ ++typedef union _LARGE_INTEGER { ++ struct { ++ ULONG LowPart; ++ LONG HighPart; ++ }vv; ++ struct { ++ ULONG LowPart; ++ LONG HighPart; ++ } u; ++ s64 QuadPart; ++} LARGE_INTEGER; ++ ++#endif ++ ++#define NDIS_802_11_LENGTH_SSID 32 ++#define NDIS_802_11_LENGTH_RATES 8 ++#define NDIS_802_11_LENGTH_RATES_EX 16 ++#define MAX_LEN_OF_SSID 32 ++#define MAC_ADDR_LEN 6 ++ ++typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; ++ ++// mask for authentication/integrity fields ++#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f ++ ++#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01 ++#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02 ++#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06 ++#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E ++ ++// Added new types for OFDM 5G and 2.4G ++typedef enum _NDIS_802_11_NETWORK_TYPE ++{ ++ Ndis802_11FH, ++ Ndis802_11DS, ++ Ndis802_11OFDM5, ++ Ndis802_11OFDM24, ++ Ndis802_11Automode, ++ Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound ++} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; ++ ++// ++// Received Signal Strength Indication ++// ++typedef LONG NDIS_802_11_RSSI; // in dBm ++ ++typedef struct _NDIS_802_11_CONFIGURATION_FH ++{ ++ ULONG Length; // Length of structure ++ ULONG HopPattern; // As defined by 802.11, MSB set ++ ULONG HopSet; // to one if non-802.11 ++ ULONG DwellTime; // units are Kusec ++} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH; ++ ++typedef struct _NDIS_802_11_CONFIGURATION ++{ ++ ULONG Length; // Length of structure ++ ULONG BeaconPeriod; // units are Kusec ++ ULONG ATIMWindow; // units are Kusec ++ ULONG DSConfig; // Frequency, units are kHz ++ NDIS_802_11_CONFIGURATION_FH FHConfig; ++} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION; ++ ++typedef ULONG NDIS_802_11_KEY_INDEX; ++typedef ULONGLONG NDIS_802_11_KEY_RSC; ++ ++// Key mapping keys require a BSSID ++typedef struct PACKED _NDIS_802_11_KEY ++{ ++ ULONG Length; // Length of this structure ++ ULONG KeyIndex; ++ ULONG KeyLength; // length of key in bytes ++ NDIS_802_11_MAC_ADDRESS BSSID; ++ NDIS_802_11_KEY_RSC KeyRSC; ++ UCHAR KeyMaterial[1]; // variable length depending on above field ++} NDIS_802_11_KEY, *PNDIS_802_11_KEY; ++ ++typedef struct _NDIS_802_11_REMOVE_KEY ++{ ++ ULONG Length; // Length of this structure ++ ULONG KeyIndex; ++ NDIS_802_11_MAC_ADDRESS BSSID; ++} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY; ++ ++typedef struct PACKED _NDIS_802_11_WEP ++{ ++ ULONG Length; // Length of this structure ++ ULONG KeyIndex; // 0 is the per-client key, 1-N are the ++ // global keys ++ ULONG KeyLength; // length of key in bytes ++ UCHAR KeyMaterial[1];// variable length depending on above field ++} NDIS_802_11_WEP, *PNDIS_802_11_WEP; ++ ++ ++typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE ++{ ++ Ndis802_11IBSS, ++ Ndis802_11Infrastructure, ++ Ndis802_11AutoUnknown, ++ Ndis802_11InfrastructureMax // Not a real value, defined as upper bound ++} NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE; ++ ++// PMKID Structures ++typedef UCHAR NDIS_802_11_PMKID_VALUE[16]; ++ ++typedef struct _BSSID_INFO ++{ ++ NDIS_802_11_MAC_ADDRESS BSSID; ++ NDIS_802_11_PMKID_VALUE PMKID; ++} BSSID_INFO, *PBSSID_INFO; ++ ++typedef struct _NDIS_802_11_PMKID ++{ ++ ULONG Length; ++ ULONG BSSIDInfoCount; ++ BSSID_INFO BSSIDInfo[1]; ++} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID; ++ ++//Added new types for PMKID Candidate lists. ++typedef struct _PMKID_CANDIDATE { ++ NDIS_802_11_MAC_ADDRESS BSSID; ++ ULONG Flags; ++} PMKID_CANDIDATE, *PPMKID_CANDIDATE; ++ ++typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST ++{ ++ ULONG Version; // Version of the structure ++ ULONG NumCandidates; // No. of pmkid candidates ++ PMKID_CANDIDATE CandidateList[1]; ++} NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST; ++ ++//Flags for PMKID Candidate list structure ++#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 ++ ++// Add new authentication modes ++typedef enum _NDIS_802_11_AUTHENTICATION_MODE ++{ ++ Ndis802_11AuthModeOpen, ++ Ndis802_11AuthModeShared, ++ Ndis802_11AuthModeAutoSwitch, ++ Ndis802_11AuthModeWPA, ++ Ndis802_11AuthModeWPAPSK, ++ Ndis802_11AuthModeWPANone, ++ Ndis802_11AuthModeWPA2, ++ Ndis802_11AuthModeWPA2PSK, ++ Ndis802_11AuthModeMax // Not a real mode, defined as upper bound ++} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE; ++ ++typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates ++typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates ++ ++typedef struct PACKED _NDIS_802_11_SSID ++{ ++ ULONG SsidLength; // length of SSID field below, in bytes; ++ // this can be zero. ++ UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; // SSID information field ++} NDIS_802_11_SSID, *PNDIS_802_11_SSID; ++ ++ ++typedef struct PACKED _NDIS_WLAN_BSSID ++{ ++ ULONG Length; // Length of this structure ++ NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID ++ UCHAR Reserved[2]; ++ NDIS_802_11_SSID Ssid; // SSID ++ ULONG Privacy; // WEP encryption requirement ++ NDIS_802_11_RSSI Rssi; // receive signal ++ // strength in dBm ++ NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; ++ NDIS_802_11_CONFIGURATION Configuration; ++ NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; ++ NDIS_802_11_RATES SupportedRates; ++} NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID; ++ ++typedef struct PACKED _NDIS_802_11_BSSID_LIST ++{ ++ ULONG NumberOfItems; // in list below, at least 1 ++ NDIS_WLAN_BSSID Bssid[1]; ++} NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST; ++ ++// Added Capabilities, IELength and IEs for each BSSID ++typedef struct PACKED _NDIS_WLAN_BSSID_EX ++{ ++ ULONG Length; // Length of this structure ++ NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID ++ UCHAR Reserved[2]; ++ NDIS_802_11_SSID Ssid; // SSID ++ ULONG Privacy; // WEP encryption requirement ++ NDIS_802_11_RSSI Rssi; // receive signal ++ // strength in dBm ++ NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; ++ NDIS_802_11_CONFIGURATION Configuration; ++ NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; ++ NDIS_802_11_RATES_EX SupportedRates; ++ ULONG IELength; ++ UCHAR IEs[1]; ++} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX; ++ ++typedef struct _NDIS_802_11_BSSID_LIST_EX ++{ ++ ULONG NumberOfItems; // in list below, at least 1 ++ NDIS_WLAN_BSSID_EX Bssid[1]; ++} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX; ++ ++typedef struct _NDIS_802_11_FIXED_IEs ++{ ++ UCHAR Timestamp[8]; ++ USHORT BeaconInterval; ++ USHORT Capabilities; ++} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs; ++ ++// Added new encryption types ++// Also aliased typedef to new name ++typedef enum _NDIS_802_11_WEP_STATUS ++{ ++ Ndis802_11WEPEnabled, ++ Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, ++ Ndis802_11WEPDisabled, ++ Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, ++ Ndis802_11WEPKeyAbsent, ++ Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, ++ Ndis802_11WEPNotSupported, ++ Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, ++ Ndis802_11Encryption2Enabled, ++ Ndis802_11Encryption2KeyAbsent, ++ Ndis802_11Encryption3Enabled, ++ Ndis802_11Encryption3KeyAbsent ++} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, ++ NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; ++ ++typedef enum _NDIS_802_11_RELOAD_DEFAULTS ++{ ++ Ndis802_11ReloadWEPKeys ++} NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS; ++ ++#define NDIS_802_11_AI_REQFI_CAPABILITIES 1 ++#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2 ++#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4 ++ ++#define NDIS_802_11_AI_RESFI_CAPABILITIES 1 ++#define NDIS_802_11_AI_RESFI_STATUSCODE 2 ++#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4 ++ ++typedef struct _NDIS_802_11_AI_REQFI ++{ ++ USHORT Capabilities; ++ USHORT ListenInterval; ++ NDIS_802_11_MAC_ADDRESS CurrentAPAddress; ++} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI; ++ ++typedef struct _NDIS_802_11_AI_RESFI ++{ ++ USHORT Capabilities; ++ USHORT StatusCode; ++ USHORT AssociationId; ++} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI; ++ ++typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION ++{ ++ ULONG Length; ++ USHORT AvailableRequestFixedIEs; ++ NDIS_802_11_AI_REQFI RequestFixedIEs; ++ ULONG RequestIELength; ++ ULONG OffsetRequestIEs; ++ USHORT AvailableResponseFixedIEs; ++ NDIS_802_11_AI_RESFI ResponseFixedIEs; ++ ULONG ResponseIELength; ++ ULONG OffsetResponseIEs; ++ ULONG AssociateResponseToMe; ++} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; ++ ++struct ndis_pmkid_entry { ++ struct ndis_pmkid_entry *next; ++ u8 bssid[ETH_ALEN]; ++ u8 pmkid[16]; ++}; ++ +diff -NaurEbB wpa_supplicant-0.5.10/drivers.c wpa_supplicant-0.5.10_RALINK/drivers.c +--- wpa_supplicant-0.5.10/drivers.c 2008-12-05 01:45:50.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/drivers.c 2008-12-05 01:36:46.000000000 +0100 +@@ -57,7 +57,9 @@ + #ifdef CONFIG_DRIVER_TEST + extern struct wpa_driver_ops wpa_driver_test_ops; /* driver_test.c */ + #endif /* CONFIG_DRIVER_TEST */ +- ++#ifdef CONFIG_DRIVER_RALINK ++extern struct wpa_driver_ops wpa_driver_ralink_ops; /* driver_ralink.c */ ++#endif /* CONFIG_DRIVER_RALINK */ + + struct wpa_driver_ops *wpa_supplicant_drivers[] = + { +@@ -103,5 +105,8 @@ + #ifdef CONFIG_DRIVER_TEST + &wpa_driver_test_ops, + #endif /* CONFIG_DRIVER_TEST */ ++#ifdef CONFIG_DRIVER_RALINK ++ &wpa_driver_ralink_ops, ++#endif /* CONFIG_DRIVER_RALINK */ + NULL + }; +diff -NaurEbB wpa_supplicant-0.5.10/events.c wpa_supplicant-0.5.10_RALINK/events.c +--- wpa_supplicant-0.5.10/events.c 2007-11-29 03:49:08.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/events.c 2008-12-05 01:40:05.000000000 +0100 +@@ -283,11 +283,14 @@ + break; + } + ++/* carella modify */ ++#ifndef CONFIG_DRIVER_RALINK + if (!(ie.group_cipher & ssid->group_cipher)) { + wpa_printf(MSG_DEBUG, " skip RSN IE - GTK cipher " + "mismatch"); + break; + } ++#endif + + if (!(ie.key_mgmt & ssid->key_mgmt)) { + wpa_printf(MSG_DEBUG, " skip RSN IE - key mgmt " +@@ -327,11 +330,14 @@ + break; + } + ++/* carella modify */ ++#ifndef CONFIG_DRIVER_RALINK + if (!(ie.group_cipher & ssid->group_cipher)) { + wpa_printf(MSG_DEBUG, " skip WPA IE - GTK cipher " + "mismatch"); + break; + } ++#endif + + if (!(ie.key_mgmt & ssid->key_mgmt)) { + wpa_printf(MSG_DEBUG, " skip WPA IE - key mgmt " +@@ -391,9 +397,10 @@ + wpa_printf(MSG_DEBUG, " skip - disabled"); + continue; + } +- if (bss->ssid_len != ssid->ssid_len || ++ //if (bss->ssid_len != ssid->ssid_len || <--carella modify ++ if (bss->ssid_len && (bss->ssid_len != ssid->ssid_len || //-->carella + os_memcmp(bss->ssid, ssid->ssid, +- bss->ssid_len) != 0) { ++ bss->ssid_len) != 0)) { + wpa_printf(MSG_DEBUG, " skip - " + "SSID mismatch"); + continue; +@@ -439,8 +447,10 @@ + wpa_printf(MSG_DEBUG, " skip - disabled"); + continue; + } ++ + if (ssid->ssid_len != 0 && +- (bss->ssid_len != ssid->ssid_len || ++ // (bss->ssid_len != ssid->ssid_len || <--carella modify ++ bss->ssid_len && (bss->ssid_len != ssid->ssid_len ||//-->carella + os_memcmp(bss->ssid, ssid->ssid, + bss->ssid_len) != 0)) { + wpa_printf(MSG_DEBUG, " skip - " +@@ -684,9 +694,12 @@ + wpa_clear_keys(wpa_s, bssid); + } + if (wpa_supplicant_select_config(wpa_s) < 0) { ++/* carell modfy */ ++#if 0 + wpa_supplicant_disassociate(wpa_s, + REASON_DEAUTH_LEAVING); + return; ++#endif + } + } + +diff -NaurEbB wpa_supplicant-0.5.10/wpa_supplicant.c wpa_supplicant-0.5.10_RALINK/wpa_supplicant.c +--- wpa_supplicant-0.5.10/wpa_supplicant.c 2008-02-17 19:42:02.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/wpa_supplicant.c 2008-12-05 01:42:07.000000000 +0100 +@@ -35,6 +35,7 @@ + #include "pmksa_cache.h" + #include "wpa_ctrl.h" + #include "mlme.h" ++#include "wpa_i.h" + + const char *wpa_supplicant_version = + "wpa_supplicant v" VERSION_STR "\n" +@@ -111,6 +112,9 @@ + extern int wpa_debug_timestamp; + + static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx); ++#ifdef CONFIG_DRIVER_RALINK ++static void wpa_supplicant_poll(void *wpa_s); ++#endif + + #if defined(IEEE8021X_EAPOL) || !defined(CONFIG_NO_WPA) + static u8 * wpa_alloc_eapol(const struct wpa_supplicant *wpa_s, u8 type, +@@ -519,11 +523,20 @@ + bssid = wpa_s->pending_bssid; + wpa_msg(wpa_s, MSG_INFO, "Authentication with " MACSTR " timed out.", + MAC2STR(bssid)); ++ ++/* carella modify */ ++#ifdef CONFIG_DRIVER_RALINK ++ wpa_s->wpa_state = WPA_SCANNING; ++ wpa_supplicant_poll(wpa_s); ++ if(!wpa_s->associate_state) ++#endif ++ { + wpa_blacklist_add(wpa_s, bssid); + wpa_sm_notify_disassoc(wpa_s->wpa); + wpa_supplicant_disassociate(wpa_s, REASON_DEAUTH_LEAVING); + wpa_s->reassociate = 1; + wpa_supplicant_req_scan(wpa_s, 0, 0); ++ } + } + + +@@ -1178,14 +1191,18 @@ + + if (bss && bss->rsn_ie_len && (ssid->proto & WPA_PROTO_RSN) && + wpa_parse_wpa_ie(bss->rsn_ie, bss->rsn_ie_len, &ie) == 0 && ++#ifndef CONFIG_DRIVER_RALINK + (ie.group_cipher & ssid->group_cipher) && ++#endif + (ie.pairwise_cipher & ssid->pairwise_cipher) && + (ie.key_mgmt & ssid->key_mgmt)) { + wpa_msg(wpa_s, MSG_DEBUG, "RSN: using IEEE 802.11i/D9.0"); + proto = WPA_PROTO_RSN; + } else if (bss && bss->wpa_ie_len && (ssid->proto & WPA_PROTO_WPA) && + wpa_parse_wpa_ie(bss->wpa_ie, bss->wpa_ie_len, &ie) == 0 && ++#ifndef CONFIG_DRIVER_RALINK + (ie.group_cipher & ssid->group_cipher) && ++#endif + (ie.pairwise_cipher & ssid->pairwise_cipher) && + (ie.key_mgmt & ssid->key_mgmt)) { + wpa_msg(wpa_s, MSG_DEBUG, "WPA: using IEEE 802.11i/D3.0"); +@@ -1232,7 +1249,11 @@ + bss ? bss->rsn_ie_len : 0)) + return -1; + ++#ifndef CONFIG_DRIVER_RALINK + sel = ie.group_cipher & ssid->group_cipher; ++#else ++ sel = ie.group_cipher; ++#endif + if (sel & WPA_CIPHER_CCMP) { + wpa_s->group_cipher = WPA_CIPHER_CCMP; + wpa_msg(wpa_s, MSG_DEBUG, "WPA: using GTK CCMP"); +@@ -1879,6 +1900,13 @@ + { + return wpa_drv_remove_pmkid(wpa_s, bssid, pmkid); + } ++ ++#ifdef CONFIG_DRIVER_RALINK ++static void wpa_supplicant_poll(void *wpa_s) ++{ ++ wpa_drv_poll(wpa_s); ++} ++#endif + #endif /* CONFIG_NO_WPA */ + + +@@ -1919,6 +1947,14 @@ + { + struct wpa_supplicant *wpa_s = ctx; + ++// if(wpa_s->wpa_state < WPA_ASSOCIATED) //<--carella modify ++ if((wpa_s->wpa->proto == WPA_PROTO_RSN && wpa_s->wpa->pmksa == NULL && wpa_s->wpa_state < WPA_ASSOCIATED) || //<--carella modify ++ (wpa_s->wpa->proto != WPA_PROTO_RSN && wpa_s->wpa_state < WPA_ASSOCIATED)) ++ { ++ printf("wpa_supplicant_rx_eapol: wpa_s->wpa_state[%d] < WPA_ASSOCIATED\n", wpa_s->wpa_state); ++ return; //-->carella ++ } ++ + wpa_printf(MSG_DEBUG, "RX EAPOL from " MACSTR, MAC2STR(src_addr)); + wpa_hexdump(MSG_MSGDUMP, "RX EAPOL", buf, len); + +diff -NaurEbB wpa_supplicant-0.5.10/wpa_supplicant_i.h wpa_supplicant-0.5.10_RALINK/wpa_supplicant_i.h +--- wpa_supplicant-0.5.10/wpa_supplicant_i.h 2007-12-28 01:50:15.000000000 +0100 ++++ wpa_supplicant-0.5.10_RALINK/wpa_supplicant_i.h 2008-12-05 01:36:46.000000000 +0100 +@@ -342,6 +342,10 @@ + + struct wpa_client_mlme mlme; + int use_client_mlme; ++ ++#ifdef CONFIG_DRIVER_RALINK ++ int associate_state; ++#endif + }; + + +@@ -577,9 +581,15 @@ + + static inline void wpa_drv_poll(struct wpa_supplicant *wpa_s) + { ++#ifdef CONFIG_DRIVER_RALINK ++ if (wpa_s->driver->poll_ralink) { ++ wpa_s->driver->poll_ralink(wpa_s->drv_priv, wpa_s); ++ } ++#else + if (wpa_s->driver->poll) { + wpa_s->driver->poll(wpa_s->drv_priv); + } ++#endif + } + + static inline const char * wpa_drv_get_ifname(struct wpa_supplicant *wpa_s) diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-zydas.patch b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-zydas.patch new file mode 100644 index 0000000000..24f7d63307 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/driver-zydas.patch @@ -0,0 +1,738 @@ +diff -Naur wpa_supplicant-0.5.8.orig/Makefile wpa_supplicant-0.5.8/Makefile +--- wpa_supplicant-0.5.8.orig/Makefile 2007-05-29 04:08:48.000000000 +0200 ++++ wpa_supplicant-0.5.8/Makefile 2008-08-07 11:49:38.000000000 +0200 +@@ -30,6 +30,7 @@ + echo CONFIG_DRIVER_HOSTAP=y >> .config + echo CONFIG_DRIVER_WEXT=y >> .config + echo CONFIG_WIRELESS_EXTENSION=y >> .config ++ echo CONFIG_DRIVER_ZYDAS=y >> .config + + install: all + mkdir -p $(DESTDIR)/usr/local/sbin/ +@@ -87,6 +88,11 @@ + OBJS += config_none.o + endif + ++ifdef CONFIG_DRIVER_ZYDAS ++CFLAGS += -DCONFIG_DRIVER_ZYDAS ++OBJS_d += driver_zydas.o ++endif ++ + ifdef CONFIG_DRIVER_HOSTAP + CFLAGS += -DCONFIG_DRIVER_HOSTAP + OBJS_d += driver_hostap.o +diff -Naur wpa_supplicant-0.5.8.orig/common.h wpa_supplicant-0.5.8/common.h +--- wpa_supplicant-0.5.8.orig/common.h 2007-05-29 04:08:48.000000000 +0200 ++++ wpa_supplicant-0.5.8/common.h 2008-08-07 12:03:15.000000000 +0200 +@@ -486,7 +486,7 @@ + + const char * wpa_ssid_txt(u8 *ssid, size_t ssid_len); + +-typedef u32 __be32; +-typedef u64 __be64; ++//typedef u32 __be32; ++//typedef u64 __be64; + + #endif /* COMMON_H */ +diff -Naur wpa_supplicant-0.5.8.orig/driver_zydas.c wpa_supplicant-0.5.8/driver_zydas.c +--- wpa_supplicant-0.5.8.orig/driver_zydas.c 1970-01-01 01:00:00.000000000 +0100 ++++ wpa_supplicant-0.5.8/driver_zydas.c 2006-11-28 09:09:34.000000000 +0100 +@@ -0,0 +1,597 @@ ++/* ++ * WPA Supplicant - driver interaction with MADWIFI 802.11 driver ++ * Copyright (c) 2004, Sam Leffler ++ * ++ * 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. ++ * ++ * Alternatively, this software may be distributed under the terms of BSD ++ * license. ++ * ++ * See README and COPYING for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "common.h" ++#include "driver.h" ++#include "driver_wext.h" ++#include "eloop.h" ++#include "wpa_supplicant.h" ++#include "wpa.h" ++ ++#include "zydas_common.h" ++ ++#include ++#include ++ ++struct wpa_driver_zydas_data { ++ void *wext; /* private data for driver_wext */ ++ void *ctx; ++ char ifname[IFNAMSIZ + 1]; ++ int sock; ++}; ++ ++static int zydas_ioctl(struct wpa_driver_zydas_data *drv, struct zydas_wlan_param *param, ++ int len, int show_err) ++{ ++ int s; ++ struct iwreq iwr; ++ ++ s = socket(PF_INET, SOCK_DGRAM, 0); ++ if (s < 0) { ++ perror("socket"); ++ return -1; ++ } ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ iwr.u.data.pointer = (caddr_t) param; ++ iwr.u.data.length = len; ++ ++ if (ioctl(s, ZD_IOCTL_WPA, &iwr) < 0) { ++ int ret; ++ close(s); ++ ret = errno; ++ if (show_err) ++ perror("ioctl[ZD_IOCTL_WPA]"); ++ return ret; ++ } ++ close(s); ++ ++ return 0; ++} ++ ++static int ++zydas_set_param(struct wpa_driver_zydas_data *drv, int op, int arg, int show_err) ++{ ++ struct iwreq iwr; ++ int *i, s, ret = 0; ++ ++ s = socket(PF_INET, SOCK_DGRAM, 0); ++ if (s < 0) { ++ perror("socket[PF_INET,SOCK_DGRAM]"); ++ return -1; ++ } ++ ++ memset(&iwr, 0, sizeof(iwr)); ++ strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); ++ i = (int *) iwr.u.name; ++ *i++ = op; ++ *i++ = arg; ++ if (op == ZD_PARAM_WPA) ++ { ++ wpa_printf(MSG_DEBUG, "ZD_PARAM_WPA: arg:%d\n", arg); ++ } ++ if (ioctl(s, ZD_IOCTL_PARAM, &iwr) < 0) { ++ perror("ioctl[ZD_IOCTL_PARAM]"); ++ ret = -1; ++ } ++ close(s); ++ ++ return ret; ++} ++#if 0 ++static int ++getifflags(const char *ifname, int *flags) ++{ ++ struct ifreq ifr; ++ int s; ++ ++ s = socket(PF_INET, SOCK_DGRAM, 0); ++ if (s < 0) { ++ perror("socket"); ++ return -1; ++ } ++ ++ memset(&ifr, 0, sizeof(ifr)); ++ strncpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); ++ if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { ++ perror("SIOCGIFFLAGS"); ++ return errno; ++ } ++ *flags = ifr.ifr_flags & 0xffff; ++ return 0; ++} ++ ++static int ++setifflags(const char *ifname, int flags) ++{ ++ struct ifreq ifr; ++ int s; ++ ++ s = socket(PF_INET, SOCK_DGRAM, 0); ++ if (s < 0) { ++ perror("socket"); ++ return -1; ++ } ++ ++ memset(&ifr, 0, sizeof(ifr)); ++ strncpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); ++ ifr.ifr_flags = flags & 0xffff; ++ if (ioctl(s, SIOCSIFFLAGS, (caddr_t)&ifr) < 0) { ++ perror("SIOCSIFFLAGS"); ++ return errno; ++ } ++ return 0; ++} ++#endif ++static int ++wpa_driver_zydas_set_wpa_ie(struct wpa_driver_zydas_data *drv, ++ const char *wpa_ie, size_t wpa_ie_len) ++{ ++ ++ ++ struct zydas_wlan_param *param; ++ int res; ++ size_t blen = ZD_GENERIC_ELEMENT_HDR_LEN + wpa_ie_len; ++ if (blen < sizeof(*param)) ++ blen = sizeof(*param); ++ ++ param = (struct zydas_wlan_param *) malloc(blen); ++ if (param == NULL) ++ return -1; ++ ++ memset(param, 0, blen); ++ param->cmd = ZD_CMD_SET_GENERIC_ELEMENT; ++ param->u.generic_elem.len = wpa_ie_len; ++ memcpy(param->u.generic_elem.data, wpa_ie, wpa_ie_len); ++ res = zydas_ioctl(drv, param, blen, 1); ++ ++ free(param); ++ ++ return res; ++} ++ ++static int ++wpa_driver_zydas_set_wpa(void *priv, int enabled) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ int ret = 0; ++ ++ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); ++ ++ if (!enabled && wpa_driver_zydas_set_wpa_ie(drv, NULL, 0) < 0) ++ ret = -1; ++ if (zydas_set_param(drv, ZD_PARAM_ROAMING, enabled, 1) < 0) ++ ret = -1; ++ if (zydas_set_param(drv, ZD_PARAM_PRIVACY, enabled, 1) < 0) ++ ret = -1; ++ if (zydas_set_param(drv, ZD_PARAM_WPA, enabled, 1) < 0) ++ ret = -1; ++ ++ return ret; ++} ++ ++static int ++wpa_driver_zydas_set_key(void *priv, wpa_alg alg, ++ const u8 *addr, int key_idx, int set_tx, ++ const u8 *seq, size_t seq_len, ++ const u8 *key, size_t key_len) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ struct zydas_wlan_param *param; ++ u8 *buf; ++ size_t blen; ++ int ret = 0; ++ char *alg_name; ++ switch (alg) { ++ case WPA_ALG_NONE: ++ alg_name = "NONE"; ++ break; ++ case WPA_ALG_WEP: ++ alg_name = "WEP"; ++ break; ++ case WPA_ALG_TKIP: ++ alg_name = "TKIP"; ++ break; ++ case WPA_ALG_CCMP: ++ alg_name = "CCMP"; ++ break; ++ default: ++ return -1; ++ } ++ ++ wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%d " ++ "key_len=%d", __FUNCTION__, alg_name, key_idx, set_tx, ++ seq_len, key_len); ++ ++ if (seq_len > 8) ++ return -2; ++ ++ blen = sizeof(*param) + key_len; ++ buf = malloc(blen); ++ if (buf == NULL) ++ return -1; ++ memset(buf, 0, blen); ++ ++ param = (struct zydas_wlan_param *) buf; ++ param->cmd = ZD_CMD_SET_ENCRYPT_KEY; ++ /* TODO: In theory, STA in client mode can use five keys; four default ++ * keys for receiving (with keyidx 0..3) and one individual key for ++ * both transmitting and receiving (keyidx 0) _unicast_ packets. Now, ++ * keyidx 0 is reserved for this unicast use and default keys can only ++ * use keyidx 1..3 (i.e., default key with keyidx 0 is not supported). ++ * This should be fine for more or less all cases, but for completeness ++ * sake, the driver could be enhanced to support the missing key. */ ++#if 1 ++ if (addr == NULL) ++ memset(param->sta_addr, 0xff, ETH_ALEN); ++ else ++ memcpy(param->sta_addr, addr, ETH_ALEN); ++#else ++ if (addr != NULL) ++ memcpy(param->sta_addr, addr, ETH_ALEN); ++#endif ++ strncpy(param->u.crypt.alg, alg_name, ZD_CRYPT_ALG_NAME_LEN); ++ param->u.crypt.flags = set_tx ? ZD_FLAG_SET_TX_KEY : 0; ++ param->u.crypt.idx = key_idx; ++ memcpy(param->u.crypt.seq, seq, seq_len); ++ param->u.crypt.key_len = key_len; ++ memcpy((u8 *) param->u.crypt.key, key, key_len); ++ ++ /* Dump key context */ ++#if 0 ++ if(alg != WPA_ALG_NONE) { ++ int ii; ++ ++ wpa_printf(MSG_DEBUG, "Key Context:"); ++ for(ii = 0; ii < key_len; ) { ++ printf("0x%02x ", key[ii]); ++ ++ if((++ii % 16) == 0) ++ printf("\n"); ++ } ++ ++ printf("\n"); ++ } ++#endif ++ if (zydas_ioctl(drv, param, blen, 1)) { ++ wpa_printf(MSG_WARNING, "Failed to set encryption."); ++ //show_set_key_error(param); ++ ret = -1; ++ } ++ free(buf); ++ ++ return ret; ++} ++ ++static int ++wpa_driver_zydas_set_countermeasures(void *priv, int enabled) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ ++ /* Enable the countermeasure */ ++ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); ++ return zydas_set_param(drv, ZD_PARAM_COUNTERMEASURES, enabled, 1); ++} ++ ++static int ++wpa_driver_zydas_set_drop_unencrypted(void *priv, int enabled) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ /* Enable the countermeasure */ ++ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); ++ return zydas_set_param(drv, ZD_PARAM_DROPUNENCRYPTED, enabled, 1); ++} ++ ++static int ++wpa_driver_zydas_deauthenticate(void *priv, const u8 *addr, int reason_code) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ struct zydas_wlan_param *param; ++ int blen; ++ int ret; ++ ++ blen = sizeof(*param); ++ param = (struct zydas_wlan_param *) malloc(blen); ++ if (param == NULL) ++ return -1; ++ ++ memset(param, 0, blen); ++ param->cmd = ZD_CMD_SET_MLME; ++ param->u.mlme.cmd = MLME_STA_DEAUTH; ++ param->u.mlme.reason_code = reason_code; ++ memcpy(param->sta_addr, addr, ETH_ALEN); ++ ret = zydas_ioctl(drv, param, blen, 1); ++ usleep(100000); ++ free(param); ++ return ret; ++} ++ ++static int ++wpa_driver_zydas_disassociate(void *priv, const u8 *addr, int reason_code) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ struct zydas_wlan_param *param; ++ int blen; ++ int ret; ++ ++ blen = sizeof(*param); ++ param = (struct zydas_wlan_param *) malloc(blen); ++ if (param == NULL) ++ return -1; ++ ++ memset(param, 0, blen); ++ param->cmd = ZD_CMD_SET_MLME; ++ param->u.mlme.cmd = MLME_STA_DISASSOC; ++ param->u.mlme.reason_code = reason_code; ++ memcpy(param->sta_addr, addr, ETH_ALEN); ++ ret = zydas_ioctl(drv, param, blen, 1); ++ free(param); ++ return ret; ++} ++ ++static int ++wpa_driver_zydas_associate(void *priv, ++ struct wpa_driver_associate_params *params) ++/*static int ++wpa_driver_zydas_associate(const char *ifname, const char *bssid, ++ const char *ssid, size_t ssid_len, ++ int freq, ++ const char *wpa_ie, size_t wpa_ie_len, ++ wpa_cipher pairwise_suite, ++ wpa_cipher group_suite, ++ wpa_key_mgmt key_mgmt_suite)*/ ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ ++ int ret = 0, privacy=1; ++ ++ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__); ++ ++ /* Because there might be the case, two or more APs with the same ++ * SSID, in order to identify them, we need to set the BSSID. */ ++ if (wpa_driver_zydas_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0) ++ ret = -1; ++ ++ if (params->pairwise_suite == CIPHER_NONE && ++ params->group_suite == CIPHER_NONE && ++ params->key_mgmt_suite == KEY_MGMT_NONE && ++ params->wpa_ie_len == 0) ++ privacy = 0; ++ ++ if (zydas_set_param(drv, ZD_PARAM_PRIVACY, privacy, 1) < 0) ++ ret = -1; ++ if (params->key_mgmt_suite == KEY_MGMT_NONE && params->wpa_ie_len == 0) ++ { ++ zydas_set_param(drv, ZD_PARAM_WPA, 0, 1); ++ } ++ wpa_printf(MSG_DEBUG, "%s:wpaIeLen:%d, KeyMgmt:%d", __FUNCTION__, params->wpa_ie_len, params->key_mgmt_suite); ++ if (params->wpa_ie_len && ++ zydas_set_param(drv, ZD_PARAM_WPA, ++ params->wpa_ie[0] == RSN_INFO_ELEM ? 2 : 1, 1) < 0) ++ ret = -1; ++ ++ if (params->bssid == NULL) { ++ /* ap_scan=0 or 2 mode - driver takes care of AP selection and ++ * roaming */ ++ /* FIX: this does not seem to work; would probably need to ++ * change something in the driver */ ++ if (zydas_set_param(drv, ZD_PARAM_ROAMING, 0, 1) < 0) ++ ret = -1; ++ // if (wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len) < 0) ++ // ret = -1; ++ } ++ ++ if (wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len) < 0) ++ ret = -1; ++ ++ // Mark for test ++ //if (wpa_driver_wext_set_bssid(ifname, bssid) < 0) ++ // ret = -1; ++ if (params->bssid) ++ { ++ wpa_printf(MSG_DEBUG, "wpa_supplicant initiates scan and AP selection\n"); ++ if (zydas_set_param(drv, ZD_PARAM_ROAMING, 1, 1) < 0) ++ ret = -1; ++ if (wpa_driver_wext_set_bssid(drv->wext, params->bssid) < 0) ++ ret = -1; ++ } ++ ++ ++#if 0 ++ /* Allow unencrypted EAPOL messages even if pairwise keys are set when ++ * not using WPA. IEEE 802.1X specifies that these frames are not ++ * encrypted, but WPA encrypts them when pairwise keys are in use. */ ++ if (key_mgmt_suite == KEY_MGMT_802_1X || ++ key_mgmt_suite == KEY_MGMT_PSK) ++ allow_unencrypted_eapol = 0; ++ else ++ allow_unencrypted_eapol = 1; ++ ++ if (prism2param(ifname, PRISM2_PARAM_IEEE_802_1X, ++ allow_unencrypted_eapol) < 0) { ++ wpa_printf(MSG_DEBUG, "hostap: Failed to configure " ++ "ieee_802_1x param"); ++ /* Ignore this error.. driver_hostap.c can also be used with ++ * other drivers that do not support this prism2_param. */ ++ } ++#endif ++ ++ return ret; ++} ++ ++static int ++wpa_driver_zydas_scan(void *priv, const u8 *ssid, size_t ssid_len) ++{ ++ struct wpa_driver_zydas_data *drv=priv; ++ struct zydas_wlan_param param; ++ int ret; ++ ++ if (ssid == NULL) { ++ /* Use standard Linux Wireless Extensions ioctl if possible ++ * because some drivers using hostap code in wpa_supplicant ++ * might not support Host AP specific scan request (with SSID ++ * info). */ ++ return wpa_driver_wext_scan(drv->wext, ssid, ssid_len); ++ } ++ ++ if (ssid_len > 32) ++ ssid_len = 32; ++ ++ memset(¶m, 0, sizeof(param)); ++ param.cmd = ZD_CMD_SCAN_REQ; ++ param.u.scan_req.ssid_len = ssid_len; ++ memcpy(param.u.scan_req.ssid, ssid, ssid_len); ++ ret = zydas_ioctl(drv, ¶m, sizeof(param), 1); ++ ++ /* Not all drivers generate "scan completed" wireless event, so try to ++ * read results after a timeout. */ ++ eloop_register_timeout(3, 0, wpa_driver_wext_scan_timeout, NULL, drv->ctx); ++ ++ return ret; ++} ++ ++static int wpa_driver_zydas_set_auth_alg(void *priv, int auth_alg) ++{ ++ struct wpa_driver_zydas_data *drv=priv; ++ int algs = 0; ++ ++ if (auth_alg & AUTH_ALG_OPEN_SYSTEM) ++ algs = 0; ++ if (auth_alg & AUTH_ALG_SHARED_KEY) ++ algs = 1; ++ ++ return zydas_set_param(drv, ZD_PARAM_AUTH_ALGS, algs, 1); ++} ++static int wpa_driver_zydas_get_bssid(void *priv, u8 *bssid) ++{ ++ struct wpa_driver_zydas_data *drv=priv; ++ return wpa_driver_wext_get_bssid(drv->wext, bssid); ++} ++ ++static int wpa_driver_zydas_get_ssid(void *priv, u8 *ssid) ++{ ++ struct wpa_driver_zydas_data *drv=priv; ++ return wpa_driver_wext_get_ssid(drv->wext, ssid); ++} ++static void * wpa_driver_zydas_init(void *ctx, const char *ifname) ++{ ++ struct wpa_driver_zydas_data *drv; ++ drv = malloc(sizeof(*drv)); ++ if (drv == NULL) ++ return NULL; ++ memset(drv, 0, sizeof(*drv)); ++ drv->wext = wpa_driver_wext_init(ctx, ifname); ++ if (drv->wext == NULL) ++ goto fail; ++ ++ drv->ctx = ctx; ++ strncpy(drv->ifname, ifname, sizeof(drv->ifname)); ++ drv->sock = socket(PF_INET, SOCK_DGRAM, 0); ++ if (drv->sock < 0) ++ goto fail2; ++ ++ if (zydas_set_param(drv, ZD_PARAM_ROAMING, 0, 1) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to set wpa_supplicant-based " ++ "roaming", __FUNCTION__); ++ goto fail3; ++ } ++ ++ if (zydas_set_param(drv, ZD_PARAM_WPA, 3, 1) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to enable WPA/WPA2 support", ++ __FUNCTION__); ++ goto fail3; ++ } ++ ++ return drv; ++ ++fail3: ++ close(drv->sock); ++fail2: ++ wpa_driver_wext_deinit(drv->wext); ++fail: ++ free(drv); ++ return NULL; ++} ++ ++ ++static void wpa_driver_zydas_deinit(void *priv) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ ++ if (wpa_driver_zydas_set_wpa_ie(drv, NULL, 0) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to clear WPA IE", ++ __FUNCTION__); ++ } ++ if (zydas_set_param(drv, ZD_PARAM_ROAMING, 0, 1) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to enable driver-based " ++ "roaming", __FUNCTION__); ++ } ++ if (zydas_set_param(drv, ZD_PARAM_PRIVACY, 0, 1) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to disable forced Privacy " ++ "flag", __FUNCTION__); ++ } ++ if (zydas_set_param(drv, ZD_PARAM_WPA, 0, 1) < 0) { ++ wpa_printf(MSG_DEBUG, "%s: failed to disable WPA", ++ __FUNCTION__); ++ } ++ ++ wpa_driver_wext_deinit(drv->wext); ++ ++ close(drv->sock); ++ free(drv); ++} ++#if 0 ++static void ++wpa_driver_zydas_cleanup(const char *ifname) ++{ ++ int flags; ++ ++ /* NB: mark interface down */ ++ if (getifflags(ifname, &flags) == 0) ++ (void) setifflags(ifname, flags &~ IFF_UP); ++} ++#endif ++static int wpa_driver_zydas_get_scan_results(void *priv, ++ struct wpa_scan_result *results, ++ size_t max_size) ++{ ++ struct wpa_driver_zydas_data *drv = priv; ++ return wpa_driver_wext_get_scan_results(drv->wext, results, max_size); ++} ++struct wpa_driver_ops wpa_driver_zydas_ops = { ++ .name = "zydas", ++ .desc = "ZyDAS 802.11 WPA support interface", ++ .get_bssid = wpa_driver_zydas_get_bssid, ++ .get_ssid = wpa_driver_zydas_get_ssid, ++// .set_wpa = wpa_driver_zydas_set_wpa, ++ .set_key = wpa_driver_zydas_set_key, ++ .init = wpa_driver_zydas_init, ++ .deinit = wpa_driver_zydas_deinit, ++ .set_countermeasures = wpa_driver_zydas_set_countermeasures, ++ .set_drop_unencrypted = wpa_driver_zydas_set_drop_unencrypted, ++ .scan = wpa_driver_zydas_scan, ++ .get_scan_results = wpa_driver_zydas_get_scan_results, ++ .deauthenticate = wpa_driver_zydas_deauthenticate, ++ .disassociate = wpa_driver_zydas_disassociate, ++ .associate = wpa_driver_zydas_associate, ++ .set_auth_alg = wpa_driver_zydas_set_auth_alg, ++}; ++ +diff -Naur wpa_supplicant-0.5.8.orig/drivers.c wpa_supplicant-0.5.8/drivers.c +--- wpa_supplicant-0.5.8.orig/drivers.c 2007-03-25 04:09:50.000000000 +0200 ++++ wpa_supplicant-0.5.8/drivers.c 2008-08-07 11:46:26.000000000 +0200 +@@ -14,7 +14,9 @@ + + #include "includes.h" + +- ++#ifdef CONFIG_DRIVER_ZYDAS ++extern struct wpa_driver_ops wpa_driver_zydas_ops; /* driver_zydas.c */ ++#endif /* CONFIG_DRIVER_ZYDAS */ + #ifdef CONFIG_DRIVER_WEXT + extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */ + #endif /* CONFIG_DRIVER_WEXT */ +@@ -59,6 +61,9 @@ + + struct wpa_driver_ops *wpa_supplicant_drivers[] = + { ++#ifdef CONFIG_DRIVER_ZYDAS ++ &wpa_driver_zydas_ops, ++#endif /* CONFIG_DRIVER_ZYDAS */ + #ifdef CONFIG_DRIVER_WEXT + &wpa_driver_wext_ops, + #endif /* CONFIG_DRIVER_WEXT */ +diff -Naur wpa_supplicant-0.5.8.orig/zydas_common.h wpa_supplicant-0.5.8/zydas_common.h +--- wpa_supplicant-0.5.8.orig/zydas_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ wpa_supplicant-0.5.8/zydas_common.h 2006-01-09 04:30:42.000000000 +0100 +@@ -0,0 +1,73 @@ ++#ifndef ZYDAS_COMMON_H ++#define ZYDAS_COMMON_H ++ ++#define ZD_IOCTL_WPA (SIOCDEVPRIVATE + 1) ++#define ZD_IOCTL_PARAM (SIOCDEVPRIVATE + 2) ++#define ZD_IOCTL_GETWPAIE (SIOCDEVPRIVATE + 3) ++#define ZD_PARAM_ROAMING 0x0001 ++#define ZD_PARAM_PRIVACY 0x0002 ++#define ZD_PARAM_WPA 0x0003 ++#define ZD_PARAM_COUNTERMEASURES 0x0004 ++#define ZD_PARAM_DROPUNENCRYPTED 0x0005 ++#define ZD_PARAM_AUTH_ALGS 0x0006 ++ ++#define ZD_CMD_SET_ENCRYPT_KEY 0x0001 ++#define ZD_CMD_SET_MLME 0x0002 ++#define ZD_CMD_SCAN_REQ 0x0003 ++#define ZD_CMD_SET_GENERIC_ELEMENT 0x0004 ++#define ZD_CMD_GET_TSC 0x0005 ++ ++#define ZD_FLAG_SET_TX_KEY 0x0001 ++ ++#define ZD_GENERIC_ELEMENT_HDR_LEN \ ++((int) (&((struct zydas_wlan_param *) 0)->u.generic_elem.data)) ++ ++#define ZD_CRYPT_ALG_NAME_LEN 16 ++#define ZD_MAX_KEY_SIZE 32 ++#define ZD_MAX_GENERIC_SIZE 64 ++ ++#define IEEE80211_ADDR_LEN 6 ++#define IEEE80211_MAX_IE_SIZE 256 ++ ++/* structure definition */ ++ ++struct zydas_wlan_param { ++ u32 cmd; ++ u8 sta_addr[ETH_ALEN]; ++ union { ++ struct { ++ u8 alg[ZD_CRYPT_ALG_NAME_LEN]; ++ u32 flags; ++ u32 err; ++ u8 idx; ++ u8 seq[8]; /* sequence counter (set: RX, get: TX) */ ++ u16 key_len; ++ u8 key[ZD_MAX_KEY_SIZE]; ++ } crypt; ++ struct { ++ u32 flags_and; ++ u32 flags_or; ++ } set_flags_sta; ++ struct { ++ u8 len; ++ u8 data[ZD_MAX_GENERIC_SIZE]; ++ } generic_elem; ++ struct { ++#define MLME_STA_DEAUTH 0 ++#define MLME_STA_DISASSOC 1 ++ u16 cmd; ++ u16 reason_code; ++ } mlme; ++ struct { ++ u8 ssid_len; ++ u8 ssid[32]; ++ } scan_req; ++ } u; ++}; ++ ++struct ieee80211req_wpaie { ++ u8 wpa_macaddr[IEEE80211_ADDR_LEN]; ++ u8 wpa_ie[IEEE80211_MAX_IE_SIZE]; ++}; ++#endif ++ diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/functions.sh b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/functions.sh new file mode 100755 index 0000000000..8ff0cb53a0 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/functions.sh @@ -0,0 +1,841 @@ +#!/bin/sh + +# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license can be +# found in /usr/share/common-licenses/GPL. + +##################################################################### +## global variables +# wpa_supplicant variables +WPA_SUP_BIN="/usr/sbin/wpa_supplicant" +WPA_SUP_PNAME="wpa_supplicant" +WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$WPA_IFACE.pid" + +# wpa_cli variables +WPA_CLI_BIN="/usr/sbin/wpa_cli" +WPA_CLI_PNAME="wpa_cli" +WPA_CLI_PIDFILE="/var/run/wpa_action.$WPA_IFACE.pid" +WPA_CLI_LOGFILE="/var/log/wpa_action.log" +WPA_CLI_TIMESTAMP="/var/run/wpa_action.$WPA_IFACE.timestamp" + +# default ctrl_interface socket directory +if [ -z "$WPA_CTRL_DIR" ]; then + WPA_CTRL_DIR="/var/run/wpa_supplicant" +fi + +# verbosity variables +if [ -n "$IF_WPA_VERBOSITY" ] || [ "$VERBOSITY" = "1" ]; then + TO_NULL="/dev/stdout" + DAEMON_VERBOSITY="--verbose" +else + TO_NULL="/dev/null" + DAEMON_VERBOSITY="--quiet" +fi + +##################################################################### +## wpa_cli wrapper +# Path to common ctrl_interface socket and iface supplied. +# NB: WPA_CTRL_DIR cannot be used for interactive commands. +# +wpa_cli () { + $WPA_CLI_BIN -p $WPA_CTRL_DIR -i $WPA_IFACE "$@" +} + +##################################################################### +## verbose and stderr message wrapper +# Ensures a standard and easily identifiable message is printed by +# scripts using this function library. +# +# verbose To stdout when IF_WPA_VERBOSITY or VERBOSITY is true +# +# action Same as verbose but without newline +# Useful for allowing wpa_cli commands to echo result +# value of 'OK' or 'FAILED' +# +# stderr Echo warning or error messages to stderr +# +# NB: when called by wpa_action, there is no redirection (verbose) +# +wpa_msg () { + + if [ -n "$WPA_ACTION" ]; then + shift + echo "wpa_action: $@" + return + fi + + case "$1" in + "verbose") + shift + echo "$WPA_SUP_PNAME: $@" >$TO_NULL + ;; + "action") + shift + echo -n "$WPA_SUP_PNAME: $@ -- " >$TO_NULL + ;; + "stderr") + shift + echo "$WPA_SUP_PNAME: $@" >/dev/stderr + ;; + *) + ;; + esac +} + +##################################################################### +## validate daemon pid files +# Test daemon process ID files via start-stop-daemon with a signal 0 +# given the exec binary and pidfile location. +# +# $1 daemon +# $2 pidfile +# +# Returns true when pidfile exists, the process ID exists _and_ was +# created by the exec binary. +# +# If the test fails, but the pidfile exists, it is stale +# +test_daemon_pidfile () { + local DAEMON PIDFILE + + if [ -n "$1" ]; then + DAEMON="$1" + fi + + if [ -f "$2" ]; then + PIDFILE="$2" + fi + + if [ -n "$DAEMON" ] && [ -f "$PIDFILE" ]; then + if start-stop-daemon --stop --quiet --signal 0 \ + --exec "$DAEMON" --pidfile "$PIDFILE"; then + return 0 + else + rm -f "$PIDFILE" + return 1 + fi + else + return 1 + fi +} + +# validate wpa_supplicant pidfile +test_wpa_supplicant () { + test_daemon_pidfile "$WPA_SUP_BIN" "$WPA_SUP_PIDFILE" +} + +# validate wpa_cli pidfile +test_wpa_cli () { + test_daemon_pidfile "$WPA_CLI_BIN" "$WPA_CLI_PIDFILE" +} + +##################################################################### +## daemonize wpa_supplicant +# Start wpa_supplicant via start-stop-dameon with all required +# options. Will start if environment variable WPA_SUP_CONF is present +# +# Required options: +# -B dameonize/background process +# -D driver backend ('wext' if none given) +# -P process ID file +# -C path to ctrl_interface socket directory +# +# Optional options: +# -c configuration file +# -W wait for wpa_cli to attach to ctrl_interface socket +# -b bridge interface name +# +init_wpa_supplicant () { + if [ -n "$WPA_SUP_CONF" ]; then + # wpa-action was removed, point to wpa-roam + if [ -n "$IF_WPA_ACTION" ]; then + wpa_msg stderr "wpa-action support has been removed" + wpa_msg stderr "refer to /usr/share/doc/wpasupplicant/README.modes.gz" + return 1 + fi + + local WPA_SUP_DRIVER WPA_SUP_OPTIONS + + if [ -n "$WPA_ACTION_SCRIPT" ]; then + if [ -x "$WPA_ACTION_SCRIPT" ]; then + WPA_SUP_OPTIONS="-W -B -P $WPA_SUP_PIDFILE -i $WPA_IFACE" + wpa_msg verbose "wait for wpa_cli to attach" + else + wpa_msg stderr "action script \"$WPA_ACTION_SCRIPT\" not executable" + return 1 + fi + else + WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $WPA_IFACE" + fi + + if [ -n "$IF_WPA_BRIDGE" ]; then + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -b $IF_WPA_BRIDGE" + wpa_msg verbose "wpa-bridge $IF_WPA_BRIDGE" + fi + + if [ -n "$IF_WPA_DRIVER" ]; then + WPA_SUP_DRIVER="$IF_WPA_DRIVER" + wpa_msg verbose "wpa-driver $WPA_SUP_DRIVER" + else + WPA_SUP_DRIVER="wext" + wpa_msg verbose "using default driver type: wpa-driver $WPA_SUP_DRIVER" + fi + + wpa_msg verbose "$WPA_SUP_BIN $WPA_SUP_OPTIONS -D $WPA_SUP_DRIVER $WPA_SUP_CONF" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \ + -- $WPA_SUP_OPTIONS -D $WPA_SUP_DRIVER $WPA_SUP_CONF + + if [ "$?" != "0" ]; then + wpa_msg stderr "$WPA_SUP_BIN daemon failed to start" + return 1 + fi + + local WPA_SOCKET_WAIT MAX_WPA_SOCKET_WAIT + WPA_SOCKET_WAIT="0" + MAX_WPA_SOCKET_WAIT="5" + until [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; do + if [ "$WPA_SOCKET_WAIT" -ge "$MAX_WPA_SOCKET_WAIT" ]; then + wpa_msg stderr "ctrl_interface socket not found at $WPA_CTRL_DIR/$WPA_IFACE" + return 1 + else + wpa_msg verbose "waiting for \"$WPA_CTRL_DIR/$WPA_IFACE\": $WPA_SOCKET_WAIT (max. $MAX_WPA_SOCKET_WAIT)" + fi + + WPA_SOCKET_WAIT=$(($WPA_SOCKET_WAIT + 1)) + sleep 1 + done + + wpa_msg verbose "ctrl_interface socket located at $WPA_CTRL_DIR/$WPA_IFACE" + else + wpa_msg stderr "init_wpa_supplicant() called without WPA_SUP_CONF" + return 1 + fi +} + +##################################################################### +## stop wpa_supplicant process +# Kill wpa_supplicant via start-stop-daemon, given the location of +# the pidfile or ctrl_interface socket path and interface name +# +kill_wpa_supplicant () { + if test_wpa_supplicant; then + + wpa_msg verbose "terminating $WPA_SUP_PNAME daemon via pidfile $WPA_SUP_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE + + if [ -f "$WPA_SUP_PIDFILE" ]; then + rm -f "$WPA_SUP_PIDFILE" + fi + elif [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; then + + wpa_msg action "terminating via ctrl_interface socket $WPA_CTRL_DIR/$WPA_IFACE" + + wpa_cli terminate >$TO_NULL + + if [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; then + rm -f "$WPA_CTRL_DIR/$WPA_IFACE" + fi + fi +} + +##################################################################### +## reload wpa_supplicant process +# Sending a HUP signal causes wpa_supplicant to reparse its +# configuration file +# +reload_wpa_supplicant () { + if test_wpa_supplicant; then + wpa_msg verbose "reloading wpa_supplicant configuration file via HUP signal" + start-stop-daemon --stop --signal HUP \ + --name "$WPA_SUP_PNAME" --pidfile "$WPA_SUP_PIDFILE" + else + wpa_msg verbose "cannot $WPA_ACTION, $WPA_SUP_PIDFILE does not exist" + fi +} + +##################################################################### +## daemonize wpa_cli and action script +# If environment variable WPA_ACTION_SCRIPT is present, wpa_cli will +# be spawned via start-stop-daemon +# +# Required options: +# -a action script => wpa_action +# -P process ID file +# -B background process +# +init_wpa_cli () { + if [ -n "$WPA_ACTION_SCRIPT" ]; then + local WPA_CLI_OPTIONS + WPA_CLI_OPTIONS="-B -P $WPA_CLI_PIDFILE -i $WPA_IFACE" + + wpa_msg verbose "$WPA_CLI_BIN $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_CLI_PNAME --startas $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE \ + -- $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT + + if [ "$?" != "0" ]; then + wpa_msg stderr "$WPA_CLI_BIN daemon failed to start" + return 1 + fi + fi +} + +##################################################################### +## stop wpa_cli process +# Kill wpa_cli via start-stop-daemon, given the location of the +# pidfile +# +kill_wpa_cli () { + if test_wpa_cli; then + + wpa_msg verbose "terminating $WPA_CLI_PNAME daemon via pidfile $WPA_CLI_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE + + if [ -f "$WPA_CLI_PIDFILE" ]; then + rm -f "$WPA_CLI_PIDFILE" + fi + fi +} + +##################################################################### +## higher level wpa_cli wrapper for variable and set_network commands +# wpa_cli_do [set_network variable] +# +# $1 envorinment variable +# $2 data type of variable {raw|ascii} +# $3 wpa_cli variable, if $3 is set_network, shift and take +# set_network subvariable +# $4 wpa-* string as it would appear in interfaces file, enhances +# verbose messages +# +wpa_cli_do () { + if [ -z "$1" ]; then + return 0 + fi + + local WPACLISET_VALUE WPACLISET_VARIABLE WPACLISET_DESC + + case "$2" in + ascii) + # Double quote + WPACLISET_VALUE="\"$1\"" + ;; + raw|*) + # Provide raw value + WPACLISET_VALUE="$1" + ;; + esac + + case "$3" in + set_network) + if [ -z "$WPA_ID" ]; then + return 1 + fi + shift + WPACLISET_VARIABLE="set_network $WPA_ID $3" + ;; + *) + WPACLISET_VARIABLE="$3" + ;; + esac + + case "$4" in + *-psk|*-passphrase|*-passwd*|*-wep-key*) + WPACLISET_DESC="$4 *****" + ;; + *) + WPACLISET_DESC="$4 $WPACLISET_VALUE" + ;; + esac + + wpa_msg action "$WPACLISET_DESC" + + wpa_cli $WPACLISET_VARIABLE "$WPACLISET_VALUE" >$TO_NULL +} + +##################################################################### +## check value data type in plaintext or hex +# returns 0 if input consists of hexadecimal digits only, 1 otherwise +# +ishex () { + if [ -z "$1" ]; then + return 0 + fi + + case "$1" in + *[!0-9a-fA-F]*) + # plaintext + return 1 + ;; + *) + # hexadecimal + return 0 + ;; + esac +} + +##################################################################### +## sanity check and set psk|passphrase +# Warn about strange psk|passphrase values +# +# $1 psk or passphrase value +# +# If psk is surrounded by quotes strip them. +# +# If psk contains all hexadecimal characters and string length is 64: +# is 256bit hexadecimal +# else: +# is plaintext +# +# plaintext passphrases must be 8 - 63 characters in length +# 256-bit hexadecimal key must be 64 characters in length +# +wpa_key_check_and_set () { + if [ -z "$1" ]; then + return 0 + fi + + local KEY KEY_TYPE + + case "$1" in + '"'*'"') + # Strip surrounding quotation marks + KEY=$(echo -n "$1" | sed 's/^"//;s/"$//') + ;; + *) + KEY="$1" + ;; + esac + + if ishex "$KEY" && [ "${#KEY}" -eq "64" ]; then + KEY_TYPE="raw" + else + KEY_TYPE="ascii" + if [ "${#KEY}" -lt "8" ] || [ "${#KEY}" -gt "63" ]; then + wpa_msg stderr \ + "plaintext or ascii wpa-psk has ${#KEY} characters, it must have between 8 and 63" + wpa_msg stderr \ + "if wpa-psk truly is a 256-bit hexadecimal key, it must have 64 characters" + fi + fi + + wpa_cli_do "$KEY" "$KEY_TYPE" \ + set_network psk wpa-psk +} + +##################################################################### +## formulate a usable configuration from interfaces(5) wpa- lines +# A series of wpa_cli commands corresponding to environment variables +# created as a result of wpa- lines in an interfaces stanza. +# +# NB: no-act when roaming daemon is used (to avoid prematurely +# attaching to ctrl_interface socket) +# +conf_wpa_supplicant () { + if [ -n "$WPA_ACTION_SCRIPT" ]; then + return 0 + fi + + if [ "$IF_WPA_DRIVER" = "wired" ]; then + IF_WPA_AP_SCAN="0" + wpa_msg verbose "forcing ap_scan=0 (required for wired IEEE8021X auth)" + fi + + if [ -n "$IF_WPA_ESSID" ]; then + # #403316, be similar to wireless tools + IF_WPA_SSID="$IF_WPA_ESSID" + fi + + wpa_cli_do "$IF_WPA_AP_SCAN" raw \ + ap_scan wpa-ap-scan + + wpa_cli_do "$IF_WPA_PREAUTHENTICATE" raw \ + preauthenticate wpa-preauthenticate + + if [ -n "$IF_WPA_SSID" ] || [ "$IF_WPA_DRIVER" = "wired" ]; then + + case "$IF_WPA_SSID" in + '"'*'"') + IF_WPA_SSID=$(echo -n "$IF_WPA_SSID" | sed 's/^"//;s/"$//') + ;; + *) + ;; + esac + + WPA_ID=$(wpa_cli add_network) + + wpa_msg verbose "configuring network block -- $WPA_ID" + + wpa_cli_do "$IF_WPA_SSID" ascii \ + set_network ssid wpa-ssid + + wpa_cli_do "$IF_WPA_PRIORITY" raw \ + set_network priority wpa-priority + + wpa_cli_do "$IF_WPA_BSSID" raw \ + set_network bssid wpa-bssid + + if [ -s "$IF_WPA_PSK_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PSK_FILE") + fi + + # remain compat with wpa-passphrase-file + if [ -s "$IF_WPA_PASSPHRASE_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PASSPHRASE_FILE") + fi + + # remain compat with wpa-passphrase + if [ -n "$IF_WPA_PASSPHRASE" ]; then + IF_WPA_PSK="$IF_WPA_PASSPHRASE" + fi + + if [ -n "$IF_WPA_PSK" ]; then + wpa_key_check_and_set "$IF_WPA_PSK" + fi + + wpa_cli_do "$IF_WPA_PAIRWISE" raw \ + set_network pairwise wpa-pairwise + + wpa_cli_do "$IF_WPA_GROUP" raw \ + set_network group wpa-group + + wpa_cli_do "$IF_WPA_MODE" raw \ + set_network mode wpa-mode + + wpa_cli_do "$IF_WPA_FREQUENCY" raw \ + set_network frequency wpa-frequency + + wpa_cli_do "$IF_WPA_KEY_MGMT" raw \ + set_network key_mgmt wpa-key-mgmt + + wpa_cli_do "$IF_WPA_PROTO" raw \ + set_network proto wpa-proto + + wpa_cli_do "$IF_WPA_AUTH_ALG" raw \ + set_network auth_alg wpa-auth-alg + + wpa_cli_do "$IF_WPA_SCAN_SSID" raw \ + set_network scan_ssid wpa-scan-ssid + + wpa_cli_do "$IF_WPA_IDENTITY" ascii \ + set_network identity wpa-identity + + wpa_cli_do "$IF_WPA_ANONYMOUS_IDENTITY" ascii \ + set_network anonymous_identity wpa-anonymous-identity + + wpa_cli_do "$IF_WPA_EAP" raw \ + set_network eap wpa-eap + + wpa_cli_do "$IF_WPA_EAPPSK" raw \ + set_network eappsk wpa-eappsk + + wpa_cli_do "$IF_WPA_NAI" ascii \ + set_network nai wpa-nai + + wpa_cli_do "$IF_WPA_PASSWORD" ascii \ + set_network password wpa-password + + wpa_cli_do "$IF_WPA_CA_CERT" ascii \ + set_network ca_cert wpa-ca-cert + + wpa_cli_do "$IF_WPA_CA_PATH" ascii \ + set_network ca_path wpa-ca-path + + wpa_cli_do "$IF_WPA_CLIENT_CERT" ascii \ + set_network client_cert wpa-client-cert + + wpa_cli_do "$IF_WPA_PRIVATE_KEY" ascii \ + set_network private_key wpa-private-key + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD" ascii \ + set_network private_key_passwd wpa-private-key-passwd + + wpa_cli_do "$IF_WPA_DH_FILE" ascii \ + set_network dh_file wpa-dh-file + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH" ascii \ + set_network subject_match wpa-subject-match + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH" ascii \ + set_network altsubject_match wpa-altsubject-match + + wpa_cli_do "$IF_WPA_CA_CERT2" ascii \ + set_network ca_cert2 wpa-ca-cert2 + + wpa_cli_do "$IF_WPA_CA_PATH2" ascii \ + set_network ca_path2 wpa-ca-path2 + + wpa_cli_do "$IF_WPA_CLIENT_CERT2" ascii \ + set_network client_cert2 wpa-client-cert2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY2" ascii \ + set_network private_key2 wpa-private-key2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD2" ascii \ + set_network private_key_passwd2 wpa-private-key-passwd2 + + wpa_cli_do "$IF_WPA_DH_FILE2" ascii \ + set_network dh_file2 wpa-dh-file2 + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH2" ascii \ + set_network subject_match2 wpa-subject-match2 + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH2" ascii \ + set_network altsubject_match2 wpa-altsubject-match2 + + wpa_cli_do "$IF_WPA_EAP_METHODS" raw \ + set_network eap_methods wpa-eap-methods + + wpa_cli_do "$IF_WPA_PHASE1" ascii \ + set_network phase1 wpa-phase1 + + wpa_cli_do "$IF_WPA_PHASE2" ascii \ + set_network phase2 wpa-phase2 + + wpa_cli_do "$IF_WPA_PCSC" raw \ + set_network pcsc wpa-pcsc + + wpa_cli_do "$IF_WPA_PIN" ascii \ + set_network pin wpa-pin + + wpa_cli_do "$IF_WPA_ENGINE" raw \ + set_network engine wpa-engine + + wpa_cli_do "$IF_WPA_ENGINE_ID" ascii \ + set_network engine_id wpa-engine-id + + wpa_cli_do "$IF_WPA_KEY_ID" ascii \ + set_network key_id wpa-key-id + + wpa_cli_do "$IF_WPA_EAPOL_FLAGS" raw \ + set_network eapol_flags wpa-eapol-flags + + wpa_cli_do "$IF_WPA_WEP_KEY0" raw \ + set_network wep_key0 wpa-wep-key0 + + wpa_cli_do "$IF_WPA_WEP_KEY1" raw \ + set_network wep_key1 wpa-wep-key1 + + wpa_cli_do "$IF_WPA_WEP_KEY2" raw \ + set_network wep_key2 wpa-wep-key2 + + wpa_cli_do "$IF_WPA_WEP_KEY3" raw \ + set_network wep_key3 wpa-wep-key3 + + wpa_cli_do "$IF_WPA_WEP_TX_KEYIDX" raw \ + set_network wep_tx_keyidx wpa-wep-tx-keyidx + + wpa_cli_do "$IF_WPA_PROACTIVE_KEY_CACHING" raw \ + set_network proactive_key_caching wpa-proactive-key-caching + + wpa_cli_do "$IF_WPA_PAC_FILE" ascii \ + set_network pac_file wpa-pac-file + + wpa_cli_do "$IF_WPA_MODE" raw \ + set_network mode wpa-mode + + wpa_cli_do "$IF_WPA_PEERKEY" raw \ + set_network peerkey wpa-peerkey + + wpa_cli_do "$IF_FRAGMENT_SIZE" raw \ + set_network fragment_size wpa-fragment-size + + wpa_cli_do "$IF_WPA_ID_STR" ascii \ + set_network id_str wpa-id-str + + wpa_cli_do "$WPA_ID" raw \ + enable_network "enabling network block" + fi +} + +##################################################################### +## wpa_action basic logging +# Log actions to file, test to see if it is writeable first +# +wpa_log_init () { + if touch "$WPA_CLI_LOGFILE" 2>/dev/null; then + exec >> "$WPA_CLI_LOGFILE" 2>&1 + fi +} + +# log timestamp and wpa_action arguments +wpa_log_action () { + echo "########## $(date +"%H:%M:%S %Y-%m-%d") ##########" + echo "IFACE=$WPA_IFACE ACTION=$WPA_ACTION" +} + +# log wpa_cli environment variables +wpa_log_environment () { + echo "WPA_ID=$WPA_ID WPA_ID_STR=$WPA_ID_STR" + echo "WPA_CTRL_DIR=$WPA_CTRL_DIR" +} + +##################################################################### +## hysteresis checking +# Networking tools such as dhcp clients used with ifupdown can +# synthesize artificial ACTION events, particuarly just after a +# DISCONNECTED/CONNECTED events are experienced in quick succession. +# This can lead to infinite event loops, and in extreme cases has the +# potential to cause system instability. +# +wpa_hysteresis_event () { + echo "$(date +%s)" > "$WPA_CLI_TIMESTAMP" +} + +wpa_hysteresis_check () { + if [ -f "$WPA_CLI_TIMESTAMP" ]; then + local TIME TIMESTAMP TIMEWAIT + TIME=$(date +%s) + # current time minus 4 second event buffer + TIMEWAIT=$(($TIME-4)) + # get time of last event + TIMESTAMP=$(cat $WPA_CLI_TIMESTAMP) + # compare values, allowing new action to be processed + # only if last action was more than 4 seconds ago + if [ "$TIMEWAIT" -le "$TIMESTAMP" ]; then + echo "Ignoring $WPA_ACTION event, too soon after previous event" + return 1 + fi + fi + + return 0 +} + +##################################################################### +## identify ifupdown files +# Identify ifupdown core files, so that state of the interface can be +# checked. This is the weakest part of the wpa_action roaming scheme, +# it would be _much_ better if stateless ifupdown capabilities were +# a reality. +# +ifupdown_check () { + if [ -e /etc/network/interfaces ]; then + INTERFACES_FILE="/etc/network/interfaces" + else + echo "Cannot locate ifupdown's \"interfaces\" file, $WPA_IFACE will not be configured" + return 1 + fi + + if [ -e /etc/network/run/ifstate ]; then + # debian's ifupdown + IFSTATE_FILE="/etc/network/run/ifstate" + elif [ -e /var/run/network/ifstate ]; then + # ubuntu's + IFSTATE_FILE="/var/run/network/ifstate" + else + echo "Cannot locate ifupdown's \"ifstate\" file, $WPA_IFACE will not be configured" + return 1 + fi + + return 0 +} + +##################################################################### +## apply mapping logic and ifup logical interface +# Apply mapping logic via id_str or external mapping script, check +# state of IFACE with respect to ifupdown and ifup logical interaface +# +ifup () { + local WPA_LOGICAL_IFACE + + if [ -z "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -n "$WPA_ID_STR" ]; then + WPA_LOGICAL_IFACE="$WPA_ID_STR" + echo "Mapping logical interface via id_str: $WPA_LOGICAL_IFACE" + fi + + if [ -z "$WPA_LOGICAL_IFACE" ] && [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + echo "Mapping logical interface via wpa-mapping-script: $IF_WPA_MAPPING_SCRIPT" + + local WPA_MAP_STDIN + + WPA_MAP_STDIN=$(set | sed -n 's/^\(IF_WPA_MAP[0-9]*\)=.*/echo \$\1/p') + + if [ -n "$WPA_MAP_STDIN" ]; then + WPA_LOGICAL_IFACE=$(eval "$WPA_MAP_STDIN" | "$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + else + WPA_LOGICAL_IFACE=$("$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + echo "Mapping script result: $WPA_LOGICAL_IFACE" + else + echo "Mapping script failed." + fi + fi + + if [ -z "$WPA_LOGICAL_IFACE" ]; then + if [ -n "$IF_WPA_ROAM_DEFAULT_IFACE" ]; then + WPA_LOGICAL_IFACE="$IF_WPA_ROAM_DEFAULT_IFACE" + echo "Using wpa-roam-default-iface: $WPA_LOGICAL_IFACE" + else + WPA_LOGICAL_IFACE="default" + echo "Using fallback logical interface: $WPA_LOGICAL_IFACE" + fi + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + if egrep -q "^iface[[:space:]]+$WPA_LOGICAL_IFACE[[:space:]]+inet" "$INTERFACES_FILE"; then + + echo "ifup $WPA_IFACE=$WPA_LOGICAL_IFACE" + + if grep -q "^$WPA_IFACE=$WPA_IFACE" "$IFSTATE_FILE"; then + # Force settings over the unconfigured "master" IFACE + /sbin/ifup --force "$WPA_IFACE=$WPA_LOGICAL_IFACE" + else + /sbin/ifup "$WPA_IFACE=$WPA_LOGICAL_IFACE" + fi + else + echo "No network defined for \"$WPA_LOGICAL_IFACE\" in \"$INTERFACES_FILE\"" + fi + else + echo "No suitable logical interface mapping for ifupdown to configure" + fi +} + +##################################################################### +## ifdown IFACE +# Check IFACE state and ifdown as requested. +# +ifdown () { + if grep -q "^$WPA_IFACE" "$IFSTATE_FILE"; then + echo "ifdown $WPA_IFACE" + /sbin/ifdown "$WPA_IFACE" + else + echo "Ignoring request to take \"$WPA_IFACE\" down, it is not up" + fi +} + +##################################################################### +## keep IFACE scanning +# After ifdown, the IFACE may be left "down", and inhibits +# wpa_supplicant's ability to continue roaming. +# +# NB: use iproute if present, flushing the IFACE first +# +if_post_down_up () { + if [ -x /sbin/ip ]; then + /sbin/ip addr flush dev "$WPA_IFACE" 2>/dev/null + /sbin/ip link set "$WPA_IFACE" up + else + /sbin/ifconfig "$WPA_IFACE" up + fi +} diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/ifupdown.sh b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/ifupdown.sh new file mode 100755 index 0000000000..4a292ac948 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.5.10/ifupdown.sh @@ -0,0 +1,132 @@ +#!/bin/sh + +# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license can be +# found in /usr/share/common-licenses/GPL. + +if [ -n "$IF_WPA_MAINT_DEBUG" ]; then + set -x +fi + +# quit if we're called for the loopback +if [ "$IFACE" = lo ]; then + exit 0 +fi + +# allow wpa_supplicant interface to be specified via wpa-iface +# useful for starting wpa_supplicant on one interface of a bridge +if [ -n "$IF_WPA_IFACE" ]; then + WPA_IFACE="$IF_WPA_IFACE" +else + WPA_IFACE="$IFACE" +fi + +# source functions +if [ -f /etc/wpa_supplicant/functions.sh ]; then + . /etc/wpa_supplicant/functions.sh +else + exit 0 +fi + +# quit if executables are not installed +if [ ! -x "$WPA_SUP_BIN" ] || [ ! -x "$WPA_CLI_BIN" ]; then + exit 0 +fi + +# quit if wpa_action is active +if test_wpa_cli; then + exit 0 +fi + +#echo "Initial WPA Checks Pass" + +# preliminary sanity checks for roaming daemon +if [ -n "$IF_WPA_ROAM" ]; then + if [ "$METHOD" != "manual" ]; then + wpa_msg stderr "wpa-roam can only be used with the \"manual\" inet METHOD" + exit 1 + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + if ! type "$IF_WPA_MAPPING_SCRIPT" >/dev/null; then + wpa_msg stderr "wpa-mapping-script \"$IF_WPA_MAPPING_SCRIPT\" is not valid" + exit 1 + fi + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -z "$IF_WPA_MAPPING_SCRIPT" ]; then + wpa_msg stderr "\"wpa-mapping-script-priority 1\" is invalid without a wpa-mapping-script" + exit 1 + fi + IF_WPA_CONF="$IF_WPA_ROAM" + WPA_ACTION_SCRIPT="/sbin/wpa_action" +fi + +# master function; determines if ifupdown.sh should do something or not +if [ -n "$IF_WPA_CONF" ]; then + if [ ! -s "$IF_WPA_CONF" ]; then + wpa_msg stderr "cannot read contents of $IF_WPA_CONF" + exit 1 + fi + WPA_SUP_CONF_CTRL_DIR=$(sed -n \ + 's/[[:space:]]*#.*//g;s/[[:space:]]\+.*$//g;s/^\(ctrl_interface\|DIR\)=\(.*\)/\2/p' "$IF_WPA_CONF") + if [ -n "$WPA_SUP_CONF_CTRL_DIR" ]; then + WPA_CTRL_DIR="$WPA_SUP_CONF_CTRL_DIR" + fi + WPA_SUP_CONF="-c $IF_WPA_CONF -C $WPA_CTRL_DIR" +elif set | grep -q "^IF_WPA"; then + WPA_SUP_CONF="-C $WPA_CTRL_DIR" +else + exit 0 +fi + +case "$MODE" in + start) + PHASE="pre-up" + echo "WPA: Configuring Interface" + case "$PHASE" in + pre-up) + kill_wpa_supplicant + init_wpa_supplicant || echo "FAILED" + conf_wpa_supplicant || { kill_wpa_supplicant; exit 1; } + ;; + post-up) + init_wpa_cli || { kill_wpa_supplicant; exit 1; } + ;; + esac + ;; + + stop) + PHASE="post-down" + echo "WPA: Terminating" + case "$PHASE" in + pre-down) + kill_wpa_cli + ;; + post-down) + kill_wpa_supplicant + ;; + *) + wpa_msg stderr "unknown phase: \"$PHASE\"" + exit 1 + ;; + esac + ;; + + *) + wpa_msg stderr "unknown mode: \"$MODE\"" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/action_wpa.sh b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/action_wpa.sh new file mode 100644 index 0000000000..6d90fa603a --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/action_wpa.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# Action script to enable/disable wpa-roam interfaces in reaction to +# ifplugd events. +# +# Copyright: Copyright (c) 2008-2010, Kel Modderman +# License: GPL-2 +# + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +if [ ! -x /usr/sbin/wpa_action ]; then + exit 0 +fi + +# ifplugd(8) - +# +# If an ifplugd managed interface is brought up, disconnect any +# wpa-roam managed interfaces so that only one "roaming" interface +# remains active on the system. + +IFPLUGD_IFACE="${1}" + +case "${2}" in + up) + COMMAND=disconnect + ;; + down) + COMMAND=reconnect + ;; + *) + echo "$0: unknown arguments: ${@}" >&2 + exit 1 + ;; +esac + +for CTRL in /var/run/wpa_supplicant/*; do + [ -S "${CTRL}" ] || continue + + IFACE="${CTRL#/var/run/wpa_supplicant/}" + + # skip if ifplugd is managing this interface + if [ "${IFPLUGD_IFACE}" = "${IFACE}" ]; then + continue + fi + + if wpa_action "${IFACE}" check; then + wpa_cli -i "${IFACE}" "${COMMAND}" + fi +done diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/functions.sh b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/functions.sh new file mode 100644 index 0000000000..b9e0eb2b82 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/functions.sh @@ -0,0 +1,1015 @@ +#!/bin/sh + +##################################################################### +## Purpose +# This file contains common shell functions used by scripts of the +# wpasupplicant package to allow ifupdown to manage wpa_supplicant. +# It also contains some functions used by wpa_action(8) that allow +# ifupdown to be managed by wpa_cli(8) action events. +# +# This file is provided by the wpasupplicant package. + +##################################################################### +# Copyright (C) 2006 - 2009 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license, +# version 2, can be found in /usr/share/common-licenses/GPL-2. + +##################################################################### +## global variables +# wpa_supplicant variables +WPA_SUP_BIN="/usr/sbin/wpa_supplicant" +WPA_SUP_PNAME="wpa_supplicant" +WPA_SUP_PIDFILE="/var/run/wpa_supplicant.${WPA_IFACE}.pid" + +# wpa_cli variables +WPA_CLI_BIN="/usr/sbin/wpa_cli" +WPA_CLI_PNAME="wpa_cli" +WPA_CLI_PIDFILE="/var/run/wpa_action.${WPA_IFACE}.pid" +WPA_CLI_TIMESTAMP="/var/run/wpa_action.${WPA_IFACE}.timestamp" +WPA_CLI_IFUPDOWN="/var/run/wpa_action.${WPA_IFACE}.ifupdown" + +# sendsigs omission interface, present in initscripts (>= 2.86.ds1-48) +if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then + # Debian + WPA_SUP_OMIT_PIDFILE="/lib/init/rw/sendsigs.omit.d/wpasupplicant.wpa_supplicant.${WPA_IFACE}.pid" +elif [ -d /var/run/sendsigs.omit.d/ ]; then + # Ubuntu, see https://launchpad.net/bugs/181541 for status + WPA_SUP_OMIT_PIDFILE="/var/run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.${WPA_IFACE}.pid" +else + WPA_SUP_OMIT_PIDFILE= +fi + +# default ctrl_interface socket directory +if [ -z "$WPA_CTRL_DIR" ]; then + WPA_CTRL_DIR="/var/run/wpa_supplicant" +fi + +# verbosity variables +if [ -n "$IF_WPA_VERBOSITY" ] || [ "$VERBOSITY" = "1" ]; then + TO_NULL="/dev/stdout" + DAEMON_VERBOSITY="--verbose" +else + TO_NULL="/dev/null" + DAEMON_VERBOSITY="--quiet" +fi + +##################################################################### +## wpa_cli wrapper +# Path to common ctrl_interface socket and iface supplied. +# NB: WPA_CTRL_DIR cannot be used for interactive commands, it is +# set only in the environment that wpa_cli provides when processing +# action events. +# +wpa_cli () { + "$WPA_CLI_BIN" -p "$WPA_CTRL_DIR" -i "$WPA_IFACE" "$@" + + return "$?" +} + +##################################################################### +## verbose and stderr message wrapper +# Ensures a standard and easily identifiable message is printed by +# scripts using this function library. +# +# log Log a message to syslog when called non-interactively +# by wpa_action +# +# verbose To stdout when IF_WPA_VERBOSITY or VERBOSITY is true +# +# action Same as verbose but without newline +# Useful for allowing wpa_cli commands to echo result +# value of 'OK' or 'FAILED' +# +# stderr Echo warning or error messages to stderr +# +# NB: when called by wpa_action, there is no redirection (verbose) +# +wpa_msg () { + if [ "$1" = "log" ]; then + shift + case "$WPA_ACTION" in + "CONNECTED"|"DISCONNECTED") + [ -x /usr/bin/logger ] || return + if [ "$#" -gt 0 ]; then + logger -t "wpa_action" "$@" + else + logger -t "wpa_action" + fi + ;; + *) + [ "$#" -gt 0 ] && echo "wpa_action: $@" + ;; + esac + return + fi + + case "$1" in + "verbose") + shift + echo "$WPA_SUP_PNAME: $@" >$TO_NULL + ;; + "action") + shift + echo -n "$WPA_SUP_PNAME: $@ -- " >$TO_NULL + ;; + "stderr") + shift + echo "$WPA_SUP_PNAME: $@" >/dev/stderr + ;; + *) + ;; + esac +} + +##################################################################### +## validate daemon pid files +# Test daemon process ID files via start-stop-daemon with a signal 0 +# given the exec binary and pidfile location. +# +# $1 daemon +# $2 pidfile +# +# Returns true when pidfile exists, the process ID exists _and_ was +# created by the exec binary. +# +# If the test fails, but the pidfile exists, it is stale +# +test_daemon_pidfile () { + local DAEMON + local PIDFILE + + if [ -n "$1" ]; then + DAEMON="$1" + fi + + if [ -f "$2" ]; then + PIDFILE="$2" + fi + + if [ -n "$DAEMON" ] && [ -f "$PIDFILE" ]; then + if start-stop-daemon --stop --quiet --signal 0 \ + --exec "$DAEMON" --pidfile "$PIDFILE"; then + return 0 + else + rm -f "$PIDFILE" + return 1 + fi + else + return 1 + fi +} + +# validate wpa_supplicant pidfile +test_wpa_supplicant () { + test_daemon_pidfile "$WPA_SUP_BIN" "$WPA_SUP_PIDFILE" +} + +# validate wpa_cli pidfile +test_wpa_cli () { + test_daemon_pidfile "$WPA_CLI_BIN" "$WPA_CLI_PIDFILE" +} + +##################################################################### +## daemonize wpa_supplicant +# Start wpa_supplicant via start-stop-dameon with all required +# options. Will start if environment variable WPA_SUP_CONF is present +# +# Default options: +# -B dameonize/background process +# -D driver backend ('wext' if none given) +# -P process ID file +# -C path to ctrl_interface socket directory +# -s log to syslog +# +# Conditional options: +# -c configuration file +# -W wait for wpa_cli to attach to ctrl_interface socket +# -b bridge interface name +# -f path to log file +# +init_wpa_supplicant () { + [ -n "$WPA_SUP_CONF" ] || return 0 + + local WPA_SUP_OPTIONS + WPA_SUP_OPTIONS="-s -B -P $WPA_SUP_PIDFILE -i $WPA_IFACE" + + if [ -n "$WPA_ACTION_SCRIPT" ]; then + if [ -x "$WPA_ACTION_SCRIPT" ]; then + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -W" + wpa_msg verbose "wait for wpa_cli to attach" + else + wpa_msg stderr "action script \"$WPA_ACTION_SCRIPT\" not executable" + return 1 + fi + fi + + if [ -n "$IF_WPA_BRIDGE" ]; then + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -b $IF_WPA_BRIDGE" + wpa_msg verbose "wpa-bridge $IF_WPA_BRIDGE" + fi + + if [ -n "$IF_WPA_DRIVER" ]; then + wpa_msg verbose "wpa-driver $IF_WPA_DRIVER" + case "$IF_WPA_DRIVER" in + hostap|ipw|madwifi|ndiswrapper) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -D nl80211,wext" + wpa_msg stderr "\"$IF_WPA_DRIVER\" wpa-driver is unsupported" + wpa_msg stderr "using \"nl80211,wext\" wpa-driver instead ..." + ;; + *) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -D $IF_WPA_DRIVER" + ;; + esac + else + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -D nl80211,wext" + wpa_msg verbose "wpa-driver nl80211,wext (default)" + fi + + if [ -n "$IF_WPA_DEBUG_LEVEL" ]; then + case "$IF_WPA_DEBUG_LEVEL" in + 3) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -t -ddd" + ;; + 2) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -t -dd" + ;; + 1) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -t -d" + ;; + 0) + # wpa_supplicant default verbosity + ;; + -1) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -q" + ;; + -2) + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -qq" + ;; + esac + wpa_msg verbose "using debug level: $IF_WPA_DEBUG_LEVEL" + fi + + if [ -n "$IF_WPA_LOGFILE" ]; then + # custom log file + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -f $IF_WPA_LOGFILE" + WPA_SUP_LOGFILE="$IF_WPA_LOGFILE" + wpa_msg verbose "logging to $IF_WPA_LOGFILE" + fi + + wpa_msg verbose "$WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \ + -- $WPA_SUP_OPTIONS $WPA_SUP_CONF + + if [ "$?" -ne 0 ]; then + wpa_msg stderr "$WPA_SUP_BIN daemon failed to start" + return 1 + fi + + if [ -n "$WPA_SUP_OMIT_PIDFILE" ]; then + local WPA_PIDFILE_WAIT + local MAX_WPA_PIDFILE_WAIT + WPA_PIDFILE_WAIT="0" + MAX_WPA_PIDFILE_WAIT="5" + until [ -s "$WPA_SUP_PIDFILE" ]; do + if [ "$WPA_PIDFILE_WAIT" -ge "$MAX_WPA_PIDFILE_WAIT" ]; then + wpa_msg stderr "timed out waiting for creation of $WPA_SUP_PIDFILE" + return 1 + else + wpa_msg verbose "waiting for \"$WPA_SUP_PIDFILE\": " \ + "$WPA_PIDFILE_WAIT (max. $MAX_WPA_PIDFILE_WAIT)" + fi + + WPA_PIDFILE_WAIT=$(($WPA_PIDFILE_WAIT + 1)) + sleep 1 + done + wpa_msg verbose "creating sendsigs omission pidfile: $WPA_SUP_OMIT_PIDFILE" + cat "$WPA_SUP_PIDFILE" > "$WPA_SUP_OMIT_PIDFILE" + else + wpa_msg verbose "sendsigs omission pidfile not created" + fi + + local WPA_SOCKET_WAIT + local MAX_WPA_SOCKET_WAIT + WPA_SOCKET_WAIT="0" + MAX_WPA_SOCKET_WAIT="5" + until [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; do + if [ "$WPA_SOCKET_WAIT" -ge "$MAX_WPA_SOCKET_WAIT" ]; then + wpa_msg stderr "ctrl_interface socket not found at $WPA_CTRL_DIR/$WPA_IFACE" + return 1 + else + wpa_msg verbose "waiting for \"$WPA_CTRL_DIR/$WPA_IFACE\": " \ + "$WPA_SOCKET_WAIT (max. $MAX_WPA_SOCKET_WAIT)" + fi + + WPA_SOCKET_WAIT=$(($WPA_SOCKET_WAIT + 1)) + sleep 1 + done + + wpa_msg verbose "ctrl_interface socket located at $WPA_CTRL_DIR/$WPA_IFACE" +} + +##################################################################### +## stop wpa_supplicant process +# Kill wpa_supplicant via start-stop-daemon, given the location of +# the pidfile or ctrl_interface socket path and interface name +# +kill_wpa_supplicant () { + test_wpa_supplicant || return 0 + + wpa_msg verbose "terminating $WPA_SUP_PNAME daemon via pidfile $WPA_SUP_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE + + if [ -f "$WPA_SUP_PIDFILE" ]; then + rm -f "$WPA_SUP_PIDFILE" + fi + + if [ -f "$WPA_SUP_OMIT_PIDFILE" ]; then + wpa_msg verbose "removing $WPA_SUP_OMIT_PIDFILE" + rm -f "$WPA_SUP_OMIT_PIDFILE" + fi +} + +##################################################################### +## reload wpa_supplicant process +# Sending a HUP signal causes wpa_supplicant to reparse its +# configuration file +# +reload_wpa_supplicant () { + if test_wpa_supplicant; then + wpa_msg verbose "reloading wpa_supplicant configuration file via HUP signal" + start-stop-daemon --stop --signal HUP \ + --name "$WPA_SUP_PNAME" --pidfile "$WPA_SUP_PIDFILE" + else + wpa_msg verbose "cannot $WPA_ACTION, $WPA_SUP_PIDFILE does not exist" + fi +} + +##################################################################### +## daemonize wpa_cli and action script +# If environment variable WPA_ACTION_SCRIPT is present, wpa_cli will +# be spawned via start-stop-daemon +# +# Required options: +# -a action script => wpa_action +# -P process ID file +# -B background process +# +init_wpa_cli () { + [ -n "$WPA_ACTION_SCRIPT" ] || return 0 + + local WPA_CLI_OPTIONS + WPA_CLI_OPTIONS="-B -P $WPA_CLI_PIDFILE -i $WPA_IFACE" + + wpa_msg verbose "$WPA_CLI_BIN $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_CLI_PNAME --startas $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE \ + -- $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT + + if [ "$?" -ne 0 ]; then + wpa_msg stderr "$WPA_CLI_BIN daemon failed to start" + return 1 + fi +} + +##################################################################### +## stop wpa_cli process +# Kill wpa_cli via start-stop-daemon, given the location of the +# pidfile +# +kill_wpa_cli () { + test_wpa_cli || return 0 + + wpa_msg verbose "terminating $WPA_CLI_PNAME daemon via pidfile $WPA_CLI_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE + + if [ -f "$WPA_CLI_PIDFILE" ]; then + rm -f "$WPA_CLI_PIDFILE" + fi + + if [ -f "$WPA_CLI_TIMESTAMP" ]; then + rm -f "$WPA_CLI_TIMESTAMP" + fi + + if [ -L "$WPA_CLI_IFUPDOWN" ]; then + rm -f "$WPA_CLI_IFUPDOWN" + fi +} + +##################################################################### +## higher level wpa_cli wrapper for variable and set_network commands +# wpa_cli_do [set_network variable] +# +# $1 envorinment variable +# $2 data type of variable {raw|ascii} +# $3 wpa_cli variable, if $3 is set_network, shift and take +# set_network subvariable +# $4 wpa-* string as it would appear in interfaces file, enhances +# verbose messages +# +wpa_cli_do () { + if [ -z "$1" ]; then + return 0 + fi + + local WPACLISET_VALUE + local WPACLISET_VARIABLE + local WPACLISET_DESC + + case "$2" in + ascii) + # Double quote + WPACLISET_VALUE="\"$1\"" + ;; + raw|*) + # Provide raw value + WPACLISET_VALUE="$1" + ;; + esac + + case "$3" in + set_network) + if [ -z "$WPA_ID" ]; then + return 1 + fi + shift + WPACLISET_VARIABLE="set_network $WPA_ID $3" + ;; + *) + WPACLISET_VARIABLE="$3" + ;; + esac + + case "$4" in + *-psk|*-passphrase|*-passwd*|*-wep-key*) + WPACLISET_DESC="$4 *****" + ;; + *) + WPACLISET_DESC="$4 $WPACLISET_VALUE" + ;; + esac + + wpa_msg action "$WPACLISET_DESC" + + wpa_cli $WPACLISET_VARIABLE "$WPACLISET_VALUE" >$TO_NULL + + if [ "$?" -ne 0 ]; then + wpa_msg stderr "$WPACLISET_DESC failed!" + fi +} + +##################################################################### +## check value data type in plaintext or hex +# returns 0 if input consists of hexadecimal digits only, 1 otherwise +# +ishex () { + if [ -z "$1" ]; then + return 0 + fi + + case "$1" in + *[!0-9a-fA-F]*) + # plaintext + return 1 + ;; + *) + # hexadecimal + return 0 + ;; + esac +} + +##################################################################### +## sanity check and set psk|passphrase +# Warn about strange psk|passphrase values +# +# $1 psk or passphrase value +# +# If psk is surrounded by quotes strip them. +# +# If psk contains all hexadecimal characters and string length is 64: +# is 256bit hexadecimal +# else: +# is plaintext +# +# plaintext passphrases must be 8 - 63 characters in length +# 256-bit hexadecimal key must be 64 characters in length +# +wpa_key_check_and_set () { + if [ "$#" -ne 3 ]; then + return 0 + fi + + local KEY + local KEY_LEN + local KEY_TYPE + local ENC_TYPE + + case "$1" in + '"'*'"') + # Strip surrounding quotation marks + KEY=$(echo -n "$1" | sed 's/^"//;s/"$//') + ;; + *) + KEY="$1" + ;; + esac + + KEY_LEN="${#KEY}" + + case "$2" in + wep_key*) + ENC_TYPE="WEP" + ;; + psk) + ENC_TYPE="WPA" + ;; + *) + return 0 + ;; + esac + + if [ "$ENC_TYPE" = "WEP" ]; then + if ishex "$KEY"; then + case "$KEY_LEN" in + 10|26|32|58) + # 64/128/152/256-bit WEP + KEY_TYPE="raw" + ;; + *) + KEY_TYPE="ascii" + ;; + esac + else + KEY_TYPE="ascii" + fi + + if [ "$KEY_TYPE" = "ascii" ]; then + if [ "$KEY_LEN" -lt "5" ]; then + wpa_msg stderr "WARNING: plaintext or ascii WEP key has $KEY_LEN characters," + wpa_msg stderr "it must have at least 5 to be valid." + fi + fi + elif [ "$ENC_TYPE" = "WPA" ]; then + if ishex "$KEY"; then + case "$KEY_LEN" in + 64) + # 256-bit WPA + KEY_TYPE="raw" + ;; + *) + KEY_TYPE="ascii" + ;; + esac + else + KEY_TYPE="ascii" + fi + + if [ "$KEY_TYPE" = "ascii" ]; then + if [ "$KEY_LEN" -lt "8" ] || [ "$KEY_LEN" -gt "63" ]; then + wpa_msg stderr "WARNING: plaintext or ascii WPA key has $KEY_LEN characters," + wpa_msg stderr "it must have between 8 and 63 to be valid." + wpa_msg stderr "If the WPA key is a 256-bit hexadecimal key, it must have" + wpa_msg stderr "exactly 64 characters." + fi + fi + fi + + wpa_cli_do "$KEY" "$KEY_TYPE" set_network "$2" "$3" +} + +##################################################################### +## formulate a usable configuration from interfaces(5) wpa- lines +# A series of wpa_cli commands corresponding to environment variables +# created as a result of wpa- lines in an interfaces stanza. +# +# NB: no-act when roaming daemon is used (to avoid prematurely +# attaching to ctrl_interface socket) +# +conf_wpa_supplicant () { + if [ -n "$WPA_ACTION_SCRIPT" ]; then + return 0 + fi + + if [ "$IF_WPA_DRIVER" = "wired" ]; then + IF_WPA_AP_SCAN="0" + wpa_msg verbose "forcing ap_scan=0 (required for wired IEEE8021X auth)" + fi + + if [ -n "$IF_WPA_ESSID" ]; then + # #403316, be similar to wireless tools + IF_WPA_SSID="$IF_WPA_ESSID" + fi + + wpa_cli_do "$IF_WPA_AP_SCAN" raw \ + ap_scan wpa-ap-scan + + wpa_cli_do "$IF_WPA_PREAUTHENTICATE" raw \ + preauthenticate wpa-preauthenticate + + if [ -n "$IF_WPA_SSID" ] || [ "$IF_WPA_DRIVER" = "wired" ] || \ + [ -n "$IF_WPA_KEY_MGMT" ]; then + + case "$IF_WPA_SSID" in + '"'*'"') + IF_WPA_SSID=$(echo -n "$IF_WPA_SSID" | sed 's/^"//;s/"$//') + ;; + *) + ;; + esac + + WPA_ID=$(wpa_cli add_network) + + wpa_msg verbose "configuring network block -- $WPA_ID" + + wpa_cli_do "$IF_WPA_SSID" ascii \ + set_network ssid wpa-ssid + + wpa_cli_do "$IF_WPA_PRIORITY" raw \ + set_network priority wpa-priority + + wpa_cli_do "$IF_WPA_BSSID" raw \ + set_network bssid wpa-bssid + + if [ -s "$IF_WPA_PSK_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PSK_FILE") + fi + + # remain compat with wpa-passphrase-file + if [ -s "$IF_WPA_PASSPHRASE_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PASSPHRASE_FILE") + fi + + # remain compat with wpa-passphrase + if [ -n "$IF_WPA_PASSPHRASE" ]; then + IF_WPA_PSK="$IF_WPA_PASSPHRASE" + fi + + if [ -n "$IF_WPA_PSK" ]; then + wpa_key_check_and_set "$IF_WPA_PSK" \ + psk wpa-psk + fi + + wpa_cli_do "$IF_WPA_PAIRWISE" raw \ + set_network pairwise wpa-pairwise + + wpa_cli_do "$IF_WPA_GROUP" raw \ + set_network group wpa-group + + wpa_cli_do "$IF_WPA_MODE" raw \ + set_network mode wpa-mode + + wpa_cli_do "$IF_WPA_FREQUENCY" raw \ + set_network frequency wpa-frequency + + wpa_cli_do "$IF_WPA_SCAN_FREQ" raw \ + set_network scan_freq wpa-scan-freq + + wpa_cli_do "$IF_WPA_FREQ_LIST" raw \ + set_network freq_list wpa-freq-list + + wpa_cli_do "$IF_WPA_KEY_MGMT" raw \ + set_network key_mgmt wpa-key-mgmt + + wpa_cli_do "$IF_WPA_PROTO" raw \ + set_network proto wpa-proto + + wpa_cli_do "$IF_WPA_AUTH_ALG" raw \ + set_network auth_alg wpa-auth-alg + + wpa_cli_do "$IF_WPA_SCAN_SSID" raw \ + set_network scan_ssid wpa-scan-ssid + + wpa_cli_do "$IF_WPA_IDENTITY" ascii \ + set_network identity wpa-identity + + wpa_cli_do "$IF_WPA_ANONYMOUS_IDENTITY" ascii \ + set_network anonymous_identity wpa-anonymous-identity + + wpa_cli_do "$IF_WPA_EAP" raw \ + set_network eap wpa-eap + + wpa_cli_do "$IF_WPA_EAPPSK" raw \ + set_network eappsk wpa-eappsk + + wpa_cli_do "$IF_WPA_NAI" ascii \ + set_network nai wpa-nai + + wpa_cli_do "$IF_WPA_PASSWORD" ascii \ + set_network password wpa-password + + wpa_cli_do "$IF_WPA_CA_CERT" ascii \ + set_network ca_cert wpa-ca-cert + + wpa_cli_do "$IF_WPA_CA_PATH" ascii \ + set_network ca_path wpa-ca-path + + wpa_cli_do "$IF_WPA_CLIENT_CERT" ascii \ + set_network client_cert wpa-client-cert + + wpa_cli_do "$IF_WPA_PRIVATE_KEY" ascii \ + set_network private_key wpa-private-key + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD" ascii \ + set_network private_key_passwd wpa-private-key-passwd + + wpa_cli_do "$IF_WPA_DH_FILE" ascii \ + set_network dh_file wpa-dh-file + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH" ascii \ + set_network subject_match wpa-subject-match + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH" ascii \ + set_network altsubject_match wpa-altsubject-match + + wpa_cli_do "$IF_WPA_CA_CERT2" ascii \ + set_network ca_cert2 wpa-ca-cert2 + + wpa_cli_do "$IF_WPA_CA_PATH2" ascii \ + set_network ca_path2 wpa-ca-path2 + + wpa_cli_do "$IF_WPA_CLIENT_CERT2" ascii \ + set_network client_cert2 wpa-client-cert2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY2" ascii \ + set_network private_key2 wpa-private-key2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD2" ascii \ + set_network private_key_passwd2 wpa-private-key-passwd2 + + wpa_cli_do "$IF_WPA_DH_FILE2" ascii \ + set_network dh_file2 wpa-dh-file2 + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH2" ascii \ + set_network subject_match2 wpa-subject-match2 + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH2" ascii \ + set_network altsubject_match2 wpa-altsubject-match2 + + wpa_cli_do "$IF_WPA_EAP_METHODS" raw \ + set_network eap_methods wpa-eap-methods + + wpa_cli_do "$IF_WPA_PHASE1" ascii \ + set_network phase1 wpa-phase1 + + wpa_cli_do "$IF_WPA_PHASE2" ascii \ + set_network phase2 wpa-phase2 + + wpa_cli_do "$IF_WPA_PCSC" raw \ + set_network pcsc wpa-pcsc + + wpa_cli_do "$IF_WPA_PIN" ascii \ + set_network pin wpa-pin + + wpa_cli_do "$IF_WPA_ENGINE" raw \ + set_network engine wpa-engine + + wpa_cli_do "$IF_WPA_ENGINE_ID" ascii \ + set_network engine_id wpa-engine-id + + wpa_cli_do "$IF_WPA_KEY_ID" ascii \ + set_network key_id wpa-key-id + + wpa_cli_do "$IF_WPA_EAPOL_FLAGS" raw \ + set_network eapol_flags wpa-eapol-flags + + if [ -n "$IF_WPA_WEP_KEY0" ]; then + wpa_key_check_and_set "$IF_WPA_WEP_KEY0" \ + wep_key0 wpa-wep-key0 + fi + + if [ -n "$IF_WPA_WEP_KEY1" ]; then + wpa_key_check_and_set "$IF_WPA_WEP_KEY1" \ + wep_key1 wpa-wep-key1 + fi + + if [ -n "$IF_WPA_WEP_KEY2" ]; then + wpa_key_check_and_set "$IF_WPA_WEP_KEY2" \ + wep_key2 wpa-wep-key2 + fi + + if [ -n "$IF_WPA_WEP_KEY3" ]; then + wpa_key_check_and_set "$IF_WPA_WEP_KEY3" \ + wep_key3 wpa-wep-key3 + fi + + wpa_cli_do "$IF_WPA_WEP_TX_KEYIDX" raw \ + set_network wep_tx_keyidx wpa-wep-tx-keyidx + + wpa_cli_do "$IF_WPA_PROACTIVE_KEY_CACHING" raw \ + set_network proactive_key_caching wpa-proactive-key-caching + + wpa_cli_do "$IF_WPA_PAC_FILE" ascii \ + set_network pac_file wpa-pac-file + + wpa_cli_do "$IF_WPA_PEERKEY" raw \ + set_network peerkey wpa-peerkey + + wpa_cli_do "$IF_FRAGMENT_SIZE" raw \ + set_network fragment_size wpa-fragment-size + + wpa_cli_do "$IF_WPA_ID_STR" ascii \ + set_network id_str wpa-id-str + + wpa_cli_do "$WPA_ID" raw \ + enable_network "enabling network block" + fi +} + +##################################################################### +## Log wpa_cli environment variables +wpa_log_env () { + wpa_msg log "WPA_IFACE=$WPA_IFACE WPA_ACTION=$WPA_ACTION" + wpa_msg log "WPA_ID=$WPA_ID WPA_ID_STR=$WPA_ID_STR WPA_CTRL_DIR=$WPA_CTRL_DIR" +} + +##################################################################### +## hysteresis checking +# Networking tools such as dhcp clients used with ifupdown can +# synthesize artificial ACTION events, particuarly just after a +# DISCONNECTED/CONNECTED events are experienced in quick succession. +# This can lead to infinite event loops, and in extreme cases has the +# potential to cause system instability. +# +wpa_hysteresis_event () { + echo "$(date +%s)" > "$WPA_CLI_TIMESTAMP" 2>/dev/null +} + +wpa_hysteresis_check () { + if [ -f "$WPA_CLI_TIMESTAMP" ]; then + local TIME + local TIMESTAMP + local TIMEWAIT + TIME=$(date +%s) + # current time minus 4 second event buffer + TIMEWAIT=$(($TIME-4)) + # get time of last event + TIMESTAMP=$(cat $WPA_CLI_TIMESTAMP) + # compare values, allowing new action to be processed + # only if last action was more than 4 seconds ago + if [ "$TIMEWAIT" -le "$TIMESTAMP" ]; then + wpa_msg log "$WPA_ACTION event blocked by hysteresis check" + return 1 + fi + fi + + return 0 +} + +##################################################################### +## ifupdown locking functions +# A collection of rudimentary locking functions to lock ifup/ifdown +# actions. +# + +ifupdown_lock () { + ln -s lock "$WPA_CLI_IFUPDOWN" +} + +ifupdown_locked () { + [ -L "$WPA_CLI_IFUPDOWN" ] && return 0 + + return 1 +} + +ifupdown_unlock () { + rm -f "$WPA_CLI_IFUPDOWN" +} + +##################################################################### +## apply mapping logic and ifup logical interface +# Apply mapping logic via id_str or external mapping script, check +# state of IFACE with respect to ifupdown and ifup logical interaface +# +ifup () { + local INTERFACES_FILE + local IFSTATE_FILE + local IFUP_RETVAL + local WPA_LOGICAL_IFACE + + if [ -e /etc/network/interfaces ]; then + INTERFACES_FILE="/etc/network/interfaces" + else + wpa_msg log "/etc/network/interfaces does not exist, $WPA_IFACE will not be configured" + return 1 + fi + + if [ -e /etc/network/run/ifstate ]; then + # debian's ifupdown + IFSTATE_FILE="/etc/network/run/ifstate" + elif [ -e /var/run/network/ifstate ]; then + # ubuntu's + IFSTATE_FILE="/var/run/network/ifstate" + else + unset IFSTATE_FILE + fi + + if [ -z "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -n "$WPA_ID_STR" ]; then + WPA_LOGICAL_IFACE="$WPA_ID_STR" + fi + + if [ -z "$WPA_LOGICAL_IFACE" ] && [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + local WPA_MAP_STDIN + + WPA_MAP_STDIN=$(set | sed -n 's/^\(IF_WPA_MAP[0-9]*\)=.*/echo \$\1/p') + + if [ -n "$WPA_MAP_STDIN" ]; then + WPA_LOGICAL_IFACE=$(eval "$WPA_MAP_STDIN" | "$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + else + WPA_LOGICAL_IFACE=$("$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + wpa_msg log "mapping script result: $WPA_LOGICAL_IFACE" + else + wpa_msg log "mapping script failed." + fi + fi + + if [ -z "$WPA_LOGICAL_IFACE" ]; then + if [ -n "$IF_WPA_ROAM_DEFAULT_IFACE" ]; then + WPA_LOGICAL_IFACE="$IF_WPA_ROAM_DEFAULT_IFACE" + else + WPA_LOGICAL_IFACE="default" + fi + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + if egrep -q "^iface[[:space:]]+${WPA_LOGICAL_IFACE}[[:space:]]+inet" "$INTERFACES_FILE"; then + : # logical network is defined + else + wpa_msg log "network settings not defined for $WPA_LOGICAL_IFACE in $INTERFACES_FILE" + WPA_LOGICAL_IFACE="default" + fi + + wpa_msg log "ifup $WPA_IFACE=$WPA_LOGICAL_IFACE" + + ifupdown_lock + + if [ -n "$IFSTATE_FILE" ] && grep -q "^$WPA_IFACE=$WPA_IFACE" "$IFSTATE_FILE"; then + # Force settings over the unconfigured "master" IFACE + /sbin/ifup -v --force "$WPA_IFACE=$WPA_LOGICAL_IFACE" + else + /sbin/ifup -v "$WPA_IFACE=$WPA_LOGICAL_IFACE" + fi + IFUP_RETVAL="$?" + + ifupdown_unlock + fi + + wpa_msg log "creating sendsigs omission pidfile: $WPA_SUP_OMIT_PIDFILE" + cat "$WPA_SUP_PIDFILE" > "$WPA_SUP_OMIT_PIDFILE" + + return "$IFUP_RETVAL" +} + +##################################################################### +## ifdown IFACE +# Check IFACE state and ifdown as requested. +# +ifdown () { + wpa_msg log "ifdown $WPA_IFACE" + + ifupdown_lock + + /sbin/ifdown -v "$WPA_IFACE" + + ifupdown_unlock + + wpa_msg log "removing sendsigs omission pidfile: $WPA_SUP_OMIT_PIDFILE" + rm -f "$WPA_SUP_OMIT_PIDFILE" +} + +##################################################################### +## keep IFACE scanning +# After ifdown, the IFACE may be left "down", and inhibits +# wpa_supplicant's ability to continue roaming. +# +# NB: use iproute if present, flushing the IFACE first +# +if_post_down_up () { + if [ -x /bin/ip ]; then + ip addr flush dev "$WPA_IFACE" 2>/dev/null + ip link set "$WPA_IFACE" up + else + ifconfig "$WPA_IFACE" up + fi +} diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/ifupdown.sh b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/ifupdown.sh new file mode 100644 index 0000000000..9dab925726 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/ifupdown.sh @@ -0,0 +1,172 @@ +#!/bin/sh + +##################################################################### +## Purpose +# This file is executed by ifupdown in pre-up, post-up, pre-down and +# post-down phases of network interface configuration. It allows +# ifup(8), and ifdown(8) to manage wpa_supplicant(8) and wpa_cli(8) +# processes running in daemon mode. +# +# /etc/wpa_supplicant/functions.sh is sourced by this file. +# +# This file is provided by the wpasupplicant package. + +##################################################################### +# Copyright (C) 2006 - 2009 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license, +# version 2, can be found in /usr/share/common-licenses/GPL-2. + +if [ -n "$IF_WPA_MAINT_DEBUG" ]; then + set -x +fi + +# quit if we're called for the loopback +if [ "$IFACE" = lo ]; then + exit 0 +fi + +# allow wpa_supplicant interface to be specified via wpa-iface +# useful for starting wpa_supplicant on one interface of a bridge +if [ -n "$IF_WPA_IFACE" ]; then + WPA_IFACE="$IF_WPA_IFACE" +else + WPA_IFACE="$IFACE" +fi + +# source functions +if [ -f /etc/wpa_supplicant/functions.sh ]; then + . /etc/wpa_supplicant/functions.sh +else + exit 0 +fi + +# quit if executables are not installed +if [ ! -x "$WPA_SUP_BIN" ] || [ ! -x "$WPA_CLI_BIN" ]; then + exit 0 +fi + +do_start () { + if test_wpa_cli; then + # if wpa_action is active for this IFACE, do nothing + ifupdown_locked && exit 0 + + # if the administrator is calling ifup, say something useful + if [ "$PHASE" = "pre-up" ]; then + wpa_msg stderr "wpa_action is managing ifup/ifdown state of $WPA_IFACE" + wpa_msg stderr "execute \`ifdown --force $WPA_IFACE' to stop wpa_action" + fi + exit 1 + elif ! set | grep -q "^IF_WPA"; then + # no wpa- option defined for IFACE, do nothing + exit 0 + fi + + # ensure stale ifupdown_lock marker is purged + ifupdown_unlock + + # preliminary sanity checks for roaming daemon + if [ -n "$IF_WPA_ROAM" ]; then + if [ "$METHOD" != "manual" ]; then + wpa_msg stderr "wpa-roam can only be used with the \"manual\" inet METHOD" + exit 1 + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + if ! type "$IF_WPA_MAPPING_SCRIPT" >/dev/null; then + wpa_msg stderr "wpa-mapping-script \"$IF_WPA_MAPPING_SCRIPT\" is not valid" + exit 1 + fi + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -z "$IF_WPA_MAPPING_SCRIPT" ]; then + wpa_msg stderr "\"wpa-mapping-script-priority 1\" is invalid without a wpa-mapping-script" + exit 1 + fi + IF_WPA_CONF="$IF_WPA_ROAM" + WPA_ACTION_SCRIPT="/usr/sbin/wpa_action" + fi + + # master function; determines if ifupdown.sh should do something or not + if [ -n "$IF_WPA_CONF" ] && [ "$IF_WPA_CONF" != "managed" ]; then + if [ ! -s "$IF_WPA_CONF" ]; then + wpa_msg stderr "cannot read contents of $IF_WPA_CONF" + exit 1 + fi + WPA_SUP_CONF_CTRL_DIR=$(sed -n -e 's/[[:space:]]*#.*//g' -e 's/[[:space:]]\+.*$//g' \ + -e 's/^ctrl_interface=\(DIR=\)\?\(.*\)/\2/p' "$IF_WPA_CONF") + if [ -n "$WPA_SUP_CONF_CTRL_DIR" ]; then + WPA_CTRL_DIR="$WPA_SUP_CONF_CTRL_DIR" + WPA_SUP_CONF="-c $IF_WPA_CONF" + else + # specify the default ctrl_interface since none was defined in + # the given IF_WPA_CONF + WPA_SUP_CONF="-c $IF_WPA_CONF -C $WPA_CTRL_DIR" + fi + else + # specify the default ctrl_interface + WPA_SUP_CONF="-C $WPA_CTRL_DIR" + fi +} + +do_stop () { + if test_wpa_cli; then + # if wpa_action is active for this IFACE and calling ifdown, + # do nothing + ifupdown_locked && exit 0 + elif test_wpa_supplicant; then + # wpa_supplicant process exists for this IFACE, but wpa_cli + # process does not. Allow stop mode to kill this process. + : + else + exit 0 + fi +} + +case "$MODE" in + start) + do_start + case "$PHASE" in + pre-up) + kill_wpa_supplicant + init_wpa_supplicant || exit 1 + conf_wpa_supplicant || { kill_wpa_supplicant; exit 1; } + ;; + post-up) + init_wpa_cli || { kill_wpa_supplicant; exit 1; } + ;; + esac + ;; + + stop) + do_stop + case "$PHASE" in + pre-down) + kill_wpa_cli + ;; + post-down) + kill_wpa_supplicant + ;; + *) + wpa_msg stderr "unknown phase: \"$PHASE\"" + exit 1 + ;; + esac + ;; + + *) + wpa_msg stderr "unknown mode: \"$MODE\"" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action new file mode 100644 index 0000000000..7ef57aca22 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action @@ -0,0 +1,81 @@ +#!/bin/sh + +# Copyright (C) 2006 - 2009 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license, +# version 2, can be found in /usr/share/common-licenses/GPL-2. + +if [ -n "$IF_WPA_ROAM_MAINT_DEBUG" ]; then + set -x +fi + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 IFACE ACTION" + exit 1 +fi + +# network interface +WPA_IFACE="$1" +# [CONNECTED|DISCONNECTED|stop|reload|check] +WPA_ACTION="$2" + +if [ -f /etc/wpa_supplicant/functions.sh ]; then + . /etc/wpa_supplicant/functions.sh +else + exit 0 +fi + +case "$WPA_ACTION" in + "CONNECTED") + wpa_log_env + wpa_hysteresis_check || exit 1 + wpa_hysteresis_event + if ifup; then + wpa_cli status | wpa_msg log + else + wpa_cli status | wpa_msg log + wpa_cli reassociate + fi + ;; + + "DISCONNECTED") + wpa_log_env + wpa_hysteresis_check || exit 1 + ifdown + if_post_down_up + ;; + + "stop"|"down") + test_wpa_cli && kill_wpa_cli + ifdown + test_wpa_supplicant && kill_wpa_supplicant + ;; + + "restart"|"reload") + test_wpa_supplicant || exit 1 + reload_wpa_supplicant + ;; + + "check") + test_wpa_supplicant || exit 1 + test_wpa_cli || exit 1 + ;; + + *) + echo "Unknown action: \"$WPA_ACTION\"" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action.8 b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action.8 new file mode 100644 index 0000000000..e8f1b28d3d --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.3/wpa_action.8 @@ -0,0 +1,148 @@ +.TH WPA_ACTION "8" "26 May 2006" "" "" +.SH NAME +wpa_action \- wpa_cli action script +.SH SYNOPSIS +\fBwpa_action\fR \fIIFACE ACTION\fR +.SH "DESCRIPTION" +\fBwpa_action\fR is a shell script designed to control the \fBifupdown\fR +framework according to \fIACTION\fR events received from \fBwpa_supplicant\fR. +\fBwpa_cli\fR receives \fICONNECTED\fR and \fIDISCONNECTED\fR events from +\fBwpa_supplicant\fR via the crtl_iface socket and gives the \fIACTION\fR event +to the \fBwpa_action\fR script as an argument, along with the \fIIFACE\fR to be +acted upon. +.PP +\fBwpa_action\fR also receives an environment variable from \fBwpa_cli\fR, +\fIWPA_ID_STR\fR, containing an alphanumeric identification string for the +\fICURRENT\fR network block. \fIWPA_ID_STR\fR is provided by the 'id_str' +network block option of \fBwpa_supplicant.conf\fR, and provides a means to map +the \fIACTION\fR to a \fILOGICAL\fR interface configured in the \fBinterfaces\fR +file. +.PP +If either the ifupdown \fBinterfaces\fR or \fIifstate\fR file cannot be found, +\fBwpa_action\fR will exit silently (status 0). \fBwpa_action\fR will search +the following locations for their existance: +.nf + /etc/network/run/ifstate + /var/run/network/ifstate + /etc/network/interfaces +.fi +.PP +.SH IFACE +Network interface to be acted upon, for example 'eth1' or 'wlan0'. +.SH ACTION +An \fIACTION\fR to be performed on the \fIIFACE\fR. +.TP +\fBCONNECTED\fR +\fBwpa_supplicant\fR has completed authentication. +\fBifup\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to +syslog. Network settings for the \fILOGICAL\fR interface \fIWPA_ID_STR\fR +are applied. +.TP +\fBDISCONNECTED\fR +\fBwpa_supplicant\fR has detected disconnection. +\fBifdown\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to +syslog. Network settings for the \fILOGICAL\fR interface \fIWPA_ID_STR\fR +are undone. +.TP +\fBstop\fR +The 'stop' \fIACTION\fR is a called manually by the user, to stop the +\fBwpa_cli\fR daemon, invoke \fBifdown\fR \fIIFACE\fR (if the \fIIFACE\fR is +present in the \fIifstate\fR file) and stop the \fBwpa_supplicant\fR daemon. +.TP +\fBreload\fR +The 'reload' \fIACTION\fR can be used to reload the \fBwpa_supplicant\fR +configuration file specified by \fIwpa-roam\fR . 'restart' is a synonym +for 'reload' and can be used equally. The action is logged to +\fI/var/log/wpa_action.log\fR. +.SH ENVIRONMENT +An alphanumeric identification string provided by the 'id_str' network block +option of \fBwpa_supplicant.conf\fR is exported to \fBwpa_action\fR as an +environment variable, \fIWPA_ID_STR\fR. When 'id_str' is not configured for the +\fICURRENT\fR network block, 'default' is substituted for the absent +\fIWPA_ID_STR\fR environment variable. +.PP +A unique network identifier, \fIWPA_ID\fR, is exported to \fBwpa_action\fR. It +is the number assigned to the \fICURRENT\fR \fBwpa_supplicant\fR network block +(network_id). +.SH USAGE +The only reasons for \fBwpa_action\fR to be explicitly executed by the user is +to stop \fBwpa_cli\fR from controlling \fBifupdown\fR or reload the +\fIwpa_supplicant.conf\fR file after editing. +.PP +.RS +\fBwpa_action\fR \fIeth1 stop\fR +.RE +.PP +Otherwise, \fBwpa_action\fR is given as an argument to a \fBwpa_cli\fR +daemon. +.PP +.RS +\fBwpa_cli\fR \fI-i eth1 -a /sbin/wpa_action -B\fR +.RE +.PP +This can be done by using the \fIwpa-roam\fR option in the \fBinterfaces\fR +file. \fIwpa-roam\fR takes one argument, a user provided +\fBwpa_supplicant.conf\fR file. +.PP +The inet \fIMETHOD\fR must be 'manual' for this interface, as it will +be configured according to \fBwpa_cli\fR action events. Also supply a 'default' +\fBinterfaces\fR stanza using the dhcp inet \fIMETHOD\fR so that networks +without an 'id_str' option can fallback to attempting to receive an ip via +dhcp. If one or more networks requires additional network configuration, +provide an unique 'id_str' for each network, and an \fBinterfaces\fR stanza +using the 'id_str' value as a \fILOGICAL\fR interface. The following interfaces +file is configured to use dhcp for any network without an 'id_str', a static ip +for the network with an 'id_str' of 'home_static' and dhcp plus an additional +post-up command for the network with an 'id_str' of 'uni'. +.PP +An example wpa_supplicant.conf configured to roam between 3 different networks: +.PP +.RS +.nf +network={ + ssid="foo" + id_str="uni" + key_mgmt=NONE +} + +network={ + ssid="bar" + id_str="home_static" + psk=123456789... +} + +network={ + ssid="" + key_mgmt=NONE +} +.fi +.RE +.PP +The corresponding \fBinterfaces\fR file would contain \fILOGICAL\fR interfaces, +that correlate to each unique 'id_str' provided by the configuration file: +.PP +.RS +.nf +iface eth1 inet manual + wpa-driver wext + wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf + +iface default inet dhcp + +iface uni inet dhcp + +iface home_static inet static + address 192.168.0.20 + netmask 255.255.255.0 + network 192.168.0.0 + broadcast 192.168.0.255 + gateway 192.168.0.1 +.fi +.RE +.PP +.SH SEE ALSO +\fBwpa_cli(8)\fR, \fBwpa_supplicant(8)\fR, \fBwpa_supplicant.conf(5)\fR, +\fBifup(8)\fR, \fBinterfaces(5)\fR +.SH AUTHOR +This manual page was written by Kel Modderman for +the Debian GNU system (but may be used by others). diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.5.10.bb b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.5.10.bb new file mode 100644 index 0000000000..e1a47ffd2f --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.5.10.bb @@ -0,0 +1,73 @@ +SUMMARY = "A Client for Wi-Fi Protected Access (WPA)." +SECTION = "network" +LICENSE = "GPLv2 | BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \ + file://README;beginline=1;endline=61;md5=ca1e815679e09dfa7e523c9b141d928e \ + file://wpa_supplicant.c;beginline=1;endline=17;md5=ed4cd86297f95122db05f4f027f0ed81" +HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/" +DEPENDS = "gnutls ${@base_contains("COMBINED_FEATURES", "madwifi", "madwifi-ng", "",d)}" +PR = "r2" + +#we introduce MY_ARCH to get 'armv5te' as arch instead of the misleading 'arm' on armv5te builds +MY_ARCH := "${PACKAGE_ARCH}" +PACKAGE_ARCH = "${@base_contains('COMBINED_FEATURES', 'madwifi', '${MACHINE_ARCH}', '${MY_ARCH}', d)}" + +SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \ + file://defconfig-gnutls \ + file://ifupdown.sh \ + file://functions.sh \ + file://driver-zydas.patch \ + file://driver-ralink.patch \ +" +S = "${WORKDIR}/wpa_supplicant-${PV}" + +PACKAGES_prepend = "wpa-supplicant-passphrase " +FILES_wpa-supplicant-passphrase = "/usr/sbin/wpa_passphrase" + +RREPLACES_${PN} = "wpa-supplicant-cli" + +RRECOMMENDS_${PN} = "wpa-supplicant-passphrase" + +export HAS_MADWIFI = "${@base_contains('COMBINED_FEATURES', 'madwifi', 1, 0,d)}" + +do_configure () { + install -m 0755 ${WORKDIR}/defconfig-gnutls .config + + if [ "x$HAS_MADWIFI" = "x1" ] ; then + echo "CONFIG_DRIVER_MADWIFI=y" >> .config + echo "CFLAGS += -I${STAGING_INCDIR}/madwifi-ng" >> .config + fi + + echo "CONFIG_DRIVER_RALINK=y" >> .config + echo "CONFIG_DRIVER_ZYDAS=y" >> .config +} + +do_compile () { + make +} + +do_install () { + install -d ${D}${sbindir} + install -m 755 wpa_supplicant ${D}${sbindir} + install -m 755 wpa_passphrase ${D}${sbindir} + install -m 755 wpa_cli ${D}${sbindir} + + install -d ${D}${localstatedir}/run/wpa_supplicant + + install -d ${D}${docdir}/wpa_supplicant + install -m 644 README ${D}${docdir}/wpa_supplicant + + install -d ${D}${sysconfdir}/network/if-pre-up.d/ + install -d ${D}${sysconfdir}/network/if-post-down.d/ + install -d ${D}${sysconfdir}/network/if-down.d/ + + install -d ${D}${sysconfdir}/wpa_supplicant + install -m 755 ${WORKDIR}/ifupdown.sh ${D}${sysconfdir}/wpa_supplicant/ + install -m 755 ${WORKDIR}/functions.sh ${D}${sysconfdir}/wpa_supplicant + + ln -s /etc/wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-pre-up.d/wpasupplicant + ln -s /etc/wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-post-down.d/wpasupplicant +} + +SRC_URI[md5sum] = "9e7b99da67c47d81121368c6d580d069" +SRC_URI[sha256sum] = "c5c5ae89b4d3a247d4f5dcfa37e86df248d7e483d42636ef1f82c0bc48597dde" diff --git a/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bbappend b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bbappend new file mode 100644 index 0000000000..7205b22c66 --- /dev/null +++ b/meta-openpli/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bbappend @@ -0,0 +1,40 @@ +DEPENDS += "openssl" +PRINC = "1" + +SRC_URI += " \ + file://action_wpa.sh \ + file://functions.sh \ + file://ifupdown.sh \ + file://wpa_action \ + file://wpa_action.8 \ +" + +do_configure_append() { + sed -e '/^CONFIG_TLS = gnutls/d' -i .config + echo "CONFIG_DEBUG_SYSLOG=y" >> .config +} +do_install_append() { + rm -rf ${D}${sysconfdir}/network/if-*.d + + install -d ${D}${sysconfdir}/wpa_supplicant + install -m 755 ${WORKDIR}/action_wpa.sh ${D}${sysconfdir}/wpa_supplicant + install -m 755 ${WORKDIR}/functions.sh ${D}${sysconfdir}/wpa_supplicant + install -m 755 ${WORKDIR}/ifupdown.sh ${D}${sysconfdir}/wpa_supplicant + + install -d ${D}${sbindir} + install -m 755 ${WORKDIR}/wpa_action ${D}${sbindir} + + install -d ${D}${mandir}/man8 + install -m 755 ${WORKDIR}/wpa_action.8 ${D}${mandir}/man8 + + install -d ${D}${sysconfdir}/network/if-down.d + install -d ${D}${sysconfdir}/network/if-post-down.d + install -d ${D}${sysconfdir}/network/if-pre-up.d + install -d ${D}${sysconfdir}/network/if-up.d + ln -s ../../wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-down.d/${PN} + ln -s ../../wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-post-down.d/${PN} + ln -s ../../wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-pre-up.d/${PN} + ln -s ../../wpa_supplicant/ifupdown.sh ${D}${sysconfdir}/network/if-up.d/${PN} +} + +FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" diff --git a/meta-openpli/recipes-connectivity/zd1211/zd1211b/cross_compile.patch b/meta-openpli/recipes-connectivity/zd1211/zd1211b/cross_compile.patch new file mode 100644 index 0000000000..cb6a003b2d --- /dev/null +++ b/meta-openpli/recipes-connectivity/zd1211/zd1211b/cross_compile.patch @@ -0,0 +1,41 @@ +Index: ZD1211LnxDrv_2_22_0_0/Makefile +=================================================================== +--- ZD1211LnxDrv_2_22_0_0.orig/Makefile 2010-12-13 15:10:36.000000000 +0000 ++++ ZD1211LnxDrv_2_22_0_0/Makefile 2010-12-13 15:13:30.000000000 +0000 +@@ -5,10 +5,10 @@ + # + + HOST= +-CC=$(HOST)gcc +-LD=$(HOST)ld +-KERN_VER=$(shell uname -r | cut -b1-3;) +-KDIR := /lib/modules/$(shell uname -r)/build ++CC?=$(HOST)gcc ++LD?=$(HOST)ld ++KERN_VER ?= $(shell uname -r | cut -b1-3;) ++KDIR ?= /lib/modules/$(shell uname -r)/build + PWD := $(shell pwd) + + SUBDIRS=. +@@ -17,10 +17,10 @@ + + ifeq ($(KERN_VER), 2.6) + KERN_26=y +- KERNEL_SOURCE=/usr/src/linux-2.6.9 ++ KERNEL_SOURCE?=/usr/src/linux-2.6.9 + else + KERN_24=y +- KERNEL_SOURCE=/usr/src/linux-2.4 ++ KERNEL_SOURCE?=/usr/src/linux-2.4 + endif + + SRC_DIR=src +@@ -28,7 +28,7 @@ + + + KERNRELEASE := $(shell uname -r;) +-MODPATH := /lib/modules/$(KERNRELEASE) ++MODPATH ?= /lib/modules/$(KERNRELEASE) + + + diff --git a/meta-openpli/recipes-connectivity/zd1211/zd1211b/zdiface.patch b/meta-openpli/recipes-connectivity/zd1211/zd1211b/zdiface.patch new file mode 100644 index 0000000000..da51ae7f11 --- /dev/null +++ b/meta-openpli/recipes-connectivity/zd1211/zd1211b/zdiface.patch @@ -0,0 +1,12 @@ +diff -Naur org/src/zdusb.c patched/src/zdusb.c +--- org/src/zdusb.c 2007-11-06 13:06:36.000000000 +0100 ++++ patched/src/zdusb.c 2008-08-19 12:44:48.000000000 +0200 +@@ -371,6 +371,8 @@ + g_dev = net; //save this for CBs use + //macp = net->priv; //kernel 2.4 + net->priv = macp; //kernel 2.6 ++ /* ath_desc: use /dev/wlanX as device node */ ++ strcpy(net->name, "wlan%d"); + macp->device = net; + macp->usb = dev; + SET_MODULE_OWNER(net); diff --git a/meta-openpli/recipes-connectivity/zd1211/zd1211b_2.22.0.0.bb b/meta-openpli/recipes-connectivity/zd1211/zd1211b_2.22.0.0.bb new file mode 100644 index 0000000000..ad7effa05a --- /dev/null +++ b/meta-openpli/recipes-connectivity/zd1211/zd1211b_2.22.0.0.bb @@ -0,0 +1,32 @@ +SUMMARY = "Driver for zd1211b family of wireless USB Dongles" +HOMEPAGE = "http://zd1211.ath.cx/" +SECTION = "kernel/modules" +LICENSE = "MPL-1.1 | GPLv2" +LIC_FILES_CHKSUM = "file://src/zd1211.c;endline=31;md5=76cb7cb1283c3b6e20de40280a74f87f" +RDEPENDS = "wireless-tools" + +inherit module + +PR = "r3" + +SRC_URI = " \ + http://www.reactivated.net/software/zd1211-vendor/releases/ZD1211LnxDrv_2_22_0_0.tar.gz \ + file://cross_compile.patch \ + file://zdiface.patch \ +" + +SRC_URI[md5sum] = "0ac1145f1f30d883694b4a1317f142c4" +SRC_URI[sha256sum] = "262f44f0d1274d2baf6548e53df96c6664b076f39e3aaeeb022bbd5caccbe3e3" + +S = "${WORKDIR}/ZD1211LnxDrv_2_22_0_0" + +do_compile() { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake KERN_VER=2.6 KDIR=${STAGING_KERNEL_DIR} KERNEL_SOURCE=${STAGING_KERNEL_DIR} \ + MODPATH=${D}${base_libdir}/modules/${KERNEL_VERSION} ZD1211REV_B=1 +} + +do_install() { + install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net + install -m 0644 ${S}/zd1211*${KERNEL_OBJECT_SUFFIX} ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net +} diff --git a/meta-openpli/recipes-connectivity/zeroconf/zeroconf_0.9.bbappend b/meta-openpli/recipes-connectivity/zeroconf/zeroconf_0.9.bbappend new file mode 100644 index 0000000000..3a1e022691 --- /dev/null +++ b/meta-openpli/recipes-connectivity/zeroconf/zeroconf_0.9.bbappend @@ -0,0 +1,5 @@ +PRINC = "1" + +do_install_append() { + sed -e 's,^#FALLBACK=yes,FALLBACK=yes,' -i ${D}${sysconfdir}/default/zeroconf +} diff --git a/meta-openpli/recipes-core/base-files/base-files/fstab b/meta-openpli/recipes-core/base-files/base-files/fstab new file mode 100644 index 0000000000..cb49d84c96 --- /dev/null +++ b/meta-openpli/recipes-core/base-files/base-files/fstab @@ -0,0 +1,5 @@ +rootfs / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +usbdevfs /proc/bus/usb usbdevfs noauto 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 diff --git a/meta-openpli/recipes-core/base-files/base-files_3.0.14.bbappend b/meta-openpli/recipes-core/base-files/base-files_3.0.14.bbappend new file mode 100644 index 0000000000..7cac96ce88 --- /dev/null +++ b/meta-openpli/recipes-core/base-files/base-files_3.0.14.bbappend @@ -0,0 +1,13 @@ +PRINC = "1" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" + +do_install_append() { + rm -rf ${D}/mnt + rm -rf ${D}/hdd + ln -sf media/hdd ${D}/hdd + ln -sf media ${D}/mnt + rm -rf ${D}/media/* + rmdir ${D}/tmp + ln -s var/volatile/tmp ${D}/tmp +} diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-ifupdown-support-post-up-pre-down-hooks.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-ifupdown-support-post-up-pre-down-hooks.patch new file mode 100644 index 0000000000..f62fe0583c --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-ifupdown-support-post-up-pre-down-hooks.patch @@ -0,0 +1,60 @@ +From b58a1a06ca695aed6a4f6e5039e2de0e5a3df111 Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard +Date: Wed, 19 Oct 2011 02:35:54 +0200 +Subject: [PATCH 1/6] ifupdown: support post-up / pre-down hooks + +function old new delta +set_environ 330 371 +41 +ifupdown_main 2156 2194 +38 +iface_up 97 113 +16 +iface_down 97 113 +16 +------------------------------------------------------------------------------ +(add/remove: 0/0 grow/shrink: 4/0 up/down: 111/0) Total: 111 bytes + +Signed-off-by: Peter Korsgaard +Signed-off-by: Denys Vlasenko +--- + networking/ifupdown.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/networking/ifupdown.c b/networking/ifupdown.c +index 3820330..abc6b58 100644 +--- a/networking/ifupdown.c ++++ b/networking/ifupdown.c +@@ -891,6 +891,8 @@ static struct interfaces_file_t *read_interfaces(const char *filename) + if (strcmp(first_word, "up") != 0 + && strcmp(first_word, "down") != 0 + && strcmp(first_word, "pre-up") != 0 ++ && strcmp(first_word, "pre-down") != 0 ++ && strcmp(first_word, "post-up") != 0 + && strcmp(first_word, "post-down") != 0 + ) { + int i; +@@ -987,6 +989,8 @@ static void set_environ(struct interface_defn_t *iface, const char *mode) + if (strcmp(iface->option[i].name, "up") == 0 + || strcmp(iface->option[i].name, "down") == 0 + || strcmp(iface->option[i].name, "pre-up") == 0 ++ || strcmp(iface->option[i].name, "pre-down") == 0 ++ || strcmp(iface->option[i].name, "post-up") == 0 + || strcmp(iface->option[i].name, "post-down") == 0 + ) { + continue; +@@ -1056,6 +1060,7 @@ static int iface_up(struct interface_defn_t *iface) + if (!execute_all(iface, "pre-up")) return 0; + if (!iface->method->up(iface, doit)) return 0; + if (!execute_all(iface, "up")) return 0; ++ if (!execute_all(iface, "post-up")) return 0; + return 1; + } + +@@ -1063,6 +1068,7 @@ static int iface_down(struct interface_defn_t *iface) + { + if (!iface->method->down(iface,check)) return -1; + set_environ(iface, "stop"); ++ if (!execute_all(iface, "pre-down")) return 0; + if (!execute_all(iface, "down")) return 0; + if (!iface->method->down(iface, doit)) return 0; + if (!execute_all(iface, "post-down")) return 0; +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-work-around-linux-ext2_fs.h-breakage.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-work-around-linux-ext2_fs.h-breakage.patch new file mode 100644 index 0000000000..fa2e237441 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0001-work-around-linux-ext2_fs.h-breakage.patch @@ -0,0 +1,50 @@ +From caf5768154301697430f0a3718838967d0f55f95 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Thu, 12 Apr 2012 14:01:10 +0200 +Subject: [PATCH 01/33] work around linux/ext2_fs.h breakage + +See https://bugzilla.kernel.org/show_bug.cgi?id=42986 + +Signed-off-by: Denys Vlasenko +--- + e2fsprogs/tune2fs.c | 6 ++++++ + util-linux/mkfs_ext2.c | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c +index 020bdaa..8da7432 100644 +--- a/e2fsprogs/tune2fs.c ++++ b/e2fsprogs/tune2fs.c +@@ -8,6 +8,12 @@ + */ + #include "libbb.h" + #include ++/* ++ * Work around linux/ext2_fs.h breakage. ++ * See https://bugzilla.kernel.org/show_bug.cgi?id=42986. ++ */ ++typedef mode_t bb__umode_t; ++#define umode_t bb__umode_t + #include + + // storage helpers +diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c +index 6cbbe0e..759bb0a 100644 +--- a/util-linux/mkfs_ext2.c ++++ b/util-linux/mkfs_ext2.c +@@ -48,6 +48,12 @@ + + #include "libbb.h" + #include ++/* ++ * Work around linux/ext2_fs.h breakage. ++ * See https://bugzilla.kernel.org/show_bug.cgi?id=42986. ++ */ ++typedef mode_t bb__umode_t; ++#define umode_t bb__umode_t + #include + + #define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0 +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-Create-and-use-our-own-copy-of-linux-ext2_fs.h.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-Create-and-use-our-own-copy-of-linux-ext2_fs.h.patch new file mode 100644 index 0000000000..f9de87f631 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-Create-and-use-our-own-copy-of-linux-ext2_fs.h.patch @@ -0,0 +1,607 @@ +From 0b2b0f31a38d77ebfb2a6416011562687ef58191 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Fri, 13 Apr 2012 16:39:18 +0200 +Subject: [PATCH 01/32] Create and use our own copy of linux/ext2_fs.h + +Signed-off-by: Denys Vlasenko +--- + e2fsprogs/tune2fs.c | 8 +- + include/bb_linux_ext2_fs.h | 547 ++++++++++++++++++++++++++++++++++++++++++++ + util-linux/mkfs_ext2.c | 8 +- + 3 files changed, 549 insertions(+), 14 deletions(-) + create mode 100644 include/bb_linux_ext2_fs.h + +diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c +index 8da7432..841d58a 100644 +--- a/e2fsprogs/tune2fs.c ++++ b/e2fsprogs/tune2fs.c +@@ -8,13 +8,7 @@ + */ + #include "libbb.h" + #include +-/* +- * Work around linux/ext2_fs.h breakage. +- * See https://bugzilla.kernel.org/show_bug.cgi?id=42986. +- */ +-typedef mode_t bb__umode_t; +-#define umode_t bb__umode_t +-#include ++#include "bb_linux_ext2_fs.h" + + // storage helpers + char BUG_wrong_field_size(void); +diff --git a/include/bb_linux_ext2_fs.h b/include/bb_linux_ext2_fs.h +new file mode 100644 +index 0000000..fdc470b +--- /dev/null ++++ b/include/bb_linux_ext2_fs.h +@@ -0,0 +1,547 @@ ++/* ++ * Work around linux/ext2_fs.h breakage. ++ * linux/ext2_fs.h might be removed from future kernel header distribution. ++ * See https://bugzilla.kernel.org/show_bug.cgi?id=42986 ++ * ++ * Licensed under GPLv2, see file LICENSE in this source tree. ++ */ ++#ifndef BB_LINUX_EXT2_FS_H ++#define BB_LINUX_EXT2_FS_H ++ ++/* ++ * From linux/magic.h ++ */ ++ ++#define EXT2_SUPER_MAGIC 0xEF53 ++#define EXT3_SUPER_MAGIC 0xEF53 ++#define EXT4_SUPER_MAGIC 0xEF53 ++ ++/* ++ * From linux/ext2_fs.h, with minor changes. ++ */ ++ ++/* ++ * Copyright (C) 1992, 1993, 1994, 1995 ++ * Remy Card (card@masi.ibp.fr) ++ * Laboratoire MASI - Institut Blaise Pascal ++ * Universite Pierre et Marie Curie (Paris VI) ++ * ++ * from ++ * ++ * linux/include/linux/minix_fs.h ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ */ ++ ++/* ++ * The second extended filesystem constants/structures ++ */ ++ ++/* ++ * Define EXT2_RESERVATION to reserve data blocks for expanding files ++ */ ++#define EXT2_DEFAULT_RESERVE_BLOCKS 8 ++/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ ++#define EXT2_MAX_RESERVE_BLOCKS 1027 ++#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0 ++ ++/* ++ * Special inode numbers ++ */ ++#define EXT2_BAD_INO 1 /* Bad blocks inode */ ++#define EXT2_ROOT_INO 2 /* Root inode */ ++#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ ++#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ ++ ++/* First non-reserved inode for old ext2 filesystems */ ++#define EXT2_GOOD_OLD_FIRST_INO 11 ++ ++/* Assume that user mode programs are passing in an ext2fs superblock, not ++ * a kernel struct super_block. This will allow us to call the feature-test ++ * macros from user land. */ ++#define EXT2_SB(sb) (sb) ++ ++/* ++ * Maximal count of links to a file ++ */ ++#define EXT2_LINK_MAX 32000 ++ ++/* ++ * Macro-instructions used to manage several block sizes ++ */ ++#define EXT2_MIN_BLOCK_SIZE 1024 ++#define EXT2_MAX_BLOCK_SIZE 4096 ++#define EXT2_MIN_BLOCK_LOG_SIZE 10 ++# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) ++#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (uint32_t)) ++# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) ++#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_INODE_SIZE : \ ++ (s)->s_inode_size) ++#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_FIRST_INO : \ ++ (s)->s_first_ino) ++ ++/* ++ * Macro-instructions used to manage fragments ++ */ ++#define EXT2_MIN_FRAG_SIZE 1024 ++#define EXT2_MAX_FRAG_SIZE 4096 ++#define EXT2_MIN_FRAG_LOG_SIZE 10 ++# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) ++# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) ++ ++/* ++ * Structure of a blocks group descriptor ++ */ ++struct ext2_group_desc ++{ ++ uint32_t bg_block_bitmap; /* Blocks bitmap block */ ++ uint32_t bg_inode_bitmap; /* Inodes bitmap block */ ++ uint32_t bg_inode_table; /* Inodes table block */ ++ uint16_t bg_free_blocks_count; /* Free blocks count */ ++ uint16_t bg_free_inodes_count; /* Free inodes count */ ++ uint16_t bg_used_dirs_count; /* Directories count */ ++ uint16_t bg_pad; ++ uint32_t bg_reserved[3]; ++}; ++ ++/* ++ * Macro-instructions used to manage group descriptors ++ */ ++# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) ++# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) ++# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group) ++ ++/* ++ * Constants relative to the data blocks ++ */ ++#define EXT2_NDIR_BLOCKS 12 ++#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS ++#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) ++#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) ++#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) ++ ++/* ++ * Inode flags (GETFLAGS/SETFLAGS) ++ */ ++#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ ++#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ ++#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ ++#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ ++#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ ++#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ ++#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ ++#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ ++/* Reserved for compression usage... */ ++#define EXT2_DIRTY_FL FS_DIRTY_FL ++#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ ++#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ ++#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ ++/* End compression flags --- maybe not all used */ ++#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ ++#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ ++#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ ++#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ ++#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ ++#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ ++#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ ++#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ ++ ++#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ ++#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ ++ ++/* Flags that should be inherited by new inodes from their parent. */ ++#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ ++ EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ ++ EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ ++ EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ ++ EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) ++ ++/* Flags that are appropriate for regular files (all but dir-specific ones). */ ++#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL)) ++ ++/* Flags that are appropriate for non-directories/regular files. */ ++#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) ++ ++/* Mask out flags that are inappropriate for the given type of inode. */ ++static inline uint32_t ext2_mask_flags(mode_t mode, uint32_t flags) ++{ ++ if (S_ISDIR(mode)) ++ return flags; ++ else if (S_ISREG(mode)) ++ return flags & EXT2_REG_FLMASK; ++ else ++ return flags & EXT2_OTHER_FLMASK; ++} ++ ++/* ++ * ioctl commands ++ */ ++#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS ++#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS ++#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION ++#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION ++#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long) ++#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long) ++ ++/* ++ * ioctl commands in 32 bit emulation ++ */ ++#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS ++#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS ++#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION ++#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION ++ ++/* ++ * Structure of an inode on the disk ++ */ ++struct ext2_inode { ++ uint16_t i_mode; /* File mode */ ++ uint16_t i_uid; /* Low 16 bits of Owner Uid */ ++ uint32_t i_size; /* Size in bytes */ ++ uint32_t i_atime; /* Access time */ ++ uint32_t i_ctime; /* Creation time */ ++ uint32_t i_mtime; /* Modification time */ ++ uint32_t i_dtime; /* Deletion Time */ ++ uint16_t i_gid; /* Low 16 bits of Group Id */ ++ uint16_t i_links_count; /* Links count */ ++ uint32_t i_blocks; /* Blocks count */ ++ uint32_t i_flags; /* File flags */ ++ union { ++ struct { ++ uint32_t l_i_reserved1; ++ } linux1; ++ struct { ++ uint32_t h_i_translator; ++ } hurd1; ++ struct { ++ uint32_t m_i_reserved1; ++ } masix1; ++ } osd1; /* OS dependent 1 */ ++ uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ ++ uint32_t i_generation; /* File version (for NFS) */ ++ uint32_t i_file_acl; /* File ACL */ ++ uint32_t i_dir_acl; /* Directory ACL */ ++ uint32_t i_faddr; /* Fragment address */ ++ union { ++ struct { ++ uint8_t l_i_frag; /* Fragment number */ ++ uint8_t l_i_fsize; /* Fragment size */ ++ uint16_t i_pad1; ++ uint16_t l_i_uid_high; /* these 2 fields */ ++ uint16_t l_i_gid_high; /* were reserved2[0] */ ++ uint32_t l_i_reserved2; ++ } linux2; ++ struct { ++ uint8_t h_i_frag; /* Fragment number */ ++ uint8_t h_i_fsize; /* Fragment size */ ++ uint16_t h_i_mode_high; ++ uint16_t h_i_uid_high; ++ uint16_t h_i_gid_high; ++ uint32_t h_i_author; ++ } hurd2; ++ struct { ++ uint8_t m_i_frag; /* Fragment number */ ++ uint8_t m_i_fsize; /* Fragment size */ ++ uint16_t m_pad1; ++ uint32_t m_i_reserved2[2]; ++ } masix2; ++ } osd2; /* OS dependent 2 */ ++}; ++ ++#define i_size_high i_dir_acl ++ ++#if defined(__KERNEL__) || defined(__linux__) ++#define i_reserved1 osd1.linux1.l_i_reserved1 ++#define i_frag osd2.linux2.l_i_frag ++#define i_fsize osd2.linux2.l_i_fsize ++#define i_uid_low i_uid ++#define i_gid_low i_gid ++#define i_uid_high osd2.linux2.l_i_uid_high ++#define i_gid_high osd2.linux2.l_i_gid_high ++#define i_reserved2 osd2.linux2.l_i_reserved2 ++#endif ++ ++#ifdef __hurd__ ++#define i_translator osd1.hurd1.h_i_translator ++#define i_frag osd2.hurd2.h_i_frag ++#define i_fsize osd2.hurd2.h_i_fsize ++#define i_uid_high osd2.hurd2.h_i_uid_high ++#define i_gid_high osd2.hurd2.h_i_gid_high ++#define i_author osd2.hurd2.h_i_author ++#endif ++ ++#ifdef __masix__ ++#define i_reserved1 osd1.masix1.m_i_reserved1 ++#define i_frag osd2.masix2.m_i_frag ++#define i_fsize osd2.masix2.m_i_fsize ++#define i_reserved2 osd2.masix2.m_i_reserved2 ++#endif ++ ++/* ++ * File system states ++ */ ++#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ ++#define EXT2_ERROR_FS 0x0002 /* Errors detected */ ++ ++/* ++ * Mount flags ++ */ ++#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ ++#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ ++#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ ++#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ ++#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */ ++#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */ ++#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */ ++#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */ ++#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */ ++#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ ++#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ ++#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ ++#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ ++#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ ++#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ ++#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ ++ ++ ++#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt ++#define set_opt(o, opt) o |= EXT2_MOUNT_##opt ++#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ ++ EXT2_MOUNT_##opt) ++/* ++ * Maximal mount counts between two filesystem checks ++ */ ++#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ ++#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ ++ ++/* ++ * Behaviour when detecting errors ++ */ ++#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ ++#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ ++#define EXT2_ERRORS_PANIC 3 /* Panic */ ++#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE ++ ++/* ++ * Structure of the super block ++ */ ++struct ext2_super_block { ++ uint32_t s_inodes_count; /* Inodes count */ ++ uint32_t s_blocks_count; /* Blocks count */ ++ uint32_t s_r_blocks_count; /* Reserved blocks count */ ++ uint32_t s_free_blocks_count; /* Free blocks count */ ++ uint32_t s_free_inodes_count; /* Free inodes count */ ++ uint32_t s_first_data_block; /* First Data Block */ ++ uint32_t s_log_block_size; /* Block size */ ++ uint32_t s_log_frag_size; /* Fragment size */ ++ uint32_t s_blocks_per_group; /* # Blocks per group */ ++ uint32_t s_frags_per_group; /* # Fragments per group */ ++ uint32_t s_inodes_per_group; /* # Inodes per group */ ++ uint32_t s_mtime; /* Mount time */ ++ uint32_t s_wtime; /* Write time */ ++ uint16_t s_mnt_count; /* Mount count */ ++ uint16_t s_max_mnt_count; /* Maximal mount count */ ++ uint16_t s_magic; /* Magic signature */ ++ uint16_t s_state; /* File system state */ ++ uint16_t s_errors; /* Behaviour when detecting errors */ ++ uint16_t s_minor_rev_level; /* minor revision level */ ++ uint32_t s_lastcheck; /* time of last check */ ++ uint32_t s_checkinterval; /* max. time between checks */ ++ uint32_t s_creator_os; /* OS */ ++ uint32_t s_rev_level; /* Revision level */ ++ uint16_t s_def_resuid; /* Default uid for reserved blocks */ ++ uint16_t s_def_resgid; /* Default gid for reserved blocks */ ++ /* ++ * These fields are for EXT2_DYNAMIC_REV superblocks only. ++ * ++ * Note: the difference between the compatible feature set and ++ * the incompatible feature set is that if there is a bit set ++ * in the incompatible feature set that the kernel doesn't ++ * know about, it should refuse to mount the filesystem. ++ * ++ * e2fsck's requirements are more strict; if it doesn't know ++ * about a feature in either the compatible or incompatible ++ * feature set, it must abort and not try to meddle with ++ * things it doesn't understand... ++ */ ++ uint32_t s_first_ino; /* First non-reserved inode */ ++ uint16_t s_inode_size; /* size of inode structure */ ++ uint16_t s_block_group_nr; /* block group # of this superblock */ ++ uint32_t s_feature_compat; /* compatible feature set */ ++ uint32_t s_feature_incompat; /* incompatible feature set */ ++ uint32_t s_feature_ro_compat; /* readonly-compatible feature set */ ++ uint8_t s_uuid[16]; /* 128-bit uuid for volume */ ++ char s_volume_name[16]; /* volume name */ ++ char s_last_mounted[64]; /* directory where last mounted */ ++ uint32_t s_algorithm_usage_bitmap; /* For compression */ ++ /* ++ * Performance hints. Directory preallocation should only ++ * happen if the EXT2_COMPAT_PREALLOC flag is on. ++ */ ++ uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ ++ uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ ++ uint16_t s_padding1; ++ /* ++ * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. ++ */ ++ uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ ++ uint32_t s_journal_inum; /* inode number of journal file */ ++ uint32_t s_journal_dev; /* device number of journal file */ ++ uint32_t s_last_orphan; /* start of list of inodes to delete */ ++ uint32_t s_hash_seed[4]; /* HTREE hash seed */ ++ uint8_t s_def_hash_version; /* Default hash version to use */ ++ uint8_t s_reserved_char_pad; ++ uint16_t s_reserved_word_pad; ++ uint32_t s_default_mount_opts; ++ uint32_t s_first_meta_bg; /* First metablock block group */ ++ uint32_t s_reserved[190]; /* Padding to the end of the block */ ++}; ++ ++/* ++ * Codes for operating systems ++ */ ++#define EXT2_OS_LINUX 0 ++#define EXT2_OS_HURD 1 ++#define EXT2_OS_MASIX 2 ++#define EXT2_OS_FREEBSD 3 ++#define EXT2_OS_LITES 4 ++ ++/* ++ * Revision levels ++ */ ++#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ ++#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ ++ ++#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV ++#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV ++ ++#define EXT2_GOOD_OLD_INODE_SIZE 128 ++ ++/* ++ * Feature set definitions ++ */ ++ ++#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) ++#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) ++#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) ++#define EXT2_SET_COMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) ++#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask) ++#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask) ++#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask) ++#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask) ++#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ ++ EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask) ++ ++#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 ++#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 ++#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 ++#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 ++#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 ++#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 ++#define EXT2_FEATURE_COMPAT_ANY 0xffffffff ++ ++#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 ++#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 ++#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 ++#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff ++ ++#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 ++#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 ++#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 ++#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 ++#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 ++#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff ++ ++#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR ++#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ ++ EXT2_FEATURE_INCOMPAT_META_BG) ++#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ ++ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ ++ EXT2_FEATURE_RO_COMPAT_BTREE_DIR) ++#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP ++#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP ++ ++/* ++ * Default values for user and/or group using reserved blocks ++ */ ++#define EXT2_DEF_RESUID 0 ++#define EXT2_DEF_RESGID 0 ++ ++/* ++ * Default mount options ++ */ ++#define EXT2_DEFM_DEBUG 0x0001 ++#define EXT2_DEFM_BSDGROUPS 0x0002 ++#define EXT2_DEFM_XATTR_USER 0x0004 ++#define EXT2_DEFM_ACL 0x0008 ++#define EXT2_DEFM_UID16 0x0010 ++ /* Not used by ext2, but reserved for use by ext3 */ ++#define EXT3_DEFM_JMODE 0x0060 ++#define EXT3_DEFM_JMODE_DATA 0x0020 ++#define EXT3_DEFM_JMODE_ORDERED 0x0040 ++#define EXT3_DEFM_JMODE_WBACK 0x0060 ++ ++/* ++ * Structure of a directory entry ++ */ ++#define EXT2_NAME_LEN 255 ++ ++struct ext2_dir_entry { ++ uint32_t inode; /* Inode number */ ++ uint16_t rec_len; /* Directory entry length */ ++ uint16_t name_len; /* Name length */ ++ char name[EXT2_NAME_LEN]; /* File name */ ++}; ++ ++/* ++ * The new version of the directory entry. Since EXT2 structures are ++ * stored in intel byte order, and the name_len field could never be ++ * bigger than 255 chars, it's safe to reclaim the extra byte for the ++ * file_type field. ++ */ ++struct ext2_dir_entry_2 { ++ uint32_t inode; /* Inode number */ ++ uint16_t rec_len; /* Directory entry length */ ++ uint8_t name_len; /* Name length */ ++ uint8_t file_type; ++ char name[EXT2_NAME_LEN]; /* File name */ ++}; ++ ++/* ++ * Ext2 directory file types. Only the low 3 bits are used. The ++ * other bits are reserved for now. ++ */ ++enum { ++ EXT2_FT_UNKNOWN = 0, ++ EXT2_FT_REG_FILE = 1, ++ EXT2_FT_DIR = 2, ++ EXT2_FT_CHRDEV = 3, ++ EXT2_FT_BLKDEV = 4, ++ EXT2_FT_FIFO = 5, ++ EXT2_FT_SOCK = 6, ++ EXT2_FT_SYMLINK = 7, ++ EXT2_FT_MAX ++}; ++ ++/* ++ * EXT2_DIR_PAD defines the directory entries boundaries ++ * ++ * NOTE: It must be a multiple of 4 ++ */ ++#define EXT2_DIR_PAD 4 ++#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) ++#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ++ ~EXT2_DIR_ROUND) ++#define EXT2_MAX_REC_LEN ((1<<16)-1) ++ ++#endif +diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c +index 759bb0a..2d9d720 100644 +--- a/util-linux/mkfs_ext2.c ++++ b/util-linux/mkfs_ext2.c +@@ -48,13 +48,7 @@ + + #include "libbb.h" + #include +-/* +- * Work around linux/ext2_fs.h breakage. +- * See https://bugzilla.kernel.org/show_bug.cgi?id=42986. +- */ +-typedef mode_t bb__umode_t; +-#define umode_t bb__umode_t +-#include ++#include "bb_linux_ext2_fs.h" + + #define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0 + #define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1 +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-ifupdown-code-shrink.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-ifupdown-code-shrink.patch new file mode 100644 index 0000000000..d0ca655773 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0002-ifupdown-code-shrink.patch @@ -0,0 +1,122 @@ +From e5221a142e8ee4509734c17584f898a1f4ac86cc Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Wed, 19 Oct 2011 02:37:08 +0200 +Subject: [PATCH 2/6] ifupdown: code shrink + +function old new delta +keywords_up_down - 43 +43 +set_environ 371 259 -112 +ifupdown_main 2194 2073 -121 +------------------------------------------------------------------------------ +(add/remove: 1/0 grow/shrink: 0/2 up/down: 43/-233) Total: -190 bytes + +Signed-off-by: Denys Vlasenko +--- + networking/ifupdown.c | 42 +++++++++++++++--------------------------- + 1 file changed, 15 insertions(+), 27 deletions(-) + +diff --git a/networking/ifupdown.c b/networking/ifupdown.c +index abc6b58..5946323 100644 +--- a/networking/ifupdown.c ++++ b/networking/ifupdown.c +@@ -87,7 +87,6 @@ struct mapping_defn_t { + + char *script; + +- int max_mappings; + int n_mappings; + char **mapping; + }; +@@ -102,7 +101,6 @@ struct interface_defn_t { + const struct method_t *method; + + char *iface; +- int max_options; + int n_options; + struct variable_t *option; + }; +@@ -138,6 +136,16 @@ struct globals { + #define INIT_G() do { } while (0) + + ++static const char keywords_up_down[] ALIGN1 = ++ "up\0" ++ "down\0" ++ "pre-up\0" ++ "pre-down\0" ++ "post-up\0" ++ "post-down\0" ++; ++ ++ + #if ENABLE_FEATURE_IFUPDOWN_IPV4 || ENABLE_FEATURE_IFUPDOWN_IPV6 + + static void addstr(char **bufp, const char *str, size_t str_length) +@@ -803,7 +811,6 @@ static struct interfaces_file_t *read_interfaces(const char *filename) + currmap->match = xrealloc_vector(currmap->match, 4, currmap->n_matches); + currmap->match[currmap->n_matches++] = xstrdup(first_word); + } +- /*currmap->max_mappings = 0; - done by xzalloc */ + /*currmap->n_mappings = 0;*/ + /*currmap->mapping = NULL;*/ + /*currmap->script = NULL;*/ +@@ -888,25 +895,16 @@ static struct interfaces_file_t *read_interfaces(const char *filename) + if (rest_of_line[0] == '\0') + bb_error_msg_and_die("option with empty value \"%s\"", buf); + +- if (strcmp(first_word, "up") != 0 +- && strcmp(first_word, "down") != 0 +- && strcmp(first_word, "pre-up") != 0 +- && strcmp(first_word, "pre-down") != 0 +- && strcmp(first_word, "post-up") != 0 +- && strcmp(first_word, "post-down") != 0 +- ) { ++ /* If not one of "up", "down",... words... */ ++ if (index_in_strings(keywords_up_down, first_word) < 0) { + int i; + for (i = 0; i < currif->n_options; i++) { + if (strcmp(currif->option[i].name, first_word) == 0) + bb_error_msg_and_die("duplicate option \"%s\"", buf); + } + } +- if (currif->n_options >= currif->max_options) { +- currif->max_options += 10; +- currif->option = xrealloc(currif->option, +- sizeof(*currif->option) * currif->max_options); +- } + debug_noise("\t%s=%s\n", first_word, rest_of_line); ++ currif->option = xrealloc_vector(currif->option, 4, currif->n_options); + currif->option[currif->n_options].name = xstrdup(first_word); + currif->option[currif->n_options].value = xstrdup(rest_of_line); + currif->n_options++; +@@ -918,11 +916,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename) + bb_error_msg_and_die("duplicate script in mapping \"%s\"", buf); + currmap->script = xstrdup(next_word(&rest_of_line)); + } else if (strcmp(first_word, "map") == 0) { +- if (currmap->n_mappings >= currmap->max_mappings) { +- currmap->max_mappings = currmap->max_mappings * 2 + 1; +- currmap->mapping = xrealloc(currmap->mapping, +- sizeof(char *) * currmap->max_mappings); +- } ++ currmap->mapping = xrealloc_vector(currmap->mapping, 2, currmap->n_mappings); + currmap->mapping[currmap->n_mappings] = xstrdup(next_word(&rest_of_line)); + currmap->n_mappings++; + } else { +@@ -986,13 +980,7 @@ static void set_environ(struct interface_defn_t *iface, const char *mode) + pp = G.my_environ; + + for (i = 0; i < iface->n_options; i++) { +- if (strcmp(iface->option[i].name, "up") == 0 +- || strcmp(iface->option[i].name, "down") == 0 +- || strcmp(iface->option[i].name, "pre-up") == 0 +- || strcmp(iface->option[i].name, "pre-down") == 0 +- || strcmp(iface->option[i].name, "post-up") == 0 +- || strcmp(iface->option[i].name, "post-down") == 0 +- ) { ++ if (index_in_strings(keywords_up_down, iface->option[i].name) >= 0) { + continue; + } + *pp++ = setlocalenv("IF_%s=%s", iface->option[i].name, iface->option[i].value); +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-Drop-include-bb_linux_ext2_fs.h-use-existing-e2fspro.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-Drop-include-bb_linux_ext2_fs.h-use-existing-e2fspro.patch new file mode 100644 index 0000000000..2a3b21b95f --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-Drop-include-bb_linux_ext2_fs.h-use-existing-e2fspro.patch @@ -0,0 +1,1877 @@ +From 176bc344751dfc41e87976182381ae0560c94f22 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Tue, 17 Apr 2012 15:06:55 +0200 +Subject: [PATCH 04/32] Drop include/bb_linux_ext2_fs.h, use existing + e2fsprogs/e2fs_defs.h + +Signed-off-by: Denys Vlasenko +--- + e2fsprogs/e2fs_defs.h | 561 --------------------------- + e2fsprogs/e2fs_lib.h | 2 +- + e2fsprogs/old_e2fsprogs/e2fsck.c | 6 +- + e2fsprogs/old_e2fsprogs/e2p/feature.c | 2 +- + e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h | 2 +- + e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h | 2 +- + e2fsprogs/old_e2fsprogs/ext2fs/initialize.c | 2 +- + e2fsprogs/old_e2fsprogs/mke2fs.c | 8 +- + e2fsprogs/tune2fs.c | 2 +- + include/bb_e2fs_defs.h | 561 +++++++++++++++++++++++++++ + include/bb_linux_ext2_fs.h | 547 -------------------------- + util-linux/mkfs_ext2.c | 2 +- + 12 files changed, 575 insertions(+), 1122 deletions(-) + delete mode 100644 e2fsprogs/e2fs_defs.h + create mode 100644 include/bb_e2fs_defs.h + delete mode 100644 include/bb_linux_ext2_fs.h + +diff --git a/e2fsprogs/e2fs_defs.h b/e2fsprogs/e2fs_defs.h +deleted file mode 100644 +index 379640e..0000000 +--- a/e2fsprogs/e2fs_defs.h ++++ /dev/null +@@ -1,561 +0,0 @@ +-/* vi: set sw=4 ts=4: */ +-/* +- * linux/include/linux/ext2_fs.h +- * +- * Copyright (C) 1992, 1993, 1994, 1995 +- * Remy Card (card@masi.ibp.fr) +- * Laboratoire MASI - Institut Blaise Pascal +- * Universite Pierre et Marie Curie (Paris VI) +- * +- * Copyright (C) 1991, 1992 Linus Torvalds +- */ +- +-#ifndef LINUX_EXT2_FS_H +-#define LINUX_EXT2_FS_H 1 +- +-/* +- * Special inode numbers +- */ +-#define EXT2_BAD_INO 1 /* Bad blocks inode */ +-#define EXT2_ROOT_INO 2 /* Root inode */ +-#define EXT2_ACL_IDX_INO 3 /* ACL inode */ +-#define EXT2_ACL_DATA_INO 4 /* ACL inode */ +-#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ +-#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ +-#define EXT2_RESIZE_INO 7 /* Reserved group descriptors inode */ +-#define EXT2_JOURNAL_INO 8 /* Journal inode */ +- +-/* First non-reserved inode for old ext2 filesystems */ +-#define EXT2_GOOD_OLD_FIRST_INO 11 +- +-/* +- * The second extended file system magic number +- */ +-#define EXT2_SUPER_MAGIC 0xEF53 +- +-/* Assume that user mode programs are passing in an ext2fs superblock, not +- * a kernel struct super_block. This will allow us to call the feature-test +- * macros from user land. */ +-#define EXT2_SB(sb) (sb) +- +-/* +- * Maximal count of links to a file +- */ +-#define EXT2_LINK_MAX 32000 +- +-/* +- * Macro-instructions used to manage several block sizes +- */ +-#define EXT2_MIN_BLOCK_LOG_SIZE 10 /* 1024 */ +-#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 65536 */ +-#define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) +-#define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) +-#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) +-#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) +-#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ +- EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size) +-#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ +- EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino) +-#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(uint32_t)) +- +-/* +- * Macro-instructions used to manage fragments +- */ +-#define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE +-#define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE +-#define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE +-#define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) +-#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) +- +-/* +- * ACL structures +- */ +-struct ext2_acl_header { /* Header of Access Control Lists */ +- uint32_t aclh_size; +- uint32_t aclh_file_count; +- uint32_t aclh_acle_count; +- uint32_t aclh_first_acle; +-}; +- +-struct ext2_acl_entry { /* Access Control List Entry */ +- uint32_t acle_size; +- uint16_t acle_perms; /* Access permissions */ +- uint16_t acle_type; /* Type of entry */ +- uint16_t acle_tag; /* User or group identity */ +- uint16_t acle_pad1; +- uint32_t acle_next; /* Pointer on next entry for the */ +- /* same inode or on next free entry */ +-}; +- +-/* +- * Structure of a blocks group descriptor +- */ +-struct ext2_group_desc { +- uint32_t bg_block_bitmap; /* Blocks bitmap block */ +- uint32_t bg_inode_bitmap; /* Inodes bitmap block */ +- uint32_t bg_inode_table; /* Inodes table block */ +- uint16_t bg_free_blocks_count; /* Free blocks count */ +- uint16_t bg_free_inodes_count; /* Free inodes count */ +- uint16_t bg_used_dirs_count; /* Directories count */ +- uint16_t bg_pad; +- uint32_t bg_reserved[3]; +-}; +- +-/* +- * Data structures used by the directory indexing feature +- * +- * Note: all of the multibyte integer fields are little endian. +- */ +- +-/* +- * Note: dx_root_info is laid out so that if it should somehow get +- * overlaid by a dirent the two low bits of the hash version will be +- * zero. Therefore, the hash version mod 4 should never be 0. +- * Sincerely, the paranoia department. +- */ +-struct ext2_dx_root_info { +- uint32_t reserved_zero; +- uint8_t hash_version; /* 0 now, 1 at release */ +- uint8_t info_length; /* 8 */ +- uint8_t indirect_levels; +- uint8_t unused_flags; +-}; +- +-#define EXT2_HASH_LEGACY 0 +-#define EXT2_HASH_HALF_MD4 1 +-#define EXT2_HASH_TEA 2 +- +-#define EXT2_HASH_FLAG_INCOMPAT 0x1 +- +-struct ext2_dx_entry { +- uint32_t hash; +- uint32_t block; +-}; +- +-struct ext2_dx_countlimit { +- uint16_t limit; +- uint16_t count; +-}; +- +- +-/* +- * Macro-instructions used to manage group descriptors +- */ +-#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) +-#define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) +-#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) +-/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */ +-#define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8) +-#define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s)) +-#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) +- +-/* +- * Constants relative to the data blocks +- */ +-#define EXT2_NDIR_BLOCKS 12 +-#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS +-#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) +-#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) +-#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) +- +-/* +- * Inode flags +- */ +-#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ +-#define EXT2_UNRM_FL 0x00000002 /* Undelete */ +-#define EXT2_COMPR_FL 0x00000004 /* Compress file */ +-#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ +-#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ +-#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ +-#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ +-#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ +-/* Reserved for compression usage... */ +-#define EXT2_DIRTY_FL 0x00000100 +-#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ +-#define EXT2_NOCOMPR_FL 0x00000400 /* Access raw compressed data */ +-#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ +-/* End compression flags --- maybe not all used */ +-#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ +-#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ +-#define EXT2_IMAGIC_FL 0x00002000 +-#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */ +-#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ +-#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */ +-#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ +-#define EXT3_EXTENTS_FL 0x00080000 /* Inode uses extents */ +-#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ +- +-#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ +-#define EXT2_FL_USER_MODIFIABLE 0x000080FF /* User modifiable flags */ +- +-/* +- * ioctl commands +- */ +-#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) +-#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) +-#define EXT2_IOC_GETVERSION _IOR('v', 1, long) +-#define EXT2_IOC_SETVERSION _IOW('v', 2, long) +- +-/* +- * Structure of an inode on the disk +- */ +-struct ext2_inode { +- uint16_t i_mode; /* File mode */ +- uint16_t i_uid; /* Low 16 bits of Owner Uid */ +- uint32_t i_size; /* Size in bytes */ +- uint32_t i_atime; /* Access time */ +- uint32_t i_ctime; /* Creation time */ +- uint32_t i_mtime; /* Modification time */ +- uint32_t i_dtime; /* Deletion Time */ +- uint16_t i_gid; /* Low 16 bits of Group Id */ +- uint16_t i_links_count; /* Links count */ +- uint32_t i_blocks; /* Blocks count */ +- uint32_t i_flags; /* File flags */ +- union { +- struct { +- uint32_t l_i_reserved1; +- } linux1; +- struct { +- uint32_t h_i_translator; +- } hurd1; +- struct { +- uint32_t m_i_reserved1; +- } masix1; +- } osd1; /* OS dependent 1 */ +- uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ +- uint32_t i_generation; /* File version (for NFS) */ +- uint32_t i_file_acl; /* File ACL */ +- uint32_t i_dir_acl; /* Directory ACL */ +- uint32_t i_faddr; /* Fragment address */ +- union { +- struct { +- uint8_t l_i_frag; /* Fragment number */ +- uint8_t l_i_fsize; /* Fragment size */ +- uint16_t i_pad1; +- uint16_t l_i_uid_high; /* these 2 fields */ +- uint16_t l_i_gid_high; /* were reserved2[0] */ +- uint32_t l_i_reserved2; +- } linux2; +- struct { +- uint8_t h_i_frag; /* Fragment number */ +- uint8_t h_i_fsize; /* Fragment size */ +- uint16_t h_i_mode_high; +- uint16_t h_i_uid_high; +- uint16_t h_i_gid_high; +- uint32_t h_i_author; +- } hurd2; +- struct { +- uint8_t m_i_frag; /* Fragment number */ +- uint8_t m_i_fsize; /* Fragment size */ +- uint16_t m_pad1; +- uint32_t m_i_reserved2[2]; +- } masix2; +- } osd2; /* OS dependent 2 */ +-}; +- +-/* +- * Permanent part of an large inode on the disk +- */ +-struct ext2_inode_large { +- uint16_t i_mode; /* File mode */ +- uint16_t i_uid; /* Low 16 bits of Owner Uid */ +- uint32_t i_size; /* Size in bytes */ +- uint32_t i_atime; /* Access time */ +- uint32_t i_ctime; /* Creation time */ +- uint32_t i_mtime; /* Modification time */ +- uint32_t i_dtime; /* Deletion Time */ +- uint16_t i_gid; /* Low 16 bits of Group Id */ +- uint16_t i_links_count; /* Links count */ +- uint32_t i_blocks; /* Blocks count */ +- uint32_t i_flags; /* File flags */ +- union { +- struct { +- uint32_t l_i_reserved1; +- } linux1; +- struct { +- uint32_t h_i_translator; +- } hurd1; +- struct { +- uint32_t m_i_reserved1; +- } masix1; +- } osd1; /* OS dependent 1 */ +- uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ +- uint32_t i_generation; /* File version (for NFS) */ +- uint32_t i_file_acl; /* File ACL */ +- uint32_t i_dir_acl; /* Directory ACL */ +- uint32_t i_faddr; /* Fragment address */ +- union { +- struct { +- uint8_t l_i_frag; /* Fragment number */ +- uint8_t l_i_fsize; /* Fragment size */ +- uint16_t i_pad1; +- uint16_t l_i_uid_high; /* these 2 fields */ +- uint16_t l_i_gid_high; /* were reserved2[0] */ +- uint32_t l_i_reserved2; +- } linux2; +- struct { +- uint8_t h_i_frag; /* Fragment number */ +- uint8_t h_i_fsize; /* Fragment size */ +- uint16_t h_i_mode_high; +- uint16_t h_i_uid_high; +- uint16_t h_i_gid_high; +- uint32_t h_i_author; +- } hurd2; +- struct { +- uint8_t m_i_frag; /* Fragment number */ +- uint8_t m_i_fsize; /* Fragment size */ +- uint16_t m_pad1; +- uint32_t m_i_reserved2[2]; +- } masix2; +- } osd2; /* OS dependent 2 */ +- uint16_t i_extra_isize; +- uint16_t i_pad1; +-}; +- +-#define i_size_high i_dir_acl +- +-/* +- * File system states +- */ +-#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ +-#define EXT2_ERROR_FS 0x0002 /* Errors detected */ +- +-/* +- * Mount flags +- */ +-#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */ +-#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */ +-#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */ +-#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ +-#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ +-#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ +-#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ +-#define EXT2_MOUNT_NO_UID32 0x0200 /* Disable 32-bit UIDs */ +- +-#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt +-#define set_opt(o, opt) o |= EXT2_MOUNT_##opt +-#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ +- EXT2_MOUNT_##opt) +-/* +- * Maximal mount counts between two filesystem checks +- */ +-#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ +-#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ +- +-/* +- * Behaviour when detecting errors +- */ +-#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ +-#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ +-#define EXT2_ERRORS_PANIC 3 /* Panic */ +-#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE +- +-/* +- * Structure of the super block +- */ +-struct ext2_super_block { +- uint32_t s_inodes_count; /* Inodes count */ +- uint32_t s_blocks_count; /* Blocks count */ +- uint32_t s_r_blocks_count; /* Reserved blocks count */ +- uint32_t s_free_blocks_count; /* Free blocks count */ +- uint32_t s_free_inodes_count; /* Free inodes count */ +- uint32_t s_first_data_block; /* First Data Block */ +- uint32_t s_log_block_size; /* Block size */ +- int32_t s_log_frag_size; /* Fragment size */ +- uint32_t s_blocks_per_group; /* # Blocks per group */ +- uint32_t s_frags_per_group; /* # Fragments per group */ +- uint32_t s_inodes_per_group; /* # Inodes per group */ +- uint32_t s_mtime; /* Mount time */ +- uint32_t s_wtime; /* Write time */ +- uint16_t s_mnt_count; /* Mount count */ +- int16_t s_max_mnt_count; /* Maximal mount count */ +- uint16_t s_magic; /* Magic signature */ +- uint16_t s_state; /* File system state */ +- uint16_t s_errors; /* Behaviour when detecting errors */ +- uint16_t s_minor_rev_level; /* minor revision level */ +- uint32_t s_lastcheck; /* time of last check */ +- uint32_t s_checkinterval; /* max. time between checks */ +- uint32_t s_creator_os; /* OS */ +- uint32_t s_rev_level; /* Revision level */ +- uint16_t s_def_resuid; /* Default uid for reserved blocks */ +- uint16_t s_def_resgid; /* Default gid for reserved blocks */ +- /* +- * These fields are for EXT2_DYNAMIC_REV superblocks only. +- * +- * Note: the difference between the compatible feature set and +- * the incompatible feature set is that if there is a bit set +- * in the incompatible feature set that the kernel doesn't +- * know about, it should refuse to mount the filesystem. +- * +- * e2fsck's requirements are more strict; if it doesn't know +- * about a feature in either the compatible or incompatible +- * feature set, it must abort and not try to meddle with +- * things it doesn't understand... +- */ +- uint32_t s_first_ino; /* First non-reserved inode */ +- uint16_t s_inode_size; /* size of inode structure */ +- uint16_t s_block_group_nr; /* block group # of this superblock */ +- uint32_t s_feature_compat; /* compatible feature set */ +- uint32_t s_feature_incompat; /* incompatible feature set */ +- uint32_t s_feature_ro_compat; /* readonly-compatible feature set */ +- uint8_t s_uuid[16]; /* 128-bit uuid for volume */ +- char s_volume_name[16]; /* volume name */ +- char s_last_mounted[64]; /* directory where last mounted */ +- uint32_t s_algorithm_usage_bitmap; /* For compression */ +- /* +- * Performance hints. Directory preallocation should only +- * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. +- */ +- uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ +- uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ +- uint16_t s_reserved_gdt_blocks; /* Per group table for online growth */ +- /* +- * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. +- */ +- uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ +- uint32_t s_journal_inum; /* inode number of journal file */ +- uint32_t s_journal_dev; /* device number of journal file */ +- uint32_t s_last_orphan; /* start of list of inodes to delete */ +- uint32_t s_hash_seed[4]; /* HTREE hash seed */ +- uint8_t s_def_hash_version; /* Default hash version to use */ +- uint8_t s_jnl_backup_type; /* Default type of journal backup */ +- uint16_t s_reserved_word_pad; +- uint32_t s_default_mount_opts; +- uint32_t s_first_meta_bg; /* First metablock group */ +- uint32_t s_mkfs_time; /* When the filesystem was created */ +- uint32_t s_jnl_blocks[17]; /* Backup of the journal inode */ +- uint32_t s_reserved[172]; /* Padding to the end of the block */ +-}; +- +-/* +- * Codes for operating systems +- */ +-#define EXT2_OS_LINUX 0 +-#define EXT2_OS_HURD 1 +-#define EXT2_OS_MASIX 2 +-#define EXT2_OS_FREEBSD 3 +-#define EXT2_OS_LITES 4 +- +-/* +- * Revision levels +- */ +-#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ +-#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ +- +-#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV +-#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV +- +-#define EXT2_GOOD_OLD_INODE_SIZE 128 +- +-/* +- * Journal inode backup types +- */ +-#define EXT3_JNL_BACKUP_BLOCKS 1 +- +-/* +- * Feature set definitions +- */ +- +-#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_feature_compat & (mask) ) +-#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) +-#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_feature_incompat & (mask) ) +- +-#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 +-#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 +-#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 +-#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 +-#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 +-#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 +- +-#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +-#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 +-/* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 not used */ +- +-#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 +-#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 +-#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ +-#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ +-#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 +-#define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 +- +- +-#define EXT2_FEATURE_COMPAT_SUPP 0 +-#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE) +-#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ +- EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ +- EXT2_FEATURE_RO_COMPAT_BTREE_DIR) +- +-/* +- * Default values for user and/or group using reserved blocks +- */ +-#define EXT2_DEF_RESUID 0 +-#define EXT2_DEF_RESGID 0 +- +-/* +- * Default mount options +- */ +-#define EXT2_DEFM_DEBUG 0x0001 +-#define EXT2_DEFM_BSDGROUPS 0x0002 +-#define EXT2_DEFM_XATTR_USER 0x0004 +-#define EXT2_DEFM_ACL 0x0008 +-#define EXT2_DEFM_UID16 0x0010 +-#define EXT3_DEFM_JMODE 0x0060 +-#define EXT3_DEFM_JMODE_DATA 0x0020 +-#define EXT3_DEFM_JMODE_ORDERED 0x0040 +-#define EXT3_DEFM_JMODE_WBACK 0x0060 +- +-/* +- * Structure of a directory entry +- */ +-#define EXT2_NAME_LEN 255 +- +-struct ext2_dir_entry { +- uint32_t inode; /* Inode number */ +- uint16_t rec_len; /* Directory entry length */ +- uint16_t name_len; /* Name length */ +- char name[EXT2_NAME_LEN]; /* File name */ +-}; +- +-/* +- * The new version of the directory entry. Since EXT2 structures are +- * stored in intel byte order, and the name_len field could never be +- * bigger than 255 chars, it's safe to reclaim the extra byte for the +- * file_type field. +- */ +-struct ext2_dir_entry_2 { +- uint32_t inode; /* Inode number */ +- uint16_t rec_len; /* Directory entry length */ +- uint8_t name_len; /* Name length */ +- uint8_t file_type; +- char name[EXT2_NAME_LEN]; /* File name */ +-}; +- +-/* +- * Ext2 directory file types. Only the low 3 bits are used. The +- * other bits are reserved for now. +- */ +-#define EXT2_FT_UNKNOWN 0 +-#define EXT2_FT_REG_FILE 1 +-#define EXT2_FT_DIR 2 +-#define EXT2_FT_CHRDEV 3 +-#define EXT2_FT_BLKDEV 4 +-#define EXT2_FT_FIFO 5 +-#define EXT2_FT_SOCK 6 +-#define EXT2_FT_SYMLINK 7 +- +-#define EXT2_FT_MAX 8 +- +-/* +- * EXT2_DIR_PAD defines the directory entries boundaries +- * +- * NOTE: It must be a multiple of 4 +- */ +-#define EXT2_DIR_PAD 4 +-#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) +-#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ +- ~EXT2_DIR_ROUND) +- +-#endif +diff --git a/e2fsprogs/e2fs_lib.h b/e2fsprogs/e2fs_lib.h +index 3905ee7..f2ae56f 100644 +--- a/e2fsprogs/e2fs_lib.h ++++ b/e2fsprogs/e2fs_lib.h +@@ -7,7 +7,7 @@ + */ + + /* Constants and structures */ +-#include "e2fs_defs.h" ++#include "bb_e2fs_defs.h" + + PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN + +diff --git a/e2fsprogs/old_e2fsprogs/e2fsck.c b/e2fsprogs/old_e2fsprogs/e2fsck.c +index 8fffa7f..373e8ce 100644 +--- a/e2fsprogs/old_e2fsprogs/e2fsck.c ++++ b/e2fsprogs/old_e2fsprogs/e2fsck.c +@@ -11577,7 +11577,7 @@ static void check_resize_inode(e2fsck_t ctx) + * s_reserved_gdt_blocks must be zero. + */ + if (!(fs->super->s_feature_compat & +- EXT2_FEATURE_COMPAT_RESIZE_INODE)) { ++ EXT2_FEATURE_COMPAT_RESIZE_INO)) { + if (fs->super->s_reserved_gdt_blocks) { + pctx.num = fs->super->s_reserved_gdt_blocks; + if (fix_problem(ctx, PR_0_NONZERO_RESERVED_GDT_BLOCKS, +@@ -11593,7 +11593,7 @@ static void check_resize_inode(e2fsck_t ctx) + retval = ext2fs_read_inode(fs, EXT2_RESIZE_INO, &inode); + if (retval) { + if (fs->super->s_feature_compat & +- EXT2_FEATURE_COMPAT_RESIZE_INODE) ++ EXT2_FEATURE_COMPAT_RESIZE_INO) + ctx->flags |= E2F_FLAG_RESIZE_INODE; + return; + } +@@ -11603,7 +11603,7 @@ static void check_resize_inode(e2fsck_t ctx) + * the resize inode is cleared; then we're done. + */ + if (!(fs->super->s_feature_compat & +- EXT2_FEATURE_COMPAT_RESIZE_INODE)) { ++ EXT2_FEATURE_COMPAT_RESIZE_INO)) { + for (i=0; i < EXT2_N_BLOCKS; i++) { + if (inode.i_block[i]) + break; +diff --git a/e2fsprogs/old_e2fsprogs/e2p/feature.c b/e2fsprogs/old_e2fsprogs/e2p/feature.c +index b45754f..2102ed8 100644 +--- a/e2fsprogs/old_e2fsprogs/e2p/feature.c ++++ b/e2fsprogs/old_e2fsprogs/e2p/feature.c +@@ -34,7 +34,7 @@ static const struct feature feature_list[] = { + "ext_attr" }, + { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX, + "dir_index" }, +- { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INODE, ++ { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INO, + "resize_inode" }, + { E2P_FEATURE_RO_INCOMPAT, EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER, + "sparse_super" }, +diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h +index 6f4f708..80ea2cb 100644 +--- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h ++++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h +@@ -475,7 +475,7 @@ struct ext2_super_block { + #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 + #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 + #define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 +-#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 ++#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 + #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 + + #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h +index 9f77201..39fb116 100644 +--- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h ++++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h +@@ -383,7 +383,7 @@ typedef struct ext2_icount *ext2_icount_t; + #define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\ + EXT2_FEATURE_COMPAT_IMAGIC_INODES|\ + EXT3_FEATURE_COMPAT_HAS_JOURNAL|\ +- EXT2_FEATURE_COMPAT_RESIZE_INODE|\ ++ EXT2_FEATURE_COMPAT_RESIZE_INO|\ + EXT2_FEATURE_COMPAT_DIR_INDEX|\ + EXT2_FEATURE_COMPAT_EXT_ATTR) + +diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/initialize.c b/e2fsprogs/old_e2fsprogs/ext2fs/initialize.c +index ef1d343..da2d151 100644 +--- a/e2fsprogs/old_e2fsprogs/ext2fs/initialize.c ++++ b/e2fsprogs/old_e2fsprogs/ext2fs/initialize.c +@@ -284,7 +284,7 @@ retry: + /* + * check the number of reserved group descriptor table blocks + */ +- if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) ++ if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO) + rsv_gdt = calc_reserved_gdt_blocks(fs); + else + rsv_gdt = 0; +diff --git a/e2fsprogs/old_e2fsprogs/mke2fs.c b/e2fsprogs/old_e2fsprogs/mke2fs.c +index 7555650..35d717a 100644 +--- a/e2fsprogs/old_e2fsprogs/mke2fs.c ++++ b/e2fsprogs/old_e2fsprogs/mke2fs.c +@@ -757,7 +757,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param, + + if (rsv_gdb > 0) { + sb_param->s_feature_compat |= +- EXT2_FEATURE_COMPAT_RESIZE_INODE; ++ EXT2_FEATURE_COMPAT_RESIZE_INO; + + sb_param->s_reserved_gdt_blocks = rsv_gdb; + } +@@ -778,7 +778,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param, + + static __u32 ok_features[3] = { + EXT3_FEATURE_COMPAT_HAS_JOURNAL | +- EXT2_FEATURE_COMPAT_RESIZE_INODE | ++ EXT2_FEATURE_COMPAT_RESIZE_INO | + EXT2_FEATURE_COMPAT_DIR_INDEX, /* Compat */ + EXT2_FEATURE_INCOMPAT_FILETYPE| /* Incompat */ + EXT3_FEATURE_INCOMPAT_JOURNAL_DEV| +@@ -1123,7 +1123,7 @@ static int PRS(int argc, char **argv) + /* Since sparse_super is the default, we would only have a problem + * here if it was explicitly disabled. + */ +- if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) && ++ if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO) && + !(param.s_feature_ro_compat&EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) { + bb_error_msg_and_die("reserved online resize blocks not supported " + "on non-sparse filesystem"); +@@ -1312,7 +1312,7 @@ int mke2fs_main (int argc, char **argv) + reserve_inodes(fs); + create_bad_block_inode(fs, bb_list); + if (fs->super->s_feature_compat & +- EXT2_FEATURE_COMPAT_RESIZE_INODE) { ++ EXT2_FEATURE_COMPAT_RESIZE_INO) { + retval = ext2fs_create_resize_inode(fs); + mke2fs_error_msg_and_die(retval, "reserve blocks for online resize"); + } +diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c +index 841d58a..46a745e 100644 +--- a/e2fsprogs/tune2fs.c ++++ b/e2fsprogs/tune2fs.c +@@ -8,7 +8,7 @@ + */ + #include "libbb.h" + #include +-#include "bb_linux_ext2_fs.h" ++#include "bb_e2fs_defs.h" + + // storage helpers + char BUG_wrong_field_size(void); +diff --git a/include/bb_e2fs_defs.h b/include/bb_e2fs_defs.h +new file mode 100644 +index 0000000..7974497 +--- /dev/null ++++ b/include/bb_e2fs_defs.h +@@ -0,0 +1,561 @@ ++/* vi: set sw=4 ts=4: */ ++/* ++ * linux/include/linux/ext2_fs.h ++ * ++ * Copyright (C) 1992, 1993, 1994, 1995 ++ * Remy Card (card@masi.ibp.fr) ++ * Laboratoire MASI - Institut Blaise Pascal ++ * Universite Pierre et Marie Curie (Paris VI) ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ */ ++ ++#ifndef LINUX_EXT2_FS_H ++#define LINUX_EXT2_FS_H 1 ++ ++/* ++ * Special inode numbers ++ */ ++#define EXT2_BAD_INO 1 /* Bad blocks inode */ ++#define EXT2_ROOT_INO 2 /* Root inode */ ++#define EXT2_ACL_IDX_INO 3 /* ACL inode */ ++#define EXT2_ACL_DATA_INO 4 /* ACL inode */ ++#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ ++#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ ++#define EXT2_RESIZE_INO 7 /* Reserved group descriptors inode */ ++#define EXT2_JOURNAL_INO 8 /* Journal inode */ ++ ++/* First non-reserved inode for old ext2 filesystems */ ++#define EXT2_GOOD_OLD_FIRST_INO 11 ++ ++/* ++ * The second extended file system magic number ++ */ ++#define EXT2_SUPER_MAGIC 0xEF53 ++ ++/* Assume that user mode programs are passing in an ext2fs superblock, not ++ * a kernel struct super_block. This will allow us to call the feature-test ++ * macros from user land. */ ++#define EXT2_SB(sb) (sb) ++ ++/* ++ * Maximal count of links to a file ++ */ ++#define EXT2_LINK_MAX 32000 ++ ++/* ++ * Macro-instructions used to manage several block sizes ++ */ ++#define EXT2_MIN_BLOCK_LOG_SIZE 10 /* 1024 */ ++#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 65536 */ ++#define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) ++#define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) ++#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) ++#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) ++#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size) ++#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino) ++#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(uint32_t)) ++ ++/* ++ * Macro-instructions used to manage fragments ++ */ ++#define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE ++#define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE ++#define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE ++#define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) ++#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) ++ ++/* ++ * ACL structures ++ */ ++struct ext2_acl_header { /* Header of Access Control Lists */ ++ uint32_t aclh_size; ++ uint32_t aclh_file_count; ++ uint32_t aclh_acle_count; ++ uint32_t aclh_first_acle; ++}; ++ ++struct ext2_acl_entry { /* Access Control List Entry */ ++ uint32_t acle_size; ++ uint16_t acle_perms; /* Access permissions */ ++ uint16_t acle_type; /* Type of entry */ ++ uint16_t acle_tag; /* User or group identity */ ++ uint16_t acle_pad1; ++ uint32_t acle_next; /* Pointer on next entry for the */ ++ /* same inode or on next free entry */ ++}; ++ ++/* ++ * Structure of a blocks group descriptor ++ */ ++struct ext2_group_desc { ++ uint32_t bg_block_bitmap; /* Blocks bitmap block */ ++ uint32_t bg_inode_bitmap; /* Inodes bitmap block */ ++ uint32_t bg_inode_table; /* Inodes table block */ ++ uint16_t bg_free_blocks_count; /* Free blocks count */ ++ uint16_t bg_free_inodes_count; /* Free inodes count */ ++ uint16_t bg_used_dirs_count; /* Directories count */ ++ uint16_t bg_pad; ++ uint32_t bg_reserved[3]; ++}; ++ ++/* ++ * Data structures used by the directory indexing feature ++ * ++ * Note: all of the multibyte integer fields are little endian. ++ */ ++ ++/* ++ * Note: dx_root_info is laid out so that if it should somehow get ++ * overlaid by a dirent the two low bits of the hash version will be ++ * zero. Therefore, the hash version mod 4 should never be 0. ++ * Sincerely, the paranoia department. ++ */ ++struct ext2_dx_root_info { ++ uint32_t reserved_zero; ++ uint8_t hash_version; /* 0 now, 1 at release */ ++ uint8_t info_length; /* 8 */ ++ uint8_t indirect_levels; ++ uint8_t unused_flags; ++}; ++ ++#define EXT2_HASH_LEGACY 0 ++#define EXT2_HASH_HALF_MD4 1 ++#define EXT2_HASH_TEA 2 ++ ++#define EXT2_HASH_FLAG_INCOMPAT 0x1 ++ ++struct ext2_dx_entry { ++ uint32_t hash; ++ uint32_t block; ++}; ++ ++struct ext2_dx_countlimit { ++ uint16_t limit; ++ uint16_t count; ++}; ++ ++ ++/* ++ * Macro-instructions used to manage group descriptors ++ */ ++#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) ++#define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) ++#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) ++/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */ ++#define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8) ++#define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s)) ++#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) ++ ++/* ++ * Constants relative to the data blocks ++ */ ++#define EXT2_NDIR_BLOCKS 12 ++#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS ++#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) ++#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) ++#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) ++ ++/* ++ * Inode flags ++ */ ++#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ ++#define EXT2_UNRM_FL 0x00000002 /* Undelete */ ++#define EXT2_COMPR_FL 0x00000004 /* Compress file */ ++#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ ++#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ ++#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ ++#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ ++#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ ++/* Reserved for compression usage... */ ++#define EXT2_DIRTY_FL 0x00000100 ++#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ ++#define EXT2_NOCOMPR_FL 0x00000400 /* Access raw compressed data */ ++#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ ++/* End compression flags --- maybe not all used */ ++#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ ++#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ ++#define EXT2_IMAGIC_FL 0x00002000 ++#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */ ++#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ ++#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */ ++#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ ++#define EXT3_EXTENTS_FL 0x00080000 /* Inode uses extents */ ++#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ ++ ++#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ ++#define EXT2_FL_USER_MODIFIABLE 0x000080FF /* User modifiable flags */ ++ ++/* ++ * ioctl commands ++ */ ++#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) ++#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) ++#define EXT2_IOC_GETVERSION _IOR('v', 1, long) ++#define EXT2_IOC_SETVERSION _IOW('v', 2, long) ++ ++/* ++ * Structure of an inode on the disk ++ */ ++struct ext2_inode { ++ uint16_t i_mode; /* File mode */ ++ uint16_t i_uid; /* Low 16 bits of Owner Uid */ ++ uint32_t i_size; /* Size in bytes */ ++ uint32_t i_atime; /* Access time */ ++ uint32_t i_ctime; /* Creation time */ ++ uint32_t i_mtime; /* Modification time */ ++ uint32_t i_dtime; /* Deletion Time */ ++ uint16_t i_gid; /* Low 16 bits of Group Id */ ++ uint16_t i_links_count; /* Links count */ ++ uint32_t i_blocks; /* Blocks count */ ++ uint32_t i_flags; /* File flags */ ++ union { ++ struct { ++ uint32_t l_i_reserved1; ++ } linux1; ++ struct { ++ uint32_t h_i_translator; ++ } hurd1; ++ struct { ++ uint32_t m_i_reserved1; ++ } masix1; ++ } osd1; /* OS dependent 1 */ ++ uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ ++ uint32_t i_generation; /* File version (for NFS) */ ++ uint32_t i_file_acl; /* File ACL */ ++ uint32_t i_dir_acl; /* Directory ACL */ ++ uint32_t i_faddr; /* Fragment address */ ++ union { ++ struct { ++ uint8_t l_i_frag; /* Fragment number */ ++ uint8_t l_i_fsize; /* Fragment size */ ++ uint16_t i_pad1; ++ uint16_t l_i_uid_high; /* these 2 fields */ ++ uint16_t l_i_gid_high; /* were reserved2[0] */ ++ uint32_t l_i_reserved2; ++ } linux2; ++ struct { ++ uint8_t h_i_frag; /* Fragment number */ ++ uint8_t h_i_fsize; /* Fragment size */ ++ uint16_t h_i_mode_high; ++ uint16_t h_i_uid_high; ++ uint16_t h_i_gid_high; ++ uint32_t h_i_author; ++ } hurd2; ++ struct { ++ uint8_t m_i_frag; /* Fragment number */ ++ uint8_t m_i_fsize; /* Fragment size */ ++ uint16_t m_pad1; ++ uint32_t m_i_reserved2[2]; ++ } masix2; ++ } osd2; /* OS dependent 2 */ ++}; ++ ++/* ++ * Permanent part of an large inode on the disk ++ */ ++struct ext2_inode_large { ++ uint16_t i_mode; /* File mode */ ++ uint16_t i_uid; /* Low 16 bits of Owner Uid */ ++ uint32_t i_size; /* Size in bytes */ ++ uint32_t i_atime; /* Access time */ ++ uint32_t i_ctime; /* Creation time */ ++ uint32_t i_mtime; /* Modification time */ ++ uint32_t i_dtime; /* Deletion Time */ ++ uint16_t i_gid; /* Low 16 bits of Group Id */ ++ uint16_t i_links_count; /* Links count */ ++ uint32_t i_blocks; /* Blocks count */ ++ uint32_t i_flags; /* File flags */ ++ union { ++ struct { ++ uint32_t l_i_reserved1; ++ } linux1; ++ struct { ++ uint32_t h_i_translator; ++ } hurd1; ++ struct { ++ uint32_t m_i_reserved1; ++ } masix1; ++ } osd1; /* OS dependent 1 */ ++ uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ ++ uint32_t i_generation; /* File version (for NFS) */ ++ uint32_t i_file_acl; /* File ACL */ ++ uint32_t i_dir_acl; /* Directory ACL */ ++ uint32_t i_faddr; /* Fragment address */ ++ union { ++ struct { ++ uint8_t l_i_frag; /* Fragment number */ ++ uint8_t l_i_fsize; /* Fragment size */ ++ uint16_t i_pad1; ++ uint16_t l_i_uid_high; /* these 2 fields */ ++ uint16_t l_i_gid_high; /* were reserved2[0] */ ++ uint32_t l_i_reserved2; ++ } linux2; ++ struct { ++ uint8_t h_i_frag; /* Fragment number */ ++ uint8_t h_i_fsize; /* Fragment size */ ++ uint16_t h_i_mode_high; ++ uint16_t h_i_uid_high; ++ uint16_t h_i_gid_high; ++ uint32_t h_i_author; ++ } hurd2; ++ struct { ++ uint8_t m_i_frag; /* Fragment number */ ++ uint8_t m_i_fsize; /* Fragment size */ ++ uint16_t m_pad1; ++ uint32_t m_i_reserved2[2]; ++ } masix2; ++ } osd2; /* OS dependent 2 */ ++ uint16_t i_extra_isize; ++ uint16_t i_pad1; ++}; ++ ++#define i_size_high i_dir_acl ++ ++/* ++ * File system states ++ */ ++#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ ++#define EXT2_ERROR_FS 0x0002 /* Errors detected */ ++ ++/* ++ * Mount flags ++ */ ++#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */ ++#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */ ++#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */ ++#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ ++#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ ++#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ ++#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ ++#define EXT2_MOUNT_NO_UID32 0x0200 /* Disable 32-bit UIDs */ ++ ++#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt ++#define set_opt(o, opt) o |= EXT2_MOUNT_##opt ++#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ ++ EXT2_MOUNT_##opt) ++/* ++ * Maximal mount counts between two filesystem checks ++ */ ++#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ ++#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ ++ ++/* ++ * Behaviour when detecting errors ++ */ ++#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ ++#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ ++#define EXT2_ERRORS_PANIC 3 /* Panic */ ++#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE ++ ++/* ++ * Structure of the super block ++ */ ++struct ext2_super_block { ++ uint32_t s_inodes_count; /* Inodes count */ ++ uint32_t s_blocks_count; /* Blocks count */ ++ uint32_t s_r_blocks_count; /* Reserved blocks count */ ++ uint32_t s_free_blocks_count; /* Free blocks count */ ++ uint32_t s_free_inodes_count; /* Free inodes count */ ++ uint32_t s_first_data_block; /* First Data Block */ ++ uint32_t s_log_block_size; /* Block size */ ++ int32_t s_log_frag_size; /* Fragment size */ ++ uint32_t s_blocks_per_group; /* # Blocks per group */ ++ uint32_t s_frags_per_group; /* # Fragments per group */ ++ uint32_t s_inodes_per_group; /* # Inodes per group */ ++ uint32_t s_mtime; /* Mount time */ ++ uint32_t s_wtime; /* Write time */ ++ uint16_t s_mnt_count; /* Mount count */ ++ int16_t s_max_mnt_count; /* Maximal mount count */ ++ uint16_t s_magic; /* Magic signature */ ++ uint16_t s_state; /* File system state */ ++ uint16_t s_errors; /* Behaviour when detecting errors */ ++ uint16_t s_minor_rev_level; /* minor revision level */ ++ uint32_t s_lastcheck; /* time of last check */ ++ uint32_t s_checkinterval; /* max. time between checks */ ++ uint32_t s_creator_os; /* OS */ ++ uint32_t s_rev_level; /* Revision level */ ++ uint16_t s_def_resuid; /* Default uid for reserved blocks */ ++ uint16_t s_def_resgid; /* Default gid for reserved blocks */ ++ /* ++ * These fields are for EXT2_DYNAMIC_REV superblocks only. ++ * ++ * Note: the difference between the compatible feature set and ++ * the incompatible feature set is that if there is a bit set ++ * in the incompatible feature set that the kernel doesn't ++ * know about, it should refuse to mount the filesystem. ++ * ++ * e2fsck's requirements are more strict; if it doesn't know ++ * about a feature in either the compatible or incompatible ++ * feature set, it must abort and not try to meddle with ++ * things it doesn't understand... ++ */ ++ uint32_t s_first_ino; /* First non-reserved inode */ ++ uint16_t s_inode_size; /* size of inode structure */ ++ uint16_t s_block_group_nr; /* block group # of this superblock */ ++ uint32_t s_feature_compat; /* compatible feature set */ ++ uint32_t s_feature_incompat; /* incompatible feature set */ ++ uint32_t s_feature_ro_compat; /* readonly-compatible feature set */ ++ uint8_t s_uuid[16]; /* 128-bit uuid for volume */ ++ char s_volume_name[16]; /* volume name */ ++ char s_last_mounted[64]; /* directory where last mounted */ ++ uint32_t s_algorithm_usage_bitmap; /* For compression */ ++ /* ++ * Performance hints. Directory preallocation should only ++ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. ++ */ ++ uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ ++ uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ ++ uint16_t s_reserved_gdt_blocks; /* Per group table for online growth */ ++ /* ++ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. ++ */ ++ uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ ++ uint32_t s_journal_inum; /* inode number of journal file */ ++ uint32_t s_journal_dev; /* device number of journal file */ ++ uint32_t s_last_orphan; /* start of list of inodes to delete */ ++ uint32_t s_hash_seed[4]; /* HTREE hash seed */ ++ uint8_t s_def_hash_version; /* Default hash version to use */ ++ uint8_t s_jnl_backup_type; /* Default type of journal backup */ ++ uint16_t s_reserved_word_pad; ++ uint32_t s_default_mount_opts; ++ uint32_t s_first_meta_bg; /* First metablock group */ ++ uint32_t s_mkfs_time; /* When the filesystem was created */ ++ uint32_t s_jnl_blocks[17]; /* Backup of the journal inode */ ++ uint32_t s_reserved[172]; /* Padding to the end of the block */ ++}; ++ ++/* ++ * Codes for operating systems ++ */ ++#define EXT2_OS_LINUX 0 ++#define EXT2_OS_HURD 1 ++#define EXT2_OS_MASIX 2 ++#define EXT2_OS_FREEBSD 3 ++#define EXT2_OS_LITES 4 ++ ++/* ++ * Revision levels ++ */ ++#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ ++#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ ++ ++#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV ++#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV ++ ++#define EXT2_GOOD_OLD_INODE_SIZE 128 ++ ++/* ++ * Journal inode backup types ++ */ ++#define EXT3_JNL_BACKUP_BLOCKS 1 ++ ++/* ++ * Feature set definitions ++ */ ++ ++#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_feature_compat & (mask) ) ++#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) ++#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ++ ( EXT2_SB(sb)->s_feature_incompat & (mask) ) ++ ++#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 ++#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 ++#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 ++#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 ++#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 ++#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 ++ ++#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 ++#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 ++/* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 not used */ ++ ++#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 ++#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 ++#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ ++#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ ++#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 ++#define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 ++ ++ ++#define EXT2_FEATURE_COMPAT_SUPP 0 ++#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE) ++#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ ++ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ ++ EXT2_FEATURE_RO_COMPAT_BTREE_DIR) ++ ++/* ++ * Default values for user and/or group using reserved blocks ++ */ ++#define EXT2_DEF_RESUID 0 ++#define EXT2_DEF_RESGID 0 ++ ++/* ++ * Default mount options ++ */ ++#define EXT2_DEFM_DEBUG 0x0001 ++#define EXT2_DEFM_BSDGROUPS 0x0002 ++#define EXT2_DEFM_XATTR_USER 0x0004 ++#define EXT2_DEFM_ACL 0x0008 ++#define EXT2_DEFM_UID16 0x0010 ++#define EXT3_DEFM_JMODE 0x0060 ++#define EXT3_DEFM_JMODE_DATA 0x0020 ++#define EXT3_DEFM_JMODE_ORDERED 0x0040 ++#define EXT3_DEFM_JMODE_WBACK 0x0060 ++ ++/* ++ * Structure of a directory entry ++ */ ++#define EXT2_NAME_LEN 255 ++ ++struct ext2_dir_entry { ++ uint32_t inode; /* Inode number */ ++ uint16_t rec_len; /* Directory entry length */ ++ uint16_t name_len; /* Name length */ ++ char name[EXT2_NAME_LEN]; /* File name */ ++}; ++ ++/* ++ * The new version of the directory entry. Since EXT2 structures are ++ * stored in intel byte order, and the name_len field could never be ++ * bigger than 255 chars, it's safe to reclaim the extra byte for the ++ * file_type field. ++ */ ++struct ext2_dir_entry_2 { ++ uint32_t inode; /* Inode number */ ++ uint16_t rec_len; /* Directory entry length */ ++ uint8_t name_len; /* Name length */ ++ uint8_t file_type; ++ char name[EXT2_NAME_LEN]; /* File name */ ++}; ++ ++/* ++ * Ext2 directory file types. Only the low 3 bits are used. The ++ * other bits are reserved for now. ++ */ ++#define EXT2_FT_UNKNOWN 0 ++#define EXT2_FT_REG_FILE 1 ++#define EXT2_FT_DIR 2 ++#define EXT2_FT_CHRDEV 3 ++#define EXT2_FT_BLKDEV 4 ++#define EXT2_FT_FIFO 5 ++#define EXT2_FT_SOCK 6 ++#define EXT2_FT_SYMLINK 7 ++ ++#define EXT2_FT_MAX 8 ++ ++/* ++ * EXT2_DIR_PAD defines the directory entries boundaries ++ * ++ * NOTE: It must be a multiple of 4 ++ */ ++#define EXT2_DIR_PAD 4 ++#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) ++#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ++ ~EXT2_DIR_ROUND) ++ ++#endif +diff --git a/include/bb_linux_ext2_fs.h b/include/bb_linux_ext2_fs.h +deleted file mode 100644 +index fdc470b..0000000 +--- a/include/bb_linux_ext2_fs.h ++++ /dev/null +@@ -1,547 +0,0 @@ +-/* +- * Work around linux/ext2_fs.h breakage. +- * linux/ext2_fs.h might be removed from future kernel header distribution. +- * See https://bugzilla.kernel.org/show_bug.cgi?id=42986 +- * +- * Licensed under GPLv2, see file LICENSE in this source tree. +- */ +-#ifndef BB_LINUX_EXT2_FS_H +-#define BB_LINUX_EXT2_FS_H +- +-/* +- * From linux/magic.h +- */ +- +-#define EXT2_SUPER_MAGIC 0xEF53 +-#define EXT3_SUPER_MAGIC 0xEF53 +-#define EXT4_SUPER_MAGIC 0xEF53 +- +-/* +- * From linux/ext2_fs.h, with minor changes. +- */ +- +-/* +- * Copyright (C) 1992, 1993, 1994, 1995 +- * Remy Card (card@masi.ibp.fr) +- * Laboratoire MASI - Institut Blaise Pascal +- * Universite Pierre et Marie Curie (Paris VI) +- * +- * from +- * +- * linux/include/linux/minix_fs.h +- * +- * Copyright (C) 1991, 1992 Linus Torvalds +- */ +- +-/* +- * The second extended filesystem constants/structures +- */ +- +-/* +- * Define EXT2_RESERVATION to reserve data blocks for expanding files +- */ +-#define EXT2_DEFAULT_RESERVE_BLOCKS 8 +-/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ +-#define EXT2_MAX_RESERVE_BLOCKS 1027 +-#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0 +- +-/* +- * Special inode numbers +- */ +-#define EXT2_BAD_INO 1 /* Bad blocks inode */ +-#define EXT2_ROOT_INO 2 /* Root inode */ +-#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ +-#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ +- +-/* First non-reserved inode for old ext2 filesystems */ +-#define EXT2_GOOD_OLD_FIRST_INO 11 +- +-/* Assume that user mode programs are passing in an ext2fs superblock, not +- * a kernel struct super_block. This will allow us to call the feature-test +- * macros from user land. */ +-#define EXT2_SB(sb) (sb) +- +-/* +- * Maximal count of links to a file +- */ +-#define EXT2_LINK_MAX 32000 +- +-/* +- * Macro-instructions used to manage several block sizes +- */ +-#define EXT2_MIN_BLOCK_SIZE 1024 +-#define EXT2_MAX_BLOCK_SIZE 4096 +-#define EXT2_MIN_BLOCK_LOG_SIZE 10 +-# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) +-#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (uint32_t)) +-# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) +-#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ +- EXT2_GOOD_OLD_INODE_SIZE : \ +- (s)->s_inode_size) +-#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ +- EXT2_GOOD_OLD_FIRST_INO : \ +- (s)->s_first_ino) +- +-/* +- * Macro-instructions used to manage fragments +- */ +-#define EXT2_MIN_FRAG_SIZE 1024 +-#define EXT2_MAX_FRAG_SIZE 4096 +-#define EXT2_MIN_FRAG_LOG_SIZE 10 +-# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) +-# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) +- +-/* +- * Structure of a blocks group descriptor +- */ +-struct ext2_group_desc +-{ +- uint32_t bg_block_bitmap; /* Blocks bitmap block */ +- uint32_t bg_inode_bitmap; /* Inodes bitmap block */ +- uint32_t bg_inode_table; /* Inodes table block */ +- uint16_t bg_free_blocks_count; /* Free blocks count */ +- uint16_t bg_free_inodes_count; /* Free inodes count */ +- uint16_t bg_used_dirs_count; /* Directories count */ +- uint16_t bg_pad; +- uint32_t bg_reserved[3]; +-}; +- +-/* +- * Macro-instructions used to manage group descriptors +- */ +-# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) +-# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) +-# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group) +- +-/* +- * Constants relative to the data blocks +- */ +-#define EXT2_NDIR_BLOCKS 12 +-#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS +-#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) +-#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) +-#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) +- +-/* +- * Inode flags (GETFLAGS/SETFLAGS) +- */ +-#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ +-#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ +-#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ +-#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ +-#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ +-#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ +-#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ +-#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ +-/* Reserved for compression usage... */ +-#define EXT2_DIRTY_FL FS_DIRTY_FL +-#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ +-#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ +-#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ +-/* End compression flags --- maybe not all used */ +-#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ +-#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ +-#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ +-#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ +-#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ +-#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ +-#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ +-#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ +- +-#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ +-#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ +- +-/* Flags that should be inherited by new inodes from their parent. */ +-#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ +- EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ +- EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ +- EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ +- EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) +- +-/* Flags that are appropriate for regular files (all but dir-specific ones). */ +-#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL)) +- +-/* Flags that are appropriate for non-directories/regular files. */ +-#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) +- +-/* Mask out flags that are inappropriate for the given type of inode. */ +-static inline uint32_t ext2_mask_flags(mode_t mode, uint32_t flags) +-{ +- if (S_ISDIR(mode)) +- return flags; +- else if (S_ISREG(mode)) +- return flags & EXT2_REG_FLMASK; +- else +- return flags & EXT2_OTHER_FLMASK; +-} +- +-/* +- * ioctl commands +- */ +-#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS +-#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS +-#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION +-#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION +-#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long) +-#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long) +- +-/* +- * ioctl commands in 32 bit emulation +- */ +-#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS +-#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS +-#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION +-#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION +- +-/* +- * Structure of an inode on the disk +- */ +-struct ext2_inode { +- uint16_t i_mode; /* File mode */ +- uint16_t i_uid; /* Low 16 bits of Owner Uid */ +- uint32_t i_size; /* Size in bytes */ +- uint32_t i_atime; /* Access time */ +- uint32_t i_ctime; /* Creation time */ +- uint32_t i_mtime; /* Modification time */ +- uint32_t i_dtime; /* Deletion Time */ +- uint16_t i_gid; /* Low 16 bits of Group Id */ +- uint16_t i_links_count; /* Links count */ +- uint32_t i_blocks; /* Blocks count */ +- uint32_t i_flags; /* File flags */ +- union { +- struct { +- uint32_t l_i_reserved1; +- } linux1; +- struct { +- uint32_t h_i_translator; +- } hurd1; +- struct { +- uint32_t m_i_reserved1; +- } masix1; +- } osd1; /* OS dependent 1 */ +- uint32_t i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ +- uint32_t i_generation; /* File version (for NFS) */ +- uint32_t i_file_acl; /* File ACL */ +- uint32_t i_dir_acl; /* Directory ACL */ +- uint32_t i_faddr; /* Fragment address */ +- union { +- struct { +- uint8_t l_i_frag; /* Fragment number */ +- uint8_t l_i_fsize; /* Fragment size */ +- uint16_t i_pad1; +- uint16_t l_i_uid_high; /* these 2 fields */ +- uint16_t l_i_gid_high; /* were reserved2[0] */ +- uint32_t l_i_reserved2; +- } linux2; +- struct { +- uint8_t h_i_frag; /* Fragment number */ +- uint8_t h_i_fsize; /* Fragment size */ +- uint16_t h_i_mode_high; +- uint16_t h_i_uid_high; +- uint16_t h_i_gid_high; +- uint32_t h_i_author; +- } hurd2; +- struct { +- uint8_t m_i_frag; /* Fragment number */ +- uint8_t m_i_fsize; /* Fragment size */ +- uint16_t m_pad1; +- uint32_t m_i_reserved2[2]; +- } masix2; +- } osd2; /* OS dependent 2 */ +-}; +- +-#define i_size_high i_dir_acl +- +-#if defined(__KERNEL__) || defined(__linux__) +-#define i_reserved1 osd1.linux1.l_i_reserved1 +-#define i_frag osd2.linux2.l_i_frag +-#define i_fsize osd2.linux2.l_i_fsize +-#define i_uid_low i_uid +-#define i_gid_low i_gid +-#define i_uid_high osd2.linux2.l_i_uid_high +-#define i_gid_high osd2.linux2.l_i_gid_high +-#define i_reserved2 osd2.linux2.l_i_reserved2 +-#endif +- +-#ifdef __hurd__ +-#define i_translator osd1.hurd1.h_i_translator +-#define i_frag osd2.hurd2.h_i_frag +-#define i_fsize osd2.hurd2.h_i_fsize +-#define i_uid_high osd2.hurd2.h_i_uid_high +-#define i_gid_high osd2.hurd2.h_i_gid_high +-#define i_author osd2.hurd2.h_i_author +-#endif +- +-#ifdef __masix__ +-#define i_reserved1 osd1.masix1.m_i_reserved1 +-#define i_frag osd2.masix2.m_i_frag +-#define i_fsize osd2.masix2.m_i_fsize +-#define i_reserved2 osd2.masix2.m_i_reserved2 +-#endif +- +-/* +- * File system states +- */ +-#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ +-#define EXT2_ERROR_FS 0x0002 /* Errors detected */ +- +-/* +- * Mount flags +- */ +-#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ +-#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ +-#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ +-#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ +-#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */ +-#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */ +-#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */ +-#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */ +-#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */ +-#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */ +-#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ +-#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ +-#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ +-#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ +-#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ +-#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ +- +- +-#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt +-#define set_opt(o, opt) o |= EXT2_MOUNT_##opt +-#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ +- EXT2_MOUNT_##opt) +-/* +- * Maximal mount counts between two filesystem checks +- */ +-#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ +-#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ +- +-/* +- * Behaviour when detecting errors +- */ +-#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ +-#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ +-#define EXT2_ERRORS_PANIC 3 /* Panic */ +-#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE +- +-/* +- * Structure of the super block +- */ +-struct ext2_super_block { +- uint32_t s_inodes_count; /* Inodes count */ +- uint32_t s_blocks_count; /* Blocks count */ +- uint32_t s_r_blocks_count; /* Reserved blocks count */ +- uint32_t s_free_blocks_count; /* Free blocks count */ +- uint32_t s_free_inodes_count; /* Free inodes count */ +- uint32_t s_first_data_block; /* First Data Block */ +- uint32_t s_log_block_size; /* Block size */ +- uint32_t s_log_frag_size; /* Fragment size */ +- uint32_t s_blocks_per_group; /* # Blocks per group */ +- uint32_t s_frags_per_group; /* # Fragments per group */ +- uint32_t s_inodes_per_group; /* # Inodes per group */ +- uint32_t s_mtime; /* Mount time */ +- uint32_t s_wtime; /* Write time */ +- uint16_t s_mnt_count; /* Mount count */ +- uint16_t s_max_mnt_count; /* Maximal mount count */ +- uint16_t s_magic; /* Magic signature */ +- uint16_t s_state; /* File system state */ +- uint16_t s_errors; /* Behaviour when detecting errors */ +- uint16_t s_minor_rev_level; /* minor revision level */ +- uint32_t s_lastcheck; /* time of last check */ +- uint32_t s_checkinterval; /* max. time between checks */ +- uint32_t s_creator_os; /* OS */ +- uint32_t s_rev_level; /* Revision level */ +- uint16_t s_def_resuid; /* Default uid for reserved blocks */ +- uint16_t s_def_resgid; /* Default gid for reserved blocks */ +- /* +- * These fields are for EXT2_DYNAMIC_REV superblocks only. +- * +- * Note: the difference between the compatible feature set and +- * the incompatible feature set is that if there is a bit set +- * in the incompatible feature set that the kernel doesn't +- * know about, it should refuse to mount the filesystem. +- * +- * e2fsck's requirements are more strict; if it doesn't know +- * about a feature in either the compatible or incompatible +- * feature set, it must abort and not try to meddle with +- * things it doesn't understand... +- */ +- uint32_t s_first_ino; /* First non-reserved inode */ +- uint16_t s_inode_size; /* size of inode structure */ +- uint16_t s_block_group_nr; /* block group # of this superblock */ +- uint32_t s_feature_compat; /* compatible feature set */ +- uint32_t s_feature_incompat; /* incompatible feature set */ +- uint32_t s_feature_ro_compat; /* readonly-compatible feature set */ +- uint8_t s_uuid[16]; /* 128-bit uuid for volume */ +- char s_volume_name[16]; /* volume name */ +- char s_last_mounted[64]; /* directory where last mounted */ +- uint32_t s_algorithm_usage_bitmap; /* For compression */ +- /* +- * Performance hints. Directory preallocation should only +- * happen if the EXT2_COMPAT_PREALLOC flag is on. +- */ +- uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ +- uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ +- uint16_t s_padding1; +- /* +- * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. +- */ +- uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ +- uint32_t s_journal_inum; /* inode number of journal file */ +- uint32_t s_journal_dev; /* device number of journal file */ +- uint32_t s_last_orphan; /* start of list of inodes to delete */ +- uint32_t s_hash_seed[4]; /* HTREE hash seed */ +- uint8_t s_def_hash_version; /* Default hash version to use */ +- uint8_t s_reserved_char_pad; +- uint16_t s_reserved_word_pad; +- uint32_t s_default_mount_opts; +- uint32_t s_first_meta_bg; /* First metablock block group */ +- uint32_t s_reserved[190]; /* Padding to the end of the block */ +-}; +- +-/* +- * Codes for operating systems +- */ +-#define EXT2_OS_LINUX 0 +-#define EXT2_OS_HURD 1 +-#define EXT2_OS_MASIX 2 +-#define EXT2_OS_FREEBSD 3 +-#define EXT2_OS_LITES 4 +- +-/* +- * Revision levels +- */ +-#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ +-#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ +- +-#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV +-#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV +- +-#define EXT2_GOOD_OLD_INODE_SIZE 128 +- +-/* +- * Feature set definitions +- */ +- +-#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) +-#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) +-#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ +- ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) +-#define EXT2_SET_COMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) +-#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask) +-#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask) +-#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask) +-#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask) +-#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ +- EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask) +- +-#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 +-#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 +-#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 +-#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 +-#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 +-#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 +-#define EXT2_FEATURE_COMPAT_ANY 0xffffffff +- +-#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +-#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 +-#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 +-#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff +- +-#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 +-#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 +-#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 +-#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 +-#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 +-#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff +- +-#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR +-#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ +- EXT2_FEATURE_INCOMPAT_META_BG) +-#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ +- EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ +- EXT2_FEATURE_RO_COMPAT_BTREE_DIR) +-#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP +-#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP +- +-/* +- * Default values for user and/or group using reserved blocks +- */ +-#define EXT2_DEF_RESUID 0 +-#define EXT2_DEF_RESGID 0 +- +-/* +- * Default mount options +- */ +-#define EXT2_DEFM_DEBUG 0x0001 +-#define EXT2_DEFM_BSDGROUPS 0x0002 +-#define EXT2_DEFM_XATTR_USER 0x0004 +-#define EXT2_DEFM_ACL 0x0008 +-#define EXT2_DEFM_UID16 0x0010 +- /* Not used by ext2, but reserved for use by ext3 */ +-#define EXT3_DEFM_JMODE 0x0060 +-#define EXT3_DEFM_JMODE_DATA 0x0020 +-#define EXT3_DEFM_JMODE_ORDERED 0x0040 +-#define EXT3_DEFM_JMODE_WBACK 0x0060 +- +-/* +- * Structure of a directory entry +- */ +-#define EXT2_NAME_LEN 255 +- +-struct ext2_dir_entry { +- uint32_t inode; /* Inode number */ +- uint16_t rec_len; /* Directory entry length */ +- uint16_t name_len; /* Name length */ +- char name[EXT2_NAME_LEN]; /* File name */ +-}; +- +-/* +- * The new version of the directory entry. Since EXT2 structures are +- * stored in intel byte order, and the name_len field could never be +- * bigger than 255 chars, it's safe to reclaim the extra byte for the +- * file_type field. +- */ +-struct ext2_dir_entry_2 { +- uint32_t inode; /* Inode number */ +- uint16_t rec_len; /* Directory entry length */ +- uint8_t name_len; /* Name length */ +- uint8_t file_type; +- char name[EXT2_NAME_LEN]; /* File name */ +-}; +- +-/* +- * Ext2 directory file types. Only the low 3 bits are used. The +- * other bits are reserved for now. +- */ +-enum { +- EXT2_FT_UNKNOWN = 0, +- EXT2_FT_REG_FILE = 1, +- EXT2_FT_DIR = 2, +- EXT2_FT_CHRDEV = 3, +- EXT2_FT_BLKDEV = 4, +- EXT2_FT_FIFO = 5, +- EXT2_FT_SOCK = 6, +- EXT2_FT_SYMLINK = 7, +- EXT2_FT_MAX +-}; +- +-/* +- * EXT2_DIR_PAD defines the directory entries boundaries +- * +- * NOTE: It must be a multiple of 4 +- */ +-#define EXT2_DIR_PAD 4 +-#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) +-#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ +- ~EXT2_DIR_ROUND) +-#define EXT2_MAX_REC_LEN ((1<<16)-1) +- +-#endif +diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c +index 2d9d720..69b25c9 100644 +--- a/util-linux/mkfs_ext2.c ++++ b/util-linux/mkfs_ext2.c +@@ -48,7 +48,7 @@ + + #include "libbb.h" + #include +-#include "bb_linux_ext2_fs.h" ++#include "bb_e2fs_defs.h" + + #define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0 + #define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1 +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-ifupdown-remove-interface-from-state_list-if-iface_u.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-ifupdown-remove-interface-from-state_list-if-iface_u.patch new file mode 100644 index 0000000000..e53d78a184 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0003-ifupdown-remove-interface-from-state_list-if-iface_u.patch @@ -0,0 +1,31 @@ +From a7b406ba64b7a4d9c9610726cb72568fc9848f5d Mon Sep 17 00:00:00 2001 +From: Lauri Hintsala +Date: Wed, 14 Dec 2011 16:49:58 +0200 +Subject: [PATCH 3/6] ifupdown: remove interface from state_list if iface_up + fails + +Fix the issue where interface is set to the configured state even if +configuration has failed. Add error check to state setting logic. + +Signed-off-by: Lauri Hintsala +Signed-off-by: Denys Vlasenko +--- + networking/ifupdown.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/networking/ifupdown.c b/networking/ifupdown.c +index 5946323..9c2cad2 100644 +--- a/networking/ifupdown.c ++++ b/networking/ifupdown.c +@@ -1311,7 +1311,7 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) + llist_t *state_list = read_iface_state(); + llist_t *iface_state = find_iface_state(state_list, iface); + +- if (cmds == iface_up) { ++ if (cmds == iface_up && !any_failures) { + char * const newiface = xasprintf("%s=%s", iface, liface); + if (iface_state == NULL) { + llist_add_to_end(&state_list, newiface); +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0004-ifupdown-support-metric-for-static-default-gw.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0004-ifupdown-support-metric-for-static-default-gw.patch new file mode 100644 index 0000000000..3e77a1c849 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0004-ifupdown-support-metric-for-static-default-gw.patch @@ -0,0 +1,64 @@ +From fecb0cbff5ca703f8fc00a8e0e93f1f2e3ae942b Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Fri, 17 Feb 2012 19:36:26 +0000 +Subject: [PATCH 4/6] ifupdown: support metric for static default gw + +This is useful when you have multiple ISPs with failover. It allows +setting the priority of the static gateway and makes it possible +to specify multiple static gateways. + +The ubuntu ifupdown supports it. + +function old new delta +.rodata 116725 116797 +72 +------------------------------------------------------------------------------ +(add/remove: 0/0 grow/shrink: 1/0 up/down: 72/0) Total: 72 bytes + text data bss dec hex filename + 953343 7313 8984 969640 ecba8 busybox_old + 953415 7313 8984 969712 ecbf0 busybox_unstripped + +Signed-off-by: Natanael Copa +Signed-off-by: Denys Vlasenko +--- + networking/ifupdown.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/networking/ifupdown.c b/networking/ifupdown.c +index 9c2cad2..9f49619 100644 +--- a/networking/ifupdown.c ++++ b/networking/ifupdown.c +@@ -403,11 +403,11 @@ static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec) + result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec); + result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); + /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */ +- result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec); ++ result += execute("[[ip route add ::/0 via %gateway%]][[ prio %metric%]]", ifd, exec); + # else + result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec); + result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec); +- result += execute("[[route -A inet6 add ::/0 gw %gateway%]]", ifd, exec); ++ result += execute("[[route -A inet6 add ::/0 gw %gateway%[[ metric %metric%]]]]", ifd, exec); + # endif + return ((result == 3) ? 3 : 0); + } +@@ -490,7 +490,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) + result = execute("ip addr add %address%/%bnmask%[[ broadcast %broadcast%]] " + "dev %iface%[[ peer %pointopoint%]][[ label %label%]]", ifd, exec); + result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); +- result += execute("[[ip route add default via %gateway% dev %iface%]]", ifd, exec); ++ result += execute("[[ip route add default via %gateway% dev %iface%[[ prio %metric%]]]]", ifd, exec); + return ((result == 3) ? 3 : 0); + # else + /* ifconfig said to set iface up before it processes hw %hwaddress%, +@@ -500,7 +500,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) + result += execute("ifconfig %iface% %address% netmask %netmask%" + "[[ broadcast %broadcast%]][[ pointopoint %pointopoint%]] ", + ifd, exec); +- result += execute("[[route add default gw %gateway% %iface%]]", ifd, exec); ++ result += execute("[[route add default gw %gateway%[[ metric %metric%]] %iface%]]", ifd, exec); + return ((result == 3) ? 3 : 0); + # endif + } +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0005-ifupdown-improve-compatibility-with-Debian.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0005-ifupdown-improve-compatibility-with-Debian.patch new file mode 100644 index 0000000000..84e1947e31 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0005-ifupdown-improve-compatibility-with-Debian.patch @@ -0,0 +1,97 @@ +From 7ec30bf273cbdf5f0ae335684939a883182e493e Mon Sep 17 00:00:00 2001 +From: Andreas Oberritter +Date: Mon, 23 Apr 2012 22:08:39 +0200 +Subject: [PATCH 5/6] ifupdown: improve compatibility with Debian + +Set environment variable 'PHASE'. +Treat post-up and pre-down as aliases for up and down. +Uses the same logic as ifupdown.nw from ifupdown-0.6.16. +Makes it possible to execute Debian's ifupdown script for +wpa-supplicant. + +Signed-off-by: Andreas Oberritter +Signed-off-by: Denys Vlasenko +--- + networking/ifupdown.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/networking/ifupdown.c b/networking/ifupdown.c +index 9f49619..5c3dcec 100644 +--- a/networking/ifupdown.c ++++ b/networking/ifupdown.c +@@ -140,8 +140,6 @@ static const char keywords_up_down[] ALIGN1 = + "up\0" + "down\0" + "pre-up\0" +- "pre-down\0" +- "post-up\0" + "post-down\0" + ; + +@@ -895,6 +893,11 @@ static struct interfaces_file_t *read_interfaces(const char *filename) + if (rest_of_line[0] == '\0') + bb_error_msg_and_die("option with empty value \"%s\"", buf); + ++ if (strcmp(first_word, "post-up") == 0) ++ first_word += 5; /* "up" */ ++ else if (strcmp(first_word, "pre-down") == 0) ++ first_word += 4; /* "down" */ ++ + /* If not one of "up", "down",... words... */ + if (index_in_strings(keywords_up_down, first_word) < 0) { + int i; +@@ -963,7 +966,7 @@ static char *setlocalenv(const char *format, const char *name, const char *value + return result; + } + +-static void set_environ(struct interface_defn_t *iface, const char *mode) ++static void set_environ(struct interface_defn_t *iface, const char *mode, const char *opt) + { + int i; + char **pp; +@@ -976,7 +979,7 @@ static void set_environ(struct interface_defn_t *iface, const char *mode) + } + + /* note: last element will stay NULL: */ +- G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 6)); ++ G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 7)); + pp = G.my_environ; + + for (i = 0; i < iface->n_options; i++) { +@@ -990,6 +993,7 @@ static void set_environ(struct interface_defn_t *iface, const char *mode) + *pp++ = setlocalenv("%s=%s", "ADDRFAM", iface->address_family->name); + *pp++ = setlocalenv("%s=%s", "METHOD", iface->method->name); + *pp++ = setlocalenv("%s=%s", "MODE", mode); ++ *pp++ = setlocalenv("%s=%s", "PHASE", opt); + if (G.startup_PATH) + *pp++ = setlocalenv("%s=%s", "PATH", G.startup_PATH); + } +@@ -1044,21 +1048,21 @@ static int check(char *str) + static int iface_up(struct interface_defn_t *iface) + { + if (!iface->method->up(iface, check)) return -1; +- set_environ(iface, "start"); ++ set_environ(iface, "start", "pre-up"); + if (!execute_all(iface, "pre-up")) return 0; + if (!iface->method->up(iface, doit)) return 0; ++ set_environ(iface, "start", "post-up"); + if (!execute_all(iface, "up")) return 0; +- if (!execute_all(iface, "post-up")) return 0; + return 1; + } + + static int iface_down(struct interface_defn_t *iface) + { + if (!iface->method->down(iface,check)) return -1; +- set_environ(iface, "stop"); +- if (!execute_all(iface, "pre-down")) return 0; ++ set_environ(iface, "stop", "pre-down"); + if (!execute_all(iface, "down")) return 0; + if (!iface->method->down(iface, doit)) return 0; ++ set_environ(iface, "stop", "post-down"); + if (!execute_all(iface, "post-down")) return 0; + return 1; + } +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/0006-get_linux_version_code-don-t-fail-on-3.0-foo.patch b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0006-get_linux_version_code-don-t-fail-on-3.0-foo.patch new file mode 100644 index 0000000000..41c31b8e3a --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/0006-get_linux_version_code-don-t-fail-on-3.0-foo.patch @@ -0,0 +1,43 @@ +From c011ab2fb52c2ee03aa9544b0d242683ee4362e1 Mon Sep 17 00:00:00 2001 +From: Andreas Oberritter +Date: Fri, 27 Apr 2012 01:40:25 +0200 +Subject: [PATCH 6/6] get_linux_version_code: don't fail on 3.0-foo + +Fixes segmentation fault in mount (nfs): + + #0 __GI_____strtol_l_internal (nptr=0x0, endptr=0x0, base=10, group=, loc=0x77f6f3c8) at strtol_l.c:298 + #1 __GI_strtol (nptr=, endptr=, base=) at strtol.c:110 + #2 get_linux_version_code () at libbb/kernel_version.c:34 + #3 find_kernel_nfs_mount_version () at util-linux/mount.c:979 + +Signed-off-by: Andreas Oberritter +--- + libbb/kernel_version.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c +index a168a1e..12f1146 100644 +--- a/libbb/kernel_version.c ++++ b/libbb/kernel_version.c +@@ -20,7 +20,7 @@ + int FAST_FUNC get_linux_version_code(void) + { + struct utsname name; +- char *s; ++ char *s, *t; + int i, r; + + if (uname(&name) == -1) { +@@ -31,7 +31,8 @@ int FAST_FUNC get_linux_version_code(void) + s = name.release; + r = 0; + for (i = 0; i < 3; i++) { +- r = r * 256 + atoi(strtok(s, ".")); ++ t = strtok(s, "."); ++ r = r * 256 + (t ? atoi(t) : 0); + s = NULL; + } + return r; +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/defconfig b/meta-openpli/recipes-core/busybox/busybox-1.19.4/defconfig new file mode 100644 index 0000000000..7f9a2075c6 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/defconfig @@ -0,0 +1,1013 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.19.4 +# Mon Mar 26 02:56:59 2012 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_PLATFORM_LINUX=y +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +CONFIG_FEATURE_COMPRESS_USAGE=y +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_INSTALL_NO_USR is not set +CONFIG_LOCALE_SUPPORT=y +CONFIG_UNICODE_SUPPORT=y +# CONFIG_UNICODE_USING_LOCALE is not set +CONFIG_FEATURE_CHECK_UNICODE_IN_ENV=y +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_LONG_OPTS=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +CONFIG_FEATURE_WTMP=y +CONFIG_FEATURE_PIDFILE=y +CONFIG_FEATURE_SUID=y +CONFIG_FEATURE_SUID_CONFIG=y +CONFIG_FEATURE_SUID_CONFIG_QUIET=y +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +CONFIG_FEATURE_HAVE_RPC=y + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_EXTRA_CFLAGS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_FEATURE_SYSTEMD=y +CONFIG_FEATURE_RTMINMAX=y +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +CONFIG_FEATURE_USE_TERMIOS=y +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +CONFIG_FEATURE_EDITING_VI=y +CONFIG_FEATURE_EDITING_HISTORY=63 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +CONFIG_FEATURE_REVERSE_SEARCH=y +CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +CONFIG_FEATURE_EDITING_ASK_TERMINAL=y +# CONFIG_FEATURE_NON_POSIX_CP is not set +CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y +CONFIG_FEATURE_COPYBUF_KB=64 +CONFIG_FEATURE_SKIP_ROOTFS=y +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_FEATURE_SEAMLESS_XZ=y +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +CONFIG_FEATURE_SEAMLESS_BZ2=y +CONFIG_FEATURE_SEAMLESS_GZ=y +CONFIG_FEATURE_SEAMLESS_Z=y +CONFIG_AR=y +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +CONFIG_BUNZIP2=y +# CONFIG_BZIP2 is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_GUNZIP=y +CONFIG_GZIP=y +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +# CONFIG_LZOP is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +# CONFIG_LZMA is not set +CONFIG_UNXZ=y +# CONFIG_XZ is not set +CONFIG_UNZIP=y + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_ID=y +CONFIG_GROUPS=y +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +CONFIG_TOUCH=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +# CONFIG_FEATURE_TR_EQUIV is not set +CONFIG_BASE64=y +CONFIG_WHO=y +CONFIG_USERS=y +# CONFIG_CAL is not set +# CONFIG_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_CHROOT=y +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_CUT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_DF=y +# CONFIG_FEATURE_DF_FANCY is not set +CONFIG_DIRNAME=y +CONFIG_DOS2UNIX=y +CONFIG_UNIX2DOS=y +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_FEATURE_ENV_LONG_OPTIONS=y +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +# CONFIG_FOLD is not set +# CONFIG_FSYNC is not set +CONFIG_HEAD=y +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_HOSTID is not set +# CONFIG_INSTALL is not set +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +CONFIG_NICE=y +CONFIG_NOHUP=y +CONFIG_OD=y +# CONFIG_PRINTENV is not set +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_SEQ=y +CONFIG_SHA1SUM=y +CONFIG_SHA256SUM=y +CONFIG_SHA512SUM=y +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_FEATURE_FLOAT_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +CONFIG_STTY=y +# CONFIG_SUM is not set +CONFIG_SYNC=y +# CONFIG_TAC is not set +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +CONFIG_UNIQ=y +CONFIG_USLEEP=y +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +CONFIG_CHVT=y +CONFIG_FGCONSOLE=y +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +CONFIG_KBD_MODE=y +CONFIG_LOADFONT=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +CONFIG_SETCONSOLE=y +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +CONFIG_SETFONT=y +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +CONFIG_SETKEYCODES=y +CONFIG_SETLOGCONS=y +CONFIG_SHOWKEY=y + +# +# Common options for loadfont and setfont +# +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set + +# +# Debian Utilities +# +CONFIG_MKTEMP=y +# CONFIG_PIPE_PROGRESS is not set +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_WHICH=y + +# +# Editors +# +CONFIG_PATCH=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=4096 +CONFIG_FEATURE_VI_8BIT=y +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +CONFIG_FEATURE_VI_REGEX_SEARCH=y +CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y +CONFIG_AWK=y +# CONFIG_FEATURE_AWK_LIBM is not set +CONFIG_CMP=y +CONFIG_DIFF=y +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +CONFIG_FEATURE_DIFF_DIR=y +# CONFIG_ED is not set +CONFIG_SED=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +CONFIG_FEATURE_FIND_DELETE=y +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +CONFIG_FEATURE_FIND_LINKS=y +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_HALT=y +CONFIG_FEATURE_CALL_TELINIT=y +CONFIG_TELINIT_PATH="/sbin/telinit" +# CONFIG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_INITRD is not set +CONFIG_INIT_TERMINAL_TYPE="" +# CONFIG_MESG is not set +# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set + +# +# Login/Password Management Utilities +# +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +CONFIG_FEATURE_SHADOWPASSWDS=y +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +CONFIG_ADDUSER=y +CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_FIRST_SYSTEM_ID=100 +CONFIG_LAST_SYSTEM_ID=999 +CONFIG_ADDGROUP=y +CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y +CONFIG_FEATURE_ADDUSER_TO_GROUP=y +CONFIG_DELUSER=y +CONFIG_DELGROUP=y +CONFIG_FEATURE_DEL_USER_FROM_GROUP=y +CONFIG_GETTY=y +CONFIG_LOGIN=y +# CONFIG_PAM is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +CONFIG_PASSWD=y +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_CRYPTPW is not set +# CONFIG_CHPASSWD is not set +CONFIG_SU=y +CONFIG_FEATURE_SU_SYSLOG=y +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +CONFIG_SULOGIN=y +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +CONFIG_LSATTR=y +CONFIG_TUNE2FS=y + +# +# Linux Module Utilities +# +CONFIG_MODINFO=y +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +CONFIG_INSMOD=y +CONFIG_RMMOD=y +CONFIG_LSMOD=y +CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y +CONFIG_MODPROBE=y +CONFIG_FEATURE_MODPROBE_BLACKLIST=y +CONFIG_DEPMOD=y + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +CONFIG_FEATURE_CHECK_TAINTED_MODULE=y +CONFIG_FEATURE_MODUTILS_ALIAS=y +CONFIG_FEATURE_MODUTILS_SYMBOLS=y +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +# CONFIG_BLOCKDEV is not set +# CONFIG_REV is not set +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKID is not set +# CONFIG_FEATURE_BLKID_TYPE is not set +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +CONFIG_FDISK=y +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +CONFIG_FEATURE_GPT_LABEL=y +CONFIG_FEATURE_FDISK_ADVANCED=y +CONFIG_FINDFS=y +CONFIG_FLOCK=y +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +CONFIG_MKFS_VFAT=y +CONFIG_GETOPT=y +CONFIG_FEATURE_GETOPT_LONG=y +CONFIG_HEXDUMP=y +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +CONFIG_HD=y +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +CONFIG_LOSETUP=y +CONFIG_LSPCI=y +CONFIG_LSUSB=y +CONFIG_MDEV=y +CONFIG_FEATURE_MDEV_CONF=y +CONFIG_FEATURE_MDEV_RENAME=y +CONFIG_FEATURE_MDEV_RENAME_REGEXP=y +CONFIG_FEATURE_MDEV_EXEC=y +CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y +CONFIG_MKSWAP=y +CONFIG_FEATURE_MKSWAP_UUID=y +CONFIG_MORE=y +CONFIG_MOUNT=y +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +CONFIG_FEATURE_MOUNT_HELPERS=y +CONFIG_FEATURE_MOUNT_LABEL=y +CONFIG_FEATURE_MOUNT_NFS=y +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +# CONFIG_PIVOT_ROOT is not set +CONFIG_RDATE=y +CONFIG_RDEV=y +CONFIG_READPROFILE=y +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +CONFIG_SWAPONOFF=y +# CONFIG_FEATURE_SWAPON_PRI is not set +CONFIG_SWITCH_ROOT=y +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +CONFIG_VOLUMEID=y + +# +# Filesystem/Volume identification +# +CONFIG_FEATURE_VOLUMEID_EXT=y +CONFIG_FEATURE_VOLUMEID_BTRFS=y +CONFIG_FEATURE_VOLUMEID_REISERFS=y +CONFIG_FEATURE_VOLUMEID_FAT=y +CONFIG_FEATURE_VOLUMEID_HFS=y +CONFIG_FEATURE_VOLUMEID_JFS=y +CONFIG_FEATURE_VOLUMEID_XFS=y +CONFIG_FEATURE_VOLUMEID_NTFS=y +CONFIG_FEATURE_VOLUMEID_ISO9660=y +CONFIG_FEATURE_VOLUMEID_UDF=y +CONFIG_FEATURE_VOLUMEID_LUKS=y +CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y +CONFIG_FEATURE_VOLUMEID_CRAMFS=y +CONFIG_FEATURE_VOLUMEID_ROMFS=y +CONFIG_FEATURE_VOLUMEID_SYSV=y +CONFIG_FEATURE_VOLUMEID_OCFS2=y +CONFIG_FEATURE_VOLUMEID_LINUXRAID=y + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +# CONFIG_FEATURE_LESS_MARKS is not set +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +CONFIG_FEATURE_LESS_ASK_TERMINAL=y +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +CONFIG_NANDWRITE=y +# CONFIG_NANDDUMP is not set +CONFIG_SETSERIAL=y +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +# CONFIG_ADJTIMEX is not set +CONFIG_BBCONFIG=y +CONFIG_FEATURE_COMPRESS_BBCONFIG=y +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +CONFIG_CHRT=y +CONFIG_CROND=y +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_DIR="/etc/cron" +CONFIG_CRONTAB=y +CONFIG_DC=y +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +CONFIG_DEVMEM=y +CONFIG_EJECT=y +CONFIG_FEATURE_EJECT_SCSI=y +# CONFIG_FBSPLASH is not set +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +CONFIG_FLASH_ERASEALL=y +CONFIG_IONICE=y +CONFIG_INOTIFYD=y +CONFIG_LAST=y +# CONFIG_FEATURE_LAST_SMALL is not set +CONFIG_FEATURE_LAST_FANCY=y +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +CONFIG_MICROCOM=y +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +CONFIG_READAHEAD=y +# CONFIG_RFKILL is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +CONFIG_SETSID=y +CONFIG_STRINGS=y +CONFIG_TASKSET=y +CONFIG_FEATURE_TASKSET_FANCY=y +CONFIG_TIME=y +CONFIG_TIMEOUT=y +# CONFIG_TTYSIZE is not set +CONFIG_VOLNAME=y +# CONFIG_WALL is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +CONFIG_NAMEIF=y +CONFIG_FEATURE_NAMEIF_EXTENDED=y +CONFIG_NBDCLIENT=y +CONFIG_NC=y +CONFIG_NC_SERVER=y +CONFIG_NC_EXTRA=y +# CONFIG_NC_110_COMPAT is not set +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +CONFIG_WHOIS=y +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +CONFIG_ARP=y +# CONFIG_ARPING is not set +CONFIG_BRCTL=y +CONFIG_FEATURE_BRCTL_FANCY=y +CONFIG_FEATURE_BRCTL_SHOW=y +# CONFIG_DNSD is not set +CONFIG_ETHER_WAKE=y +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTP_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_HOSTNAME=y +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_FEATURE_IFCONFIG_HW=y +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +CONFIG_IFUPDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +CONFIG_INETD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +# CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +CONFIG_NETSTAT=y +CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_FEATURE_NETSTAT_PRG=y +CONFIG_NSLOOKUP=y +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_PSCAN is not set +CONFIG_ROUTE=y +# CONFIG_SLATTACH is not set +# CONFIG_TCPSVD is not set +CONFIG_TELNET=y +CONFIG_FEATURE_TELNET_TTYPE=y +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_TELNETD=y +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +CONFIG_TFTP=y +# CONFIG_TFTPD is not set + +# +# Common options for tftp/tftpd +# +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_TFTP_DEBUG is not set +CONFIG_TRACEROUTE=y +CONFIG_TRACEROUTE6=y +CONFIG_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +CONFIG_FEATURE_TRACEROUTE_USE_ICMP=y +CONFIG_TUNCTL=y +CONFIG_FEATURE_TUNCTL_UG=y +# CONFIG_UDHCPD is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_DUMPLEASES is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +CONFIG_DHCPD_LEASES_FILE="" +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +CONFIG_FEATURE_UDHCP_8021Q=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b -H `hostname`" +# CONFIG_UDPSVD is not set +CONFIG_VCONFIG=y +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_FEATURE_WGET_TIMEOUT=y +# CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="us-ascii" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +CONFIG_IOSTAT=y +CONFIG_MPSTAT=y +CONFIG_NMETER=y +# CONFIG_PMAP is not set +CONFIG_POWERTOP=y +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +CONFIG_SMEMCAP=y +CONFIG_UPTIME=y +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_KILL=y +CONFIG_KILLALL=y +# CONFIG_KILLALL5 is not set +# CONFIG_PGREP is not set +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +# CONFIG_PKILL is not set +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +CONFIG_RENICE=y +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +CONFIG_WATCH=y + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_IDLE_TIMEOUT=y +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +# CONFIG_ASH_CMDCMD is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_MSH is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +CONFIG_FEATURE_BASH_IS_ASH=y +# CONFIG_FEATURE_BASH_IS_HUSH is not set +# CONFIG_FEATURE_BASH_IS_NONE is not set +CONFIG_SH_MATH_SUPPORT=y +# CONFIG_SH_MATH_SUPPORT_64 is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_FEATURE_SH_HISTFILESIZE=y + +# +# System Logging Utilities +# +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +CONFIG_FEATURE_SYSLOGD_DUP=y +CONFIG_FEATURE_SYSLOGD_CFG=y +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +CONFIG_FEATURE_IPC_SYSLOG=y +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16 +CONFIG_LOGREAD=y +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y +CONFIG_KLOGD=y +CONFIG_FEATURE_KLOGD_KLOGCTL=y +CONFIG_LOGGER=y diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd b/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd new file mode 100755 index 0000000000..cf50bcd546 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd @@ -0,0 +1,33 @@ +#!/bin/sh +# +# start/stop inetd super server. + +if ! [ -x /usr/sbin/inetd ]; then + exit 0 +fi + +case "$1" in + start) + echo -n "Starting internet superserver:" + echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null + echo "." + ;; + stop) + echo -n "Stopping internet superserver:" + echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null + echo "." + ;; + restart) + echo -n "Restarting internet superserver:" + echo -n " inetd " + killall -HUP inetd + echo "." + ;; + *) + echo "Usage: /etc/init.d/inetd {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 + diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd.conf b/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd.conf new file mode 100644 index 0000000000..f2b7ae1145 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/inetd.conf @@ -0,0 +1,22 @@ +# /etc/inetd.conf: see inetd(8) for further informations. +# +# Internet server configuration database +# +# If you want to disable an entry so it isn't touched during +# package updates just comment it out with a single '#' character. +# +# +# +#:INTERNAL: Internal services +#echo stream tcp nowait root internal +#echo dgram udp wait root internal +#chargen stream tcp nowait root internal +#chargen dgram udp wait root internal +#discard stream tcp nowait root internal +#discard dgram udp wait root internal +#daytime stream tcp nowait root internal +#daytime dgram udp wait root internal +#time stream tcp nowait root internal +#time dgram udp wait root internal +ftp stream tcp nowait root /usr/sbin/vsftpd vsftpd +telnet stream tcp nowait root /usr/sbin/telnetd telnetd diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev new file mode 100755 index 0000000000..4384fa1863 --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev @@ -0,0 +1,11 @@ +#!/bin/sh + +echo > /dev/mdev.seq + +echo "/sbin/mdev" >/proc/sys/kernel/hotplug + +touch /dev/.udev + +[ -d "/sys/kernel" ] || mount sysfs /sys -t sysfs + +mdev -s diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev-mount.sh b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev-mount.sh new file mode 100644 index 0000000000..c2416ac0ce --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev-mount.sh @@ -0,0 +1,99 @@ +#!/bin/sh + +notify() { + # we don't really depend on the hotplug_e2_helper, but when it exists, call it + if [ -x /usr/bin/hotplug_e2_helper ]; then + /usr/bin/hotplug_e2_helper $ACTION /block/$MDEV $PHYSDEVPATH + fi +} + +case "$ACTION" in + add|"") + ACTION="add" + # check if already mounted + if grep -q "^/dev/${MDEV} " /proc/mounts ; then + # Already mounted + exit 0 + fi + DEVBASE=`expr substr $MDEV 1 3` + # check for "please don't mount it" file + if [ -f "/dev/nomount.${DEVBASE}" ] ; then + # blocked + exit 0 + fi + # check for full-disk partition + if [ "${DEVBASE}" == "${MDEV}" ] ; then + if [ -d /sys/block/${DEVBASE}/${DEVBASE}1 ] ; then + # Partition detected, just tell and quit + notify + exit 0 + fi + if [ ! -f /sys/block/${DEVBASE}/size ] ; then + # No size at all + exit 0 + fi + if [ `cat /sys/block/${DEVBASE}/size` == 0 ] ; then + # empty device, bail out + exit 0 + fi + fi + # first allow fstab to determine the mountpoint + if ! mount /dev/$MDEV > /dev/null 2>&1 + then + # no fstab entry, use automatic mountpoint + REMOVABLE=`cat /sys/block/$DEVBASE/removable` + readlink -fn /sys/block/$DEVBASE/device | grep -qs 'pci' + EXTERNAL=$? + if [ "${REMOVABLE}" -eq "0" -a $EXTERNAL -eq 0 ]; then + # mount the first non-removable internal device on /media/hdd + DEVICETYPE="hdd" + else + MODEL=`cat /sys/block/$DEVBASE/device/model` + if [ "$MODEL" == "USB CF Reader " ]; then + DEVICETYPE="cf" + elif [ "$MODEL" == "Compact Flash " ]; then + DEVICETYPE="cf" + elif [ "$MODEL" == "USB SD Reader " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "USB SD Reader " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "SD/MMC " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "USB MS Reader " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "SM/xD-Picture " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "USB SM Reader " ]; then + DEVICETYPE="mmc1" + elif [ "$MODEL" == "MS/MS-Pro " ]; then + DEVICETYPE="mmc1" + else + DEVICETYPE="usb" + fi + fi + # Use mkdir as 'atomic' action, failure means someone beat us to the punch + MOUNTPOINT="/media/$DEVICETYPE" + if ! mkdir $MOUNTPOINT + then + MOUNTPOINT="/media/$MDEV" + mkdir -p $MOUNTPOINT + fi + mount -t auto /dev/$MDEV $MOUNTPOINT + fi + ;; + remove) + MOUNTPOINT=`grep "^/dev/$MDEV\s" /proc/mounts | cut -d' ' -f 2` + if [ -z "$MOUNTPOINT" ] + then + MOUNTPOINT="/media/$MDEV" + fi + umount $MOUNTPOINT || umount /dev/$MDEV + rmdir $MOUNTPOINT + ;; + *) + # Unexpected keyword + exit 1 + ;; +esac + +notify diff --git a/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev.conf b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev.conf new file mode 100644 index 0000000000..aa782ba34f --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox-1.19.4/mdev.conf @@ -0,0 +1,49 @@ +console 0:0 0600 +cpu_dma_latency 0:0 0660 +fb([0-2]) 0:0 0660 >fb/%1 +i2c-([0-9]) 0:0 0660 >i2c/%1 +mtd([0-9]) 0:0 0660 >mtd/%1 +mtdblock([0-9]) 0:0 0660 >mtdblock/%1 +full 0:0 0666 +initctl 0:0 0600 +ircomm[0-9].* 0:20 0660 +kmem 0:15 0640 +kmsg 0:0 0660 +log 0:0 0666 +loop[0-9].* 0:6 0640 +mem 0:15 0640 +network_latency 0:0 0660 +network_throughput 0:0 0660 +null 0:0 0666 +port 0:15 0640 +ptmx 0:5 0666 +ram[0-9].* 0:6 0640 +random 0:0 0666 +tty 0:5 0666 +tty.* 0:0 0620 +urandom 0:0 0666 +usbdev.* 0:0 0660 +vcs.* 0:5 0660 +zero 0:0 0666 +tun[0-9]* 0:0 0640 =net/ + +pcm.* 0:0 0660 =snd/ +control.* 0:0 0660 =snd/ +timer 0:0 0660 =snd/ + +event.* 0:0 0660 =input/ +mice 0:0 0660 =input/ +mouse.* 0:0 0660 =input/ + +rtc0 0:0 0666 =misc/rtc + +[hs]d[a-z][0-9]? 0:0 664 */etc/mdev/mdev-mount.sh +sr0 0:0 664 */usr/bin/bdpoll sr0 -c + +dvb([0-9])\.(.*)([0-9]) 0:0 660 >dvb/adapter%1/%2%3 + +lcd0 0:0 660 =dbox/lcd0 +oled0 0:0 660 =dbox/oled0 +dboxlcd 0:0 660 =dbox/lcd0 +pvr 0:0 660 =misc/pvr +vtuner([0-3]) 0:0 660 =misc/ diff --git a/meta-openpli/recipes-core/busybox/busybox_1.19.4.bbappend b/meta-openpli/recipes-core/busybox/busybox_1.19.4.bbappend new file mode 100644 index 0000000000..9c9e8008ed --- /dev/null +++ b/meta-openpli/recipes-core/busybox/busybox_1.19.4.bbappend @@ -0,0 +1,39 @@ +PRINC = "6" + +SRC_URI += " \ + file://0001-ifupdown-support-post-up-pre-down-hooks.patch \ + file://0002-ifupdown-code-shrink.patch \ + file://0003-ifupdown-remove-interface-from-state_list-if-iface_u.patch \ + file://0004-ifupdown-support-metric-for-static-default-gw.patch \ + file://0005-ifupdown-improve-compatibility-with-Debian.patch \ + file://0006-get_linux_version_code-don-t-fail-on-3.0-foo.patch" + +SRC_URI += " \ + file://0001-work-around-linux-ext2_fs.h-breakage.patch \ + file://0002-Create-and-use-our-own-copy-of-linux-ext2_fs.h.patch \ + file://0003-Drop-include-bb_linux_ext2_fs.h-use-existing-e2fspro.patch \ + " + +SRC_URI += " \ + file://mdev-mount.sh \ + file://inetd \ + file://inetd.conf \ + " + +PACKAGES =+ "${PN}-inetd" +INITSCRIPT_PACKAGES += "${PN}-inetd" +INITSCRIPT_NAME_${PN}-inetd = "inetd.${BPN}" +CONFFILES_${PN}-inetd = "${sysconfdir}/inetd.conf" +FILES_${PN}-inetd = "${sysconfdir}/init.d/inetd.${BPN} ${sysconfdir}/inetd.conf" + +RRECOMMENDS_${PN} += "${PN}-inetd" + +do_install_append() { + if grep -q "CONFIG_CRONTAB=y" ${WORKDIR}/defconfig; then + install -d ${D}${sysconfdir}/cron/crontabs + fi + install -d ${D}${sysconfdir}/mdev + install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev +} + +FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" diff --git a/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/autofoo.patch b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/autofoo.patch new file mode 100644 index 0000000000..9eb2b874a7 --- /dev/null +++ b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/autofoo.patch @@ -0,0 +1,125 @@ +--- libsigc++-1.2.5-old/configure.in 2003-05-14 10:04:25.000000000 +0200 ++++ libsigc++-1.2.5/configure.in 2004-07-03 10:00:13.000000000 +0200 +@@ -35,9 +35,9 @@ + dnl AC_SUBST(SIGC_RELEASE, $SIGC_RELEASE) + AC_SUBST(SIGC_VERSION) + +-AC_DEFINE_UNQUOTED(SIGC_MAJOR_VERSION, $SIGC_MAJOR_VERSION) +-AC_DEFINE_UNQUOTED(SIGC_MINOR_VERSION, $SIGC_MINOR_VERSION) +-AC_DEFINE_UNQUOTED(SIGC_MICRO_VERSION, $SIGC_MICRO_VERSION) ++AC_DEFINE_UNQUOTED(SIGC_MAJOR_VERSION, $SIGC_MAJOR_VERSION, [library major version]) ++AC_DEFINE_UNQUOTED(SIGC_MINOR_VERSION, $SIGC_MINOR_VERSION, [library minor version]) ++AC_DEFINE_UNQUOTED(SIGC_MICRO_VERSION, $SIGC_MICRO_VERSION, [library micro version]) + + AC_CONFIG_AUX_DIR(scripts) + +@@ -50,6 +50,23 @@ + + dnl Specify a configuration file + AM_CONFIG_HEADER(sigc++/config/sigcconfig.h) ++AH_BOTTOM([ ++// Window DLL declarations ++ ++#ifdef LIBSIGC_DLL ++ #if defined(LIBSIGC_COMPILATION) && defined(DLL_EXPORT) ++ #define LIBSIGC_API __declspec(dllexport) ++ #define LIBSIGC_TMPL ++ #elif !defined(LIBSIGC_COMPILATION) ++ #define LIBSIGC_API __declspec(dllimport) ++ #define LIBSIGC_TMPL extern ++ #else ++ #define LIBSIGC_API ++ #endif /* LIBSIGC_COMPILATION - DLL_EXPORT */ ++#else ++ #define LIBSIGC_API ++#endif /* LIBSIGC_DLL */ ++]) + + AM_MAINTAINER_MODE + +@@ -288,10 +307,10 @@ + }; + ],[ + ], +- AC_DEFINE(SIGC_CXX_EXPLICIT,explicit) ++ AC_DEFINE(SIGC_CXX_EXPLICIT,explicit,[if C++ compiler supports explicit]) + ac_cxx_explicit=yes + , +- AC_DEFINE(SIGC_CXX_EXPLICIT,) ++ AC_DEFINE(SIGC_CXX_EXPLICIT) + ac_cxx_explicit=no + ) + AC_MSG_RESULT([$ac_cxx_explicit]) +@@ -305,7 +324,7 @@ + }; + ],[ + ], +- AC_DEFINE(SIGC_CXX_EXPLICIT_COPY,explicit) ++ AC_DEFINE(SIGC_CXX_EXPLICIT_COPY,explicit,[if C++ compiler supports explicit copy ctor]) + ac_cxx_explicit_copy_ctor=yes + , + AC_DEFINE(SIGC_CXX_EXPLICIT_COPY,) +@@ -413,7 +432,7 @@ + k a; + ],[ + ac_cxx_partial_specialization=yes +- AC_DEFINE(SIGC_CXX_PARTIAL_SPEC) ++ AC_DEFINE(SIGC_CXX_PARTIAL_SPEC,,[if C++ compiler supports partial specialization]) + ],[ + # config_error=yes + ac_cxx_partial_specialization=no +@@ -434,7 +453,7 @@ + ],[ + ac_cxx_namespaces=yes + AC_MSG_RESULT([$ac_cxx_namespaces]) +- AC_DEFINE(SIGC_CXX_NAMESPACES) ++ AC_DEFINE(SIGC_CXX_NAMESPACES,,[if C++ compiler supports name spaces]) + ],[ + ac_cxx_namespaces=no + AC_MSG_RESULT([$ac_cxx_namespaces]) +@@ -474,7 +493,7 @@ + A i; + ],[ + ],[ +- AC_DEFINE(SIGC_CXX_INT_CTOR) ++ AC_DEFINE(SIGC_CXX_INT_CTOR,,[if C++ compiler has intrinsic constructors]) + ac_cxx_tmpl_intctor=yes + ],[ + ac_cxx_tmpl_intctor=no +@@ -515,7 +534,7 @@ + ],[ + ],[ + ac_cxx_void_return=yes +- AC_DEFINE(SIGC_CXX_VOID_RETURN) ++ AC_DEFINE(SIGC_CXX_VOID_RETURN,,[if C++ compiler allows void returns]) + ],[ + ac_cxx_void_return=no + ]) +@@ -530,7 +549,7 @@ + ],[ + ],[ + ac_cxx_void_cast_return=yes +- AC_DEFINE(SIGC_CXX_VOID_CAST_RETURN) ++ AC_DEFINE(SIGC_CXX_VOID_CAST_RETURN,,[if C++ compiler supports void cast return]) + ],[ + ac_cxx_void_cast_return=no + ]) +@@ -565,7 +584,7 @@ + P::ptr q=b; + ],[ + ac_cxx_specialize_references=yes +- AC_DEFINE(SIGC_CXX_SPECIALIZE_REFERENCES) ++ AC_DEFINE(SIGC_CXX_SPECIALIZE_REFERENCES,,[if C++ compiler allows specialization of references]) + ],[ + ac_cxx_specialize_references=no + ]) +--- libsigc++-1.2.5-old/Makefile.am 2004-06-27 12:45:19.000000000 +0200 ++++ libsigc++-1.2.5/Makefile.am 2004-07-03 08:40:44.000000000 +0200 +@@ -1,6 +1,6 @@ + SUBDIRS = sigc++ tests doc + DIST_SUBDIRS = $(SUBDIRS) examples scripts MSVC_6 MSVC_Net2003 +-ACLOCAL_AMFLAGS = -I $(srcdir)/scripts ++ACLOCAL_AMFLAGS = -I ./scripts + + EXTRA_DIST = \ + FEATURES IDEAS \ diff --git a/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/fix-install.patch b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/fix-install.patch new file mode 100644 index 0000000000..1cdfedbc07 --- /dev/null +++ b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/fix-install.patch @@ -0,0 +1,15 @@ +upstream: unmaintained + +| ...build/tmp/sysroots/i686-linux/usr/bin/install: will not overwrite just-created `...build/tmp/work/mipsel-oe-linux/libsigc++-1.2-1.2.5-r2/image/usr/include/sigc++-1.2/sigc++/method_slot.h' with `method_slot.h' + +--- libsigc++-1.2.7/sigc++/Makefile.am.orig 2010-09-24 12:03:24.000000000 +0000 ++++ libsigc++-1.2.7/sigc++/Makefile.am 2010-09-24 12:03:30.000000000 +0000 +@@ -12,7 +12,7 @@ + sigc_built_h = bind_return.h \ + object_slot.h retype_return.h slot.h bind.h \ + class_slot.h hide.h retype.h signal.h \ +- method_slot.h method_slot.h ++ method_slot.h + + built_sources = $(sigc_built_cc) $(sigc_built_h) + dist_sources = $(sigc_fixed_cc) $(sigc_fixed_h) diff --git a/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/pkgconfig.patch b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/pkgconfig.patch new file mode 100644 index 0000000000..7495a4d34e --- /dev/null +++ b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/pkgconfig.patch @@ -0,0 +1,13 @@ + +# +# Patch managed by http://www.holgerschurig.de/patcher.html +# + +--- libsigc++-1.2.5/sigc++-1.2.pc.in~pkgconfig ++++ libsigc++-1.2.5/sigc++-1.2.pc.in +@@ -7,4 +7,4 @@ + Description: Type-safe signal and callback system for C++ + Version: @VERSION@ + Libs: -L${libdir} -lsigc-1.2 +-Cflags: -I${exec_prefix}/lib/sigc++-1.2/include -I${includedir}/sigc++-1.2 ++Cflags: -I${libdir}/sigc++-1.2/include -I${includedir}/sigc++-1.2 diff --git a/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/to_1.2.7.patch b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/to_1.2.7.patch new file mode 100644 index 0000000000..21fa72931b --- /dev/null +++ b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2-1.2.5/to_1.2.7.patch @@ -0,0 +1,159 @@ +diff -Naur libsigc++-1.2.5/sigc++/macros/signal.h.m4 libsigc++-1.2.7/sigc++/macros/signal.h.m4 +--- libsigc++-1.2.5/sigc++/macros/signal.h.m4 2003-03-06 09:06:12.000000000 +0100 ++++ libsigc++-1.2.7/sigc++/macros/signal.h.m4 2005-01-29 00:10:34.000000000 +0100 +@@ -82,6 +82,8 @@ + bool empty(); + void clear(); + void cleanup(); // nothrow ++ private: ++ void _remove(SignalConnectionNode* c); + }; + + class LIBSIGC_API SignalBase +diff -Naur libsigc++-1.2.5/sigc++/object.h libsigc++-1.2.7/sigc++/object.h +--- libsigc++-1.2.5/sigc++/object.h 2003-05-08 21:35:11.000000000 +0200 ++++ libsigc++-1.2.7/sigc++/object.h 2012-02-14 13:08:00.193044640 +0100 +@@ -69,7 +69,7 @@ + virtual void unreference() const; + virtual void set_manage(); + +- ObjectBase& operator=(const ObjectBase& /* o */) ++ ObjectBase& operator=(const ObjectBase& o) + { return *this; } + + ObjectBase() +@@ -79,7 +79,11 @@ + : control_(0) {} + + virtual ~ObjectBase()=0; +- ++ ++ Control_* control() const ++ { ++ return const_cast(this)->control(); ++ } + Control_* control() + { + if (!control_) +@@ -129,7 +133,6 @@ + template + Ptr(const Ptr& p2) + { +- T* test_assignment_ = (T2*)0; + assign( p2.get() ); + } + +@@ -144,7 +147,7 @@ + + template + Ptr& operator=(const Ptr& p2) +- { T *test_assignment_=(T2*)0; reset(p2.get()); return *this; } ++ { reset(p2.get()); return *this; } + + Ptr& operator=(const Ptr& p) + { reset(p.get()); return *this; } +@@ -175,7 +178,7 @@ + if (control_) + control_->ref(); + } +- ++ + void reset(T* t = 0) + { + if (object_ == t) +@@ -197,4 +200,3 @@ + + + #endif // SIGC_OBJECT +- +diff -Naur libsigc++-1.2.5/sigc++/signal.cc libsigc++-1.2.7/sigc++/signal.cc +--- libsigc++-1.2.5/sigc++/signal.cc 2002-12-12 20:18:24.000000000 +0100 ++++ libsigc++-1.2.7/sigc++/signal.cc 2005-01-29 00:10:34.000000000 +0100 +@@ -93,33 +93,11 @@ + defered_ = false; + + SignalConnectionNode* i = begin_; +- +- while(begin_ && begin_->defered_) +- begin_ = begin_->next_; +- +- while(end_ && end_->defered_) +- end_ = end_->prev_; +- +- // Hmm, this looks a bit tricky to me. The code above removes all +- // elements from the front and the back that have defered_ = true set. +- // But the following loop unreferences *all* defered elements, including +- // those that are still in the list. +- // +- // I don't know whether this is a bug -- it's possible that defered nodes +- // are always at the front or back. If not, a node could be unreferenced +- // twice which is bad. +- // +- // --Daniel +- + while(i) + { + SignalConnectionNode* next = i->next_; +- + if(i->defered_) +- { +- i->parent_ = 0; +- i->unreference(); +- } ++ _remove(i); + + i = next; + } +@@ -141,7 +119,7 @@ + begin_->prev_=c; + else + end_=c; +- end_=c; ++ begin_=c; + return c; + } + +@@ -161,21 +139,8 @@ + + void SignalNode::remove(SignalConnectionNode* c) + { +- if (!exec_count_) +- { +- if (c->prev_) +- c->prev_->next_=c->next_; +- else +- begin_=c->next_; +- +- if (c->next_) +- c->next_->prev_=c->prev_; +- else +- end_=c->prev_; +- +- c->parent_ = 0; +- c->unreference(); +- } ++ if(!exec_count_) ++ _remove(c); + else + { + c->defered_=true; +@@ -184,6 +149,19 @@ + } + } + ++void SignalNode::_remove(SignalConnectionNode* c) ++ { ++ if (c->prev_) ++ c->prev_->next_=c->next_; ++ else ++ begin_=c->next_; ++ if (c->next_) ++ c->next_->prev_=c->prev_; ++ else ++ end_=c->prev_; ++ c->parent_ = 0; ++ c->unreference(); ++ } + + + /**********************************************************/ diff --git a/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2_1.2.5.bb b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2_1.2.5.bb new file mode 100644 index 0000000000..632a6f556a --- /dev/null +++ b/meta-openpli/recipes-core/libsigc++-1.2/libsigc++-1.2_1.2.5.bb @@ -0,0 +1,21 @@ +SUMMARY = "A library for loose coupling of C++ method calls" +SECTION = "libs" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" +PR = "r2" + +SRC_URI = "${SOURCEFORGE_MIRROR}/libsigc/libsigc++-${PV}.tar.gz \ + file://autofoo.patch \ + file://fix-install.patch \ + file://pkgconfig.patch \ + file://to_1.2.7.patch" +SRC_URI[md5sum] = "d0d1ffcae0eced97ef4f17ce0ba81352" +SRC_URI[sha256sum] = "dcd6d3ea9a2c185b5286f80eefe9ac1402036b8fa21cfc742442d99579bd2b3e" + +S = "${WORKDIR}/libsigc++-${PV}" + +inherit autotools pkgconfig + +EXTRA_AUTORECONF = "--exclude=autoheader" + +FILES_${PN}-dev += "${libdir}/sigc++-*/" diff --git a/meta-openpli/recipes-core/sysvinit/sysvinit-inittab/inittab b/meta-openpli/recipes-core/sysvinit/sysvinit-inittab/inittab new file mode 100644 index 0000000000..7624b0630c --- /dev/null +++ b/meta-openpli/recipes-core/sysvinit/sysvinit-inittab/inittab @@ -0,0 +1,32 @@ +# /etc/inittab: init(8) configuration. +# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ + +# The default runlevel. +id:3:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +gui:3:respawn:/usr/bin/enigma2.sh diff --git a/meta-openpli/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta-openpli/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb new file mode 100644 index 0000000000..8fc01818ce --- /dev/null +++ b/meta-openpli/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Inittab for sysvinit" + +require conf/license/openpli-gplv2.inc + +PR = "r6" + +SRC_URI = "file://inittab" + +S = "${WORKDIR}/sysvinit-${PV}" + +INHIBIT_DEFAULT_DEPS = "1" + +do_compile() { + : +} + +do_install() { + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab +} diff --git a/meta-openpli/recipes-core/udev/udev-124/41-od-linux-2.6.18-misc.rules b/meta-openpli/recipes-core/udev/udev-124/41-od-linux-2.6.18-misc.rules new file mode 100644 index 0000000000..fe7521febe --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/41-od-linux-2.6.18-misc.rules @@ -0,0 +1,21 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +KERNEL=="fp0", NAME="dbox/fp0" +KERNEL=="oled0", NAME="dbox/oled0" +KERNEL=="lcd0", NAME="dbox/lcd0" +KERNEL=="hsm0", NAME="misc/hsm0" +KERNEL=="vtuner0", NAME="misc/vtuner0" +KERNEL=="vtuner1", NAME="misc/vtuner1" diff --git a/meta-openpli/recipes-core/udev/udev-124/50-hostap_cs.rules b/meta-openpli/recipes-core/udev/udev-124/50-hostap_cs.rules new file mode 100644 index 0000000000..efefdc58fc --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/50-hostap_cs.rules @@ -0,0 +1,4 @@ +# hostap_cs needs ignore_cis_vcc=1 set - this should handle all cards +# +ACTION=="add", DEVICE=="hostap_cs", \ + SYSFS{func_id}=="0x06", RUN+="/sbin/modprobe hostap_cs ignore_cis_vcc=1" diff --git a/meta-openpli/recipes-core/udev/udev-124/default b/meta-openpli/recipes-core/udev/udev-124/default new file mode 100644 index 0000000000..d0050b873c --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/default @@ -0,0 +1,4 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" diff --git a/meta-openpli/recipes-core/udev/udev-124/devfs-udev.rules b/meta-openpli/recipes-core/udev/udev-124/devfs-udev.rules new file mode 100644 index 0000000000..0ba1ad4e7f --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/devfs-udev.rules @@ -0,0 +1,108 @@ +# The use of these rules is not recommended or supported. +# In a world where devices can come and go at any time, the devfs scheme +# of simple device enumeration does not help _anything_. Just forget about +# it. Use custom rules to name your device or look at the persistent device +# naming scheme, which is implemented for disks and add your subsystem. + +# ide block devices +BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}" + +# md block devices +KERNEL="md[0-9]*", NAME="md/%n" + +# floppy devices +KERNEL="fd[0-9]*", NAME="floppy/%n" + +# tty devices +KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k" +KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k" +KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n" + +# vc devices +KERNEL="vcs", NAME="vcc/0" +KERNEL="vcs[0-9]*", NAME="vcc/%n" +KERNEL="vcsa", NAME="vcc/a0" +KERNEL="vcsa[0-9]*", NAME="vcc/a%n" + +# v4l devices +KERNEL="video[0-9]*", NAME="v4l/video%n" +KERNEL="radio[0-9]*", NAME="v4l/radio%n" +KERNEL="vbi[0-9]*", NAME="v4l/vbi%n" +KERNEL="vtx[0-9]*", NAME="v4l/vtx%n" + +# dm devices (ignore them) +KERNEL="dm-[0-9]*", NAME="" + +# i2c devices +KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k" + +# loop devices +KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k" + +# ramdisks +KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k" + +# framebuffer devices +KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k" + +# misc +KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" +KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" +KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k" +KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" +KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" +KERNEL="uinput", NAME="misc/%k", SYMLINK="%k" + +# alsa devices +KERNEL="controlC[0-9]*", NAME="snd/%k" +KERNEL="hw[CD0-9]*", NAME="snd/%k" +KERNEL="pcm[CD0-9cp]*", NAME="snd/%k" +KERNEL="midi[CD0-9]*", NAME="snd/%k" +KERNEL="timer", NAME="snd/%k" +KERNEL="seq", NAME="snd/%k" + +# oss devices +KERNEL="audio*", NAME="sound/%k", SYMLINK="%k" +KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k" +KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k" +KERNEL="midi*", NAME="sound/%k", SYMLINK="%k" +KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k" +KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k" + +# input devices +KERNEL="mice", NAME="input/%k" +KERNEL="mouse*", NAME="input/%k" +KERNEL="event*", NAME="input/%k" +KERNEL="js*", NAME="input/%k" +KERNEL="ts*", NAME="input/%k" + +# USB devices +KERNEL="hiddev*", NAME="usb/%k" +KERNEL="auer*", NAME="usb/%k" +KERNEL="legousbtower*", NAME="usb/%k" +KERNEL="dabusb*", NAME="usb/%k" +BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k" + +# netlink devices +KERNEL="route", NAME="netlink/%k" +KERNEL="skip", NAME="netlink/%k" +KERNEL="usersock", NAME="netlink/%k" +KERNEL="fwmonitor", NAME="netlink/%k" +KERNEL="tcpdiag", NAME="netlink/%k" +KERNEL="nflog", NAME="netlink/%k" +KERNEL="xfrm", NAME="netlink/%k" +KERNEL="arpd", NAME="netlink/%k" +KERNEL="route6", NAME="netlink/%k" +KERNEL="ip6_fw", NAME="netlink/%k" +KERNEL="dnrtmsg", NAME="netlink/%k" +KERNEL="tap*", NAME="netlink/%k" + +# CAPI devices +KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20" +KERNEL="capi*", NAME="capi/%n" + +# Network devices +KERNEL="tun", NAME="net/%k" + +# raw devices +KERNEL="raw[0-9]*", NAME="raw/%k" diff --git a/meta-openpli/recipes-core/udev/udev-124/flags.patch b/meta-openpli/recipes-core/udev/udev-124/flags.patch new file mode 100644 index 0000000000..13f20eb6a8 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/flags.patch @@ -0,0 +1,56 @@ +--- + Makefile | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +Index: udev-115/Makefile +=================================================================== +--- udev-115.orig/Makefile 2007-08-24 01:29:54.000000000 +0200 ++++ udev-115/Makefile 2007-09-20 17:21:45.000000000 +0200 +@@ -112,39 +112,39 @@ + AR = $(CROSS_COMPILE)ar + RANLIB = $(CROSS_COMPILE)ranlib + +-CFLAGS += -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ++override CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 + WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \ + -Wchar-subscripts -Wmissing-declarations -Wnested-externs \ + -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes +-CFLAGS += $(WARNINGS) ++override CFLAGS += $(WARNINGS) + + LDFLAGS += -Wl,-warn-common,--as-needed + + OPTFLAGS = -Os +-CFLAGS += $(OPTFLAGS) ++override CFLAGS += $(OPTFLAGS) + + ifeq ($(strip $(USE_LOG)),true) +- CFLAGS += -DUSE_LOG ++ override CFLAGS += -DUSE_LOG + endif + + # if DEBUG is enabled, then we do not strip + ifeq ($(strip $(DEBUG)),true) +- CFLAGS += -DDEBUG ++ override CFLAGS += -DDEBUG + endif + + ifeq ($(strip $(USE_GCOV)),true) +- CFLAGS += -fprofile-arcs -ftest-coverage ++ override CFLAGS += -fprofile-arcs -ftest-coverage + LDFLAGS += -fprofile-arcs + endif + + ifeq ($(strip $(USE_SELINUX)),true) + UDEV_OBJS += udev_selinux.o + LIB_OBJS += -lselinux -lsepol +- CFLAGS += -DUSE_SELINUX ++ override CFLAGS += -DUSE_SELINUX + endif + + ifeq ($(strip $(USE_STATIC)),true) +- CFLAGS += -DUSE_STATIC ++ override CFLAGS += -DUSE_STATIC + LDFLAGS += -static + endif + diff --git a/meta-openpli/recipes-core/udev/udev-124/init b/meta-openpli/recipes-core/udev/udev-124/init new file mode 100644 index 0000000000..ce7f40babb --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/init @@ -0,0 +1,79 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x /sbin/udevd ] || exit 1 +[ -f /etc/default/udev ] && . /etc/default/udev +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +kill_udevd() { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +export ACTION=add +# propagate /dev from /sys +echo -n "Starting udev" + +# mount the tmpfs on /dev, if not already done +LANG=C awk "\$2 == \"/dev\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && { + mount -n -o mode=0755 -t tmpfs none "/dev" + mkdir -m 0755 /dev/pts + mkdir -m 0755 /dev/shm +} + +if [ "$DEVCACHE" != "" ]; then + # Invalidate udev cache if the kernel or its bootargs/cmdline have changed + [ -x /bin/uname ] && /bin/uname -mrspv > /tmp/uname || touch /tmp/uname + [ -r /proc/cmdline ] && cat /proc/cmdline > /tmp/cmdline || touch /tmp/cmdline + [ -r /proc/atags ] && cat /proc/atags > /tmp/atags || touch /tmp/atags + if [ -e $DEVCACHE ] && \ + cmp -s /tmp/uname /etc/udev/saved.uname && \ + cmp -s /tmp/cmdline /etc/udev/saved.cmdline && \ + cmp -s /tmp/atags /etc/udev/saved.atags; then + (cd /; tar xf $DEVCACHE) + not_first_boot=1 + fi +fi + +# make_extra_nodes +kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + /sbin/udevd -d + + /sbin/udevadm control env STARTUP=1 + if [ "$not_first_boot" != "" ];then + /sbin/udevadm trigger --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform + (/sbin/udevadm settle --timeout=3; /sbin/udevadm control env STARTUP=)& + if [ "$DEVCACHE" != "" ]; then + rm -f /tmp/uname + rm -f /tmp/cmdline + rm -f /tmp/atags + fi + else + /sbin/udevadm trigger + /sbin/udevadm settle + if [ "$DEVCACHE" != "" ]; then + echo -n " and populating dev cache" + (cd /; tar cf $DEVCACHE dev) + mv /tmp/uname /etc/udev/saved.uname + mv /tmp/cmdline /etc/udev/saved.cmdline + mv /tmp/atags /etc/udev/saved.atags + fi + fi + +echo +exit 0 diff --git a/meta-openpli/recipes-core/udev/udev-124/libvolume-id-soname.patch b/meta-openpli/recipes-core/udev/udev-124/libvolume-id-soname.patch new file mode 100644 index 0000000000..56365a4351 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/libvolume-id-soname.patch @@ -0,0 +1,12 @@ +diff -uNr udev-124-orig/extras/volume_id/lib/Makefile udev-124/extras/volume_id/lib/Makefile +--- udev-124-orig/extras/volume_id/lib/Makefile 2008-06-12 01:24:30.000000000 -0400 ++++ udev-124/extras/volume_id/lib/Makefile 2009-01-14 23:32:42.000000000 -0500 +@@ -113,7 +113,7 @@ + ifeq ($(libdir),$(usrlibdir)) + ln -sf $(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so + else +- ln -sf $(libdir)/$(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so ++ ln -sf ../..$(libdir)/$(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so + endif + $(INSTALL) -d $(DESTDIR)$(usrlibdir)/pkgconfig + $(INSTALL_DATA) libvolume_id.pc $(DESTDIR)$(usrlibdir)/pkgconfig/libvolume_id.pc diff --git a/meta-openpli/recipes-core/udev/udev-124/links.conf b/meta-openpli/recipes-core/udev/udev-124/links.conf new file mode 100644 index 0000000000..a9f8b58b27 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/links.conf @@ -0,0 +1,24 @@ +# This file does not exist. Please do not ask the debian maintainer about it. +# You may use it to do strange and wonderful things, at your risk. + +L fd /proc/self/fd +L stdin /proc/self/fd/0 +L stdout /proc/self/fd/1 +L stderr /proc/self/fd/2 +L core /proc/kcore +L sndstat /proc/asound/oss/sndstat +L MAKEDEV /sbin/MAKEDEV + +D pts +D shm + +M null c 1 3 +M console c 5 1 + +# Hic sunt leones. +M ppp c 108 0 +D loop +M loop/0 b 7 0 +D net +M net/tun c 10 200 + diff --git a/meta-openpli/recipes-core/udev/udev-124/local.rules b/meta-openpli/recipes-core/udev/udev-124/local.rules new file mode 100644 index 0000000000..a4866923fd --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/local.rules @@ -0,0 +1,32 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + +# Handle network interface setup +SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" +SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" + +# The first rtc device is symlinked to /dev/rtc +KERNEL=="rtc0", SYMLINK+="rtc" + +# Try and modprobe for drivers for new hardware +ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" + +# Create a symlink to any touchscreen input device +SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" +SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" diff --git a/meta-openpli/recipes-core/udev/udev-124/mount.blacklist b/meta-openpli/recipes-core/udev/udev-124/mount.blacklist new file mode 100644 index 0000000000..d3ebb17176 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/mount.blacklist @@ -0,0 +1,3 @@ +/dev/loop +/dev/ram +/dev/mtdblock diff --git a/meta-openpli/recipes-core/udev/udev-124/mount.sh b/meta-openpli/recipes-core/udev/udev-124/mount.sh new file mode 100644 index 0000000000..440dcee57b --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/mount.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# Called from udev +# Attemp to mount any added block devices +# and remove any removed devices +# + +MOUNT="/bin/mount" +PMOUNT="/usr/bin/pmount" +UMOUNT="/bin/umount" +name="`basename "$DEVNAME"`" + +for line in `cat /etc/udev/mount.blacklist | grep -v ^#` +do + if ( echo "$DEVNAME" | grep -q "$line" ) + then + logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" + exit 0 + fi +done + +automount() { + ! test -d "/media/$name" && mkdir -p "/media/$name" + + if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name" + then + #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!" + rm_dir "/media/$name" + else + logger "mount.sh/automount" "Auto-mount of [/media/$name] successful" + touch "/tmp/.automount-$name" + fi +} + +rm_dir() { + # We do not want to rm -r populated directories + if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1" + then + ! test -z "$1" && rm -r "$1" + else + logger "mount.sh/automount" "Not removing non-empty directory [$1]" + fi +} + +if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then + if [ -x "$PMOUNT" ]; then + $PMOUNT $DEVNAME 2> /dev/null + elif [ -x $MOUNT ]; then + $MOUNT $DEVNAME 2> /dev/null + fi + + # If the device isn't mounted at this point, it isn't configured in fstab + # 20061107: Small correction: The rootfs partition may be called just "rootfs" and not by + # its true device name so this would break. If the rootfs is mounted on two places + # during boot, it confuses the heck out of fsck. So Im auto-adding the root-partition + # to /etc/udev/mount.blacklist via postinst + + cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount + +fi + + + +if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then + for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " ` + do + $UMOUNT -l $mnt + done + + # Remove empty directories from auto-mounter + test -e "/tmp/.automount-$name" && rm_dir "/media/$name" +fi diff --git a/meta-openpli/recipes-core/udev/udev-124/mtd-exclude-persistent.patch b/meta-openpli/recipes-core/udev/udev-124/mtd-exclude-persistent.patch new file mode 100644 index 0000000000..204b7b487d --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/mtd-exclude-persistent.patch @@ -0,0 +1,13 @@ +Copyright (c) 2009 MontaVista Software, Inc. All rights reserved. + +--- a/etc/udev/rules.d/60-persistent-storage.rules 2008-06-12 07:24:30.000000000 +0200 ++++ b/etc/udev/rules.d/60-persistent-storage.rules 2009-08-18 11:39:23.595063264 +0200 +@@ -10,7 +10,7 @@ + SUBSYSTEM!="block", GOTO="persistent_storage_end" + + # skip rules for inappropriate block devices +-KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" ++KERNEL=="ram*|loop*|fd*|mtd*|nbd*|gnbd*|dm-*|md*|btibm*", GOTO="persistent_storage_end" + + # never access non-cdrom removable ide devices, the drivers are causing event loops on open() + KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end" diff --git a/meta-openpli/recipes-core/udev/udev-124/network.sh b/meta-openpli/recipes-core/udev/udev-124/network.sh new file mode 100644 index 0000000000..d287855221 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/network.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# udevd does clearenv(). Export shell PATH to children. +export PATH + +# Do not run when pcmcia-cs is installed +test -x /sbin/cardctl && exit 0 + +# We get two "add" events for hostap cards due to wifi0 +echo "$INTERFACE" | grep -q wifi && exit 0 + +# Avoid udev stopping persistent ppp connections +echo "$INTERFACE" | grep -q ppp && exit 0 + +# Check if /etc/init.d/network has been run yet to see if we are +# called by starting /etc/rcS.d/S03udev and not by hotplugging a device +# +# At this stage, network interfaces should not be brought up +# automatically because: +# a) /etc/init.d/network has not been run yet (security issue) +# b) /var has not been populated yet so /etc/resolv,conf points to +# oblivion, making the network unusable +# + +spoofp="`grep ^spoofprotect /etc/network/options`" +if test -z "$spoofp" +then + # This is the default from /etc/init.d/network + spoofp_val=yes +else + spoofp_val=${spoofp#spoofprotect=} +fi + +test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0 + +# I think it is safe to assume that "lo" will always be there ;) +if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val" +then + echo "$INTERFACE" >> /dev/udev_network_queue + exit 0 +fi + +# +# Code taken from pcmcia-cs:/etc/pcmcia/network +# + +# if this interface has an entry in /etc/network/interfaces, let ifupdown +# handle it +if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then + case $ACTION in + add) + ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE + ;; + remove) + ifdown $INTERFACE + ;; + esac + + exit 0 +fi diff --git a/meta-openpli/recipes-core/udev/udev-124/noasmlinkage.patch b/meta-openpli/recipes-core/udev/udev-124/noasmlinkage.patch new file mode 100644 index 0000000000..d58a7ea4de --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/noasmlinkage.patch @@ -0,0 +1,45 @@ +diff -pru udev-124.orig/test-udev.c udev-124/test-udev.c +--- udev-124.orig/test-udev.c 2008-06-12 06:24:30.000000000 +0100 ++++ udev-124/test-udev.c 2008-07-07 14:43:37.000000000 +0100 +@@ -46,7 +46,7 @@ void log_message(int priority, const cha + } + #endif + +-static void asmlinkage sig_handler(int signum) ++static void sig_handler(int signum) + { + switch (signum) { + case SIGALRM: +diff -pru udev-124.orig/udevd.c udev-124/udevd.c +--- udev-124.orig/udevd.c 2008-06-12 06:24:30.000000000 +0100 ++++ udev-124/udevd.c 2008-07-07 14:43:58.000000000 +0100 +@@ -87,7 +87,7 @@ void log_message(int priority, const cha + + #endif + +-static void asmlinkage udev_event_sig_handler(int signum) ++static void udev_event_sig_handler(int signum) + { + if (signum == SIGALRM) + exit(1); +@@ -798,7 +798,7 @@ static struct udevd_uevent_msg *get_netl + return msg; + } + +-static void asmlinkage sig_handler(int signum) ++static void sig_handler(int signum) + { + switch (signum) { + case SIGINT: +diff -pru udev-124.orig/udevmonitor.c udev-124/udevmonitor.c +--- udev-124.orig/udevmonitor.c 2008-06-12 06:24:30.000000000 +0100 ++++ udev-124/udevmonitor.c 2008-07-07 14:44:24.000000000 +0100 +@@ -97,7 +97,7 @@ static int init_uevent_netlink_sock(void + return 0; + } + +-static void asmlinkage sig_handler(int signum) ++static void sig_handler(int signum) + { + if (signum == SIGINT || signum == SIGTERM) + udev_exit = 1; diff --git a/meta-openpli/recipes-core/udev/udev-124/permissions.rules b/meta-openpli/recipes-core/udev/udev-124/permissions.rules new file mode 100644 index 0000000000..940d163047 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/permissions.rules @@ -0,0 +1,119 @@ +ACTION!="add", GOTO="permissions_end" + +# workarounds needed to synchronize with sysfs +# only needed for kernels < v2.6.18-rc1 +ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" +SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt" +# only needed for kernels < 2.6.16 +SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" +# only needed for kernels < 2.6.17 +SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" + +# devices needed to load the drivers providing them +KERNEL=="tun", OPTIONS+="ignore_remove" +KERNEL=="ppp", OPTIONS+="ignore_remove" +KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove" + +# default permissions for block devices +SUBSYSTEM=="block", GROUP="disk" +# the aacraid driver is broken and reports that disks removable (see #404927) +SUBSYSTEM=="block", ATTRS{removable}=="1", \ + DRIVERS!="aacraid", GROUP="floppy" +# all block devices on these buses are "removable" +SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy" + +# IDE devices +KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \ + IMPORT{program}="cdrom_id --export $tempnode" +ENV{ID_CDROM}=="?*", GROUP="cdrom" +KERNEL=="ht[0-9]*", GROUP="tape" +KERNEL=="nht[0-9]*", GROUP="tape" + +# SCSI devices +KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode" +SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape" +SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape" + +# USB devices +KERNEL=="legousbtower*", MODE="0666" +KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp" + +# usbfs-like devices +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ + MODE="0664" + +# iRiver music players +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \ + ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]" + +# serial devices +SUBSYSTEM=="tty", GROUP="dialout" +SUBSYSTEM=="capi", GROUP="dialout" +SUBSYSTEM=="slamr", GROUP="dialout" +SUBSYSTEM=="zaptel", GROUP="dialout" + +# vc devices (all members of the tty subsystem) +KERNEL=="ptmx", MODE="0666", GROUP="root" +KERNEL=="console", MODE="0600", GROUP="root" +KERNEL=="tty", MODE="0666", GROUP="root" +KERNEL=="tty[0-9]*", GROUP="root" +KERNEL=="pty*", MODE="0666", GROUP="tty" + +# video devices +SUBSYSTEM=="video4linux", GROUP="video" +SUBSYSTEM=="drm", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" +SUBSYSTEM=="em8300", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="nvidia", GROUP="video" + +# misc devices +KERNEL=="random", MODE="0666" +KERNEL=="urandom", MODE="0666" +KERNEL=="mem", MODE="0640", GROUP="kmem" +KERNEL=="kmem", MODE="0640", GROUP="kmem" +KERNEL=="port", MODE="0640", GROUP="kmem" +KERNEL=="full", MODE="0666" +KERNEL=="null", MODE="0666" +KERNEL=="zero", MODE="0666" +KERNEL=="inotify", MODE="0666" +KERNEL=="sgi_fetchop", MODE="0666" +KERNEL=="sonypi", MODE="0666" +KERNEL=="agpgart", GROUP="video" +KERNEL=="rtc|rtc[0-9]*", GROUP="audio" +KERNEL=="kqemu", MODE="0666" +KERNEL=="tun", MODE="0666", + +KERNEL=="cdemu[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd", MODE="0644" + +# printers and parallel devices +SUBSYSTEM=="printer", GROUP="lp" +SUBSYSTEM=="ppdev", GROUP="lp" +KERNEL=="irlpt*", GROUP="lp" +KERNEL=="pt[0-9]*", GROUP="tape" +KERNEL=="pht[0-9]*", GROUP="tape" + +# sound devices +SUBSYSTEM=="sound", GROUP="audio" + +# ieee1394 devices +KERNEL=="raw1394", GROUP="disk" +KERNEL=="dv1394*", GROUP="video" +KERNEL=="video1394*", GROUP="video" + +# input devices +KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \ + MODE="0664", GROUP="video" +KERNEL=="js[0-9]*", MODE="0664" +KERNEL=="lirc[0-9]*", GROUP="video" + +# AOE character devices +SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" +SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" + +LABEL="permissions_end" + diff --git a/meta-openpli/recipes-core/udev/udev-124/run.rules b/meta-openpli/recipes-core/udev/udev-124/run.rules new file mode 100644 index 0000000000..75d71375bb --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/run.rules @@ -0,0 +1,14 @@ +# debugging monitor +RUN+="socket:/org/kernel/udev/monitor" + +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" + +# ignore the events generated by virtual consoles +KERNEL=="ptmx", OPTIONS+="last_rule" +KERNEL=="console", OPTIONS+="last_rule" +KERNEL=="tty" , OPTIONS+="last_rule" +KERNEL=="tty[0-9]*", OPTIONS+="last_rule" +KERNEL=="pty*", OPTIONS+="last_rule" +SUBSYSTEM=="vc", OPTIONS+="last_rule" + diff --git a/meta-openpli/recipes-core/udev/udev-124/udev-compat-wrapper-patch b/meta-openpli/recipes-core/udev/udev-124/udev-compat-wrapper-patch new file mode 100644 index 0000000000..2273bf30e0 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udev-compat-wrapper-patch @@ -0,0 +1,35 @@ +This patch should be applied on platforms which support kernels < 2.6.27 and need udev-compat package. + +It should be applied after: +sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init + +It has not .patch suffix, because such files would not be copied to +WORKDIR and cannot be selectively applied on another source file. + +--- init ++++ init +@@ -11,6 +11,17 @@ + + export TZ=/etc/localtime + ++UDEVD="/sbin/udevd" ++UDEVADM="/sbin/udevadm" ++# If we are running an old kernel and have a static udev present use that instead ++if [ -e /sbin/udevd-compat ] ; then ++ KERNELMICROVER="$(uname -r | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*$/\1/')" ++ if [ $KERNELMICROVER -lt 27 ] ; then ++ UDEVD="/sbin/udevd-compat" ++ UDEVADM="/sbin/udevadm-compat" ++ fi ++fi ++ + [ -d /sys/class ] || exit 1 + [ -r /proc/mounts ] || exit 1 + [ -x $UDEVD ] || exit 1 +@@ -21,4 +32,6 @@ + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid ++ pid=`pidof -x udevd-compat` ++ [ -n "$pid" ] && kill $pid + } + diff --git a/meta-openpli/recipes-core/udev/udev-124/udev.rules b/meta-openpli/recipes-core/udev/udev-124/udev.rules new file mode 100644 index 0000000000..6117b94875 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udev.rules @@ -0,0 +1,113 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# workaround for devices which do not report media changes +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \ + ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions" +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \ + OPTIONS+="all_partitions" + +# SCSI devices +SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n" + +# USB devices +SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ + ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \ + SYMLINK+="pilot" + +# usbfs-like devices +SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \ + NAME="%c" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}" + +# serial devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi[0-9]*", NAME="capi/%n" + +# video devices +KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \ + NAME="%c" +KERNEL=="card[0-9]*", NAME="dri/%k" + +# misc devices +KERNEL=="hw_random", NAME="hwrng" +KERNEL=="tun", NAME="net/%k" +KERNEL=="evtchn", NAME="xen/%k" + +KERNEL=="cdemu[0-9]*", NAME="cdemu/%n" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n" +KERNEL=="pktcdvd", NAME="pktcdvd/control" + +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode" + +KERNEL=="umad*", NAME="infiniband/%k" +KERNEL=="issm*", NAME="infiniband/%k" +KERNEL=="uverbs*", NAME="infiniband/%k" +KERNEL=="ucm*", NAME="infiniband/%k" +KERNEL=="rdma_ucm", NAME="infiniband/%k" + +# ALSA devices +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" + +# ieee1394 devices +KERNEL=="dv1394*", NAME="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# input devices +KERNEL=="mice", NAME="input/%k" +KERNEL=="mouse[0-9]*", NAME="input/%k" +KERNEL=="event[0-9]*", NAME="input/%k" +KERNEL=="js[0-9]*", NAME="input/%k" +KERNEL=="ts[0-9]*", NAME="input/%k" +KERNEL=="uinput", NAME="input/%k" + +# Zaptel +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zaptimer", NAME="zap/timer" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zap[0-9]*", NAME="zap/%n" + +# AOE character devices +SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k" + +# device mapper creates its own device nodes, so ignore these +KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device" +KERNEL=="device-mapper", NAME="mapper/control" + +KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660" + +# Samsung UARTS +KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n" + +# MXC UARTs +KERNEL=="ttymxc[0-4]", NAME="ttymxc%n" + diff --git a/meta-openpli/recipes-core/udev/udev-124/udev_network_queue.sh b/meta-openpli/recipes-core/udev/udev-124/udev_network_queue.sh new file mode 100644 index 0000000000..05e08e9d1b --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udev_network_queue.sh @@ -0,0 +1,35 @@ +#! /bin/sh +# +# Copyright Matthias Hentges (c) 2006 +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# +# Filename: udev_network_queue.sh +# Date: 03-May-06 + +do_start() { + if test -e /dev/udev_network_queue + then + echo "Activating queued NICs..." + for NIC in `cat /dev/udev_network_queue` + do + export INTERFACE="$NIC" ; export ACTION=add + /etc/udev/scripts/network.sh + done + echo "" + else + echo "No NICs queued" + fi +} + +do_stop() { + /bin/true +} + +case "$1" in +start) do_start;; +stop) do_stop;; +restart) do_stop + do_start;; +*) echo "Usage: `basename $0` [ start | stop | restart ]" + exit 0;; +esac diff --git a/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.patch b/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.patch new file mode 100644 index 0000000000..7811188485 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.patch @@ -0,0 +1,776 @@ +--- udev-081/udevsynthesize.c.orig 2006-01-29 12:22:45.000000000 +0100 ++++ udev-081/udevsynthesize.c 2006-01-29 12:22:40.000000000 +0100 +@@ -0,0 +1,763 @@ ++/* ++ * udevcoldplug.c ++ * ++ * Copyright (C) 2005 SUSE Linux Products GmbH ++ * ++ * Author: ++ * Kay Sievers ++ * ++ * Synthesize kernel events from sysfs information and pass them ++ * to the udevd daemon. ++ * ++ * 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 version 2 of the License. ++ * ++ * 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., ++ * 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "udev_libc_wrapper.h" ++#include "udev.h" ++#include "udevd.h" ++#include "udev_version.h" ++#include "logging.h" ++ ++#include "list.h" ++ ++#ifndef DT_DIR ++#define DT_DIR 4 ++#endif ++ ++static const char *udev_log_str; ++static int udevd_sock = -1; ++ ++#ifdef USE_LOG ++void log_message(int priority, const char *format, ...) ++{ ++ va_list args; ++ ++ if (priority > udev_log_priority) ++ return; ++ ++ va_start(args, format); ++ vsyslog(priority, format, args); ++ va_end(args); ++} ++#endif ++ ++struct device { ++ struct list_head node; ++ struct udevd_msg msg; ++ size_t bufpos; ++ char *path; ++}; ++ ++static dev_t read_devt(const char *path) ++{ ++ char filename[PATH_SIZE]; ++ char majorminor[64]; ++ unsigned int major, minor; ++ ssize_t count; ++ int fd; ++ ++ snprintf(filename, sizeof(filename), "%s/%s", path, "dev"); ++ filename[sizeof(filename)-1] = '\0'; ++ ++ fd = open(filename, O_RDONLY); ++ if (fd < 0) ++ return 0; ++ ++ count = read(fd, majorminor, sizeof(majorminor)); ++ close(fd); ++ majorminor[count] = '\0'; ++ if (sscanf(majorminor, "%u:%u", &major, &minor) != 2) ++ return 0; ++ dbg("found major=%d, minor=%d", major, minor); ++ ++ return makedev(major, minor); ++} ++ ++static ssize_t read_file(const char *directory, const char *file, char *str, size_t len) ++{ ++ char filename[PATH_SIZE]; ++ ssize_t count; ++ int fd; ++ ++ memset(filename, 0, sizeof(filename)); ++ snprintf(filename, sizeof(filename), "%s/%s", directory, file); ++ filename[sizeof(filename)-1] = '\0'; ++ ++ fd = open(filename, O_RDONLY); ++ if (fd < 0) ++ return -1; ++ ++ count = read(fd, str, len-1); ++ close(fd); ++ ++ if (count > (ssize_t)len) ++ count = len; ++ str[count-1] = '\0'; ++ ++ return count; ++} ++ ++static ssize_t read_link(const char *directory, const char *file, char *str, size_t size) ++{ ++ char filename[PATH_SIZE]; ++ char target[PATH_SIZE]; ++ int len; ++ char *back; ++ char *strip; ++ int level = 1; ++ ++ snprintf(filename, sizeof(filename), "%s/%s", directory, file); ++ filename[sizeof(filename)-1] = '\0'; ++ ++ len = readlink(filename, target, sizeof(target)-1); ++ if (len < 0) ++ return -1; ++ target[len] = '\0'; ++ ++ back = target; ++ while (strncmp(back, "../", 3) == 0) { ++ back += 3; ++ level++; ++ } ++ while(level--) { ++ strip = strrchr(filename, '/'); ++ if (!strip) ++ return -1; ++ strip[0] = '\0'; ++ } ++ ++ snprintf(str, size, "%s/%s", filename, back); ++ str[size-1] = '\0'; ++ ++ return len; ++} ++ ++static char *add_env_key(struct device *device, const char *key, const char *value) ++{ ++ size_t pos = device->bufpos; ++ device->bufpos += sprintf(&device->msg.envbuf[device->bufpos], "%s=%s", key, value)+1; ++ return &device->msg.envbuf[pos]; ++} ++ ++static struct device *device_create(const char *path, const char *subsystem, dev_t devt) ++{ ++ struct device *device; ++ const char *devpath = &path[strlen(sysfs_path)]; ++ char target[PATH_SIZE]; ++ ++ device = malloc(sizeof(struct device)); ++ if (device == NULL) { ++ dbg("error malloc"); ++ return NULL; ++ } ++ memset(device, 0x00, sizeof(struct device)); ++ ++ device->path = add_env_key(device, "DEVPATH", devpath); ++ device->path += strlen("DEVPATH="); ++ add_env_key(device, "SUBSYSTEM", subsystem); ++ add_env_key(device, "ACTION", "add"); ++ add_env_key(device, "UDEV_COLDPLUG", "1"); ++ ++ if (major(devt)) { ++ char number[32]; ++ sprintf(number, "%u", major(devt)); ++ add_env_key(device, "MAJOR", number); ++ sprintf(number, "%u", minor(devt)); ++ add_env_key(device, "MINOR", number); ++ } ++ ++ if (strncmp(devpath, "/block/", strlen("/block/")) == 0 || ++ strncmp(devpath, "/class/", strlen("/class/")) == 0) { ++ char physpath[PATH_SIZE]; ++ ++ if (read_link(path, "device", physpath, sizeof(physpath)) > (ssize_t)strlen(sysfs_path)) { ++ add_env_key(device, "PHYSDEVPATH", &physpath[strlen(sysfs_path)]); ++ if (read_link(physpath, "driver", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) { ++ char *pos = strrchr(target, '/'); ++ if (pos) ++ add_env_key(device, "PHYSDEVDRIVER", &pos[1]); ++ } ++ if (read_link(physpath, "bus", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) { ++ char *pos = strrchr(target, '/'); ++ if (pos) ++ add_env_key(device, "PHYSDEVBUS", &pos[1]); ++ } ++ } ++ } else if (strncmp(devpath, "/devices/", strlen("/devices/")) == 0) { ++ if (read_link(path, "driver", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) { ++ char *pos = strrchr(target, '/'); ++ if (pos) ++ add_env_key(device, "PHYSDEVDRIVER", &pos[1]); ++ } ++ if (read_link(path, "bus", target, sizeof(target)) > (ssize_t)strlen(sysfs_path)) { ++ char *pos = strrchr(target, '/'); ++ if (pos) ++ add_env_key(device, "PHYSDEVBUS", &pos[1]); ++ } ++ } ++ ++ return device; ++} ++ ++static int device_list_insert(struct list_head *device_list, struct device *device) ++{ ++ struct device *loop_device; ++ ++ dbg("insert: '%s'", device->path); ++ ++ /* sort files in lexical order */ ++ list_for_each_entry(loop_device, device_list, node) ++ if (strcmp(loop_device->path, device->path) > 0) ++ break; ++ ++ list_add_tail(&device->node, &loop_device->node); ++ ++ return 0; ++} ++ ++static int add_device_udevd(struct device *device) ++{ ++ size_t msg_len; ++ struct sockaddr_un saddr; ++ socklen_t addrlen; ++ int retval; ++ ++ memset(&saddr, 0x00, sizeof(struct sockaddr_un)); ++ saddr.sun_family = AF_LOCAL; ++ /* use abstract namespace for socket path */ ++ strcpy(&saddr.sun_path[1], UDEVD_SOCK_PATH); ++ addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1; ++ ++ strcpy(device->msg.magic, UDEV_MAGIC); ++ device->msg.type = UDEVD_UEVENT_UDEVSEND; ++ ++ msg_len = offsetof(struct udevd_msg, envbuf) + device->bufpos; ++ dbg("msg_len=%i", msg_len); ++ ++ retval = sendto(udevd_sock, &device->msg, msg_len, 0, (struct sockaddr *)&saddr, addrlen); ++ if (retval < 0) ++ return -1; ++ ++ return 0; ++} ++ ++static void exec_list(struct list_head *device_list, const char *first[], const char *last[]) ++{ ++ struct device *loop_device; ++ struct device *tmp_device; ++ int i; ++ ++ /* handle the "first" type devices first */ ++ if (first) ++ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) { ++ for (i = 0; first[i] != NULL; i++) { ++ if (strncmp(loop_device->path, first[i], strlen(first[i])) == 0) { ++ add_device_udevd(loop_device); ++ list_del(&loop_device->node); ++ free(loop_device); ++ break; ++ } ++ } ++ } ++ ++ /* handle the devices we are allowed to, excluding the "last" type devices */ ++ if (last) ++ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) { ++ int found = 0; ++ for (i = 0; last[i] != NULL; i++) { ++ if (strncmp(loop_device->path, last[i], strlen(last[i])) == 0) { ++ found = 1; ++ break; ++ } ++ } ++ if (found) ++ continue; ++ ++ add_device_udevd(loop_device); ++ list_del(&loop_device->node); ++ free(loop_device); ++ } ++ ++ /* handle the rest of the devices */ ++ list_for_each_entry_safe(loop_device, tmp_device, device_list, node) { ++ add_device_udevd(loop_device); ++ list_del(&loop_device->node); ++ free(loop_device); ++ } ++} ++ ++static int udev_scan_class(void) ++{ ++ char base[PATH_SIZE]; ++ DIR *dir; ++ struct dirent *dent; ++ LIST_HEAD(device_list); ++ ++ /* we want /dev/null and /dev/console first */ ++ const char *first[] = { ++ "/class/mem", ++ "/class/tty", ++ NULL, ++ }; ++ ++ snprintf(base, sizeof(base), "%s/class", sysfs_path); ++ base[sizeof(base)-1] = '\0'; ++ ++ dir = opendir(base); ++ if (!dir) ++ return -1; ++ ++ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { ++ char dirname[PATH_SIZE]; ++ DIR *dir2; ++ struct dirent *dent2; ++ ++ if (dent->d_name[0] == '.') ++ continue; ++ ++ snprintf(dirname, sizeof(dirname), "%s/%s", base, dent->d_name); ++ dirname[sizeof(dirname)-1] = '\0'; ++ ++ dir2 = opendir(dirname); ++ if (!dir2) ++ continue; ++ for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) { ++ char dirname2[PATH_SIZE]; ++ struct device *device; ++ dev_t devt; ++ ++ if (dent2->d_name[0] == '.') ++ continue; ++ if (dent2->d_type != DT_DIR) ++ continue; ++ ++ snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name); ++ dirname2[sizeof(dirname2)-1] = '\0'; ++ devt = read_devt(dirname2); ++ device = device_create(dirname2, dent->d_name, devt); ++ ++ if (strcmp(dent->d_name, "net") == 0 || ++ strcmp(dent->d_name, "bluetooth") == 0) { ++ add_env_key(device, "INTERFACE", dent2->d_name); ++ } else if (strcmp(dent->d_name, "pcmcia_socket") == 0 && ++ strlen(dent->d_name) > 14) { ++ add_env_key(device, "SOCKET_NO", ++ dent2->d_name + 14); ++ } ++ ++ device_list_insert(&device_list, device); ++ } ++ closedir(dir2); ++ } ++ closedir(dir); ++ exec_list(&device_list, first, NULL); ++ ++ return 0; ++} ++ ++static int udev_scan_block(void) ++{ ++ char base[PATH_SIZE]; ++ DIR *dir; ++ struct dirent *dent; ++ LIST_HEAD(device_list); ++ ++ /* dm wants to have the block devices around before it */ ++ const char *last[] = { ++ "/block/dm", ++ NULL, ++ }; ++ ++ snprintf(base, sizeof(base), "%s/block", sysfs_path); ++ base[sizeof(base)-1] = '\0'; ++ ++ dir = opendir(base); ++ if (!dir) ++ return -1; ++ ++ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { ++ char dirname[PATH_SIZE]; ++ struct device *device; ++ struct dirent *dent2; ++ DIR *dir2; ++ dev_t devt; ++ ++ if (dent->d_name[0] == '.') ++ continue; ++ if (dent->d_type != DT_DIR) ++ continue; ++ ++ snprintf(dirname, sizeof(dirname), "%s/%s", base, dent->d_name); ++ dirname[sizeof(dirname)-1] = '\0'; ++ devt = read_devt(dirname); ++ if (major(devt)) { ++ device = device_create(dirname, "block", devt); ++ device_list_insert(&device_list, device); ++ } ++ ++ /* look for partitions */ ++ dir2 = opendir(dirname); ++ if (!dir2) ++ continue; ++ for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) { ++ char dirname2[PATH_SIZE]; ++ ++ if (dent2->d_name[0] == '.') ++ continue; ++ if (dent2->d_type != DT_DIR) ++ continue; ++ ++ snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name); ++ dirname2[sizeof(dirname2)-1] = '\0'; ++ devt = read_devt(dirname2); ++ if (major(devt)) { ++ device = device_create(dirname2, "block", devt); ++ device_list_insert(&device_list, device); ++ continue; ++ } ++ } ++ closedir(dir2); ++ } ++ closedir(dir); ++ exec_list(&device_list, NULL, last); ++ ++ return 0; ++} ++ ++static int pci_handler(struct device *device) ++{ ++ char path[PATH_SIZE]; ++ char value[PATH_SIZE]; ++ char vendor[PATH_SIZE]; ++ char product[PATH_SIZE]; ++ const char *name; ++ ++ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path); ++ path[sizeof(path)-1] = '\0'; ++ ++ if (read_file(path, "modalias", value, sizeof(value)) > 0) ++ add_env_key(device, "MODALIAS", value); ++ ++ name = strrchr(device->path, '/'); ++ if (name) ++ add_env_key(device, "PCI_SLOT_NAME", &name[1]); ++ ++ if (read_file(path, "class", value, sizeof(value)) > 0) ++ add_env_key(device, "PCI_CLASS", &value[2]); ++ ++ if (read_file(path, "vendor", vendor, sizeof(vendor)) > 0 && ++ read_file(path, "device", product, sizeof(product)) > 0) { ++ snprintf(value, sizeof(value), "%s:%s", &vendor[2], &product[2]); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "PCI_ID", value); ++ } ++ ++ if (read_file(path, "subsystem_vendor", vendor, sizeof(vendor)) > 0 && ++ read_file(path, "subsystem_device", product, sizeof(product)) > 0) { ++ snprintf(value, sizeof(value), "%s:%s", &vendor[2], &product[2]); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "PCI_SUBSYS_ID", value); ++ } ++ ++ return 0; ++} ++ ++static int usb_handler(struct device *device) ++{ ++ char path[PATH_SIZE]; ++ char value[PATH_SIZE]; ++ char str1[PATH_SIZE]; ++ char str2[PATH_SIZE]; ++ char str3[PATH_SIZE]; ++ unsigned int int1; ++ unsigned int int2; ++ unsigned int int3; ++ char *pos; ++ ++ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path); ++ path[sizeof(path)-1] = '\0'; ++ ++ /* device events have : in their directory name */ ++ pos = strrchr(path, '/'); ++ if (!strchr(pos, ':')) ++ return 0; /* and do not have other variables */ ++ ++ if (read_file(path, "modalias", value, sizeof(value)) > 0) ++ add_env_key(device, "MODALIAS", value); ++ ++ if (read_file(path, "bInterfaceClass", str1, sizeof(str1)) > 0 && ++ read_file(path, "bInterfaceSubClass", str2, sizeof(str2)) > 0 && ++ read_file(path, "bInterfaceProtocol", str3, sizeof(str3)) > 0) { ++ int1 = (int) strtol(str1, NULL, 16); ++ int2 = (int) strtol(str2, NULL, 16); ++ int3 = (int) strtol(str3, NULL, 16); ++ snprintf(value, sizeof(value), "%u/%u/%u", int1, int2, int3); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "INTERFACE", value); ++ } ++ ++ /* move to the parent directory */ ++ pos[0] = '\0'; ++ ++ if (read_file(path, "idVendor", str1, sizeof(str1)) > 0 && ++ read_file(path, "idProduct", str2, sizeof(str2)) > 0 && ++ read_file(path, "bcdDevice", str3, sizeof(str3)) > 0) { ++ int1 = (int) strtol(str1, NULL, 16); ++ int2 = (int) strtol(str2, NULL, 16); ++ int3 = (int) strtol(str3, NULL, 16); ++ snprintf(value, sizeof(value), "%x/%x/%x", int1, int2, int3); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "PRODUCT", value); ++ } ++ ++ if (read_file(path, "bDeviceClass", str1, sizeof(str1)) > 0 && ++ read_file(path, "bDeviceSubClass", str2, sizeof(str2)) > 0 && ++ read_file(path, "bDeviceProtocol", str3, sizeof(str3)) > 0) { ++ int1 = (int) strtol(str1, NULL, 16); ++ int2 = (int) strtol(str2, NULL, 16); ++ int3 = (int) strtol(str3, NULL, 16); ++ snprintf(value, sizeof(value), "%u/%u/%u", int1, int2, int3); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "TYPE", value); ++ } ++ ++ if (read_file(path, "devnum", str2, sizeof(str2)) > 0) { ++ pos = strrchr(path, 'b'); ++ int1 = (int) strtol(pos + 1, NULL, 16); ++ int2 = (int) strtol(str2, NULL, 16); ++ snprintf(value, sizeof(value), ++ "/proc/bus/usb/%03d/%03d", int1, int2); ++ path[sizeof(value)-1] = '\0'; ++ add_env_key(device, "DEVICE", value); ++ } ++ ++ return 0; ++} ++ ++static int serio_handler(struct device *device) ++{ ++ char path[PATH_SIZE]; ++ char value[PATH_SIZE]; ++ ++ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path); ++ path[sizeof(path)-1] = '\0'; ++ ++ if (read_file(path, "modalias", value, sizeof(value)) > 0) ++ add_env_key(device, "MODALIAS", value); ++ ++ if (read_file(path, "id/type", value, sizeof(value)) > 0) ++ add_env_key(device, "SERIO_TYPE", value); ++ ++ if (read_file(path, "id/proto", value, sizeof(value)) > 0) ++ add_env_key(device, "SERIO_PROTO", value); ++ ++ if (read_file(path, "id/id", value, sizeof(value)) > 0) ++ add_env_key(device, "SERIO_ID", value); ++ ++ if (read_file(path, "id/extra", value, sizeof(value)) > 0) ++ add_env_key(device, "SERIO_EXTRA", value); ++ ++ return 0; ++} ++ ++static int ccw_handler(struct device *device) ++{ ++ char path[PATH_SIZE]; ++ char value[PATH_SIZE], *tmp; ++ ++ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path); ++ path[sizeof(path)-1] = '\0'; ++ ++ if (read_file(path, "modalias", value, sizeof(value)) > 0) ++ add_env_key(device, "MODALIAS", value); ++ ++ if (read_file(path, "cutype", value, sizeof(value)) > 0) { ++ value[4] = 0; ++ tmp = &value[5]; ++ add_env_key(device, "CU_TYPE", value); ++ add_env_key(device, "CU_MODEL", tmp); ++ } ++ ++ if (read_file(path, "devtype", value, sizeof(value)) > 0) { ++ if (value[0] == 'n') { ++ add_env_key(device, "DEV_TYPE", "0000"); ++ add_env_key(device, "DEV_MODEL", "00"); ++ } ++ else { ++ value[4] = 0; ++ tmp = &value[5]; ++ add_env_key(device, "DEV_TYPE", value); ++ add_env_key(device, "DEV_MODEL", tmp); ++ } ++ } ++ ++ return 0; ++} ++ ++static int modalias_handler(struct device *device) ++{ ++ char path[PATH_SIZE]; ++ char value[PATH_SIZE]; ++ ++ snprintf(path, sizeof(path), "%s%s", sysfs_path, device->path); ++ path[sizeof(path)-1] = '\0'; ++ ++ if (read_file(path, "modalias", value, sizeof(value)) > 0) ++ add_env_key(device, "MODALIAS", value); ++ ++ return 0; ++} ++ ++static int udev_scan_bus(const char *bus, int bus_handler(struct device *device)) ++{ ++ char base[PATH_SIZE]; ++ DIR *dir; ++ struct dirent *dent; ++ LIST_HEAD(device_list); ++ ++ snprintf(base, sizeof(base), "%s/bus/%s/devices", sysfs_path, bus); ++ base[sizeof(base)-1] = '\0'; ++ ++ dir = opendir(base); ++ if (!dir) ++ return -1; ++ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { ++ char devpath[PATH_SIZE]; ++ struct device *device; ++ ++ if (dent->d_name[0] == '.') ++ continue; ++ ++ if (read_link(base, dent->d_name, devpath, sizeof(devpath)) < 0) ++ continue; ++ ++ device = device_create(devpath, bus, makedev(0, 0)); ++ if (bus_handler) { ++ if (bus_handler(device) < 0) { ++ dbg("'%s' bus handler skipped event", devpath); ++ free(device); ++ continue; ++ } ++ } ++ ++ device_list_insert(&device_list, device); ++ } ++ closedir(dir); ++ exec_list(&device_list, NULL, NULL); ++ ++ return 0; ++} ++ ++static int udev_scan_devices(void) ++{ ++ char base[PATH_SIZE]; ++ DIR *dir; ++ struct dirent *dent; ++ ++ snprintf(base, sizeof(base), "%s/bus", sysfs_path); ++ base[sizeof(base)-1] = '\0'; ++ ++ dir = opendir(base); ++ if (!dir) ++ return -1; ++ ++ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { ++ if (dent->d_name[0] == '.') ++ continue; ++ if (dent->d_type != DT_DIR) ++ continue; ++ ++ /* add bus specific env values */ ++ if (strcmp(dent->d_name, "pci") == 0) ++ udev_scan_bus("pci", pci_handler); ++ else if (strcmp(dent->d_name, "usb") == 0) ++ udev_scan_bus("usb", usb_handler); ++ else if (strcmp(dent->d_name, "serio") == 0) ++ udev_scan_bus("serio", serio_handler); ++ else if (strcmp(dent->d_name, "ccw") == 0) ++ udev_scan_bus("ccw", ccw_handler); ++ else ++ udev_scan_bus(dent->d_name, modalias_handler); ++ } ++ closedir(dir); ++ ++ return 0; ++} ++ ++int main(int argc, char *argv[], char *envp[]) ++{ ++ LIST_HEAD(device_list); ++ int i; ++ ++ logging_init("udevcoldplug"); ++ udev_config_init(); sysfs_init(); ++ dbg("version %s", UDEV_VERSION); ++ ++ udev_log_str = getenv("UDEV_LOG"); ++ ++ /* disable all logging if not explicitely requested */ ++ if (udev_log_str == NULL) ++ udev_log_priority = 0; ++ ++ for (i = 1 ; i < argc; i++) { ++ char *arg = argv[i]; ++ ++ if (strcmp(arg, "help") == 0 || strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) { ++ printf("Usage: udevcoldplug \n" ++ " --help print this help text\n\n"); ++ exit(0); ++ } else { ++ fprintf(stderr, "unknown option\n\n"); ++ exit(1); ++ } ++ } ++ ++ udevd_sock = socket(AF_LOCAL, SOCK_DGRAM, 0); ++ if (udevd_sock < 0) { ++ err("error getting socket"); ++ return 1; ++ } ++ ++ /* create nodes for already available devices */ ++ udev_scan_class(); ++ udev_scan_block(); ++ ++ /* synthesize events for bus devices ++ * may load modules or configure the device */ ++ udev_scan_devices(); ++ ++ if (udevd_sock >= 0) ++ close(udevd_sock); ++ logging_close(); ++ ++ return 0; ++} +--- udev-081/Makefile ++++ udev-081/Makefile +@@ -58,6 +58,7 @@ PROGRAMS = \ + udevmonitor \ + udevinfo \ + udevtest \ ++ udevsynthesize \ + udevstart + + HEADERS = \ diff --git a/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.sh b/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.sh new file mode 100644 index 0000000000..d58217c144 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udevsynthesize.sh @@ -0,0 +1,51 @@ +#!/bin/sh -e + +load_input_modules() { + for module in mousedev evdev joydev; do + modprobe -q $module || true + done +} + +if [ ! -e /sys/class/mem/null/uevent ]; then # <= 2.6.14 + /lib/udev/udevsynthesize + load_input_modules + exit 0 +fi + +# replace $IFS with something which is not likely to appear in a sysfs path, +# because some buggy drivers have spaces in their names +oldifs="$IFS" +IFS="|" + +for file in /sys/bus/*/devices/*/uevent /sys/class/*/*/uevent \ + /sys/block/*/uevent /sys/block/*/*/uevent; do + case "$file" in + */device/uevent) ;; # skip followed device symlinks + */\*/*) ;; + + */class/mem/*) # for /dev/null + first="$first${IFS}$file" ;; + + */block/md[0-9]*) + last="$last${IFS}$file" ;; + + *) + default="$default${IFS}$file" ;; + esac +done + +for file in $first${IFS}$default${IFS}$last; do + [ "$file" ] || continue + echo 'add' > "$file" || true +done + +IFS="$oldifs" + +case "$(uname -r)" in + 2.6.1[0-5]|2.6.1[0-5][!0-9]*) # <= 2.6.15 + load_input_modules + ;; +esac + +exit 0 + diff --git a/meta-openpli/recipes-core/udev/udev-124/udevtrigger_add_devname_filtering.patch b/meta-openpli/recipes-core/udev/udev-124/udevtrigger_add_devname_filtering.patch new file mode 100644 index 0000000000..5182542461 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/udevtrigger_add_devname_filtering.patch @@ -0,0 +1,99 @@ +diff -pru udev-124.orig/udevtrigger.c udev-124/udevtrigger.c +--- udev-124.orig/udevtrigger.c 2008-06-12 06:24:30.000000000 +0100 ++++ udev-124/udevtrigger.c 2008-07-07 15:10:09.000000000 +0100 +@@ -42,6 +42,8 @@ static int dry_run; + LIST_HEAD(device_list); + LIST_HEAD(filter_subsystem_match_list); + LIST_HEAD(filter_subsystem_nomatch_list); ++LIST_HEAD(filter_kernel_match_list); ++LIST_HEAD(filter_kernel_nomatch_list); + LIST_HEAD(filter_attr_match_list); + LIST_HEAD(filter_attr_nomatch_list); + static int sock = -1; +@@ -331,6 +333,26 @@ static int attr_match(const char *path, + return 0; + } + ++static int kernel_filtered(const char *kernel) ++{ ++ struct name_entry *loop_name; ++ ++ /* skip devices matching the prohibited kernel device names */ ++ list_for_each_entry(loop_name, &filter_kernel_nomatch_list, node) ++ if (fnmatch(loop_name->name, kernel, 0) == 0) ++ return 1; ++ ++ /* skip devices not matching the listed kernel device names */ ++ if (!list_empty(&filter_kernel_match_list)) { ++ list_for_each_entry(loop_name, &filter_kernel_match_list, node) ++ if (fnmatch(loop_name->name, kernel, 0) == 0) ++ return 0; ++ return 1; ++ } ++ ++ return 0; ++} ++ + static int attr_filtered(const char *path) + { + struct name_entry *loop_name; +@@ -409,6 +431,9 @@ static void scan_subsystem(const char *s + if (dent2->d_name[0] == '.') + continue; + ++ if (kernel_filtered(dent2->d_name)) ++ continue; ++ + strlcpy(dirname2, dirname, sizeof(dirname2)); + strlcat(dirname2, "/", sizeof(dirname2)); + strlcat(dirname2, dent2->d_name, sizeof(dirname2)); +@@ -465,6 +490,9 @@ static void scan_block(void) + if (!strcmp(dent2->d_name,"device")) + continue; + ++ if (kernel_filtered(dent2->d_name)) ++ continue; ++ + strlcpy(dirname2, dirname, sizeof(dirname2)); + strlcat(dirname2, "/", sizeof(dirname2)); + strlcat(dirname2, dent2->d_name, sizeof(dirname2)); +@@ -576,6 +604,8 @@ int udevtrigger(int argc, char *argv[], + { "subsystem-nomatch", 1, NULL, 'S' }, + { "attr-match", 1, NULL, 'a' }, + { "attr-nomatch", 1, NULL, 'A' }, ++ { "kernel-match", 1, NULL, 'k' }, ++ { "kernel-nomatch", 1, NULL, 'K' }, + { "env", 1, NULL, 'e' }, + {} + }; +@@ -622,6 +652,12 @@ int udevtrigger(int argc, char *argv[], + case 'A': + name_list_add(&filter_attr_nomatch_list, optarg, 0); + break; ++ case 'k': ++ name_list_add(&filter_kernel_match_list, optarg, 0); ++ break; ++ case 'K': ++ name_list_add(&filter_kernel_nomatch_list, optarg, 0); ++ break; + case 'h': + printf("Usage: udevadm trigger OPTIONS\n" + " --verbose print the list of devices while running\n" +@@ -632,6 +668,8 @@ int udevtrigger(int argc, char *argv[], + " --env== pass an additional key (works only with --socket=)\n" + " --subsystem-match= trigger devices from a matching subystem\n" + " --subsystem-nomatch= exclude devices from a matching subystem\n" ++ " --kernel-match= trigger devices from a matching kernel device name\n" ++ " --kernel-nomatch= exclude devices from a matching kernel device name\n" + " --attr-match=]> trigger devices with a matching sysfs\n" + " attribute\n" + " --attr-nomatch=]> exclude devices with a matching sysfs\n" +@@ -701,6 +739,8 @@ int udevtrigger(int argc, char *argv[], + exit: + name_list_cleanup(&filter_subsystem_match_list); + name_list_cleanup(&filter_subsystem_nomatch_list); ++ name_list_cleanup(&filter_kernel_match_list); ++ name_list_cleanup(&filter_kernel_nomatch_list); + name_list_cleanup(&filter_attr_match_list); + name_list_cleanup(&filter_attr_nomatch_list); + diff --git a/meta-openpli/recipes-core/udev/udev-124/vol_id_ld.patch b/meta-openpli/recipes-core/udev/udev-124/vol_id_ld.patch new file mode 100644 index 0000000000..11126eef8d --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-124/vol_id_ld.patch @@ -0,0 +1,17 @@ +--- + extras/volume_id/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: udev-115/extras/volume_id/Makefile +=================================================================== +--- udev-115.orig/extras/volume_id/Makefile 2007-09-20 18:17:59.000000000 +0200 ++++ udev-115/extras/volume_id/Makefile 2007-09-20 18:18:08.000000000 +0200 +@@ -44,7 +44,7 @@ + ifeq ($(strip $(VOLUME_ID_STATIC)),true) + $(Q) $(LD) $(LDFLAGS) -o $@ $@.o $(LIBUDEV) lib/libvolume_id.a $(LIB_OBJS) + else +- $(Q) $(LD) $(LDFLAGS) -o $@ $@.o $(LIBUDEV) -Llib -lvolume_id $(LIB_OBJS) ++ $(Q) $(LD) -Llib $(LDFLAGS) -o $@ $@.o $(LIBUDEV) -lvolume_id $(LIB_OBJS) + endif + + # man pages diff --git a/meta-openpli/recipes-core/udev/udev-182/init b/meta-openpli/recipes-core/udev/udev-182/init new file mode 100644 index 0000000000..45e1fc3094 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev-182/init @@ -0,0 +1,45 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev (symlinks only) and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x /lib/udev/udevd ] || exit 1 +[ -f /etc/default/udev ] && . /etc/default/udev +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +kill_udevd() { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +export ACTION=add + +echo "Starting udev" + +if [ ! -e "/lib/modules/$(uname -r)"/modules.dep ] ; then + mkdir -p /lib/modules/$(uname -r) + depmod -ae +fi + +# make_extra_nodes +kill_udevd > "/dev/null" 2>&1 + +# trigger the sorted events +echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug +/lib/udev/udevd -d + +/usr/bin/udevadm control --env STARTUP=1 +/usr/bin/udevadm trigger --action=add +#/usr/bin/udevadm settle + +exit 0 diff --git a/meta-openpli/recipes-core/udev/udev_124.bb b/meta-openpli/recipes-core/udev/udev_124.bb new file mode 100644 index 0000000000..5b75e98892 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev_124.bb @@ -0,0 +1,70 @@ +DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \ +/dev/, handles hotplug events and loads drivers at boot time. It replaces \ +the hotplug package and requires a kernel not older than 2.6.12." +RPROVIDES_${PN} = "hotplug" + +require udev_124.inc + +PR = "${INC_PR}.5" + +LD = "${CC}" + +SRC_URI += "file://noasmlinkage.patch \ + file://flags.patch \ + file://vol_id_ld.patch \ + file://udevtrigger_add_devname_filtering.patch \ + file://libvolume-id-soname.patch \ + file://mtd-exclude-persistent.patch \ + file://mount.blacklist \ + file://run.rules \ + file://default \ + file://local.rules \ + file://41-od-linux-2.6.18-misc.rules \ + " + +FILES_${PN} += "${base_libdir}/udev/*" +FILES_${PN}-dbg += "${base_libdir}/udev/.debug" +UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/" +EXTRA_OEMAKE += "libudevdir=/lib/udev libdir=${base_libdir} prefix=" + +do_install () { + install -d ${D}${usrsbindir} \ + ${D}${sbindir} + oe_runmake 'DESTDIR=${D}' INSTALL=install install + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev + + install -d ${D}${sysconfdir}/default + install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/udev + + install -d ${D}${sysconfdir}/udev/rules.d/ + + install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/ + install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules + install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules + install -m 0644 ${WORKDIR}/run.rules ${D}${sysconfdir}/udev/rules.d/run.rules + install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules + install -m 0644 ${WORKDIR}/links.conf ${D}${sysconfdir}/udev/links.conf + if [ "${UDEV_DEVFS_RULES}" = "1" ]; then + install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules + fi + + touch ${D}${sysconfdir}/udev/saved.uname + touch ${D}${sysconfdir}/udev/saved.cmdline + touch ${D}${sysconfdir}/udev/saved.atags + + install -d ${D}${sysconfdir}/udev/scripts/ + + install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh + install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts + + install -d ${D}${base_libdir}/udev/ + + install -m 0644 ${WORKDIR}/41-od-linux-2.6.18-misc.rules ${D}${sysconfdir}/udev/rules.d + + # disable automatic mounts + sed -e 's,^\(.*/mount\.sh.*\)$,#\1,' -i ${D}${sysconfdir}/udev/rules.d/local.rules +} + +SRC_URI[md5sum] = "2ea9229208154229c5d6df6222f74ad7" +SRC_URI[sha256sum] = "cc9f58ff58fbd3f5868e1f1e368e3c93e1f441afd0ac1dcbd5d01a9ce5b5b0d7" diff --git a/meta-openpli/recipes-core/udev/udev_124.inc b/meta-openpli/recipes-core/udev/udev_124.inc new file mode 100644 index 0000000000..c666768274 --- /dev/null +++ b/meta-openpli/recipes-core/udev/udev_124.inc @@ -0,0 +1,102 @@ +DESCRIPTION ?= "udev is a program which dynamically creates and removes device nodes from \ +/dev/. It responds to /sbin/hotplug device events and requires a 2.6 kernel." + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ + file://udev.rules \ + file://devfs-udev.rules \ + file://links.conf \ + file://permissions.rules \ + file://mount.sh \ + file://network.sh \ + file://local.rules \ + file://init \ + file://udev-compat-wrapper-patch" + +INC_PR = "r30" + +inherit update-rc.d autotools pkgconfig + +PARALLEL_MAKE = "" +UDEV_DEVFS_RULES ?= "0" +PKG_libvolume-id-dev = "libvolume-id-dev" + +RDEPENDS_${PN} += "module-init-tools-depmod udev-utils" + +INITSCRIPT_NAME = "udev" +INITSCRIPT_PARAMS = "start 03 S ." + +export CROSS = "${TARGET_PREFIX}" +export HOSTCC = "${BUILD_CC}" +export udevdir ?= "/dev" +# Put stuff in /lib and /sbin +export bindir := "${base_bindir}" +export sbindir := "${base_sbindir}" +export usrbindir := "${bindir}" +export usrsbindir := "${sbindir}" +export etcdir := "${sysconfdir}" + +TARGET_CC_ARCH += "${LDFLAGS}" +UDEV_EXTRAS = "" +EXTRA_OEMAKE = "-e \ + 'EXTRAS=${UDEV_EXTRAS}' \ + 'STRIP=echo'" + +RPROVIDES_udev_append = " udev-compat-wrapper" +RDEPENDS_udev_spitz += "udev-compat" +do_unpack_append_spitz() { + bb.build.exec_func('do_apply_compat_wrapper', d) +} +RDEPENDS_udev_akita += "udev-compat" +do_unpack_append_akita() { + bb.build.exec_func('do_apply_compat_wrapper', d) +} +RDEPENDS_udev_c7x0 += "udev-compat" +do_unpack_append_c7x0() { + bb.build.exec_func('do_apply_compat_wrapper', d) +} +RDEPENDS_udev_poodle += "udev-compat" +do_unpack_append_poodle() { + bb.build.exec_func('do_apply_compat_wrapper', d) +} + +# Modify init script on platforms that need to boot old kernels: +do_apply_compat_wrapper() { + cd ${WORKDIR} + sed -i "s:/sbin/udevd:\$UDEVD:g;s:/sbin/udevadm:\$UDEVADM:g" init + patch $shellfile + sed -e "s:${S}:.:g" -e "s:exit 1:true:" tmpfile >> $shellfile + + echo "export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile + echo "alias ./configure=oe_runconf" >> $shellfile + echo "alias make=oe_runmake" >> $shellfile + + mkdir -p ${DEPLOY_DIR}/addons + install -m 755 $shellfile ${DEPLOY_DIR}/addons +} + +addtask deploy after do_install before do_package diff --git a/meta-openpli/recipes-devtools/opkg/opkg/sanity-check-provides.patch b/meta-openpli/recipes-devtools/opkg/opkg/sanity-check-provides.patch new file mode 100644 index 0000000000..60415a9599 --- /dev/null +++ b/meta-openpli/recipes-devtools/opkg/opkg/sanity-check-provides.patch @@ -0,0 +1,12 @@ +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index d8c3984..cdcd39a 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -734,6 +734,7 @@ pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field) + if (pkg->provides_count) { + fprintf(fp, "Provides:"); + for(i = 1; i < pkg->provides_count; i++) { ++ if (!pkg->provides[i]) break; + fprintf(fp, "%s %s", i == 1 ? "" : ",", + pkg->provides[i]->name); + } diff --git a/meta-openpli/recipes-devtools/opkg/opkg_svn.bbappend b/meta-openpli/recipes-devtools/opkg/opkg_svn.bbappend new file mode 100644 index 0000000000..b8074eeb8e --- /dev/null +++ b/meta-openpli/recipes-devtools/opkg/opkg_svn.bbappend @@ -0,0 +1,5 @@ +PRINC = "1" + +SRC_URI += "file://sanity-check-provides.patch" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" \ No newline at end of file diff --git a/meta-openpli/recipes-devtools/python/python-coherence_git.bb b/meta-openpli/recipes-devtools/python/python-coherence_git.bb new file mode 100644 index 0000000000..4b5397ca7a --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-coherence_git.bb @@ -0,0 +1,33 @@ +SUMMARY = "Python UPnP framework" +HOMEPAGE = "http://coherence.beebits.net/" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENCE;md5=3f7c147addd67ce1d53239c68a6b7022" +DEPENDS = "libxml2" +SRCREV = "f4864b1f63866d738c18c02dcb16d824a049880c" +PV = "0.6.7" +PR = "r3" + +SRC_URI = "git://github.com/sreichholf/coherence.git;protocol=git" + +S = "${WORKDIR}/git/Coherence" + +inherit setuptools + +do_configure_prepend() { + sed -e 's,^from coherence import __version__$,__version__ = "${PV}",' -i setup.py +} +do_install_append() { + rm ${D}${bindir}/applet-coherence + rm -r ${D}${PYTHON_SITEPACKAGES_DIR}/Coherence-${PV}-*.egg-info + rm -r ${D}${PYTHON_SITEPACKAGES_DIR}/coherence/test + rm -r ${D}${PYTHON_SITEPACKAGES_DIR}/misc/Desktop-Applet +} + +RDEPENDS_${PN} = "python-xmlrpc python-twisted-web" + +PACKAGES =+ "${PN}-bin" + +RDEPENDS_${PN}-bin = "${PN} python-zopeinterface" + +FILES_${PN}-bin = "${bindir} ${PYTHON_SITEPACKAGES_DIR}/misc/*.py" diff --git a/meta-openpli/recipes-devtools/python/python-daap/python-daap.patch b/meta-openpli/recipes-devtools/python/python-daap/python-daap.patch new file mode 100644 index 0000000000..8fb9ae55fe --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-daap/python-daap.patch @@ -0,0 +1,57 @@ +--- python-daap-0.7.1/daap.py 2007-09-10 20:35:45.000000000 +0200 ++++ python-daap-0.7.1/daap.py 2010-11-03 19:39:09.000000000 +0100 +@@ -417,18 +417,21 @@ + # this returns an HTTP response object + response = self._get_response(r, params) + status = response.status +- content = response.read() +- # if we got gzipped data base, gunzip it. +- if response.getheader("Content-Encoding") == "gzip": +- log.debug("gunzipping data") +- old_len = len(content) +- compressedstream = StringIO( content ) +- gunzipper = gzip.GzipFile(fileobj=compressedstream) +- content = gunzipper.read() +- log.debug("expanded from %s bytes to %s bytes", old_len, len(content)) +- # close this, we're done with it ++ #Dr.Best --> fix ++ if status == 200: ++ content = response.read() ++ # if we got gzipped data base, gunzip it. ++ if response.getheader("Content-Encoding") == "gzip": ++ log.debug("gunzipping data") ++ old_len = len(content) ++ compressedstream = StringIO( content ) ++ gunzipper = gzip.GzipFile(fileobj=compressedstream) ++ content = gunzipper.read() ++ log.debug("expanded from %s bytes to %s bytes", old_len, len(content)) ++ # close this, we're done with it + response.close() + ++ + if status == 401: + raise DAAPError('DAAPClient: %s: auth required'%r) + elif status == 403: +@@ -511,7 +514,7 @@ + # the atoms we want. Making this list smaller reduces memory footprint, + # and speeds up reading large libraries. It also reduces the metainformation + # available to the client. +-daap_atoms = "dmap.itemid,dmap.itemname,daap.songalbum,daap.songartist,daap.songformat,daap.songtime,daap.songsize,daap.songgenre,daap.songyear,daap.songtracknumber" ++daap_atoms = "dmap.itemid,dmap.itemname,daap.songalbum,daap.songartist,daap.songformat,daap.songtime,daap.songsize,daap.songgenre,daap.songyear,daap.songtracknumber,daap.songtrackcount,daap.songbitrate" + + class DAAPDatabase(object): + +@@ -560,7 +563,12 @@ + 'id':'miid', + 'type':'asfm', + 'time':'astm', +- 'size':'assz'} ++ 'size':'assz', ++ 'year':'asyr', ++ 'genre':'asgn', ++ 'tracknr': 'astn', ++ 'trackcount': 'astc', ++ 'bitrate': 'asbr'} + + def __init__(self, database, atom): + self.database = database diff --git a/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bb b/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bb new file mode 100644 index 0000000000..31f89011e2 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bb @@ -0,0 +1,17 @@ +SUMMARY = "A pure Python DAAP client implementation" +SECTION = "devel/python" +PRIORITY = "optional" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fbc093901857fcd118f065f900982c24" +PR = "r2" + +inherit distutils + +SRC_URI = "http://jerakeen.org/files/PythonDaap-${PV}.tar.gz" +S = "${WORKDIR}/PythonDaap-${PV}" + +RDEPENDS_${PN} = "python-compression" + + +SRC_URI[md5sum] = "b3db3d60b0ee83f5f23101d2c3bb99e0" +SRC_URI[sha256sum] = "ea1d3a8141654781a0df31e6607c4722436fa33eb2e9934492770b3b61be8122" diff --git a/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bbappend b/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bbappend new file mode 100644 index 0000000000..7e3ee71a85 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-daap_0.7.1.bbappend @@ -0,0 +1,5 @@ +PRINC = "1" + +SRC_URI += " \ + file://python-daap.patch \ +" diff --git a/meta-openpli/recipes-devtools/python/python-flickrapi_1.4.2.bb b/meta-openpli/recipes-devtools/python/python-flickrapi_1.4.2.bb new file mode 100644 index 0000000000..fb3272db8e --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-flickrapi_1.4.2.bb @@ -0,0 +1,25 @@ +SUMMARY = "The official Python interface to the Flickr API" +HOMEPAGE = "http://stuvel.eu/flickrapi" +SECTION = "devel/python" +PRIORITY = "optional" +LICENSE = "PSF" +PR = "r1" +# NOTE: requires python-misc for webbrowser and subprocess as missing dependency of the webbrowser +RDEPENDS_${PN} = "\ + python-core \ + python-elementtree \ + python-logging \ + python-misc \ + python-netclient \ + python-subprocess \ + python-threading \ + python-xml \ +" + +SRC_URI = "http://pypi.python.org/packages/source/f/flickrapi/flickrapi-${PV}.zip" +SRC_URI[md5sum] = "90dca08a45968b18da0894887f3e59b3" +SRC_URI[sha256sum] = "ac9304f571175b8af4fc2ee17d3e110847b526640665ca53d97bbf9df98329bc" + +S = "${WORKDIR}/flickrapi-${PV}" + +inherit distutils diff --git a/meta-openpli/recipes-devtools/python/python-gdata_2.0.14.bb b/meta-openpli/recipes-devtools/python/python-gdata_2.0.14.bb new file mode 100644 index 0000000000..e2a8a017fe --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-gdata_2.0.14.bb @@ -0,0 +1,21 @@ +SUMMARY = "Google Data APIs Python Client Library" +HOMEPAGE = "http://code.google.com/p/gdata-python-client/" +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://README.txt;beginline=1;endline=13;md5=7a713fc5eed20ac1904c2efe0b816a33" +RDEPENDS = "python-elementtree" +RDEPENDS_${PN}-tests = "${PN}" +PR = "r1" + +SRC_URI = "http://gdata-python-client.googlecode.com/files/gdata-${PV}.tar.gz;name=archive" +SRC_URI[archive.md5sum] = "29cf394b4f75aa4fae8c1b59079f2a02" +SRC_URI[archive.sha256sum] = "ba291d2b9d36a0f1b1b31a5a3ac3ba11f1bcce21c915a6ec78d109a43dafb1b0" + +S = "${WORKDIR}/gdata-${PV}" + +inherit distutils + +PACKAGES =+ "${PN}-tests" + +FILES_${PN}-tests = "${libdir}/${PYTHON_DIR}/site-packages/gdata/test*" +FILES_${PN} += "${datadir}" diff --git a/meta-openpli/recipes-devtools/python/python-mutagen/patch.diff b/meta-openpli/recipes-devtools/python/python-mutagen/patch.diff new file mode 100644 index 0000000000..73a112c360 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-mutagen/patch.diff @@ -0,0 +1,12 @@ +diff -Naur mutagen/easymp4.py mutagen_pach/easymp4.py +--- mutagen/mutagen/easymp4.py 2009-08-10 12:57:55.000000000 +0200 ++++ mutagen/mutagen/easymp4.py 2010-01-11 19:24:05.000000000 +0100 +@@ -204,7 +204,7 @@ + '\xa9cmt': 'comment', + 'desc': 'description', + '\xa9grp': 'grouping', +- '\xa9grn': 'genre', ++ '\xa9gen': 'genre', + 'cprt': 'copyright', + 'soal': 'albumsort', + 'soaa': 'albumartistsort', diff --git a/meta-openpli/recipes-devtools/python/python-mutagen_1.18.bb b/meta-openpli/recipes-devtools/python/python-mutagen_1.18.bb new file mode 100644 index 0000000000..6656432709 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-mutagen_1.18.bb @@ -0,0 +1,22 @@ +SUMMARY = "Module for manipulating ID3 (v1 + v2) tags in Python" +SECTION = "devel/python" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +SRCNAME = "mutagen" +PR = "r1" + +DEPENDS = "python" +RDEPENDS = "python-shell" + +SRC_URI = "http://mutagen.googlecode.com/files/mutagen-${PV}.tar.gz \ + file://patch.diff \ +" + +SRC_URI[md5sum] = "0c2cd954e4bacd79fadd45afc4acce4c" +SRC_URI[sha256sum] = "30b6147baf59ab3609939acf49a1a1c73b15d8b1c637a01bfee89da7feea0d6c" + +S = "${WORKDIR}/mutagen-${PV}" + +inherit distutils + + diff --git a/meta-openpli/recipes-devtools/python/python-native_2.7.2.bbappend b/meta-openpli/recipes-devtools/python/python-native_2.7.2.bbappend new file mode 100644 index 0000000000..9c23feb271 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-native_2.7.2.bbappend @@ -0,0 +1,4 @@ +PRINC = "1" + +RPROVIDES += "python-pickle-native python-pprint-native" + diff --git a/meta-openpli/recipes-devtools/python/python-pycrypto/no-usr-include.patch b/meta-openpli/recipes-devtools/python/python-pycrypto/no-usr-include.patch new file mode 100644 index 0000000000..4b74b5a21c --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-pycrypto/no-usr-include.patch @@ -0,0 +1,11 @@ +--- pycrypto-2.5/setup.py.orig 2012-03-13 17:29:36.215553438 +0100 ++++ pycrypto-2.5/setup.py 2012-03-13 17:29:46.339553341 +0100 +@@ -366,7 +366,7 @@ + 'ext_modules': plat_ext + [ + # _fastmath (uses GNU mp library) + Extension("Crypto.PublicKey._fastmath", +- include_dirs=['src/','/usr/include/'], ++ include_dirs=['src/'], + libraries=['gmp'], + sources=["src/_fastmath.c"]), + diff --git a/meta-openpli/recipes-devtools/python/python-pycrypto_2.5.bb b/meta-openpli/recipes-devtools/python/python-pycrypto_2.5.bb new file mode 100644 index 0000000000..a6ab591bbc --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-pycrypto_2.5.bb @@ -0,0 +1,17 @@ +SUMMARY = "A collection of cryptographic algorithms and protocols" +SECTION = "devel/python" +LICENSE = "PD & Python-2.0" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=35f354d199e8cb7667b059a23578e63d" +DEPENDS = "gmp" +PR = "r1" + +SRC_URI = "http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-${PV}.tar.gz \ + file://no-usr-include.patch" +SRC_URI[md5sum] = "783e45d4a1a309e03ab378b00f97b291" +SRC_URI[sha256sum] = "e950a78184e2a7defccf5d45e0c29c1e9edeb29984433f0d110a21e9631e38de" + +S = "${WORKDIR}/pycrypto-${PV}" + +inherit autotools distutils + +BBCLASSEXTEND = "native" diff --git a/meta-openpli/recipes-devtools/python/python-pysnmp-se_3.5.2.bb b/meta-openpli/recipes-devtools/python/python-pysnmp-se_3.5.2.bb new file mode 100644 index 0000000000..2dae66dfb6 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-pysnmp-se_3.5.2.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "A Pure Python SNMP Package" +SECTION = "devel/python" +PRIORITY = "optional" +RDEPENDS_${PN} = "python-core" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://README;beginline=13;endline=14;md5=fe0c3d0cab1e25fcec2777b0a8b8e4bf" + +SRCNAME = "pysnmp-se" +SRC_URI = "http://downloads.sourceforge.net/twistedsnmp/${SRCNAME}-${PV}.tar.gz" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils + +SRC_URI[md5sum] = "445f5812110d33c72ad250798b9fdbb1" +SRC_URI[sha256sum] = "f6b4fd14b1e868fbb89e7d2bd9c5fbcd4ce4bd4fc1d4b460971cf810762eb17b" diff --git a/meta-openpli/recipes-devtools/python/python-transmissionrpc_hg.bb b/meta-openpli/recipes-devtools/python/python-transmissionrpc_hg.bb new file mode 100644 index 0000000000..d1479c368b --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-transmissionrpc_hg.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "Transmission RPC is a python module that can communicate with the bittorrent client Transmission through json-rpc" +HOMEPAGE = "http://bitbucket.org/blueluna/transmissionrpc/wiki/Home" +SECTION = "devel/python" +PRIORITY = "optional" +LICENSE = "MIT" +RDEPENDS_${PN} = "python-simplejson" +PV = "0.7+hg${SRCREV}" + +SRC_URI = "hg://bitbucket.org/blueluna;proto=http;module=transmissionrpc;rev=${SRCREV}" + +SRCREV = "4fe71eb818d0" +S = "${WORKDIR}/transmissionrpc" + +inherit setuptools diff --git a/meta-openpli/recipes-devtools/python/python-twisted_12.0.0.bb b/meta-openpli/recipes-devtools/python/python-twisted_12.0.0.bb new file mode 100644 index 0000000000..2373024b88 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-twisted_12.0.0.bb @@ -0,0 +1,256 @@ +DESCRIPTION = "Twisted is an event-driven networking framework written in Python and licensed under the LGPL. \ +Twisted supports TCP, UDP, SSL/TLS, multicast, Unix sockets, a large number of protocols \ +(including HTTP, NNTP, IMAP, SSH, IRC, FTP, and others), and much more." +HOMEPAGE = "http://www.twistedmatrix.com" +SECTION = "console/network" + +#twisted/topfiles/NEWS:655: - Relicensed: Now under the MIT license, rather than LGPL. +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;beginline=40;md5=3fced11d6df719b47505837a51c16ae5" + +SRC_URI = "http://twistedmatrix.com/Releases/Twisted/12.0/Twisted-${PV}.tar.bz2" +SRC_URI[md5sum] = "cf49a8676c21c50faf1b42b528049471" +SRC_URI[sha256sum] = "e5561c9714583fd052ea9e0b10331609a719b3878f9d2593e4c57eab0ba0effd" + +S = "${WORKDIR}/Twisted-${PV}" +PR = "r1" + +inherit setuptools openpli-distutils + +do_compile() { +} + +do_install() { + distutils_do_install_keep +} + +PACKAGES =+ "${PN}-src" +RDEPENDS_{PN}-src = "${PN}" +FILES_${PN}-src = " \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/*.py \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/*/*.py \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/*/*/*.py \ + " + +PACKAGES =+ "${PN}-selftest" +RDEPENDS_{PN}-selftest = "${PN}" +FILES_${PN}-selftest = "${libdir}/${PYTHON_DIR}/site-packages/twisted/*/test" + +PACKAGES += "\ + ${PN}-zsh \ + ${PN}-test \ + ${PN}-protocols \ + ${PN}-bin \ + ${PN}-conch \ + ${PN}-lore \ + ${PN}-mail \ + ${PN}-names \ + ${PN}-news \ + ${PN}-runner \ + ${PN}-web \ + ${PN}-words \ + ${PN}-flow \ + ${PN}-pair \ + ${PN}-core \ +" + +RDEPENDS_${PN} += "\ + ${PN}-bin \ + ${PN}-conch \ + ${PN}-lore \ + ${PN}-mail \ + ${PN}-names \ + ${PN}-news \ + ${PN}-runner \ + ${PN}-web \ + ${PN}-words \ +" + +do_install_append() { + # remove some useless files before packaging + find ${D} -name "*.bat" -o -name "*.c" -o -name "*.h" -exec rm {} \; +} + +ALLOW_EMPTY_${PN} = "1" +FILES_${PN} = "" + +FILES_${PN}-test = " \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/test \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/*/test \ +" +RDEPENDS_${PN}-test = "${PN}" + +FILES_${PN}-protocols = " \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/protocols/ \ +" + +FILES_${PN}-zsh = " \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/python/zsh \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/python/zshcomp.* \ +" + +FILES_${PN}-bin = " \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/protocols/_c_urlarg.so \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/spread/cBanana.so \ +" + +FILES_${PN}-conch = " \ + ${bindir}/ckeygen \ + ${bindir}/tkconch \ + ${bindir}/conch \ + ${bindir}/conchftp \ + ${bindir}/cftp \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_conch.py* \ + ${libdir}/${PYTHON_DIR}/site-packages/twisted/conch \ +" +RDEPENDS_${PN}-conch = "${PN}-core ${PN}-protocols" + +FILES_${PN}-core = " \ +${bindir}/manhole \ +${bindir}/mktap \ +${bindir}/twistd \ +${bindir}/tap2deb \ +${bindir}/tap2rpm \ +${bindir}/tapconvert \ +${bindir}/tkmktap \ +${bindir}/trial \ +${bindir}/easy_install* \ +${bindir}/pyhtmlizer \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/*.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/__init__.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/notestplugin.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/testplugin.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_ftp.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_inet.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_manhole.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_portforward.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_socks.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_telnet.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_trial.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/dropin.cache \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/application \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/cred \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/enterprise \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/internet \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/manhole \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/manhole \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/persisted \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/protocols\ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python\ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/timeoutqueue.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/filepath.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/dxprofile.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/plugin.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/htmlizer.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/__init__.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/dispatch.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/hook.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/threadpool.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/otp.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/usage.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/roots.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/versions.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/urlpath.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/util.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/components.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/logfile.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/runtime.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/reflect.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/context.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/threadable.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/rebuild.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/failure.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/lockfile.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/formmethod.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/finalize.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/win32.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/dist.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/shortcut.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/zipstream.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/release.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/syslog.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/log.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/compat.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/zshcomp.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/procutils.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/text.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/_twisted_zsh_stub \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/_epoll.so \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/_initgroups.so \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/scripts/ \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/spread/ \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/tap/ \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/trial/ \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/__init__.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/_version.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/copyright.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/im.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/*.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/python/*.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/*.py* \ +" +RDEPENDS_${PN}-core = "python-core python-zopeinterface" + +FILES_${PN}-lore = " \ +${bindir}/bookify \ +${bindir}/lore \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_lore.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/lore \ +" +RDEPENDS_${PN}-lore = "${PN}-core" + +FILES_${PN}-mail = " \ +${bindir}/mailmail \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_mail.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/mail \ +" +RDEPENDS_${PN}-mail = "${PN}-core ${PN}-protocols" + +FILES_${PN}-names = " \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_names.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/names \ +" +RDEPENDS_${PN}-names = "${PN}-core" + +FILES_${PN}-news = " \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_news.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/news \ +" +RDEPENDS_${PN}-news = "${PN}-core ${PN}-protocols" + +FILES_${PN}-runner = " \ +${libdir}/site-packages/twisted/runner/portmap.so \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/runner\ +" +RDEPENDS_${PN}-runner = "${PN}-core ${PN}-protocols" + +FILES_${PN}-web = " \ +${bindir}/websetroot \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_web.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/web\ +" +RDEPENDS_${PN}-web += "${PN}-core ${PN}-protocols" + +FILES_${PN}-words = " \ +${bindir}/im \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_words.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/words\ +" +RDEPENDS_${PN}-words += "${PN}-core" + +FILES_${PN}-flow = " \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_flow.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/flow \" +RDEPENDS_${PN}-flow += "${PN}-core" + +FILES_${PN}-pair = " \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/plugins/twisted_pair.py* \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/pair \ +" +RDEPENDS_${PN}-pair += "${PN}-core" + +FILES_${PN}-dbg += " \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/*/.debug \ +${libdir}/${PYTHON_DIR}/site-packages/twisted/*/*/.debug \ +" +RDEPENDS_${PN}-dbg = "${PN}" diff --git a/meta-openpli/recipes-devtools/python/python-wifi_0.5.0.bb b/meta-openpli/recipes-devtools/python/python-wifi_0.5.0.bb new file mode 100644 index 0000000000..7f2ccb7a7a --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-wifi_0.5.0.bb @@ -0,0 +1,31 @@ +SUMMARY = "Provides access to Linux Wireless Extensions" +HOMEPAGE = "http://pythonwifi.wikispot.org/" +SECTION = "devel/python" +LICENSE = "LGPLv2+" +LICENSE_${PN}-examples = "GPLv2+" +LIC_FILES_CHKSUM = "file://README;beginline=56;endline=57;md5=31ebd3ff22b6f3c0160a143e0c4a98a3 \ + file://examples/iwconfig.py;beginline=1;endline=20;md5=60fd41501905b3e20e9065995edfc0cf \ + file://pythonwifi/iwlibs.py;beginline=1;endline=22;md5=679475d61cc083a24158bb8b473f0c6f" +RDEPENDS_${PN} = "python-ctypes python-datetime" +PR = "r1" + +SRC_URI = "http://download.berlios.de/pythonwifi/${P}.tar.bz2" +SRC_URI[md5sum] = "8fe7fd0a4edce1f9bedaff4acb7fd500" +SRC_URI[sha256sum] = "3e3f645d37ab20450f60c785cec5f21b330f28a6c46c7c1b0898305dd7a34b26" + +inherit setuptools + +do_install_append() { + install -d ${D}${docdir}/${PN} + mv ${D}${datadir}/README ${D}${docdir}/${PN} + mv ${D}${datadir}/INSTALL ${D}${docdir}/${PN} + mv ${D}${datadir}/docs/* ${D}${docdir}/${PN} + rmdir ${D}${datadir}/docs + install -d ${D}${sbindir} + mv ${D}${datadir}/examples/* ${D}${sbindir} + rmdir ${D}${datadir}/examples +} + +PACKAGES =+ "${PN}-examples" + +FILES_${PN}-examples = "${sbindir}" diff --git a/meta-openpli/recipes-devtools/python/python-yenc_0.3.bb b/meta-openpli/recipes-devtools/python/python-yenc_0.3.bb new file mode 100644 index 0000000000..491860e0d6 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-yenc_0.3.bb @@ -0,0 +1,17 @@ +DESCRIPTION = "yEnc module for Python" +SECTION = "devel/python" +DEPENDS = "python" +PRIORITY = "optional" +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://COPYING;md5=e673a95e6911049cc1cadf00eac1f759" + +SRCNAME = "yenc" +PR = "ml1" + +SRC_URI = "http://www.golug.it/pub/yenc/${SRCNAME}-${PV}.tar.gz" +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils + +SRC_URI[md5sum] = "5bdcad71607e4bf7874c9d5fa203c7c7" diff --git a/meta-openpli/recipes-devtools/python/python-zopeinterface_3.5.1.bbappend b/meta-openpli/recipes-devtools/python/python-zopeinterface_3.5.1.bbappend new file mode 100644 index 0000000000..7bcb16b0ab --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python-zopeinterface_3.5.1.bbappend @@ -0,0 +1,21 @@ +PRINC = "1" + +inherit setuptools openpli-distutils + +do_compile() { +} + +do_install() { + distutils_do_install_keep +} + +do_install_append() { + rm -fR ${D}${PYTHON_SITEPACKAGES_DIR}/zope/interface/test* + rm -fR ${D}${PYTHON_SITEPACKAGES_DIR}/zope/interface/common/test* +} + +PACKAGES =+ "${PN}-src" +RDEPENDS_{PN}-src = "${PN}" +FILES_${PN}-src += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*.py" +FILES_${PN}-src += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*/*.py" + diff --git a/meta-openpli/recipes-devtools/python/python/ctypes-error-handling-fix.patch b/meta-openpli/recipes-devtools/python/python/ctypes-error-handling-fix.patch new file mode 100644 index 0000000000..5e07082487 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python/ctypes-error-handling-fix.patch @@ -0,0 +1,40 @@ +--- a/Modules/_ctypes/_ctypes.c 2012-01-26 15:41:30.000000000 +0100 ++++ b/Modules/_ctypes/_ctypes.c 2012-01-26 15:44:41.046977137 +0100 +@@ -602,10 +602,16 @@ + #ifdef __CYGWIN__ + /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_ValueError, +- "symbol '%s' not found (%s) ", ++ "symbol '%s' not found", + name); + #else +- PyErr_SetString(PyExc_ValueError, ctypes_dlerror()); ++ const char *err = ctypes_dlerror(); ++ if (!err) ++ PyErr_Format(PyExc_ValueError, ++ "symbol '%s' not found", ++ name); ++ else ++ PyErr_SetString(PyExc_ValueError, err); + #endif + return NULL; + } +@@ -3290,10 +3296,16 @@ + #ifdef __CYGWIN__ + /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_AttributeError, +- "function '%s' not found (%s) ", ++ "function '%s' not found", + name); + #else +- PyErr_SetString(PyExc_AttributeError, ctypes_dlerror()); ++ const char *err = ctypes_dlerror(); ++ if (!err) ++ PyErr_Format(PyExc_AttributeError, ++ "function '%s' not found", ++ name); ++ else ++ PyErr_SetString(PyExc_AttributeError, err); + #endif + return NULL; + } diff --git a/meta-openpli/recipes-devtools/python/python/fix_pthread_site.patch b/meta-openpli/recipes-devtools/python/python/fix_pthread_site.patch new file mode 100644 index 0000000000..d392060492 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python/fix_pthread_site.patch @@ -0,0 +1,38 @@ +--- configure.in.org 2008-05-01 12:40:58.000000000 +0200 ++++ configure.in 2008-05-01 12:39:39.000000000 +0200 +@@ -998,7 +999,7 @@ + # so we need to run a program to see whether it really made the + # function available. + AC_MSG_CHECKING(whether $CC accepts -pthread) +-AC_CACHE_VAL(ac_cv_thread, ++AC_CACHE_VAL(ac_cv_pthread, + [ac_save_cc="$CC" + CC="$CC -pthread" + AC_TRY_RUN([ +@@ -1023,11 +1024,11 @@ + + # If we have set a CC compiler flag for thread support then + # check if it works for CXX, too. +-ac_cv_cxx_thread=no + if test ! -z "$CXX" + then + AC_MSG_CHECKING(whether $CXX also accepts flags for thread support) +-ac_save_cxx="$CXX" ++AC_CACHE_VAL(ac_cv_cxx_thread, ++[ac_save_cxx="$CXX" + + if test "$ac_cv_kpthread" = "yes" + then +@@ -1056,9 +1057,11 @@ + fi + rm -fr conftest* + fi ++CXX="$ac_save_cxx"]) + AC_MSG_RESULT($ac_cv_cxx_thread) ++else ++ ac_cv_cxx_thread=no + fi +-CXX="$ac_save_cxx" + + dnl # check for ANSI or K&R ("traditional") preprocessor + dnl AC_MSG_CHECKING(for C preprocessor type) diff --git a/meta-openpli/recipes-devtools/python/python/no-ldconfig.patch b/meta-openpli/recipes-devtools/python/python/no-ldconfig.patch new file mode 100644 index 0000000000..fff1ccd3bd --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python/no-ldconfig.patch @@ -0,0 +1,23 @@ +Fixes exception on 'import uuid' if ldconfig is unavailable. + +diff -Naur Python-2.6.7.orig/Lib/ctypes/util.py Python-2.6.7/Lib/ctypes/util.py +--- Python-2.6.7.orig/Lib/ctypes/util.py 2010-03-20 03:11:16.000000000 +0100 ++++ Python-2.6.7/Lib/ctypes/util.py 2012-01-12 15:26:37.562726637 +0100 +@@ -204,7 +204,16 @@ + return res.group(1) + + def find_library(name): +- return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ++ from glob import glob ++ paths = ['/lib', '/usr/lib'] ++ if os.environ.has_key('LD_LIBRARY_PATH'): ++ paths = os.environ['LD_LIBRARY_PATH'].split(':') + paths ++ for path in paths: ++ for lib in glob("%s/lib%s.so.*" % (path, name)): ++ rpath = os.path.realpath(lib) ++ if os.path.isfile(rpath): ++ return rpath ++ return None + + ################################################################ + # test code diff --git a/meta-openpli/recipes-devtools/python/python/some_configure_fixes.patch b/meta-openpli/recipes-devtools/python/python/some_configure_fixes.patch new file mode 100644 index 0000000000..eced413945 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python/some_configure_fixes.patch @@ -0,0 +1,32 @@ +--- configure.in 2008-02-13 20:17:17.000000000 +0100 ++++ configure.in 2008-10-21 22:45:31.000000000 +0200 +@@ -3369,27 +3369,9 @@ + AC_MSG_RESULT(no) + ) + +-AC_MSG_CHECKING(for /dev/ptmx) ++AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if we have /dev/ptmx.])) + +-if test -r /dev/ptmx +-then +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_DEV_PTMX, 1, +- [Define if we have /dev/ptmx.]) +-else +- AC_MSG_RESULT(no) +-fi +- +-AC_MSG_CHECKING(for /dev/ptc) +- +-if test -r /dev/ptc +-then +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_DEV_PTC, 1, +- [Define if we have /dev/ptc.]) +-else +- AC_MSG_RESULT(no) +-fi ++AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.])) + + case $MACHDEP in + darwin) diff --git a/meta-openpli/recipes-devtools/python/python_2.7.2.bbappend b/meta-openpli/recipes-devtools/python/python_2.7.2.bbappend new file mode 100644 index 0000000000..2069d83ca3 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/python_2.7.2.bbappend @@ -0,0 +1,30 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PRINC = "2" + +SRC_URI += " \ + file://some_configure_fixes.patch;striplevel=0 \ + file://fix_pthread_site.patch;striplevel=0 \ + file://no-ldconfig.patch \ + file://ctypes-error-handling-fix.patch \ +" + +EXTRA_OECONF += " \ + ac_cv_file__dev_ptmx=yes \ + ac_cv_file__dev_ptc=no \ + ac_cv_no_strict_aliasing_ok=yes \ + ac_cv_pthread=yes \ + ac_cv_cxx_thread=yes \ + ac_cv_sizeof_off_t=8 \ +" + +PACKAGES =+ "${PN}-src" +RDEPENDS_{PN}-src = "${PN}" +FILES_${PN}-src += "${libdir}/python${PYTHON_MAJMIN}/*.py" +FILES_${PN}-src += "${libdir}/python${PYTHON_MAJMIN}/*/*.py" +FILES_${PN}-src += "${libdir}/python${PYTHON_MAJMIN}/*/*/*.py" + +do_install_append() { + rm -fR ${D}/usr/lib/python${PYTHON_MAJMIN}/*/test* + rm -fR ${D}/usr/lib/python${PYTHON_MAJMIN}/*/*/test* +} diff --git a/meta-openpli/recipes-devtools/python/twistedsnmp_0.3.13.bb b/meta-openpli/recipes-devtools/python/twistedsnmp_0.3.13.bb new file mode 100644 index 0000000000..27c14f6279 --- /dev/null +++ b/meta-openpli/recipes-devtools/python/twistedsnmp_0.3.13.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "twisted SNMP framework" +SECTION = "devel/python" +PRIORITY = "optional" +RDEPENDS_${PN} = "python-pysnmp-se" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://license.txt;md5=c6f330cac7a286df5a2a7617fdda815f" + +SRCNAME = "TwistedSNMP" +SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${SRCNAME}-${PV}.tar.gz" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils + +SRC_URI[md5sum] = "70716c4314f6c03a3da0cf57cabba03c" +SRC_URI[sha256sum] = "4e3d20110a3083bf4c602b57c5bcf447182bb0effcb8b0603f5da0314a804cce" diff --git a/meta-openpli/recipes-devtools/swig/swig_2.0.4.bb b/meta-openpli/recipes-devtools/swig/swig_2.0.4.bb new file mode 100644 index 0000000000..e05c9d646a --- /dev/null +++ b/meta-openpli/recipes-devtools/swig/swig_2.0.4.bb @@ -0,0 +1,11 @@ +require recipes-devtools/swig/swig.inc + +LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \ + file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \ + file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08" + +DEPENDS += "libpcre-native" +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "4319c503ee3a13d2a53be9d828c3adc0" +SRC_URI[sha256sum] = "763a117730d26f8e5ed67f5718c6c0761fbb8461680fc20269db8c0839e1ec8a" diff --git a/meta-openpli/recipes-extended/hddtemp/hddtemp/hddtemp-no-nls-support.patch b/meta-openpli/recipes-extended/hddtemp/hddtemp/hddtemp-no-nls-support.patch new file mode 100644 index 0000000000..8f6b9c3c4b --- /dev/null +++ b/meta-openpli/recipes-extended/hddtemp/hddtemp/hddtemp-no-nls-support.patch @@ -0,0 +1,66 @@ +diff -ru hddtemp-0.3-beta15.orig/configure.in hddtemp-0.3-beta15/configure.in +--- hddtemp-0.3-beta15.orig/configure.in 2005-10-17 20:14:19.000000000 +0100 ++++ hddtemp-0.3-beta15/configure.in 2008-06-27 00:00:46.000000000 +0100 +@@ -17,6 +17,7 @@ + # append the host alias to the tools for cross compiling + AC_HEADER_STDC + AC_CHECK_HEADERS(fcntl.h) ++AC_CHECK_HEADERS(iconv.h) + AC_CHECK_HEADERS(netinet/in.h) + AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE_UNQUOTED([in_addr_t], [uint32_t], [Define to 'uint32_t' if does not define.])], [#include ]) + +@@ -29,6 +30,8 @@ + AM_GNU_GETTEXT + #AM_GNU_GETTEXT([external]) + ++AC_CHECK_FUNCS([bindtextdomain textdomain iconv]) ++ + dnl reasonable guesses for where stuff is installed + dnl if we don't do that now, the config.h will use ${prefix} + dnl for DEFAULT_DATABASE_PATH. +diff -ru hddtemp-0.3-beta15.orig/src/hddtemp.c hddtemp-0.3-beta15/src/hddtemp.c +--- hddtemp-0.3-beta15.orig/src/hddtemp.c 2006-04-19 03:37:35.000000000 +0100 ++++ hddtemp-0.3-beta15/src/hddtemp.c 2008-06-26 23:59:40.000000000 +0100 +@@ -276,8 +276,12 @@ + backtrace_sigbus(); + + setlocale (LC_ALL, ""); ++#ifdef HAVE_BINDTEXTDOMAIN + bindtextdomain (PACKAGE, LOCALEDIR); ++#endif ++#ifdef HAVE_TEXTDOMAIN + textdomain (PACKAGE); ++#endif + + show_db = debug = numeric = quiet = wakeup = af_hint = syslog_interval = 0; + unit = DEFAULT; +diff -ru hddtemp-0.3-beta15.orig/src/utf8.c hddtemp-0.3-beta15/src/utf8.c +--- hddtemp-0.3-beta15.orig/src/utf8.c 2006-04-19 03:37:02.000000000 +0100 ++++ hddtemp-0.3-beta15/src/utf8.c 2008-06-27 00:02:15.000000000 +0100 +@@ -23,7 +23,9 @@ + + // Standard includes + #include ++#ifdef HAVE_ICONV_H + #include ++#endif + #include + #include + #include +@@ -34,6 +36,7 @@ + + static char *iconv_from_utf8_to_locale(const char *string, const char* fallback_string) + { ++#ifdef HAVE_ICONV + const size_t buffer_inc = 80; // Increment buffer size in 80 bytes step + const char *charset; + iconv_t cd; +@@ -93,6 +96,8 @@ + if (dest_buffer != NULL) + free(dest_buffer); // free buffer + free(src_buffer); // free string ++#endif ++ + return strdup(fallback_string); // and return fallback string + } + diff --git a/meta-openpli/recipes-extended/hddtemp/hddtemp_0.3-beta15.bb b/meta-openpli/recipes-extended/hddtemp/hddtemp_0.3-beta15.bb new file mode 100644 index 0000000000..8ef9a2c52e --- /dev/null +++ b/meta-openpli/recipes-extended/hddtemp/hddtemp_0.3-beta15.bb @@ -0,0 +1,22 @@ +SUMMARY = "Hard disk temperature monitor daemon" +SECTION = "console/network" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://GPL-2;md5=eb723b61539feef013de476e68b5c50a" +PR = "r1" + +SRC_URI = "http://download.savannah.nongnu.org/releases/${PN}/${PN}-${PV}.tar.bz2;name=tar \ + http://download.savannah.nongnu.org/releases/${PN}/hddtemp.db;name=db \ + file://hddtemp-no-nls-support.patch" +SRC_URI[tar.md5sum] = "8b829339e1ae9df701684ec239021bb8" +SRC_URI[tar.sha256sum] = "618541584054093d53be8a2d9e81c97174f30f00af91cb8700a97e442d79ef5b" +SRC_URI[db.md5sum] = "5321858f8c028d4b1a91a8a5f951f2f8" +SRC_URI[db.sha256sum] = "8b19e70228214562eb10a46bd73b6ea8601e996f2d6527907b560d35b33f5240" + +inherit autotools gettext + +FILES_${PN} += "/usr/share/misc/hddtemp.db" + +do_install_append() { + install -d ${D}/usr/share/misc/ + install -m 0644 ${WORKDIR}/hddtemp.db ${D}/usr/share/misc/hddtemp.db +} diff --git a/meta-openpli/recipes-extended/irqbalance/irqbalance_0.56.bb b/meta-openpli/recipes-extended/irqbalance/irqbalance_0.56.bb new file mode 100644 index 0000000000..aec35b249d --- /dev/null +++ b/meta-openpli/recipes-extended/irqbalance/irqbalance_0.56.bb @@ -0,0 +1,12 @@ +SUMMARY = "Daemon to balance interrupts for SMP systems" +HOMEPAGE = "http://irqbalance.org/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "glib-2.0" +PR = "r1" + +SRC_URI = "http://irqbalance.org/releases/${BP}.tar.bz2" +SRC_URI[md5sum] = "cd0c4d3b2bb84778a04fc594ad83949a" +SRC_URI[sha256sum] = "516e1bdc5469f0f350e2e9ad2925b221faa4497a608c8d4e28a997938451c5fc" + +inherit autotools diff --git a/meta-openpli/recipes-extended/joe/joe_3.7.bb b/meta-openpli/recipes-extended/joe/joe_3.7.bb new file mode 100644 index 0000000000..436fd078b2 --- /dev/null +++ b/meta-openpli/recipes-extended/joe/joe_3.7.bb @@ -0,0 +1,14 @@ +SUMMARY = "Console text editor with good functionality, good choice for vi-haters." +HOMEPAGE = "http://joe-editor.sourceforge.net/" +SECTION = "console/utils" +LICENSE = "GPL-1.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=da10ed7cf8038981c580e11c1d3e8fb6" +PR = "r2" + +SRC_URI = "${SOURCEFORGE_MIRROR}/joe-editor/joe-${PV}.tar.gz" +SRC_URI[md5sum] = "66de1b073e869ba12abbfcde3885c577" +SRC_URI[sha256sum] = "cae456e1ad5a8c1d3c94920a3416c2347277739b260e3494d3bc0f2b9b73106f" + +inherit autotools + +RDEPENDS_${PN} = "ncurses-terminfo" diff --git a/meta-openpli/recipes-extended/ncdu/ncdu_1.8.bb b/meta-openpli/recipes-extended/ncdu/ncdu_1.8.bb new file mode 100644 index 0000000000..75e0641cfa --- /dev/null +++ b/meta-openpli/recipes-extended/ncdu/ncdu_1.8.bb @@ -0,0 +1,11 @@ +SUMMARY = "NCurses Disk Usage" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=321d4ec4e1e7746028446d003a975868" +DEPENDS = "ncurses" +PR = "r1" + +SRC_URI = "http://dev.yorhel.nl/download/ncdu-${PV}.tar.gz" +SRC_URI[md5sum] = "94d7a821f8a0d7ba8ef3dd926226f7d5" +SRC_URI[sha256sum] = "42aaf0418c05e725b39b220166a9c604a9c54c0fbf7692c9c119b36d0ed5d099" + +inherit autotools diff --git a/meta-openpli/recipes-extended/sdparm/sdparm_1.07.bb b/meta-openpli/recipes-extended/sdparm/sdparm_1.07.bb new file mode 100644 index 0000000000..d93414f371 --- /dev/null +++ b/meta-openpli/recipes-extended/sdparm/sdparm_1.07.bb @@ -0,0 +1,11 @@ +SUMMARY = "The sdparm utility accesses SCSI device parameters" +SECTION = "console" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=ecab6c36b7ba82c675581dd0afde36f7" +PR = "r1" + +SRC_URI = "http://sg.danny.cz/sg/p/sdparm-${PV}.tgz" +SRC_URI[md5sum] = "c807f9db3dd7af175214be0d7fece494" +SRC_URI[sha256sum] = "c1d257ba97f37f99a602e889a73e4c62f9b374c5b979e33fc06963462f0c0e41" + +inherit autotools diff --git a/meta-openpli/recipes-extended/shadow/shadow-securetty/securetty b/meta-openpli/recipes-extended/shadow/shadow-securetty/securetty new file mode 100644 index 0000000000..e1dfa2465a --- /dev/null +++ b/meta-openpli/recipes-extended/shadow/shadow-securetty/securetty @@ -0,0 +1,275 @@ +# /etc/securetty: list of terminals on which root is allowed to login. +# See securetty(5) and login(1). +console + +# Standard serial ports +ttyS0 +ttyS1 +ttyS2 +ttyS3 + +# Samsung ARM SoCs +ttySAC0 +ttySAC1 +ttySAC2 +ttySAC3 + +# TI OMAP SoCs +ttyO0 +ttyO1 +ttyO2 +ttyO3 + +# USB dongles +ttyUSB0 +ttyUSB1 +ttyUSB2 + +# USB serial gadget +ttyGS0 + +# PowerMac +ttyPZ0 +ttyPZ1 +ttyPZ2 +ttyPZ3 + +# Embedded MPC platforms +ttyPSC0 +ttyPSC1 +ttyPSC2 +ttyPSC3 +ttyPSC4 +ttyPSC5 + +# PA-RISC mux ports +ttyB0 +ttyB1 + +# Standard hypervisor virtual console +hvc0 + +# Oldstyle Xen console +xvc0 + +# Standard consoles +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +tty12 +tty13 +tty14 +tty15 +tty16 +tty17 +tty18 +tty19 +tty20 +tty21 +tty22 +tty23 +tty24 +tty25 +tty26 +tty27 +tty28 +tty29 +tty30 +tty31 +tty32 +tty33 +tty34 +tty35 +tty36 +tty37 +tty38 +tty39 +tty40 +tty41 +tty42 +tty43 +tty44 +tty45 +tty46 +tty47 +tty48 +tty49 +tty50 +tty51 +tty52 +tty53 +tty54 +tty55 +tty56 +tty57 +tty58 +tty59 +tty60 +tty61 +tty62 +tty63 + +# Local X displays (allows empty passwords with pam_unix's nullok_secure) +:0 +:0.0 +:0.1 +:1 +:1.0 +:1.1 +:2 +:2.0 +:2.1 +:3 +:3.0 +:3.1 + +# Embedded Freescale i.MX ports +ttymxc0 +ttymxc1 +ttymxc2 +ttymxc3 +ttymxc4 +ttymxc5 + +# Standard serial ports, with devfs +tts/0 +tts/1 + +# Standard consoles, with devfs +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +vc/12 +vc/13 +vc/14 +vc/15 +vc/16 +vc/17 +vc/18 +vc/19 +vc/20 +vc/21 +vc/22 +vc/23 +vc/24 +vc/25 +vc/26 +vc/27 +vc/28 +vc/29 +vc/30 +vc/31 +vc/32 +vc/33 +vc/34 +vc/35 +vc/36 +vc/37 +vc/38 +vc/39 +vc/40 +vc/41 +vc/42 +vc/43 +vc/44 +vc/45 +vc/46 +vc/47 +vc/48 +vc/49 +vc/50 +vc/51 +vc/52 +vc/53 +vc/54 +vc/55 +vc/56 +vc/57 +vc/58 +vc/59 +vc/60 +vc/61 +vc/62 +vc/63 + +# Pseudo terminals +pts/0 +pts/1 +pts/2 +pts/3 +pts/4 +pts/5 +pts/6 +pts/7 +pts/8 +pts/9 +pts/10 +pts/11 +pts/12 +pts/13 +pts/14 +pts/15 +pts/16 +pts/17 +pts/18 +pts/19 +pts/20 +pts/21 +pts/22 +pts/23 +pts/24 +pts/25 +pts/26 +pts/27 +pts/28 +pts/29 +pts/30 +pts/31 +pts/32 +pts/33 +pts/34 +pts/35 +pts/36 +pts/37 +pts/38 +pts/39 +pts/40 +pts/41 +pts/42 +pts/43 +pts/44 +pts/45 +pts/46 +pts/47 +pts/48 +pts/49 +pts/50 +pts/51 +pts/52 +pts/53 +pts/54 +pts/55 +pts/56 +pts/57 +pts/58 +pts/59 +pts/60 +pts/61 +pts/62 +pts/63 diff --git a/meta-openpli/recipes-extended/shadow/shadow-securetty_4.1.4.3.bbappend b/meta-openpli/recipes-extended/shadow/shadow-securetty_4.1.4.3.bbappend new file mode 100644 index 0000000000..9a5dec5294 --- /dev/null +++ b/meta-openpli/recipes-extended/shadow/shadow-securetty_4.1.4.3.bbappend @@ -0,0 +1,3 @@ +PRINC = "1" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openpli/recipes-extended/smartmontools/smartmontools.inc b/meta-openpli/recipes-extended/smartmontools/smartmontools.inc new file mode 100644 index 0000000000..c1ded3a084 --- /dev/null +++ b/meta-openpli/recipes-extended/smartmontools/smartmontools.inc @@ -0,0 +1,10 @@ +SECTION = "console/utils" +SUMMARY = "Control and monitor storage systems using S.M.A.R.T." +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +INC_PR = "r1" + +SRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz" +S = "${WORKDIR}/smartmontools-${PV}" + +inherit autotools diff --git a/meta-openpli/recipes-extended/smartmontools/smartmontools_5.42.bb b/meta-openpli/recipes-extended/smartmontools/smartmontools_5.42.bb new file mode 100644 index 0000000000..98ebb37a20 --- /dev/null +++ b/meta-openpli/recipes-extended/smartmontools/smartmontools_5.42.bb @@ -0,0 +1,6 @@ +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "4460bf9a79a1252ff5c00ba52cf76b2a" +SRC_URI[sha256sum] = "b664d11e814e114ce3a32a4fa918c9e649c684e2897c007b2a8b92574decc374" + +require smartmontools.inc diff --git a/meta-openpli/recipes-extended/tzdata/tzdata_2012b.bbappend b/meta-openpli/recipes-extended/tzdata/tzdata_2012b.bbappend new file mode 100644 index 0000000000..2841a13cb4 --- /dev/null +++ b/meta-openpli/recipes-extended/tzdata/tzdata_2012b.bbappend @@ -0,0 +1,76 @@ +PRINC = "1" + +DEFAULT_TIMEZONE = "CET" + +FILES_${PN} = " \ + ${datadir}/zoneinfo/Africa/Casablanca \ + ${datadir}/zoneinfo/Africa/Harare \ + ${datadir}/zoneinfo/Africa/Kinshasa \ + ${datadir}/zoneinfo/Africa/Nairobi \ + ${datadir}/zoneinfo/America/Anchorage \ + ${datadir}/zoneinfo/America/Bogota \ + ${datadir}/zoneinfo/America/Caracas \ + ${datadir}/zoneinfo/America/Danmarkshavn \ + ${datadir}/zoneinfo/America/Halifax \ + ${datadir}/zoneinfo/America/Manaus \ + ${datadir}/zoneinfo/America/Noronha \ + ${datadir}/zoneinfo/America/Regina \ + ${datadir}/zoneinfo/America/Santiago \ + ${datadir}/zoneinfo/America/Sao_Paulo \ + ${datadir}/zoneinfo/America/St_Johns \ + ${datadir}/zoneinfo/America/Tijuana \ + ${datadir}/zoneinfo/Asia/Almaty \ + ${datadir}/zoneinfo/Asia/Baghdad \ + ${datadir}/zoneinfo/Asia/Baku \ + ${datadir}/zoneinfo/Asia/Bangkok \ + ${datadir}/zoneinfo/Asia/Colombo \ + ${datadir}/zoneinfo/Asia/Dhaka \ + ${datadir}/zoneinfo/Asia/Hong_Kong \ + ${datadir}/zoneinfo/Asia/Irkutsk \ + ${datadir}/zoneinfo/Asia/Jerusalem \ + ${datadir}/zoneinfo/Asia/Kabul \ + ${datadir}/zoneinfo/Asia/Kathmandu \ + ${datadir}/zoneinfo/Asia/Kolkata \ + ${datadir}/zoneinfo/Asia/Krasnoyarsk \ + ${datadir}/zoneinfo/Asia/Kuala_Lumpur \ + ${datadir}/zoneinfo/Asia/Magadan \ + ${datadir}/zoneinfo/Asia/Muscat \ + ${datadir}/zoneinfo/Asia/Omsk \ + ${datadir}/zoneinfo/Asia/Rangoon \ + ${datadir}/zoneinfo/Asia/Riyadh \ + ${datadir}/zoneinfo/Asia/Seoul \ + ${datadir}/zoneinfo/Asia/Taipei \ + ${datadir}/zoneinfo/Asia/Tashkent \ + ${datadir}/zoneinfo/Asia/Tehran \ + ${datadir}/zoneinfo/Asia/Tokyo \ + ${datadir}/zoneinfo/Asia/Vladivostok \ + ${datadir}/zoneinfo/Asia/Yakutsk \ + ${datadir}/zoneinfo/Atlantic/Azores \ + ${datadir}/zoneinfo/Atlantic/Cape_Verde \ + ${datadir}/zoneinfo/Australia/Adelaide \ + ${datadir}/zoneinfo/Australia/Brisbane \ + ${datadir}/zoneinfo/Australia/Darwin \ + ${datadir}/zoneinfo/Australia/Hobart \ + ${datadir}/zoneinfo/Australia/Perth \ + ${datadir}/zoneinfo/Australia/Sydney \ + ${datadir}/zoneinfo/CET \ + ${datadir}/zoneinfo/CST6CDT \ + ${datadir}/zoneinfo/EST \ + ${datadir}/zoneinfo/EST5EDT \ + ${datadir}/zoneinfo/Europe/Dublin \ + ${datadir}/zoneinfo/Europe/Istanbul \ + ${datadir}/zoneinfo/Europe/Moscow \ + ${datadir}/zoneinfo/MST7MDT \ + ${datadir}/zoneinfo/Pacific/Auckland \ + ${datadir}/zoneinfo/Pacific/Fiji \ + ${datadir}/zoneinfo/Pacific/Guam \ + ${datadir}/zoneinfo/Pacific/Honolulu \ + ${datadir}/zoneinfo/Pacific/Kwajalein \ + ${datadir}/zoneinfo/Pacific/Midway \ + ${datadir}/zoneinfo/Pacific/Tongatapu \ + ${sysconfdir}/localtime \ + ${sysconfdir}/timezone " + +PACKAGES += "${PN}-base" + +FILES_${PN}-base = "${datadir}/zoneinfo" diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-af9005.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-af9005.bb new file mode 100644 index 0000000000..74732d6ffb --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-af9005.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for Afatech AF9005" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 af9005.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data1-st.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data1-st.bb new file mode 100644 index 0000000000..56bbcde4e6 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data1-st.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for as102_data1_st" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 as102_data1_st.hex ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data2-st.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data2-st.bb new file mode 100644 index 0000000000..6366a59100 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-as102-data2-st.bb @@ -0,0 +1,12 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for as102_data2_st" + +SRCREV = "61a66a03697b3cdc04e244688fa716aa13b3bf12" + +PR = "r1" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 as102_data2_st.hex ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-atheros-ar9271.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-atheros-ar9271.bb new file mode 100644 index 0000000000..fdfb3ce1d3 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-atheros-ar9271.bb @@ -0,0 +1,11 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for Atheros HTC devices ar9271" + +SRCREV = "a3ffb1a98408f713ff82d59ae1fd203d650974c4" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 ar9271.fw ${D}${base_libdir}/firmware + install -m 0644 LICENCE.atheros_firmware ${D}${base_libdir}/firmware/LICENCE_ar9271.txt +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-carl9170_1.9.5.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-carl9170_1.9.5.bb new file mode 100644 index 0000000000..f209e91b8f --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-carl9170_1.9.5.bb @@ -0,0 +1,11 @@ +DESCRIPTION = "Firmware for CARL9170" +LICENCE = "closed" + +require linux-firmware.inc + +SRCREV = "c8157f24773d71bef6b45811a2d4b40eafa08f9c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 ar9170-3.fw ${D}${base_libdir}/firmware/carl9170-1.fw +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.a2.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.a2.bb new file mode 100644 index 0000000000..ed821324fa --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.a2.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for drx397xD.A2" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 drx397xD.A2.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.b1.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.b1.bb new file mode 100644 index 0000000000..a3d365d5b5 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-drx397xd.b1.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for drx397xD.B1" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 drx397xD.B1.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-a2-1.1.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-a2-1.1.bb new file mode 100644 index 0000000000..ecd6cef532 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-a2-1.1.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for drxd-a2-1.1" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 drxd-a2-1.1.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-b1-1.1.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-b1-1.1.bb new file mode 100644 index 0000000000..c064f38a6b --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-drxd-b1-1.1.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for drxd-b1-1.1" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 drxd-b1-1.1.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-af9013.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-af9013.bb new file mode 100644 index 0000000000..4cc060bee6 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-af9013.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-fe-af9013" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-fe-af9013.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-ds3000.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-ds3000.bb new file mode 100644 index 0000000000..a718bf5234 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-ds3000.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for ds3000 dvb frontend" + +SRCREV = "2c7a7f802cdf515e6e7b814111aea56669fac4b2" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-fe-ds3000.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-tda10071.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-tda10071.bb new file mode 100644 index 0000000000..9003f0dd75 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-tda10071.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for TDA10071 dvb frontend" + +SRCREV = "2c7a7f802cdf515e6e7b814111aea56669fac4b2" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-fe-tda10071.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.1.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.1.bb new file mode 100644 index 0000000000..5cadff26b7 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.1.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for xc5000" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-fe-xc5000-1.1.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.6.114.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.6.114.bb new file mode 100644 index 0000000000..3a0da9cdc7 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-fe-xc5000-1.6.114.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for xc5000" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-fe-xc5000-1.6.114.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-nova-12mhz-b0.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-nova-12mhz-b0.bb new file mode 100644 index 0000000000..edae582496 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-nova-12mhz-b0.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-nova_12Mhz" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb_nova_12mhz_b0.inp ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-siano.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-siano.bb new file mode 100644 index 0000000000..f623fca7cf --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-siano.bb @@ -0,0 +1,13 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for Siano USB DVB" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-dvbt-02.fw ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-isdbt-02.fw ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-nova-a-dvbt-01.fw ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-nova-b-dvbt-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-adstech-usb2-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-adstech-usb2-02.bb new file mode 100644 index 0000000000..69ca6a67b2 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-adstech-usb2-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-adstech-usb2-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-adstech-usb2-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9015.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9015.bb new file mode 100644 index 0000000000..487ee3ff07 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9015.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-af9015" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-af9015.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9035-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9035-01.bb new file mode 100644 index 0000000000..afcb912823 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-af9035-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-af9035-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-af9035-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-avertv-a800-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-avertv-a800-02.bb new file mode 100644 index 0000000000..6014328e0a --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-avertv-a800-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-az6027-03" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-az6027-03.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-01.bb new file mode 100644 index 0000000000..6cf746de2e --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-bluebird-01" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-bluebird-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-02.bb new file mode 100644 index 0000000000..07f825ea8b --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-bluebird-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-bluebird-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-bluebird-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-01.bb new file mode 100644 index 0000000000..039e5e7fa9 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dib0700-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dib0700-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-03-pre1.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-03-pre1.bb new file mode 100644 index 0000000000..60ea3bf87f --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-03-pre1.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dib0700-03-pre1" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dib0700-03-pre1.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.10.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.10.bb new file mode 100644 index 0000000000..a9894d458b --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.10.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dib0700-1.10" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dib0700-1.10.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.20.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.20.bb new file mode 100644 index 0000000000..6793aacb34 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dib0700-1.20.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dib0700-1.20" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dib0700-1.20.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-5.0.0.11.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-5.0.0.11.bb new file mode 100644 index 0000000000..2c7824ed04 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-5.0.0.11.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dibusb-5.0.0.11" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dibusb-5.0.0.11.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-6.0.0.8.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-6.0.0.8.bb new file mode 100644 index 0000000000..0e7424b6ad --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-6.0.0.8.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dibusb-6.0.0.8" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dibusb-6.0.0.8.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-an2235-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-an2235-01.bb new file mode 100644 index 0000000000..91b62fd6ab --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dibusb-an2235-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dibusb-an2235-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dibusb-an2235-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digitv-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digitv-02.bb new file mode 100644 index 0000000000..d0e0cb96f5 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digitv-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-digitv-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-digitv-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digivox-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digivox-02.bb new file mode 100644 index 0000000000..3a6aeb4fae --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-digivox-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-digivox-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-digivox-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dposh-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dposh-01.bb new file mode 100644 index 0000000000..28f6e78ea4 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dposh-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dposh-01" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dposh-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dtt200u-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dtt200u-01.bb new file mode 100644 index 0000000000..04aa25cc1e --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-dtt200u-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-dtt200u-01.fw" + +SRCREV = "3aa7bab757fdb0e38c484e73d73c6d34a770c1ba" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-dtt200u-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-ec168.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-ec168.bb new file mode 100644 index 0000000000..12bb71f714 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-ec168.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-ec168" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-ec168.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it9135.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it9135.bb new file mode 100644 index 0000000000..fa29e4dc43 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it9135.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-it9135" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-it9135.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it913x.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it913x.bb new file mode 100644 index 0000000000..f69eefdc63 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-it913x.bb @@ -0,0 +1,12 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-it913x" + +SRCREV = "4eb21647ad89816cdc0ad90edcb486fa09ef9a31" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-it9135-01.fw ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-it9135-02.fw ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-it9137-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-megasky-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-megasky-02.bb new file mode 100644 index 0000000000..74dbca7368 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-megasky-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-megasky-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-megasky-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-01.bb new file mode 100644 index 0000000000..879063e23f --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-nova-t-usb2-01.fw" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-nova-t-usb2-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-02.bb new file mode 100644 index 0000000000..f8b2f274d1 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-nova-t-usb2-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-nova-t-usb2-02" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-nova-t-usb2-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-s660.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-s660.bb new file mode 100644 index 0000000000..439c6bda72 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-s660.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for DVB USB TeVii S660 adapter" + +SRCREV = "2c7a7f802cdf515e6e7b814111aea56669fac4b2" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-s660.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-tvwalkert.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-tvwalkert.bb new file mode 100644 index 0000000000..6dab2b471e --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-tvwalkert.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-tvwalkert" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-tvwalkert.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-umt-010-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-umt-010-02.bb new file mode 100644 index 0000000000..d86b9891d8 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-umt-010-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-umt-010-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-umt-010-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-02.bb new file mode 100644 index 0000000000..712873c920 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-wt220u-02" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-wt220u-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-fc03.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-fc03.bb new file mode 100644 index 0000000000..08e1c0760a --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-fc03.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-wt220u-fc03" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-wt220u-fc03.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-miglia-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-miglia-01.bb new file mode 100644 index 0000000000..479b7b961d --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-miglia-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-wt220u-miglia-01" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-wt220u-miglia-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-zl0353-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-zl0353-01.bb new file mode 100644 index 0000000000..6ed65b7b1b --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-dvb-usb-wt220u-zl0353-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for dvb-usb-wt220u-zl0353-01" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 dvb-usb-wt220u-zl0353-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-htc7010.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-htc7010.bb new file mode 100644 index 0000000000..da50cf4240 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-htc7010.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for HTC7010" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 htc_7010.fw ${D}/${base_libdir}/firmware/ +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-htc9271.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-htc9271.bb new file mode 100644 index 0000000000..0ba67a95ce --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-htc9271.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for HTC9271" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 htc_9271.fw ${D}/${base_libdir}/firmware/ +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-isdbt-nova-12mhz-b0.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-isdbt-nova-12mhz-b0.bb new file mode 100644 index 0000000000..75bd07b7d7 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-isdbt-nova-12mhz-b0.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for isdbt_nova_12mhz_b0.inp" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 isdbt_nova_12mhz_b0.inp ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-marvell-sd8688_10.38.1-p25.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-marvell-sd8688_10.38.1-p25.bb new file mode 100644 index 0000000000..de571e3e9f --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-marvell-sd8688_10.38.1-p25.bb @@ -0,0 +1,11 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for Marvell 8688 sdio wifi/bt chipset" + +SRCREV = "09a550b63d05ae12892efaea05417955eaf9e21f" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 libertas/sd8688.bin libertas/sd8688_helper.bin ${D}${base_libdir}/firmware + install -m 0644 LICENCE.libertas ${D}${base_libdir}/firmware/LICENCE_sd8688.txt +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-rt2870.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-rt2870.bb new file mode 100644 index 0000000000..65505d21a6 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-rt2870.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for Ralink RT2870" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 rt2870.bin ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-rt73.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-rt73.bb new file mode 100644 index 0000000000..0b2e100617 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-rt73.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for RT73" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 rt73.bin ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8192cu.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8192cu.bb new file mode 100644 index 0000000000..64dae9fb79 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8192cu.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for RTL8192CU" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware/rtlwifi + install -m 0644 rtlwifi/rtl8192cufw.bin ${D}/${base_libdir}/firmware/rtlwifi/ +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8712u.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8712u.bb new file mode 100644 index 0000000000..315f391ff6 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-rtl8712u.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for RTL8712U" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware/rtlwifi + install -m 0644 rtlwifi/rtl8712u.bin ${D}/${base_libdir}/firmware/rtlwifi/ +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-114xxx-cmmb-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-114xxx-cmmb-01.bb new file mode 100644 index 0000000000..8fad3118ff --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-114xxx-cmmb-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-114xxx-cmmb-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-114xxx-cmmb-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-01.bb new file mode 100644 index 0000000000..ccd4f70901 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-55xxx-dvbt-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-dvbt-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-02.bb new file mode 100644 index 0000000000..da4425a61d --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-55xxx-dvbt-02" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-dvbt-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-03.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-03.bb new file mode 100644 index 0000000000..cbc052c7d2 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-dvbt-03.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-55xxx-dvbt-03" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-dvbt-03.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-02.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-02.bb new file mode 100644 index 0000000000..a2131352b2 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-02.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-55xxx-isdbt-02" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-isdbt-02.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-03.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-03.bb new file mode 100644 index 0000000000..c00e9fe05c --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-hcw-55xxx-isdbt-03.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-hcw-55xxx-isdbt-03" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-hcw-55xxx-isdbt-03.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-a-dvbt-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-a-dvbt-01.bb new file mode 100644 index 0000000000..17b16e4665 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-a-dvbt-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-nova-a-dvbt-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-nova-a-dvbt-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-b-dvbt-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-b-dvbt-01.bb new file mode 100644 index 0000000000..e528d0c659 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-sms1xxx-nova-b-dvbt-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for sms1xxx-nova-b-dvbt-01" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 sms1xxx-nova-b-dvbt-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-dvico-au-01.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-dvico-au-01.bb new file mode 100644 index 0000000000..0332bd1589 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-dvico-au-01.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for xc3028-dvico-au-01" + +SRCREV = "46c66487a85cd05a4acbd5eb4828f72783d1be4c" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 xc3028-dvico-au-01.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-v27.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-v27.bb new file mode 100644 index 0000000000..e5093a4268 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028-v27.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for xc3028-v27" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 xc3028-v27.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028l-v36.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028l-v36.bb new file mode 100644 index 0000000000..68da2abac7 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-xc3028l-v36.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for xc3028L-v36" + +SRCREV = "13f0b6bda7b567d29c747196aa65ad82b18651ca" + +do_install() { + install -d ${D}${base_libdir}/firmware + install -m 0644 xc3028L-v36.fw ${D}${base_libdir}/firmware +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/firmware-zd1211.bb b/meta-openpli/recipes-linux/linux-firmwares/firmware-zd1211.bb new file mode 100644 index 0000000000..20d6210243 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/firmware-zd1211.bb @@ -0,0 +1,10 @@ +require linux-firmware.inc + +DESCRIPTION = "Firmware for ZD1211" + +SRCREV = "bf9f8648fdf1d1d63db471554781f897d219bd62" + +do_install() { + install -d ${D}${base_libdir}/firmware/zd1211 + install -m 0644 zd1211/* ${D}/${base_libdir}/firmware/zd1211/ +} diff --git a/meta-openpli/recipes-linux/linux-firmwares/linux-firmware.inc b/meta-openpli/recipes-linux/linux-firmwares/linux-firmware.inc new file mode 100644 index 0000000000..4c23ccf45d --- /dev/null +++ b/meta-openpli/recipes-linux/linux-firmwares/linux-firmware.inc @@ -0,0 +1,11 @@ +LICENSE = "CLOSED" + +SRC_URI = "git://github.com/mdamt/linux-firmware.git;protocol=git" +SRC_URI = "git://github.com/BjornLee/linux-firmware.git;protocol=git" + +S = "${WORKDIR}/git" + +PACKAGES = "${PN}" +FILES_${PN} += "${base_libdir}/firmware" + +PACKAGE_ARCH = "all" diff --git a/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers.inc b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers.inc new file mode 100644 index 0000000000..4137be1a45 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers.inc @@ -0,0 +1,66 @@ +DESCRIPTION = "Sanitized set of kernel headers for the C library's use." +SECTION = "devel" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +python __anonymous () { + major = d.getVar("PV",True).split('.')[0] + if major == "3": + d.setVar("HEADER_FETCH_VER", "3.0") + else: + d.setVar("HEADER_FETCH_VER", "2.6") +} + +SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.bz2" + +S = "${WORKDIR}/linux-${PV}" + +set_arch() { + case ${TARGET_ARCH} in + alpha*) ARCH=alpha ;; + arm*) ARCH=arm ;; + cris*) ARCH=cris ;; + hppa*) ARCH=parisc ;; + i*86*) ARCH=i386 ;; + ia64*) ARCH=ia64 ;; + mips*) ARCH=mips ;; + m68k*) ARCH=m68k ;; + powerpc*) ARCH=powerpc ;; + s390*) ARCH=s390 ;; + sh*) ARCH=sh ;; + sparc64*) ARCH=sparc64 ;; + sparc*) ARCH=sparc ;; + x86_64*) ARCH=x86_64 ;; + avr32*) ARCH=avr32 ;; + bfin*) ARCH=blackfin ;; + microblaze*) ARCH=microblaze ;; + esac +} + +do_configure() { + set_arch + oe_runmake allnoconfig ARCH=$ARCH +} + +do_compile () { +} + +do_install() { + set_arch + oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix} ARCH=$ARCH + # Kernel should not be exporting this header + rm -f ${D}${exec_prefix}/include/scsi/scsi.h + + # The ..install.cmd conflicts between various configure runs + find ${D}${includedir} -name ..install.cmd | xargs rm -f +} + +BBCLASSEXTEND = "nativesdk" + +#DEPENDS = "cross-linkage" +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS += "unifdef-native" diff --git a/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch new file mode 100644 index 0000000000..5d531d65e4 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch @@ -0,0 +1,29 @@ +Upstream-Status: Inappropriate [embedded specific] + +Currently default header is linux-libc-header, which leads the dismatch +with wrs kernel. + +The different headers for same file cause trouble between kerenl module and +user level binary. E.g. segfault in v86d due to different +CONNECTOR_MAX_MSG_SIZE in connector.h from the one used by uvesafb. + +This fix is work around to sync with wrs kernel headers, and should be removed +after switching to linux-libc-headers-wrs. + +[BUGID #279] fixed by this. + +Signed-off-by: Zhai Edwin + +Index: linux-2.6.34/include/linux/connector.h +=================================================================== +--- linux-2.6.34.orig/include/linux/connector.h 2010-09-30 14:15:25.000000000 +0800 ++++ linux-2.6.34/include/linux/connector.h 2010-09-30 14:15:43.000000000 +0800 +@@ -48,7 +48,7 @@ + /* + * Maximum connector's message size. + */ +-#define CONNECTOR_MAX_MSG_SIZE 16384 ++#define CONNECTOR_MAX_MSG_SIZE 65536 + + /* + * idx and val are unique identifiers which diff --git a/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers_3.3.bb b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers_3.3.bb new file mode 100644 index 0000000000..ea90f4a177 --- /dev/null +++ b/meta-openpli/recipes-linux/linux-libc-headers/linux-libc-headers_3.3.bb @@ -0,0 +1,6 @@ +PRINC = "1" + +require linux-libc-headers.inc + +SRC_URI[md5sum] = "7ceb61f87c097fc17509844b71268935" +SRC_URI[sha256sum] = "c881fc2b53cf0da7ca4538aa44623a7de043a41f76fd5d0f51a31f6ed699d463" diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-buildfix.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-buildfix.patch new file mode 100644 index 0000000000..ce38a95323 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-buildfix.patch @@ -0,0 +1,12 @@ +diff --git a/drivers/mtd/brcmnand/brcmnand_priv.h b/drivers/mtd/brcmnand/brcmnand_priv.h +index 02bbf3c..4011c77 100644 +--- a/drivers/mtd/brcmnand/brcmnand_priv.h ++++ b/drivers/mtd/brcmnand/brcmnand_priv.h +@@ -28,6 +28,7 @@ + + #ifndef CONFIG_MTD_PARTITIONS + #define CONFIG_MTD_PARTITIONS ++#include "../mtdcore.h" + #endif + + #include diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-corr-uncorr-error-detection.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-corr-uncorr-error-detection.patch new file mode 100644 index 0000000000..338c83d61d --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-corr-uncorr-error-detection.patch @@ -0,0 +1,70 @@ +From 894d0934eae56efb33cc3902d6453b9141e0f93f Mon Sep 17 00:00:00 2001 +From: Andreas Monzner +Date: Wed, 1 Feb 2012 00:17:01 +0100 +Subject: [PATCH] brcmnand: use old way to detect correctable/uncorrectable + errors + +--- + drivers/mtd/brcmnand/brcmnand_base.c | 19 +++++++++++-------- + 1 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/drivers/mtd/brcmnand/brcmnand_base.c b/drivers/mtd/brcmnand/brcmnand_base.c +index d39484c..0b9d82e 100644 +--- a/drivers/mtd/brcmnand/brcmnand_base.c ++++ b/drivers/mtd/brcmnand/brcmnand_base.c +@@ -1584,7 +1584,6 @@ printk("<-- %s err = %d\n", __FUNCTION__, err);} + + #endif + +-#if 1 + /* + * SWLINUX-1584: Use HIF status register to check for errors. + * In the past we rely on the fact that the registers +@@ -1598,6 +1597,8 @@ printk("<-- %s err = %d\n", __FUNCTION__, err);} + BCHP_HIF_INTR2_CPU_STATUS_NAND_CORR_INTR_MASK |\ + BCHP_HIF_INTR2_CPU_STATUS_NAND_UNC_INTR_MASK) + ++#if 0 ++ + /* + * Returns 0: BRCMNAND_SUCCESS: No errors + * 1: Correctable error +@@ -1661,15 +1662,14 @@ printk("-->%s\n", __FUNCTION__);} + return BRCMNAND_SUCCESS; + + addr = chip->ctrl_read(BCHP_NAND_ECC_CORR_ADDR); +- if (addr) { +- + #if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_1_0 +- extAddr = chip->ctrl_read(BCHP_NAND_ECC_CORR_EXT_ADDR); ++ extAddr = chip->ctrl_read(BCHP_NAND_ECC_CORR_EXT_ADDR); ++#endif ++ if (addr || extAddr) { ++#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_1_0 + // Clear it + chip->ctrl_write(BCHP_NAND_ECC_CORR_EXT_ADDR, 0); + #endif +- +- // Clear it + chip->ctrl_write(BCHP_NAND_ECC_CORR_ADDR, 0); + printk(KERN_WARNING "%s: Correctable ECC error at %08x:%08x\n", __FUNCTION__, extAddr, addr); + +@@ -1677,10 +1677,13 @@ printk("-->%s\n", __FUNCTION__);} + err = BRCMNAND_CORRECTABLE_ECC_ERROR; + } + ++ extAddr = 0; + addr = chip->ctrl_read(BCHP_NAND_ECC_UNC_ADDR); +- if (addr) { + #if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_1_0 +- extAddr = chip->ctrl_read(BCHP_NAND_ECC_UNC_EXT_ADDR); ++ extAddr = chip->ctrl_read(BCHP_NAND_ECC_UNC_EXT_ADDR); ++#endif ++ if (addr || extAddr) { ++#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_1_0 + // Clear it + chip->ctrl_write(BCHP_NAND_ECC_UNC_EXT_ADDR, 0); + #endif +-- +1.7.8.3 + diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-non-hwecc-first-workaround.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-non-hwecc-first-workaround.patch new file mode 100644 index 0000000000..fd061126db --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/brcmnand-fixed-non-hwecc-first-workaround.patch @@ -0,0 +1,321 @@ +From 3d03c32d61c4772433060225db2892d66db9f6ed Mon Sep 17 00:00:00 2001 +From: Andreas Monzner +Date: Fri, 6 Apr 2012 17:37:04 +0200 +Subject: [PATCH] brcmnand: fixed workaround for dreamboxes without first + stage loader with enabled hw ecc + +--- + drivers/mtd/brcmnand/bcm7xxx-nand.c | 20 +++++---- + drivers/mtd/brcmnand/brcmnand.h | 2 +- + drivers/mtd/brcmnand/brcmnand_base.c | 80 +++++++++++++++++----------------- + drivers/mtd/brcmnand/brcmnand_bbt.c | 4 +- + 4 files changed, 55 insertions(+), 51 deletions(-) + +diff --git a/drivers/mtd/brcmnand/bcm7xxx-nand.c b/drivers/mtd/brcmnand/bcm7xxx-nand.c +index ab842e6..52b85d4 100644 +--- a/drivers/mtd/brcmnand/bcm7xxx-nand.c ++++ b/drivers/mtd/brcmnand/bcm7xxx-nand.c +@@ -338,15 +338,6 @@ static int __devinit brcmnanddrv_probe(struct platform_device *pdev) + + //brcmnand_sort_chipSelects(&info->brcmnand); + +- // Each chip now will have its own BBT (per mtd handle) +- // Problem is we don't know how many CS's we get, until its too late +- if (brcmnand_scan(&info->mtd, cs, gNumNand)) { +- err = -ENXIO; +- goto out_free_info; +- } +- +-PRINTK("Master size=%08llx\n", info->mtd.size); +- + #ifdef CONFIG_MTD_PARTITIONS + /* allow cmdlineparts to override the default map */ + err = parse_mtd_partitions(&info->mtd, part_probe_types, +@@ -357,7 +348,18 @@ PRINTK("Master size=%08llx\n", info->mtd.size); + info->parts = cfg->nr_parts ? cfg->parts : NULL; + info->nr_parts = cfg->nr_parts; + } ++#endif ++ ++ // Each chip now will have its own BBT (per mtd handle) ++ // Problem is we don't know how many CS's we get, until its too late ++ if (brcmnand_scan(&info->mtd, cs, gNumNand)) { ++ err = -ENXIO; ++ goto out_free_info; ++ } + ++PRINTK("Master size=%08llx\n", info->mtd.size); ++ ++#ifdef CONFIG_MTD_PARTITIONS + // Add MTD partition have a dependency on the BBT + if (info->nr_parts) // Primary mtd + brcmnand_add_mtd_partitions(&info->mtd, info->parts, info->nr_parts); +diff --git a/drivers/mtd/brcmnand/brcmnand.h b/drivers/mtd/brcmnand/brcmnand.h +index 96de5d6..031d8cc 100644 +--- a/drivers/mtd/brcmnand/brcmnand.h ++++ b/drivers/mtd/brcmnand/brcmnand.h +@@ -660,7 +660,7 @@ struct brcmnand_chip { + + uint32_t (*ctrl_read) (uint32_t command); + void (*ctrl_write) (uint32_t command, uint32_t val); +- uint32_t (*ctrl_writeAddr)(struct mtd_info* mtd, loff_t addr, int cmdEndAddr); ++ uint32_t (*ctrl_writeAddr)(struct brcmnand_chip* chip, loff_t addr, int cmdEndAddr); + + /* + * THT: Private methods exported to BBT, equivalent to the methods defined in struct ecc_nand_ctl +diff --git a/drivers/mtd/brcmnand/brcmnand_base.c b/drivers/mtd/brcmnand/brcmnand_base.c +index 0b9d82e..170b871 100644 +--- a/drivers/mtd/brcmnand/brcmnand_base.c ++++ b/drivers/mtd/brcmnand/brcmnand_base.c +@@ -1060,10 +1060,9 @@ if (gdebug > 3) printk("%s: offset=%0llx cs=%d ldw = %08x, udw = %08x\n", __FUN + * Controller v3.3 or later allows heterogenous flashes + * Here offset is the offset from the start of the flash (CSn), as each flash has its own mtd handle + */ +-static uint32_t brcmnand_ctrl_writeAddr(struct mtd_info *mtd, loff_t offset, int cmdEndAddr) +-{ +- struct brcmnand_chip* chip = mtd->priv; + ++static uint32_t brcmnand_ctrl_writeAddr(struct brcmnand_chip* chip, loff_t offset, int cmdEndAddr) ++{ + #if CONFIG_MTD_BRCMNAND_VERSION <= CONFIG_MTD_BRCMNAND_VERS_0_1 + uint32_t pAddr = offset + chip->pbase; + uint32_t ldw = 0; +@@ -1095,28 +1094,31 @@ if (gdebug > 3) printk("%s: offset=%0llx cs=%d ldw = %08x, udw = %08x\n", __FUN + #if defined(CONFIG_DREAMBOX) && !defined(CONFIG_DREAMBOX_FIRST_SUPPORTS_HW_ECC) \ + && CONFIG_MTD_BRCMNAND_VERSION < CONFIG_MTD_BRCMNAND_VERS_3_3 + { +- struct mtd_partition **parts = (struct mtd_partition**)(mtd+1); +- struct mtd_partition *part = *parts; +- static uint32_t bits_modified; ++ int *num_parts = (int*)(chip+1); ++ if (*num_parts) { ++ struct mtd_partition **parts = (struct mtd_partition**)(num_parts+1); ++ struct mtd_partition *part = *parts; ++ static uint32_t bits_modified; + +- part++; // loader partition ++ part++; // loader partition + +- if (unlikely(offset < part->size)) { +- uint32_t acc = brcmnand_ctrl_read(bchp_nand_acc_control(0)); +- uint32_t ecc_bits = acc & (BCHP_NAND_ACC_CONTROL_RD_ECC_EN_MASK | BCHP_NAND_ACC_CONTROL_RD_ECC_BLK0_EN_MASK | BCHP_NAND_ACC_CONTROL_WR_ECC_EN_MASK); ++ if (unlikely(offset < part->size)) { ++ uint32_t acc = brcmnand_ctrl_read(bchp_nand_acc_control(0)); ++ uint32_t ecc_bits = acc & (BCHP_NAND_ACC_CONTROL_RD_ECC_EN_MASK | BCHP_NAND_ACC_CONTROL_RD_ECC_BLK0_EN_MASK | BCHP_NAND_ACC_CONTROL_WR_ECC_EN_MASK); + +- if ((ecc_bits | bits_modified) != bits_modified) { ++ if ((ecc_bits | bits_modified) != bits_modified) { + if (gdebug > 3) printk("disable ecc %08x %08x, old %08x\n", ecc_bits, bits_modified, acc); +- acc &= ~ecc_bits; +- brcmnand_ctrl_write(bchp_nand_acc_control(0), acc); +- bits_modified |= ecc_bits; +- } +- } else { +- if (bits_modified) { +- uint32_t acc = brcmnand_ctrl_read(bchp_nand_acc_control(0)); ++ acc &= ~ecc_bits; ++ brcmnand_ctrl_write(bchp_nand_acc_control(0), acc); ++ bits_modified |= ecc_bits; ++ } ++ } else { ++ if (bits_modified) { ++ uint32_t acc = brcmnand_ctrl_read(bchp_nand_acc_control(0)); + if (gdebug > 3) printk("re-enable ecc %08x %08x, old %08x\n", acc, bits_modified, acc); +- brcmnand_restore_ecc(chip, acc | bits_modified); +- bits_modified = 0; ++ brcmnand_restore_ecc(chip, acc | bits_modified); ++ bits_modified = 0; ++ } + } + } + } +@@ -2482,7 +2484,7 @@ static int brcmnand_handle_false_read_ecc_unc_errors( + /* Disable ECC */ + acc0 = brcmnand_disable_read_ecc(chip); + +- chip->ctrl_writeAddr(mtd, offset, 0); ++ chip->ctrl_writeAddr(chip, offset, 0); + PLATFORM_IOFLUSH_WAR(); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_PAGE_READ); + +@@ -2791,7 +2793,7 @@ static int brcmnand_Hamming_WAR(struct mtd_info* mtd, loff_t offset, void* buffe + BDEV_WR(BCHP_HIF_INTR2_CPU_STATUS, intr_status); + #endif + +- chip->ctrl_writeAddr(mtd, offset, 0); ++ chip->ctrl_writeAddr(chip, offset, 0); + PLATFORM_IOFLUSH_WAR(); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_PAGE_READ); + +@@ -2922,7 +2924,7 @@ printk("%s: before intr_status=%08x\n", __FUNCTION__, intr_status); + BDEV_WR(BCHP_HIF_INTR2_CPU_STATUS, intr_status); + #endif + +- chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ chip->ctrl_writeAddr(chip, sliceOffset, 0); + PLATFORM_IOFLUSH_WAR(); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_PAGE_READ); + +@@ -3092,7 +3094,7 @@ static void __maybe_unused debug_clear_ctrl_cache(struct mtd_info* mtd) + BDEV_WR(BCHP_HIF_INTR2_CPU_STATUS, intr_status); + #endif + +- chip->ctrl_writeAddr(mtd, offset, 0); ++ chip->ctrl_writeAddr(chip, offset, 0); + PLATFORM_IOFLUSH_WAR(); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_PAGE_READ); + +@@ -3334,7 +3336,7 @@ brcmnand_edu_read_completion(struct mtd_info* mtd, + // Reset EDU + ISR_push_request(mtd, tmpBuf, NULL, tmpOffset); + #else +- lkgs = chip->ctrl_writeAddr(mtd, gLastKnownGoodEcc, 0); ++ lkgs = chip->ctrl_writeAddr(chip, gLastKnownGoodEcc, 0); + PLATFORM_IOFLUSH_WAR(); + intr_status = EDU_read(buffer, lkgs); + #endif +@@ -3456,7 +3458,7 @@ PRINTK("************* UNCORRECTABLE_ECC (offset=%0llx) ********************\n", + * THT: Since EDU does not handle OOB area, unlike the UNC ERR case of the ctrl read, + * we have to explicitly read the OOB, before calling the WAR routine. + */ +- chip->ctrl_writeAddr(mtd, offset, 0); ++ chip->ctrl_writeAddr(chip, offset, 0); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_SPARE_AREA_READ); + + // Wait until spare area is filled up +@@ -3632,7 +3634,7 @@ PRINTK("************* UNCORRECTABLE_ECC (offset=%0llx) ********************\n", + * THT: Since EDU does not handle OOB area, unlike the UNC ERR case of the ctrl read, + * we have to explicitly read the OOB, before calling the WAR routine. + */ +- chip->ctrl_writeAddr(mtd, offset, 0); ++ chip->ctrl_writeAddr(chip, offset, 0); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_SPARE_AREA_READ); + + // Wait until spare area is filled up +@@ -3769,7 +3771,7 @@ if (gdebug>3) printk("++++++++++++++++++++++++ %s: buffer not 32B aligned, tryin + intr_status = 0; + do { + +- EDU_ldw = chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ EDU_ldw = chip->ctrl_writeAddr(chip, sliceOffset, 0); + PLATFORM_IOFLUSH_WAR(); + + if (intr_status & HIF_INTR2_EBI_TIMEOUT) { +@@ -3874,7 +3876,7 @@ printk("-->%s: offset=%0llx\n", __FUNCTION__, offset); } + //local_irq_save(irqflags); + } + +- chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ chip->ctrl_writeAddr(chip, sliceOffset, 0); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_SPARE_AREA_READ); + + // Wait until spare area is filled up +@@ -4127,7 +4129,7 @@ print_databuf(buffer, 32);} + ret = -EINVAL; + goto out; + } +- chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ chip->ctrl_writeAddr(chip, sliceOffset, 0); + + + if (buffer) { +@@ -4375,7 +4377,7 @@ PRINTK("%s: Buffer %p not suitable for EDU at %0llx, trying ctrl read op\n", __F + + ret = ERESTARTSYS; + do { +- EDU_ldw = chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ EDU_ldw = chip->ctrl_writeAddr(chip, sliceOffset, 0); + + // printk("EDU20\n"); + +@@ -4512,7 +4514,7 @@ print_oobbuf(oobarea, 16); + __FUNCTION__, offset); + } + +- chip->ctrl_writeAddr(mtd, sliceOffset, 0); ++ chip->ctrl_writeAddr(chip, sliceOffset, 0); + + #if 0 + /* Must write data when NAND_COMPLEX_OOB_WRITE option is set */ +@@ -4976,7 +4978,7 @@ EDU_submit_read(eduIsrNode_t* req) + + spin_lock(&req->lock); + +- req->edu_ldw = chip->ctrl_writeAddr(mtd, req->offset, 0); ++ req->edu_ldw = chip->ctrl_writeAddr(chip, req->offset, 0); + PLATFORM_IOFLUSH_WAR(); + + //req->cmd = EDU_READ; +@@ -5031,7 +5033,7 @@ int EDU_submit_write(eduIsrNode_t* req) + } + + +- req->edu_ldw = chip->ctrl_writeAddr(mtd, req->offset, 0); ++ req->edu_ldw = chip->ctrl_writeAddr(chip, req->offset, 0); + + + if (req->oobarea) { +@@ -7088,7 +7090,7 @@ static int brcmnand_erase_nolock(struct mtd_info *mtd, struct erase_info *instr, + instr->state = MTD_ERASE_FAILED; + goto erase_one_block; + } +- chip->ctrl_writeAddr(mtd, addr, 0); ++ chip->ctrl_writeAddr(chip, addr, 0); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_BLOCK_ERASE); + + /* Wait until flash is ready */ +@@ -7231,7 +7233,7 @@ PRINTK( + + //chip->command(mtd, ONENAND_CMD_ERASE, addr, block_size); + +- chip->ctrl_writeAddr(mtd, addr, 0); ++ chip->ctrl_writeAddr(chip, addr, 0); + + chip->ctrl_write(BCHP_NAND_CMD_START, OP_BLOCK_ERASE); + +@@ -7507,9 +7509,9 @@ static int brcmnand_unlock(struct mtd_info *mtd, loff_t llofs, uint64_t len) + for (blkAddr = ofs; blkAddr < (ofs + len); blkAddr = blkAddr + chip->blockSize) { + + /* The following 2 commands share the same CMD_EXT_ADDR, as the block never cross a CS boundary */ +- chip->ctrl_writeAddr(mtd, blkAddr, 0); ++ chip->ctrl_writeAddr(chip, blkAddr, 0); + /* Set end block address */ +- chip->ctrl_writeAddr(mtd, blkAddr + chip->blockSize - 1, 1); ++ chip->ctrl_writeAddr(chip, blkAddr + chip->blockSize - 1, 1); + /* Write unlock command */ + chip->ctrl_write(BCHP_NAND_CMD_START, OP_BLOCKS_UNLOCK); + +@@ -7521,7 +7523,7 @@ static int brcmnand_unlock(struct mtd_info *mtd, loff_t llofs, uint64_t len) + printk(KERN_ERR "block = %0llx, wp status = 0x%x\n", blkAddr, status); + + /* Check lock status */ +- chip->ctrl_writeAddr(mtd, blkAddr, 0); ++ chip->ctrl_writeAddr(chip, blkAddr, 0); + chip->ctrl_write(BCHP_NAND_CMD_START, OP_READ_BLOCKS_LOCK_STATUS); + status = chip->ctrl_read(BCHP_NAND_BLOCK_LOCK_STATUS); + //status = chip->read_word(chip->base + ONENAND_REG_WP_STATUS); +diff --git a/drivers/mtd/brcmnand/brcmnand_bbt.c b/drivers/mtd/brcmnand/brcmnand_bbt.c +index 50f5259..106fd4d 100644 +--- a/drivers/mtd/brcmnand/brcmnand_bbt.c ++++ b/drivers/mtd/brcmnand/brcmnand_bbt.c +@@ -1714,7 +1714,7 @@ printk("%s: gClearBBT=clearbbt, start=%0llx, end=%0llx\n", __FUNCTION__, + + PRINTK("brcmnand flag=%d: Erasing block at %0llx\n", + gClearBBT, bOffset); +- this->ctrl_writeAddr(mtd, bOffset, 0); ++ this->ctrl_writeAddr(this, bOffset, 0); + + this->ctrl_write(BCHP_NAND_CMD_START, OP_BLOCK_ERASE); + // Wait until flash is ready +@@ -1918,7 +1918,7 @@ PRINTK("Found bad block at offset %0llx\n", offs); + } + + //printk("brcmnand flag=%d: Erasing block at %08x\n", gClearBBT, bOffset); +- this->ctrl_writeAddr(mtd, bOffset, 0); ++ this->ctrl_writeAddr(this, bOffset, 0); + + this->ctrl_write(BCHP_NAND_CMD_START, OP_BLOCK_ERASE); + // Wait until flash is ready +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/clear_sublevel.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/clear_sublevel.patch new file mode 100644 index 0000000000..5d093eb02d --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/clear_sublevel.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,7 @@ + VERSION = 3 + PATCHLEVEL = 2 +-SUBLEVEL = 16 ++SUBLEVEL = ++#SUBLEVEL = 16 + EXTRAVERSION = + NAME = Saber-toothed Squirrel + diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm500hd/defconfig b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm500hd/defconfig new file mode 100644 index 0000000000..6271005239 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm500hd/defconfig @@ -0,0 +1,2938 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.2 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_ATI_XILLEON is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +CONFIG_BCM7405B0=y +# CONFIG_BCM7405D0 is not set +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +# CONFIG_BRCM_UPPER_MEMORY is not set +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +CONFIG_MTD_BRCMNAND_VERIFY_WRITE=y +CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING=y +CONFIG_MTD_BRCMNAND_MARK_BADBLOCKS=y +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +CONFIG_BRCM_SCSI_NO_RW10_RETRIES=y +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_2=y +CONFIG_BRCMNAND_MAJOR_VERS=2 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_DREAMBOX=y +# CONFIG_DREAMBOX_SWAP_ATA_PORTS is not set +# CONFIG_DREAMBOX_FIRST_SUPPORTS_HW_ECC is not set +CONFIG_DREAMBOX_DM500HD=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=6 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_CLEANCACHE=y +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="-dm500hd" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="dm500hd" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_RUNTIME=y +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_ROUTE_CLASSID=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +CONFIG_NF_CT_PROTO_DCCP=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_BROADCAST=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SNMP=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_SANE=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_TPROXY=m +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +CONFIG_NETFILTER_XT_MARK=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_SET=m + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_CT is not set +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_HL=m +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +CONFIG_NETFILTER_XT_TARGET_LED=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_RATEEST=m +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +CONFIG_NETFILTER_XT_TARGET_TPROXY=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m + +# +# Xtables matches +# +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_HL=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_OSF=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_RECENT=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_SOCKET=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_IP_SET=m +CONFIG_IP_SET_MAX=256 +CONFIG_IP_SET_BITMAP_IP=m +CONFIG_IP_SET_BITMAP_IPMAC=m +CONFIG_IP_SET_BITMAP_PORT=m +CONFIG_IP_SET_HASH_IP=m +CONFIG_IP_SET_HASH_IPPORT=m +CONFIG_IP_SET_HASH_IPPORTIP=m +CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETPORT=m +CONFIG_IP_SET_HASH_NETIFACE=m +CONFIG_IP_SET_LIST_SET=m +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_NF_NAT_SNMP_BASIC is not set +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_RAW=m +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_IP_DCCP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +CONFIG_STP=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_NET_DSA is not set +CONFIG_VLAN_8021Q=m +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_DECNET is not set +CONFIG_LLC=m +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_RED is not set +CONFIG_NET_SCH_SFB=m +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_DSMARK is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_QFQ is not set + +# +# Classification +# +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_FW is not set +# CONFIG_NET_CLS_U32 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=m +CONFIG_BT_L2CAP=y +CONFIG_BT_SCO=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=m +# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=m +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +# CONFIG_CFG80211_DEFAULT_PS is not set +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +# CONFIG_LIB80211 is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_PID=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +# CONFIG_MAC80211_RC_DEFAULT_PID is not set +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +CONFIG_CEPH_LIB=m +# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=2 +CONFIG_BLK_DEV_CRYPTOLOOP=m + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_UB=m +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +# CONFIG_SATA_PMP is not set + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_MIRROR is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_EEM=m +CONFIG_USB_NET_CDC_NCM=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_ZAURUS=m +CONFIG_USB_NET_CX82310_ETH=m +CONFIG_USB_NET_KALMIA=m +CONFIG_USB_NET_INT51X1=m +CONFIG_USB_IPHETH=m +CONFIG_USB_SIERRA_NET=m +CONFIG_USB_VL600=m +CONFIG_WLAN=y +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=m +CONFIG_USB_NET_RNDIS_WLAN=m +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +CONFIG_ATH5K=m +# CONFIG_ATH5K_DEBUG is not set +CONFIG_ATH5K_PCI=y +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_HTC is not set +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_HOSTAP is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_LIBERTAS is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +CONFIG_RTL8192CU=m +CONFIG_RTLWIFI=m +CONFIG_RTL8192C_COMMON=m +# CONFIG_WL1251 is not set +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_MWIFIEX is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_SPARSEKMAP=m + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +# CONFIG_CONSOLE_TRANSLATIONS is not set +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_RAMOOPS=m +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_SMBUS is not set + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_TEST_POWER is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_BATTERY_BQ27x00 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=m +CONFIG_LIRC=m +CONFIG_RC_MAP=m +CONFIG_IR_NEC_DECODER=m +CONFIG_IR_RC5_DECODER=m +CONFIG_IR_RC6_DECODER=m +CONFIG_IR_JVC_DECODER=m +CONFIG_IR_SONY_DECODER=m +CONFIG_IR_RC5_SZ_DECODER=m +CONFIG_IR_MCE_KBD_DECODER=m +CONFIG_IR_LIRC_CODEC=m +CONFIG_RC_ATI_REMOTE=m +CONFIG_IR_IMON=m +CONFIG_IR_MCEUSB=m +CONFIG_IR_REDRAT3=m +CONFIG_IR_STREAMZAP=m +CONFIG_RC_LOOPBACK=m +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEOBUF2_CORE=m +CONFIG_VIDEOBUF2_MEMOPS=m +CONFIG_VIDEOBUF2_VMALLOC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +CONFIG_VIDEO_IR_I2C=m + +# +# Audio decoders, processors and mixers +# +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_WM8775=m + +# +# RDS decoders +# + +# +# Video decoders +# +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_TVP5150=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# + +# +# Camera sensor devices +# +CONFIG_VIDEO_MT9V011=m + +# +# Flash devices +# + +# +# Video improvement chips +# + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_VIVI is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_CX23885 is not set +# CONFIG_VIDEO_CX25821 is not set +# CONFIG_VIDEO_AU0828 is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_CX18 is not set +# CONFIG_VIDEO_SAA7164 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_SOC_CAMERA is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_USB_VIDEO_CLASS=m +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_PVRUSB2_DVB=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_HDPVR=m +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +# CONFIG_VIDEO_EM28XX_RC is not set +CONFIG_VIDEO_TLG2300=m +CONFIG_VIDEO_CX231XX=m +CONFIG_VIDEO_CX231XX_RC=y +CONFIG_VIDEO_CX231XX_ALSA=m +CONFIG_VIDEO_CX231XX_DVB=m +CONFIG_VIDEO_TM6000=m +CONFIG_VIDEO_TM6000_ALSA=m +CONFIG_VIDEO_TM6000_DVB=m +CONFIG_VIDEO_USBVISION=m +CONFIG_USB_ET61X251=m +CONFIG_USB_SN9C102=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_PWC_INPUT_EVDEV=y +CONFIG_USB_ZR364XX=m +CONFIG_USB_STKWEBCAM=m +CONFIG_USB_S2255=m +CONFIG_V4L_MEM2MEM_DRIVERS=y +# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set +# CONFIG_RADIO_ADAPTERS is not set +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +CONFIG_DVB_DUMMY_FE=m + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_HRTIMER is not set +CONFIG_SND_DYNAMIC_MINORS=y +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +CONFIG_SND_USB=y +CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_UA101 is not set +CONFIG_SND_USB_CAIAQ=m +# CONFIG_SND_USB_CAIAQ_INPUT is not set +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_QUANTA is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_WACOM is not set +CONFIG_HID_WIIMOTE=m +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_HWA_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_WDM=m +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_REALTEK=m +CONFIG_REALTEK_AUTOPM=y +CONFIG_USB_STORAGE_DATAFAB=m +CONFIG_USB_STORAGE_FREECOM=m +CONFIG_USB_STORAGE_ISD200=m +CONFIG_USB_STORAGE_USBAT=m +CONFIG_USB_STORAGE_SDDR09=m +CONFIG_USB_STORAGE_SDDR55=m +CONFIG_USB_STORAGE_JUMPSHOT=m +CONFIG_USB_STORAGE_ALAUDA=m +CONFIG_USB_STORAGE_ONETOUCH=m +CONFIG_USB_STORAGE_KARMA=m +CONFIG_USB_STORAGE_CYPRESS_ATACB=m +CONFIG_USB_STORAGE_ENE_UB6250=m +CONFIG_USB_UAS=m +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP210X=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IR=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_IUU=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_MOTOROLA=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_QCAUX=m +CONFIG_USB_SERIAL_QUALCOMM=m +CONFIG_USB_SERIAL_SPCP8X5=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIEMENS_MPI=m +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_SYMBOL=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTICON=m +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m +CONFIG_USB_SERIAL_ZIO=m +CONFIG_USB_SERIAL_SSU100=m +CONFIG_USB_SERIAL_DEBUG=m + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +CONFIG_UIO=m +# CONFIG_UIO_CIF is not set +CONFIG_UIO_PDRV=m +CONFIG_UIO_PDRV_GENIRQ=m +# CONFIG_UIO_AEC is not set +# CONFIG_UIO_SERCOS3 is not set +# CONFIG_UIO_PCI_GENERIC is not set +# CONFIG_UIO_NETX is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set +CONFIG_STAGING=y +# CONFIG_ET131X is not set +CONFIG_USBIP_CORE=m +CONFIG_USBIP_VHCI_HCD=m +CONFIG_USBIP_HOST=m +# CONFIG_USBIP_DEBUG is not set +# CONFIG_W35UND is not set +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +# CONFIG_R8187SE is not set +CONFIG_RTL8192U=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_RTS_PSTOR is not set +CONFIG_RTS5139=m +# CONFIG_RTS5139_DEBUG is not set +CONFIG_TRANZPORT=m +# CONFIG_POHMELFS is not set +# CONFIG_IDE_PHISON is not set +CONFIG_LINE6_USB=m +# CONFIG_LINE6_USB_DEBUG is not set +# CONFIG_LINE6_USB_DUMP_CTRL is not set +# CONFIG_LINE6_USB_DUMP_MIDI is not set +# CONFIG_LINE6_USB_DUMP_PCM is not set +# CONFIG_LINE6_USB_RAW is not set +# CONFIG_LINE6_USB_IMPULSE_RESPONSE is not set +CONFIG_USB_SERIAL_QUATECH2=m +CONFIG_USB_SERIAL_QUATECH_USB2=m +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_ZCACHE is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +CONFIG_USB_ENESTORAGE=m +CONFIG_BCM_WIMAX=m +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +CONFIG_DVB_CXD2099=m +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Hardware Spinlock drivers +# +CONFIG_IOMMU_SUPPORT=y +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD=m +CONFIG_JBD2=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_XFS_FS=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +CONFIG_BTRFS_FS=m +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_FANOTIFY=y +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_CUSE=m + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +CONFIG_UNION_FS=m +# CONFIG_UNION_FS_XATTR is not set +# CONFIG_UNION_FS_DEBUG is not set +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +CONFIG_JFFS2_CMODE_SIZE=y +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +CONFIG_LOGFS=m +CONFIG_CRAMFS=m +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +CONFIG_MINIX_FS=m +CONFIG_MINIX_FS_NATIVE_ENDIAN=y +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +CONFIG_NFS_V4=y +# CONFIG_NFS_V4_1 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_NEW_IDMAPPER is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V4=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_CEPH_FS=m +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_UPCALL is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_DFS_UPCALL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +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=y +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=y +# CONFIG_LDM_DEBUG 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="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_LOCKUP_DETECTOR=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=m +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=m +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=m +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_USER=m +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_NULL=m +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=m +CONFIG_CRYPTO_GCM=m +CONFIG_CRYPTO_SEQIV=m + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CTR=m +CONFIG_CRYPTO_CTS=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_XTS=m + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_VMAC=m + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_GHASH=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_RMD128=m +CONFIG_CRYPTO_RMD160=m +CONFIG_CRYPTO_RMD256=m +CONFIG_CRYPTO_RMD320=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_WP512=m + +# +# Ciphers +# +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_BLOWFISH_COMMON=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_SALSA20=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_ZLIB=m +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=m +CONFIG_CRYPTO_USER_API=m +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_CRC8=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_XZ_DEC=m +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_TEST is not set +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_BTREE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm7020hd/defconfig b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm7020hd/defconfig new file mode 100644 index 0000000000..5580a4fcda --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm7020hd/defconfig @@ -0,0 +1,2942 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.2 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_ATI_XILLEON is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_ARCH_SPARSEMEM_ENABLE=y + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +# CONFIG_BCM7405B0 is not set +CONFIG_BCM7405D0=y +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +CONFIG_BRCM_UPPER_MEMORY=y +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +CONFIG_MTD_BRCMNAND_VERIFY_WRITE=y +CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING=y +CONFIG_MTD_BRCMNAND_MARK_BADBLOCKS=y +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +CONFIG_BRCM_SCSI_NO_RW10_RETRIES=y +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_3=y +CONFIG_BRCMNAND_MAJOR_VERS=3 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_UPPER_256MB=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_DREAMBOX=y +# CONFIG_DREAMBOX_SWAP_ATA_PORTS is not set +CONFIG_DREAMBOX_FIRST_SUPPORTS_HW_ECC=y +# CONFIG_DREAMBOX_DM800SE is not set +CONFIG_DREAMBOX_DM7020HD=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=6 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_CLEANCACHE=y +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="-dm7020hd" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="dm7020hd" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_RUNTIME=y +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_ROUTE_CLASSID=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +CONFIG_NF_CT_PROTO_DCCP=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_BROADCAST=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SNMP=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_SANE=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_TPROXY=m +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +CONFIG_NETFILTER_XT_MARK=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_SET=m + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_CT is not set +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_HL=m +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +CONFIG_NETFILTER_XT_TARGET_LED=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_RATEEST=m +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +CONFIG_NETFILTER_XT_TARGET_TPROXY=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m + +# +# Xtables matches +# +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_HL=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_OSF=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_RECENT=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_SOCKET=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_IP_SET=m +CONFIG_IP_SET_MAX=256 +CONFIG_IP_SET_BITMAP_IP=m +CONFIG_IP_SET_BITMAP_IPMAC=m +CONFIG_IP_SET_BITMAP_PORT=m +CONFIG_IP_SET_HASH_IP=m +CONFIG_IP_SET_HASH_IPPORT=m +CONFIG_IP_SET_HASH_IPPORTIP=m +CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETPORT=m +CONFIG_IP_SET_HASH_NETIFACE=m +CONFIG_IP_SET_LIST_SET=m +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_NF_NAT_SNMP_BASIC is not set +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_RAW=m +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_IP_DCCP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +CONFIG_STP=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_NET_DSA is not set +CONFIG_VLAN_8021Q=m +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_DECNET is not set +CONFIG_LLC=m +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_RED is not set +CONFIG_NET_SCH_SFB=m +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_DSMARK is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_QFQ is not set + +# +# Classification +# +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_FW is not set +# CONFIG_NET_CLS_U32 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=m +CONFIG_BT_L2CAP=y +CONFIG_BT_SCO=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=m +# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=m +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +# CONFIG_CFG80211_DEFAULT_PS is not set +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +# CONFIG_LIB80211 is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_PID=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +# CONFIG_MAC80211_RC_DEFAULT_PID is not set +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +CONFIG_CEPH_LIB=m +# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=2 +CONFIG_BLK_DEV_CRYPTOLOOP=m + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_UB=m +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +# CONFIG_SATA_PMP is not set + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_MIRROR is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_EEM=m +CONFIG_USB_NET_CDC_NCM=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_ZAURUS=m +CONFIG_USB_NET_CX82310_ETH=m +CONFIG_USB_NET_KALMIA=m +CONFIG_USB_NET_INT51X1=m +CONFIG_USB_IPHETH=m +CONFIG_USB_SIERRA_NET=m +CONFIG_USB_VL600=m +CONFIG_WLAN=y +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=m +CONFIG_USB_NET_RNDIS_WLAN=m +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +CONFIG_ATH5K=m +# CONFIG_ATH5K_DEBUG is not set +CONFIG_ATH5K_PCI=y +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_HTC is not set +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_HOSTAP is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_LIBERTAS is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +CONFIG_RTL8192CU=m +CONFIG_RTLWIFI=m +CONFIG_RTL8192C_COMMON=m +# CONFIG_WL1251 is not set +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_MWIFIEX is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_SPARSEKMAP=m + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +# CONFIG_CONSOLE_TRANSLATIONS is not set +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_RAMOOPS=m +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_SMBUS is not set + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_TEST_POWER is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_BATTERY_BQ27x00 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=m +CONFIG_LIRC=m +CONFIG_RC_MAP=m +CONFIG_IR_NEC_DECODER=m +CONFIG_IR_RC5_DECODER=m +CONFIG_IR_RC6_DECODER=m +CONFIG_IR_JVC_DECODER=m +CONFIG_IR_SONY_DECODER=m +CONFIG_IR_RC5_SZ_DECODER=m +CONFIG_IR_MCE_KBD_DECODER=m +CONFIG_IR_LIRC_CODEC=m +CONFIG_RC_ATI_REMOTE=m +CONFIG_IR_IMON=m +CONFIG_IR_MCEUSB=m +CONFIG_IR_REDRAT3=m +CONFIG_IR_STREAMZAP=m +CONFIG_RC_LOOPBACK=m +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEOBUF2_CORE=m +CONFIG_VIDEOBUF2_MEMOPS=m +CONFIG_VIDEOBUF2_VMALLOC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +CONFIG_VIDEO_IR_I2C=m + +# +# Audio decoders, processors and mixers +# +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_WM8775=m + +# +# RDS decoders +# + +# +# Video decoders +# +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_TVP5150=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# + +# +# Camera sensor devices +# +CONFIG_VIDEO_MT9V011=m + +# +# Flash devices +# + +# +# Video improvement chips +# + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_VIVI is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_CX23885 is not set +# CONFIG_VIDEO_CX25821 is not set +# CONFIG_VIDEO_AU0828 is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_CX18 is not set +# CONFIG_VIDEO_SAA7164 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_SOC_CAMERA is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_USB_VIDEO_CLASS=m +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_PVRUSB2_DVB=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_HDPVR=m +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +# CONFIG_VIDEO_EM28XX_RC is not set +CONFIG_VIDEO_TLG2300=m +CONFIG_VIDEO_CX231XX=m +CONFIG_VIDEO_CX231XX_RC=y +CONFIG_VIDEO_CX231XX_ALSA=m +CONFIG_VIDEO_CX231XX_DVB=m +CONFIG_VIDEO_TM6000=m +CONFIG_VIDEO_TM6000_ALSA=m +CONFIG_VIDEO_TM6000_DVB=m +CONFIG_VIDEO_USBVISION=m +CONFIG_USB_ET61X251=m +CONFIG_USB_SN9C102=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_PWC_INPUT_EVDEV=y +CONFIG_USB_ZR364XX=m +CONFIG_USB_STKWEBCAM=m +CONFIG_USB_S2255=m +CONFIG_V4L_MEM2MEM_DRIVERS=y +# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set +# CONFIG_RADIO_ADAPTERS is not set +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +CONFIG_DVB_DUMMY_FE=m + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_HRTIMER is not set +CONFIG_SND_DYNAMIC_MINORS=y +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +CONFIG_SND_USB=y +CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_UA101 is not set +CONFIG_SND_USB_CAIAQ=m +# CONFIG_SND_USB_CAIAQ_INPUT is not set +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_QUANTA is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_WACOM is not set +CONFIG_HID_WIIMOTE=m +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_HWA_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_WDM=m +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_REALTEK=m +CONFIG_REALTEK_AUTOPM=y +CONFIG_USB_STORAGE_DATAFAB=m +CONFIG_USB_STORAGE_FREECOM=m +CONFIG_USB_STORAGE_ISD200=m +CONFIG_USB_STORAGE_USBAT=m +CONFIG_USB_STORAGE_SDDR09=m +CONFIG_USB_STORAGE_SDDR55=m +CONFIG_USB_STORAGE_JUMPSHOT=m +CONFIG_USB_STORAGE_ALAUDA=m +CONFIG_USB_STORAGE_ONETOUCH=m +CONFIG_USB_STORAGE_KARMA=m +CONFIG_USB_STORAGE_CYPRESS_ATACB=m +CONFIG_USB_STORAGE_ENE_UB6250=m +CONFIG_USB_UAS=m +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP210X=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IR=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_IUU=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_MOTOROLA=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_QCAUX=m +CONFIG_USB_SERIAL_QUALCOMM=m +CONFIG_USB_SERIAL_SPCP8X5=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIEMENS_MPI=m +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_SYMBOL=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTICON=m +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m +CONFIG_USB_SERIAL_ZIO=m +CONFIG_USB_SERIAL_SSU100=m +CONFIG_USB_SERIAL_DEBUG=m + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +CONFIG_UIO=m +# CONFIG_UIO_CIF is not set +CONFIG_UIO_PDRV=m +CONFIG_UIO_PDRV_GENIRQ=m +# CONFIG_UIO_AEC is not set +# CONFIG_UIO_SERCOS3 is not set +# CONFIG_UIO_PCI_GENERIC is not set +# CONFIG_UIO_NETX is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set +CONFIG_STAGING=y +# CONFIG_ET131X is not set +CONFIG_USBIP_CORE=m +CONFIG_USBIP_VHCI_HCD=m +CONFIG_USBIP_HOST=m +# CONFIG_USBIP_DEBUG is not set +# CONFIG_W35UND is not set +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +# CONFIG_R8187SE is not set +CONFIG_RTL8192U=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_RTS_PSTOR is not set +CONFIG_RTS5139=m +# CONFIG_RTS5139_DEBUG is not set +CONFIG_TRANZPORT=m +# CONFIG_POHMELFS is not set +# CONFIG_IDE_PHISON is not set +CONFIG_LINE6_USB=m +# CONFIG_LINE6_USB_DEBUG is not set +# CONFIG_LINE6_USB_DUMP_CTRL is not set +# CONFIG_LINE6_USB_DUMP_MIDI is not set +# CONFIG_LINE6_USB_DUMP_PCM is not set +# CONFIG_LINE6_USB_RAW is not set +# CONFIG_LINE6_USB_IMPULSE_RESPONSE is not set +CONFIG_USB_SERIAL_QUATECH2=m +CONFIG_USB_SERIAL_QUATECH_USB2=m +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_ZCACHE is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +CONFIG_USB_ENESTORAGE=m +CONFIG_BCM_WIMAX=m +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +CONFIG_DVB_CXD2099=m +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Hardware Spinlock drivers +# +CONFIG_IOMMU_SUPPORT=y +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD=m +CONFIG_JBD2=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_XFS_FS=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +CONFIG_BTRFS_FS=m +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_FANOTIFY=y +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_CUSE=m + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +CONFIG_UNION_FS=m +# CONFIG_UNION_FS_XATTR is not set +# CONFIG_UNION_FS_DEBUG is not set +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +CONFIG_JFFS2_CMODE_SIZE=y +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +CONFIG_LOGFS=m +CONFIG_CRAMFS=m +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +CONFIG_MINIX_FS=m +CONFIG_MINIX_FS_NATIVE_ENDIAN=y +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +CONFIG_NFS_V4=y +# CONFIG_NFS_V4_1 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_NEW_IDMAPPER is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V4=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_CEPH_FS=m +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_UPCALL is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_DFS_UPCALL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +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=y +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=y +# CONFIG_LDM_DEBUG 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="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_LOCKUP_DETECTOR=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=m +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=m +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=m +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_USER=m +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_NULL=m +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=m +CONFIG_CRYPTO_GCM=m +CONFIG_CRYPTO_SEQIV=m + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CTR=m +CONFIG_CRYPTO_CTS=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_XTS=m + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_VMAC=m + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_GHASH=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_RMD128=m +CONFIG_CRYPTO_RMD160=m +CONFIG_CRYPTO_RMD256=m +CONFIG_CRYPTO_RMD320=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_WP512=m + +# +# Ciphers +# +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_BLOWFISH_COMMON=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_SALSA20=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_ZLIB=m +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=m +CONFIG_CRYPTO_USER_API=m +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_CRC8=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_XZ_DEC=m +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_TEST is not set +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_BTREE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm8000/defconfig b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm8000/defconfig new file mode 100644 index 0000000000..8b42baacae --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm8000/defconfig @@ -0,0 +1,2958 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.2 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_ATI_XILLEON is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +CONFIG_BRCM_LEGACY=y +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM3563C0 is not set +# CONFIG_BCM7038C0 is not set +# CONFIG_BCM7118C0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7336A0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +CONFIG_BCM7400E0=y +# CONFIG_BCM7401C0 is not set +# CONFIG_BCM7403A0 is not set +# CONFIG_BCM7405B0 is not set +# CONFIG_BCM7405D0 is not set +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7440B0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +# CONFIG_BRCM_UPPER_MEMORY is not set +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +CONFIG_BRCM_SCSI_NO_RW10_RETRIES=y +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_SHARED_UART_IRQ=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NAND_MINOR_0=y +CONFIG_BRCM_HAS_NAND_MAJOR_1=y +CONFIG_BRCMNAND_MAJOR_VERS=1 +CONFIG_BRCMNAND_MINOR_VERS=0 +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7400=y +CONFIG_DREAMBOX=y +# CONFIG_DREAMBOX_SWAP_ATA_PORTS is not set +# CONFIG_DREAMBOX_FIRST_SUPPORTS_HW_ECC is not set +CONFIG_DREAMBOX_DM8000=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=6 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_CLEANCACHE=y +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="-dm8000" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="dm8000" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_RUNTIME=y +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_ROUTE_CLASSID=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +CONFIG_NF_CT_PROTO_DCCP=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_BROADCAST=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SNMP=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_SANE=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_TPROXY=m +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +CONFIG_NETFILTER_XT_MARK=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_SET=m + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_CT is not set +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_HL=m +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +CONFIG_NETFILTER_XT_TARGET_LED=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_RATEEST=m +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +CONFIG_NETFILTER_XT_TARGET_TPROXY=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m + +# +# Xtables matches +# +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_HL=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_OSF=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_RECENT=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_SOCKET=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_IP_SET=m +CONFIG_IP_SET_MAX=256 +CONFIG_IP_SET_BITMAP_IP=m +CONFIG_IP_SET_BITMAP_IPMAC=m +CONFIG_IP_SET_BITMAP_PORT=m +CONFIG_IP_SET_HASH_IP=m +CONFIG_IP_SET_HASH_IPPORT=m +CONFIG_IP_SET_HASH_IPPORTIP=m +CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETPORT=m +CONFIG_IP_SET_HASH_NETIFACE=m +CONFIG_IP_SET_LIST_SET=m +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_NF_NAT_SNMP_BASIC is not set +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_RAW=m +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_IP_DCCP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +CONFIG_STP=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_NET_DSA is not set +CONFIG_VLAN_8021Q=m +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_DECNET is not set +CONFIG_LLC=m +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_RED is not set +CONFIG_NET_SCH_SFB=m +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_DSMARK is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_QFQ is not set + +# +# Classification +# +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_FW is not set +# CONFIG_NET_CLS_U32 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=m +CONFIG_BT_L2CAP=y +CONFIG_BT_SCO=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=m +# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=m +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +# CONFIG_CFG80211_DEFAULT_PS is not set +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +# CONFIG_LIB80211 is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_PID=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +# CONFIG_MAC80211_RC_DEFAULT_PID is not set +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +CONFIG_CEPH_LIB=m +# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=m +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=m +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_NAND_ECC=y +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_DENALI is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +CONFIG_MTD_NAND_DREAMBOX=y +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=2 +CONFIG_BLK_DEV_CRYPTOLOOP=m + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_UB=m +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +# CONFIG_SATA_PMP is not set + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_MIRROR is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_EEM=m +CONFIG_USB_NET_CDC_NCM=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_ZAURUS=m +CONFIG_USB_NET_CX82310_ETH=m +CONFIG_USB_NET_KALMIA=m +CONFIG_USB_NET_INT51X1=m +CONFIG_USB_IPHETH=m +CONFIG_USB_SIERRA_NET=m +CONFIG_USB_VL600=m +CONFIG_WLAN=y +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=m +CONFIG_USB_NET_RNDIS_WLAN=m +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +CONFIG_ATH5K=m +# CONFIG_ATH5K_DEBUG is not set +CONFIG_ATH5K_PCI=y +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_HTC is not set +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_HOSTAP is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_LIBERTAS is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +CONFIG_RTL8192CU=m +CONFIG_RTLWIFI=m +CONFIG_RTL8192C_COMMON=m +# CONFIG_WL1251 is not set +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_MWIFIEX is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_SPARSEKMAP=m + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +# CONFIG_CONSOLE_TRANSLATIONS is not set +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_RAMOOPS=m +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_SMBUS is not set + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_TEST_POWER is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_BATTERY_BQ27x00 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=m +CONFIG_LIRC=m +CONFIG_RC_MAP=m +CONFIG_IR_NEC_DECODER=m +CONFIG_IR_RC5_DECODER=m +CONFIG_IR_RC6_DECODER=m +CONFIG_IR_JVC_DECODER=m +CONFIG_IR_SONY_DECODER=m +CONFIG_IR_RC5_SZ_DECODER=m +CONFIG_IR_MCE_KBD_DECODER=m +CONFIG_IR_LIRC_CODEC=m +CONFIG_RC_ATI_REMOTE=m +CONFIG_IR_IMON=m +CONFIG_IR_MCEUSB=m +CONFIG_IR_REDRAT3=m +CONFIG_IR_STREAMZAP=m +CONFIG_RC_LOOPBACK=m +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEOBUF2_CORE=m +CONFIG_VIDEOBUF2_MEMOPS=m +CONFIG_VIDEOBUF2_VMALLOC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +CONFIG_VIDEO_IR_I2C=m + +# +# Audio decoders, processors and mixers +# +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_WM8775=m + +# +# RDS decoders +# + +# +# Video decoders +# +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_TVP5150=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# + +# +# Camera sensor devices +# +CONFIG_VIDEO_MT9V011=m + +# +# Flash devices +# + +# +# Video improvement chips +# + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_VIVI is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_CX23885 is not set +# CONFIG_VIDEO_CX25821 is not set +# CONFIG_VIDEO_AU0828 is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_CX18 is not set +# CONFIG_VIDEO_SAA7164 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_SOC_CAMERA is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_USB_VIDEO_CLASS=m +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_PVRUSB2_DVB=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_HDPVR=m +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +# CONFIG_VIDEO_EM28XX_RC is not set +CONFIG_VIDEO_TLG2300=m +CONFIG_VIDEO_CX231XX=m +CONFIG_VIDEO_CX231XX_RC=y +CONFIG_VIDEO_CX231XX_ALSA=m +CONFIG_VIDEO_CX231XX_DVB=m +CONFIG_VIDEO_TM6000=m +CONFIG_VIDEO_TM6000_ALSA=m +CONFIG_VIDEO_TM6000_DVB=m +CONFIG_VIDEO_USBVISION=m +CONFIG_USB_ET61X251=m +CONFIG_USB_SN9C102=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_PWC_INPUT_EVDEV=y +CONFIG_USB_ZR364XX=m +CONFIG_USB_STKWEBCAM=m +CONFIG_USB_S2255=m +CONFIG_V4L_MEM2MEM_DRIVERS=y +# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set +# CONFIG_RADIO_ADAPTERS is not set +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +CONFIG_DVB_DUMMY_FE=m + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_HRTIMER is not set +CONFIG_SND_DYNAMIC_MINORS=y +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +CONFIG_SND_USB=y +CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_UA101 is not set +CONFIG_SND_USB_CAIAQ=m +# CONFIG_SND_USB_CAIAQ_INPUT is not set +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_QUANTA is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_WACOM is not set +CONFIG_HID_WIIMOTE=m +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_HWA_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_WDM=m +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_REALTEK=m +CONFIG_REALTEK_AUTOPM=y +CONFIG_USB_STORAGE_DATAFAB=m +CONFIG_USB_STORAGE_FREECOM=m +CONFIG_USB_STORAGE_ISD200=m +CONFIG_USB_STORAGE_USBAT=m +CONFIG_USB_STORAGE_SDDR09=m +CONFIG_USB_STORAGE_SDDR55=m +CONFIG_USB_STORAGE_JUMPSHOT=m +CONFIG_USB_STORAGE_ALAUDA=m +CONFIG_USB_STORAGE_ONETOUCH=m +CONFIG_USB_STORAGE_KARMA=m +CONFIG_USB_STORAGE_CYPRESS_ATACB=m +CONFIG_USB_STORAGE_ENE_UB6250=m +CONFIG_USB_UAS=m +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP210X=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IR=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_IUU=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_MOTOROLA=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_QCAUX=m +CONFIG_USB_SERIAL_QUALCOMM=m +CONFIG_USB_SERIAL_SPCP8X5=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIEMENS_MPI=m +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_SYMBOL=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTICON=m +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m +CONFIG_USB_SERIAL_ZIO=m +CONFIG_USB_SERIAL_SSU100=m +CONFIG_USB_SERIAL_DEBUG=m + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +CONFIG_UIO=m +# CONFIG_UIO_CIF is not set +CONFIG_UIO_PDRV=m +CONFIG_UIO_PDRV_GENIRQ=m +# CONFIG_UIO_AEC is not set +# CONFIG_UIO_SERCOS3 is not set +# CONFIG_UIO_PCI_GENERIC is not set +# CONFIG_UIO_NETX is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set +CONFIG_STAGING=y +# CONFIG_ET131X is not set +CONFIG_USBIP_CORE=m +CONFIG_USBIP_VHCI_HCD=m +CONFIG_USBIP_HOST=m +# CONFIG_USBIP_DEBUG is not set +# CONFIG_W35UND is not set +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +# CONFIG_R8187SE is not set +CONFIG_RTL8192U=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_RTS_PSTOR is not set +CONFIG_RTS5139=m +# CONFIG_RTS5139_DEBUG is not set +CONFIG_TRANZPORT=m +# CONFIG_POHMELFS is not set +# CONFIG_IDE_PHISON is not set +CONFIG_LINE6_USB=m +# CONFIG_LINE6_USB_DEBUG is not set +# CONFIG_LINE6_USB_DUMP_CTRL is not set +# CONFIG_LINE6_USB_DUMP_MIDI is not set +# CONFIG_LINE6_USB_DUMP_PCM is not set +# CONFIG_LINE6_USB_RAW is not set +# CONFIG_LINE6_USB_IMPULSE_RESPONSE is not set +CONFIG_USB_SERIAL_QUATECH2=m +CONFIG_USB_SERIAL_QUATECH_USB2=m +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_ZCACHE is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +CONFIG_USB_ENESTORAGE=m +CONFIG_BCM_WIMAX=m +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +CONFIG_DVB_CXD2099=m +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Hardware Spinlock drivers +# +CONFIG_IOMMU_SUPPORT=y +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD=m +CONFIG_JBD2=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_XFS_FS=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +CONFIG_BTRFS_FS=m +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_FANOTIFY=y +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_CUSE=m + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +CONFIG_UNION_FS=m +# CONFIG_UNION_FS_XATTR is not set +# CONFIG_UNION_FS_DEBUG is not set +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +CONFIG_JFFS2_CMODE_SIZE=y +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +CONFIG_LOGFS=m +CONFIG_CRAMFS=m +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +CONFIG_MINIX_FS=m +CONFIG_MINIX_FS_NATIVE_ENDIAN=y +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +CONFIG_NFS_V4=y +# CONFIG_NFS_V4_1 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_NEW_IDMAPPER is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V4=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_CEPH_FS=m +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_UPCALL is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_DFS_UPCALL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +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=y +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=y +# CONFIG_LDM_DEBUG 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="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_LOCKUP_DETECTOR=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=m +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=m +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=m +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_USER=m +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_NULL=m +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=m +CONFIG_CRYPTO_GCM=m +CONFIG_CRYPTO_SEQIV=m + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CTR=m +CONFIG_CRYPTO_CTS=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_XTS=m + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_VMAC=m + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_GHASH=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_RMD128=m +CONFIG_CRYPTO_RMD160=m +CONFIG_CRYPTO_RMD256=m +CONFIG_CRYPTO_RMD320=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_WP512=m + +# +# Ciphers +# +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_BLOWFISH_COMMON=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_SALSA20=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_ZLIB=m +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=m +CONFIG_CRYPTO_USER_API=m +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_CRC8=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_XZ_DEC=m +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_TEST is not set +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_BTREE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm800se/defconfig b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm800se/defconfig new file mode 100644 index 0000000000..9f872a5d2d --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/dm800se/defconfig @@ -0,0 +1,2939 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.2 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_ATI_XILLEON is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +# CONFIG_BCM7405B0 is not set +CONFIG_BCM7405D0=y +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +# CONFIG_BRCM_UPPER_MEMORY is not set +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +CONFIG_MTD_BRCMNAND_VERIFY_WRITE=y +CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING=y +CONFIG_MTD_BRCMNAND_MARK_BADBLOCKS=y +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +CONFIG_BRCM_SCSI_NO_RW10_RETRIES=y +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_3=y +CONFIG_BRCMNAND_MAJOR_VERS=3 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_DREAMBOX=y +CONFIG_DREAMBOX_SWAP_ATA_PORTS=y +# CONFIG_DREAMBOX_FIRST_SUPPORTS_HW_ECC is not set +CONFIG_DREAMBOX_DM800SE=y +# CONFIG_DREAMBOX_DM7020HD is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=6 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_CLEANCACHE=y +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="-dm800se" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="dm800se" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_RUNTIME=y +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +CONFIG_NET_KEY=m +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_ROUTE_CLASSID=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y +CONFIG_BRIDGE_NETFILTER=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +CONFIG_NF_CT_PROTO_DCCP=m +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +CONFIG_NF_CT_PROTO_UDPLITE=m +CONFIG_NF_CONNTRACK_AMANDA=m +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_BROADCAST=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_SNMP=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_SANE=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_TPROXY=m +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +CONFIG_NETFILTER_XT_MARK=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_SET=m + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +# CONFIG_NETFILTER_XT_TARGET_CT is not set +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_HL=m +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +CONFIG_NETFILTER_XT_TARGET_LED=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +CONFIG_NETFILTER_XT_TARGET_RATEEST=m +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +CONFIG_NETFILTER_XT_TARGET_TPROXY=m +CONFIG_NETFILTER_XT_TARGET_TRACE=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m + +# +# Xtables matches +# +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_CLUSTER=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_HL=m +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_OSF=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_RATEEST=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_RECENT=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_SOCKET=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_MATCH_U32=m +CONFIG_IP_SET=m +CONFIG_IP_SET_MAX=256 +CONFIG_IP_SET_BITMAP_IP=m +CONFIG_IP_SET_BITMAP_IPMAC=m +CONFIG_IP_SET_BITMAP_PORT=m +CONFIG_IP_SET_HASH_IP=m +CONFIG_IP_SET_HASH_IPPORT=m +CONFIG_IP_SET_HASH_IPPORTIP=m +CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETPORT=m +CONFIG_IP_SET_HASH_NETIFACE=m +CONFIG_IP_SET_LIST_SET=m +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +CONFIG_IP_NF_QUEUE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_NF_NAT_SNMP_BASIC is not set +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_IP6_NF_QUEUE=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_TARGET_HL=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_RAW=m +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_IP_DCCP is not set +CONFIG_IP_SCTP=m +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +CONFIG_STP=m +CONFIG_BRIDGE=m +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_NET_DSA is not set +CONFIG_VLAN_8021Q=m +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_DECNET is not set +CONFIG_LLC=m +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_RED is not set +CONFIG_NET_SCH_SFB=m +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_DSMARK is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_QFQ is not set + +# +# Classification +# +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_FW is not set +# CONFIG_NET_CLS_U32 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=m +CONFIG_BT_L2CAP=y +CONFIG_BT_SCO=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=m +# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=m +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +# CONFIG_CFG80211_DEFAULT_PS is not set +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +# CONFIG_LIB80211 is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_PID=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +# CONFIG_MAC80211_RC_DEFAULT_PID is not set +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +CONFIG_CEPH_LIB=m +# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +CONFIG_MTD_MTDRAM=m +CONFIG_MTDRAM_TOTAL_SIZE=4096 +CONFIG_MTDRAM_ERASE_SIZE=128 +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=2 +CONFIG_BLK_DEV_CRYPTOLOOP=m + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_UB=m +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set +CONFIG_ATA_OVER_ETH=m +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=m +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +# CONFIG_SATA_PMP is not set + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_DM=m +# CONFIG_DM_DEBUG is not set +CONFIG_DM_CRYPT=m +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_MIRROR is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_CDC_EEM=m +CONFIG_USB_NET_CDC_NCM=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_ZAURUS=m +CONFIG_USB_NET_CX82310_ETH=m +CONFIG_USB_NET_KALMIA=m +CONFIG_USB_NET_INT51X1=m +CONFIG_USB_IPHETH=m +CONFIG_USB_SIERRA_NET=m +CONFIG_USB_VL600=m +CONFIG_WLAN=y +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=m +CONFIG_USB_NET_RNDIS_WLAN=m +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +CONFIG_ATH5K=m +# CONFIG_ATH5K_DEBUG is not set +CONFIG_ATH5K_PCI=y +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_HTC is not set +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_HOSTAP is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_LIBERTAS is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +CONFIG_P54_USB=m +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +CONFIG_RTL8192CU=m +CONFIG_RTLWIFI=m +CONFIG_RTL8192C_COMMON=m +# CONFIG_WL1251 is not set +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_MWIFIEX is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_FF_MEMLESS=m +CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_SPARSEKMAP=m + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +# CONFIG_CONSOLE_TRANSLATIONS is not set +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_RAMOOPS=m +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_SMBUS is not set + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_TEST_POWER is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_BATTERY_BQ27x00 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=m +CONFIG_LIRC=m +CONFIG_RC_MAP=m +CONFIG_IR_NEC_DECODER=m +CONFIG_IR_RC5_DECODER=m +CONFIG_IR_RC6_DECODER=m +CONFIG_IR_JVC_DECODER=m +CONFIG_IR_SONY_DECODER=m +CONFIG_IR_RC5_SZ_DECODER=m +CONFIG_IR_MCE_KBD_DECODER=m +CONFIG_IR_LIRC_CODEC=m +CONFIG_RC_ATI_REMOTE=m +CONFIG_IR_IMON=m +CONFIG_IR_MCEUSB=m +CONFIG_IR_REDRAT3=m +CONFIG_IR_STREAMZAP=m +CONFIG_RC_LOOPBACK=m +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEOBUF2_CORE=m +CONFIG_VIDEOBUF2_MEMOPS=m +CONFIG_VIDEOBUF2_VMALLOC=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +CONFIG_VIDEO_IR_I2C=m + +# +# Audio decoders, processors and mixers +# +CONFIG_VIDEO_MSP3400=m +CONFIG_VIDEO_CS53L32A=m +CONFIG_VIDEO_WM8775=m + +# +# RDS decoders +# + +# +# Video decoders +# +CONFIG_VIDEO_SAA711X=m +CONFIG_VIDEO_TVP5150=m + +# +# Video and audio decoders +# +CONFIG_VIDEO_CX25840=m + +# +# MPEG video encoders +# +CONFIG_VIDEO_CX2341X=m + +# +# Video encoders +# + +# +# Camera sensor devices +# +CONFIG_VIDEO_MT9V011=m + +# +# Flash devices +# + +# +# Video improvement chips +# + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_VIVI is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_CX23885 is not set +# CONFIG_VIDEO_CX25821 is not set +# CONFIG_VIDEO_AU0828 is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_CX18 is not set +# CONFIG_VIDEO_SAA7164 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_SOC_CAMERA is not set +CONFIG_V4L_USB_DRIVERS=y +CONFIG_USB_VIDEO_CLASS=m +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_PVRUSB2_SYSFS=y +CONFIG_VIDEO_PVRUSB2_DVB=y +# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set +CONFIG_VIDEO_HDPVR=m +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +# CONFIG_VIDEO_EM28XX_RC is not set +CONFIG_VIDEO_TLG2300=m +CONFIG_VIDEO_CX231XX=m +CONFIG_VIDEO_CX231XX_RC=y +CONFIG_VIDEO_CX231XX_ALSA=m +CONFIG_VIDEO_CX231XX_DVB=m +CONFIG_VIDEO_TM6000=m +CONFIG_VIDEO_TM6000_ALSA=m +CONFIG_VIDEO_TM6000_DVB=m +CONFIG_VIDEO_USBVISION=m +CONFIG_USB_ET61X251=m +CONFIG_USB_SN9C102=m +CONFIG_USB_PWC=m +# CONFIG_USB_PWC_DEBUG is not set +CONFIG_USB_PWC_INPUT_EVDEV=y +CONFIG_USB_ZR364XX=m +CONFIG_USB_STKWEBCAM=m +CONFIG_USB_S2255=m +CONFIG_V4L_MEM2MEM_DRIVERS=y +# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set +# CONFIG_RADIO_ADAPTERS is not set +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=m +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +CONFIG_DVB_TTUSB_BUDGET=m +CONFIG_DVB_TTUSB_DEC=m +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +CONFIG_DVB_B2C2_FLEXCOP=m +# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set +CONFIG_DVB_B2C2_FLEXCOP_USB=m +# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +CONFIG_DVB_DUMMY_FE=m + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=m +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +# CONFIG_LOGO is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_HRTIMER is not set +CONFIG_SND_DYNAMIC_MINORS=y +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +CONFIG_SND_USB=y +CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_UA101 is not set +CONFIG_SND_USB_CAIAQ=m +# CONFIG_SND_USB_CAIAQ_INPUT is not set +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=m +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_QUANTA is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_WACOM is not set +CONFIG_HID_WIIMOTE=m +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_DEVICE_CLASS is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_HWA_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_WDM=m +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_REALTEK=m +CONFIG_REALTEK_AUTOPM=y +CONFIG_USB_STORAGE_DATAFAB=m +CONFIG_USB_STORAGE_FREECOM=m +CONFIG_USB_STORAGE_ISD200=m +CONFIG_USB_STORAGE_USBAT=m +CONFIG_USB_STORAGE_SDDR09=m +CONFIG_USB_STORAGE_SDDR55=m +CONFIG_USB_STORAGE_JUMPSHOT=m +CONFIG_USB_STORAGE_ALAUDA=m +CONFIG_USB_STORAGE_ONETOUCH=m +CONFIG_USB_STORAGE_KARMA=m +CONFIG_USB_STORAGE_CYPRESS_ATACB=m +CONFIG_USB_STORAGE_ENE_UB6250=m +CONFIG_USB_UAS=m +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_CH341=m +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP210X=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IR=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_IUU=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_MOTOROLA=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OTI6858=m +CONFIG_USB_SERIAL_QCAUX=m +CONFIG_USB_SERIAL_QUALCOMM=m +CONFIG_USB_SERIAL_SPCP8X5=m +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +# CONFIG_USB_SERIAL_SAFE_PADDED is not set +CONFIG_USB_SERIAL_SIEMENS_MPI=m +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_SYMBOL=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +CONFIG_USB_SERIAL_OPTICON=m +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m +CONFIG_USB_SERIAL_ZIO=m +CONFIG_USB_SERIAL_SSU100=m +CONFIG_USB_SERIAL_DEBUG=m + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +CONFIG_UIO=m +# CONFIG_UIO_CIF is not set +CONFIG_UIO_PDRV=m +CONFIG_UIO_PDRV_GENIRQ=m +# CONFIG_UIO_AEC is not set +# CONFIG_UIO_SERCOS3 is not set +# CONFIG_UIO_PCI_GENERIC is not set +# CONFIG_UIO_NETX is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set +CONFIG_STAGING=y +# CONFIG_ET131X is not set +CONFIG_USBIP_CORE=m +CONFIG_USBIP_VHCI_HCD=m +CONFIG_USBIP_HOST=m +# CONFIG_USBIP_DEBUG is not set +# CONFIG_W35UND is not set +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +# CONFIG_R8187SE is not set +CONFIG_RTL8192U=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_RTS_PSTOR is not set +CONFIG_RTS5139=m +# CONFIG_RTS5139_DEBUG is not set +CONFIG_TRANZPORT=m +# CONFIG_POHMELFS is not set +# CONFIG_IDE_PHISON is not set +CONFIG_LINE6_USB=m +# CONFIG_LINE6_USB_DEBUG is not set +# CONFIG_LINE6_USB_DUMP_CTRL is not set +# CONFIG_LINE6_USB_DUMP_MIDI is not set +# CONFIG_LINE6_USB_DUMP_PCM is not set +# CONFIG_LINE6_USB_RAW is not set +# CONFIG_LINE6_USB_IMPULSE_RESPONSE is not set +CONFIG_USB_SERIAL_QUATECH2=m +CONFIG_USB_SERIAL_QUATECH_USB2=m +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_ZCACHE is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +CONFIG_USB_ENESTORAGE=m +CONFIG_BCM_WIMAX=m +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +CONFIG_DVB_CXD2099=m +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Hardware Spinlock drivers +# +CONFIG_IOMMU_SUPPORT=y +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +CONFIG_EXT2_FS=m +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=m +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD=m +CONFIG_JBD2=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_XFS_FS=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +CONFIG_BTRFS_FS=m +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +CONFIG_FANOTIFY=y +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m +CONFIG_CUSE=m + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +CONFIG_UNION_FS=m +# CONFIG_UNION_FS_XATTR is not set +# CONFIG_UNION_FS_DEBUG is not set +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +CONFIG_JFFS2_CMODE_SIZE=y +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +CONFIG_LOGFS=m +CONFIG_CRAMFS=m +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +CONFIG_MINIX_FS=m +CONFIG_MINIX_FS_NATIVE_ENDIAN=y +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_UFS_DEBUG is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +CONFIG_NFS_V4=y +# CONFIG_NFS_V4_1 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_NEW_IDMAPPER is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V4=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=m +CONFIG_CEPH_FS=m +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_UPCALL is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_DFS_UPCALL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +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=y +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=y +# CONFIG_LDM_DEBUG 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="utf8" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=m +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y +CONFIG_DLM=m +# CONFIG_DLM_DEBUG is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_LOCKUP_DETECTOR=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=m +# CONFIG_KEYS_DEBUG_PROC_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=m +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=m +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_USER=m +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_NULL=m +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CRYPTO_CRYPTD=m +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=m +CONFIG_CRYPTO_GCM=m +CONFIG_CRYPTO_SEQIV=m + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CTR=m +CONFIG_CRYPTO_CTS=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_XTS=m + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_VMAC=m + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_GHASH=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_RMD128=m +CONFIG_CRYPTO_RMD160=m +CONFIG_CRYPTO_RMD256=m +CONFIG_CRYPTO_RMD320=m +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_WP512=m + +# +# Ciphers +# +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_BLOWFISH_COMMON=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_SALSA20=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_ZLIB=m +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=m +CONFIG_CRYPTO_USER_API=m +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=m +CONFIG_CRC_ITU_T=m +CONFIG_CRC32=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_CRC8=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_XZ_DEC=m +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_TEST is not set +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_BTREE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fadvise_dontneed_change.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fadvise_dontneed_change.patch new file mode 100644 index 0000000000..f67abca720 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fadvise_dontneed_change.patch @@ -0,0 +1,142 @@ +diff --git a/include/linux/fs.h b/include/linux/fs.h +index e313022..9736054 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -2210,8 +2210,12 @@ extern int check_disk_change(struct block_device *); + extern int __invalidate_device(struct block_device *, bool); + extern int invalidate_partition(struct gendisk *, int); + #endif +-unsigned long invalidate_mapping_pages(struct address_space *mapping, +- pgoff_t start, pgoff_t end); ++ ++#define invalidate_mapping_pages(__mapping, __start, __end) \ ++ __invalidate_mapping_pages(__mapping, __start, __end, true) ++unsigned long __invalidate_mapping_pages(struct address_space *mapping, ++ pgoff_t start, pgoff_t end, ++ bool invalidate); + + static inline void invalidate_remote_inode(struct inode *inode) + { +diff --git a/mm/fadvise.c b/mm/fadvise.c +index 8d723c9..a59c1af 100644 +--- a/mm/fadvise.c ++++ b/mm/fadvise.c +@@ -106,7 +106,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) + nrpages = end_index - start_index + 1; + if (!nrpages) + nrpages = ~0UL; +- ++ + ret = force_page_cache_readahead(mapping, file, + start_index, + nrpages); +@@ -123,9 +123,16 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) + start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT; + end_index = (endbyte >> PAGE_CACHE_SHIFT); + ++ /* ++ * Reduce cache eligibility. ++ * ++ * This does not guarantee that pages are always dropped from ++ * page cache: active pages will be moved to the tail of the ++ * inactive list; inactive pages will be dropped if possible. ++ */ + if (end_index >= start_index) +- invalidate_mapping_pages(mapping, start_index, +- end_index); ++ __invalidate_mapping_pages(mapping, start_index, ++ end_index, false); + break; + default: + ret = -EINVAL; +diff --git a/mm/swap.c b/mm/swap.c +index a91caf7..2ddbe9f 100644 +--- a/mm/swap.c ++++ b/mm/swap.c +@@ -436,7 +436,7 @@ void add_page_to_unevictable_list(struct page *page) + * 2. active, dirty/writeback page -> inactive, head, PG_reclaim + * 3. inactive, mapped page -> none + * 4. inactive, dirty/writeback page -> inactive, head, PG_reclaim +- * 5. inactive, clean -> inactive, tail ++ * 5. [in]active, clean -> inactive, tail + * 6. Others -> none + * + * In 4, why it moves inactive's head, the VM expects the page would +diff --git a/mm/truncate.c b/mm/truncate.c +index 632b15e..f0a38dc 100644 +--- a/mm/truncate.c ++++ b/mm/truncate.c +@@ -315,20 +315,27 @@ void truncate_inode_pages(struct address_space *mapping, loff_t lstart) + EXPORT_SYMBOL(truncate_inode_pages); + + /** +- * invalidate_mapping_pages - Invalidate all the unlocked pages of one inode ++ * __invalidate_mapping_pages - Invalidate all the unlocked pages of one inode + * @mapping: the address_space which holds the pages to invalidate + * @start: the offset 'from' which to invalidate + * @end: the offset 'to' which to invalidate (inclusive) ++ * @invalidate: aggressive cache invalidation when true + * + * This function only removes the unlocked pages, if you want to + * remove all the pages of one inode, you must call truncate_inode_pages. + * +- * invalidate_mapping_pages() will not block on IO activity. It will not +- * invalidate pages which are dirty, locked, under writeback or mapped into +- * pagetables. ++ * The @invalidate parameter can be used to apply a more aggressive policy ++ * (when true) that will always drop pages from page cache when possible, or to ++ * just reduce cache eligibility (when false). In the last case active pages ++ * will be moved to the tail of the inactive list by deactivate_page(); ++ * inactive pages will be dropped in both cases. ++ * ++ * __invalidate_mapping_pages() will not block on IO activity. It will not ++ * invalidate pages which are dirty, locked, under writeback, mapped into ++ * pagetables, or on active lru when @invalidate is false. + */ +-unsigned long invalidate_mapping_pages(struct address_space *mapping, +- pgoff_t start, pgoff_t end) ++unsigned long __invalidate_mapping_pages(struct address_space *mapping, ++ pgoff_t start, pgoff_t end, bool invalidate) + { + struct pagevec pvec; + pgoff_t index = start; +@@ -359,12 +366,26 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping, + if (!trylock_page(page)) + continue; + WARN_ON(page->index != index); +- ret = invalidate_inode_page(page); +- unlock_page(page); + /* +- * Invalidation is a hint that the page is no longer +- * of interest and try to speed up its reclaim. ++ * Invalidation of active page is rather aggressive as ++ * we can't make sure it's not a working set of other ++ * processes. ++ * ++ * When "invalidate" is false, deactivate_page() would ++ * move active page into inactive's tail so the page ++ * will have a chance to activate again if other ++ * processes touch it. + */ ++ if (!invalidate /*&& PageActive(page)*/) ++ ret = 0; ++ else ++ ret = invalidate_inode_page(page); ++ unlock_page(page); ++ /* ++ * Invalidation of an inactive page (or any page when ++ * invalidate is true) is a hint that the page is no ++ * longer of interest and try to speed up its reclaim. ++ */ + if (!ret) + deactivate_page(page); + count += ret; +@@ -376,7 +397,7 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping, + } + return count; + } +-EXPORT_SYMBOL(invalidate_mapping_pages); ++EXPORT_SYMBOL(__invalidate_mapping_pages); + + /* + * This is like invalidate_complete_page(), except it ignores the page's diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fix-proc-cputype.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fix-proc-cputype.patch new file mode 100644 index 0000000000..aef46693cb --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/fix-proc-cputype.patch @@ -0,0 +1,22 @@ +diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c +index bb133d1..cd52810 100644 +--- a/arch/mips/kernel/cpu-probe.c ++++ b/arch/mips/kernel/cpu-probe.c +@@ -933,7 +933,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) + case PRID_IMP_BMIPS3300_ALT: + case PRID_IMP_BMIPS3300_BUG: + c->cputype = CPU_BMIPS3300; +- __cpu_name[cpu] = "Broadcom BMIPS3300"; ++ __cpu_name[cpu] = "Brcm3300"; + set_elf_platform(cpu, "bmips3300"); + break; + case PRID_IMP_BMIPS43XX: { +@@ -942,7 +942,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) + if (rev >= PRID_REV_BMIPS4380_LO && + rev <= PRID_REV_BMIPS4380_HI) { + c->cputype = CPU_BMIPS4380; +- __cpu_name[cpu] = "Broadcom BMIPS4380"; ++ __cpu_name[cpu] = "Brcm4380"; + set_elf_platform(cpu, "bmips4380"); + } else { + c->cputype = CPU_BMIPS4350; diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/make-3.82-hack.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/make-3.82-hack.patch new file mode 100644 index 0000000000..72c8ff3e2b --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/make-3.82-hack.patch @@ -0,0 +1,48 @@ +From aac3e80b6ca8b49036786edfb5ff0aead2426138 Mon Sep 17 00:00:00 2001 +From: Brian Harring +Date: Fri, 23 Dec 2011 18:16:15 -0800 +Subject: [PATCH] CHROMIUM: make-3.82: hack to fix differing behaviour between + 3.81 and 3.82 + +BUG=chromium-os:19882 +TEST=emerge make-3.82 via I7d0a6e25, emerge-x86-alex chromeos-kernel + +Change-Id: I6accabc10e93fe12debba42667900e4e0463cb41 +Signed-off-by: Brian Harring +Reviewed-on: https://gerrit.chromium.org/gerrit/13474 +Reviewed-by: Olof Johansson +--- + scripts/Makefile.fwinst | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst +index 6bf8e87..689204f 100644 +--- a/scripts/Makefile.fwinst ++++ b/scripts/Makefile.fwinst +@@ -27,7 +27,7 @@ endif + installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) + + installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) +-installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. ++installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH) + + # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. + PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs +@@ -36,6 +36,14 @@ $(INSTALL_FW_PATH)/$$(%): install-all-dirs + install-all-dirs: $(installed-fw-dirs) + @true + ++ ++# hack for make-3.82 support; without this (admittedly daft) rule, ++# firmware installation fails since it can't find a matching ++# rule for $(INSTALL_FW_PATH/.. ++# leave the hack in place till the root cause is fully found, without ++# it make-3.82 cannot be used. ++$(INSTALL_FW_PATH)/./: $(INSTALL_FW_PATH) ++ + quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) + cmd_install = $(INSTALL) -m0644 $< $@ + +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-a.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-a.patch new file mode 100644 index 0000000000..a83618dcd3 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-a.patch @@ -0,0 +1,56 @@ +commit 2080913e017ab9f88379d93fd09546ad95faf87b +Author: Larry Finger +Date: Sat Feb 25 18:10:21 2012 -0600 + + staging: r8712u: Fix regression caused by commit 8c213fa + + In commit 8c213fa "staging: r8712u: Use asynchronous firmware loading", + the command to release the firmware was placed in the wrong routine. + + In combination with the bug introduced in commit a5ee652 "staging: r8712u: + Interface-state not fully tracked", the driver attempts to upload firmware + that had already been released. This bug is the source of one of the + problems in https://bugs.archlinux.org/task/27996#comment89833. + + Tested-by: Alberto Lago Ballesteros + Tested-by: Adrian + Signed-off-by: Larry Finger + Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c +index 4cf175f..7bbd53a 100644 +--- a/drivers/staging/rtl8712/os_intfs.c ++++ b/drivers/staging/rtl8712/os_intfs.c +@@ -475,9 +475,6 @@ static int netdev_close(struct net_device *pnetdev) + r8712_free_assoc_resources(padapter); + /*s2-4.*/ + r8712_free_network_queue(padapter); +- release_firmware(padapter->fw); +- /* never exit with a firmware callback pending */ +- wait_for_completion(&padapter->rtl8712_fw_ready); + return 0; + } + +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c +index fe0e2ff..e01fe14 100644 +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + #include "osdep_service.h" + #include "drv_types.h" +@@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf) + struct _adapter *padapter = netdev_priv(pnetdev); + struct usb_device *udev = interface_to_usbdev(pusb_intf); + ++ if (padapter->fw_found) ++ release_firmware(padapter->fw); ++ /* never exit with a firmware callback pending */ ++ wait_for_completion(&padapter->rtl8712_fw_ready); + usb_set_intfdata(pusb_intf, NULL); + if (padapter) { + if (drvpriv.drv_registered == true) diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-b.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-b.patch new file mode 100644 index 0000000000..29ae16555a --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-b.patch @@ -0,0 +1,35 @@ +commit 534717020e6bd9459433d744bfd355d151e7b261 +Author: Martin Krause +Date: Fri Mar 2 13:00:14 2012 +0100 + + Staging rtl8712: Remove double USB device IDs + + Remove copies of the double USB device IDs: + + - 0bda:8172 + - 0bda:8174 + + Signed-off-by: Martin Krause + Acked-by: Larry Finger + Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c +index e01fe14..f8fbb57 100644 +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -109,7 +109,6 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = { + /* Amigo */ + {USB_DEVICE(0x0EB0, 0x9061)}, + /* ASUS/EKB */ +- {USB_DEVICE(0x0BDA, 0x8172)}, + {USB_DEVICE(0x13D3, 0x3323)}, + {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ + {USB_DEVICE(0x13D3, 0x3342)}, +@@ -161,7 +160,6 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = { + /* RTL8192SU */ + /* Realtek */ + {USB_DEVICE(0x0BDA, 0x8174)}, +- {USB_DEVICE(0x0BDA, 0x8174)}, + /* Belkin */ + {USB_DEVICE(0x050D, 0x845A)}, + /* Corega */ diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-c.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-c.patch new file mode 100644 index 0000000000..2d07a699cb --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-c.patch @@ -0,0 +1,45 @@ +commit 07b99cf55ccf3b058a1159642a92200a274aa839 +Author: Martin Krause +Date: Fri Mar 2 13:01:40 2012 +0100 + + Staging: rtl8712/rtl8192u: move USB device ID within staging drivers. + + It seems the USB device ID 0bda:8192 is wrongly assigned to the + RTL8192SU chip and not to the RTL8191SU chip in the USB database. + So this patch moves this device ID from the rtl8192u staging + driver to the rtl8712 staging driver. + + This patch was tested with a Radicom WIFIHU embedded wireless + module with a RTL8191SU chip and the USB device ID 0bda:8192. + Without the patch the rtl8192u driver claims this device, but + it does not work. With the patch the rtl8712 driver services + this device and it works. + + Signed-off-by: Martin Krause + Acked-by: Larry Finger + Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c +index c09be0a..9c00865 100644 +--- a/drivers/staging/rtl8192u/r8192U_core.c ++++ b/drivers/staging/rtl8192u/r8192U_core.c +@@ -105,7 +105,6 @@ u32 rt_global_debug_component = \ + + static const struct usb_device_id rtl8192_usb_id_tbl[] = { + /* Realtek */ +- {USB_DEVICE(0x0bda, 0x8192)}, + {USB_DEVICE(0x0bda, 0x8709)}, + /* Corega */ + {USB_DEVICE(0x07aa, 0x0043)}, +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c +index f8fbb57..b0c4cdb 100644 +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -106,6 +106,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = { + /* RTL8191SU */ + /* Realtek */ + {USB_DEVICE(0x0BDA, 0x8172)}, ++ {USB_DEVICE(0x0BDA, 0x8192)}, + /* Amigo */ + {USB_DEVICE(0x0EB0, 0x9061)}, + /* ASUS/EKB */ diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-d.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-d.patch new file mode 100644 index 0000000000..3ef873e646 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/rtl8712-backport-d.patch @@ -0,0 +1,41 @@ +commit ee6aeff71e2f16b9fe95ce908d098c169e0f4004 +Author: Larry Finger +Date: Fri Mar 2 21:06:49 2012 -0600 + + staging: r8712u: Fix Smatch warning + + The patch 2080913e017a: "staging: r8712u: Fix regression caused by + commit 8c213fa" from Feb 25, 2012, leads to the following Smatch + complaint: + + drivers/staging/rtl8712/usb_intf.c:629 r871xu_dev_remove() + warn: variable dereferenced before check 'padapter' (see line 625) + + The fix is to move the new statements inside the block where padapter + is not NULL. + + Reported-by: Dan Carpenter + Signed-off-by: Larry Finger + Signed-off-by: Greg Kroah-Hartman + +diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c +index b0c4cdb..e419b4f 100644 +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -620,12 +620,12 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf) + struct _adapter *padapter = netdev_priv(pnetdev); + struct usb_device *udev = interface_to_usbdev(pusb_intf); + +- if (padapter->fw_found) +- release_firmware(padapter->fw); +- /* never exit with a firmware callback pending */ +- wait_for_completion(&padapter->rtl8712_fw_ready); + usb_set_intfdata(pusb_intf, NULL); + if (padapter) { ++ if (padapter->fw_found) ++ release_firmware(padapter->fw); ++ /* never exit with a firmware callback pending */ ++ wait_for_completion(&padapter->rtl8712_fw_ready); + if (drvpriv.drv_registered == true) + padapter->bSurpriseRemoved = true; + if (pnetdev != NULL) { diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/threaded-interrupt-support.patch b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/threaded-interrupt-support.patch new file mode 100644 index 0000000000..e46dcbf29e --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox-3.2/threaded-interrupt-support.patch @@ -0,0 +1,98 @@ +From 1e2860643990a19617868d9dd4b161f79e67eebf Mon Sep 17 00:00:00 2001 +From: Andreas Monzner +Date: Fri, 13 Apr 2012 15:25:40 +0200 +Subject: worked on threaded interrupt support + +--- + arch/mips/brcmstb/irq.c | 2 +- + arch/mips/brcmstb/setup.c | 10 ++++++++++ + arch/mips/brcmstb/smp.c | 4 ++-- + drivers/tty/serial/bcm3250.c | 2 +- + 5 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/arch/mips/brcmstb/irq.c b/arch/mips/brcmstb/irq.c +index eee3900..586a7fc 100644 +--- a/arch/mips/brcmstb/irq.c ++++ b/arch/mips/brcmstb/irq.c +@@ -404,7 +404,7 @@ static int brcm_setup_upg_irq(void) + int ret; + + ret = request_irq(BRCM_IRQ_UPG, brcm_upg_interrupt, +- IRQF_SHARED, "brcm_shared_upg", "brcm_shared_upg"); ++ IRQF_SHARED | IRQF_NO_THREAD, "brcm_shared_upg", "brcm_shared_upg"); + if (ret) + printk(KERN_ERR "error: can't request UPG interrupt\n"); + return ret; +diff --git a/arch/mips/brcmstb/setup.c b/arch/mips/brcmstb/setup.c +index d8fb3cb..9a4e91f 100644 +--- a/arch/mips/brcmstb/setup.c ++++ b/arch/mips/brcmstb/setup.c +@@ -61,6 +61,13 @@ + * Platform device setup + ***********************************************************************/ + ++#ifdef CONFIG_BRCM_SHARED_UART_IRQ ++#define IRQ_THREADING \ ++ .irqflags = IRQF_NO_THREAD ++#else ++#define IRQ_THREADING ++#endif ++ + #ifdef CONFIG_BRCM_HAS_16550 + #define BRCM_16550_PLAT_DEVICE(uart_addr, uart_irq) \ + { \ +@@ -70,6 +77,7 @@ + .regshift = 2, \ + .iotype = UPIO_MEM32, \ + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ ++ IRQ_THREADING \ + }, + + #ifdef CONFIG_BRCM_HAS_PCU_UARTS +@@ -108,11 +116,13 @@ static struct platform_device brcm_16550_uarts = { + .start = BPHYSADDR(BCHP_##uart##_REG_START), \ + .end = BPHYSADDR(BCHP_##uart##_REG_END) + 3, \ + .flags = IORESOURCE_MEM, \ ++ IRQ_THREADING \ + }, \ + [1] = { \ + .start = BRCM_IRQ_##uart, \ + .end = BRCM_IRQ_##uart, \ + .flags = IORESOURCE_IRQ, \ ++ IRQ_THREADING \ + }, \ + }; \ + static struct platform_device bcm3250_##uart##_device = { \ +diff --git a/arch/mips/brcmstb/smp.c b/arch/mips/brcmstb/smp.c +index 2520852..3785616 100644 +--- a/arch/mips/brcmstb/smp.c ++++ b/arch/mips/brcmstb/smp.c +@@ -92,10 +92,10 @@ static irqreturn_t brcmstb_ipi_interrupt(int irq, void *dev_id); + /* IRQ setup - runs on TP0 */ + static void brcmstb_prepare_cpus(unsigned int max_cpus) + { +- if (request_irq(BRCM_IRQ_IPI0, brcmstb_ipi_interrupt, IRQF_DISABLED, ++ if (request_irq(BRCM_IRQ_IPI0, brcmstb_ipi_interrupt, IRQF_DISABLED | IRQF_NO_THREAD | IRQF_PERCPU, + "smp_ipi_tp0", NULL)) + panic("Can't request TP0 IPI interrupt\n"); +- if (request_irq(BRCM_IRQ_IPI1, brcmstb_ipi_interrupt, IRQF_DISABLED, ++ if (request_irq(BRCM_IRQ_IPI1, brcmstb_ipi_interrupt, IRQF_DISABLED | IRQF_NO_THREAD | IRQF_PERCPU, + "smp_ipi_tp1", NULL)) + panic("Can't request TP1 IPI interrupt\n"); + } +diff --git a/drivers/tty/serial/bcm3250.c b/drivers/tty/serial/bcm3250.c +index 65f422e..4803f4c 100644 +--- a/drivers/tty/serial/bcm3250.c ++++ b/drivers/tty/serial/bcm3250.c +@@ -330,7 +330,7 @@ static int bcm97xxx_startup(struct uart_port *port) + /* + * Allocate the IRQ + */ +- retval = request_irq(port->irq, bcm97xxx_interrupt, 0, "bcm3250_serial", port); ++ retval = request_irq(port->irq, bcm97xxx_interrupt, port->irqflags, "bcm3250_serial", port); + if (retval) { + printk(KERN_ERR "bcm3250_serial: bcm97xxx_startup - Can't get irq\n"); + return retval; +-- +1.7.9.5 + diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox.inc b/meta-openpli/recipes-linux/linux/linux-dreambox.inc new file mode 100644 index 0000000000..21aeed7955 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox.inc @@ -0,0 +1,58 @@ +require linux.inc + +INC_PR = "r8" + +PACKAGES_DYNAMIC = "kernel-*" + +# By default, kernel.bbclass modifies package names to allow multiple kernels +# to be installed in parallel. We revert this change and rprovide the versioned +# package names instead, to allow only one kernel to be installed. +PKG_kernel-base = "kernel-base" +PKG_kernel-image = "kernel-image" +RPROVIDES_kernel-base = "kernel-${KERNEL_VERSION}" +RPROVIDES_kernel-image = "kernel-image-${KERNEL_VERSION}" + +USB_ROOT = "/dev/sdb2" +USB_ROOT_dm8000 = "/dev/sdf2" + +do_install_append() { + gzip -9 ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} + echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec.bat + echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec.bat + echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat + echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${USB_CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat +} + +FILES_kernel-image += "/${KERNEL_IMAGEDEST}/autoexec*.bat" + +python __anonymous () { + import bb, re + kv = d.getVar('DREAMBOX_KERNEL_VERSION', True) + pv = d.getVar('PV', True) + if kv != pv: + raise bb.parse.SkipPackage("incompatible with kernel version %s" % kv) +} + +pkg_preinst_kernel-image() { + if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi +} +pkg_prerm_kernel-image() { + if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi +} +pkg_postinst_kernel-image() { + if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,ro /${KERNEL_IMAGEDEST}; fi +} +pkg_postrm_kernel-image() { + if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,ro /${KERNEL_IMAGEDEST}; fi +} + +# Do not use update-alternatives! +pkg_postinst_kernel () { +} +pkg_postrm_kernel () { +} + +CMDLINE = "root=/dev/mtdblock3 rootfstype=jffs2 rw ${CMDLINE_CONSOLE}" +USB_CMDLINE = "root=${USB_ROOT} rootdelay=10 rw ${CMDLINE_CONSOLE}" + +LOCALVERSION = "-${MACHINE}" diff --git a/meta-openpli/recipes-linux/linux/linux-dreambox_3.2.bb b/meta-openpli/recipes-linux/linux/linux-dreambox_3.2.bb new file mode 100644 index 0000000000..dd8e667f91 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-dreambox_3.2.bb @@ -0,0 +1,37 @@ +PR = "${INC_PR}.13" + +PATCHREV = "a3eaf43fbd1c2994fb61fd7065724ff4f2e4f1e0" +PATCHLEVEL = "16" + +SRC_URI = " \ + ${KERNELORG_MIRROR}/linux/kernel/v3.x/linux-3.2.tar.bz2;name=kernel \ + ${KERNELORG_MIRROR}/linux/kernel/v3.x/patch-3.2.${PATCHLEVEL}.bz2;apply=yes;name=kernel-patch \ + http://sources.dreamboxupdate.com/download/kernel-patches/${P}-${PATCHREV}.patch.bz2;name=dmm-patch \ + http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.11_for_3.2.2.diff.gz;name=unionfs \ + file://clear_sublevel.patch \ + file://fadvise_dontneed_change.patch \ + file://fix-proc-cputype.patch \ + file://threaded-interrupt-support.patch \ + file://brcmnand-buildfix.patch \ + file://brcmnand-fixed-corr-uncorr-error-detection.patch \ + file://brcmnand-fixed-non-hwecc-first-workaround.patch \ + file://rtl8712-backport-a.patch \ + file://rtl8712-backport-b.patch \ + file://rtl8712-backport-c.patch \ + file://rtl8712-backport-d.patch \ + file://make-3.82-hack.patch \ + file://defconfig \ +" + +SRC_URI[kernel.md5sum] = "7ceb61f87c097fc17509844b71268935" +SRC_URI[kernel.sha256sum] = "c881fc2b53cf0da7ca4538aa44623a7de043a41f76fd5d0f51a31f6ed699d463" +SRC_URI[kernel-patch.md5sum] = "1179d169e0ec15ada29cfa9066777a7f" +SRC_URI[kernel-patch.sha256sum] = "ea412451426f39b4b0edd89ce592e7f21a87c5bc12ed2600ad45c3f71867f415" +SRC_URI[dmm-patch.md5sum] = "29e0428508845663144ea8ed26575054" +SRC_URI[dmm-patch.sha256sum] = "a725831642a8d19a9664592adf36ab7a1341cca0a3570f1c02e5e449cbf2738f" +SRC_URI[unionfs.md5sum] = "06e7c9f6cafd49b72184be851116c511" +SRC_URI[unionfs.sha256sum] = "ce6ffa3c17a11dcca24196c11f6efc95c59b65a5b99958e73e8d4cc8e4b1f1ef" + +S = "${WORKDIR}/linux-3.2" + +require linux-dreambox.inc diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/add-dmx-source-timecode.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/add-dmx-source-timecode.patch new file mode 100644 index 0000000000..2d69356adf --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/add-dmx-source-timecode.patch @@ -0,0 +1,14 @@ +diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h +index f078f3a..21032e1 100644 +--- a/include/linux/dvb/dmx.h ++++ b/include/linux/dvb/dmx.h +@@ -135,6 +135,9 @@ typedef enum { + DMX_SOURCE_DVR3 + } dmx_source_t; + ++/* feature flag, add to DMX_SET_SOURCE argument to enable TS timecodes */ ++#define DMX_SOURCE_TIMECODE 0x80 ++ + struct dmx_stc { + unsigned int num; /* input : which STC? 0..N */ + unsigned int base; /* output: divisor for stc to get 90 kHz clock */ diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/af9015-output-full-range-SNR.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/af9015-output-full-range-SNR.patch new file mode 100644 index 0000000000..52498d2335 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/af9015-output-full-range-SNR.patch @@ -0,0 +1,39 @@ +af9015: fix SNR report in Enigma2/Kaffeine; SNR is now scaled in the full +0-65536 range; the snrdb module parameter of the af9013 demodulator enables +the SNR output in dBx10 as before. + +From: Gianluca Gennari +--- + drivers/media/dvb/frontends/af9013.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c +index 6bcbcf5..ce175df 100644 +--- a/drivers/media/dvb/frontends/af9013.c ++++ b/drivers/media/dvb/frontends/af9013.c +@@ -24,9 +24,11 @@ + + #include "af9013_priv.h" + +-int af9013_debug; ++int af9013_debug, af9013_snrdb; + module_param_named(debug, af9013_debug, int, 0644); + MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); ++module_param_named(snrdb, af9013_snrdb, int, 0644); ++MODULE_PARM_DESC(snrdb, "Turn on/off SNR output as dBx10 (default:off)."); + + struct af9013_state { + struct i2c_adapter *i2c; +@@ -469,6 +471,9 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe) + } + state->snr = tmp * 10; /* dB/10 */ + ++ if (!af9013_snrdb) ++ state->snr = (0xffff / (snr_lut[len - 1].snr * 10)) * state->snr; ++ + return ret; + err: + dbg("%s: failed=%d", __func__, ret); +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/as102-adjust-signal-strength-report.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-adjust-signal-strength-report.patch new file mode 100644 index 0000000000..97bcb7072c --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-adjust-signal-strength-report.patch @@ -0,0 +1,31 @@ +adjust signal strength report for devices with eLNA set to 0xA0 + +From: Gianluca Gennari +--- + drivers/staging/media/as102/as102_fe.c | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c +index 99e26c5..03fbbc8 100644 +--- a/drivers/staging/media/as102/as102_fe.c ++++ b/drivers/staging/media/as102/as102_fe.c +@@ -242,6 +242,16 @@ static int as102_fe_read_signal_strength(struct dvb_frontend *fe, + + *strength = (((0xffff * 400) * dev->signal_strength + 41000) * 2); + ++ switch (dev->elna_cfg) { ++ case 0xA0: ++ /* with eLNA set to 0xA0, the signal strength is capped at about 53% */ ++ *strength = *strength > 0x8ccc ? 0xffff : *strength * 20 / 11; ++ break; ++ case 0XC0: ++ default: ++ break; ++ } ++ + LEAVE(); + return 0; + } +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/as102-backports-from-kernel-3.4.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-backports-from-kernel-3.4.patch new file mode 100644 index 0000000000..257a51ea6f --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-backports-from-kernel-3.4.patch @@ -0,0 +1,462 @@ +as102: backports from kernel 3.4 + +includes 3 patches already upstream: +http://patchwork.linuxtv.org/patch/9878/ +http://patchwork.linuxtv.org/patch/10199/ +http://patchwork.linuxtv.org/patch/10200/ + +From: Gianluca Gennari +--- + drivers/staging/media/as102/as102_drv.h | 2 +- + drivers/staging/media/as102/as102_fe.c | 2 +- + drivers/staging/media/as102/as102_fw.h | 2 +- + drivers/staging/media/as102/as102_usb_drv.c | 17 +++++- + drivers/staging/media/as102/as10x_cmd.h | 80 +++++++++++++------------- + drivers/staging/media/as102/as10x_types.h | 2 +- + 6 files changed, 60 insertions(+), 45 deletions(-) + +diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h +index 957f0ed..b0e5a23 100644 +--- a/drivers/staging/media/as102/as102_drv.h ++++ b/drivers/staging/media/as102/as102_drv.h +@@ -76,7 +76,7 @@ struct as102_dev_t { + struct as10x_bus_adapter_t bus_adap; + struct list_head device_entry; + struct kref kref; +- unsigned long minor; ++ uint8_t elna_cfg; + + struct dvb_adapter dvb_adap; + struct dvb_frontend dvb_fe; +diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c +index bdc5a38..043c520 100644 +--- a/drivers/staging/media/as102/as102_fe.c ++++ b/drivers/staging/media/as102/as102_fe.c +@@ -265,7 +265,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire) + + if (acquire) { + if (elna_enable) +- as10x_cmd_set_context(&dev->bus_adap, 1010, 0xC0); ++ as10x_cmd_set_context(&dev->bus_adap, CONTEXT_LNA, dev->elna_cfg); + + ret = as10x_cmd_turn_on(&dev->bus_adap); + } else { +diff --git a/drivers/staging/media/as102/as102_fw.h b/drivers/staging/media/as102/as102_fw.h +index bd21f05..4bfc684 100644 +--- a/drivers/staging/media/as102/as102_fw.h ++++ b/drivers/staging/media/as102/as102_fw.h +@@ -29,7 +29,7 @@ struct as10x_fw_pkt_t { + union { + unsigned char request[2]; + unsigned char length[2]; +- } u; ++ } __packed u; + struct as10x_raw_fw_pkt raw; + } __packed; + +diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c +index d775be0..0f6bfe7 100644 +--- a/drivers/staging/media/as102/as102_usb_drv.c ++++ b/drivers/staging/media/as102/as102_usb_drv.c +@@ -57,6 +57,17 @@ static const char * const as102_device_names[] = { + NULL /* Terminating entry */ + }; + ++/* eLNA configuration: devices built on the reference design work best ++ with 0xA0, while custom designs seem to require 0xC0 */ ++static uint8_t const as102_elna_cfg[] = { ++ 0xA0, ++ 0xC0, ++ 0xC0, ++ 0xA0, ++ 0xA0, ++ 0x00 /* Terminating entry */ ++}; ++ + struct usb_driver as102_usb_driver = { + .name = DRIVER_FULL_NAME, + .probe = as102_usb_probe, +@@ -270,6 +281,8 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) + } + + urb->transfer_buffer = dev->stream + (i * AS102_USB_BUF_SIZE); ++ urb->transfer_dma = dev->dma_addr + (i * AS102_USB_BUF_SIZE); ++ urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + urb->transfer_buffer_length = AS102_USB_BUF_SIZE; + + dev->stream_urb[i] = urb; +@@ -369,8 +382,10 @@ static int as102_usb_probe(struct usb_interface *intf, + /* Assign the user-friendly device name */ + for (i = 0; i < (sizeof(as102_usb_id_table) / + sizeof(struct usb_device_id)); i++) { +- if (id == &as102_usb_id_table[i]) ++ if (id == &as102_usb_id_table[i]) { + as102_dev->name = as102_device_names[i]; ++ as102_dev->elna_cfg = as102_elna_cfg[i]; ++ } + } + + if (as102_dev->name == NULL) +diff --git a/drivers/staging/media/as102/as10x_cmd.h b/drivers/staging/media/as102/as10x_cmd.h +index 4ea249e..e21ec6c 100644 +--- a/drivers/staging/media/as102/as10x_cmd.h ++++ b/drivers/staging/media/as102/as10x_cmd.h +@@ -99,14 +99,14 @@ union as10x_turn_on { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_turn_off { +@@ -114,14 +114,14 @@ union as10x_turn_off { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t err; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_set_tune { +@@ -131,14 +131,14 @@ union as10x_set_tune { + uint16_t proc_id; + /* tune params */ + struct as10x_tune_args args; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* response error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_get_tune_status { +@@ -146,7 +146,7 @@ union as10x_get_tune_status { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -155,7 +155,7 @@ union as10x_get_tune_status { + uint8_t error; + /* tune status */ + struct as10x_tune_status sts; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_get_tps { +@@ -163,7 +163,7 @@ union as10x_get_tps { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -172,7 +172,7 @@ union as10x_get_tps { + uint8_t error; + /* tps details */ + struct as10x_tps tps; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_common { +@@ -180,14 +180,14 @@ union as10x_common { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* response error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_add_pid_filter { +@@ -201,7 +201,7 @@ union as10x_add_pid_filter { + uint8_t stream_type; + /* PID index in filter table */ + uint8_t idx; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -210,7 +210,7 @@ union as10x_add_pid_filter { + uint8_t error; + /* Filter id */ + uint8_t filter_id; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_del_pid_filter { +@@ -220,14 +220,14 @@ union as10x_del_pid_filter { + uint16_t proc_id; + /* PID to remove */ + uint16_t pid; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* response error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_start_streaming { +@@ -235,14 +235,14 @@ union as10x_start_streaming { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_stop_streaming { +@@ -250,14 +250,14 @@ union as10x_stop_streaming { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_get_demod_stats { +@@ -265,7 +265,7 @@ union as10x_get_demod_stats { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -274,7 +274,7 @@ union as10x_get_demod_stats { + uint8_t error; + /* demod stats */ + struct as10x_demod_stats stats; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_get_impulse_resp { +@@ -282,7 +282,7 @@ union as10x_get_impulse_resp { + struct { + /* request identifier */ + uint16_t proc_id; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -291,7 +291,7 @@ union as10x_get_impulse_resp { + uint8_t error; + /* impulse response ready */ + uint8_t is_ready; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_fw_context { +@@ -305,7 +305,7 @@ union as10x_fw_context { + uint16_t tag; + /* context request type */ + uint16_t type; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -316,7 +316,7 @@ union as10x_fw_context { + uint16_t type; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_set_register { +@@ -328,14 +328,14 @@ union as10x_set_register { + struct as10x_register_addr reg_addr; + /* register content */ + struct as10x_register_value reg_val; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_get_register { +@@ -345,7 +345,7 @@ union as10x_get_register { + uint16_t proc_id; + /* register description */ + struct as10x_register_addr reg_addr; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -354,7 +354,7 @@ union as10x_get_register { + uint8_t error; + /* register content */ + struct as10x_register_value reg_val; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_cfg_change_mode { +@@ -364,14 +364,14 @@ union as10x_cfg_change_mode { + uint16_t proc_id; + /* mode */ + uint8_t mode; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ + uint16_t proc_id; + /* error */ + uint8_t error; +- } rsp; ++ } __packed rsp; + } __packed; + + struct as10x_cmd_header_t { +@@ -394,7 +394,7 @@ union as10x_dump_memory { + struct as10x_register_addr reg_addr; + /* nb blocks to read */ + uint16_t num_blocks; +- } req; ++ } __packed req; + /* response */ + struct { + /* response identifier */ +@@ -408,8 +408,8 @@ union as10x_dump_memory { + uint8_t data8[DUMP_BLOCK_SIZE]; + uint16_t data16[DUMP_BLOCK_SIZE / sizeof(uint16_t)]; + uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; +- } u; +- } rsp; ++ } __packed u; ++ } __packed rsp; + } __packed; + + union as10x_dumplog_memory { +@@ -418,7 +418,7 @@ union as10x_dumplog_memory { + uint16_t proc_id; + /* dump memory type request */ + uint8_t dump_req; +- } req; ++ } __packed req; + struct { + /* request identifier */ + uint16_t proc_id; +@@ -428,7 +428,7 @@ union as10x_dumplog_memory { + uint8_t dump_rsp; + /* dump data */ + uint8_t data[DUMP_BLOCK_SIZE]; +- } rsp; ++ } __packed rsp; + } __packed; + + union as10x_raw_data { +@@ -437,14 +437,14 @@ union as10x_raw_data { + uint16_t proc_id; + uint8_t data[64 - sizeof(struct as10x_cmd_header_t) + - 2 /* proc_id */]; +- } req; ++ } __packed req; + /* response */ + struct { + uint16_t proc_id; + uint8_t error; + uint8_t data[64 - sizeof(struct as10x_cmd_header_t) + - 2 /* proc_id */ - 1 /* rc */]; +- } rsp; ++ } __packed rsp; + } __packed; + + struct as10x_cmd_t { +@@ -469,7 +469,7 @@ struct as10x_cmd_t { + union as10x_dump_memory dump_memory; + union as10x_dumplog_memory dumplog_memory; + union as10x_raw_data raw_data; +- } body; ++ } __packed body; + } __packed; + + struct as10x_token_cmd_t { +diff --git a/drivers/staging/media/as102/as10x_types.h b/drivers/staging/media/as102/as10x_types.h +index fde8140..af26e05 100644 +--- a/drivers/staging/media/as102/as10x_types.h ++++ b/drivers/staging/media/as102/as10x_types.h +@@ -181,7 +181,7 @@ struct as10x_register_value { + uint8_t value8; /* 8 bit value */ + uint16_t value16; /* 16 bit value */ + uint32_t value32; /* 32 bit value */ +- } u; ++ } __packed u; + } __packed; + + struct as10x_register_addr { +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/as102-scale-MER-to-full-range.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-scale-MER-to-full-range.patch new file mode 100644 index 0000000000..52efeafeed --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/as102-scale-MER-to-full-range.patch @@ -0,0 +1,68 @@ +BER/MER is converted in dB and scaled to the full range 0-65536 for output; +added a module parameter to select SNR/MER output in dBx10; + +From: Gianluca Gennari +--- + drivers/staging/media/as102/as102_drv.c | 4 ++++ + drivers/staging/media/as102/as102_fe.c | 16 ++++++++++++++++ + 2 files changed, 20 insertions(+), 0 deletions(-) + +diff --git a/drivers/staging/media/as102/as102_drv.c b/drivers/staging/media/as102/as102_drv.c +index aae0505..564e558 100644 +--- a/drivers/staging/media/as102/as102_drv.c ++++ b/drivers/staging/media/as102/as102_drv.c +@@ -56,6 +56,10 @@ int elna_enable = 1; + module_param_named(elna_enable, elna_enable, int, 0644); + MODULE_PARM_DESC(elna_enable, "Activate eLNA (default: on)"); + ++int snr_db; ++module_param_named(snr_db, snr_db, int, 0644); ++MODULE_PARM_DESC(snr_db, "Output SNR/MER in dBx10 (default: no)"); ++ + DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); + + static void as102_stop_stream(struct as102_dev_t *dev) +diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c +index 043c520..99e26c5 100644 +--- a/drivers/staging/media/as102/as102_fe.c ++++ b/drivers/staging/media/as102/as102_fe.c +@@ -22,6 +22,9 @@ + #include "as102_drv.h" + #include "as10x_types.h" + #include "as10x_cmd.h" ++#include "dvb_math.h" ++ ++extern int snr_db; + + static void as10x_fe_copy_tps_parameters(struct dtv_frontend_properties *dst, + struct as10x_tps *src); +@@ -184,6 +187,7 @@ out: + static int as102_fe_read_snr(struct dvb_frontend *fe, u16 *snr) + { + struct as102_dev_t *dev; ++ u32 mer_db; + + ENTER(); + +@@ -193,6 +197,18 @@ static int as102_fe_read_snr(struct dvb_frontend *fe, u16 *snr) + + *snr = dev->demod_stats.mer; + ++ /* convert in dBx10 */ ++ if (*snr > 0) { ++ mer_db = 10 * intlog10(*snr); ++ *snr = mer_db / ((1 << 24) / 10); ++ } ++ ++ dprintk(debug, "MER=%d dBx10\n", *snr); ++ ++ /* scale the MER value to the full range 0-65536, capping MER at 29 dB */ ++ if (!snr_db) ++ *snr = (*snr >= 290) ? 0xffff : (0xffff / 290) * *snr; ++ + LEAVE(); + return 0; + } +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/cinergy_s2_usb_r2.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/cinergy_s2_usb_r2.patch new file mode 100644 index 0000000000..f2349753b4 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/cinergy_s2_usb_r2.patch @@ -0,0 +1,57 @@ +diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c +index 451c5a7..60dcb43 100644 +--- a/drivers/media/dvb/dvb-usb/dw2102.c ++++ b/drivers/media/dvb/dvb-usb/dw2102.c +@@ -1181,6 +1181,13 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d) + { + u8 obuf[3] = { 0xe, 0x80, 0 }; + u8 ibuf[] = { 0 }; ++ ++ if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0) ++ err("command 0x0e transfer failed."); ++ //power on su3000 ++ obuf[0] = 0xe; ++ obuf[1] = 0x02; ++ obuf[2] = 1; + + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0) + err("command 0x0e transfer failed."); +@@ -1451,6 +1458,7 @@ enum dw2102_table_entry { + TEVII_S480_1, + TEVII_S480_2, + X3M_SPC1400HD, ++ TERRATEC_CINERGY_S2_R2, + }; + + static struct usb_device_id dw2102_table[] = { +@@ -1469,6 +1477,7 @@ static struct usb_device_id dw2102_table[] = { + [TEVII_S480_1] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)}, + [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)}, + [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)}, ++ [TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)}, + { } + }; + +@@ -1857,7 +1866,7 @@ static struct dvb_usb_device_properties su3000_properties = { + }}, + } + }, +- .num_device_descs = 3, ++ .num_device_descs = 4, + .devices = { + { "SU3000HD DVB-S USB2.0", + { &dw2102_table[GENIATECH_SU3000], NULL }, +@@ -1871,6 +1880,10 @@ static struct dvb_usb_device_properties su3000_properties = { + { &dw2102_table[X3M_SPC1400HD], NULL }, + { NULL }, + }, ++ { "Terratec Cinergy S2 USB HD Rev.2", ++ { &dw2102_table[TERRATEC_CINERGY_S2_R2], NULL }, ++ { NULL }, ++ }, + } + }; + +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-changed-condition-to-break-out-from-wait-lock-loop.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-changed-condition-to-break-out-from-wait-lock-loop.patch new file mode 100644 index 0000000000..ed6a07b46f --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-changed-condition-to-break-out-from-wait-lock-loop.patch @@ -0,0 +1,30 @@ +Changed condition to break out from wait lock loop; +return DVBFE_ALGO_SEARCH_SUCCESS only if we have a lock; + +From: Gianluca Gennari +--- + drivers/media/dvb/frontends/cxd2820r_core.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c +index 5c7c2aa..3bba37d 100644 +--- a/drivers/media/dvb/frontends/cxd2820r_core.c ++++ b/drivers/media/dvb/frontends/cxd2820r_core.c +@@ -526,12 +526,12 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe) + if (ret) + goto error; + +- if (status & FE_HAS_SIGNAL) ++ if (status & FE_HAS_LOCK) + break; + } + + /* check if we have a valid signal */ +- if (status) { ++ if (status & FE_HAS_LOCK) { + priv->last_tune_failed = 0; + return DVBFE_ALGO_SEARCH_SUCCESS; + } else { +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-enable-LNA-for-DVB-T.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-enable-LNA-for-DVB-T.patch new file mode 100644 index 0000000000..4b1d57528b --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-enable-LNA-for-DVB-T.patch @@ -0,0 +1,17 @@ +diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c +index aabbf48..25fc73f 100644 +--- a/drivers/media/video/em28xx/em28xx-dvb.c ++++ b/drivers/media/video/em28xx/em28xx-dvb.c +@@ -504,7 +504,8 @@ static struct cxd2820r_config em28xx_cxd2820r_config = { + .i2c_address = (0xd8 >> 1), + .ts_mode = CXD2820R_TS_SERIAL, + +- /* enable LNA for DVB-T2 and DVB-C */ ++ /* enable LNA for DVB-T, DVB-T2 and DVB-C */ ++ .gpio_dvbt[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L, + .gpio_dvbt2[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L, + .gpio_dvbc[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L, + }; +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-output-full-range-SNR.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-output-full-range-SNR.patch new file mode 100644 index 0000000000..1e3e1a6c79 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/cxd2820r-output-full-range-SNR.patch @@ -0,0 +1,155 @@ +cxd2820r: by default SNR output is scaled to full 0-65535 range; +output in dBx10 can be enabled through a module parameter; + +Signed-off-by: Gianluca Gennari +--- + drivers/media/dvb/frontends/cxd2820r_core.c | 4 +++ + drivers/media/dvb/frontends/cxd2820r_priv.h | 1 + + drivers/media/dvb/frontends/cxd2820r_t.c | 29 +++++++++++++++++++++-- + drivers/media/dvb/frontends/cxd2820r_t2.c | 33 ++++++++++++++++++++++++-- + 4 files changed, 61 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c +index 3bba37d..3e8d5a3 100644 +--- a/drivers/media/dvb/frontends/cxd2820r_core.c ++++ b/drivers/media/dvb/frontends/cxd2820r_core.c +@@ -25,6 +25,10 @@ int cxd2820r_debug; + module_param_named(debug, cxd2820r_debug, int, 0644); + MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); + ++int cxd2820r_snrdb; ++module_param_named(snrdb,cxd2820r_snrdb, int, 0644); ++MODULE_PARM_DESC(snrdb, "Turn on/off SNR output in dBx10 (default:off)."); ++ + /* write multiple registers */ + static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, + u8 *val, int len) +diff --git a/drivers/media/dvb/frontends/cxd2820r_priv.h b/drivers/media/dvb/frontends/cxd2820r_priv.h +index 9a9822c..7038235 100644 +--- a/drivers/media/dvb/frontends/cxd2820r_priv.h ++++ b/drivers/media/dvb/frontends/cxd2820r_priv.h +@@ -63,6 +63,7 @@ struct cxd2820r_priv { + /* cxd2820r_core.c */ + + extern int cxd2820r_debug; ++extern int cxd2820r_snrdb; + + int cxd2820r_gpio(struct dvb_frontend *fe); + +diff --git a/drivers/media/dvb/frontends/cxd2820r_t.c b/drivers/media/dvb/frontends/cxd2820r_t.c +index 1a02623..d8fbdcf 100644 +--- a/drivers/media/dvb/frontends/cxd2820r_t.c ++++ b/drivers/media/dvb/frontends/cxd2820r_t.c +@@ -309,7 +309,6 @@ int cxd2820r_read_signal_strength_t(struct dvb_frontend *fe, + + /* scale value to 0x0000-0xffff from 0x0000-0x0fff */ + *strength = tmp * 0xffff / 0x0fff; +- + return ret; + error: + dbg("%s: failed:%d", __func__, ret); +@@ -321,7 +320,7 @@ int cxd2820r_read_snr_t(struct dvb_frontend *fe, u16 *snr) + struct cxd2820r_priv *priv = fe->demodulator_priv; + int ret; + u8 buf[2]; +- u16 tmp; ++ u16 tmp, max_snr; + /* report SNR in dB * 10 */ + + ret = cxd2820r_rd_regs(priv, 0x00028, buf, sizeof(buf)); +@@ -336,8 +335,32 @@ int cxd2820r_read_snr_t(struct dvb_frontend *fe, u16 *snr) + else + *snr = 0; + +- dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); ++ if (cxd2820r_snrdb) ++ goto db_out; ++ ++ /* scale SNR to full range */ ++ ret = cxd2820r_rd_regs(priv, 0x0002f, buf, 1); ++ if (ret) ++ goto error; + ++ switch ((buf[0] >> 6) & 0x03) { ++ case 0: /* QPSK */ ++ max_snr = 230; ++ break; ++ case 1: /* QAM_16 */ ++ max_snr = 260; ++ break; ++ case 2: /* QAM_64 */ ++ default: ++ max_snr = 290; ++ break; ++ } ++ ++ *snr = (*snr >= max_snr) ? 0xffff : (0xffff / max_snr) * *snr; ++ dbg("%s: SNR=%d val=%04x", __func__, *snr, tmp); ++ return ret; ++db_out: ++ dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); + return ret; + error: + dbg("%s: failed:%d", __func__, ret); +diff --git a/drivers/media/dvb/frontends/cxd2820r_t2.c b/drivers/media/dvb/frontends/cxd2820r_t2.c +index 3a5759e..10f99e55 100644 +--- a/drivers/media/dvb/frontends/cxd2820r_t2.c ++++ b/drivers/media/dvb/frontends/cxd2820r_t2.c +@@ -343,7 +343,6 @@ int cxd2820r_read_signal_strength_t2(struct dvb_frontend *fe, + + /* scale value to 0x0000-0xffff from 0x0000-0x0fff */ + *strength = tmp * 0xffff / 0x0fff; +- + return ret; + error: + dbg("%s: failed:%d", __func__, ret); +@@ -355,7 +354,7 @@ int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr) + struct cxd2820r_priv *priv = fe->demodulator_priv; + int ret; + u8 buf[2]; +- u16 tmp; ++ u16 tmp, max_snr; + /* report SNR in dB * 10 */ + + ret = cxd2820r_rd_regs(priv, 0x02028, buf, sizeof(buf)); +@@ -370,8 +369,36 @@ int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr) + else + *snr = 0; + +- dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); ++ if (cxd2820r_snrdb) ++ goto db_out; ++ ++ /* scale SNR to full range */ ++ ret = cxd2820r_rd_regs(priv, 0x0205d, buf, 1); ++ if (ret) ++ goto error; + ++ switch (buf[0] & 0x07) { ++ /* FIXME: check the values */ ++ case 0: /* QPSK */ ++ max_snr = 170; ++ break; ++ case 1: /* QAM_16 */ ++ max_snr = 200; ++ break; ++ case 2: /* QAM_64 */ ++ max_snr = 230; ++ break; ++ case 3: /* QAM_256 */ ++ default: ++ max_snr = 260; ++ break; ++ } ++ ++ *snr = (*snr >= max_snr) ? 0xffff : (0xffff / max_snr) * *snr; ++ dbg("%s: SNR=%d val=%04x", __func__, *snr, tmp); ++ return ret; ++db_out: ++ dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); + return ret; + error: + dbg("%s: failed:%d", __func__, ret); +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/disable_early_fb.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/disable_early_fb.patch new file mode 100644 index 0000000000..c37bc011e1 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/disable_early_fb.patch @@ -0,0 +1,11 @@ +--- a/drivers/video/bcmfb.c ++++ b/drivers/video/bcmfb.c +@@ -130,7 +130,7 @@ static int __devinit bcmfb_probe(struct platform_device *pdev) + struct fb_info *info; + struct bcmfb_par *fbi; + struct device *device = &pdev->dev; +- ++ return -ENODEV; + info = framebuffer_alloc(sizeof(struct bcmfb_par), device); + if (!info) return -ENOMEM; + fbi = (struct bcmfb_par*)info->par; diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-a867.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-a867.patch new file mode 100644 index 0000000000..d7b23fcccc --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-a867.patch @@ -0,0 +1,44121 @@ +driver for Avermedia A867; + +thanks to Ambrosa for the implementation of SNR report and several cleanups; + +added define to manage refactored RC code on recent v4l +versions together with old kernels; +modified frontend driver to work directly with the DVBv5 +data structure, as required in new kernel/v4l versions; + +this driver supports all kernels up to 3.4 + +From: Gianluca Gennari +--- + drivers/media/dvb/dvb-usb/Kconfig | 8 + + drivers/media/dvb/dvb-usb/Makefile | 6 + + drivers/media/dvb/dvb-usb/a867_Afa_AF9007.c | 50 + + drivers/media/dvb/dvb-usb/a867_Afa_AF9007.h | 39 + + drivers/media/dvb/dvb-usb/a867_Afa_AF9007_Script.h | 93 + + drivers/media/dvb/dvb-usb/a867_Common.h | 259 + + drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.c | 203 + + drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.h | 60 + + .../dvb/dvb-usb/a867_Maxlinear_MXL5007_Script.h | 64 + + drivers/media/dvb/dvb-usb/a867_af903x-core.c | 253 + + drivers/media/dvb/dvb-usb/a867_af903x-devices.c | 278 + + drivers/media/dvb/dvb-usb/a867_af903x-drv.c | 1238 ++ + drivers/media/dvb/dvb-usb/a867_af903x-fe.c | 936 ++ + drivers/media/dvb/dvb-usb/a867_af903x-ioctl.h | 29 + + drivers/media/dvb/dvb-usb/a867_af903x-tuner.c | 122 + + drivers/media/dvb/dvb-usb/a867_af903x.h | 311 + + drivers/media/dvb/dvb-usb/a867_aver_version.h | 1 + + drivers/media/dvb/dvb-usb/a867_cmd.c | 1005 ++ + drivers/media/dvb/dvb-usb/a867_cmd.h | 246 + + drivers/media/dvb/dvb-usb/a867_compat.h | 503 + + drivers/media/dvb/dvb-usb/a867_debug.h | 4 + + drivers/media/dvb/dvb-usb/a867_demodulator.c | 540 + + drivers/media/dvb/dvb-usb/a867_demodulator.h | 1495 +++ + drivers/media/dvb/dvb-usb/a867_demodulatorextend.c | 607 + + drivers/media/dvb/dvb-usb/a867_demodulatorextend.h | 1326 ++ + drivers/media/dvb/dvb-usb/a867_error.h | 141 + + drivers/media/dvb/dvb-usb/a867_firmware.h |10867 ++++++++++++++++ + drivers/media/dvb/dvb-usb/a867_inttype.h | 41 + + drivers/media/dvb/dvb-usb/a867_iocontrol.h | 738 ++ + drivers/media/dvb/dvb-usb/a867_mxl5007t.c | 698 + + drivers/media/dvb/dvb-usb/a867_mxl5007t.h | 135 + + drivers/media/dvb/dvb-usb/a867_ofdm.h | 18 + + drivers/media/dvb/dvb-usb/a867_register.h |13519 ++++++++++++++++++++ + drivers/media/dvb/dvb-usb/a867_standard.c | 4668 +++++++ + drivers/media/dvb/dvb-usb/a867_standard.h | 1142 ++ + drivers/media/dvb/dvb-usb/a867_type.h | 968 ++ + drivers/media/dvb/dvb-usb/a867_usb-urb.c | 247 + + drivers/media/dvb/dvb-usb/a867_usb2impl.c | 171 + + drivers/media/dvb/dvb-usb/a867_usb2impl.h | 38 + + drivers/media/dvb/dvb-usb/a867_user.c | 236 + + drivers/media/dvb/dvb-usb/a867_user.h | 155 + + drivers/media/dvb/dvb-usb/a867_userdef.h | 25 + + drivers/media/dvb/dvb-usb/a867_variable.h | 260 + + drivers/media/dvb/dvb-usb/a867_version.h | 3 + + 44 files changed, 43746 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/dvb/dvb-usb/a867_Afa_AF9007.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_Afa_AF9007.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_Afa_AF9007_Script.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_Common.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007_Script.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-core.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-devices.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-drv.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-fe.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-ioctl.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x-tuner.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_af903x.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_aver_version.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_cmd.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_cmd.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_compat.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_debug.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_demodulator.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_demodulator.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_demodulatorextend.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_demodulatorextend.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_error.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_firmware.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_inttype.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_iocontrol.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_mxl5007t.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_mxl5007t.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_ofdm.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_register.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_standard.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_standard.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_type.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_usb-urb.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_usb2impl.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_usb2impl.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_user.c + create mode 100644 drivers/media/dvb/dvb-usb/a867_user.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_userdef.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_variable.h + create mode 100644 drivers/media/dvb/dvb-usb/a867_version.h + +diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig +index d2014c0..787ffab 100644 +--- a/drivers/media/dvb/dvb-usb/Kconfig ++++ b/drivers/media/dvb/dvb-usb/Kconfig +@@ -415,3 +415,11 @@ config DVB_USB_MXL111SF + select VIDEO_TVEEPROM + help + Say Y here to support the MxL111SF USB2.0 DTV receiver. ++ ++config DVB_USB_A867 ++ tristate "Avermedia A867 DVB support" ++ depends on DVB_USB ++ default m ++ help ++ Say Y here to support the Avermedia A867 device ++ +diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile +index f8b1013..4745905 100644 +--- a/drivers/media/dvb/dvb-usb/Makefile ++++ b/drivers/media/dvb/dvb-usb/Makefile +@@ -109,6 +109,12 @@ obj-$(CONFIG_DVB_USB_MXL111SF) += mxl111sf-tuner.o + dvb-usb-af9035-objs = af9035.o + obj-$(CONFIG_DVB_USB_AF9035) += dvb-usb-af9035.o + ++dvb-usb-a867-objs := a867_af903x-core.o a867_af903x-devices.o a867_af903x-drv.o \ ++ a867_af903x-fe.o a867_af903x-tuner.o a867_cmd.o a867_standard.o \ ++ a867_demodulator.o a867_demodulatorextend.o a867_usb2impl.o \ ++ a867_user.o a867_mxl5007t.o a867_Maxlinear_MXL5007.o a867_Afa_AF9007.o ++obj-$(CONFIG_DVB_USB_A867) += dvb-usb-a867.o ++ + ccflags-y += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ + # due to tuner-xc3028 + ccflags-y += -Idrivers/media/common/tuners +diff --git a/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.c b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.c +new file mode 100644 +index 0000000..0d65cf9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.c +@@ -0,0 +1,50 @@ ++/* ++ * @(#)Afatech_AF9007_EXT.cpp ++ * ++ * Copyright 2005 Afatech, Inc. All rights reserved. ++ */ ++ ++//#include ++#include "a867_type.h" ++#include "a867_error.h" ++#include "a867_user.h" ++#include "a867_register.h" ++#include "a867_standard.h" ++#include "a867_Afa_AF9007_Script.h" ++ ++ ++Dword AF9007_open ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ return (Error_NO_ERROR); ++} ++ ++Dword AF9007_close ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ return (Error_NO_ERROR); ++} ++ ++Dword AF9007_set ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++) { ++ return (Error_NO_ERROR); ++} ++ ++TunerDescription tuner_AF9007 = { ++ AF9007_open, ++ AF9007_close, ++ AF9007_set, ++ AF9007_scripts, ++ AF9007_scriptSets, ++ 0, /** tuner i2c address */ ++ 0, /** length of tuner register address */ ++ 36167000, /** tuner if */ ++ True, /** spectrum inverse */ ++ 0xFF /** tuner id */ ++}; +diff --git a/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.h b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.h +new file mode 100644 +index 0000000..7f41742 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007.h +@@ -0,0 +1,39 @@ ++/** ++ * @(#)Afatech_AF9007_EXT.h ++ * ++ * Copyright 2005 Afatech, Inc. All rights reserved. ++ */ ++#ifndef __Afatech_AF9007_EXT_H__ ++#define __Afatech_AF9007_EXT_H__ ++ ++ ++extern TunerDescription tuner_AF9007; ++ ++ ++/** ++ * ++ */ ++Dword AF9007_open ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++/** ++ * ++ */ ++Dword AF9007_close ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++/** ++ * ++ */ ++Dword AF9007_set ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_Afa_AF9007_Script.h b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007_Script.h +new file mode 100644 +index 0000000..7da168b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Afa_AF9007_Script.h +@@ -0,0 +1,93 @@ ++/** script version */ ++ ++#define AF9007_ADDRESS 0xC0 ++#define AF9007_SCRIPTSETLENGTH 0x00000001 ++ ++ ++Word AF9007_scriptSets[] = { ++ 0x50 ++}; ++ ++ValueSet AF9007_scripts[] = { ++ {0xF600, 0x5}, ++ {0xF601, 0x8}, ++ {0xF602, 0xb}, ++ {0xF603, 0x0e}, ++ {0xF604, 0x11}, ++ {0xF605, 0x14}, ++ {0xF606, 0x17}, ++ {0xF607, 0x1f}, ++ {0xF1E6, 0x01}, ++ {0xF001, 0x00}, ++ {0xF005, 0x01}, ++ {0xF004, 0x00}, ++ {0xF00A, 0x1B}, ++ {0xF00B, 0x1C}, ++ {0xF00C, 0x1B}, ++ {0xF00D, 0x1C}, ++ {0xF016, 0x10}, ++ {0xF017, 0x04}, ++ {0xF018, 0x05}, ++ {0xF019, 0x04}, ++ {0xF01A, 0x05}, ++ {0xF021, 0x03}, ++ {0xF022, 0x0A}, ++ {0xF023, 0x0A}, ++ {0xF000, 0x01}, ++ {0xF047, 0x00}, ++ {0xF007, 0x00}, ++ {0xF12F, 0x00}, ++ {0xF077, 0x00}, ++ {0xF00A, 0x1A}, ++ {0xF00B, 0x1B}, ++ {0xF00C, 0x1A}, ++ {0xF00D, 0x1B}, ++ {0xF01F, 0x50}, ++ {0xF020, 0x00}, ++ {0xF029, 0x46}, ++ {0xF02A, 0x00}, ++ {0xF010, 0xDF}, ++ {0xF011, 0x02}, ++ {0xF00E, 0x44}, ++ {0xF00F, 0x01}, ++ {0xF014, 0xEB}, ++ {0xF015, 0x02}, ++ {0xF012, 0xF4}, ++ {0xF013, 0x01}, ++ {0x0066, 0x52}, ++ {0xF01B, 0x26}, ++ {0xF01C, 0x01}, ++ {0xF01D, 0x12}, ++ {0xF01E, 0x03}, ++ {0xF025, 0xE8}, ++ {0xF026, 0x00}, ++ {0xF027, 0x5F}, ++ {0xF028, 0x03}, ++ {0x0044, 0xFF}, ++ {0x0045, 0x03}, ++ {0x0046, 0xFF}, ++ {0x0047, 0x03}, ++ {0x0048, 0xFF}, ++ {0x0049, 0x03}, ++ {0x004a, 0xFF}, ++ {0x004b, 0x03}, ++ {0x004c, 0xEB}, ++ {0x004d, 0x02}, ++ {0x0053, 0x68}, ++ {0x0054, 0x03}, ++ {0x0059, 0x12}, ++ {0x005a, 0x03}, ++ {0xF02B, 0x00}, ++ {0xF02C, 0x01}, ++ {0xF03B, 0x9A}, ++ {0xF03C, 0x01}, ++ {0xF03D, 0x5A}, ++ {0xF03E, 0x01}, ++ {0xF03F, 0x96}, ++ {0xF040, 0x46}, ++ {0xF031, 0x0}, ++ {0x006b, 0x0A}, ++ {0x006c, 0x14}, ++ {0x006d, 0x08}, ++}; ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_Common.h b/drivers/media/dvb/dvb-usb/a867_Common.h +new file mode 100644 +index 0000000..d6e6fe2 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Common.h +@@ -0,0 +1,259 @@ ++#pragma once ++ ++typedef unsigned char BYTE; /** At least 1 Byte */ ++typedef unsigned short WORD; /** At least 2 Bytes */ ++typedef unsigned int DWORD; /** At least 4 Bytes */ ++typedef void * HANDLE; /** Pointer to memory location */ ++ ++#define TUNER_REGS_NUM 104 ++#define INITCTRL_NUM 38 ++#ifdef _MXL_PRODUCTION ++#define CHCTRL_NUM 39 ++#else ++#define CHCTRL_NUM 36 ++#endif ++ ++#define MXLCTRL_NUM 189 ++ ++#define MASTER_CONTROL_ADDR 9 ++ ++/** Enumeration of AGC Mode */ ++typedef enum ++{ ++ MXL_DUAL_AGC = 0 , ++ MXL_SINGLE_AGC ++} AGC_Mode ; ++ ++/** ++ * Enumeration of Master Control Register State ++ */ ++typedef enum ++{ ++ MC_LOAD_START = 1 , ++ MC_POWER_DOWN , ++ MC_SYNTH_RESET , ++ MC_SEQ_OFF ++} Master_Control_State ; ++ ++/** ++ * Enumeration of MXL5005 Tuner Mode ++ */ ++typedef enum ++{ ++ MXL_ANALOG_MODE = 0 , ++ MXL_DIGITAL_MODE ++ ++} Tuner_Mode ; ++ ++/** ++ * Enumeration of MXL5005 Tuner IF Mode ++ */ ++typedef enum ++{ ++ MXL_ZERO_IF = 0 , ++ MXL_LOW_IF ++ ++} Tuner_IF_Mode ; ++ ++/** ++ * Enumeration of MXL5005 Tuner Clock Out Mode ++ */ ++typedef enum ++{ ++ MXL_CLOCK_OUT_DISABLE = 0 , ++ MXL_CLOCK_OUT_ENABLE ++} Tuner_Clock_Out ; ++ ++/** ++ * Enumeration of MXL5005 Tuner Div Out Mode ++ */ ++typedef enum ++{ ++ MXL_DIV_OUT_1 = 0 , ++ MXL_DIV_OUT_4 ++ ++} Tuner_Div_Out ; ++ ++/** ++ * Enumeration of MXL5005 Tuner Pull-up Cap Select Mode ++ */ ++typedef enum ++{ ++ MXL_CAP_SEL_DISABLE = 0 , ++ MXL_CAP_SEL_ENABLE ++ ++} Tuner_Cap_Select ; ++ ++/** ++ * Enumeration of MXL5005 Tuner RSSI Mode ++ */ ++typedef enum ++{ ++ MXL_RSSI_DISABLE = 0 , ++ MXL_RSSI_ENABLE ++ ++} Tuner_RSSI ; ++ ++/** ++ * Enumeration of MXL5005 Tuner Modulation Type ++ */ ++typedef enum ++{ ++ MXL_DEFAULT_MODULATION = 0 , ++ MXL_DVBT, ++ MXL_ATSC, ++ MXL_QAM ++ ++} Tuner_Modu_Type ; ++ ++/** ++ * MXL5005 Tuner Register Struct ++ */ ++typedef struct _TunerReg_struct ++{ ++ WORD Reg_Num ; /** Tuner Register Address */ ++ WORD Reg_Val ; /** Current sofware programmed value waiting to be writen */ ++} TunerReg_struct ; ++ ++/** ++ * MXL5005 Tuner Control Struct ++ */ ++typedef struct _TunerControl_struct { ++/* char Name[40] ; */ /** Control Name */ ++ WORD Ctrl_Num ; /** Control Number */ ++ WORD size ; /** Number of bits to represent Value */ ++ WORD addr[25] ; /** Array of Tuner Register Address for each bit position */ ++ WORD bit[25] ; /** Array of bit position in Register Address for each bit position */ ++ WORD val[25] ; /** Binary representation of Value */ ++} TunerControl_struct ; ++ ++/** ++ * MXL5005 Tuner Struct ++ */ ++typedef struct _Tuner_struct ++{ ++ BYTE Mode ; /** 0: Analog Mode ; 1: Digital Mode */ ++ BYTE IF_Mode ; /** for Analog Mode, 0: zero IF; 1: low IF */ ++ DWORD Chan_Bandwidth ; /** filter channel bandwidth (6, 7, 8) */ ++ DWORD IF_OUT ; /** Desired IF Out Frequency */ ++ WORD IF_OUT_LOAD ; /** IF Out Load Resistor (200/300 Ohms) */ ++ DWORD RF_IN ; /** RF Input Frequency */ ++ DWORD Fxtal ; /** XTAL Frequency */ ++ BYTE AGC_Mode ; /** AGC Mode 0: Dual AGC; 1: Single AGC */ ++ WORD TOP ; /** Value: take over point */ ++ BYTE CLOCK_OUT ; /** 0: turn off clock out; 1: turn on clock out */ ++ BYTE DIV_OUT ; /** 4MHz or 16MHz */ ++ BYTE CAPSELECT ; /** 0: disable On-Chip pulling cap; 1: enable */ ++ BYTE EN_RSSI ; /** 0: disable RSSI; 1: enable RSSI */ ++ BYTE Mod_Type ; /** Modulation Type; */ ++ /** 0 - Default; 1 - DVB-T */ ++ ++ /** Calculated Settings */ ++ DWORD RF_LO ; /** Synth RF LO Frequency */ ++ DWORD IF_LO ; /** Synth IF LO Frequency */ ++ DWORD TG_LO ; /** Synth TG_LO Frequency */ ++ ++ /** Pointers to ControlName Arrays */ ++ WORD Init_Ctrl_Num ; /** Number of INIT Control Names */ ++ TunerControl_struct Init_Ctrl[INITCTRL_NUM] ; /** INIT Control Names Array Pointer */ ++ WORD CH_Ctrl_Num ; /** Number of CH Control Names */ ++ TunerControl_struct CH_Ctrl[CHCTRL_NUM] ; /** CH Control Name Array Pointer */ ++ WORD MXL_Ctrl_Num ; /** Number of MXL Control Names */ ++ TunerControl_struct MXL_Ctrl[MXLCTRL_NUM] ; /** MXL Control Name Array Pointer */ ++ ++ /** Pointer to Tuner Register Array */ ++ WORD TunerRegs_Num ; /** Number of Tuner Registers */ ++ TunerReg_struct TunerRegs[TUNER_REGS_NUM] ; /** Tuner Register Array Pointer */ ++} Tuner_struct ; ++ ++ ++ ++typedef enum ++{ ++ /** ++ * Initialization Control Names ++ */ ++ DN_IQTN_AMP_CUT = 1 , /** 1 */ ++ BB_MODE , /** 2 */ ++ BB_BUF , /** 3 */ ++ BB_BUF_OA , /** 4 */ ++ BB_ALPF_BANDSELECT , /** 5 */ ++ BB_IQSWAP , /** 6 */ ++ BB_DLPF_BANDSEL , /** 7 */ ++ RFSYN_CHP_GAIN , /** 8 */ ++ RFSYN_EN_CHP_HIGAIN , /** 9 */ ++ AGC_IF , /** 10 */ ++ AGC_RF , /** 11 */ ++ IF_DIVVAL , /** 12 */ ++ IF_VCO_BIAS , /** 13 */ ++ CHCAL_INT_MOD_IF , /** 14 */ ++ CHCAL_FRAC_MOD_IF , /** 15 */ ++ DRV_RES_SEL , /** 16 */ ++ I_DRIVER , /** 17 */ ++ EN_AAF , /** 18 */ ++ EN_3P , /** 19 */ ++ EN_AUX_3P , /** 20 */ ++ SEL_AAF_BAND , /** 21 */ ++ SEQ_ENCLK16_CLK_OUT , /** 22 */ ++ SEQ_SEL4_16B , /** 23 */ ++ XTAL_CAPSELECT , /** 24 */ ++ IF_SEL_DBL , /** 25 */ ++ RFSYN_R_DIV , /** 26 */ ++ SEQ_EXTSYNTHCALIF , /** 27 */ ++ SEQ_EXTDCCAL , /** 28 */ ++ AGC_EN_RSSI , /** 29 */ ++ RFA_ENCLKRFAGC , /** 30 */ ++ RFA_RSSI_REFH , /** 31 */ ++ RFA_RSSI_REF , /** 32 */ ++ RFA_RSSI_REFL , /** 33 */ ++ RFA_FLR , /** 34 */ ++ RFA_CEIL , /** 35 */ ++ SEQ_EXTIQFSMPULSE , /** 36 */ ++ OVERRIDE_1 , /** 37 */ ++ BB_INITSTATE_DLPF_TUNE, /** 38 */ ++ /** ++ * Channel Change Control Names ++ */ ++ DN_POLY = 51 , /** 51 */ ++ DN_RFGAIN , /** 52 */ ++ DN_CAP_RFLPF , /** 53 */ ++ DN_EN_VHFUHFBAR , /** 54 */ ++ DN_GAIN_ADJUST , /** 55 */ ++ DN_IQTNBUF_AMP , /** 56 */ ++ DN_IQTNGNBFBIAS_BST , /** 57 */ ++ RFSYN_EN_OUTMUX , /** 58 */ ++ RFSYN_SEL_VCO_OUT , /** 59 */ ++ RFSYN_SEL_VCO_HI , /** 60 */ ++ RFSYN_SEL_DIVM , /** 61 */ ++ RFSYN_RF_DIV_BIAS , /** 62 */ ++ DN_SEL_FREQ , /** 63 */ ++ RFSYN_VCO_BIAS , /** 64 */ ++ CHCAL_INT_MOD_RF , /** 65 */ ++ CHCAL_FRAC_MOD_RF , /** 66 */ ++ RFSYN_LPF_R , /** 67 */ ++ CHCAL_EN_INT_RF , /** 68 */ ++ TG_LO_DIVVAL , /** 69 */ ++ TG_LO_SELVAL , /** 70 */ ++ TG_DIV_VAL , /** 71 */ ++ TG_VCO_BIAS , /** 72 */ ++ SEQ_EXTPOWERUP , /** 73 */ ++ OVERRIDE_2 , /** 74 */ ++ OVERRIDE_3 , /** 75 */ ++ OVERRIDE_4 , /** 76 */ ++ SEQ_FSM_PULSE , /** 77 */ ++ GPIO_4B, /** 78 */ ++ GPIO_3B, /** 79 */ ++ GPIO_4, /** 80 */ ++ GPIO_3, /** 81 */ ++ GPIO_1B, /** 82 */ ++ DAC_A_ENABLE , /** 83 */ ++ DAC_B_ENABLE , /** 84 */ ++ DAC_DIN_A , /** 85 */ ++ DAC_DIN_B , /** 86 */ ++#ifdef _MXL_PRODUCTION ++ RFSYN_EN_DIV, /** 87 */ ++ RFSYN_DIVM, /** 88 */ ++ DN_BYPASS_AGC_I2C /** 89 */ ++#endif ++ ++} MXL5005_ControlName ; +diff --git a/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.c b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.c +new file mode 100644 +index 0000000..1bc1d33 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.c +@@ -0,0 +1,203 @@ ++/** ++ * Maxlinear_MXL5007.cpp ++ * ++ * Interface btw Afa9035 and Mxl5007T ++ */ ++ ++#include "a867_Maxlinear_MXL5007.h" ++#include "a867_Maxlinear_MXL5007_Script.h" ++#include "a867_mxl5007t.h" ++#include "a867_af903x.h" ++ ++//m100 todo MxL5007_TunerConfigS MxL5007_TunerConfig = 0; ++struct mxl5007t_config MxL5007_TunerConfig; ++ ++Dword MXL5007_WriteI2C( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte* pAddress, ++ IN Byte* pData, ++ IN Dword count ++) { ++ Dword error = Error_NO_ERROR; /* Status to be returned */ ++ Byte buffer[25]; ++ //Byte numberOfRegisters = 9; ++ Byte i; ++ ++/** single write */ ++ for (i = 0; i < count; i++) { ++ buffer[0] = *(pAddress + i); ++ buffer[1] = *(pData + i); ++ //buffer[2] = 0xFE; /** Latch CMD request by MXL5005 Confidential Datasheet */ ++ error = Standard_writeTunerRegisters (demodulator, chip, buffer[0], 1, &buffer[1]); ++ if (error){ ++ deb_data("MXL5007_WriteI2C failed"); ++ goto exit; ++ } ++ } ++exit: ++ return (error); ++} ++ ++ ++UINT32 MxL_I2C_Write(UINT8 DeviceAddr, void* pArray, UINT32 ByteCount, struct mxl5007t_config* myTuner) ++{ ++ Dword error = Error_NO_ERROR; /* Status to be returned */ ++ // Byte buffer[25]; ++ // Byte i; ++ Byte* pData; ++ pData = (Byte*)pArray; ++ ++/** single write */ ++ //buffer[2] = 0xFE; /** Latch CMD request by MXL5005 Confidential Datasheet */ ++ if (ByteCount == 1) ++ error = Standard_writeTunerRegisters ((myTuner->demodulator), (myTuner->chip), pData[0], 0, NULL); ++ else if (ByteCount > 1) ++ error = Standard_writeTunerRegisters ((myTuner->demodulator), (myTuner->chip), pData[0], ByteCount - 1, &pData[1]); ++ else ++ { ++ error = Error_INVALID_DATA_LENGTH; ++ deb_data("MxL_I2C_Write:: ByteCount = 0"); ++ } ++ ++ if (error){ ++ deb_data("MxL_I2C_Write failed"); ++ goto exit; ++ } ++ ++exit: ++ return (error); ++} ++ ++ ++UINT32 MxL_I2C_Read(UINT8 DeviceAddr, UINT8 Addr, UINT8* mData, struct mxl5007t_config* myTuner) ++{ ++ Dword error = Error_NO_ERROR; ++ ++ error = Standard_writeTunerRegisters(myTuner->demodulator, myTuner->chip, 0xFB, 1, &Addr); ++ error = Standard_readTunerRegisters (myTuner->demodulator, myTuner->chip, 0xffff, 1, mData); ++ ++ return (error); ++} ++ ++void MxL_Delay(UINT32 mSec) ++{ ++ User_delay(NULL, mSec); ++} ++ ++ ++Dword MXL5007_open ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ Ganymede* ganymede; ++ ganymede = (Ganymede*) demodulator; ++ MxL5007_TunerConfig.demodulator = demodulator; ++ MxL5007_TunerConfig.chip = chip; ++ ++ //MxL5007_TunerConfig.I2C_Addr = MxL_I2C_ADDR_096; // 7-bit address ++ MxL5007_TunerConfig.I2C_Addr = ganymede->tunerDescription->tunerAddress; //Get from tunerDescription ++ ++ //MxL5007_TunerConfig.IF_Freq = MxL_IF_4_57_MHZ; ++ switch( ganymede->tunerDescription->ifFrequency ) { ++ case 4000000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_4_MHZ; break; ++ case 4500000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_4_5_MHZ; break; ++ case 4570000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_4_57_MHZ; break; ++ case 5000000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_5_MHZ; break; ++ case 5380000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_5_38_MHZ; break; ++ case 6000000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_6_MHZ; break; ++ case 6280000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_6_28_MHZ; break; ++ case 9191500: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_9_1915_MHZ; break; ++ case 35250000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_35_25_MHZ; break; ++ case 36150000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_36_15_MHZ; break; ++ case 44000000: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_44_MHZ; break; ++ default: ++ MxL5007_TunerConfig.if_freq_hz = MxL_IF_4_57_MHZ; ++ printk("IF unsupported\n"); ++ break; ++ } ++ ++ //MxL5007_TunerConfig.IF_Spectrum = MxL_NORMAL_IF; ++ if (ganymede->tunerDescription->inversion == True) ++ MxL5007_TunerConfig.invert_if = 1; //Get from tunerDescription ++ else ++ MxL5007_TunerConfig.invert_if = 0; ++ ++ MxL5007_TunerConfig.Mode = MxL_MODE_DVBT; ++ MxL5007_TunerConfig.if_diff_out_level = -8; //Setting for Cable mode only ++ MxL5007_TunerConfig.xtal_freq_hz = MxL_XTAL_24_MHZ; //24Mhz ++ MxL5007_TunerConfig.clk_out_enable = 0; ++ MxL5007_TunerConfig.clk_out_amp = MxL_CLKOUT_AMP_0_94V; ++ ++ if( ganymede->booted ) ++ a867_mxl5007t_attach(&MxL5007_TunerConfig); ++ deb_data("MxL5007 Open"); ++ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword MXL5007_close ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ a867_mxl5007t_release(MxL5007_TunerConfig.state); ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword MXL5007_set ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++) { ++ // Dword status = 0; ++ ++ deb_data("MxL5007 Set"); ++ if( a867_mxl5007t_set_params(MxL5007_TunerConfig.state, (enum mxl5007t_bw_mhz) (bandwidth / 1000), frequency * 1000) ) { ++ deb_data("MxL5007 Set fail"); ++ return (Error_WRITE_TUNER_FAIL); ++ } ++ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword SwPowerCtrlMXL5007( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control /** 0 for power down mode, 1 for normal operation mode */ ++) ++{ ++ return (Error_NO_ERROR); ++} ++ ++ ++ ++TunerDescription tuner_MXL5007 = { ++ MXL5007_open, ++ MXL5007_close, ++ MXL5007_set, ++ MXL5007_scripts, ++ MXL5007_scriptSets, ++ 0xC0, /** tuner i2c address */ ++ 1, /** length of tuner register address */ ++ 4570000, /* ref. mxl5007t.h/mxl5007t_if_freq */ ++ False /** spectrum inverse */ ++}; ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.h b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.h +new file mode 100644 +index 0000000..46f6fb5 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007.h +@@ -0,0 +1,60 @@ ++/** ++ * Maxlinear_MXL5007.h ++ * ++ * Interface btw Afa9035 and Mxl5007T ++ */ ++ ++#ifndef __Maxlinear_MXL5007_H__ ++#define __Maxlinear_MXL5007_H__ ++ ++#include "a867_type.h" ++#include "a867_error.h" ++#include "a867_user.h" ++#include "a867_register.h" ++#include "a867_standard.h" ++#include "a867_mxl5007t.h" ++#include "a867_Common.h" //for Tuner_struct ++typedef unsigned int UINT32; ++typedef unsigned char UINT8; ++ ++extern TunerDescription tuner_MXL5007; ++ ++/** ++ * ++ */ ++ ++UINT32 MxL_I2C_Write(UINT8 DeviceAddr, void* pArray, UINT32 ByteCount, struct mxl5007t_config* myTuner); ++UINT32 MxL_I2C_Read(UINT8 DeviceAddr, UINT8 Addr, UINT8* mData, struct mxl5007t_config* myTuner); ++void MxL_Delay(UINT32 mSec); ++ ++ ++/** ++ * ++ */ ++Dword MXL5007_open ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * ++ */ ++Dword MXL5007_close ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * ++ */ ++Dword MXL5007_set ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++ ++#endif //__Maxlinear_MXL5007_H__ ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007_Script.h b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007_Script.h +new file mode 100644 +index 0000000..c5daff6 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_Maxlinear_MXL5007_Script.h +@@ -0,0 +1,64 @@ ++/** script version */ ++ ++#define MXL5007_ADDRESS 0xC0 ++#define MXL5007_SCRIPTSETLENGTH 0x00000001 ++ ++ ++Word MXL5007_scriptSets[] = { ++ 0x34 ++}; ++ ++ValueSet MXL5007_scripts[] = { ++ {0x0046, 0x04}, ++ {0x0057, 0x00}, ++ {0x0058, 0x01}, ++ {0x005f, 0x00}, ++ {0x0060, 0x00}, ++ {0x006e, 0x01}, ++ {0x0071, 0x0A}, ++ {0x0072, 0x02}, ++ {0x0074, 0x01}, ++ {0x0079, 0x01}, ++ {0x0093, 0x00}, ++ {0x0094, 0x00}, ++ {0x0095, 0x00}, ++ {0x0096, 0x00}, ++ {0x009b, 0x20}, ++ {0x009c, 0x66}, ++ {0x00b3, 0x01}, ++ {0x00c3, 0x0}, ++ {0x00c4, 0x0}, ++ {0x00c7, 0x59}, ++ {0xF007, 0x00}, ++ {0xF00A, 0x1B}, ++ {0xF00B, 0x1B}, ++ {0xF00C, 0x1B}, ++ {0xF00D, 0x1B}, ++ {0xF00E, 0xFF}, ++ {0xF00F, 0x01}, ++ {0xF010, 0x00}, ++ {0xF011, 0x02}, ++ {0xF012, 0xFF}, ++ {0xF013, 0x01}, ++ {0xF014, 0x00}, ++ {0xF015, 0x02}, ++ {0xF01B, 0xEF}, ++ {0xF01C, 0x01}, ++ {0xF01D, 0x0f}, ++ {0xF01E, 0x02}, ++ {0xF01F, 0x6e}, ++ {0xF020, 0x00}, ++ {0xF025, 0xDE}, ++ {0xF026, 0x00}, ++ {0xF027, 0x0A}, ++ {0xF028, 0x03}, ++ {0xF029, 0x6e}, ++ {0xF02A, 0x00}, ++ {0xF047, 0x00}, ++ {0xF054, 0x0}, ++ {0xF055, 0x0}, ++ {0xF077, 0x02}, ++ {0xF14F, 0x02}, ++ {0xF1E6, 0x00}, ++ {0xF163, 0x02}, ++}; +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-core.c b/drivers/media/dvb/dvb-usb/a867_af903x-core.c +new file mode 100644 +index 0000000..8d784b1 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-core.c +@@ -0,0 +1,253 @@ ++#include "a867_af903x.h" ++#include "a867_aver_version.h" ++ ++DEVICE_CONTEXT DC; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) ++DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); ++#endif ++ ++static int map_gpio_by_id(const struct usb_device_id *id, PDEVICE_CONTEXT pdc) ++{ ++ if( id->idProduct == 0xa333 ) { ++ pdc->Map.I2C_SLAVE_ADDR = 0x3A; ++ pdc->Map.RF_SW_HOST = 0; //chip0 ++ pdc->Map.GPIO_UHF_en = p_reg_top_gpioh2_en; ++ pdc->Map.GPIO_UHF_on = p_reg_top_gpioh2_on; ++ pdc->Map.GPIO_UHF_o = p_reg_top_gpioh2_o; ++ pdc->Map.GPIO_VHF_en = p_reg_top_gpioh3_en; ++ pdc->Map.GPIO_VHF_on = p_reg_top_gpioh3_on; ++ pdc->Map.GPIO_VHF_o = p_reg_top_gpioh3_o; ++ pdc->Map.GPIO_WP_en = p_reg_top_gpioh7_en; ++ pdc->Map.GPIO_WP_on = p_reg_top_gpioh7_on; ++ pdc->Map.GPIO_WP_o = p_reg_top_gpioh7_o; ++ pdc->Map.GPIO_OSC_en = p_reg_top_gpioh6_en; ++ pdc->Map.GPIO_OSC_on = p_reg_top_gpioh6_on; ++ pdc->Map.GPIO_OSC_o = p_reg_top_gpioh6_o; ++ pdc->Map.GPIO_TUR1_en = p_reg_top_gpioh11_en; ++ pdc->Map.GPIO_TUR1_on = p_reg_top_gpioh11_on; ++ pdc->Map.GPIO_TUR1_o = p_reg_top_gpioh11_o; ++ pdc->Map.GPIO_TUR2_en = p_reg_top_gpioh12_en; ++ pdc->Map.GPIO_TUR2_on = p_reg_top_gpioh12_on; ++ pdc->Map.GPIO_TUR2_o = p_reg_top_gpioh12_o; ++ pdc->Map.GPIO_DPWR_en = 0xF000; ++ pdc->Map.GPIO_DPWR_on = 0xF000; ++ pdc->Map.GPIO_DPWR_o = 0xF000; ++ pdc->Map.GPIO_DRST_en = 0xF000; ++ pdc->Map.GPIO_DRST_on = 0xF000; ++ pdc->Map.GPIO_DRST_o = 0xF000; ++ pdc->Map.GPIO_STR_en = p_reg_top_gpioh8_en; ++ pdc->Map.GPIO_STR_on = p_reg_top_gpioh8_on; ++ pdc->Map.GPIO_STR_o = p_reg_top_gpioh8_o; ++ pdc->Map.GPIO_STR_i = r_reg_top_gpioh8_i; ++ } ++ else if( id->idProduct == 0xa825 ) { ++ pdc->Map.I2C_SLAVE_ADDR = 0x3E; ++ //pdc->Map.RF_SW_HOST = 1; //chip1 ++ pdc->Map.RF_SW_HOST = 0; //chip0 ++ pdc->Map.GPIO_UHF_en = p_reg_top_gpioh3_en; ++ pdc->Map.GPIO_UHF_on = p_reg_top_gpioh3_on; ++ pdc->Map.GPIO_UHF_o = p_reg_top_gpioh3_o; ++ pdc->Map.GPIO_VHF_en = p_reg_top_gpioh2_en; //When UHF, this pin low ++ pdc->Map.GPIO_VHF_on = p_reg_top_gpioh2_on; ++ pdc->Map.GPIO_VHF_o = p_reg_top_gpioh2_o; ++ pdc->Map.GPIO_WP_en = p_reg_top_gpioh7_en; ++ pdc->Map.GPIO_WP_on = p_reg_top_gpioh7_on; ++ pdc->Map.GPIO_WP_o = p_reg_top_gpioh7_o; ++ pdc->Map.GPIO_OSC_en = p_reg_top_gpioh6_en; //Use GPIO6 for HW test ++ pdc->Map.GPIO_OSC_on = p_reg_top_gpioh6_on; //GPIO8 can't use. ++ pdc->Map.GPIO_OSC_o = p_reg_top_gpioh6_o; ++ pdc->Map.GPIO_TUR1_en = p_reg_top_gpioh11_en; //Use GPIO11,12 will cause hostB fail. ++ pdc->Map.GPIO_TUR1_on = p_reg_top_gpioh11_on; ++ pdc->Map.GPIO_TUR1_o = p_reg_top_gpioh11_o; ++ pdc->Map.GPIO_TUR2_en = p_reg_top_gpioh12_en; ++ pdc->Map.GPIO_TUR2_on = p_reg_top_gpioh12_on; ++ pdc->Map.GPIO_TUR2_o = p_reg_top_gpioh12_o; ++ pdc->Map.GPIO_DPWR_en = p_reg_top_gpioh2_en; ++ pdc->Map.GPIO_DPWR_on = p_reg_top_gpioh2_on; ++ pdc->Map.GPIO_DPWR_o = p_reg_top_gpioh2_o; ++ pdc->Map.GPIO_DRST_en = p_reg_top_gpioh5_en; ++ pdc->Map.GPIO_DRST_on = p_reg_top_gpioh5_on; ++ pdc->Map.GPIO_DRST_o = p_reg_top_gpioh5_o; ++ pdc->Map.GPIO_STR_en = 0xF000; ++ pdc->Map.GPIO_STR_on = 0xF000; ++ pdc->Map.GPIO_STR_o = 0xF000; ++ pdc->Map.GPIO_STR_i = 0xF000; ++ } ++ else if(id->idProduct == 0xa337 ++ || id->idProduct == 0xF337 ++ || id->idProduct == 0x0337 ++ || id->idProduct == 0xa867 ++ || id->idProduct == 0x0867 ++ || id->idProduct == 0x1867) { ++ deb_data("GPIO Mapping : A867\n"); ++ pdc->Map.I2C_SLAVE_ADDR = 0x3A; ++ pdc->Map.RF_SW_HOST = 0; //chip1 ++ pdc->Map.GPIO_UHF_en = 0xF000; ++ pdc->Map.GPIO_UHF_on = 0xF000; ++ pdc->Map.GPIO_UHF_o = 0xF000; ++ pdc->Map.GPIO_VHF_en = 0xF000; ++ pdc->Map.GPIO_VHF_on = 0xF000; ++ pdc->Map.GPIO_VHF_o = 0xF000; ++ pdc->Map.GPIO_WP_en = p_reg_top_gpioh7_en; ++ pdc->Map.GPIO_WP_on = p_reg_top_gpioh7_on; ++ pdc->Map.GPIO_WP_o = p_reg_top_gpioh7_o; ++ pdc->Map.GPIO_OSC_en = 0xF000; ++ pdc->Map.GPIO_OSC_on = 0xF000; ++ pdc->Map.GPIO_OSC_o = 0xF000; ++ pdc->Map.GPIO_TUR1_en = p_reg_top_gpioh6_en; //Use GPIO11,12 will cause hostB fail. ++ pdc->Map.GPIO_TUR1_on = p_reg_top_gpioh6_on; ++ pdc->Map.GPIO_TUR1_o = p_reg_top_gpioh6_o; ++ pdc->Map.GPIO_TUR2_en = p_reg_top_gpioh11_en; ++ pdc->Map.GPIO_TUR2_on = p_reg_top_gpioh11_on; ++ pdc->Map.GPIO_TUR2_o = p_reg_top_gpioh11_o; ++ pdc->Map.GPIO_DPWR_en = 0xF000; ++ pdc->Map.GPIO_DPWR_on = 0xF000; ++ pdc->Map.GPIO_DPWR_o = 0xF000; ++ pdc->Map.GPIO_DRST_en = 0xF000; ++ pdc->Map.GPIO_DRST_on = 0xF000; ++ pdc->Map.GPIO_DRST_o = 0xF000; ++ pdc->Map.GPIO_STR_en = 0xF000; ++ pdc->Map.GPIO_STR_on = 0xF000; ++ pdc->Map.GPIO_STR_o = 0xF000; ++ pdc->Map.GPIO_STR_i = 0xF000; ++ pdc->Map.GPIO_LED_en = p_reg_top_gpioh3_en; ++ pdc->Map.GPIO_LED_on = p_reg_top_gpioh3_on; ++ pdc->Map.GPIO_LED_o = p_reg_top_gpioh3_o; ++ } ++ else { ++ pdc->Map.I2C_SLAVE_ADDR = 0x3E; ++ pdc->Map.RF_SW_HOST = 1; //chip1 ++ pdc->Map.GPIO_UHF_en = p_reg_top_gpioh3_en; ++ pdc->Map.GPIO_UHF_on = p_reg_top_gpioh3_on; ++ pdc->Map.GPIO_UHF_o = p_reg_top_gpioh3_o; ++ pdc->Map.GPIO_VHF_en = p_reg_top_gpioh2_en; //When UHF, this pin low ++ pdc->Map.GPIO_VHF_on = p_reg_top_gpioh2_on; ++ pdc->Map.GPIO_VHF_o = p_reg_top_gpioh2_o; ++ pdc->Map.GPIO_WP_en = p_reg_top_gpioh7_en; ++ pdc->Map.GPIO_WP_on = p_reg_top_gpioh7_on; ++ pdc->Map.GPIO_WP_o = p_reg_top_gpioh7_o; ++ pdc->Map.GPIO_OSC_en = p_reg_top_gpioh6_en; //Use GPIO6 for HW test ++ pdc->Map.GPIO_OSC_on = p_reg_top_gpioh6_on; //GPIO8 can't use. ++ pdc->Map.GPIO_OSC_o = p_reg_top_gpioh6_o; ++ pdc->Map.GPIO_TUR1_en = p_reg_top_gpioh11_en; //Use GPIO11,12 will cause hostB fail. ++ pdc->Map.GPIO_TUR1_on = p_reg_top_gpioh11_on; ++ pdc->Map.GPIO_TUR1_o = p_reg_top_gpioh11_o; ++ pdc->Map.GPIO_TUR2_en = p_reg_top_gpioh12_en; ++ pdc->Map.GPIO_TUR2_on = p_reg_top_gpioh12_on; ++ pdc->Map.GPIO_TUR2_o = p_reg_top_gpioh12_o; ++ pdc->Map.GPIO_DPWR_en = p_reg_top_gpioh2_en; ++ pdc->Map.GPIO_DPWR_on = p_reg_top_gpioh2_on; ++ pdc->Map.GPIO_DPWR_o = p_reg_top_gpioh2_o; ++ pdc->Map.GPIO_DRST_en = p_reg_top_gpioh5_en; ++ pdc->Map.GPIO_DRST_on = p_reg_top_gpioh5_on; ++ pdc->Map.GPIO_DRST_o = p_reg_top_gpioh5_o; ++ pdc->Map.GPIO_STR_en = 0xF000; ++ pdc->Map.GPIO_STR_on = 0xF000; ++ pdc->Map.GPIO_STR_o = 0xF000; ++ pdc->Map.GPIO_STR_i = 0xF000; ++ } ++ return 0; ++} ++ ++static int af903x_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ int retval = -ENOMEM; ++ int i; ++ ++ // init GPIO mappings based on device ++ map_gpio_by_id(id, &DC); ++ ++ deb_data("===af903x usb device pluged in!! ===\n"); ++ retval = Device_init(interface_to_usbdev(intf),intf,&DC, true); ++ if (retval){ ++ if(retval) deb_data("Device_init Fail: 0x%08x\n", retval); ++ } ++ ++ for (i = 0; i < af903x_device_count; i++) { ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) ++ if (dvb_usb_device_init(intf, &af903x_properties[i], THIS_MODULE, NULL, adapter_nr) == 0) ++#else ++ if (dvb_usb_device_init(intf, &af903x_properties[i], THIS_MODULE, NULL) == 0) ++#endif ++ {deb_data("dvb_usb_device_init success!!\n");return 0;} ++ } ++ ++ return -ENOMEM; ++} ++ ++static int af903x_suspend(struct usb_interface *intf, pm_message_t message) ++{ ++ int error; ++ deb_data("Enter %s Function, message=0x%ux\n",__FUNCTION__, message.event); ++ error = DL_ApCtrl(0); ++ if (error) deb_data("DL_ApCtrl error : 0x%x\n", error); ++ ++// If selective suspend is not supported, this must be a S3/S4 suspend, ++// in which case we choose to reboot AF903x so it can work after resuming on EeePC. ++#if !defined(CONFIG_USB_SUSPEND) ++ DL_Reboot(); ++#endif ++ ++ return 0; ++} ++ ++static int af903x_resume(struct usb_interface *intf) ++{ ++ int retval = -ENOMEM; ++ deb_data("Enter %s Function\n",__FUNCTION__); ++ ++ retval = DL_ApCtrl(1); ++ if (retval) deb_data("DL_ApCtrl error : 0x%x\n", retval); ++ ++ retval = Device_init(interface_to_usbdev(intf),intf,&DC, false); ++ if (retval){ ++ if(retval) deb_data("Device_init Fail: 0x%08x\n", retval); ++ } ++ ++ return 0; ++} ++ ++static struct usb_driver af903x_driver = { ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) ++ .owner = THIS_MODULE, ++#endif ++ .name = "dvb-usb-a867", ++ .probe = af903x_probe, ++ .disconnect = dvb_usb_device_exit, ++ .id_table = af903x_usb_id_table, ++ .suspend = af903x_suspend, ++ .resume = af903x_resume, ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22) ++ .reset_resume = af903x_resume, ++#endif ++ .supports_autosuspend = 1, ++}; ++ ++static int __init af903x_module_init(void) ++{ ++ int result; ++ ++ printk("AVerMedia A867 driver module V%s loaded.\n", DRIVER_VER); ++ ++ if ((result = usb_register(&af903x_driver))) { ++ err("usb_register failed. Error number %d",result); ++ return result; ++ } ++ return 0; ++} ++ ++static void __exit af903x_module_exit(void) ++{ ++ usb_deregister(&af903x_driver); ++ printk("AVerMedia A867 driver module V%s unloaded.\n", DRIVER_VER); ++} ++ ++module_init (af903x_module_init); ++module_exit (af903x_module_exit); ++ ++MODULE_AUTHOR("MPD Linux Team"); ++MODULE_DESCRIPTION("AVerMedia A867"); ++MODULE_VERSION(DRIVER_VER); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-devices.c b/drivers/media/dvb/dvb-usb/a867_af903x-devices.c +new file mode 100644 +index 0000000..76fc41b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-devices.c +@@ -0,0 +1,278 @@ ++#include "a867_af903x.h" ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 196608)) ++#define V4L2_REFACTORED_MFE_CODE ++#endif ++ ++int dvb_usb_af903x_hwpid = 1; // enable hw pid filter ++module_param_named(hwpid,dvb_usb_af903x_hwpid, int, 0644); ++MODULE_PARM_DESC(debug, "set hw pid filter.(disable=0, enable=1)" DVB_USB_DEBUG_STATUS); ++ ++//static u16 gSWPIDTable[32]; ++static int gTblUsed = 0; ++ ++static int af903x_download_firmware(struct usb_device *udev, const struct firmware *fw) ++{ ++ int ret=0; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ return ret; ++} ++ ++static int af903x_powerctrl(struct dvb_usb_device *d, int onoff) ++{ ++ ++ int ret; ++ deb_data("- Enter %s Function - %s\n",__FUNCTION__,onoff?"ON":"OFF"); ++ ++ // resume device before DL_ApCtrl(on) ++ if( onoff ) { ++ ret = usb_autopm_get_interface(uintfs); ++ if(ret) { ++ deb_data("%s calling usb_autopm_get_interface failed with %d\n", __FUNCTION__, ret); ++ gTblUsed = 0; ++ ++ return ret; ++ } ++ } ++ ++ ret = DL_ApCtrl(onoff); ++ if(ret) deb_data(" af903x_powerctrl Fail: 0x%04X\n", ret); ++ ++ //suspend device after DL_ApCtrl(off) ++ if( !onoff ) { ++ usb_autopm_put_interface(uintfs); ++ } ++ ++ deb_data("- Exit %s Function - %s, ret=%d\n",__FUNCTION__,onoff?"ON":"OFF", ret); ++ return ret; ++} ++ ++static int af903x_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, ++ struct dvb_usb_device_description **desc, int *cold) ++{ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ *cold = 0; ++ ++ return 0; ++} ++ ++static int af903x_frontend_attach(struct dvb_usb_adapter *adap) ++{ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++#ifdef V4L2_REFACTORED_MFE_CODE ++ adap->fe_adap[0].fe = af903x_attach(1); ++ ++ return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; ++#else ++ adap->fe = af903x_attach(1); ++ ++ return adap->fe == NULL ? -ENODEV : 0; ++#endif ++} ++ ++static int af903x_tuner_attach(struct dvb_usb_adapter *adap) ++{ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++#ifdef V4L2_REFACTORED_MFE_CODE ++ tuner_attach(adap->fe_adap[0].fe); ++#else ++ tuner_attach(adap->fe); ++#endif ++ return 0; ++} ++ ++static int af903x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ++{ ++ deb_data("- Enter %s Function - (%d) streaming state for %d\n",__FUNCTION__,onoff, adap->id); ++ ++ ++ return 0; ++} ++ ++static int af903x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) ++{ ++ int ret =0; ++ deb_data("%s: onoff:%d\n", __func__, onoff); ++ ++ if (!onoff){ ++ deb_data(" Reset PID Table\n"); ++ DL_ResetPID(); ++ PDC->fc[adap->id].ulcPIDs = 0; ++ memset(PDC->fc[adap->id].aulPIDs, 0, sizeof(FILTER_INFO)); ++ } ++ PDC->fc[adap->id].bEnPID = onoff; ++ ret = DL_PIDOnOff(PDC->fc[adap->id].bEnPID); ++ ++ deb_data(" set pid onoff ok\n"); ++ return ret; ++} ++ ++ ++static int af903x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pidnum, ++ int onoff) ++{ ++// if (down_interruptible (&my_sem)) ++// return -ERESTARTSYS; ++ ++ int ret = 0; ++ Pid pid; ++ deb_data("- %s: set pid filter, index %d, pid %d, onoff %d.\n", ++ __func__, index, pidnum, onoff); ++ ++ ++ if (onoff) { //add filter to table ++ PDC->fc[adap->id].aulPIDs[index].filternum = pidnum; ++ if (!PDC->fc[adap->id].aulPIDs[index].onoff ){ ++ PDC->fc[adap->id].aulPIDs[index].onoff = true; ++ PDC->fc[adap->id].ulcPIDs ++; ++ } ++ } ++ else{ //del filter from table ++ PDC->fc[adap->id].aulPIDs[index].filternum = 0; ++ if (PDC->fc[adap->id].aulPIDs[index].onoff ){ ++ PDC->fc[adap->id].aulPIDs[index].onoff = false; ++ PDC->fc[adap->id].ulcPIDs --; ++ } ++ } ++ ++ if (onoff) { ++ /* cannot use it as pid_filter_ctrl since it has to be done ++ * before setting the first pid */ ++ if (adap->feedcount == 1) { ++ deb_data(" first pid set, enable pid table\n"); ++ ++ pid.sectionType = SectionType_TABLE; ++ pid.table = 0x00; ++ pid.duration = 0xFF; ++ ++ ret = af903x_pid_filter_ctrl(adap, onoff); ++ if (ret) ++ return ret; ++ } ++ pid.value = (Word)pidnum; ++ ret = DL_AddPID(index, pid); ++ if (ret) ++ return ret; ++ ++ } ++ else{ ++ ++ pid.value = (Word)pidnum; ++ ret = DL_RemovePID(index, pid); ++ if (ret) ++ return ret; ++ ++ if (adap->feedcount == 0) { ++ deb_data(" last pid unset, disable pid table\n"); ++ ret = af903x_pid_filter_ctrl(adap, onoff); ++ if (ret) ++ return ret; ++ } ++ ++ } ++ ++ deb_data(" set pid ok, total pid num :%d\n", PDC->fc[adap->id].ulcPIDs); ++ ++ msleep(100); ++ ++// up(&my_sem); ++ return 0; ++} ++ ++ ++struct usb_device_id af903x_usb_id_table[] = { ++ { USB_DEVICE(0x07ca,0xa333) }, ++ { USB_DEVICE(0x07ca,0xb867) }, ++ { USB_DEVICE(0x07ca,0x1867) }, ++ { USB_DEVICE(0x07ca,0x0337) }, ++ { USB_DEVICE(0x07ca,0xa867) }, ++ { USB_DEVICE(0x07ca,0x0867) }, ++ { USB_DEVICE(0x07ca,0xF337) }, ++ { USB_DEVICE(0x07ca,0x3867) }, ++#if SUPPORT_AF903X_EVB ++ { USB_DEVICE(0x15A4,0x1000) }, ++ { USB_DEVICE(0x15A4,0x1001) }, ++ { USB_DEVICE(0x15A4,0x1002) }, ++ { USB_DEVICE(0x15A4,0x1003) }, ++ { USB_DEVICE(0x15A4,0x9035) }, ++#endif //SUPPORT_AF903X_EVB ++ { 0 } /* Terminating entry */ ++}; ++MODULE_DEVICE_TABLE(usb, af903x_usb_id_table); ++ ++struct dvb_usb_device_properties af903x_properties[] = { ++ { ++ .usb_ctrl = DEVICE_SPECIFIC, ++ .download_firmware = af903x_download_firmware, ++ .no_reconnect = 1, ++ .power_ctrl = af903x_powerctrl, ++ .identify_state = af903x_identify_state, ++ ++ .num_adapters = 1, ++ .adapter = { ++ { ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++#if ENABLE_HW_PID ++ .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, ++#else ++ .caps = DVB_USB_ADAP_HAS_PID_FILTER, ++#endif ++ .pid_filter_count = 32, ++ .frontend_attach = af903x_frontend_attach, ++ .tuner_attach = af903x_tuner_attach, ++ .streaming_ctrl = af903x_streaming_ctrl, ++ .pid_filter_ctrl = af903x_pid_filter_ctrl, ++ .pid_filter = af903x_pid_filter, ++ ++ .stream = { ++ .type = USB_BULK, ++ .count = 10, ++ .endpoint = 0x84, ++ .u = { ++ .bulk = { ++ .buffersize = (188 * TS_PACKET_COUNT), ++ } ++ } ++ } ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ }, ++ }, ++#if 0 ++ .num_device_descs = 1, ++#else ++ .num_device_descs = 2, ++#endif ++ .devices = { ++ { "AVerMedia A333 DVB-T Recevier", ++ { &af903x_usb_id_table[0] ++ ,&af903x_usb_id_table[1] ++#if SUPPORT_AF903X_EVB ++ ,&af903x_usb_id_table[7] ++ ,&af903x_usb_id_table[8] ++#endif //SUPPORT_AF903X_EVB ++ }, ++ ++ { NULL }, ++ }, ++ { "AVerMedia A867 DVB-T Recevier", ++ { &af903x_usb_id_table[2] ++ ,&af903x_usb_id_table[3] ++ ,&af903x_usb_id_table[4] ++ ,&af903x_usb_id_table[5] ++ ,&af903x_usb_id_table[6] ++ ,&af903x_usb_id_table[7] ++ }, ++ ++ { NULL }, ++ } ++ } ++ } ++}; ++ ++int af903x_device_count = ARRAY_SIZE(af903x_properties); +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-drv.c b/drivers/media/dvb/dvb-usb/a867_af903x-drv.c +new file mode 100644 +index 0000000..3a030a8 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-drv.c +@@ -0,0 +1,1238 @@ ++#include "a867_af903x.h" ++//#include "a867_firmware.h" ++#include "a867_ofdm.h" ++ ++#define true 1 ++#define false 0 ++ ++#define FW_VER 0x08060000 ++int dvb_usb_af903x_debug = 0; // disable all level by default ++module_param_named(debug,dvb_usb_af903x_debug, int, 0644); ++MODULE_PARM_DESC(debug, "set debugging level (info=1, deb_fw=2, deb_fwdata=4, deb_data=8 (or-able)), default=0"); ++ ++int dvb_usb_af903x_snrdb = 0; // output SNR 16bit format ++module_param_named(snrdb,dvb_usb_af903x_snrdb, int, 0644); ++MODULE_PARM_DESC(snrdb, "set SNR format (16bit=0, dB decibel=1), default=0"); ++ ++struct usb_device *udevs = NULL; ++struct usb_interface *uintfs = NULL; ++PDEVICE_CONTEXT PDC; ++ ++ ++//************** DRV_ *************// ++ ++static DWORD DRV_ResetPID( ++ IN void* handle, ++ IN BYTE ucSlaveDemod) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ //Clear pidTable ++ dwError = Demodulator_resetPid ((Demodulator*) &pdc->Demodulator, ucSlaveDemod); ++ ++ return dwError; ++} ++ ++static DWORD DRV_PIDOnOff( ++ void *handle, ++ BYTE ucSlaveDemod, ++ DWORD dwOnOff) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ if(dwOnOff) ++ { ++ dwError = Demodulator_controlPidFilter ((Demodulator*) &pdc->Demodulator, ucSlaveDemod, 1); ++ } ++ else ++ { ++ dwError = Demodulator_controlPidFilter ((Demodulator*) &pdc->Demodulator, ucSlaveDemod, 0); ++ } ++ ++ return dwError; ++} ++ ++static DWORD DRV_AddPID( ++ void *handle, ++ BYTE ucSlaveDemod, ++ DWORD index, ++ Pid pid) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ dwError = Demodulator_addPidToFilter ((Demodulator*) &pdc->Demodulator, ucSlaveDemod,index, pid); ++ ++ return dwError; ++} ++ ++DWORD DRV_RemovePID( ++ IN void* handle, ++ IN BYTE ucSlaveDemod, ++ IN Byte index, ++ IN Pid pid ++) ++{ ++// deb_data("- Enter %s Function - , index:%d, pid:%x \n",__FUNCTION__, index, pid.value); ++ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ dwError = Demodulator_removePidAt ((Demodulator*) &pdc->Demodulator, ucSlaveDemod,index, pid); ++ ++ return(dwError); ++ ++} ++ ++ ++ ++static DWORD DRV_IrTblDownload(IN void * handle) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ struct file *filp; ++ unsigned char b_buf[512] ; ++ int i, fileSize; ++ mm_segment_t oldfs; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ oldfs=get_fs(); ++ set_fs(KERNEL_DS); ++ ++ filp=filp_open("/lib/firmware/af35irtbl.bin", O_RDWR,0644); ++ if ( IS_ERR(filp) ) { ++ deb_data(" LoadIrTable : Can't open file\n");goto exit;} ++ ++ if ( (filp->f_op) == NULL ) { ++ deb_data(" LoadIrTable : File Operation Method Error!!\n");goto exit;} ++ ++ filp->f_pos=0x00; ++ fileSize = filp->f_op->read(filp,b_buf,sizeof(b_buf),&filp->f_pos); ++ ++ for(i=0; iDemodulator, (Word)fileSize, b_buf); ++ if (dwError) {deb_data("Demodulator_loadIrTable fail"); goto exit;} ++ ++ filp_close(filp, NULL); ++ set_fs(oldfs); ++ ++ return (dwError); ++exit: ++ deb_data("LoadIrTable fail!\n"); ++ return dwError; ++ ++} ++ ++static DWORD DRV_GetEEPROMConfig2( ++ void * handle, ++ BYTE ucSlaveDemod) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ tWORD shift = 0; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ BYTE btmp = 0; ++ ++ deb_data("- Enter %s Function -",__FUNCTION__); ++ ++ if(ucSlaveDemod) shift = EEPROM_SHIFT; ++ ++ dwError = Demodulator_readRegisters((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, EEPROM_TUNERID+shift, 1, &btmp); ++ if (dwError) goto exit; ++ deb_data("EEPROM_TUNERID%d = 0x%02X\n", ucSlaveDemod, btmp); ++ PTI.TunerId = btmp; ++ ++exit: ++ ++ return(dwError); ++} ++ ++static DWORD DRV_SetFreqBw( ++ void* handle, ++ BYTE ucSlaveDemod, ++ DWORD dwFreq, ++ WORD ucBw ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ //Bool bLock = true; ++ ++ deb_data("- Enter %s Function -\n ",__FUNCTION__); ++ deb_data(" ucSlaveDemod = %d, Freq= %d, BW=%d\n", ucSlaveDemod, dwFreq, ucBw); ++ ++ if (pdc->fc[ucSlaveDemod].bEnPID) ++ { ++ deb_data(" Reset HW PID table\n "); ++ //Disable PID filter ++ Demodulator_writeRegisterBits ((Demodulator*) &pdc->Demodulator, ucSlaveDemod, Processor_OFDM, p_mp2if_pid_en, mp2if_pid_en_pos, mp2if_pid_en_len, 0); ++ ++ } ++ ++ down(&PDC->tunerLock); ++ ++ PDC->fc[0].AVerFlags &= ~(0x08); ++ PDC->fc[0].AVerFlags |= 0x04; ++ PTI.bSettingFreq = true; //before acquireChannel, it is ture; otherwise, it is false ++ ++ if(dwFreq) { ++ pdc->fc[ucSlaveDemod].ulDesiredFrequency = dwFreq; ++ } ++ else { ++ dwFreq = pdc->fc[ucSlaveDemod].ulDesiredFrequency; ++ } ++ ++ if(ucBw) { ++ pdc->fc[ucSlaveDemod].ucDesiredBandWidth = ucBw*1000; ++ } ++ else { ++ ucBw = pdc->fc[ucSlaveDemod].ucDesiredBandWidth; ++ } ++ ++ deb_data("Real Freq= %d, BW=%d\n", pdc->fc[ucSlaveDemod].ulDesiredFrequency, pdc->fc[ucSlaveDemod].ucDesiredBandWidth); ++ ++ ++ if(!PTI.bTunerInited){ ++ deb_data(" Skip SetFreq - Tuner is still off!\n"); ++ goto exit; ++ } ++ ++ PTI.bTunerOK = false; ++ ++ if (pdc->fc[ucSlaveDemod].ulDesiredFrequency!=0 && pdc->fc[ucSlaveDemod].ucDesiredBandWidth!=0) ++ { ++ deb_data("AcquireChannel : Real Freq= %d, BW=%d\n", pdc->fc[ucSlaveDemod].ulDesiredFrequency, pdc->fc[ucSlaveDemod].ucDesiredBandWidth); ++ dwError = Demodulator_acquireChannel ((Demodulator*) &pdc->Demodulator, ucSlaveDemod, pdc->fc[ucSlaveDemod].ucDesiredBandWidth, pdc->fc[ucSlaveDemod].ulDesiredFrequency); ++ //PTI.bSettingFreq = false; ++ if (dwError) ++ { ++ deb_data("Demod_acquireChannel fail! 0x%08x\n", dwError); ++ goto exit; ++ } ++ else //when success acquireChannel, record currentFreq/currentBW. ++ { ++ pdc->fc[ucSlaveDemod].ulCurrentFrequency = pdc->fc[ucSlaveDemod].ulDesiredFrequency; ++ pdc->fc[ucSlaveDemod].ucCurrentBandWidth = pdc->fc[ucSlaveDemod].ucDesiredBandWidth; ++ } ++ } ++ else { ++ deb_data("Demod_acquireChannel skipped\n"); ++ } ++ ++ if(pdc->StreamType == StreamType_DVBT_DATAGRAM) { ++ PDC->fc[ucSlaveDemod].OvrFlwChk = CHECK_LOCK_LOOPS ; ++ PDC->fc[ucSlaveDemod].UnLockCount = 0; ++ } ++ ++ PTI.bTunerOK = true; ++ ++exit: ++ ++ PTI.bSettingFreq = false; ++ up(&PDC->tunerLock); ++ ++ return(dwError); ++} ++ ++static DWORD DRV_getFirmwareVersionFromFile( ++ Processor processor, ++ DWORD* version ++) ++{ ++ DWORD OFDM_VER1 = DVB_OFDM_VERSION1; ++ DWORD OFDM_VER2 = DVB_OFDM_VERSION2; ++ DWORD OFDM_VER3 = DVB_OFDM_VERSION3; ++ DWORD OFDM_VER4 = DVB_OFDM_VERSION4; ++ ++ DWORD LINK_VER1 = DVB_LL_VERSION1; ++ DWORD LINK_VER2 = DVB_LL_VERSION2; ++ DWORD LINK_VER3 = DVB_LL_VERSION3; ++ DWORD LINK_VER4 = DVB_LL_VERSION4; ++ ++ if(processor == Processor_OFDM) { ++ *version = (DWORD)( (OFDM_VER1 << 24) + (OFDM_VER2 << 16) + (OFDM_VER3 << 8) + OFDM_VER4); ++ } ++ else { //LINK ++ *version = (DWORD)( (LINK_VER1 << 24) + (LINK_VER2 << 16) + (LINK_VER3 << 8) + LINK_VER4); ++ } ++ ++ return *version; ++} ++ ++static DWORD DRV_Initialize( ++ void * handle ++) ++{ ++ DWORD error = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ DWORD fileVersion, cmdVersion = 0; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ if(pdc->Demodulator.booted) //from Standard_setBusTuner() > Standard_getFirmwareVersion() ++ { ++ //use "#define version" to get fw version (from firmware.h title) ++ error = DRV_getFirmwareVersionFromFile(Processor_OFDM, &fileVersion); ++ ++ //use "Command_QUERYINFO" to get fw version ++ error = Demodulator_getFirmwareVersion((Demodulator*) &pdc->Demodulator, Processor_OFDM, &cmdVersion); ++ if(error) deb_data("DRV_Initialize : Demodulator_getFirmwareVersion : error = 0x%08x\n", error); ++ ++ if(cmdVersion != fileVersion) ++ { ++ deb_data("Reboot: Outside Fw = 0x%X, Inside Fw = 0x%X", fileVersion, cmdVersion); ++ error = Demodulator_reboot((Demodulator*) &pdc->Demodulator); ++ pdc->bBootCode = true; ++ if(error) ++ { ++ deb_data("Demodulator_reboot : error = 0x%08x\n", error); ++ return error; ++ } ++ else { ++ return Error_NOT_READY; ++ } ++ } ++ else ++ { ++ deb_data(" Fw version is the same!\n"); ++ error = Error_NO_ERROR; ++ } ++ }//pdc->Demodulator.booted ++ ++ReInit: //Patch for NIM fail or disappear, Maggie ++ error = Demodulator_initialize ((Demodulator*) &pdc->Demodulator, pdc->Demodulator.chipNumber , 8000, pdc->StreamType, pdc->architecture); ++ if (error) ++ { ++ deb_data("Device initialize fail : 0x%08x\n", error); ++ if( ((error&Error_FIRMWARE_STATUS) && (error&0x10)) && (pdc->Demodulator.chipNumber>1) ) ++ { ++ pdc->Demodulator.cmdDescription->sendCommand ((Demodulator*) &pdc->Demodulator, Command_FW_DOWNLOAD_END, 0, Processor_LINK, 0, NULL, 0, NULL); ++ ++ deb_data(" Retry to download FW with Single TS\n"); ++ pdc->Demodulator.chipNumber = 1; ++ pdc->bDualTs = false; ++ error = Demodulator_writeRegister ((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, 0x417F, 0); ++ goto ReInit; ++ } ++ } ++ else { ++ deb_data(" Device initialize Ok!!\n"); ++ } ++ ++ error = Demodulator_writeRegisterBits ((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, ++ p_reg_usb_min_len, reg_usb_min_len_pos, reg_usb_min_len_len, 1); ++ ++ Demodulator_getFirmwareVersion ((Demodulator*) &pdc->Demodulator, Processor_OFDM, &cmdVersion); ++ deb_data(" FwVer OFDM = 0x%X, ", cmdVersion); ++ Demodulator_getFirmwareVersion ((Demodulator*) &pdc->Demodulator, Processor_LINK, &cmdVersion); ++ deb_data("FwVer LINK = 0x%X\n", cmdVersion); ++ ++ return error; ++ ++} ++ ++static DWORD DRV_InitDevInfo( ++ void * handle, ++ BYTE ucSlaveDemod ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDC->fc[ucSlaveDemod].ulCurrentFrequency = 0; ++ PDC->fc[ucSlaveDemod].ucCurrentBandWidth = 0; ++ ++ PDC->fc[ucSlaveDemod].ulDesiredFrequency = 0; ++ PDC->fc[ucSlaveDemod].ucDesiredBandWidth = 6000; ++ ++ //For PID Filter Setting ++ //PDC->fc[ucSlaveDemod].ulcPIDs = 0; ++ PDC->fc[ucSlaveDemod].bEnPID = true; ++ PDC->fc[ucSlaveDemod].bApOn = false; ++ PDC->fc[ucSlaveDemod].bResetTs = false; ++ ++ PTI.bTunerOK = false; ++ PTI.bSettingFreq = false; ++ ++ return dwError; ++} ++ ++static DWORD DRV_GetEEPROMConfig( ++ void * handle) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ BYTE ucSlaveDemod = 0; ++ BYTE btmp = 0; ++ ++ deb_data("- Enter %s Function -",__FUNCTION__); ++ ++ //bIrTblDownload option ++ dwError = Demodulator_readRegisters((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, EEPROM_IRMODE, 1, &btmp); ++ if (dwError) return(dwError); ++ PDC->bIrTblDownload = btmp ? true:false; ++ deb_data( "EEPROM_IRMODE = 0x%02X, ", btmp); ++ deb_data("bIrTblDownload %s\n", PDC->bIrTblDownload?"ON":"OFF"); ++ ++ PDC->bDualTs = false; ++ PDC->architecture = Architecture_DCA; ++ PDC->Demodulator.chipNumber = 1; ++ PDC->bDCAPIP = false; ++ ++ ++ dwError = DRV_GetEEPROMConfig2(pdc, ucSlaveDemod); ++ if (dwError) return(dwError); ++ dwError = DRV_InitDevInfo(pdc, ucSlaveDemod); ++ ++ return(dwError); ++} ++ ++static DWORD DRV_SetBusTuner( ++ void * handle, ++ Word busId, ++ Word tunerId ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ DWORD version = 0; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ deb_data("- Enter %s Function -",__FUNCTION__); ++ deb_data("busId = 0x%x, tunerId =0x%x\n", busId, tunerId); ++ ++ if ((pdc->UsbMode==0x0110) && (busId==Bus_USB)) { ++ busId=Bus_USB11; ++ } ++ ++ dwError = Demodulator_setBusTuner ((Demodulator*) &pdc->Demodulator, busId, tunerId); ++ if (dwError) {deb_data("Demodulator_setBusTuner error\n");return dwError;} ++ dwError = Demodulator_getFirmwareVersion ((Demodulator*) &pdc->Demodulator, Processor_LINK, &version); ++ if (version != 0) { ++ pdc->Demodulator.booted = True; ++ } ++ else { ++ pdc->Demodulator.booted = False; ++ } ++ return(dwError); ++} ++ ++ ++DWORD A333TunerPowerControl( ++ PDEVICE_CONTEXT pdc, ++ BYTE ucSlaveDemod, ++ bool bPowerOn ++) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ ++ if(bPowerOn) ++ PTI.bTunerInited = true; ++ else ++ PTI.bTunerInited = false; ++ ++ //control oscilator ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_OSC_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_OSC_on, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_OSC_o, 1); ++ ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR1_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR1_on, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR1_o, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR2_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR2_on, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR2_o, 1); ++ ++ if(bPowerOn) ++ { ++ dwError=Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_OSC_o, 1); ++ dwError=Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR1_o, 1); ++ dwError=Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR2_o, 1); ++ if(pdc->bTunerPowerOff == true) ++ { ++ dwError = Demodulator_initialize ((Demodulator*) &pdc->Demodulator, pdc->Demodulator.chipNumber, ++ pdc->Demodulator.bandwidth[0], pdc->StreamType, pdc->architecture); ++ pdc->bTunerPowerOff = false; ++ } ++ ++ } ++ else ++ { // power off ++ ++ if(pdc->architecture == Architecture_PIP) ++ { ++ if(pdc->fc[0].tunerinfo.bTunerInited == 0 && pdc->fc[1].tunerinfo.bTunerInited == 0) ++ { ++ if(pdc->bTunerPowerOff == false) ++ { ++ dwError = Demodulator_finalize((Demodulator*) &pdc->Demodulator); ++ pdc->bTunerPowerOff = true; ++ } ++ dwError = Demodulator_writeRegister((Demodulator*)&PDC->Demodulator,0,Processor_LINK,PDC->Map.GPIO_TUR1_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*)&PDC->Demodulator,0,Processor_LINK,PDC->Map.GPIO_TUR2_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*)&PDC->Demodulator,0,Processor_LINK,PDC->Map.GPIO_OSC_o, 0); ++ } ++ } ++ else ++ { ++ if(pdc->bTunerPowerOff == false) ++ { ++ dwError = Demodulator_finalize((Demodulator*) &pdc->Demodulator); ++ pdc->bTunerPowerOff = true; ++ } ++ ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR1_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_TUR2_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_OSC_o, 0); ++ } ++ } ++ ++ return dwError; ++} ++ ++DWORD A337TunerPowerControl( ++ PDEVICE_CONTEXT pdc, ++ BYTE ucSlaveDemod, ++ bool bPowerOn ++) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ ++ if(bPowerOn) ++ PTI.bTunerInited = true; ++ else ++ PTI.bTunerInited = false; ++ ++ if(bPowerOn) //tuner on ++ { ++ if(pdc->bTunerPowerOff == true) ++ { ++ //use variable to control gpio ++ ++ // enable tuner power ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_on, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_on, 1); ++ ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_o, 1); ++ mdelay(100); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_o, 1); ++ mdelay(100); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_en, 1); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_on, 1); ++ ++ ++ // reset tuner ++ deb_data("A337 reset"); ++ mdelay(10); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_o, 0); ++ mdelay(30); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_o, 1); ++ ++ mdelay(300); ++ deb_data("pdc->bTunerPowerOff == true\n"); ++ dwError = Demodulator_initialize ((Demodulator*) &pdc->Demodulator, pdc->Demodulator.chipNumber , pdc->Demodulator.bandwidth[0], pdc->StreamType, pdc->architecture); ++ pdc->bTunerPowerOff = false; ++ } ++ } ++ else //tuner off ++ { ++ // Bugfix: wrong level of tuner i2c whiling plugging in device. ++ dwError = Demodulator_finalize((Demodulator*) &pdc->Demodulator); ++ if(pdc->bTunerPowerOff == false) ++ { ++ pdc->bTunerPowerOff = true; ++ ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_en, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh12_on, 0); ++ mdelay(10); ++ ++ // disable tuner power ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_o, 0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_en,0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR1_on,0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_en,0); ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, pdc->Map.GPIO_TUR2_on,0); ++ } ++ } ++ ++ return dwError; ++} ++ ++ ++static DWORD DRV_TunerPowerCtrl( ++ void * handle, ++ BYTE ucSlaveDemod, ++ bool bPowerOn ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ deb_data("- Enter %s Function , bPowerOn=%d -\n",__FUNCTION__, bPowerOn); ++ ++ deb_data("Detected tuner ID: 0x%x\n", pdc->fc[0].tunerinfo.TunerId); ++ ++ switch(PDC->idProduct) ++ { ++ case 0xa337: //A337 ++ case 0x0337: //A867 ++ case 0xa867: //A867 ++ case 0x0867: ++ case 0x1867: ++ case 0xF337: ++ dwError = A337TunerPowerControl(pdc, ucSlaveDemod, bPowerOn); ++ break; ++ case 0xa333: //A337 & EVB ++ default: ++ dwError = A333TunerPowerControl(pdc, ucSlaveDemod, bPowerOn); ++ } ++ ++ return dwError; ++} ++ ++static DWORD DRV_ApCtrl ( ++ void * handle, ++ Byte ucSlaveDemod, ++ Bool bOn ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ ++ deb_data("enter DRV_ApCtrl: ucSlaveDemod = %d, bOn = %s\n", ucSlaveDemod, bOn?"ON":"OFF"); ++ ++ //deb_data("enter DRV_ApCtrl: Demod[%d].GraphBuilt = %d", ucSlaveDemod, pdc->fc[ucSlaveDemod].GraphBuilt); ++ ++ Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_LED_en, 1); ++ Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_LED_on, 1); ++ Demodulator_writeRegister((Demodulator*) &PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_LED_o, bOn?1:0); ++ ++ ++ dwError = DRV_TunerPowerCtrl(handle, ucSlaveDemod, bOn); ++ if(dwError) deb_data("DRV_TunerPowerCtrl Fail: 0x%08x\n", dwError); ++ ++ ++ dwError = Demodulator_controlPowerSaving((Demodulator*) &pdc->Demodulator, ucSlaveDemod, bOn); ++ if(dwError) deb_data("DRV_ApCtrl: Demodulator_controlPowerSaving error = 0x%08x\n", dwError); ++ ++ return(dwError); ++} ++ ++ ++static DWORD DRV_TunerWakeup( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT) handle; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ //tuner power on ++ dwError = Demodulator_writeRegisterBits((Demodulator*) &pdc->Demodulator, 0, Processor_LINK, p_reg_top_gpioh7_o, reg_top_gpioh7_o_pos, reg_top_gpioh7_o_len, 1); ++ ++ return(dwError); ++ ++} ++ ++static DWORD DRV_Reboot( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT) handle; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Demodulator_reboot((Demodulator*) &pdc->Demodulator); ++ ++ return(dwError); ++} ++//s021+e ++ ++static DWORD DRV_IsPsbOverflow( ++ void * handle, ++ Byte ucSlaveDemod, ++ Bool *bPsbOverflow ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ Byte ucValue; ++ PDEVICE_CONTEXT pdc = (PDEVICE_CONTEXT)handle; ++ Bool PsbOverflow; ++ ++ deb_data("enter %s: - \n", __FUNCTION__); ++ ++ if( ucSlaveDemod ) { //13 ++ dwError = Demodulator_readRegister((Demodulator*) &pdc->Demodulator, 0, Processor_OFDM, p_reg_sys_buf_overflow, &ucValue); ++ if( dwError ) goto exit; ++ ++ PsbOverflow = (ucValue&0x01)? 1:0; ++ if( PsbOverflow ) { ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_OFDM, p_reg_sys_buf_overflow, ucValue&(~0x01)); ++ if( dwError ) goto exit; ++ } ++ } ++ else { //15 ++ dwError = Demodulator_readRegister((Demodulator*) &pdc->Demodulator, 0, Processor_OFDM, p_mp2if_psb_overflow, &ucValue); ++ if( dwError ) goto exit; ++ ++ PsbOverflow = (ucValue&0x01)? 1:0; ++ if( PsbOverflow ) { ++ dwError = Demodulator_writeRegister((Demodulator*) &pdc->Demodulator, 0, Processor_OFDM, p_mp2if_psb_overflow, ucValue&(~0x01)); ++ if( dwError ) goto exit; ++ } ++ } ++ ++ if( bPsbOverflow ) *bPsbOverflow = PsbOverflow; ++exit: ++ return dwError; ++} ++ ++//************** DL_ *************// ++// ++DWORD DL_ResetPID(void) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_ResetPID(PDC, 0); ++ ++ return dwError; ++} ++ ++DWORD DL_AddPID(BYTE index, Pid pid) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_AddPID(PDC, 0, index, pid); ++ ++ return dwError; ++} ++ ++DWORD DL_PIDOnOff(DWORD OnOff) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_PIDOnOff(PDC, 0, OnOff); ++ ++ return dwError; ++} ++ ++DWORD DL_RemovePID( ++ IN Byte index, ++ IN Pid pid ++) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_RemovePID(PDC, 0, index, pid); ++ ++ return(dwError); ++} ++ ++ ++DWORD DL_IsPsbOverflow( ++ void * handle, ++ Byte ucSlaveDemod, ++ Bool * bPsbOverflow ++) ++{ ++ DWORD dwError = DRV_IsPsbOverflow(handle, ucSlaveDemod, bPsbOverflow); ++ return dwError; ++} ++ ++ ++DWORD DL_MonitorReception(Bool *lock) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ Bool bLock = False; ++ ChannelStatistic stat; ++ ++ deb_data("- Enter %s Function , OvrFlwChk=%d, UnLockCount=%d-\n",__FUNCTION__, ++ PDC->fc[ucSlaveDemod].OvrFlwChk, ++ PDC->fc[ucSlaveDemod].UnLockCount); ++ ++ down(&PDC->tunerLock); ++ ++ if( PDC->fc[ucSlaveDemod].ulDesiredFrequency==0 || PDC->fc[ucSlaveDemod].ucDesiredBandWidth==0 ) { ++ if( lock ) *lock = False; ++ deb_data("- %s Function skipping\n",__FUNCTION__); ++ goto exit; ++ } ++ ++ // check lock status ++ dwError= Demodulator_isLocked((Demodulator*) &PDC->Demodulator, ucSlaveDemod, &bLock); ++ if( dwError!=Error_NO_ERROR ) { ++ goto exit; ++ } ++ ++ // consider as unlock if UBC is not zero ++ dwError = Demodulator_getChannelStatistic((Demodulator*) &PDC->Demodulator, ucSlaveDemod, &stat); ++ if( dwError!=Error_NO_ERROR ) { ++ goto exit; ++ } ++ ++//uncomment this because this causes instability in channel scan. ++ ++ ++ // report lock status ++ if( lock ) *lock = bLock; ++ deb_data("- %s Function, LOCK = %d\n", __FUNCTION__, bLock); ++ ++ // stop monitoring ++ if(PDC->fc[ucSlaveDemod].OvrFlwChk<1) { ++ deb_data("- %s Function end of monitor cycle -\n",__FUNCTION__); ++ ++ // if lock is lost for a while, try to reacquire channel ++ if( PDC->fc[ucSlaveDemod].UnLockCount >= CHECK_LOCK_LOOPS*2/3) { ++ WORD bw = PDC->fc[ucSlaveDemod].ucDesiredBandWidth; ++ DWORD freq = PDC->fc[ucSlaveDemod].ulDesiredFrequency; ++ ++ ++ deb_data("- %s Function need to reacquire channel, freq=%d, bw=%d-\n",__FUNCTION__, ++ freq, bw); ++ ++ // reacquire channel ++ // first power off, then power on ++ DRV_ApCtrl (PDC, 0, 0); ++ User_delay(0, 500); ++ DRV_ApCtrl (PDC, 0, 1); ++ User_delay(0, 500); ++ ++ // switch to another frequency, say 500MHz ++ deb_data("- %s Function switch to 500MHz first -\n",__FUNCTION__); ++ Demodulator_acquireChannel ((Demodulator*) &PDC->Demodulator, ucSlaveDemod, ++ bw, 500000); ++ User_delay(0, 500); ++ // now change to original frequency ++ deb_data("- %s Function switch to %d KHz later -\n",__FUNCTION__, freq); ++ Demodulator_acquireChannel ((Demodulator*) &PDC->Demodulator, ucSlaveDemod, ++ bw, freq); ++ } ++ ++ // restart monitor cycle ++ PDC->fc[ucSlaveDemod].OvrFlwChk = CHECK_LOCK_LOOPS; ++ PDC->fc[ucSlaveDemod].UnLockCount = 0; ++ ++ dwError = Error_NO_ERROR; ++ goto exit; ++ } ++ ++ PDC->fc[ucSlaveDemod].OvrFlwChk--; ++ ++ // maintain lock count ++ if( !bLock ) PDC->fc[ucSlaveDemod].UnLockCount ++; ++ ++ deb_data("- Exit %s Function -\n",__FUNCTION__); ++ ++ // avoid race with setfreq ++exit: ++ up(&PDC->tunerLock); ++ return dwError; ++} ++ ++ ++DWORD DL_GetLocked(Bool *bLock) ++{ ++ DWORD dwError; ++ BYTE ucSlaveDemod=0; ++ ++ down(&PDC->tunerLock); ++ ++ if( bLock ) { ++ dwError= Demodulator_isLocked((Demodulator*) &PDC->Demodulator, ucSlaveDemod, bLock); ++ } ++ else { ++ dwError = Error_NULL_PTR; ++ } ++ ++ up(&PDC->tunerLock); ++ return dwError; ++} ++ ++ ++DWORD DL_GetSignalStrength(u16 *strength) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ Byte str; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Demodulator_getSignalStrength((Demodulator*) &PDC->Demodulator, ucSlaveDemod, &str); ++ ++ if( strength ) *strength = str; ++ ++ return dwError; ++} ++ ++DWORD DL_GetSignalQuality(u16 *squality) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ Byte str; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Demodulator_getSignalQuality((Demodulator*) &PDC->Demodulator, ucSlaveDemod, &str); ++ ++ if( squality ) *squality = str; ++ ++ return dwError; ++} ++ ++ ++DWORD DL_GetChannelStat(u32 *ber, u32 *berbits, u32 *ubc) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ ChannelStatistic stat; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Demodulator_getChannelStatistic((Demodulator*) &PDC->Demodulator, ucSlaveDemod, &stat); ++ // ignore error because saved value is returned in stat ++ if( ber ) *ber = stat.postVitErrorCount; ++ if( berbits ) *berbits = stat.postVitBitCount; ++ if( ubc ) *ubc = stat.abortCount; ++ ++ return(dwError); ++} ++ ++ ++static DWORD DL_Initialize( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_Initialize(handle); ++ ++ return (dwError); ++ ++} ++ ++static DWORD DL_SetBusTuner( ++ void * handle, ++ Word busId, ++ Word tunerId ++) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_SetBusTuner(handle, busId, tunerId); ++ ++ return (dwError); ++ ++} ++ ++static DWORD DL_GetEEPROMConfig( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_GetEEPROMConfig(handle); ++ ++ return(dwError); ++} ++ ++static DWORD DL_TunerWakeup( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_TunerWakeup(handle); ++ ++ return(dwError); ++} ++static DWORD DL_IrTblDownload( ++ void * handle ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ dwError = DRV_IrTblDownload(handle); ++ ++ return(dwError); ++} ++ ++ ++DWORD DL_TunerPowerCtrl(u8 bPowerOn) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ deb_data("enter DL_TunerPowerCtrl: bOn = %s\n", bPowerOn?"ON":"OFF"); ++ ++ dwError = DRV_TunerPowerCtrl(PDC, 0, bPowerOn); ++ ++ return (dwError); ++} ++//EXPORT_SYMBOL(DL_TunerPowerCtrl); ++ ++ ++DWORD DL_ApCtrl ( ++ Bool bOn ++) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ //Bool bLock; ++ ++ down(&PDC->powerLock); ++ ++ deb_data("Enter DL_ApCtrl: bOn = %s, use_cnt=%d\n", bOn?"ON":"OFF", PDC->power_use_count); ++ ++ // implement power management based on reference counting ++ if( bOn ) PDC->power_use_count++; ++ else PDC->power_use_count--; ++ if( PDC->power_use_count < 0 ) PDC->power_use_count = 0; ++ ++ if( bOn && PDC->power_use_count==1 ) { ++ ++ deb_data("DL_ApCtrl: call DRV_ApCtrl(ON)\n"); ++ dwError = DRV_ApCtrl (PDC, 0, 1); ++ } ++ else if( !bOn && PDC->power_use_count==0 ) { ++ deb_data("DL_ApCtrl: call DRV_ApCtrl(OFF)\n"); ++ ++ dwError = DRV_ApCtrl (PDC, 0, 0); ++ PDC->fc[ucSlaveDemod].ulDesiredFrequency = 0; ++ PDC->fc[ucSlaveDemod].ucDesiredBandWidth = 0; ++ PDC->fc[ucSlaveDemod].OvrFlwChk = 0; ++ } ++ ++ up(&PDC->powerLock); ++ ++ deb_data("Exit DL_ApCtrl: bOn = %s, dwError = %d\n", bOn?"ON":"OFF", dwError); ++ return(dwError); ++} ++ ++// return 1 if the difference between freq1 & freq2 is smaller or equal than t. ++static inline int Is_Within_Tolerance(u32 freq1, u32 freq2, u32 t) ++{ ++ u32 diff = (freq1>freq2)? (freq1-freq2) : (freq2-freq1); ++ if( diff<=t ) return 1; ++ else return 0; ++} ++ ++ ++DWORD DL_Tuner_SetFreq(u32 dwFreq,u8 ucBw) ++{ ++ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ if ( (PDC->fc[ucSlaveDemod].ulDesiredFrequency!=dwFreq ++ && !Is_Within_Tolerance(PDC->fc[ucSlaveDemod].ulDesiredFrequency, dwFreq, 125) ) ++ || PDC->fc[ucSlaveDemod].ucDesiredBandWidth!=ucBw*1000) ++ dwError = DRV_SetFreqBw(PDC, ucSlaveDemod, dwFreq, ucBw); ++ else ++ deb_data(" the same Frequency & BandWidth\n"); ++ ++ return(dwError); ++} ++ ++DWORD DL_Tuner_SetBW(u8 ucBw) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ BYTE ucSlaveDemod=0; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ if (PDC->fc[ucSlaveDemod].ucDesiredBandWidth!=ucBw*1000) ++ dwError = DRV_SetFreqBw(PDC, ucSlaveDemod, 0, ucBw); ++ else ++ deb_data(" the same BandWidth\n"); ++ ++ return(dwError); ++} ++ ++DWORD DL_ReSetInterval(void) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ ++ return(dwError); ++} ++ ++DWORD DL_Reboot(void) ++{ ++ DWORD dwError = Error_NO_ERROR; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = DRV_Reboot(PDC); ++ ++ return(dwError); ++} ++ ++ ++DWORD Device_init(struct usb_device *udev,struct usb_interface *uintf, PDEVICE_CONTEXT PDCs, Bool bBoot) ++{ ++ DWORD error = Error_NO_ERROR; ++ BYTE filterIdx=0; ++ udevs=udev; ++ uintfs=uintf; ++ PDC=PDCs; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ //************* Set Device init Info *************// ++ PDC->bEnterSuspend = false; ++ PDC->bSurpriseRemoval = false; ++ PDC->bDevNotResp = false; ++ PDC->bSelectiveSuspend = false; ++ PDC->bTunerPowerOff = false; ++ ++ if (bBoot) ++ { ++ PDC->bSupportSelSuspend = false; ++ PDC->Demodulator.userData = (Handle)PDC; ++ PDC->Demodulator.chipNumber =1; ++ PDC->architecture=Architecture_DCA; ++ PDC->Demodulator.frequency[0] = 666000; ++ PDC->Demodulator.bandwidth[0] = 8000; ++ PDC->bIrTblDownload = false; ++ PDC->fc[0].tunerinfo.TunerId = 0; ++ PDC->fc[1].tunerinfo.TunerId = 0; ++ PDC->bDualTs=false; ++ PDC->FilterCnt = 0; ++ PDC->StreamType = StreamType_DVBT_DATAGRAM; ++ PDC->UsbCtrlTimeOut = 1; ++ ++ //init_MUTEX(&PDC->powerLock); ++ //init_MUTEX(&PDC->tunerLock); ++ sema_init(&PDC->powerLock, 1); ++ sema_init(&PDC->tunerLock, 1); ++ ++ PDC->power_use_count = 0; ++ ++ PDC->idVendor = udev->descriptor.idVendor; ++ PDC->idProduct = udev->descriptor.idProduct; ++ ++ PDC->Demodulator.GPIO8Value[0] = 2; ++ PDC->Demodulator.GPIO8Value[1] = 2; ++ ++ PDC->fc[0].AVerFlags = 0x00; ++ PDC->fc[1].AVerFlags = 0x00; ++ ++ //init_MUTEX(&PDC->regLock); ++ sema_init(&PDC->regLock, 1); ++ } ++ else { ++ PDC->UsbCtrlTimeOut = 5; ++ }//bBoot ++ ++#ifdef AFA_USB_DEVICE ++ if (bBoot) { ++ //************* Set USB Info *************// ++ PDC->MaxPacketSize = 0x0200; //default USB2.0 ++ PDC->UsbMode = (PDC->MaxPacketSize == 0x200)?0x0200:0x0110; ++ deb_data("USB mode= 0x%x\n", PDC->UsbMode); ++ ++ PDC->TsPacketCount = (PDC->UsbMode == 0x200)?TS_PACKET_COUNT_HI:TS_PACKET_COUNT_FU; ++ PDC->TsFrames = (PDC->UsbMode == 0x200)?TS_FRAMES_HI:TS_FRAMES_FU; ++ PDC->TsFrameSize = TS_PACKET_SIZE*PDC->TsPacketCount; ++ PDC->TsFrameSizeDw = PDC->TsFrameSize/4; ++ } ++ PDC->bEP12Error = false; ++ PDC->bEP45Error = false; ++ PDC->ForceWrite = false; ++ PDC->ulActiveFilter = 0; ++#else ++ PDC->bSupportSuspend = false; ++#endif//AFA_USB_DEVICE ++ ++#ifdef AFA_USB_DEVICE ++ if(bBoot) ++ { ++ //patch for eeepc ++ error = DL_SetBusTuner (PDC, Bus_USB, Tuner_Afatech_AF9007); ++ PDC->UsbCtrlTimeOut = 5; ++ ++ error = DL_SetBusTuner (PDC, Bus_USB, Tuner_Afatech_AF9007); ++ if (error) ++ { ++ deb_data("First DL_SetBusTuner fail : 0x%08x\n",error ); ++ goto Exit; ++ } ++ ++ error =DL_GetEEPROMConfig(PDC); ++ if (error) ++ { ++ deb_data("DL_GetEEPROMConfig fail : 0x%08x\n", error); ++ goto Exit; ++ } ++ }//bBoot ++ ++ error = DL_SetBusTuner(PDC, Bus_USB, PDC->fc[0].tunerinfo.TunerId); ++ if (error) ++ { ++ deb_data("DL_SetBusTuner fail!\n"); ++ goto Exit; ++ } ++ ++ if(PDC->Demodulator.chipNumber == 1 && PDC->Demodulator.booted) //warm-boot/(S1) ++ { ++ error = DL_TunerWakeup(PDC); ++ } ++ if(error) deb_data("DL_NIMReset or DL_NIMSuspend or DL_TunerWakeup fail!\n"); ++ ++ error = DL_Initialize(PDC); ++ if (error) ++ { ++ deb_data("DL_Initialize fail! 0x%08x\n", error); ++ goto Exit; ++ } ++ ++ if (PDC->bIrTblDownload) ++ { ++ error = DL_IrTblDownload(PDC); ++ if (error) deb_data("DL_IrTblDownload fail"); ++ } ++ ++ //for (filterIdx=0; filterIdx< pdc->Demodulator.chipNumber; filterIdx++) ++ //{ ++ ++ ++ if (bBoot) ++ { ++ //Bool bLock; ++ error = DRV_ApCtrl(PDC, filterIdx, false); ++ if (error) deb_data("%d: DRV_ApCtrl Fail!\n", filterIdx); ++ } ++ ++ deb_data(" %s success!! \n",__FUNCTION__); ++ ++Exit: ++#endif //AFA_USB_DEVICE ++ ++ return (error); ++} ++//EXPORT_SYMBOL(Device_init); +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-fe.c b/drivers/media/dvb/dvb-usb/a867_af903x-fe.c +new file mode 100644 +index 0000000..4f405f0 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-fe.c +@@ -0,0 +1,936 @@ ++#include ++#include ++#include ++#include ++ ++#include "a867_af903x.h" ++#include "dvb_frontend.h" ++#include "a867_standard.h" ++ ++#define A333_FREQ_MIN 44250000 ++#define A333_FREQ_MAX 867250000 ++ ++DEFINE_MUTEX(mutex); ++ ++static int alwayslock; // default to 0 ++module_param(alwayslock, int, 0644); ++MODULE_PARM_DESC(alwayslock, "Whether to always report channel as locked (default:no)."); ++ ++ ++struct af903xm_state { ++ struct dvb_frontend demod; ++#ifdef V4L2_ONLY_DVB_V5 ++ uint32_t current_bandwidth_hz; ++#else ++ fe_bandwidth_t current_bandwidth; ++#endif ++ uint32_t current_frequency; ++ ++ struct completion thread_exit; ++ int thread_should_stop; ++ atomic_t thread_created; ++ ++ u32 ucblocks; ++ u32 ber; ++ u16 strength; ++ ++ int locked; ++}; ++ ++int test_map_snr(u32 snr_data, u16 *snr, u16 *maxsnr) ++{ ++ Dword error = 0; ++ Dword snr_value = 0; ++ Byte constellation = 0; ++ Byte transmission_mode = 0; ++ ++ *maxsnr = 0; ++ *snr = 0; ++ ++ /** Get constellation type */ ++ error = Standard_readRegisterBits ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_OFDM, g_reg_tpsd_const, reg_tpsd_const_pos, reg_tpsd_const_len, &constellation); ++ if (error) goto exit; ++ ++ /** Get FFT mode */ ++ error = Standard_readRegisterBits ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_OFDM, g_reg_tpsd_txmod, reg_tpsd_txmod_pos, reg_tpsd_txmod_len, &transmission_mode); ++ if (error) goto exit; ++ ++ // Adjust snr data by transmission mode ++ if (transmission_mode == 0) ++ snr_value = snr_data * 4; ++ else if (transmission_mode == 2) ++ snr_value = snr_data * 2; ++ else ++ snr_value = snr_data; ++ ++ if( constellation == 0) //Constellation_QPSK ++ { ++ if(snr_value < 0xB4771) *snr = 0; ++ else if(snr_value < 0xC1AED) *snr = 1; ++ else if(snr_value < 0xD0D27) *snr = 2; ++ else if(snr_value < 0xE4D19) *snr = 3; ++ else if(snr_value < 0xE5DA8) *snr = 4; ++ else if(snr_value < 0x107097) *snr = 5; ++ else if(snr_value < 0x116975) *snr = 6; ++ else if(snr_value < 0x1252D9) *snr = 7; ++ else if(snr_value < 0x131FA4) *snr = 8; ++ else if(snr_value < 0x13D5E1) *snr = 9; ++ else if(snr_value < 0x148E53) *snr = 10; ++ else if(snr_value < 0x15358B) *snr = 11; ++ else if(snr_value < 0x15DD29) *snr = 12; ++ else if(snr_value < 0x168112) *snr = 13; ++ else if(snr_value < 0x170B61) *snr = 14; ++ else if(snr_value < 0x17A532) *snr = 15; ++ else if(snr_value < 0x180F94) *snr = 16; ++ else if(snr_value < 0x186ED2) *snr = 17; ++ else if(snr_value < 0x18B271) *snr = 18; ++ else if(snr_value < 0x18E118) *snr = 19; ++ else if(snr_value < 0x18FF4B) *snr = 20; ++ else if(snr_value < 0x190AF1) *snr = 21; ++ else if(snr_value < 0x191451) *snr = 22; ++ else *snr = 23; ++ *maxsnr = 23; ++ } ++ else if ( constellation == 1) //Constellation_16QAM ++ { ++ if(snr_value < 0x4F0D5) *snr = 0; ++ else if(snr_value < 0x5387A) *snr = 1; ++ else if(snr_value < 0x573A4) *snr = 2; ++ else if(snr_value < 0x5A99E) *snr = 3; ++ else if(snr_value < 0x5CC80) *snr = 4; ++ else if(snr_value < 0x5EB62) *snr = 5; ++ else if(snr_value < 0x5FECF) *snr = 6; ++ else if(snr_value < 0x60B80) *snr = 7; ++ else if(snr_value < 0x62501) *snr = 8; ++ else if(snr_value < 0x64865) *snr = 9; ++ else if(snr_value < 0x69604) *snr = 10; ++ else if(snr_value < 0x6F356) *snr = 11; ++ else if(snr_value < 0x7706A) *snr = 12; ++ else if(snr_value < 0x804D3) *snr = 13; ++ else if(snr_value < 0x89D1A) *snr = 14; ++ else if(snr_value < 0x93E3D) *snr = 15; ++ else if(snr_value < 0x9E35D) *snr = 16; ++ else if(snr_value < 0xA7C3C) *snr = 17; ++ else if(snr_value < 0xAFAF8) *snr = 18; ++ else if(snr_value < 0xB719D) *snr = 19; ++ else if(snr_value < 0xBDA6A) *snr = 20; ++ else if(snr_value < 0xC0C75) *snr = 21; ++ else if(snr_value < 0xC3F7D) *snr = 22; ++ else if(snr_value < 0xC5E62) *snr = 23; ++ else if(snr_value < 0xC6C31) *snr = 24; ++ else if(snr_value < 0xC7925) *snr = 25; ++ else *snr = 26; ++ *maxsnr = 26; ++ } ++ else if ( constellation == 2) //Constellation_64QAM ++ { ++ if(snr_value < 0x256D0) *snr = 0; ++ else if(snr_value < 0x27A65) *snr = 1; ++ else if(snr_value < 0x29873) *snr = 2; ++ else if(snr_value < 0x2B7FE) *snr = 3; ++ else if(snr_value < 0x2CF1E) *snr = 4; ++ else if(snr_value < 0x2E234) *snr = 5; ++ else if(snr_value < 0x2F409) *snr = 6; ++ else if(snr_value < 0x30046) *snr = 7; ++ else if(snr_value < 0x30844) *snr = 8; ++ else if(snr_value < 0x30A02) *snr = 9; ++ else if(snr_value < 0x30CDE) *snr = 10; ++ else if(snr_value < 0x31031) *snr = 11; ++ else if(snr_value < 0x3144C) *snr = 12; ++ else if(snr_value < 0x315DD) *snr = 13; ++ else if(snr_value < 0x31920) *snr = 14; ++ else if(snr_value < 0x322D0) *snr = 15; ++ else if(snr_value < 0x339FC) *snr = 16; ++ else if(snr_value < 0x364A1) *snr = 17; ++ else if(snr_value < 0x38BCC) *snr = 18; ++ else if(snr_value < 0x3C7D3) *snr = 19; ++ else if(snr_value < 0x408CC) *snr = 20; ++ else if(snr_value < 0x43BED) *snr = 21; ++ else if(snr_value < 0x48061) *snr = 22; ++ else if(snr_value < 0x4BE95) *snr = 23; ++ else if(snr_value < 0x4FA7D) *snr = 24; ++ else if(snr_value < 0x52405) *snr = 25; ++ else if(snr_value < 0x5570D) *snr = 26; ++ else if(snr_value < 0x59FEB) *snr = 27; ++ else if(snr_value < 0x5BF38) *snr = 28; ++ else *snr = 29; ++ *maxsnr = 29; ++ } ++ ++ ++exit: ++ ++ deb_data(" %s Function, SNR = %d -\n",__FUNCTION__, *snr); ++ return error; ++} ++ ++int test_read_strength_dbm(struct dvb_frontend *demod, u32 *str) ++{ ++ ++ Dword dwError = 0; ++ Byte str_dbm = 0; ++ ++ // Read StrengthDBM ++ dwError = Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, est_rf_level_dbm, &str_dbm); ++ if(dwError) { ++ deb_data("%s error, ret=0x%x\n", __FUNCTION__, dwError); ++ *str = 0; ++ goto exit; ++ } ++ ++ deb_data(" %s Function, StrengthDbm = %d -\n",__FUNCTION__, str_dbm); ++ ++exit: ++ return dwError; ++} ++ ++ ++int test_read_snr(struct dvb_frontend *demod, u32 *snr_data) ++{ ++ Byte check1 = 0x0, check2 = 0x0; ++ Byte base1 = 0x0, base2 = 0x0; ++ Byte snr1 = 0x0, snr2 = 0x0, snr3=0x0; ++ u16 baseAddr = 0x0; ++ ++ *snr_data = 0x000000; ++ ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, 0xf21b, &check1); ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, 0xf999, &check2); ++ ++ deb_data(" %s Function, check1=0x%x -\n",__FUNCTION__, check1); ++ ++ if(check1 != 0x0c || check2 != 0x01) return 1; ++ ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, 0x418b, &base1); ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, 0x418c, &base2); ++ ++ baseAddr = (base1<<8) + base2 + 0x2C; ++ ++ deb_data(" %s Function, base1 = 0x%x -\n",__FUNCTION__, base1); ++ deb_data(" %s Function, base2 = 0x%x -\n",__FUNCTION__, base2); ++ deb_data(" %s Function, (base1<<8) + base2 + 0x2c = baseAddr = 0x%x -\n",__FUNCTION__, baseAddr); ++ ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, baseAddr, &snr1); ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, baseAddr+1, &snr2); ++ Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, baseAddr+2, &snr3); ++ ++ *snr_data = (snr3<<16)+(snr2<<8)+(snr1); ++ ++ deb_data(" %s Function, snr data = 0x%x -\n",__FUNCTION__, *snr_data); ++ ++ return 0; ++ ++} ++ ++ ++ ++/* unused ++static int af903x_set_bandwidth(struct dvb_frontend *demod, u8 bw_idx) ++{ ++ struct af903xm_state *state = demod->demodulator_priv; ++ ++ deb_data("- Enter %s Function - bandwidth= %d \n",__FUNCTION__,bw_idx); ++ ++// state->current_bandwidth = bw_idx; ++ ++ DL_Tuner_SetBW(bw_idx); ++ ++ return 0; ++} ++*/ ++ ++static void af903x_set_channel(struct af903x_ofdm_channel *ch) ++{ ++ deb_data("- Enter %s Function - RF=%d, BW=%d\n",__FUNCTION__,ch->RF_kHz,ch->Bw); ++ ++ DL_Tuner_SetFreq(ch->RF_kHz,ch->Bw); ++ ++} ++ ++static int af903x_tune(struct dvb_frontend *demod, struct af903x_ofdm_channel *ch) ++{ ++ if (ch != NULL) ++ af903x_set_channel(ch); ++ ++ return 0; ++} ++ ++static int af903x_init(struct dvb_frontend *demod) ++{ ++ int ret = 0; ++ struct af903xm_state *state = demod->demodulator_priv; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ ret = usb_autopm_get_interface(uintfs); ++ if(ret) { ++ deb_data("%s calling usb_autopm_get_interface failed with %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ ++ ret = DL_ApCtrl(1); ++ if(ret) { ++ deb_data("af903x_init Fail: 0x%04X", ret); ++ return -EIO; ++ } ++ ++ // reset statistics ++ state->ber = 0; ++ state->ucblocks = 0; ++ state->strength = 0; ++ state->locked = 1; ++ ++ // reset values ++ state->current_frequency = 0; ++#ifdef V4L2_ONLY_DVB_V5 ++ state->current_bandwidth_hz = 0; ++#else ++ state->current_bandwidth = 0; ++#endif ++ ++ af903x_start_monitor_thread(demod); ++ ++ deb_data("- Exit %s Function -\n",__FUNCTION__); ++ return 0; ++} ++ ++static int af903x_sleep(struct dvb_frontend *demod) ++{ ++ int error; ++ deb_data("Enter %s Function\n",__FUNCTION__); ++ ++ af903x_stop_monitor_thread(demod); ++ ++ error = DL_ApCtrl(0); ++ if (error) { ++ deb_data("%s calling DL_ApCtrl error : 0x%x\n", __FUNCTION__, error); ++ return -EIO; ++ } ++ ++ usb_autopm_put_interface(uintfs); ++ ++ deb_data("- Exit %s Function -\n",__FUNCTION__); ++ return 0; ++} ++static int af903x_identify(struct af903xm_state *state) ++{ ++ return 0; ++} ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int af903x_get_frontend(struct dvb_frontend* fe) ++{ ++ struct dtv_frontend_properties *fep = &fe->dtv_property_cache; ++ struct af903xm_state *state = fe->demodulator_priv; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ fep->frequency = state->current_frequency; ++ fep->inversion = INVERSION_AUTO; ++ fep->bandwidth_hz = state->current_bandwidth_hz; ++ ++ return 0; ++} ++ ++static int af903x_set_frontend(struct dvb_frontend* fe) ++{ ++ struct dtv_frontend_properties *fep = &fe->dtv_property_cache; ++ struct af903xm_state *state = fe->demodulator_priv; ++ struct af903x_ofdm_channel ch; ++ u16 bw=0; ++ int ret=0; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ ++ if( fep->frequency < A333_FREQ_MIN || fep->frequency > A333_FREQ_MAX ) { ++ deb_data("- %s freq=%d Hz out of range(%d~%d)-\n",__FUNCTION__, fep->frequency, ++ A333_FREQ_MIN, A333_FREQ_MAX); ++ // set to zero so we can report unlock to AP, because return -EINVAL apparently ++ // does not stop AP from continuing tuning. ++ state->current_frequency = 0; ++ return -EINVAL; ++ } ++ ++ switch(fep->bandwidth_hz) { ++ case 8000000: bw=8; break; ++ case 7000000: bw=7; break; ++ case 6000000: bw=6; break; ++ default: ++ deb_data("- %s unknown bw value: %d -\n",__FUNCTION__, fep->bandwidth_hz); ++ return -EINVAL; ++ } ++ ++ ++ ch.RF_kHz = fep->frequency / 1000; ++ ch.Bw = bw; ++ deb_data("- %s freq=%d KHz, bw=%d MHz -\n",__FUNCTION__, ch.RF_kHz, ch.Bw); ++ ++ state->current_bandwidth_hz = fep->bandwidth_hz; ++ state->current_frequency = fep->frequency; ++ ++ ret = af903x_tune(fe, &ch); ++ ++ // start monitor thread if not yet. ++ af903x_start_monitor_thread(fe); ++ ++ return ret; ++} ++#else ++static int af903x_get_frontend(struct dvb_frontend* fe, ++ struct dvb_frontend_parameters *fep) ++{ ++ struct af903xm_state *state = fe->demodulator_priv; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ memset(fep, 0, sizeof(*fep)); ++ fep->frequency = state->current_frequency; ++ fep->inversion = INVERSION_AUTO; ++ fep->u.ofdm.bandwidth = state->current_bandwidth; ++ return 0; ++} ++ ++static int af903x_set_frontend(struct dvb_frontend* fe, ++ struct dvb_frontend_parameters *fep) ++{ ++ struct af903xm_state *state = fe->demodulator_priv; ++ struct af903x_ofdm_channel ch; ++ u16 bw=0; ++ int ret=0; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ ++ if( fep->frequency < A333_FREQ_MIN || fep->frequency > A333_FREQ_MAX ) { ++ deb_data("- %s freq=%d Hz out of range(%d~%d)-\n",__FUNCTION__, fep->frequency, ++ A333_FREQ_MIN, A333_FREQ_MAX); ++ // set to zero so we can report unlock to AP, because return -EINVAL apparently ++ // does not stop AP from continuing tuning. ++ state->current_frequency = 0; ++ return -EINVAL; ++ } ++ ++ switch(fep->u.ofdm.bandwidth) { ++ case BANDWIDTH_8_MHZ: bw=8; break; ++ case BANDWIDTH_7_MHZ: bw=7; break; ++ case BANDWIDTH_6_MHZ: bw=6; break; ++ ++ case 6: ++ //case 7: ++ //case 8: ++ bw = fep->u.ofdm.bandwidth; ++ deb_data("- %s wrong bw value: %d -\n",__FUNCTION__, fep->u.ofdm.bandwidth); ++ break; ++ default: ++ ++ deb_data("- %s unknown bw value: %d -\n",__FUNCTION__, fep->u.ofdm.bandwidth); ++ return -EINVAL; ++ } ++ ++ ++ ch.RF_kHz = fep->frequency / 1000; ++ ch.Bw = bw; ++ deb_data("- %s freq=%d KHz, bw=%d MHz -\n",__FUNCTION__, ch.RF_kHz, ch.Bw); ++ ++ state->current_bandwidth = fep->u.ofdm.bandwidth; ++ state->current_frequency = fep->frequency; ++ ++ ret = af903x_tune(fe, &ch); ++ ++ // start monitor thread if not yet. ++ af903x_start_monitor_thread(fe); ++ ++ return ret; ++} ++#endif ++ ++static int af903x_read_status(struct dvb_frontend *fe, fe_status_t *stat) ++{ ++ //DWORD dwError; ++ Bool bLock; ++ struct af903xm_state *state = fe->demodulator_priv; ++ //u32 snr_data; ++ //u32 str_dbm_data; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ *stat = 0; ++ ++#if !USE_MONITOR_TH ++ { ++ unsigned long j = (HZ*500)/1000; ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ schedule_timeout(j); ++ } ++ dwError = DL_GetLocked(&bLock); ++ if( dwError ) { ++ deb_data("- Function %s error=0x%x\n",__FUNCTION__, dwError); ++ return -EIO; ++ } ++#else ++ if( alwayslock ) { ++ bLock = True; ++ } ++ else { ++ bLock = state->locked; ++ } ++#endif ++ if( bLock ) { ++ *stat |= FE_HAS_SIGNAL; ++ *stat |= FE_HAS_CARRIER; ++ *stat |= FE_HAS_LOCK; ++ *stat |= FE_HAS_VITERBI; ++ *stat |= FE_HAS_SYNC; ++ } ++ ++ ++ // report unlock if frequency is out of bound ++ if( 0==state->current_frequency ) { ++ *stat = 0; ++ } ++ ++#if ENABLE_TEST_FUNCTION ++ test_read_snr(fe, &snr_data); ++ test_map_snr(snr_data, &snr); ++ test_read_strength_dbm(fe, &str_dbm_data); ++#endif ++ ++ deb_data("- Exit %s Function, status=0x%x -\n",__FUNCTION__, *stat); ++ return 0; ++} ++ ++static int af903x_read_ubc(struct dvb_frontend *fe, u32* ucblocks) ++{ ++ struct af903xm_state *state = fe->demodulator_priv; ++ //DWORD dwError; ++ //Bool bLock; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++#if !USE_MONITOR_TH ++ DL_GetChannelStat(NULL, NULL, ucblocks); ++ ++ dwError = DL_GetLocked(&bLock); ++ // if signal is not locked, fill with 65535 to indicate loss of signal ++ if( dwError || !bLock ) { ++ deb_data("- Function %s lost lock , error=0x%x, bLock=%d -\n",__FUNCTION__, dwError, bLock); ++ if( ucblocks ) *ucblocks = 65535; ++ return 0; ++ } ++#else ++ if( ucblocks ) *ucblocks = state->ucblocks; ++#endif ++ ++ deb_data("- Exit %s Function, ubc=%d -\n",__FUNCTION__, ucblocks? *ucblocks:-1); ++ return 0; ++} ++ ++ ++static int af903x_read_ber(struct dvb_frontend *fe, u32 *ber) ++{ ++ struct af903xm_state *state = fe->demodulator_priv; ++ //DWORD dwError; ++ //u32 berbits; ++ //Bool bLock; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++#if !USE_MONITOR_TH ++ DL_GetChannelStat(ber, &berbits, NULL); ++ ++ // if signal is not locked, fill BER with BER total bits ++ dwError = DL_GetLocked(&bLock); ++ if( dwError || !bLock ) { ++ deb_data("- Function %s lost lock , error=0x%x, bLock=%d -\n",__FUNCTION__, dwError, bLock); ++ if( ber ) *ber = berbits; ++ return 0; ++ } ++#else ++ if( ber ) *ber = state->ber; ++#endif ++ // ++ deb_data("- Exit %s Function , ber=%d-\n",__FUNCTION__, ber? *ber:(-1)); ++ return 0; ++} ++ ++ ++static int af903x_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ++{ ++ DWORD dwError; ++ Bool bLock; ++ Byte value; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, signal_strength, &value); ++ //dwError = DL_GetSignalStrength(strength); ++ if( dwError ) { ++ deb_data("- Function %s error reading signal strength -\n",__FUNCTION__); ++ *strength = 0; ++ return 1; ++ } ++ ++ dwError = DL_GetLocked(&bLock); ++ if( dwError ) { ++ deb_data("- Function %s error reading signal quality : lost lock -\n",__FUNCTION__); ++ *strength = 0; ++ return 1; ++ } ++ ++ deb_data("- Exit %s Function, signal strength (0-100)=%d -\n",__FUNCTION__, value); ++ ++ // 16 bit output ++ *strength = value * (0xffff / 100); ++ ++ return 0; ++} ++ ++/* ++static int af903x_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ++{ ++ struct af903xm_state *state = fe->demodulator_priv; ++ //DWORD dwError; ++ // Bool bLock; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++#if !USE_MONITOR_TH ++ DL_GetSignalStrength(strength); ++ ++ dwError = DL_GetLocked(&bLock); ++ if( dwError || !bLock ) { ++ deb_data("- Function %s lost lock , error=0x%x, bLock=%d -\n",__FUNCTION__, dwError, bLock); ++ if( strength ) *strength = 0; ++ return 0; ++ } ++#else ++ if( strength ) *strength = state->strength; ++#endif ++ ++ deb_data("- Exit %s Function, strength=%d -\n",__FUNCTION__, strength? *strength:-1); ++ return 0; ++} ++*/ ++ ++static int af903x_read_snr(struct dvb_frontend* fe, u16 *snr) ++{ ++ Byte value_7_0 = 0; ++ Byte value_15_8 = 0; ++ Byte value_23_16 = 0; ++ //Dword addr = 0; ++ Dword dwError = 0; ++ u32 snr_val=0; ++ u16 snr_max=0; ++ u16 snr_16bit = 0; ++ ++ *snr = 0; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ ++ dwError = Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, qnt_vbc_err_7_0, &value_7_0); ++ if(dwError) { ++ deb_data("- Function %s qnt_vbc_err_7_0 register read fail ! -\n",__FUNCTION__); ++ return 1; ++ } ++ ++ dwError = Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, qnt_vbc_err_15_8, &value_15_8); ++ if(dwError) { ++ deb_data("- Function %s qnt_vbc_err_15_8 register read fail ! -\n",__FUNCTION__); ++ return 1; ++ } ++ ++ dwError = Standard_readRegister ((Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, Processor_OFDM, qnt_vbc_err_23_16, &value_23_16); ++ if(dwError) { ++ deb_data("- Function %s qnt_vbc_err_23_16 register read fail ! -\n",__FUNCTION__); ++ return 1; ++ } ++ ++ snr_val = (value_23_16 << 16) + (value_15_8 << 8) + value_7_0; ++ deb_data("- Function %s SNR row val 0x%x -\n",__FUNCTION__,snr_val); ++ ++ dwError = test_map_snr(snr_val, snr, &snr_max); ++ if(dwError) { ++ deb_data("- Function %s map_snr fail ! -\n",__FUNCTION__); ++ *snr = 0; ++ return 1; ++ } ++ snr_16bit = (0xffff / snr_max) * *snr; ++ deb_data("- Exit %s SNR %d dB , %d 16bit -\n",__FUNCTION__,*snr,snr_16bit); ++ ++ if (dvb_usb_af903x_snrdb == 0) ++ *snr = snr_16bit; ++ ++ return 0; ++ ++} ++ ++ ++ ++static void af903x_release(struct dvb_frontend *demod) ++{ ++ struct af903xm_state *st = demod->demodulator_priv; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ af903x_stop_monitor_thread(demod); ++ kfree(st); ++} ++ ++static struct dvb_frontend_ops af903x_ops = { ++#ifdef V4L2_ONLY_DVB_V5 ++ .delsys = { SYS_DVBT }, ++#endif ++ .info = { ++ .name = "A867 USB DVB-T", ++#ifndef V4L2_ONLY_DVB_V5 ++ .type = FE_OFDM, ++#endif ++ .frequency_min = A333_FREQ_MIN, ++ .frequency_max = A333_FREQ_MAX, ++ .frequency_stepsize = 62500, ++ .caps = FE_CAN_INVERSION_AUTO | ++ FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | ++ FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | ++ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | ++ FE_CAN_TRANSMISSION_MODE_AUTO | ++ FE_CAN_GUARD_INTERVAL_AUTO | ++ FE_CAN_RECOVER | ++ FE_CAN_HIERARCHY_AUTO, ++ }, ++ ++ .release = af903x_release, ++ ++ .init = af903x_init, ++ .sleep = af903x_sleep, ++ ++ .set_frontend = af903x_set_frontend, ++ .get_frontend = af903x_get_frontend, ++ ++ .read_status = af903x_read_status, ++ .read_ber = af903x_read_ber, ++ .read_signal_strength = af903x_read_signal_strength, ++ .read_snr = af903x_read_snr, ++// .read_snr = af903x_read_signal_quality, ++ .read_ucblocks = af903x_read_ubc, ++}; ++ ++static struct dvb_frontend_ops af903x_ops; ++struct dvb_frontend * af903x_attach(u8 tmp) ++{ ++ struct dvb_frontend *demod; ++ struct af903xm_state *st; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ st = kzalloc(sizeof(struct af903xm_state), GFP_KERNEL); ++ if (st == NULL) ++ return NULL; ++ ++ demod = &st->demod; ++ demod->demodulator_priv = st; ++ memcpy(&st->demod.ops, &af903x_ops, sizeof(struct dvb_frontend_ops)); ++ atomic_set(&st->thread_created, 0); ++ ++ af903x_identify(st); ++ ++ return demod; ++} ++ ++ ++static Dword Monitor_GPIO8(void) ++{ ++ Dword error = Error_NO_ERROR; ++ Byte PinValue; ++ ++ if ( PDC->idProduct!=0xa333 ) { ++ goto exit; ++ } ++ ++ if( PDC->fc[0].AVerFlags&0x04 ) { ++ deb_data("%s, skip read GPIO8\n", __FUNCTION__); ++ PDC->fc[0].AVerFlags &= ~(0x04); ++ goto exit; ++ } ++ ++ // read GPIO8 ++ error = Standard_readRegister ((Demodulator *)&PDC->Demodulator, ++ PDC->Map.RF_SW_HOST, ++ Processor_LINK, ++ PDC->Map.GPIO_STR_i, ++ &PinValue); ++ if( error ) goto exit; ++ ++ if( PDC->Demodulator.GPIO8Value[0] != PinValue ) { ++ ++ if( PinValue == 1 ) { ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, ++ PDC->Map.RF_SW_HOST, ++ Processor_LINK, ++ PDC->Map.GPIO_UHF_o, ++ 1); ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, ++ PDC->Map.RF_SW_HOST, ++ Processor_LINK, ++ PDC->Map.GPIO_VHF_o, ++ 1); ++ } ++ else if (PDC->fc[0].ulDesiredFrequency > 300000) ++ { ++ //UHF ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_LINK, PDC->Map.GPIO_UHF_o, 1); ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_LINK, PDC->Map.GPIO_VHF_o, 0); ++ } ++ else ++ { ++ //VHF ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_LINK, PDC->Map.GPIO_UHF_o, 0); ++ error = Standard_writeRegister ( (Demodulator *)&PDC->Demodulator, PDC->Map.RF_SW_HOST, ++ Processor_LINK, PDC->Map.GPIO_VHF_o, 1); ++ } ++ PDC->Demodulator.GPIO8Value[0] = PinValue; ++ } ++ else if( PinValue == 0 ) { // pin value remains 0 ++ if( PDC->Demodulator.channelStatistic[0].abortCount > 2500 && ++ (PDC->fc[0].AVerFlags&0x08)==0 ) { ++ // pull high GPIO8 ++ PDC->fc[0].AVerFlags |= 0x08; // pull H flag bit 3 ++ Demodulator_writeRegister( (Demodulator *)&PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_STR_en, 1); ++ Demodulator_writeRegister( (Demodulator *)&PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_STR_on, 1); ++ Demodulator_writeRegister( (Demodulator *)&PDC->Demodulator, 0, Processor_LINK, PDC->Map.GPIO_STR_o, 1); ++ } ++ } ++ else if( PinValue == 1 ) { // pin value remains 1 ++ if( PDC->Demodulator.channelStatistic[0].abortCount < 2500 && ++ (PDC->fc[0].AVerFlags&0x08)!=0 ) { ++ // after manual tune and result is good ++ PDC->fc[0].AVerFlags &= ~(0x08); ++ } ++ } ++ ++exit: ++ return error; ++} ++ ++static int af903x_monitor_thread_func(void *data) ++{ ++ struct dvb_frontend *demod = data; ++ struct af903xm_state *state = demod? demod->demodulator_priv:NULL; ++ const char *thread_name = "A867_monitor_thread"; ++ unsigned long loopcount = 0; ++ Bool bLock = True; ++ ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ if( !state ) return -1; ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) ++ lock_kernel(); ++#else ++ mutex_lock(&mutex); ++#endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61) ++ daemonize(); ++ sigfillset(¤t->blocked); ++ sprintf(current->comm, "%s", thread_name); ++#else ++ daemonize("%s", thread_name); ++ allow_signal(SIGTERM); ++#endif ++ siginitsetinv(¤t->blocked, sigmask(SIGKILL)|sigmask(SIGINT)|\ ++ sigmask(SIGTERM)); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) ++ unlock_kernel(); ++#else ++ mutex_unlock(&mutex); ++#endif ++ while(!state->thread_should_stop && !signal_pending(current)) { ++ ++ //DWORD dwError; ++ u32 ber, berbits, ucblocks; ++ u16 strength; ++ ++ loopcount++; ++ ++ // sleep for 500 mili seconds ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ schedule_timeout((HZ*500)/1000); ++ ++ // monitor lock and return lock status ++ // reacquire channel if lock is lost for quiet a while ++ #if 1 ++ DL_MonitorReception(&bLock); ++ state->locked = bLock? 1:0; ++ #endif //0 ++ // obtain statistics ++ // do this every 2 loops, which is 1 second ++ if( loopcount%2 == 1 ) { ++ // do not do this if bLock is false, because ++ // 1. this is not necessary ++ // 2. frequency is not yet set ++ if( bLock ) { ++ DL_GetChannelStat(&ber, &berbits, &ucblocks); ++ DL_GetSignalStrength(&strength); ++ ++ // sometimes strength can drop to zero while demod ++ // is still pumping out stream. In which case we ++ // maintain strength to a locked level because ++ // some AP(kaffeine) seem to rely on strength ++ // for signs of signal lock. ++ //if( strength==0 ) strength = 10; ++ ++ strength = (strength*65535/100); ++ } ++ else { ++ DL_GetChannelStat(NULL, &berbits, NULL); ++ ber = berbits; ++ ucblocks = 65535; ++ strength = 0; ++ } ++ ++ state->ber = ber; ++ state->ucblocks = ucblocks; ++ state->strength = strength; ++ } ++ // monitor GPIO8 ++ Monitor_GPIO8(); ++ } ++ ++ //Firstly, clear thread_created flag so monitor thead can be restored later. ++ atomic_set(&state->thread_created, 0); ++ //Secondly, clear current frequency so we can depent on later set_frequency to restore ++ //this thread. ++ state->current_frequency = 0; ++ ++ deb_data("- Exit %s Function -\n",__FUNCTION__); ++ complete_and_exit(&state->thread_exit, 0); ++} ++ ++void af903x_start_monitor_thread(struct dvb_frontend *demod) ++{ ++ struct af903xm_state *st = demod? demod->demodulator_priv:NULL; ++ if( !st ) return; ++ ++#if USE_MONITOR_TH ++ // if st->thread_created is already 1, then skip thread creation ++ if( atomic_add_unless(&st->thread_created, 1, 1) ) { ++ st->thread_should_stop = 0; ++ init_completion(&st->thread_exit); ++ kernel_thread(af903x_monitor_thread_func, st, 0); ++ } ++#endif //USE_MONITOR_TH ++ ++} ++ ++void af903x_stop_monitor_thread(struct dvb_frontend *demod) ++{ ++ struct af903xm_state *st = demod? demod->demodulator_priv:NULL; ++ deb_data("- Enter %s Function -\n",__FUNCTION__); ++ if( !st ) return; ++ ++#if USE_MONITOR_TH ++ // if st->thread_created is alread 0, then skip thread destruction ++ if( atomic_add_unless(&st->thread_created, -1, 0) ) { ++ st->thread_should_stop = 1; ++ wait_for_completion(&st->thread_exit); ++ } ++#endif //USE_MONITOR_TH ++ deb_data("- Exit %s Function -\n",__FUNCTION__); ++} ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-ioctl.h b/drivers/media/dvb/dvb-usb/a867_af903x-ioctl.h +new file mode 100644 +index 0000000..14b6df9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-ioctl.h +@@ -0,0 +1,29 @@ ++#ifndef _AF903X_IOCTL_H_ ++#define _AF903X_IOCTL_H_ ++ ++#include /* needed for the _IOW etc stuff used later */ ++ ++/* ++ * Ioctl definitions ++ */ ++ ++/* Use 'k' as magic number */ ++#define AFA_IOC_MAGIC 'k' ++/* Please use a different 8-bit number in your code */ ++ ++//#define AFA_IOCRESETINTERVAL _IO(AFA_IOC_MAGIC, 0) ++ ++/* ++ * S means "Set" through a ptr, ++ * T means "Tell" directly with the argument value ++ * G means "Get": reply by setting through a pointer ++ * Q means "Query": response is on the return value ++ * X means "eXchange": switch G and S atomically ++ * H means "sHift": switch T and Q atomically ++ */ ++ ++ ++/* ... more to come */ ++ ++#define AFA_IOC_MAXNR 14 ++#endif /* _AF903X-IOCTL_H_ */ +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x-tuner.c b/drivers/media/dvb/dvb-usb/a867_af903x-tuner.c +new file mode 100644 +index 0000000..6ad5768 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x-tuner.c +@@ -0,0 +1,122 @@ ++#include ++#include ++#include ++#include ++ ++#include "dvb_frontend.h" ++#include "a867_af903x.h" ++ ++#define IF2 36150 // IF2 frequency = 36.150 MHz ++#define FREF 16000 // Quartz oscillator 16 MHz ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int tuner_set_params(struct dvb_frontend *fe) ++{ ++ struct dtv_frontend_properties *params = &fe->dtv_property_cache; ++ struct tuner_priv *priv=NULL; ++ DWORD dwError = Error_NO_ERROR; ++ DWORD freq = params->frequency ;// 1000; // Hz -> kHz ++ ++ switch (params->delivery_system) { ++ case SYS_DVBT: ++ case SYS_DVBT2: ++ case SYS_ISDBT: ++ case SYS_DMBTH: ++ priv->bandwidth = params->bandwidth_hz; ++ break; ++ default: ++ priv->bandwidth = 0; ++ break; ++ } ++ ++ deb_data("%s - freq : %d , bandwidth : %dn",__FUNCTION__, freq, priv->bandwidth); ++ ++ /* here, frequency is expressed in KHz and bandwidth in MHz */ ++ dwError =DL_Tuner_SetFreq(freq/1000, priv->bandwidth/1000000); ++ if (dwError) deb_data("tuner_set_params Fail !\n"); ++ ++ return 0; ++} ++#else ++static int tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) ++{ ++ struct tuner_priv *priv=NULL; ++ DWORD dwError = Error_NO_ERROR; ++ DWORD freq = params->frequency ;// 1000; // Hz -> kHz ++ ++ priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; ++ ++ deb_data("%s - freq : %d , bandwidth : %dn",__FUNCTION__, freq,priv->bandwidth); ++ ++ dwError =DL_Tuner_SetFreq(freq,priv->bandwidth); ++ if (dwError) deb_data("tuner_set_params Fail !\n"); ++ ++ return 0; ++} ++#endif ++static int tuner_get_frequency(struct dvb_frontend *fe, u32 *frequency) ++{ ++ struct tuner_priv *priv = fe->tuner_priv; ++ *frequency = priv->frequency; ++ return 0; ++} ++ ++static int tuner_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) ++{ ++ struct tuner_priv *priv = fe->tuner_priv; ++ *bandwidth = priv->bandwidth; ++ return 0; ++} ++ ++static int tuner_init(struct dvb_frontend *fe) ++{ ++ ++ return 0; ++} ++ ++static int tuner_sleep(struct dvb_frontend *fe) ++{ ++ return 0; ++} ++ ++static int tuner_release(struct dvb_frontend *fe) ++{ ++ kfree(fe->tuner_priv); ++ fe->tuner_priv = NULL; ++ return 0; ++} ++ ++static const struct dvb_tuner_ops tuner_tuner_ops = { ++ .info = { ++ .name = "dvb_usb_tuner", ++ .frequency_min = 48000000, ++ .frequency_max = 860000000, ++ .frequency_step = 50000, ++ }, ++ ++ .release = tuner_release, ++ ++ .init = tuner_init, ++ .sleep = tuner_sleep, ++ ++ .set_params = tuner_set_params, ++ .get_frequency = tuner_get_frequency, ++ .get_bandwidth = tuner_get_bandwidth ++}; ++ ++/* This functions tries to identify a MT2060 tuner by reading the PART/REV register. This is hasty. */ ++struct dvb_frontend * tuner_attach(struct dvb_frontend *fe) ++{ ++ struct tuner_priv *priv = NULL; ++ ++ priv = kzalloc(sizeof(struct tuner_priv), GFP_KERNEL); ++ if (priv == NULL) ++ return NULL; ++ ++ memcpy(&fe->ops.tuner_ops, &tuner_tuner_ops, sizeof(struct dvb_tuner_ops)); ++ ++ fe->tuner_priv = priv; ++ ++ return fe; ++} ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_af903x.h b/drivers/media/dvb/dvb-usb/a867_af903x.h +new file mode 100644 +index 0000000..03f7ea9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_af903x.h +@@ -0,0 +1,311 @@ ++ ++#ifndef _AF903X_H_ ++#define _AF903X_H_ ++ ++#define DVB_USB_LOG_PREFIX "AF903X" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) ++#include ++#else ++#include ++#endif ++#include ++#include ++#include "dvb-usb.h" ++#include "a867_af903x-ioctl.h" ++#include "a867_demodulator.h" ++#include "a867_userdef.h" ++//#include "a867_firmware.h" ++#include "a867_type.h" ++#include "a867_Common.h" ++#include "a867_debug.h" ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 197120)) ++/* all DVB frontend drivers now work directly with the DVBv5 ++ * structure. This warrants that all drivers will be ++ * getting/setting frontend parameters on a consistent way, in ++ * order to avoid copying data from/to the DVBv3 structs ++ * without need. ++ */ ++#define V4L2_ONLY_DVB_V5 ++#endif ++ ++#define ENABLE_TEST_FUNCTION 0 ++#define ENABLE_HW_PID 0 ++ ++ ++//enable snr reading register , default = 0 ++#define ENABLE_READ_REG 1 ++ ++ ++#define SUPPORT_AF903X_EVB 0 ++ ++//***************** from device.h *****************// ++#define AFA_USB_DEVICE ++ ++#define SLAVE_DEMOD_2WIREADDR 0x3A ++ ++#define TS_PACKET_SIZE 188 ++#define TS_PACKET_COUNT_HI 348 ++#define TS_PACKET_COUNT_FU 21 ++ ++//***************** from driver.h *****************// ++#define TS_FRAMES_HI 16 ++#define TS_FRAMES_FU 128 ++#define MAX_USB20_IRP_NUM 5 ++#define MAX_USB11_IRP_NUM 2 ++ ++//***************** from afdrv.h *****************// ++#define GANY_ONLY 0x42F5 ++#define EEPROM_FLB_OFS 8 ++ ++#define EEPROM_IRMODE (GANY_ONLY+EEPROM_FLB_OFS+0x10) //00:disabled, 01:HID ++#define EEPROM_SELSUSPEND (GANY_ONLY+EEPROM_FLB_OFS+0x28) //Selective Suspend Mode ++#define EEPROM_TSMODE (GANY_ONLY+EEPROM_FLB_OFS+0x28+1) //0:one ts, 1:dual ts ++#define EEPROM_2WIREADDR (GANY_ONLY+EEPROM_FLB_OFS+0x28+2) //MPEG2 2WireAddr ++#define EEPROM_SUSPEND (GANY_ONLY+EEPROM_FLB_OFS+0x28+3) //Suspend Mode ++#define EEPROM_IRTYPE (GANY_ONLY+EEPROM_FLB_OFS+0x28+4) //0:NEC, 1:RC6 ++#define EEPROM_SAWBW1 (GANY_ONLY+EEPROM_FLB_OFS+0x28+5) ++#define EEPROM_XTAL1 (GANY_ONLY+EEPROM_FLB_OFS+0x28+6) //0:28800, 1:20480 ++#define EEPROM_SPECINV1 (GANY_ONLY+EEPROM_FLB_OFS+0x28+7) ++#define EEPROM_TUNERID (GANY_ONLY+EEPROM_FLB_OFS+0x30+4) // ++#define EEPROM_IFFREQL (GANY_ONLY+EEPROM_FLB_OFS+0x30) ++#define EEPROM_IFFREQH (GANY_ONLY+EEPROM_FLB_OFS+0x30+1) ++#define EEPROM_IF1L (GANY_ONLY+EEPROM_FLB_OFS+0x30+2) ++#define EEPROM_IF1H (GANY_ONLY+EEPROM_FLB_OFS+0x30+3) ++#define EEPROM_SHIFT (0x10) //EEPROM Addr Shift for slave front end ++ ++#define CHECK_LOCK_LOOPS (20) ++#define USE_MONITOR_TH 1 ++ ++ ++extern int dvb_usb_af903x_debug; ++extern int dvb_usb_af903x_snrdb; ++/* ++#if CONFIG_DVB_USB_DEBUG ++#define avprintk(dbg, lvl, fmt, args...) \ ++ do { \ ++ printk(fmt, ## args); \ ++ } while(0) ++#else ++#define avprintk(dbg, lvl, fmt, args...) do {} while(0) ++#endif //CONFIG_DVB_USB_DEBUG ++ ++#define deb_info(fmt, args...) avprintk(dvb_usb_af903x_debug,0x01,fmt, ## args) ++#define deb_fw(fmt, args...) avprintk(dvb_usb_af903x_debug,0x02,fmt, ## args) ++#define deb_fwdata(fmt, args...) avprintk(dvb_usb_af903x_debug,0x04,fmt, ## args) ++#define deb_data(fmt, args...) avprintk(dvb_usb_af903x_debug,0x08,fmt, ## args) ++*/ ++//#define deb_data(args...) printk(KERN_NOTICE args) ++ ++#define deb_force(args...) printk(KERN_DEBUG args); ++#define deb_info(args...) if (dvb_usb_af903x_debug & 1) printk(KERN_DEBUG args); ++#define deb_fw(args...) if (dvb_usb_af903x_debug & 2) printk(KERN_DEBUG args); ++#define deb_fwdata(args...) if (dvb_usb_af903x_debug & 4) printk(KERN_DEBUG args); ++#define deb_data(args...) if (dvb_usb_af903x_debug & 8) printk(KERN_DEBUG args); ++ ++typedef struct _GPIO_MAPPINGS { ++ unsigned short I2C_SLAVE_ADDR; ++ unsigned short RF_SW_HOST; ++ int GPIO_UHF_en; ++ int GPIO_UHF_on; ++ int GPIO_UHF_o; ++ int GPIO_VHF_en; ++ int GPIO_VHF_on; ++ int GPIO_VHF_o; ++ int GPIO_WP_en; ++ int GPIO_WP_on; ++ int GPIO_WP_o; ++ int GPIO_OSC_en; ++ int GPIO_OSC_on; ++ int GPIO_OSC_o; ++ int GPIO_TUR1_en; ++ int GPIO_TUR1_on; ++ int GPIO_TUR1_o; ++ int GPIO_TUR2_en; ++ int GPIO_TUR2_on; ++ int GPIO_TUR2_o; ++ int GPIO_DPWR_en; ++ int GPIO_DPWR_on; ++ int GPIO_DPWR_o; ++ int GPIO_DRST_en; ++ int GPIO_DRST_on; ++ int GPIO_DRST_o; ++ int GPIO_STR_en; ++ int GPIO_STR_on; ++ int GPIO_STR_o; ++ int GPIO_STR_i; ++ int GPIO_LED_en; ++ int GPIO_LED_on; ++ int GPIO_LED_o; ++} GPIO_MAPPINGS, *PGPIO_MAPPINGS; ++ ++//***************** from device.h *****************// ++typedef struct _TUNER_INFO { ++ ++ Bool bTunerInited; ++ Bool bSettingFreq; ++ BYTE TunerId; ++ Bool bTunerOK; ++ Tuner_struct MXL5005_Info; ++ ++} TUNER_INFO, *PTUNER_INFO; ++ ++ ++typedef struct _FILTER_INFO{ ++ int filternum; ++ Bool onoff; ++} FILTER_INFO; ++ ++ ++typedef struct _FILTER_CONTEXT_HW { ++ DWORD ulCurrentFrequency; ++ WORD ucCurrentBandWidth; ++ DWORD ulDesiredFrequency; ++ WORD ucDesiredBandWidth; ++ //ULONG ulBandWidth; ++ Bool bTimerOn; ++ // PKSFILTER filter; ++ Byte GraphBuilt; ++ TUNER_INFO tunerinfo; ++ //SIGNAL_STATISTICS ss; ++ //SIGNAL_RETRAIN sr; ++ //DWORD gdwOrigFCW; //move from AF901x.cpp [global variable] ++ //BYTE gucOrigUnplugTh; //move from AF901x.cpp [global variable] ++ //BYTE gucPreShiftIdx; //move from AF901x.cpp [global variable] ++ // PKSFILTERFACTORY pFilterFactory; ++ int bEnPID; ++ int ulcPIDs; ++ FILTER_INFO aulPIDs[32]; ++ Bool bApOn; ++ int bResetTs; ++ Byte OvrFlwChk; ++ Byte UnLockCount; ++ ++ BYTE AVerFlags; ++} FILTER_CONTEXT_HW, *PFILTER_CONTEXT_HW; ++ ++typedef struct _DEVICE_CONTEXT { ++ FILTER_CONTEXT_HW fc[2]; ++ Byte DeviceNo; ++ Bool bBootCode; ++ Bool bEP12Error; ++ Bool bEP45Error; ++ //bool bDebugMsg; ++ //bool bDevExist; ++ Bool bDualTs; ++ Bool bIrTblDownload; ++ Byte BulkOutData[256]; ++ u32 WriteLength; ++ Bool bSurpriseRemoval; ++ Bool bDevNotResp; ++ Bool bEnterSuspend; ++ Bool bSupportSuspend; ++ Bool bSupportSelSuspend; ++ u16 regIdx; ++ Byte eepromIdx; ++ u16 UsbMode; ++ u16 MaxPacketSize; ++ u32 MaxIrpSize; ++ u32 TsFrames; ++ u32 TsFrameSize; ++ u32 TsFrameSizeDw; ++ u32 TsPacketCount; ++ //BYTE ucDemod2WireAddr; ++ //USB_IDLE_CALLBACK_INFO cbinfo; // callback info for selective suspend // our selective suspend IRP ++ ++ Bool bSelectiveSuspend; ++ u32 ulActiveFilter; ++ //BYTE ucSerialNo; ++ Architecture architecture; ++ //BYTE Tuner_Id; ++ StreamType StreamType; ++ Bool bDCAPIP; ++ Bool bSwapFilter; ++ Byte FilterCnt; ++ Bool bTunerPowerOff; ++ //PKSPIN PinSave; ++ Byte UsbCtrlTimeOut; ++ ++ Ganymede Demodulator; ++ ++ Bool ForceWrite; ++ ++ GPIO_MAPPINGS Map; ++ ++ struct semaphore powerLock; ++ int power_use_count; ++ struct semaphore tunerLock; ++ ++ unsigned short idVendor; ++ unsigned short idProduct; ++ ++ struct semaphore regLock; ++ ++} DEVICE_CONTEXT, *PDEVICE_CONTEXT; ++ ++#define PTI (PDC->fc[ucSlaveDemod].tunerinfo) //TunerInfo pointer ++ ++ ++ ++struct af903x_ofdm_channel { ++ u32 RF_kHz; ++ u8 Bw; ++ s16 nfft; ++ s16 guard; ++ s16 nqam; ++ s16 vit_hrch; ++ s16 vit_select_hp; ++ s16 vit_alpha; ++ s16 vit_code_rate_hp; ++ s16 vit_code_rate_lp; ++ u8 intlv_native; ++}; ++ ++struct tuner_priv { ++ struct tuner_config *cfg; ++ struct i2c_adapter *i2c; ++ ++ u32 frequency; ++ u32 bandwidth; ++ u16 if1_freq; ++ u8 fmfreq; ++}; ++ ++extern struct dvb_frontend * tuner_attach(struct dvb_frontend *fe); ++extern struct dvb_frontend * af903x_attach(u8 TMP); ++extern struct dvb_usb_device_properties af903x_properties[]; ++extern struct usb_device_id af903x_usb_id_table[]; ++extern struct usb_device *udevs; ++extern struct usb_interface *uintfs; ++extern PDEVICE_CONTEXT PDC; ++extern int af903x_device_count; ++ ++extern void af903x_start_monitor_thread(struct dvb_frontend *demod); ++extern void af903x_stop_monitor_thread(struct dvb_frontend *demod); ++ ++extern DWORD Device_init(struct usb_device *udev, struct usb_interface *uintf, PDEVICE_CONTEXT PDCs, Bool bBoot); ++extern DWORD DL_ApCtrl (Bool bOn); ++extern DWORD DL_Tuner_SetBW(u8 ucBw); ++extern DWORD DL_Tuner_SetFreq(u32 ucFreq,u8 ucBw); ++extern DWORD DL_ReSetInterval(void); ++extern DWORD DL_GetChannelStat(u32 *ber, u32 *berbits, u32 *ubc); ++extern DWORD DL_GetSignalStrength(u16 *strength); ++extern DWORD DL_GetSignalQuality(u16 *strength); ++extern DWORD DL_GetLocked(Bool *bLock); ++extern DWORD DL_MonitorReception(Bool *bLock); ++extern DWORD DL_IsPsbOverflow(void *handle, Byte ucSlaveDemod, Bool *bPsvOverflow); ++extern DWORD DL_Reboot(void); ++extern DWORD DL_ResetPID(void); ++extern DWORD DL_AddPID(BYTE index, Pid pid); ++extern DWORD DL_PIDOnOff(DWORD OnOff); ++extern DWORD DL_RemovePID(BYTE index, Pid pid); ++ ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_aver_version.h b/drivers/media/dvb/dvb-usb/a867_aver_version.h +new file mode 100644 +index 0000000..c321316 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_aver_version.h +@@ -0,0 +1 @@ ++#define DRIVER_VER "1.0.27" +diff --git a/drivers/media/dvb/dvb-usb/a867_cmd.c b/drivers/media/dvb/dvb-usb/a867_cmd.c +new file mode 100644 +index 0000000..3f6007e +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_cmd.c +@@ -0,0 +1,1005 @@ ++#include "a867_cmd.h" ++ ++ ++Byte Cmd_sequence = 0; ++ ++ ++Dword Bus_addChecksum ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ Dword loop = (*bufferLength - 1) / 2; ++ Dword remain = (*bufferLength - 1) % 2; ++ Dword i; ++ Word checksum = 0; ++ ++ for (i = 0; i < loop; i++) ++ checksum += (Word) (buffer[2 * i + 1] << 8) + (Word) (buffer[2 * i + 2]); ++ if (remain) ++ checksum += (Word) (buffer[*bufferLength - 1] << 8); ++ checksum = ~checksum; ++ buffer[*bufferLength] = (Byte) ((checksum & 0xFF00) >> 8); ++ buffer[*bufferLength + 1] = (Byte) (checksum & 0x00FF); ++ buffer[0] = (Byte) (*bufferLength + 1); ++ *bufferLength += 2; ++ ++ return (error); ++} ++ ++ ++Dword Bus_removeChecksum ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ Dword loop = (*bufferLength - 3) / 2; ++ Dword remain = (*bufferLength - 3) % 2; ++ Dword i; ++ Word checksum = 0; ++ ++ for (i = 0; i < loop; i++) ++ checksum += (Word) (buffer[2 * i + 1] << 8) + (Word) (buffer[2 * i + 2]); ++ if (remain) ++ checksum += (Word) (buffer[*bufferLength - 3] << 8); ++ checksum = ~checksum; ++ if (((Word) (buffer[*bufferLength - 2] << 8) + (Word) (buffer[*bufferLength - 1])) != checksum) { ++ error = Error_WRONG_CHECKSUM; ++ goto exit; ++ } ++ if (buffer[2]) ++ error = Error_FIRMWARE_STATUS | buffer[2]; ++ buffer[0] = (Byte) (*bufferLength - 3); ++ *bufferLength -= 2; ++ ++exit : ++ return (error); ++} ++ ++ ++Dword Cmd_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (writeBufferLength == 0) goto exit; ++ if (registerAddressLength > 4) { ++ error = Error_PROTOCOL_FORMAT_INVALID; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ i = 0; ++ while (i < writeBufferLength) { ++ ++ j = (writeBufferLength - i) > (maxPktSize - 12) ? (maxPktSize - 12) : (writeBufferLength - i); ++ command = Bus_buildCommand (Command_REG_DEMOD_WRITE, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) j; ++ buffer[5] = (Byte) registerAddressLength; ++ buffer[6] = (Byte) ((registerAddress + i) >> 24); /** Get first byte of reg. address */ ++ buffer[7] = (Byte) ((registerAddress + i) >> 16); /** Get second byte of reg. address */ ++ buffer[8] = (Byte) ((registerAddress + i) >> 8); /** Get third byte of reg. address */ ++ buffer[9] = (Byte) (registerAddress + i); /** Get fourth byte of reg. address */ ++ ++ for (k = 0; k < j; k++) ++ buffer[10 + k] = writeBuffer[i + k]; ++ ++ bufferLength = j + 10; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ i += j; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (valueSetsLength == 0) goto exit; ++ if (valueSetsAddressLength > 4) { ++ error = Error_PROTOCOL_FORMAT_INVALID; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ i = 0; ++ while (i < valueSetsLength) { ++ j = (valueSetsLength - i) > ((maxPktSize - 10) / 3) ? ((maxPktSize - 10) / 3) : (valueSetsLength - i); ++ command = Bus_buildCommand (Command_SCATTER_WRITE, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) 2; /** Type 2 */ ++ if (processor == Processor_LINK) ++ buffer[5] = (Byte) 0; ++ else ++ buffer[5] = (Byte) 1; ++ buffer[6] = (Byte) 0; ++ buffer[7] = (Byte) j; ++ ++ for (k = 0; k < j; k++) { ++ buffer[8 + k * 2] = (Byte) (valueSets[k].address >> 8); ++ buffer[9 + k * 2] = (Byte) valueSets[k].address; ++ buffer[8 + j * 2 + k] = (Byte) valueSets[k].value; ++ } ++ ++ bufferLength = 8 + j * 3; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ i += j; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++) { ++ ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ if (writeBufferLength == 0) ++ { ++ command = Bus_buildCommand (Command_REG_TUNER_WRITE, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) 0; ++ buffer[5] = (Byte) tunerAddress; ++ buffer[6] = (Byte) registerAddressLength; ++ buffer[7] = (Byte) ((registerAddress) >> 8); /** Get high byte of reg. address */ ++ buffer[8] = (Byte) (registerAddress); /** Get low byte of reg. address */ ++ ++ bufferLength = 9; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ goto exit; ++ } ++ ++ i = 0; ++ while (i < writeBufferLength) { ++ j = (writeBufferLength - i) > (maxPktSize - 11) ? (maxPktSize - 11) : (writeBufferLength - i); ++ command = Bus_buildCommand (Command_REG_TUNER_WRITE, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) j; ++ buffer[5] = (Byte) tunerAddress; ++ buffer[6] = (Byte) registerAddressLength; ++ buffer[7] = (Byte) ((registerAddress + i) >> 8); /** Get high byte of reg. address */ ++ buffer[8] = (Byte) (registerAddress + i); /** Get low byte of reg. address */ ++ ++ for (k = 0; k < j; k++) ++ buffer[9 + k] = writeBuffer[ i + k]; ++ ++ bufferLength = j + 9; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ i += j; ++ } ++ ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Byte i; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (writeBufferLength == 0) goto exit; ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ command = Bus_buildCommand (Command_REG_EEPROM_WRITE, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) writeBufferLength; ++ buffer[5] = (Byte) eepromAddress; ++ buffer[6] = (Byte) registerAddressLength; ++ buffer[7] = (Byte) (registerAddress >> 8); /** Get high byte of reg. address */ ++ buffer[8] = (Byte) registerAddress; /** Get low byte of reg. address */ ++ ++ for (i = 0; i < writeBufferLength; i++) ++ buffer[9 + i] = writeBuffer[i]; ++ ++ bufferLength = writeBufferLength + 9; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (readBufferLength == 0) goto exit; ++ if (registerAddressLength > 4) { ++ error = Error_PROTOCOL_FORMAT_INVALID; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ i = 0; ++ while (i < readBufferLength) { ++ ++ j = (readBufferLength - i) > (maxPktSize - 5) ? (maxPktSize - 5) : (readBufferLength - i); ++ command = Bus_buildCommand (Command_REG_DEMOD_READ, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) j; ++ buffer[5] = (Byte) registerAddressLength; ++ buffer[6] = (Byte) ((registerAddress + i) >> 24); /** Get first byte of reg. address */ ++ buffer[7] = (Byte) ((registerAddress + i) >> 16); /** Get second byte of reg. address */ ++ buffer[8] = (Byte) ((registerAddress + i) >> 8); /** Get third byte of reg. address */ ++ buffer[9] = (Byte) (registerAddress + i); /** Get fourth byte of reg. address */ ++ ++ bufferLength = 10; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = j + 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ for (k = 0; k < j; k++) { ++ readBuffer[i + k] = buffer[k + 3]; ++ } ++ ++ i += j; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (valueSetsLength == 0) goto exit; ++ if (valueSetsAddressLength > 4) { ++ error = Error_PROTOCOL_FORMAT_INVALID; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ i = 0; ++ while (i < valueSetsLength) { ++ j = (valueSetsLength - i) > ((maxPktSize - 10) / 2) ? ((maxPktSize - 10) / 2) : (valueSetsLength - i); ++ command = Bus_buildCommand (Command_SCATTER_READ, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) 2; /** Type 2 */ ++ if (processor == Processor_LINK) ++ buffer[5] = (Byte) 0; ++ else ++ buffer[5] = (Byte) 1; ++ buffer[6] = (Byte) 0; ++ buffer[7] = (Byte) j; ++ ++ for (k = 0; k < j; k++) { ++ buffer[8 + k * 2] = (Byte) (valueSets[k].address >> 8); ++ buffer[9 + k * 2] = (Byte) valueSets[k].address; ++ } ++ ++ bufferLength = 8 + j * 2; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = j + 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ for (k = 0; k < j; k++) { ++ //(Byte) valueSets[i + k].value = buffer[k + 3]; ++ valueSets[i + k].value = (Byte) buffer[k + 3]; ++ } ++ ++ i += j; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ IN Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (readBufferLength == 0) goto exit; ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ i = 0; ++ while (i < readBufferLength) { ++ j = (readBufferLength - i) > (maxPktSize - 5) ? (maxPktSize - 5) : (readBufferLength - i); ++ command = Bus_buildCommand (Command_REG_TUNER_READ, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) j; ++ buffer[5] = (Byte) tunerAddress; ++ buffer[6] = (Byte) registerAddressLength; ++ buffer[7] = (Byte) ((registerAddress + i) >> 8); /** Get high byte of reg. address */ ++ buffer[8] = (Byte) (registerAddress + i); /** Get low byte of reg. address */ ++ ++ bufferLength = 9; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = j + 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ for (k = 0; k < j; k++) { ++ readBuffer[i + k] = buffer[k + 3]; ++ } ++ ++ i += j; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ OUT Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Byte i; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (readBufferLength == 0) goto exit; ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ command = Bus_buildCommand (Command_REG_EEPROM_READ, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) readBufferLength; ++ buffer[5] = (Byte) eepromAddress; ++ buffer[6] = (Byte) registerAddressLength; ++ buffer[7] = (Byte) (registerAddress >> 8); /** Get high byte of reg. address */ ++ buffer[8] = (Byte) registerAddress; /** Get low byte of reg. address */ ++ ++ bufferLength = 9; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = readBufferLength + 5; ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ for (i = 0; i < readBufferLength; i++) { ++ readBuffer[i] = buffer[i + 3]; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_modifyRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Byte temp; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ if (registerAddressLength > 4) { ++ error = Error_PROTOCOL_FORMAT_INVALID; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ command = Bus_buildCommand (Command_REG_DEMOD_READ, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) 1; ++ buffer[5] = (Byte) registerAddressLength; ++ buffer[6] = (Byte) (registerAddress >> 24); /** Get first byte of reg. address */ ++ buffer[7] = (Byte) (registerAddress >> 16); /** Get second byte of reg. address */ ++ buffer[8] = (Byte) (registerAddress >> 8); /** Get third byte of reg. address */ ++ buffer[9] = (Byte) registerAddress; /** Get fourth byte of reg. address */ ++ ++ bufferLength = 10; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 6; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ temp = buffer[3]; ++ temp = REG_CREATE (value, temp, position, length); ++ ++ command = Bus_buildCommand (Command_REG_DEMOD_WRITE, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) 1; ++ buffer[5] = (Byte) registerAddressLength; ++ buffer[6] = (Byte) (registerAddress >> 24); /** Get first byte of reg. address */ ++ buffer[7] = (Byte) (registerAddress >> 16); /** Get second byte of reg. address */ ++ buffer[8] = (Byte) (registerAddress >> 8); /** Get third byte of reg. address */ ++ buffer[9] = (Byte) registerAddress; /** Get fourth byte of reg. address */ ++ buffer[10] = temp; ++ ++ bufferLength = 11; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Dword length, ++ IN Byte* firmware ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Dword loop; ++ Dword remain; ++ Dword i, j, k; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ loop = length / (maxPktSize - 6); ++ remain = length % (maxPktSize - 6); ++ k = 0; ++ command = Bus_buildCommand (Command_FW_DOWNLOAD, Processor_LINK, 0); ++ for (i = 0; i < loop; i++) { ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ for (j = 0; j < (maxPktSize - 6); j++) ++ buffer[4 + j] = firmware[k++]; ++ bufferLength = (maxPktSize - 2); ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ } ++ if (remain) { ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ for (j = 0; j < remain; j++) ++ buffer[4 + j] = firmware[k++]; ++ bufferLength = (Word) (4 + remain); ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_reboot ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ command = Bus_buildCommand (Command_REBOOT, Processor_LINK, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ bufferLength = 4; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_sendCommand ( ++ IN Demodulator* demodulator, ++ IN Word command, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Dword i, j, k; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ if (writeBufferLength == 0) { ++ command = Bus_buildCommand (command, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ bufferLength = 4; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ } else { ++ i = 0; ++ while (i < writeBufferLength) { ++ j = (writeBufferLength - i) > (maxPktSize - 6) ? (maxPktSize - 6) : (writeBufferLength - i); ++ command = Bus_buildCommand (command, processor, chip); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ for (k = 0; k < j; k++) ++ buffer[k + 4] = writeBuffer[i + k]; ++ ++ bufferLength = j + 4; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ i += j; ++ } ++ } ++ ++ if (readBufferLength == 0) { ++ bufferLength = 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ } else { ++ i = 0; ++ while (i < readBufferLength) { ++ j = (readBufferLength - i) > (maxPktSize - 5) ? (maxPktSize - 5) : (readBufferLength - i); ++ ++ bufferLength = j + 5; ++ ++ error = pbusDesc->busRx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = Bus_removeChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ for (k = 0; k < j; k++) ++ readBuffer[i + k] = buffer[k + 3]; ++ ++ i += j; ++ } ++ } ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Dword Cmd_receiveData ( ++ IN Demodulator* demodulator, ++ IN Dword registerAddress, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ Word command; ++ Byte buffer[256]; ++ Dword bufferLength; ++ Ganymede* ganymede; ++ CmdDescription* pcmdDesc; ++ BusDescription* pbusDesc; ++ Dword maxPktSize; ++ ++ if (readBufferLength == 0) goto exit; ++ ++ ganymede = (Ganymede*) demodulator; ++ pcmdDesc = ganymede->cmdDescription; ++ pbusDesc = pcmdDesc->busDescription; ++ maxPktSize = pcmdDesc->mailBoxSize; ++ ++ User_enterCriticalSection (demodulator); ++ ++ command = Bus_buildCommand (Command_DATA_READ, Processor_LINK, 0); ++ buffer[1] = (Byte) (command >> 8); ++ buffer[2] = (Byte) command; ++ buffer[3] = (Byte) Cmd_sequence++; ++ buffer[4] = (Byte) ((readBufferLength >> 16) & 0xFF); ++ buffer[5] = (Byte) ((readBufferLength >> 8) & 0xFF); ++ buffer[6] = (Byte) (readBufferLength & 0xFF); ++ buffer[7] = (Byte) ((registerAddress >> 16) & 0xFF); ++ buffer[8] = (Byte) ((registerAddress >> 8) & 0xFF); ++ buffer[9] = (Byte) (registerAddress & 0xFF); ++ ++ bufferLength = 10; ++ error = Bus_addChecksum (demodulator, &bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busTx (demodulator, bufferLength, buffer); ++ if (error) goto exit; ++ ++ error = pbusDesc->busRxData (demodulator, readBufferLength, readBuffer); ++ ++exit : ++ User_leaveCriticalSection (demodulator); ++ return (error); ++} ++ ++ ++Word Cmd_busId = Bus_USB; ++CmdDescription Cmd_busDescription = { ++ 0, ++ NULL, ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++}; +diff --git a/drivers/media/dvb/dvb-usb/a867_cmd.h b/drivers/media/dvb/dvb-usb/a867_cmd.h +new file mode 100644 +index 0000000..d7cb1f6 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_cmd.h +@@ -0,0 +1,246 @@ ++#ifndef __CMD_H__ ++#define __CMD_H__ ++ ++ ++#include "a867_type.h" ++#include "a867_user.h" ++#include "a867_error.h" ++ ++/** ++ * Bus types ++ */ ++#define Bus_I2C 1 ++#define Bus_USB 2 ++#define Bus_SPI 3 ++#define Bus_SDIO 4 ++#define Bus_USB11 5 ++#define Bus_I2M 6 /** I2C bus for Mercury */ ++#define Bus_I2U 7 /** I2C bus for Mercury USB */ ++ ++ ++/** ++ * Define commands ++ */ ++#define Command_REG_DEMOD_READ 0x0000 ++#define Command_REG_DEMOD_WRITE 0x0001 ++#define Command_REG_TUNER_READ 0x0002 ++#define Command_REG_TUNER_WRITE 0x0003 ++#define Command_REG_EEPROM_READ 0x0004 ++#define Command_REG_EEPROM_WRITE 0x0005 ++#define Command_VAR_READ 0x0008 ++#define Command_VAR_WRITE 0x0009 ++ ++#define Command_DATA_READ 0x0006 ++ ++#define Command_PLATFORM_GET 0x000A ++#define Command_PLATFORM_SET 0x000B ++#define Command_IP_CACHE 0x000D ++#define Command_IP_ADD 0x000E ++#define Command_IP_REMOVE 0x000F ++#define Command_PID_ADD 0x0010 ++#define Command_PID_REMOVE 0x0011 ++#define Command_SIPSI_GET 0x0012 /** Get SI/PSI table for specific PID "once". */ ++#define Command_SIPSI_MPE_RESET 0x0013 ++#define Command_H_PID_ADD 0x0015 ++#define Command_H_PID_REMOVE 0x0016 ++#define Command_ABORT 0x0017 ++#define Command_IR_GET 0x0018 ++#define Command_IR_SET 0x0019 ++#define Command_FW_DOWNLOAD_BEGIN 0x0024 ++#define Command_FW_DOWNLOAD 0x0021 ++#define Command_FW_DOWNLOAD_END 0x0025 ++#define Command_QUERYINFO 0x0022 ++#define Command_BOOT 0x0023 ++#define Command_REBOOT 0x0023 ++#define Command_RUN_CODE 0x0026 ++#define Command_SCATTER_READ 0x0028 ++#define Command_SCATTER_WRITE 0x0029 ++#define Command_GENERIC_READ 0x002A ++#define Command_GENERIC_WRITE 0x002B ++ ++#define Command_SERVICES_GET 0x0083 ++#define Command_COMPONENT_ADD 0x0086 ++#define Command_COMPONENT_REMOVE 0x0087 ++#define Command_FIG_ADD 0x0088 ++#define Command_FIG_REMOVE 0x0089 ++ ++ ++#define Bus_MAX_WRITE_SIZE 254 ++#define Bus_MAX_READ_SIZE 254 ++ ++ ++#define Bus_buildCommand(command, processor, chip) (command + (Word) (processor << 12) + (Word) (chip << 12)) ++ ++ ++/** ++ * ++ */ ++Dword Cmd_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++ ++/** ++ * ++ */ ++Dword Cmd_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ IN Byte* readBuffer ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_modifyRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Dword length, ++ IN Byte* firmware ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_reboot ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * ++ */ ++Dword Cmd_sendCommand ( ++ IN Demodulator* demodulator, ++ IN Word command, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++Dword Cmd_receiveData ( ++ IN Demodulator* demodulator, ++ IN Dword registerAddress, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++extern Word Cmd_busId; ++extern CmdDescription Cmd_busDescription; ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_compat.h b/drivers/media/dvb/dvb-usb/a867_compat.h +new file mode 100644 +index 0000000..d043287 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_compat.h +@@ -0,0 +1,503 @@ ++/* ++ * $Id: compat.h,v 1.1.1.1 2008/07/09 07:30:49 stylon Exp $ ++ */ ++ ++#ifndef _COMPAT_H ++#define _COMPAT_H ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) ++#define KERN_CONT "" ++#endif ++ ++/* To allow I2C compatibility code to work */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) ++#include ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) ++# define set_freezable() ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18) ++# define minor(x) MINOR(x) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) ++# define DEVICE_ATTR(a,b,c,d) CLASS_DEVICE_ATTR(a,b,c,d) ++# define device_create_file(a,b) class_device_create_file(a,b) ++# define device_remove_file(a,b) class_device_remove_file(a,b) ++# define device_register(a) class_device_register(a) ++# define device_unregister(a) class_device_unregister(a) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++# include ++# include ++# define need_resched() (current->need_resched) ++# define work_struct tq_struct ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19) ++# define BUG_ON(condition) do { if ((condition)!=0) BUG(); } while(0) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) ++# define irqreturn_t void ++# define IRQ_RETVAL(foobar) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) ++# define strlcpy(dest,src,len) strncpy(dest,src,(len)-1) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++# define iminor(inode) minor(inode->i_rdev) ++#endif ++ ++#if defined(I2C_ADAP_CLASS_TV_ANALOG) && !defined(I2C_CLASS_TV_ANALOG) ++# define I2C_CLASS_TV_ANALOG I2C_ADAP_CLASS_TV_ANALOG ++# define I2C_CLASS_TV_DIGITAL I2C_ADAP_CLASS_TV_DIGITAL ++#endif ++ ++#ifndef __pure ++# define __pure __attribute__((pure)) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++# define __user ++# define __kernel ++# define __iomem ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ++# define pm_message_t u32 ++# define pci_choose_state(pci_dev, state) (state) ++# define PCI_D0 (0) ++# define assert_spin_locked(foobar) ++#endif ++ ++/* Since v4l-dvb now includes it's own copy of linux/i2c-id.h these ++ are no longer necessary */ ++/* ++#if !defined(I2C_ALGO_SAA7134) ++#define I2C_ALGO_SAA7134 I2C_HW_B_BT848 ++#endif ++#if !defined(I2C_HW_B_CX2388x) ++# define I2C_HW_B_CX2388x I2C_HW_B_BT848 ++#endif ++#if !defined(I2C_HW_SAA7134) ++# define I2C_HW_SAA7134 I2C_ALGO_SAA7134 ++#endif ++#if !defined(I2C_HW_SAA7146) ++# define I2C_HW_SAA7146 I2C_ALGO_SAA7146 ++#endif ++#if !defined(I2C_HW_B_EM2820) ++#define I2C_HW_B_EM2820 0x99 ++#endif ++*/ ++ ++#ifndef I2C_M_IGNORE_NAK ++# define I2C_M_IGNORE_NAK 0x1000 ++#endif ++ ++/* v4l-dvb uses an out of kernel copy of i2c-id.h, which does not have ++ some stuff that previous versions of i2c-id.h defined. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) && defined(LINUX_I2C_ID_H) ++# define I2C_ALGO_BIT 0x010000 ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++#define __le32 __u32 ++#endif ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) ++static inline unsigned long msecs_to_jiffies(const unsigned int m) ++{ ++#if HZ <= 1000 && !(1000 % HZ) ++ return (m + (1000 / HZ) - 1) / (1000 / HZ); ++#else ++#if HZ > 1000 && !(HZ % 1000) ++ return m * (HZ / 1000); ++#else ++ return (m * HZ + 999) / 1000; ++#endif ++#endif ++} ++static inline unsigned int jiffies_to_msecs(const unsigned long j) ++{ ++#if HZ <= 1000 && !(1000 % HZ) ++ return (1000 / HZ) * j; ++#else ++#if HZ > 1000 && !(HZ % 1000) ++ return (j + (HZ / 1000) - 1)/(HZ / 1000); ++#else ++ return (j * 1000) / HZ; ++#endif ++#endif ++} ++static inline void msleep(unsigned int msecs) ++{ ++ unsigned long timeout = msecs_to_jiffies(msecs); ++ while (timeout) { ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++} ++#endif ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++static inline unsigned long msleep_interruptible(unsigned int msecs) ++{ ++ unsigned long timeout = msecs_to_jiffies(msecs); ++ ++ while (timeout) { ++ set_current_state(TASK_INTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++ return jiffies_to_msecs(timeout); ++} ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++/* some keys from 2.6.x which are not (yet?) in 2.4.x */ ++# define KEY_PLAY 207 ++# define KEY_PRINT 210 ++# define KEY_EMAIL 215 ++# define KEY_SEARCH 217 ++# define KEY_SELECT 0x161 ++# define KEY_GOTO 0x162 ++# define KEY_INFO 0x166 ++# define KEY_CHANNEL 0x16b ++# define KEY_LANGUAGE 0x170 ++# define KEY_SUBTITLE 0x172 ++# define KEY_ZOOM 0x174 ++# define KEY_MODE 0x175 ++# define KEY_TV 0x179 ++# define KEY_CD 0x17f ++# define KEY_TUNER 0x182 ++# define KEY_TEXT 0x184 ++# define KEY_DVD 0x185 ++# define KEY_AUDIO 0x188 ++# define KEY_VIDEO 0x189 ++# define KEY_RED 0x18e ++# define KEY_GREEN 0x18f ++# define KEY_YELLOW 0x190 ++# define KEY_BLUE 0x191 ++# define KEY_CHANNELUP 0x192 ++# define KEY_CHANNELDOWN 0x193 ++# define KEY_RESTART 0x198 ++# define KEY_SHUFFLE 0x19a ++# define KEY_NEXT 0x197 ++# define KEY_RADIO 0x181 ++# define KEY_PREVIOUS 0x19c ++# define KEY_MHP 0x16f ++# define KEY_EPG 0x16d ++# define KEY_FASTFORWARD 208 ++# define KEY_LIST 0x18b ++# define KEY_LAST 0x195 ++# define KEY_CLEAR 0x163 ++# define KEY_AUX 0x186 ++# define KEY_SCREEN 0x177 ++# define KEY_PC 0x178 ++# define KEY_MEDIA 226 ++# define KEY_SLOW 0x199 ++# define KEY_OK 0x160 ++# define KEY_DIGITS 0x19d ++#endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++# define KEY_SEND 231 ++# define KEY_REPLY 232 ++# define KEY_FORWARDMAIL 233 ++# define KEY_SAVE 234 ++# define KEY_DOCUMENTS 235 ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++#define container_of(ptr, type, member) ({ \ ++ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ++ (type *)( (char *)__mptr - offsetof(type,member) );}) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) ++#include ++static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) ++{ ++ return page_to_pfn(vmalloc_to_page(vmalloc_addr)); ++} ++ ++static unsigned long kvirt_to_pa(unsigned long adr) ++{ ++ unsigned long kva, ret; ++ ++ kva = (unsigned long) page_address(vmalloc_to_page((void *)adr)); ++ kva |= adr & (PAGE_SIZE-1); /* restore the offset */ ++ ret = __pa(kva); ++ return ret; ++} ++ ++#ifndef wait_event_timeout ++#define wait_event_timeout(wq, condition, timeout) \ ++({ \ ++ long __ret = timeout; \ ++ if (!(condition)) \ ++ do { \ ++ DEFINE_WAIT(__wait); \ ++ for (;;) { \ ++ prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ ++ if (condition) \ ++ break; \ ++ __ret = schedule_timeout(__ret); \ ++ if (!__ret) \ ++ break; \ ++ } \ ++ finish_wait(&wq, &__wait); \ ++ } while (0); \ ++ __ret; \ ++}) ++#endif ++ ++#define remap_pfn_range remap_page_range ++ ++#endif ++ ++/* vm_insert_page() was added in 2.6.15 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_MM_H) ++static inline int vm_insert_page(struct vm_area_struct *vma, ++ unsigned long addr, struct page *page) ++{ ++ return remap_pfn_range(vma, addr, page_to_pfn(page), PAGE_SIZE, ++ vma->vm_page_prot); ++} ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++#ifndef kcalloc ++#define kcalloc(n,size,flags) \ ++({ \ ++ void * __ret = NULL; \ ++ __ret = kmalloc(n * size, flags); \ ++ if (__ret) \ ++ memset(__ret, 0, n * size); \ ++ __ret; \ ++}) ++#endif ++#endif ++ ++/* try_to_freeze() lost its argument. Must appear after linux/sched.h */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && defined(_LINUX_SCHED_H) ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ++# define try_to_freeze() try_to_freeze(PF_FREEZE) ++# else ++# define try_to_freeze() (0) ++# endif ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++#ifndef kzalloc ++#define kzalloc(size, flags) \ ++({ \ ++ void *__ret = kmalloc(size, flags); \ ++ if (__ret) \ ++ memset(__ret, 0, size); \ ++ __ret; \ ++}) ++#endif ++#endif ++ ++/* The class_device system didn't appear until 2.5.69 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++#define class_device_create_file(a, b) (0) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) ++# define class_device_create(a, b, c, d, e, f, g, h) class_simple_device_add(a, c, d, e, f, g, h) ++# define class_device_destroy(a, b) class_simple_device_remove(b) ++# define class_create(a, b) class_simple_create(a, b) ++# define class_destroy(a) class_simple_destroy(a) ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) ++# define class_device_create(a, b, c, d, e, f, g, h) class_device_create(a, c, d, e, f, g, h) ++#endif ++/* device_create/destroy added in 2.6.18 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) ++/* on older kernels, class_device_create will in turn be a compat macro */ ++# define device_create(a, b, c, d, e, f, g) class_device_create(a, NULL, c, b, d, e, f, g) ++# define device_destroy(a, b) class_device_destroy(a, b) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) ++# define input_allocate_device() kzalloc(sizeof(struct input_dev),GFP_KERNEL); ++# define input_free_device(input_dev) kfree(input_dev) ++# ifdef _INPUT_H /* input.h must be included _before_ compat.h for this to work */ ++ /* input_register_device() was changed to return an error code in 2.6.15 */ ++# define input_register_device(x) (input_register_device(x), 0) ++# endif ++#endif ++ ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) ++#define DEFINE_MUTEX(a) DECLARE_MUTEX(a) ++#define mutex_lock_interruptible(a) down_interruptible(a) ++#define mutex_unlock(a) up(a) ++#define mutex_lock(a) down(a) ++#define mutex_init(a) init_MUTEX(a) ++#define mutex_trylock(a) down_trylock(a) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) && defined(_LINUX_SCHED_H) ++static inline signed long __sched ++schedule_timeout_interruptible(signed long timeout) ++{ ++ __set_current_state(TASK_INTERRUPTIBLE); ++ return schedule_timeout(timeout); ++} ++#endif ++ ++/* New 4GB DMA zone was added in 2.6.15-rc2 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) ++# define __GFP_DMA32 __GFP_DMA ++#endif ++ ++/* setup_timer() helper added 10/31/05, 2.6.15-rc1 */ ++/* Need linux/timer.h to be included for struct timer_list */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_TIMER_H) ++static inline void setup_timer(struct timer_list * timer, ++ void (*function)(unsigned long), ++ unsigned long data) ++{ ++ timer->function = function; ++ timer->data = data; ++ init_timer(timer); ++} ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) ++#define IRQF_SHARED SA_SHIRQ ++#define IRQF_DISABLED SA_INTERRUPT ++#endif ++ ++/* linux/usb.h must be included _before_ compat.h for this code to get ++ turned on. We can not just include usb.h here, because there is a ++ lot of code which will not compile if it has usb.h included, due to ++ conflicts with symbol names. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && \ ++ defined(__LINUX_USB_H) && defined(_INPUT_H) ++#include ++/* Found in linux/usb_input.h in 2.6.13 */ ++/* Moved to linux/usb/input.h in 2.6.18 */ ++static inline void ++usb_to_input_id(const struct usb_device *dev, struct input_id *id) ++{ ++ id->bustype = BUS_USB; ++ id->vendor = le16_to_cpu(dev->descriptor.idVendor); ++ id->product = le16_to_cpu(dev->descriptor.idProduct); ++ id->version = le16_to_cpu(dev->descriptor.bcdDevice); ++} ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ++# define PCIAGP_FAIL 0 ++ ++#define vmalloc_32_user(a) vmalloc_32(a) ++ ++#endif ++ ++/* bool type and enum-based definition of true and false was added in 2.6.19 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ++typedef int bool; ++#define true 1 ++#define false 0 ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) ++#define sony_pic_camera_command(a,b) sonypi_camera_command(a,b) ++ ++#define SONY_PIC_COMMAND_SETCAMERAAGC SONYPI_COMMAND_SETCAMERAAGC ++#define SONY_PIC_COMMAND_SETCAMERABRIGHTNESS SONYPI_COMMAND_SETCAMERABRIGHTNESS ++#define SONY_PIC_COMMAND_SETCAMERACOLOR SONYPI_COMMAND_SETCAMERACOLOR ++#define SONY_PIC_COMMAND_SETCAMERACONTRAST SONYPI_COMMAND_SETCAMERACONTRAST ++#define SONY_PIC_COMMAND_SETCAMERAHUE SONYPI_COMMAND_SETCAMERAHUE ++#define SONY_PIC_COMMAND_SETCAMERAPICTURE SONYPI_COMMAND_SETCAMERAPICTURE ++#define SONY_PIC_COMMAND_SETCAMERASHARPNESS SONYPI_COMMAND_SETCAMERASHARPNESS ++#define SONY_PIC_COMMAND_SETCAMERA SONYPI_COMMAND_SETCAMERA ++#endif ++ ++/* Parameter to pci_match_device() changed in 2.6.13-rc2 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && defined(LINUX_PCI_H) ++#define pci_match_device(drv, dev) pci_match_device((drv)->id_table, dev) ++#endif ++ ++/* pci_dev got a new revision field in 2.6.23-rc1 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) && defined(LINUX_PCI_H) ++/* Just make it easier to subsitute pci_dev->revision with ++ * v4l_compat_pci_rev(pci_dev). It's too bad there isn't some kind of context ++ * sensitive macro in C that could do this for us. */ ++static inline u8 v4l_compat_pci_rev(struct pci_dev *pci) ++{ u8 rev; pci_read_config_byte(pci, PCI_REVISION_ID, &rev); return rev; } ++#endif ++ ++/* ALSA removed a bunch of typedefs and renamed some structs in 2.6.16 */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) ++# ifdef __SOUND_CORE_H ++# define snd_card _snd_card /* struct _snd_card became struct snd_card */ ++# define snd_pcm _snd_pcm ++# undef snd_device ++# define snd_device _snd_device ++# endif ++# ifdef __SOUND_PCM_H ++# define snd_pcm_substream _snd_pcm_substream ++# define snd_pcm_hardware _snd_pcm_hardware ++# define snd_pcm_runtime _snd_pcm_runtime ++# define snd_pcm_ops _snd_pcm_ops ++# endif ++# ifdef __SOUND_ASOUND_H ++# define snd_pcm_hw_params sndrv_pcm_hw_params ++# define snd_ctl_elem_info sndrv_ctl_elem_info ++# define snd_ctl_elem_value sndrv_ctl_elem_value ++# endif ++# ifdef __SOUND_CONTROL_H ++# undef snd_kcontrol ++# define snd_kcontrol _snd_kcontrol ++# define snd_kcontrol_new _snd_kcontrol_new ++# endif ++#endif ++ ++#if defined(COMPAT_PCM_TO_RATE_BIT) && defined(__SOUND_PCM_H) ++/* New alsa core utility function */ ++static inline unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) ++{ ++ static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, ++ 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 }; ++ unsigned int i; ++ ++ for (i = 0; i < ARRAY_SIZE(rates); i++) ++ if (rates[i] == rate) ++ return 1u << i; ++ return SNDRV_PCM_RATE_KNOT; ++} ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ++# define task_pid_nr(current) ((current)->pid) ++ ++# define sg_init_table(a,b) ++# define sg_page(p) (sg->page) ++# define sg_set_page(sglist,pg,sz,off) \ ++do { \ ++ struct scatterlist *p=sglist; \ ++ p->page = pg; \ ++ p->length = sz; \ ++ p->offset = off; \ ++} while (0) ++#endif ++ ++#ifndef BIT_MASK ++# define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) ++# define BIT_WORD(nr) ((nr) / BITS_PER_LONG) ++#endif ++ ++#endif ++/* ++ * Local variables: ++ * c-basic-offset: 8 ++ * End: ++ */ +diff --git a/drivers/media/dvb/dvb-usb/a867_debug.h b/drivers/media/dvb/dvb-usb/a867_debug.h +new file mode 100644 +index 0000000..08552fa +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_debug.h +@@ -0,0 +1,4 @@ ++ ++// turn on/off debug for all modules ++//#define CONFIG_DVB_USB_DEBUG 0 ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_demodulator.c b/drivers/media/dvb/dvb-usb/a867_demodulator.c +new file mode 100644 +index 0000000..9192004 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_demodulator.c +@@ -0,0 +1,540 @@ ++#include "a867_demodulator.h" ++ ++ ++Dword Demodulator_writeRegister ( ++ Demodulator* demodulator, ++ Byte chip, ++ Processor processor, ++ Dword registerAddress, ++ Byte value ++) { ++ return (Standard_writeRegister (demodulator, chip, processor, registerAddress, value)); ++} ++ ++ ++Dword Demodulator_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_writeRegisters (demodulator, chip, processor, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++) { ++ return (Standard_writeScatterRegisters (demodulator, chip, processor, valueSetsLength, valueSets)); ++} ++ ++ ++Dword Demodulator_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_writeTunerRegisters (demodulator, chip, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_writeGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_writeGenericRegisters (demodulator, chip, interfaceIndex, slaveAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_writeEepromValues (demodulator, chip, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_writeRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++) ++{ ++ return (Standard_writeRegisterBits (demodulator, chip, processor, registerAddress, position, length, value)); ++} ++ ++ ++Dword Demodulator_readRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ OUT Byte* value ++) { ++ return (Standard_readRegister (demodulator, chip, processor, registerAddress, value)); ++} ++ ++ ++Dword Demodulator_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++) { ++ return (Standard_readRegisters (demodulator, chip, processor, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++) { ++ return (Standard_readScatterRegisters (demodulator, chip, processor, valueSetsLength, valueSets)); ++} ++ ++ ++Dword Demodulator_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_readTunerRegisters (demodulator, chip, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_readGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ return (Standard_readGenericRegisters (demodulator, chip, interfaceIndex, slaveAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++) { ++ return (Standard_readEepromValues (demodulator, chip, registerAddress, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_readRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ OUT Byte* value ++) { ++ return (Standard_readRegisterBits (demodulator, chip, processor, registerAddress, position, length, value)); ++} ++ ++ ++Dword Demodulator_getHardwareVersion ( ++ IN Demodulator* demodulator, ++ OUT Dword* version ++) { ++ return (Standard_getHardwareVersion (demodulator, version)); ++} ++ ++ ++Dword Demodulator_getFirmwareVersion ( ++ IN Demodulator* demodulator, ++ IN Processor processor, ++ OUT Dword* version ++) { ++ return (Standard_getFirmwareVersion (demodulator, processor, version)); ++} ++ ++ ++Dword Demodulator_getRfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* rfAgc ++) { ++ return (Standard_getRfAgcGain (demodulator, chip, rfAgc)); ++} ++ ++ ++Dword Demodulator_getIfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* ifAgc ++) { ++ return (Standard_getIfAgcGain (demodulator, chip, ifAgc)); ++} ++ ++ ++Dword Demodulator_controlPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++) { ++ return (Standard_controlPidFilter (demodulator, chip, control)); ++} ++ ++ ++Dword Demodulator_addPidToFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++) { ++ return (Standard_addPidToFilter (demodulator, chip, index, pid)); ++} ++ ++ ++Dword Demodulator_resetPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ return (Standard_resetPidFilter (demodulator, chip)); ++} ++ ++ ++Dword Demodulator_loadIrTable ( ++ IN Demodulator* demodulator, ++ IN Word tableLength, ++ IN Byte* table ++) { ++ return (Standard_loadIrTable (demodulator, tableLength, table)); ++} ++ ++ ++Dword Demodulator_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Byte* firmwareCodes, ++ IN Segment* firmwareSegments, ++ IN Byte* firmwarePartitions ++) { ++ ++ return (Standard_loadFirmware (demodulator, firmwareCodes, firmwareSegments, firmwarePartitions)); ++} ++ ++ ++Dword Demodulator_initialize ( ++ IN Demodulator* demodulator, ++ IN Byte chipNumber, ++ IN Word sawBandwidth, ++ IN StreamType streamType, ++ IN Architecture architecture ++) { ++ return (Standard_initialize (demodulator, chipNumber, sawBandwidth, streamType, architecture)); ++} ++ ++ ++Dword Demodulator_finalize ( ++ IN Demodulator* demodulator ++) { ++ return (Standard_finalize (demodulator)); ++} ++ ++ ++Dword Demodulator_isAgcLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ return (Standard_isAgcLocked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_isCfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ return (Standard_isCfoeLocked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_isSfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ return (Standard_isSfoeLocked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_isTpsLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ return (Standard_isTpsLocked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_isMpeg2Locked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ return (Standard_isMpeg2Locked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_isLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) ++{ ++ return (Standard_isLocked (demodulator, chip, locked)); ++} ++ ++ ++Dword Demodulator_setPriority ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Priority priority ++) ++{ ++ return (Standard_setPriority (demodulator, chip, priority)); ++} ++ ++ ++Dword Demodulator_reset ( ++ IN Demodulator* demodulator ++) { ++ return (Standard_reset (demodulator)); ++} ++ ++ ++Dword Demodulator_getChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelModulation* channelModulation ++) { ++ return (Standard_getChannelModulation (demodulator, chip, channelModulation)); ++} ++ ++ ++Dword Demodulator_setChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN ChannelModulation* channelModulation ++) { ++ return (Standard_setChannelModulation (demodulator, chip, channelModulation)); ++} ++ ++ ++Dword Demodulator_acquireChannel ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++) { ++ return (Standard_acquireChannel (demodulator, chip, bandwidth, frequency)); ++} ++ ++ ++Dword Demodulator_setStreamType ( ++ IN Demodulator* demodulator, ++ IN StreamType streamType ++) { ++ return (Standard_setStreamType (demodulator, streamType)); ++} ++ ++ ++Dword Demodulator_setArchitecture ( ++ IN Demodulator* demodulator, ++ IN Architecture architecture ++) { ++ return (Standard_setArchitecture (demodulator, architecture)); ++} ++ ++ ++Dword Demodulator_getSignalQuality ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* quality ++) { ++ return (Standard_getSignalQuality (demodulator, chip, quality)); ++} ++ ++ ++Dword Demodulator_getSignalStrength ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* strength ++) { ++ return (Standard_getSignalStrength (demodulator, chip, strength)); ++} ++ ++ ++Dword Demodulator_getSignalStrengthDbm ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long rfpullUpVolt_X10, /** RF pull up voltage multiplied by 10 */ ++ IN Long ifpullUpVolt_X10, /** IF pull up voltage multiplied by 10 */ ++ OUT Long* strengthDbm /** DBm */ ++) { ++ return (Standard_getSignalStrengthDbm (demodulator, chip, rfpullUpVolt_X10, ifpullUpVolt_X10, strengthDbm)); ++} ++ ++Dword Demodulator_getPostVitBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* postErrorCount, /** 24 bits */ ++ OUT Dword* postBitCount, /** 16 bits */ ++ OUT Word* abortCount ++){ ++ return (Standard_getPostVitBer(demodulator, chip, postErrorCount, postBitCount, abortCount)); ++} ++ ++ ++Dword Demodulator_setStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte superFrameCount, ++ IN Word packetUnit ++) { ++ return (Standard_setStatisticRange (demodulator, chip, superFrameCount, packetUnit)); ++} ++ ++ ++Dword Demodulator_getStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte* superFrameCount, ++ IN Word* packetUnit ++) { ++ return (Standard_getStatisticRange (demodulator, chip, superFrameCount, packetUnit)); ++} ++ ++ ++Dword Demodulator_getStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Statistic* statistic ++) { ++ return (Standard_getStatistic (demodulator, chip, statistic)); ++} ++ ++ ++Dword Demodulator_getInterrupts ( ++ IN Demodulator* demodulator, ++ OUT Interrupts* interrupts ++) { ++ return (Standard_getInterrupts (demodulator, interrupts)); ++} ++ ++ ++Dword Demodulator_clearInterrupt ( ++ IN Demodulator* demodulator, ++ IN Interrupt interrupt ++) { ++ return (Standard_clearInterrupt (demodulator, interrupt)); ++} ++ ++ ++Dword Demodulator_getDataLength ( ++ IN Demodulator* demodulator, ++ OUT Dword* dataLength, ++ OUT Bool* valid ++) { ++ return (Standard_getDataLength (demodulator, dataLength, valid)); ++} ++ ++ ++//jamie: The function is unused. ++Dword Demodulator_getData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ return (Standard_getData (demodulator, bufferLength, buffer)); ++} ++ ++//jamie: The function is unused. ++Dword Demodulator_getDatagram ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++) { ++ return (Standard_getDatagram (demodulator, bufferLength, buffer)); ++} ++ ++ ++Dword Demodulator_getIrCode ( ++ IN Demodulator* demodulator, ++ OUT Dword* code ++) { ++ return (Standard_getIrCode (demodulator, code)); ++} ++ ++ ++Dword Demodulator_reboot ( ++ IN Demodulator* demodulator ++) { ++ return (Standard_reboot (demodulator)); ++} ++ ++ ++Dword Demodulator_controlPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++) { ++ return (Standard_controlPowerSaving (demodulator, chip, control)); ++} ++ ++ ++Dword Demodulator_controlTunerPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte control ++) { ++ return (Standard_controlTunerPowerSaving (demodulator, control)); ++} ++ ++ ++Dword Demodulator_setBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize burstSize ++) { ++ return (Standard_setBurstSize (demodulator, burstSize)); ++} ++ ++ ++Dword Demodulator_getBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize* burstSize ++) { ++ return (Standard_getBurstSize (demodulator, burstSize)); ++} +diff --git a/drivers/media/dvb/dvb-usb/a867_demodulator.h b/drivers/media/dvb/dvb-usb/a867_demodulator.h +new file mode 100644 +index 0000000..323cb2b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_demodulator.h +@@ -0,0 +1,1495 @@ ++#ifndef __GANYMEDE_H__ ++#define __GANYMEDE_H__ ++ ++ ++#include "a867_type.h" ++#include "a867_user.h" ++#include "a867_error.h" ++#include "a867_register.h" ++#include "a867_variable.h" ++#include "a867_cmd.h" ++#include "a867_standard.h" ++#include "a867_demodulatorextend.h" /** release1remove */ ++#include "a867_version.h" ++ ++/** ++ * Write one byte (8 bits) to a specific register in demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be written. ++ * @param value the value to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set the value of register 0xA000 in demodulator to 0.
++ *     error = Demodulator_writeRegister ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, 0);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte value ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the start address of the registers to be written. ++ * @param bufferLength the number of registers to be written. ++ * @param buffer a byte array which is used to store values to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3] = { 0x00, 0x01, 0x02 };
++ *     Ganymede ganymede;
++ *
++ *     // Set the value of register 0xA000 in demodulator to 0.
++ *     // Set the value of register 0xA001 in demodulator to 1.
++ *     // Set the value of register 0xA002 in demodulator to 2.
++ *     error = Demodulator_writeRegisters ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a collection of values to discontiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param valueSetsLength the number of values to be written. ++ * @param valueSets a ValueSet array which is used to store values to be ++ * written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     ValueSet valueSet[3];
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of register 0xA000, 0xA001 and 0xA002 in demodulator.
++ *     valueSet[0].address = 0xA000;
++ *     valueSet[0].value = 0x00;
++ *     valueSet[1].address = 0xA001;
++ *     valueSet[1].value = 0x01;
++ *     valueSet[2].address = 0xA002;
++ *     valueSet[2].value = 0x02;
++ *     error = Demodulator_writeScatterRegisters ((Demodulator*) &ganymede, 0, Processor_LINK, 3, valueSet);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in slave device. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the registers to be read. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3] = { 0x00, 0x01, 0x02 };
++ *     Ganymede ganymede;
++ *
++ *     // Set the value of register 0x0000 in tuner to 0.
++ *     // Set the value of register 0x0001 in tuner to 1.
++ *     // Set the value of register 0x0002 in tuner to 2.
++ *     error = Demodulator_writeTunerRegistersWithAddress ((Demodulator*) &ganymede, 0, 0x38, 0x00, 1, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in slave device ++ * through specified interface (1, 2, 3). ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param interfaceIndex the index of interface. The possible values are ++ * 1~3. ++ * @param slaveAddress the I2c address of slave device. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_writeGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous cells in the EEPROM. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5 (firmware will detect EEPROM address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the cells to be written. ++ * @param registerAddressLength the valid bytes of registerAddress. ++ * @param bufferLength the number of cells to be written. ++ * @param buffer a byte array which is used to store values to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3] = { 0x00, 0x01, 0x02 };
++ *     Ganymede ganymede;
++ *
++ *     // Set the value of cell 0x0000 in EEPROM to 0.
++ *     // Set the value of cell 0x0001 in EEPROM to 1.
++ *     // Set the value of cell 0x0002 in EEPROM to 2.
++ *     error = Demodulator_writeEepromValues ((Demodulator*) &ganymede, 0, 0x0000, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Modify bits in the specific register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be written. ++ * @param position the start position of bits to be modified (0 means the ++ * LSB of the specifyed register). ++ * @param length the length of bits. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Modify the LSB of register 0xA000 in demodulator to 0.
++ *     error = Demodulator_writeRegisterBits ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, 0, 1, 0);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_writeRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++); ++ ++ ++/** ++ * Read one byte (8 bits) from a specific register in demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param value the pointer used to store the value read from demodulator ++ * register. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte value;
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of register 0xA000 in demodulator.
++ *     error = Demodulator_readRegister ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, &value);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of 0xA000 is %2x", value);
++ * 
++ */ ++Dword Demodulator_readRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ OUT Byte* value ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3];
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of register 0xA000, 0xA001, 0xA002 in demodulator.
++ *     error = Demodulator_readRegisters ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of 0xA000 is %2x", buffer[0]);
++ *     printf ("The value of 0xA001 is %2x", buffer[1]);
++ *     printf ("The value of 0xA002 is %2x", buffer[2]);
++ * 
++ */ ++Dword Demodulator_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Read a collection of values to discontiguous registers from demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param valueSetsLength the number of values to be read. ++ * @param valueSets a ValueSet array which is used to store values to be ++ * read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     ValueSet valueSet[3];
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of register 0xA000, 0xA001 and 0xA002 in demodulator.
++ *     valueSet[0].address = 0xA000;
++ *     valueSet[1].address = 0xA001;
++ *     valueSet[2].address = 0xA002;
++ *     error = Demodulator_readScatterRegisters ((Demodulator*) &ganymede, 0, Processor_LINK, 3, valueSet);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of 0xA000 is %2x", valueSet[0].value);
++ *     printf ("The value of 0xA001 is %2x", valueSet[1].value);
++ *     printf ("The value of 0xA002 is %2x", valueSet[2].value);
++ * 
++ */ ++Dword Demodulator_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in tuner. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the registers to be read. ++ * @param registerAddressLength the valid bytes of registerAddress. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3];
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of register 0x0000, 0x0001, 0x0002 in tuner.
++ *     error = Demodulator_readTunerRegisters ((Demodulator*) &ganymede, 0, 0x0000, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of 0x0000 is %2x", buffer[0]);
++ *     printf ("The value of 0x0001 is %2x", buffer[1]);
++ *     printf ("The value of 0x0002 is %2x", buffer[2]);
++ * 
++ */ ++Dword Demodulator_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in slave device ++ * through specified interface (1, 2, 3). ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param interfaceIndex the index of interface. The possible values are ++ * 1~3. ++ * @param slaveAddress the I2c address of slave device. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_readGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous cells in the EEPROM. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5 (firmware will detect EEPROM address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the cells to be read. ++ * @param registerAddressLength the valid bytes of registerAddress. ++ * @param bufferLength the number of cells to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte buffer[3];
++ *     Ganymede ganymede;
++ *
++ *     // Get the value of cell 0x0000, 0x0001, 0x0002 in EEPROM.
++ *     error = Demodulator_readEepromValues ((Demodulator*) &ganymede, 0, 0x0000, 3, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of 0x0000 is %2x", buffer[0]);
++ *     printf ("The value of 0x0001 is %2x", buffer[1]);
++ *     printf ("The value of 0x0002 is %2x", buffer[2]);
++ * 
++ */ ++Dword Demodulator_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Read bits of the specified register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param position the start position of bits to be read (0 means the ++ * LSB of the specifyed register). ++ * @param length the length of bits. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte value;
++ *     Ganymede ganymede;
++ *
++ *     // Read the LSB of register 0xA000 in demodulator.
++ *     error = Demodulator_readRegisterBits ((Demodulator*) &ganymede, 0, Processor_LINK, 0xA000, 0, 1, &value);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     printf ("The value of LSB of 0xA000 is %2x", value);
++ * 
++ */ ++Dword Demodulator_readRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ OUT Byte* value ++); ++ ++ ++/** ++ * Get the version of hardware. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param version the version of hardware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Dword version;
++ *     Ganymede ganymede;
++ *
++ *     // Add PID to PID filter.
++ *     error = Demodulator_getHardwareVersion ((Demodulator*) &ganymede, &version);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("The version of hardware is : %X", version);
++ * 
++ */ ++Dword Demodulator_getHardwareVersion ( ++ IN Demodulator* demodulator, ++ OUT Dword* version ++); ++ ++ ++/** ++ * Get the version of firmware. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param version the version of firmware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Dword version;
++ *     Ganymede ganymede;
++ *
++ *     // Get the version of Link layer firmware.
++ *     error = Demodulator_getFirmwareVersion ((Demodulator*) &ganymede, Processor_LINK, &version);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("The version of firmware is : %X", version);
++ * 
++ */ ++Dword Demodulator_getFirmwareVersion ( ++ IN Demodulator* demodulator, ++ IN Processor processor, ++ OUT Dword* version ++); ++ ++ ++/** ++ * Add PID to PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param index the index of PID filter. ++ * @param pid the PID that will be add to PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Pid pid;
++ *     Ganymede ganymede;
++ *
++ *     pid.value = 0x0000;
++ *
++ *     // Add PID to PID filter.
++ *     error = Demodulator_addPidToFilter ((Demodulator*) &ganymede, 0, 1, pid);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_addPidToFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++); ++ ++ ++/** ++ * Reset PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     error = Demodulator_resetPidFilter ((Demodulator*) &ganymede, 0);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_resetPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * Get datagram from device. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_BUFFER_INSUFFICIENT: if buffer is too small. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Word bufferLength;
++ *     Byte buffer[4096];
++ *     Ganymede ganymede;
++ *
++ *     bufferLength = 4096;
++ *     error = Demodulator_getDatagram ((Demodulator*) &ganymede, &bufferLength, buffer);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_getDatagram ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Get RF AGC gain. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param rfAgc the value of RF AGC. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte rfAgc;
++ *     Ganymede ganymede;
++ *
++ *     // Set I2C as the control bus.
++ *     error = Demodulator_getRfAgcGain ((Demodulator*) &ganymede, 0, rfAgc);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_getRfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* rfAgc ++); ++ ++ ++/** ++ * Get IF AGC. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param ifAgc the value of IF AGC. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte ifAgc;
++ *     Ganymede ganymede;
++ *
++ *     // Set I2C as the control bus.
++ *     error = Demodulator_getIfAgcGain ((Demodulator*) &ganymede, 0, ifAgc);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_getIfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* ifAgc ++); ++ ++ ++/** ++ * Load the IR table for USB device. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param tableLength The length of IR table. ++ * @param table The content of IR table. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_loadIrTable ( ++ IN Demodulator* demodulator, ++ IN Word tableLength, ++ IN Byte* table ++); ++ ++ ++/** ++ * Load firmware to device ++ * ++ * @param demodulator the handle of demodulator. ++ * @firmwareCodes pointer to fw binary. ++ * @firmwareSegments pointer to fw segments. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Byte* firmwareCodes, ++ IN Segment* firmwareSegments, ++ IN Byte* firmwarePartitions ++); ++ ++ ++/** ++ * First, download firmware from host to demodulator. Actually, firmware is ++ * put in firmware.h as a part of source code. Therefore, in order to ++ * update firmware the host have to re-compile the source code. ++ * Second, setting all parameters which will be need at the beginning. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chipNumber The total number of demodulators. ++ * @param sawBandwidth SAW filter bandwidth in KHz. The possible values ++ * are 6000, 7000, and 8000 (KHz). ++ * @param streamType The format of output stream. ++ * @param architecture the architecture of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Initialize demodulators.
++ *     // SAW Filter  : 8MHz
++ *     // Stream Type : IP Datagram.
++ *     error = Demodulator_initialize ((Demodulator*) &ganymede, 1, 8, StreamType_IP_DATAGRAM, Architecture_DCA);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_initialize ( ++ IN Demodulator* demodulator, ++ IN Byte chipNumber, ++ IN Word sawBandwidth, ++ IN StreamType streamType, ++ IN Architecture architecture ++); ++ ++ ++/** ++ * Power off the demodulators. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Finalize demodulators.
++ *     error = Demodulator_finalize ((Demodulator*) &ganymede);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_finalize ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isAgcLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isCfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isSfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isTpsLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isMpeg2Locked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param locked the result of frequency tuning. True if there is ++ * demodulator can lock signal, False otherwise. ++ * @see Demodulator_acquireChannel ++ */ ++Dword Demodulator_isLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * Set priorty of modulation. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param priority modulation priority. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set priority.
++ *     error = Demodulator_setPriority ((Demodulator*) &ganymede, 0, Priority_HIGH);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setPriority ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Priority priority ++); ++ ++ ++/** ++ * Reset demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Reset demodulator.
++ *     error = Demodulator_reset ((Demodulator*) &ganymede);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_reset ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Get channel modulation related information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param channelModulation The modulation of channel. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelModulation* channelModulation ++); ++ ++ ++/** ++ * Set channel modulation related information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param channelModulation The modulation of channel. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN ChannelModulation* channelModulation ++); ++ ++ ++/** ++ * Specify the bandwidth of channel and tune the channel to the specific ++ * frequency. Afterwards, host could use output parameter dvbH to determine ++ * if there is a DVB-H signal. ++ * In DVB-T mode, after calling this function the output parameter dvbH ++ * should return False and host could use output parameter "locked" to check ++ * if the channel has correct TS output. ++ * In DVB-H mode, after calling this function the output parameter dvbH should ++ * return True and host could start get platform thereafter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param bandwidth The channel bandwidth. ++ * DVB-T: 5000, 6000, 7000, and 8000 (KHz). ++ * DVB-H: 5000, 6000, 7000, and 8000 (KHz). ++ * T-DMB: 5000, 6000, 7000, and 8000 (KHz). ++ * FM: 100, and 200 (KHz). ++ * @param frequency the channel frequency in KHz. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Bool locked;
++ *     Ganymede ganymede;
++ *
++ *     error = Demodulator_acquireChannel ((Demodulator*) &ganymede, 0, 8000, 666000);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *
++ *     error = Demodulator_isLocked ((Demodulator*) &ganymede, 0, &locked);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *
++ *     if (locked == True) {
++ *         // In DVB-T mode.
++ *         // Start to process TS
++ *         // Because DVB-T could be multiplex with DVB-H
++ *     }
++ * 
++ */ ++Dword Demodulator_acquireChannel ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++ ++ ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * ++ * Note: After host know all the available channels, and want to change to ++ * specific channel, host have to choose output mode before receive ++ * data. Please refer the example of Demodulator_setStreamType. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param streamType the possible values are ++ * DVB-H: StreamType_DVBH_DATAGRAM ++ * StreamType_DVBH_DATABURST ++ * DVB-T: StreamType_DVBT_DATAGRAM ++ * StreamType_DVBT_PARALLEL ++ * StreamType_DVBT_SERIAL ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     error = Demodulator_setStreamType ((Demodulator*) &ganymede, StreamType_DVBT_PARALLEL)
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setStreamType ( ++ IN Demodulator* demodulator, ++ IN StreamType streamType ++); ++ ++ ++/** ++ * Set the architecture of chip. When two of our device are using, they could ++ * be operated in Diversity Combine Architecture (DCA) or (PIP). Therefore, ++ * host could decide which mode to be operated. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param architecture the possible values are ++ * Architecture_DCA ++ * Architecture_PIP ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set architecture.
++ *     error = Demodulator_setArchitecture ((Demodulator*) &ganymede, Architecture_DCA)
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setArchitecture ( ++ IN Demodulator* demodulator, ++ IN Architecture architecture ++); ++ ++ ++/** ++ * Get the length of Data ++ * In DVB-T mode, data length should always equals 2K, ++ * In DVB-H mode, data length would be the length of IP datagram. ++ * NOTE: data can't be transfer via I2C bus, in order to transfer data ++ * host must provide SPI bus. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param dataLength the length of data. ++ * @param valid True if the data length is valid. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @see Demodulator_addIp ++ */ ++Dword Demodulator_getDataLength ( ++ IN Demodulator* demodulator, ++ OUT Dword* dataLength, ++ OUT Bool* valid ++); ++ ++ ++/** ++ * Get the IP datagram of Data. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength the length of buffer. ++ * @param buffer buffer used to get Data. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @see Demodulator_addIp ++ */ ++Dword Demodulator_getData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Get the type of interrupts. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param interrupts the type of interrupts. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Interrupt interrupts;
++ *     Ganymede ganymede;
++ *
++ *     // Get the type of interrupts.
++ *     error = Demodulator_getInterrupts ((Demodulator*) &ganymede, &interrupts);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     if (interrupts & Interrupt_VERSION) {
++ *         // Get IP version
++ *     }
++ *     if (interrupts & Interrupt_DVBH) {
++ *         // Get DVB-H Data
++ *     }
++ *     if (interrupts & Interrupt_DVBT) {
++ *         // Get DVB-T Data
++ *     }
++ *     if (interrupts & Interrupt_SIPSI) {
++ *         // Get SI/PSI
++ *     }
++ * 
++ */ ++Dword Demodulator_getInterrupts ( ++ IN Demodulator* demodulator, ++ OUT Interrupts* interrupts ++); ++ ++ ++/** ++ * Clear interrupts flag. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param interrupts interrupts flag. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set statistic range.
++ *     error = Demodulator_clearInterrupt ((Demodulator*) &ganymede, Interrupt_SIPSI);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_clearInterrupt ( ++ IN Demodulator* demodulator, ++ IN Interrupt interrupt ++); ++ ++ ++/** ++ * Get siganl quality. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param quality The value of signal quality. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getSignalQuality ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* quality ++); ++ ++ ++/** ++ * Get signal strength ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param strength The value of signal strength. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getSignalStrength ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* strength ++); ++ ++ ++/** ++ * Get signal strength in dbm ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param rfpullUpVolt_X10 the pullup voltag of RF multiply 10. ++ * @param ifpullUpVolt_X10 the pullup voltag of IF multiply 10. ++ * @param strengthDbm The value of signal strength in DBm. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getSignalStrengthDbm ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long rfpullUpVolt_X10, /** RF pull up voltage multiplied by 10 */ ++ IN Long ifpullUpVolt_X10, /** IF pull up voltage multiplied by 10 */ ++ OUT Long* strengthDbm /** DBm */ ++); ++ ++ ++/** ++ * Get post VitBer ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param postErrorCount error count after viterbi ++ * @param postBitCount total count after viterbi ++ * @param abortCount error count after reed-soloman ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getPostVitBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* postErrorCount, /** 24 bits */ ++ OUT Dword* postBitCount, /** 16 bits */ ++ OUT Word* abortCount ++); ++ ++ ++/** ++ * Set the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param frameCount the number of super frame for Pre-Viterbi. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set statistic range.
++ *     error = Demodulator_setStatisticRange ((Demodulator*) &ganymede, 0, 1, 10000);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte superFrameCount, ++ IN Word packetUnit ++); ++ ++ ++/** ++ * Get the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param frameCount the number of super frame for Pre-Viterbi. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte superFrameCount;
++ *     Word packetUnit;
++ *     Ganymede ganymede;
++ *
++ *     // Set statistic range.
++ *     error = Demodulator_getStatisticRange ((Demodulator*) &ganymede, 0, &superFrameCount, &packetUnit);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_getStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte* superFrameCount, ++ IN Word* packetUnit ++); ++ ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param statistic the structure that store all statistic values. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Statistic statistic;
++ *     double preBer;
++ *     double postBer;
++ *     Ganymede ganymede;
++ *
++ *     // Set statistic range.
++ *     error = Demodulator_getStatistic ((Demodulator*) &ganymede, 0, &statistic);
++ *     if (error)
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     preBer = (double) statistic.preVitErrorCount / (double) statistic.preVitBitCount;
++ *     printf ("Pre-Viterbi BER = %f\n", preBer);
++ *     postBer = (double) statistic.postVitErrorCount / (double) statistic.postVitBitCount;
++ *     printf ("Post-Viterbi BER = %f\n", postBer);
++ *     printf ("Abort Count = %d\n", statistic.abortCount);
++ *     if (statistic.signalPresented == True)
++ *         printf ("Signal Presented = True\n");
++ *     else
++ *         printf ("Signal Presented = False\n");
++ *     if (statistic.signalLocked == True)
++ *         printf ("Signal Locked = True\n");
++ *     else
++ *         printf ("Signal Locked = False\n");
++ *     printf ("Signal Quality = %d\n", statistic.signalQuality);
++ *     printf ("Signal Strength = %d\n", statistic.signalStrength);
++ * 
++ */ ++Dword Demodulator_getStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Statistic* statistic ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param code the value of IR raw code, the size should be 4 or 6, ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getIrCode ( ++ IN Demodulator* demodulator, ++ OUT Dword* code ++); ++ ++ ++/** ++ * Return to boot code ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_reboot ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Control PID fileter ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param contorl 0: Disable, 1: Enable. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_controlPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param contorl 1: Power up, 0: Power down; ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_controlPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++); ++ ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param contorl 1: Power up, 0: Power down; ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_controlTunerPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte control ++); ++ ++ ++/** ++ * Set datagram burst size. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param burstSize the burst size. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_NOT_SUPPORT: if the burst size is not support. ++ */ ++Dword Demodulator_setBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize burstSize ++); ++ ++ ++/** ++ * Get datagram burst size. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param burstSize the burst size. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_NOT_SUPPORT: if the burst size is not support. ++ */ ++Dword Demodulator_getBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize* burstSize ++); ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_demodulatorextend.c b/drivers/media/dvb/dvb-usb/a867_demodulatorextend.c +new file mode 100644 +index 0000000..594a303 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_demodulatorextend.c +@@ -0,0 +1,607 @@ ++#include "a867_demodulatorextend.h" ++/* ++#include "i2cimpl.h" ++#include "spiimpl.h" ++#include "i2uimpl.h" ++#include "i2u.h" ++#include "sdioimpl.h" ++*/ ++ ++#include "a867_usb2impl.h" ++#include "a867_cmd.h" ++ ++#include "a867_Maxlinear_MXL5007.h" ++#include "a867_Afa_AF9007.h" ++ ++static PidInfo pidInfo; ++BusDescription busDesc[] = ++{ ++ /** 0: NULL bus */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++ /** 1: I2C bus */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++ /** 2: USB bus */ ++ { ++ Usb2_getDriver, ++ Usb2_writeControlBus, ++ Usb2_readControlBus, ++ Usb2_readDataBus, ++ }, ++ /** 3: SPI bus */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++ /** 4: SDIO bus */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++ /** 5: USB11 bus */ ++ { ++ Usb2_getDriver, ++ Usb2_writeControlBus, ++ Usb2_readControlBus, ++ Usb2_readDataBus, ++ }, ++ /** 6: I2C for old mail box */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++ /** 7: USB for old mail box */ ++ { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ }, ++}; ++ ++CmdDescription cmdDesc[] = ++{ ++ /** NULL Bus */ ++ { ++ 0, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++ }, ++ /** 1:I2C Bus */ ++ { ++ 255, ++ &busDesc[1], ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++ }, ++ /** 2:USB Bus */ ++ { ++ 63, ++ &busDesc[2], ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++ }, ++ /** 3:SPI Bus */ ++ { ++ 255, ++ &busDesc[3], ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++ }, ++ /** 4:SDIO Bus */ ++ { ++ 255, ++ &busDesc[4], ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++ }, ++ /** 5:USB11 Bus */ ++ { ++ 63, ++ &busDesc[5], ++ Cmd_writeRegisters, ++ Cmd_writeScatterRegisters, ++ Cmd_writeTunerRegisters, ++ Cmd_writeEepromValues, ++ Cmd_readRegisters, ++ Cmd_readScatterRegisters, ++ Cmd_readTunerRegisters, ++ Cmd_readEepromValues, ++ Cmd_modifyRegister, ++ Cmd_loadFirmware, ++ Cmd_reboot, ++ Cmd_sendCommand, ++ Cmd_receiveData ++ }, ++ /** 6:I2C for old mailbox */ ++ { ++ 16, ++ &busDesc[6], ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++ }, ++ /** 7:USB for old mailbox */ ++ { ++ 16, ++ &busDesc[7], ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++ }, ++}; ++ ++Dword Demodulator_setBusTuner ( ++ IN Demodulator* demodulator, ++ IN Word busId, ++ IN Word tunerId ++) { ++ Dword error = Error_NO_ERROR; ++ ++ Ganymede* ganymede; ++ ganymede = (Ganymede*) demodulator; ++ ganymede->cmdDescription = &cmdDesc[busId]; ++ ganymede->busId = busId; ++ ++ switch(tunerId) { ++ case Tuner_Afatech_AF9007: ++ ganymede->tunerDescription = &tuner_AF9007; ++ break; ++ ++ case Tuner_Maxlinear_MXL5007: ++ ganymede->tunerDescription = &tuner_MXL5007; ++ break; ++ ++ default: ++ error = Error_INVALID_TUNER_TYPE; ++ goto exit; ++ break; ++ } ++ ++ if (ganymede->tunerDescription->tunerScript == NULL) { ++ ganymede->tunerDescription->tunerScript = NULL; ++ ganymede->tunerDescription->tunerScriptSets = NULL; ++ } ++ ++exit: ++ return(error); ++} ++ ++Dword Demodulator_getChannelStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelStatistic* channelStatistic ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetChannelStatisticRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.channelStatistic = channelStatistic; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETCHANNELSTATISTIC, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Dword postErrCnt; ++ Dword postBitCnt; ++ Word rsdAbortCnt; ++ Ganymede* ganymede; ++ ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ ++ /** Get BER if couter is ready, error = Error_RSD_COUNTER_NOT_READY if counter is not ready */ ++ if (ganymede->architecture == Architecture_PIP) { ++ error = Standard_getPostVitBer (demodulator, chip, &postErrCnt, &postBitCnt, &rsdAbortCnt); ++ if (error == Error_NO_ERROR) { ++ ganymede->channelStatistic[chip].postVitErrorCount = postErrCnt; ++ ganymede->channelStatistic[chip].postVitBitCount = postBitCnt; ++ ganymede->channelStatistic[chip].abortCount = rsdAbortCnt; ++ } ++ } else { ++ error = Standard_getPostVitBer (demodulator, 0, &postErrCnt, &postBitCnt, &rsdAbortCnt); ++ if (error == Error_NO_ERROR) { ++ ganymede->channelStatistic[chip].postVitErrorCount = postErrCnt; ++ ganymede->channelStatistic[chip].postVitBitCount = postBitCnt; ++ ganymede->channelStatistic[chip].abortCount = rsdAbortCnt; ++ } ++ } ++ ++ *channelStatistic = ganymede->channelStatistic[chip]; ++ ++#endif ++ ++ return (error); ++} ++Dword Demodulator_addPid ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Pid pid ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ AddPidRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.pid = pid; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_ADDPID, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte writeBuffer[2]; ++ Byte i, j; ++ Bool found; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (pidInfo.pidinit == False) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ for (j = 0; j < 32; j++) { ++ pidInfo.pidtable[i].pid[j] = 0xFFFF; ++ } ++ } ++ pidInfo.pidinit = True; ++ } ++ ++ /** Enable pid filter */ ++ if (pidInfo.pidcount == 0) { ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_en, mp2if_pid_en_pos, mp2if_pid_en_len, 1); ++ if (error) goto exit; ++ } else { ++ found = False; ++ for (i = 0; i < 32; i++) { ++ if (pidInfo.pidtable[chip].pid[i] == pid.value) { ++ found = True; ++ break; ++ } ++ } ++ if (found == True) ++ goto exit; ++ } ++ ++ for (i = 0; i < 32; i++) { ++ if (pidInfo.pidtable[chip].pid[i] == 0xFFFF) ++ break; ++ } ++ if (i == 32) { ++ error = Error_PID_FILTER_FULL; ++ goto exit; ++ } ++ ++ writeBuffer[0] = (Byte) pid.value; ++ writeBuffer[1] = (Byte) (pid.value >> 8); ++ ++ error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, p_mp2if_pid_dat_l, 2, writeBuffer); ++ if (error) goto exit; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_index_en, mp2if_pid_index_en_pos, mp2if_pid_index_en_len, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_mp2if_pid_index, i); ++ if (error) goto exit; ++ ++ pidInfo.pidtable[chip].pid[i] = pid.value; ++ pidInfo.pidcount++; ++ ++exit : ++#endif ++ ++ return (error); ++} ++ ++ ++Dword Demodulator_addPidAt ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++) { ++ return (Demodulator_addPidToFilter (demodulator, chip, index, pid)); ++} ++ ++ ++Dword Demodulator_removePid ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Pid pid ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ RemovePidRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.pid = pid; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_REMOVEPID, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte i; ++ Bool found; ++ Interrupts interrupts; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ found = False; ++ for (i = 0; i < 32; i++) { ++ if (pidInfo.pidtable[chip].pid[i] == pid.value) { ++ found = True; ++ break; ++ } ++ } ++ if (found == False) ++ goto exit; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_index_en, mp2if_pid_index_en_pos, mp2if_pid_index_en_len, 0); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_mp2if_pid_index, i); ++ if (error) goto exit; ++ ++ pidInfo.pidtable[chip].pid[i] = 0xFFFF; ++ ++ /** Disable pid filter */ ++ if (pidInfo.pidcount == 1) { ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_en, mp2if_pid_en_pos, mp2if_pid_en_len, 0); ++ ++ error = Standard_getInterrupts (demodulator, &interrupts); ++ if (error) goto exit; ++ if (interrupts & Interrupt_DVBT) { ++ error = Standard_clearInterrupt (demodulator, Interrupt_DVBT); ++ if (error) goto exit; ++ } ++ } ++ ++ pidInfo.pidcount--; ++ ++exit : ++#endif ++ ++ return (error); ++} ++ ++ ++Dword Demodulator_removePidAt ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ RemovePidAtRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.index = index; ++ request.pid = pid; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_REMOVEPIDAT, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_index_en, mp2if_pid_index_en_pos, mp2if_pid_index_en_len, 0); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_mp2if_pid_index, index); ++ if (error) goto exit; ++exit : ++#endif ++ ++ return (error); ++} ++ ++ ++Dword Demodulator_resetPid ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte i; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ for (i = 0; i < 32; i++) { ++ pidInfo.pidtable[chip].pid[i] = 0xFFFF; ++ } ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_rst, mp2if_pid_rst_pos, mp2if_pid_rst_len, 1); ++ if (error) goto exit; ++ ++ pidInfo.pidcount = 0; ++ ++exit : ++#endif ++ ++ return (error); ++} ++ ++ ++#ifdef UNDER_CE ++#else ++extern long ActiveSync; ++#endif ++ ++Dword Demodulator_controlActiveSync ( ++ IN Demodulator* demodulator, ++ IN Byte control ++) { ++#ifdef UNDER_CE ++ if (control == 0) ++ ActiveSync = 0; ++ else ++ ActiveSync = 1; ++#endif ++ ++ return (Error_NO_ERROR); ++} +diff --git a/drivers/media/dvb/dvb-usb/a867_demodulatorextend.h b/drivers/media/dvb/dvb-usb/a867_demodulatorextend.h +new file mode 100644 +index 0000000..20d508f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_demodulatorextend.h +@@ -0,0 +1,1326 @@ ++#ifndef __DEMODULATOREXTEND_H__ ++#define __DEMODULATOREXTEND_H__ ++ ++ ++//#include ++//#include ++#include "a867_type.h" ++#include "a867_user.h" ++#include "a867_register.h" ++#include "a867_error.h" ++#include "a867_cmd.h" ++/* ++#include "i2cimpl.h" ++#include "spiimpl.h" ++#include "sdioimpl.h" ++*/ ++#include "a867_usb2impl.h" ++#include "a867_demodulator.h" ++ ++ ++#define Tuner_Panasonic_ENV77H11D5 0x01 ++#define Tuner_Microtune_MT2060 0x02 ++#define Tuner_Maxlinear_MXL5003 0x03 ++#define Tuner_Philip_TD1316AFIHP 0x04 ++#define Tuner_Freescale_FS803A 0x05 ++#define Tuner_Quantek_QT1010 0x06 ++#define Tuner_Panasonic_ENV75H10D8 0x07 ++#define Tuner_Lg_TDTMG252D 0x08 ++#define Tuner_Himax_HTXR03A 0x09 ++#define Tuner_Alps_TDQ44M 0x0A ++#define Tuner_Infineon_TUA6045 0x0B ++#define Tuner_Infineon_TUA6034 0x0C ++#define Tuner_Maxlinear_MXL5005 0x0D ++#define Tuner_Thomson_664X 0x0E ++#define Tuner_Thomson_6630 0x0F ++#define Tuner_Samsung_DTOS403 0x10 ++#define Tuner_Samsung_DTOS446 0x11 ++#define Tuner_Freescale_FS803A_DLNA 0x12 ++#define Tuner_Microtune_MT2060_7SAW 0x13 ++#define Tuner_Alps_TDQ03 0x14 ++#define Tuner_Thomson_759X 0x15 ++#define Tuner_Empire_DTN317 0x16 ++#define Tuner_Partsnic_PDHTF05D 0x17 ++#define Tuner_Panasonic_ENG37A30GF 0x18 ++#define Tuner_Philips_FQD1216ME_MK5 0x19 ++#define Tuner_Infineon_TUA6041 0x1A ++#define Tuner_Philips_TDA18271 0x1B ++#define Tuner_Alps_TDQD1X001A 0x1C ++#define Tuner_Maxlinear_MXL5005_RSSI 0x1D ++#define Tuner_Thomson_75101 0x1E ++#define Tuner_Sharp_5056 0x1F ++#define Tuner_Freescale_MC44CD02 0x20 ++#define Tuner_Microtune_MT2260B0 0x21 ++#define Tuner_Philips_TDA18291HN 0x22 ++#define Tuner_Microtune_MT2266 0x23 ++#define Tuner_Integrant_ITD3020 0x24 ++#define Tuner_Afatech_PEACOCK 0x25 ++#define Tuner_Xceive_XC3028L 0x26 ++#define Tuner_Infineon_TUA9001 0x27 ++#define Tuner_Fitipower_FC0011 0x28 ++#define Tuner_Afatech_AF9007 0xFF ++#define Tuner_Maxlinear_MXL5007 0xA0 ++ ++/** ++ * Define commands for AGC general set function ++ */ ++#define APO_AGC_SET_RF_ACQUIRE 1 ++#define APO_AGC_SET_RF_TRACK 2 ++#define APO_AGC_SET_IF_ACQUIRE 3 ++#define APO_AGC_SET_IF_TRACK 4 ++#define APO_AGC_SET_ADC_OUT_DESIRED_S 5 ++#define APO_AGC_SET_RF_TOP_S 6 ++#define APO_AGC_SET_IF_TOP_S 7 ++#define APO_AGC_SET_RF_LOCK_TH_ACQUIRE 8 ++#define APO_AGC_SET_RF_LOCK_TH_TRACK 9 ++#define APO_AGC_SET_IF_LOCK_TH_ACQUIRE 10 ++#define APO_AGC_SET_IF_LOCK_TH_TRACK 11 ++#define APO_AGC_SET_ADC_OUT_DESIRED_M 12 ++#define APO_AGC_SET_RF_TOP_M 13 ++#define APO_AGC_SET_IF_TOP_M 14 ++#define APO_AGC_SET_RF_TOP 15 ++#define APO_AGC_SET_IF_TOP 16 ++ ++ ++/** ++ * Define commands for AGC general set function ++ */ ++#define APO_AGC_GET_RF_ACQUIRE 1 ++#define APO_AGC_GET_RF_TRACK 2 ++#define APO_AGC_GET_IF_ACQUIRE 3 ++#define APO_AGC_GET_IF_TRACK 4 ++#define APO_AGC_GET_RF_LOCK_TH_ACQUIRE 5 ++#define APO_AGC_GET_RF_LOCK_TH_TRACK 6 ++#define APO_AGC_GET_IF_LOCK_TH_ACQUIRE 7 ++#define APO_AGC_GET_IF_LOCK_TH_TRACK 8 ++#define APO_AGC_GET_RF_MAX 9 ++#define APO_AGC_GET_RF_MIN 10 ++#define APO_AGC_GET_RF_TOP_S 11 ++#define APO_AGC_GET_RF_TOP_M 17 ++#define APO_AGC_GET_IF_MAX 12 ++#define APO_AGC_GET_IF_MIN 13 ++#define APO_AGC_GET_IF_TOP_S 14 ++#define APO_AGC_GET_IF_TOP_M 18 ++#define APO_AGC_GET_RF_TOP 19 ++#define APO_AGC_GET_IF_TOP 20 ++#define APO_AGC_GET_ADC_OUT_DESIRED_S 15 ++#define APO_AGC_GET_ADC_OUT_DESIRED_M 16 ++ ++ ++/** ++ * Define Options ++ */ ++#define APO_OPTION_FREQSHIFT 0x00000001 ++#define APO_OPTION_DYNATOP 0x00000002 ++#define APO_OPTION_RET_NOW 0x00000004 ++#define APO_OPTION_REPEAT_RETRAIN 0x00000008 ++ ++ ++/** ++ * Define Demodulator_getDouble index ++ */ ++#define APO_GET_FREQ_SHIFT 1 ++#define APO_GET_ORIG_RF_TOP 2 ++#define APO_GET_ORIG_IF_TOP 3 ++#define APO_GET_FINAL_RF_TOP 4 ++#define APO_GET_FINAL_IF_TOP 5 ++#define APO_GET_BEST_RF_TOP 6 ++#define APO_GET_BEST_IF_TOP 7 ++ ++ ++/** ++ * Define commands for general CE information function ++ */ ++#define APO_AGC_CLEAR_REGS 1 ++#define APO_AGC_STALL_OFSM_ACCESS 2 ++#define APO_AGC_RESTORE_OFSM_ACCESS 3 ++ ++ ++#define APO_DCA_EN_UPPER 0x01 ++#define APO_DCA_EN_LOWER 0x02 ++#define APO_DCA_BOTH 0x00 ++ ++ ++/** keep for internal api release */ ++/** ++ * The type defination of PidTable. ++ */ ++typedef struct { ++ Word pid[32]; ++} PidTable; ++ ++typedef struct { ++ PidTable pidtable[2]; ++ Byte pidcount; ++ Bool pidinit; ++} PidInfo; ++/** end keep for internal api release */ ++ ++ ++extern Word DemodulatorExtend_diversityMode; ++extern double DemodulatorExtend_crystalFrequency; ++extern Word Tdmb_bitRateTable[64]; ++ ++ ++/** ++ * Set control bus and tuner. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param busId The ID of bus. ++ * @param tunerId The ID of tuner. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set I2C as the control bus. 
++ *     error = Demodulator_setBusTuner ((Demodulator*) &ganymede, Bus_I2C, Tuner_MICROTUNE_MT2060);
++ *     if (error) 
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setBusTuner ( ++ IN Demodulator* demodulator, ++ IN Word busId, ++ IN Word tunerId ++); ++ ++ ++/** ++ * Set firmware and script. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param crystalFrequency The value of crystal frequency on board (KHz). ++ * @param adcFrequency The value of desire internal ADC frequency (Hz). ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Ganymede ganymede;
++ *
++ *     // Set frequencies. 
++ *     error = Demodulator_setCrystalAdcFrequency ((Demodulator*) &ganymede, 30000, 20156250);
++ *     if (error) 
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setCrystalAdcFrequency ( ++ IN Demodulator* demodulator, ++ IN Dword crystalFrequency, ++ IN Dword adcFrequency ++); ++ ++ ++/** ++ * Set firmware and script. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param firmwareCodes The byte array of firmware code. ++ * @param firmwareSegments The segments of firmwares. ++ * @param firmwarePartitions The partitions of firmwares. ++ * @param scriptSets The sets of script. ++ * @param scripts The byte array of script. ++ * @param tunerScriptSets The sets of tunerScript. ++ * @param tunerScripts The byte array of tunerScript. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     Byte firmware[65535];
++ *     ValueSet script[256];
++ *     ValueSet tunerScript[256];
++ *     Ganymede ganymede;
++ *
++ *     // Set I2C as the control bus. 
++ *     error = Demodulator_setFirmwareScript ((Demodulator*) &ganymede, firmware, 65535, script, 256, tunerScript, 256);
++ *     if (error) 
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ * 
++ */ ++Dword Demodulator_setFirmwareScript ( ++ IN Demodulator* demodulator, ++ IN Byte* firmwareCodes, ++ IN Segment* firmwareSegments, ++ IN Byte* firmwarePartitions, ++ IN Word* scriptSets, ++ IN ValueSet* scripts, ++ IN Word* tunerScriptSets, ++ IN ValueSet* tunerScripts ++); ++ ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param statistic the structure that store all statistic values. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ *     Dword error = Error_NO_ERROR;
++ *     ChannelStatistic channelStatistic;
++ *     double preBer;
++ *     double postBer;
++ *     Ganymede ganymede;
++ *
++ *     // Set statistic range. 
++ *     error = Demodulator_getChannelStatistic ((Demodulator*) &ganymede, 0, &channelStatistic);
++ *     if (error) 
++ *         printf ("Error Code = %X", error);
++ *     else
++ *         printf ("Success");
++ *     preBer = (double) channelStatistic.preVitErrorCount / (double) channelStatistic.preVitBitCount;
++ *     printf ("Pre-Viterbi BER = %f\n", preBer);
++ *     postBer = (double) channelStatistic.postVitErrorCount / (double) channelStatistic.postVitBitCount;
++ *     printf ("Post-Viterbi BER = %f\n", postBer);
++ *     printf ("Abort Count = %d\n", channelStatistic.abortCount);
++ * 
++ */ ++Dword Demodulator_getChannelStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelStatistic* channelStatistic ++); ++ ++ ++/** ++ * Set the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param preErrorCount the number of super frame for Pre-Viterbi. ++ * @param preBitCount the number of packet unit for Post-Viterbi. ++ * @param snr the signal to noise ratio. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_getPreVitBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* preErrorCount, ++ OUT Dword* preBitCount, ++ OUT double* snr ++); ++ ++ ++/** ++ * Set the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param preErrorCount the number of super frame for Pre-Viterbi. ++ * @param preBitCount the number of packet unit for Post-Viterbi. ++ * @param snr the signal to noise ratio. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_getSoftBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* preErrorCount, ++ OUT Dword* preBitCount, ++ OUT double* snr ++); ++ ++ ++/** ++ * This function is used to get signal quality indicator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param sqi signal quality indicator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ *     Byte sqi;
++ * 
++ *     Demodulator_getSqi (0x38, 0, &sqi);
++ * 
++ */ ++Dword Demodulator_getSqi ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* sqi ++); ++ ++ ++/** ++ * Get IF agc voltage. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param doPullUpVolt The pull up voltage of tunre. ++ * @param dopVolt IF AGC voltage to be returned. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getIfAgcVoltage ( ++ IN Demodulator* demodulator, ++ IN double doPullUpVolt, ++ OUT double* dopVolt ++); ++ ++ ++/** ++ * Set maximum RF agc. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param doMaxRfAgc The maximum value of RF AGC. ++ * @param doVolt RF AGC voltage to be set. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMaxRfAgc ( ++ IN Demodulator* demodulator, ++ IN double doMaxRfAgc, ++ IN double doVolt ++); ++ ++ ++/** ++ * Set minimum rf agc. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param doMinRfAgc The minimum value of RF AGC. ++ * @param doVolt RF AGC voltage to be set. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMinRfAgc ( ++ IN Demodulator* demodulator, ++ IN double doMinRfAgc, ++ IN double doVolt ++); ++ ++ ++/** ++ * Set max if agc. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param doMaxIfAgc The maximum value of IF AGC. ++ * @param doVolt IF AGC voltage to be set. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMaxIfAgc ( ++ IN Demodulator* demodulator, ++ IN double doMaxIfAgc, ++ IN double doVolt ++); ++ ++ ++/** ++ * Set min if agc. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param doMinIfAgc The minimum value of IF AGC. ++ * @param doVolt IF AGC voltage to be set. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMinIfAgc ( ++ IN Demodulator* demodulator, ++ IN double doMinIfAgc, ++ IN double doVolt ++); ++ ++ ++/** ++ * General agc set function. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucCmd . ++ * @param vpParams . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setAgc ( ++ IN Demodulator* demodulator, ++ IN Byte ucCmd, ++ IN Word* vpParams ++); ++ ++ ++/** ++ * General agc get function. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucCmd . ++ * @param vpParams . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getAgc ( ++ IN Demodulator* demodulator, ++ IN Byte ucCmd, ++ IN void* vpParams ++); ++ ++ ++/** ++ * Check if INR detected. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param count INR count. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getInrCount ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Word* count ++); ++ ++ ++/** ++ * Check if CCI happens. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param cci0 1: CCI happen, 0: CCI doesn't happen. ++ * @param cci1 1: CCI happen, 0: CCI doesn't happen. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isCci ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* cci0, ++ OUT Bool* cci1 ++); ++ ++ ++/** ++ * Check if ACI happens ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param aci0 1: ACI happen, 0: ACI doesn't happen. ++ * @param aci1 1: ACI happen, 0: ACI doesn't happen. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isAci ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* aci0, ++ OUT Bool* aci1 ++); ++ ++ ++/** ++ * Get frequency offset. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param doTs Sampling period. ++ * @param lpNormOffset Normalized frequency offset (carrier spacing). ++ * @param lpOffset Frequency offset (22 bits) (Hz). ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getFrequencyOffset ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN double elementaryPeriod, ++ OUT Long* normalizedOffset, ++ OUT Long* offset ++); ++ ++ ++/** ++ * Get sampling clock offset in second ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param adcFrequency ADC frequency. ++ * @param elementaryPeriod Sampling period. ++ * @param offset ADC sampling clock offset in sec. ++ * @param offsetPpm ADC sampling clock offset in PPM. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getTimeOffset ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN double adcFrequency, ++ IN double elementaryPeriod, ++ OUT double* offset, ++ OUT double* offsetPpm ++); ++ ++ ++/** ++ * Set IF1 frequency of MT2060. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param dwIf1 The IF1 frequency (KHz). ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMT2060If1 ( ++ IN Demodulator* demodulator, ++ IN Dword dwIf1 ++); ++ ++ ++/** ++ * Clear FFT window position valid bit. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_resetFftWinPos ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * Clear FFT window position valid bit. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param delta Delta value for FFT window position. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getFftWinPos ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long* delta ++); ++ ++ ++/** ++ * Get crystal frequency (KHz). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param fpFreq Crystal frequency. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getXtalFreq ( ++ IN Demodulator* demodulator, ++ IN float* fpFreq ++); ++ ++ ++/** ++ * Test register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_testRegister ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Dump register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param cpFileName The name of file to be write. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_dumpRegister ( ++ IN Demodulator* demodulator, ++ IN char* cpFileName ++); ++ ++ ++/** ++ * Get frequency response from hardware. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param tone Sub-Carrier Index ( Real Index = 200*wIndex). ++ * @param realPart Real part of Constellation value. ++ * @param imaginaryPart Imaginary part of Constellation value. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getFrequencyResponse ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Word* tone, ++ OUT Long* realPart, ++ OUT Long* imaginaryPart ++); ++ ++ ++/** ++ * Get constellation value. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param tone Sub-Carrier Index ( Real Index = 200*wIndex). ++ * @param realPart Real part of Constellation value. ++ * @param imaginaryPart Imaginary part of Constellation value. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getConstellation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word tone, ++ OUT float* realPart, ++ OUT float* imaginaryPart ++); ++ ++ ++/** ++ * Capture constellation value (2). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param wIndex Sub-Carrier Index ( Real Index = 200*wIndex). ++ * @param wpReal real part of constellation value. ++ * @param wpImag imaginary part of constellation value. ++ * @param wpH2 H2 value. ++ * @param wpRealH real part of H. ++ * @param wpImagH imaginary part of H. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_capConstellation2 ( ++ IN Demodulator* demodulator, ++ IN Word wIndex, ++ OUT Byte* ucpSymCnt, ++ OUT Byte* ucpReal, ++ OUT Byte* ucpImag, ++ OUT Word* wpRealH, ++ OUT Word* wpImagH ++); ++ ++ ++/** ++ * Get status. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param dwpStatus Pointer to system information. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getStatus ( ++ IN Demodulator* demodulator, ++ OUT Dword* dwpStatus ++); ++ ++ ++/** ++ * Get frequency shift. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param index . ++ * @param dopShift . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getDouble ( ++ IN Demodulator* demodulator, ++ IN Byte index, ++ IN double* dopValue ++); ++ ++ ++/** ++ * Get IR byte. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucpIRByte IR packet buffer. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getIr ( ++ IN Demodulator* demodulator, ++ OUT Byte* ucpIRByte ++); ++ ++ ++/** ++ * Dump EEPROM. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param dwDelay . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_dumpEeprom ( ++ IN Demodulator* demodulator, ++ IN Dword dwDelay ++); ++ ++ ++/** ++ * Load file to EEPROM. ++ * ++ * @param fileName File name to load to EEPROM. ++ * @param dwDelay . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_loadEeprom ( ++ IN Demodulator* demodulator, ++ IN char* fileName, ++ IN Dword dwDelay ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_isFecMonEnabled ( ++ IN Demodulator* demodulator, ++ OUT Bool* enabled ++); ++ ++ ++/** ++ * Generate ce information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param command . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_genCeInfoFunc ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte command ++); ++ ++ ++/** ++ * Get ce information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param spCentroid . ++ * @param spBias . ++ * @param dwpRh0 . ++ * @param wpM2 . ++ * @param dwpEh2 . ++ * @param ucpM2q . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getCeInfo ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Short* spCentroid, ++ OUT Short* spBias, ++ OUT Dword* dwpRh0, ++ OUT Word* wpM2, ++ OUT Dword* dwpEh2, ++ OUT Byte* ucpM2q ++); ++ ++ ++/** ++ * Enable/disable retrain. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param enable . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setRetrain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte enable ++); ++ ++ ++/** ++ * Enable/disable CCIR. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucEnable . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setCcir ( ++ IN Demodulator* demodulator, ++ IN Byte ucEnable ++); ++ ++ ++/** ++ * Handle CCIF ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ccifId . ++ * @param ctrl . ++ * @param ucBw . ++ * @param wFreq . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_handleCcif ( ++ IN Demodulator* demodulator, ++ IN Byte ccifId, ++ IN Byte ctrl, ++ IN Byte ucBw, ++ IN Word wFreq ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param level . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getAdcDesiredLevel ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Word* level ++); ++ ++ ++/** ++ * Set tuner type ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucTuner . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setTunerType ( ++ IN Demodulator* demodulator, ++ IN Byte ucTuner ++); ++ ++ ++/** ++ * Set board id ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucBoard . ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setBoardId ( ++ IN Demodulator* demodulator, ++ IN Byte ucBoard ++); ++ ++ ++/** ++ * Get signal strength in Dbm ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucTunerType tuner type. ++ * @param ucBoardId Board ids. ++ * @param dopStrength signal strength. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getSignalStrengthDBm ( ++ IN Demodulator* demodulator, ++ IN Byte ucTunerType, ++ IN Byte ucBoardId, ++ OUT double* dopStrength ++); ++ ++ ++/** ++ * Program CFOE 2. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ucBw Current channel bandwidth in MHz. ++ * @param dFs ADC sampling frequency. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_programCFOE2 ( ++ IN Demodulator* demodulator, ++ IN Byte ucBw, ++ IN double dFs ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setCalibratAgc ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setCrystalFrequency ( ++ IN Demodulator* demodulator, ++ IN double crystalFrequency ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_writeMt2060If1 ( ++ IN Demodulator* demodulator, ++ IN Dword dwIF1 ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getSnr ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT double* snr ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param speed the I2C speed in KHz. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setI2cSpeed ( ++ IN Demodulator* demodulator, ++ IN Dword speed ++); ++ ++ ++/** ++ * Ask fw to go back to boot code ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_backToBootCode ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Control gpio3 (AF9015 use this pin to turn on/off tuner) ++ * ucOn = 1 => turn on tuner ++ * ucOn = 0 => turn off tuner ++ * ++ * @param demodulator the handle of demodulator. ++ * @param contorl True: Enable, False: Disable; ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_controlTunerPower ( ++ IN Demodulator* demodulator, ++ IN Byte control ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param multiplier ADC frequency multiplier; ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setMultiplier ( ++ IN Demodulator* demodulator, ++ IN Multiplier multiplier ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param multiplier ADC frequency multiplier; ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_getMultiplier ( ++ IN Demodulator* demodulator, ++ IN Multiplier* multiplier ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param ifFrequency the IF frequency of tuner; ++ * @param inversion True if tuner's pectrum is inversed; ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_modifyTunerDescription ( ++ IN Demodulator* demodulator, ++ IN Byte tunerAddress, ++ IN Byte registerAddressLength, ++ IN Dword ifFrequency, ++ IN Bool inversion ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_writeRawData ( ++ IN Demodulator* demodulator, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_readRawData ( ++ IN Demodulator* demodulator, ++ IN Byte readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * Open tuner. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ */ ++Dword Demodulator_openTuner ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++/** ++ * Set tuner. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param bandwidth The desired bandwidth. ++ * @param frequency The desired frequency. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ */ ++Dword Demodulator_setTuner ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param block How many block (logical frame) to be check. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_setPostVitAllZeroBlock ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word block ++); ++ ++ ++/** ++ * Add PID to PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param pid the PID that will be add to PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_addPid ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Pid pid ++); ++ ++ ++/** ++ * Add PID to PID filter by index. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param index the index of PID filter. ++ * @param pid the PID that will be add to PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_addPidAt ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++); ++ ++ ++/** ++ * Remove PID from PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param pid the PID that will be remove from PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_removePid ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Pid pid ++); ++ ++/** ++ * Remove PID from PID filter by index. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param index the index of PID filter. ++ * @param pid the PID that will be remove from PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_removePidAt ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++); ++ ++ ++/** ++ * Reset PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Demodulator_resetPid ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * Control Active Sync. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param contorl 0: Disable(BDA Extend), 1: Enable (Active Sync) ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Demodulator_controlActiveSync ( ++ IN Demodulator* demodulator, ++ IN Byte control ++); ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_error.h b/drivers/media/dvb/dvb-usb/a867_error.h +new file mode 100644 +index 0000000..234c03a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_error.h +@@ -0,0 +1,141 @@ ++#ifndef __ERROR_H__ ++#define __ERROR_H__ ++ ++#define Error_NO_ERROR 0x00000000ul ++#define Error_RESET_TIMEOUT 0x00000001ul ++#define Error_WRITE_REG_TIMEOUT 0x00000002ul ++#define Error_WRITE_TUNER_TIMEOUT 0x00000003ul ++#define Error_WRITE_TUNER_FAIL 0x00000004ul ++#define Error_RSD_COUNTER_NOT_READY 0x00000005ul ++#define Error_VTB_COUNTER_NOT_READY 0x00000006ul ++#define Error_FEC_MON_NOT_ENABLED 0x00000007ul ++#define Error_INVALID_DEV_TYPE 0x00000008ul ++#define Error_INVALID_TUNER_TYPE 0x00000009ul ++#define Error_OPEN_FILE_FAIL 0x0000000Aul ++#define Error_WRITEFILE_FAIL 0x0000000Bul ++#define Error_READFILE_FAIL 0x0000000Cul ++#define Error_CREATEFILE_FAIL 0x0000000Dul ++#define Error_MALLOC_FAIL 0x0000000Eul ++#define Error_INVALID_FILE_SIZE 0x0000000Ful ++#define Error_INVALID_READ_SIZE 0x00000010ul ++#define Error_LOAD_FW_DONE_BUT_FAIL 0x00000011ul ++#define Error_NOT_IMPLEMENTED 0x00000012ul ++#define Error_NOT_SUPPORT 0x00000013ul ++#define Error_WRITE_MBX_TUNER_TIMEOUT 0x00000014ul ++#define Error_DIV_MORE_THAN_8_CHIPS 0x00000015ul ++#define Error_DIV_NO_CHIPS 0x00000016ul ++#define Error_SUPER_FRAME_CNT_0 0x00000017ul ++#define Error_INVALID_FFT_MODE 0x00000018ul ++#define Error_INVALID_CONSTELLATION_MODE 0x00000019ul ++#define Error_RSD_PKT_CNT_0 0x0000001Aul ++#define Error_FFT_SHIFT_TIMEOUT 0x0000001Bul ++#define Error_WAIT_TPS_TIMEOUT 0x0000001Cul ++#define Error_INVALID_BW 0x0000001Dul ++#define Error_INVALID_BUF_LEN 0x0000001Eul ++#define Error_NULL_PTR 0x0000001Ful ++#define Error_INVALID_AGC_VOLT 0x00000020ul ++#define Error_MT_OPEN_FAIL 0x00000021ul ++#define Error_MT_TUNE_FAIL 0x00000022ul ++#define Error_CMD_NOT_SUPPORTED 0x00000023ul ++#define Error_CE_NOT_READY 0x00000024ul ++#define Error_EMBX_INT_NOT_CLEARED 0x00000025ul ++#define Error_INV_PULLUP_VOLT 0x00000026ul ++#define Error_FREQ_OUT_OF_RANGE 0x00000027ul ++#define Error_INDEX_OUT_OF_RANGE 0x00000028ul ++#define Error_NULL_SETTUNER_PTR 0x00000029ul ++#define Error_NULL_INITSCRIPT_PTR 0x0000002Aul ++#define Error_INVALID_INITSCRIPT_LEN 0x0000002Bul ++#define Error_INVALID_POS 0x0000002Cul ++#define Error_BACK_TO_BOOTCODE_FAIL 0x0000002Dul ++#define Error_GET_BUFFER_VALUE_FAIL 0x0000002Eul ++#define Error_INVALID_REG_VALUE 0x0000002Ful ++#define Error_INVALID_INDEX 0x00000030ul ++#define Error_READ_TUNER_TIMEOUT 0x00000031ul ++#define Error_READ_TUNER_FAIL 0x00000032ul ++#define Error_UNDEFINED_SAW_BW 0x00000033ul ++#define Error_MT_NOT_AVAILABLE 0x00000034ul ++#define Error_NO_SUCH_TABLE 0x00000035ul ++#define Error_WRONG_CHECKSUM 0x00000036ul ++#define Error_INVALID_XTAL_FREQ 0x00000037ul ++#define Error_COUNTER_NOT_AVAILABLE 0x00000038ul ++#define Error_INVALID_DATA_LENGTH 0x00000039ul ++#define Error_BOOT_FAIL 0x0000003Aul ++#define Error_BUFFER_INSUFFICIENT 0x0000003Bul ++#define Error_NOT_READY 0x0000003Cul ++#define Error_DRIVER_INVALID 0x0000003Dul ++#define Error_INTERFACE_FAIL 0x0000003Eul ++#define Error_PID_FILTER_FULL 0x0000003Ful ++#define Error_OPERATION_TIMEOUT 0x00000040ul ++#define Error_LOADFIRMWARE_SKIPPED 0x00000041ul ++#define Error_REBOOT_FAIL 0x00000042ul ++#define Error_PROTOCOL_FORMAT_INVALID 0x00000043ul ++#define Error_ACTIVESYNC_ERROR 0x00000044ul ++#define Error_CE_READWRITEBUS_ERROR 0x00000045ul ++#define Error_CE_NODATA_ERROR 0x00000046ul ++#define Error_NULL_FW_SCRIPT 0x00000047ul ++#define Error_NULL_TUNER_SCRIPT 0x00000048ul ++ ++/** Error Code of Gemini System */ ++#define Error_INVALID_INDICATOR_TYPE 0x00000101ul ++#define Error_INVALID_SC_NUMBER 0x00000102ul ++#define Error_INVALID_SC_INFO 0x00000103ul ++#define Error_FIGBYPASS_FAIL 0x00000104ul ++ ++/** Error Code of Firmware */ ++#define Error_FIRMWARE_STATUS 0x01000000ul ++ ++/** Error Code of I2C Module */ ++#define Error_I2C_DATA_HIGH_FAIL 0x02001000ul ++#define Error_I2C_CLK_HIGH_FAIL 0x02002000ul ++#define Error_I2C_WRITE_NO_ACK 0x02003000ul ++#define Error_I2C_DATA_LOW_FAIL 0x02004000ul ++ ++/** Error Code of USB Module */ ++#define Error_USB_NULL_HANDLE 0x03010001ul ++#define Error_USB_WRITEFILE_FAIL 0x03000002ul ++#define Error_USB_READFILE_FAIL 0x03000003ul ++#define Error_USB_INVALID_READ_SIZE 0x03000004ul ++#define Error_USB_INVALID_STATUS 0x03000005ul ++#define Error_USB_INVALID_SN 0x03000006ul ++#define Error_USB_INVALID_PKT_SIZE 0x03000007ul ++#define Error_USB_INVALID_HEADER 0x03000008ul ++#define Error_USB_NO_IR_PKT 0x03000009ul ++#define Error_USB_INVALID_IR_PKT 0x0300000Aul ++#define Error_USB_INVALID_DATA_LEN 0x0300000Bul ++#define Error_USB_EP4_READFILE_FAIL 0x0300000Cul ++#define Error_USB_EP$_INVALID_READ_SIZE 0x0300000Dul ++#define Error_USB_BOOT_INVALID_PKT_TYPE 0x0300000Eul ++#define Error_USB_BOOT_BAD_CONFIG_HEADER 0x0300000Ful ++#define Error_USB_BOOT_BAD_CONFIG_SIZE 0x03000010ul ++#define Error_USB_BOOT_BAD_CONFIG_SN 0x03000011ul ++#define Error_USB_BOOT_BAD_CONFIG_SUBTYPE 0x03000012ul ++#define Error_USB_BOOT_BAD_CONFIG_VALUE 0x03000013ul ++#define Error_USB_BOOT_BAD_CONFIG_CHKSUM 0x03000014ul ++#define Error_USB_BOOT_BAD_CONFIRM_HEADER 0x03000015ul ++#define Error_USB_BOOT_BAD_CONFIRM_SIZE 0x03000016ul ++#define Error_USB_BOOT_BAD_CONFIRM_SN 0x03000017ul ++#define Error_USB_BOOT_BAD_CONFIRM_SUBTYPE 0x03000018ul ++#define Error_USB_BOOT_BAD_CONFIRM_VALUE 0x03000019ul ++#define Error_USB_BOOT_BAD_CONFIRM_CHKSUM 0x03000020ul ++#define Error_USB_BOOT_BAD_BOOT_HEADER 0x03000021ul ++#define Error_USB_BOOT_BAD_BOOT_SIZE 0x03000022ul ++#define Error_USB_BOOT_BAD_BOOT_SN 0x03000023ul ++#define Error_USB_BOOT_BAD_BOOT_PATTERN_01 0x03000024ul ++#define Error_USB_BOOT_BAD_BOOT_PATTERN_10 0x03000025ul ++#define Error_USB_BOOT_BAD_BOOT_CHKSUM 0x03000026ul ++#define Error_USB_INVALID_BOOT_PKT_TYPE 0x03000027ul ++#define Error_USB_BOOT_BAD_CONFIG_VAlUE 0x03000028ul ++#define Error_USB_COINITIALIZEEX_FAIL 0x03000029ul ++#define Error_USB_COCREATEINSTANCE_FAIL 0x0300003Aul ++#define Error_USB_COCREATCLSEENUMERATOR_FAIL 0x0300002Bul ++#define Error_USB_QUERY_INTERFACE_FAIL 0x0300002Cul ++#define Error_USB_PKSCTRL_NULL 0x0300002Dul ++#define Error_USB_INVALID_REGMODE 0x0300002Eul ++#define Error_USB_INVALID_REG_COUNT 0x0300002Ful ++#define Error_USB_INVALID_HANDLE 0x03000100ul ++#define Error_USB_WRITE_FAIL 0x03000200ul ++#define Error_USB_UNEXPECTED_WRITE_LEN 0x03000300ul ++#define Error_USB_READ_FAIL 0x03000400ul ++ ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_firmware.h b/drivers/media/dvb/dvb-usb/a867_firmware.h +new file mode 100644 +index 0000000..1562dfa +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_firmware.h +@@ -0,0 +1,10867 @@ ++// This file is automatically generated. Do not edit. ++ ++#ifndef __FIRMWARE_H__ ++ ++#define __FIRMWARE_H__ ++ ++ ++/* moved to a867_ofdm.h ++ ++#define DVB_LL_VERSION1 10 ++ ++#define DVB_LL_VERSION2 10 ++ ++#define DVB_LL_VERSION3 3 ++ ++#define DVB_LL_VERSION4 0 ++ ++ ++ ++#define DVB_OFDM_VERSION1 4 ++ ++#define DVB_OFDM_VERSION2 21 ++ ++#define DVB_OFDM_VERSION3 6 ++ ++#define DVB_OFDM_VERSION4 251 ++*/ ++ ++ ++#include "a867_type.h" ++ ++ ++ ++ ++ ++#define Firmware_CODELENGTH 0x0000A4D6 ++ ++#define Firmware_SEGMENTLENGTH 0x00000004 ++ ++#define Firmware_PARTITIONLENGTH 0x00000001 ++ ++ ++ ++ ++ ++static Byte Firmware_codes[] = { ++ ++ 0x01,0x41,0x00,0x00,0x03,0xFB,0xBE,0x02, ++ ++ 0x54,0x30, ++ ++ 0x01,0x47,0x00,0x3A,0x07,0xF7,0x7E,0x32, ++ ++ 0x32,0xA9,0x07,0x89,0x0E,0xE5,0x0E,0x24, ++ ++ 0x04,0x90,0xF7,0x00,0xF0,0x90,0xF7,0x03, ++ ++ 0xE0,0x90,0xF7,0x01,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xE5,0x0E,0x24,0x05,0x90,0xF4,0x12,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0xE0,0x54,0xFC,0xF0, ++ ++ 0x75,0x0C,0xF7,0x75,0x0D,0x03,0x90,0xF7, ++ ++ 0x01,0xE0,0xF5,0x08,0xA3,0xE0,0xF5,0x09, ++ ++ 0xE5,0x0E,0x60,0x57,0xB4,0x01,0x1A,0x8D, ++ ++ 0x82,0x8C,0x83,0xE0,0x85,0x0D,0x82,0x85, ++ ++ 0x0C,0x83,0xF0,0xE0,0xFE,0xE4,0x25,0x09, ++ ++ 0xF5,0x09,0xEE,0x35,0x08,0xF5,0x08,0x80, ++ ++ 0x3A,0x8D,0x82,0x8C,0x83,0xE0,0xF5,0x0A, ++ ++ 0xA3,0xE0,0xF5,0x0B,0x85,0x0D,0x82,0x85, ++ ++ 0x0C,0x83,0xE5,0x0A,0xF0,0xA3,0xE5,0x0B, ++ ++ 0xF0,0x25,0x09,0xF5,0x09,0xE5,0x0A,0x35, ++ ++ 0x08,0xF5,0x08,0x74,0x02,0x2D,0xFD,0xE4, ++ ++ 0x3C,0xFC,0x74,0x02,0x25,0x0D,0xF5,0x0D, ++ ++ 0xE4,0x35,0x0C,0xF5,0x0C,0x15,0x0E,0x15, ++ ++ 0x0E,0x80,0xA5,0xE5,0x09,0xF4,0xFF,0xE5, ++ ++ 0x08,0xF4,0xFE,0x74,0x03,0x29,0xF5,0x82, ++ ++ 0xE4,0x34,0xF7,0xF5,0x83,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x22,0x90,0x41,0x82,0xEE,0xF0, ++ ++ 0xA3,0xEF,0xF0,0xE4,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xFC,0xEC,0xC3,0x9D,0x50,0x43,0xEC,0x30, ++ ++ 0xE0,0x1F,0x90,0x41,0x82,0xE0,0xFE,0xA3, ++ ++ 0xE0,0x2C,0xF5,0x82,0xE4,0x3E,0xF5,0x83, ++ ++ 0xE0,0xFF,0x90,0x41,0x85,0xE0,0x2F,0xF0, ++ ++ 0x90,0x41,0x84,0xE0,0x34,0x00,0xF0,0x80, ++ ++ 0x1D,0x90,0x41,0x82,0xE0,0xFE,0xA3,0xE0, ++ ++ 0x2C,0xF5,0x82,0xE4,0x3E,0xF5,0x83,0xE0, ++ ++ 0xFE,0x90,0x41,0x85,0xE0,0x24,0x00,0xF0, ++ ++ 0x90,0x41,0x84,0xE0,0x3E,0xF0,0x0C,0x80, ++ ++ 0xB8,0x90,0x41,0x84,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xF4,0xFF,0xEE,0xF4,0xFE,0x22,0xC0,0xE0, ++ ++ 0xC0,0xF0,0xC0,0x83,0xC0,0x82,0xC0,0x85, ++ ++ 0xC0,0x84,0xC0,0x86,0x75,0x86,0x00,0xC0, ++ ++ 0xD0,0x75,0xD0,0x00,0xC0,0x00,0xC0,0x01, ++ ++ 0xC0,0x02,0xC0,0x03,0xC0,0x04,0xC0,0x05, ++ ++ 0xC0,0x06,0xC0,0x07,0x90,0x41,0xAD,0x74, ++ ++ 0xFE,0xF0,0x90,0xF4,0x05,0xE0,0x20,0xE5, ++ ++ 0x03,0x02,0x52,0xAD,0x75,0x12,0x00,0x90, ++ ++ 0xF6,0xB4,0xE0,0x30,0xE0,0x1F,0x90,0xF4, ++ ++ 0x09,0xE0,0xF4,0x60,0x18,0x90,0xF7,0x00, ++ ++ 0xE0,0x04,0xFF,0x90,0xF4,0x09,0xE0,0xC3, ++ ++ 0x9F,0x50,0x0A,0x90,0xF4,0x05,0xE0,0x44, ++ ++ 0x20,0xF0,0x02,0x52,0xAD,0x90,0xF6,0xB4, ++ ++ 0xE0,0x30,0xE0,0x05,0x90,0xF4,0x09,0xE4, ++ ++ 0xF0,0x90,0xF6,0xB4,0xE0,0x20,0xE0,0x46, ++ ++ 0x90,0xF6,0x6F,0xE0,0x20,0xE0,0x3F,0x90, ++ ++ 0xF6,0x04,0xE0,0x54,0xF0,0x60,0x37,0x90, ++ ++ 0xF6,0x03,0xE0,0x04,0xF0,0x90,0xF4,0x05, ++ ++ 0x74,0x20,0xF0,0x90,0x41,0x8C,0xE0,0x04, ++ ++ 0xF0,0x70,0x06,0x90,0x41,0x8B,0xE0,0x04, ++ ++ 0xF0,0x90,0xF6,0x04,0xE0,0x30,0xE1,0xF9, ++ ++ 0x90,0xF6,0x04,0xE4,0xF0,0xE0,0x44,0x01, ++ ++ 0xF0,0xE0,0x54,0xFE,0xF0,0x90,0xF6,0x03, ++ ++ 0xE0,0x14,0xF0,0x02,0x52,0xAD,0x90,0xF7, ++ ++ 0x01,0xE0,0x54,0x70,0x70,0x03,0x02,0x4A, ++ ++ 0x6A,0xE0,0x54,0x0F,0xFE,0xA3,0xE0,0xC3, ++ ++ 0x94,0x06,0xEE,0x94,0x00,0x40,0x03,0x02, ++ ++ 0x4A,0x61,0x90,0xF1,0x03,0xE0,0x90,0x41, ++ ++ 0x91,0xF0,0x90,0xF6,0xB5,0xE0,0x54,0xF7, ++ ++ 0x44,0x08,0xF0,0xE0,0x54,0xF7,0xF0,0x90, ++ ++ 0x41,0x91,0xE0,0x90,0xF1,0x03,0xF0,0x90, ++ ++ 0x41,0x8E,0xE0,0x90,0xF0,0x00,0xF0,0x90, ++ ++ 0x44,0xB8,0xE0,0x60,0x09,0x90,0xF1,0x04, ++ ++ 0xE0,0x54,0xF3,0xF0,0x80,0x09,0x90,0xF1, ++ ++ 0x04,0xE0,0x54,0xF3,0x44,0x04,0xF0,0x90, ++ ++ 0xF7,0x00,0xE0,0x04,0xF5,0x11,0x90,0xF1, ++ ++ 0x01,0xF0,0x90,0xF7,0x01,0xE0,0x54,0x70, ++ ++ 0xFF,0x74,0xFE,0x25,0x11,0xF5,0x82,0xE4, ++ ++ 0x34,0xF6,0xF5,0x83,0xE0,0x2F,0xF0,0x90, ++ ++ 0xF7,0x01,0xE0,0x54,0x8F,0xF0,0xE5,0x11, ++ ++ 0x60,0x1E,0x15,0x11,0xE4,0x25,0x11,0xF5, ++ ++ 0x82,0xE4,0x34,0xF7,0xF5,0x83,0xE0,0xFF, ++ ++ 0xE5,0x11,0x24,0x01,0xFD,0xE4,0x34,0xF0, ++ ++ 0x8D,0x82,0xF5,0x83,0xEF,0xF0,0x80,0xDE, ++ ++ 0x90,0xF1,0x00,0xE0,0x54,0xFE,0xF0,0x90, ++ ++ 0xF1,0x02,0x74,0x01,0xF0,0x90,0xF7,0x02, ++ ++ 0xE0,0x30,0xE0,0x05,0x75,0x11,0x05,0x80, ++ ++ 0x08,0x90,0xF7,0x04,0xE0,0x24,0x05,0xF5, ++ ++ 0x11,0x90,0xF1,0x02,0xE0,0x30,0xE2,0x0F, ++ ++ 0x90,0xF4,0x05,0x74,0x20,0xF0,0x90,0xF1, ++ ++ 0x02,0x74,0x02,0xF0,0x02,0x52,0xAD,0x90, ++ ++ 0xF1,0x02,0xE0,0x30,0xE1,0xE3,0x74,0x02, ++ ++ 0xF0,0x90,0xF4,0x12,0xE5,0x11,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0xE0,0x54,0xFC,0xF0,0x90, ++ ++ 0xF0,0x00,0xE0,0x04,0xF0,0x90,0xF1,0x01, ++ ++ 0xE5,0x11,0xF0,0x90,0xF1,0x00,0xE0,0x44, ++ ++ 0x01,0xF0,0x90,0xF1,0x02,0x74,0x01,0xF0, ++ ++ 0x75,0x0F,0x00,0x75,0x10,0x00,0x90,0xF1, ++ ++ 0x02,0xE0,0x20,0xE3,0x2A,0xE0,0x30,0xE2, ++ ++ 0xF5,0x74,0x02,0xF0,0xAE,0x0F,0xAF,0x10, ++ ++ 0xBE,0xFF,0x0C,0xBF,0xFF,0x09,0x90,0xF4, ++ ++ 0x05,0x74,0x20,0xF0,0x02,0x52,0xAD,0x90, ++ ++ 0xF1,0x02,0x74,0x01,0xF0,0x05,0x10,0xE5, ++ ++ 0x10,0x70,0x02,0x05,0x0F,0x80,0xCF,0xE5, ++ ++ 0x11,0x60,0x1D,0x15,0x11,0xE4,0x25,0x11, ++ ++ 0xFF,0xE4,0x34,0xF0,0x8F,0x82,0xF5,0x83, ++ ++ 0xE0,0xFF,0xE4,0x25,0x11,0xF5,0x82,0xE4, ++ ++ 0x34,0xF7,0xF5,0x83,0xEF,0xF0,0x80,0xDF, ++ ++ 0x90,0xF4,0x05,0x74,0x20,0xF0,0x90,0x44, ++ ++ 0xB8,0xE0,0x60,0x1C,0x7E,0xDE,0x7F,0x40, ++ ++ 0x90,0xF7,0x00,0xE0,0x04,0xFB,0x7D,0x00, ++ ++ 0x7C,0xF7,0x12,0x56,0x9C,0x90,0xF7,0x00, ++ ++ 0xE0,0x04,0x90,0xDD,0x86,0xF0,0x80,0x07, ++ ++ 0x90,0xF4,0x11,0xE0,0x54,0xFC,0xF0,0x90, ++ ++ 0xF1,0x02,0x74,0x08,0xF0,0x02,0x52,0xAD, ++ ++ 0x90,0xF4,0x05,0x74,0x20,0xF0,0x02,0x52, ++ ++ 0xAD,0x90,0xF7,0x03,0xE0,0x90,0x41,0xB2, ++ ++ 0xF0,0x90,0xF7,0x00,0xE0,0x64,0x03,0x70, ++ ++ 0x2C,0xA3,0xE0,0x64,0x02,0x70,0x26,0x90, ++ ++ 0xF7,0x00,0x04,0xF0,0x90,0xF7,0x02,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xF5,0x82,0x8E,0x83,0xE0, ++ ++ 0x90,0xF7,0x01,0xF0,0x90,0xF4,0x12,0x74, ++ ++ 0x02,0xF0,0xA3,0xE4,0xF0,0xA3,0xE0,0x54, ++ ++ 0xFC,0xF0,0x02,0x51,0xE1,0x90,0xF7,0x00, ++ ++ 0xE0,0xB4,0x04,0x20,0xA3,0xE0,0xB4,0x03, ++ ++ 0x1B,0x90,0xF7,0x04,0xE0,0xFF,0x90,0xF7, ++ ++ 0x02,0xE0,0xFC,0xA3,0xE0,0xF5,0x82,0x8C, ++ ++ 0x83,0xEF,0xF0,0x90,0xF4,0x05,0x74,0x20, ++ ++ 0xF0,0x02,0x52,0xAD,0x90,0xF7,0x00,0xE0, ++ ++ 0xB4,0x04,0x0D,0xA3,0xE0,0xB4,0x04,0x08, ++ ++ 0x90,0x41,0xAE,0x74,0x01,0xF0,0x80,0x12, ++ ++ 0x90,0xF7,0x00,0xE0,0x64,0x05,0x70,0x77, ++ ++ 0xA3,0xE0,0x64,0x05,0x70,0x71,0x90,0x41, ++ ++ 0xAE,0xF0,0x90,0xF7,0x02,0xE0,0xFD,0x90, ++ ++ 0x41,0xAE,0xE0,0xFB,0x90,0xF7,0x03,0xE0, ++ ++ 0x90,0x41,0xC4,0xF0,0x90,0xF7,0x04,0xE0, ++ ++ 0xFF,0xA3,0xE0,0x90,0x41,0xC5,0xCF,0xF0, ++ ++ 0xA3,0xEF,0xF0,0xEB,0x60,0x06,0x7E,0xF7, ++ ++ 0x7F,0x01,0x80,0x04,0x7E,0xF7,0x7F,0x06, ++ ++ 0x90,0x41,0xC7,0xEE,0xF0,0xA3,0xEF,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x04,0xF0,0x7F,0x02, ++ ++ 0x12,0x57,0x94,0x90,0x41,0xB0,0xEF,0xF0, ++ ++ 0x90,0x41,0xAE,0xE0,0x70,0x09,0x90,0xF4, ++ ++ 0x05,0x74,0x20,0xF0,0x02,0x52,0xAD,0x90, ++ ++ 0xF7,0x00,0x74,0x01,0xF0,0x90,0x41,0xB0, ++ ++ 0xE0,0x70,0x03,0x02,0x4A,0x95,0x90,0xF7, ++ ++ 0x01,0x74,0xFF,0xF0,0x02,0x4A,0x95,0x90, ++ ++ 0x41,0xAD,0x74,0xFF,0xF0,0x90,0x41,0xB8, ++ ++ 0x74,0x01,0xF0,0x90,0xF7,0x01,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0xEE,0x60,0x03,0x02,0x51, ++ ++ 0xDE,0xEF,0x12,0x7E,0xB5,0x4E,0x42,0x00, ++ ++ 0x4B,0xB2,0x01,0x4C,0xE8,0x02,0x4C,0xE1, ++ ++ 0x03,0x4D,0x9B,0x04,0x4D,0x94,0x05,0x4E, ++ ++ 0x5A,0x06,0x4C,0x6A,0x18,0x4C,0x0C,0x22, ++ ++ 0x4F,0xE3,0x23,0x51,0xD3,0x25,0x50,0xA2, ++ ++ 0x29,0x50,0x18,0x2A,0x50,0x2F,0x2B,0x4E, ++ ++ 0x5A,0x30,0x4E,0xE2,0x32,0x00,0x00,0x51, ++ ++ 0xDE,0x90,0xF6,0xB4,0xE0,0x54,0x08,0xF5, ++ ++ 0x12,0x60,0x04,0xE0,0x54,0xF7,0xF0,0x90, ++ ++ 0xF7,0x04,0xE0,0xF5,0x11,0x90,0xF7,0x08, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x80,0x00,0xE5, ++ ++ 0x11,0x60,0x27,0x15,0x11,0x74,0x0A,0x25, ++ ++ 0x11,0xF5,0x82,0xE4,0x34,0xF7,0xF5,0x83, ++ ++ 0xE0,0xFF,0xE5,0x11,0xFD,0x7C,0x00,0x90, ++ ++ 0xF7,0x08,0xE0,0xFA,0xA3,0xE0,0x2D,0xFD, ++ ++ 0xEC,0x3A,0x8D,0x82,0xF5,0x83,0xEF,0xF0, ++ ++ 0x80,0xD5,0xE5,0x12,0x60,0x07,0x90,0xF6, ++ ++ 0xB4,0xE0,0x44,0x08,0xF0,0x75,0x12,0x00, ++ ++ 0x02,0x51,0xE1,0x90,0xF4,0x12,0x74,0x09, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xE0,0x54,0xFC, ++ ++ 0xF0,0x90,0xF7,0x00,0x74,0x08,0xF0,0x90, ++ ++ 0xF7,0x03,0xE0,0x90,0xF7,0x01,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x74,0x0A,0xF0,0xA3,0xF0, ++ ++ 0xA3,0x74,0x03,0xF0,0xA3,0xE4,0xF0,0x90, ++ ++ 0xF7,0x03,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0xF7,0x01,0xE0,0xFC,0xA3,0xE0,0x2F,0xFF, ++ ++ 0xEC,0x3E,0xFE,0x90,0xF7,0x05,0xE0,0xFC, ++ ++ 0xA3,0xE0,0x2F,0xFF,0xEC,0x3E,0xFE,0xEF, ++ ++ 0xF4,0xFF,0xEE,0xF4,0xA3,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x41,0xAD,0xE4,0xF0,0x02,0x51, ++ ++ 0xE1,0x90,0xF7,0x00,0x74,0x08,0xF0,0x90, ++ ++ 0xF7,0x03,0xE0,0x90,0xF7,0x01,0xF0,0x90, ++ ++ 0x44,0xDE,0xE0,0x60,0x40,0x90,0x44,0xDE, ++ ++ 0xE4,0xF0,0x90,0xF7,0x02,0xF0,0x90,0x44, ++ ++ 0xDD,0x04,0xF0,0x90,0x44,0xDF,0xE0,0xFF, ++ ++ 0x90,0x41,0x86,0xF0,0x90,0xDE,0x80,0xE0, ++ ++ 0x90,0xF7,0x03,0xF0,0x90,0xDE,0x81,0xE0, ++ ++ 0x90,0xF7,0x04,0xF0,0x90,0xDE,0x82,0xE0, ++ ++ 0x90,0xF7,0x05,0xF0,0x90,0xDE,0x83,0xE0, ++ ++ 0x90,0xF7,0x06,0xF0,0x90,0x41,0x86,0xE0, ++ ++ 0xB5,0x07,0xC2,0x80,0x06,0x90,0xF7,0x02, ++ ++ 0x74,0x01,0xF0,0x90,0xF7,0x00,0xE0,0x04, ++ ++ 0x90,0xF4,0x12,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0xE0,0x54,0xFC,0xF0,0x90,0x44,0xDD,0xE4, ++ ++ 0xF0,0x90,0x41,0xAD,0xF0,0x02,0x51,0xE1, ++ ++ 0x90,0x41,0xAE,0xE4,0xF0,0x80,0x06,0x90, ++ ++ 0x41,0xAE,0x74,0x01,0xF0,0x90,0x41,0xAF, ++ ++ 0x74,0x02,0xF0,0x90,0x41,0xAE,0xE0,0x60, ++ ++ 0x07,0x90,0xF7,0x04,0xE0,0xFF,0x80,0x02, ++ ++ 0x7F,0x00,0xEF,0x24,0x04,0x90,0x41,0xB1, ++ ++ 0xF0,0x90,0xF7,0x05,0xE0,0xB4,0x01,0x08, ++ ++ 0x90,0x41,0xDE,0xE0,0xFF,0xFD,0x80,0x06, ++ ++ 0x90,0xF7,0x05,0xE0,0xFF,0xFD,0x90,0x41, ++ ++ 0xAE,0xE0,0xFB,0x90,0xF7,0x06,0xE0,0x90, ++ ++ 0x41,0xC4,0xF0,0x90,0xF7,0x07,0xE0,0xFF, ++ ++ 0xA3,0xE0,0x90,0x41,0xC5,0xCF,0xF0,0xA3, ++ ++ 0xEF,0xF0,0xEB,0x60,0x06,0x7E,0xF7,0x7F, ++ ++ 0x03,0x80,0x04,0x7E,0xF7,0x7F,0x09,0x90, ++ ++ 0x41,0xC7,0xEE,0xF0,0xA3,0xEF,0xF0,0x90, ++ ++ 0xF7,0x04,0xE0,0xFF,0x90,0x41,0xC9,0xE4, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x7F,0x02,0x12,0x57, ++ ++ 0x94,0x90,0x41,0xB0,0xEF,0xF0,0xA3,0xE0, ++ ++ 0xFF,0x90,0xF7,0x00,0xF0,0x90,0x41,0xB2, ++ ++ 0xE0,0x90,0xF7,0x01,0xF0,0x90,0x41,0xB0, ++ ++ 0xE0,0x90,0xF7,0x02,0xF0,0xEF,0x04,0x90, ++ ++ 0xF4,0x12,0xF0,0xA3,0xE4,0xF0,0xA3,0xE0, ++ ++ 0x54,0xFC,0xF0,0x90,0x41,0xAD,0xE4,0xF0, ++ ++ 0x02,0x51,0xE1,0x90,0x41,0xAE,0xE4,0xF0, ++ ++ 0x80,0x06,0x90,0x41,0xAE,0x74,0x01,0xF0, ++ ++ 0x90,0x44,0xB8,0xE0,0x60,0x04,0x7F,0x01, ++ ++ 0x80,0x02,0x7F,0x03,0x90,0x41,0xAF,0xEF, ++ ++ 0xF0,0x90,0x41,0xAE,0xE0,0xFB,0x60,0x07, ++ ++ 0x90,0xF7,0x04,0xE0,0xFF,0x80,0x02,0x7F, ++ ++ 0x00,0xEF,0x24,0x04,0x90,0x41,0xB1,0xF0, ++ ++ 0x90,0xF7,0x05,0xE0,0xB4,0x01,0x08,0x90, ++ ++ 0x41,0xDE,0xE0,0xFF,0xFD,0x80,0x06,0x90, ++ ++ 0xF7,0x05,0xE0,0xFF,0xFD,0x90,0xF7,0x08, ++ ++ 0xE0,0x90,0x44,0xC9,0xF0,0xEB,0x60,0x06, ++ ++ 0x7E,0xF7,0x7F,0x03,0x80,0x04,0x7E,0xF7, ++ ++ 0x7F,0x09,0x90,0x44,0xCA,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x90,0xF7,0x04,0xE0,0xFF,0x90, ++ ++ 0x44,0xCC,0xE4,0xF0,0xA3,0xEF,0xF0,0x90, ++ ++ 0x41,0xAF,0xE0,0xFF,0x12,0x6A,0xEA,0x90, ++ ++ 0x41,0xB0,0xEF,0xF0,0xA3,0xE0,0xFF,0x90, ++ ++ 0xF7,0x00,0xF0,0x90,0x41,0xB2,0xE0,0x90, ++ ++ 0xF7,0x01,0xF0,0x90,0x41,0xB0,0xE0,0x90, ++ ++ 0xF7,0x02,0xF0,0xEF,0x04,0x90,0xF4,0x12, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xE0,0x54,0xFC, ++ ++ 0xF0,0x90,0x41,0xAD,0xE4,0xF0,0x02,0x51, ++ ++ 0xE1,0x90,0xF7,0x04,0xE0,0xFF,0x90,0xF7, ++ ++ 0x08,0xE0,0xFC,0xA3,0xE0,0xFD,0x12,0x47, ++ ++ 0x02,0x90,0x41,0xAD,0xE4,0xF0,0x02,0x51, ++ ++ 0xE1,0xC2,0x8C,0xC2,0x8D,0x75,0x8A,0x00, ++ ++ 0x75,0x8C,0x00,0xE5,0x89,0x54,0xF0,0x44, ++ ++ 0x01,0xF5,0x89,0xD2,0x8C,0x90,0x41,0x87, ++ ++ 0xE4,0xF0,0x90,0xF4,0x04,0xE0,0x54,0x04, ++ ++ 0xFF,0x13,0x13,0x54,0x3F,0x60,0x21,0xE0, ++ ++ 0x54,0xFB,0x44,0x04,0xF0,0xA3,0x74,0x20, ++ ++ 0xF0,0x90,0xF4,0x14,0xE0,0x54,0x7F,0xF0, ++ ++ 0x90,0xF4,0x11,0xE0,0x54,0xFC,0x44,0x02, ++ ++ 0xF0,0xC2,0x8C,0xC2,0x8D,0x02,0x52,0xAD, ++ ++ 0x30,0x8D,0xCF,0xC2,0x8C,0xC2,0x8D,0x90, ++ ++ 0x41,0x87,0xE0,0x04,0xF0,0xE0,0xD3,0x94, ++ ++ 0x01,0x40,0x2A,0x90,0xF4,0x14,0xE0,0x54, ++ ++ 0x7F,0x44,0x80,0xF0,0xE0,0x54,0xFC,0xF0, ++ ++ 0x90,0xF4,0x13,0x74,0x08,0xF0,0x90,0xF4, ++ ++ 0x12,0xE4,0xF0,0x90,0xF4,0x05,0x74,0x20, ++ ++ 0xF0,0x90,0xF4,0x11,0xE0,0x54,0xFC,0x44, ++ ++ 0x01,0xF0,0x02,0x52,0xAD,0xD2,0x8C,0x80, ++ ++ 0x91,0x90,0xF7,0x0A,0xE0,0xFF,0x90,0x41, ++ ++ 0xB8,0xF0,0x90,0x41,0x88,0xF0,0x90,0xF4, ++ ++ 0x14,0xE0,0x30,0xE7,0x1F,0x90,0xF7,0x04, ++ ++ 0xE0,0x54,0x03,0xFF,0x90,0xF4,0x14,0xE0, ++ ++ 0x54,0xFC,0x4F,0xF0,0x90,0xF7,0x05,0xE0, ++ ++ 0x90,0xF4,0x13,0xF0,0x90,0xF7,0x06,0xE0, ++ ++ 0x90,0xF4,0x12,0xF0,0x90,0xF4,0x05,0x74, ++ ++ 0x20,0xF0,0x90,0xF4,0x11,0xE0,0x54,0x03, ++ ++ 0x60,0x08,0x90,0x41,0x89,0xE0,0x64,0x01, ++ ++ 0x60,0x1B,0x90,0xF7,0x07,0xE0,0xB4,0xF0, ++ ++ 0x0B,0x90,0xF4,0x11,0xE0,0x54,0xFC,0x44, ++ ++ 0x02,0xF0,0x80,0x09,0x90,0xF4,0x11,0xE0, ++ ++ 0x54,0xFC,0x44,0x01,0xF0,0x90,0x41,0x89, ++ ++ 0xE4,0xF0,0x90,0x41,0x88,0xE0,0xB4,0x01, ++ ++ 0x0C,0x90,0xF4,0x04,0xE0,0x54,0xFB,0x44, ++ ++ 0x04,0xF0,0x02,0x52,0xAD,0x90,0xF4,0x05, ++ ++ 0xE0,0x20,0xE5,0x09,0x90,0xF4,0x15,0xE0, ++ ++ 0xC3,0x94,0x05,0x40,0xF0,0x90,0xF4,0x04, ++ ++ 0xE0,0x54,0xFB,0x44,0x04,0xF0,0xA3,0xE0, ++ ++ 0x30,0xE5,0x09,0x90,0x41,0x89,0x74,0x01, ++ ++ 0xF0,0x02,0x52,0xAD,0x90,0x41,0xB8,0xE0, ++ ++ 0x14,0xF0,0x70,0x03,0x02,0x52,0xAD,0x90, ++ ++ 0xF4,0x15,0xE0,0x70,0xFA,0xA3,0xE0,0x70, ++ ++ 0xF6,0xA3,0xE0,0x54,0x03,0x70,0xF0,0x90, ++ ++ 0xF4,0x04,0xE0,0x54,0x04,0xFF,0x13,0x13, ++ ++ 0x54,0x3F,0x60,0x0C,0x90,0x41,0x8A,0xE0, ++ ++ 0xC3,0x94,0xFF,0x50,0x03,0xE0,0x04,0xF0, ++ ++ 0x90,0xF4,0x05,0xE0,0x20,0xE5,0x0D,0x90, ++ ++ 0xF4,0x04,0xE0,0x54,0x04,0xFF,0x13,0x13, ++ ++ 0x54,0x3F,0x60,0xEC,0x90,0xF4,0x05,0xE0, ++ ++ 0x20,0xE5,0x03,0x02,0x4F,0x1B,0x90,0xF4, ++ ++ 0x04,0xE0,0x54,0xFB,0x44,0x04,0xF0,0x02, ++ ++ 0x52,0xAD,0xC2,0xAF,0x90,0xF6,0xB3,0xE0, ++ ++ 0x54,0xFE,0xF0,0x90,0xF6,0xDE,0xE0,0x54, ++ ++ 0xFE,0x44,0x01,0xF0,0x90,0xF6,0xDE,0xE0, ++ ++ 0x20,0xE0,0xF9,0x90,0x44,0xB8,0xE0,0x60, ++ ++ 0x07,0x90,0xDD,0x00,0xE0,0x54,0x7F,0xF0, ++ ++ 0x90,0xF4,0x05,0x74,0x20,0xF0,0x90,0xF6, ++ ++ 0x2F,0xE0,0x54,0xFE,0x44,0x01,0xF0,0x90, ++ ++ 0x41,0xAE,0x74,0x01,0xF0,0x90,0xF7,0x06, ++ ++ 0xE0,0x44,0x01,0xF0,0x90,0xF7,0x03,0xE0, ++ ++ 0x90,0xF7,0x01,0xF0,0x80,0x1D,0x90,0x41, ++ ++ 0xAE,0xE4,0xF0,0x90,0xF7,0x03,0xE0,0x90, ++ ++ 0xF7,0x01,0xF0,0x7E,0xF0,0x7F,0x01,0x90, ++ ++ 0xF7,0x04,0xE0,0xFB,0x7D,0x07,0x7C,0xF7, ++ ++ 0x12,0x56,0x9C,0x90,0xF7,0x04,0xE0,0xF5, ++ ++ 0x11,0xA3,0xE0,0xFF,0xA3,0xE0,0xFD,0x90, ++ ++ 0x41,0xBD,0x74,0x01,0xF0,0xAB,0x11,0x12, ++ ++ 0x54,0xB6,0x8F,0x12,0x90,0xF7,0x02,0xEF, ++ ++ 0xF0,0x90,0x41,0xAE,0xE0,0x64,0x01,0x60, ++ ++ 0x03,0x02,0x51,0xE1,0x7C,0xF0,0x7D,0x00, ++ ++ 0x90,0xF7,0x04,0xE0,0xFB,0x7F,0x03,0x7E, ++ ++ 0xF7,0x12,0x56,0x9C,0x90,0x41,0xAD,0xE4, ++ ++ 0xF0,0xE5,0x11,0x24,0x04,0x90,0xF7,0x00, ++ ++ 0xF0,0xE0,0x90,0xF4,0x12,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0xE0,0x54,0xFC,0xF0,0x02,0x51, ++ ++ 0xE1,0x90,0x41,0xB6,0x74,0xF7,0xF0,0xA3, ++ ++ 0x74,0x08,0xF0,0x90,0xF7,0x04,0xE0,0x24, ++ ++ 0xFE,0x60,0x10,0x14,0x60,0x7F,0x24,0x02, ++ ++ 0x60,0x03,0x02,0x51,0xC8,0x75,0x12,0x01, ++ ++ 0x02,0x51,0xC8,0x90,0xF7,0x07,0xE0,0x75, ++ ++ 0xF0,0x02,0xA4,0x24,0x08,0xFE,0xE5,0xF0, ++ ++ 0x34,0xF7,0x90,0x41,0xB4,0xF0,0xA3,0xCE, ++ ++ 0xF0,0x90,0x41,0xB3,0xE4,0xF0,0x90,0xF7, ++ ++ 0x07,0xE0,0xFF,0x90,0x41,0xB3,0xE0,0xC3, ++ ++ 0x9F,0x50,0x44,0xA3,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xF5,0x82,0x8E,0x83,0xE0,0xFF,0x90,0x41, ++ ++ 0xB6,0xE0,0xFC,0xA3,0xE0,0xF5,0x82,0x8C, ++ ++ 0x83,0xE0,0xFC,0xA3,0xE0,0xF5,0x82,0x8C, ++ ++ 0x83,0xEF,0xF0,0x90,0x41,0xB3,0xE0,0x04, ++ ++ 0xF0,0x90,0x41,0xB5,0xE0,0x04,0xF0,0x70, ++ ++ 0x06,0x90,0x41,0xB4,0xE0,0x04,0xF0,0x90, ++ ++ 0x41,0xB7,0xE0,0x24,0x02,0xF0,0x90,0x41, ++ ++ 0xB6,0xE0,0x34,0x00,0xF0,0x80,0xAF,0x75, ++ ++ 0x12,0x00,0x02,0x51,0xC8,0x90,0xF7,0x07, ++ ++ 0xE0,0x75,0xF0,0x03,0xA4,0x24,0x08,0xFE, ++ ++ 0xE5,0xF0,0x34,0xF7,0x90,0x41,0xB4,0xF0, ++ ++ 0xA3,0xCE,0xF0,0x90,0xF7,0x07,0xE0,0x75, ++ ++ 0xF0,0x03,0xA4,0x24,0x08,0x90,0xF6,0x20, ++ ++ 0xF0,0x90,0x41,0xB3,0xE4,0xF0,0x90,0xF7, ++ ++ 0x07,0xE0,0xFF,0x90,0x41,0xB3,0xE0,0xC3, ++ ++ 0x9F,0x50,0x59,0x90,0x41,0xB6,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x24,0x02,0xFD,0xE4,0x3E, ++ ++ 0x8D,0x82,0xF5,0x83,0xE0,0xFD,0x90,0x41, ++ ++ 0xB9,0xF0,0xFB,0x8F,0x82,0x8E,0x83,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x41,0xB4,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0x12,0x56,0x9C,0x90, ++ ++ 0x41,0xB9,0xE0,0xFF,0x90,0x41,0xB5,0xE0, ++ ++ 0x2F,0xF0,0x90,0x41,0xB4,0xE0,0x34,0x00, ++ ++ 0xF0,0x90,0x41,0xB3,0xE0,0x04,0xF0,0x90, ++ ++ 0x41,0xB6,0xE0,0xFE,0xA3,0xE0,0x24,0x03, ++ ++ 0xFF,0xE4,0x3E,0x90,0x41,0xB6,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x80,0x9A,0x75,0x12,0x00,0x90, ++ ++ 0x41,0xAD,0x74,0xFF,0xF0,0x75,0x12,0x00, ++ ++ 0x80,0x0E,0x90,0x41,0xAD,0x74,0xFF,0xF0, ++ ++ 0x75,0x12,0xFA,0x80,0x03,0x75,0x12,0x02, ++ ++ 0x90,0x41,0xAD,0xE0,0xFF,0xF4,0x60,0x5E, ++ ++ 0xEF,0x64,0xFE,0x60,0x59,0x90,0xF7,0x00, ++ ++ 0xE0,0x24,0xFE,0xFD,0x7F,0x01,0x7E,0xF7, ++ ++ 0x12,0x47,0xAC,0x90,0xF7,0x00,0xE0,0x24, ++ ++ 0xFF,0xF5,0x82,0xE4,0x34,0xF6,0xF5,0x83, ++ ++ 0xEE,0xF0,0xA3,0xEF,0xF0,0x90,0xF4,0x05, ++ ++ 0x74,0x20,0xF0,0x90,0x44,0xB8,0xE0,0x60, ++ ++ 0x1C,0x7E,0xDE,0x7F,0x40,0x90,0xF7,0x00, ++ ++ 0xE0,0x04,0xFB,0x7D,0x00,0x7C,0xF7,0x12, ++ ++ 0x56,0x9C,0x90,0xF7,0x00,0xE0,0x04,0x90, ++ ++ 0xDD,0x86,0xF0,0x80,0x77,0x90,0x41,0xAD, ++ ++ 0xE0,0x54,0x03,0xFF,0x90,0xF4,0x11,0xE0, ++ ++ 0x54,0xFC,0x4F,0xF0,0x80,0x66,0x90,0x41, ++ ++ 0xAD,0xE0,0xF4,0x70,0x30,0x90,0xF4,0x12, ++ ++ 0x74,0x05,0xF0,0xA3,0xE4,0xF0,0xA3,0xE0, ++ ++ 0x54,0xFC,0xF0,0x90,0xF7,0x00,0x74,0x04, ++ ++ 0xF0,0x90,0xF7,0x03,0xE0,0x90,0xF7,0x01, ++ ++ 0xF0,0xA3,0xE5,0x12,0xF0,0x90,0xF7,0x01, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xF4,0xFF,0xEE,0xF4, ++ ++ 0xA3,0xF0,0xA3,0xEF,0xF0,0x90,0xF4,0x05, ++ ++ 0x74,0x20,0xF0,0x90,0x44,0xB8,0xE0,0x60, ++ ++ 0x1C,0x7E,0xDE,0x7F,0x40,0x90,0xF7,0x00, ++ ++ 0xE0,0x04,0xFB,0x7D,0x00,0x7C,0xF7,0x12, ++ ++ 0x56,0x9C,0x90,0xF7,0x00,0xE0,0x04,0x90, ++ ++ 0xDD,0x86,0xF0,0x80,0x07,0x90,0xF4,0x11, ++ ++ 0xE0,0x54,0xFC,0xF0,0xD0,0x07,0xD0,0x06, ++ ++ 0xD0,0x05,0xD0,0x04,0xD0,0x03,0xD0,0x02, ++ ++ 0xD0,0x01,0xD0,0x00,0xD0,0xD0,0xD0,0x86, ++ ++ 0xD0,0x84,0xD0,0x85,0xD0,0x82,0xD0,0x83, ++ ++ 0xD0,0xF0,0xD0,0xE0,0x32,0x32,0x32,0x32, ++ ++ 0x32,0x32,0x90,0xF6,0x13,0xE0,0x30,0xE0, ++ ++ 0x03,0x7F,0x03,0x22,0x90,0xF6,0xB4,0xE0, ++ ++ 0x30,0xE0,0x03,0x7F,0x00,0x22,0x90,0xF6, ++ ++ 0x6F,0xE0,0x30,0xE0,0x03,0x7F,0x02,0x22, ++ ++ 0x7F,0x01,0x22,0x90,0x41,0x7F,0xE0,0x90, ++ ++ 0x41,0x8E,0xF0,0xE0,0x54,0xF9,0xFF,0xBF, ++ ++ 0x38,0x04,0x7F,0x01,0x80,0x02,0x7F,0x00, ++ ++ 0xEF,0x54,0x01,0xFF,0x90,0xD8,0x1A,0xE0, ++ ++ 0x54,0xFE,0x4F,0xF0,0x90,0xF6,0x41,0xE0, ++ ++ 0xB4,0x22,0x12,0x90,0xD8,0xD1,0xE0,0x54, ++ ++ 0xFE,0x44,0x01,0xF0,0x90,0xD8,0xD0,0xE0, ++ ++ 0x54,0xFE,0x44,0x01,0xF0,0x90,0xD8,0x30, ++ ++ 0xE0,0x54,0xFE,0x44,0x01,0xF0,0xA3,0xE0, ++ ++ 0x54,0xFE,0xF0,0xA3,0xE0,0x54,0xFE,0xF0, ++ ++ 0x90,0xD8,0x29,0xE0,0x54,0xFE,0xF0,0x90, ++ ++ 0xF6,0xB3,0xE0,0x54,0xFE,0x44,0x01,0xF0, ++ ++ 0x90,0xF6,0x32,0x74,0xFF,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF6,0x31,0xE0,0x54,0xFE,0x44,0x01, ++ ++ 0xF0,0x90,0xF6,0x13,0xE0,0x54,0x01,0x90, ++ ++ 0x44,0xB8,0xF0,0x12,0x7C,0x41,0x12,0x52, ++ ++ 0xD3,0x90,0x41,0x90,0xEF,0xF0,0x90,0xF6, ++ ++ 0xA0,0x74,0x04,0xF0,0x90,0x41,0x90,0xE0, ++ ++ 0x90,0xF6,0xA1,0xF0,0x90,0xF6,0xDE,0xE0, ++ ++ 0x54,0xFE,0x44,0x01,0xF0,0x90,0xF6,0xDE, ++ ++ 0xE0,0x20,0xE0,0xF9,0x90,0xDF,0x82,0xE0, ++ ++ 0x44,0x20,0xF0,0x90,0xDD,0x17,0xE0,0x54, ++ ++ 0xFE,0xF0,0xC2,0xDC,0xD2,0xBC,0x12,0x56, ++ ++ 0xD8,0xD2,0xE9,0x12,0x78,0x4B,0x12,0x5A, ++ ++ 0x72,0x90,0xF4,0x18,0xE4,0xF0,0xA3,0xE0, ++ ++ 0x54,0xF0,0x44,0x08,0xF0,0x90,0xF4,0x1E, ++ ++ 0xE0,0x54,0xEF,0x44,0x10,0xF0,0xC2,0xB8, ++ ++ 0xC2,0xBA,0xD2,0xAF,0xD2,0xA8,0xD2,0xAA, ++ ++ 0x90,0xDF,0x82,0xE0,0x30,0xE0,0x1A,0xA2, ++ ++ 0xAF,0xE4,0x33,0x90,0x41,0x8D,0xF0,0xC2, ++ ++ 0xAF,0x90,0xDF,0x82,0x74,0x20,0xF0,0xE4, ++ ++ 0xF0,0x90,0x41,0x8D,0xE0,0x24,0xFF,0x92, ++ ++ 0xAF,0x90,0x41,0x81,0xE0,0xFF,0x90,0x43, ++ ++ 0x43,0xE0,0x6F,0x60,0x1D,0xA2,0xAF,0xE4, ++ ++ 0x33,0x90,0x41,0x8D,0xF0,0xC2,0xAF,0x90, ++ ++ 0x44,0xDE,0xE0,0x70,0x05,0x90,0x43,0x43, ++ ++ 0xEF,0xF0,0x90,0x41,0x8D,0xE0,0x24,0xFF, ++ ++ 0x92,0xAF,0x12,0x58,0xDB,0x90,0x41,0x8F, ++ ++ 0xE0,0xB4,0x07,0x05,0x12,0x5A,0x0B,0x80, ++ ++ 0xA7,0x12,0x59,0x73,0x80,0xA2,0x22,0x75, ++ ++ 0x81,0x18,0x02,0x54,0x71,0x02,0x52,0xF4, ++ ++ 0xE4,0x93,0xA3,0xF8,0xE4,0x93,0xA3,0x40, ++ ++ 0x03,0xF6,0x80,0x01,0xF2,0x08,0xDF,0xF4, ++ ++ 0x80,0x29,0xE4,0x93,0xA3,0xF8,0x54,0x07, ++ ++ 0x24,0x0C,0xC8,0xC3,0x33,0xC4,0x54,0x0F, ++ ++ 0x44,0x20,0xC8,0x83,0x40,0x04,0xF4,0x56, ++ ++ 0x80,0x01,0x46,0xF6,0xDF,0xE4,0x80,0x0B, ++ ++ 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80, ++ ++ 0x90,0x64,0x98,0xE4,0x7E,0x01,0x93,0x60, ++ ++ 0xBC,0xA3,0xFF,0x54,0x3F,0x30,0xE5,0x09, ++ ++ 0x54,0x1F,0xFE,0xE4,0x93,0xA3,0x60,0x01, ++ ++ 0x0E,0xCF,0x54,0xC0,0x25,0xE0,0x60,0xA8, ++ ++ 0x40,0xB8,0xE4,0x93,0xA3,0xFA,0xE4,0x93, ++ ++ 0xA3,0xF8,0xE4,0x93,0xA3,0xC8,0xC5,0x82, ++ ++ 0xC8,0xCA,0xC5,0x83,0xCA,0xF0,0xA3,0xC8, ++ ++ 0xC5,0x82,0xC8,0xCA,0xC5,0x83,0xCA,0xDF, ++ ++ 0xE9,0xDE,0xE7,0x80,0xBE,0x90,0x41,0xBA, ++ ++ 0xEF,0xF0,0xA3,0xED,0xF0,0xA3,0xEB,0xF0, ++ ++ 0x90,0x41,0x92,0xE0,0xB4,0x01,0x2E,0x90, ++ ++ 0x41,0xBC,0xE0,0x24,0x01,0xFF,0xE4,0x33, ++ ++ 0xFE,0xE4,0xFC,0xFD,0x7B,0xFB,0x7A,0x04, ++ ++ 0xF9,0xF8,0x12,0x7D,0x98,0xE4,0x7B,0x04, ++ ++ 0xFA,0xF9,0xF8,0x12,0x7E,0x23,0xEF,0x24, ++ ++ 0x03,0xFF,0xE4,0x3E,0xFE,0xE4,0x3D,0xFD, ++ ++ 0xE4,0x3C,0xFC,0x80,0x3F,0x90,0x41,0xBC, ++ ++ 0xE0,0x24,0x01,0xFF,0xE4,0x33,0xFE,0xE4, ++ ++ 0xFC,0xFD,0x7B,0x05,0xFA,0xF9,0xF8,0x12, ++ ++ 0x7D,0x98,0xA8,0x04,0xA9,0x05,0xAA,0x06, ++ ++ 0xAB,0x07,0x90,0xF1,0x03,0xE0,0xFF,0xE4, ++ ++ 0xFC,0xFD,0xFE,0x12,0x7D,0x98,0xE4,0x7B, ++ ++ 0x04,0xFA,0xF9,0xF8,0x12,0x7E,0x23,0xEF, ++ ++ 0x24,0x03,0xFF,0xE4,0x3E,0xFE,0xE4,0x3D, ++ ++ 0xFD,0xE4,0x3C,0xFC,0x90,0x41,0xBF,0xEE, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x90,0x41,0xBB,0xE0, ++ ++ 0x90,0xF0,0x00,0xF0,0x90,0x41,0x92,0xE0, ++ ++ 0xB4,0x01,0x27,0x90,0x41,0x98,0xE0,0xFF, ++ ++ 0x90,0x41,0x97,0xE0,0x2F,0xFF,0xE4,0x33, ++ ++ 0xFE,0xC3,0xEF,0x94,0x0A,0xEE,0x64,0x80, ++ ++ 0x94,0x80,0x50,0x05,0x12,0x7C,0x0E,0x80, ++ ++ 0x09,0x90,0x41,0xBE,0x74,0x05,0xF0,0x02, ++ ++ 0x56,0x8E,0x90,0xF1,0x03,0xE0,0x90,0x41, ++ ++ 0x91,0xF0,0x90,0xF6,0xB5,0xE0,0x54,0xF7, ++ ++ 0x44,0x08,0xF0,0xE0,0x54,0xF7,0xF0,0x90, ++ ++ 0x41,0x91,0xE0,0x90,0xF1,0x03,0xF0,0x90, ++ ++ 0x41,0xBA,0xE0,0xFF,0xB4,0x01,0x09,0x90, ++ ++ 0xF1,0x04,0xE0,0x54,0xF3,0xF0,0x80,0x18, ++ ++ 0xEF,0xB4,0x02,0x0B,0x90,0xF1,0x04,0xE0, ++ ++ 0x54,0xF3,0x44,0x08,0xF0,0x80,0x09,0x90, ++ ++ 0xF1,0x04,0xE0,0x54,0xF3,0x44,0x04,0xF0, ++ ++ 0x90,0x41,0xBB,0xE0,0x54,0x01,0xFF,0x90, ++ ++ 0xF1,0x00,0xE0,0x54,0xFE,0x4F,0xF0,0x90, ++ ++ 0x41,0xBC,0xE0,0x90,0xF1,0x01,0xF0,0x12, ++ ++ 0x7B,0x3E,0x90,0x41,0xBD,0xE0,0x64,0x01, ++ ++ 0x60,0x03,0x02,0x56,0x6C,0x90,0xF1,0x02, ++ ++ 0xE0,0x20,0xE2,0x16,0xE0,0x20,0xE1,0x12, ++ ++ 0xE0,0x20,0xE3,0x0E,0x90,0x41,0xBF,0x74, ++ ++ 0xFF,0xF5,0xF0,0x12,0x7D,0x6C,0x45,0xF0, ++ ++ 0x70,0xE3,0x90,0x41,0xBF,0xE0,0x70,0x02, ++ ++ 0xA3,0xE0,0x70,0x25,0x90,0xF1,0x03,0xE0, ++ ++ 0x90,0x41,0x91,0xF0,0x90,0xF6,0xB5,0xE0, ++ ++ 0x54,0xF7,0x44,0x08,0xF0,0xE0,0x54,0xF7, ++ ++ 0xF0,0x90,0x41,0x91,0xE0,0x90,0xF1,0x03, ++ ++ 0xF0,0x90,0x41,0xBE,0x74,0x04,0xF0,0x80, ++ ++ 0x49,0x90,0xF1,0x02,0xE0,0x30,0xE2,0x08, ++ ++ 0x90,0x41,0xBE,0x74,0x02,0xF0,0x80,0x3A, ++ ++ 0x90,0x41,0xBB,0xE0,0x30,0xE0,0x16,0x90, ++ ++ 0xF1,0x02,0xE0,0x30,0xE1,0x08,0x90,0x41, ++ ++ 0xBE,0x74,0x01,0xF0,0x80,0x24,0xE4,0x90, ++ ++ 0x41,0xBE,0xF0,0x80,0x1D,0x90,0xF1,0x02, ++ ++ 0xE0,0x30,0xE3,0x08,0x90,0x41,0xBE,0x74, ++ ++ 0x01,0xF0,0x80,0x0E,0xE4,0x90,0x41,0xBE, ++ ++ 0xF0,0x80,0x07,0xE4,0x90,0x41,0xBE,0xF0, ++ ++ 0x80,0x1B,0x90,0x41,0xBB,0xE0,0x30,0xE0, ++ ++ 0x0B,0x90,0xF1,0x02,0xE0,0x54,0xF7,0x44, ++ ++ 0x08,0xF0,0x80,0x09,0x90,0xF1,0x02,0xE0, ++ ++ 0x54,0xFD,0x44,0x02,0xF0,0x90,0x41,0x91, ++ ++ 0xE0,0x90,0xF1,0x03,0xF0,0x90,0x41,0xBE, ++ ++ 0xE0,0xFF,0x22,0xAA,0x86,0x53,0x86,0xFE, ++ ++ 0x8E,0x85,0x8F,0x84,0x8C,0x83,0x8D,0x82, ++ ++ 0x0B,0x80,0x0A,0xE0,0xA3,0x63,0x86,0x01, ++ ++ 0xF0,0xA3,0x63,0x86,0x01,0xDB,0xF4,0x8A, ++ ++ 0x86,0x22,0x43,0x8E,0x08,0x53,0x89,0xF0, ++ ++ 0x43,0x89,0x01,0x22,0xAD,0x07,0xAC,0x06, ++ ++ 0xC2,0x8C,0xC2,0x8D,0xEC,0xF4,0xF5,0x8C, ++ ++ 0xED,0xF4,0xF5,0x8A,0xD2,0x8C,0x22,0xC2, ++ ++ 0xAF,0x90,0x41,0x03,0x74,0x02,0xF0,0xA3, ++ ++ 0x74,0x47,0xF0,0xA3,0x74,0x00,0xF0,0x90, ++ ++ 0x41,0x0B,0x74,0x02,0xF0,0xA3,0x74,0x47, ++ ++ 0xF0,0xA3,0x74,0x01,0xF0,0x90,0x41,0x13, ++ ++ 0x74,0x02,0xF0,0xA3,0x74,0x48,0xF0,0xA3, ++ ++ 0x74,0x0F,0xF0,0x90,0x41,0x1B,0x74,0x02, ++ ++ 0xF0,0xA3,0x74,0x52,0xF0,0xA3,0x74,0xCE, ++ ++ 0xF0,0x90,0x41,0x23,0x74,0x02,0xF0,0xA3, ++ ++ 0x74,0x57,0xF0,0xA3,0x74,0x93,0xF0,0x90, ++ ++ 0x41,0x2B,0x74,0x02,0xF0,0xA3,0x74,0x6D, ++ ++ 0xF0,0xA3,0x74,0xA9,0xF0,0x90,0x41,0x33, ++ ++ 0x74,0x02,0xF0,0xA3,0x74,0x67,0xF0,0xA3, ++ ++ 0x74,0x3B,0xF0,0x90,0x41,0x3B,0x74,0x02, ++ ++ 0xF0,0xA3,0x74,0x52,0xF0,0xA3,0x74,0xCF, ++ ++ 0xF0,0x90,0x41,0x43,0x74,0x02,0xF0,0xA3, ++ ++ 0x74,0x52,0xF0,0xA3,0x74,0xD0,0xF0,0x90, ++ ++ 0x41,0x4B,0x74,0x02,0xF0,0xA3,0x74,0x60, ++ ++ 0xF0,0xA3,0x74,0x6A,0xF0,0x90,0x41,0x53, ++ ++ 0x74,0x02,0xF0,0xA3,0x74,0x52,0xF0,0xA3, ++ ++ 0x74,0xD1,0xF0,0x90,0x41,0x5B,0x74,0x02, ++ ++ 0xF0,0xA3,0x74,0x52,0xF0,0xA3,0x74,0xD2, ++ ++ 0xF0,0x90,0x41,0x63,0x74,0x02,0xF0,0xA3, ++ ++ 0x74,0x67,0xF0,0xA3,0x74,0x85,0xF0,0xD2, ++ ++ 0xAF,0x22,0x32,0x90,0x41,0xC1,0xEF,0xF0, ++ ++ 0xA3,0xED,0xF0,0xEB,0x70,0x61,0x90,0x41, ++ ++ 0xC4,0xE0,0xFF,0xB4,0x01,0x0A,0x90,0x41, ++ ++ 0xC6,0xE0,0x90,0xF0,0x01,0xF0,0x80,0x14, ++ ++ 0xEF,0xB4,0x02,0x10,0x90,0x41,0xC5,0xE0, ++ ++ 0x90,0xF0,0x01,0xF0,0x90,0x41,0xC6,0xE0, ++ ++ 0x90,0xF0,0x02,0xF0,0x90,0x41,0xC4,0xE0, ++ ++ 0x24,0x01,0xF5,0x82,0xE4,0x34,0xF0,0xAF, ++ ++ 0x82,0xFE,0x90,0x41,0xC7,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0x90,0x41,0xCA,0xE0,0xFB,0x12, ++ ++ 0x56,0x9C,0x90,0x41,0xC1,0xE0,0xFF,0xA3, ++ ++ 0xE0,0xFD,0x90,0x41,0xCA,0xE0,0xFE,0x90, ++ ++ 0x41,0xC4,0xE0,0x2E,0xFB,0x90,0x41,0xBD, ++ ++ 0x74,0x01,0xF0,0x12,0x54,0xB6,0x22,0x90, ++ ++ 0x41,0xC4,0xE0,0x70,0x22,0x90,0x41,0xC1, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x44,0x01,0xFD,0x90, ++ ++ 0x41,0xCA,0xE0,0xFB,0x90,0x41,0xBD,0x74, ++ ++ 0x01,0xF0,0x12,0x54,0xB6,0x90,0x41,0xCB, ++ ++ 0xEF,0xF0,0x60,0x5F,0xE0,0xFF,0x22,0x7E, ++ ++ 0xF0,0x7F,0x01,0x90,0x41,0xC4,0xE0,0xFD, ++ ++ 0xC3,0x74,0xC7,0x9D,0xF9,0x74,0x41,0x94, ++ ++ 0x00,0xFC,0xAD,0x01,0xE0,0xFB,0x12,0x56, ++ ++ 0x9C,0x90,0x41,0xC1,0xE0,0xFF,0xA3,0xE0, ++ ++ 0xFD,0x90,0x41,0xC4,0xE0,0xFB,0x90,0x41, ++ ++ 0xBD,0x74,0x01,0xF0,0x12,0x54,0xB6,0x90, ++ ++ 0x41,0xCB,0xEF,0xF0,0x60,0x03,0xE0,0xFF, ++ ++ 0x22,0x90,0x41,0xC1,0xE0,0xFF,0xA3,0xE0, ++ ++ 0x44,0x01,0xFD,0x90,0x41,0xCA,0xE0,0xFB, ++ ++ 0x90,0x41,0xBD,0x74,0x01,0xF0,0x12,0x54, ++ ++ 0xB6,0x90,0x41,0xCB,0xEF,0xF0,0x60,0x03, ++ ++ 0xE0,0xFF,0x22,0x90,0x41,0xC7,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x7C,0xF0,0x7D,0x00,0x90, ++ ++ 0x41,0xCA,0xE0,0xFB,0x12,0x56,0x9C,0x7F, ++ ++ 0x00,0x22,0x90,0x41,0xCC,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0xA3,0xEC,0xF0,0xA3,0xED,0xF0, ++ ++ 0x90,0x41,0xC4,0x74,0x01,0xF0,0x90,0x41, ++ ++ 0xCC,0xE0,0xFF,0xA3,0xE0,0x90,0x41,0xC5, ++ ++ 0xCF,0xF0,0xA3,0xEF,0xF0,0x90,0x41,0xCE, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x41,0xC7,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x04,0xF0,0x7D,0xC0,0x7F,0x02,0x12,0x57, ++ ++ 0x94,0x22,0xC2,0xE9,0x90,0x41,0xD3,0xE0, ++ ++ 0xFF,0xA3,0xE0,0xFE,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFC,0xD2,0xE9,0x60,0x06,0xED,0xD3, ++ ++ 0x94,0x02,0x40,0x06,0x90,0xF6,0xA5,0xE4, ++ ++ 0xF0,0x22,0xED,0xD3,0x94,0x00,0x40,0x16, ++ ++ 0xED,0xC4,0x54,0xF0,0xFC,0x74,0x37,0x9C, ++ ++ 0xFC,0xEE,0xC4,0x54,0x0F,0xFB,0xC3,0xEC, ++ ++ 0x9B,0x90,0xF6,0xA5,0xF0,0x22,0xEE,0xD3, ++ ++ 0x94,0x0C,0x40,0x10,0xEE,0x13,0x13,0x13, ++ ++ 0x54,0x1F,0xFC,0xC3,0x74,0x49,0x9C,0x90, ++ ++ 0xF6,0xA5,0xF0,0x22,0xEE,0xD3,0x94,0x02, ++ ++ 0x40,0x19,0xEE,0x25,0xE0,0xFC,0xC3,0x74, ++ ++ 0x5F,0x9C,0xFC,0xEF,0xC4,0x13,0x13,0x13, ++ ++ 0x54,0x01,0xFB,0xC3,0xEC,0x9B,0x90,0xF6, ++ ++ 0xA5,0xF0,0x22,0xED,0xD3,0x94,0x10,0x40, ++ ++ 0x1A,0xEE,0x25,0xE0,0x25,0xE0,0xFE,0xC3, ++ ++ 0x74,0x64,0x9E,0xFE,0xEF,0xC4,0x13,0x13, ++ ++ 0x54,0x03,0xFF,0xC3,0xEE,0x9F,0x90,0xF6, ++ ++ 0xA5,0xF0,0x22,0x90,0xF6,0xA5,0x74,0x64, ++ ++ 0xF0,0x22,0xC2,0xE9,0x90,0x41,0xD7,0xE0, ++ ++ 0xFF,0x90,0x41,0xD9,0xE0,0xFD,0x90,0x41, ++ ++ 0xDB,0xE0,0x90,0x41,0xD2,0xF0,0x90,0x41, ++ ++ 0xDC,0xE0,0xF9,0xD2,0xE9,0xEF,0xFE,0x7C, ++ ++ 0x00,0xE4,0x2D,0xFF,0xEC,0x3E,0xFE,0x90, ++ ++ 0x41,0xD0,0xF0,0xA3,0xEF,0xF0,0xD3,0x94, ++ ++ 0x64,0xEE,0x94,0x00,0x40,0x45,0x90,0x43, ++ ++ 0x4F,0xE0,0xB4,0x01,0x1C,0xE9,0xFF,0x90, ++ ++ 0x41,0xD2,0xE0,0x2F,0xFF,0xEC,0x33,0xCF, ++ ++ 0x24,0x71,0xCF,0x34,0xFF,0xFE,0x7D,0x28, ++ ++ 0x12,0x7D,0x05,0xAA,0x06,0xAB,0x07,0x80, ++ ++ 0x13,0xAF,0x01,0x7E,0x00,0x7C,0x00,0x7D, ++ ++ 0x28,0x12,0x7D,0x05,0xEF,0x24,0xA0,0xFB, ++ ++ 0xEE,0x34,0x14,0xFA,0xEA,0xFF,0x90,0x43, ++ ++ 0x4E,0xE0,0x2F,0xFF,0x24,0x05,0x90,0xF6, ++ ++ 0xA6,0xF0,0x22,0x90,0x41,0xD0,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0xC3,0x74,0x64,0x9F,0xFF, ++ ++ 0xE4,0x9E,0xFE,0x7C,0x00,0x7D,0x06,0x12, ++ ++ 0x7D,0x17,0xEF,0x24,0x50,0x90,0xF6,0xA6, ++ ++ 0xF0,0x22,0xC2,0xE9,0x90,0x41,0xDD,0xE0, ++ ++ 0xFF,0xD2,0xE9,0xC3,0x13,0x24,0x1A,0x90, ++ ++ 0xF6,0xA6,0xF0,0xE0,0xC3,0x94,0x5A,0x40, ++ ++ 0x0A,0xE0,0xD3,0x94,0x64,0x50,0x04,0xA3, ++ ++ 0xE4,0xF0,0x22,0x90,0xF6,0xA6,0xE0,0xFF, ++ ++ 0x74,0x5A,0xD3,0x9F,0x40,0x0F,0xE0,0x94, ++ ++ 0x28,0x40,0x0A,0xE0,0xFF,0x74,0x5A,0x9F, ++ ++ 0x25,0xE0,0xA3,0xF0,0x22,0x90,0xF6,0xA6, ++ ++ 0xE0,0xC3,0x94,0x28,0x50,0x0A,0xE0,0xC3, ++ ++ 0x94,0x00,0x40,0x04,0xA3,0x74,0x64,0xF0, ++ ++ 0x22,0xE4,0x90,0x44,0xB5,0xF0,0x90,0x44, ++ ++ 0xB6,0xF0,0x90,0x44,0xB7,0xF0,0x90,0x44, ++ ++ 0xC5,0xF0,0x12,0x6A,0xDF,0x12,0x64,0xA0, ++ ++ 0x22,0x90,0x45,0x18,0xE0,0x60,0x38,0x74, ++ ++ 0x41,0x90,0x41,0x7F,0xF0,0x74,0xE4,0xA3, ++ ++ 0xF0,0x90,0x45,0x34,0xE0,0x70,0x05,0x12, ++ ++ 0x6D,0x4C,0x80,0x1B,0x90,0x45,0x34,0xE0, ++ ++ 0xB4,0x01,0x05,0x12,0x6D,0x56,0x80,0x0F, ++ ++ 0x90,0x45,0x34,0xE0,0x64,0x02,0x60,0x04, ++ ++ 0xE0,0xB4,0xFF,0x03,0x12,0x78,0xFE,0x90, ++ ++ 0x44,0xB8,0xE0,0x70,0x02,0xD2,0xDD,0x90, ++ ++ 0x44,0xB8,0xE0,0x60,0x06,0x12,0x68,0x68, ++ ++ 0x12,0x68,0x49,0x22,0x90,0x43,0x54,0xE0, ++ ++ 0xFF,0x20,0xE7,0x03,0x02,0x5B,0x98,0xB4, ++ ++ 0xA1,0x19,0xA3,0xE0,0x24,0xFE,0x60,0x0D, ++ ++ 0x14,0x60,0x0D,0x24,0x02,0x60,0x03,0x02, ++ ++ 0x5C,0x52,0x7F,0x21,0x22,0x7F,0x22,0x22, ++ ++ 0x7F,0x23,0x22,0x90,0x43,0x54,0xE0,0xFF, ++ ++ 0x54,0x60,0x60,0x03,0x02,0x5C,0x52,0x90, ++ ++ 0x43,0x55,0xE0,0x24,0xFA,0x60,0x2D,0x24, ++ ++ 0xFE,0x70,0x03,0x02,0x5B,0x92,0x24,0xFE, ++ ++ 0x70,0x03,0x02,0x5B,0x95,0x24,0x0A,0x60, ++ ++ 0x03,0x02,0x5C,0x52,0xEF,0x24,0x7F,0x60, ++ ++ 0x0D,0x14,0x60,0x0D,0x24,0x02,0x60,0x03, ++ ++ 0x02,0x5C,0x52,0x7F,0x01,0x22,0x7F,0x02, ++ ++ 0x22,0x7F,0x03,0x22,0x90,0x43,0x54,0xE0, ++ ++ 0xB4,0x81,0x1B,0x90,0x43,0x57,0xE0,0x24, ++ ++ 0xDE,0x60,0x0D,0x14,0x60,0x0D,0x24,0x02, ++ ++ 0x60,0x03,0x02,0x5C,0x52,0x7F,0x6B,0x22, ++ ++ 0x7F,0x6C,0x22,0x7F,0x6D,0x22,0x90,0x43, ++ ++ 0x57,0xE0,0x14,0xB4,0x08,0x00,0x40,0x03, ++ ++ 0x02,0x5C,0x52,0x90,0x5B,0x62,0x75,0xF0, ++ ++ 0x03,0xA4,0xC5,0x83,0x25,0xF0,0xC5,0x83, ++ ++ 0x73,0x02,0x5B,0x7A,0x02,0x5B,0x7D,0x02, ++ ++ 0x5B,0x80,0x02,0x5B,0x83,0x02,0x5B,0x86, ++ ++ 0x02,0x5B,0x89,0x02,0x5B,0x8C,0x02,0x5B, ++ ++ 0x8F,0x7F,0x60,0x22,0x7F,0x61,0x22,0x7F, ++ ++ 0x62,0x22,0x7F,0x63,0x22,0x7F,0x64,0x22, ++ ++ 0x7F,0x65,0x22,0x7F,0x66,0x22,0x7F,0x67, ++ ++ 0x22,0x7F,0x80,0x22,0x7F,0xA0,0x22,0x90, ++ ++ 0x43,0x54,0xE0,0xB4,0x21,0x19,0xA3,0xE0, ++ ++ 0x24,0xF6,0x60,0x0D,0x14,0x60,0x0D,0x24, ++ ++ 0x02,0x60,0x03,0x02,0x5C,0x52,0x7F,0x29, ++ ++ 0x22,0x7F,0x2B,0x22,0x7F,0x2B,0x22,0x90, ++ ++ 0x43,0x54,0xE0,0xFF,0x54,0x60,0x60,0x03, ++ ++ 0x02,0x5C,0x52,0x90,0x43,0x55,0xE0,0x24, ++ ++ 0xFD,0x60,0x39,0x24,0xFE,0x60,0x63,0x24, ++ ++ 0xFE,0x60,0x6B,0x24,0xFE,0x60,0x74,0x24, ++ ++ 0xFE,0x60,0x73,0x24,0x0A,0x70,0x72,0xEF, ++ ++ 0x24,0xFE,0x60,0x17,0x24,0x02,0x70,0x69, ++ ++ 0x90,0x43,0x56,0xE0,0xFE,0xB4,0x01,0x03, ++ ++ 0x7F,0x10,0x22,0xEE,0x64,0x02,0x70,0x59, ++ ++ 0x7F,0x12,0x22,0x90,0x43,0x56,0xE0,0x70, ++ ++ 0x50,0x7F,0x13,0x22,0x90,0x43,0x54,0xE0, ++ ++ 0x24,0xFE,0x60,0x1D,0x24,0x02,0x70,0x41, ++ ++ 0x90,0x43,0x56,0xE0,0xFE,0xB4,0x01,0x03, ++ ++ 0x7F,0x30,0x22,0xEE,0x64,0x02,0x70,0x31, ++ ++ 0x90,0x43,0x58,0xE0,0x70,0x2B,0x7F,0x31, ++ ++ 0x22,0x90,0x43,0x56,0xE0,0x70,0x22,0x7F, ++ ++ 0x32,0x22,0x90,0x43,0x56,0xE0,0xC3,0x94, ++ ++ 0x80,0x50,0x16,0x7F,0x50,0x22,0x90,0x43, ++ ++ 0x54,0xE0,0xB4,0x01,0x03,0x7F,0x71,0x22, ++ ++ 0x7F,0x70,0x22,0x7F,0x90,0x22,0x7F,0xB0, ++ ++ 0x22,0x7F,0x00,0x22,0xE4,0xFF,0x7F,0x06, ++ ++ 0x90,0x43,0x5C,0xE4,0xF0,0xA3,0xDF,0xFC, ++ ++ 0x22,0x90,0x44,0x67,0xE0,0x24,0xA0,0x60, ++ ++ 0x2D,0x14,0x60,0x35,0x14,0x70,0x03,0x02, ++ ++ 0x5C,0xFD,0x24,0xFD,0x70,0x03,0x02,0x5D, ++ ++ 0x5D,0x14,0x70,0x03,0x02,0x5D,0x67,0x24, ++ ++ 0x16,0x60,0x03,0x02,0x5D,0xC9,0x90,0x43, ++ ++ 0x56,0xE0,0x90,0xDD,0x10,0xF0,0xE4,0x90, ++ ++ 0x44,0x68,0xF0,0x02,0x5D,0xCC,0x90,0x43, ++ ++ 0x64,0xE0,0xFF,0x12,0x68,0xD9,0x02,0x5D, ++ ++ 0xCC,0x90,0x44,0xC5,0xE0,0x60,0x29,0x78, ++ ++ 0x89,0x7C,0x43,0x7D,0x01,0x7B,0x01,0x7A, ++ ++ 0x43,0x79,0x80,0x7E,0x00,0x7F,0x09,0x12, ++ ++ 0x7F,0x9D,0x90,0x43,0x8A,0x74,0x02,0xF0, ++ ++ 0x7F,0x00,0x7E,0x40,0x12,0x6A,0x7A,0x7F, ++ ++ 0x02,0x7E,0x00,0x12,0x6A,0xBB,0x80,0x21, ++ ++ 0x78,0x89,0x7C,0x43,0x7D,0x01,0x7B,0x01, ++ ++ 0x7A,0x44,0x79,0x6A,0x7E,0x00,0x7F,0x09, ++ ++ 0x12,0x7F,0x9D,0x7F,0x02,0x7E,0x00,0x12, ++ ++ 0x6A,0x7A,0x7F,0x14,0x7E,0x00,0x12,0x6A, ++ ++ 0xBB,0x90,0x43,0x8B,0xE0,0xFF,0x12,0x68, ++ ++ 0xD9,0x02,0x5D,0xCC,0xE4,0xFF,0x90,0x43, ++ ++ 0x56,0xE0,0xFE,0xEF,0xC3,0x9E,0x50,0x2C, ++ ++ 0x90,0x44,0x69,0xE0,0xFE,0x90,0x45,0x03, ++ ++ 0xE0,0x75,0xF0,0x08,0xA4,0x2E,0xF5,0x82, ++ ++ 0xE4,0x35,0xF0,0xF5,0x83,0xE5,0x82,0x24, ++ ++ 0x00,0xF5,0x82,0xE5,0x83,0x34,0x45,0xF5, ++ ++ 0x83,0xE0,0xFE,0x90,0x44,0x69,0xE0,0x2E, ++ ++ 0xF0,0x0F,0x80,0xCA,0x90,0x44,0x69,0xE0, ++ ++ 0xFF,0x90,0x45,0x03,0xE0,0x75,0xF0,0x08, ++ ++ 0xA4,0x2F,0xF5,0x82,0xE4,0x35,0xF0,0xF5, ++ ++ 0x83,0xE5,0x82,0x24,0x00,0xF5,0x82,0xE5, ++ ++ 0x83,0x34,0x45,0xF5,0x83,0xE0,0xFF,0x12, ++ ++ 0x68,0xD9,0x80,0x6F,0x90,0x43,0x76,0xE0, ++ ++ 0xFF,0x12,0x68,0xD9,0x80,0x65,0x90,0x44, ++ ++ 0xC5,0xE0,0x60,0x31,0x78,0x89,0x7C,0x43, ++ ++ 0x7D,0x01,0x7B,0x01,0x7A,0x44,0x79,0x6A, ++ ++ 0x7E,0x00,0x7F,0x09,0x12,0x7F,0x9D,0x90, ++ ++ 0x43,0x8A,0x74,0x07,0xF0,0x7F,0x02,0x7E, ++ ++ 0x00,0x12,0x6A,0x7A,0x7F,0x14,0x7E,0x00, ++ ++ 0x12,0x6A,0xBB,0x90,0x43,0x8B,0xE0,0xFF, ++ ++ 0x12,0x68,0xD9,0x80,0x2E,0x78,0x89,0x7C, ++ ++ 0x43,0x7D,0x01,0x7B,0x01,0x7A,0x43,0x79, ++ ++ 0x80,0x7E,0x00,0x7F,0x09,0x12,0x7F,0x9D, ++ ++ 0x90,0x43,0x8B,0xE0,0xFF,0x12,0x68,0xD9, ++ ++ 0x7F,0x00,0x7E,0x40,0x12,0x6A,0x7A,0x7F, ++ ++ 0x02,0x7E,0x00,0x12,0x6A,0xBB,0x80,0x03, ++ ++ 0x7F,0x07,0x22,0x7F,0x00,0x22,0x90,0x44, ++ ++ 0x67,0xE0,0xFF,0x14,0x24,0xFD,0x50,0x3A, ++ ++ 0x24,0xF4,0x70,0x03,0x02,0x5E,0x6D,0x24, ++ ++ 0xFD,0x70,0x03,0x02,0x5E,0x75,0x24,0xE2, ++ ++ 0x70,0x03,0x02,0x5E,0xA6,0x14,0x70,0x03, ++ ++ 0x02,0x5E,0x8D,0x24,0xB2,0x70,0x03,0x02, ++ ++ 0x5E,0xD6,0x24,0xF0,0x70,0x03,0x02,0x5E, ++ ++ 0xE6,0x24,0xF0,0x70,0x03,0x02,0x5E,0xF8, ++ ++ 0x24,0xF0,0x70,0x03,0x02,0x5F,0x08,0x02, ++ ++ 0x5F,0x1A,0xEF,0xB4,0x01,0x26,0x90,0x44, ++ ++ 0xC5,0xE0,0x60,0x10,0x90,0x43,0x87,0xE0, ++ ++ 0xFF,0xC4,0x13,0x13,0x54,0x01,0x90,0xDE, ++ ++ 0x00,0xF0,0x80,0x32,0x90,0x44,0x71,0xE0, ++ ++ 0xFF,0xC4,0x13,0x13,0x54,0x01,0x90,0xDE, ++ ++ 0x00,0xF0,0x80,0x22,0x90,0x44,0x67,0xE0, ++ ++ 0xB4,0x02,0x07,0xE4,0x90,0xDE,0x00,0xF0, ++ ++ 0x80,0x14,0x90,0x43,0x58,0xE0,0x54,0x0F, ++ ++ 0x24,0x5C,0xF5,0x82,0xE4,0x34,0x43,0xF5, ++ ++ 0x83,0xE0,0x90,0xDE,0x00,0xF0,0xE4,0x90, ++ ++ 0xDE,0x01,0xF0,0x90,0x44,0x68,0x74,0x02, ++ ++ 0xF0,0x02,0x5F,0x1D,0xE4,0x90,0x44,0x68, ++ ++ 0xF0,0x02,0x5F,0x1D,0x90,0x43,0x58,0xE0, ++ ++ 0x54,0x0F,0x24,0x5C,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0xE4,0xF0,0x90,0x44,0x68, ++ ++ 0xF0,0x02,0x5F,0x1D,0x90,0x43,0x58,0xE0, ++ ++ 0x54,0x0F,0x24,0x5C,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0x74,0x01,0xF0,0xE4,0x90, ++ ++ 0x44,0x68,0xF0,0x80,0x77,0x90,0x44,0xC5, ++ ++ 0xE0,0x60,0x08,0xE4,0x90,0x44,0xB6,0xF0, ++ ++ 0x7F,0x07,0x22,0x90,0x43,0x59,0xE0,0x14, ++ ++ 0x24,0xFC,0x50,0x02,0x80,0x08,0x90,0x44, ++ ++ 0xB6,0x74,0x01,0xF0,0x80,0x08,0xE4,0x90, ++ ++ 0x44,0xB6,0xF0,0x7F,0x07,0x22,0xE4,0x90, ++ ++ 0x44,0x68,0xF0,0x80,0x47,0x90,0x43,0x62, ++ ++ 0xE0,0x90,0xDE,0x00,0xF0,0x90,0x44,0x68, ++ ++ 0x74,0x01,0xF0,0x80,0x37,0x12,0x5C,0x55, ++ ++ 0x90,0x43,0x56,0xE0,0x90,0x43,0x62,0xF0, ++ ++ 0xE4,0x90,0x44,0x68,0xF0,0x80,0x25,0x90, ++ ++ 0x43,0x63,0xE0,0x90,0xDE,0x00,0xF0,0x90, ++ ++ 0x44,0x68,0x74,0x01,0xF0,0x80,0x15,0x12, ++ ++ 0x5C,0x55,0x90,0x43,0x56,0xE0,0x90,0x43, ++ ++ 0x63,0xF0,0xE4,0x90,0x44,0x68,0xF0,0x80, ++ ++ 0x03,0x7F,0x07,0x22,0x7F,0x00,0x22,0x90, ++ ++ 0x44,0x67,0xE0,0x24,0xDE,0x60,0x1F,0x24, ++ ++ 0xF7,0x60,0x2B,0x24,0xBF,0x60,0x0D,0x04, ++ ++ 0x70,0x33,0x90,0x43,0xF3,0xE0,0xFF,0x12, ++ ++ 0x68,0xD9,0x80,0x2C,0x90,0x43,0xFA,0xE0, ++ ++ 0xFF,0x12,0x68,0xD9,0x80,0x22,0x90,0x44, ++ ++ 0xB4,0xE0,0x90,0xDE,0x00,0xF0,0x90,0x44, ++ ++ 0x68,0x74,0x01,0xF0,0x80,0x12,0x90,0x43, ++ ++ 0x57,0xE0,0x90,0x44,0xB4,0xF0,0xE4,0x90, ++ ++ 0x44,0x68,0xF0,0x80,0x03,0x7F,0x07,0x22, ++ ++ 0x7F,0x00,0x22,0x90,0x44,0x67,0xE0,0x12, ++ ++ 0x7E,0xB5,0x5F,0xB6,0x01,0x5F,0xB6,0x02, ++ ++ 0x5F,0xB6,0x03,0x5F,0xB6,0x10,0x5F,0xB6, ++ ++ 0x13,0x5F,0xB6,0x22,0x5F,0xB6,0x2B,0x5F, ++ ++ 0xB6,0x31,0x5F,0xB6,0x32,0x5F,0xB6,0x50, ++ ++ 0x5F,0xC0,0x60,0x5F,0xD6,0x61,0x5F,0xEC, ++ ++ 0x62,0x5F,0xCB,0x65,0x5F,0xE1,0x66,0x60, ++ ++ 0x03,0x6B,0x60,0x0E,0x6C,0x5F,0xB6,0x80, ++ ++ 0x5F,0xB6,0x90,0x5F,0xB6,0xA0,0x5F,0xB6, ++ ++ 0xB0,0x00,0x00,0x60,0x19,0x90,0x44,0x68, ++ ++ 0xE0,0x90,0xDD,0x85,0xF0,0x80,0x5C,0x7A, ++ ++ 0x43,0x79,0x64,0x7B,0x01,0x12,0x68,0xFE, ++ ++ 0x80,0x51,0x7A,0x43,0x79,0x76,0x7B,0x01, ++ ++ 0x12,0x68,0xFE,0x80,0x46,0x7A,0x43,0x79, ++ ++ 0x89,0x7B,0x01,0x12,0x68,0xFE,0x80,0x3B, ++ ++ 0x7A,0x43,0x79,0x89,0x7B,0x01,0x12,0x68, ++ ++ 0xFE,0x80,0x30,0x90,0x45,0x03,0xE0,0x75, ++ ++ 0xF0,0x08,0xA4,0x24,0x00,0xF9,0x74,0x45, ++ ++ 0x35,0xF0,0xFA,0x7B,0x01,0x12,0x68,0xFE, ++ ++ 0x80,0x19,0x7A,0x43,0x79,0xF3,0x7B,0x01, ++ ++ 0x12,0x68,0xFE,0x80,0x0E,0x7B,0x01,0x7A, ++ ++ 0x44,0x79,0x73,0x12,0x68,0xFE,0x80,0x03, ++ ++ 0x7F,0x03,0x22,0x7F,0x00,0x22,0x12,0x5A, ++ ++ 0xBD,0x90,0x44,0x67,0xEF,0xF0,0x90,0x44, ++ ++ 0x67,0xE0,0x70,0x03,0x7F,0x06,0x22,0x12, ++ ++ 0x68,0xA2,0xEF,0x60,0x01,0x22,0x7F,0x00, ++ ++ 0x22,0x12,0x5F,0x6C,0xEF,0x60,0x01,0x22, ++ ++ 0x7F,0x00,0x22,0x90,0xDE,0xC3,0xE0,0x90, ++ ++ 0xDE,0x41,0xF0,0xE4,0xA3,0xF0,0x7C,0xDE, ++ ++ 0x7D,0xC0,0x90,0xDE,0xC0,0xE0,0x04,0xFB, ++ ++ 0x7F,0x00,0x7E,0xF7,0x12,0x56,0x9C,0x90, ++ ++ 0xF4,0x10,0xE0,0x54,0xFE,0x44,0x01,0xF0, ++ ++ 0x22,0xC0,0xE0,0xC0,0xF0,0xC0,0x83,0xC0, ++ ++ 0x82,0xC0,0x85,0xC0,0x84,0xC0,0x86,0x75, ++ ++ 0x86,0x00,0xC0,0xD0,0x75,0xD0,0x00,0xC0, ++ ++ 0x00,0xC0,0x01,0xC0,0x02,0xC0,0x03,0xC0, ++ ++ 0x04,0xC0,0x05,0xC0,0x06,0xC0,0x07,0x90, ++ ++ 0xF6,0xA8,0xE0,0x12,0x7E,0xB5,0x60,0xCE, ++ ++ 0x00,0x63,0x39,0x01,0x63,0x39,0x02,0x60, ++ ++ 0xEB,0x04,0x61,0x0E,0x05,0x61,0x47,0x07, ++ ++ 0x62,0x73,0x0D,0x62,0x73,0x0E,0x62,0x73, ++ ++ 0x0F,0x62,0xC6,0x10,0x62,0x3D,0x11,0x61, ++ ++ 0x58,0x12,0x61,0xA4,0x13,0x62,0x04,0x14, ++ ++ 0x62,0x04,0x15,0x64,0x0D,0x16,0x64,0x3E, ++ ++ 0x17,0x00,0x00,0x64,0x6D,0x7E,0xDE,0x7F, ++ ++ 0x40,0x90,0xF7,0x00,0xE0,0x04,0xFB,0x7D, ++ ++ 0x00,0x7C,0xF7,0x12,0x56,0x9C,0x90,0xF7, ++ ++ 0x00,0xE0,0x04,0x90,0xDD,0x86,0xF0,0x02, ++ ++ 0x64,0x6D,0x90,0xF6,0xA9,0xE0,0x90,0x41, ++ ++ 0xD3,0xF0,0x90,0xF6,0xAA,0xE0,0x90,0x41, ++ ++ 0xD4,0xF0,0x90,0xF6,0xAB,0xE0,0x90,0x41, ++ ++ 0xD5,0xF0,0x90,0xF6,0xAC,0xE0,0x90,0x41, ++ ++ 0xD6,0xF0,0x02,0x64,0x6D,0x90,0x41,0x8F, ++ ++ 0x74,0x05,0xF0,0x90,0xF6,0xA9,0xE0,0x90, ++ ++ 0x41,0xD7,0xF0,0x90,0xF6,0xAA,0xE0,0x90, ++ ++ 0x41,0xD9,0xF0,0x90,0xF6,0xAB,0xE0,0x90, ++ ++ 0x41,0xD8,0xF0,0x90,0xF6,0xAC,0xE0,0x90, ++ ++ 0x41,0xDA,0xF0,0x90,0xF6,0xAD,0xE0,0x90, ++ ++ 0x41,0xDB,0xF0,0x90,0xF6,0xAE,0xE0,0x90, ++ ++ 0x41,0xDC,0xF0,0x02,0x64,0x6D,0x90,0x41, ++ ++ 0x8F,0x74,0x07,0xF0,0x90,0xF6,0xA9,0xE0, ++ ++ 0x90,0x41,0xDD,0xF0,0x02,0x64,0x6D,0x90, ++ ++ 0x41,0xC4,0x74,0x01,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0xF0,0xA3,0x74,0xF0,0xF0,0xA3,0x74, ++ ++ 0x00,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x10, ++ ++ 0xF0,0x7B,0x01,0x7D,0xC0,0x7F,0x02,0x12, ++ ++ 0x57,0x94,0x90,0xF0,0x01,0xE0,0xFF,0x13, ++ ++ 0x13,0x54,0x01,0xFE,0xEF,0x13,0x13,0x13, ++ ++ 0x54,0x03,0x2E,0xFF,0xE0,0x54,0x03,0x2F, ++ ++ 0xFF,0xC4,0x54,0xF0,0xFF,0xA3,0xE0,0xFE, ++ ++ 0xC4,0x54,0x0F,0x2F,0x90,0xF6,0xA4,0xF0, ++ ++ 0x02,0x64,0x6D,0x90,0xF6,0xA9,0xE0,0xC3, ++ ++ 0x94,0x40,0x50,0x1F,0xE0,0x54,0x0F,0x90, ++ ++ 0x43,0x4B,0xF0,0x90,0xF6,0xA9,0xE0,0xFF, ++ ++ 0xC4,0x54,0x0F,0x24,0x50,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xE0,0x90,0x43,0x4A, ++ ++ 0xF0,0x80,0x10,0x90,0xF6,0xA9,0xE0,0x54, ++ ++ 0x3F,0x90,0x43,0x4B,0xF0,0x90,0x43,0x4A, ++ ++ 0x74,0xFE,0xF0,0x90,0x41,0xC4,0x74,0x01, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x0A,0xF0, ++ ++ 0xA3,0x74,0x43,0xF0,0xA3,0x74,0x4A,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x02,0xF0,0xE4, ++ ++ 0xFB,0x7D,0xC0,0x7F,0x02,0x12,0x57,0x94, ++ ++ 0x02,0x64,0x6D,0x90,0xF6,0xA8,0xE0,0xB4, ++ ++ 0x15,0x04,0x7F,0xAC,0x80,0x02,0x7F,0x9C, ++ ++ 0x90,0x43,0x49,0xEF,0xF0,0x90,0x41,0xC4, ++ ++ 0x74,0x01,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x04,0xF0,0xA3,0x74,0x43,0xF0,0xA3,0x74, ++ ++ 0x49,0xF0,0xA3,0xE4,0xF0,0xA3,0x04,0xF0, ++ ++ 0xE4,0xFB,0x7D,0xC0,0x7F,0x02,0x12,0x57, ++ ++ 0x94,0x02,0x64,0x6D,0x7C,0x43,0x7D,0x48, ++ ++ 0x7B,0x01,0x7F,0x1C,0x7E,0x00,0x12,0x58, ++ ++ 0x9B,0x90,0x43,0x48,0xE0,0x54,0xF7,0xF0, ++ ++ 0xE0,0xFF,0x90,0xF6,0xA9,0xE0,0xFE,0x33, ++ ++ 0x33,0x33,0x54,0xF8,0xFE,0xEF,0x4E,0x90, ++ ++ 0x43,0x48,0xF0,0x7C,0x43,0x7D,0x48,0xE4, ++ ++ 0xFB,0x7F,0x1C,0xFE,0x12,0x58,0x9B,0x02, ++ ++ 0x64,0x6D,0x90,0x44,0xB8,0xE0,0x60,0x08, ++ ++ 0x90,0x43,0x46,0x74,0x01,0xF0,0x80,0x06, ++ ++ 0x90,0x43,0x46,0x74,0x03,0xF0,0x90,0xF0, ++ ++ 0x01,0x74,0x05,0xF0,0xA3,0x74,0x80,0xF0, ++ ++ 0x90,0xF6,0xA8,0xE0,0x90,0xF0,0x03,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x7F,0xF0,0x90, ++ ++ 0xF6,0xA8,0xE0,0xF4,0x90,0xF0,0x06,0xF0, ++ ++ 0x90,0x43,0x46,0xE0,0xFF,0x90,0x41,0x8E, ++ ++ 0xE0,0xFD,0x90,0x41,0xBD,0x74,0x01,0xF0, ++ ++ 0x7B,0x07,0x12,0x54,0xB6,0x90,0x43,0x45, ++ ++ 0xEF,0xF0,0x02,0x64,0x6D,0x90,0x41,0xC4, ++ ++ 0x74,0x01,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x07,0xF0,0xA3,0x74,0x43,0xF0,0xA3,0x74, ++ ++ 0x44,0xF0,0xA3,0xE4,0xF0,0xA3,0x04,0xF0, ++ ++ 0xFB,0x7D,0xC0,0x7F,0x02,0x12,0x57,0x94, ++ ++ 0x90,0xF6,0xA9,0xE0,0x90,0x43,0x4E,0xF0, ++ ++ 0x90,0x43,0x44,0xE0,0x54,0xC3,0xF0,0xE0, ++ ++ 0xFF,0x90,0x43,0x4E,0xE0,0xFE,0x25,0xE0, ++ ++ 0x25,0xE0,0xFE,0xEF,0x4E,0x90,0x43,0x44, ++ ++ 0xF0,0x90,0x41,0xC4,0x74,0x01,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x74,0x07,0xF0,0xA3,0x74, ++ ++ 0x43,0xF0,0xA3,0x74,0x44,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0x04,0xF0,0xE4,0xFB,0x7D,0xC0, ++ ++ 0x7F,0x02,0x12,0x57,0x94,0x90,0x43,0x4E, ++ ++ 0xE0,0x90,0xF6,0xA9,0xF0,0x02,0x64,0x6D, ++ ++ 0x90,0xF6,0x41,0xE0,0x24,0xDE,0x70,0x03, ++ ++ 0x02,0x63,0xEA,0x14,0x60,0x0E,0x24,0xFB, ++ ++ 0x70,0x03,0x02,0x63,0xEA,0x24,0x07,0x60, ++ ++ 0x03,0x02,0x64,0x6D,0x90,0xF0,0x02,0x74, ++ ++ 0x52,0xF0,0x90,0x41,0xC4,0x74,0x01,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x05,0xF0,0xA3, ++ ++ 0x74,0x43,0xF0,0xA3,0x74,0x44,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x04,0xF0,0xFB,0x7D,0xC0, ++ ++ 0x7F,0x02,0x12,0x57,0x94,0x90,0xF6,0xA8, ++ ++ 0xE0,0xB4,0x01,0x0C,0x90,0x43,0x47,0x74, ++ ++ 0x01,0xF0,0x90,0x43,0x4F,0xF0,0x80,0x12, ++ ++ 0x90,0xF6,0xA8,0xE0,0xB4,0x02,0x0B,0x90, ++ ++ 0x43,0x47,0x74,0x02,0xF0,0x90,0x43,0x4F, ++ ++ 0xE4,0xF0,0x90,0x43,0x44,0xE0,0x54,0xCF, ++ ++ 0xF0,0xE0,0xFF,0x90,0x43,0x47,0xE0,0xFE, ++ ++ 0xC4,0x54,0xF0,0xFE,0xEF,0x4E,0x90,0x43, ++ ++ 0x44,0xF0,0x90,0x41,0xC4,0x74,0x01,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x05,0xF0,0xA3, ++ ++ 0x74,0x43,0xF0,0xA3,0x74,0x44,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x04,0xF0,0xE4,0xFB,0x7D, ++ ++ 0xC0,0x7F,0x02,0x12,0x57,0x94,0x90,0x43, ++ ++ 0x47,0xE0,0x90,0xF6,0xA9,0xF0,0x02,0x64, ++ ++ 0x6D,0x90,0xF6,0xA8,0xE0,0xB4,0x01,0x0B, ++ ++ 0x90,0xD8,0xCF,0xE0,0x54,0xFE,0x44,0x01, ++ ++ 0xF0,0x80,0x71,0x90,0xF6,0xA8,0xE0,0x64, ++ ++ 0x02,0x70,0x69,0x90,0xD8,0xCF,0xE0,0x54, ++ ++ 0xFE,0xF0,0x80,0x60,0x90,0x43,0x4C,0x74, ++ ++ 0xC0,0xF0,0xA3,0x74,0x16,0xF0,0x90,0x41, ++ ++ 0xC4,0x74,0x01,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0x36,0xF0,0xA3,0x74,0x43,0xF0,0xA3, ++ ++ 0x74,0x4C,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x02,0xF0,0xE4,0xFB,0x7D,0xC0,0x7F,0x02, ++ ++ 0x12,0x57,0x94,0x80,0x2F,0x90,0x43,0x4C, ++ ++ 0x74,0xC0,0xF0,0xA3,0x74,0x13,0xF0,0x90, ++ ++ 0x41,0xC4,0x74,0x01,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0x36,0xF0,0xA3,0x74,0x43,0xF0, ++ ++ 0xA3,0x74,0x4C,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0x02,0xF0,0xE4,0xFB,0x7D,0xC0,0x7F, ++ ++ 0x02,0x12,0x57,0x94,0x53,0x91,0xDF,0x90, ++ ++ 0xF6,0xDF,0xE0,0x54,0xFE,0xF0,0xD0,0x07, ++ ++ 0xD0,0x06,0xD0,0x05,0xD0,0x04,0xD0,0x03, ++ ++ 0xD0,0x02,0xD0,0x01,0xD0,0x00,0xD0,0xD0, ++ ++ 0xD0,0x86,0xD0,0x84,0xD0,0x85,0xD0,0x82, ++ ++ 0xD0,0x83,0xD0,0xF0,0xD0,0xE0,0x32,0x44, ++ ++ 0x43,0x50,0x9E,0xBE,0xDE,0xFE,0x00,0x78, ++ ++ 0x64,0x7C,0x43,0x7D,0x01,0x7B,0xFF,0x7A, ++ ++ 0x7F,0x79,0xC3,0x7E,0x01,0x7F,0x03,0x12, ++ ++ 0x7F,0x9D,0x78,0x6A,0x7C,0x44,0x7D,0x01, ++ ++ 0x7B,0x01,0x7A,0x43,0x79,0x89,0x7E,0x00, ++ ++ 0x7F,0x09,0x12,0x7F,0x9D,0x78,0x73,0x7C, ++ ++ 0x44,0x7D,0x01,0x7B,0xFF,0x7A,0x80,0x79, ++ ++ 0xC6,0x7E,0x00,0x7F,0x41,0x12,0x7F,0x9D, ++ ++ 0x22,0x90,0x44,0xB9,0x74,0xAF,0xF0,0xA3, ++ ++ 0xEF,0xF0,0xA3,0x74,0x22,0xF0,0x7A,0x44, ++ ++ 0x79,0xB9,0x12,0x7E,0xDB,0x22,0x90,0x44, ++ ++ 0xB9,0x74,0x8F,0xF0,0xA3,0xEF,0xF0,0xA3, ++ ++ 0x74,0x22,0xF0,0xAF,0x05,0x7C,0x44,0x7D, ++ ++ 0xB9,0x90,0x44,0xB9,0x12,0x7E,0xDF,0x22, ++ ++ 0xE4,0x90,0x44,0xBE,0xF0,0x90,0x44,0xB8, ++ ++ 0xE0,0x60,0x0D,0x90,0xDD,0xA8,0xE0,0x30, ++ ++ 0xE0,0x06,0x12,0x68,0x77,0x02,0x67,0x38, ++ ++ 0x90,0xDF,0x82,0xE0,0x20,0xE1,0x06,0x12, ++ ++ 0x67,0xD1,0x02,0x67,0x38,0x90,0x44,0xB8, ++ ++ 0xE0,0x70,0x09,0x90,0x44,0xBF,0xE0,0x04, ++ ++ 0xF0,0x02,0x67,0x38,0x90,0xDD,0xA8,0xE0, ++ ++ 0x30,0xE0,0x06,0x12,0x68,0x77,0x02,0x67, ++ ++ 0x38,0x90,0xDD,0x1B,0xE0,0x30,0xE1,0x12, ++ ++ 0x90,0xDD,0x1D,0x74,0xFF,0xF0,0x90,0xDD, ++ ++ 0x1B,0x74,0x02,0xF0,0x12,0x68,0x20,0x02, ++ ++ 0x67,0x38,0x90,0x45,0x33,0xE0,0x64,0x01, ++ ++ 0x70,0x29,0x90,0xDD,0x1B,0xE0,0x30,0xE0, ++ ++ 0x22,0x74,0x01,0xF0,0xE4,0x90,0x44,0xBD, ++ ++ 0xF0,0x90,0xDD,0x1B,0xE0,0x30,0xE0,0x0D, ++ ++ 0x74,0x01,0xF0,0x90,0x44,0xBD,0xE0,0x04, ++ ++ 0xF0,0xE0,0xB4,0x02,0xEC,0x12,0x68,0x3F, ++ ++ 0x02,0x67,0x38,0x90,0xDD,0x1B,0xE0,0x30, ++ ++ 0xE2,0x28,0x90,0xDD,0x14,0xE0,0x44,0x01, ++ ++ 0xF0,0x12,0x69,0x63,0x12,0x60,0x1F,0x90, ++ ++ 0x44,0xBC,0xEF,0xF0,0x70,0x03,0x02,0x67, ++ ++ 0x38,0x90,0xDD,0x14,0xE0,0x54,0xFE,0xF0, ++ ++ 0x90,0xDD,0x12,0xE0,0x44,0x01,0xF0,0x02, ++ ++ 0x67,0x38,0x90,0xDD,0x19,0xE0,0x30,0xE0, ++ ++ 0x42,0x90,0xDD,0x14,0xE0,0x44,0x01,0xF0, ++ ++ 0x90,0xDD,0x19,0x74,0x01,0xF0,0x90,0xDD, ++ ++ 0x13,0xE0,0x44,0x01,0xF0,0x90,0x44,0xB6, ++ ++ 0xE0,0x64,0x01,0x60,0x03,0x02,0x67,0x38, ++ ++ 0x90,0xDD,0x00,0xC0,0x83,0xC0,0x82,0xE0, ++ ++ 0xFF,0x90,0x43,0x59,0xE0,0xFE,0x33,0x33, ++ ++ 0x33,0x54,0xF8,0xFE,0xEF,0x4E,0xD0,0x82, ++ ++ 0xD0,0x83,0xF0,0xE4,0x90,0x44,0xB6,0xF0, ++ ++ 0x02,0x67,0x38,0x90,0xDD,0x18,0xE0,0x30, ++ ++ 0xE0,0x31,0x90,0xDD,0x14,0xE0,0x30,0xE0, ++ ++ 0x2A,0x90,0xDD,0x14,0xE0,0x54,0xFE,0xF0, ++ ++ 0x12,0x60,0x3A,0x90,0x44,0xBC,0xEF,0xF0, ++ ++ 0x60,0x09,0x90,0xDD,0x12,0xE0,0x44,0x01, ++ ++ 0xF0,0x80,0x07,0x90,0xDD,0x13,0xE0,0x54, ++ ++ 0xFE,0xF0,0x90,0xDD,0x18,0x74,0x01,0xF0, ++ ++ 0x02,0x67,0x38,0x90,0xDD,0x19,0xE0,0x30, ++ ++ 0xE1,0x10,0x90,0xDD,0x19,0x74,0x02,0xF0, ++ ++ 0x90,0xDD,0x13,0xE0,0x44,0x02,0xF0,0x02, ++ ++ 0x67,0x38,0x90,0xDD,0x18,0xE0,0x30,0xE1, ++ ++ 0x16,0x90,0xDD,0x84,0x74,0x40,0xF0,0x90, ++ ++ 0xDD,0x13,0xE0,0x54,0xFD,0xF0,0x90,0xDD, ++ ++ 0x18,0x74,0x02,0xF0,0x02,0x67,0x38,0x90, ++ ++ 0xDD,0x19,0xE0,0x30,0xE4,0x6A,0x90,0xDD, ++ ++ 0x19,0x74,0x10,0xF0,0x90,0x43,0x43,0xE0, ++ ++ 0x64,0x01,0x60,0x03,0x02,0x67,0x38,0x90, ++ ++ 0x44,0xDE,0xE0,0xFF,0xB4,0x01,0x31,0xE4, ++ ++ 0x90,0x44,0xBD,0xF0,0x90,0x44,0xBD,0xE0, ++ ++ 0xFE,0xC3,0x94,0x08,0x50,0x14,0x74,0x80, ++ ++ 0x2E,0xF5,0x82,0xE4,0x34,0xDE,0xF5,0x83, ++ ++ 0xE4,0xF0,0x90,0x44,0xBD,0xE0,0x04,0xF0, ++ ++ 0x80,0xE2,0x90,0xDD,0x87,0x74,0x08,0xF0, ++ ++ 0x90,0x44,0xDE,0x74,0x02,0xF0,0x80,0x6F, ++ ++ 0xEF,0x64,0x02,0x70,0x6A,0x90,0x44,0xDE, ++ ++ 0xF0,0x90,0xDD,0x13,0xE0,0x44,0x10,0xF0, ++ ++ 0x90,0x41,0x81,0xE0,0xFF,0x64,0x01,0x60, ++ ++ 0x56,0x90,0x43,0x43,0xEF,0xF0,0x80,0x4F, ++ ++ 0x90,0xDD,0x19,0xE0,0x30,0xE3,0x18,0x90, ++ ++ 0xDD,0x13,0xE0,0x44,0x08,0xF0,0x90,0xDD, ++ ++ 0x19,0x74,0x08,0xF0,0x12,0x60,0x44,0x90, ++ ++ 0x44,0xB7,0x74,0x01,0xF0,0x80,0x30,0x90, ++ ++ 0xDD,0x14,0xE0,0x54,0x08,0xFF,0x13,0x13, ++ ++ 0x13,0x54,0x1F,0x60,0x1C,0x90,0xDD,0x18, ++ ++ 0xE0,0x30,0xE3,0x15,0x90,0xDD,0x84,0x74, ++ ++ 0x40,0xF0,0x90,0xDD,0x13,0xE0,0x54,0xF7, ++ ++ 0xF0,0x90,0xDD,0x18,0x74,0x08,0xF0,0x80, ++ ++ 0x06,0x90,0x44,0xC0,0xE0,0x04,0xF0,0xC2, ++ ++ 0xDC,0x22,0xC0,0xE0,0xC0,0xF0,0xC0,0x83, ++ ++ 0xC0,0x82,0xC0,0x85,0xC0,0x84,0xC0,0x86, ++ ++ 0x75,0x86,0x00,0xC0,0xD0,0x75,0xD0,0x00, ++ ++ 0xC0,0x00,0xC0,0x01,0xC0,0x02,0xC0,0x03, ++ ++ 0xC0,0x04,0xC0,0x05,0xC0,0x06,0xC0,0x07, ++ ++ 0x12,0x65,0x09,0xD0,0x07,0xD0,0x06,0xD0, ++ ++ 0x05,0xD0,0x04,0xD0,0x03,0xD0,0x02,0xD0, ++ ++ 0x01,0xD0,0x00,0xD0,0xD0,0xD0,0x86,0xD0, ++ ++ 0x84,0xD0,0x85,0xD0,0x82,0xD0,0x83,0xD0, ++ ++ 0xF0,0xD0,0xE0,0x32,0xC0,0xE0,0xC0,0xF0, ++ ++ 0xC0,0x83,0xC0,0x82,0xC0,0x85,0xC0,0x84, ++ ++ 0xC0,0x86,0x75,0x86,0x00,0xC0,0xD0,0x75, ++ ++ 0xD0,0x00,0xC0,0x00,0xC0,0x01,0xC0,0x02, ++ ++ 0xC0,0x03,0xC0,0x04,0xC0,0x05,0xC0,0x06, ++ ++ 0xC0,0x07,0xC2,0xDB,0x12,0x65,0x09,0xD0, ++ ++ 0x07,0xD0,0x06,0xD0,0x05,0xD0,0x04,0xD0, ++ ++ 0x03,0xD0,0x02,0xD0,0x01,0xD0,0x00,0xD0, ++ ++ 0xD0,0xD0,0x86,0xD0,0x84,0xD0,0x85,0xD0, ++ ++ 0x82,0xD0,0x83,0xD0,0xF0,0xD0,0xE0,0x32, ++ ++ 0x90,0x45,0x18,0xE0,0x64,0x01,0x60,0x05, ++ ++ 0xE0,0x64,0x05,0x70,0x41,0x90,0x45,0x34, ++ ++ 0xE0,0x70,0x05,0x12,0x6E,0x3F,0x80,0x1B, ++ ++ 0x90,0x45,0x34,0xE0,0xB4,0x01,0x05,0x12, ++ ++ 0x6F,0xCD,0x80,0x0F,0x90,0x45,0x34,0xE0, ++ ++ 0x64,0x02,0x60,0x04,0xE0,0xB4,0xFF,0x03, ++ ++ 0x12,0x79,0x40,0x90,0x43,0x43,0xE0,0xB4, ++ ++ 0x01,0x14,0x90,0x44,0xDE,0xE0,0xB4,0x01, ++ ++ 0x0D,0x90,0xDD,0x13,0xE0,0x54,0xEF,0xF0, ++ ++ 0x90,0xDD,0x87,0x74,0x08,0xF0,0x22,0x12, ++ ++ 0x69,0x97,0x90,0xDD,0x01,0xE0,0x54,0x04, ++ ++ 0x90,0x44,0xC5,0xF0,0x90,0x46,0x00,0xE0, ++ ++ 0x60,0x03,0x12,0x75,0xD6,0x12,0x75,0xD5, ++ ++ 0xE4,0x90,0x44,0xDE,0xF0,0x22,0x90,0xD8, ++ ++ 0x06,0xE0,0x54,0xFE,0x44,0x01,0xF0,0x22, ++ ++ 0x12,0x69,0x97,0x90,0x45,0x11,0xE0,0x30, ++ ++ 0xE6,0x09,0x90,0xDD,0xA7,0xE0,0x44,0x01, ++ ++ 0xF0,0x80,0x07,0x90,0xDD,0x00,0xE0,0x44, ++ ++ 0x80,0xF0,0xD2,0xAF,0xD2,0xDD,0x22,0x90, ++ ++ 0x45,0x12,0xE0,0x30,0xE0,0x07,0x90,0xDD, ++ ++ 0xA8,0xE0,0x30,0xE2,0xF9,0x22,0x90,0xDD, ++ ++ 0xA7,0xE0,0x30,0xE1,0x06,0xE0,0x54,0xFD, ++ ++ 0xF0,0x80,0x07,0x90,0xDD,0xA7,0xE0,0x44, ++ ++ 0x02,0xF0,0x90,0xDD,0xA8,0xE0,0x30,0xE1, ++ ++ 0x08,0x90,0xDD,0x00,0xE0,0x44,0x80,0xF0, ++ ++ 0x22,0x90,0xDD,0x00,0xE0,0x54,0x7F,0xF0, ++ ++ 0x22,0xE4,0x90,0x44,0x69,0xF0,0x12,0x5C, ++ ++ 0x62,0x90,0x44,0xC1,0xEF,0xF0,0x60,0x25, ++ ++ 0xE0,0xB4,0x05,0x03,0x7F,0x05,0x22,0x12, ++ ++ 0x5D,0xCF,0x90,0x44,0xC1,0xEF,0xF0,0x60, ++ ++ 0x14,0xE0,0xB4,0x05,0x03,0x7F,0x05,0x22, ++ ++ 0x12,0x5F,0x20,0x90,0x44,0xC1,0xEF,0xF0, ++ ++ 0x60,0x03,0xE0,0xFF,0x22,0x7F,0x00,0x22, ++ ++ 0x90,0x43,0x5B,0xE0,0xD3,0x94,0x00,0x40, ++ ++ 0x06,0x90,0x44,0x68,0xEF,0xF0,0x22,0x90, ++ ++ 0x43,0x5A,0xE0,0xFE,0xEF,0xC3,0x9E,0x50, ++ ++ 0x06,0x90,0x44,0x68,0xEF,0xF0,0x22,0x90, ++ ++ 0x44,0x68,0xEE,0xF0,0x22,0x90,0x44,0xC2, ++ ++ 0xEB,0xF0,0xA3,0xEA,0xF0,0xA3,0xE9,0xF0, ++ ++ 0xE4,0xFF,0x90,0x44,0x68,0xE0,0xD3,0x94, ++ ++ 0x00,0x40,0x04,0x7E,0x01,0x80,0x02,0x7E, ++ ++ 0x00,0xEF,0xC3,0x94,0x40,0x50,0x04,0x7D, ++ ++ 0x01,0x80,0x02,0x7D,0x00,0xED,0x5E,0x60, ++ ++ 0x33,0x90,0x44,0xC2,0xE0,0xFB,0xA3,0xE0, ++ ++ 0xFA,0xA3,0xE0,0xF9,0x90,0x44,0x69,0xE0, ++ ++ 0xF5,0x82,0x75,0x83,0x00,0x12,0x7C,0xD8, ++ ++ 0xFE,0x74,0x00,0x2F,0xF5,0x82,0xE4,0x34, ++ ++ 0xDE,0xF5,0x83,0xEE,0xF0,0x0F,0x90,0x44, ++ ++ 0x68,0xE0,0x14,0xF0,0x90,0x44,0x69,0xE0, ++ ++ 0x04,0xF0,0x80,0xAE,0x90,0xDD,0x85,0xEF, ++ ++ 0xF0,0x22,0x90,0xDD,0x13,0xE0,0x44,0x01, ++ ++ 0xF0,0x90,0xDD,0x1B,0x74,0x04,0xF0,0xE4, ++ ++ 0xFF,0x74,0x00,0x2F,0xF5,0x82,0xE4,0x34, ++ ++ 0xDF,0xF5,0x83,0xE0,0xFE,0x74,0x54,0x2F, ++ ++ 0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83,0xEE, ++ ++ 0xF0,0x0F,0xEF,0xB4,0x08,0xE3,0x90,0xDD, ++ ++ 0x1B,0xE0,0x20,0xE2,0xD4,0x22,0x90,0xDD, ++ ++ 0x13,0x74,0x7B,0xF0,0x90,0xDD,0x80,0x74, ++ ++ 0xC0,0xF0,0xA3,0x74,0x00,0xF0,0xA3,0x74, ++ ++ 0x40,0xF0,0xA3,0x74,0x80,0xF0,0x12,0x5C, ++ ++ 0x55,0xE4,0x90,0x43,0x62,0xF0,0x90,0x43, ++ ++ 0x63,0xF0,0x90,0xDD,0x14,0x74,0x0B,0xF0, ++ ++ 0x90,0xDD,0x17,0x74,0x06,0xF0,0x90,0x45, ++ ++ 0x33,0xE0,0xB4,0x01,0x07,0x90,0xDD,0x17, ++ ++ 0xE0,0x44,0x01,0xF0,0x90,0xDD,0x15,0x74, ++ ++ 0x0B,0xF0,0x90,0xDD,0x0C,0x74,0x80,0xF0, ++ ++ 0x90,0xDD,0x8E,0xE4,0xF0,0xA3,0x74,0x03, ++ ++ 0xF0,0x90,0xDD,0x0E,0xE4,0xF0,0xA3,0x04, ++ ++ 0xF0,0x90,0xDD,0x13,0xE0,0x54,0x7F,0xF0, ++ ++ 0x90,0xDD,0x20,0xE0,0x54,0xFC,0x44,0x03, ++ ++ 0xF0,0x90,0xDD,0x11,0x74,0x8F,0xF0,0x90, ++ ++ 0x45,0x18,0xE0,0x64,0x01,0x70,0x27,0xC3, ++ ++ 0x74,0x03,0x94,0x89,0x90,0x43,0x82,0xF0, ++ ++ 0x90,0x44,0x6C,0xF0,0x90,0x43,0x84,0x74, ++ ++ 0x02,0xF0,0x90,0x44,0x6E,0xF0,0x90,0xDD, ++ ++ 0x15,0xE0,0x44,0x10,0xF0,0x90,0xDD,0x11, ++ ++ 0xE0,0x44,0x10,0xF0,0x80,0x17,0xC3,0x74, ++ ++ 0xEA,0x94,0x89,0x90,0x43,0x82,0xF0,0x90, ++ ++ 0x44,0x6C,0xF0,0x90,0x43,0x84,0x74,0x01, ++ ++ 0xF0,0x90,0x44,0x6E,0xF0,0x90,0x46,0x00, ++ ++ 0xE0,0x60,0x03,0x12,0x75,0xD6,0x90,0xDD, ++ ++ 0x0C,0x74,0x80,0xF0,0x90,0xDD,0x89,0x74, ++ ++ 0x03,0xF0,0x90,0xDD,0x88,0x74,0xDB,0xF0, ++ ++ 0x90,0xDD,0x13,0xE0,0x54,0xDF,0xF0,0x90, ++ ++ 0xF4,0x1A,0xE0,0x54,0xFE,0x44,0x01,0xF0, ++ ++ 0x22,0x90,0x43,0xE0,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xD9,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xD2,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xCB,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xB4,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xAD,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0xA6,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x43,0x9F,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x22,0x90,0x43,0xE7,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x22,0x8F,0x82,0x8E,0x83,0xE4, ++ ++ 0xFF,0xFE,0xED,0x4C,0x60,0x0F,0xED,0x60, ++ ++ 0x01,0x0C,0xE0,0xA3,0x2F,0xFF,0xE4,0x3E, ++ ++ 0xFE,0xDD,0xF7,0xDC,0xF5,0x22,0x80,0x02, ++ ++ 0x80,0xFE,0x90,0xF1,0x03,0x74,0x25,0xF0, ++ ++ 0x22,0x90,0x44,0xC6,0xEF,0xF0,0xA3,0xED, ++ ++ 0xF0,0xA3,0xEB,0xF0,0xA3,0xE0,0xFE,0xFD, ++ ++ 0x7C,0x00,0x90,0x44,0xCC,0xE0,0xFA,0xA3, ++ ++ 0xE0,0xFB,0x2D,0xFD,0xEC,0x3A,0xFC,0xD3, ++ ++ 0xED,0x94,0x00,0xEC,0x94,0x01,0x40,0x03, ++ ++ 0x7F,0x01,0x22,0xE4,0xB5,0x03,0x08,0xEA, ++ ++ 0xB4,0x01,0x04,0x7F,0x08,0x80,0x0B,0xEE, ++ ++ 0x54,0x07,0xFF,0xC3,0x74,0x08,0x9F,0x54, ++ ++ 0x07,0xFF,0x90,0x44,0xCE,0xEF,0xF0,0xC3, ++ ++ 0xEB,0x9F,0xEA,0x94,0x00,0x50,0x06,0x90, ++ ++ 0x44,0xCD,0xE0,0xA3,0xF0,0x90,0x44,0xCD, ++ ++ 0xE0,0xFF,0xA3,0xE0,0xFE,0xC3,0xEF,0x9E, ++ ++ 0x54,0x07,0xFE,0x90,0x44,0xD0,0xF0,0x90, ++ ++ 0x44,0xCE,0xE0,0xFD,0xC3,0xEF,0x9D,0xC3, ++ ++ 0x9E,0xA3,0xF0,0x90,0x44,0xCE,0xE0,0x90, ++ ++ 0x44,0xD1,0xF0,0xA3,0x74,0x08,0xF0,0x90, ++ ++ 0x44,0xD0,0xE0,0x90,0x44,0xD3,0xF0,0xE4, ++ ++ 0xA3,0xF0,0x90,0x44,0xD4,0xE0,0xFB,0x24, ++ ++ 0xCE,0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83, ++ ++ 0xE0,0x70,0x03,0x02,0x6C,0x90,0x90,0x44, ++ ++ 0xC9,0xE0,0x90,0xF0,0x01,0xF0,0x90,0x44, ++ ++ 0xC8,0xE0,0x70,0x4E,0x7E,0xF0,0x7F,0x02, ++ ++ 0x90,0x44,0xCA,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0x74,0xD1,0x2B,0xF5,0x82,0xE4,0x34,0x44, ++ ++ 0xF5,0x83,0xE0,0xFB,0x12,0x56,0x9C,0x90, ++ ++ 0x44,0xC6,0xE0,0xFF,0xA3,0xE0,0xFD,0x90, ++ ++ 0x44,0xD4,0xE0,0x24,0xD1,0xF5,0x82,0xE4, ++ ++ 0x34,0x44,0xF5,0x83,0xE0,0x04,0xFB,0x90, ++ ++ 0x41,0xBD,0x74,0x01,0xF0,0x12,0x54,0xB6, ++ ++ 0xEF,0x60,0x03,0x7F,0x02,0x22,0x7F,0x35, ++ ++ 0x7E,0x82,0x12,0x56,0xC5,0x20,0x8D,0x60, ++ ++ 0x80,0xFB,0x90,0x44,0xC6,0xE0,0xFF,0xA3, ++ ++ 0xE0,0xFD,0x90,0x41,0xBD,0x74,0x01,0xF0, ++ ++ 0xFB,0x12,0x54,0xB6,0xEF,0x60,0x03,0x7F, ++ ++ 0x02,0x22,0x90,0x44,0xC6,0xE0,0xFF,0xA3, ++ ++ 0xE0,0x44,0x01,0xFD,0x90,0x44,0xD4,0xE0, ++ ++ 0x24,0xD1,0xF5,0x82,0xE4,0x34,0x44,0xF5, ++ ++ 0x83,0xE0,0xFB,0x90,0x41,0xBD,0x74,0x01, ++ ++ 0xF0,0x12,0x54,0xB6,0xEF,0x60,0x03,0x7F, ++ ++ 0x02,0x22,0x90,0x44,0xCA,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x7C,0xF0,0x7D,0x00,0x90,0x44, ++ ++ 0xD4,0xE0,0x24,0xD1,0xF5,0x82,0xE4,0x34, ++ ++ 0x44,0xF5,0x83,0xE0,0xFB,0x12,0x56,0x9C, ++ ++ 0x90,0x44,0xD4,0xE0,0xFF,0x24,0xD1,0xF5, ++ ++ 0x82,0xE4,0x34,0x44,0xF5,0x83,0xE0,0xFE, ++ ++ 0x90,0x44,0xC9,0xE0,0x2E,0xF0,0xEE,0xFD, ++ ++ 0x90,0x44,0xCB,0xE0,0x2D,0xF0,0x90,0x44, ++ ++ 0xCA,0xE0,0x34,0x00,0xF0,0x74,0xCE,0x2F, ++ ++ 0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83,0xC0, ++ ++ 0x83,0xC0,0x82,0xE0,0xFF,0x90,0x44,0xD4, ++ ++ 0xE0,0x24,0xD1,0xF5,0x82,0xE4,0x34,0x44, ++ ++ 0xF5,0x83,0xE0,0xFE,0xC3,0xEF,0x9E,0xD0, ++ ++ 0x82,0xD0,0x83,0xF0,0x02,0x6B,0x73,0x90, ++ ++ 0x44,0xD4,0xE0,0x04,0xF0,0xE0,0xC3,0x94, ++ ++ 0x03,0x50,0x03,0x02,0x6B,0x73,0x7F,0x00, ++ ++ 0x22,0x90,0x44,0xD5,0xEF,0xF0,0xE4,0x90, ++ ++ 0x44,0xD6,0xF0,0x90,0x44,0xD6,0xE0,0xFE, ++ ++ 0xC3,0x94,0x10,0x50,0x1F,0x90,0x44,0xD5, ++ ++ 0xE0,0xFF,0xEE,0x44,0xA0,0xFD,0x90,0x41, ++ ++ 0xBD,0x74,0x01,0xF0,0xFB,0x12,0x54,0xB6, ++ ++ 0xEF,0x60,0x09,0x90,0x44,0xD6,0xE0,0x24, ++ ++ 0x02,0xF0,0x80,0xD7,0x90,0x44,0xD6,0xE0, ++ ++ 0xFF,0xC3,0x94,0x10,0x50,0x05,0xEF,0x44, ++ ++ 0xA0,0xFF,0x22,0x7F,0x01,0x22,0x90,0xDF, ++ ++ 0x82,0xE0,0x54,0xDF,0xF0,0xE4,0x90,0x44, ++ ++ 0xDE,0xF0,0x90,0x44,0xDD,0xF0,0x90,0x43, ++ ++ 0x43,0x04,0xF0,0x90,0x41,0x81,0xF0,0x90, ++ ++ 0x41,0xE1,0x74,0x32,0xF0,0x90,0x41,0xE3, ++ ++ 0x74,0x14,0xF0,0x90,0x41,0xE2,0x74,0x3E, ++ ++ 0xF0,0xE4,0x90,0x44,0xE0,0xF0,0x90,0x44, ++ ++ 0xEB,0xF0,0x90,0x44,0xEF,0xF0,0x90,0x44, ++ ++ 0xF1,0xF0,0xA3,0xF0,0x90,0x44,0xE1,0xF0, ++ ++ 0xA3,0xF0,0x90,0x44,0xEC,0xF0,0xA3,0xF0, ++ ++ 0x90,0x44,0xF7,0xF0,0x90,0xDF,0x80,0x74, ++ ++ 0x28,0xF0,0xA3,0x74,0x04,0xF0,0x75,0xCA, ++ ++ 0x01,0xE4,0xF5,0xCB,0xF5,0xC8,0xD2,0xAD, ++ ++ 0xD2,0xCA,0x22,0x90,0xDF,0x92,0x74,0x50, ++ ++ 0xF0,0x12,0x6C,0xE7,0x22,0x90,0x41,0xDF, ++ ++ 0x74,0x7F,0xF0,0xA3,0x74,0xFF,0xF0,0x90, ++ ++ 0xDF,0x90,0x74,0x50,0xF0,0xE4,0xA3,0xF0, ++ ++ 0xA3,0x74,0x96,0xF0,0xE4,0xA3,0xF0,0xA3, ++ ++ 0x74,0x2C,0xF0,0xA3,0x74,0x01,0xF0,0xA3, ++ ++ 0x74,0x90,0xF0,0xA3,0x74,0x01,0xF0,0xA3, ++ ++ 0x74,0xC2,0xF0,0xA3,0x74,0x01,0xF0,0xA3, ++ ++ 0x74,0x26,0xF0,0xA3,0x74,0x02,0xF0,0xE4, ++ ++ 0xA3,0xF0,0xA3,0x74,0x10,0xF0,0xE4,0xA3, ++ ++ 0xF0,0xA3,0x74,0x20,0xF0,0xE4,0xA3,0xF0, ++ ++ 0xA3,0x74,0x40,0xF0,0x12,0x6C,0xE7,0x22, ++ ++ 0xC0,0xE0,0xC0,0x83,0xC0,0x82,0xC0,0x85, ++ ++ 0xC0,0x84,0xC0,0x86,0x75,0x86,0x00,0xC0, ++ ++ 0xD0,0x75,0xD0,0x00,0xC0,0x07,0xC2,0xCF, ++ ++ 0x90,0x44,0xE1,0xE0,0x60,0x1A,0xA3,0xE0, ++ ++ 0x04,0xF0,0x90,0x41,0xE3,0xE0,0xFF,0x90, ++ ++ 0x44,0xE2,0xE0,0xD3,0x9F,0x40,0x10,0x90, ++ ++ 0x44,0xE1,0xE4,0xF0,0xA3,0xF0,0x80,0x07, ++ ++ 0x90,0x44,0xE1,0xE4,0xF0,0xA3,0xF0,0x90, ++ ++ 0x44,0xF1,0xE0,0x60,0x19,0xA3,0xE0,0x04, ++ ++ 0xF0,0x90,0x41,0xE2,0xE0,0xFF,0x90,0x44, ++ ++ 0xF2,0xE0,0xD3,0x9F,0x40,0x11,0xE4,0xF0, ++ ++ 0x90,0x44,0xF1,0xF0,0x80,0x09,0x90,0x44, ++ ++ 0xF2,0xE4,0xF0,0x90,0x44,0xF1,0xF0,0xD0, ++ ++ 0x07,0xD0,0xD0,0xD0,0x86,0xD0,0x84,0xD0, ++ ++ 0x85,0xD0,0x82,0xD0,0x83,0xD0,0xE0,0x32, ++ ++ 0x90,0xDF,0x82,0xE0,0x30,0xE0,0x14,0x74, ++ ++ 0x20,0xF0,0xE0,0x90,0x44,0xD7,0xF0,0xE4, ++ ++ 0x90,0xDF,0x82,0xF0,0x90,0x44,0xE0,0xF0, ++ ++ 0x7F,0x01,0x22,0x7F,0x00,0x22,0x12,0x6E, ++ ++ 0x21,0xEF,0x60,0x03,0x02,0x6F,0xCC,0x90, ++ ++ 0xDF,0x82,0xE0,0x30,0xE1,0x03,0x02,0x6F, ++ ++ 0xCC,0x90,0x44,0xD9,0xE5,0xE4,0xF0,0x90, ++ ++ 0x44,0xE0,0xE0,0x14,0x60,0x68,0x14,0x70, ++ ++ 0x03,0x02,0x6F,0x51,0x24,0x02,0x60,0x03, ++ ++ 0x02,0x6F,0xC2,0x90,0x44,0xD9,0xE0,0x64, ++ ++ 0xBC,0x70,0x3B,0x90,0x44,0xEB,0xF0,0x90, ++ ++ 0x44,0xED,0xF0,0x90,0x44,0xEC,0xF0,0x90, ++ ++ 0x44,0xEF,0xF0,0x90,0x44,0xD8,0xF0,0x90, ++ ++ 0x44,0xD8,0xE0,0xFF,0xC3,0x94,0x08,0x50, ++ ++ 0x14,0x74,0xE3,0x2F,0xF5,0x82,0xE4,0x34, ++ ++ 0x44,0xF5,0x83,0xE4,0xF0,0x90,0x44,0xD8, ++ ++ 0xE0,0x04,0xF0,0x80,0xE2,0x90,0x44,0xE0, ++ ++ 0x74,0x01,0xF0,0x02,0x6F,0xC2,0x90,0x44, ++ ++ 0xD9,0xE0,0xB4,0xAC,0x09,0x90,0x44,0xE0, ++ ++ 0x74,0x02,0xF0,0x02,0x6F,0xC2,0xE4,0x90, ++ ++ 0x44,0xE0,0xF0,0x02,0x6F,0xC2,0x90,0x44, ++ ++ 0xD9,0xE0,0xC3,0x94,0xE8,0x40,0x17,0x12, ++ ++ 0x72,0x67,0xE4,0x90,0x44,0xE0,0xF0,0x90, ++ ++ 0x44,0xED,0xF0,0x90,0x44,0xEC,0xF0,0x90, ++ ++ 0x44,0xEB,0xF0,0x02,0x6F,0xC2,0x90,0x44, ++ ++ 0xD9,0xE0,0xB4,0x98,0x1F,0x90,0x44,0xEC, ++ ++ 0xE0,0xFF,0x74,0x01,0xA8,0x07,0x08,0x80, ++ ++ 0x02,0xC3,0x33,0xD8,0xFC,0xFF,0x90,0x44, ++ ++ 0xED,0xE0,0x2F,0xF0,0x90,0x44,0xEC,0xE0, ++ ++ 0x04,0xF0,0x80,0x1A,0x90,0x44,0xD9,0xE0, ++ ++ 0xB4,0x88,0x08,0x90,0x44,0xEC,0xE0,0x04, ++ ++ 0xF0,0x80,0x0B,0xE4,0x90,0x44,0xE0,0xF0, ++ ++ 0x90,0x44,0xEC,0xE0,0x04,0xF0,0x90,0x44, ++ ++ 0xEC,0xE0,0x64,0x08,0x60,0x03,0x02,0x6F, ++ ++ 0xC2,0xA3,0xE0,0xFF,0x90,0x44,0xEB,0xE0, ++ ++ 0xFE,0x04,0xF0,0x74,0xE3,0x2E,0xF5,0x82, ++ ++ 0xE4,0x34,0x44,0xF5,0x83,0xEF,0xF0,0xE4, ++ ++ 0x90,0x44,0xEC,0xF0,0xA3,0xF0,0x80,0x71, ++ ++ 0x90,0x44,0xD9,0xE0,0xC3,0x94,0xF8,0x40, ++ ++ 0x68,0x90,0x44,0xEF,0xE0,0x04,0xF0,0x90, ++ ++ 0x44,0xDE,0xE0,0x70,0x41,0x90,0x41,0xE3, ++ ++ 0xE0,0x75,0xF0,0x05,0x84,0xFF,0x90,0x44, ++ ++ 0xEF,0xE0,0xB5,0x07,0x31,0xE4,0x90,0x44, ++ ++ 0xD8,0xF0,0x90,0x44,0xD8,0xE0,0xFF,0x24, ++ ++ 0xE3,0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83, ++ ++ 0xE0,0xFE,0x74,0x80,0x2F,0xF5,0x82,0xE4, ++ ++ 0x34,0xDE,0xF5,0x83,0xEE,0xF0,0x90,0x44, ++ ++ 0xD8,0xE0,0x04,0xF0,0xE0,0xB4,0x08,0xDA, ++ ++ 0x90,0x44,0xDE,0x74,0x01,0xF0,0x90,0x41, ++ ++ 0xE3,0xE0,0x75,0xF0,0x05,0x84,0xFF,0x90, ++ ++ 0x44,0xEF,0xE0,0xB5,0x07,0x02,0xE4,0xF0, ++ ++ 0xE4,0x90,0x44,0xE0,0xF0,0x90,0x44,0xEB, ++ ++ 0xF0,0x90,0xDF,0x82,0xE0,0x20,0xE1,0x03, ++ ++ 0x02,0x6E,0x52,0x22,0x12,0x6E,0x21,0xEF, ++ ++ 0x60,0x03,0x02,0x72,0x66,0x90,0xDF,0x82, ++ ++ 0xE0,0x30,0xE1,0x03,0x02,0x72,0x66,0x90, ++ ++ 0x44,0xDA,0xE5,0xE4,0xF0,0x90,0x44,0xE0, ++ ++ 0xE0,0x14,0x60,0x3F,0x14,0x70,0x03,0x02, ++ ++ 0x71,0x33,0x24,0x02,0x60,0x03,0x02,0x72, ++ ++ 0x5C,0x90,0x44,0xDA,0xE0,0xB4,0x8C,0x23, ++ ++ 0xE4,0x90,0x44,0xEB,0xF0,0xA3,0xF0,0xA3, ++ ++ 0xF0,0xFF,0x7F,0x03,0x90,0x44,0xF3,0xE4, ++ ++ 0xF0,0xA3,0xDF,0xFC,0x7F,0x03,0x90,0x44, ++ ++ 0xE0,0x74,0x01,0xF0,0x90,0x44,0xF8,0xF0, ++ ++ 0x02,0x72,0x5C,0xE4,0x90,0x44,0xE0,0xF0, ++ ++ 0x02,0x72,0x5C,0x90,0x44,0xDA,0xE0,0x54, ++ ++ 0x0F,0xA3,0xF0,0x90,0x44,0xDA,0xE0,0xFF, ++ ++ 0xC4,0x54,0x0F,0x90,0x44,0xDC,0xF0,0x90, ++ ++ 0x44,0xF8,0xE0,0x24,0xFE,0x60,0x34,0x14, ++ ++ 0x60,0x52,0x14,0x60,0x70,0x14,0x70,0x03, ++ ++ 0x02,0x70,0xDF,0x24,0x04,0x60,0x03,0x02, ++ ++ 0x72,0x5C,0x90,0x44,0xDB,0xE0,0xB4,0x07, ++ ++ 0x0E,0xA3,0xE0,0xB4,0x07,0x09,0x90,0x44, ++ ++ 0xF8,0x74,0x02,0xF0,0x02,0x72,0x5C,0xE4, ++ ++ 0x90,0x44,0xE0,0xF0,0x90,0x44,0xF8,0xF0, ++ ++ 0x02,0x72,0x5C,0x90,0x44,0xDB,0xE0,0xB4, ++ ++ 0x07,0x0E,0xA3,0xE0,0xB4,0x07,0x09,0x90, ++ ++ 0x44,0xF8,0x74,0x03,0xF0,0x02,0x72,0x5C, ++ ++ 0xE4,0x90,0x44,0xE0,0xF0,0x90,0x44,0xF8, ++ ++ 0xF0,0x02,0x72,0x5C,0x90,0x44,0xDB,0xE0, ++ ++ 0xB4,0x07,0x0E,0xA3,0xE0,0xB4,0x08,0x09, ++ ++ 0x90,0x44,0xF8,0x74,0x04,0xF0,0x02,0x72, ++ ++ 0x5C,0xE4,0x90,0x44,0xE0,0xF0,0x90,0x44, ++ ++ 0xF8,0xF0,0x02,0x72,0x5C,0x90,0x44,0xDB, ++ ++ 0xE0,0xB4,0x07,0x0E,0xA3,0xE0,0xB4,0x08, ++ ++ 0x09,0x90,0x44,0xF8,0x74,0x05,0xF0,0x02, ++ ++ 0x72,0x5C,0xE4,0x90,0x44,0xE0,0xF0,0x90, ++ ++ 0x44,0xF8,0xF0,0x02,0x72,0x5C,0x90,0x44, ++ ++ 0xDB,0xE0,0x64,0x09,0x70,0x40,0x90,0x44, ++ ++ 0xF3,0x74,0x08,0xF0,0x90,0x44,0xDC,0xE0, ++ ++ 0xB4,0x08,0x0F,0x90,0x44,0xF4,0x74,0x88, ++ ++ 0xF0,0xA3,0xF0,0xE4,0xA3,0xF0,0xA3,0x74, ++ ++ 0x03,0xF0,0x90,0x44,0xDC,0xE0,0xB4,0x07, ++ ++ 0x0F,0x90,0x44,0xF4,0x74,0x88,0xF0,0xE4, ++ ++ 0xA3,0xF0,0xA3,0xF0,0xA3,0x74,0x02,0xF0, ++ ++ 0x90,0x44,0xE0,0x74,0x02,0xF0,0xE4,0x90, ++ ++ 0x44,0xF8,0xF0,0x02,0x72,0x5C,0xE4,0x90, ++ ++ 0x44,0xE0,0xF0,0x90,0x44,0xF8,0xF0,0x02, ++ ++ 0x72,0x5C,0x90,0x44,0xDA,0xE0,0x54,0x0F, ++ ++ 0xA3,0xF0,0x90,0x44,0xDA,0xE0,0xFF,0xC4, ++ ++ 0x54,0x0F,0x90,0x44,0xDC,0xF0,0x90,0x44, ++ ++ 0xDB,0xE0,0xB4,0x07,0x21,0x90,0x44,0xF7, ++ ++ 0xE0,0xFF,0x04,0xF0,0x74,0xF3,0x2F,0xF5, ++ ++ 0x82,0xE4,0x34,0x44,0xF5,0x83,0x74,0x08, ++ ++ 0xF0,0x90,0x44,0xF7,0xE0,0x64,0x04,0x70, ++ ++ 0x50,0x12,0x72,0xAA,0x80,0x4B,0x90,0x44, ++ ++ 0xDB,0xE0,0x64,0x08,0x70,0x3E,0x90,0x44, ++ ++ 0xF7,0xE0,0xFF,0x04,0xF0,0x74,0xF3,0x2F, ++ ++ 0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83,0x74, ++ ++ 0x08,0xF0,0x90,0x44,0xF7,0xE0,0xB4,0x04, ++ ++ 0x03,0x12,0x72,0xAA,0x90,0x44,0xF7,0xE0, ++ ++ 0xFF,0x04,0xF0,0x74,0xF3,0x2F,0xF5,0x82, ++ ++ 0xE4,0x34,0x44,0xF5,0x83,0x74,0x08,0xF0, ++ ++ 0x90,0x44,0xF7,0xE0,0xB4,0x04,0x0A,0x12, ++ ++ 0x72,0xAA,0x80,0x05,0xE4,0x90,0x44,0xE0, ++ ++ 0xF0,0x90,0x44,0xDC,0xE0,0xC3,0x94,0x0C, ++ ++ 0x40,0x26,0x90,0x44,0xF7,0xE0,0x94,0x04, ++ ++ 0x50,0x14,0xE0,0xFF,0x04,0xF0,0x74,0xF3, ++ ++ 0x2F,0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83, ++ ++ 0x74,0x88,0xF0,0x12,0x72,0xAA,0x12,0x72, ++ ++ 0x67,0xE4,0x90,0x44,0xE0,0xF0,0x80,0x73, ++ ++ 0x90,0x44,0xDC,0xE0,0xB4,0x07,0x21,0x90, ++ ++ 0x44,0xF7,0xE0,0xFF,0x04,0xF0,0x74,0xF3, ++ ++ 0x2F,0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83, ++ ++ 0x74,0x88,0xF0,0x90,0x44,0xF7,0xE0,0x64, ++ ++ 0x04,0x70,0x50,0x12,0x72,0xAA,0x80,0x4B, ++ ++ 0x90,0x44,0xDC,0xE0,0x64,0x08,0x70,0x3E, ++ ++ 0x90,0x44,0xF7,0xE0,0xFF,0x04,0xF0,0x74, ++ ++ 0xF3,0x2F,0xF5,0x82,0xE4,0x34,0x44,0xF5, ++ ++ 0x83,0x74,0x88,0xF0,0x90,0x44,0xF7,0xE0, ++ ++ 0xB4,0x04,0x03,0x12,0x72,0xAA,0x90,0x44, ++ ++ 0xF7,0xE0,0xFF,0x04,0xF0,0x74,0xF3,0x2F, ++ ++ 0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83,0x74, ++ ++ 0x88,0xF0,0x90,0x44,0xF7,0xE0,0xB4,0x04, ++ ++ 0x0A,0x12,0x72,0xAA,0x80,0x05,0xE4,0x90, ++ ++ 0x44,0xE0,0xF0,0x90,0xDF,0x82,0xE0,0x20, ++ ++ 0xE1,0x03,0x02,0x6F,0xE0,0x22,0x90,0x45, ++ ++ 0x18,0xE0,0xB4,0x01,0x0D,0x90,0x43,0x43, ++ ++ 0xE0,0xB4,0x01,0x06,0x12,0x73,0x64,0xEF, ++ ++ 0x60,0x2E,0x90,0x44,0xE1,0xE0,0x70,0x28, ++ ++ 0x7E,0xDE,0x7F,0x80,0x7C,0x44,0x7D,0xE3, ++ ++ 0x7B,0x08,0x12,0x56,0x9C,0x90,0x44,0xE1, ++ ++ 0x74,0x01,0xF0,0xE4,0xA3,0xF0,0x90,0x44, ++ ++ 0xDD,0xE0,0x60,0x06,0x90,0x44,0xDF,0xE0, ++ ++ 0x04,0xF0,0x90,0x44,0xDE,0x74,0x01,0xF0, ++ ++ 0x22,0xE4,0xFF,0xEF,0xC3,0x94,0x04,0x50, ++ ++ 0x65,0x74,0xF3,0x2F,0xF5,0x82,0xE4,0x34, ++ ++ 0x44,0xF5,0x83,0xE0,0xFE,0xB4,0x08,0x32, ++ ++ 0x74,0xF4,0x2F,0xF5,0x82,0xE4,0x34,0x44, ++ ++ 0xF5,0x83,0xE0,0xB4,0x88,0x24,0x90,0x44, ++ ++ 0xEC,0xE0,0xFD,0xC3,0x74,0x07,0x9D,0xFD, ++ ++ 0x74,0x01,0xA8,0x05,0x08,0x80,0x02,0xC3, ++ ++ 0x33,0xD8,0xFC,0xFD,0x90,0x44,0xED,0xE0, ++ ++ 0x2D,0xF0,0x90,0x44,0xEC,0xE0,0x04,0xF0, ++ ++ 0x80,0x20,0xEE,0xB4,0x88,0x16,0x74,0xF4, ++ ++ 0x2F,0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83, ++ ++ 0xE0,0xB4,0x08,0x08,0x90,0x44,0xEC,0xE0, ++ ++ 0x04,0xF0,0x80,0x06,0x90,0x44,0xEC,0xE0, ++ ++ 0x04,0xF0,0x0F,0x0F,0x80,0x95,0xE4,0x90, ++ ++ 0x44,0xF7,0xF0,0x90,0x44,0xEC,0xE0,0x64, ++ ++ 0x08,0x70,0x3F,0xA3,0xE0,0xFF,0x90,0x44, ++ ++ 0xEB,0xE0,0xFE,0x04,0xF0,0x74,0xE3,0x2E, ++ ++ 0xF5,0x82,0xE4,0x34,0x44,0xF5,0x83,0xEF, ++ ++ 0xF0,0xE4,0x90,0x44,0xEC,0xF0,0xA3,0xF0, ++ ++ 0x90,0x44,0xEB,0xE0,0xB4,0x04,0x1B,0x90, ++ ++ 0x41,0xDF,0xE0,0xFF,0x90,0x44,0xE5,0xE0, ++ ++ 0x5F,0xF0,0x90,0x41,0xE0,0xE0,0xFF,0x90, ++ ++ 0x44,0xE6,0xE0,0x5F,0xF0,0xE4,0x90,0x44, ++ ++ 0xEB,0xF0,0x22,0xE4,0xFD,0xFC,0x90,0x41, ++ ++ 0xE1,0xE0,0x75,0xF0,0x07,0xA4,0xFF,0xC3, ++ ++ 0xED,0x9F,0xEC,0x95,0xF0,0x40,0x03,0x02, ++ ++ 0x75,0x01,0x74,0xE4,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFF,0x90,0x44, ++ ++ 0xE3,0xE0,0xFE,0xEF,0x6E,0x60,0x03,0x02, ++ ++ 0x74,0xF7,0x74,0xE5,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFF,0x90,0x44, ++ ++ 0xE4,0xE0,0xFE,0xEF,0x6E,0x60,0x03,0x02, ++ ++ 0x74,0xF7,0x74,0xE6,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFF,0x90,0x44, ++ ++ 0xE5,0xE0,0xFE,0xEF,0x6E,0x60,0x03,0x02, ++ ++ 0x74,0xF7,0x74,0xE7,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFF,0x90,0x44, ++ ++ 0xE6,0xE0,0xFE,0xEF,0x6E,0x60,0x03,0x02, ++ ++ 0x74,0xF7,0x74,0xEA,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFE,0x30,0xE7, ++ ++ 0x0B,0x90,0x44,0xF1,0x74,0x01,0xF0,0xE4, ++ ++ 0xA3,0xF0,0xFF,0x22,0x90,0x44,0xF1,0xE0, ++ ++ 0x60,0x3D,0xE4,0xF0,0xA3,0xF0,0xEE,0x64, ++ ++ 0x40,0x70,0x2B,0x90,0x44,0xE3,0xF0,0xA3, ++ ++ 0xF0,0x74,0xEF,0x2D,0xF5,0x82,0x74,0x41, ++ ++ 0x3C,0xF5,0x83,0xE0,0x90,0x44,0xE5,0xF0, ++ ++ 0xE4,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3, ++ ++ 0xF0,0xA3,0xF0,0x90,0x44,0xF1,0x04,0xF0, ++ ++ 0xE4,0xA3,0xF0,0x7F,0x01,0x22,0xE4,0x90, ++ ++ 0x44,0xF1,0xF0,0xA3,0xF0,0xFF,0x22,0xE4, ++ ++ 0x90,0x44,0xE3,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0x74,0xE9,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFE,0x70,0x1F, ++ ++ 0x74,0xEA,0x2D,0xF5,0x82,0x74,0x41,0x3C, ++ ++ 0xF5,0x83,0xE0,0x70,0x12,0x74,0xE8,0x2D, ++ ++ 0xF5,0x82,0x74,0x41,0x3C,0xF5,0x83,0xE0, ++ ++ 0x90,0x44,0xE5,0xF0,0x7F,0x01,0x22,0xEE, ++ ++ 0x70,0x20,0x74,0xEA,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xB4,0x40,0x12, ++ ++ 0x74,0xE8,0x2D,0xF5,0x82,0x74,0x41,0x3C, ++ ++ 0xF5,0x83,0xE0,0x90,0x44,0xE5,0xF0,0x7F, ++ ++ 0x01,0x22,0x74,0xE9,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0xFF,0x60,0x16, ++ ++ 0x90,0x44,0xE3,0xF0,0x74,0xE8,0x2D,0xF5, ++ ++ 0x82,0x74,0x41,0x3C,0xF5,0x83,0xE0,0x90, ++ ++ 0x44,0xE5,0xF0,0x7F,0x01,0x22,0x74,0xEA, ++ ++ 0x2D,0xF5,0x82,0x74,0x41,0x3C,0xF5,0x83, ++ ++ 0xE0,0x30,0xE0,0x18,0x90,0x44,0xE5,0x74, ++ ++ 0x9A,0xF0,0x74,0xE8,0x2D,0xF5,0x82,0x74, ++ ++ 0x41,0x3C,0xF5,0x83,0xE0,0x90,0x44,0xE6, ++ ++ 0xF0,0x7F,0x01,0x22,0x74,0xE8,0x2D,0xF5, ++ ++ 0x82,0x74,0x41,0x3C,0xF5,0x83,0xE0,0x90, ++ ++ 0x44,0xE5,0xF0,0x7F,0x01,0x22,0x74,0x07, ++ ++ 0x2D,0xFD,0xE4,0x3C,0xFC,0x02,0x73,0x67, ++ ++ 0x7F,0x00,0x22,0xAE,0x07,0x90,0x41,0xDE, ++ ++ 0xE0,0xFD,0xB4,0x01,0x03,0x7F,0x03,0x22, ++ ++ 0xAF,0x06,0xE4,0x90,0x44,0xC9,0xF0,0x7A, ++ ++ 0x45,0x7B,0x00,0xA3,0x74,0x45,0xF0,0xA3, ++ ++ 0x74,0x00,0xF0,0xA3,0x74,0x01,0xF0,0xA3, ++ ++ 0xE4,0xF0,0x7B,0x01,0x12,0x6A,0xEA,0xEF, ++ ++ 0x60,0x03,0x7F,0x04,0x22,0x7E,0x45,0x7F, ++ ++ 0x02,0x90,0x45,0x02,0xE0,0xFD,0x7C,0x00, ++ ++ 0x12,0x6A,0xC4,0x90,0x45,0x00,0xE0,0x6E, ++ ++ 0x70,0x03,0xA3,0xE0,0x6F,0x60,0x03,0x7F, ++ ++ 0x05,0x22,0x7F,0x00,0x22,0x90,0x45,0x08, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x43,0x6C,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x90,0x45,0x0A,0xE0, ++ ++ 0xFF,0xA3,0xE0,0x90,0x43,0x6E,0xCF,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x45,0x0C,0xE0,0xFF, ++ ++ 0xA3,0xE0,0x90,0x43,0x70,0xCF,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x90,0x45,0x0E,0xE0,0x90,0x43, ++ ++ 0x72,0xF0,0x90,0x45,0x0F,0xE0,0x90,0x43, ++ ++ 0x73,0xF0,0x90,0x45,0x10,0xE0,0x90,0x43, ++ ++ 0x74,0xF0,0x90,0x45,0x15,0xE0,0x90,0x44, ++ ++ 0x02,0xF0,0x90,0x45,0x13,0xE0,0x90,0x43, ++ ++ 0x88,0xF0,0x90,0x45,0x11,0xE0,0xFF,0x90, ++ ++ 0x44,0x71,0xF0,0x90,0x43,0x87,0xF0,0x90, ++ ++ 0x45,0x14,0xE0,0x90,0x44,0x72,0xF0,0x90, ++ ++ 0x45,0x16,0xE0,0x90,0xF1,0x03,0xF0,0x90, ++ ++ 0x45,0x56,0xE0,0xF4,0x60,0x05,0xE0,0x90, ++ ++ 0xDD,0x93,0xF0,0x22,0x22,0x90,0x45,0x04, ++ ++ 0xE0,0x70,0x03,0x02,0x78,0x4A,0x90,0x45, ++ ++ 0x04,0xE0,0x75,0xF0,0x08,0xA4,0x90,0x44, ++ ++ 0xF9,0xF0,0xE0,0x24,0x01,0xF5,0x82,0xE4, ++ ++ 0x34,0x45,0xF5,0x83,0xE0,0x90,0x44,0xFC, ++ ++ 0xF0,0x90,0x44,0xFC,0xE0,0x70,0x03,0x02, ++ ++ 0x78,0x4A,0x90,0x44,0xF9,0xE0,0xFE,0x24, ++ ++ 0x02,0xA3,0xF0,0x74,0x00,0x2E,0xF5,0x82, ++ ++ 0xE4,0x34,0x45,0xF5,0x83,0xE0,0x90,0x44, ++ ++ 0xFB,0xF0,0xE0,0x54,0xC0,0xFF,0x70,0x06, ++ ++ 0x90,0x44,0xC5,0xE0,0x70,0x16,0xBF,0x40, ++ ++ 0x06,0x90,0x44,0xC5,0xE0,0x60,0x0D,0x90, ++ ++ 0x44,0xFB,0xE0,0x54,0xC0,0x64,0xC0,0x60, ++ ++ 0x03,0x02,0x77,0xD7,0x90,0x44,0xFB,0xE0, ++ ++ 0x54,0x03,0x14,0x60,0x54,0x14,0x70,0x03, ++ ++ 0x02,0x76,0xEF,0x14,0x70,0x03,0x02,0x77, ++ ++ 0x6D,0x24,0x03,0x60,0x03,0x02,0x77,0xD7, ++ ++ 0xE4,0x90,0x44,0xFD,0xF0,0x90,0x44,0xFC, ++ ++ 0xE0,0xFF,0xA3,0xE0,0xC3,0x9F,0x40,0x03, ++ ++ 0x02,0x77,0xD7,0x90,0x44,0xFA,0xE0,0xFE, ++ ++ 0x24,0x00,0xF5,0x82,0xE4,0x34,0x45,0xF5, ++ ++ 0x83,0xE0,0xFF,0x74,0x01,0x2E,0xF5,0x82, ++ ++ 0xE4,0x34,0x45,0xF5,0x83,0xE0,0xFD,0x12, ++ ++ 0x64,0xEF,0x90,0x44,0xFA,0xE0,0x24,0x02, ++ ++ 0xF0,0x90,0x44,0xFD,0xE0,0x04,0xF0,0x80, ++ ++ 0xC4,0xE4,0x90,0x44,0xFD,0xF0,0x90,0x44, ++ ++ 0xFC,0xE0,0xFF,0xA3,0xE0,0xC3,0x9F,0x40, ++ ++ 0x03,0x02,0x77,0xD7,0x90,0x44,0xFA,0xE0, ++ ++ 0xFF,0x24,0x02,0xF5,0x82,0xE4,0x34,0x45, ++ ++ 0xF5,0x83,0xE0,0xFD,0x74,0x00,0x2F,0xF5, ++ ++ 0x82,0xE4,0x34,0x45,0xF5,0x83,0xE0,0xFE, ++ ++ 0x90,0x44,0xFA,0xE0,0x24,0x01,0xF5,0x82, ++ ++ 0xE4,0x34,0x45,0xF5,0x83,0xE0,0xFB,0xEE, ++ ++ 0xEB,0xF5,0x82,0x8E,0x83,0xED,0xF0,0x90, ++ ++ 0x44,0xFA,0xE0,0x24,0x03,0xF0,0x90,0x44, ++ ++ 0xFD,0xE0,0x04,0xF0,0x80,0xB0,0x90,0x44, ++ ++ 0xFA,0xE0,0xFD,0x24,0x00,0xF5,0x82,0xE4, ++ ++ 0x34,0x45,0xF5,0x83,0xE0,0xFE,0x74,0x01, ++ ++ 0x2D,0xF5,0x82,0xE4,0x34,0x45,0xF5,0x83, ++ ++ 0xE0,0xFD,0xEE,0xED,0xFF,0x90,0x44,0xFE, ++ ++ 0xEE,0xF0,0xA3,0xEF,0xF0,0x90,0x44,0xFA, ++ ++ 0xE0,0x24,0x02,0xF0,0xE4,0x90,0x44,0xFD, ++ ++ 0xF0,0x90,0x44,0xFC,0xE0,0xFF,0xA3,0xE0, ++ ++ 0xC3,0x9F,0x40,0x03,0x02,0x77,0xD7,0x90, ++ ++ 0x44,0xFA,0xE0,0xFF,0x24,0x01,0xF5,0x82, ++ ++ 0xE4,0x34,0x45,0xF5,0x83,0xE0,0xFE,0x74, ++ ++ 0x00,0x2F,0xF5,0x82,0xE4,0x34,0x45,0xF5, ++ ++ 0x83,0xE0,0xFD,0x90,0x44,0xFF,0xE0,0x2D, ++ ++ 0xFD,0x90,0x44,0xFE,0xE0,0x34,0x00,0x8D, ++ ++ 0x82,0xF5,0x83,0xEE,0xF0,0x90,0x44,0xFA, ++ ++ 0xE0,0x24,0x02,0xF0,0x90,0x44,0xFD,0xE0, ++ ++ 0x04,0xF0,0x80,0xB5,0x90,0x44,0xFA,0xE0, ++ ++ 0xFD,0x24,0x00,0xF5,0x82,0xE4,0x34,0x45, ++ ++ 0xF5,0x83,0xE0,0xFE,0x74,0x01,0x2D,0xF5, ++ ++ 0x82,0xE4,0x34,0x45,0xF5,0x83,0xE0,0xFD, ++ ++ 0xEE,0xED,0xFF,0x90,0x44,0xFE,0xEE,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x44,0xFA,0xE0,0x24, ++ ++ 0x02,0xF0,0xE4,0x90,0x44,0xFD,0xF0,0x90, ++ ++ 0x44,0xFC,0xE0,0xFF,0xA3,0xE0,0xC3,0x9F, ++ ++ 0x50,0x2C,0x90,0x44,0xFA,0xE0,0xFF,0x04, ++ ++ 0xF0,0x74,0x00,0x2F,0xF5,0x82,0xE4,0x34, ++ ++ 0x45,0xF5,0x83,0xE0,0xFF,0x90,0x44,0xFE, ++ ++ 0xE4,0x75,0xF0,0x01,0x12,0x7D,0x82,0x85, ++ ++ 0xF0,0x82,0xF5,0x83,0xEF,0xF0,0x90,0x44, ++ ++ 0xFD,0xE0,0x04,0xF0,0x80,0xC9,0x90,0x44, ++ ++ 0xF9,0xE0,0x24,0x02,0xF0,0x90,0x44,0xFB, ++ ++ 0xE0,0x54,0x03,0x14,0x60,0x19,0x14,0x60, ++ ++ 0x27,0x14,0x60,0x38,0x24,0x03,0x70,0x44, ++ ++ 0x90,0x44,0xFC,0xE0,0x25,0xE0,0xFF,0x90, ++ ++ 0x44,0xF9,0xE0,0x2F,0xF0,0x80,0x35,0x90, ++ ++ 0x44,0xFC,0xE0,0x75,0xF0,0x03,0xA4,0xFF, ++ ++ 0x90,0x44,0xF9,0xE0,0x2F,0xF0,0x80,0x24, ++ ++ 0x90,0x44,0xF9,0xE0,0x24,0x02,0xFF,0x90, ++ ++ 0x44,0xFC,0xE0,0x25,0xE0,0x2F,0x90,0x44, ++ ++ 0xF9,0xF0,0x80,0x10,0x90,0x44,0xF9,0xE0, ++ ++ 0x24,0x02,0xFF,0x90,0x44,0xFC,0xE0,0x2F, ++ ++ 0x90,0x44,0xF9,0xF0,0x90,0x44,0xF9,0xE0, ++ ++ 0x24,0x01,0xF5,0x82,0xE4,0x34,0x45,0xF5, ++ ++ 0x83,0xE0,0x90,0x44,0xFC,0xF0,0x02,0x75, ++ ++ 0xFA,0x22,0x90,0x44,0xB8,0xE0,0x60,0x08, ++ ++ 0x90,0x46,0x01,0x74,0x01,0xF0,0x80,0x06, ++ ++ 0x90,0x46,0x01,0x74,0x03,0xF0,0x12,0x56, ++ ++ 0xBB,0x12,0x6A,0xDF,0x90,0xF1,0x03,0xE0, ++ ++ 0x90,0x41,0x91,0xF0,0x90,0xF6,0xB5,0xE0, ++ ++ 0x54,0xF7,0x44,0x08,0xF0,0xE0,0x54,0xF7, ++ ++ 0xF0,0x90,0x41,0x91,0xE0,0x90,0xF1,0x03, ++ ++ 0xF0,0x90,0x46,0x01,0xE0,0xFF,0x12,0x6C, ++ ++ 0xA2,0x90,0x41,0xDE,0xEF,0xF0,0x90,0x44, ++ ++ 0xB8,0xE0,0x60,0x03,0x12,0x5A,0x5A,0x90, ++ ++ 0x46,0x01,0xE0,0xFF,0x12,0x75,0x04,0xEF, ++ ++ 0x70,0x04,0x7F,0x01,0x80,0x02,0x7F,0x00, ++ ++ 0x90,0x46,0x00,0xEF,0xF0,0x60,0x1C,0x90, ++ ++ 0x45,0x57,0xE0,0x60,0x16,0xE0,0x90,0xF6, ++ ++ 0x32,0xF0,0x90,0x45,0x57,0xE0,0x90,0xF6, ++ ++ 0x33,0xF0,0x90,0xF6,0x31,0xE0,0x54,0xFE, ++ ++ 0x44,0x01,0xF0,0x90,0x46,0x00,0xE0,0x60, ++ ++ 0x07,0x12,0x75,0x56,0x12,0x75,0xD6,0x22, ++ ++ 0x90,0x44,0xB8,0xE0,0x60,0x1E,0xE4,0x90, ++ ++ 0x45,0x31,0xF0,0x90,0x45,0x33,0xF0,0x90, ++ ++ 0x45,0x12,0xF0,0x90,0x45,0x18,0x74,0x05, ++ ++ 0xF0,0xE4,0x90,0x45,0x34,0xF0,0x90,0x45, ++ ++ 0x11,0x74,0x80,0xF0,0x22,0xE4,0x90,0x46, ++ ++ 0x06,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0x90,0xDF,0x84,0x74,0x64,0xF0, ++ ++ 0xE4,0x90,0xDF,0x85,0xF0,0x90,0xDF,0x86, ++ ++ 0x74,0x2C,0xF0,0x90,0xDF,0x87,0x74,0x01, ++ ++ 0xF0,0xE4,0x90,0xDF,0x88,0xF0,0x90,0xDF, ++ ++ 0x89,0x74,0x02,0xF0,0x12,0x6C,0xE7,0x90, ++ ++ 0xDF,0x82,0xE0,0x20,0xE1,0x08,0x90,0x46, ++ ++ 0x05,0xE5,0xE4,0xF0,0x80,0xF1,0x22,0x90, ++ ++ 0xDF,0x82,0xE0,0x30,0xE0,0x0E,0x74,0x20, ++ ++ 0xF0,0xE0,0x90,0x46,0x02,0xF0,0xE4,0x90, ++ ++ 0xDF,0x82,0xF0,0x22,0x90,0xDF,0x82,0xE0, ++ ++ 0x30,0xE1,0x03,0x02,0x7B,0x3D,0x90,0x46, ++ ++ 0x02,0xE5,0xE4,0xF0,0xE0,0x54,0x0F,0xA3, ++ ++ 0xF0,0x90,0x46,0x02,0xE0,0xFF,0xC4,0x54, ++ ++ 0x0F,0x90,0x46,0x04,0xF0,0x90,0x44,0xE0, ++ ++ 0xE0,0x14,0x70,0x03,0x02,0x7A,0x25,0x04, ++ ++ 0x60,0x03,0x02,0x7A,0x92,0x90,0x46,0x07, ++ ++ 0xE0,0x25,0xE0,0xF0,0x90,0x46,0x06,0xE0, ++ ++ 0x33,0xF0,0xA3,0xE0,0x44,0x01,0xF0,0xA3, ++ ++ 0xE0,0x04,0xF0,0x90,0x46,0x02,0xE0,0x24, ++ ++ 0xEF,0x70,0x03,0x02,0x7A,0x92,0x24,0xEF, ++ ++ 0x60,0x20,0x24,0x10,0x70,0x37,0x90,0x46, ++ ++ 0x07,0xE0,0x25,0xE0,0xF0,0x90,0x46,0x06, ++ ++ 0xE0,0x33,0xF0,0x90,0x46,0x08,0xE0,0x04, ++ ++ 0xF0,0x90,0x44,0xE0,0x74,0x01,0xF0,0x02, ++ ++ 0x7A,0x92,0x90,0x46,0x07,0xE0,0x25,0xE0, ++ ++ 0xF0,0x90,0x46,0x06,0xE0,0x33,0xF0,0x90, ++ ++ 0x46,0x08,0xE0,0x04,0xF0,0xE4,0x90,0x44, ++ ++ 0xE0,0xF0,0x02,0x7A,0x92,0x90,0x46,0x03, ++ ++ 0xE0,0xB4,0x02,0x13,0x90,0x46,0x07,0xE0, ++ ++ 0x25,0xE0,0xF0,0x90,0x46,0x06,0xE0,0x33, ++ ++ 0xF0,0x90,0x46,0x08,0xE0,0x04,0xF0,0x90, ++ ++ 0x46,0x04,0xE0,0xD3,0x94,0x02,0x40,0x14, ++ ++ 0x90,0x46,0x03,0xE0,0x64,0x01,0x60,0x04, ++ ++ 0xE0,0xB4,0x02,0x08,0x90,0x46,0x04,0x74, ++ ++ 0xFF,0xF0,0x80,0x75,0x90,0x46,0x04,0x74, ++ ++ 0xFE,0xF0,0x80,0x6D,0x90,0x46,0x02,0xE0, ++ ++ 0x24,0xDF,0x60,0x1F,0x24,0x10,0x70,0x35, ++ ++ 0x90,0x46,0x07,0xE0,0x25,0xE0,0xF0,0x90, ++ ++ 0x46,0x06,0xE0,0x33,0xF0,0x90,0x46,0x08, ++ ++ 0xE0,0x04,0xF0,0x90,0x44,0xE0,0x74,0x01, ++ ++ 0xF0,0x80,0x46,0x90,0x46,0x07,0xE0,0x25, ++ ++ 0xE0,0xF0,0x90,0x46,0x06,0xE0,0x33,0xF0, ++ ++ 0x90,0x46,0x08,0xE0,0x04,0xF0,0xE4,0x90, ++ ++ 0x44,0xE0,0xF0,0x80,0x2C,0x90,0x46,0x07, ++ ++ 0xE0,0x25,0xE0,0xF0,0x90,0x46,0x06,0xE0, ++ ++ 0x33,0xF0,0x90,0x46,0x08,0xE0,0x04,0xF0, ++ ++ 0x90,0x46,0x03,0xE0,0xB4,0x01,0x0C,0xA3, ++ ++ 0xE0,0xD3,0x94,0x02,0x40,0x05,0x74,0xFF, ++ ++ 0xF0,0x80,0x06,0x90,0x46,0x04,0x74,0xFE, ++ ++ 0xF0,0x90,0x46,0x04,0xE0,0xD3,0x94,0x0F, ++ ++ 0x50,0x03,0x02,0x79,0x55,0x90,0x46,0x08, ++ ++ 0xE0,0xFF,0xD3,0x94,0x10,0x50,0x7E,0xEF, ++ ++ 0x94,0x0A,0x40,0x79,0x90,0x46,0x04,0xE0, ++ ++ 0xF4,0x70,0x72,0xFF,0x7F,0x08,0x90,0x44, ++ ++ 0xE3,0xE4,0xF0,0xA3,0xDF,0xFC,0x7F,0x08, ++ ++ 0x90,0x45,0x34,0xE0,0xB4,0xFF,0x1A,0x90, ++ ++ 0x46,0x06,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x46,0x09,0xE0,0x6E,0x70,0x03,0xA3,0xE0, ++ ++ 0x6F,0x60,0x06,0x90,0x44,0xE3,0x74,0x01, ++ ++ 0xF0,0x90,0x46,0x06,0xE0,0xFF,0xA3,0xE0, ++ ++ 0x90,0x46,0x09,0xCF,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x90,0x46,0x06,0xE0,0x54,0xF7,0xF0,0x90, ++ ++ 0x45,0x34,0xE0,0xB4,0xFF,0x12,0x90,0x46, ++ ++ 0x09,0xE0,0x90,0x44,0xE5,0xF0,0x90,0x46, ++ ++ 0x0A,0xE0,0x90,0x44,0xE6,0xF0,0x80,0x10, ++ ++ 0x90,0x46,0x06,0xE0,0x90,0x44,0xE5,0xF0, ++ ++ 0x90,0x46,0x07,0xE0,0x90,0x44,0xE6,0xF0, ++ ++ 0x12,0x72,0x67,0x80,0x07,0xE4,0x90,0x46, ++ ++ 0x09,0xF0,0xA3,0xF0,0xE4,0x90,0x46,0x06, ++ ++ 0xF0,0xA3,0xF0,0xA3,0xF0,0x90,0x44,0xE0, ++ ++ 0xF0,0x02,0x79,0x55,0x22,0x90,0x41,0x92, ++ ++ 0xE0,0x70,0x0A,0x90,0xF1,0x02,0xE0,0x54, ++ ++ 0xFE,0x44,0x01,0xF0,0x22,0x90,0x41,0x96, ++ ++ 0xE0,0x90,0xF1,0x03,0xF0,0x90,0x83,0xFE, ++ ++ 0xE0,0x54,0xFE,0x44,0x01,0xF0,0xE0,0x54, ++ ++ 0xFE,0xF0,0xE0,0x54,0xFE,0x44,0x01,0xF0, ++ ++ 0xE0,0x54,0xFE,0xF0,0x12,0x56,0xBB,0xC2, ++ ++ 0xAF,0x90,0x41,0x93,0xE0,0xFF,0x90,0xF1, ++ ++ 0x01,0xE0,0x8F,0xF0,0xA4,0xFF,0xAE,0xF0, ++ ++ 0x90,0x41,0x94,0xE0,0x7C,0x00,0x2F,0xF5, ++ ++ 0x17,0xEC,0x3E,0xF5,0x16,0xE4,0xF5,0x18, ++ ++ 0xF5,0x14,0xF5,0x15,0xC3,0xE5,0x15,0x95, ++ ++ 0x17,0xE5,0x14,0x95,0x16,0x50,0x6A,0xE5, ++ ++ 0x15,0x45,0x14,0x70,0x16,0x90,0xF1,0x02, ++ ++ 0xE0,0x54,0xFE,0x44,0x01,0xF0,0x90,0x83, ++ ++ 0xFE,0xE0,0x54,0xFE,0x44,0x01,0xF0,0xE0, ++ ++ 0x54,0xFE,0xF0,0xE5,0x18,0x25,0xE0,0x24, ++ ++ 0x99,0xF5,0x82,0xE4,0x34,0x41,0xF5,0x83, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x12,0x7C,0x73, ++ ++ 0x7E,0x00,0xE5,0x15,0x54,0x01,0x24,0x95, ++ ++ 0xF5,0x82,0xEE,0x34,0x41,0xF5,0x83,0xE0, ++ ++ 0x90,0xF1,0x03,0xF0,0x90,0x83,0xFE,0xE0, ++ ++ 0x54,0xFE,0x44,0x01,0xF0,0xE0,0x54,0xFE, ++ ++ 0xF0,0x05,0x15,0xE5,0x15,0x70,0x02,0x05, ++ ++ 0x14,0x74,0x0B,0x25,0x18,0xF5,0x82,0xE4, ++ ++ 0x34,0x46,0xF5,0x83,0xE0,0xF5,0x18,0x80, ++ ++ 0x8B,0xD2,0xAF,0xE4,0x22,0xE4,0xFF,0x90, ++ ++ 0x41,0x98,0xE0,0xFE,0x90,0x41,0x97,0xE0, ++ ++ 0xFD,0x2E,0x14,0xFE,0xEF,0xC3,0x9E,0x50, ++ ++ 0x12,0xEF,0x04,0xFE,0x74,0x0B,0x2F,0xF5, ++ ++ 0x82,0xE4,0x34,0x46,0xF5,0x83,0xEE,0xF0, ++ ++ 0x0F,0x80,0xDC,0x74,0x0B,0x2F,0xF5,0x82, ++ ++ 0xE4,0x34,0x46,0xF5,0x83,0xED,0xF0,0x22, ++ ++ 0xE4,0x90,0x41,0x92,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0x14,0xF0,0xA3,0x74,0xFF,0xF0, ++ ++ 0xA3,0x74,0x07,0xF0,0xA3,0x74,0x01,0xF0, ++ ++ 0xA3,0x04,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x77,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74, ++ ++ 0x40,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x24, ++ ++ 0xF0,0x22,0xC0,0x07,0x85,0x06,0x07,0x12, ++ ++ 0x7C,0x8F,0xD0,0xE0,0xC0,0xE0,0xC4,0x54, ++ ++ 0x0F,0xFF,0x12,0x7C,0xAF,0xD0,0xE0,0x54, ++ ++ 0x0F,0xFF,0x12,0x7C,0xC0,0x22,0xEF,0x70, ++ ++ 0x02,0x80,0x0B,0x80,0x00,0xC0,0x07,0x12, ++ ++ 0x7C,0xA0,0xD0,0x07,0xDF,0xF7,0x22,0x7F, ++ ++ 0x0C,0x12,0x7C,0xAF,0x7F,0x04,0x90,0x7C, ++ ++ 0xA0,0xE0,0xDF,0xFD,0xE0,0x22,0xEF,0x70, ++ ++ 0x02,0x80,0x0B,0x80,0x00,0x90,0x7C,0xB6, ++ ++ 0xE0,0xE0,0xE0,0x04,0xDF,0xF7,0x22,0x90, ++ ++ 0x7C,0xC8,0xEF,0xF4,0x54,0x0F,0x73,0x04, ++ ++ 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, ++ ++ 0x04,0x04,0x04,0x04,0x04,0x04,0x22,0xBB, ++ ++ 0x01,0x0C,0xE5,0x82,0x29,0xF5,0x82,0xE5, ++ ++ 0x83,0x3A,0xF5,0x83,0xE0,0x22,0x50,0x06, ++ ++ 0xE9,0x25,0x82,0xF8,0xE6,0x22,0xBB,0xFE, ++ ++ 0x06,0xE9,0x25,0x82,0xF8,0xE2,0x22,0xE5, ++ ++ 0x82,0x29,0xF5,0x82,0xE5,0x83,0x3A,0xF5, ++ ++ 0x83,0xE4,0x93,0x22,0xEF,0x8D,0xF0,0xA4, ++ ++ 0xA8,0xF0,0xCF,0x8C,0xF0,0xA4,0x28,0xCE, ++ ++ 0x8D,0xF0,0xA4,0x2E,0xFE,0x22,0xBC,0x00, ++ ++ 0x0B,0xBE,0x00,0x29,0xEF,0x8D,0xF0,0x84, ++ ++ 0xFF,0xAD,0xF0,0x22,0xE4,0xCC,0xF8,0x75, ++ ++ 0xF0,0x08,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, ++ ++ 0xEC,0x33,0xFC,0xEE,0x9D,0xEC,0x98,0x40, ++ ++ 0x05,0xFC,0xEE,0x9D,0xFE,0x0F,0xD5,0xF0, ++ ++ 0xE9,0xE4,0xCE,0xFD,0x22,0xED,0xF8,0xF5, ++ ++ 0xF0,0xEE,0x84,0x20,0xD2,0x1C,0xFE,0xAD, ++ ++ 0xF0,0x75,0xF0,0x08,0xEF,0x2F,0xFF,0xED, ++ ++ 0x33,0xFD,0x40,0x07,0x98,0x50,0x06,0xD5, ++ ++ 0xF0,0xF2,0x22,0xC3,0x98,0xFD,0x0F,0xD5, ++ ++ 0xF0,0xEA,0x22,0xC5,0xF0,0xF8,0xA3,0xE0, ++ ++ 0x28,0xF0,0xC5,0xF0,0xF8,0xE5,0x82,0x15, ++ ++ 0x82,0x70,0x02,0x15,0x83,0xE0,0x38,0xF0, ++ ++ 0x22,0xA3,0xF8,0xE0,0xC5,0xF0,0x25,0xF0, ++ ++ 0xF0,0xE5,0x82,0x15,0x82,0x70,0x02,0x15, ++ ++ 0x83,0xE0,0xC8,0x38,0xF0,0xE8,0x22,0xE8, ++ ++ 0x8F,0xF0,0xA4,0xCC,0x8B,0xF0,0xA4,0x2C, ++ ++ 0xFC,0xE9,0x8E,0xF0,0xA4,0x2C,0xFC,0x8A, ++ ++ 0xF0,0xED,0xA4,0x2C,0xFC,0xEA,0x8E,0xF0, ++ ++ 0xA4,0xCD,0xA8,0xF0,0x8B,0xF0,0xA4,0x2D, ++ ++ 0xCC,0x38,0x25,0xF0,0xFD,0xE9,0x8F,0xF0, ++ ++ 0xA4,0x2C,0xCD,0x35,0xF0,0xFC,0xEB,0x8E, ++ ++ 0xF0,0xA4,0xFE,0xA9,0xF0,0xEB,0x8F,0xF0, ++ ++ 0xA4,0xCF,0xC5,0xF0,0x2E,0xCD,0x39,0xFE, ++ ++ 0xE4,0x3C,0xFC,0xEA,0xA4,0x2D,0xCE,0x35, ++ ++ 0xF0,0xFD,0xE4,0x3C,0xFC,0x22,0x75,0xF0, ++ ++ 0x08,0x75,0x82,0x00,0xEF,0x2F,0xFF,0xEE, ++ ++ 0x33,0xFE,0xCD,0x33,0xCD,0xCC,0x33,0xCC, ++ ++ 0xC5,0x82,0x33,0xC5,0x82,0x9B,0xED,0x9A, ++ ++ 0xEC,0x99,0xE5,0x82,0x98,0x40,0x0C,0xF5, ++ ++ 0x82,0xEE,0x9B,0xFE,0xED,0x9A,0xFD,0xEC, ++ ++ 0x99,0xFC,0x0F,0xD5,0xF0,0xD6,0xE4,0xCE, ++ ++ 0xFB,0xE4,0xCD,0xFA,0xE4,0xCC,0xF9,0xA8, ++ ++ 0x82,0x22,0xB8,0x00,0xC1,0xB9,0x00,0x59, ++ ++ 0xBA,0x00,0x2D,0xEC,0x8B,0xF0,0x84,0xCF, ++ ++ 0xCE,0xCD,0xFC,0xE5,0xF0,0xCB,0xF9,0x78, ++ ++ 0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE,0xED, ++ ++ 0x33,0xFD,0xEC,0x33,0xFC,0xEB,0x33,0xFB, ++ ++ 0x10,0xD7,0x03,0x99,0x40,0x04,0xEB,0x99, ++ ++ 0xFB,0x0F,0xD8,0xE5,0xE4,0xF9,0xFA,0x22, ++ ++ 0x78,0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, ++ ++ 0xED,0x33,0xFD,0xEC,0x33,0xFC,0xC9,0x33, ++ ++ 0xC9,0x10,0xD7,0x05,0x9B,0xE9,0x9A,0x40, ++ ++ 0x07,0xEC,0x9B,0xFC,0xE9,0x9A,0xF9,0x0F, ++ ++ 0xD8,0xE0,0xE4,0xC9,0xFA,0xE4,0xCC,0xFB, ++ ++ 0x22,0x75,0xF0,0x10,0xEF,0x2F,0xFF,0xEE, ++ ++ 0x33,0xFE,0xED,0x33,0xFD,0xCC,0x33,0xCC, ++ ++ 0xC8,0x33,0xC8,0x10,0xD7,0x07,0x9B,0xEC, ++ ++ 0x9A,0xE8,0x99,0x40,0x0A,0xED,0x9B,0xFD, ++ ++ 0xEC,0x9A,0xFC,0xE8,0x99,0xF8,0x0F,0xD5, ++ ++ 0xF0,0xDA,0xE4,0xCD,0xFB,0xE4,0xCC,0xFA, ++ ++ 0xE4,0xC8,0xF9,0x22,0xD0,0x83,0xD0,0x82, ++ ++ 0xF8,0xE4,0x93,0x70,0x12,0x74,0x01,0x93, ++ ++ 0x70,0x0D,0xA3,0xA3,0x93,0xF8,0x74,0x01, ++ ++ 0x93,0xF5,0x82,0x88,0x83,0xE4,0x73,0x74, ++ ++ 0x02,0x93,0x68,0x60,0xEF,0xA3,0xA3,0xA3, ++ ++ 0x80,0xDF,0x8A,0x83,0x89,0x82,0xE4,0x73, ++ ++ 0xE7,0x09,0xF6,0x08,0xDF,0xFA,0x80,0x46, ++ ++ 0xE7,0x09,0xF2,0x08,0xDF,0xFA,0x80,0x3E, ++ ++ 0x88,0x82,0x8C,0x83,0xE7,0x09,0xF0,0xA3, ++ ++ 0xDF,0xFA,0x80,0x32,0xE3,0x09,0xF6,0x08, ++ ++ 0xDF,0xFA,0x80,0x6E,0xE3,0x09,0xF2,0x08, ++ ++ 0xDF,0xFA,0x80,0x66,0x88,0x82,0x8C,0x83, ++ ++ 0xE3,0x09,0xF0,0xA3,0xDF,0xFA,0x80,0x5A, ++ ++ 0x89,0x82,0x8A,0x83,0xE0,0xA3,0xF6,0x08, ++ ++ 0xDF,0xFA,0x80,0x4E,0x89,0x82,0x8A,0x83, ++ ++ 0xE0,0xA3,0xF2,0x08,0xDF,0xFA,0x80,0x42, ++ ++ 0x80,0xD2,0x80,0xFA,0x80,0xC6,0x80,0xD4, ++ ++ 0x80,0x55,0x80,0xF2,0x80,0x29,0x80,0x10, ++ ++ 0x80,0xA6,0x80,0xEA,0x80,0x9A,0x80,0xA8, ++ ++ 0x80,0xDA,0x80,0xE2,0x80,0xCA,0x80,0x29, ++ ++ 0x88,0x84,0x8C,0x85,0x89,0x82,0x8A,0x83, ++ ++ 0xE4,0x93,0xA3,0x05,0x86,0xF0,0xA3,0x05, ++ ++ 0x86,0xDF,0xF5,0xDE,0xF3,0x80,0x0B,0x89, ++ ++ 0x82,0x8A,0x83,0xE4,0x93,0xA3,0xF6,0x08, ++ ++ 0xDF,0xF9,0xEC,0xFA,0xA9,0xF0,0xED,0xFB, ++ ++ 0x22,0x88,0x84,0x8C,0x85,0x89,0x82,0x8A, ++ ++ 0x83,0xE0,0xA3,0x05,0x86,0xF0,0xA3,0x05, ++ ++ 0x86,0xDF,0xF6,0xDE,0xF4,0x80,0xE3,0x89, ++ ++ 0x82,0x8A,0x83,0xE4,0x93,0xA3,0xF2,0x08, ++ ++ 0xDF,0xF9,0x80,0xD6,0x88,0xF0,0xEF,0x60, ++ ++ 0x01,0x0E,0x4E,0x60,0xCD,0x88,0xF0,0xED, ++ ++ 0x24,0x02,0xB4,0x04,0x00,0x50,0xC3,0xF5, ++ ++ 0x82,0xEB,0x24,0x02,0xB4,0x04,0x00,0x50, ++ ++ 0xB9,0x23,0x23,0x45,0x82,0x23,0x90,0x7F, ++ ++ 0x31,0x73,0x12,0x01,0x00,0x02,0x00,0x00, ++ ++ 0x00,0x40,0xA4,0x15,0x50,0x03,0x00,0x02, ++ ++ 0x00,0x00,0x00,0x01,0x0A,0x06,0x00,0x02, ++ ++ 0x00,0x00,0x00,0x40,0x01,0x00,0x09,0x07, ++ ++ 0x35,0x00,0x01,0x01,0x00,0x80,0xFA,0x09, ++ ++ 0x02,0x35,0x00,0x01,0x01,0x00,0x80,0xFA, ++ ++ 0x09,0x04,0x00,0x00,0x05,0xFF,0x00,0x00, ++ ++ 0x00,0x07,0x05,0x81,0x02,0x40,0x00,0x00, ++ ++ 0x07,0x05,0x02,0x02,0x40,0x00,0x00,0x07, ++ ++ 0x05,0x84,0x02,0x40,0x00,0x00,0x07,0x05, ++ ++ 0x85,0x02,0x40,0x00,0x00,0x07,0x05,0x86, ++ ++ 0x01,0x00,0x00,0x01,0x09,0x04,0x00,0x01, ++ ++ 0x05,0xFF,0x00,0x00,0x00,0x07,0x05,0x81, ++ ++ 0x02,0x40,0x00,0x00,0x07,0x05,0x02,0x02, ++ ++ 0x40,0x00,0x00,0x07,0x05,0x84,0x02,0x40, ++ ++ 0x00,0x00,0x07,0x05,0x85,0x02,0x40,0x00, ++ ++ 0x00,0x07,0x05,0x86,0x01,0x00,0x14,0x01, ++ ++ 0x09,0x04,0x01,0x00,0x01,0x03,0x00,0x01, ++ ++ 0x00,0x09,0x21,0x01,0x01,0x00,0x01,0x22, ++ ++ 0x41,0x00,0x07,0x05,0x83,0x03,0x40,0x00, ++ ++ 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x05,0x01,0x09, ++ ++ 0x06,0xA1,0x01,0x05,0x07,0x19,0xE0,0x29, ++ ++ 0xE7,0x15,0x00,0x25,0x01,0x95,0x08,0x75, ++ ++ 0x01,0x81,0x02,0x95,0x08,0x75,0x01,0x81, ++ ++ 0x01,0x05,0x08,0x19,0x01,0x29,0x03,0x95, ++ ++ 0x03,0x75,0x01,0x91,0x02,0x95,0x01,0x75, ++ ++ 0x05,0x91,0x01,0x05,0x07,0x19,0x00,0x2A, ++ ++ 0xFF,0x00,0x15,0x00,0x26,0xFF,0x00,0x95, ++ ++ 0x06,0x75,0x08,0x81,0x00,0xC0, ++ ++ 0x02,0x41,0x00,0x00,0x03,0xFA,0xBE,0x02, ++ ++ 0x99,0x14, ++ ++ 0x02,0x45,0x50,0x6A,0xAD,0x00,0x50,0x90, ++ ++ 0x43,0x66,0xE0,0xFE,0x90,0x44,0x02,0xF0, ++ ++ 0xE4,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3, ++ ++ 0xF0,0xA3,0xF0,0xA3,0xCE,0xF0,0xE4,0xA3, ++ ++ 0xF0,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0x90, ++ ++ 0x44,0x02,0xE0,0x04,0xFF,0x90,0x41,0xEF, ++ ++ 0xE0,0xFE,0x2F,0x8E,0xF0,0x84,0xAF,0xF0, ++ ++ 0x90,0x44,0x02,0xEF,0xF0,0xA3,0xE0,0xFD, ++ ++ 0xA3,0xE0,0xA3,0xCD,0xF0,0xA3,0xED,0xF0, ++ ++ 0xEF,0x25,0xE0,0x24,0x58,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0x90,0x43,0x61,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xEF,0x2D,0xFF,0xEE,0x3C,0xFE,0x90, ++ ++ 0x43,0x66,0xE0,0x25,0xE0,0x24,0x58,0xF5, ++ ++ 0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0xC3,0xEF,0x9B,0xFF,0xEE, ++ ++ 0x9A,0xFE,0xED,0x24,0x01,0xFD,0xE4,0x3C, ++ ++ 0xFC,0x12,0x4A,0x78,0x90,0x44,0x03,0xEC, ++ ++ 0xF0,0xA3,0xED,0xF0,0xD3,0x90,0x43,0x72, ++ ++ 0xE0,0x9D,0xEC,0x64,0x80,0xF8,0x90,0x43, ++ ++ 0x71,0xE0,0x64,0x80,0x98,0x50,0x80,0x90, ++ ++ 0x41,0xEF,0xE0,0xFD,0x7C,0x00,0x90,0x44, ++ ++ 0x08,0xE0,0x2D,0xFF,0x90,0x44,0x07,0xE0, ++ ++ 0x3C,0xCF,0x24,0xFF,0xCF,0x34,0xFF,0xFE, ++ ++ 0x12,0x4A,0x78,0xEC,0xF0,0xA3,0xED,0xF0, ++ ++ 0xA3,0xE0,0xFF,0xA3,0xE0,0xA3,0xCF,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x44,0x08,0xE0,0x25, ++ ++ 0xE0,0xFF,0x90,0x44,0x07,0xE0,0x33,0xFE, ++ ++ 0x74,0x58,0x2F,0xF5,0x82,0x74,0x43,0x3E, ++ ++ 0xF5,0x83,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x43,0x66,0xE0,0x25,0xE0,0x24,0x58,0xF5, ++ ++ 0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFC, ++ ++ 0xA3,0xE0,0xFD,0x90,0x43,0x61,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0xED,0x2B,0xFD,0xEC,0x3A, ++ ++ 0xCD,0xC3,0x9F,0xFF,0xED,0x9E,0xFE,0xEB, ++ ++ 0x24,0x01,0xFD,0xE4,0x3A,0xFC,0x12,0x4A, ++ ++ 0x78,0x90,0x44,0x09,0xEC,0xF0,0xA3,0xED, ++ ++ 0xF0,0xD3,0x90,0x43,0x72,0xE0,0x9D,0xEC, ++ ++ 0x64,0x80,0xF8,0x90,0x43,0x71,0xE0,0x64, ++ ++ 0x80,0x98,0x40,0x03,0x02,0x45,0xF0,0x90, ++ ++ 0x44,0x05,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x44,0x0B,0xE0,0xFC,0xA3,0xE0,0xFD,0x9F, ++ ++ 0xEE,0x64,0x80,0xF8,0xEC,0x64,0x80,0x98, ++ ++ 0x40,0x08,0xA3,0xEC,0xF0,0xA3,0xED,0xF0, ++ ++ 0x80,0x08,0x90,0x44,0x0D,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x90,0x44,0x03,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x44,0x09,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xC3,0x9F,0xEE,0x64,0x80,0xF8, ++ ++ 0xEC,0x64,0x80,0x98,0x50,0x2B,0x90,0x44, ++ ++ 0x0F,0xEC,0xF0,0xA3,0xED,0xF0,0x90,0x41, ++ ++ 0xEF,0xE0,0xFD,0x7C,0x00,0x90,0x44,0x08, ++ ++ 0xE0,0x2D,0xFF,0x90,0x44,0x07,0xE0,0x3C, ++ ++ 0xCF,0x24,0xFF,0xCF,0x34,0xFF,0xFE,0x12, ++ ++ 0x4A,0x78,0xEC,0xF0,0xA3,0xED,0xF0,0x80, ++ ++ 0x24,0x90,0x44,0x03,0xE0,0xFF,0xA3,0xE0, ++ ++ 0x90,0x44,0x0F,0xCF,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x90,0x44,0x02,0xE0,0x04,0xFF,0x90,0x41, ++ ++ 0xEF,0xE0,0xFE,0x2F,0x8E,0xF0,0x84,0x90, ++ ++ 0x44,0x02,0xE5,0xF0,0xF0,0x90,0x44,0x0D, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x90,0x44, ++ ++ 0x10,0xE0,0x9F,0xFF,0x90,0x44,0x0F,0xE0, ++ ++ 0x9E,0x90,0x44,0x11,0xF0,0xA3,0xEF,0xF0, ++ ++ 0xE4,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0x90, ++ ++ 0x44,0x01,0xF0,0x90,0x43,0x69,0xE0,0x75, ++ ++ 0xF0,0x04,0xA4,0xFF,0xC3,0x90,0x44,0x12, ++ ++ 0xE0,0x9F,0xE5,0xF0,0x64,0x80,0xF8,0x90, ++ ++ 0x44,0x11,0xE0,0x64,0x80,0x98,0x40,0x03, ++ ++ 0x02,0x49,0x21,0x90,0x44,0x13,0xE0,0x60, ++ ++ 0x03,0x02,0x49,0x21,0x90,0x44,0x01,0xE0, ++ ++ 0x94,0x14,0x40,0x17,0x90,0xF5,0xE7,0xE4, ++ ++ 0xF0,0x90,0xF5,0xE1,0xF0,0xF5,0x13,0x7B, ++ ++ 0x01,0x7A,0x44,0x79,0x6A,0x7D,0x01,0xFC, ++ ++ 0x12,0xA1,0x83,0x90,0x44,0x01,0xE0,0x04, ++ ++ 0xF0,0x90,0x44,0x0F,0xE0,0xFF,0xA3,0xE0, ++ ++ 0x90,0x44,0x0D,0xCF,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x90,0x44,0x02,0xE0,0x25,0xE0,0x24,0x58, ++ ++ 0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x43,0x61,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xEF,0x2D,0xFF,0xEE, ++ ++ 0x3C,0xFE,0x90,0x43,0x66,0xE0,0x25,0xE0, ++ ++ 0x24,0x58,0xF5,0x82,0xE4,0x34,0x43,0xF5, ++ ++ 0x83,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0xEF, ++ ++ 0x9B,0xFF,0xEE,0x9A,0xFE,0xED,0x24,0x01, ++ ++ 0xFD,0xE4,0x3C,0xFC,0x12,0x4A,0x78,0x90, ++ ++ 0x44,0x03,0xEC,0xF0,0xA3,0xED,0xF0,0x90, ++ ++ 0x44,0x08,0xE0,0x25,0xE0,0xFF,0x90,0x44, ++ ++ 0x07,0xE0,0x33,0xFE,0x74,0x58,0x2F,0xF5, ++ ++ 0x82,0x74,0x43,0x3E,0xF5,0x83,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x90,0x43,0x66,0xE0,0x25, ++ ++ 0xE0,0x24,0x58,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xE0,0xFC,0xA3,0xE0,0xFD,0x90, ++ ++ 0x43,0x61,0xE0,0xFA,0xA3,0xE0,0xFB,0xED, ++ ++ 0x2B,0xFD,0xEC,0x3A,0xCD,0xC3,0x9F,0xFF, ++ ++ 0xED,0x9E,0xFE,0xEB,0x24,0x01,0xFD,0xE4, ++ ++ 0x3A,0xFC,0x12,0x4A,0x78,0x90,0x44,0x09, ++ ++ 0xEC,0xF0,0xA3,0xED,0xF0,0x90,0x44,0x03, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x9D,0xEC, ++ ++ 0x64,0x80,0xF8,0xEE,0x64,0x80,0x98,0x50, ++ ++ 0x3F,0x90,0x44,0x0F,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x44,0x15,0xE0,0x60,0x03,0x02, ++ ++ 0x48,0xEE,0x90,0x43,0x66,0xE0,0xFF,0x90, ++ ++ 0x44,0x02,0xE0,0xFE,0xB5,0x07,0x04,0x7F, ++ ++ 0x01,0x80,0x02,0x7F,0x00,0x90,0x44,0x15, ++ ++ 0xEF,0xF0,0x70,0x69,0xEE,0x04,0xFF,0x90, ++ ++ 0x41,0xEF,0xE0,0xFE,0x2F,0x8E,0xF0,0x84, ++ ++ 0x90,0x44,0x02,0xE5,0xF0,0xF0,0x80,0x55, ++ ++ 0x90,0x44,0x09,0xE0,0xFF,0xA3,0xE0,0x90, ++ ++ 0x44,0x0F,0xCF,0xF0,0xA3,0xEF,0xF0,0x90, ++ ++ 0x44,0x14,0xE0,0x70,0x40,0x90,0x43,0x66, ++ ++ 0xE0,0xFF,0x7E,0x00,0x90,0x44,0x07,0xE0, ++ ++ 0xFA,0xA3,0xE0,0xFB,0xB5,0x07,0x08,0xEE, ++ ++ 0xB5,0x02,0x04,0x7F,0x01,0x80,0x02,0x7F, ++ ++ 0x00,0x90,0x44,0x14,0xEF,0xF0,0x70,0x1D, ++ ++ 0x90,0x41,0xEF,0xE0,0xFD,0x7C,0x00,0x2B, ++ ++ 0xFF,0xEC,0x3A,0xCF,0x24,0xFF,0xCF,0x34, ++ ++ 0xFF,0xFE,0x12,0x4A,0x78,0x90,0x44,0x07, ++ ++ 0xEC,0xF0,0xA3,0xED,0xF0,0x90,0x44,0x0D, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x90,0x44, ++ ++ 0x10,0xE0,0x9F,0xFF,0x90,0x44,0x0F,0xE0, ++ ++ 0x9E,0x90,0x44,0x11,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x90,0x44,0x14,0xE0,0x60,0x08,0xA3,0xE0, ++ ++ 0x60,0x04,0x7F,0x01,0x80,0x02,0x7F,0x00, ++ ++ 0x90,0x44,0x13,0xEF,0xF0,0x02,0x47,0x44, ++ ++ 0x90,0x44,0x13,0xE0,0x60,0x0F,0x90,0x43, ++ ++ 0x4D,0x74,0x07,0xF0,0x90,0x43,0x6E,0x74, ++ ++ 0x01,0xF0,0x02,0x49,0xDB,0x90,0x43,0x69, ++ ++ 0xE0,0xF9,0x25,0xE0,0xFF,0xE4,0x33,0xFE, ++ ++ 0x90,0x43,0x71,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0x90,0x44,0x0F,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xC3,0x9D,0xFD,0xEA,0x9C,0xFC,0xC3,0xED, ++ ++ 0x9F,0xEE,0x64,0x80,0xF8,0xEC,0x64,0x80, ++ ++ 0x98,0x50,0x22,0xE9,0x75,0xF0,0x02,0xA4, ++ ++ 0xFF,0x90,0x43,0x72,0xE0,0x2F,0xFF,0x90, ++ ++ 0x43,0x71,0xE0,0x35,0xF0,0xFE,0xC3,0xEB, ++ ++ 0x9F,0xFF,0xEA,0x9E,0x90,0x43,0x67,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x80,0x55,0xE9,0x25,0xE0, ++ ++ 0xFF,0xE4,0x33,0xFE,0x90,0x44,0x0D,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0x90,0x43,0x71,0xE0, ++ ++ 0xFA,0xA3,0xE0,0xFB,0xC3,0x9D,0xFD,0xEA, ++ ++ 0x9C,0xFC,0xC3,0xED,0x9F,0xEE,0x64,0x80, ++ ++ 0xF8,0xEC,0x64,0x80,0x98,0x50,0x24,0xE9, ++ ++ 0x25,0xE0,0xFF,0xE4,0x33,0xFE,0xEB,0x2F, ++ ++ 0xFF,0xEA,0x3E,0xFE,0x90,0x44,0x0D,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xC3,0xEF,0x9D,0xFF, ++ ++ 0xEE,0x9C,0x90,0x43,0x67,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x80,0x07,0xE4,0x90,0x43,0x67,0xF0, ++ ++ 0xA3,0xF0,0x90,0x43,0x6E,0x74,0x03,0xF0, ++ ++ 0x90,0xF5,0xE6,0xF0,0x90,0x43,0x67,0xE0, ++ ++ 0xA2,0xE7,0x13,0xF0,0xA3,0xE0,0x13,0xF0, ++ ++ 0x90,0x43,0x4D,0x74,0x07,0xF0,0x22,0xBB, ++ ++ 0x01,0x06,0x89,0x82,0x8A,0x83,0xE0,0x22, ++ ++ 0x50,0x02,0xE7,0x22,0xBB,0xFE,0x02,0xE3, ++ ++ 0x22,0x89,0x82,0x8A,0x83,0xE4,0x93,0x22, ++ ++ 0xEF,0x8D,0xF0,0xA4,0xA8,0xF0,0xCF,0x8C, ++ ++ 0xF0,0xA4,0x28,0xCE,0x8D,0xF0,0xA4,0x2E, ++ ++ 0xFE,0x22,0xBC,0x00,0x0B,0xBE,0x00,0x29, ++ ++ 0xEF,0x8D,0xF0,0x84,0xFF,0xAD,0xF0,0x22, ++ ++ 0xE4,0xCC,0xF8,0x75,0xF0,0x08,0xEF,0x2F, ++ ++ 0xFF,0xEE,0x33,0xFE,0xEC,0x33,0xFC,0xEE, ++ ++ 0x9D,0xEC,0x98,0x40,0x05,0xFC,0xEE,0x9D, ++ ++ 0xFE,0x0F,0xD5,0xF0,0xE9,0xE4,0xCE,0xFD, ++ ++ 0x22,0xED,0xF8,0xF5,0xF0,0xEE,0x84,0x20, ++ ++ 0xD2,0x1C,0xFE,0xAD,0xF0,0x75,0xF0,0x08, ++ ++ 0xEF,0x2F,0xFF,0xED,0x33,0xFD,0x40,0x07, ++ ++ 0x98,0x50,0x06,0xD5,0xF0,0xF2,0x22,0xC3, ++ ++ 0x98,0xFD,0x0F,0xD5,0xF0,0xEA,0x22,0xC2, ++ ++ 0xD5,0xEC,0x30,0xE7,0x09,0xB2,0xD5,0xE4, ++ ++ 0xC3,0x9D,0xFD,0xE4,0x9C,0xFC,0xEE,0x30, ++ ++ 0xE7,0x15,0xB2,0xD5,0xE4,0xC3,0x9F,0xFF, ++ ++ 0xE4,0x9E,0xFE,0x12,0x4A,0x23,0xC3,0xE4, ++ ++ 0x9D,0xFD,0xE4,0x9C,0xFC,0x80,0x03,0x12, ++ ++ 0x4A,0x23,0x30,0xD5,0x07,0xC3,0xE4,0x9F, ++ ++ 0xFF,0xE4,0x9E,0xFE,0x22,0xE8,0x8F,0xF0, ++ ++ 0xA4,0xCC,0x8B,0xF0,0xA4,0x2C,0xFC,0xE9, ++ ++ 0x8E,0xF0,0xA4,0x2C,0xFC,0x8A,0xF0,0xED, ++ ++ 0xA4,0x2C,0xFC,0xEA,0x8E,0xF0,0xA4,0xCD, ++ ++ 0xA8,0xF0,0x8B,0xF0,0xA4,0x2D,0xCC,0x38, ++ ++ 0x25,0xF0,0xFD,0xE9,0x8F,0xF0,0xA4,0x2C, ++ ++ 0xCD,0x35,0xF0,0xFC,0xEB,0x8E,0xF0,0xA4, ++ ++ 0xFE,0xA9,0xF0,0xEB,0x8F,0xF0,0xA4,0xCF, ++ ++ 0xC5,0xF0,0x2E,0xCD,0x39,0xFE,0xE4,0x3C, ++ ++ 0xFC,0xEA,0xA4,0x2D,0xCE,0x35,0xF0,0xFD, ++ ++ 0xE4,0x3C,0xFC,0x22,0xC3,0xE4,0x9F,0xFF, ++ ++ 0xE4,0x9E,0xFE,0xE4,0x9D,0xFD,0xE4,0x9C, ++ ++ 0xFC,0x22,0xEB,0x9F,0xF5,0xF0,0xEA,0x9E, ++ ++ 0x42,0xF0,0xE9,0x9D,0x42,0xF0,0xEC,0x64, ++ ++ 0x80,0xC8,0x64,0x80,0x98,0x45,0xF0,0x22, ++ ++ 0xEB,0x9F,0xF5,0xF0,0xEA,0x9E,0x42,0xF0, ++ ++ 0xE9,0x9D,0x42,0xF0,0xE8,0x9C,0x45,0xF0, ++ ++ 0x22,0xE8,0x60,0x0F,0xEC,0xC3,0x13,0xFC, ++ ++ 0xED,0x13,0xFD,0xEE,0x13,0xFE,0xEF,0x13, ++ ++ 0xFF,0xD8,0xF1,0x22,0xE8,0x60,0x10,0xEC, ++ ++ 0xA2,0xE7,0x13,0xFC,0xED,0x13,0xFD,0xEE, ++ ++ 0x13,0xFE,0xEF,0x13,0xFF,0xD8,0xF0,0x22, ++ ++ 0xE8,0x60,0x0F,0xEF,0xC3,0x33,0xFF,0xEE, ++ ++ 0x33,0xFE,0xED,0x33,0xFD,0xEC,0x33,0xFC, ++ ++ 0xD8,0xF1,0x22,0xEC,0xF0,0xA3,0xED,0xF0, ++ ++ 0xA3,0xEE,0xF0,0xA3,0xEF,0xF0,0x22,0xA8, ++ ++ 0x82,0x85,0x83,0xF0,0xD0,0x83,0xD0,0x82, ++ ++ 0x12,0x4B,0x8F,0x12,0x4B,0x8F,0x12,0x4B, ++ ++ 0x8F,0x12,0x4B,0x8F,0xE4,0x73,0xE4,0x93, ++ ++ 0xA3,0xC5,0x83,0xC5,0xF0,0xC5,0x83,0xC8, ++ ++ 0xC5,0x82,0xC8,0xF0,0xA3,0xC5,0x83,0xC5, ++ ++ 0xF0,0xC5,0x83,0xC8,0xC5,0x82,0xC8,0x22, ++ ++ 0x8A,0x83,0x89,0x82,0xE4,0x73,0xBB,0x01, ++ ++ 0x0C,0xE5,0x82,0x29,0xF5,0x82,0xE5,0x83, ++ ++ 0x3A,0xF5,0x83,0xE0,0x22,0x50,0x06,0xE9, ++ ++ 0x25,0x82,0xF8,0xE6,0x22,0xBB,0xFE,0x06, ++ ++ 0xE9,0x25,0x82,0xF8,0xE2,0x22,0xE5,0x82, ++ ++ 0x29,0xF5,0x82,0xE5,0x83,0x3A,0xF5,0x83, ++ ++ 0xE4,0x93,0x22,0xF8,0xBB,0x01,0x0D,0xE5, ++ ++ 0x82,0x29,0xF5,0x82,0xE5,0x83,0x3A,0xF5, ++ ++ 0x83,0xE8,0xF0,0x22,0x50,0x06,0xE9,0x25, ++ ++ 0x82,0xC8,0xF6,0x22,0xBB,0xFE,0x05,0xE9, ++ ++ 0x25,0x82,0xC8,0xF2,0x22,0xBB,0x01,0x0A, ++ ++ 0x89,0x82,0x8A,0x83,0xE0,0xF5,0xF0,0xA3, ++ ++ 0xE0,0x22,0x50,0x06,0x87,0xF0,0x09,0xE7, ++ ++ 0x19,0x22,0xBB,0xFE,0x07,0xE3,0xF5,0xF0, ++ ++ 0x09,0xE3,0x19,0x22,0x89,0x82,0x8A,0x83, ++ ++ 0xE4,0x93,0xF5,0xF0,0x74,0x01,0x93,0x22, ++ ++ 0xBB,0x01,0x10,0xE5,0x82,0x29,0xF5,0x82, ++ ++ 0xE5,0x83,0x3A,0xF5,0x83,0xE0,0xF5,0xF0, ++ ++ 0xA3,0xE0,0x22,0x50,0x09,0xE9,0x25,0x82, ++ ++ 0xF8,0x86,0xF0,0x08,0xE6,0x22,0xBB,0xFE, ++ ++ 0x0A,0xE9,0x25,0x82,0xF8,0xE2,0xF5,0xF0, ++ ++ 0x08,0xE2,0x22,0xE5,0x83,0x2A,0xF5,0x83, ++ ++ 0xE9,0x93,0xF5,0xF0,0xA3,0xE9,0x93,0x22, ++ ++ 0xBB,0x01,0x0A,0x89,0x82,0x8A,0x83,0xF0, ++ ++ 0xE5,0xF0,0xA3,0xF0,0x22,0x50,0x06,0xF7, ++ ++ 0x09,0xA7,0xF0,0x19,0x22,0xBB,0xFE,0x06, ++ ++ 0xF3,0xE5,0xF0,0x09,0xF3,0x19,0x22,0xF8, ++ ++ 0xBB,0x01,0x11,0xE5,0x82,0x29,0xF5,0x82, ++ ++ 0xE5,0x83,0x3A,0xF5,0x83,0xE8,0xF0,0xE5, ++ ++ 0xF0,0xA3,0xF0,0x22,0x50,0x09,0xE9,0x25, ++ ++ 0x82,0xC8,0xF6,0x08,0xA6,0xF0,0x22,0xBB, ++ ++ 0xFE,0x09,0xE9,0x25,0x82,0xC8,0xF2,0xE5, ++ ++ 0xF0,0x08,0xF2,0x22,0x75,0xF0,0x08,0x75, ++ ++ 0x82,0x00,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, ++ ++ 0xCD,0x33,0xCD,0xCC,0x33,0xCC,0xC5,0x82, ++ ++ 0x33,0xC5,0x82,0x9B,0xED,0x9A,0xEC,0x99, ++ ++ 0xE5,0x82,0x98,0x40,0x0C,0xF5,0x82,0xEE, ++ ++ 0x9B,0xFE,0xED,0x9A,0xFD,0xEC,0x99,0xFC, ++ ++ 0x0F,0xD5,0xF0,0xD6,0xE4,0xCE,0xFB,0xE4, ++ ++ 0xCD,0xFA,0xE4,0xCC,0xF9,0xA8,0x82,0x22, ++ ++ 0xB8,0x00,0xC1,0xB9,0x00,0x59,0xBA,0x00, ++ ++ 0x2D,0xEC,0x8B,0xF0,0x84,0xCF,0xCE,0xCD, ++ ++ 0xFC,0xE5,0xF0,0xCB,0xF9,0x78,0x18,0xEF, ++ ++ 0x2F,0xFF,0xEE,0x33,0xFE,0xED,0x33,0xFD, ++ ++ 0xEC,0x33,0xFC,0xEB,0x33,0xFB,0x10,0xD7, ++ ++ 0x03,0x99,0x40,0x04,0xEB,0x99,0xFB,0x0F, ++ ++ 0xD8,0xE5,0xE4,0xF9,0xFA,0x22,0x78,0x18, ++ ++ 0xEF,0x2F,0xFF,0xEE,0x33,0xFE,0xED,0x33, ++ ++ 0xFD,0xEC,0x33,0xFC,0xC9,0x33,0xC9,0x10, ++ ++ 0xD7,0x05,0x9B,0xE9,0x9A,0x40,0x07,0xEC, ++ ++ 0x9B,0xFC,0xE9,0x9A,0xF9,0x0F,0xD8,0xE0, ++ ++ 0xE4,0xC9,0xFA,0xE4,0xCC,0xFB,0x22,0x75, ++ ++ 0xF0,0x10,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, ++ ++ 0xED,0x33,0xFD,0xCC,0x33,0xCC,0xC8,0x33, ++ ++ 0xC8,0x10,0xD7,0x07,0x9B,0xEC,0x9A,0xE8, ++ ++ 0x99,0x40,0x0A,0xED,0x9B,0xFD,0xEC,0x9A, ++ ++ 0xFC,0xE8,0x99,0xF8,0x0F,0xD5,0xF0,0xDA, ++ ++ 0xE4,0xCD,0xFB,0xE4,0xCC,0xFA,0xE4,0xC8, ++ ++ 0xF9,0x22,0x90,0x44,0x7E,0xEF,0xF0,0xA9, ++ ++ 0x05,0xE4,0x90,0x44,0x84,0xF0,0xFB,0x90, ++ ++ 0x43,0x60,0xE0,0xFD,0xEB,0xC3,0x9D,0x50, ++ ++ 0x4F,0x90,0xF5,0xF1,0xE0,0xFF,0xEB,0x25, ++ ++ 0xE0,0x24,0x50,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xEF,0xF0,0x90,0xF5,0xF0,0xE0, ++ ++ 0xFF,0xEB,0x25,0xE0,0x24,0x51,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xEF,0xF0,0x90, ++ ++ 0xF5,0xF1,0xE0,0xFF,0xEB,0x25,0xE0,0x24, ++ ++ 0x58,0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83, ++ ++ 0xEF,0xF0,0x90,0xF5,0xF0,0xE0,0xFF,0xEB, ++ ++ 0x25,0xE0,0x24,0x59,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0xEF,0xF0,0x0B,0x80,0xA7, ++ ++ 0x90,0x41,0xEF,0xED,0xF0,0x90,0x43,0x50, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xEE,0xC3,0x13, ++ ++ 0xFE,0xEF,0x13,0xFF,0x90,0x44,0x7F,0xEE, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x7A,0x01,0x90,0x41, ++ ++ 0xEF,0xE0,0xFF,0xEA,0xC3,0x9F,0x50,0x4E, ++ ++ 0xEA,0x25,0xE0,0x24,0x50,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3,0xE0, ++ ++ 0x78,0x02,0xCE,0xC3,0x13,0xCE,0x13,0xD8, ++ ++ 0xF9,0xFD,0xAC,0x06,0xEA,0x25,0xE0,0x24, ++ ++ 0x50,0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xEE,0xC3,0x13, ++ ++ 0xFE,0xEF,0x13,0x2D,0xFF,0xEE,0x3C,0xFE, ++ ++ 0x90,0x44,0x7F,0xE0,0xFC,0xA3,0xE0,0xC3, ++ ++ 0x9F,0xEC,0x9E,0x50,0x06,0x90,0x43,0x4C, ++ ++ 0x74,0x01,0xF0,0x0A,0x80,0xA8,0x90,0x43, ++ ++ 0x78,0xE0,0xFE,0x70,0x14,0x90,0x41,0xEF, ++ ++ 0xE0,0x64,0x01,0x70,0x31,0x90,0x43,0x78, ++ ++ 0x04,0xF0,0x90,0xF5,0xE2,0xE9,0xF0,0x80, ++ ++ 0x25,0xEE,0xB4,0x01,0x17,0x90,0x41,0xEF, ++ ++ 0xE0,0xB4,0x01,0x08,0x90,0x43,0x78,0x74, ++ ++ 0x03,0xF0,0x80,0x12,0x90,0x43,0x78,0x74, ++ ++ 0x02,0xF0,0x80,0x0A,0x90,0x43,0x78,0xE0, ++ ++ 0xB4,0x02,0x03,0x74,0x03,0xF0,0x90,0x43, ++ ++ 0x78,0xE0,0xB4,0x03,0x0F,0x90,0x42,0x0F, ++ ++ 0xE0,0x14,0x90,0x43,0x77,0xF0,0x90,0x41, ++ ++ 0xEF,0x74,0x01,0xF0,0x90,0x44,0x7E,0xE0, ++ ++ 0x60,0x03,0x02,0x50,0xDD,0x7A,0x01,0x90, ++ ++ 0x43,0x60,0xE0,0xFF,0xEA,0xC3,0x9F,0x50, ++ ++ 0x34,0xEA,0x25,0xE0,0x24,0x58,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x43,0x58,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xC3,0xEF,0x9D,0xFF,0xEE,0x9C, ++ ++ 0xFE,0xEA,0x25,0xE0,0x24,0x77,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x0A,0x80,0xC2,0x90,0x43,0x8A, ++ ++ 0xE0,0xFC,0x70,0x39,0xFA,0x90,0x43,0x60, ++ ++ 0xE0,0xFF,0xEA,0xC3,0x9F,0x50,0x25,0xEA, ++ ++ 0x25,0xE0,0x24,0x79,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0xEA,0x25,0xE0,0x24,0x81,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x0A,0x80,0xD1,0x90,0x41,0xEF,0xE0, ++ ++ 0x90,0x43,0x8A,0xF0,0x22,0xEC,0x64,0x01, ++ ++ 0x70,0x03,0x02,0x50,0x96,0x90,0x44,0x83, ++ ++ 0x74,0x01,0xF0,0x90,0x44,0x82,0xF0,0xE4, ++ ++ 0xFA,0xF9,0xE9,0x25,0xE0,0x24,0x81,0xF5, ++ ++ 0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0xEA,0x25,0xE0,0x24,0x79, ++ ++ 0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xC3,0x9F,0xFF,0xEC,0x9E, ++ ++ 0xFE,0xC3,0x64,0x80,0x94,0x80,0x50,0x24, ++ ++ 0xC3,0xE4,0x9F,0xFF,0xE4,0x9E,0xFE,0x90, ++ ++ 0x43,0x60,0xE0,0x24,0xFE,0xFD,0xEA,0xC3, ++ ++ 0x9D,0x50,0x03,0x0A,0x80,0x06,0x90,0x44, ++ ++ 0x84,0x74,0x01,0xF0,0x90,0x44,0x81,0x74, ++ ++ 0x01,0xF0,0x80,0x1A,0xE4,0x90,0x44,0x81, ++ ++ 0xF0,0x90,0x43,0x8A,0xE0,0x24,0xFE,0xFD, ++ ++ 0xE9,0xC3,0x9D,0x50,0x03,0x09,0x80,0x06, ++ ++ 0x90,0x44,0x84,0x74,0x01,0xF0,0x90,0x42, ++ ++ 0x12,0xE0,0xFD,0xC3,0xEF,0x9D,0x74,0x80, ++ ++ 0xF8,0x6E,0x98,0x40,0x2A,0x90,0x43,0x50, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xEE,0x13,0xFE, ++ ++ 0xEF,0x13,0xFF,0x90,0x44,0x83,0xE0,0x25, ++ ++ 0xE0,0x24,0x50,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xE0,0xFC,0xA3,0xE0,0xD3,0x9F, ++ ++ 0xEC,0x9E,0x50,0x03,0x02,0x50,0x75,0x90, ++ ++ 0x44,0x83,0xE0,0xFC,0x25,0xE0,0x24,0x58, ++ ++ 0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x44,0x82,0xE0, ++ ++ 0xFD,0x25,0xE0,0x24,0x58,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0xEC,0x25,0xE0,0x24,0x50,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0xED,0x25,0xE0,0x24,0x50,0xF5, ++ ++ 0x82,0xE4,0x34,0x43,0xF5,0x83,0xEE,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x44,0x82,0xE0,0x04, ++ ++ 0xF0,0x90,0x44,0x81,0xE0,0xB4,0x01,0x17, ++ ++ 0x90,0x43,0x8A,0xE0,0x24,0xFE,0xFF,0xE9, ++ ++ 0xC3,0x9F,0x50,0x03,0x09,0x80,0x1D,0x90, ++ ++ 0x44,0x84,0x74,0x01,0xF0,0x80,0x15,0x90, ++ ++ 0x43,0x60,0xE0,0x24,0xFE,0xFF,0xEA,0xC3, ++ ++ 0x9F,0x50,0x03,0x0A,0x80,0x06,0x90,0x44, ++ ++ 0x84,0x74,0x01,0xF0,0x90,0x44,0x82,0xE0, ++ ++ 0x90,0x41,0xEF,0xF0,0xEA,0x04,0x90,0x44, ++ ++ 0x83,0xF0,0xA3,0xE0,0x64,0x01,0x60,0x03, ++ ++ 0x02,0x4F,0x4B,0x90,0x41,0xEF,0xE0,0x90, ++ ++ 0x43,0x8A,0xF0,0x80,0x06,0x90,0x41,0xEF, ++ ++ 0x74,0x01,0xF0,0x7B,0x01,0x90,0x43,0x8A, ++ ++ 0xE0,0x14,0xFF,0xEB,0xC3,0x9F,0x50,0x34, ++ ++ 0xEB,0x25,0xE0,0x24,0x58,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0x90,0x43,0x58,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xC3,0xEF,0x9D,0xFF,0xEE,0x9C,0xFE, ++ ++ 0xEB,0x25,0xE0,0x24,0x7F,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xEE,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x0B,0x80,0xC1,0x22,0x90,0xF9,0x00, ++ ++ 0xE0,0x70,0x0A,0x90,0x42,0x72,0xF0,0xA3, ++ ++ 0x74,0x32,0xF0,0x80,0x1B,0x90,0xF9,0x00, ++ ++ 0xE0,0xB4,0x01,0x0B,0x90,0x42,0x72,0xE4, ++ ++ 0xF0,0xA3,0x74,0xC8,0xF0,0x80,0x09,0x90, ++ ++ 0x42,0x72,0xE4,0xF0,0xA3,0x74,0x64,0xF0, ++ ++ 0x90,0x41,0xE2,0x74,0x40,0xF0,0x12,0x5A, ++ ++ 0x62,0x7F,0x01,0x12,0xAE,0x43,0x90,0x42, ++ ++ 0x72,0xE4,0xF0,0xA3,0x74,0x1E,0xF0,0x90, ++ ++ 0x41,0xE2,0x74,0x50,0xF0,0x12,0x5A,0x62, ++ ++ 0x90,0xF4,0x0C,0xE0,0x60,0x5A,0x90,0xF1, ++ ++ 0xEB,0x74,0x01,0xF0,0xE4,0xF0,0x90,0xF9, ++ ++ 0x00,0xE0,0x70,0x0A,0x90,0x42,0x72,0xF0, ++ ++ 0xA3,0x74,0x96,0xF0,0x80,0x1D,0x90,0xF9, ++ ++ 0x00,0xE0,0xB4,0x01,0x0C,0x90,0x42,0x72, ++ ++ 0x74,0x02,0xF0,0xA3,0x74,0x58,0xF0,0x80, ++ ++ 0x0A,0x90,0x42,0x72,0x74,0x01,0xF0,0xA3, ++ ++ 0x74,0x2C,0xF0,0x7F,0x01,0x12,0xAE,0x43, ++ ++ 0x90,0x41,0xE2,0x74,0x60,0xF0,0x12,0x5A, ++ ++ 0x62,0x90,0x42,0x72,0xE4,0xF0,0xA3,0x74, ++ ++ 0x1E,0xF0,0x7F,0x01,0x12,0xAE,0x43,0x90, ++ ++ 0x41,0xE2,0x74,0x70,0xF0,0x12,0x5A,0x62, ++ ++ 0x90,0xF4,0x0C,0xE0,0x60,0x10,0x90,0x41, ++ ++ 0xD8,0x74,0x02,0xF0,0x90,0xF2,0x1C,0xF0, ++ ++ 0xE4,0x90,0x43,0xBB,0xF0,0x22,0x90,0x41, ++ ++ 0xD8,0x74,0x01,0xF0,0x90,0xF2,0x1C,0xF0, ++ ++ 0x90,0x43,0xBB,0xF0,0xE4,0x90,0x42,0x6E, ++ ++ 0xF0,0x90,0xF1,0xB5,0xE0,0x90,0x42,0x6F, ++ ++ 0xF0,0x90,0xF1,0xB4,0xE0,0x90,0x42,0x70, ++ ++ 0xF0,0x90,0xF1,0xB3,0xE0,0x90,0x42,0x71, ++ ++ 0xF0,0x90,0x42,0x6E,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x42,0x60,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3, ++ ++ 0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0xEF,0x9B, ++ ++ 0xFF,0xEE,0x9A,0xFE,0xED,0x99,0xFD,0xEC, ++ ++ 0x98,0xFC,0x90,0x42,0x6E,0x12,0x4B,0x6C, ++ ++ 0x7F,0xFF,0x7E,0xFF,0x7D,0x3F,0x7C,0x00, ++ ++ 0x90,0x42,0x6E,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xD3,0x12, ++ ++ 0x4B,0x0B,0x40,0x21,0x90,0x42,0x6E,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0x24,0x00,0xFF,0xE4,0x3E,0xFE,0xED, ++ ++ 0x34,0x80,0xFD,0xEC,0x34,0xFF,0xFC,0x90, ++ ++ 0x42,0x6E,0x12,0x4B,0x6C,0x90,0x42,0x6E, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x78,0x09,0x12,0x4B,0x45, ++ ++ 0x90,0x42,0x6E,0x12,0x4B,0x6C,0x90,0x43, ++ ++ 0xE1,0xE0,0x60,0x04,0x7F,0x01,0x80,0x02, ++ ++ 0x7F,0x00,0x90,0x42,0x1F,0xE0,0x5F,0x70, ++ ++ 0x0F,0x90,0xF1,0x33,0xE0,0x70,0x09,0x90, ++ ++ 0xF1,0x35,0xE0,0x70,0x03,0x02,0x54,0x10, ++ ++ 0xE4,0x90,0x42,0x60,0xF0,0xA3,0xF0,0x90, ++ ++ 0xF1,0x0F,0xE0,0x90,0x42,0x62,0xF0,0x90, ++ ++ 0xF1,0x0E,0xE0,0x90,0x42,0x63,0xF0,0x90, ++ ++ 0x42,0x60,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x42,0x6E, ++ ++ 0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA, ++ ++ 0xA3,0xE0,0x2F,0xFF,0xEA,0x3E,0xFE,0xE9, ++ ++ 0x3D,0xFD,0xE8,0x3C,0xFC,0x90,0x42,0x60, ++ ++ 0x12,0x4B,0x6C,0xE4,0xFF,0x7E,0x40,0xFD, ++ ++ 0xFC,0x90,0x42,0x60,0xE0,0xF8,0xA3,0xE0, ++ ++ 0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3, ++ ++ 0x12,0x4B,0x0B,0x40,0x24,0x90,0x42,0x60, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE, ++ ++ 0xA3,0xE0,0x24,0x00,0xFF,0xEE,0x34,0xC0, ++ ++ 0xFE,0xED,0x34,0xFF,0xFD,0xEC,0x34,0xFF, ++ ++ 0xFC,0x90,0x42,0x60,0x12,0x4B,0x6C,0x80, ++ ++ 0x39,0xE4,0xFF,0xFE,0xFD,0xFC,0x90,0x42, ++ ++ 0x60,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0, ++ ++ 0xFA,0xA3,0xE0,0xFB,0xC3,0x12,0x4B,0x0B, ++ ++ 0x50,0x20,0x90,0x42,0x60,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0x24, ++ ++ 0x00,0xFF,0xEE,0x34,0x40,0xFE,0xE4,0x3D, ++ ++ 0xFD,0xE4,0x3C,0xFC,0x90,0x42,0x60,0x12, ++ ++ 0x4B,0x6C,0x90,0x42,0x63,0xE0,0x90,0xF1, ++ ++ 0x0E,0xF0,0x90,0x42,0x62,0xE0,0x90,0xF1, ++ ++ 0x0F,0xF0,0xE4,0x90,0x42,0x60,0xF0,0xA3, ++ ++ 0xF0,0x90,0xF1,0x13,0xE0,0x90,0x42,0x62, ++ ++ 0xF0,0x90,0xF1,0x12,0xE0,0x90,0x42,0x63, ++ ++ 0xF0,0x90,0x42,0x60,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x42,0x6E,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3, ++ ++ 0xE0,0xFA,0xA3,0xE0,0x2F,0xFF,0xEA,0x3E, ++ ++ 0xFE,0xE9,0x3D,0xFD,0xE8,0x3C,0xFC,0x90, ++ ++ 0x42,0x60,0x12,0x4B,0x6C,0xE4,0xFF,0x7E, ++ ++ 0x40,0xFD,0xFC,0x90,0x42,0x60,0xE0,0xF8, ++ ++ 0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0, ++ ++ 0xFB,0xC3,0x12,0x4B,0x0B,0x40,0x24,0x90, ++ ++ 0x42,0x60,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFE,0xA3,0xE0,0x24,0x00,0xFF,0xEE, ++ ++ 0x34,0xC0,0xFE,0xED,0x34,0xFF,0xFD,0xEC, ++ ++ 0x34,0xFF,0xFC,0x90,0x42,0x60,0x12,0x4B, ++ ++ 0x6C,0x80,0x39,0xE4,0xFF,0xFE,0xFD,0xFC, ++ ++ 0x90,0x42,0x60,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0x12, ++ ++ 0x4B,0x0B,0x50,0x20,0x90,0x42,0x60,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0x24,0x00,0xFF,0xEE,0x34,0x40,0xFE, ++ ++ 0xE4,0x3D,0xFD,0xE4,0x3C,0xFC,0x90,0x42, ++ ++ 0x60,0x12,0x4B,0x6C,0x90,0x42,0x63,0xE0, ++ ++ 0x90,0xF1,0x12,0xF0,0x90,0x42,0x62,0xE0, ++ ++ 0x90,0xF1,0x13,0xF0,0x90,0x43,0xDF,0xE0, ++ ++ 0x70,0x05,0x90,0xF1,0x0A,0x04,0xF0,0xE4, ++ ++ 0x90,0x42,0x60,0xF0,0x90,0xF1,0xB5,0xE0, ++ ++ 0x90,0x42,0x61,0xF0,0x90,0xF1,0xB4,0xE0, ++ ++ 0x90,0x42,0x62,0xF0,0x90,0xF1,0xB3,0xE0, ++ ++ 0x90,0x42,0x63,0xF0,0x22,0xE4,0x90,0x43, ++ ++ 0xEE,0xF0,0x90,0x43,0xE1,0xF0,0x90,0x42, ++ ++ 0x21,0xE0,0x90,0x44,0x8D,0xF0,0x90,0x42, ++ ++ 0x22,0xE0,0x90,0x44,0x8C,0xF0,0x90,0xF6, ++ ++ 0x25,0xE4,0xF0,0x90,0x42,0x20,0xE0,0x90, ++ ++ 0xF6,0x26,0xF0,0x90,0xF6,0x2B,0x74,0x02, ++ ++ 0xF0,0xA3,0xF0,0xA3,0xE4,0xF0,0x90,0xF6, ++ ++ 0x25,0x04,0xF0,0x90,0xF6,0x2F,0xF0,0x90, ++ ++ 0xF6,0x2F,0xE0,0xB4,0x01,0xF9,0x90,0xF6, ++ ++ 0x32,0xE0,0x90,0x43,0xF0,0xF0,0x90,0xF6, ++ ++ 0x33,0xE0,0x90,0x43,0xEF,0xF0,0x90,0x44, ++ ++ 0x8C,0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x90, ++ ++ 0x43,0xF0,0xE0,0x9F,0x90,0x43,0xEF,0xE0, ++ ++ 0x9E,0x40,0x03,0x02,0x57,0x34,0x90,0x44, ++ ++ 0x8C,0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x90, ++ ++ 0x43,0xF0,0xE0,0x9F,0x90,0x43,0xEF,0xE0, ++ ++ 0x9E,0x50,0x3A,0x90,0xF6,0x2C,0xE0,0xB4, ++ ++ 0x02,0x05,0x74,0x01,0xF0,0x80,0x0A,0x90, ++ ++ 0xF6,0x2B,0xE0,0x04,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0x90,0xF6,0x2F,0x74,0x01,0xF0,0x90, ++ ++ 0xF6,0x2F,0xE0,0xB4,0x01,0xF9,0x90,0xF6, ++ ++ 0x32,0xE0,0x90,0x43,0xF0,0xF0,0x90,0xF6, ++ ++ 0x33,0xE0,0x90,0x43,0xEF,0xF0,0x90,0xF6, ++ ++ 0x2B,0xE0,0xB4,0x0F,0xB1,0x90,0x42,0x23, ++ ++ 0xE0,0xFF,0x90,0xF6,0x2B,0xE0,0xC3,0x9F, ++ ++ 0x40,0x04,0x7F,0x01,0x80,0x02,0x7F,0x00, ++ ++ 0x90,0x43,0xDF,0xEF,0xF0,0x60,0x5C,0x90, ++ ++ 0xF1,0x2F,0xE4,0xF0,0x90,0xF1,0x34,0x04, ++ ++ 0xF0,0x90,0xF1,0x37,0x74,0x10,0xF0,0xA3, ++ ++ 0x74,0x06,0xF0,0x90,0xF1,0x3B,0x74,0x60, ++ ++ 0xF0,0xA3,0x74,0x1A,0xF0,0x90,0xF1,0x3F, ++ ++ 0x74,0xC0,0xF0,0xA3,0x74,0x2D,0xF0,0x90, ++ ++ 0xF1,0x33,0x74,0x01,0xF0,0x90,0xF1,0x36, ++ ++ 0x74,0x0D,0xF0,0x90,0xF1,0x39,0x74,0x10, ++ ++ 0xF0,0xA3,0x74,0x18,0xF0,0x90,0xF1,0x3D, ++ ++ 0x74,0x60,0xF0,0xA3,0x74,0x1B,0xF0,0x90, ++ ++ 0xF1,0x41,0x74,0x40,0xF0,0xA3,0x74,0x3A, ++ ++ 0xF0,0x90,0xF1,0x35,0x74,0x01,0xF0,0x90, ++ ++ 0xF1,0x11,0xF0,0x90,0xF6,0x2B,0xE0,0x14, ++ ++ 0xF0,0xC2,0xAF,0x90,0xF6,0x2D,0x74,0x01, ++ ++ 0xF0,0x90,0xF6,0x2F,0xF0,0x90,0xF6,0x2F, ++ ++ 0xE0,0xB4,0x01,0xF9,0xD2,0xAF,0x90,0xF6, ++ ++ 0x4C,0xE0,0x90,0x44,0x8F,0xF0,0x90,0xF6, ++ ++ 0x4D,0xE0,0x90,0x44,0x90,0xF0,0x90,0xF6, ++ ++ 0x4E,0xE0,0x90,0x44,0x91,0xF0,0x90,0xF6, ++ ++ 0x4F,0xE0,0x90,0x44,0x92,0xF0,0x90,0x44, ++ ++ 0x90,0xE0,0xFF,0x90,0x44,0x8F,0xE0,0xFE, ++ ++ 0x6F,0x60,0x20,0x90,0x44,0x91,0xE0,0xFD, ++ ++ 0xEE,0x6D,0x60,0x17,0xA3,0xE0,0xFC,0xEE, ++ ++ 0x6C,0x60,0x10,0xEF,0x6D,0x60,0x0C,0x90, ++ ++ 0x44,0x90,0xE0,0x6C,0x60,0x05,0xA3,0xE0, ++ ++ 0xB5,0x04,0x06,0x90,0x43,0xEE,0x74,0x01, ++ ++ 0xF0,0x90,0x44,0x8E,0x74,0x04,0xF0,0x90, ++ ++ 0x44,0x8E,0xE0,0xFF,0xC3,0x94,0x06,0x40, ++ ++ 0x03,0x02,0x57,0x34,0x90,0xF6,0x4C,0xE0, ++ ++ 0x6F,0x70,0x4B,0x90,0x43,0xEE,0xE0,0xB4, ++ ++ 0x01,0x21,0x90,0x44,0x8E,0xE0,0xB4,0x05, ++ ++ 0x1A,0x90,0x43,0xE3,0x74,0xAC,0xF0,0x90, ++ ++ 0x43,0xE2,0x74,0x0D,0xF0,0x90,0x43,0xE5, ++ ++ 0x74,0x9F,0xF0,0x90,0x43,0xE4,0x74,0x1A, ++ ++ 0xF0,0x80,0x20,0x90,0xF6,0x34,0xE0,0x90, ++ ++ 0x43,0xE3,0xF0,0x90,0xF6,0x35,0xE0,0x90, ++ ++ 0x43,0xE2,0xF0,0x90,0xF6,0x36,0xE0,0x90, ++ ++ 0x43,0xE5,0xF0,0x90,0xF6,0x37,0xE0,0x90, ++ ++ 0x43,0xE4,0xF0,0x12,0x75,0xDF,0x90,0x44, ++ ++ 0x8E,0xE0,0xFF,0x90,0xF6,0x4D,0xE0,0x6F, ++ ++ 0x70,0x48,0x90,0x43,0xEE,0xE0,0xB4,0x01, ++ ++ 0x1E,0xEF,0xB4,0x05,0x1A,0x90,0x43,0xE3, ++ ++ 0x74,0xAC,0xF0,0x90,0x43,0xE2,0x74,0x0D, ++ ++ 0xF0,0x90,0x43,0xE5,0x74,0x9F,0xF0,0x90, ++ ++ 0x43,0xE4,0x74,0x1A,0xF0,0x80,0x20,0x90, ++ ++ 0xF6,0x3A,0xE0,0x90,0x43,0xE3,0xF0,0x90, ++ ++ 0xF6,0x3B,0xE0,0x90,0x43,0xE2,0xF0,0x90, ++ ++ 0xF6,0x3C,0xE0,0x90,0x43,0xE5,0xF0,0x90, ++ ++ 0xF6,0x3D,0xE0,0x90,0x43,0xE4,0xF0,0x12, ++ ++ 0x75,0xDF,0x90,0x44,0x8E,0xE0,0xFF,0x90, ++ ++ 0xF6,0x4E,0xE0,0x6F,0x70,0x48,0x90,0x43, ++ ++ 0xEE,0xE0,0xB4,0x01,0x1E,0xEF,0xB4,0x05, ++ ++ 0x1A,0x90,0x43,0xE3,0x74,0xAC,0xF0,0x90, ++ ++ 0x43,0xE2,0x74,0x0D,0xF0,0x90,0x43,0xE5, ++ ++ 0x74,0x9F,0xF0,0x90,0x43,0xE4,0x74,0x1A, ++ ++ 0xF0,0x80,0x20,0x90,0xF6,0x40,0xE0,0x90, ++ ++ 0x43,0xE3,0xF0,0x90,0xF6,0x41,0xE0,0x90, ++ ++ 0x43,0xE2,0xF0,0x90,0xF6,0x42,0xE0,0x90, ++ ++ 0x43,0xE5,0xF0,0x90,0xF6,0x43,0xE0,0x90, ++ ++ 0x43,0xE4,0xF0,0x12,0x75,0xDF,0x90,0x44, ++ ++ 0x8E,0xE0,0xFF,0x90,0xF6,0x4F,0xE0,0x6F, ++ ++ 0x70,0x48,0x90,0x43,0xEE,0xE0,0xB4,0x01, ++ ++ 0x1E,0xEF,0xB4,0x05,0x1A,0x90,0x43,0xE3, ++ ++ 0x74,0xAC,0xF0,0x90,0x43,0xE2,0x74,0x0D, ++ ++ 0xF0,0x90,0x43,0xE5,0x74,0x9F,0xF0,0x90, ++ ++ 0x43,0xE4,0x74,0x1A,0xF0,0x80,0x20,0x90, ++ ++ 0xF6,0x46,0xE0,0x90,0x43,0xE3,0xF0,0x90, ++ ++ 0xF6,0x47,0xE0,0x90,0x43,0xE2,0xF0,0x90, ++ ++ 0xF6,0x48,0xE0,0x90,0x43,0xE5,0xF0,0x90, ++ ++ 0xF6,0x49,0xE0,0x90,0x43,0xE4,0xF0,0x12, ++ ++ 0x75,0xDF,0x90,0x44,0x8E,0xE0,0x04,0xF0, ++ ++ 0x02,0x55,0xD0,0x90,0xF6,0x25,0xE4,0xF0, ++ ++ 0x90,0x43,0xDF,0xE0,0x70,0x0D,0x90,0x43, ++ ++ 0xE1,0xE0,0xB4,0x01,0x06,0x90,0xF1,0x0A, ++ ++ 0x74,0x01,0xF0,0x7F,0x01,0x12,0xAE,0x43, ++ ++ 0x22,0x90,0xF4,0xC1,0xE0,0xC3,0x94,0x01, ++ ++ 0x50,0x03,0x02,0x5A,0x4D,0x90,0x43,0x26, ++ ++ 0xE0,0x70,0x1E,0x90,0x43,0x12,0x12,0x4B, ++ ++ 0x78,0x00,0x00,0x00,0x00,0x90,0x43,0x16, ++ ++ 0x12,0x4B,0x78,0x00,0x00,0x00,0x00,0x90, ++ ++ 0x43,0x0E,0x12,0x4B,0x78,0x00,0x00,0x00, ++ ++ 0x00,0x90,0x43,0x25,0xE0,0x25,0xE0,0x24, ++ ++ 0x36,0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x43,0x23,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x90,0xF9,0x00,0xE0, ++ ++ 0x70,0x19,0x90,0x43,0x23,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x7C,0x06,0x7D,0xA8,0x12,0x4A, ++ ++ 0x23,0x90,0x43,0x23,0xEC,0xF0,0xA3,0xED, ++ ++ 0xF0,0x80,0x1E,0x90,0xF9,0x00,0xE0,0xB4, ++ ++ 0x02,0x17,0x90,0x43,0x23,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x7C,0x0D,0x7D,0x50,0x12,0x4A, ++ ++ 0x23,0x90,0x43,0x23,0xEC,0xF0,0xA3,0xED, ++ ++ 0xF0,0x12,0xAC,0x5B,0x12,0x8E,0xE5,0x12, ++ ++ 0xAD,0x5A,0x90,0x42,0xFE,0xE0,0xFF,0xC4, ++ ++ 0x13,0x13,0x13,0x54,0x01,0x90,0x44,0xD5, ++ ++ 0xF0,0xE0,0xB4,0x01,0x31,0x90,0x43,0x12, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x90,0x42,0xFE,0xE0,0xF8, ++ ++ 0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0, ++ ++ 0xFB,0xC3,0xEF,0x9B,0xFF,0xEE,0x9A,0xFE, ++ ++ 0xED,0x99,0xFD,0xEC,0x98,0xFC,0x90,0x43, ++ ++ 0x12,0x12,0x4B,0x6C,0x80,0x2E,0x90,0x43, ++ ++ 0x12,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x42,0xFE,0xE0, ++ ++ 0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3, ++ ++ 0xE0,0xFB,0xEF,0x2B,0xFF,0xEE,0x3A,0xFE, ++ ++ 0xED,0x39,0xFD,0xEC,0x38,0xFC,0x90,0x43, ++ ++ 0x12,0x12,0x4B,0x6C,0x90,0x44,0xD5,0xE0, ++ ++ 0xB4,0x01,0x31,0x90,0x43,0x16,0xE0,0xFC, ++ ++ 0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0x90,0x43,0x02,0xE0,0xF8,0xA3,0xE0, ++ ++ 0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3, ++ ++ 0xEF,0x9B,0xFF,0xEE,0x9A,0xFE,0xED,0x99, ++ ++ 0xFD,0xEC,0x98,0xFC,0x90,0x43,0x16,0x12, ++ ++ 0x4B,0x6C,0x80,0x2E,0x90,0x43,0x16,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x43,0x02,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xEF,0x2B,0xFF,0xEE,0x3A,0xFE,0xED,0x39, ++ ++ 0xFD,0xEC,0x38,0xFC,0x90,0x43,0x16,0x12, ++ ++ 0x4B,0x6C,0x90,0x43,0x0E,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0x90,0x43,0x06,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xEF,0x2B, ++ ++ 0xFF,0xEE,0x3A,0xFE,0xED,0x39,0xFD,0xEC, ++ ++ 0x38,0xFC,0x90,0x43,0x0E,0x12,0x4B,0x6C, ++ ++ 0x90,0x43,0x26,0xE0,0x04,0xF0,0xE0,0xC3, ++ ++ 0x94,0x64,0x50,0x03,0x02,0x5A,0x61,0x90, ++ ++ 0x43,0x0E,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43,0x12, ++ ++ 0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0xEF,0x9B,0xFF,0xEE,0x9A, ++ ++ 0xFE,0xED,0x99,0xFD,0xEC,0x98,0xFC,0x90, ++ ++ 0x43,0x1A,0x12,0x4B,0x6C,0x90,0x43,0x1A, ++ ++ 0xE0,0xFF,0xC4,0x13,0x13,0x13,0x54,0x01, ++ ++ 0xFF,0xBF,0x01,0x14,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x12, ++ ++ 0x4A,0xFD,0x90,0x43,0x1A,0x12,0x4B,0x6C, ++ ++ 0x90,0x43,0x16,0xE0,0xFF,0xC4,0x13,0x13, ++ ++ 0x13,0x54,0x01,0xFF,0xBF,0x01,0x31,0x90, ++ ++ 0x43,0x1A,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43,0x16, ++ ++ 0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0xC3,0xEF,0x9B,0xFF,0xEE, ++ ++ 0x9A,0xFE,0xED,0x99,0xFD,0xEC,0x98,0xFC, ++ ++ 0x90,0x43,0x1A,0x12,0x4B,0x6C,0x80,0x2E, ++ ++ 0x90,0x43,0x1A,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43, ++ ++ 0x16,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0, ++ ++ 0xFA,0xA3,0xE0,0xFB,0xEF,0x2B,0xFF,0xEE, ++ ++ 0x3A,0xFE,0xED,0x39,0xFD,0xEC,0x38,0xFC, ++ ++ 0x90,0x43,0x1A,0x12,0x4B,0x6C,0x90,0x43, ++ ++ 0x1A,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x78,0x04,0x12,0x4B, ++ ++ 0x59,0x90,0x43,0x0E,0xE0,0xF8,0xA3,0xE0, ++ ++ 0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3, ++ ++ 0x12,0x4B,0x21,0x50,0x06,0x90,0x43,0x27, ++ ++ 0xE0,0x04,0xF0,0x90,0x43,0x25,0xE0,0x04, ++ ++ 0xF0,0xE4,0xA3,0xF0,0x90,0x43,0x25,0xE0, ++ ++ 0xC3,0x94,0x08,0x40,0x6B,0x90,0x43,0x27, ++ ++ 0xE0,0xFF,0x70,0x1A,0x90,0x42,0x38,0xF0, ++ ++ 0x90,0xF7,0x07,0x74,0xFC,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0x74,0xC9,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0x5E,0xF0,0x80,0x26,0xEF,0xD3, ++ ++ 0x94,0x07,0x40,0x20,0x90,0x42,0x38,0x74, ++ ++ 0x01,0xF0,0x90,0xF7,0x07,0x74,0xFC,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x7E,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x74,0x2F,0xF0,0x90,0x42, ++ ++ 0x39,0x74,0x01,0xF0,0x90,0x42,0xF7,0xE0, ++ ++ 0x04,0xF0,0xE4,0x90,0x43,0x25,0xF0,0x90, ++ ++ 0x43,0x27,0xF0,0x22,0x90,0xF7,0x07,0x74, ++ ++ 0xFC,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x7E, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x2F,0xF0, ++ ++ 0x22,0xE4,0x90,0x42,0x68,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF5,0xB3,0x04,0xF0,0x90,0xF5,0xB1, ++ ++ 0xE4,0xF0,0x90,0xF5,0xB0,0xF0,0x90,0xF5, ++ ++ 0xC2,0x04,0xF0,0x90,0xF5,0xB0,0xF0,0x90, ++ ++ 0xF5,0xC2,0xE4,0xF0,0x90,0x42,0x74,0xF0, ++ ++ 0x90,0x42,0x5F,0xE0,0x70,0x05,0x90,0x42, ++ ++ 0x74,0x04,0xF0,0x90,0x42,0x64,0x12,0x4B, ++ ++ 0x78,0x00,0x00,0x00,0x00,0x90,0xF2,0x1B, ++ ++ 0x74,0x40,0xF0,0xE4,0x90,0x42,0x78,0xF0, ++ ++ 0x90,0x42,0x74,0xE0,0xFF,0x90,0x42,0x78, ++ ++ 0xE0,0xFE,0xD3,0x9F,0x40,0x03,0x02,0x5B, ++ ++ 0x8B,0x90,0xF5,0xB8,0xEE,0xF0,0x90,0x42, ++ ++ 0x72,0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0xE4, ++ ++ 0x9F,0xFF,0xE4,0x9E,0x90,0x42,0x75,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x42,0x72,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x90,0x42,0x75,0xE0,0xFC, ++ ++ 0xA3,0xE0,0xFD,0xD3,0x9F,0xEE,0x64,0x80, ++ ++ 0xF8,0xEC,0x64,0x80,0x98,0x40,0x03,0x02, ++ ++ 0x5B,0x82,0xE0,0x90,0xF4,0x11,0xF0,0xEC, ++ ++ 0xFF,0x33,0x95,0xE0,0xA3,0xEF,0xF0,0x90, ++ ++ 0xF5,0xB5,0x74,0x01,0xF0,0x90,0x42,0x78, ++ ++ 0xE0,0xFF,0x25,0xE0,0x24,0x41,0x90,0xF2, ++ ++ 0x1B,0xF0,0x7D,0x80,0x7C,0x3E,0xE4,0xFF, ++ ++ 0x12,0xAB,0xED,0x90,0x44,0xAA,0xE0,0xB4, ++ ++ 0x01,0x04,0x7F,0x01,0x80,0x02,0x7F,0x00, ++ ++ 0x90,0xF5,0xB5,0xE0,0x64,0x01,0x60,0x04, ++ ++ 0x7E,0x01,0x80,0x02,0x7E,0x00,0xEE,0x5F, ++ ++ 0x70,0xE1,0x90,0xF5,0xB5,0xE0,0xB4,0x01, ++ ++ 0x04,0x7F,0x01,0x80,0x02,0x7F,0x00,0x90, ++ ++ 0x42,0x77,0xEF,0xF0,0x90,0x41,0xF8,0xF0, ++ ++ 0x90,0x42,0x78,0xE0,0xFD,0x25,0xE0,0x24, ++ ++ 0x42,0x90,0xF2,0x1B,0xF0,0x90,0x42,0x75, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x12,0x9A,0x29, ++ ++ 0x90,0x42,0x76,0xE0,0x04,0xF0,0x70,0x06, ++ ++ 0x90,0x42,0x75,0xE0,0x04,0xF0,0x02,0x5A, ++ ++ 0xDC,0x90,0x42,0x78,0xE0,0x04,0xF0,0x02, ++ ++ 0x5A,0xB1,0x90,0x42,0x68,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0xD3,0x90,0x42,0x6B,0xE0,0x9F, ++ ++ 0x90,0x42,0x6A,0xE0,0x9E,0x50,0x03,0x02, ++ ++ 0x5C,0x86,0x90,0x41,0xE7,0xE0,0x64,0x01, ++ ++ 0xF0,0x90,0xF0,0x76,0xF0,0xE4,0x90,0x42, ++ ++ 0x6E,0xF0,0x90,0xF1,0xB5,0xE0,0x90,0x42, ++ ++ 0x6F,0xF0,0x90,0xF1,0xB4,0xE0,0x90,0x42, ++ ++ 0x70,0xF0,0x90,0xF1,0xB3,0xE0,0x90,0x42, ++ ++ 0x71,0xF0,0xE4,0xFF,0xFE,0x7D,0x40,0xFC, ++ ++ 0x90,0x42,0x6E,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0x12,0x4B, ++ ++ 0x0B,0x40,0x23,0x90,0x42,0x6E,0xE0,0xF8, ++ ++ 0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0, ++ ++ 0xFB,0xE4,0x9B,0xFF,0xE4,0x9A,0xFE,0x74, ++ ++ 0x80,0x99,0xFD,0xE4,0x98,0xFC,0x90,0x42, ++ ++ 0x6E,0x12,0x4B,0x6C,0x80,0x17,0x90,0x42, ++ ++ 0x6E,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x12,0x4A,0xFD,0x90, ++ ++ 0x42,0x6E,0x12,0x4B,0x6C,0x90,0x42,0x60, ++ ++ 0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0xC3,0xE4,0x9B,0xFF,0xE4, ++ ++ 0x9A,0xFE,0x74,0x80,0x99,0xFD,0xE4,0x98, ++ ++ 0xFC,0x90,0x42,0x60,0x12,0x4B,0x6C,0x90, ++ ++ 0xF1,0xEB,0x74,0x01,0xF0,0xE4,0xF0,0x90, ++ ++ 0x42,0x6F,0xE0,0x90,0xF1,0xA5,0xF0,0x90, ++ ++ 0x42,0x70,0xE0,0x90,0xF1,0xA4,0xF0,0x90, ++ ++ 0x42,0x71,0xE0,0x90,0xF1,0xA3,0xF0,0x90, ++ ++ 0xF1,0x14,0xE0,0x70,0x06,0x90,0xF1,0x10, ++ ++ 0xE0,0x60,0x1A,0x90,0xF1,0x0E,0xE0,0xF4, ++ ++ 0xF0,0xA3,0xE0,0xF4,0xF0,0x90,0xF1,0x12, ++ ++ 0xE0,0xF4,0xF0,0xA3,0xE0,0xF4,0xF0,0x90, ++ ++ 0xF1,0x0A,0x74,0x01,0xF0,0x90,0x42,0x6C, ++ ++ 0xE0,0xFF,0x33,0x95,0xE0,0x90,0xF4,0x0D, ++ ++ 0xEF,0xF0,0x90,0x42,0x6D,0xE0,0x90,0xF4, ++ ++ 0x0C,0xF0,0x90,0xF5,0xB6,0x74,0x01,0xF0, ++ ++ 0x90,0xF2,0x1B,0x74,0x45,0xF0,0x7D,0x80, ++ ++ 0x7C,0x3E,0xE4,0xFF,0x12,0xAB,0xED,0x90, ++ ++ 0x44,0xAA,0xE0,0xB4,0x01,0x04,0x7F,0x01, ++ ++ 0x80,0x02,0x7F,0x00,0x90,0xF5,0xB7,0xE0, ++ ++ 0x64,0x01,0x60,0x04,0x7E,0x01,0x80,0x02, ++ ++ 0x7E,0x00,0xEE,0x5F,0x70,0xE1,0x90,0xF5, ++ ++ 0xB7,0xE0,0xB4,0x01,0x04,0x7F,0x01,0x80, ++ ++ 0x02,0x7F,0x00,0x90,0x42,0x77,0xEF,0xF0, ++ ++ 0x90,0x41,0xFF,0xF0,0x90,0xF2,0x1B,0x74, ++ ++ 0x46,0xF0,0x04,0xF0,0x90,0xF5,0xB6,0xE4, ++ ++ 0xF0,0x90,0xF5,0xC2,0x04,0xF0,0x90,0xF5, ++ ++ 0xB0,0xE4,0xF0,0x90,0xF5,0xC2,0xF0,0x22, ++ ++ 0xE4,0x90,0x44,0x2F,0xF0,0xA3,0xF0,0x90, ++ ++ 0x44,0x33,0xF0,0xA3,0x04,0xF0,0xE4,0x90, ++ ++ 0x44,0xB1,0xF0,0x90,0xF5,0xAD,0xF0,0x90, ++ ++ 0x44,0x2D,0xF0,0xA3,0xF0,0x90,0x44,0x2D, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x94,0x03, ++ ++ 0xEE,0x94,0x00,0x40,0x03,0x02,0x5E,0xA1, ++ ++ 0xEF,0x4E,0x70,0x22,0x90,0xF4,0x61,0xF0, ++ ++ 0x90,0xF4,0x60,0xF0,0x90,0xF4,0x64,0x74, ++ ++ 0x02,0xF0,0x90,0xF4,0x63,0x74,0x06,0xF0, ++ ++ 0x90,0x43,0xDF,0xE0,0x60,0x5A,0x90,0xF4, ++ ++ 0x63,0x74,0x07,0xF0,0x80,0x52,0x90,0x44, ++ ++ 0x2D,0xE0,0x70,0x04,0xA3,0xE0,0x64,0x01, ++ ++ 0x70,0x22,0x90,0xF4,0x61,0x74,0x02,0xF0, ++ ++ 0x90,0xF4,0x60,0xF0,0x90,0xF4,0x6C,0xF0, ++ ++ 0x90,0xF4,0x6B,0x74,0x04,0xF0,0x90,0x43, ++ ++ 0xDF,0xE0,0x60,0x2C,0x90,0xF4,0x6B,0x74, ++ ++ 0x07,0xF0,0x80,0x24,0x90,0xF4,0x61,0x74, ++ ++ 0x01,0xF0,0x90,0xF4,0x60,0x74,0x04,0xF0, ++ ++ 0x90,0xF4,0x68,0x74,0x02,0xF0,0x90,0xF4, ++ ++ 0x65,0x74,0x05,0xF0,0x90,0x43,0xDF,0xE0, ++ ++ 0x60,0x06,0x90,0xF4,0x65,0x74,0x07,0xF0, ++ ++ 0x90,0xF5,0xAC,0x74,0x01,0xF0,0x90,0xF5, ++ ++ 0xAE,0xE0,0xB4,0x01,0xF9,0x90,0xF5,0xAE, ++ ++ 0x74,0x01,0xF0,0x90,0xF4,0x6F,0xE0,0xFE, ++ ++ 0x90,0xF4,0x6E,0xE0,0xFD,0xEE,0xED,0xFF, ++ ++ 0x90,0x44,0x31,0xEE,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x90,0xF4,0x73,0xE0,0xFE,0x90,0xF4,0x72, ++ ++ 0xE0,0xFD,0xEE,0xED,0xFF,0x90,0x44,0x35, ++ ++ 0xEE,0xF0,0xA3,0xEF,0xF0,0x90,0x44,0x33, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xFB,0xAA,0x06, ++ ++ 0xE4,0xF9,0xF8,0x90,0x44,0x31,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0xE4,0xFC,0xFD,0x12,0x4A, ++ ++ 0xAE,0xC0,0x04,0xC0,0x05,0xC0,0x06,0xC0, ++ ++ 0x07,0x90,0x44,0x35,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0xFB,0xAA,0x06,0xE4,0xF9,0xF8,0x90, ++ ++ 0x44,0x2F,0xE0,0xFE,0xA3,0xE0,0xFF,0xE4, ++ ++ 0xFC,0xFD,0x12,0x4A,0xAE,0xA8,0x04,0xA9, ++ ++ 0x05,0xAA,0x06,0xAB,0x07,0xD0,0x07,0xD0, ++ ++ 0x06,0xD0,0x05,0xD0,0x04,0xC3,0x12,0x4B, ++ ++ 0x21,0x50,0x4F,0x90,0x44,0x31,0xE0,0xFF, ++ ++ 0xA3,0xE0,0x90,0x44,0x2F,0xCF,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x90,0x44,0x35,0xE0,0xFF,0xA3, ++ ++ 0xE0,0x90,0x44,0x33,0xCF,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0xF4,0x74,0xE0,0x90,0x44,0x29, ++ ++ 0xF0,0x90,0xF4,0x75,0xE0,0x90,0x44,0x2A, ++ ++ 0xF0,0x90,0xF4,0x76,0xE0,0x90,0x44,0x2B, ++ ++ 0xF0,0x90,0xF4,0x77,0xE0,0x90,0x44,0x2C, ++ ++ 0xF0,0x90,0x44,0x2E,0xE0,0x25,0xE0,0xFF, ++ ++ 0x90,0x44,0x2D,0xE0,0x33,0x90,0x44,0xB1, ++ ++ 0xEF,0xF0,0x90,0xF5,0xAC,0xE4,0xF0,0x90, ++ ++ 0x44,0x2E,0xE0,0x04,0xF0,0x70,0x06,0x90, ++ ++ 0x44,0x2D,0xE0,0x04,0xF0,0x02,0x5D,0x1E, ++ ++ 0x90,0x44,0x2C,0xE0,0xFF,0x90,0x44,0x2B, ++ ++ 0xE0,0xC3,0x9F,0x50,0x0D,0x90,0x44,0x28, ++ ++ 0x74,0x03,0xF0,0x90,0x44,0x2B,0xEF,0xF0, ++ ++ 0x80,0x06,0x90,0x44,0x28,0x74,0x02,0xF0, ++ ++ 0x90,0x44,0x2A,0xE0,0xFF,0x90,0x44,0x29, ++ ++ 0xE0,0xC3,0x9F,0x50,0x0D,0x90,0x44,0xB2, ++ ++ 0x74,0x01,0xF0,0x90,0x44,0x29,0xEF,0xF0, ++ ++ 0x80,0x05,0xE4,0x90,0x44,0xB2,0xF0,0x90, ++ ++ 0x44,0x2B,0xE0,0xFF,0x90,0x44,0x29,0xE0, ++ ++ 0xC3,0x9F,0x50,0x08,0x90,0x44,0x28,0xE0, ++ ++ 0x90,0x44,0xB2,0xF0,0x90,0x44,0x9A,0xE0, ++ ++ 0xB4,0x01,0x1F,0x90,0x44,0x9C,0xE0,0xFF, ++ ++ 0x70,0x06,0x90,0x44,0xB1,0xF0,0x80,0x12, ++ ++ 0xEF,0xB4,0x01,0x08,0x90,0x44,0xB1,0x74, ++ ++ 0x02,0xF0,0x80,0x06,0x90,0x44,0xB1,0x74, ++ ++ 0x04,0xF0,0x90,0x44,0xB2,0xE0,0x90,0xF9, ++ ++ 0x01,0xF0,0x90,0x44,0xB1,0xE0,0xFF,0x70, ++ ++ 0x06,0x90,0xF9,0x00,0xF0,0x80,0x21,0xEF, ++ ++ 0xC3,0x94,0x04,0x40,0x0E,0x90,0xF9,0x00, ++ ++ 0x74,0x02,0xF0,0x90,0x44,0xB2,0xE0,0x04, ++ ++ 0xF0,0x80,0x0D,0x90,0xF9,0x00,0x74,0x01, ++ ++ 0xF0,0x90,0x44,0xB2,0xE0,0x24,0x02,0xF0, ++ ++ 0x90,0x44,0xB2,0xE0,0xFD,0x12,0xAF,0x75, ++ ++ 0x90,0x44,0xB2,0xE0,0x24,0x06,0xFF,0x74, ++ ++ 0x01,0x7E,0x00,0xA8,0x07,0x08,0x80,0x05, ++ ++ 0xC3,0x33,0xCE,0x33,0xCE,0xD8,0xF9,0x24, ++ ++ 0xF6,0xFF,0xEE,0x34,0xFF,0x90,0x44,0x2D, ++ ++ 0xF0,0xA3,0xEF,0xF0,0xE0,0x90,0xF4,0x69, ++ ++ 0xF0,0x90,0x44,0x2D,0xE0,0x90,0xF4,0x6A, ++ ++ 0xF0,0x90,0xF4,0x6D,0x74,0x14,0xF0,0x90, ++ ++ 0xF5,0xAC,0xE4,0xF0,0x22,0xE4,0x90,0x44, ++ ++ 0x99,0xF0,0x90,0xFE,0x01,0xE0,0x54,0x7F, ++ ++ 0xFB,0x90,0xFE,0x08,0xE0,0xFD,0xA3,0xE0, ++ ++ 0x90,0x44,0x97,0xCD,0xF0,0xA3,0xED,0xF0, ++ ++ 0xAF,0x03,0xEF,0x60,0x0F,0x90,0xFE,0x02, ++ ++ 0xE0,0xFD,0xA3,0xE0,0x90,0x44,0x97,0xCD, ++ ++ 0xF0,0xA3,0xED,0xF0,0x90,0x44,0x97,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xC3,0xEC,0x94,0x40, ++ ++ 0x50,0x12,0x90,0x41,0x8C,0xE0,0x2D,0xFE, ++ ++ 0x90,0x41,0x8B,0xE0,0x3C,0x90,0x44,0x97, ++ ++ 0xF0,0xA3,0xCE,0xF0,0x90,0xFE,0x00,0xE0, ++ ++ 0x64,0x03,0x70,0x29,0xEB,0x64,0x02,0x70, ++ ++ 0x24,0x04,0xF0,0x90,0x44,0x97,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xF5,0x82,0x8E,0x83,0xE0,0x90, ++ ++ 0xFE,0x01,0xF0,0x90,0xFB,0x90,0x74,0x02, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xF0,0x90,0x44, ++ ++ 0x99,0xF0,0x02,0x61,0xC7,0x90,0xFE,0x00, ++ ++ 0xE0,0x64,0x04,0x70,0x42,0xAF,0x03,0xEB, ++ ++ 0x64,0x03,0x70,0x3B,0x90,0x41,0x8B,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x44,0x97,0xE0, ++ ++ 0xB5,0x06,0x11,0xA3,0xE0,0xB5,0x07,0x0C, ++ ++ 0x12,0xA1,0xB1,0x90,0x44,0x99,0x74,0x03, ++ ++ 0xF0,0x02,0x61,0xC7,0x90,0xFE,0x04,0xE0, ++ ++ 0xFF,0x90,0x44,0x97,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xF5,0x82,0x8C,0x83,0xEF,0xF0,0x90,0x44, ++ ++ 0x99,0x74,0x02,0xF0,0x02,0x61,0xC7,0x90, ++ ++ 0x44,0x95,0x74,0xFE,0xF0,0xA3,0x74,0x0A, ++ ++ 0xF0,0x90,0xFE,0x00,0xE0,0xFF,0x24,0xFF, ++ ++ 0xF5,0x82,0xE4,0x34,0xFD,0xF5,0x83,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xF4,0xFD,0xEC,0xF4,0x90, ++ ++ 0x44,0x93,0xF0,0xA3,0xED,0xF0,0xEF,0x24, ++ ++ 0xFE,0xFF,0x12,0xA2,0xC2,0x90,0x44,0x93, ++ ++ 0xE0,0x6E,0x70,0x03,0xA3,0xE0,0x6F,0x60, ++ ++ 0x09,0x90,0x44,0x99,0x74,0x02,0xF0,0x02, ++ ++ 0x61,0xC7,0x90,0x41,0x8B,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x44,0x97,0xE0,0xB5,0x06, ++ ++ 0x27,0xA3,0xE0,0xB5,0x07,0x22,0x12,0xA1, ++ ++ 0xB1,0x90,0x44,0x99,0x74,0x01,0xF0,0xE4, ++ ++ 0xFD,0xFF,0x12,0xAC,0xC0,0x90,0xFE,0x01, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xF4,0xFF,0xEE,0xF4, ++ ++ 0xA3,0xF0,0xA3,0xEF,0xF0,0x02,0x61,0xC7, ++ ++ 0x90,0xFE,0x04,0xE0,0xFF,0xFC,0x90,0xFE, ++ ++ 0x01,0xE0,0x54,0x3F,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xEA,0x60,0x03,0x02,0x62,0x27,0xEB,0x60, ++ ++ 0x57,0x24,0xF8,0x60,0x53,0x14,0x60,0x12, ++ ++ 0x24,0xFC,0x70,0x03,0x02,0x61,0xBE,0x24, ++ ++ 0xEB,0x60,0x7D,0x24,0x21,0x60,0x03,0x02, ++ ++ 0x62,0x27,0xEF,0x60,0x23,0x1F,0x90,0x44, ++ ++ 0x95,0xE0,0xFA,0xA3,0xE0,0x2F,0xF5,0x82, ++ ++ 0xE4,0x3A,0xF5,0x83,0xE0,0xFE,0x90,0x44, ++ ++ 0x97,0xE0,0xFA,0xA3,0xE0,0x2F,0xF5,0x82, ++ ++ 0xE4,0x3A,0xF5,0x83,0xEE,0xF0,0x80,0xDA, ++ ++ 0xE4,0xFD,0xFF,0x12,0xAC,0xC0,0x90,0xFE, ++ ++ 0x01,0xE0,0xFE,0xA3,0xE0,0xF4,0xFF,0xEE, ++ ++ 0xF4,0xA3,0xF0,0xA3,0xEF,0xF0,0x80,0x7E, ++ ++ 0xAF,0x04,0xE4,0xFD,0x12,0xAC,0xC0,0x90, ++ ++ 0x44,0x97,0xE0,0xFE,0xA3,0xE0,0xFF,0xAD, ++ ++ 0x04,0x12,0xA6,0x5B,0x90,0xFE,0x00,0xE0, ++ ++ 0x24,0xFE,0xFF,0x12,0xA2,0xC2,0xEF,0xF4, ++ ++ 0xFF,0xEE,0xF4,0xFE,0x90,0xFE,0x00,0xE0, ++ ++ 0x24,0xFF,0xF5,0x82,0xE4,0x34,0xFD,0xF5, ++ ++ 0x83,0xEE,0xF0,0xA3,0xEF,0xF0,0x80,0x46, ++ ++ 0xE4,0xFD,0x7F,0x04,0x12,0xAC,0xC0,0x90, ++ ++ 0xFE,0x03,0x74,0x04,0xF0,0xA3,0x74,0x15, ++ ++ 0xF0,0xA3,0x74,0x06,0xF0,0xA3,0x74,0xFB, ++ ++ 0xF0,0x90,0xFE,0x00,0xE0,0x24,0xFE,0xFF, ++ ++ 0x12,0xA2,0xC2,0xEF,0xF4,0xFF,0xEE,0xF4, ++ ++ 0xFE,0x90,0xFE,0x00,0xE0,0x24,0xFF,0xF5, ++ ++ 0x82,0xE4,0x34,0xFD,0xF5,0x83,0xEE,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x80,0x09,0x90,0xFB,0x86, ++ ++ 0x74,0x01,0xF0,0x12,0xA6,0xD7,0x90,0xFB, ++ ++ 0x86,0x74,0x01,0xF0,0x90,0x44,0x99,0xE0, ++ ++ 0xFF,0x64,0x02,0x60,0x24,0xEF,0x64,0x03, ++ ++ 0x60,0x1F,0x90,0xF9,0x9F,0xE0,0x60,0x14, ++ ++ 0x90,0xFB,0x88,0xE0,0x64,0x01,0x60,0xF8, ++ ++ 0x90,0xFB,0x96,0xE4,0xF0,0x90,0xFB,0x88, ++ ++ 0x04,0xF0,0x80,0x05,0x90,0xFB,0x93,0xE4, ++ ++ 0xF0,0x90,0x44,0x99,0xE0,0xFF,0x64,0x01, ++ ++ 0x60,0x04,0xEF,0xB4,0x03,0x20,0xE4,0xF5, ++ ++ 0x13,0xC2,0xAF,0x7A,0xAF,0x79,0xA0,0x12, ++ ++ 0x4B,0xA9,0x7A,0xAF,0x79,0xA0,0x12,0x4B, ++ ++ 0xA9,0x7B,0x01,0x7A,0x44,0x79,0x6A,0x7D, ++ ++ 0x01,0x7C,0x00,0x12,0xA1,0x83,0x22,0x90, ++ ++ 0x44,0xBB,0xEF,0xF0,0xC2,0xEB,0xE4,0x90, ++ ++ 0x43,0x6A,0xF0,0xA3,0xF0,0x90,0xF9,0x01, ++ ++ 0xE0,0xD3,0x94,0x01,0x50,0x0A,0x90,0x43, ++ ++ 0x6A,0x74,0x05,0xF0,0xA3,0x74,0x55,0xF0, ++ ++ 0x90,0xF9,0x01,0xE0,0x24,0x06,0xFF,0x74, ++ ++ 0x01,0x7E,0x00,0xA8,0x07,0x08,0x80,0x05, ++ ++ 0xC3,0x33,0xCE,0x33,0xCE,0xD8,0xF9,0x90, ++ ++ 0x43,0x72,0xF0,0xEE,0x90,0x43,0x71,0xF0, ++ ++ 0x90,0xF9,0x00,0xE0,0x70,0x34,0x90,0x43, ++ ++ 0x61,0x74,0x02,0xF0,0xA3,0x74,0xAB,0xF0, ++ ++ 0x90,0x43,0x69,0x74,0x28,0xF0,0x90,0x44, ++ ++ 0xBD,0x74,0x05,0xF0,0x90,0xF5,0xEF,0x74, ++ ++ 0x28,0xF0,0x90,0x43,0x6A,0xE0,0xFE,0xA3, ++ ++ 0xE0,0x78,0x02,0xCE,0xC3,0x13,0xCE,0x13, ++ ++ 0xD8,0xF9,0xF0,0xEE,0x90,0x43,0x6A,0xF0, ++ ++ 0x80,0x6F,0x90,0xF9,0x00,0xE0,0xB4,0x01, ++ ++ 0x34,0x90,0x43,0x61,0x74,0x0A,0xF0,0xA3, ++ ++ 0x74,0xAB,0xF0,0x90,0x43,0x69,0x74,0x50, ++ ++ 0xF0,0x90,0x44,0xBD,0x74,0x12,0xF0,0x90, ++ ++ 0xF5,0xEF,0x74,0x50,0xF0,0x90,0x43,0x71, ++ ++ 0xE0,0xFE,0xA3,0xE0,0x78,0x02,0xC3,0x33, ++ ++ 0xCE,0x33,0xCE,0xD8,0xF9,0xF0,0xEE,0x90, ++ ++ 0x43,0x71,0xF0,0x80,0x34,0x90,0x43,0x61, ++ ++ 0x74,0x05,0xF0,0xA3,0x74,0x55,0xF0,0x90, ++ ++ 0x43,0x69,0x74,0x3C,0xF0,0x90,0x44,0xBD, ++ ++ 0x74,0x09,0xF0,0x90,0xF5,0xEF,0x74,0x3C, ++ ++ 0xF0,0x90,0x43,0x72,0xE0,0x25,0xE0,0xF0, ++ ++ 0x90,0x43,0x71,0xE0,0x33,0xF0,0x90,0x43, ++ ++ 0x6A,0xE0,0xC3,0x13,0xF0,0xA3,0xE0,0x13, ++ ++ 0xF0,0x90,0x43,0x6A,0xE0,0xFF,0xA3,0xE0, ++ ++ 0xA3,0xCF,0xF0,0xA3,0xEF,0xF0,0x90,0x43, ++ ++ 0x69,0xE0,0x90,0xF5,0xE2,0xF0,0x90,0x43, ++ ++ 0x71,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43, ++ ++ 0x62,0xE0,0x2F,0xFF,0x90,0x43,0x61,0xE0, ++ ++ 0x3E,0xA2,0xE7,0x13,0xFE,0xEF,0x13,0xFF, ++ ++ 0x90,0xF5,0xFE,0xF0,0xEE,0xA3,0xF0,0xE4, ++ ++ 0x90,0x43,0x6F,0xF0,0xA3,0xF0,0x90,0xF5, ++ ++ 0x3B,0xF0,0x90,0xF5,0xBB,0xF0,0x90,0xF5, ++ ++ 0xB1,0xF0,0x90,0xF5,0xC8,0xF0,0x90,0xF5, ++ ++ 0xF8,0x04,0xF0,0x90,0xF5,0xDF,0x74,0xFB, ++ ++ 0xF0,0xA3,0xE4,0xF0,0x90,0xF5,0xE3,0x74, ++ ++ 0x09,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF5,0xFD,0xF0,0x90,0xF6,0x6D,0xE4, ++ ++ 0xF0,0x90,0xF5,0xF9,0x74,0x04,0xF0,0x90, ++ ++ 0x42,0x0E,0xE0,0xB4,0x01,0x1B,0x90,0x44, ++ ++ 0xBB,0xE0,0xB4,0x01,0x14,0x90,0xF5,0xE3, ++ ++ 0x74,0x01,0xF0,0x90,0xF5,0xF9,0xF0,0x90, ++ ++ 0xF5,0xFE,0x74,0xFF,0xF0,0xA3,0x74,0x0F, ++ ++ 0xF0,0xE4,0x90,0x44,0xBC,0xF0,0x90,0x43, ++ ++ 0x4B,0xE0,0xB4,0x01,0x22,0xE4,0x90,0x41, ++ ++ 0xEF,0xF0,0x90,0x43,0x8A,0xF0,0x90,0x43, ++ ++ 0x4C,0xF0,0x90,0x43,0x77,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF0,0x2B,0xE0,0xB4,0x01,0x11,0x90, ++ ++ 0x42,0x12,0x74,0x25,0xF0,0x80,0x09,0x90, ++ ++ 0x42,0x0F,0xE0,0x14,0x90,0x43,0x77,0xF0, ++ ++ 0x90,0x42,0x0F,0xE0,0xFF,0x90,0x43,0x77, ++ ++ 0xE0,0xC3,0x9F,0x50,0x53,0x90,0x44,0xBC, ++ ++ 0xE0,0x04,0xF0,0x90,0xF5,0xE7,0xE4,0xF0, ++ ++ 0xA3,0x04,0xF0,0x90,0xF5,0xE1,0xE4,0xF0, ++ ++ 0x90,0xF5,0xE7,0x04,0xF0,0x90,0xF5,0xE8, ++ ++ 0xE0,0xB4,0x01,0xF9,0x90,0xF5,0xE1,0xE0, ++ ++ 0x90,0x43,0x4D,0xF0,0xE0,0xB4,0x05,0x20, ++ ++ 0x74,0x06,0xF0,0x90,0xF5,0xEA,0xE0,0x90, ++ ++ 0x43,0x60,0xF0,0x90,0x43,0x4D,0xE0,0x90, ++ ++ 0xF5,0xE1,0xF0,0x90,0x44,0xBB,0xE0,0xFF, ++ ++ 0x90,0x44,0xBD,0xE0,0xFD,0x12,0x4D,0x7B, ++ ++ 0x90,0x43,0x77,0xE0,0x04,0xF0,0x80,0xA0, ++ ++ 0x12,0x6C,0xF4,0xE4,0x90,0x43,0x4B,0xF0, ++ ++ 0x90,0x43,0x4D,0xE0,0xFF,0x64,0x0E,0x60, ++ ++ 0x47,0xEF,0xB4,0x06,0x05,0x12,0x45,0x50, ++ ++ 0x80,0xEE,0x90,0x43,0x4D,0xE0,0x64,0x07, ++ ++ 0x70,0x22,0x12,0x84,0x03,0x90,0xF5,0xE8, ++ ++ 0x74,0x01,0xF0,0x90,0x43,0x4D,0xE0,0x90, ++ ++ 0xF5,0xE1,0xF0,0x90,0xF5,0xE8,0xE0,0xB4, ++ ++ 0x01,0xF9,0x90,0xF5,0xE6,0xE4,0xF0,0x12, ++ ++ 0x8A,0xED,0x80,0xC4,0x90,0x43,0x4D,0xE0, ++ ++ 0xB4,0x0C,0xBD,0x90,0x44,0xBB,0xE0,0xFF, ++ ++ 0x12,0x81,0x24,0x12,0x9B,0x32,0x80,0xB0, ++ ++ 0x90,0xF5,0xE7,0xE4,0xF0,0x90,0xF5,0xE1, ++ ++ 0xF0,0xD2,0xEB,0x22,0xC2,0xE9,0xC2,0xEA, ++ ++ 0xD2,0xA8,0xD2,0xAF,0x90,0x43,0xB8,0xE0, ++ ++ 0x60,0x12,0x90,0xF9,0x57,0xE0,0x54,0xFD, ++ ++ 0x44,0x02,0xF0,0xE0,0x54,0xFD,0xF0,0xE4, ++ ++ 0x90,0x43,0xB8,0xF0,0x90,0xF5,0xA9,0x74, ++ ++ 0x01,0xF0,0x90,0xF0,0x71,0xE4,0xF0,0x90, ++ ++ 0xF1,0xE9,0xF0,0x90,0xF0,0xD5,0xF0,0x90, ++ ++ 0xF0,0xE3,0xF0,0x90,0xF0,0xE2,0xF0,0x90, ++ ++ 0xF1,0xEA,0xF0,0x90,0xF1,0xEF,0xF0,0x90, ++ ++ 0xF1,0xF2,0xF0,0x90,0xF1,0xF7,0xF0,0x90, ++ ++ 0xF1,0xFB,0xF0,0x90,0xF5,0xAF,0xF0,0xA3, ++ ++ 0xF0,0xA3,0xF0,0x90,0xF5,0xBB,0xF0,0x90, ++ ++ 0xF5,0xA8,0xF0,0x90,0xF5,0xAC,0xF0,0x90, ++ ++ 0xF5,0xC8,0xF0,0x90,0xF4,0x71,0xF0,0x90, ++ ++ 0xF9,0x0B,0xF0,0x90,0xF5,0xE7,0xF0,0x90, ++ ++ 0xF5,0xE1,0xF0,0x90,0xF4,0x71,0xF0,0x90, ++ ++ 0xF5,0xD7,0xF0,0x90,0xF6,0x25,0xF0,0x90, ++ ++ 0xFD,0xA2,0xF0,0x90,0xF1,0xE8,0x04,0xF0, ++ ++ 0x90,0xF0,0x6C,0xF0,0x90,0xF1,0x75,0xF0, ++ ++ 0x90,0xF1,0x31,0xF0,0xE4,0x90,0x43,0xDF, ++ ++ 0xF0,0x90,0xF1,0xF6,0x04,0xF0,0x90,0xF1, ++ ++ 0xFA,0xF0,0x90,0xF1,0xF3,0xF0,0x90,0xF1, ++ ++ 0xF0,0xF0,0x90,0xF0,0x7D,0xF0,0x90,0xF1, ++ ++ 0xEB,0xF0,0x90,0xF5,0xC2,0xF0,0x90,0xF5, ++ ++ 0xB3,0xF0,0x90,0xF5,0xBD,0xF0,0x90,0xF1, ++ ++ 0xE8,0xF0,0xE4,0xF0,0x90,0xF0,0x6C,0xF0, ++ ++ 0x90,0xF1,0x75,0xF0,0x90,0xF1,0x31,0xF0, ++ ++ 0x90,0xF1,0xFA,0xF0,0x90,0x41,0xBA,0xE0, ++ ++ 0x90,0xF1,0xA3,0xF0,0x90,0x41,0xBB,0xE0, ++ ++ 0x90,0xF1,0xA4,0xF0,0x90,0x41,0xBC,0xE0, ++ ++ 0x90,0xF1,0xA5,0xF0,0x90,0xF6,0x21,0x74, ++ ++ 0x02,0xF0,0x90,0xF6,0x23,0xF0,0x90,0xF5, ++ ++ 0xC6,0xE4,0xF0,0xA3,0xF0,0x90,0xF5,0xC3, ++ ++ 0xF0,0xA3,0xF0,0x90,0x41,0xB2,0xE0,0x90, ++ ++ 0xF1,0x54,0xF0,0x90,0x41,0xB3,0xE0,0x90, ++ ++ 0xF1,0x55,0xF0,0x90,0x41,0xB4,0xE0,0x90, ++ ++ 0xF1,0x52,0xF0,0x90,0x41,0xB5,0xE0,0x90, ++ ++ 0xF1,0x53,0xF0,0x90,0xF1,0x93,0xE4,0xF0, ++ ++ 0x90,0xF1,0x69,0x74,0x08,0xF0,0x90,0xF1, ++ ++ 0x5F,0x74,0x02,0xF0,0x90,0xF1,0x4E,0x74, ++ ++ 0x40,0xF0,0x74,0xFF,0xF0,0x90,0xF1,0x85, ++ ++ 0xE4,0xF0,0x90,0xF1,0x2F,0x04,0xF0,0x90, ++ ++ 0xFD,0x02,0xF0,0x90,0xF7,0x0F,0xE4,0xF0, ++ ++ 0x90,0xF7,0x8A,0x74,0x0F,0xF0,0x90,0xF7, ++ ++ 0x98,0x74,0x0D,0xF0,0x90,0xF7,0x8B,0x74, ++ ++ 0x01,0xF0,0x90,0xFD,0xA5,0xE4,0xF0,0x90, ++ ++ 0xF5,0x52,0x74,0x3F,0xF0,0xA3,0x74,0x05, ++ ++ 0xF0,0x90,0x44,0x9D,0x74,0x0A,0xF0,0x90, ++ ++ 0xF0,0x71,0x74,0x01,0xF0,0x90,0xF7,0x15, ++ ++ 0xF0,0x90,0xF9,0x0E,0xF0,0x90,0xF5,0x06, ++ ++ 0x74,0x04,0xF0,0x90,0xF7,0x3C,0xE0,0x70, ++ ++ 0x04,0x90,0xF7,0x2F,0xF0,0x12,0xAE,0x16, ++ ++ 0x90,0xF7,0x34,0xE4,0xF0,0x90,0xF7,0x33, ++ ++ 0xF0,0x90,0xF7,0x35,0x74,0x05,0xF0,0xA3, ++ ++ 0xF0,0x90,0xF7,0x39,0x74,0xFF,0xF0,0xA3, ++ ++ 0x74,0x9C,0xF0,0x90,0xF7,0x7E,0x74,0x01, ++ ++ 0xF0,0x90,0xFD,0x00,0xF0,0x90,0xFD,0x90, ++ ++ 0x74,0x03,0xF0,0x90,0xF2,0x17,0x74,0xFE, ++ ++ 0xF0,0x90,0xF0,0x42,0x04,0xF0,0xA3,0xF0, ++ ++ 0xA3,0x74,0x07,0xF0,0xA3,0xF0,0x90,0xF7, ++ ++ 0x74,0x74,0x01,0xF0,0x90,0xF7,0x6A,0xF0, ++ ++ 0x12,0xAB,0x75,0x90,0xF7,0x3E,0x74,0x01, ++ ++ 0xF0,0x90,0xF7,0x3C,0xE0,0x70,0x0B,0x90, ++ ++ 0x44,0x9B,0xF0,0xD2,0xEA,0x90,0xF7,0x76, ++ ++ 0x04,0xF0,0x90,0xF7,0x37,0x74,0xDC,0xF0, ++ ++ 0xA3,0x74,0x05,0xF0,0x90,0xFD,0xA2,0xE4, ++ ++ 0xF0,0xA3,0xF0,0xA3,0x74,0x05,0xF0,0x90, ++ ++ 0xF5,0x4D,0x74,0x01,0xF0,0x90,0xF5,0x41, ++ ++ 0xE4,0xF0,0xA3,0x74,0x02,0xF0,0x90,0xF6, ++ ++ 0x5C,0xE4,0xF0,0xA3,0xF0,0x90,0xF0,0x5F, ++ ++ 0x04,0xF0,0x90,0x42,0x0A,0xE0,0x90,0xF0, ++ ++ 0x06,0xF0,0x90,0xF0,0x58,0xE4,0xF0,0xF0, ++ ++ 0x90,0x42,0x2B,0xF0,0x90,0x42,0x38,0x74, ++ ++ 0xFF,0xF0,0x90,0x42,0xFC,0xF0,0x90,0x42, ++ ++ 0xF7,0xF0,0x90,0xF9,0xE5,0x74,0x1E,0xF0, ++ ++ 0xA3,0x74,0x05,0xF0,0xA3,0xE4,0xF0,0x90, ++ ++ 0x42,0x3D,0x74,0xFF,0xF0,0x22,0x90,0xF4, ++ ++ 0x60,0xE0,0x60,0x03,0x02,0x67,0xA0,0x90, ++ ++ 0x41,0x92,0xE0,0x90,0xF4,0x03,0xF0,0x90, ++ ++ 0x41,0x93,0xE0,0x90,0xF4,0x02,0xF0,0x90, ++ ++ 0x41,0x94,0xE0,0x90,0xF4,0x01,0xF0,0x90, ++ ++ 0x41,0x95,0xE0,0x90,0xF4,0x00,0xF0,0x90, ++ ++ 0x41,0x96,0xE0,0x90,0xF4,0x07,0xF0,0x90, ++ ++ 0x41,0x97,0xE0,0x90,0xF4,0x06,0xF0,0x90, ++ ++ 0x41,0x98,0xE0,0x90,0xF4,0x05,0xF0,0x90, ++ ++ 0x41,0x99,0xE0,0x90,0xF4,0x04,0xF0,0x12, ++ ++ 0xAE,0xA0,0x90,0xF9,0x01,0xE0,0x14,0x60, ++ ++ 0x16,0x14,0x60,0x1F,0x14,0x60,0x28,0x24, ++ ++ 0x03,0x70,0x2E,0x90,0xF5,0x59,0x74,0xFA, ++ ++ 0xF0,0xA3,0x74,0x54,0xF0,0x80,0x22,0x90, ++ ++ 0xF5,0x59,0x74,0x7A,0xF0,0xA3,0x74,0x52, ++ ++ 0xF0,0x80,0x16,0x90,0xF5,0x59,0x74,0xE5, ++ ++ 0xF0,0xA3,0x74,0x4D,0xF0,0x80,0x0A,0x90, ++ ++ 0xF5,0x59,0x74,0x1B,0xF0,0xA3,0x74,0x46, ++ ++ 0xF0,0x12,0xAF,0x0C,0x90,0xF7,0x37,0x74, ++ ++ 0xDC,0xF0,0xA3,0x74,0x05,0xF0,0x22,0x90, ++ ++ 0xF4,0x60,0xE0,0x64,0x04,0x60,0x03,0x02, ++ ++ 0x68,0x3B,0x90,0x41,0xAA,0xE0,0x90,0xF4, ++ ++ 0x03,0xF0,0x90,0x41,0xAB,0xE0,0x90,0xF4, ++ ++ 0x02,0xF0,0x90,0x41,0xAC,0xE0,0x90,0xF4, ++ ++ 0x01,0xF0,0x90,0x41,0xAD,0xE0,0x90,0xF4, ++ ++ 0x00,0xF0,0x90,0x41,0xAE,0xE0,0x90,0xF4, ++ ++ 0x07,0xF0,0x90,0x41,0xAF,0xE0,0x90,0xF4, ++ ++ 0x06,0xF0,0x90,0x41,0xB0,0xE0,0x90,0xF4, ++ ++ 0x05,0xF0,0x90,0x41,0xB1,0xE0,0x90,0xF4, ++ ++ 0x04,0xF0,0x12,0xAE,0xC0,0x90,0xF9,0x01, ++ ++ 0xE0,0x14,0x60,0x16,0x14,0x60,0x1F,0x14, ++ ++ 0x60,0x28,0x24,0x03,0x70,0x2E,0x90,0xF5, ++ ++ 0x59,0x74,0xA4,0xF0,0xA3,0x74,0x28,0xF0, ++ ++ 0x80,0x22,0x90,0xF5,0x59,0x74,0x72,0xF0, ++ ++ 0xA3,0x74,0x27,0xF0,0x80,0x16,0x90,0xF5, ++ ++ 0x59,0x74,0x41,0xF0,0xA3,0x74,0x25,0xF0, ++ ++ 0x80,0x0A,0x90,0xF5,0x59,0x74,0x87,0xF0, ++ ++ 0xA3,0x74,0x21,0xF0,0x12,0xAE,0xD0,0x90, ++ ++ 0xF7,0x37,0x74,0xB8,0xF0,0xA3,0x74,0x0B, ++ ++ 0xF0,0x22,0x90,0xF4,0x60,0xE0,0x24,0xFE, ++ ++ 0x60,0x29,0x14,0x60,0x48,0x24,0x02,0x70, ++ ++ 0x64,0x90,0x41,0x9A,0xE0,0x90,0xF4,0x03, ++ ++ 0xF0,0x90,0x41,0x9B,0xE0,0x90,0xF4,0x02, ++ ++ 0xF0,0x90,0x41,0x9C,0xE0,0x90,0xF4,0x01, ++ ++ 0xF0,0x90,0x41,0x9D,0xE0,0x90,0xF4,0x00, ++ ++ 0xF0,0x80,0x42,0x90,0x41,0x9E,0xE0,0x90, ++ ++ 0xF4,0x03,0xF0,0x90,0x41,0x9F,0xE0,0x90, ++ ++ 0xF4,0x02,0xF0,0x90,0x41,0xA0,0xE0,0x90, ++ ++ 0xF4,0x01,0xF0,0x90,0x41,0xA1,0xE0,0x90, ++ ++ 0xF4,0x00,0xF0,0x80,0x20,0x90,0x41,0xA2, ++ ++ 0xE0,0x90,0xF4,0x03,0xF0,0x90,0x41,0xA3, ++ ++ 0xE0,0x90,0xF4,0x02,0xF0,0x90,0x41,0xA4, ++ ++ 0xE0,0x90,0xF4,0x01,0xF0,0x90,0x41,0xA5, ++ ++ 0xE0,0x90,0xF4,0x00,0xF0,0x90,0x41,0xA6, ++ ++ 0xE0,0x90,0xF4,0x07,0xF0,0x90,0x41,0xA7, ++ ++ 0xE0,0x90,0xF4,0x06,0xF0,0x90,0x41,0xA8, ++ ++ 0xE0,0x90,0xF4,0x05,0xF0,0x90,0x41,0xA9, ++ ++ 0xE0,0x90,0xF4,0x04,0xF0,0x12,0xAE,0xB0, ++ ++ 0x90,0xF9,0x01,0xE0,0x14,0x60,0x16,0x14, ++ ++ 0x60,0x1F,0x14,0x60,0x28,0x24,0x03,0x70, ++ ++ 0x2E,0x90,0xF5,0x59,0x74,0x52,0xF0,0xA3, ++ ++ 0x74,0x14,0xF0,0x80,0x22,0x90,0xF5,0x59, ++ ++ 0x74,0xB9,0xF0,0xA3,0x74,0x13,0xF0,0x80, ++ ++ 0x16,0x90,0xF5,0x59,0x74,0xA1,0xF0,0xA3, ++ ++ 0x74,0x12,0xF0,0x80,0x0A,0x90,0xF5,0x59, ++ ++ 0x74,0xC4,0xF0,0xA3,0x74,0x10,0xF0,0x12, ++ ++ 0xAE,0x7E,0x90,0xF7,0x37,0x74,0xB8,0xF0, ++ ++ 0xA3,0x74,0x0B,0xF0,0x22,0x90,0x41,0xE8, ++ ++ 0xE0,0x60,0x03,0x02,0x69,0xEB,0x90,0xF0, ++ ++ 0x60,0xE0,0xC3,0x94,0xD5,0x50,0x27,0x90, ++ ++ 0x42,0x54,0xE0,0x90,0x44,0x45,0xF0,0x94, ++ ++ 0x00,0x40,0x06,0xE0,0x14,0x90,0x42,0x54, ++ ++ 0xF0,0x90,0xF0,0x60,0xE0,0xD3,0x94,0x60, ++ ++ 0x50,0x24,0x90,0x44,0x47,0x74,0x86,0xF0, ++ ++ 0x90,0xFB,0x28,0xF0,0x80,0x18,0x90,0xF0, ++ ++ 0x60,0xE0,0xD3,0x94,0xF7,0x40,0x0F,0xE0, ++ ++ 0x94,0xFF,0x40,0x0A,0x90,0x44,0x47,0x74, ++ ++ 0x82,0xF0,0x90,0xFB,0x28,0xF0,0x90,0x41, ++ ++ 0xE3,0xE0,0x60,0x47,0x90,0xF0,0x61,0xE0, ++ ++ 0xD3,0x94,0xBA,0x50,0x26,0x90,0x41,0xD5, ++ ++ 0xE0,0x60,0x38,0x90,0x44,0x46,0xE0,0x25, ++ ++ 0xE0,0xFF,0xE4,0x33,0xFE,0xEF,0x24,0xA0, ++ ++ 0xFF,0xE4,0x3E,0xFE,0x90,0xF0,0x61,0xE0, ++ ++ 0xD3,0x9F,0xEE,0x64,0x80,0xF8,0x74,0x80, ++ ++ 0x98,0x40,0x18,0x90,0x41,0xDC,0xE0,0xB4, ++ ++ 0x01,0x07,0x7F,0x02,0x12,0xAD,0x3C,0x80, ++ ++ 0x05,0x7F,0x0C,0x12,0xAD,0x3C,0xE4,0x90, ++ ++ 0x41,0xE3,0xF0,0x90,0x41,0xE3,0xE0,0x70, ++ ++ 0x24,0x90,0xF0,0x61,0xE0,0xC3,0x94,0x5A, ++ ++ 0x50,0x1B,0x90,0x41,0xDC,0xE0,0xB4,0x01, ++ ++ 0x07,0x7F,0x01,0x12,0xAD,0x3C,0x80,0x05, ++ ++ 0x7F,0x0B,0x12,0xAD,0x3C,0x90,0x41,0xE3, ++ ++ 0x74,0x01,0xF0,0x80,0x05,0x90,0xF0,0x60, ++ ++ 0xE0,0xFF,0x90,0x41,0xE9,0xE0,0x60,0x03, ++ ++ 0x02,0x6B,0x1A,0x12,0xA3,0x15,0x90,0x42, ++ ++ 0x13,0xE0,0xFE,0xEF,0xD3,0x9E,0x50,0x13, ++ ++ 0x12,0xA3,0x15,0x90,0x42,0x14,0xE0,0xFE, ++ ++ 0xEF,0xD3,0x9E,0x40,0x68,0x90,0x41,0xD5, ++ ++ 0xE0,0x60,0x62,0x90,0x42,0x54,0xE0,0xD3, ++ ++ 0x94,0x00,0x40,0x59,0xE0,0x14,0xF0,0xE0, ++ ++ 0x90,0x44,0x45,0xF0,0x90,0x41,0xE3,0xE0, ++ ++ 0x60,0x4B,0x90,0xF0,0x1C,0xE0,0xFE,0x90, ++ ++ 0xF0,0x1B,0xE0,0x7C,0x00,0x24,0x00,0xFF, ++ ++ 0xEC,0x3E,0x90,0x44,0x4E,0xF0,0xA3,0xEF, ++ ++ 0xF0,0xE0,0x24,0xF9,0xF0,0x90,0x44,0x4E, ++ ++ 0xE0,0x34,0xFF,0xF0,0x90,0xF0,0x0F,0xE0, ++ ++ 0xFE,0x90,0xF0,0x0E,0xE0,0x24,0x00,0xFF, ++ ++ 0xEC,0x3E,0x90,0x44,0x4A,0xF0,0xA3,0xEF, ++ ++ 0xF0,0xE0,0x24,0xF9,0xF0,0x90,0x44,0x4A, ++ ++ 0xE0,0x34,0xFF,0xF0,0x12,0xA9,0xA8,0x90, ++ ++ 0x44,0x46,0xE0,0x04,0xF0,0x12,0xA3,0x15, ++ ++ 0x90,0x42,0x15,0xE0,0xFE,0xEF,0xC3,0x9E, ++ ++ 0x50,0x06,0x90,0x41,0xD5,0xE0,0x60,0x10, ++ ++ 0x12,0xA3,0x15,0x90,0x42,0x16,0xE0,0xFE, ++ ++ 0xEF,0xC3,0x9E,0x40,0x03,0x02,0x6B,0x1A, ++ ++ 0x90,0x41,0xDC,0xE0,0xB4,0x01,0x04,0x7F, ++ ++ 0x0F,0x80,0x02,0x7F,0x0B,0x90,0x42,0x54, ++ ++ 0xE0,0xC3,0x9F,0x50,0x58,0xE0,0x04,0xF0, ++ ++ 0x90,0x44,0x46,0xE0,0x94,0x00,0x40,0x59, ++ ++ 0x90,0xF0,0x1C,0xE0,0xFE,0x90,0xF0,0x1B, ++ ++ 0xE0,0x7C,0x00,0x24,0x00,0xFF,0xEC,0x3E, ++ ++ 0x90,0x44,0x4E,0xF0,0xA3,0xEF,0xF0,0xE0, ++ ++ 0x24,0x07,0xF0,0x90,0x44,0x4E,0xE0,0x34, ++ ++ 0x00,0xF0,0x90,0xF0,0x0F,0xE0,0xFE,0x90, ++ ++ 0xF0,0x0E,0xE0,0x24,0x00,0xFF,0xEC,0x3E, ++ ++ 0x90,0x44,0x4A,0xF0,0xA3,0xEF,0xF0,0xE0, ++ ++ 0x24,0x07,0xF0,0x90,0x44,0x4A,0xE0,0x34, ++ ++ 0x00,0xF0,0x12,0xA9,0xA8,0x90,0x44,0x46, ++ ++ 0xE0,0x14,0xF0,0x80,0x0C,0x90,0x44,0x46, ++ ++ 0xE0,0xD3,0x94,0x00,0x40,0x03,0x12,0xAA, ++ ++ 0x3A,0x90,0x42,0x54,0xE0,0x90,0x44,0x45, ++ ++ 0xF0,0x22,0x90,0x41,0xD1,0xE0,0x60,0x6E, ++ ++ 0x90,0xF9,0x00,0xE0,0x90,0x44,0xB1,0xF0, ++ ++ 0x90,0xF9,0x01,0xE0,0x90,0x44,0xB2,0xF0, ++ ++ 0x90,0x44,0xB1,0xE0,0x70,0x0A,0xA3,0xE0, ++ ++ 0xFD,0xE4,0xFF,0x12,0xAF,0x75,0x80,0x22, ++ ++ 0x90,0x44,0xB1,0xE0,0xB4,0x02,0x0D,0xA3, ++ ++ 0xE0,0x04,0xF0,0xE0,0xFD,0x7F,0x04,0x12, ++ ++ 0xAF,0x75,0x80,0x0E,0x90,0x44,0xB2,0xE0, ++ ++ 0x24,0x02,0xF0,0xE0,0xFD,0x7F,0x02,0x12, ++ ++ 0xAF,0x75,0x90,0x44,0xB2,0xE0,0x24,0x06, ++ ++ 0xFF,0x74,0x01,0x7E,0x00,0xA8,0x07,0x08, ++ ++ 0x80,0x05,0xC3,0x33,0xCE,0x33,0xCE,0xD8, ++ ++ 0xF9,0x24,0xF6,0xFF,0xEE,0x34,0xFF,0xFE, ++ ++ 0xEF,0x90,0xF4,0x69,0xF0,0xEE,0xA3,0xF0, ++ ++ 0x90,0xF4,0x6D,0x74,0x14,0xF0,0x90,0xF4, ++ ++ 0x63,0x74,0x05,0xF0,0x90,0x43,0xDF,0xE0, ++ ++ 0x60,0x06,0x90,0xF4,0x63,0x74,0x07,0xF0, ++ ++ 0x90,0xF5,0xAD,0x74,0x01,0xF0,0x90,0xF5, ++ ++ 0xAC,0xE4,0xF0,0x04,0xF0,0x90,0xF5,0xAE, ++ ++ 0xE0,0xB4,0x01,0xF9,0x90,0xF5,0xAE,0x74, ++ ++ 0x01,0xF0,0x90,0xF4,0x83,0xE0,0x90,0x44, ++ ++ 0x52,0xF0,0x90,0xF4,0x82,0xE0,0x90,0x44, ++ ++ 0x53,0xF0,0x90,0xF4,0x81,0xE0,0x90,0x44, ++ ++ 0x54,0xF0,0x90,0xF4,0x80,0xE0,0x90,0x44, ++ ++ 0x55,0xF0,0x90,0xF4,0x86,0xE0,0x30,0xE2, ++ ++ 0x04,0x7F,0xFF,0x80,0x02,0x7F,0x00,0x90, ++ ++ 0x44,0x56,0xEF,0xF0,0xE0,0xB4,0xFF,0x09, ++ ++ 0x90,0xF4,0x86,0xE0,0x44,0xF8,0xFF,0x80, ++ ++ 0x07,0x90,0xF4,0x86,0xE0,0x54,0x07,0xFF, ++ ++ 0x90,0x44,0x57,0xEF,0xF0,0x90,0xF4,0x85, ++ ++ 0xE0,0x90,0x44,0x58,0xF0,0x90,0xF4,0x84, ++ ++ 0xE0,0x90,0x44,0x59,0xF0,0x90,0x44,0xB2, ++ ++ 0xE0,0x24,0x05,0xFF,0x74,0x01,0x7E,0x00, ++ ++ 0xA8,0x07,0x08,0x80,0x05,0xC3,0x33,0xCE, ++ ++ 0x33,0xCE,0xD8,0xF9,0x90,0x44,0xB0,0xF0, ++ ++ 0xEE,0x90,0x44,0xAF,0xF0,0x90,0x44,0x56, ++ ++ 0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA, ++ ++ 0xA3,0xE0,0xFB,0x90,0x44,0x52,0xE0,0xFC, ++ ++ 0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0x12,0xA4,0xD1,0xA8,0x04,0xA9,0x05, ++ ++ 0xAA,0x06,0xAB,0x07,0x90,0x44,0xAF,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0xE4,0xFC,0xFD,0xEB, ++ ++ 0x2F,0xFF,0xEA,0x3E,0xFE,0xED,0x39,0xFD, ++ ++ 0xEC,0x38,0xFC,0x90,0x44,0x5A,0x12,0x4B, ++ ++ 0x6C,0x90,0x44,0xB0,0xE0,0x90,0xF5,0x3C, ++ ++ 0xF0,0x90,0x44,0xAF,0xE0,0x90,0xF5,0x3D, ++ ++ 0xF0,0xE4,0x7F,0xFF,0x7E,0x07,0xFD,0xFC, ++ ++ 0x90,0x44,0x5A,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xD3,0x12, ++ ++ 0x4B,0x0B,0x40,0x0C,0x90,0x44,0x5A,0x12, ++ ++ 0x4B,0x78,0x00,0x00,0x07,0xFF,0x80,0x26, ++ ++ 0x7F,0x00,0x7E,0xF8,0x7D,0xFF,0x7C,0xFF, ++ ++ 0x90,0x44,0x5A,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0x12, ++ ++ 0x4B,0x0B,0x50,0x0A,0x90,0x44,0x5A,0x12, ++ ++ 0x4B,0x78,0xFF,0xFF,0xF8,0x00,0x90,0x44, ++ ++ 0x5D,0xE0,0x90,0xF4,0x66,0xF0,0x90,0x44, ++ ++ 0x5C,0xE0,0x90,0xF4,0x67,0xF0,0x90,0xF4, ++ ++ 0x67,0xE0,0x70,0xFA,0x90,0xF4,0x66,0xE0, ++ ++ 0x70,0xF4,0x22,0x90,0x43,0x63,0x74,0x01, ++ ++ 0xF0,0x90,0x41,0xEF,0xE0,0xFF,0xD3,0x94, ++ ++ 0x01,0x40,0x05,0xEF,0x14,0xFF,0x80,0x02, ++ ++ 0x7F,0x01,0x90,0x43,0x64,0xEF,0xF0,0x90, ++ ++ 0xF6,0x6D,0x74,0x01,0xF0,0x90,0x41,0xEF, ++ ++ 0xE0,0x90,0xF6,0x6C,0xF0,0x90,0xF6,0x69, ++ ++ 0x74,0x01,0xF0,0xE4,0xF9,0x90,0x41,0xEF, ++ ++ 0xE0,0xFE,0xE9,0xC3,0x9E,0x50,0x47,0xE9, ++ ++ 0x25,0xE0,0x24,0x50,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0xE0,0x90,0xF6,0x6B,0xF0, ++ ++ 0xE9,0x25,0xE0,0x24,0x51,0xF5,0x82,0xE4, ++ ++ 0x34,0x43,0xF5,0x83,0xE0,0x90,0xF6,0x6A, ++ ++ 0xF0,0xE9,0x25,0xE0,0x24,0x58,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xE0,0x90,0xF6, ++ ++ 0x6B,0xF0,0xE9,0x25,0xE0,0x24,0x59,0xF5, ++ ++ 0x82,0xE4,0x34,0x43,0xF5,0x83,0xE0,0x90, ++ ++ 0xF6,0x6A,0xF0,0x09,0x80,0xAF,0x90,0x42, ++ ++ 0x0E,0xE0,0xB4,0x01,0x46,0x90,0x43,0x47, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xC3,0x90,0x43, ++ ++ 0x6B,0xE0,0x9D,0x90,0x43,0x6A,0xE0,0x9C, ++ ++ 0x50,0x0E,0x90,0x43,0x47,0xE0,0xA3,0xE0, ++ ++ 0x90,0x43,0x6A,0xEC,0xF0,0xA3,0xED,0xF0, ++ ++ 0x90,0x43,0x49,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0xC3,0x90,0x43,0x6D,0xE0,0x9D,0x90,0x43, ++ ++ 0x6C,0xE0,0x9C,0x50,0x0E,0x90,0x43,0x49, ++ ++ 0xE0,0xA3,0xE0,0x90,0x43,0x6C,0xEC,0xF0, ++ ++ 0xA3,0xED,0xF0,0x79,0x01,0x90,0x41,0xEF, ++ ++ 0xE0,0xFE,0xE9,0xC3,0x9E,0x50,0x79,0xE9, ++ ++ 0x25,0xE0,0x24,0x58,0xF5,0x82,0xE4,0x34, ++ ++ 0x43,0xF5,0x83,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0x90,0x43,0x58,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xC3,0xED,0x9B,0xFD,0xEC,0x9A,0xFC,0xD3, ++ ++ 0x90,0x43,0x6B,0xE0,0x9D,0x90,0x43,0x6A, ++ ++ 0xE0,0x9C,0x40,0x06,0xE9,0x04,0x90,0x43, ++ ++ 0x63,0xF0,0x90,0x43,0x61,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0x90,0x43,0x59,0xE0,0x2D,0xFD, ++ ++ 0x90,0x43,0x58,0xE0,0x3C,0xFC,0xC3,0xEE, ++ ++ 0x99,0xFF,0x25,0xE0,0x24,0x58,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFA,0xA3, ++ ++ 0xE0,0xFB,0xC3,0xED,0x9B,0xFD,0xEC,0x9A, ++ ++ 0xFC,0xD3,0x90,0x43,0x6D,0xE0,0x9D,0x90, ++ ++ 0x43,0x6C,0xE0,0x9C,0x40,0x06,0xEF,0x14, ++ ++ 0x90,0x43,0x64,0xF0,0x09,0x02,0x6D,0xC6, ++ ++ 0x90,0x43,0x64,0xE0,0xFF,0x90,0x43,0x63, ++ ++ 0xE0,0xFE,0xD3,0x9F,0x40,0x0F,0xEF,0x24, ++ ++ 0x01,0xFD,0xE4,0x33,0xFC,0xEE,0xB5,0x05, ++ ++ 0xE7,0xE4,0xB5,0x04,0xE3,0x90,0x41,0xEF, ++ ++ 0xE0,0xFF,0xB4,0x01,0x0C,0xE4,0x90,0x43, ++ ++ 0x65,0xF0,0x90,0x43,0x4D,0x74,0x0C,0xF0, ++ ++ 0x22,0x90,0x43,0x64,0xE0,0xF9,0x24,0x01, ++ ++ 0xFD,0xE4,0x33,0xFC,0x90,0x43,0x63,0xE0, ++ ++ 0xFE,0xB5,0x05,0x1E,0xE4,0xB5,0x04,0x1A, ++ ++ 0xEE,0xB5,0x07,0x07,0xE4,0x90,0x43,0x65, ++ ++ 0xF0,0x80,0x08,0x90,0x43,0x63,0xE0,0x90, ++ ++ 0x43,0x65,0xF0,0x90,0x43,0x4D,0x74,0x0C, ++ ++ 0xF0,0x22,0xE9,0xFF,0x90,0x43,0x63,0xE0, ++ ++ 0x2F,0xFF,0xE4,0x33,0xA2,0xE7,0x13,0xEF, ++ ++ 0x13,0x90,0x43,0x66,0xF0,0x90,0x43,0x4D, ++ ++ 0x74,0x06,0xF0,0x22,0x90,0x44,0x20,0x12, ++ ++ 0x4B,0x78,0x00,0x00,0x00,0x00,0x90,0x44, ++ ++ 0x24,0x12,0x4B,0x78,0x00,0x00,0x00,0x00, ++ ++ 0xE4,0x90,0x43,0xF5,0xF0,0xA3,0xF0,0x90, ++ ++ 0x43,0xF7,0xF0,0xA3,0xF0,0x90,0x43,0xE2, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x44,0x16,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x90,0x43,0xE4,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0xD3,0x90,0x44,0x17, ++ ++ 0xE0,0x9F,0x90,0x44,0x16,0xE0,0x9E,0x40, ++ ++ 0x03,0x02,0x70,0x4D,0xA3,0xE0,0x90,0xF6, ++ ++ 0x67,0xF0,0x90,0x44,0x16,0xE0,0x90,0xF6, ++ ++ 0x68,0xF0,0x90,0xF6,0x66,0x74,0x01,0xF0, ++ ++ 0x90,0xF6,0x66,0xE0,0xB4,0x01,0xF9,0x90, ++ ++ 0xF6,0x30,0xE0,0x54,0x0F,0xFB,0xA3,0xE0, ++ ++ 0x75,0xF0,0x10,0xA4,0xFF,0x90,0xF6,0x30, ++ ++ 0xE0,0xFD,0xC4,0x54,0x0F,0x7C,0x00,0x2F, ++ ++ 0xFF,0xEC,0x35,0xF0,0xFE,0xE4,0xFD,0x90, ++ ++ 0x44,0x18,0x12,0x4B,0x6C,0xEB,0xB4,0x0F, ++ ++ 0x16,0x90,0x44,0x18,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x44,0x1C,0x12,0x4B,0x6C,0x80,0x25,0x90, ++ ++ 0x44,0x18,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3, ++ ++ 0xE0,0xFE,0xA3,0xE0,0x24,0x00,0xFF,0xEE, ++ ++ 0x34,0x10,0xFE,0xE4,0x3D,0xFD,0xE4,0x3C, ++ ++ 0xFC,0xA8,0x03,0x12,0x4B,0x59,0x90,0x44, ++ ++ 0x1C,0x12,0x4B,0x6C,0x90,0x44,0x20,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x44,0x1C,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xD3,0x12,0x4B,0x21,0x40,0x48,0x90,0x44, ++ ++ 0x20,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x44,0x24,0x12, ++ ++ 0x4B,0x6C,0x90,0x43,0xF5,0xE0,0xFF,0xA3, ++ ++ 0xE0,0x90,0x43,0xF7,0xCF,0xF0,0xA3,0xEF, ++ ++ 0xF0,0x90,0x44,0x1C,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90, ++ ++ 0x44,0x20,0x12,0x4B,0x6C,0x90,0x44,0x16, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x43,0xF5,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x80,0x45,0x90,0x44, ++ ++ 0x24,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x44,0x1C,0xE0, ++ ++ 0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3, ++ ++ 0xE0,0xFB,0xD3,0x12,0x4B,0x21,0x40,0x23, ++ ++ 0x90,0x44,0x1C,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x44, ++ ++ 0x24,0x12,0x4B,0x6C,0x90,0x44,0x16,0xE0, ++ ++ 0xFF,0xA3,0xE0,0x90,0x43,0xF7,0xCF,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x44,0x17,0xE0,0x04, ++ ++ 0xF0,0x70,0x06,0x90,0x44,0x16,0xE0,0x04, ++ ++ 0xF0,0x02,0x6E,0xF5,0x22,0x12,0xA5,0x58, ++ ++ 0x12,0x99,0xA0,0x12,0x88,0x66,0x12,0x79, ++ ++ 0x8A,0x90,0xF7,0x8E,0x74,0x01,0xF0,0x90, ++ ++ 0xF7,0x91,0xF0,0x90,0xF7,0x31,0xE0,0x60, ++ ++ 0x08,0x90,0xF5,0xA9,0xE0,0xFF,0x12,0xA3, ++ ++ 0xFB,0xE4,0x90,0x44,0xCF,0xF0,0x12,0x87, ++ ++ 0x8B,0x12,0x95,0x68,0x12,0xA8,0x4D,0x12, ++ ++ 0x78,0x57,0x90,0x42,0x1B,0xE0,0x64,0x01, ++ ++ 0x70,0x34,0x90,0xF1,0x33,0xE0,0x70,0x2E, ++ ++ 0x90,0xF1,0x35,0xE0,0x70,0x28,0x90,0xF4, ++ ++ 0xC1,0xE0,0x64,0x02,0x70,0x20,0x90,0xF9, ++ ++ 0x00,0xE0,0x60,0x1A,0x90,0xF0,0x2B,0xE0, ++ ++ 0x70,0x14,0x90,0x42,0xFD,0xE0,0x70,0x0E, ++ ++ 0x90,0x43,0x4C,0xE0,0x60,0x08,0x90,0xFD, ++ ++ 0xA2,0x74,0x01,0xF0,0x80,0x05,0x90,0xFD, ++ ++ 0xA2,0xE4,0xF0,0x90,0xF5,0x4E,0xE0,0x60, ++ ++ 0x36,0xA3,0xE0,0x60,0x32,0x90,0xF9,0x03, ++ ++ 0xE0,0xFF,0x90,0xF4,0xC1,0xE0,0x6F,0x70, ++ ++ 0x23,0x90,0xF9,0x05,0xE0,0xB4,0x01,0x0A, ++ ++ 0xA3,0xE0,0xFF,0x90,0xF4,0xC4,0xE0,0xB5, ++ ++ 0x07,0x12,0x90,0xF9,0x05,0xE0,0x70,0x0F, ++ ++ 0x90,0xF9,0x07,0xE0,0xFF,0x90,0xF4,0xC5, ++ ++ 0xE0,0x6F,0x60,0x03,0x12,0xAF,0x97,0x7D, ++ ++ 0x00,0x7C,0x07,0xE4,0xFF,0x12,0xAB,0xED, ++ ++ 0x90,0xF9,0x99,0xE0,0x60,0x0E,0x90,0xF2, ++ ++ 0x1B,0x74,0x0C,0xF0,0x90,0x42,0x5F,0x74, ++ ++ 0x01,0xF0,0x80,0x06,0x90,0xF2,0x1B,0x74, ++ ++ 0x0D,0xF0,0x90,0xFD,0x33,0xE4,0xF0,0x04, ++ ++ 0xF0,0x90,0xFD,0x36,0xE0,0xB4,0x01,0xF9, ++ ++ 0x12,0xA3,0xB2,0x12,0xA5,0x15,0x90,0x43, ++ ++ 0xBC,0xE0,0x64,0x01,0x60,0x1E,0x90,0x43, ++ ++ 0xDD,0xE0,0xFF,0x90,0xFD,0x54,0xE0,0xC3, ++ ++ 0x9F,0x50,0x08,0x90,0x44,0xCA,0x74,0x01, ++ ++ 0xF0,0x80,0x09,0x90,0x44,0xCA,0xE0,0xB4, ++ ++ 0x01,0x02,0xE4,0xF0,0x12,0x82,0x1E,0x90, ++ ++ 0x44,0xAA,0xE0,0xB4,0x01,0x08,0x12,0x9E, ++ ++ 0xF5,0x12,0x78,0x57,0x80,0xF1,0x90,0x43, ++ ++ 0xDE,0xE0,0xB4,0x01,0x11,0x90,0xF5,0x4E, ++ ++ 0xE0,0x64,0x01,0x60,0x09,0xA3,0xE0,0x64, ++ ++ 0x01,0x60,0x03,0x12,0xAF,0x97,0x90,0x44, ++ ++ 0xCF,0xE0,0x75,0xF0,0x50,0x84,0xE5,0xF0, ++ ++ 0x70,0x03,0x12,0x79,0x8A,0x12,0x99,0xA0, ++ ++ 0x12,0x88,0x66,0x90,0x44,0xCF,0xE0,0x04, ++ ++ 0xF0,0xE0,0xC3,0x94,0xFA,0x50,0x03,0x02, ++ ++ 0x70,0x77,0x90,0x43,0xDE,0x74,0x01,0xF0, ++ ++ 0x90,0x42,0x0D,0xE0,0x64,0x01,0x60,0x09, ++ ++ 0x90,0x43,0x8D,0xE0,0x70,0x03,0x12,0x7E, ++ ++ 0x10,0x90,0x43,0xBB,0x74,0x01,0xF0,0x22, ++ ++ 0x90,0x41,0xEF,0xE0,0xD3,0x94,0x01,0x40, ++ ++ 0x0E,0x90,0xFD,0x0F,0x74,0x07,0xF0,0x90, ++ ++ 0xFD,0x29,0x74,0x01,0xF0,0x80,0x0A,0x90, ++ ++ 0xFD,0x0F,0xE4,0xF0,0x90,0xFD,0x29,0x04, ++ ++ 0xF0,0x90,0x42,0x46,0xE0,0x60,0x03,0x02, ++ ++ 0x72,0xA0,0x90,0x44,0xA6,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x7C,0x00,0x7D,0x64,0x12,0x4A, ++ ++ 0x23,0xED,0x4C,0x60,0x03,0x02,0x72,0xA0, ++ ++ 0x90,0xF9,0x80,0xE0,0xB4,0x01,0x15,0x90, ++ ++ 0x42,0x4C,0xE0,0x70,0x0F,0x04,0xF0,0x90, ++ ++ 0xF9,0x80,0xE4,0xF0,0xFF,0x7E,0x05,0x12, ++ ++ 0xAF,0x5E,0x80,0x7B,0x90,0xF9,0x80,0xE0, ++ ++ 0xB4,0x01,0x17,0x90,0x42,0x4C,0xE0,0xB4, ++ ++ 0x01,0x10,0x74,0x01,0xF0,0x90,0xF9,0x80, ++ ++ 0xE4,0xF0,0xFF,0x7E,0x05,0x12,0xAF,0x5E, ++ ++ 0x80,0x5D,0x90,0xF9,0x80,0xE0,0x70,0x57, ++ ++ 0x90,0x42,0x4C,0xE0,0x64,0x01,0x70,0x4F, ++ ++ 0xA2,0xAF,0x33,0x90,0x44,0xCC,0xF0,0xE4, ++ ++ 0x90,0x42,0x4C,0xF0,0xC2,0xAF,0x90,0xF7, ++ ++ 0x14,0xF0,0x7F,0xD4,0x7E,0x27,0x12,0xAF, ++ ++ 0x5E,0x90,0xF9,0x9D,0x74,0x01,0xF0,0x90, ++ ++ 0xF7,0x16,0xF0,0x90,0xF7,0x11,0xE4,0xF0, ++ ++ 0x74,0xFF,0xFF,0xFE,0x12,0xAF,0x5E,0x90, ++ ++ 0xF9,0x9D,0xE4,0xF0,0x90,0xF7,0x14,0x04, ++ ++ 0xF0,0x90,0xF7,0x0D,0xF0,0x90,0xF7,0x86, ++ ++ 0xF0,0xA3,0xF0,0x90,0xF7,0x11,0xF0,0x90, ++ ++ 0x44,0xCC,0xE0,0x24,0xFF,0x92,0xAF,0x90, ++ ++ 0x44,0xA7,0xE0,0x04,0xF0,0x70,0x06,0x90, ++ ++ 0x44,0xA6,0xE0,0x04,0xF0,0x90,0x42,0x44, ++ ++ 0xE0,0x70,0x0B,0x90,0x42,0x56,0xE0,0x70, ++ ++ 0x05,0x12,0xAD,0xFF,0x80,0x09,0x90,0xF0, ++ ++ 0x01,0xE0,0x60,0x03,0x12,0x83,0x14,0x90, ++ ++ 0x44,0xA6,0xE0,0xFE,0xA3,0xE0,0xFF,0x7C, ++ ++ 0x00,0x7D,0x0A,0x12,0x4A,0x23,0xED,0x4C, ++ ++ 0x70,0x13,0x90,0x43,0xBE,0xE0,0x60,0x0D, ++ ++ 0x90,0x41,0xD7,0xE0,0xB4,0x23,0x03,0x12, ++ ++ 0x69,0x1E,0x12,0xA5,0x99,0x90,0xF9,0x99, ++ ++ 0xE0,0x90,0x41,0xCE,0xF0,0x90,0x42,0x42, ++ ++ 0xE0,0x70,0x06,0x90,0x42,0x43,0xE0,0x60, ++ ++ 0x04,0x7F,0x01,0x80,0x02,0x7F,0x00,0x90, ++ ++ 0x41,0xCD,0xEF,0xF0,0x90,0x44,0xA6,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x7C,0x00,0x7D,0x32, ++ ++ 0x12,0x4A,0x23,0xED,0x4C,0x70,0x0E,0x12, ++ ++ 0x8A,0x18,0x12,0x89,0x40,0x90,0x43,0x8D, ++ ++ 0xE0,0x60,0x02,0x14,0xF0,0xC2,0xCF,0x22, ++ ++ 0xE4,0x90,0x43,0xDE,0xF0,0x12,0xAE,0xFD, ++ ++ 0xE4,0x90,0x42,0xFB,0xF0,0x90,0x42,0xF9, ++ ++ 0xF0,0xA3,0xF0,0x12,0x8E,0x1F,0x90,0x42, ++ ++ 0xF8,0x74,0x01,0xF0,0x90,0x43,0xDF,0xE0, ++ ++ 0x60,0x0A,0x90,0xF1,0x2F,0x74,0x01,0xF0, ++ ++ 0x90,0xF1,0x0A,0xF0,0x90,0xF7,0x3C,0xE0, ++ ++ 0x70,0x03,0xA3,0x04,0xF0,0x12,0x9A,0xAE, ++ ++ 0x12,0xAF,0x90,0x12,0x7B,0xDB,0xE4,0xFF, ++ ++ 0x12,0xA7,0xB4,0x90,0xFD,0x32,0xE0,0x90, ++ ++ 0xFD,0x92,0xF0,0x90,0xFD,0x31,0xE0,0x90, ++ ++ 0xFD,0x91,0xF0,0x90,0xF2,0x1B,0x74,0x09, ++ ++ 0xF0,0xE4,0xFF,0x12,0x62,0x28,0x90,0xF2, ++ ++ 0x1B,0x74,0x0A,0xF0,0x90,0xFD,0xA1,0xE0, ++ ++ 0x60,0x06,0x90,0xF7,0x81,0x74,0x40,0xF0, ++ ++ 0x7F,0x04,0x12,0xAE,0x43,0x90,0xF5,0x3B, ++ ++ 0x74,0x01,0xF0,0xE4,0xFF,0x12,0xA7,0xB4, ++ ++ 0x12,0x7F,0x1C,0x90,0x43,0xBD,0xE0,0x60, ++ ++ 0x21,0x90,0xF7,0x3C,0xE0,0x70,0x16,0x90, ++ ++ 0xF7,0x40,0xF0,0x90,0xF5,0x54,0x04,0xF0, ++ ++ 0xE4,0x90,0x44,0x9E,0xF0,0x90,0x44,0x9D, ++ ++ 0xE0,0x90,0xF5,0x52,0xF0,0xE4,0x90,0x43, ++ ++ 0xB9,0xF0,0x90,0x41,0xCD,0x74,0x01,0xF0, ++ ++ 0x90,0x42,0x42,0xF0,0x12,0x7E,0x10,0x12, ++ ++ 0xAD,0xCE,0x7F,0x0A,0x12,0xAE,0x43,0x90, ++ ++ 0xF5,0xC8,0x74,0x01,0xF0,0x90,0xF7,0x8E, ++ ++ 0xF0,0x90,0x44,0x3B,0xF0,0x90,0x42,0x41, ++ ++ 0xE0,0x64,0x01,0x70,0x6D,0x90,0x43,0xD0, ++ ++ 0xE0,0x64,0x01,0x70,0x65,0x90,0xF0,0x2B, ++ ++ 0xE0,0x64,0x01,0x70,0x5D,0x90,0xF6,0x08, ++ ++ 0xE0,0x70,0x57,0xC2,0xEB,0x90,0xF7,0x8B, ++ ++ 0x74,0x02,0xF0,0x7F,0x01,0x12,0x80,0x20, ++ ++ 0x90,0x42,0x33,0xE0,0x90,0x44,0xCE,0xF0, ++ ++ 0x90,0xFD,0xA5,0x74,0x01,0xF0,0x90,0x43, ++ ++ 0xBC,0xF0,0x7F,0x08,0x12,0xAE,0x43,0x7F, ++ ++ 0x01,0x12,0x80,0x20,0x90,0x42,0x33,0xE0, ++ ++ 0xFF,0x90,0x44,0xCE,0xE0,0xC3,0x9F,0x40, ++ ++ 0x0B,0x90,0xFD,0xA5,0xE4,0xF0,0x90,0x43, ++ ++ 0xBC,0xF0,0x80,0x0A,0x90,0xFD,0xA5,0x74, ++ ++ 0x01,0xF0,0x90,0x43,0xBC,0xF0,0xE4,0x90, ++ ++ 0x43,0xD0,0xF0,0x90,0xF7,0x8B,0x04,0xF0, ++ ++ 0xD2,0xEB,0x12,0xA5,0x15,0x90,0xF7,0x31, ++ ++ 0xE0,0x60,0x05,0x7F,0x01,0x12,0xA3,0xFB, ++ ++ 0xE4,0x90,0x43,0xC7,0xF0,0x90,0x42,0xFD, ++ ++ 0x04,0xF0,0x12,0xAF,0x36,0x90,0xF2,0x1B, ++ ++ 0x74,0x0B,0xF0,0x22,0x90,0x42,0x5C,0xE0, ++ ++ 0x70,0x1A,0xA3,0xE0,0x64,0x0C,0x60,0x05, ++ ++ 0xE0,0x64,0x0D,0x70,0x22,0x90,0xF5,0x68, ++ ++ 0xE0,0xB4,0x0A,0x1B,0x90,0x42,0x5C,0x74, ++ ++ 0x01,0xF0,0x80,0x13,0x90,0x42,0x5D,0xE0, ++ ++ 0xB4,0x0C,0x0C,0x90,0xF5,0x69,0xE0,0xB4, ++ ++ 0x05,0x05,0xE4,0x90,0x42,0x5C,0xF0,0x90, ++ ++ 0x42,0x5C,0xE0,0xB4,0x01,0x19,0xA3,0xE0, ++ ++ 0xB4,0x0C,0x14,0x90,0xF5,0xC1,0xE0,0xB4, ++ ++ 0x01,0x0D,0x90,0x42,0x5D,0x74,0x03,0xF0, ++ ++ 0x90,0xF5,0x66,0xF0,0x02,0x75,0x99,0x90, ++ ++ 0x42,0x5C,0xE0,0xB4,0x01,0x0F,0xA3,0xE0, ++ ++ 0xB4,0x0D,0x0A,0x74,0x03,0xF0,0x90,0xF5, ++ ++ 0x66,0xF0,0x02,0x75,0x99,0x90,0x42,0x5C, ++ ++ 0xE0,0x70,0x15,0xA3,0xE0,0xB4,0x0C,0x10, ++ ++ 0x90,0xF5,0xC1,0xE0,0xB4,0x01,0x09,0x90, ++ ++ 0xF5,0x66,0x74,0x0C,0xF0,0x02,0x75,0x99, ++ ++ 0x90,0x42,0x5C,0xE0,0x70,0x16,0xA3,0xE0, ++ ++ 0xB4,0x0C,0x11,0x90,0xF5,0x69,0xE0,0xC3, ++ ++ 0x94,0x05,0x50,0x08,0x90,0xF5,0x66,0x74, ++ ++ 0x0C,0xF0,0x80,0x64,0x90,0x42,0x5C,0xE0, ++ ++ 0x64,0x01,0x70,0x1C,0xA3,0xE0,0xB4,0x0C, ++ ++ 0x17,0x90,0xF5,0xC1,0xE0,0x70,0x11,0x90, ++ ++ 0xF5,0x68,0xE0,0xC3,0x94,0x0A,0x50,0x08, ++ ++ 0x90,0xF5,0x66,0x74,0x0C,0xF0,0x80,0x40, ++ ++ 0x90,0x42,0x5C,0xE0,0x64,0x01,0x70,0x1E, ++ ++ 0xA3,0xE0,0xB4,0x0C,0x19,0x90,0xF5,0xC1, ++ ++ 0xE0,0x70,0x13,0x90,0xF5,0x68,0xE0,0xB4, ++ ++ 0x0A,0x0C,0x90,0x42,0x5D,0x74,0x03,0xF0, ++ ++ 0x90,0xF5,0x66,0xF0,0x80,0x1A,0x90,0x42, ++ ++ 0x5D,0xE0,0xB4,0x0D,0x08,0x90,0xF5,0x66, ++ ++ 0x74,0x0D,0xF0,0x80,0x0B,0x90,0x42,0x5D, ++ ++ 0xE0,0x04,0xF0,0xE0,0x90,0xF5,0x66,0xF0, ++ ++ 0x90,0x42,0x5D,0xE0,0x25,0xE0,0x24,0xA3, ++ ++ 0xF5,0x82,0xE4,0x34,0x42,0xF5,0x83,0xE0, ++ ++ 0xA3,0xE0,0x90,0xF5,0x5B,0xF0,0x90,0x42, ++ ++ 0x5D,0xE0,0x25,0xE0,0x24,0xBF,0xF5,0x82, ++ ++ 0xE4,0x34,0x42,0xF5,0x83,0xE0,0xA3,0xE0, ++ ++ 0x90,0xF5,0x5C,0xF0,0x90,0x42,0x5D,0xE0, ++ ++ 0x25,0xE0,0x24,0xDB,0xF5,0x82,0xE4,0x34, ++ ++ 0x42,0xF5,0x83,0xE0,0xA3,0xE0,0x90,0xF5, ++ ++ 0x5D,0xF0,0xA3,0xE4,0xF0,0x22,0x74,0xFF, ++ ++ 0x90,0x44,0xB9,0xF0,0xA3,0xF0,0x90,0x43, ++ ++ 0xE2,0xE0,0xFE,0xA3,0xE0,0xFF,0xC3,0x90, ++ ++ 0x43,0xE5,0xE0,0x9F,0xFF,0x90,0x43,0xE4, ++ ++ 0xE0,0x9E,0xFE,0x90,0x42,0x1D,0xE0,0xFD, ++ ++ 0x7C,0x00,0x12,0x4A,0x11,0x90,0x42,0x1C, ++ ++ 0xE0,0xFD,0xEF,0xA8,0x05,0x08,0x80,0x05, ++ ++ 0xCE,0xC3,0x13,0xCE,0x13,0xD8,0xF9,0xFF, ++ ++ 0x90,0x42,0x1E,0xE0,0x2F,0x90,0x44,0xB7, ++ ++ 0xF0,0x90,0x43,0xE1,0xE0,0x70,0x34,0x90, ++ ++ 0x43,0xE4,0xE0,0xFF,0xA3,0xE0,0x90,0x43, ++ ++ 0xF3,0xCF,0xF0,0xA3,0xEF,0xF0,0x90,0x43, ++ ++ 0xE2,0xE0,0xFF,0xA3,0xE0,0x90,0x43,0xF1, ++ ++ 0xCF,0xF0,0xA3,0xEF,0xF0,0x12,0x6E,0xC5, ++ ++ 0x90,0x43,0xF5,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0xE4,0xFC,0xFD,0x90,0x43,0xEA,0x12,0x4B, ++ ++ 0x6C,0x80,0x3F,0x90,0x43,0xE1,0xE0,0xB4, ++ ++ 0x01,0x16,0x12,0x6E,0xC5,0x90,0x43,0xF5, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xE4,0xFC,0xFD, ++ ++ 0x90,0x43,0xEA,0x12,0x4B,0x6C,0x80,0x22, ++ ++ 0x90,0x43,0xE4,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0x90,0x43,0xE3,0xE0,0x2F,0xFF,0x90,0x43, ++ ++ 0xE2,0xE0,0x3E,0xC3,0x13,0xFE,0xEF,0x13, ++ ++ 0xFF,0xE4,0xFC,0xFD,0x90,0x43,0xEA,0x12, ++ ++ 0x4B,0x6C,0x12,0x86,0xAE,0x90,0x43,0xE3, ++ ++ 0xE0,0x24,0xB0,0xF0,0x90,0x43,0xE2,0xE0, ++ ++ 0x34,0x02,0xF0,0x90,0x43,0xE5,0xE0,0x24, ++ ++ 0xB0,0xF0,0x90,0x43,0xE4,0xE0,0x34,0x02, ++ ++ 0xF0,0x90,0x43,0xE1,0xE0,0xFF,0x70,0x20, ++ ++ 0x90,0x44,0xB7,0xE0,0xA3,0xF0,0x90,0xF1, ++ ++ 0x09,0xF0,0x90,0x43,0xE9,0xE0,0x90,0xF1, ++ ++ 0x0E,0xF0,0x90,0x43,0xE8,0xE0,0x90,0xF1, ++ ++ 0x0F,0xF0,0xA3,0x74,0x01,0xF0,0x80,0x34, ++ ++ 0xEF,0x64,0x01,0x70,0x2F,0x90,0x43,0xEE, ++ ++ 0xE0,0x70,0x0A,0x90,0x44,0xB7,0xE0,0x90, ++ ++ 0xF1,0x0B,0xF0,0x80,0x0B,0x90,0x44,0xB8, ++ ++ 0xE0,0xFF,0xC3,0x13,0x90,0xF1,0x0B,0xF0, ++ ++ 0x90,0x43,0xE9,0xE0,0x90,0xF1,0x12,0xF0, ++ ++ 0x90,0x43,0xE8,0xE0,0x90,0xF1,0x13,0xF0, ++ ++ 0xA3,0x74,0x01,0xF0,0x90,0x43,0xE1,0xE0, ++ ++ 0x04,0xF0,0x22,0x90,0x42,0x59,0xE0,0x70, ++ ++ 0x1A,0xA3,0xE0,0x64,0x0C,0x60,0x05,0xE0, ++ ++ 0x64,0x0D,0x70,0x22,0x90,0xF4,0x1B,0xE0, ++ ++ 0xB4,0x0A,0x1B,0x90,0x42,0x59,0x74,0x01, ++ ++ 0xF0,0x80,0x13,0x90,0x42,0x5A,0xE0,0xB4, ++ ++ 0x0C,0x0C,0x90,0xF4,0x1C,0xE0,0xB4,0x0A, ++ ++ 0x05,0xE4,0x90,0x42,0x59,0xF0,0x90,0x42, ++ ++ 0x59,0xE0,0xB4,0x01,0x19,0xA3,0xE0,0xB4, ++ ++ 0x0C,0x14,0x90,0xF5,0xBA,0xE0,0xB4,0x01, ++ ++ 0x0D,0x90,0x42,0x5A,0x74,0x03,0xF0,0x90, ++ ++ 0xF4,0x19,0xF0,0x02,0x78,0x20,0x90,0x42, ++ ++ 0x59,0xE0,0xB4,0x01,0x0F,0xA3,0xE0,0xB4, ++ ++ 0x0D,0x0A,0x74,0x03,0xF0,0x90,0xF4,0x19, ++ ++ 0xF0,0x02,0x78,0x20,0x90,0x42,0x59,0xE0, ++ ++ 0x70,0x15,0xA3,0xE0,0xB4,0x0C,0x10,0x90, ++ ++ 0xF5,0xBA,0xE0,0xB4,0x01,0x09,0x90,0xF4, ++ ++ 0x19,0x74,0x0C,0xF0,0x02,0x78,0x20,0x90, ++ ++ 0x42,0x59,0xE0,0x70,0x16,0xA3,0xE0,0xB4, ++ ++ 0x0C,0x11,0x90,0xF4,0x1C,0xE0,0xC3,0x94, ++ ++ 0x0A,0x50,0x08,0x90,0xF4,0x19,0x74,0x0C, ++ ++ 0xF0,0x80,0x64,0x90,0x42,0x59,0xE0,0x64, ++ ++ 0x01,0x70,0x1C,0xA3,0xE0,0xB4,0x0C,0x17, ++ ++ 0x90,0xF5,0xBA,0xE0,0x70,0x11,0x90,0xF4, ++ ++ 0x1B,0xE0,0xC3,0x94,0x0A,0x50,0x08,0x90, ++ ++ 0xF4,0x19,0x74,0x0C,0xF0,0x80,0x40,0x90, ++ ++ 0x42,0x59,0xE0,0x64,0x01,0x70,0x1E,0xA3, ++ ++ 0xE0,0xB4,0x0C,0x19,0x90,0xF5,0xBA,0xE0, ++ ++ 0x70,0x13,0x90,0xF4,0x1B,0xE0,0xB4,0x0A, ++ ++ 0x0C,0x90,0x42,0x5A,0x74,0x03,0xF0,0x90, ++ ++ 0xF4,0x19,0xF0,0x80,0x1A,0x90,0x42,0x5A, ++ ++ 0xE0,0xB4,0x0D,0x08,0x90,0xF4,0x19,0x74, ++ ++ 0x0D,0xF0,0x80,0x0B,0x90,0x42,0x5A,0xE0, ++ ++ 0x04,0xF0,0xE0,0x90,0xF4,0x19,0xF0,0x90, ++ ++ 0x42,0x5A,0xE0,0x24,0x79,0xF5,0x82,0xE4, ++ ++ 0x34,0x42,0xF5,0x83,0xE0,0x90,0xF4,0x08, ++ ++ 0xF0,0x90,0x42,0x5A,0xE0,0x24,0x87,0xF5, ++ ++ 0x82,0xE4,0x34,0x42,0xF5,0x83,0xE0,0x90, ++ ++ 0xF4,0x09,0xF0,0x90,0x42,0x5A,0xE0,0x24, ++ ++ 0x95,0xF5,0x82,0xE4,0x34,0x42,0xF5,0x83, ++ ++ 0xE0,0x90,0xF4,0x0A,0xF0,0x22,0x90,0x42, ++ ++ 0x34,0xE0,0x70,0x03,0x02,0x79,0x89,0x90, ++ ++ 0xF0,0x2B,0xE0,0x70,0x16,0x90,0xF5,0x3E, ++ ++ 0xE0,0xD3,0x94,0x20,0x40,0x0D,0x90,0xF2, ++ ++ 0x17,0x74,0xFE,0xF0,0x90,0xF7,0x87,0x74, ++ ++ 0x01,0xF0,0x22,0x90,0xF7,0x32,0xE0,0x64, ++ ++ 0x01,0x70,0x2D,0x90,0x42,0x33,0xE0,0xFE, ++ ++ 0x90,0x44,0x9F,0xE0,0xFD,0xD3,0x9E,0x40, ++ ++ 0x05,0xED,0x9E,0xFF,0x80,0x0C,0x90,0x44, ++ ++ 0x9F,0xE0,0xFE,0x90,0x42,0x33,0xE0,0xC3, ++ ++ 0x9E,0xFF,0xEF,0xC3,0x94,0x0A,0x50,0x08, ++ ++ 0x90,0x44,0x9F,0xE0,0x90,0x42,0x33,0xF0, ++ ++ 0x90,0x42,0x33,0xE0,0xFE,0xC3,0x94,0x23, ++ ++ 0x50,0x07,0x90,0xF2,0x17,0x74,0xFE,0xF0, ++ ++ 0x22,0xEE,0xC3,0x94,0x28,0x50,0x13,0x90, ++ ++ 0xF2,0x17,0xE0,0xB4,0xFE,0x05,0xE0,0x64, ++ ++ 0xA6,0x60,0x07,0x90,0xF2,0x17,0x74,0xFE, ++ ++ 0xF0,0x22,0x90,0x42,0x33,0xE0,0xC3,0x94, ++ ++ 0x2D,0x50,0x13,0x90,0xF2,0x17,0xE0,0xB4, ++ ++ 0xFE,0x05,0xE0,0x64,0xA6,0x60,0x07,0x90, ++ ++ 0xF2,0x17,0x74,0xA6,0xF0,0x22,0x90,0x42, ++ ++ 0x33,0xE0,0xFE,0xC3,0x94,0x37,0x50,0x07, ++ ++ 0x90,0xF2,0x17,0x74,0xA6,0xF0,0x22,0xEE, ++ ++ 0xC3,0x94,0x3C,0x50,0x13,0x90,0xF2,0x17, ++ ++ 0xE0,0xB4,0xA6,0x05,0xE0,0x64,0x26,0x60, ++ ++ 0x07,0x90,0xF2,0x17,0x74,0xA6,0xF0,0x22, ++ ++ 0x90,0x42,0x33,0xE0,0xC3,0x94,0x41,0x50, ++ ++ 0x13,0x90,0xF2,0x17,0xE0,0xB4,0xA6,0x05, ++ ++ 0xE0,0x64,0x26,0x60,0x07,0x90,0xF2,0x17, ++ ++ 0x74,0x26,0xF0,0x22,0x90,0x42,0x33,0xE0, ++ ++ 0xFE,0xC3,0x94,0x4B,0x50,0x07,0x90,0xF2, ++ ++ 0x17,0x74,0x26,0xF0,0x22,0xEE,0xC3,0x94, ++ ++ 0x50,0x50,0x13,0x90,0xF2,0x17,0xE0,0xB4, ++ ++ 0x26,0x05,0xE0,0x64,0x25,0x60,0x07,0x90, ++ ++ 0xF2,0x17,0x74,0x26,0xF0,0x22,0x90,0x42, ++ ++ 0x33,0xE0,0xC3,0x94,0x55,0x50,0x13,0x90, ++ ++ 0xF2,0x17,0xE0,0xB4,0x26,0x05,0xE0,0x64, ++ ++ 0x25,0x60,0x07,0x90,0xF2,0x17,0x74,0x25, ++ ++ 0xF0,0x22,0x90,0xF2,0x17,0x74,0x25,0xF0, ++ ++ 0x22,0x90,0xF6,0x08,0xE0,0x90,0x44,0xA3, ++ ++ 0xF0,0x90,0xFD,0x29,0xE0,0x90,0x44,0xA4, ++ ++ 0xF0,0xE4,0xA3,0xF0,0x90,0x41,0xD5,0xE0, ++ ++ 0x70,0x05,0x90,0x43,0xC7,0xF0,0x22,0x90, ++ ++ 0xF5,0x4C,0xE0,0xFF,0x90,0xF5,0x41,0xE0, ++ ++ 0x4F,0x70,0x03,0x02,0x7A,0xB2,0x90,0x44, ++ ++ 0x62,0x74,0x02,0xF0,0xA3,0x74,0x39,0xF0, ++ ++ 0xE4,0xFB,0xFA,0xFD,0xFF,0x12,0x7C,0xF8, ++ ++ 0x90,0x44,0xA2,0xEF,0xF0,0xD3,0x94,0x32, ++ ++ 0x40,0x04,0xE0,0xFF,0x80,0x02,0x7F,0xFF, ++ ++ 0x90,0x44,0xA2,0xEF,0xF0,0xFD,0x90,0x44, ++ ++ 0x62,0xE4,0xF0,0xA3,0x74,0x32,0xF0,0xE4, ++ ++ 0xFB,0xFA,0x7F,0x01,0x12,0x7C,0xF8,0x90, ++ ++ 0x44,0xA1,0xEF,0xF0,0xD3,0x94,0x0A,0x40, ++ ++ 0x58,0x90,0xF1,0x14,0xE0,0x70,0x1E,0x04, ++ ++ 0xF0,0x90,0x43,0xDC,0xE0,0x90,0xF1,0x12, ++ ++ 0xF0,0x90,0x43,0xDB,0xE0,0x90,0xF1,0x13, ++ ++ 0xF0,0x90,0xF1,0x0B,0xE4,0xF0,0x90,0xF1, ++ ++ 0x0A,0x04,0xF0,0x80,0x34,0x90,0xF1,0x10, ++ ++ 0xE0,0x70,0x2E,0x90,0x43,0xDC,0xE0,0xFF, ++ ++ 0x90,0xF1,0x12,0xE0,0x6F,0x60,0x22,0x90, ++ ++ 0x43,0xDB,0xE0,0xFE,0x90,0xF1,0x13,0xE0, ++ ++ 0x6E,0x60,0x16,0x90,0xF1,0x10,0x74,0x01, ++ ++ 0xF0,0x90,0xF1,0x0E,0xEF,0xF0,0xA3,0xEE, ++ ++ 0xF0,0x90,0xF1,0x09,0xE4,0xF0,0xA3,0x04, ++ ++ 0xF0,0x90,0x44,0xA2,0xE0,0xFD,0x90,0x44, ++ ++ 0x62,0x74,0x02,0xF0,0xA3,0x74,0x39,0xF0, ++ ++ 0x7B,0xF4,0x7A,0x01,0x7F,0x01,0x12,0x7C, ++ ++ 0xF8,0x90,0x44,0xA1,0xEF,0xF0,0xD3,0x94, ++ ++ 0x19,0x40,0x3E,0x90,0xF1,0x14,0xE0,0x70, ++ ++ 0x38,0x04,0xF0,0x90,0x43,0xDA,0xE0,0x90, ++ ++ 0xF1,0x12,0xF0,0x90,0x43,0xD9,0xE0,0x90, ++ ++ 0xF1,0x13,0xF0,0x90,0xF1,0x0B,0x74,0x15, ++ ++ 0xF0,0x90,0xF1,0x10,0x74,0x01,0xF0,0x90, ++ ++ 0x43,0xD8,0xE0,0x90,0xF1,0x0E,0xF0,0x90, ++ ++ 0x43,0xD7,0xE0,0x90,0xF1,0x0F,0xF0,0x90, ++ ++ 0xF1,0x09,0x74,0x10,0xF0,0xA3,0x74,0x01, ++ ++ 0xF0,0x22,0x7E,0x41,0x7F,0x91,0xD3,0xEF, ++ ++ 0x94,0x56,0xEE,0x94,0x42,0x50,0x0D,0x8F, ++ ++ 0x82,0x8E,0x83,0xE4,0xF0,0x0F,0xBF,0x00, ++ ++ 0x01,0x0E,0x80,0xEA,0x12,0xAA,0xC8,0x12, ++ ++ 0xAA,0xF5,0x90,0x41,0x8B,0x74,0x41,0xF0, ++ ++ 0xA3,0x74,0x91,0xF0,0xE4,0x90,0x43,0xBE, ++ ++ 0xF0,0xD2,0xAF,0xD2,0xA8,0xC2,0xDB,0xD2, ++ ++ 0xEC,0xF5,0x13,0xF5,0x14,0x90,0x43,0xCE, ++ ++ 0xF0,0xA3,0xF0,0x90,0x43,0xB8,0xF0,0x90, ++ ++ 0x41,0xD2,0x04,0xF0,0x90,0x42,0x0F,0x74, ++ ++ 0x04,0xF0,0x90,0x42,0x12,0x74,0x0A,0xF0, ++ ++ 0x90,0x41,0xE0,0x74,0x03,0xF0,0xE4,0x90, ++ ++ 0x41,0xE1,0xF0,0xF5,0xF8,0x75,0xB8,0x12, ++ ++ 0xD2,0x88,0xD2,0xEB,0x90,0x43,0xB6,0xF0, ++ ++ 0x90,0x41,0xD1,0xF0,0x90,0x43,0xBD,0x04, ++ ++ 0xF0,0xE4,0x90,0x41,0xE7,0xF0,0x90,0x41, ++ ++ 0xE6,0x04,0xF0,0x90,0x41,0xEB,0xF0,0x90, ++ ++ 0x41,0xEC,0x04,0xF0,0xE4,0x90,0x41,0xED, ++ ++ 0xF0,0x90,0x41,0xEE,0xF0,0x90,0x42,0x0E, ++ ++ 0x04,0xF0,0x90,0x41,0xCB,0x74,0x10,0xF0, ++ ++ 0x90,0x41,0xCC,0x74,0x27,0xF0,0x90,0x41, ++ ++ 0xF6,0x74,0x50,0xF0,0x90,0x41,0xCA,0x74, ++ ++ 0x01,0xF0,0x90,0x42,0x20,0x74,0x20,0xF0, ++ ++ 0x90,0x42,0x21,0x74,0x2C,0xF0,0x90,0x42, ++ ++ 0x22,0x74,0x01,0xF0,0x90,0x42,0x1C,0x74, ++ ++ 0x07,0xF0,0x90,0x42,0x1D,0xF0,0x90,0x42, ++ ++ 0x1E,0x14,0xF0,0xE4,0x90,0x43,0xE1,0xF0, ++ ++ 0x90,0xF6,0x2E,0x74,0x64,0xF0,0xE4,0x90, ++ ++ 0x42,0x3F,0xF0,0x90,0x41,0xDC,0x04,0xF0, ++ ++ 0x90,0x44,0x37,0x12,0x4B,0x78,0x00,0x00, ++ ++ 0x00,0x00,0xE4,0x90,0x41,0xF3,0xF0,0x90, ++ ++ 0x41,0xF4,0xF0,0x90,0x41,0xF5,0xF0,0x90, ++ ++ 0x41,0xC0,0x04,0xF0,0x90,0x41,0xC8,0x74, ++ ++ 0x10,0xF0,0x90,0x41,0xC9,0x74,0x27,0xF0, ++ ++ 0xE4,0x90,0x41,0xD9,0xF0,0x90,0x41,0xDA, ++ ++ 0xF0,0x90,0x41,0xDB,0xF0,0x90,0x43,0xC8, ++ ++ 0xF0,0x90,0x43,0x90,0xF0,0x90,0x41,0xE3, ++ ++ 0xF0,0x22,0x90,0xF4,0xC1,0xE0,0x14,0x60, ++ ++ 0x46,0x14,0x60,0x7C,0x24,0x02,0x60,0x03, ++ ++ 0x02,0x7C,0x97,0x90,0xFD,0x19,0x74,0xCA, ++ ++ 0xF0,0xA3,0x74,0x08,0xF0,0xA3,0x74,0x4A, ++ ++ 0xF0,0xA3,0x74,0x0A,0xF0,0xA3,0x74,0xCA, ++ ++ 0xF0,0xA3,0x74,0x0C,0xF0,0xA3,0x74,0x4A, ++ ++ 0xF0,0xA3,0x74,0x10,0xF0,0xA3,0x74,0xCA, ++ ++ 0xF0,0xA3,0x74,0x14,0xF0,0xA3,0x74,0x4A, ++ ++ 0xF0,0xA3,0x74,0x1A,0xF0,0xA3,0x74,0xCA, ++ ++ 0xF0,0xA3,0x74,0x20,0xF0,0x80,0x6F,0x90, ++ ++ 0xFD,0x19,0x74,0x80,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0xF0,0xA3,0x74,0x02,0xF0,0xA3,0x74, ++ ++ 0x20,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74, ++ ++ 0xE8,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74, ++ ++ 0xB0,0xF0,0xA3,0x74,0x04,0xF0,0xA3,0x74, ++ ++ 0xDC,0xF0,0xA3,0x74,0x05,0xF0,0xA3,0x74, ++ ++ 0x34,0xF0,0xA3,0x74,0x08,0xF0,0x80,0x36, ++ ++ 0x90,0xFD,0x19,0x74,0x7D,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0x74,0xB4,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0xC8,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0xFA,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x2C,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0x52,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74, ++ ++ 0x34,0xF0,0xA3,0x74,0x08,0xF0,0xE4,0xFD, ++ ++ 0xED,0x75,0xF0,0x02,0xA4,0x24,0x19,0xFF, ++ ++ 0xE5,0xF0,0x34,0xFD,0xFE,0x8F,0x82,0xF5, ++ ++ 0x83,0xE0,0xF9,0xA3,0xE0,0xFC,0x90,0xF9, ++ ++ 0x00,0xE0,0x70,0x18,0xEC,0x54,0x0F,0xFB, ++ ++ 0xC4,0x54,0xF0,0xFB,0xE9,0xC4,0x54,0x0F, ++ ++ 0x4B,0x8F,0x82,0x8E,0x83,0xF0,0xEC,0xC4, ++ ++ 0x54,0x0F,0xA3,0xF0,0x90,0xF9,0x00,0xE0, ++ ++ 0x64,0x02,0x70,0x1D,0xEC,0x54,0x0F,0xFB, ++ ++ 0x25,0xE0,0x25,0xE0,0xFB,0xAA,0x01,0xEA, ++ ++ 0x13,0x13,0x54,0x3F,0x4B,0x8F,0x82,0x8E, ++ ++ 0x83,0xF0,0xEC,0x13,0x13,0x54,0x3F,0xA3, ++ ++ 0xF0,0x0D,0xED,0xB4,0x07,0xA2,0x22,0x90, ++ ++ 0x44,0x5E,0xEF,0xF0,0xA3,0xED,0xF0,0xE4, ++ ++ 0x90,0x44,0x66,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0xAF,0x03,0x90,0x44,0x64,0xEA, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x90,0x44,0x62,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0xA3,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xC3,0x9F,0xEC,0x9E,0x40,0x03, ++ ++ 0x02,0x7D,0xC4,0x90,0xF9,0x00,0xE0,0xB4, ++ ++ 0x02,0x0F,0x90,0x44,0x65,0xE0,0x25,0xE0, ++ ++ 0xFD,0x90,0x44,0x64,0xE0,0x33,0xFC,0x80, ++ ++ 0x1A,0x90,0xF9,0x00,0xE0,0xB4,0x01,0x13, ++ ++ 0x90,0x44,0x64,0xE0,0xFE,0xA3,0xE0,0x78, ++ ++ 0x02,0xC3,0x33,0xCE,0x33,0xCE,0xD8,0xF9, ++ ++ 0xFD,0xAC,0x06,0xED,0x90,0xF5,0x50,0xF0, ++ ++ 0xEC,0xA3,0xF0,0x90,0xF6,0x5B,0x74,0x01, ++ ++ 0xF0,0x7F,0x55,0x7E,0x0D,0x12,0xAF,0x5E, ++ ++ 0x20,0x8C,0xFD,0x90,0xF6,0x5F,0xE0,0xFF, ++ ++ 0x13,0x13,0x54,0x3F,0xFF,0x90,0x44,0x67, ++ ++ 0xE0,0x2F,0xF0,0x90,0x44,0x66,0xE0,0x34, ++ ++ 0x00,0xF0,0x90,0xF6,0x5F,0xE0,0xFF,0x90, ++ ++ 0x44,0x69,0xE0,0xC3,0x9F,0x50,0x08,0x90, ++ ++ 0xF6,0x5F,0xE0,0x90,0x44,0x69,0xF0,0x90, ++ ++ 0x44,0x5F,0xE0,0xFF,0x90,0xF6,0x5F,0xE0, ++ ++ 0xD3,0x9F,0x40,0x06,0x90,0x44,0x68,0xE0, ++ ++ 0x04,0xF0,0x90,0x44,0x65,0xE0,0x04,0xF0, ++ ++ 0x70,0x06,0x90,0x44,0x64,0xE0,0x04,0xF0, ++ ++ 0x02,0x7D,0x15,0x90,0x44,0x66,0xE0,0xFE, ++ ++ 0xA3,0xE0,0x78,0x07,0xCE,0xC3,0x13,0xCE, ++ ++ 0x13,0xD8,0xF9,0xFF,0x90,0x44,0x69,0xE0, ++ ++ 0xFE,0x13,0x13,0x54,0x3F,0xFD,0xEF,0xD3, ++ ++ 0x9D,0x40,0x13,0xEF,0x94,0x80,0x40,0x05, ++ ++ 0x74,0xFF,0xF0,0x80,0x10,0xEF,0x25,0xE0, ++ ++ 0x90,0x44,0x69,0xF0,0x80,0x07,0xEE,0xC3, ++ ++ 0x13,0x90,0x44,0x69,0xF0,0x90,0x44,0x5E, ++ ++ 0xE0,0x70,0x06,0x90,0x44,0x69,0xE0,0xFF, ++ ++ 0x22,0x90,0x44,0x68,0xE0,0xFF,0x22,0x90, ++ ++ 0x44,0xB3,0x74,0x01,0xF0,0xA3,0x04,0xF0, ++ ++ 0xA3,0xF0,0x90,0x43,0x91,0xE0,0x60,0x0A, ++ ++ 0x90,0x42,0x53,0xE0,0x60,0x04,0x7F,0x00, ++ ++ 0x80,0x05,0x90,0x42,0x1F,0xE0,0xFF,0x90, ++ ++ 0x44,0xB6,0xEF,0xF0,0x90,0x43,0xE0,0xE0, ++ ++ 0x14,0x70,0x03,0x02,0x7E,0xCC,0x04,0x60, ++ ++ 0x03,0x02,0x7E,0xFE,0x90,0x44,0xB6,0xE0, ++ ++ 0x60,0x09,0xE4,0xFD,0x7F,0x02,0x12,0xAF, ++ ++ 0x75,0x80,0x35,0x90,0x41,0xD1,0xE0,0xB4, ++ ++ 0x01,0x23,0x90,0xF9,0x01,0xE0,0x90,0x44, ++ ++ 0xB5,0xF0,0x90,0xF9,0x00,0xE0,0xFF,0x90, ++ ++ 0x44,0xB3,0xF0,0x60,0x0B,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0xE0,0x24,0x02,0xF0,0x80,0x05, ++ ++ 0xE4,0x90,0x44,0xB4,0xF0,0x90,0x44,0xB4, ++ ++ 0xE0,0xFF,0xA3,0xE0,0xFD,0x12,0xAF,0x75, ++ ++ 0x90,0xF4,0x63,0xE4,0xF0,0x90,0xF4,0x69, ++ ++ 0x74,0xFB,0xF0,0xA3,0xE4,0xF0,0x90,0xF4, ++ ++ 0x6D,0x74,0x05,0xF0,0x7F,0x01,0x12,0xAD, ++ ++ 0x78,0x12,0x9C,0x33,0x90,0x44,0xB6,0xE0, ++ ++ 0xFF,0x60,0x08,0x90,0xF9,0x00,0x74,0x01, ++ ++ 0xF0,0x80,0x08,0x90,0x44,0xB3,0xE0,0x90, ++ ++ 0xF9,0x00,0xF0,0x90,0xF5,0xC2,0x74,0x01, ++ ++ 0xF0,0xE4,0xF0,0xEF,0x60,0x05,0x12,0x54, ++ ++ 0x2E,0x80,0x32,0x90,0xF1,0x57,0xE0,0x60, ++ ++ 0x08,0x90,0xF1,0x49,0x74,0x01,0xF0,0xE4, ++ ++ 0xF0,0x7D,0xFF,0x7C,0x7F,0xE4,0xFF,0x12, ++ ++ 0xAB,0xED,0x90,0xF1,0x82,0xE0,0x70,0x15, ++ ++ 0x90,0xF1,0x57,0xE0,0x60,0x0F,0x90,0x44, ++ ++ 0xAA,0xE0,0xB4,0x01,0x08,0x90,0xF1,0x7C, ++ ++ 0xE0,0x60,0xE7,0x80,0xE5,0xE4,0x90,0x42, ++ ++ 0x60,0xF0,0x90,0xF1,0xB5,0xE0,0x90,0x42, ++ ++ 0x61,0xF0,0x90,0xF1,0xB4,0xE0,0x90,0x42, ++ ++ 0x62,0xF0,0x90,0xF1,0xB3,0xE0,0x90,0x42, ++ ++ 0x63,0xF0,0x22,0x90,0xF5,0xC8,0xE4,0xF0, ++ ++ 0x90,0xF5,0x75,0xF0,0x90,0xF5,0x74,0xF0, ++ ++ 0x90,0xF1,0xD0,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF5,0x6E,0x74,0x0A,0xF0,0x90,0xF5, ++ ++ 0x71,0x74,0x02,0xF0,0xA3,0x74,0x27,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x90,0x42,0x3F,0xE0,0x64, ++ ++ 0x01,0x60,0x03,0x02,0x7F,0xD4,0x90,0xF5, ++ ++ 0xF7,0xE0,0xFE,0x90,0xF5,0xF6,0xE0,0x7C, ++ ++ 0x00,0x24,0x00,0xFF,0xEC,0x3E,0xFE,0xEF, ++ ++ 0x78,0x06,0xCE,0xC3,0x13,0xCE,0x13,0xD8, ++ ++ 0xF9,0x90,0x44,0xCB,0xF0,0x90,0xF9,0x00, ++ ++ 0xE0,0xB4,0x01,0x0C,0x90,0x44,0xCB,0xE0, ++ ++ 0xFF,0x13,0x13,0x54,0x3F,0xF0,0x80,0x0F, ++ ++ 0x90,0xF9,0x00,0xE0,0xB4,0x02,0x08,0x90, ++ ++ 0x44,0xCB,0xE0,0xFF,0xC3,0x13,0xF0,0x90, ++ ++ 0x44,0xCB,0xE0,0xFF,0xC3,0x94,0x04,0x40, ++ ++ 0x05,0x74,0x03,0xF0,0x80,0x21,0xEF,0xC3, ++ ++ 0x94,0x02,0x40,0x08,0x90,0x44,0xCB,0x74, ++ ++ 0x02,0xF0,0x80,0x13,0xEF,0xC3,0x94,0x01, ++ ++ 0x40,0x08,0x90,0x44,0xCB,0x74,0x01,0xF0, ++ ++ 0x80,0x05,0xE4,0x90,0x44,0xCB,0xF0,0x90, ++ ++ 0x44,0xCB,0xE0,0xFF,0x90,0xF9,0x01,0xE0, ++ ++ 0xC3,0x9F,0x50,0x0F,0xE0,0x90,0x44,0xCB, ++ ++ 0xF0,0x80,0x08,0x90,0xF9,0x01,0xE0,0x90, ++ ++ 0x44,0xCB,0xF0,0x90,0x44,0xCB,0xE0,0x14, ++ ++ 0x60,0x0F,0x14,0x60,0x11,0x14,0x60,0x13, ++ ++ 0x24,0x03,0x70,0x12,0x12,0x92,0x9B,0x80, ++ ++ 0x0D,0x12,0x94,0xB7,0x80,0x08,0x12,0x90, ++ ++ 0x6C,0x80,0x03,0x12,0x94,0x05,0x90,0xF9, ++ ++ 0x01,0xE0,0x14,0x60,0x0E,0x14,0x60,0x0F, ++ ++ 0x14,0x60,0x10,0x24,0x03,0x70,0x0F,0x12, ++ ++ 0x9E,0x25,0x22,0x12,0x9E,0x8D,0x22,0x12, ++ ++ 0xA0,0x27,0x22,0x12,0xA0,0x8B,0x22,0xAA, ++ ++ 0x07,0xEA,0x70,0x10,0x90,0xF7,0x86,0x04, ++ ++ 0xF0,0xA3,0xF0,0xE4,0x90,0x44,0x41,0xF0, ++ ++ 0x90,0x44,0x3F,0xF0,0xEA,0x64,0x01,0x70, ++ ++ 0x1D,0x90,0x44,0x3F,0x04,0xF0,0x90,0xF7, ++ ++ 0x86,0xF0,0xA3,0xF0,0x90,0xF7,0x86,0xE0, ++ ++ 0x70,0x06,0x90,0xF7,0x32,0xE0,0x70,0xF4, ++ ++ 0x90,0xF7,0x87,0xE0,0x60,0xEE,0x90,0xF7, ++ ++ 0x86,0xE0,0x70,0x09,0x90,0xF7,0x31,0xE0, ++ ++ 0x70,0x03,0x02,0x81,0x1A,0x90,0x44,0x3B, ++ ++ 0xE0,0xC3,0x94,0x01,0x50,0x03,0x02,0x81, ++ ++ 0x1A,0x90,0xF7,0x87,0xE0,0x70,0x03,0x02, ++ ++ 0x81,0x1A,0x90,0xF9,0x00,0xE0,0x70,0x04, ++ ++ 0x7B,0x04,0x80,0x0D,0x90,0xF9,0x00,0xE0, ++ ++ 0xB4,0x01,0x04,0x7B,0x06,0x80,0x02,0x7B, ++ ++ 0x05,0x90,0xF9,0x03,0xE0,0xFF,0xC3,0xEB, ++ ++ 0x9F,0xFB,0x90,0xF7,0x92,0xE0,0x90,0x41, ++ ++ 0xBD,0xF0,0x90,0xF7,0x93,0xE0,0x90,0x41, ++ ++ 0xBE,0xF0,0x90,0xF7,0x94,0xE0,0x90,0x41, ++ ++ 0xBF,0xF0,0x90,0xF7,0x8B,0xE0,0x90,0x41, ++ ++ 0xC0,0xF0,0x90,0xF7,0x97,0xE0,0x90,0x44, ++ ++ 0x3C,0xF0,0x90,0xF7,0x96,0xE0,0x90,0x44, ++ ++ 0x3D,0xF0,0x90,0xF7,0x95,0xE0,0x90,0x44, ++ ++ 0x3E,0xF0,0x90,0x44,0x3C,0xE0,0x90,0x44, ++ ++ 0x42,0xF0,0x90,0x44,0x3D,0xE0,0x90,0x44, ++ ++ 0x43,0xF0,0xAF,0x03,0x12,0xA9,0xD9,0x90, ++ ++ 0x44,0x43,0xE0,0x90,0x42,0x33,0xF0,0x90, ++ ++ 0x41,0xBF,0xE0,0x90,0x44,0x42,0xF0,0x90, ++ ++ 0x41,0xBE,0xE0,0x90,0x44,0x43,0xF0,0xAF, ++ ++ 0x03,0x12,0xA9,0xD9,0x90,0x44,0x43,0xE0, ++ ++ 0x90,0x42,0x32,0xF0,0x90,0xF7,0x86,0x74, ++ ++ 0x01,0xF0,0xA3,0xF0,0xE4,0x90,0x44,0x41, ++ ++ 0xF0,0xEA,0xB4,0x01,0x05,0xE4,0x90,0x44, ++ ++ 0x3F,0xF0,0x22,0xAD,0x07,0x90,0x43,0x70, ++ ++ 0xE0,0x90,0xF5,0xDB,0xF0,0x90,0x43,0x6F, ++ ++ 0xE0,0xFF,0x33,0x95,0xE0,0x90,0xF5,0xDC, ++ ++ 0xEF,0xF0,0x90,0x43,0x65,0xE0,0x90,0xF5, ++ ++ 0xFA,0xF0,0x90,0xF5,0xE8,0xE4,0xF0,0x90, ++ ++ 0x43,0x4D,0xE0,0x90,0xF5,0xE1,0xF0,0x90, ++ ++ 0xF5,0xE8,0xE0,0xB4,0x01,0xF9,0x90,0xF5, ++ ++ 0xE8,0xE4,0xF0,0x90,0xF5,0xE1,0x74,0x0D, ++ ++ 0xF0,0x90,0xF5,0xE8,0xE0,0xB4,0x01,0xF9, ++ ++ 0x90,0x43,0x4D,0x74,0x0E,0xF0,0x90,0xF5, ++ ++ 0xDD,0xE0,0x90,0x44,0xBF,0xF0,0x90,0xF5, ++ ++ 0xDE,0xE0,0x90,0x44,0xBE,0xF0,0xE0,0xC3, ++ ++ 0x94,0x20,0x40,0x04,0xE0,0x24,0xC0,0xF0, ++ ++ 0xED,0xB4,0x01,0x1C,0x90,0x43,0x73,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0x90,0x44,0xBF,0xE0, ++ ++ 0x2F,0xFF,0x90,0x44,0xBE,0xE0,0x3E,0x90, ++ ++ 0x43,0x75,0xF0,0xA3,0xEF,0xF0,0x80,0x1F, ++ ++ 0x90,0x44,0xBE,0xE0,0xFF,0xA3,0xE0,0x90, ++ ++ 0x43,0x75,0xCF,0xF0,0xA3,0xEF,0xF0,0x90, ++ ++ 0xF5,0xFB,0xE0,0x90,0x43,0x74,0xF0,0x90, ++ ++ 0xF5,0xFC,0xE0,0x90,0x43,0x73,0xF0,0x90, ++ ++ 0x43,0x76,0xE0,0x90,0xF4,0x66,0xF0,0x90, ++ ++ 0x43,0x75,0xE0,0x90,0xF4,0x67,0xF0,0x90, ++ ++ 0xF6,0x08,0xE0,0xFF,0x13,0x13,0x13,0x54, ++ ++ 0x1F,0x90,0xFD,0xA1,0xF0,0x90,0xF5,0xFC, ++ ++ 0xE0,0xFE,0x90,0xF5,0xFB,0xE0,0x7C,0x00, ++ ++ 0x24,0x00,0xFF,0xEC,0x3E,0xAD,0x07,0xFC, ++ ++ 0x90,0xF5,0x3D,0xE0,0xFE,0x90,0xF5,0x3C, ++ ++ 0xE0,0x7A,0x00,0x24,0x00,0xFF,0xEA,0x3E, ++ ++ 0xFE,0xEF,0x2D,0xFD,0xEE,0x3C,0xFF,0x33, ++ ++ 0x95,0xE0,0xA3,0xEF,0xF0,0xAF,0x05,0xEF, ++ ++ 0x90,0xF5,0x3C,0xF0,0x22,0x90,0x42,0x37, ++ ++ 0xE0,0x70,0x03,0x02,0x83,0x10,0xE4,0x90, ++ ++ 0x44,0xD4,0xF0,0x90,0x44,0xD4,0xE0,0xF9, ++ ++ 0xC3,0x94,0x08,0x50,0x7E,0x90,0x42,0xFB, ++ ++ 0xE0,0x75,0xF0,0x05,0xA4,0x24,0x64,0xFB, ++ ++ 0xE4,0x35,0xF0,0xFA,0xE9,0xFF,0x7E,0x00, ++ ++ 0x7C,0x02,0x7D,0x58,0x12,0x4A,0x11,0xEF, ++ ++ 0x2B,0xFF,0xEE,0x3A,0xFE,0x90,0x43,0x21, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0x12,0x4A,0x23, ++ ++ 0xA3,0xEC,0xF0,0xA3,0xED,0xF0,0x12,0xAC, ++ ++ 0x5B,0x12,0xAD,0x5A,0x90,0x44,0xD4,0xE0, ++ ++ 0x70,0x03,0x12,0xA6,0x99,0x90,0x43,0x0A, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x78,0x04,0x12,0x4B,0x32, ++ ++ 0x90,0x43,0x06,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0x12, ++ ++ 0x4B,0x21,0x50,0x0E,0x90,0x42,0xFA,0xE0, ++ ++ 0x04,0xF0,0x70,0x06,0x90,0x42,0xF9,0xE0, ++ ++ 0x04,0xF0,0x90,0x44,0xD4,0xE0,0x04,0xF0, ++ ++ 0x02,0x82,0x2C,0x90,0x42,0xFB,0xE0,0x04, ++ ++ 0xF0,0xE0,0x64,0x64,0x70,0x51,0x90,0xF9, ++ ++ 0x00,0xE0,0x60,0x08,0x90,0x43,0x35,0x74, ++ ++ 0x28,0xF0,0x80,0x06,0x90,0x43,0x35,0x74, ++ ++ 0x3E,0xF0,0x90,0x42,0x2B,0x74,0x01,0xF0, ++ ++ 0x90,0x43,0x35,0xE0,0xFF,0xD3,0x90,0x42, ++ ++ 0xFA,0xE0,0x9F,0x90,0x42,0xF9,0xE0,0x94, ++ ++ 0x00,0x40,0x0B,0xE4,0x90,0x41,0xE4,0xF0, ++ ++ 0x90,0x41,0xE5,0xF0,0x80,0x0A,0x90,0x41, ++ ++ 0xE4,0x74,0x01,0xF0,0x90,0x41,0xE5,0xF0, ++ ++ 0x90,0x42,0xFC,0xE0,0x04,0xF0,0xE4,0x90, ++ ++ 0x42,0xF9,0xF0,0xA3,0xF0,0xA3,0xF0,0x12, ++ ++ 0xA7,0x80,0x22,0x90,0xF0,0x02,0xE0,0x90, ++ ++ 0x43,0x8C,0xF0,0x90,0xF0,0x03,0xE0,0x90, ++ ++ 0x43,0x8B,0xF0,0x90,0xF0,0x03,0xE0,0x60, ++ ++ 0x04,0x7F,0xFF,0x80,0x05,0x90,0xF0,0x02, ++ ++ 0xE0,0xFF,0x90,0x42,0x40,0xEF,0xF0,0x90, ++ ++ 0xF0,0x63,0xE0,0xFE,0x90,0xF0,0x62,0xE0, ++ ++ 0x7C,0x00,0x24,0x00,0xFF,0xEC,0x3E,0x90, ++ ++ 0x43,0x9A,0xF0,0xA3,0xEF,0xF0,0x90,0x43, ++ ++ 0xAA,0xE0,0xFB,0x7A,0x00,0x90,0x43,0x9B, ++ ++ 0xE0,0x2B,0xFE,0x90,0x43,0x9A,0xE0,0x3A, ++ ++ 0x90,0x43,0x96,0xF0,0xA3,0xCE,0xF0,0xC3, ++ ++ 0x90,0x43,0x9B,0xE0,0x9B,0xFE,0x90,0x43, ++ ++ 0x9A,0xE0,0x9A,0x90,0x43,0x98,0xF0,0xA3, ++ ++ 0xCE,0xF0,0x90,0x43,0x97,0xE0,0x25,0xE0, ++ ++ 0xFF,0x90,0x43,0x96,0xE0,0x33,0xFE,0xD3, ++ ++ 0x90,0x43,0x8C,0xE0,0x9F,0x90,0x43,0x8B, ++ ++ 0xE0,0x9E,0x40,0x08,0x90,0x43,0x9C,0x74, ++ ++ 0xFC,0xF0,0x80,0x5F,0x90,0x43,0x96,0xE0, ++ ++ 0xFE,0xA3,0xE0,0xFF,0xD3,0x90,0x43,0x8C, ++ ++ 0xE0,0x9F,0x90,0x43,0x8B,0xE0,0x9E,0x40, ++ ++ 0x08,0x90,0x43,0x9C,0x74,0xFF,0xF0,0x80, ++ ++ 0x42,0x90,0x43,0x98,0xE0,0xC3,0x13,0xFE, ++ ++ 0xA3,0xE0,0x13,0xFF,0xC3,0x90,0x43,0x8C, ++ ++ 0xE0,0x9F,0x90,0x43,0x8B,0xE0,0x9E,0x50, ++ ++ 0x08,0x90,0x43,0x9C,0x74,0x04,0xF0,0x80, ++ ++ 0x22,0x90,0x43,0x98,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0xC3,0x90,0x43,0x8C,0xE0,0x9F,0x90, ++ ++ 0x43,0x8B,0xE0,0x9E,0x50,0x08,0x90,0x43, ++ ++ 0x9C,0x74,0x01,0xF0,0x80,0x05,0xE4,0x90, ++ ++ 0x43,0x9C,0xF0,0x90,0xF0,0x01,0x74,0x01, ++ ++ 0xF0,0x22,0x90,0x43,0x6E,0xE0,0xF9,0xB4, ++ ++ 0x01,0x37,0x90,0x43,0x66,0xE0,0x25,0xE0, ++ ++ 0x24,0x58,0xF5,0x82,0xE4,0x34,0x43,0xF5, ++ ++ 0x83,0xE0,0xFC,0xA3,0xE0,0xFD,0x90,0x43, ++ ++ 0x6F,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0xED, ++ ++ 0x9B,0xFD,0xEC,0x9A,0xFC,0x90,0x43,0x68, ++ ++ 0xE0,0x2D,0xFE,0x90,0x43,0x67,0xE0,0x3C, ++ ++ 0x90,0x44,0xC0,0xF0,0xA3,0xCE,0xF0,0x80, ++ ++ 0x72,0xE9,0xB4,0x02,0x32,0x90,0x43,0x71, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43,0x62, ++ ++ 0xE0,0x2F,0xFF,0x90,0x43,0x61,0xE0,0x3E, ++ ++ 0xFE,0x90,0x43,0x67,0xE0,0xFC,0xA3,0xE0, ++ ++ 0xFD,0xC3,0xEF,0x9D,0xFF,0xEE,0x9C,0xFE, ++ ++ 0xC3,0xE4,0x9F,0xFF,0xE4,0x9E,0x90,0x44, ++ ++ 0xC0,0xF0,0xA3,0xEF,0xF0,0x80,0x3C,0x90, ++ ++ 0x43,0x6E,0xE0,0xB4,0x03,0x35,0x90,0x43, ++ ++ 0x66,0xE0,0x25,0xE0,0x24,0x58,0xF5,0x82, ++ ++ 0xE4,0x34,0x43,0xF5,0x83,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x43,0x6F,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xC3,0xEF,0x9D,0xFF,0xEE,0x9C, ++ ++ 0xFE,0x90,0x43,0x68,0xE0,0x2F,0xFF,0x90, ++ ++ 0x43,0x67,0xE0,0x3E,0x90,0x44,0xC0,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x44,0xC0,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xFF,0x90,0x43,0x70,0xE0,0x2F, ++ ++ 0xF0,0x90,0x43,0x6F,0xE0,0x3E,0xF0,0x90, ++ ++ 0x44,0xC1,0xE0,0x90,0xF4,0x66,0xF0,0x90, ++ ++ 0x44,0xC0,0xE0,0x90,0xF4,0x67,0xF0,0x90, ++ ++ 0x43,0x68,0xE0,0x90,0xF5,0xF4,0xF0,0x90, ++ ++ 0x43,0x67,0xE0,0x90,0xF5,0xF5,0xF0,0x90, ++ ++ 0x43,0x4D,0x74,0x08,0xF0,0x22,0xC2,0xAF, ++ ++ 0x90,0xF7,0x7D,0xE0,0x64,0x01,0x70,0x57, ++ ++ 0x90,0xF7,0x32,0xE0,0x60,0x03,0x12,0x96, ++ ++ 0xBA,0x90,0xF7,0x3C,0xE0,0x60,0x03,0x02, ++ ++ 0x85,0xBF,0x90,0xF5,0xA9,0xE0,0x60,0x03, ++ ++ 0x02,0x85,0xBF,0x90,0xF7,0x32,0xE0,0xB4, ++ ++ 0x01,0x10,0x90,0xF7,0x7B,0xE0,0xB4,0x01, ++ ++ 0x09,0x90,0x43,0xBA,0x74,0x02,0xF0,0x12, ++ ++ 0xA4,0x44,0x90,0xF7,0x31,0xE0,0x64,0x01, ++ ++ 0x60,0x03,0x02,0x85,0xBF,0x90,0xF7,0x7C, ++ ++ 0xE0,0x64,0x01,0x60,0x03,0x02,0x85,0xBF, ++ ++ 0x90,0x44,0x9A,0x04,0xF0,0x90,0xF7,0x49, ++ ++ 0xE0,0x90,0x44,0x9C,0xF0,0x80,0x6F,0x90, ++ ++ 0x44,0x9B,0xE0,0x64,0x01,0x70,0x67,0x90, ++ ++ 0xF5,0xB9,0xE0,0x64,0x01,0x70,0x29,0x90, ++ ++ 0xF5,0xB3,0x04,0xF0,0x90,0xF4,0x60,0xE0, ++ ++ 0x70,0x05,0x12,0xAE,0xA0,0x80,0x0F,0x90, ++ ++ 0xF4,0x60,0xE0,0xB4,0x01,0x05,0x12,0xAE, ++ ++ 0xB0,0x80,0x03,0x12,0xAE,0xC0,0x90,0xF5, ++ ++ 0xB3,0xE4,0xF0,0x90,0x42,0x58,0x04,0xF0, ++ ++ 0x90,0xF5,0xC0,0xE0,0x64,0x01,0x70,0x29, ++ ++ 0x90,0xF5,0xBD,0x04,0xF0,0x90,0xF4,0x60, ++ ++ 0xE0,0x70,0x05,0x12,0xAF,0x0C,0x80,0x0F, ++ ++ 0x90,0xF4,0x60,0xE0,0xB4,0x01,0x05,0x12, ++ ++ 0xAE,0x7E,0x80,0x03,0x12,0xAE,0xD0,0x90, ++ ++ 0xF5,0xBD,0xE4,0xF0,0x90,0x42,0x57,0x04, ++ ++ 0xF0,0xE4,0x90,0x44,0xCD,0xF0,0x12,0xAB, ++ ++ 0x75,0x53,0x91,0xBF,0xE4,0x90,0x44,0x9B, ++ ++ 0xF0,0xD2,0xEA,0xD2,0xE9,0xD2,0xAF,0x22, ++ ++ 0x12,0xAC,0x9F,0x12,0x8F,0xAB,0x12,0x7A, ++ ++ 0xB3,0x90,0x44,0x71,0x74,0x01,0xF0,0xFB, ++ ++ 0x7A,0x44,0x79,0x6A,0x12,0xA1,0x52,0xD2, ++ ++ 0xAF,0x90,0xF2,0x1B,0xE4,0xF0,0x90,0x44, ++ ++ 0x71,0xE0,0x70,0xFA,0x12,0xAD,0xCE,0xE5, ++ ++ 0x13,0xB4,0x0A,0x00,0x40,0x03,0x02,0x86, ++ ++ 0x9E,0x90,0x86,0x09,0xF8,0x28,0x28,0x73, ++ ++ 0x02,0x86,0x27,0x02,0x86,0x2C,0x02,0x86, ++ ++ 0x31,0x02,0x86,0x36,0x02,0x86,0x3B,0x02, ++ ++ 0x86,0x40,0x02,0x86,0x45,0x02,0x86,0x4A, ++ ++ 0x02,0x86,0x6A,0x02,0x86,0x99,0x12,0xAE, ++ ++ 0x6C,0x80,0x75,0x12,0x9B,0xB3,0x80,0x70, ++ ++ 0x12,0x8B,0xBB,0x80,0x6B,0x12,0xAA,0x6A, ++ ++ 0x80,0x66,0x12,0x9C,0x33,0x80,0x61,0x12, ++ ++ 0xA8,0xE4,0x80,0x5C,0x12,0xA4,0x8D,0x80, ++ ++ 0x57,0x90,0xF5,0x05,0x74,0x01,0xF0,0x90, ++ ++ 0x43,0x8E,0xF0,0x12,0xAF,0x7E,0x90,0x43, ++ ++ 0xBB,0xE0,0xB4,0x01,0x05,0x7F,0x01,0x12, ++ ++ 0xAD,0x78,0x7F,0x01,0x12,0xAE,0x43,0x80, ++ ++ 0x37,0x12,0xA0,0xEF,0x12,0x8D,0x56,0x90, ++ ++ 0xF5,0x05,0xE4,0xF0,0x90,0x43,0xBB,0xE0, ++ ++ 0xB4,0x01,0x06,0x12,0x73,0x31,0x12,0xA0, ++ ++ 0xEF,0x90,0x43,0xBB,0xE0,0xB4,0x01,0x06, ++ ++ 0xE5,0x13,0x64,0x08,0x60,0x12,0xE4,0x90, ++ ++ 0x42,0x42,0xF0,0x12,0xAD,0xCE,0x80,0x08, ++ ++ 0x12,0x70,0x4E,0x80,0x03,0x12,0xAF,0x87, ++ ++ 0x12,0x9F,0xC1,0x12,0x97,0xF3,0x12,0xAD, ++ ++ 0xCE,0x02,0x85,0xF8,0x22,0x90,0x41,0xB5, ++ ++ 0xE0,0xFE,0x90,0x41,0xB4,0xE0,0x7C,0x00, ++ ++ 0x24,0x00,0xFF,0xEC,0x3E,0x90,0x44,0xC2, ++ ++ 0xF0,0xA3,0xEF,0xF0,0xE4,0x7F,0x50,0x7E, ++ ++ 0x0D,0xFD,0x90,0x43,0xEA,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xC3,0x12,0x4B,0x21,0x40,0x24,0x90,0x43, ++ ++ 0xEA,0xE0,0xFC,0xA3,0xE0,0xFD,0xA3,0xE0, ++ ++ 0xFE,0xA3,0xE0,0x24,0xB0,0xFF,0xEE,0x34, ++ ++ 0xF2,0xFE,0xED,0x34,0xFF,0xFD,0xEC,0x34, ++ ++ 0xFF,0xFC,0x90,0x43,0xE6,0x12,0x4B,0x6C, ++ ++ 0x80,0x23,0x90,0x43,0xEA,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xC3,0x74,0x50,0x9B,0xFF,0x74,0x0D,0x9A, ++ ++ 0xFE,0xE4,0x99,0xFD,0xE4,0x98,0xFC,0x90, ++ ++ 0x43,0xE6,0x12,0x4B,0x6C,0x90,0x44,0xC2, ++ ++ 0xE0,0xFE,0xA3,0xE0,0xFF,0xE4,0xFC,0xFD, ++ ++ 0x90,0x43,0xE6,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0x12,0x4A, ++ ++ 0xAE,0x78,0x09,0x12,0x4B,0x32,0x90,0x43, ++ ++ 0xE6,0x12,0x4B,0x6C,0xE4,0x7F,0x50,0x7E, ++ ++ 0x0D,0xFD,0xFC,0x90,0x43,0xEA,0xE0,0xF8, ++ ++ 0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0, ++ ++ 0xFB,0xC3,0x12,0x4B,0x21,0x50,0x22,0x90, ++ ++ 0x43,0xE6,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3, ++ ++ 0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0xE4,0x9B, ++ ++ 0xFF,0x74,0x40,0x9A,0xFE,0xE4,0x99,0xFD, ++ ++ 0xE4,0x98,0xFC,0x90,0x43,0xE6,0x12,0x4B, ++ ++ 0x6C,0x22,0xE4,0xFF,0xFE,0x90,0x44,0xD3, ++ ++ 0xF0,0x90,0x41,0xD7,0xE0,0xFD,0xB4,0x22, ++ ++ 0x07,0x90,0x42,0x04,0xE0,0x70,0x01,0x0F, ++ ++ 0xED,0xB4,0x28,0x08,0x90,0xF0,0x61,0xE0, ++ ++ 0x70,0x02,0x7F,0x01,0x90,0x41,0xD7,0xE0, ++ ++ 0xB4,0x22,0x19,0x90,0x43,0xAE,0xE0,0x24, ++ ++ 0xAB,0xF5,0x82,0xE4,0x34,0x43,0xF5,0x83, ++ ++ 0xE0,0xFD,0x90,0x42,0x04,0xE0,0xC3,0x9D, ++ ++ 0x50,0x02,0x7E,0x01,0x90,0x41,0xD7,0xE0, ++ ++ 0xB4,0x28,0x0B,0x90,0xF0,0x61,0xE0,0xC3, ++ ++ 0x94,0x70,0x50,0x02,0x7E,0x01,0x90,0x43, ++ ++ 0x8E,0xE0,0x64,0x03,0x60,0x08,0x90,0x42, ++ ++ 0x52,0xE0,0x64,0x01,0x60,0xF0,0x90,0x41, ++ ++ 0xE8,0xE0,0x70,0x70,0x90,0x41,0xE3,0xE0, ++ ++ 0x70,0x2C,0xEF,0x70,0x09,0x90,0x41,0xD5, ++ ++ 0xE0,0x60,0x61,0xEE,0x60,0x5E,0x90,0x41, ++ ++ 0xD7,0xE0,0xB4,0x22,0x06,0x90,0x43,0x8F, ++ ++ 0x74,0x14,0xF0,0x12,0xAB,0x20,0x90,0x43, ++ ++ 0x8D,0x74,0x32,0xF0,0x90,0x41,0xD5,0xE0, ++ ++ 0x60,0x42,0x12,0xAF,0x6A,0x22,0x90,0x41, ++ ++ 0xD7,0xE0,0xFF,0xB4,0x22,0x14,0x90,0x42, ++ ++ 0x04,0xE0,0xD3,0x94,0x40,0x40,0x0B,0x90, ++ ++ 0x41,0xD5,0xE0,0x70,0x05,0x90,0x44,0xD3, ++ ++ 0x04,0xF0,0xEF,0xB4,0x28,0x0F,0x90,0xF0, ++ ++ 0x61,0xE0,0xD3,0x94,0x90,0x40,0x06,0x90, ++ ++ 0x44,0xD3,0x74,0x01,0xF0,0x90,0x44,0xD3, ++ ++ 0xE0,0x60,0x09,0x90,0x43,0x8F,0x74,0x14, ++ ++ 0xF0,0x12,0xAB,0x4B,0x22,0xE4,0xFF,0x90, ++ ++ 0x43,0xCA,0xF0,0xA3,0xF0,0xA3,0xF0,0x90, ++ ++ 0xF9,0x00,0xE0,0x70,0x08,0x90,0x43,0xCD, ++ ++ 0x74,0x2D,0xF0,0x80,0x15,0x90,0xF9,0x00, ++ ++ 0xE0,0xB4,0x02,0x08,0x90,0x43,0xCD,0x74, ++ ++ 0x59,0xF0,0x80,0x06,0x90,0x43,0xCD,0x74, ++ ++ 0xB1,0xF0,0x90,0xF5,0x56,0xE4,0xF0,0xFF, ++ ++ 0x90,0x43,0xCD,0xE0,0xFE,0xEF,0xC3,0x9E, ++ ++ 0x40,0x03,0x02,0x89,0x39,0x90,0xF6,0x56, ++ ++ 0xEF,0xF0,0x90,0xF6,0x5A,0x74,0x01,0xF0, ++ ++ 0x90,0xF6,0x5A,0xE0,0x70,0xFA,0x90,0xF6, ++ ++ 0x5E,0xE0,0x90,0x43,0xC9,0xF0,0x90,0x43, ++ ++ 0xC7,0xE0,0xC3,0x94,0xC8,0x50,0x25,0x90, ++ ++ 0x41,0xD5,0xE0,0xB4,0x01,0x1E,0xEF,0xC3, ++ ++ 0x94,0x0E,0x40,0x0C,0x90,0x43,0xCD,0xE0, ++ ++ 0x24,0xF2,0xFE,0xEF,0xD3,0x9E,0x40,0x06, ++ ++ 0x90,0x43,0xC9,0x74,0x01,0xF0,0x90,0x43, ++ ++ 0xC7,0xE0,0x04,0xF0,0x90,0x43,0xC9,0xE0, ++ ++ 0x60,0x17,0x90,0x43,0xCB,0xE0,0xFE,0x74, ++ ++ 0x01,0xA8,0x06,0x08,0x80,0x02,0xC3,0x33, ++ ++ 0xD8,0xFC,0xFE,0x90,0x43,0xCA,0xE0,0x2E, ++ ++ 0xF0,0x90,0x43,0xCB,0xE0,0x04,0xF0,0xE0, ++ ++ 0x64,0x08,0x60,0x05,0xA3,0xE0,0xB4,0x16, ++ ++ 0x1B,0x90,0x43,0xCC,0xE0,0x90,0xF5,0x57, ++ ++ 0xF0,0x90,0x43,0xCA,0xE0,0x90,0xF5,0x55, ++ ++ 0xF0,0xE4,0x90,0x43,0xCA,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xE0,0x04,0xF0,0x0F,0x02,0x88,0x99, ++ ++ 0x90,0xF5,0x56,0x74,0x01,0xF0,0x22,0x90, ++ ++ 0x44,0x44,0xE0,0x54,0x01,0xF0,0xC2,0xAF, ++ ++ 0x70,0x27,0x90,0xF7,0x02,0xE0,0x90,0xFB, ++ ++ 0x97,0xF0,0x90,0xF7,0x03,0xE0,0x90,0xFB, ++ ++ 0x98,0xF0,0x90,0xF7,0x04,0xE0,0x90,0xFB, ++ ++ 0x99,0xF0,0x90,0xF9,0x99,0xE0,0x90,0xFB, ++ ++ 0x9A,0xF0,0x7F,0x04,0x12,0xAD,0x3C,0x80, ++ ++ 0x53,0x90,0x44,0x44,0xE0,0x64,0x01,0x70, ++ ++ 0x4B,0x90,0x41,0xD7,0xE0,0xB4,0x22,0x0F, ++ ++ 0x90,0x42,0x04,0xE0,0x90,0xFB,0x97,0xF0, ++ ++ 0x7F,0x07,0x12,0xAD,0x3C,0x80,0x35,0x90, ++ ++ 0x43,0x8C,0xE0,0x90,0xFB,0x97,0xF0,0x90, ++ ++ 0x43,0x8B,0xE0,0x90,0xFB,0x98,0xF0,0x90, ++ ++ 0x42,0x2E,0xE0,0x90,0xFB,0x99,0xF0,0x90, ++ ++ 0x42,0x2F,0xE0,0x90,0xFB,0x9A,0xF0,0x90, ++ ++ 0xF0,0x60,0xE0,0x90,0xFB,0x9B,0xF0,0x90, ++ ++ 0xF0,0x61,0xE0,0x90,0xFB,0x9C,0xF0,0x7F, ++ ++ 0x05,0x12,0xAD,0x3C,0xD2,0xAF,0x90,0x44, ++ ++ 0x44,0xE0,0x04,0xF0,0x90,0xFB,0xA3,0xE0, ++ ++ 0x90,0x41,0xDA,0xF0,0x90,0xFB,0xA4,0xE0, ++ ++ 0x25,0xE0,0x25,0xE0,0x24,0x82,0x90,0x41, ++ ++ 0xDB,0xF0,0xE0,0xFF,0xC3,0x94,0x54,0x40, ++ ++ 0x06,0xE4,0x90,0x41,0xD9,0xF0,0x22,0xEF, ++ ++ 0xC3,0x94,0x32,0x40,0x12,0xEF,0x94,0x54, ++ ++ 0x50,0x0D,0xC3,0x74,0x53,0x9F,0x75,0xF0, ++ ++ 0x03,0xA4,0x90,0x41,0xD9,0xF0,0x22,0x90, ++ ++ 0x41,0xDB,0xE0,0xC3,0x94,0x32,0x50,0x06, ++ ++ 0x90,0x41,0xD9,0x74,0x64,0xF0,0x22,0x90, ++ ++ 0xF9,0x03,0xE0,0x90,0x41,0xC1,0xF0,0x90, ++ ++ 0xF9,0x00,0xE0,0x90,0x41,0xC2,0xF0,0x90, ++ ++ 0x44,0x41,0xE0,0x04,0xF0,0xE0,0xC3,0x94, ++ ++ 0x32,0x40,0x05,0xE4,0xFF,0x12,0x80,0x20, ++ ++ 0x90,0x44,0x3F,0xE0,0x70,0x05,0x7F,0x02, ++ ++ 0x12,0x80,0x20,0x90,0x44,0x40,0xE0,0x04, ++ ++ 0xF0,0xE0,0xC3,0x94,0x32,0x40,0x0B,0x90, ++ ++ 0xF7,0x0D,0x74,0x01,0xF0,0xE4,0x90,0x44, ++ ++ 0x40,0xF0,0x90,0xF7,0x0D,0xE0,0x60,0x5A, ++ ++ 0x90,0xF7,0x05,0xE0,0x90,0x41,0xC3,0xF0, ++ ++ 0x90,0xF7,0x06,0xE0,0x90,0x41,0xC4,0xF0, ++ ++ 0x90,0xF7,0x02,0xE0,0x90,0x41,0xC5,0xF0, ++ ++ 0x90,0xF7,0x03,0xE0,0x90,0x41,0xC6,0xF0, ++ ++ 0x90,0xF7,0x04,0xE0,0x90,0x41,0xC7,0xF0, ++ ++ 0x90,0xF7,0x00,0xE0,0x90,0x41,0xC8,0xF0, ++ ++ 0x90,0xF7,0x01,0xE0,0x90,0x41,0xC9,0xF0, ++ ++ 0x90,0xF7,0x0D,0x74,0x01,0xF0,0xE4,0x90, ++ ++ 0x44,0x40,0xF0,0x90,0x41,0xCF,0xE0,0x04, ++ ++ 0xF0,0xE0,0xFF,0x90,0x41,0xF6,0xE0,0xFE, ++ ++ 0xEF,0x8E,0xF0,0x84,0x90,0x41,0xCF,0xE5, ++ ++ 0xF0,0xF0,0x90,0xF7,0x00,0xE0,0xFF,0x90, ++ ++ 0x41,0xCB,0xE0,0xFE,0xB5,0x07,0x0C,0x90, ++ ++ 0xF7,0x01,0xE0,0xFF,0x90,0x41,0xCC,0xE0, ++ ++ 0x6F,0x60,0x18,0x90,0xF7,0x00,0xEE,0xF0, ++ ++ 0x90,0x41,0xCC,0xE0,0x90,0xF7,0x01,0xF0, ++ ++ 0x90,0xF7,0x0C,0x74,0x01,0xF0,0xE4,0xF0, ++ ++ 0xA3,0x04,0xF0,0x22,0x90,0xF5,0xEB,0xE0, ++ ++ 0x90,0x44,0xAC,0xF0,0x90,0xF5,0xEC,0xE0, ++ ++ 0x90,0x44,0xAB,0xF0,0x90,0xF5,0xED,0xE0, ++ ++ 0x90,0x44,0xAE,0xF0,0x90,0xF5,0xEE,0xE0, ++ ++ 0x90,0x44,0xAD,0xF0,0x90,0x43,0x6E,0xE0, ++ ++ 0xFF,0xB4,0x01,0x0A,0x74,0x02,0xF0,0x90, ++ ++ 0x43,0x4D,0x74,0x07,0xF0,0x22,0xEF,0x64, ++ ++ 0x02,0x60,0x08,0xEF,0x64,0x03,0x60,0x03, ++ ++ 0x02,0x8B,0xBA,0x90,0x43,0x64,0xE0,0xFF, ++ ++ 0x90,0x43,0x63,0xE0,0xFE,0x6F,0x70,0x2C, ++ ++ 0x90,0xF5,0xE9,0xE0,0x70,0x07,0x90,0x43, ++ ++ 0x65,0xEE,0xF0,0x80,0x18,0x90,0x41,0xEF, ++ ++ 0xE0,0x14,0xB5,0x06,0x07,0xE4,0x90,0x43, ++ ++ 0x65,0xF0,0x80,0x09,0x90,0x43,0x63,0xE0, ++ ++ 0x04,0x90,0x43,0x65,0xF0,0x90,0x43,0x4D, ++ ++ 0x74,0x0C,0xF0,0x22,0x90,0xF5,0xE9,0xE0, ++ ++ 0x70,0x18,0x90,0x43,0x63,0xE0,0xFF,0x90, ++ ++ 0x43,0x66,0xE0,0xB5,0x07,0x0C,0x90,0x43, ++ ++ 0x65,0xEF,0xF0,0x90,0x43,0x4D,0x74,0x0C, ++ ++ 0xF0,0x22,0x90,0xF5,0xE9,0xE0,0x70,0x0B, ++ ++ 0x90,0x43,0x66,0xE0,0x14,0x90,0x43,0x64, ++ ++ 0xF0,0x80,0x09,0x90,0x43,0x66,0xE0,0x04, ++ ++ 0x90,0x43,0x63,0xF0,0x90,0x43,0x64,0xE0, ++ ++ 0xFF,0x90,0x43,0x63,0xE0,0x2F,0xFF,0xC3, ++ ++ 0x13,0x90,0x43,0x66,0xF0,0x90,0x43,0x6E, ++ ++ 0x74,0x03,0xF0,0x90,0x43,0x4D,0x74,0x06, ++ ++ 0xF0,0x22,0x90,0xF0,0x2B,0xE4,0xF0,0x90, ++ ++ 0x42,0x44,0xE0,0x70,0x17,0x90,0xF1,0xE5, ++ ++ 0x04,0xF0,0x12,0xAE,0x59,0x12,0xAB,0x4B, ++ ++ 0x12,0x96,0x16,0x90,0x43,0xBB,0x74,0x01, ++ ++ 0xF0,0x02,0x8C,0x5E,0x90,0x44,0x47,0x74, ++ ++ 0x82,0xF0,0x90,0xFB,0x28,0xF0,0x12,0xAF, ++ ++ 0xA6,0x90,0x42,0x05,0xE0,0x90,0xF0,0x41, ++ ++ 0xF0,0x90,0xF0,0x2C,0x74,0x01,0xF0,0x90, ++ ++ 0xF1,0xE5,0xF0,0x75,0xF0,0x02,0xE5,0x13, ++ ++ 0xA4,0x24,0xC5,0xF5,0x82,0xE5,0xF0,0x34, ++ ++ 0xAF,0xF5,0x83,0xE4,0x93,0xFC,0x74,0x01, ++ ++ 0x93,0xFD,0xE4,0xFF,0x12,0xAB,0xED,0x90, ++ ++ 0x44,0xAA,0xE0,0xB4,0x01,0x04,0x7F,0x01, ++ ++ 0x80,0x02,0x7F,0x00,0x90,0xF1,0xE7,0xE0, ++ ++ 0x64,0x01,0x60,0x04,0x7E,0x01,0x80,0x02, ++ ++ 0x7E,0x00,0xEE,0x5F,0x70,0xE1,0x90,0xF1, ++ ++ 0xE7,0xE0,0xB4,0x01,0x04,0x7F,0x01,0x80, ++ ++ 0x02,0x7F,0x00,0x90,0x43,0xBB,0xEF,0xF0, ++ ++ 0xE0,0xB4,0x01,0x11,0x7D,0xFE,0x7C,0x27, ++ ++ 0xE4,0xFF,0x12,0xAB,0xED,0x90,0x44,0xAA, ++ ++ 0xE0,0x64,0x01,0x60,0xF8,0x90,0xF1,0x75, ++ ++ 0x74,0x01,0xF0,0x90,0x41,0xD7,0xE0,0xB4, ++ ++ 0x23,0x08,0x90,0x42,0x54,0xE0,0x90,0x44, ++ ++ 0x45,0xF0,0x12,0xAC,0x37,0x90,0xF0,0xD5, ++ ++ 0x74,0x01,0xF0,0x90,0xF0,0xE3,0xF0,0x90, ++ ++ 0xF0,0xE2,0xF0,0x90,0x43,0xBE,0xF0,0x22, ++ ++ 0x90,0x43,0xBD,0xE0,0x70,0x03,0x02,0x8D, ++ ++ 0x4F,0xC2,0xE9,0xE4,0x90,0x44,0x9B,0xF0, ++ ++ 0x90,0xF7,0x3C,0xE0,0xB4,0x01,0x04,0xC2, ++ ++ 0xEA,0x80,0x02,0xD2,0xEA,0x90,0xF7,0x0E, ++ ++ 0xE0,0xB4,0x01,0x20,0x90,0x43,0xB9,0xE0, ++ ++ 0xC3,0x94,0x02,0x50,0x11,0xE5,0x13,0xB4, ++ ++ 0x09,0x0C,0x12,0xAD,0xB2,0x90,0x43,0xB9, ++ ++ 0xE0,0x04,0xF0,0x02,0x8D,0x4F,0x12,0xA6, ++ ++ 0xD7,0x02,0x8D,0x4F,0x90,0xF5,0x54,0xE0, ++ ++ 0x64,0x01,0x70,0x7A,0x90,0xF0,0x2B,0xE0, ++ ++ 0x70,0x12,0x90,0x42,0x34,0xE0,0xB4,0x01, ++ ++ 0x0B,0x90,0xF2,0x17,0x74,0xFE,0xF0,0x90, ++ ++ 0x42,0x33,0x04,0xF0,0x90,0x44,0x9E,0xE0, ++ ++ 0xC3,0x94,0x02,0x50,0x18,0xE5,0x13,0xB4, ++ ++ 0x09,0x13,0x12,0xAD,0xB2,0x90,0x44,0x9D, ++ ++ 0xE0,0x90,0xF5,0x52,0xF0,0x90,0x44,0x9E, ++ ++ 0xE0,0x04,0xF0,0x80,0x41,0x90,0x43,0xBA, ++ ++ 0x74,0x02,0xF0,0x90,0xF7,0x0E,0xE0,0x64, ++ ++ 0x01,0x60,0x07,0x90,0xF7,0x40,0xE0,0xB4, ++ ++ 0x01,0x05,0x12,0xA6,0xD7,0x80,0x27,0x90, ++ ++ 0xF7,0x31,0xE0,0x60,0x0A,0xE4,0xFF,0x12, ++ ++ 0xA3,0xFB,0x12,0xAB,0xC7,0x80,0x11,0x90, ++ ++ 0xF7,0x3C,0xE0,0x70,0x03,0x12,0xAE,0x16, ++ ++ 0xE4,0x90,0x42,0x42,0xF0,0x12,0xAE,0xDF, ++ ++ 0x12,0xAE,0x8F,0x12,0xAD,0x95,0x12,0xAE, ++ ++ 0x8F,0x53,0x91,0x7F,0x22,0x90,0xF5,0xA8, ++ ++ 0xE4,0xF0,0x04,0xF0,0x75,0xF0,0x02,0xE5, ++ ++ 0x13,0xA4,0x24,0xC5,0xF5,0x82,0xE5,0xF0, ++ ++ 0x34,0xAF,0xF5,0x83,0xE4,0x93,0xFC,0x74, ++ ++ 0x01,0x93,0xFD,0xE4,0xFF,0x12,0xAB,0xED, ++ ++ 0x90,0x44,0xAA,0xE0,0xB4,0x01,0x04,0x7F, ++ ++ 0x01,0x80,0x02,0x7F,0x00,0x90,0xF5,0xA9, ++ ++ 0xE0,0x64,0x01,0x60,0x04,0x7E,0x01,0x80, ++ ++ 0x02,0x7E,0x00,0xEE,0x5F,0x70,0xE1,0x90, ++ ++ 0xF5,0xA9,0xE0,0xB4,0x01,0x04,0x7F,0x01, ++ ++ 0x80,0x02,0x7F,0x00,0x90,0x43,0xBB,0xEF, ++ ++ 0xF0,0xE0,0x64,0x01,0x70,0x40,0x90,0xF4, ++ ++ 0xCC,0xE0,0xFF,0x90,0xF9,0x08,0xF0,0x90, ++ ++ 0xF4,0xC1,0xE0,0xFF,0x90,0xF9,0x03,0xF0, ++ ++ 0x90,0xF4,0xC4,0xE0,0xFF,0x90,0xF9,0x06, ++ ++ 0xF0,0x90,0xF4,0xC5,0xE0,0xFF,0x90,0xF9, ++ ++ 0x07,0xF0,0x90,0xF4,0xC6,0xE0,0x54,0x03, ++ ++ 0xFF,0x90,0xF9,0x02,0xF0,0x70,0x05,0x90, ++ ++ 0xF9,0x05,0x04,0xF0,0x90,0x41,0xD1,0x74, ++ ++ 0x01,0xF0,0x90,0xF7,0x2F,0xF0,0x90,0xF1, ++ ++ 0x0F,0xE0,0xFE,0x90,0xF1,0x0E,0xE0,0x7C, ++ ++ 0x00,0x24,0x00,0xFF,0xEC,0x3E,0x90,0x43, ++ ++ 0xD1,0xF0,0xA3,0xEF,0xF0,0x90,0xF1,0x13, ++ ++ 0xE0,0xFE,0x90,0xF1,0x12,0xE0,0x24,0x00, ++ ++ 0xFF,0xEC,0x3E,0x90,0x43,0xD3,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x12,0x95,0x68,0x22,0x90,0xF9, ++ ++ 0x00,0xE0,0xB4,0x01,0x10,0x90,0x43,0x20, ++ ++ 0x74,0x0C,0xF0,0xA3,0x74,0x1A,0xF0,0xA3, ++ ++ 0x74,0xA1,0xF0,0x80,0x24,0x90,0xF9,0x00, ++ ++ 0xE0,0x70,0x10,0x90,0x43,0x20,0x74,0x0A, ++ ++ 0xF0,0xA3,0x74,0x06,0xF0,0xA3,0x74,0xA9, ++ ++ 0xF0,0x80,0x0E,0x90,0x43,0x20,0x74,0x0B, ++ ++ 0xF0,0xA3,0x74,0x0D,0xF0,0xA3,0x74,0x51, ++ ++ 0xF0,0xE4,0xFF,0x7F,0x08,0x90,0x43,0x28, ++ ++ 0xE4,0xF0,0xA3,0xDF,0xFC,0x7F,0x08,0x90, ++ ++ 0xF4,0xC1,0xE0,0x14,0x60,0x12,0x14,0x60, ++ ++ 0x41,0x24,0x02,0x70,0x6E,0x90,0x43,0x1E, ++ ++ 0x74,0xB5,0xF0,0xA3,0x74,0x08,0xF0,0x22, ++ ++ 0x90,0xF4,0xC6,0xE0,0x14,0x60,0x0A,0x14, ++ ++ 0x60,0x12,0x14,0x60,0x1A,0x24,0x03,0x70, ++ ++ 0x52,0x90,0x43,0x1E,0x74,0xA2,0xF0,0xA3, ++ ++ 0x74,0x09,0xF0,0x22,0x90,0x43,0x1E,0x74, ++ ++ 0xE5,0xF0,0xA3,0x74,0x0A,0xF0,0x22,0x90, ++ ++ 0x43,0x1E,0x74,0x8E,0xF0,0xA3,0x74,0x0A, ++ ++ 0xF0,0x22,0x90,0xF4,0xC6,0xE0,0x14,0x60, ++ ++ 0x0A,0x14,0x60,0x12,0x14,0x60,0x1A,0x24, ++ ++ 0x03,0x70,0x20,0x90,0x43,0x1E,0x74,0x9E, ++ ++ 0xF0,0xA3,0x74,0x0A,0xF0,0x22,0x90,0x43, ++ ++ 0x1E,0x74,0x84,0xF0,0xA3,0x74,0x0A,0xF0, ++ ++ 0x22,0x90,0x43,0x1E,0x74,0xC5,0xF0,0xA3, ++ ++ 0x74,0x0B,0xF0,0x22,0x90,0xF5,0xCB,0xE0, ++ ++ 0xB4,0x01,0xF9,0x90,0xF5,0xD0,0xE0,0x90, ++ ++ 0x42,0xFF,0xF0,0x90,0xF5,0xCF,0xE0,0x90, ++ ++ 0x43,0x00,0xF0,0x90,0xF5,0xCE,0xE0,0x90, ++ ++ 0x43,0x01,0xF0,0x90,0x42,0xFE,0xE0,0xFC, ++ ++ 0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0, ++ ++ 0xFF,0x78,0x0A,0x12,0x4B,0x59,0x78,0x0A, ++ ++ 0x12,0x4B,0x45,0x90,0x42,0xFE,0x12,0x4B, ++ ++ 0x6C,0x90,0x43,0x1E,0xE0,0xFF,0xE4,0xFC, ++ ++ 0xFD,0xFE,0x90,0x42,0xFE,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0x12,0x4A,0xAE,0x90,0x43,0x1F,0xE0,0xF9, ++ ++ 0xF8,0x12,0x4B,0x45,0x90,0x42,0xFE,0x12, ++ ++ 0x4B,0x6C,0x90,0xF5,0xD3,0xE0,0x90,0x43, ++ ++ 0x03,0xF0,0x90,0xF5,0xD2,0xE0,0x90,0x43, ++ ++ 0x04,0xF0,0x90,0xF5,0xD1,0xE0,0x90,0x43, ++ ++ 0x05,0xF0,0x90,0x43,0x02,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0x78,0x0A,0x12,0x4B,0x59,0x78,0x0A,0x12, ++ ++ 0x4B,0x45,0x90,0x43,0x02,0x12,0x4B,0x6C, ++ ++ 0x90,0x43,0x1E,0xE0,0xFF,0xE4,0xFC,0xFD, ++ ++ 0xFE,0x90,0x43,0x02,0xE0,0xF8,0xA3,0xE0, ++ ++ 0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0x12, ++ ++ 0x4A,0xAE,0x90,0x43,0x1F,0xE0,0xF9,0xF8, ++ ++ 0x12,0x4B,0x45,0x90,0x43,0x02,0x12,0x4B, ++ ++ 0x6C,0x22,0xC2,0xAF,0x90,0x41,0x03,0x74, ++ ++ 0x02,0xF0,0xA3,0x74,0x91,0xF0,0xA3,0x74, ++ ++ 0x2C,0xF0,0x90,0x41,0x0B,0x74,0x02,0xF0, ++ ++ 0xA3,0x74,0x91,0xF0,0xA3,0x74,0x34,0xF0, ++ ++ 0x90,0x41,0x13,0x74,0x02,0xF0,0xA3,0x74, ++ ++ 0x91,0xF0,0xA3,0x74,0x3C,0xF0,0x90,0x41, ++ ++ 0x1B,0x74,0x02,0xF0,0xA3,0x74,0x91,0xF0, ++ ++ 0xA3,0x74,0x44,0xF0,0x90,0x41,0x23,0x74, ++ ++ 0x02,0xF0,0xA3,0x74,0x91,0xF0,0xA3,0x74, ++ ++ 0x4C,0xF0,0x90,0x41,0x2B,0x74,0x02,0xF0, ++ ++ 0xA3,0x74,0x91,0xF0,0xA3,0x74,0x54,0xF0, ++ ++ 0x90,0x41,0x33,0x74,0x02,0xF0,0xA3,0x74, ++ ++ 0x91,0xF0,0xA3,0x74,0x5C,0xF0,0x90,0x41, ++ ++ 0x3B,0x74,0x02,0xF0,0xA3,0x74,0x91,0xF0, ++ ++ 0xA3,0x74,0x64,0xF0,0x90,0x41,0x43,0x74, ++ ++ 0x02,0xF0,0xA3,0x74,0x91,0xF0,0xA3,0x74, ++ ++ 0x6C,0xF0,0x90,0x41,0x4B,0x74,0x02,0xF0, ++ ++ 0xA3,0x74,0x91,0xF0,0xA3,0x74,0x74,0xF0, ++ ++ 0x90,0x41,0x53,0x74,0x02,0xF0,0xA3,0x74, ++ ++ 0x91,0xF0,0xA3,0x74,0x7C,0xF0,0x90,0x41, ++ ++ 0x5B,0x74,0x02,0xF0,0xA3,0x74,0x91,0xF0, ++ ++ 0xA3,0x74,0x84,0xF0,0x90,0x41,0x63,0x74, ++ ++ 0x02,0xF0,0xA3,0x74,0x91,0xF0,0xA3,0x74, ++ ++ 0x8C,0xF0,0x90,0xAF,0xA0,0x74,0x32,0xF0, ++ ++ 0xD2,0xAF,0x22,0x90,0xF5,0x76,0x74,0xFF, ++ ++ 0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74,0x9E, ++ ++ 0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74,0x31, ++ ++ 0xF0,0xA3,0x74,0x02,0xF0,0xA3,0x74,0xB0, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x7B,0xF0, ++ ++ 0xA3,0x74,0x01,0xF0,0xA3,0x74,0x25,0xF0, ++ ++ 0xA3,0x74,0x03,0xF0,0xA3,0x74,0xEC,0xF0, ++ ++ 0xA3,0x74,0x02,0xF0,0xA3,0x74,0xE1,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0xB0,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x74,0x3A,0xF0,0xA3,0x74, ++ ++ 0x03,0xF0,0xA3,0x74,0xA2,0xF0,0xA3,0x74, ++ ++ 0x03,0xF0,0xA3,0x74,0x97,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0x74,0x26,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0x9C,0xF0,0xA3,0x74,0x03,0xF0, ++ ++ 0xA3,0x74,0xF9,0xF0,0xA3,0x74,0x03,0xF0, ++ ++ 0xA3,0x74,0x37,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0xFC,0xF0,0xA3,0x74,0x03,0xF0,0xA3, ++ ++ 0x74,0xE8,0xF0,0xA3,0x74,0x03,0xF0,0x90, ++ ++ 0xF5,0x6C,0xE4,0xF0,0xA3,0x74,0x05,0xF0, ++ ++ 0x90,0xF9,0x00,0xE0,0x70,0x0A,0x90,0xF5, ++ ++ 0x9E,0x74,0x19,0xF0,0xA3,0xE4,0xF0,0x22, ++ ++ 0x90,0xF9,0x00,0xE0,0xB4,0x01,0x0A,0x90, ++ ++ 0xF5,0x9E,0x74,0x65,0xF0,0xA3,0xE4,0xF0, ++ ++ 0x22,0x90,0xF5,0x9E,0x74,0x65,0xF0,0xA3, ++ ++ 0xE4,0xF0,0x22,0xC0,0xE0,0x75,0xE0,0x00, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x02, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x04, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x06, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x08, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x0A, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x0C, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x0E, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x10, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x12, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x14, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x16, ++ ++ 0x02,0x91,0x94,0xC0,0xE0,0x75,0xE0,0x18, ++ ++ 0x02,0x91,0x94,0xC0,0xD0,0x75,0xD0,0x00, ++ ++ 0xC0,0x86,0x75,0x86,0x00,0xC0,0x83,0xC0, ++ ++ 0x82,0xC0,0x85,0xC0,0x84,0xC0,0xF0,0xC0, ++ ++ 0x00,0xC0,0x01,0xC0,0x02,0xC0,0x03,0xC0, ++ ++ 0x04,0xC0,0x05,0xC0,0x06,0xC0,0x07,0x90, ++ ++ 0xAF,0xE3,0xF9,0x93,0xFA,0xE9,0x04,0x93, ++ ++ 0xF9,0x12,0x4B,0xA9,0xD0,0x07,0xD0,0x06, ++ ++ 0xD0,0x05,0xD0,0x04,0xD0,0x03,0xD0,0x02, ++ ++ 0xD0,0x01,0xD0,0x00,0xD0,0xF0,0xD0,0x84, ++ ++ 0xD0,0x85,0xD0,0x82,0xD0,0x83,0xD0,0x86, ++ ++ 0xD0,0xD0,0xD0,0xE0,0x32,0x4E,0x42,0x79, ++ ++ 0x99,0x46,0x01,0xE9,0x50,0x06,0xC6,0xB3, ++ ++ 0xB0,0xB0,0xAE,0xA8,0x9E,0x74,0x4E,0x42, ++ ++ 0x87,0x02,0x02,0x02,0x01,0x01,0x01,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4E, ++ ++ 0x42,0x95,0x00,0x00,0x00,0x03,0x05,0x08, ++ ++ 0x0C,0x0F,0x10,0x10,0x10,0x0D,0x0B,0x05, ++ ++ 0x5C,0x42,0xA3,0x00,0x00,0x00,0x99,0x00, ++ ++ 0x00,0x00,0xE8,0x00,0x4B,0x00,0xFC,0x00, ++ ++ 0xAE,0x00,0x8B,0x00,0x79,0x00,0x70,0x00, ++ ++ 0x6C,0x00,0x6B,0x00,0x6B,0x00,0x14,0x5C, ++ ++ 0x42,0xBF,0x00,0x03,0x00,0x02,0x00,0x02, ++ ++ 0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x42, ++ ++ 0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ ++ 0x01,0x00,0x01,0x00,0x02,0x00,0x03,0x00, ++ ++ 0x03,0x00,0x04,0x00,0x05,0x00,0x05,0x00, ++ ++ 0x06,0x00,0x06,0x00,0x03,0x43,0x43,0xAB, ++ ++ 0x3A,0x44,0x40,0x48,0x43,0x28,0x00,0x00, ++ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x43, ++ ++ 0x36,0x02,0x39,0x04,0xEE,0x08,0xFB,0x0E, ++ ++ 0xAA,0x10,0xD5,0x13,0x0D,0x14,0xC9,0x18, ++ ++ 0xFE,0x00,0x90,0xF5,0x76,0x74,0x20,0xF0, ++ ++ 0xA3,0x74,0x01,0xF0,0xA3,0x74,0x22,0xF0, ++ ++ 0xA3,0x74,0x02,0xF0,0xA3,0x74,0xFF,0xF0, ++ ++ 0xA3,0x74,0x01,0xF0,0xA3,0x74,0x7E,0xF0, ++ ++ 0xA3,0x74,0x02,0xF0,0xA3,0x74,0xA0,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0x74,0x51,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0xF0,0xA3,0x74,0x03,0xF0, ++ ++ 0xA3,0x74,0x40,0xF0,0xA3,0x74,0x01,0xF0, ++ ++ 0xA3,0x74,0xED,0xF0,0xA3,0x74,0x02,0xF0, ++ ++ 0xA3,0x74,0xA1,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0xDF,0xF0,0xA3,0x74,0x03,0xF0,0xA3, ++ ++ 0x74,0xC1,0xF0,0xA3,0x74,0x03,0xF0,0xA3, ++ ++ 0x74,0x68,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x9F,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74, ++ ++ 0x3E,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0xE8, ++ ++ 0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74,0xFF, ++ ++ 0xF0,0xA3,0x74,0x03,0xF0,0xA3,0x74,0x0A, ++ ++ 0xF0,0xA3,0xE4,0xF0,0x90,0xF9,0x00,0xE0, ++ ++ 0x70,0x0A,0x90,0xF5,0x9E,0x74,0x3F,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x22,0x90,0xF9,0x00,0xE0, ++ ++ 0xB4,0x01,0x0A,0x90,0xF5,0x9E,0x74,0xFB, ++ ++ 0xF0,0xA3,0xE4,0xF0,0x22,0x90,0xF5,0x9E, ++ ++ 0x74,0x7D,0xF0,0xA3,0xE4,0xF0,0x22,0x90, ++ ++ 0x41,0xD7,0xE0,0x64,0x22,0x70,0x34,0x90, ++ ++ 0x41,0xD4,0xE0,0x70,0x06,0x90,0x41,0xD5, ++ ++ 0xE0,0x60,0x28,0x90,0x43,0x9C,0xE0,0x60, ++ ++ 0x22,0x90,0x42,0x0B,0xE0,0xFF,0x90,0x42, ++ ++ 0x04,0xE0,0xB5,0x07,0x16,0x7F,0x12,0x12, ++ ++ 0xAD,0x3C,0x90,0xFB,0xA2,0xE0,0x90,0x42, ++ ++ 0x04,0xF0,0x90,0x43,0x8F,0x74,0x14,0xF0, ++ ++ 0x12,0xA8,0x1A,0x90,0x42,0x04,0xE0,0x90, ++ ++ 0x43,0xA6,0xF0,0x90,0x43,0x9C,0xE0,0xFF, ++ ++ 0x60,0x42,0x90,0x43,0xA9,0xE0,0x60,0x02, ++ ++ 0x14,0xF0,0xEF,0x30,0xE7,0x0B,0x12,0xAD, ++ ++ 0xE8,0x90,0x43,0x9C,0xE0,0x04,0xF0,0x80, ++ ++ 0x09,0x12,0xAC,0xFE,0x90,0x43,0x9C,0xE0, ++ ++ 0x14,0xF0,0x90,0x41,0xD5,0xE0,0x60,0x17, ++ ++ 0x90,0x43,0xA7,0xE0,0xB4,0x03,0x15,0x12, ++ ++ 0xA8,0x1A,0xE4,0x90,0x43,0xA7,0xF0,0x90, ++ ++ 0x43,0xA9,0x74,0x20,0xF0,0x80,0x05,0x12, ++ ++ 0xAF,0x28,0x80,0xB7,0x90,0x42,0x04,0xE0, ++ ++ 0xFF,0x90,0x42,0x3D,0xF0,0x90,0x42,0x53, ++ ++ 0xE0,0x60,0x18,0x90,0x42,0x0B,0xE0,0xFE, ++ ++ 0xEF,0xB5,0x06,0x0F,0x90,0x43,0x9D,0xE0, ++ ++ 0xD3,0x94,0x40,0x50,0x06,0x90,0x43,0x90, ++ ++ 0x74,0x01,0xF0,0x22,0x90,0xF5,0x76,0x74, ++ ++ 0x06,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0xC1,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0xFF,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0xB8,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0x0C,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0x36,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x79, ++ ++ 0xF0,0xA3,0x74,0x03,0xF0,0xA3,0xF0,0xA3, ++ ++ 0xF0,0xA3,0x74,0xE7,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0x74,0x18,0xF0,0xA3,0x74,0x03, ++ ++ 0xF0,0xA3,0x74,0x74,0xF0,0xA3,0x74,0x03, ++ ++ 0xF0,0xA3,0x74,0xD6,0xF0,0xA3,0x74,0x03, ++ ++ 0xF0,0xA3,0x74,0x1E,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0x41,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0x43,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x30,0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x18, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x07,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x90,0xF9,0x00,0xE0,0x70, ++ ++ 0x0A,0x90,0xF5,0x9E,0x74,0x19,0xF0,0xA3, ++ ++ 0xE4,0xF0,0x22,0x90,0xF9,0x00,0xE0,0xB4, ++ ++ 0x01,0x0A,0x90,0xF5,0x9E,0x74,0x65,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x22,0x90,0xF5,0x9E,0x74, ++ ++ 0x32,0xF0,0xA3,0xE4,0xF0,0x22,0x90,0xF5, ++ ++ 0x76,0x74,0x72,0xF0,0xA3,0x74,0x01,0xF0, ++ ++ 0xA3,0xF0,0xA3,0x04,0xF0,0xA3,0x74,0x5C, ++ ++ 0xF0,0xA3,0x74,0x01,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0xF0,0xA3,0x74,0xCD,0xF0,0xA3,0x74, ++ ++ 0x02,0xF0,0xA3,0x74,0x8E,0xF0,0xA3,0x74, ++ ++ 0x01,0xF0,0xA3,0x04,0xF0,0xA3,0x04,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0xF0,0xA3,0x74,0xC3, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0x74,0x16,0xF0, ++ ++ 0xA3,0x74,0x03,0xF0,0xA3,0x74,0x89,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3, ++ ++ 0x74,0xA9,0xF0,0xA3,0x74,0x03,0xF0,0xA3, ++ ++ 0x74,0x5D,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0xD0,0xF0,0xA3,0x74,0x03,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0xF0,0xA3,0x74,0x15,0xF0,0xA3, ++ ++ 0xE4,0xF0,0xA3,0x74,0xEF,0xF0,0xA3,0x74, ++ ++ 0x03,0xF0,0x90,0xF5,0x6C,0x74,0x80,0xF0, ++ ++ 0xA3,0x74,0x06,0xF0,0x90,0xF9,0x00,0xE0, ++ ++ 0x70,0x0A,0x90,0xF5,0x9E,0x74,0x3F,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x22,0x90,0xF9,0x00,0xE0, ++ ++ 0xB4,0x01,0x0A,0x90,0xF5,0x9E,0x74,0xFB, ++ ++ 0xF0,0xA3,0xE4,0xF0,0x22,0x90,0xF5,0x9E, ++ ++ 0x74,0x7D,0xF0,0xA3,0xE4,0xF0,0x22,0x90, ++ ++ 0xF1,0x10,0xE0,0x64,0x01,0x60,0x03,0x02, ++ ++ 0x96,0x09,0x90,0xF1,0x14,0xE0,0x64,0x01, ++ ++ 0x60,0x03,0x02,0x96,0x09,0xD3,0x90,0x43, ++ ++ 0xD2,0xE0,0x94,0x10,0x90,0x43,0xD1,0xE0, ++ ++ 0x94,0x35,0x40,0x0C,0xA3,0xE0,0x94,0x30, ++ ++ 0x90,0x43,0xD1,0xE0,0x94,0x38,0x40,0x1B, ++ ++ 0xD3,0x90,0x43,0xD4,0xE0,0x94,0x10,0x90, ++ ++ 0x43,0xD3,0xE0,0x94,0x35,0x40,0x61,0xA3, ++ ++ 0xE0,0x94,0x30,0x90,0x43,0xD3,0xE0,0x94, ++ ++ 0x38,0x50,0x55,0x90,0xF4,0xC1,0xE0,0x64, ++ ++ 0x01,0x70,0x25,0x90,0xF9,0x00,0xE0,0x70, ++ ++ 0x0C,0x90,0xF5,0x4B,0x74,0x05,0xF0,0x90, ++ ++ 0xF6,0x55,0x74,0x20,0xF0,0x90,0xF9,0x00, ++ ++ 0xE0,0xB4,0x01,0x0C,0x90,0xF5,0x4B,0x74, ++ ++ 0x04,0xF0,0x90,0xF6,0x55,0x74,0x10,0xF0, ++ ++ 0x90,0xF4,0xC1,0xE0,0x64,0x02,0x70,0x2C, ++ ++ 0x90,0xF9,0x00,0xE0,0x70,0x06,0x90,0xF5, ++ ++ 0x4B,0x74,0x09,0xF0,0x90,0xF9,0x00,0xE0, ++ ++ 0xB4,0x01,0x06,0x90,0xF5,0x4B,0x74,0x08, ++ ++ 0xF0,0x90,0xF6,0x55,0x74,0x20,0xF0,0x22, ++ ++ 0x90,0xF5,0x4B,0x74,0x14,0xF0,0x90,0xF6, ++ ++ 0x55,0x74,0x20,0xF0,0x22,0xC2,0xAD,0x90, ++ ++ 0x41,0xD7,0xE0,0xB4,0x22,0x0B,0x7F,0x14, ++ ++ 0x12,0xAD,0x3C,0x90,0x43,0xAF,0x74,0x01, ++ ++ 0xF0,0x12,0xA7,0xE7,0x90,0x42,0x53,0xE0, ++ ++ 0x60,0x05,0xE4,0x90,0x43,0x8D,0xF0,0x90, ++ ++ 0xF0,0x01,0x74,0x01,0xF0,0xE4,0x90,0x44, ++ ++ 0xD2,0xF0,0x90,0xF0,0x01,0xE0,0xB4,0x01, ++ ++ 0xF9,0x12,0x83,0x14,0x90,0x43,0x9C,0xE0, ++ ++ 0x60,0x20,0x12,0x93,0x50,0x7D,0x33,0x7C, ++ ++ 0x01,0xE4,0xFF,0x12,0xAB,0xED,0x90,0x44, ++ ++ 0xAA,0xE0,0x64,0x01,0x60,0xF8,0x90,0x44, ++ ++ 0xD2,0xE0,0x04,0xF0,0xE0,0xC3,0x94,0x30, ++ ++ 0x40,0xD0,0xE4,0x90,0x43,0x94,0xF0,0xA3, ++ ++ 0xF0,0x90,0x43,0x92,0xF0,0xA3,0xF0,0x90, ++ ++ 0x42,0x04,0xE0,0x90,0x43,0x9D,0xF0,0xD2, ++ ++ 0xAD,0x90,0x41,0xD7,0xE0,0xB4,0x22,0x10, ++ ++ 0x90,0x42,0x4B,0xE0,0x60,0x0A,0x7F,0x15, ++ ++ 0x12,0xAD,0x3C,0xE4,0x90,0x43,0xAF,0xF0, ++ ++ 0x90,0x42,0x53,0xE0,0x60,0x12,0x90,0x42, ++ ++ 0x04,0xE0,0x70,0x0C,0x90,0x42,0x40,0xE0, ++ ++ 0xD3,0x94,0xD0,0x40,0x03,0x12,0xAB,0x20, ++ ++ 0x22,0x90,0xF7,0x66,0xE0,0x90,0x44,0xC8, ++ ++ 0xF0,0xE0,0xFF,0x90,0x42,0x43,0xF0,0x90, ++ ++ 0xF7,0x68,0xE0,0x90,0x44,0xA0,0xF0,0x90, ++ ++ 0xF5,0xA9,0xE0,0x70,0x09,0xEF,0x60,0x06, ++ ++ 0x90,0x44,0x9A,0xE0,0x60,0x04,0x7F,0x01, ++ ++ 0x80,0x02,0x7F,0x00,0x90,0x44,0x9A,0xEF, ++ ++ 0xF0,0x70,0x03,0x12,0xA4,0x44,0x90,0xF5, ++ ++ 0xA9,0xE0,0x70,0x2A,0x90,0xF7,0x63,0xE0, ++ ++ 0x90,0x42,0x2B,0xF0,0x90,0xF7,0x64,0xE0, ++ ++ 0x90,0x41,0xE4,0xF0,0x90,0xF7,0x65,0xE0, ++ ++ 0x90,0x44,0x9F,0xF0,0x12,0x9A,0xAE,0x90, ++ ++ 0x44,0xC8,0xE0,0x90,0x41,0xCD,0xF0,0xE4, ++ ++ 0x90,0x42,0x42,0xF0,0x80,0x0A,0x90,0x41, ++ ++ 0xCD,0x74,0x01,0xF0,0x90,0x42,0x42,0xF0, ++ ++ 0x12,0xA7,0x80,0xE4,0x90,0x44,0xC9,0xF0, ++ ++ 0x7F,0x00,0x7E,0x28,0x12,0xAF,0x5E,0x20, ++ ++ 0x8C,0xFD,0x90,0x44,0xC9,0xE0,0x04,0xF0, ++ ++ 0xE0,0xC3,0x94,0x05,0x40,0xEA,0x12,0xAD, ++ ++ 0xCE,0x90,0xF7,0x69,0xE0,0x70,0xFA,0x90, ++ ++ 0xF7,0x6B,0x74,0x01,0xF0,0xE4,0xF0,0x22, ++ ++ 0x90,0xF5,0xCC,0xE4,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0x90,0xF5,0xD4,0xE0,0x90,0x43,0x09, ++ ++ 0xF0,0x90,0xF5,0xCB,0xE0,0xB4,0x01,0xF9, ++ ++ 0x12,0xAD,0x5A,0x90,0xFD,0x33,0xE4,0xF0, ++ ++ 0x04,0xF0,0x90,0xFD,0x36,0xE0,0xB4,0x01, ++ ++ 0xF9,0x12,0xA6,0x99,0x90,0x43,0x06,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x43,0x0A,0xE0,0xF8,0xA3, ++ ++ 0xE0,0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB, ++ ++ 0xC3,0x12,0x4B,0x21,0x50,0x06,0x90,0x43, ++ ++ 0x33,0xE0,0x04,0xF0,0x90,0x43,0x06,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x78,0x02,0x12,0x4B,0x45,0x90, ++ ++ 0x43,0x06,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3, ++ ++ 0xE0,0xFA,0xA3,0xE0,0x2F,0xFF,0xEA,0x3E, ++ ++ 0xFE,0xE9,0x3D,0xFD,0xE8,0x3C,0xFC,0x90, ++ ++ 0x43,0x0A,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3, ++ ++ 0xE0,0xFA,0xA3,0xE0,0xFB,0xD3,0x12,0x4B, ++ ++ 0x21,0x40,0x06,0x90,0x43,0x32,0xE0,0x04, ++ ++ 0xF0,0x22,0x90,0x41,0xD2,0xE0,0x70,0x1D, ++ ++ 0x90,0xF9,0x57,0xE0,0x54,0xFD,0x44,0x02, ++ ++ 0xF0,0x90,0x41,0xD2,0x74,0x01,0xF0,0xE4, ++ ++ 0x90,0x43,0xB8,0xF0,0x90,0x43,0xB6,0xF0, ++ ++ 0xA3,0xF0,0xF5,0x13,0x22,0x90,0x43,0xB7, ++ ++ 0xE0,0x60,0x68,0x90,0x43,0xBB,0xE0,0xB4, ++ ++ 0x01,0x0C,0xE5,0x13,0x90,0xAF,0xA7,0x93, ++ ++ 0xF5,0x13,0xE4,0xF5,0x14,0x22,0xE5,0x13, ++ ++ 0x70,0x05,0xF5,0x13,0xF5,0x14,0x22,0xE5, ++ ++ 0x13,0x90,0xAF,0xD9,0x93,0xB5,0x14,0x1C, ++ ++ 0x90,0x43,0xCE,0xE0,0xB5,0x13,0x05,0x75, ++ ++ 0x13,0x01,0x80,0x0C,0x90,0x43,0xCE,0xE5, ++ ++ 0x13,0xF0,0x90,0xAF,0xBB,0x93,0xF5,0x13, ++ ++ 0xE4,0xF5,0x14,0x22,0xE5,0x13,0x90,0xAF, ++ ++ 0xB1,0x93,0xFF,0xB5,0x13,0x03,0x05,0x14, ++ ++ 0x22,0x90,0x43,0xCF,0xE0,0xB5,0x13,0x08, ++ ++ 0x90,0xAF,0xBB,0x93,0xF5,0x13,0x80,0x08, ++ ++ 0x90,0x43,0xCF,0xE5,0x13,0xF0,0x8F,0x13, ++ ++ 0xE4,0xF5,0x14,0x22,0xE4,0xFB,0xEB,0x25, ++ ++ 0xE0,0x24,0x36,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xE0,0xFF,0xA3,0xE0,0x90,0x43, ++ ++ 0x23,0xCF,0xF0,0xA3,0xEF,0xF0,0x12,0xA5, ++ ++ 0xDA,0x90,0xF5,0xD0,0xE0,0xFF,0xC4,0x13, ++ ++ 0x54,0x07,0xFF,0x90,0xF5,0xD3,0xE0,0xFE, ++ ++ 0xC4,0x13,0x54,0x07,0x6F,0x60,0x0D,0x74, ++ ++ 0x28,0x2B,0xF5,0x82,0xE4,0x34,0x43,0xF5, ++ ++ 0x83,0xE0,0x04,0xF0,0x0B,0xEB,0xB4,0x08, ++ ++ 0xBD,0x90,0x43,0x26,0xE0,0x04,0xF0,0xE0, ++ ++ 0xC3,0x94,0x13,0x40,0x3D,0xE4,0xFF,0xFB, ++ ++ 0x74,0x28,0x2B,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xE0,0xFE,0xD3,0x94,0x0E,0x50, ++ ++ 0x06,0xEE,0xC3,0x94,0x05,0x50,0x01,0x0F, ++ ++ 0x74,0x28,0x2B,0xF5,0x82,0xE4,0x34,0x43, ++ ++ 0xF5,0x83,0xE4,0xF0,0x0B,0xEB,0xB4,0x08, ++ ++ 0xD7,0xEF,0xD3,0x94,0x06,0x40,0x06,0x90, ++ ++ 0x42,0x38,0x74,0x01,0xF0,0xE4,0x90,0x43, ++ ++ 0x26,0xF0,0x22,0x78,0x7F,0xE4,0xF6,0xD8, ++ ++ 0xFD,0x75,0x81,0x14,0x02,0x99,0x5B,0x02, ++ ++ 0x85,0xD1,0xE4,0x93,0xA3,0xF8,0xE4,0x93, ++ ++ 0xA3,0x40,0x03,0xF6,0x80,0x01,0xF2,0x08, ++ ++ 0xDF,0xF4,0x80,0x29,0xE4,0x93,0xA3,0xF8, ++ ++ 0x54,0x07,0x24,0x0C,0xC8,0xC3,0x33,0xC4, ++ ++ 0x54,0x0F,0x44,0x20,0xC8,0x83,0x40,0x04, ++ ++ 0xF4,0x56,0x80,0x01,0x46,0xF6,0xDF,0xE4, ++ ++ 0x80,0x0B,0x01,0x02,0x04,0x08,0x10,0x20, ++ ++ 0x40,0x80,0x90,0x91,0xE6,0xE4,0x7E,0x01, ++ ++ 0x93,0x60,0xBC,0xA3,0xFF,0x54,0x3F,0x30, ++ ++ 0xE5,0x09,0x54,0x1F,0xFE,0xE4,0x93,0xA3, ++ ++ 0x60,0x01,0x0E,0xCF,0x54,0xC0,0x25,0xE0, ++ ++ 0x60,0xA8,0x40,0xB8,0xE4,0x93,0xA3,0xFA, ++ ++ 0xE4,0x93,0xA3,0xF8,0xE4,0x93,0xA3,0xC8, ++ ++ 0xC5,0x82,0xC8,0xCA,0xC5,0x83,0xCA,0xF0, ++ ++ 0xA3,0xC8,0xC5,0x82,0xC8,0xCA,0xC5,0x83, ++ ++ 0xCA,0xDF,0xE9,0xDE,0xE7,0x80,0xBE,0x90, ++ ++ 0xF1,0x14,0xE0,0xFF,0x90,0x43,0xD6,0xE0, ++ ++ 0x6F,0x60,0x04,0x7F,0x01,0x80,0x02,0x7F, ++ ++ 0x00,0x90,0xF1,0x10,0xE0,0xFE,0x90,0x43, ++ ++ 0xD5,0xE0,0x6E,0x60,0x04,0x7E,0x01,0x80, ++ ++ 0x02,0x7E,0x00,0xEE,0x4F,0xFF,0x90,0x42, ++ ++ 0x2A,0xE0,0x64,0x01,0x70,0x3C,0x90,0xF5, ++ ++ 0x41,0xE0,0x60,0x03,0xEF,0x60,0x40,0x90, ++ ++ 0xF5,0x41,0xE4,0xF0,0x04,0xF0,0x90,0xF5, ++ ++ 0x4C,0xE0,0xB4,0x01,0xF9,0x90,0xF6,0x5D, ++ ++ 0x74,0x01,0xF0,0x90,0xF1,0x10,0xE0,0x70, ++ ++ 0x06,0x90,0xF1,0x14,0xE0,0x60,0x20,0x90, ++ ++ 0xF4,0xC1,0xE0,0x70,0x1A,0x90,0xF4,0xC4, ++ ++ 0xE0,0x70,0x14,0x90,0xF6,0x5C,0x04,0xF0, ++ ++ 0x80,0x0D,0x90,0xF5,0x41,0xE4,0xF0,0x90, ++ ++ 0xF6,0x5D,0xF0,0x90,0xF6,0x5C,0xF0,0x90, ++ ++ 0xF1,0x10,0xE0,0x90,0x43,0xD5,0xF0,0x90, ++ ++ 0xF1,0x14,0xE0,0x90,0x43,0xD6,0xF0,0x22, ++ ++ 0x90,0x44,0x85,0xEE,0xF0,0xA3,0xEF,0xF0, ++ ++ 0xA3,0xED,0xF0,0xE4,0xA3,0xF0,0xA3,0xF0, ++ ++ 0xA3,0xF0,0x90,0xF4,0x1D,0xE0,0x90,0x44, ++ ++ 0x8B,0xF0,0x90,0x42,0x64,0xE0,0xFC,0xA3, ++ ++ 0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF, ++ ++ 0x90,0x44,0x88,0xE0,0xF8,0xA3,0xE0,0xF9, ++ ++ 0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0xC3,0x12, ++ ++ 0x4B,0x0B,0x40,0x48,0x90,0x44,0x88,0xE0, ++ ++ 0xFC,0xA3,0xE0,0xFD,0xA3,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0x90,0x42,0x64,0x12,0x4B,0x6C, ++ ++ 0x90,0x44,0x85,0xE0,0xFF,0xA3,0xE0,0x90, ++ ++ 0x42,0x6C,0xCF,0xF0,0xA3,0xEF,0xF0,0x90, ++ ++ 0x44,0x87,0xE0,0x70,0x10,0x90,0x42,0x66, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x42,0x68,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x22,0x90,0x42,0x66, ++ ++ 0xE0,0xFF,0xA3,0xE0,0x90,0x42,0x6A,0xCF, ++ ++ 0xF0,0xA3,0xEF,0xF0,0x22,0x90,0xF9,0x05, ++ ++ 0xE0,0x60,0x0A,0x90,0xF4,0xC4,0xE0,0x90, ++ ++ 0x44,0x74,0xF0,0x80,0x08,0x90,0xF4,0xC5, ++ ++ 0xE0,0x90,0x44,0x74,0xF0,0x90,0x44,0x74, ++ ++ 0xE0,0x14,0x60,0x20,0x14,0x60,0x2F,0x14, ++ ++ 0x60,0x3D,0x14,0x60,0x4B,0x24,0x04,0x70, ++ ++ 0x57,0x90,0xF7,0x7F,0x74,0xE0,0xF0,0xA3, ++ ++ 0x74,0x01,0xF0,0xA3,0x74,0xBB,0xF0,0xA3, ++ ++ 0x74,0x01,0xF0,0x22,0x90,0xF7,0x7F,0x74, ++ ++ 0x40,0xF0,0xA3,0x74,0x01,0xF0,0xA3,0x74, ++ ++ 0x55,0xF0,0xA3,0xE4,0xF0,0x22,0x90,0xF7, ++ ++ 0x7F,0x74,0xFA,0xF0,0xA3,0xE4,0xF0,0xA3, ++ ++ 0x74,0x30,0xF0,0xA3,0xE4,0xF0,0x22,0x90, ++ ++ 0xF7,0x7F,0x74,0xF5,0xF0,0xA3,0xE4,0xF0, ++ ++ 0xA3,0x74,0x15,0xF0,0xA3,0xE4,0xF0,0x22, ++ ++ 0x90,0xF7,0x7F,0x74,0xA0,0xF0,0xA3,0xE4, ++ ++ 0xF0,0xA3,0x74,0x15,0xF0,0xA3,0xE4,0xF0, ++ ++ 0x22,0xE4,0xFD,0x90,0xF5,0xF7,0xE0,0xFE, ++ ++ 0x90,0xF5,0xF6,0xE0,0x7A,0x00,0x24,0x00, ++ ++ 0xFF,0xEA,0x3E,0x90,0x43,0x4E,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x90,0x43,0x4E,0xE0,0xFE,0xA3, ++ ++ 0xE0,0xFF,0xC3,0x94,0x40,0xEE,0x94,0x08, ++ ++ 0x40,0x0A,0xD3,0xEF,0x94,0x60,0xEE,0x94, ++ ++ 0x08,0x50,0x01,0x0D,0x90,0x41,0xEF,0xE0, ++ ++ 0x64,0x02,0x70,0x45,0xED,0x64,0x01,0x70, ++ ++ 0x40,0x90,0xF9,0x04,0xE0,0x64,0x01,0x70, ++ ++ 0x38,0x90,0xF9,0x01,0xE0,0x64,0x03,0x70, ++ ++ 0x30,0x90,0xF9,0x00,0xE0,0x64,0x01,0x70, ++ ++ 0x28,0x90,0xF9,0x03,0xE0,0x64,0x02,0x70, ++ ++ 0x20,0x90,0x43,0x65,0xE0,0xFF,0x70,0x0B, ++ ++ 0x90,0xF5,0x6C,0x74,0xE5,0xF0,0xA3,0x74, ++ ++ 0x01,0xF0,0x22,0xEF,0xB4,0x01,0x0A,0x90, ++ ++ 0xF5,0x6C,0x74,0x1B,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0x22,0x90,0x41,0xD6,0xE0,0xB4,0x01, ++ ++ 0x0B,0x90,0xF0,0x7F,0x74,0x01,0xF0,0xA3, ++ ++ 0xE4,0xF0,0x80,0x08,0x90,0xF0,0x7F,0xE4, ++ ++ 0xF0,0xA3,0x04,0xF0,0x90,0x43,0x4B,0x74, ++ ++ 0x01,0xF0,0xE4,0x90,0x41,0xD1,0xF0,0x90, ++ ++ 0xF7,0x3C,0xE0,0x60,0x09,0xE4,0x90,0x41, ++ ++ 0xCE,0xF0,0x90,0x41,0xCD,0xF0,0xE4,0x90, ++ ++ 0x43,0x47,0xF0,0xA3,0xF0,0x90,0x43,0x49, ++ ++ 0xF0,0xA3,0xF0,0x90,0x44,0x3B,0x04,0xF0, ++ ++ 0x12,0x64,0xA5,0x90,0x41,0xE6,0xE0,0x70, ++ ++ 0x04,0x7F,0x01,0x80,0x02,0x7F,0x00,0x90, ++ ++ 0x42,0x5F,0xEF,0xF0,0x12,0xAA,0x3A,0x12, ++ ++ 0xAF,0x90,0x90,0x43,0xD0,0x74,0x01,0xF0, ++ ++ 0xE4,0x90,0x43,0xBE,0xF0,0x90,0xF7,0x31, ++ ++ 0xE0,0xB4,0x01,0x03,0x12,0xAC,0x7D,0xE4, ++ ++ 0x90,0x43,0xBC,0xF0,0x90,0x43,0xBB,0x04, ++ ++ 0xF0,0x22,0x7F,0xD4,0x7E,0x27,0x12,0xAF, ++ ++ 0x5E,0x20,0x8C,0xFD,0x90,0xF1,0x48,0x74, ++ ++ 0x01,0xF0,0x90,0xF0,0x92,0xE4,0xF0,0x90, ++ ++ 0xF0,0x91,0x04,0xF0,0x90,0xF0,0x94,0xF0, ++ ++ 0x90,0xF0,0x81,0xF0,0x90,0xF0,0x91,0xE4, ++ ++ 0xF0,0xA3,0x04,0xF0,0x90,0xF0,0x94,0xE0, ++ ++ 0xB4,0x01,0xF9,0x90,0xF1,0xFB,0xE4,0xF0, ++ ++ 0x90,0xF1,0xFA,0x04,0xF0,0x90,0xF1,0xFD, ++ ++ 0xF0,0x90,0xF1,0xFC,0xF0,0x90,0xF1,0xFA, ++ ++ 0xE4,0xF0,0xA3,0x04,0xF0,0x90,0xF1,0xFD, ++ ++ 0xE0,0xB4,0x01,0xF9,0x90,0xF1,0xF7,0xE4, ++ ++ 0xF0,0x90,0xF1,0xF6,0x04,0xF0,0x90,0xF1, ++ ++ 0xF9,0xF0,0x90,0xF1,0xF8,0x04,0xF0,0x90, ++ ++ 0xF2,0x14,0x14,0xF0,0x90,0xF1,0xF6,0xE4, ++ ++ 0xF0,0xA3,0x04,0xF0,0x90,0xF1,0xF9,0xE0, ++ ++ 0xB4,0x01,0xF9,0x90,0x43,0xBB,0x74,0x01, ++ ++ 0xF0,0x22,0x90,0xF1,0xEA,0xE4,0xF0,0x90, ++ ++ 0xF1,0xEF,0xF0,0x90,0xF1,0xF2,0xF0,0x90, ++ ++ 0xF0,0x7C,0xF0,0x90,0xF1,0xFB,0xF0,0x90, ++ ++ 0xF1,0xF7,0xF0,0x90,0xF1,0xE8,0x04,0xF0, ++ ++ 0x90,0xF1,0xEB,0xF0,0x90,0xF1,0xF0,0xF0, ++ ++ 0x90,0xF1,0xF3,0xF0,0x90,0xF0,0x7D,0xF0, ++ ++ 0x90,0xF1,0xFA,0xF0,0x90,0xF1,0xF6,0xF0, ++ ++ 0x90,0xF1,0xF8,0xE4,0xF0,0x90,0xF1,0xFC, ++ ++ 0x74,0x03,0xF0,0x90,0xF1,0xE8,0xE4,0xF0, ++ ++ 0x90,0xF1,0xEB,0xF0,0x90,0xF1,0xF0,0xF0, ++ ++ 0x90,0xF1,0xF3,0xF0,0x90,0xF0,0x7D,0xF0, ++ ++ 0x90,0xF1,0xFA,0xF0,0x90,0xF1,0xF6,0xF0, ++ ++ 0x90,0xF1,0xEA,0x04,0xF0,0x90,0xF1,0xEF, ++ ++ 0xF0,0x90,0xF1,0xF2,0xF0,0x90,0xF0,0x7C, ++ ++ 0xF0,0x90,0xF1,0xF7,0xF0,0x90,0xF1,0xFB, ++ ++ 0xF0,0x90,0xF5,0xC2,0xF0,0xE4,0xF0,0x22, ++ ++ 0xEF,0xB4,0x02,0x1B,0x90,0x43,0xD7,0x74, ++ ++ 0x0B,0xF0,0xA3,0x74,0xB3,0xF0,0xA3,0x74, ++ ++ 0x0A,0xF0,0xA3,0x74,0x73,0xF0,0xA3,0x74, ++ ++ 0x33,0xF0,0xA3,0x74,0xE5,0xF0,0x22,0xEF, ++ ++ 0xB4,0x04,0x1B,0x90,0x43,0xD7,0x74,0x0B, ++ ++ 0xF0,0xA3,0x74,0xE3,0xF0,0xA3,0x74,0x0A, ++ ++ 0xF0,0xA3,0x74,0x9D,0xF0,0xA3,0x74,0x33, ++ ++ 0xF0,0xA3,0x74,0xB3,0xF0,0x22,0xEF,0xB4, ++ ++ 0x05,0x1B,0x90,0x43,0xD7,0x74,0x0B,0xF0, ++ ++ 0xA3,0x74,0xA3,0xF0,0xA3,0x74,0x0A,0xF0, ++ ++ 0xA3,0x74,0x65,0xF0,0xA3,0x74,0x33,0xF0, ++ ++ 0xA3,0x74,0xF4,0xF0,0x22,0xEF,0xB4,0x0B, ++ ++ 0x1A,0x90,0x43,0xD7,0x74,0x0B,0xF0,0xA3, ++ ++ 0x74,0xD5,0xF0,0xA3,0x74,0x0A,0xF0,0xA3, ++ ++ 0x74,0x91,0xF0,0xA3,0x74,0x33,0xF0,0xA3, ++ ++ 0x74,0xC1,0xF0,0x22,0x90,0xF1,0x61,0xE0, ++ ++ 0xFE,0x90,0xF1,0x60,0xE0,0x7C,0x00,0x24, ++ ++ 0x00,0xFF,0xEC,0x3E,0x90,0x44,0xC6,0xF0, ++ ++ 0xA3,0xEF,0xF0,0x90,0x42,0x52,0xE0,0x60, ++ ++ 0x5A,0xE4,0x90,0x43,0x9E,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF2,0x10,0xE0,0x90,0x43,0xA0,0xF0, ++ ++ 0x90,0xF2,0x0F,0xE0,0x90,0x43,0xA1,0xF0, ++ ++ 0x90,0x42,0x40,0xE0,0xFF,0xE4,0xFC,0xFD, ++ ++ 0xFE,0x90,0x43,0x9E,0xE0,0xF8,0xA3,0xE0, ++ ++ 0xF9,0xA3,0xE0,0xFA,0xA3,0xE0,0xFB,0x12, ++ ++ 0x4A,0xAE,0x90,0x43,0x9E,0x12,0x4B,0x6C, ++ ++ 0x90,0x43,0x9E,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0xF2, ++ ++ 0x11,0xE0,0xF9,0xF8,0x12,0x4B,0x32,0x90, ++ ++ 0x43,0xA3,0xE0,0x2F,0xF0,0x90,0x43,0xA2, ++ ++ 0xE0,0x3E,0xF0,0x22,0x90,0xF5,0x6C,0x74, ++ ++ 0x40,0xF0,0xA3,0x74,0x07,0xF0,0x90,0xF9, ++ ++ 0x00,0xE0,0x70,0x16,0x90,0xF5,0x6A,0xF0, ++ ++ 0xA3,0x74,0x05,0xF0,0x90,0xF5,0x70,0x74, ++ ++ 0x03,0xF0,0x90,0xF5,0x6F,0x74,0x01,0xF0, ++ ++ 0x80,0x32,0x90,0xF9,0x00,0xE0,0xB4,0x01, ++ ++ 0x16,0x90,0xF5,0x6A,0xE4,0xF0,0xA3,0x74, ++ ++ 0x04,0xF0,0x90,0xF5,0x70,0x04,0xF0,0x90, ++ ++ 0xF5,0x6F,0x74,0x03,0xF0,0x80,0x15,0x90, ++ ++ 0xF5,0x6A,0xE4,0xF0,0xA3,0x74,0x0A,0xF0, ++ ++ 0x90,0xF5,0x70,0x74,0x04,0xF0,0x90,0xF5, ++ ++ 0x6F,0x74,0x02,0xF0,0x90,0xFD,0x27,0x74, ++ ++ 0x03,0xF0,0x90,0xFD,0x31,0x74,0x40,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x22,0x90,0xF5,0x6C,0x74, ++ ++ 0x80,0xF0,0xA3,0x74,0x06,0xF0,0x90,0xF9, ++ ++ 0x00,0xE0,0x70,0x16,0x90,0xF5,0x6A,0xF0, ++ ++ 0xA3,0x74,0x0A,0xF0,0x90,0xF5,0x70,0x74, ++ ++ 0x04,0xF0,0x90,0xF5,0x6F,0x74,0x02,0xF0, ++ ++ 0x80,0x32,0x90,0xF9,0x00,0xE0,0xB4,0x01, ++ ++ 0x17,0x90,0xF5,0x6A,0xE4,0xF0,0xA3,0x74, ++ ++ 0x08,0xF0,0x90,0xF5,0x70,0x74,0x06,0xF0, ++ ++ 0x90,0xF5,0x6F,0x74,0x04,0xF0,0x80,0x14, ++ ++ 0x90,0xF5,0x6A,0xE4,0xF0,0xA3,0x74,0x04, ++ ++ 0xF0,0x90,0xF5,0x70,0x04,0xF0,0x90,0xF5, ++ ++ 0x6F,0x74,0x03,0xF0,0x90,0xFD,0x27,0x74, ++ ++ 0x04,0xF0,0x90,0xFD,0x31,0x74,0x80,0xF0, ++ ++ 0xA3,0xE4,0xF0,0x22,0x90,0x42,0x36,0xE0, ++ ++ 0x64,0x01,0x70,0x5D,0x90,0x42,0x3C,0xE0, ++ ++ 0x70,0x04,0x90,0x42,0xF8,0xF0,0x90,0x42, ++ ++ 0x3D,0xE0,0x64,0x01,0x70,0x30,0x90,0x42, ++ ++ 0xF8,0xE0,0x64,0x01,0x70,0x28,0x90,0xFD, ++ ++ 0xA5,0x04,0xF0,0x90,0xF9,0x00,0xE0,0x60, ++ ++ 0x05,0x90,0xF9,0x00,0xE0,0xFF,0x12,0x98, ++ ++ 0x85,0x90,0x42,0x38,0xE0,0xB4,0x01,0x29, ++ ++ 0xE4,0x90,0x42,0xF8,0xF0,0x12,0xAE,0xFD, ++ ++ 0xE4,0x90,0x42,0x38,0xF0,0x22,0x90,0xFD, ++ ++ 0xA5,0xE4,0xF0,0x90,0x42,0xF8,0xE0,0xB4, ++ ++ 0x01,0x0C,0x12,0xAE,0xFD,0xE4,0x90,0x42, ++ ++ 0x38,0xF0,0x90,0x42,0xF8,0xF0,0x12,0x57, ++ ++ 0x52,0x22,0x90,0x42,0x4A,0xE0,0x60,0x06, ++ ++ 0x90,0xFB,0x2A,0x74,0x71,0xF0,0x90,0xFB, ++ ++ 0x97,0xE4,0xF0,0x7F,0x11,0x12,0xAD,0x3C, ++ ++ 0xE4,0x90,0x44,0xD6,0xF0,0x74,0xFF,0xFB, ++ ++ 0xFA,0xE4,0xFD,0x7F,0x01,0x12,0xAC,0x13, ++ ++ 0x90,0x44,0xD6,0xE0,0x04,0xF0,0xE0,0xC3, ++ ++ 0x94,0x02,0x40,0xE9,0x90,0xFB,0x08,0xE0, ++ ++ 0xFE,0x90,0xFB,0x07,0xE0,0x7C,0x00,0x24, ++ ++ 0x00,0xFF,0xEC,0x3E,0x90,0x44,0x50,0xF0, ++ ++ 0xA3,0xEF,0xF0,0xE0,0x90,0x41,0xFC,0xF0, ++ ++ 0x90,0xFB,0x97,0x74,0x01,0xF0,0x7F,0x11, ++ ++ 0x12,0xAD,0x3C,0x90,0x42,0x4A,0xE0,0x60, ++ ++ 0x06,0x90,0xFB,0x2A,0x74,0x75,0xF0,0x22, ++ ++ 0xE5,0x13,0x14,0xB4,0x08,0x00,0x50,0x5D, ++ ++ 0x90,0x9F,0xD7,0x75,0xF0,0x03,0xA4,0xC5, ++ ++ 0x83,0x25,0xF0,0xC5,0x83,0x73,0x02,0x9F, ++ ++ 0xEF,0x02,0x9F,0xF6,0x02,0x9F,0xFD,0x02, ++ ++ 0xA0,0x04,0x02,0xA0,0x0B,0x02,0xA0,0x12, ++ ++ 0x02,0xA0,0x19,0x02,0xA0,0x20,0x90,0xF2, ++ ++ 0x1B,0x74,0x01,0xF0,0x22,0x90,0xF2,0x1B, ++ ++ 0x74,0x02,0xF0,0x22,0x90,0xF2,0x1B,0x74, ++ ++ 0x03,0xF0,0x22,0x90,0xF2,0x1B,0x74,0x04, ++ ++ 0xF0,0x22,0x90,0xF2,0x1B,0x74,0x05,0xF0, ++ ++ 0x22,0x90,0xF2,0x1B,0x74,0x06,0xF0,0x22, ++ ++ 0x90,0xF2,0x1B,0x74,0x07,0xF0,0x22,0x90, ++ ++ 0xF2,0x1B,0x74,0x08,0xF0,0x22,0x90,0xF5, ++ ++ 0x6C,0xE4,0xF0,0xA3,0x74,0x05,0xF0,0x90, ++ ++ 0xF9,0x00,0xE0,0x70,0x15,0x90,0xF5,0x6A, ++ ++ 0xF0,0xA3,0x74,0x04,0xF0,0x90,0xF5,0x70, ++ ++ 0x04,0xF0,0x90,0xF5,0x6F,0x74,0x03,0xF0, ++ ++ 0x80,0x31,0x90,0xF9,0x00,0xE0,0xB4,0x01, ++ ++ 0x15,0x90,0xF5,0x6A,0xE4,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF5,0x70,0x74,0x07,0xF0,0x90,0xF5, ++ ++ 0x6F,0x74,0x05,0xF0,0x80,0x15,0x90,0xF5, ++ ++ 0x6A,0xE4,0xF0,0xA3,0x74,0x08,0xF0,0x90, ++ ++ 0xF5,0x70,0x74,0x06,0xF0,0x90,0xF5,0x6F, ++ ++ 0x74,0x04,0xF0,0x90,0xFD,0x27,0x74,0x07, ++ ++ 0xF0,0x90,0xFD,0x31,0xE4,0xF0,0xA3,0x04, ++ ++ 0xF0,0x22,0x90,0xF5,0x6C,0xE4,0xF0,0xA3, ++ ++ 0x74,0x02,0xF0,0x90,0xF9,0x00,0xE0,0x70, ++ ++ 0x16,0x90,0xF5,0x6A,0xF0,0xA3,0x74,0x08, ++ ++ 0xF0,0x90,0xF5,0x70,0x74,0x04,0xF0,0x90, ++ ++ 0xF5,0x6F,0x74,0x02,0xF0,0x80,0x2F,0x90, ++ ++ 0xF9,0x00,0xE0,0xB4,0x01,0x15,0x90,0xF5, ++ ++ 0x6A,0xE4,0xF0,0xA3,0xF0,0x90,0xF5,0x70, ++ ++ 0x74,0x06,0xF0,0x90,0xF5,0x6F,0x74,0x04, ++ ++ 0xF0,0x80,0x13,0x90,0xF5,0x6A,0xE4,0xF0, ++ ++ 0xA3,0xF0,0x90,0xF5,0x70,0x74,0x05,0xF0, ++ ++ 0x90,0xF5,0x6F,0x74,0x03,0xF0,0x90,0xFD, ++ ++ 0x27,0x74,0x07,0xF0,0x90,0xFD,0x31,0xE4, ++ ++ 0xF0,0xA3,0x74,0x02,0xF0,0x22,0x90,0xF4, ++ ++ 0x1A,0x74,0x0D,0xF0,0x90,0xF4,0x10,0x74, ++ ++ 0x08,0xF0,0x90,0xF4,0x18,0xF0,0x90,0xF5, ++ ++ 0x61,0x74,0x06,0xF0,0xE4,0x90,0x44,0xCD, ++ ++ 0xF0,0x90,0x42,0x59,0xF0,0x90,0x42,0x5B, ++ ++ 0xF0,0x90,0x42,0x5C,0xF0,0x90,0x42,0x5E, ++ ++ 0xF0,0x90,0x42,0x5A,0xF0,0x90,0x42,0x5D, ++ ++ 0xF0,0x90,0x42,0x57,0x04,0xF0,0x90,0xF5, ++ ++ 0xBD,0xF0,0x90,0xF5,0xBB,0xF0,0x90,0xF5, ++ ++ 0xBD,0xE4,0xF0,0x90,0xF5,0xBF,0x04,0xF0, ++ ++ 0x90,0x42,0x58,0xF0,0x90,0xF5,0xB3,0xF0, ++ ++ 0x90,0xF5,0xB1,0xF0,0x90,0xF5,0xB3,0xE4, ++ ++ 0xF0,0x90,0xF5,0xB2,0x04,0xF0,0xD2,0xE9, ++ ++ 0x22,0xD0,0xE0,0xF5,0xF0,0xFC,0xD0,0xE0, ++ ++ 0xFD,0x12,0x4C,0x61,0x85,0x0F,0xF0,0xE5, ++ ++ 0x81,0x90,0x00,0x02,0x12,0x4C,0x80,0x85, ++ ++ 0x0E,0xF0,0xE5,0x0D,0x90,0x00,0x04,0x12, ++ ++ 0x4C,0x80,0xE5,0x10,0x90,0x00,0x06,0x12, ++ ++ 0x4B,0xDC,0x8D,0x82,0x8C,0x83,0xE4,0xFE, ++ ++ 0xFF,0x73,0xED,0xFF,0xEC,0xFE,0x12,0x4B, ++ ++ 0xFE,0xFC,0xAD,0xF0,0x90,0x00,0x02,0x12, ++ ++ 0x4C,0x29,0x85,0xF0,0x81,0xF5,0x0F,0x90, ++ ++ 0x00,0x04,0x12,0x4C,0x29,0xF5,0x0E,0x85, ++ ++ 0xF0,0x0D,0x90,0x00,0x06,0x12,0x4B,0xAF, ++ ++ 0xF5,0x10,0x8D,0x82,0x8C,0x83,0xE4,0x73, ++ ++ 0x12,0xAB,0xC7,0xE4,0x90,0x41,0xD8,0xF0, ++ ++ 0x90,0x41,0xE7,0xE0,0x90,0xF0,0x76,0xF0, ++ ++ 0x90,0x43,0xB6,0x74,0x01,0xF0,0x90,0x43, ++ ++ 0xBB,0xF0,0x90,0x43,0xB7,0xF0,0xE4,0x90, ++ ++ 0x43,0xBA,0xF0,0xF5,0x13,0x90,0x41,0xDD, ++ ++ 0xE0,0xB4,0x01,0x14,0x90,0x44,0x71,0x74, ++ ++ 0x01,0xF0,0x12,0x9B,0xB3,0x12,0xAF,0x51, ++ ++ 0x90,0xFB,0xA8,0x74,0x01,0xF0,0x80,0x16, ++ ++ 0x90,0xFB,0xA8,0xE4,0xF0,0x12,0xAF,0x1A, ++ ++ 0xE4,0x90,0x44,0x71,0xF0,0x90,0x42,0x47, ++ ++ 0xE0,0x60,0x03,0x12,0x9F,0x5B,0xE4,0x90, ++ ++ 0x41,0xDD,0xF0,0x22,0x90,0x41,0xD5,0xE0, ++ ++ 0x60,0x07,0x90,0xF0,0x2B,0xE4,0xF0,0x80, ++ ++ 0x39,0x90,0x42,0x01,0xE0,0xF9,0x90,0x42, ++ ++ 0x02,0xE0,0x89,0xF0,0xA4,0xFF,0x90,0x43, ++ ++ 0xB4,0xE0,0xFC,0xA3,0xE0,0xFD,0xD3,0x9F, ++ ++ 0xEC,0x95,0xF0,0x40,0x08,0x90,0xF0,0x2B, ++ ++ 0x74,0x01,0xF0,0x80,0x15,0x90,0x42,0x03, ++ ++ 0xE0,0x89,0xF0,0xA4,0xFF,0xC3,0xED,0x9F, ++ ++ 0xEC,0x95,0xF0,0x50,0x05,0x90,0xF0,0x2B, ++ ++ 0xE4,0xF0,0x90,0xF0,0x2B,0xE0,0x60,0x07, ++ ++ 0x90,0x43,0xAA,0x74,0x15,0xF0,0x22,0x90, ++ ++ 0x42,0x29,0xE0,0x90,0x43,0xAA,0xF0,0x22, ++ ++ 0xC2,0xAF,0x90,0x44,0xCD,0xE0,0x04,0xF0, ++ ++ 0x12,0x74,0x95,0x90,0xF5,0xBE,0x74,0x01, ++ ++ 0xF0,0x12,0x77,0x1C,0x90,0x44,0x9B,0x74, ++ ++ 0x01,0xF0,0x90,0x44,0xCD,0xE0,0x64,0xAF, ++ ++ 0x70,0x31,0x90,0xF5,0xC1,0xE0,0x70,0x04, ++ ++ 0x90,0x42,0x57,0xF0,0x90,0xF5,0xBA,0xE0, ++ ++ 0x70,0x04,0x90,0x42,0x58,0xF0,0x90,0x42, ++ ++ 0x58,0xE0,0x70,0x17,0x90,0x42,0x57,0xE0, ++ ++ 0x70,0x11,0x90,0xF5,0xB9,0x04,0xF0,0x90, ++ ++ 0xF5,0xC0,0xF0,0xD2,0xE9,0x90,0x44,0x9B, ++ ++ 0xF0,0xD2,0xEA,0x53,0x91,0xDF,0xD2,0xAF, ++ ++ 0x22,0xAD,0x07,0x75,0x0A,0x01,0x75,0x0B, ++ ++ 0xFE,0x75,0x0C,0x01,0xE4,0xF5,0x08,0xF5, ++ ++ 0x09,0xED,0x60,0x3B,0xB4,0x01,0x16,0xAB, ++ ++ 0x0A,0xAA,0x0B,0xA9,0x0C,0x12,0x49,0xF8, ++ ++ 0xFE,0xE4,0x25,0x09,0xF5,0x09,0xEE,0x35, ++ ++ 0x08,0xF5,0x08,0x80,0x22,0x85,0x0C,0x82, ++ ++ 0x85,0x0B,0x83,0xE0,0xFE,0xA3,0xE0,0x25, ++ ++ 0x09,0xF5,0x09,0xEE,0x35,0x08,0xF5,0x08, ++ ++ 0x74,0x02,0x25,0x0C,0xF5,0x0C,0xE4,0x35, ++ ++ 0x0B,0xF5,0x0B,0x1D,0x1D,0x80,0xC2,0xAE, ++ ++ 0x08,0xAF,0x09,0x22,0x90,0xFB,0x08,0xE0, ++ ++ 0xFE,0x90,0xFB,0x07,0xE0,0x7C,0x00,0x24, ++ ++ 0x00,0xFF,0xEC,0x3E,0xFE,0x90,0x44,0x50, ++ ++ 0xE0,0xFC,0xA3,0xE0,0xFD,0xC3,0xEF,0x9D, ++ ++ 0xFF,0xEE,0x9C,0xFE,0x90,0x42,0x45,0xE0, ++ ++ 0xFD,0xEF,0xA8,0x05,0x08,0x80,0x05,0xCE, ++ ++ 0xC3,0x13,0xCE,0x13,0xD8,0xF9,0xFF,0x90, ++ ++ 0xFB,0x28,0xE0,0xB4,0x86,0x13,0x90,0x42, ++ ++ 0x00,0xE0,0xFE,0xA8,0x05,0x08,0x80,0x02, ++ ++ 0xC3,0x13,0xD8,0xFC,0xFE,0xC3,0xEF,0x9E, ++ ++ 0xFF,0x90,0x41,0xFD,0xEF,0xF0,0x22,0x90, ++ ++ 0x42,0x52,0xE0,0x60,0x43,0x90,0x43,0x8E, ++ ++ 0xE0,0xFF,0xD3,0x94,0x01,0x50,0x07,0xEF, ++ ++ 0x60,0x36,0x74,0x02,0xF0,0x22,0x90,0x43, ++ ++ 0xA2,0xE0,0xFE,0xA3,0xE0,0xFF,0xA3,0xEE, ++ ++ 0xF0,0xA3,0xEF,0xF0,0xD3,0x94,0x50,0xEE, ++ ++ 0x94,0x07,0x40,0x08,0x90,0x41,0xD5,0x74, ++ ++ 0x01,0xF0,0x80,0x0E,0xC3,0xEF,0x94,0x50, ++ ++ 0xEE,0x94,0x05,0x50,0x05,0xE4,0x90,0x41, ++ ++ 0xD5,0xF0,0x90,0x43,0x8E,0x74,0x03,0xF0, ++ ++ 0x22,0x90,0x42,0x3B,0xE0,0x64,0x01,0x70, ++ ++ 0x40,0x90,0xFD,0x9D,0xE0,0xFE,0x90,0xFD, ++ ++ 0x9C,0xE0,0x7C,0x00,0x24,0x00,0xFF,0xEC, ++ ++ 0x3E,0xFE,0xC3,0xEF,0x94,0x46,0xEE,0x94, ++ ++ 0x00,0x50,0x26,0x90,0xFD,0x37,0xE0,0xB4, ++ ++ 0x07,0x1F,0xE4,0x90,0x42,0x39,0xF0,0x90, ++ ++ 0xFD,0x2B,0xF0,0x7D,0xFF,0x7C,0x7F,0xFF, ++ ++ 0x12,0xAB,0xED,0x90,0x44,0xAA,0xE0,0x64, ++ ++ 0x01,0x60,0xF8,0x90,0xFD,0x2B,0x74,0x01, ++ ++ 0xF0,0x22,0x90,0x42,0x2B,0xE0,0x90,0xF7, ++ ++ 0x5A,0xF0,0x90,0x41,0xE5,0xE0,0x90,0xF7, ++ ++ 0x5B,0xF0,0x90,0x42,0x33,0xE0,0x90,0xF7, ++ ++ 0x5C,0xF0,0xA3,0xEF,0xF0,0x90,0xF9,0x00, ++ ++ 0xE0,0x90,0xF7,0x5E,0xF0,0x90,0x41,0xDB, ++ ++ 0xE0,0x90,0xF7,0x5F,0xF0,0x90,0xF7,0x61, ++ ++ 0x74,0x01,0xF0,0x90,0xF7,0x60,0xF0,0x7F, ++ ++ 0x00,0x7E,0x28,0x12,0xAF,0x5E,0x20,0x8C, ++ ++ 0xFD,0x90,0xF7,0x61,0xE4,0xF0,0x90,0xF7, ++ ++ 0x60,0xF0,0x22,0x90,0x44,0x9A,0x74,0x01, ++ ++ 0xF0,0x90,0xF7,0x42,0xE0,0x90,0x44,0x9C, ++ ++ 0xF0,0xE0,0x90,0xF9,0x00,0xF0,0x90,0xF7, ++ ++ 0x44,0xE0,0xFF,0x90,0xF9,0x08,0xF0,0x90, ++ ++ 0xF7,0x43,0xE0,0xFF,0x90,0xF9,0x03,0xF0, ++ ++ 0x90,0xF7,0x46,0xE0,0xFF,0x90,0xF9,0x06, ++ ++ 0xF0,0x90,0xF7,0x47,0xE0,0xFF,0x90,0xF9, ++ ++ 0x07,0xF0,0x90,0xF7,0x45,0xE0,0x54,0x03, ++ ++ 0xFF,0x90,0xF9,0x02,0xF0,0x90,0xF9,0x05, ++ ++ 0x74,0x01,0xF0,0x22,0x75,0xF0,0x02,0xE5, ++ ++ 0x13,0xA4,0x24,0xC5,0xF5,0x82,0xE5,0xF0, ++ ++ 0x34,0xAF,0xF5,0x83,0xE4,0x93,0xFC,0x74, ++ ++ 0x01,0x93,0xFD,0xE4,0xFF,0x12,0xAB,0xED, ++ ++ 0x90,0xF1,0x48,0xE4,0xF0,0x90,0xF0,0x81, ++ ++ 0x74,0x03,0xF0,0x90,0xF1,0xFC,0xF0,0x90, ++ ++ 0xF5,0xAF,0xE4,0xF0,0x04,0xF0,0x90,0xF5, ++ ++ 0xB4,0xE0,0xB4,0x01,0xF9,0x90,0xF5,0xAF, ++ ++ 0xE4,0xF0,0x90,0x43,0xBB,0x04,0xF0,0x22, ++ ++ 0xC2,0xD5,0xE8,0x30,0xE7,0x0F,0xB2,0xD5, ++ ++ 0xE4,0xC3,0x9B,0xFB,0xE4,0x9A,0xFA,0xE4, ++ ++ 0x99,0xF9,0xE4,0x98,0xF8,0xEC,0x30,0xE7, ++ ++ 0x17,0xB2,0xD5,0x12,0xA5,0x07,0x12,0x4C, ++ ++ 0xE9,0xE4,0xC3,0x9B,0xFB,0xE4,0x9A,0xFA, ++ ++ 0xE4,0x99,0xF9,0xE4,0x98,0xF8,0x80,0x03, ++ ++ 0x12,0x4C,0xE9,0x30,0xD5,0x0D,0xE4,0xC3, ++ ++ 0x9F,0xFF,0xE4,0x9E,0xFE,0xE4,0x9D,0xFD, ++ ++ 0xE4,0x9C,0xFC,0x22,0xE4,0x90,0x43,0xDD, ++ ++ 0xF0,0x90,0xF9,0x00,0xE0,0x70,0x09,0x90, ++ ++ 0x42,0x26,0xE0,0x90,0x43,0xDD,0xF0,0x22, ++ ++ 0x90,0xF9,0x00,0xE0,0xB4,0x01,0x1F,0x90, ++ ++ 0x41,0xE5,0xE0,0xB4,0x01,0x09,0x90,0x42, ++ ++ 0x24,0xE0,0x90,0x43,0xDD,0xF0,0x22,0x90, ++ ++ 0xF0,0x2B,0xE0,0x70,0x11,0x90,0x42,0x27, ++ ++ 0xE0,0x90,0x43,0xDD,0xF0,0x22,0x90,0x42, ++ ++ 0x25,0xE0,0x90,0x43,0xDD,0xF0,0x22,0x90, ++ ++ 0x41,0xD7,0xE0,0x64,0x27,0x70,0x38,0x90, ++ ++ 0x43,0xB0,0xE0,0xB4,0x01,0x1B,0x90,0x41, ++ ++ 0xD5,0xE0,0x64,0x01,0x60,0x08,0x90,0x41, ++ ++ 0xDC,0xE0,0x64,0x01,0x60,0x0B,0xE4,0x90, ++ ++ 0x43,0xB0,0xF0,0x7F,0x17,0x12,0xAD,0x3C, ++ ++ 0x22,0x90,0x43,0xB0,0xE0,0x70,0x10,0x90, ++ ++ 0x41,0xD5,0xE0,0x70,0x0A,0x90,0x43,0xB0, ++ ++ 0x04,0xF0,0x7F,0x16,0x12,0xAD,0x3C,0x22, ++ ++ 0xE5,0x13,0xD3,0x94,0x02,0x40,0x39,0x90, ++ ++ 0x43,0xB1,0xE0,0xB4,0x01,0x03,0x12,0xAC, ++ ++ 0x37,0x90,0x43,0xB1,0xE0,0x70,0x29,0x90, ++ ++ 0x42,0x01,0xE0,0xFF,0x90,0x43,0xB2,0xE0, ++ ++ 0xC3,0x9F,0x50,0x0D,0x12,0xA6,0x1B,0x12, ++ ++ 0x9D,0xAD,0x90,0x43,0xB2,0xE0,0x04,0xF0, ++ ++ 0x22,0x90,0x43,0xB1,0x74,0x01,0xF0,0x12, ++ ++ 0xA3,0x68,0x12,0xA2,0x0D,0x12,0xAD,0x1D, ++ ++ 0x22,0x90,0xF9,0x00,0xE0,0x70,0x19,0x90, ++ ++ 0x43,0x23,0xE0,0xFE,0xA3,0xE0,0xFF,0x7C, ++ ++ 0x06,0x7D,0xA8,0x12,0x4A,0x23,0x90,0x43, ++ ++ 0x23,0xEC,0xF0,0xA3,0xED,0xF0,0x80,0x1E, ++ ++ 0x90,0xF9,0x00,0xE0,0xB4,0x02,0x17,0x90, ++ ++ 0x43,0x23,0xE0,0xFE,0xA3,0xE0,0xFF,0x7C, ++ ++ 0x0D,0x7D,0x50,0x12,0x4A,0x23,0x90,0x43, ++ ++ 0x23,0xEC,0xF0,0xA3,0xED,0xF0,0x12,0xAC, ++ ++ 0x5B,0x22,0x90,0x43,0xB2,0xE0,0xD3,0x94, ++ ++ 0x00,0x40,0x2E,0x90,0x42,0x40,0xE0,0xFE, ++ ++ 0x90,0x43,0xB3,0xE0,0xFD,0xD3,0x9E,0x40, ++ ++ 0x05,0xED,0x9E,0xFF,0x80,0x0C,0x90,0x43, ++ ++ 0xB3,0xE0,0xFE,0x90,0x42,0x40,0xE0,0xC3, ++ ++ 0x9E,0xFF,0xEF,0xFD,0x90,0x43,0xB5,0xE0, ++ ++ 0x2D,0xF0,0x90,0x43,0xB4,0xE0,0x34,0x00, ++ ++ 0xF0,0x90,0x42,0x40,0xE0,0x90,0x43,0xB3, ++ ++ 0xF0,0x22,0x90,0x44,0xC4,0xEE,0xF0,0xA3, ++ ++ 0xEF,0xF0,0x75,0x11,0xFE,0x75,0x12,0x03, ++ ++ 0xED,0x60,0x2C,0x90,0x44,0xC4,0xE0,0xFE, ++ ++ 0xA3,0xE0,0xF5,0x82,0x8E,0x83,0xE0,0x85, ++ ++ 0x12,0x82,0x85,0x11,0x83,0xF0,0x90,0x44, ++ ++ 0xC5,0xE0,0x04,0xF0,0x70,0x06,0x90,0x44, ++ ++ 0xC4,0xE0,0x04,0xF0,0x05,0x12,0xE5,0x12, ++ ++ 0x70,0x02,0x05,0x11,0x1D,0x80,0xD1,0x22, ++ ++ 0x90,0xFD,0x47,0xE0,0x90,0x43,0x0A,0xF0, ++ ++ 0x90,0xFD,0x46,0xE0,0x90,0x43,0x0B,0xF0, ++ ++ 0x90,0xFD,0x45,0xE0,0x90,0x43,0x0C,0xF0, ++ ++ 0x90,0xFD,0x44,0xE0,0x90,0x43,0x0D,0xF0, ++ ++ 0x90,0x43,0x0A,0xE0,0xFC,0xA3,0xE0,0xFD, ++ ++ 0xA3,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x43, ++ ++ 0x20,0xE0,0xF9,0xF8,0x12,0x4B,0x32,0x90, ++ ++ 0x43,0x0A,0x12,0x4B,0x6C,0x22,0x90,0xF7, ++ ++ 0x3C,0xE0,0x70,0x21,0x90,0xF7,0x31,0xE0, ++ ++ 0x60,0x07,0xE4,0xFF,0x12,0xA3,0xFB,0x80, ++ ++ 0x14,0x90,0xFB,0x88,0xE0,0x64,0x01,0x60, ++ ++ 0xF8,0x90,0xFB,0x96,0x74,0x0D,0xF0,0x90, ++ ++ 0xFB,0x88,0x74,0x01,0xF0,0x12,0xAB,0xC7, ++ ++ 0x12,0xAE,0x8F,0x90,0xF7,0x2F,0xE4,0xF0, ++ ++ 0x90,0x43,0xBA,0x04,0xF0,0x12,0xAD,0x95, ++ ++ 0x22,0x90,0xFB,0x86,0xE0,0x60,0x32,0x90, ++ ++ 0x44,0x72,0xE0,0x70,0x24,0x90,0xFE,0x00, ++ ++ 0xE0,0x24,0x01,0xFF,0xE4,0x33,0xFE,0x90, ++ ++ 0xFB,0x82,0xE0,0xC3,0x9F,0xEE,0x64,0x80, ++ ++ 0xF8,0x74,0x80,0x98,0x50,0x0B,0xE0,0xF4, ++ ++ 0x60,0x07,0x90,0xFB,0x86,0x74,0x01,0xF0, ++ ++ 0x22,0x90,0xFB,0x82,0xE4,0xF0,0x12,0x5F, ++ ++ 0x96,0x22,0x90,0xF7,0x14,0xE0,0x60,0x2E, ++ ++ 0x90,0xF7,0x32,0xE0,0x70,0x06,0x90,0xF7, ++ ++ 0x3C,0xE0,0x60,0x22,0xC2,0xAF,0x90,0xF7, ++ ++ 0x14,0xE4,0xF0,0x7B,0xD4,0x7A,0x27,0xFD, ++ ++ 0x7F,0x01,0x12,0xAC,0x13,0x90,0xF9,0x9D, ++ ++ 0x74,0x01,0xF0,0x90,0xF7,0x16,0xF0,0x90, ++ ++ 0xF7,0x11,0xE4,0xF0,0xD2,0xAF,0x22,0x90, ++ ++ 0x42,0x2B,0xE0,0x60,0x2D,0x90,0xF0,0x2B, ++ ++ 0xE0,0x70,0x1B,0x90,0x43,0x4C,0xE0,0x70, ++ ++ 0x06,0x90,0xF9,0x00,0xE0,0x70,0x0F,0x90, ++ ++ 0x41,0xE4,0xE0,0x70,0x09,0x90,0xF7,0x84, ++ ++ 0xF0,0x90,0xF7,0x83,0xF0,0x22,0x90,0xF7, ++ ++ 0x84,0x74,0x01,0xF0,0x90,0xF7,0x83,0x74, ++ ++ 0xFF,0xF0,0x22,0x90,0xFD,0x15,0x74,0x08, ++ ++ 0xF0,0xA3,0x74,0x10,0xF0,0xA3,0xE4,0xF0, ++ ++ 0x90,0xFD,0x05,0x04,0xF0,0x90,0xFD,0x2B, ++ ++ 0xF0,0x90,0xFD,0x2A,0xF0,0x90,0x44,0xCA, ++ ++ 0xEF,0xF0,0xE4,0x90,0x42,0x39,0xF0,0x90, ++ ++ 0xFD,0x2C,0x04,0xF0,0xFF,0x12,0xAE,0x43, ++ ++ 0x90,0xFD,0x2C,0xE4,0xF0,0x22,0x90,0x42, ++ ++ 0x06,0xE0,0xFF,0x90,0xF0,0x58,0xF0,0xEF, ++ ++ 0xF0,0x90,0x42,0x09,0xE0,0x90,0xF0,0x58, ++ ++ 0xF0,0x90,0x42,0x0C,0xE0,0x90,0x42,0x04, ++ ++ 0xF0,0xE4,0x90,0x43,0x8F,0xF0,0x90,0x43, ++ ++ 0x8E,0xF0,0x90,0x43,0xAE,0x74,0x02,0xF0, ++ ++ 0xE4,0x90,0x41,0xD5,0xF0,0x12,0xAF,0x28, ++ ++ 0x22,0x90,0x43,0xA8,0xE0,0x04,0xF0,0xE0, ++ ++ 0x54,0x01,0xF0,0x70,0x10,0x90,0x42,0x49, ++ ++ 0xE0,0xFF,0x90,0xF0,0x1F,0xF0,0x90,0xF0, ++ ++ 0x29,0xEF,0xF0,0x80,0x0E,0x90,0x42,0x48, ++ ++ 0xE0,0xFF,0x90,0xF0,0x1F,0xF0,0x90,0xF0, ++ ++ 0x29,0xEF,0xF0,0x90,0x43,0xA8,0xE0,0x90, ++ ++ 0x43,0xAE,0xF0,0x22,0x90,0x43,0x34,0xE0, ++ ++ 0xB4,0x64,0x22,0x90,0x43,0x33,0xE0,0xD3, ++ ++ 0x94,0x05,0x40,0x11,0x90,0x43,0x32,0xE0, ++ ++ 0xD3,0x94,0x05,0x40,0x08,0x90,0x42,0xFD, ++ ++ 0x74,0x01,0xF0,0x80,0x05,0xE4,0x90,0x42, ++ ++ 0xFD,0xF0,0x12,0xAF,0x36,0x90,0x43,0x34, ++ ++ 0xE0,0x04,0xF0,0x12,0x97,0x59,0x22,0x90, ++ ++ 0x43,0xAF,0xE0,0x60,0x23,0x12,0xA9,0x15, ++ ++ 0x90,0x43,0xA6,0xE0,0x54,0x0F,0x64,0x0F, ++ ++ 0x70,0x1E,0x90,0x42,0x04,0xE0,0x54,0x0F, ++ ++ 0x70,0x16,0x90,0x43,0xA9,0xE0,0x70,0x10, ++ ++ 0x90,0x43,0xA7,0xE0,0x44,0x01,0xF0,0x22, ++ ++ 0x90,0x42,0x04,0xE0,0xFF,0x12,0xAE,0xEE, ++ ++ 0x22,0x90,0x43,0xAF,0xE0,0x60,0x23,0x12, ++ ++ 0xA9,0x46,0x90,0x43,0xA6,0xE0,0x54,0x0F, ++ ++ 0x70,0x20,0x90,0x42,0x04,0xE0,0x54,0x0F, ++ ++ 0xFF,0xBF,0x0F,0x16,0x90,0x43,0xA9,0xE0, ++ ++ 0x70,0x10,0x90,0x43,0xA7,0xE0,0x44,0x02, ++ ++ 0xF0,0x22,0x90,0x42,0x04,0xE0,0xFF,0x12, ++ ++ 0xAE,0xEE,0x22,0x90,0x41,0xD1,0xE0,0x70, ++ ++ 0x04,0xFF,0x12,0xAD,0x78,0x12,0x67,0x07, ++ ++ 0x7F,0x01,0x12,0xAD,0x78,0x90,0xF6,0x24, ++ ++ 0xE0,0xD3,0x94,0x04,0x40,0x0F,0xE4,0x90, ++ ++ 0x41,0xD8,0xF0,0x90,0xF2,0x1C,0xF0,0x90, ++ ++ 0x43,0xBB,0x04,0xF0,0x22,0x90,0x43,0xBB, ++ ++ 0x74,0x01,0xF0,0x22,0x90,0x42,0x4A,0xE0, ++ ++ 0xFF,0x90,0xF5,0xA9,0xE0,0x5F,0x60,0x0E, ++ ++ 0x90,0xF0,0x68,0xE0,0x20,0xE0,0xF9,0x90, ++ ++ 0xF0,0x68,0xE0,0x30,0xE0,0xF9,0x90,0x42, ++ ++ 0x07,0xE0,0xFF,0x90,0xF0,0x58,0xF0,0xEF, ++ ++ 0xF0,0x90,0x42,0x09,0xE0,0xFF,0x90,0xF0, ++ ++ 0x58,0xF0,0xEF,0xF0,0x22,0x90,0x42,0x4A, ++ ++ 0xE0,0xFF,0x90,0xF5,0xA9,0xE0,0x5F,0x60, ++ ++ 0x0E,0x90,0xF0,0x68,0xE0,0x20,0xE0,0xF9, ++ ++ 0x90,0xF0,0x68,0xE0,0x30,0xE0,0xF9,0x90, ++ ++ 0x42,0x08,0xE0,0xFF,0x90,0xF0,0x58,0xF0, ++ ++ 0xEF,0xF0,0x90,0x42,0x09,0xE0,0xFF,0x90, ++ ++ 0xF0,0x58,0xF0,0xEF,0xF0,0x22,0x90,0x42, ++ ++ 0x53,0xE0,0x60,0x2A,0x7F,0x02,0x12,0xAD, ++ ++ 0x3C,0xE4,0x90,0x41,0xE3,0xF0,0x90,0x41, ++ ++ 0xD4,0xF0,0x90,0x42,0x04,0xE0,0xC3,0x94, ++ ++ 0x1A,0x50,0x04,0xE4,0xF0,0x80,0x07,0x90, ++ ++ 0x42,0x04,0xE0,0x24,0xE6,0xF0,0x90,0x42, ++ ++ 0x04,0xE0,0xFF,0x12,0xAB,0x9E,0x22,0x90, ++ ++ 0x44,0x4F,0xE0,0x90,0xF0,0x1B,0xF0,0x90, ++ ++ 0x44,0x4E,0xE0,0xFF,0x33,0x95,0xE0,0x90, ++ ++ 0xF0,0x1C,0xEF,0xF0,0x90,0x44,0x4B,0xE0, ++ ++ 0x90,0xF0,0x0E,0xF0,0x90,0x44,0x4A,0xE0, ++ ++ 0xFF,0x33,0x95,0xE0,0x90,0xF0,0x0F,0xEF, ++ ++ 0xF0,0x90,0xF0,0x2C,0x74,0x01,0xF0,0x22, ++ ++ 0x90,0x44,0x42,0xE0,0xFE,0xA3,0xE0,0xA8, ++ ++ 0x07,0x08,0x80,0x05,0xCE,0xC3,0x13,0xCE, ++ ++ 0x13,0xD8,0xF9,0xF0,0xEE,0x90,0x44,0x42, ++ ++ 0xF0,0xE0,0xFE,0xA3,0xE0,0xFF,0x90,0x41, ++ ++ 0xC0,0xE0,0xFD,0x7C,0x00,0x12,0x4A,0x23, ++ ++ 0x90,0x44,0x42,0xEE,0xF0,0xA3,0xEF,0xF0, ++ ++ 0x22,0x90,0x41,0xB3,0xE0,0xFE,0x90,0x41, ++ ++ 0xB2,0xE0,0x7C,0x00,0x24,0x00,0xFF,0xEC, ++ ++ 0x3E,0xFE,0xE4,0xFD,0x90,0x43,0xE6,0xE0, ++ ++ 0xF8,0xA3,0xE0,0xF9,0xA3,0xE0,0xFA,0xA3, ++ ++ 0xE0,0xFB,0x12,0x4A,0xAE,0x78,0x09,0x12, ++ ++ 0x4B,0x32,0x90,0x43,0xEA,0x12,0x4B,0x6C, ++ ++ 0x22,0x90,0x42,0x17,0xE0,0x90,0xF0,0x0E, ++ ++ 0xF0,0x90,0x42,0x18,0xE0,0x90,0xF0,0x0F, ++ ++ 0xF0,0x90,0x42,0x19,0xE0,0x90,0xF0,0x1B, ++ ++ 0xF0,0x90,0x42,0x1A,0xE0,0x90,0xF0,0x1C, ++ ++ 0xF0,0x90,0xF0,0x2C,0x74,0x01,0xF0,0x90, ++ ++ 0xF1,0xE5,0xF0,0xE4,0x90,0x44,0x46,0xF0, ++ ++ 0x22,0x12,0x9C,0xB3,0x90,0xF1,0x4E,0x74, ++ ++ 0x3F,0xF0,0x90,0xF1,0x85,0xE4,0xF0,0x90, ++ ++ 0xF1,0x47,0xF0,0xA3,0xF0,0x90,0x42,0x0D, ++ ++ 0xE0,0x64,0x01,0x60,0x08,0xE4,0x90,0x43, ++ ++ 0xE0,0xF0,0x12,0x7E,0x10,0x90,0x43,0xE0, ++ ++ 0x74,0x01,0xF0,0x90,0x43,0xBB,0xF0,0x22, ++ ++ 0xC2,0xAF,0x90,0xF7,0x14,0xE0,0x70,0x24, ++ ++ 0x90,0xF7,0x32,0xE0,0x70,0x06,0x90,0xF7, ++ ++ 0x3C,0xE0,0x60,0x18,0x90,0xF9,0x9D,0xE4, ++ ++ 0xF0,0x90,0xF7,0x14,0x04,0xF0,0x90,0xF7, ++ ++ 0x0D,0xF0,0x90,0xF7,0x86,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF7,0x11,0xF0,0xD2,0xAF,0x22,0x90, ++ ++ 0xFB,0x27,0xE0,0x54,0x1F,0xFF,0xC3,0x13, ++ ++ 0xFF,0x90,0x41,0xD6,0x74,0x01,0xF0,0x90, ++ ++ 0x44,0x47,0x74,0x82,0xF0,0x12,0xAF,0x1A, ++ ++ 0x90,0xFB,0x25,0x74,0x1F,0xF0,0xA3,0x74, ++ ++ 0x22,0xF0,0x90,0xFB,0x29,0x74,0x42,0xF0, ++ ++ 0x12,0x9D,0x31,0x22,0xC2,0x8C,0x43,0x8E, ++ ++ 0x08,0xE4,0x90,0x44,0xA6,0xF0,0xA3,0xF0, ++ ++ 0x90,0x44,0xA8,0xF0,0xA3,0xF0,0xD2,0xAD, ++ ++ 0xF5,0xC9,0xC2,0xC9,0xC2,0xCD,0xC2,0xCC, ++ ++ 0xC2,0xC8,0xC2,0xCE,0xC2,0xCB,0x75,0xCA, ++ ++ 0xAA,0x75,0xCB,0xF2,0xD2,0xCA,0x22,0x90, ++ ++ 0x43,0xAF,0xE0,0x90,0x44,0xD1,0xF0,0x90, ++ ++ 0x42,0x53,0xE0,0x60,0x1C,0x90,0x41,0xE3, ++ ++ 0x74,0x01,0xF0,0xFF,0x12,0xAD,0x3C,0x90, ++ ++ 0x41,0xD4,0x74,0x01,0xF0,0x90,0x42,0x04, ++ ++ 0xE0,0x24,0x1A,0xF0,0xE0,0xFF,0x12,0xAB, ++ ++ 0x9E,0x22,0x90,0x41,0xE8,0xE0,0x70,0x23, ++ ++ 0x90,0x43,0x90,0xE0,0xA3,0xF0,0x60,0x05, ++ ++ 0x12,0xAB,0x20,0x80,0x03,0x12,0xA9,0x77, ++ ++ 0x90,0x41,0xF9,0xE0,0xFF,0x90,0xF0,0x1F, ++ ++ 0xF0,0x90,0xF0,0x29,0xEF,0xF0,0xE4,0x90, ++ ++ 0x43,0x90,0xF0,0x22,0x90,0xF7,0x79,0x74, ++ ++ 0x01,0xF0,0xA3,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0x90,0xF7,0x6A,0xF0,0x90,0xF7,0x74,0xF0, ++ ++ 0x90,0xF0,0x09,0xF0,0x90,0xF7,0x7D,0xF0, ++ ++ 0x90,0xF5,0xB9,0xF0,0x90,0xF5,0xBE,0xF0, ++ ++ 0x90,0xF5,0xC0,0xF0,0x22,0x90,0x44,0xD0, ++ ++ 0xEF,0xF0,0x90,0x41,0xD7,0xE0,0xB4,0x22, ++ ++ 0x1C,0xC2,0xAF,0x7F,0x15,0x12,0xAD,0x3C, ++ ++ 0x90,0x44,0xD0,0xE0,0xFF,0x12,0xAE,0xEE, ++ ++ 0x90,0x43,0xAF,0xE0,0x60,0x05,0x7F,0x14, ++ ++ 0x12,0xAD,0x3C,0xD2,0xAF,0x22,0x90,0xF7, ++ ++ 0x3C,0xE0,0x70,0x03,0x12,0xAE,0x16,0xE4, ++ ++ 0x90,0x44,0x9A,0xF0,0x90,0x42,0x42,0xF0, ++ ++ 0x90,0x42,0x43,0xF0,0x12,0xAD,0xCE,0xE4, ++ ++ 0x90,0x41,0xCE,0xF0,0x90,0x41,0xCD,0xF0, ++ ++ 0x12,0xAE,0xDF,0x22,0xAB,0x07,0x90,0xF1, ++ ++ 0x1D,0x74,0x01,0xF0,0xE4,0xF0,0xED,0x90, ++ ++ 0xF1,0x18,0xF0,0xEC,0xA3,0xF0,0x90,0xF1, ++ ++ 0x1B,0xEB,0xF0,0xD2,0xAF,0xD2,0xE8,0x90, ++ ++ 0x44,0xAA,0x74,0x01,0xF0,0x90,0xF1,0x1A, ++ ++ 0xF0,0x22,0xC2,0xA9,0xEF,0x42,0x89,0xEA, ++ ++ 0xF4,0xF5,0x8C,0xEB,0xF4,0xF5,0x8A,0x53, ++ ++ 0x8E,0xF7,0xAF,0x05,0xEF,0x33,0x33,0x33, ++ ++ 0x54,0xF8,0x42,0x8E,0xD2,0x8C,0x30,0x8D, ++ ++ 0xFD,0xC2,0x8D,0xD2,0xA9,0x22,0x90,0x41, ++ ++ 0xF1,0xE0,0x70,0x10,0x90,0x43,0xB1,0xF0, ++ ++ 0xA3,0xF0,0x90,0x43,0xB4,0xF0,0xA3,0xF0, ++ ++ 0x90,0x43,0xB3,0xF0,0x90,0x42,0x52,0xE0, ++ ++ 0x60,0x07,0xE4,0x90,0x43,0xA2,0xF0,0xA3, ++ ++ 0xF0,0x22,0x90,0x43,0x24,0xE0,0x90,0xF5, ++ ++ 0xCC,0xF0,0x90,0x43,0x23,0xE0,0x54,0x1F, ++ ++ 0x90,0xF5,0xCD,0xF0,0x90,0xF5,0xD4,0xE0, ++ ++ 0x90,0x43,0x09,0xF0,0x90,0xF5,0xCB,0xE0, ++ ++ 0xB4,0x01,0xF9,0x22,0xE4,0xFF,0xFE,0xC3, ++ ++ 0xEF,0x94,0xFF,0xEE,0x64,0x80,0x94,0x7F, ++ ++ 0x50,0x13,0x74,0x58,0x2F,0xF5,0x82,0x74, ++ ++ 0xF7,0x3E,0xF5,0x83,0xE4,0xF0,0x0F,0xBF, ++ ++ 0x00,0x01,0x0E,0x80,0xE2,0x22,0x90,0xFB, ++ ++ 0x87,0xE0,0x60,0xFA,0x90,0xFB,0x9E,0xE0, ++ ++ 0xB4,0x04,0x05,0xA3,0xE0,0xFF,0x80,0x02, ++ ++ 0x7F,0x00,0x90,0x44,0x72,0xEF,0xF0,0x90, ++ ++ 0xFB,0x87,0xE4,0xF0,0xC2,0xDB,0x22,0xEF, ++ ++ 0x24,0x04,0x90,0xFE,0x00,0xF0,0x90,0xFE, ++ ++ 0x03,0xE0,0x90,0xFE,0x01,0xF0,0xA3,0xED, ++ ++ 0xF0,0xEF,0x24,0x05,0x90,0xFB,0x90,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0xF0,0x22,0xD2,0xAF, ++ ++ 0xD2,0xA9,0xEF,0x42,0x89,0xEA,0xF4,0xF5, ++ ++ 0x8C,0xEB,0xF4,0xF5,0x8A,0x53,0x8E,0xF7, ++ ++ 0xAF,0x05,0xEF,0x33,0x33,0x33,0x54,0xF8, ++ ++ 0x42,0x8E,0xD2,0x8C,0x22,0x90,0x42,0x0B, ++ ++ 0xE0,0xFF,0x90,0x42,0x04,0xE0,0xC3,0x9F, ++ ++ 0x50,0x11,0xE0,0x04,0xF0,0x90,0x41,0xD7, ++ ++ 0xE0,0xB4,0x22,0x04,0x12,0xA8,0x80,0x22, ++ ++ 0x12,0xA9,0x15,0x22,0x90,0xF0,0x2B,0xE0, ++ ++ 0x70,0x0E,0x90,0x43,0xBC,0xF0,0x90,0xFD, ++ ++ 0x74,0xF0,0x90,0xF1,0xE9,0x04,0xF0,0x22, ++ ++ 0x90,0xF1,0xE9,0xE4,0xF0,0x90,0xFD,0x74, ++ ++ 0x04,0xF0,0x22,0x90,0xFB,0x88,0xE0,0x64, ++ ++ 0x01,0x60,0xF8,0x90,0xFB,0x96,0xEF,0xF0, ++ ++ 0x90,0xFB,0x88,0x74,0x01,0xF0,0x90,0xFB, ++ ++ 0x88,0xE0,0x64,0x01,0x60,0xF8,0x7F,0x01, ++ ++ 0x22,0xE4,0x90,0x43,0x06,0xF0,0x90,0xF5, ++ ++ 0xD6,0xE0,0x90,0x43,0x07,0xF0,0x90,0xF5, ++ ++ 0xD5,0xE0,0x90,0x43,0x08,0xF0,0x90,0xF5, ++ ++ 0xD4,0xE0,0x90,0x43,0x09,0xF0,0x22,0x90, ++ ++ 0xF4,0x71,0xE4,0xF0,0x04,0xF0,0x90,0xF5, ++ ++ 0xAC,0xE4,0xF0,0xEF,0x70,0x05,0x12,0x5D, ++ ++ 0x01,0x80,0x03,0x12,0x6B,0x1B,0x90,0xF4, ++ ++ 0x71,0xE4,0xF0,0x22,0xE4,0xF5,0x13,0xC2, ++ ++ 0xAF,0x53,0x91,0x7F,0x7A,0xAF,0x79,0xA0, ++ ++ 0x12,0x4B,0xA9,0x7B,0x01,0x7A,0x44,0x79, ++ ++ 0x6A,0x7D,0x01,0x7C,0x00,0x12,0xA1,0x83, ++ ++ 0x22,0x90,0xF7,0x11,0xE4,0xF0,0x7F,0xFF, ++ ++ 0x7E,0x66,0x12,0xAF,0x5E,0x20,0x8C,0xFD, ++ ++ 0x90,0x44,0x9B,0x74,0x01,0xF0,0xD2,0xEA, ++ ++ 0x90,0xF7,0x11,0xF0,0x22,0x90,0x42,0x42, ++ ++ 0xE0,0x70,0x0C,0x90,0x42,0x43,0xE0,0x60, ++ ++ 0x0A,0x90,0x44,0x9A,0xE0,0x60,0x04,0x12, ++ ++ 0xAA,0x99,0x22,0x12,0xA7,0x4B,0x22,0x90, ++ ++ 0x42,0x04,0xE0,0x60,0x10,0x14,0xF0,0x90, ++ ++ 0x41,0xD7,0xE0,0xB4,0x22,0x04,0x12,0xA8, ++ ++ 0xB2,0x22,0x12,0xA9,0x46,0x22,0x90,0x43, ++ ++ 0x8F,0xE0,0x60,0x03,0x14,0xF0,0x22,0x90, ++ ++ 0xF0,0x01,0xE0,0xB4,0x01,0x06,0x12,0x83, ++ ++ 0x14,0x12,0x93,0x50,0x22,0xC2,0xAF,0x90, ++ ++ 0xF5,0xA8,0xE4,0xF0,0x90,0xF7,0x3D,0xF0, ++ ++ 0xFF,0x7E,0x28,0x12,0xAF,0x5E,0x20,0x8C, ++ ++ 0xFD,0xD2,0xAF,0x22,0xC2,0xAF,0xC2,0xDB, ++ ++ 0x90,0xFB,0x7F,0xE0,0x70,0x09,0x90,0xFB, ++ ++ 0x87,0xF0,0x90,0xFB,0xAF,0x04,0xF0,0xD2, ++ ++ 0xAF,0x22,0x90,0xF5,0x38,0xE0,0xFD,0xEF, ++ ++ 0x60,0x0D,0x90,0xF5,0x38,0xE0,0xFE,0x6D, ++ ++ 0x60,0xF5,0xAD,0x06,0x1F,0x80,0xF0,0x22, ++ ++ 0x90,0x41,0xD7,0xE0,0xB4,0x27,0x0B,0x7F, ++ ++ 0x16,0x12,0xAD,0x3C,0x90,0x43,0xB0,0x74, ++ ++ 0x01,0xF0,0x22,0x90,0x43,0xB6,0xE0,0x70, ++ ++ 0x05,0x90,0x43,0xBB,0xF0,0x22,0x90,0x43, ++ ++ 0xBB,0x74,0x01,0xF0,0x22,0x90,0xF5,0x5B, ++ ++ 0x74,0xFC,0xF0,0xA3,0xE4,0xF0,0xA3,0x74, ++ ++ 0x02,0xF0,0xA3,0xE4,0xF0,0x22,0x90,0xF5, ++ ++ 0x52,0x74,0x3F,0xF0,0x90,0xF5,0x54,0x74, ++ ++ 0x01,0xF0,0x90,0xF7,0x0E,0xF0,0x22,0x90, ++ ++ 0xF4,0x08,0x74,0x99,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xF0,0x22,0x90, ++ ++ 0xF4,0x08,0x74,0x99,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xF0,0x22,0x90, ++ ++ 0xF4,0x08,0x74,0x99,0xF0,0xA3,0x74,0x02, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xF0,0x22,0x90, ++ ++ 0xF5,0x5B,0xE4,0xF0,0xA3,0x74,0x03,0xF0, ++ ++ 0xA3,0xE4,0xF0,0xA3,0xF0,0x22,0xE4,0x90, ++ ++ 0x42,0x2B,0xF0,0x90,0xF7,0x83,0x74,0xAA, ++ ++ 0xF0,0xA3,0xE4,0xF0,0x22,0xC2,0xAF,0x90, ++ ++ 0xFB,0x97,0xEF,0xF0,0x7F,0x13,0x12,0xAD, ++ ++ 0x3C,0xD2,0xAF,0x22,0xE4,0x90,0x43,0x27, ++ ++ 0xF0,0x90,0x43,0x25,0xF0,0xA3,0xF0,0x12, ++ ++ 0x8E,0x1F,0x22,0x90,0xF5,0x5B,0x74,0x60, ++ ++ 0xF0,0xA3,0xE4,0xF0,0xA3,0xF0,0xA3,0xF0, ++ ++ 0x22,0x90,0xFB,0x24,0xE4,0xF0,0x90,0x44, ++ ++ 0x47,0xE0,0x90,0xFB,0x28,0xF0,0x22,0xE4, ++ ++ 0x90,0x43,0xA7,0xF0,0x90,0x43,0xA9,0xF0, ++ ++ 0x90,0x43,0xA8,0xF0,0x22,0xE4,0x90,0x43, ++ ++ 0x34,0xF0,0x90,0x43,0x33,0xF0,0x90,0x43, ++ ++ 0x32,0xF0,0x22,0xE4,0x90,0x44,0xAA,0xF0, ++ ++ 0x90,0xF1,0x1C,0xF0,0x53,0x91,0xEF,0x22, ++ ++ 0x90,0xFB,0x24,0x74,0x08,0xF0,0x90,0xFB, ++ ++ 0x28,0x74,0x74,0xF0,0x22,0xAB,0x07,0xAA, ++ ++ 0x06,0xE4,0xFD,0x7F,0x01,0x12,0xAC,0xDF, ++ ++ 0x22,0x90,0xF1,0x75,0x74,0x01,0xF0,0x90, ++ ++ 0xF1,0x0A,0xF0,0x22,0x90,0xF4,0x60,0xEF, ++ ++ 0xF0,0xA3,0xED,0xF0,0x22,0x90,0xF4,0x13, ++ ++ 0xE4,0xF0,0x12,0x50,0xDE,0x22,0x90,0x43, ++ ++ 0xBB,0x74,0x01,0xF0,0xF5,0x13,0x22,0x90, ++ ++ 0xF2,0x17,0x74,0xFE,0xF0,0x22,0xC2,0xAF, ++ ++ 0x12,0xA6,0xD7,0x22,0xC2,0x8C,0x22,0x22, ++ ++ 0x22,0x22,0x22,0x22,0x22,0x22,0x01,0x02, ++ ++ 0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x09, ++ ++ 0x00,0x01,0x02,0x03,0x04,0x05,0x05,0x03, ++ ++ 0x08,0x01,0x00,0x01,0x01,0x02,0x03,0x03, ++ ++ 0x01,0x01,0x01,0x01,0x3E,0x80,0x06,0x40, ++ ++ 0x7D,0x00,0x12,0xC0,0x12,0xC0,0xFA,0x00, ++ ++ 0x12,0xC0,0xBB,0x80,0x9C,0x40,0x00,0xA0, ++ ++ 0x00,0x00,0x01,0x02,0x02,0x02,0x02,0x02, ++ ++ 0x01,0x01,0xA7,0x12,0xAF,0x9D,0xAF,0xA1, ++ ++ 0xAF,0xA2,0xAF,0xA3,0x71,0xC9,0xAF,0xA4, ++ ++ 0xAF,0xA5,0xAF,0x44,0xA2,0x69,0x84,0xEF, ++ ++ 0x8C,0x89,0xAE,0x2D ++ ++}; ++ ++ ++ ++static Segment Firmware_segments[] = { ++ ++ { 0x00, 0x0000000A }, ++ ++ { 0x00, 0x00003A0E }, ++ ++ { 0x00, 0x0000000A }, ++ ++ { 0x00, 0x00006AB4 } ++ ++}; ++ ++ ++ ++static Byte Firmware_partitions[] = { ++ ++ 0x04 ++ ++}; ++ ++ ++ ++ ++ ++#define Firmware_SCRIPTSETLENGTH 0x00000001 ++ ++ ++ ++ ++ ++static Word Firmware_scriptSets[] = { ++ ++ 0x6B ++ ++}; ++ ++ ++ ++ ++ ++static ValueSet Firmware_scripts[] = { ++ ++ {0xF905, 0x01}, ++ ++ {0xF40E, 0x0A}, ++ ++ {0xF40F, 0x40}, ++ ++ {0xF410, 0x08}, ++ ++ {0xF55F, 0x0A}, ++ ++ {0xF562, 0x20}, ++ ++ {0xF561, 0x15}, ++ ++ {0xF610, 0x32}, ++ ++ {0xF611, 0x10}, ++ ++ {0xF60F, 0x04}, ++ ++ {0xF60E, 0x00}, ++ ++ {0xF600, 0x05}, ++ ++ {0xF601, 0x08}, ++ ++ {0xF602, 0x0B}, ++ ++ {0xF603, 0x0E}, ++ ++ {0xF604, 0x11}, ++ ++ {0xF605, 0x14}, ++ ++ {0xF606, 0x17}, ++ ++ {0xF607, 0x1F}, ++ ++ {0xF5F8, 0x01}, ++ ++ {0xF5DF, 0xFB}, ++ ++ {0xF5E0, 0x00}, ++ ++ {0xF5E3, 0x09}, ++ ++ {0xF5E4, 0x01}, ++ ++ {0xF5E5, 0x01}, ++ ++ {0xF5FD, 0x01}, ++ ++ {0xF80F, 0x40}, ++ ++ {0xF810, 0x54}, ++ ++ {0xF811, 0x5a}, ++ ++ {0xF78B, 0x01}, ++ ++ {0xFB06, 0x3}, ++ ++ {0x00a0, 0xCF}, ++ ++ {0x009f, 0xE1}, ++ ++ {0x00a6, 0x01}, ++ ++ {0xFD8B, 0x00}, ++ ++ {0x00ad, 0x01}, ++ ++ {0x00a3, 0x01}, ++ ++ {0x00a4, 0x3C}, ++ ++ {0x00ab, 0x01}, ++ ++ {0x008e, 0x01}, ++ ++ {0x008a, 0x01}, ++ ++ {0x0099, 0x01}, ++ ++ {0x00a9, 0x00}, ++ ++ {0x00a5, 0x01}, ++ ++ {0x00aa, 0x01}, ++ ++ {0x0092, 0x06}, ++ ++ {0xF078, 0x00}, ++ ++ {0xF016, 0x10}, ++ ++ {0xF017, 0x04}, ++ ++ {0xF018, 0x05}, ++ ++ {0xF019, 0x04}, ++ ++ {0xF01A, 0x05}, ++ ++ {0xF021, 0x03}, ++ ++ {0xF022, 0x0A}, ++ ++ {0xF023, 0x0A}, ++ ++ {0xF02B, 0x00}, ++ ++ {0x0070, 0x0A}, ++ ++ {0xF1CB, 0xA0}, ++ ++ {0xF1CC, 0x01}, ++ ++ {0xF02C, 0x01}, ++ ++ {0x00b0, 0x01}, ++ ++ {0xF000, 0xF}, ++ ++ {0xF707, 0xFC}, ++ ++ {0xF708, 0x00}, ++ ++ {0xF709, 0x7E}, ++ ++ {0xF70A, 0x00}, ++ ++ {0xF70B, 0x2F}, ++ ++ {0xF1BC, 0x36}, ++ ++ {0xF1BD, 0x00}, ++ ++ {0xF214, 0x0}, ++ ++ {0xF204, 0x10}, ++ ++ {0xF087, 0x0}, ++ ++ {0xF064, 0x03}, ++ ++ {0xF067, 0x1}, ++ ++ {0xF065, 0xF9}, ++ ++ {0xF066, 0x03}, ++ ++ {0xF06F, 0xe0}, ++ ++ {0xF070, 0x3}, ++ ++ {0xF072, 0x0f}, ++ ++ {0xF073, 0x03}, ++ ++ {0xF144, 0x1a}, ++ ++ {0xF146, 0x00}, ++ ++ {0xF14A, 0x01}, ++ ++ {0xF14C, 0x00}, ++ ++ {0xF14D, 0x00}, ++ ++ {0xF14F, 0x04}, ++ ++ {0xF09F, 0x0c}, ++ ++ {0xF0A0, 0x00}, ++ ++ {0xF15A, 0x00}, ++ ++ {0xF15B, 0x08}, ++ ++ {0xF163, 0x05}, ++ ++ {0xF09B, 0x3f}, ++ ++ {0xF09C, 0x00}, ++ ++ {0xF168, 0x0f}, ++ ++ {0xF09D, 0x20}, ++ ++ {0xF09E, 0x00}, ++ ++ {0xF167, 0x40}, ++ ++ {0xF158, 0x7f}, ++ ++ {0xF166, 0x01}, ++ ++ {0xF15D, 0x03}, ++ ++ {0xF130, 0x04}, ++ ++ {0xF132, 0x04}, ++ ++ {0xF183, 0x01}, ++ ++ {0xF19D, 0x40}, ++ ++ {0xF15E, 0x05}, ++ ++ {0xF17A, 0x00}, ++ ++ {0xF17B, 0x00}, ++ ++}; ++ ++#endif ++ ++// Warning: version numbers are manually altered. ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_inttype.h b/drivers/media/dvb/dvb-usb/a867_inttype.h +new file mode 100644 +index 0000000..303ae70 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_inttype.h +@@ -0,0 +1,41 @@ ++#ifndef __INTTYPE_H__ ++#define __INTTYPE_H__ ++ ++ ++/** ++ * The type defination of SnrTable. ++ */ ++typedef struct { ++ Dword errorCount; ++ Dword snr; ++ double errorRate; ++} SnrTable; ++ ++ ++/** ++ * The type defination of Statistic. ++ */ ++typedef struct { ++ Word abortCount; ++ Dword postVitBitCount; ++ Dword postVitErrorCount; ++ /** float point */ ++ Dword softBitCount; ++ Dword softErrorCount; ++ Dword preVitBitCount; ++ Dword preVitErrorCount; ++ double snr; ++} ChannelStatistic; ++ ++ ++/** ++ * The type defination of AgcVoltage. ++ */ ++typedef struct { ++ double doSetVolt; ++ double doPuUpVolt; ++} AgcVoltage; ++ ++ ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_iocontrol.h b/drivers/media/dvb/dvb-usb/a867_iocontrol.h +new file mode 100644 +index 0000000..a38a1e5 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_iocontrol.h +@@ -0,0 +1,738 @@ ++/** ++ * ++ * Copyright (c) 2006 Afa Corporation. All rights reserved. ++ * ++ * Module Name: ++ * iocontrol.h ++ * ++ * Abstract: ++ * The structure and IO code for IO control call. ++ * ++ */ ++ ++#ifndef __IOCONTROL_H__ ++#define __IOCONTROL_H__ ++ ++#ifdef UNDER_CE ++#include ++#else ++#endif ++ ++#include "a867_type.h" ++ ++#define MEDIA_DEVICE_AFADEMOD 0x00000AFA ++ ++typedef struct { ++ Byte chipNumber; ++ Word sawBandwidth; ++ StreamType streamType; ++ Architecture architecture; ++ Dword error; ++ Byte reserved[16]; ++} InitializeRequest, *PInitializeRequest; ++ ++typedef struct { ++ Dword error; ++ Byte reserved[16]; ++} FinalizeRequest, *PFinalizeRequest; ++ ++typedef struct { ++ StreamType streamType; ++ Dword error; ++ Byte reserved[16]; ++} SetStreamTypeRequest, *PSetStreamTypeRequest; ++ ++typedef struct { ++ Architecture architecture; ++ Dword error; ++ Byte reserved[16]; ++} SetArchitectureRequest, *PSetArchitectureRequest; ++ ++typedef struct { ++ Byte chip; ++ ChannelModulation* channelModulation; ++ Dword error; ++ Byte reserved[16]; ++} GetChannelModulationRequest, *PGetChannelModulationRequest; ++ ++typedef struct { ++ Processor processor; ++ Dword* version; ++ Dword error; ++ Byte reserved[16]; ++} GetFirmwareVersionRequest, *PGetFirmwareVersionRequest; ++ ++typedef struct { ++ Byte chip; ++ Word bandwidth; ++ Dword frequency; ++ Dword error; ++ Byte reserved[16]; ++} AcquireChannelRequest, *PAcquireChannelRequest; ++ ++typedef struct { ++ Byte chip; ++ Bool* locked; ++ Dword error; ++ Byte reserved[16]; ++} IsLockedRequest, *PIsLockedRequest; ++ ++typedef struct { ++ Byte chip; ++ Pid pid; ++ Dword error; ++ Byte reserved[16]; ++} AddPidRequest, *PAddPidRequest; ++ ++typedef struct { ++ Byte chip; ++ Pid pid; ++ Dword error; ++ Byte reserved[16]; ++} RemovePidRequest, *PRemovePidRequest; ++ ++typedef struct { ++ Byte chip; ++ Dword error; ++ Byte reserved[16]; ++} ResetPidRequest, *PResetPidRequest; ++ ++typedef struct { ++ Byte chip; ++ Byte superFrameCount; ++ Word packetUnit; ++ Dword error; ++ Byte reserved[16]; ++} SetStatisticRangeRequest, *PSetStatisticRangeRequest; ++ ++typedef struct { ++ Byte chip; ++ Byte* superFrameCount; ++ Word* packetUnit; ++ Dword error; ++ Byte reserved[16]; ++} GetStatisticRangeRequest, *PGetStatisticRangeRequest; ++ ++typedef struct { ++ Byte chip; ++ ChannelStatistic* channelStatistic; ++ Dword error; ++ Byte reserved[16]; ++} GetChannelStatisticRequest, *PGetChannelStatisticRequest; ++ ++typedef struct { ++ Byte chip; ++ Statistic* statistic; ++ Dword error; ++ Byte reserved[16]; ++} GetStatisticRequest, *PGetStatisticRequest; ++ ++typedef struct { ++ Dword* bufferLength; ++ Byte* buffer; ++ Dword error; ++ Byte reserved[16]; ++} GetDatagramRequest, *PGetDatagramRequest; ++ ++typedef struct { ++ Byte chip; ++ Byte control; ++ Dword error; ++ Byte reserved[16]; ++} ControlPidFilterRequest, *PControlPidFilterRequest; ++ ++typedef struct { ++ Byte chip; ++ Byte control; ++ Dword error; ++ Byte reserved[16]; ++} ControlPowerSavingRequest, *PControlPowerSavingRequest; ++ ++typedef struct { ++ Byte DriverVerion[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */ ++ Byte APIVerion[32]; /** XX.XX.XXXXXXXX.XX Ex., 1.2.3.4 */ ++ Byte FWVerionLink[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */ ++ Byte FWVerionOFDM[16]; /** XX.XX.XX.XX Ex., 1.2.3.4 */ ++ Byte DateTime[24]; /** Ex.,"2004-12-20 18:30:00" or "DEC 20 2004 10:22:10" with compiler __DATE__ and __TIME__ definitions */ ++ Byte Company[8]; /** Ex.,"Afatech" */ ++ Byte SupportHWInfo[32]; /** Ex.,"Jupiter DVBT/DVBH" */ ++ Dword error; ++ Byte reserved[128]; ++} DemodDriverInfo, *PDemodDriverInfo; ++ ++typedef struct { ++ Ensemble* ensemble; ++ Dword error; ++ Byte reserved[16]; ++} AcquireEnsembleRequest, *PAcquireEnsembleRequest; ++ ++typedef struct { ++ Byte* serviceLength; ++ Service* services; ++ Dword error; ++ Byte reserved[16]; ++} AcquireServiceRequest, *PAcquireServiceRequest; ++ ++typedef struct { ++ Service service; ++ Byte* componentLength; ++ Component* components; ++ Dword error; ++ Byte reserved[16]; ++} AcquireComponentRequest, *PAcquireComponentRequest; ++ ++typedef struct { ++ Component component; ++ Dword error; ++ Byte reserved[16]; ++} AddComponentRequest, *PAddComponentRequest; ++ ++typedef struct { ++ Component component; ++ Dword error; ++ Byte reserved[16]; ++} RemoveComponentRequest, *PRemoveComponentRequest; ++ ++typedef struct { ++ Byte figType; ++ Byte figExtension; ++ Dword error; ++ Byte reserved[16]; ++} AddFigRequest, *PAddFigRequest; ++ ++typedef struct { ++ Byte figType; ++ Byte figExtension; ++ Dword error; ++ Byte reserved[16]; ++} RemoveFigRequest, *PRemoveFigRequest; ++ ++ ++/** ++ * Demodulator API commands ++ */ ++ ++/** ++ * First, download firmware from host to demodulator. Actually, firmware is ++ * put in firmware.h as a part of source code. Therefore, in order to ++ * update firmware the host have to re-compile the source code. ++ * Second, setting all parameters which will be need at the beginning. ++ * Paramters: None ++ */ ++#define IOCTL_AFA_DEMOD_INITIALIZE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x003, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * Paramters: DemodStreamType struct ++ */ ++#define IOCTL_AFA_DEMOD_SETSTREAMTYPE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x004, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * Paramters: DemodStreamType struct ++ */ ++#define IOCTL_AFA_DEMOD_SETARCHITECTURE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x006, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * Paramters: DemodStreamType struct ++ */ ++#define IOCTL_AFA_DEMOD_GETCHANNELMODULATION \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x008, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * Paramters: DemodStreamType struct ++ */ ++#define IOCTL_AFA_DEMOD_GETFIRMWAREVERSION \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x009, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Specify the bandwidth of channel and tune the channel to the specific ++ * frequency. Afterwards, host could use output parameter dvbH to determine ++ * if there is a DVB-H signal. ++ * In DVB-T mode, after calling this function output parameter dvbH should ++ * be False and host could use output parameter "locked" to indicate if the ++ * TS is correct. ++ * In DVB-H mode, after calling this function output parameter dvbH should ++ * be True and host could use Jupiter_acquirePlatorm to get platform. ++ * Paramters: DemodAcqCh struct ++ */ ++#define IOCTL_AFA_DEMOD_ACQUIRECHANNEL \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00A, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get all the platforms found in current frequency. ++ * Paramters: DemodAcqPlatform struct ++ */ ++#define IOCTL_AFA_DEMOD_ISLOCKED \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00B, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get all the platforms found in current frequency. ++ * Paramters: DemodAcqPlatform struct ++ */ ++#define IOCTL_AFA_DEMOD_ACQUIREPLATFORM \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00C, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Change the current platform as the specified platform. If the target ++ * platform is locate in different frequency, this function will tune to ++ * that frequency before setting platform. ++ * Paramters: DemodSetPlatform struct ++ */ ++#define IOCTL_AFA_DEMOD_SETPLATFORM \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00D, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Add IP to IP filter. ++ * Paramters: DemodIp struct ++ */ ++#define IOCTL_AFA_DEMOD_ADDIP \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00E, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Remove IP from IP filter. ++ * Paramters: DemodIp struct ++ */ ++#define IOCTL_AFA_DEMOD_REMOVEIP \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x00F, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Add PID to PID filter. ++ * Paramters: DemodPid struct ++ */ ++#define IOCTL_AFA_DEMOD_ADDPID \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x010, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Remove PID from PID filter. ++ * Paramters: DemodPid struct ++ */ ++#define IOCTL_AFA_DEMOD_REMOVEPID \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x011, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Reset PID from PID filter. ++ * Paramters: ResetPidRequest struct ++ */ ++#define IOCTL_AFA_DEMOD_RESETPID \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x012, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get data of one single section ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETSECTION \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x013, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_SETSTATISTICRANGE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x014, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETSTATISTICRANGE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x015, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETCHANNELSTATISTIC \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x016, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETSTATISTIC \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x017, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETINTERRUPTS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x018, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_CLEARINTERRUPT \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x019, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * Paramters: DemodGetStat struct ++ */ ++#define IOCTL_AFA_DEMOD_GETDATAGRAM \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01A, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * ++ * Paramters: DemodControl struct ++ */ ++#define IOCTL_AFA_DEMOD_GETDELTAT \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01B, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Enable PID filter. ++ * Paramters: EnablePidRequest struct ++ */ ++#define IOCTL_AFA_DEMOD_CONTROLPIDFILTER \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01C, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * ++ * Paramters: DemodControl struct ++ */ ++#define IOCTL_AFA_DEMOD_CONTROLTIMESLICING \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01D, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * ++ * Paramters: DemodControl struct ++ */ ++#define IOCTL_AFA_DEMOD_CONTROLPOWERSAVING \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01E, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Power off the demodulators. ++ * Paramters: None ++ */ ++#define IOCTL_AFA_DEMOD_FINALIZE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x01F, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get driver information. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_GETDRIVERINFO \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x020, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get ensemble. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_ACQUIREENSEMBLE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x021, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get service. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_ACQUIRESERVICE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x022, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Get component. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_ACQUIRECOMPONENT \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x023, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Add component. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_ADDCOMPONENT \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x024, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Remove component. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_REMOVECOMPONENT \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x025, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Add FIG. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_ADDFIG \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x026, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Remove FIG. ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_REMOVEFIG \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x027, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++ ++/** ++ * Demodulator Misc API commands ++ */ ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Dword registerAddress; ++ Byte bufferLength; ++ Byte buffer[256]; ++ Dword error; ++ Byte reserved[16]; ++} WriteRegistersRequest, *PWriteRegistersRequest; ++ ++typedef struct { ++ Byte chip; ++ Word registerAddress; ++ Byte bufferLength; ++ Byte buffer[256]; ++ Dword error; ++ Byte reserved[16]; ++} WriteTunerRegistersRequest, *PWriteTunerRegistersRequest; ++ ++typedef struct { ++ Byte chip; ++ Word registerAddress; ++ Byte bufferLength; ++ Byte buffer[256]; ++ Dword error; ++ Byte reserved[16]; ++} WriteEepromValuesRequest, *PWriteEepromValuesRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Dword registerAddress; ++ Byte position; ++ Byte length; ++ Byte value; ++ Dword error; ++ Byte reserved[16]; ++} WriteRegisterBitsRequest, *PWriteRegisterBitsRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Word variableIndex; ++ Byte bufferLength; ++ Byte buffer[256]; ++ Dword error; ++ Byte reserved[16]; ++} SetVariablesRequest, *PSetVariablesRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Word variableIndex; ++ Byte position; ++ Byte length; ++ Byte value; ++ Dword error; ++ Byte reserved[16]; ++} SetVariableBitsRequest, *PSetVariableBitsRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Dword registerAddress; ++ Byte bufferLength; ++ Byte* buffer; ++ Dword error; ++ Byte reserved[16]; ++} ReadRegistersRequest, *PReadRegistersRequest; ++ ++typedef struct { ++ Byte chip; ++ Word registerAddress; ++ Byte bufferLength; ++ Byte* buffer; ++ Dword error; ++ Byte reserved[16]; ++} ReadTunerRegistersRequest, *PReadTunerRegistersRequest; ++ ++typedef struct { ++ Byte chip; ++ Word registerAddress; ++ Byte bufferLength; ++ Byte* buffer; ++ Dword error; ++ Byte reserved[16]; ++} ReadEepromValuesRequest, *PReadEepromValuesRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Dword registerAddress; ++ Byte position; ++ Byte length; ++ Byte* value; ++ Dword error; ++ Byte reserved[16]; ++} ReadRegisterBitsRequest, *PReadRegisterBitsRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Word variableIndex; ++ Byte bufferLength; ++ Byte* buffer; ++ Dword error; ++ Byte reserved[16]; ++} GetVariablesRequest, *PGetVariablesRequest; ++ ++typedef struct { ++ Byte chip; ++ Processor processor; ++ Word variableIndex; ++ Byte position; ++ Byte length; ++ Byte* value; ++ Dword error; ++ Byte reserved[16]; ++} GetVariableBitsRequest, *PGetVariableBitsRequest; ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in demodulator. ++ * Paramters: DemodRegs struct ++ */ ++#define IOCTL_AFA_DEMOD_WRITEREGISTERS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x101, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in tuner. ++ * Paramters: DemodTunerRegs struct ++ */ ++#define IOCTL_AFA_DEMOD_WRITETUNERREGISTERS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x102, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Write a sequence of bytes to the contiguous cells in the EEPROM. ++ * Paramters: DemodEEPROMVaules struct ++ */ ++#define IOCTL_AFA_DEMOD_WRITEEEPROMVALUES \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x103, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Write one byte to the contiguous registers in demodulator. ++ * Paramters: DemodRegs struct ++ */ ++#define IOCTL_AFA_DEMOD_WRITEREGISTERBITS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x104, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Write a sequence of bytes to the contiguous variables in demodulator. ++ * Paramters: DemodVariables struct ++ */ ++#define IOCTL_AFA_DEMOD_SETVARIABLES \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x105, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Write a sequence of bytes to the contiguous variables in demodulator. ++ * Paramters: DemodVariables struct ++ */ ++#define IOCTL_AFA_DEMOD_SETVARIABLEBITS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x106, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in demodulator. ++ * Paramters: DemodRegs struct ++ */ ++#define IOCTL_AFA_DEMOD_READREGISTERS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x108, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in tuner. ++ * Paramters: DemodTunerRegs ++ */ ++#define IOCTL_AFA_DEMOD_READTUNERREGISTERS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous cells in the EEPROM. ++ * Paramters: DemodEEPROMVaules struct ++ */ ++#define IOCTL_AFA_DEMOD_READEEPROMVALUES \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x10A, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in demodulator. ++ * Paramters: DemodRegs struct ++ */ ++#define IOCTL_AFA_DEMOD_READREGISTERBITS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x10B, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous variables in demodulator. ++ * Paramters: DemodVariables struct ++ */ ++#define IOCTL_AFA_DEMOD_GETVARIABLES \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x10C, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++/** ++ * Read a sequence of bytes from the contiguous variables in demodulator. ++ * Paramters: DemodVariables struct ++ */ ++#define IOCTL_AFA_DEMOD_GETVARIABLEBITS \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x10D, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++ ++ ++/** ++ * Demodulator Stream control API commands ++ */ ++ ++typedef struct { ++ Byte chip; ++ Dword error; ++ Byte reserved[16]; ++} StartCaptureRequest, *PStartCaptureRequest; ++ ++typedef struct { ++ Byte chip; ++ Dword error; ++ Byte reserved[16]; ++} StopCaptureRequest, *PStopCaptureRequest; ++ ++/** ++ * Start capture data stream ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_STARTCAPTURE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x200, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++ ++/** ++ * Stop capture data stream ++ * Paramters: DemodDriverInfo struct ++ */ ++#define IOCTL_AFA_DEMOD_STOPCAPTURE \ ++ CTL_CODE( MEDIA_DEVICE_AFADEMOD, 0x201, METHOD_BUFFERED, FILE_ANY_ACCESS ) ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_mxl5007t.c b/drivers/media/dvb/dvb-usb/a867_mxl5007t.c +new file mode 100644 +index 0000000..29b397a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_mxl5007t.c +@@ -0,0 +1,698 @@ ++/* ++ * mxl5007t.c - driver for the MaxLinear MxL5007T silicon tuner ++ * ++ * Copyright (C) 2008, 2009 Michael Krufky ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * The code is modified to accommodate the AF903x source code on 2010/6/7 ++ */ ++ ++#include ++#include ++#include ++#include ++#include "a867_mxl5007t.h" ++ ++/* ------------------------------------------------------------------------- */ ++ ++#define mxl_printk(kern, fmt, arg...) \ ++ printk(kern "%s: " fmt "\n", __func__, ##arg) ++ ++#define mxl_err(fmt, arg...) \ ++ mxl_printk(KERN_ERR, "%d: " fmt, __LINE__, ##arg) ++ ++#define mxl_warn(fmt, arg...) \ ++ mxl_printk(KERN_WARNING, fmt, ##arg) ++ ++#define mxl_info(fmt, arg...) \ ++ mxl_printk(KERN_INFO, fmt, ##arg) ++ ++#define mxl_debug(fmt, arg...) \ ++({ \ ++ if (1) \ ++ mxl_printk(KERN_DEBUG, fmt, ##arg); \ ++}) ++ ++#define mxl_fail(ret) \ ++({ \ ++ int __ret; \ ++ __ret = (ret < 0); \ ++ if (__ret) \ ++ mxl_printk(KERN_ERR, "error %d on line %d", \ ++ ret, __LINE__); \ ++ __ret; \ ++}) ++ ++/* ------------------------------------------------------------------------- */ ++ ++#define MHz 1000000 ++ ++ ++#include "a867_Maxlinear_MXL5007.h" ++ ++ ++struct reg_pair_t { ++ u8 reg; ++ u8 val; ++}; ++ ++/* ------------------------------------------------------------------------- */ ++ ++static struct reg_pair_t init_tab[] = { ++ { 0x02, 0x06 }, ++ { 0x03, 0x48 }, ++ { 0x05, 0x04 }, ++ { 0x06, 0x10 }, ++ { 0x2e, 0x15 }, /* OVERRIDE */ ++ { 0x30, 0x10 }, /* OVERRIDE */ ++ { 0x45, 0x58 }, /* OVERRIDE */ ++ { 0x48, 0x19 }, /* OVERRIDE */ ++ { 0x52, 0x03 }, /* OVERRIDE */ ++ { 0x53, 0x44 }, /* OVERRIDE */ ++ { 0x6a, 0x4b }, /* OVERRIDE */ ++ { 0x76, 0x00 }, /* OVERRIDE */ ++ { 0x78, 0x18 }, /* OVERRIDE */ ++ { 0x7a, 0x17 }, /* OVERRIDE */ ++ { 0x85, 0x06 }, /* OVERRIDE */ ++ { 0x01, 0x01 }, /* TOP_MASTER_ENABLE */ ++ { 0, 0 } ++}; ++ ++static struct reg_pair_t init_tab_cable[] = { ++ { 0x02, 0x06 }, ++ { 0x03, 0x48 }, ++ { 0x05, 0x04 }, ++ { 0x06, 0x10 }, ++ { 0x09, 0x3f }, ++ { 0x0a, 0x3f }, ++ { 0x0b, 0x3f }, ++ { 0x2e, 0x15 }, /* OVERRIDE */ ++ { 0x30, 0x10 }, /* OVERRIDE */ ++ { 0x45, 0x58 }, /* OVERRIDE */ ++ { 0x48, 0x19 }, /* OVERRIDE */ ++ { 0x52, 0x03 }, /* OVERRIDE */ ++ { 0x53, 0x44 }, /* OVERRIDE */ ++ { 0x6a, 0x4b }, /* OVERRIDE */ ++ { 0x76, 0x00 }, /* OVERRIDE */ ++ { 0x78, 0x18 }, /* OVERRIDE */ ++ { 0x7a, 0x17 }, /* OVERRIDE */ ++ { 0x85, 0x06 }, /* OVERRIDE */ ++ { 0x01, 0x01 }, /* TOP_MASTER_ENABLE */ ++ { 0, 0 } ++}; ++ ++/* ------------------------------------------------------------------------- */ ++ ++static struct reg_pair_t reg_pair_rftune[] = { ++ { 0x0f, 0x00 }, /* abort tune */ ++ { 0x0c, 0x15 }, ++ { 0x0d, 0x40 }, ++ { 0x0e, 0x0e }, ++ { 0x1f, 0x87 }, /* OVERRIDE */ ++ { 0x20, 0x1f }, /* OVERRIDE */ ++ { 0x21, 0x87 }, /* OVERRIDE */ ++ { 0x22, 0x1f }, /* OVERRIDE */ ++ { 0x80, 0x01 }, /* freq dependent */ ++ { 0x0f, 0x01 }, /* start tune */ ++ { 0, 0 } ++}; ++ ++/* ------------------------------------------------------------------------- */ ++ ++ ++ ++/* ------------------------------------------------------------------------- */ ++ ++/* called by _init and _rftun to manipulate the register arrays */ ++ ++static void set_reg_bits(struct reg_pair_t *reg_pair, u8 reg, u8 mask, u8 val) ++{ ++ unsigned int i = 0; ++ ++ while (reg_pair[i].reg || reg_pair[i].val) { ++ if (reg_pair[i].reg == reg) { ++ reg_pair[i].val &= ~mask; ++ reg_pair[i].val |= val; ++ } ++ i++; ++ ++ } ++ return; ++} ++ ++static void copy_reg_bits(struct reg_pair_t *reg_pair1, ++ struct reg_pair_t *reg_pair2) ++{ ++ unsigned int i, j; ++ ++ i = j = 0; ++ ++ while (reg_pair1[i].reg || reg_pair1[i].val) { ++ while (reg_pair2[j].reg || reg_pair2[j].val) { ++ if (reg_pair1[i].reg != reg_pair2[j].reg) { ++ j++; ++ continue; ++ } ++ reg_pair2[j].val = reg_pair1[i].val; ++ break; ++ } ++ i++; ++ } ++ return; ++} ++ ++/* ------------------------------------------------------------------------- */ ++ ++static void mxl5007t_set_mode_bits(struct mxl5007t_state *state, ++ enum mxl5007t_mode mode, ++ s32 if_diff_out_level) ++{ ++ switch (mode) { ++ case MxL_MODE_ATSC: ++ set_reg_bits(state->tab_init, 0x06, 0x1f, 0x12); ++ break; ++ case MxL_MODE_DVBT: ++ set_reg_bits(state->tab_init, 0x06, 0x1f, 0x11); ++ break; ++ case MxL_MODE_ISDBT: ++ set_reg_bits(state->tab_init, 0x06, 0x1f, 0x10); ++ break; ++ case MxL_MODE_CABLE: ++ set_reg_bits(state->tab_init_cable, 0x09, 0xff, 0xc1); ++ set_reg_bits(state->tab_init_cable, 0x0a, 0xff, ++ 8 - if_diff_out_level); ++ set_reg_bits(state->tab_init_cable, 0x0b, 0xff, 0x17); ++ break; ++ default: ++ mxl_fail(-EINVAL); ++ } ++ return; ++} ++ ++static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state, ++ enum mxl5007t_if_freq if_freq, ++ int invert_if) ++{ ++ u8 val; ++ ++ switch (if_freq) { ++ case MxL_IF_4_MHZ: ++ val = 0x00; ++ break; ++ case MxL_IF_4_5_MHZ: ++ val = 0x02; ++ break; ++ case MxL_IF_4_57_MHZ: ++ val = 0x03; ++ break; ++ case MxL_IF_5_MHZ: ++ val = 0x04; ++ break; ++ case MxL_IF_5_38_MHZ: ++ val = 0x05; ++ break; ++ case MxL_IF_6_MHZ: ++ val = 0x06; ++ break; ++ case MxL_IF_6_28_MHZ: ++ val = 0x07; ++ break; ++ case MxL_IF_9_1915_MHZ: ++ val = 0x08; ++ break; ++ case MxL_IF_35_25_MHZ: ++ val = 0x09; ++ break; ++ case MxL_IF_36_15_MHZ: ++ val = 0x0a; ++ break; ++ case MxL_IF_44_MHZ: ++ val = 0x0b; ++ break; ++ default: ++ mxl_fail(-EINVAL); ++ return; ++ } ++ set_reg_bits(state->tab_init, 0x02, 0x0f, val); ++ ++ /* set inverted IF or normal IF */ ++ set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00); ++ ++ return; ++} ++ ++static void mxl5007t_set_xtal_freq_bits(struct mxl5007t_state *state, ++ enum mxl5007t_xtal_freq xtal_freq) ++{ ++ switch (xtal_freq) { ++ case MxL_XTAL_16_MHZ: ++ /* select xtal freq & ref freq */ ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x00); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x00); ++ break; ++ case MxL_XTAL_20_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x10); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x01); ++ break; ++ case MxL_XTAL_20_25_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x20); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x02); ++ break; ++ case MxL_XTAL_20_48_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x30); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x03); ++ break; ++ case MxL_XTAL_24_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x40); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x04); ++ break; ++ case MxL_XTAL_25_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x50); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x05); ++ break; ++ case MxL_XTAL_25_14_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x60); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x06); ++ break; ++ case MxL_XTAL_27_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x70); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x07); ++ break; ++ case MxL_XTAL_28_8_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x80); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x08); ++ break; ++ case MxL_XTAL_32_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0x90); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x09); ++ break; ++ case MxL_XTAL_40_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0xa0); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x0a); ++ break; ++ case MxL_XTAL_44_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0xb0); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x0b); ++ break; ++ case MxL_XTAL_48_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0xc0); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x0c); ++ break; ++ case MxL_XTAL_49_3811_MHZ: ++ set_reg_bits(state->tab_init, 0x03, 0xf0, 0xd0); ++ set_reg_bits(state->tab_init, 0x05, 0x0f, 0x0d); ++ break; ++ default: ++ mxl_fail(-EINVAL); ++ return; ++ } ++ ++ return; ++} ++ ++static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state, ++ enum mxl5007t_mode mode) ++{ ++ struct mxl5007t_config *cfg = state->config; ++ ++ memcpy(state->tab_init, init_tab, sizeof(init_tab)); ++ memcpy(state->tab_init_cable, init_tab_cable, sizeof(init_tab_cable)); ++ ++ mxl5007t_set_mode_bits(state, mode, cfg->if_diff_out_level); ++ mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if); ++ mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz); ++ ++ set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable); ++ set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3); ++ set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp); ++ ++ if (mode >= MxL_MODE_CABLE) { ++ copy_reg_bits(state->tab_init, state->tab_init_cable); ++ return state->tab_init_cable; ++ } else ++ return state->tab_init; ++} ++ ++static void mxl5007t_set_bw_bits(struct mxl5007t_state *state, ++ enum mxl5007t_bw_mhz bw) ++{ ++ u8 val; ++ ++ switch (bw) { ++ case MxL_BW_6MHz: ++ val = 0x15; /* set DIG_MODEINDEX, DIG_MODEINDEX_A, ++ * and DIG_MODEINDEX_CSF */ ++ break; ++ case MxL_BW_7MHz: ++ val = 0x2a; ++ break; ++ case MxL_BW_8MHz: ++ val = 0x3f; ++ break; ++ default: ++ mxl_fail(-EINVAL); ++ return; ++ } ++ set_reg_bits(state->tab_rftune, 0x0c, 0x3f, val); ++ ++ return; ++} ++ ++static struct ++reg_pair_t *mxl5007t_calc_rf_tune_regs(struct mxl5007t_state *state, ++ u32 rf_freq, enum mxl5007t_bw_mhz bw) ++{ ++ u32 dig_rf_freq = 0; ++ u32 temp; ++ u32 frac_divider = 1000000; ++ unsigned int i; ++ ++ memcpy(state->tab_rftune, reg_pair_rftune, sizeof(reg_pair_rftune)); ++ ++ mxl5007t_set_bw_bits(state, bw); ++ ++ /* Convert RF frequency into 16 bits => ++ * 10 bit integer (MHz) + 6 bit fraction */ ++ dig_rf_freq = rf_freq / MHz; ++ ++ temp = rf_freq % MHz; ++ ++ for (i = 0; i < 6; i++) { ++ dig_rf_freq <<= 1; ++ frac_divider /= 2; ++ if (temp > frac_divider) { ++ temp -= frac_divider; ++ dig_rf_freq++; ++ } ++ } ++ ++ /* add to have shift center point by 7.8124 kHz */ ++ if (temp > 7812) ++ dig_rf_freq++; ++ ++ set_reg_bits(state->tab_rftune, 0x0d, 0xff, (u8) dig_rf_freq); ++ set_reg_bits(state->tab_rftune, 0x0e, 0xff, (u8) (dig_rf_freq >> 8)); ++ ++ if (rf_freq >= 333000000) ++ set_reg_bits(state->tab_rftune, 0x80, 0x40, 0x40); ++ ++ return state->tab_rftune; ++} ++ ++/* ------------------------------------------------------------------------- */ ++ ++static int mxl5007t_write_reg(struct mxl5007t_state *state, u8 reg, u8 val) ++{ ++ u8 buf[] = { reg, val }; ++ int ret = MxL_I2C_Write(state->config->I2C_Addr, buf, 2, state->config); ++ if (ret) { ++ mxl_err("failed!"); ++ return -EREMOTEIO; ++ } ++ ++ return ret; ++} ++ ++static int mxl5007t_write_regs(struct mxl5007t_state *state, ++ struct reg_pair_t *reg_pair) ++{ ++ unsigned int i = 0; ++ int ret = 0; ++ ++ while ((ret == 0) && (reg_pair[i].reg || reg_pair[i].val)) { ++ ret = mxl5007t_write_reg(state, ++ reg_pair[i].reg, reg_pair[i].val); ++ i++; ++ } ++ ++ return ret; ++} ++ ++/* unused ++static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val) ++{ ++ int ret = MxL_I2C_Read(state->config->I2C_Addr, reg, val, state->config); ++ ++ if (ret) { ++ mxl_err("failed!"); ++ return -EREMOTEIO; ++ } ++ return ret; ++} ++ ++*/ ++ ++static int mxl5007t_soft_reset(struct mxl5007t_state *state) ++{ ++ u8 d = 0xff; ++ ++ int ret = MxL_I2C_Write(state->config->I2C_Addr, &d, 1, state->config); ++ if (ret) { ++ mxl_err("failed!"); ++ return -EREMOTEIO; ++ } ++ return ret; ++} ++ ++static int mxl5007t_tuner_init(struct mxl5007t_state *state, ++ enum mxl5007t_mode mode) ++{ ++ struct reg_pair_t *init_regs; ++ int ret; ++ ++ ret = mxl5007t_soft_reset(state); ++ if (mxl_fail(ret)) ++ goto fail; ++ ++ /* calculate initialization reg array */ ++ init_regs = mxl5007t_calc_init_regs(state, mode); ++ ++ ret = mxl5007t_write_regs(state, init_regs); ++ if (mxl_fail(ret)) ++ goto fail; ++ mdelay(1); ++fail: ++ return ret; ++} ++ ++static int mxl5007t_tuner_rf_tune(struct mxl5007t_state *state, u32 rf_freq_hz, ++ enum mxl5007t_bw_mhz bw) ++{ ++ struct reg_pair_t *rf_tune_regs; ++ int ret; ++ ++ /* calculate channel change reg array */ ++ rf_tune_regs = mxl5007t_calc_rf_tune_regs(state, rf_freq_hz, bw); ++ ++ ret = mxl5007t_write_regs(state, rf_tune_regs); ++ if (mxl_fail(ret)) ++ goto fail; ++ msleep(3); ++fail: ++ return ret; ++} ++ ++/* ------------------------------------------------------------------------- */ ++ ++/* unused ++static int mxl5007t_synth_lock_status(struct mxl5007t_state *state, ++ int *rf_locked, int *ref_locked) ++{ ++ u8 d; ++ int ret; ++ ++ *rf_locked = 0; ++ *ref_locked = 0; ++ ++ ret = mxl5007t_read_reg(state, 0xd8, &d); ++ if (mxl_fail(ret)) ++ goto fail; ++ ++ if ((d & 0x0c) == 0x0c) ++ *rf_locked = 1; ++ ++ if ((d & 0x03) == 0x03) ++ *ref_locked = 1; ++fail: ++ return ret; ++} ++*/ ++ ++/* ------------------------------------------------------------------------- */ ++ ++int a867_mxl5007t_set_params(struct mxl5007t_state *state, enum mxl5007t_bw_mhz bw, u32 freq) ++{ ++ int ret; ++ ++ mutex_lock(&state->lock); ++ ++ ret = mxl5007t_tuner_init(state, state->config->Mode); ++ if (mxl_fail(ret)) ++ goto fail; ++ ++ ret = mxl5007t_tuner_rf_tune(state, freq, bw); ++ if (mxl_fail(ret)) ++ goto fail; ++ ++ state->frequency = freq; //hz ++ state->bandwidth = bw; //6, 7 ,8 ++fail: ++ mutex_unlock(&state->lock); ++ ++ return ret; ++} ++ ++/* ------------------------------------------------------------------------- */ ++ ++/* unused ++static int mxl5007t_init(struct mxl5007t_state *state) ++{ ++ int ret; ++ ++ // wake from standby ++ ret = mxl5007t_write_reg(state, 0x01, 0x01); ++ mxl_fail(ret); ++ ++ return ret; ++} ++ ++*/ ++ ++/* unused ++static int mxl5007t_sleep(struct mxl5007t_state *state) ++{ ++ int ret; ++ ++ // enter standby mode ++ ret = mxl5007t_write_reg(state, 0x01, 0x00); ++ mxl_fail(ret); ++ ret = mxl5007t_write_reg(state, 0x0f, 0x00); ++ mxl_fail(ret); ++ ++ return ret; ++} ++*/ ++ ++/* ------------------------------------------------------------------------- */ ++ ++/* unused ++static int mxl5007t_get_frequency(struct mxl5007t_state *state, u32 *frequency) ++{ ++ *frequency = state->frequency; ++ return 0; ++} ++ ++*/ ++ ++/* unused ++static int mxl5007t_get_bandwidth(struct mxl5007t_state *state, u32 *bandwidth) ++{ ++ *bandwidth = state->bandwidth; ++ return 0; ++} ++*/ ++ ++void a867_mxl5007t_release(struct mxl5007t_state *state) ++{ ++ if( state ) { ++ if( state->tab_init ) kfree(state->tab_init); ++ if( state->tab_init_cable ) kfree(state->tab_init_cable); ++ if( state->tab_rftune ) kfree(state->tab_rftune); ++ state->config->state = NULL; ++ kfree(state); ++ } ++} ++ ++/* unused ++static int mxl5007t_get_chip_id(struct mxl5007t_state *state) ++{ ++ char *name; ++ int ret; ++ u8 id; ++ ++ ret = mxl5007t_read_reg(state, 0xd9, &id); ++ if (mxl_fail(ret)) ++ goto fail; ++ ++ switch (id) { ++ case MxL_5007_V1_F1: ++ name = "MxL5007.v1.f1"; ++ break; ++ case MxL_5007_V1_F2: ++ name = "MxL5007.v1.f2"; ++ break; ++ case MxL_5007_V2_100_F1: ++ name = "MxL5007.v2.100.f1"; ++ break; ++ case MxL_5007_V2_100_F2: ++ name = "MxL5007.v2.100.f2"; ++ break; ++ case MxL_5007_V2_200_F1: ++ name = "MxL5007.v2.200.f1"; ++ break; ++ case MxL_5007_V2_200_F2: ++ name = "MxL5007.v2.200.f2"; ++ break; ++ case MxL_5007_V4: ++ name = "MxL5007T.v4"; ++ break; ++ default: ++ name = "MxL5007T"; ++ printk(KERN_WARNING "%s: unknown rev (%02x)\n", __func__, id); ++ id = MxL_UNKNOWN_ID; ++ } ++ state->chip_id = id; ++ return 0; ++ ++fail: ++ state->chip_id = MxL_UNKNOWN_ID; ++ return ret; ++} ++*/ ++ ++void a867_mxl5007t_attach(struct mxl5007t_config *cfg) ++{ ++ struct mxl5007t_state *state; ++ ++ state = kzalloc(sizeof(struct mxl5007t_state), GFP_KERNEL); ++ if( state == NULL ) return; ++ ++ mutex_init(&state->lock); ++ ++ state->config = cfg; ++ cfg->state = state; ++ state->tab_init = kzalloc(sizeof(init_tab), GFP_KERNEL); ++ if( !state->tab_init ) goto error; ++ ++ state->tab_init_cable = kzalloc(sizeof(init_tab_cable), GFP_KERNEL); ++ if( !state->tab_init_cable ) goto error; ++ ++ state->tab_rftune = kzalloc(sizeof(reg_pair_rftune), GFP_KERNEL); ++ if( !state->tab_rftune ) goto error; ++ return; ++error: ++ printk("fail to allocate memory\n"); ++ return; ++} ++ ++ ++/* ++ * Overrides for Emacs so that we follow Linus's tabbing style. ++ * --------------------------------------------------------------------------- ++ * Local variables: ++ * c-basic-offset: 8 ++ * End: ++ */ +diff --git a/drivers/media/dvb/dvb-usb/a867_mxl5007t.h b/drivers/media/dvb/dvb-usb/a867_mxl5007t.h +new file mode 100644 +index 0000000..fae1059 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_mxl5007t.h +@@ -0,0 +1,135 @@ ++/* ++ * mxl5007t.h - driver for the MaxLinear MxL5007T silicon tuner ++ * ++ * Copyright (C) 2008 Michael Krufky ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * =============> modified from that in linux-2.6.34 ++ */ ++ ++#ifndef __MXL5007T_H__ ++#define __MXL5007T_H__ ++ ++#include "a867_type.h" ++/* ------------------------------------------------------------------------- */ ++ ++enum mxl5007t_if_freq { ++ MxL_IF_4_MHZ, /* 4000000 */ ++ MxL_IF_4_5_MHZ, /* 4500000 */ ++ MxL_IF_4_57_MHZ, /* 4570000 */ ++ MxL_IF_5_MHZ, /* 5000000 */ ++ MxL_IF_5_38_MHZ, /* 5380000 */ ++ MxL_IF_6_MHZ, /* 6000000 */ ++ MxL_IF_6_28_MHZ, /* 6280000 */ ++ MxL_IF_9_1915_MHZ, /* 9191500 */ ++ MxL_IF_35_25_MHZ, /* 35250000 */ ++ MxL_IF_36_15_MHZ, /* 36150000 */ ++ MxL_IF_44_MHZ, /* 44000000 */ ++}; ++ ++enum mxl5007t_xtal_freq { ++ MxL_XTAL_16_MHZ, /* 16000000 */ ++ MxL_XTAL_20_MHZ, /* 20000000 */ ++ MxL_XTAL_20_25_MHZ, /* 20250000 */ ++ MxL_XTAL_20_48_MHZ, /* 20480000 */ ++ MxL_XTAL_24_MHZ, /* 24000000 */ ++ MxL_XTAL_25_MHZ, /* 25000000 */ ++ MxL_XTAL_25_14_MHZ, /* 25140000 */ ++ MxL_XTAL_27_MHZ, /* 27000000 */ ++ MxL_XTAL_28_8_MHZ, /* 28800000 */ ++ MxL_XTAL_32_MHZ, /* 32000000 */ ++ MxL_XTAL_40_MHZ, /* 40000000 */ ++ MxL_XTAL_44_MHZ, /* 44000000 */ ++ MxL_XTAL_48_MHZ, /* 48000000 */ ++ MxL_XTAL_49_3811_MHZ, /* 49381100 */ ++}; ++ ++enum mxl5007t_clkout_amp { ++ MxL_CLKOUT_AMP_0_94V = 0, ++ MxL_CLKOUT_AMP_0_53V = 1, ++ MxL_CLKOUT_AMP_0_37V = 2, ++ MxL_CLKOUT_AMP_0_28V = 3, ++ MxL_CLKOUT_AMP_0_23V = 4, ++ MxL_CLKOUT_AMP_0_20V = 5, ++ MxL_CLKOUT_AMP_0_17V = 6, ++ MxL_CLKOUT_AMP_0_15V = 7, ++}; ++ ++enum mxl5007t_mode { ++ MxL_MODE_ISDBT = 0, ++ MxL_MODE_DVBT = 1, ++ MxL_MODE_ATSC = 2, ++ MxL_MODE_CABLE = 0x10, ++}; ++ ++enum mxl5007t_bw_mhz { ++ MxL_BW_6MHz = 6, ++ MxL_BW_7MHz = 7, ++ MxL_BW_8MHz = 8, ++}; ++ ++struct mxl5007t_config; ++enum mxl5007t_chip_version { ++ MxL_UNKNOWN_ID = 0x00, ++ MxL_5007_V1_F1 = 0x11, ++ MxL_5007_V1_F2 = 0x12, ++ MxL_5007_V4 = 0x14, ++ MxL_5007_V2_100_F1 = 0x21, ++ MxL_5007_V2_100_F2 = 0x22, ++ MxL_5007_V2_200_F1 = 0x23, ++ MxL_5007_V2_200_F2 = 0x24, ++}; ++ ++struct mxl5007t_state { ++ struct mutex lock; ++ struct mxl5007t_config *config; ++ enum mxl5007t_chip_version chip_id; ++ struct reg_pair_t *tab_init; ++ struct reg_pair_t *tab_init_cable; ++ struct reg_pair_t *tab_rftune; ++ u32 frequency; ++ u32 bandwidth; ++}; ++ ++struct mxl5007t_config { ++ Demodulator* demodulator; //AF9035 instance //todo include ++ unsigned char chip; //AF9035 instance ++ unsigned char I2C_Addr; ++ enum mxl5007t_mode Mode; ++ struct mxl5007t_state *state; ++ s32 if_diff_out_level; ++ enum mxl5007t_clkout_amp clk_out_amp; ++ enum mxl5007t_xtal_freq xtal_freq_hz; ++ enum mxl5007t_if_freq if_freq_hz; ++ unsigned int invert_if:1; ++ unsigned int loop_thru_enable:1; ++ unsigned int clk_out_enable:1; ++}; ++ ++extern void a867_mxl5007t_attach(struct mxl5007t_config *cfg); ++extern void a867_mxl5007t_release(struct mxl5007t_state *state); ++extern int a867_mxl5007t_set_params(struct mxl5007t_state *state, enum mxl5007t_bw_mhz bw, u32 freq); ++ ++#endif /* __MXL5007T_H__ */ ++ ++/* ++ * Overrides for Emacs so that we follow Linus's tabbing style. ++ * --------------------------------------------------------------------------- ++ * Local variables: ++ * c-basic-offset: 8 ++ * End: ++ */ ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_ofdm.h b/drivers/media/dvb/dvb-usb/a867_ofdm.h +new file mode 100644 +index 0000000..30df3f2 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_ofdm.h +@@ -0,0 +1,18 @@ ++ ++#define DVB_LL_VERSION1 10 ++ ++#define DVB_LL_VERSION2 10 ++ ++#define DVB_LL_VERSION3 3 ++ ++#define DVB_LL_VERSION4 0 ++ ++ ++#define DVB_OFDM_VERSION1 4 ++ ++#define DVB_OFDM_VERSION2 21 ++ ++#define DVB_OFDM_VERSION3 6 ++ ++#define DVB_OFDM_VERSION4 251 ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_register.h b/drivers/media/dvb/dvb-usb/a867_register.h +new file mode 100644 +index 0000000..76e4795 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_register.h +@@ -0,0 +1,13519 @@ ++#ifndef _TD_BIU_REG_H_ ++#define _TD_BIU_REG_H_ ++// biu_reg.h 6-27-2007 ++// gen_biu Ver 1.0 generated by ++#define xd_p_reg_p_aagc_log_2_acc (*(volatile byte xdata *) 0xF000) ++#define p_reg_p_aagc_log_2_acc 0xF000 ++#define reg_p_aagc_log_2_acc_pos 0 ++#define reg_p_aagc_log_2_acc_len 4 ++#define reg_p_aagc_log_2_acc_lsb 0 ++#define xd_p_reg_p_aagc_signal_level_rdy (*(volatile byte xdata *) 0xF001) ++#define p_reg_p_aagc_signal_level_rdy 0xF001 ++#define reg_p_aagc_signal_level_rdy_pos 0 ++#define reg_p_aagc_signal_level_rdy_len 1 ++#define reg_p_aagc_signal_level_rdy_lsb 0 ++#define xd_r_reg_r_aagc_signal_level_7_0 (*(volatile byte xdata *) 0xF002) ++#define r_reg_r_aagc_signal_level_7_0 0xF002 ++#define reg_r_aagc_signal_level_7_0_pos 0 ++#define reg_r_aagc_signal_level_7_0_len 8 ++#define reg_r_aagc_signal_level_7_0_lsb 0 ++#define xd_r_reg_r_aagc_signal_level_9_8 (*(volatile byte xdata *) 0xF003) ++#define r_reg_r_aagc_signal_level_9_8 0xF003 ++#define reg_r_aagc_signal_level_9_8_pos 0 ++#define reg_r_aagc_signal_level_9_8_len 2 ++#define reg_r_aagc_signal_level_9_8_lsb 8 ++#define xd_p_reg_p_aagc_rf_if_swap (*(volatile byte xdata *) 0xF004) ++#define p_reg_p_aagc_rf_if_swap 0xF004 ++#define reg_p_aagc_rf_if_swap_pos 0 ++#define reg_p_aagc_rf_if_swap_len 1 ++#define reg_p_aagc_rf_if_swap_lsb 0 ++#define xd_p_reg_p_pwm_rf_if_from_hw (*(volatile byte xdata *) 0xF006) ++#define p_reg_p_pwm_rf_if_from_hw 0xF006 ++#define reg_p_pwm_rf_if_from_hw_pos 0 ++#define reg_p_pwm_rf_if_from_hw_len 1 ++#define reg_p_pwm_rf_if_from_hw_lsb 0 ++#define xd_p_reg_aagc_out_if_inv (*(volatile byte xdata *) 0xF007) ++#define p_reg_aagc_out_if_inv 0xF007 ++#define reg_aagc_out_if_inv_pos 0 ++#define reg_aagc_out_if_inv_len 1 ++#define reg_aagc_out_if_inv_lsb 0 ++#define xd_p_reg_aagc_int_en (*(volatile byte xdata *) 0xF008) ++#define p_reg_aagc_int_en 0xF008 ++#define reg_aagc_int_en_pos 0 ++#define reg_aagc_int_en_len 1 ++#define reg_aagc_int_en_lsb 0 ++#define xd_p_reg_aagc_lock_change_flag (*(volatile byte xdata *) 0xF009) ++#define p_reg_aagc_lock_change_flag 0xF009 ++#define reg_aagc_lock_change_flag_pos 0 ++#define reg_aagc_lock_change_flag_len 1 ++#define reg_aagc_lock_change_flag_lsb 0 ++#define xd_p_reg_aagc_rf_loop_bw_scale_acquire (*(volatile byte xdata *) 0xF00A) ++#define p_reg_aagc_rf_loop_bw_scale_acquire 0xF00A ++#define reg_aagc_rf_loop_bw_scale_acquire_pos 0 ++#define reg_aagc_rf_loop_bw_scale_acquire_len 5 ++#define reg_aagc_rf_loop_bw_scale_acquire_lsb 0 ++#define xd_p_reg_aagc_rf_loop_bw_scale_track (*(volatile byte xdata *) 0xF00B) ++#define p_reg_aagc_rf_loop_bw_scale_track 0xF00B ++#define reg_aagc_rf_loop_bw_scale_track_pos 0 ++#define reg_aagc_rf_loop_bw_scale_track_len 5 ++#define reg_aagc_rf_loop_bw_scale_track_lsb 0 ++#define xd_p_reg_aagc_if_loop_bw_scale_acquire (*(volatile byte xdata *) 0xF00C) ++#define p_reg_aagc_if_loop_bw_scale_acquire 0xF00C ++#define reg_aagc_if_loop_bw_scale_acquire_pos 0 ++#define reg_aagc_if_loop_bw_scale_acquire_len 5 ++#define reg_aagc_if_loop_bw_scale_acquire_lsb 0 ++#define xd_p_reg_aagc_if_loop_bw_scale_track (*(volatile byte xdata *) 0xF00D) ++#define p_reg_aagc_if_loop_bw_scale_track 0xF00D ++#define reg_aagc_if_loop_bw_scale_track_pos 0 ++#define reg_aagc_if_loop_bw_scale_track_len 5 ++#define reg_aagc_if_loop_bw_scale_track_lsb 0 ++#define xd_p_reg_aagc_max_rf_agc_7_0 (*(volatile byte xdata *) 0xF00E) ++#define p_reg_aagc_max_rf_agc_7_0 0xF00E ++#define reg_aagc_max_rf_agc_7_0_pos 0 ++#define reg_aagc_max_rf_agc_7_0_len 8 ++#define reg_aagc_max_rf_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_max_rf_agc_9_8 (*(volatile byte xdata *) 0xF00F) ++#define p_reg_aagc_max_rf_agc_9_8 0xF00F ++#define reg_aagc_max_rf_agc_9_8_pos 0 ++#define reg_aagc_max_rf_agc_9_8_len 2 ++#define reg_aagc_max_rf_agc_9_8_lsb 8 ++#define xd_p_reg_aagc_min_rf_agc_7_0 (*(volatile byte xdata *) 0xF010) ++#define p_reg_aagc_min_rf_agc_7_0 0xF010 ++#define reg_aagc_min_rf_agc_7_0_pos 0 ++#define reg_aagc_min_rf_agc_7_0_len 8 ++#define reg_aagc_min_rf_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_min_rf_agc_9_8 (*(volatile byte xdata *) 0xF011) ++#define p_reg_aagc_min_rf_agc_9_8 0xF011 ++#define reg_aagc_min_rf_agc_9_8_pos 0 ++#define reg_aagc_min_rf_agc_9_8_len 2 ++#define reg_aagc_min_rf_agc_9_8_lsb 8 ++#define xd_p_reg_aagc_max_if_agc_7_0 (*(volatile byte xdata *) 0xF012) ++#define p_reg_aagc_max_if_agc_7_0 0xF012 ++#define reg_aagc_max_if_agc_7_0_pos 0 ++#define reg_aagc_max_if_agc_7_0_len 8 ++#define reg_aagc_max_if_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_max_if_agc_9_8 (*(volatile byte xdata *) 0xF013) ++#define p_reg_aagc_max_if_agc_9_8 0xF013 ++#define reg_aagc_max_if_agc_9_8_pos 0 ++#define reg_aagc_max_if_agc_9_8_len 2 ++#define reg_aagc_max_if_agc_9_8_lsb 8 ++#define xd_p_reg_aagc_min_if_agc_7_0 (*(volatile byte xdata *) 0xF014) ++#define p_reg_aagc_min_if_agc_7_0 0xF014 ++#define reg_aagc_min_if_agc_7_0_pos 0 ++#define reg_aagc_min_if_agc_7_0_len 8 ++#define reg_aagc_min_if_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_min_if_agc_9_8 (*(volatile byte xdata *) 0xF015) ++#define p_reg_aagc_min_if_agc_9_8 0xF015 ++#define reg_aagc_min_if_agc_9_8_pos 0 ++#define reg_aagc_min_if_agc_9_8_len 2 ++#define reg_aagc_min_if_agc_9_8_lsb 8 ++#define xd_p_reg_aagc_lock_sample_scale (*(volatile byte xdata *) 0xF016) ++#define p_reg_aagc_lock_sample_scale 0xF016 ++#define reg_aagc_lock_sample_scale_pos 0 ++#define reg_aagc_lock_sample_scale_len 5 ++#define reg_aagc_lock_sample_scale_lsb 0 ++#define xd_p_reg_aagc_rf_agc_lock_scale_acquire (*(volatile byte xdata *) 0xF017) ++#define p_reg_aagc_rf_agc_lock_scale_acquire 0xF017 ++#define reg_aagc_rf_agc_lock_scale_acquire_pos 0 ++#define reg_aagc_rf_agc_lock_scale_acquire_len 3 ++#define reg_aagc_rf_agc_lock_scale_acquire_lsb 0 ++#define xd_p_reg_aagc_rf_agc_lock_scale_track (*(volatile byte xdata *) 0xF018) ++#define p_reg_aagc_rf_agc_lock_scale_track 0xF018 ++#define reg_aagc_rf_agc_lock_scale_track_pos 0 ++#define reg_aagc_rf_agc_lock_scale_track_len 3 ++#define reg_aagc_rf_agc_lock_scale_track_lsb 0 ++#define xd_p_reg_aagc_if_agc_lock_scale_acquire (*(volatile byte xdata *) 0xF019) ++#define p_reg_aagc_if_agc_lock_scale_acquire 0xF019 ++#define reg_aagc_if_agc_lock_scale_acquire_pos 0 ++#define reg_aagc_if_agc_lock_scale_acquire_len 3 ++#define reg_aagc_if_agc_lock_scale_acquire_lsb 0 ++#define xd_p_reg_aagc_if_agc_lock_scale_track (*(volatile byte xdata *) 0xF01A) ++#define p_reg_aagc_if_agc_lock_scale_track 0xF01A ++#define reg_aagc_if_agc_lock_scale_track_pos 0 ++#define reg_aagc_if_agc_lock_scale_track_len 3 ++#define reg_aagc_if_agc_lock_scale_track_lsb 0 ++#define xd_p_reg_aagc_rf_top_numerator_s_7_0 (*(volatile byte xdata *) 0xF01B) ++#define p_reg_aagc_rf_top_numerator_s_7_0 0xF01B ++#define reg_aagc_rf_top_numerator_s_7_0_pos 0 ++#define reg_aagc_rf_top_numerator_s_7_0_len 8 ++#define reg_aagc_rf_top_numerator_s_7_0_lsb 0 ++#define xd_p_reg_aagc_rf_top_numerator_s_9_8 (*(volatile byte xdata *) 0xF01C) ++#define p_reg_aagc_rf_top_numerator_s_9_8 0xF01C ++#define reg_aagc_rf_top_numerator_s_9_8_pos 0 ++#define reg_aagc_rf_top_numerator_s_9_8_len 2 ++#define reg_aagc_rf_top_numerator_s_9_8_lsb 8 ++#define xd_p_reg_aagc_if_top_numerator_s_7_0 (*(volatile byte xdata *) 0xF01D) ++#define p_reg_aagc_if_top_numerator_s_7_0 0xF01D ++#define reg_aagc_if_top_numerator_s_7_0_pos 0 ++#define reg_aagc_if_top_numerator_s_7_0_len 8 ++#define reg_aagc_if_top_numerator_s_7_0_lsb 0 ++#define xd_p_reg_aagc_if_top_numerator_s_9_8 (*(volatile byte xdata *) 0xF01E) ++#define p_reg_aagc_if_top_numerator_s_9_8 0xF01E ++#define reg_aagc_if_top_numerator_s_9_8_pos 0 ++#define reg_aagc_if_top_numerator_s_9_8_len 2 ++#define reg_aagc_if_top_numerator_s_9_8_lsb 8 ++#define xd_p_reg_aagc_adc_out_desired_s_7_0 (*(volatile byte xdata *) 0xF01F) ++#define p_reg_aagc_adc_out_desired_s_7_0 0xF01F ++#define reg_aagc_adc_out_desired_s_7_0_pos 0 ++#define reg_aagc_adc_out_desired_s_7_0_len 8 ++#define reg_aagc_adc_out_desired_s_7_0_lsb 0 ++#define xd_p_reg_aagc_adc_out_desired_s_8 (*(volatile byte xdata *) 0xF020) ++#define p_reg_aagc_adc_out_desired_s_8 0xF020 ++#define reg_aagc_adc_out_desired_s_8_pos 0 ++#define reg_aagc_adc_out_desired_s_8_len 1 ++#define reg_aagc_adc_out_desired_s_8_lsb 8 ++#define xd_p_reg_aagc_lock_count_th (*(volatile byte xdata *) 0xF021) ++#define p_reg_aagc_lock_count_th 0xF021 ++#define reg_aagc_lock_count_th_pos 0 ++#define reg_aagc_lock_count_th_len 4 ++#define reg_aagc_lock_count_th_lsb 0 ++#define xd_p_reg_aagc_rf_agc_unlock_numerator (*(volatile byte xdata *) 0xF022) ++#define p_reg_aagc_rf_agc_unlock_numerator 0xF022 ++#define reg_aagc_rf_agc_unlock_numerator_pos 0 ++#define reg_aagc_rf_agc_unlock_numerator_len 6 ++#define reg_aagc_rf_agc_unlock_numerator_lsb 0 ++#define xd_p_reg_aagc_if_agc_unlock_numerator (*(volatile byte xdata *) 0xF023) ++#define p_reg_aagc_if_agc_unlock_numerator 0xF023 ++#define reg_aagc_if_agc_unlock_numerator_pos 0 ++#define reg_aagc_if_agc_unlock_numerator_len 6 ++#define reg_aagc_if_agc_unlock_numerator_lsb 0 ++#define xd_p_reg_aagc_rf_top_numerator_m_7_0 (*(volatile byte xdata *) 0xF025) ++#define p_reg_aagc_rf_top_numerator_m_7_0 0xF025 ++#define reg_aagc_rf_top_numerator_m_7_0_pos 0 ++#define reg_aagc_rf_top_numerator_m_7_0_len 8 ++#define reg_aagc_rf_top_numerator_m_7_0_lsb 0 ++#define xd_p_reg_aagc_rf_top_numerator_m_9_8 (*(volatile byte xdata *) 0xF026) ++#define p_reg_aagc_rf_top_numerator_m_9_8 0xF026 ++#define reg_aagc_rf_top_numerator_m_9_8_pos 0 ++#define reg_aagc_rf_top_numerator_m_9_8_len 2 ++#define reg_aagc_rf_top_numerator_m_9_8_lsb 8 ++#define xd_p_reg_aagc_if_top_numerator_m_7_0 (*(volatile byte xdata *) 0xF027) ++#define p_reg_aagc_if_top_numerator_m_7_0 0xF027 ++#define reg_aagc_if_top_numerator_m_7_0_pos 0 ++#define reg_aagc_if_top_numerator_m_7_0_len 8 ++#define reg_aagc_if_top_numerator_m_7_0_lsb 0 ++#define xd_p_reg_aagc_if_top_numerator_m_9_8 (*(volatile byte xdata *) 0xF028) ++#define p_reg_aagc_if_top_numerator_m_9_8 0xF028 ++#define reg_aagc_if_top_numerator_m_9_8_pos 0 ++#define reg_aagc_if_top_numerator_m_9_8_len 2 ++#define reg_aagc_if_top_numerator_m_9_8_lsb 8 ++#define xd_p_reg_aagc_adc_out_desired_m_7_0 (*(volatile byte xdata *) 0xF029) ++#define p_reg_aagc_adc_out_desired_m_7_0 0xF029 ++#define reg_aagc_adc_out_desired_m_7_0_pos 0 ++#define reg_aagc_adc_out_desired_m_7_0_len 8 ++#define reg_aagc_adc_out_desired_m_7_0_lsb 0 ++#define xd_p_reg_aagc_adc_out_desired_m_8 (*(volatile byte xdata *) 0xF02A) ++#define p_reg_aagc_adc_out_desired_m_8 0xF02A ++#define reg_aagc_adc_out_desired_m_8_pos 0 ++#define reg_aagc_adc_out_desired_m_8_len 1 ++#define reg_aagc_adc_out_desired_m_8_lsb 8 ++#define xd_p_reg_aagc_mobile_sel (*(volatile byte xdata *) 0xF02B) ++#define p_reg_aagc_mobile_sel 0xF02B ++#define reg_aagc_mobile_sel_pos 0 ++#define reg_aagc_mobile_sel_len 1 ++#define reg_aagc_mobile_sel_lsb 0 ++#define xd_p_reg_aagc_top_reload (*(volatile byte xdata *) 0xF02C) ++#define p_reg_aagc_top_reload 0xF02C ++#define reg_aagc_top_reload_pos 0 ++#define reg_aagc_top_reload_len 1 ++#define reg_aagc_top_reload_lsb 0 ++#define xd_p_reg_aagc_rf_delta_voltage_en (*(volatile byte xdata *) 0xF02D) ++#define p_reg_aagc_rf_delta_voltage_en 0xF02D ++#define reg_aagc_rf_delta_voltage_en_pos 0 ++#define reg_aagc_rf_delta_voltage_en_len 1 ++#define reg_aagc_rf_delta_voltage_en_lsb 0 ++#define xd_p_reg_aagc_rf_voltage_inc (*(volatile byte xdata *) 0xF02E) ++#define p_reg_aagc_rf_voltage_inc 0xF02E ++#define reg_aagc_rf_voltage_inc_pos 0 ++#define reg_aagc_rf_voltage_inc_len 1 ++#define reg_aagc_rf_voltage_inc_lsb 0 ++#define xd_p_reg_aagc_if_delta_voltage_en (*(volatile byte xdata *) 0xF02F) ++#define p_reg_aagc_if_delta_voltage_en 0xF02F ++#define reg_aagc_if_delta_voltage_en_pos 0 ++#define reg_aagc_if_delta_voltage_en_len 1 ++#define reg_aagc_if_delta_voltage_en_lsb 0 ++#define xd_p_reg_aagc_if_voltage_inc (*(volatile byte xdata *) 0xF030) ++#define p_reg_aagc_if_voltage_inc 0xF030 ++#define reg_aagc_if_voltage_inc_pos 0 ++#define reg_aagc_if_voltage_inc_len 1 ++#define reg_aagc_if_voltage_inc_lsb 0 ++#define xd_p_reg_aagc_rf_delta_voltage_7_0 (*(volatile byte xdata *) 0xF032) ++#define p_reg_aagc_rf_delta_voltage_7_0 0xF032 ++#define reg_aagc_rf_delta_voltage_7_0_pos 0 ++#define reg_aagc_rf_delta_voltage_7_0_len 8 ++#define reg_aagc_rf_delta_voltage_7_0_lsb 0 ++#define xd_p_reg_aagc_rf_delta_voltage_15_8 (*(volatile byte xdata *) 0xF033) ++#define p_reg_aagc_rf_delta_voltage_15_8 0xF033 ++#define reg_aagc_rf_delta_voltage_15_8_pos 0 ++#define reg_aagc_rf_delta_voltage_15_8_len 8 ++#define reg_aagc_rf_delta_voltage_15_8_lsb 8 ++#define xd_p_reg_aagc_rf_delta_voltage_23_16 (*(volatile byte xdata *) 0xF034) ++#define p_reg_aagc_rf_delta_voltage_23_16 0xF034 ++#define reg_aagc_rf_delta_voltage_23_16_pos 0 ++#define reg_aagc_rf_delta_voltage_23_16_len 8 ++#define reg_aagc_rf_delta_voltage_23_16_lsb 16 ++#define xd_p_reg_aagc_rf_delta_voltage_29_24 (*(volatile byte xdata *) 0xF035) ++#define p_reg_aagc_rf_delta_voltage_29_24 0xF035 ++#define reg_aagc_rf_delta_voltage_29_24_pos 0 ++#define reg_aagc_rf_delta_voltage_29_24_len 6 ++#define reg_aagc_rf_delta_voltage_29_24_lsb 24 ++#define xd_p_reg_aagc_if_delta_voltage_7_0 (*(volatile byte xdata *) 0xF036) ++#define p_reg_aagc_if_delta_voltage_7_0 0xF036 ++#define reg_aagc_if_delta_voltage_7_0_pos 0 ++#define reg_aagc_if_delta_voltage_7_0_len 8 ++#define reg_aagc_if_delta_voltage_7_0_lsb 0 ++#define xd_p_reg_aagc_if_delta_voltage_15_8 (*(volatile byte xdata *) 0xF037) ++#define p_reg_aagc_if_delta_voltage_15_8 0xF037 ++#define reg_aagc_if_delta_voltage_15_8_pos 0 ++#define reg_aagc_if_delta_voltage_15_8_len 8 ++#define reg_aagc_if_delta_voltage_15_8_lsb 8 ++#define xd_p_reg_aagc_if_delta_voltage_23_16 (*(volatile byte xdata *) 0xF038) ++#define p_reg_aagc_if_delta_voltage_23_16 0xF038 ++#define reg_aagc_if_delta_voltage_23_16_pos 0 ++#define reg_aagc_if_delta_voltage_23_16_len 8 ++#define reg_aagc_if_delta_voltage_23_16_lsb 16 ++#define xd_p_reg_aagc_if_delta_voltage_29_24 (*(volatile byte xdata *) 0xF039) ++#define p_reg_aagc_if_delta_voltage_29_24 0xF039 ++#define reg_aagc_if_delta_voltage_29_24_pos 0 ++#define reg_aagc_if_delta_voltage_29_24_len 6 ++#define reg_aagc_if_delta_voltage_29_24_lsb 24 ++#define xd_p_reg_aagc_delta_voltage_hold_time (*(volatile byte xdata *) 0xF03A) ++#define p_reg_aagc_delta_voltage_hold_time 0xF03A ++#define reg_aagc_delta_voltage_hold_time_pos 0 ++#define reg_aagc_delta_voltage_hold_time_len 8 ++#define reg_aagc_delta_voltage_hold_time_lsb 0 ++#define xd_p_reg_aagc_top_th_dis (*(volatile byte xdata *) 0xF041) ++#define p_reg_aagc_top_th_dis 0xF041 ++#define reg_aagc_top_th_dis_pos 0 ++#define reg_aagc_top_th_dis_len 1 ++#define reg_aagc_top_th_dis_lsb 0 ++#define xd_p_reg_p_aagc_rf_floor_dca (*(volatile byte xdata *) 0xF042) ++#define p_reg_p_aagc_rf_floor_dca 0xF042 ++#define reg_p_aagc_rf_floor_dca_pos 0 ++#define reg_p_aagc_rf_floor_dca_len 8 ++#define reg_p_aagc_rf_floor_dca_lsb 0 ++#define xd_p_reg_p_aagc_if_floor_dca (*(volatile byte xdata *) 0xF043) ++#define p_reg_p_aagc_if_floor_dca 0xF043 ++#define reg_p_aagc_if_floor_dca_pos 0 ++#define reg_p_aagc_if_floor_dca_len 8 ++#define reg_p_aagc_if_floor_dca_lsb 0 ++#define xd_p_reg_p_aagc_rf_gain_scale_dca (*(volatile byte xdata *) 0xF044) ++#define p_reg_p_aagc_rf_gain_scale_dca 0xF044 ++#define reg_p_aagc_rf_gain_scale_dca_pos 0 ++#define reg_p_aagc_rf_gain_scale_dca_len 3 ++#define reg_p_aagc_rf_gain_scale_dca_lsb 0 ++#define xd_p_reg_p_aagc_if_gain_scale_dca (*(volatile byte xdata *) 0xF045) ++#define p_reg_p_aagc_if_gain_scale_dca 0xF045 ++#define reg_p_aagc_if_gain_scale_dca_pos 0 ++#define reg_p_aagc_if_gain_scale_dca_len 3 ++#define reg_p_aagc_if_gain_scale_dca_lsb 0 ++#define xd_r_reg_r_aagc_ufl_gain (*(volatile byte xdata *) 0xF046) ++#define r_reg_r_aagc_ufl_gain 0xF046 ++#define reg_r_aagc_ufl_gain_pos 0 ++#define reg_r_aagc_ufl_gain_len 8 ++#define reg_r_aagc_ufl_gain_lsb 0 ++#define xd_p_reg_aagc_out_rf_inv (*(volatile byte xdata *) 0xF047) ++#define p_reg_aagc_out_rf_inv 0xF047 ++#define reg_aagc_out_rf_inv_pos 0 ++#define reg_aagc_out_rf_inv_len 1 ++#define reg_aagc_out_rf_inv_lsb 0 ++#define xd_p_reg_p_aagc_save_agc_control (*(volatile byte xdata *) 0xF048) ++#define p_reg_p_aagc_save_agc_control 0xF048 ++#define reg_p_aagc_save_agc_control_pos 0 ++#define reg_p_aagc_save_agc_control_len 1 ++#define reg_p_aagc_save_agc_control_lsb 0 ++#define xd_p_reg_aagc_fw_sel (*(volatile byte xdata *) 0xF049) ++#define p_reg_aagc_fw_sel 0xF049 ++#define reg_aagc_fw_sel_pos 0 ++#define reg_aagc_fw_sel_len 1 ++#define reg_aagc_fw_sel_lsb 0 ++#define xd_r_reg_r_aagc_rf_control_7_0 (*(volatile byte xdata *) 0xF04A) ++#define r_reg_r_aagc_rf_control_7_0 0xF04A ++#define reg_r_aagc_rf_control_7_0_pos 0 ++#define reg_r_aagc_rf_control_7_0_len 8 ++#define reg_r_aagc_rf_control_7_0_lsb 0 ++#define xd_r_reg_r_aagc_rf_control_9_8 (*(volatile byte xdata *) 0xF04B) ++#define r_reg_r_aagc_rf_control_9_8 0xF04B ++#define reg_r_aagc_rf_control_9_8_pos 0 ++#define reg_r_aagc_rf_control_9_8_len 2 ++#define reg_r_aagc_rf_control_9_8_lsb 8 ++#define xd_r_reg_r_aagc_if_control_7_0 (*(volatile byte xdata *) 0xF04C) ++#define r_reg_r_aagc_if_control_7_0 0xF04C ++#define reg_r_aagc_if_control_7_0_pos 0 ++#define reg_r_aagc_if_control_7_0_len 8 ++#define reg_r_aagc_if_control_7_0_lsb 0 ++#define xd_r_reg_r_aagc_if_control_9_8 (*(volatile byte xdata *) 0xF04D) ++#define r_reg_r_aagc_if_control_9_8 0xF04D ++#define reg_r_aagc_if_control_9_8_pos 0 ++#define reg_r_aagc_if_control_9_8_len 2 ++#define reg_r_aagc_if_control_9_8_lsb 8 ++#define xd_p_reg_aagc_adc_out_desired_from_fw_7_0 (*(volatile byte xdata *) 0xF04E) ++#define p_reg_aagc_adc_out_desired_from_fw_7_0 0xF04E ++#define reg_aagc_adc_out_desired_from_fw_7_0_pos 0 ++#define reg_aagc_adc_out_desired_from_fw_7_0_len 8 ++#define reg_aagc_adc_out_desired_from_fw_7_0_lsb 0 ++#define xd_p_reg_aagc_adc_out_desired_from_fw_8 (*(volatile byte xdata *) 0xF04F) ++#define p_reg_aagc_adc_out_desired_from_fw_8 0xF04F ++#define reg_aagc_adc_out_desired_from_fw_8_pos 0 ++#define reg_aagc_adc_out_desired_from_fw_8_len 1 ++#define reg_aagc_adc_out_desired_from_fw_8_lsb 8 ++#define xd_p_reg_aagc_init_rf_agc_7_0 (*(volatile byte xdata *) 0xF050) ++#define p_reg_aagc_init_rf_agc_7_0 0xF050 ++#define reg_aagc_init_rf_agc_7_0_pos 0 ++#define reg_aagc_init_rf_agc_7_0_len 8 ++#define reg_aagc_init_rf_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_init_rf_agc_9_8 (*(volatile byte xdata *) 0xF051) ++#define p_reg_aagc_init_rf_agc_9_8 0xF051 ++#define reg_aagc_init_rf_agc_9_8_pos 0 ++#define reg_aagc_init_rf_agc_9_8_len 2 ++#define reg_aagc_init_rf_agc_9_8_lsb 8 ++#define xd_p_reg_aagc_init_if_agc_7_0 (*(volatile byte xdata *) 0xF052) ++#define p_reg_aagc_init_if_agc_7_0 0xF052 ++#define reg_aagc_init_if_agc_7_0_pos 0 ++#define reg_aagc_init_if_agc_7_0_len 8 ++#define reg_aagc_init_if_agc_7_0_lsb 0 ++#define xd_p_reg_aagc_init_if_agc_9_8 (*(volatile byte xdata *) 0xF053) ++#define p_reg_aagc_init_if_agc_9_8 0xF053 ++#define reg_aagc_init_if_agc_9_8_pos 0 ++#define reg_aagc_init_if_agc_9_8_len 2 ++#define reg_aagc_init_if_agc_9_8_lsb 8 ++#define xd_p_reg_p_pwm_if_high_unit_num (*(volatile byte xdata *) 0xF054) ++#define p_reg_p_pwm_if_high_unit_num 0xF054 ++#define reg_p_pwm_if_high_unit_num_pos 0 ++#define reg_p_pwm_if_high_unit_num_len 8 ++#define reg_p_pwm_if_high_unit_num_lsb 0 ++#define xd_p_reg_p_pwm_rf_high_unit_num (*(volatile byte xdata *) 0xF055) ++#define p_reg_p_pwm_rf_high_unit_num 0xF055 ++#define reg_p_pwm_rf_high_unit_num_pos 0 ++#define reg_p_pwm_rf_high_unit_num_len 8 ++#define reg_p_pwm_rf_high_unit_num_lsb 0 ++#define xd_p_reg_p_pwm_rf_gpio (*(volatile byte xdata *) 0xF058) ++#define p_reg_p_pwm_rf_gpio 0xF058 ++#define reg_p_pwm_rf_gpio_pos 0 ++#define reg_p_pwm_rf_gpio_len 1 ++#define reg_p_pwm_rf_gpio_lsb 0 ++#define xd_p_reg_p_pwm_if_gpio (*(volatile byte xdata *) 0xF058) ++#define p_reg_p_pwm_if_gpio 0xF058 ++#define reg_p_pwm_if_gpio_pos 1 ++#define reg_p_pwm_if_gpio_len 1 ++#define reg_p_pwm_if_gpio_lsb 0 ++#define xd_p_reg_aagc_in_sat_cnt_7_0 (*(volatile byte xdata *) 0xF05A) ++#define p_reg_aagc_in_sat_cnt_7_0 0xF05A ++#define reg_aagc_in_sat_cnt_7_0_pos 0 ++#define reg_aagc_in_sat_cnt_7_0_len 8 ++#define reg_aagc_in_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_aagc_in_sat_cnt_15_8 (*(volatile byte xdata *) 0xF05B) ++#define p_reg_aagc_in_sat_cnt_15_8 0xF05B ++#define reg_aagc_in_sat_cnt_15_8_pos 0 ++#define reg_aagc_in_sat_cnt_15_8_len 8 ++#define reg_aagc_in_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_aagc_in_sat_cnt_23_16 (*(volatile byte xdata *) 0xF05C) ++#define p_reg_aagc_in_sat_cnt_23_16 0xF05C ++#define reg_aagc_in_sat_cnt_23_16_pos 0 ++#define reg_aagc_in_sat_cnt_23_16_len 8 ++#define reg_aagc_in_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_aagc_in_sat_cnt_31_24 (*(volatile byte xdata *) 0xF05D) ++#define p_reg_aagc_in_sat_cnt_31_24 0xF05D ++#define reg_aagc_in_sat_cnt_31_24_pos 0 ++#define reg_aagc_in_sat_cnt_31_24_len 8 ++#define reg_aagc_in_sat_cnt_31_24_lsb 24 ++#define xd_p_reg_p_pwm_cycle_unit (*(volatile byte xdata *) 0xF05E) ++#define p_reg_p_pwm_cycle_unit 0xF05E ++#define reg_p_pwm_cycle_unit_pos 0 ++#define reg_p_pwm_cycle_unit_len 4 ++#define reg_p_pwm_cycle_unit_lsb 0 ++#define xd_p_reg_p_pwm_en (*(volatile byte xdata *) 0xF05F) ++#define p_reg_p_pwm_en 0xF05F ++#define reg_p_pwm_en_pos 0 ++#define reg_p_pwm_en_len 1 ++#define reg_p_pwm_en_lsb 0 ++#define xd_r_reg_aagc_rf_gain (*(volatile byte xdata *) 0xF060) ++#define r_reg_aagc_rf_gain 0xF060 ++#define reg_aagc_rf_gain_pos 0 ++#define reg_aagc_rf_gain_len 8 ++#define reg_aagc_rf_gain_lsb 0 ++#define xd_r_reg_aagc_if_gain (*(volatile byte xdata *) 0xF061) ++#define r_reg_aagc_if_gain 0xF061 ++#define reg_aagc_if_gain_pos 0 ++#define reg_aagc_if_gain_len 8 ++#define reg_aagc_if_gain_lsb 0 ++#define xd_r_reg_aagc_current_desired_level_7_0 (*(volatile byte xdata *) 0xF062) ++#define r_reg_aagc_current_desired_level_7_0 0xF062 ++#define reg_aagc_current_desired_level_7_0_pos 0 ++#define reg_aagc_current_desired_level_7_0_len 8 ++#define reg_aagc_current_desired_level_7_0_lsb 0 ++#define xd_r_reg_aagc_current_desired_level_8 (*(volatile byte xdata *) 0xF063) ++#define r_reg_aagc_current_desired_level_8 0xF063 ++#define reg_aagc_current_desired_level_8_pos 0 ++#define reg_aagc_current_desired_level_8_len 1 ++#define reg_aagc_current_desired_level_8_lsb 8 ++#define xd_p_reg_tinr_fifo_size (*(volatile byte xdata *) 0xF064) ++#define p_reg_tinr_fifo_size 0xF064 ++#define reg_tinr_fifo_size_pos 0 ++#define reg_tinr_fifo_size_len 5 ++#define reg_tinr_fifo_size_lsb 0 ++#define xd_p_reg_tinr_saturation_th_7_0 (*(volatile byte xdata *) 0xF065) ++#define p_reg_tinr_saturation_th_7_0 0xF065 ++#define reg_tinr_saturation_th_7_0_pos 0 ++#define reg_tinr_saturation_th_7_0_len 8 ++#define reg_tinr_saturation_th_7_0_lsb 0 ++#define xd_p_reg_tinr_saturation_th_9_8 (*(volatile byte xdata *) 0xF066) ++#define p_reg_tinr_saturation_th_9_8 0xF066 ++#define reg_tinr_saturation_th_9_8_pos 0 ++#define reg_tinr_saturation_th_9_8_len 2 ++#define reg_tinr_saturation_th_9_8_lsb 8 ++#define xd_p_reg_tinr_saturation_cnt_th (*(volatile byte xdata *) 0xF067) ++#define p_reg_tinr_saturation_cnt_th 0xF067 ++#define reg_tinr_saturation_cnt_th_pos 0 ++#define reg_tinr_saturation_cnt_th_len 4 ++#define reg_tinr_saturation_cnt_th_lsb 0 ++#define xd_r_reg_tinr_counter_7_0 (*(volatile byte xdata *) 0xF068) ++#define r_reg_tinr_counter_7_0 0xF068 ++#define reg_tinr_counter_7_0_pos 0 ++#define reg_tinr_counter_7_0_len 8 ++#define reg_tinr_counter_7_0_lsb 0 ++#define xd_r_reg_tinr_counter_15_8 (*(volatile byte xdata *) 0xF069) ++#define r_reg_tinr_counter_15_8 0xF069 ++#define reg_tinr_counter_15_8_pos 0 ++#define reg_tinr_counter_15_8_len 8 ++#define reg_tinr_counter_15_8_lsb 8 ++#define xd_p_reg_tinr_counter_rst (*(volatile byte xdata *) 0xF06C) ++#define p_reg_tinr_counter_rst 0xF06C ++#define reg_tinr_counter_rst_pos 0 ++#define reg_tinr_counter_rst_len 1 ++#define reg_tinr_counter_rst_lsb 0 ++#define xd_p_reg_tinr_ins_th_7_0 (*(volatile byte xdata *) 0xF06F) ++#define p_reg_tinr_ins_th_7_0 0xF06F ++#define reg_tinr_ins_th_7_0_pos 0 ++#define reg_tinr_ins_th_7_0_len 8 ++#define reg_tinr_ins_th_7_0_lsb 0 ++#define xd_p_reg_tinr_ins_th_9_8 (*(volatile byte xdata *) 0xF070) ++#define p_reg_tinr_ins_th_9_8 0xF070 ++#define reg_tinr_ins_th_9_8_pos 0 ++#define reg_tinr_ins_th_9_8_len 2 ++#define reg_tinr_ins_th_9_8_lsb 8 ++#define xd_p_reg_tinr_ins_en (*(volatile byte xdata *) 0xF071) ++#define p_reg_tinr_ins_en 0xF071 ++#define reg_tinr_ins_en_pos 0 ++#define reg_tinr_ins_en_len 1 ++#define reg_tinr_ins_en_lsb 0 ++#define xd_p_reg_tinr_ins_size (*(volatile byte xdata *) 0xF072) ++#define p_reg_tinr_ins_size 0xF072 ++#define reg_tinr_ins_size_pos 0 ++#define reg_tinr_ins_size_len 4 ++#define reg_tinr_ins_size_lsb 0 ++#define xd_p_reg_tinr_ins_hnum (*(volatile byte xdata *) 0xF073) ++#define p_reg_tinr_ins_hnum 0xF073 ++#define reg_tinr_ins_hnum_pos 0 ++#define reg_tinr_ins_hnum_len 4 ++#define reg_tinr_ins_hnum_lsb 0 ++#define xd_r_reg_tinr_ins_hcnt_7_0 (*(volatile byte xdata *) 0xF074) ++#define r_reg_tinr_ins_hcnt_7_0 0xF074 ++#define reg_tinr_ins_hcnt_7_0_pos 0 ++#define reg_tinr_ins_hcnt_7_0_len 8 ++#define reg_tinr_ins_hcnt_7_0_lsb 0 ++#define xd_r_reg_tinr_ins_hcnt_15_8 (*(volatile byte xdata *) 0xF075) ++#define r_reg_tinr_ins_hcnt_15_8 0xF075 ++#define reg_tinr_ins_hcnt_15_8_pos 0 ++#define reg_tinr_ins_hcnt_15_8_len 8 ++#define reg_tinr_ins_hcnt_15_8_lsb 8 ++#define xd_p_reg_tinr_in_conj (*(volatile byte xdata *) 0xF076) ++#define p_reg_tinr_in_conj 0xF076 ++#define reg_tinr_in_conj_pos 0 ++#define reg_tinr_in_conj_len 1 ++#define reg_tinr_in_conj_lsb 0 ++#define xd_p_reg_tinr_in_zero_if (*(volatile byte xdata *) 0xF077) ++#define p_reg_tinr_in_zero_if 0xF077 ++#define reg_tinr_in_zero_if_pos 0 ++#define reg_tinr_in_zero_if_len 2 ++#define reg_tinr_in_zero_if_lsb 0 ++#define xd_p_reg_tinr_in_shift (*(volatile byte xdata *) 0xF078) ++#define p_reg_tinr_in_shift 0xF078 ++#define reg_tinr_in_shift_pos 0 ++#define reg_tinr_in_shift_len 1 ++#define reg_tinr_in_shift_lsb 0 ++#define xd_p_reg_tinr_in_conj_sat_counter_rst (*(volatile byte xdata *) 0xF079) ++#define p_reg_tinr_in_conj_sat_counter_rst 0xF079 ++#define reg_tinr_in_conj_sat_counter_rst_pos 0 ++#define reg_tinr_in_conj_sat_counter_rst_len 1 ++#define reg_tinr_in_conj_sat_counter_rst_lsb 0 ++#define xd_r_reg_tinr_in_conj_sat_counter_7_0 (*(volatile byte xdata *) 0xF07A) ++#define r_reg_tinr_in_conj_sat_counter_7_0 0xF07A ++#define reg_tinr_in_conj_sat_counter_7_0_pos 0 ++#define reg_tinr_in_conj_sat_counter_7_0_len 8 ++#define reg_tinr_in_conj_sat_counter_7_0_lsb 0 ++#define xd_r_reg_tinr_in_conj_sat_counter_14_8 (*(volatile byte xdata *) 0xF07B) ++#define r_reg_tinr_in_conj_sat_counter_14_8 0xF07B ++#define reg_tinr_in_conj_sat_counter_14_8_pos 0 ++#define reg_tinr_in_conj_sat_counter_14_8_len 7 ++#define reg_tinr_in_conj_sat_counter_14_8_lsb 8 ++#define xd_p_reg_p_antif_en (*(volatile byte xdata *) 0xF07C) ++#define p_reg_p_antif_en 0xF07C ++#define reg_p_antif_en_pos 0 ++#define reg_p_antif_en_len 1 ++#define reg_p_antif_en_lsb 0 ++#define xd_p_reg_p_antif_rst (*(volatile byte xdata *) 0xF07D) ++#define p_reg_p_antif_rst 0xF07D ++#define reg_p_antif_rst_pos 0 ++#define reg_p_antif_rst_len 1 ++#define reg_p_antif_rst_lsb 0 ++#define xd_p_reg_p_antif_byp (*(volatile byte xdata *) 0xF07E) ++#define p_reg_p_antif_byp 0xF07E ++#define reg_p_antif_byp_pos 0 ++#define reg_p_antif_byp_len 1 ++#define reg_p_antif_byp_lsb 0 ++#define xd_p_reg_p_antif_mode (*(volatile byte xdata *) 0xF07F) ++#define p_reg_p_antif_mode 0xF07F ++#define reg_p_antif_mode_pos 0 ++#define reg_p_antif_mode_len 1 ++#define reg_p_antif_mode_lsb 0 ++#define xd_p_reg_p_ds_byp (*(volatile byte xdata *) 0xF080) ++#define p_reg_p_ds_byp 0xF080 ++#define reg_p_ds_byp_pos 0 ++#define reg_p_ds_byp_len 1 ++#define reg_p_ds_byp_lsb 0 ++#define xd_p_reg_p_antif_dagc5_mode (*(volatile byte xdata *) 0xF081) ++#define p_reg_p_antif_dagc5_mode 0xF081 ++#define reg_p_antif_dagc5_mode_pos 0 ++#define reg_p_antif_dagc5_mode_len 2 ++#define reg_p_antif_dagc5_mode_lsb 0 ++#define xd_p_reg_p_antif_dagc5_desired_level_7_0 (*(volatile byte xdata *) 0xF082) ++#define p_reg_p_antif_dagc5_desired_level_7_0 0xF082 ++#define reg_p_antif_dagc5_desired_level_7_0_pos 0 ++#define reg_p_antif_dagc5_desired_level_7_0_len 8 ++#define reg_p_antif_dagc5_desired_level_7_0_lsb 0 ++#define xd_p_reg_p_antif_dagc5_desired_level_8 (*(volatile byte xdata *) 0xF083) ++#define p_reg_p_antif_dagc5_desired_level_8 0xF083 ++#define reg_p_antif_dagc5_desired_level_8_pos 0 ++#define reg_p_antif_dagc5_desired_level_8_len 1 ++#define reg_p_antif_dagc5_desired_level_8_lsb 8 ++#define xd_p_reg_p_antif_dagc5_apply_delay (*(volatile byte xdata *) 0xF084) ++#define p_reg_p_antif_dagc5_apply_delay 0xF084 ++#define reg_p_antif_dagc5_apply_delay_pos 0 ++#define reg_p_antif_dagc5_apply_delay_len 7 ++#define reg_p_antif_dagc5_apply_delay_lsb 0 ++#define xd_p_reg_p_antif_dagc5_fixed_gain_7_0 (*(volatile byte xdata *) 0xF085) ++#define p_reg_p_antif_dagc5_fixed_gain_7_0 0xF085 ++#define reg_p_antif_dagc5_fixed_gain_7_0_pos 0 ++#define reg_p_antif_dagc5_fixed_gain_7_0_len 8 ++#define reg_p_antif_dagc5_fixed_gain_7_0_lsb 0 ++#define xd_p_reg_p_antif_dagc5_fixed_gain_11_8 (*(volatile byte xdata *) 0xF086) ++#define p_reg_p_antif_dagc5_fixed_gain_11_8 0xF086 ++#define reg_p_antif_dagc5_fixed_gain_11_8_pos 0 ++#define reg_p_antif_dagc5_fixed_gain_11_8_len 4 ++#define reg_p_antif_dagc5_fixed_gain_11_8_lsb 8 ++#define xd_p_reg_p_antif_dagc5_use_despow (*(volatile byte xdata *) 0xF087) ++#define p_reg_p_antif_dagc5_use_despow 0xF087 ++#define reg_p_antif_dagc5_use_despow_pos 0 ++#define reg_p_antif_dagc5_use_despow_len 1 ++#define reg_p_antif_dagc5_use_despow_lsb 0 ++#define xd_p_reg_p_antif_dagc5_log_2_accumulate_num (*(volatile byte xdata *) 0xF088) ++#define p_reg_p_antif_dagc5_log_2_accumulate_num 0xF088 ++#define reg_p_antif_dagc5_log_2_accumulate_num_pos 0 ++#define reg_p_antif_dagc5_log_2_accumulate_num_len 5 ++#define reg_p_antif_dagc5_log_2_accumulate_num_lsb 0 ++#define xd_p_reg_p_antif_dagc5_in_sat_cnt_7_0 (*(volatile byte xdata *) 0xF089) ++#define p_reg_p_antif_dagc5_in_sat_cnt_7_0 0xF089 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_p_antif_dagc5_in_sat_cnt_15_8 (*(volatile byte xdata *) 0xF08A) ++#define p_reg_p_antif_dagc5_in_sat_cnt_15_8 0xF08A ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_p_antif_dagc5_in_sat_cnt_23_16 (*(volatile byte xdata *) 0xF08B) ++#define p_reg_p_antif_dagc5_in_sat_cnt_23_16 0xF08B ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_p_antif_dagc5_in_sat_cnt_31_24 (*(volatile byte xdata *) 0xF08C) ++#define p_reg_p_antif_dagc5_in_sat_cnt_31_24 0xF08C ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_lsb 24 ++#define xd_p_reg_p_antif_dagc5_out_sat_cnt_7_0 (*(volatile byte xdata *) 0xF08D) ++#define p_reg_p_antif_dagc5_out_sat_cnt_7_0 0xF08D ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_p_antif_dagc5_out_sat_cnt_15_8 (*(volatile byte xdata *) 0xF08E) ++#define p_reg_p_antif_dagc5_out_sat_cnt_15_8 0xF08E ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_p_antif_dagc5_out_sat_cnt_23_16 (*(volatile byte xdata *) 0xF08F) ++#define p_reg_p_antif_dagc5_out_sat_cnt_23_16 0xF08F ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_p_antif_dagc5_out_sat_cnt_31_24 (*(volatile byte xdata *) 0xF090) ++#define p_reg_p_antif_dagc5_out_sat_cnt_31_24 0xF090 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_lsb 24 ++#define xd_p_reg_p_antif_dagc5_rst (*(volatile byte xdata *) 0xF091) ++#define p_reg_p_antif_dagc5_rst 0xF091 ++#define reg_p_antif_dagc5_rst_pos 0 ++#define reg_p_antif_dagc5_rst_len 1 ++#define reg_p_antif_dagc5_rst_lsb 0 ++#define xd_p_reg_p_antif_dagc5_en (*(volatile byte xdata *) 0xF092) ++#define p_reg_p_antif_dagc5_en 0xF092 ++#define reg_p_antif_dagc5_en_pos 0 ++#define reg_p_antif_dagc5_en_len 1 ++#define reg_p_antif_dagc5_en_lsb 0 ++#define xd_p_reg_p_antif_sc_mode (*(volatile byte xdata *) 0xF093) ++#define p_reg_p_antif_sc_mode 0xF093 ++#define reg_p_antif_sc_mode_pos 0 ++#define reg_p_antif_sc_mode_len 4 ++#define reg_p_antif_sc_mode_lsb 0 ++#define xd_p_reg_p_antif_dagc5_done (*(volatile byte xdata *) 0xF094) ++#define p_reg_p_antif_dagc5_done 0xF094 ++#define reg_p_antif_dagc5_done_pos 0 ++#define reg_p_antif_dagc5_done_len 1 ++#define reg_p_antif_dagc5_done_lsb 0 ++#define xd_r_reg_r_antif_sc_7_0 (*(volatile byte xdata *) 0xF095) ++#define r_reg_r_antif_sc_7_0 0xF095 ++#define reg_r_antif_sc_7_0_pos 0 ++#define reg_r_antif_sc_7_0_len 8 ++#define reg_r_antif_sc_7_0_lsb 0 ++#define xd_r_reg_r_antif_sc_15_8 (*(volatile byte xdata *) 0xF096) ++#define r_reg_r_antif_sc_15_8 0xF096 ++#define reg_r_antif_sc_15_8_pos 0 ++#define reg_r_antif_sc_15_8_len 8 ++#define reg_r_antif_sc_15_8_lsb 8 ++#define xd_r_reg_r_antif_dagc5_multiplier_7_0 (*(volatile byte xdata *) 0xF097) ++#define r_reg_r_antif_dagc5_multiplier_7_0 0xF097 ++#define reg_r_antif_dagc5_multiplier_7_0_pos 0 ++#define reg_r_antif_dagc5_multiplier_7_0_len 8 ++#define reg_r_antif_dagc5_multiplier_7_0_lsb 0 ++#define xd_r_reg_r_antif_dagc5_multiplier_15_8 (*(volatile byte xdata *) 0xF098) ++#define r_reg_r_antif_dagc5_multiplier_15_8 0xF098 ++#define reg_r_antif_dagc5_multiplier_15_8_pos 0 ++#define reg_r_antif_dagc5_multiplier_15_8_len 8 ++#define reg_r_antif_dagc5_multiplier_15_8_lsb 8 ++#define xd_r_reg_r_antif_dagc5_right_shift_bits (*(volatile byte xdata *) 0xF099) ++#define r_reg_r_antif_dagc5_right_shift_bits 0xF099 ++#define reg_r_antif_dagc5_right_shift_bits_pos 0 ++#define reg_r_antif_dagc5_right_shift_bits_len 4 ++#define reg_r_antif_dagc5_right_shift_bits_lsb 0 ++#define xd_p_reg_p_antif_dagc5_bypass_scale_ctl (*(volatile byte xdata *) 0xF09A) ++#define p_reg_p_antif_dagc5_bypass_scale_ctl 0xF09A ++#define reg_p_antif_dagc5_bypass_scale_ctl_pos 0 ++#define reg_p_antif_dagc5_bypass_scale_ctl_len 3 ++#define reg_p_antif_dagc5_bypass_scale_ctl_lsb 0 ++#define xd_p_reg_mccid_ccirunno_7_0 (*(volatile byte xdata *) 0xF09B) ++#define p_reg_mccid_ccirunno_7_0 0xF09B ++#define reg_mccid_ccirunno_7_0_pos 0 ++#define reg_mccid_ccirunno_7_0_len 8 ++#define reg_mccid_ccirunno_7_0_lsb 0 ++#define xd_p_reg_mccid_ccirunno_8 (*(volatile byte xdata *) 0xF09C) ++#define p_reg_mccid_ccirunno_8 0xF09C ++#define reg_mccid_ccirunno_8_pos 0 ++#define reg_mccid_ccirunno_8_len 1 ++#define reg_mccid_ccirunno_8_lsb 8 ++#define xd_p_reg_mccid_acirunno_7_0 (*(volatile byte xdata *) 0xF09D) ++#define p_reg_mccid_acirunno_7_0 0xF09D ++#define reg_mccid_acirunno_7_0_pos 0 ++#define reg_mccid_acirunno_7_0_len 8 ++#define reg_mccid_acirunno_7_0_lsb 0 ++#define xd_p_reg_mccid_acirunno_8 (*(volatile byte xdata *) 0xF09E) ++#define p_reg_mccid_acirunno_8 0xF09E ++#define reg_mccid_acirunno_8_pos 0 ++#define reg_mccid_acirunno_8_len 1 ++#define reg_mccid_acirunno_8_lsb 8 ++#define xd_p_reg_mccid_maxtonenearrange_7_0 (*(volatile byte xdata *) 0xF09F) ++#define p_reg_mccid_maxtonenearrange_7_0 0xF09F ++#define reg_mccid_maxtonenearrange_7_0_pos 0 ++#define reg_mccid_maxtonenearrange_7_0_len 8 ++#define reg_mccid_maxtonenearrange_7_0_lsb 0 ++#define xd_p_reg_mccid_maxtonenearrange_8 (*(volatile byte xdata *) 0xF0A0) ++#define p_reg_mccid_maxtonenearrange_8 0xF0A0 ++#define reg_mccid_maxtonenearrange_8_pos 0 ++#define reg_mccid_maxtonenearrange_8_len 1 ++#define reg_mccid_maxtonenearrange_8_lsb 8 ++#define xd_r_reg_mccid_maxacipower_7_0 (*(volatile byte xdata *) 0xF0A1) ++#define r_reg_mccid_maxacipower_7_0 0xF0A1 ++#define reg_mccid_maxacipower_7_0_pos 0 ++#define reg_mccid_maxacipower_7_0_len 8 ++#define reg_mccid_maxacipower_7_0_lsb 0 ++#define xd_r_reg_mccid_maxacipower_15_8 (*(volatile byte xdata *) 0xF0A2) ++#define r_reg_mccid_maxacipower_15_8 0xF0A2 ++#define reg_mccid_maxacipower_15_8_pos 0 ++#define reg_mccid_maxacipower_15_8_len 8 ++#define reg_mccid_maxacipower_15_8_lsb 8 ++#define xd_r_reg_mccid_maxacipower_19_16 (*(volatile byte xdata *) 0xF0A3) ++#define r_reg_mccid_maxacipower_19_16 0xF0A3 ++#define reg_mccid_maxacipower_19_16_pos 0 ++#define reg_mccid_maxacipower_19_16_len 4 ++#define reg_mccid_maxacipower_19_16_lsb 16 ++#define xd_p_reg_p_dcoe_en (*(volatile byte xdata *) 0xF0D5) ++#define p_reg_p_dcoe_en 0xF0D5 ++#define reg_p_dcoe_en_pos 0 ++#define reg_p_dcoe_en_len 1 ++#define reg_p_dcoe_en_lsb 0 ++#define xd_p_reg_p_dcoe_rst (*(volatile byte xdata *) 0xF0D6) ++#define p_reg_p_dcoe_rst 0xF0D6 ++#define reg_p_dcoe_rst_pos 0 ++#define reg_p_dcoe_rst_len 1 ++#define reg_p_dcoe_rst_lsb 0 ++#define xd_p_reg_p_dcoe_clear (*(volatile byte xdata *) 0xF0D7) ++#define p_reg_p_dcoe_clear 0xF0D7 ++#define reg_p_dcoe_clear_pos 0 ++#define reg_p_dcoe_clear_len 1 ++#define reg_p_dcoe_clear_lsb 0 ++#define xd_p_reg_p_dcoe_applyloc_7_0 (*(volatile byte xdata *) 0xF0D8) ++#define p_reg_p_dcoe_applyloc_7_0 0xF0D8 ++#define reg_p_dcoe_applyloc_7_0_pos 0 ++#define reg_p_dcoe_applyloc_7_0_len 8 ++#define reg_p_dcoe_applyloc_7_0_lsb 0 ++#define xd_p_reg_p_dcoe_applyloc_12_8 (*(volatile byte xdata *) 0xF0D9) ++#define p_reg_p_dcoe_applyloc_12_8 0xF0D9 ++#define reg_p_dcoe_applyloc_12_8_pos 0 ++#define reg_p_dcoe_applyloc_12_8_len 5 ++#define reg_p_dcoe_applyloc_12_8_lsb 8 ++#define xd_p_reg_p_dcoe_accnums (*(volatile byte xdata *) 0xF0DA) ++#define p_reg_p_dcoe_accnums 0xF0DA ++#define reg_p_dcoe_accnums_pos 0 ++#define reg_p_dcoe_accnums_len 3 ++#define reg_p_dcoe_accnums_lsb 0 ++#define xd_p_reg_p_dcoe_accweightsum_sh (*(volatile byte xdata *) 0xF0DB) ++#define p_reg_p_dcoe_accweightsum_sh 0xF0DB ++#define reg_p_dcoe_accweightsum_sh_pos 0 ++#define reg_p_dcoe_accweightsum_sh_len 3 ++#define reg_p_dcoe_accweightsum_sh_lsb 0 ++#define xd_p_reg_p_dcoe_accweightcurr (*(volatile byte xdata *) 0xF0DC) ++#define p_reg_p_dcoe_accweightcurr 0xF0DC ++#define reg_p_dcoe_accweightcurr_pos 0 ++#define reg_p_dcoe_accweightcurr_len 8 ++#define reg_p_dcoe_accweightcurr_lsb 0 ++#define xd_p_reg_dcoe_apply_rd (*(volatile byte xdata *) 0xF0DF) ++#define p_reg_dcoe_apply_rd 0xF0DF ++#define reg_dcoe_apply_rd_pos 0 ++#define reg_dcoe_apply_rd_len 1 ++#define reg_dcoe_apply_rd_lsb 0 ++#define xd_r_reg_dcoe_apply_i (*(volatile byte xdata *) 0xF0E0) ++#define r_reg_dcoe_apply_i 0xF0E0 ++#define reg_dcoe_apply_i_pos 0 ++#define reg_dcoe_apply_i_len 8 ++#define reg_dcoe_apply_i_lsb 0 ++#define xd_r_reg_dcoe_apply_q (*(volatile byte xdata *) 0xF0E1) ++#define r_reg_dcoe_apply_q 0xF0E1 ++#define reg_dcoe_apply_q_pos 0 ++#define reg_dcoe_apply_q_len 8 ++#define reg_dcoe_apply_q_lsb 0 ++#define xd_p_reg_p_dcrm_en (*(volatile byte xdata *) 0xF0E2) ++#define p_reg_p_dcrm_en 0xF0E2 ++#define reg_p_dcrm_en_pos 0 ++#define reg_p_dcrm_en_len 1 ++#define reg_p_dcrm_en_lsb 0 ++#define xd_p_reg_p_dcrm_fir (*(volatile byte xdata *) 0xF0E3) ++#define p_reg_p_dcrm_fir 0xF0E3 ++#define reg_p_dcrm_fir_pos 0 ++#define reg_p_dcrm_fir_len 1 ++#define reg_p_dcrm_fir_lsb 0 ++#define xd_p_reg_p_dcrm_log2_firlen (*(volatile byte xdata *) 0xF0E4) ++#define p_reg_p_dcrm_log2_firlen 0xF0E4 ++#define reg_p_dcrm_log2_firlen_pos 0 ++#define reg_p_dcrm_log2_firlen_len 3 ++#define reg_p_dcrm_log2_firlen_lsb 0 ++#define xd_r_reg_dcoe_apply_fir_i (*(volatile byte xdata *) 0xF0E5) ++#define r_reg_dcoe_apply_fir_i 0xF0E5 ++#define reg_dcoe_apply_fir_i_pos 0 ++#define reg_dcoe_apply_fir_i_len 8 ++#define reg_dcoe_apply_fir_i_lsb 0 ++#define xd_r_reg_dcoe_apply_fir_q (*(volatile byte xdata *) 0xF0E6) ++#define r_reg_dcoe_apply_fir_q 0xF0E6 ++#define reg_dcoe_apply_fir_q_pos 0 ++#define reg_dcoe_apply_fir_q_len 8 ++#define reg_dcoe_apply_fir_q_lsb 0 ++#define xd_p_reg_p_dcrm_force_en (*(volatile byte xdata *) 0xF0E7) ++#define p_reg_p_dcrm_force_en 0xF0E7 ++#define reg_p_dcrm_force_en_pos 0 ++#define reg_p_dcrm_force_en_len 1 ++#define reg_p_dcrm_force_en_lsb 0 ++#define xd_p_reg_p_dcrm_force_value_i (*(volatile byte xdata *) 0xF0E8) ++#define p_reg_p_dcrm_force_value_i 0xF0E8 ++#define reg_p_dcrm_force_value_i_pos 0 ++#define reg_p_dcrm_force_value_i_len 8 ++#define reg_p_dcrm_force_value_i_lsb 0 ++#define xd_p_reg_p_dcrm_force_value_q (*(volatile byte xdata *) 0xF0E9) ++#define p_reg_p_dcrm_force_value_q 0xF0E9 ++#define reg_p_dcrm_force_value_q_pos 0 ++#define reg_p_dcrm_force_value_q_len 8 ++#define reg_p_dcrm_force_value_q_lsb 0 ++#define xd_p_reg_p_iqip_en (*(volatile byte xdata *) 0xF0EA) ++#define p_reg_p_iqip_en 0xF0EA ++#define reg_p_iqip_en_pos 0 ++#define reg_p_iqip_en_len 1 ++#define reg_p_iqip_en_lsb 0 ++#define xd_p_reg_p_iqip_rst (*(volatile byte xdata *) 0xF0EB) ++#define p_reg_p_iqip_rst 0xF0EB ++#define reg_p_iqip_rst_pos 0 ++#define reg_p_iqip_rst_len 1 ++#define reg_p_iqip_rst_lsb 0 ++#define xd_p_reg_iqip_mu_ld (*(volatile byte xdata *) 0xF0EC) ++#define p_reg_iqip_mu_ld 0xF0EC ++#define reg_iqip_mu_ld_pos 0 ++#define reg_iqip_mu_ld_len 1 ++#define reg_iqip_mu_ld_lsb 0 ++#define xd_p_reg_p_iqip_mu_7_0 (*(volatile byte xdata *) 0xF0ED) ++#define p_reg_p_iqip_mu_7_0 0xF0ED ++#define reg_p_iqip_mu_7_0_pos 0 ++#define reg_p_iqip_mu_7_0_len 8 ++#define reg_p_iqip_mu_7_0_lsb 0 ++#define xd_p_reg_p_iqip_mu_11_8 (*(volatile byte xdata *) 0xF0EE) ++#define p_reg_p_iqip_mu_11_8 0xF0EE ++#define reg_p_iqip_mu_11_8_pos 0 ++#define reg_p_iqip_mu_11_8_len 4 ++#define reg_p_iqip_mu_11_8_lsb 8 ++#define xd_p_reg_iqip_gs_ld (*(volatile byte xdata *) 0xF0EF) ++#define p_reg_iqip_gs_ld 0xF0EF ++#define reg_iqip_gs_ld_pos 0 ++#define reg_iqip_gs_ld_len 1 ++#define reg_iqip_gs_ld_lsb 0 ++#define xd_p_reg_p_iqip_gsnums (*(volatile byte xdata *) 0xF0F0) ++#define p_reg_p_iqip_gsnums 0xF0F0 ++#define reg_p_iqip_gsnums_pos 0 ++#define reg_p_iqip_gsnums_len 4 ++#define reg_p_iqip_gsnums_lsb 0 ++#define xd_p_reg_p_iqip_gsites_7_0 (*(volatile byte xdata *) 0xF0F1) ++#define p_reg_p_iqip_gsites_7_0 0xF0F1 ++#define reg_p_iqip_gsites_7_0_pos 0 ++#define reg_p_iqip_gsites_7_0_len 8 ++#define reg_p_iqip_gsites_7_0_lsb 0 ++#define xd_p_reg_p_iqip_gsites_15_8 (*(volatile byte xdata *) 0xF0F2) ++#define p_reg_p_iqip_gsites_15_8 0xF0F2 ++#define reg_p_iqip_gsites_15_8_pos 0 ++#define reg_p_iqip_gsites_15_8_len 8 ++#define reg_p_iqip_gsites_15_8_lsb 8 ++#define xd_p_reg_iqip_w_ld (*(volatile byte xdata *) 0xF0F3) ++#define p_reg_iqip_w_ld 0xF0F3 ++#define reg_iqip_w_ld_pos 0 ++#define reg_iqip_w_ld_len 1 ++#define reg_iqip_w_ld_lsb 0 ++#define xd_p_reg_p_iqip_w_re_7_0 (*(volatile byte xdata *) 0xF0F4) ++#define p_reg_p_iqip_w_re_7_0 0xF0F4 ++#define reg_p_iqip_w_re_7_0_pos 0 ++#define reg_p_iqip_w_re_7_0_len 8 ++#define reg_p_iqip_w_re_7_0_lsb 0 ++#define xd_p_reg_p_iqip_w_re_15_8 (*(volatile byte xdata *) 0xF0F5) ++#define p_reg_p_iqip_w_re_15_8 0xF0F5 ++#define reg_p_iqip_w_re_15_8_pos 0 ++#define reg_p_iqip_w_re_15_8_len 8 ++#define reg_p_iqip_w_re_15_8_lsb 8 ++#define xd_p_reg_p_iqip_w_re_16 (*(volatile byte xdata *) 0xF0F6) ++#define p_reg_p_iqip_w_re_16 0xF0F6 ++#define reg_p_iqip_w_re_16_pos 0 ++#define reg_p_iqip_w_re_16_len 1 ++#define reg_p_iqip_w_re_16_lsb 16 ++#define xd_p_reg_p_iqip_w_im_7_0 (*(volatile byte xdata *) 0xF0F7) ++#define p_reg_p_iqip_w_im_7_0 0xF0F7 ++#define reg_p_iqip_w_im_7_0_pos 0 ++#define reg_p_iqip_w_im_7_0_len 8 ++#define reg_p_iqip_w_im_7_0_lsb 0 ++#define xd_p_reg_p_iqip_w_im_15_8 (*(volatile byte xdata *) 0xF0F8) ++#define p_reg_p_iqip_w_im_15_8 0xF0F8 ++#define reg_p_iqip_w_im_15_8_pos 0 ++#define reg_p_iqip_w_im_15_8_len 8 ++#define reg_p_iqip_w_im_15_8_lsb 8 ++#define xd_p_reg_p_iqip_w_im_16 (*(volatile byte xdata *) 0xF0F9) ++#define p_reg_p_iqip_w_im_16 0xF0F9 ++#define reg_p_iqip_w_im_16_pos 0 ++#define reg_p_iqip_w_im_16_len 1 ++#define reg_p_iqip_w_im_16_lsb 16 ++#define xd_p_reg_iqip_accnums_rd (*(volatile byte xdata *) 0xF0FA) ++#define p_reg_iqip_accnums_rd 0xF0FA ++#define reg_iqip_accnums_rd_pos 0 ++#define reg_iqip_accnums_rd_len 1 ++#define reg_iqip_accnums_rd_lsb 0 ++#define xd_p_reg_p_iqip_accnums (*(volatile byte xdata *) 0xF0FB) ++#define p_reg_p_iqip_accnums 0xF0FB ++#define reg_p_iqip_accnums_pos 0 ++#define reg_p_iqip_accnums_len 2 ++#define reg_p_iqip_accnums_lsb 0 ++#define xd_p_reg_iqip_accnums_rdy (*(volatile byte xdata *) 0xF0FC) ++#define p_reg_iqip_accnums_rdy 0xF0FC ++#define reg_iqip_accnums_rdy_pos 0 ++#define reg_iqip_accnums_rdy_len 1 ++#define reg_iqip_accnums_rdy_lsb 0 ++#define xd_r_reg_r_iqip_wacc_re_7_0 (*(volatile byte xdata *) 0xF0FD) ++#define r_reg_r_iqip_wacc_re_7_0 0xF0FD ++#define reg_r_iqip_wacc_re_7_0_pos 0 ++#define reg_r_iqip_wacc_re_7_0_len 8 ++#define reg_r_iqip_wacc_re_7_0_lsb 0 ++#define xd_r_reg_r_iqip_wacc_re_15_8 (*(volatile byte xdata *) 0xF0FE) ++#define r_reg_r_iqip_wacc_re_15_8 0xF0FE ++#define reg_r_iqip_wacc_re_15_8_pos 0 ++#define reg_r_iqip_wacc_re_15_8_len 8 ++#define reg_r_iqip_wacc_re_15_8_lsb 8 ++#define xd_r_reg_r_iqip_wacc_re_16 (*(volatile byte xdata *) 0xF0FF) ++#define r_reg_r_iqip_wacc_re_16 0xF0FF ++#define reg_r_iqip_wacc_re_16_pos 0 ++#define reg_r_iqip_wacc_re_16_len 1 ++#define reg_r_iqip_wacc_re_16_lsb 16 ++#define xd_r_reg_r_iqip_wacc_im_7_0 (*(volatile byte xdata *) 0xF100) ++#define r_reg_r_iqip_wacc_im_7_0 0xF100 ++#define reg_r_iqip_wacc_im_7_0_pos 0 ++#define reg_r_iqip_wacc_im_7_0_len 8 ++#define reg_r_iqip_wacc_im_7_0_lsb 0 ++#define xd_r_reg_r_iqip_wacc_im_15_8 (*(volatile byte xdata *) 0xF101) ++#define r_reg_r_iqip_wacc_im_15_8 0xF101 ++#define reg_r_iqip_wacc_im_15_8_pos 0 ++#define reg_r_iqip_wacc_im_15_8_len 8 ++#define reg_r_iqip_wacc_im_15_8_lsb 8 ++#define xd_r_reg_r_iqip_wacc_im_16 (*(volatile byte xdata *) 0xF102) ++#define r_reg_r_iqip_wacc_im_16 0xF102 ++#define reg_r_iqip_wacc_im_16_pos 0 ++#define reg_r_iqip_wacc_im_16_len 1 ++#define reg_r_iqip_wacc_im_16_lsb 16 ++#define xd_r_reg_r_iqip_out2cacc_re_7_0 (*(volatile byte xdata *) 0xF103) ++#define r_reg_r_iqip_out2cacc_re_7_0 0xF103 ++#define reg_r_iqip_out2cacc_re_7_0_pos 0 ++#define reg_r_iqip_out2cacc_re_7_0_len 8 ++#define reg_r_iqip_out2cacc_re_7_0_lsb 0 ++#define xd_r_reg_r_iqip_out2cacc_re_15_8 (*(volatile byte xdata *) 0xF104) ++#define r_reg_r_iqip_out2cacc_re_15_8 0xF104 ++#define reg_r_iqip_out2cacc_re_15_8_pos 0 ++#define reg_r_iqip_out2cacc_re_15_8_len 8 ++#define reg_r_iqip_out2cacc_re_15_8_lsb 8 ++#define xd_r_reg_r_iqip_out2cacc_re_21_16 (*(volatile byte xdata *) 0xF105) ++#define r_reg_r_iqip_out2cacc_re_21_16 0xF105 ++#define reg_r_iqip_out2cacc_re_21_16_pos 0 ++#define reg_r_iqip_out2cacc_re_21_16_len 6 ++#define reg_r_iqip_out2cacc_re_21_16_lsb 16 ++#define xd_r_reg_r_iqip_out2cacc_im_7_0 (*(volatile byte xdata *) 0xF106) ++#define r_reg_r_iqip_out2cacc_im_7_0 0xF106 ++#define reg_r_iqip_out2cacc_im_7_0_pos 0 ++#define reg_r_iqip_out2cacc_im_7_0_len 8 ++#define reg_r_iqip_out2cacc_im_7_0_lsb 0 ++#define xd_r_reg_r_iqip_out2cacc_im_15_8 (*(volatile byte xdata *) 0xF107) ++#define r_reg_r_iqip_out2cacc_im_15_8 0xF107 ++#define reg_r_iqip_out2cacc_im_15_8_pos 0 ++#define reg_r_iqip_out2cacc_im_15_8_len 8 ++#define reg_r_iqip_out2cacc_im_15_8_lsb 8 ++#define xd_r_reg_r_iqip_out2cacc_im_21_16 (*(volatile byte xdata *) 0xF108) ++#define r_reg_r_iqip_out2cacc_im_21_16 0xF108 ++#define reg_r_iqip_out2cacc_im_21_16_pos 0 ++#define reg_r_iqip_out2cacc_im_21_16_len 6 ++#define reg_r_iqip_out2cacc_im_21_16_lsb 16 ++#define xd_p_reg_mccid_ccif0_scstrobe (*(volatile byte xdata *) 0xF109) ++#define p_reg_mccid_ccif0_scstrobe 0xF109 ++#define reg_mccid_ccif0_scstrobe_pos 0 ++#define reg_mccid_ccif0_scstrobe_len 7 ++#define reg_mccid_ccif0_scstrobe_lsb 0 ++#define xd_p_reg_mccid_cciftrigger (*(volatile byte xdata *) 0xF10A) ++#define p_reg_mccid_cciftrigger 0xF10A ++#define reg_mccid_cciftrigger_pos 0 ++#define reg_mccid_cciftrigger_len 1 ++#define reg_mccid_cciftrigger_lsb 0 ++#define xd_p_reg_mccid_ccif1_scstrobe (*(volatile byte xdata *) 0xF10B) ++#define p_reg_mccid_ccif1_scstrobe 0xF10B ++#define reg_mccid_ccif1_scstrobe_pos 0 ++#define reg_mccid_ccif1_scstrobe_len 7 ++#define reg_mccid_ccif1_scstrobe_lsb 0 ++#define xd_p_reg_mccid_ccif0_fcwccif_7_0 (*(volatile byte xdata *) 0xF10E) ++#define p_reg_mccid_ccif0_fcwccif_7_0 0xF10E ++#define reg_mccid_ccif0_fcwccif_7_0_pos 0 ++#define reg_mccid_ccif0_fcwccif_7_0_len 8 ++#define reg_mccid_ccif0_fcwccif_7_0_lsb 0 ++#define xd_p_reg_mccid_ccif0_fcwccif_13_8 (*(volatile byte xdata *) 0xF10F) ++#define p_reg_mccid_ccif0_fcwccif_13_8 0xF10F ++#define reg_mccid_ccif0_fcwccif_13_8_pos 0 ++#define reg_mccid_ccif0_fcwccif_13_8_len 6 ++#define reg_mccid_ccif0_fcwccif_13_8_lsb 8 ++#define xd_p_reg_mccid_ccif0_state (*(volatile byte xdata *) 0xF110) ++#define p_reg_mccid_ccif0_state 0xF110 ++#define reg_mccid_ccif0_state_pos 0 ++#define reg_mccid_ccif0_state_len 1 ++#define reg_mccid_ccif0_state_lsb 0 ++#define xd_p_reg_mccid_ccif0_acistate (*(volatile byte xdata *) 0xF111) ++#define p_reg_mccid_ccif0_acistate 0xF111 ++#define reg_mccid_ccif0_acistate_pos 0 ++#define reg_mccid_ccif0_acistate_len 1 ++#define reg_mccid_ccif0_acistate_lsb 0 ++#define xd_p_reg_mccid_ccif1_fcwccif_7_0 (*(volatile byte xdata *) 0xF112) ++#define p_reg_mccid_ccif1_fcwccif_7_0 0xF112 ++#define reg_mccid_ccif1_fcwccif_7_0_pos 0 ++#define reg_mccid_ccif1_fcwccif_7_0_len 8 ++#define reg_mccid_ccif1_fcwccif_7_0_lsb 0 ++#define xd_p_reg_mccid_ccif1_fcwccif_13_8 (*(volatile byte xdata *) 0xF113) ++#define p_reg_mccid_ccif1_fcwccif_13_8 0xF113 ++#define reg_mccid_ccif1_fcwccif_13_8_pos 0 ++#define reg_mccid_ccif1_fcwccif_13_8_len 6 ++#define reg_mccid_ccif1_fcwccif_13_8_lsb 8 ++#define xd_p_reg_mccid_ccif1_state (*(volatile byte xdata *) 0xF114) ++#define p_reg_mccid_ccif1_state 0xF114 ++#define reg_mccid_ccif1_state_pos 0 ++#define reg_mccid_ccif1_state_len 1 ++#define reg_mccid_ccif1_state_lsb 0 ++#define xd_p_reg_mccid_ccif1_acistate (*(volatile byte xdata *) 0xF115) ++#define p_reg_mccid_ccif1_acistate 0xF115 ++#define reg_mccid_ccif1_acistate_pos 0 ++#define reg_mccid_ccif1_acistate_len 1 ++#define reg_mccid_ccif1_acistate_lsb 0 ++#define xd_r_reg_r_acif_saturate (*(volatile byte xdata *) 0xF117) ++#define r_reg_r_acif_saturate 0xF117 ++#define reg_r_acif_saturate_pos 0 ++#define reg_r_acif_saturate_len 8 ++#define reg_r_acif_saturate_lsb 0 ++#define xd_p_reg_tmr_timer0_threshold_7_0 (*(volatile byte xdata *) 0xF118) ++#define p_reg_tmr_timer0_threshold_7_0 0xF118 ++#define reg_tmr_timer0_threshold_7_0_pos 0 ++#define reg_tmr_timer0_threshold_7_0_len 8 ++#define reg_tmr_timer0_threshold_7_0_lsb 0 ++#define xd_p_reg_tmr_timer0_threshold_15_8 (*(volatile byte xdata *) 0xF119) ++#define p_reg_tmr_timer0_threshold_15_8 0xF119 ++#define reg_tmr_timer0_threshold_15_8_pos 0 ++#define reg_tmr_timer0_threshold_15_8_len 8 ++#define reg_tmr_timer0_threshold_15_8_lsb 8 ++#define xd_p_reg_tmr_timer0_enable (*(volatile byte xdata *) 0xF11A) ++#define p_reg_tmr_timer0_enable 0xF11A ++#define reg_tmr_timer0_enable_pos 0 ++#define reg_tmr_timer0_enable_len 1 ++#define reg_tmr_timer0_enable_lsb 0 ++#define xd_p_reg_tmr_timer0_clk_sel (*(volatile byte xdata *) 0xF11B) ++#define p_reg_tmr_timer0_clk_sel 0xF11B ++#define reg_tmr_timer0_clk_sel_pos 0 ++#define reg_tmr_timer0_clk_sel_len 1 ++#define reg_tmr_timer0_clk_sel_lsb 0 ++#define xd_p_reg_tmr_timer0_int (*(volatile byte xdata *) 0xF11C) ++#define p_reg_tmr_timer0_int 0xF11C ++#define reg_tmr_timer0_int_pos 0 ++#define reg_tmr_timer0_int_len 1 ++#define reg_tmr_timer0_int_lsb 0 ++#define xd_p_reg_tmr_timer0_rst (*(volatile byte xdata *) 0xF11D) ++#define p_reg_tmr_timer0_rst 0xF11D ++#define reg_tmr_timer0_rst_pos 0 ++#define reg_tmr_timer0_rst_len 1 ++#define reg_tmr_timer0_rst_lsb 0 ++#define xd_r_reg_tmr_timer0_count_7_0 (*(volatile byte xdata *) 0xF11E) ++#define r_reg_tmr_timer0_count_7_0 0xF11E ++#define reg_tmr_timer0_count_7_0_pos 0 ++#define reg_tmr_timer0_count_7_0_len 8 ++#define reg_tmr_timer0_count_7_0_lsb 0 ++#define xd_r_reg_tmr_timer0_count_15_8 (*(volatile byte xdata *) 0xF11F) ++#define r_reg_tmr_timer0_count_15_8 0xF11F ++#define reg_tmr_timer0_count_15_8_pos 0 ++#define reg_tmr_timer0_count_15_8_len 8 ++#define reg_tmr_timer0_count_15_8_lsb 8 ++#define xd_p_reg_suspend (*(volatile byte xdata *) 0xF120) ++#define p_reg_suspend 0xF120 ++#define reg_suspend_pos 0 ++#define reg_suspend_len 1 ++#define reg_suspend_lsb 0 ++#define xd_p_reg_suspend_rdy (*(volatile byte xdata *) 0xF121) ++#define p_reg_suspend_rdy 0xF121 ++#define reg_suspend_rdy_pos 0 ++#define reg_suspend_rdy_len 1 ++#define reg_suspend_rdy_lsb 0 ++#define xd_p_reg_resume (*(volatile byte xdata *) 0xF122) ++#define p_reg_resume 0xF122 ++#define reg_resume_pos 0 ++#define reg_resume_len 1 ++#define reg_resume_lsb 0 ++#define xd_p_reg_resume_rdy (*(volatile byte xdata *) 0xF123) ++#define p_reg_resume_rdy 0xF123 ++#define reg_resume_rdy_pos 0 ++#define reg_resume_rdy_len 1 ++#define reg_resume_rdy_lsb 0 ++#define xd_p_reg_gp_trigger (*(volatile byte xdata *) 0xF124) ++#define p_reg_gp_trigger 0xF124 ++#define reg_gp_trigger_pos 0 ++#define reg_gp_trigger_len 1 ++#define reg_gp_trigger_lsb 0 ++#define xd_p_reg_trigger_sel (*(volatile byte xdata *) 0xF125) ++#define p_reg_trigger_sel 0xF125 ++#define reg_trigger_sel_pos 0 ++#define reg_trigger_sel_len 2 ++#define reg_trigger_sel_lsb 0 ++#define xd_p_reg_debug_ofdm (*(volatile byte xdata *) 0xF126) ++#define p_reg_debug_ofdm 0xF126 ++#define reg_debug_ofdm_pos 0 ++#define reg_debug_ofdm_len 2 ++#define reg_debug_ofdm_lsb 0 ++#define xd_p_reg_trigger_module_sel (*(volatile byte xdata *) 0xF127) ++#define p_reg_trigger_module_sel 0xF127 ++#define reg_trigger_module_sel_pos 0 ++#define reg_trigger_module_sel_len 6 ++#define reg_trigger_module_sel_lsb 0 ++#define xd_p_reg_trigger_set_sel (*(volatile byte xdata *) 0xF128) ++#define p_reg_trigger_set_sel 0xF128 ++#define reg_trigger_set_sel_pos 0 ++#define reg_trigger_set_sel_len 6 ++#define reg_trigger_set_sel_lsb 0 ++#define xd_p_reg_fw_int_mask_n (*(volatile byte xdata *) 0xF129) ++#define p_reg_fw_int_mask_n 0xF129 ++#define reg_fw_int_mask_n_pos 0 ++#define reg_fw_int_mask_n_len 1 ++#define reg_fw_int_mask_n_lsb 0 ++#define xd_p_reg_dioif_rst (*(volatile byte xdata *) 0xF12A) ++#define p_reg_dioif_rst 0xF12A ++#define reg_dioif_rst_pos 0 ++#define reg_dioif_rst_len 1 ++#define reg_dioif_rst_lsb 0 ++#define xd_p_reg_debug_group (*(volatile byte xdata *) 0xF12B) ++#define p_reg_debug_group 0xF12B ++#define reg_debug_group_pos 0 ++#define reg_debug_group_len 4 ++#define reg_debug_group_lsb 0 ++#define xd_p_reg_odbg_clk_sel (*(volatile byte xdata *) 0xF12C) ++#define p_reg_odbg_clk_sel 0xF12C ++#define reg_odbg_clk_sel_pos 0 ++#define reg_odbg_clk_sel_len 3 ++#define reg_odbg_clk_sel_lsb 0 ++#define xd_p_reg_p_ccif_shift_fre (*(volatile byte xdata *) 0xF12F) ++#define p_reg_p_ccif_shift_fre 0xF12F ++#define reg_p_ccif_shift_fre_pos 0 ++#define reg_p_ccif_shift_fre_len 1 ++#define reg_p_ccif_shift_fre_lsb 0 ++#define xd_p_reg_p_ccif_bandwidth_factor (*(volatile byte xdata *) 0xF130) ++#define p_reg_p_ccif_bandwidth_factor 0xF130 ++#define reg_p_ccif_bandwidth_factor_pos 0 ++#define reg_p_ccif_bandwidth_factor_len 3 ++#define reg_p_ccif_bandwidth_factor_lsb 0 ++#define xd_p_reg_ccif_rst (*(volatile byte xdata *) 0xF131) ++#define p_reg_ccif_rst 0xF131 ++#define reg_ccif_rst_pos 0 ++#define reg_ccif_rst_len 1 ++#define reg_ccif_rst_lsb 0 ++#define xd_p_reg_p_ccif_min_bandwidth (*(volatile byte xdata *) 0xF132) ++#define p_reg_p_ccif_min_bandwidth 0xF132 ++#define reg_p_ccif_min_bandwidth_pos 0 ++#define reg_p_ccif_min_bandwidth_len 7 ++#define reg_p_ccif_min_bandwidth_lsb 0 ++#define xd_p_reg_ccif_bq0_state (*(volatile byte xdata *) 0xF133) ++#define p_reg_ccif_bq0_state 0xF133 ++#define reg_ccif_bq0_state_pos 0 ++#define reg_ccif_bq0_state_len 1 ++#define reg_ccif_bq0_state_lsb 0 ++#define xd_p_reg_ccif_bq0_outputscaling (*(volatile byte xdata *) 0xF134) ++#define p_reg_ccif_bq0_outputscaling 0xF134 ++#define reg_ccif_bq0_outputscaling_pos 0 ++#define reg_ccif_bq0_outputscaling_len 5 ++#define reg_ccif_bq0_outputscaling_lsb 0 ++#define xd_p_reg_ccif_bq1_state (*(volatile byte xdata *) 0xF135) ++#define p_reg_ccif_bq1_state 0xF135 ++#define reg_ccif_bq1_state_pos 0 ++#define reg_ccif_bq1_state_len 1 ++#define reg_ccif_bq1_state_lsb 0 ++#define xd_p_reg_ccif_bq1_outputscaling (*(volatile byte xdata *) 0xF136) ++#define p_reg_ccif_bq1_outputscaling 0xF136 ++#define reg_ccif_bq1_outputscaling_pos 0 ++#define reg_ccif_bq1_outputscaling_len 5 ++#define reg_ccif_bq1_outputscaling_lsb 0 ++#define xd_p_reg_ccif_bq0_a1_7_0 (*(volatile byte xdata *) 0xF137) ++#define p_reg_ccif_bq0_a1_7_0 0xF137 ++#define reg_ccif_bq0_a1_7_0_pos 0 ++#define reg_ccif_bq0_a1_7_0_len 8 ++#define reg_ccif_bq0_a1_7_0_lsb 0 ++#define xd_p_reg_ccif_bq0_a1_13_8 (*(volatile byte xdata *) 0xF138) ++#define p_reg_ccif_bq0_a1_13_8 0xF138 ++#define reg_ccif_bq0_a1_13_8_pos 0 ++#define reg_ccif_bq0_a1_13_8_len 6 ++#define reg_ccif_bq0_a1_13_8_lsb 8 ++#define xd_p_reg_ccif_bq1_a1_7_0 (*(volatile byte xdata *) 0xF139) ++#define p_reg_ccif_bq1_a1_7_0 0xF139 ++#define reg_ccif_bq1_a1_7_0_pos 0 ++#define reg_ccif_bq1_a1_7_0_len 8 ++#define reg_ccif_bq1_a1_7_0_lsb 0 ++#define xd_p_reg_ccif_bq1_a1_13_8 (*(volatile byte xdata *) 0xF13A) ++#define p_reg_ccif_bq1_a1_13_8 0xF13A ++#define reg_ccif_bq1_a1_13_8_pos 0 ++#define reg_ccif_bq1_a1_13_8_len 6 ++#define reg_ccif_bq1_a1_13_8_lsb 8 ++#define xd_p_reg_ccif_bq0_b1_7_0 (*(volatile byte xdata *) 0xF13B) ++#define p_reg_ccif_bq0_b1_7_0 0xF13B ++#define reg_ccif_bq0_b1_7_0_pos 0 ++#define reg_ccif_bq0_b1_7_0_len 8 ++#define reg_ccif_bq0_b1_7_0_lsb 0 ++#define xd_p_reg_ccif_bq0_b1_13_8 (*(volatile byte xdata *) 0xF13C) ++#define p_reg_ccif_bq0_b1_13_8 0xF13C ++#define reg_ccif_bq0_b1_13_8_pos 0 ++#define reg_ccif_bq0_b1_13_8_len 6 ++#define reg_ccif_bq0_b1_13_8_lsb 8 ++#define xd_p_reg_ccif_bq1_b1_7_0 (*(volatile byte xdata *) 0xF13D) ++#define p_reg_ccif_bq1_b1_7_0 0xF13D ++#define reg_ccif_bq1_b1_7_0_pos 0 ++#define reg_ccif_bq1_b1_7_0_len 8 ++#define reg_ccif_bq1_b1_7_0_lsb 0 ++#define xd_p_reg_ccif_bq1_b1_13_8 (*(volatile byte xdata *) 0xF13E) ++#define p_reg_ccif_bq1_b1_13_8 0xF13E ++#define reg_ccif_bq1_b1_13_8_pos 0 ++#define reg_ccif_bq1_b1_13_8_len 6 ++#define reg_ccif_bq1_b1_13_8_lsb 8 ++#define xd_p_reg_ccif_bq0_b2_7_0 (*(volatile byte xdata *) 0xF13F) ++#define p_reg_ccif_bq0_b2_7_0 0xF13F ++#define reg_ccif_bq0_b2_7_0_pos 0 ++#define reg_ccif_bq0_b2_7_0_len 8 ++#define reg_ccif_bq0_b2_7_0_lsb 0 ++#define xd_p_reg_ccif_bq0_b2_13_8 (*(volatile byte xdata *) 0xF140) ++#define p_reg_ccif_bq0_b2_13_8 0xF140 ++#define reg_ccif_bq0_b2_13_8_pos 0 ++#define reg_ccif_bq0_b2_13_8_len 6 ++#define reg_ccif_bq0_b2_13_8_lsb 8 ++#define xd_p_reg_ccif_bq1_b2_7_0 (*(volatile byte xdata *) 0xF141) ++#define p_reg_ccif_bq1_b2_7_0 0xF141 ++#define reg_ccif_bq1_b2_7_0_pos 0 ++#define reg_ccif_bq1_b2_7_0_len 8 ++#define reg_ccif_bq1_b2_7_0_lsb 0 ++#define xd_p_reg_ccif_bq1_b2_13_8 (*(volatile byte xdata *) 0xF142) ++#define p_reg_ccif_bq1_b2_13_8 0xF142 ++#define reg_ccif_bq1_b2_13_8_pos 0 ++#define reg_ccif_bq1_b2_13_8_len 6 ++#define reg_ccif_bq1_b2_13_8_lsb 8 ++#define xd_p_reg_ccif_debug_rst (*(volatile byte xdata *) 0xF143) ++#define p_reg_ccif_debug_rst 0xF143 ++#define reg_ccif_debug_rst_pos 0 ++#define reg_ccif_debug_rst_len 1 ++#define reg_ccif_debug_rst_lsb 0 ++#define xd_p_reg_mccid_defaultccifscstrobe (*(volatile byte xdata *) 0xF144) ++#define p_reg_mccid_defaultccifscstrobe 0xF144 ++#define reg_mccid_defaultccifscstrobe_pos 0 ++#define reg_mccid_defaultccifscstrobe_len 7 ++#define reg_mccid_defaultccifscstrobe_lsb 0 ++#define xd_p_reg_mccid_monitoringaci (*(volatile byte xdata *) 0xF145) ++#define p_reg_mccid_monitoringaci 0xF145 ++#define reg_mccid_monitoringaci_pos 0 ++#define reg_mccid_monitoringaci_len 1 ++#define reg_mccid_monitoringaci_lsb 0 ++#define xd_p_reg_mccid_ispassmode (*(volatile byte xdata *) 0xF146) ++#define p_reg_mccid_ispassmode 0xF146 ++#define reg_mccid_ispassmode_pos 0 ++#define reg_mccid_ispassmode_len 1 ++#define reg_mccid_ispassmode_lsb 0 ++#define xd_p_reg_mccid_issteadystatemode (*(volatile byte xdata *) 0xF147) ++#define p_reg_mccid_issteadystatemode 0xF147 ++#define reg_mccid_issteadystatemode_pos 0 ++#define reg_mccid_issteadystatemode_len 1 ++#define reg_mccid_issteadystatemode_lsb 0 ++#define xd_p_reg_mccid_fixedgaincmp (*(volatile byte xdata *) 0xF148) ++#define p_reg_mccid_fixedgaincmp 0xF148 ++#define reg_mccid_fixedgaincmp_pos 0 ++#define reg_mccid_fixedgaincmp_len 1 ++#define reg_mccid_fixedgaincmp_lsb 0 ++#define xd_p_reg_mccid_misscounter_reset (*(volatile byte xdata *) 0xF149) ++#define p_reg_mccid_misscounter_reset 0xF149 ++#define reg_mccid_misscounter_reset_pos 0 ++#define reg_mccid_misscounter_reset_len 1 ++#define reg_mccid_misscounter_reset_lsb 0 ++#define xd_p_reg_mccid_acwgcheckcciexist (*(volatile byte xdata *) 0xF14A) ++#define p_reg_mccid_acwgcheckcciexist 0xF14A ++#define reg_mccid_acwgcheckcciexist_pos 0 ++#define reg_mccid_acwgcheckcciexist_len 1 ++#define reg_mccid_acwgcheckcciexist_lsb 0 ++#define xd_p_reg_mccid_acidone (*(volatile byte xdata *) 0xF14B) ++#define p_reg_mccid_acidone 0xF14B ++#define reg_mccid_acidone_pos 0 ++#define reg_mccid_acidone_len 1 ++#define reg_mccid_acidone_lsb 0 ++#define xd_p_reg_mccid_sxdesiredpower_7_0 (*(volatile byte xdata *) 0xF14C) ++#define p_reg_mccid_sxdesiredpower_7_0 0xF14C ++#define reg_mccid_sxdesiredpower_7_0_pos 0 ++#define reg_mccid_sxdesiredpower_7_0_len 8 ++#define reg_mccid_sxdesiredpower_7_0_lsb 0 ++#define xd_p_reg_mccid_sxdesiredpower_9_8 (*(volatile byte xdata *) 0xF14D) ++#define p_reg_mccid_sxdesiredpower_9_8 0xF14D ++#define reg_mccid_sxdesiredpower_9_8_pos 0 ++#define reg_mccid_sxdesiredpower_9_8_len 2 ++#define reg_mccid_sxdesiredpower_9_8_lsb 8 ++#define xd_p_reg_mccid_defaultccitimertriggerno (*(volatile byte xdata *) 0xF14E) ++#define p_reg_mccid_defaultccitimertriggerno 0xF14E ++#define reg_mccid_defaultccitimertriggerno_pos 0 ++#define reg_mccid_defaultccitimertriggerno_len 8 ++#define reg_mccid_defaultccitimertriggerno_lsb 0 ++#define xd_p_reg_mccid_detectedmaxtonecountshift (*(volatile byte xdata *) 0xF14F) ++#define p_reg_mccid_detectedmaxtonecountshift 0xF14F ++#define reg_mccid_detectedmaxtonecountshift_pos 0 ++#define reg_mccid_detectedmaxtonecountshift_len 3 ++#define reg_mccid_detectedmaxtonecountshift_lsb 0 ++#define xd_p_reg_mccid_moveffttoccif_en (*(volatile byte xdata *) 0xF151) ++#define p_reg_mccid_moveffttoccif_en 0xF151 ++#define reg_mccid_moveffttoccif_en_pos 0 ++#define reg_mccid_moveffttoccif_en_len 1 ++#define reg_mccid_moveffttoccif_en_lsb 0 ++#define xd_p_reg_mccid_fftindextobfsfcwfactor_7_0 (*(volatile byte xdata *) 0xF152) ++#define p_reg_mccid_fftindextobfsfcwfactor_7_0 0xF152 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_pos 0 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_len 8 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_lsb 0 ++#define xd_p_reg_mccid_fftindextobfsfcwfactor_9_8 (*(volatile byte xdata *) 0xF153) ++#define p_reg_mccid_fftindextobfsfcwfactor_9_8 0xF153 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_pos 0 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_len 2 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_lsb 8 ++#define xd_p_reg_mccid_bfsfcwffttoindexfactor_7_0 (*(volatile byte xdata *) 0xF154) ++#define p_reg_mccid_bfsfcwffttoindexfactor_7_0 0xF154 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_pos 0 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_len 8 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_lsb 0 ++#define xd_p_reg_mccid_bfsfcwffttoindexfactor_10_8 (*(volatile byte xdata *) 0xF155) ++#define p_reg_mccid_bfsfcwffttoindexfactor_10_8 0xF155 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_pos 0 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_len 3 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_lsb 8 ++#define xd_p_reg_mccid_detectedaci (*(volatile byte xdata *) 0xF156) ++#define p_reg_mccid_detectedaci 0xF156 ++#define reg_mccid_detectedaci_pos 0 ++#define reg_mccid_detectedaci_len 1 ++#define reg_mccid_detectedaci_lsb 0 ++#define xd_r_reg_mccid_filter_enable (*(volatile byte xdata *) 0xF157) ++#define r_reg_mccid_filter_enable 0xF157 ++#define reg_mccid_filter_enable_pos 0 ++#define reg_mccid_filter_enable_len 1 ++#define reg_mccid_filter_enable_lsb 0 ++#define xd_p_reg_mccid_aciscstrobe (*(volatile byte xdata *) 0xF158) ++#define p_reg_mccid_aciscstrobe 0xF158 ++#define reg_mccid_aciscstrobe_pos 0 ++#define reg_mccid_aciscstrobe_len 7 ++#define reg_mccid_aciscstrobe_lsb 0 ++#define xd_p_reg_mccid_scanningaci (*(volatile byte xdata *) 0xF159) ++#define p_reg_mccid_scanningaci 0xF159 ++#define reg_mccid_scanningaci_pos 0 ++#define reg_mccid_scanningaci_len 1 ++#define reg_mccid_scanningaci_lsb 0 ++#define xd_p_reg_mccid_windowsizeacciwdcount_7_0 (*(volatile byte xdata *) 0xF15A) ++#define p_reg_mccid_windowsizeacciwdcount_7_0 0xF15A ++#define reg_mccid_windowsizeacciwdcount_7_0_pos 0 ++#define reg_mccid_windowsizeacciwdcount_7_0_len 8 ++#define reg_mccid_windowsizeacciwdcount_7_0_lsb 0 ++#define xd_p_reg_mccid_windowsizeacciwdcount_12_8 (*(volatile byte xdata *) 0xF15B) ++#define p_reg_mccid_windowsizeacciwdcount_12_8 0xF15B ++#define reg_mccid_windowsizeacciwdcount_12_8_pos 0 ++#define reg_mccid_windowsizeacciwdcount_12_8_len 5 ++#define reg_mccid_windowsizeacciwdcount_12_8_lsb 8 ++#define xd_p_reg_mccid_scannedacionly (*(volatile byte xdata *) 0xF15C) ++#define p_reg_mccid_scannedacionly 0xF15C ++#define reg_mccid_scannedacionly_pos 0 ++#define reg_mccid_scannedacionly_len 1 ++#define reg_mccid_scannedacionly_lsb 0 ++#define xd_p_reg_mccid_scfactor (*(volatile byte xdata *) 0xF15D) ++#define p_reg_mccid_scfactor 0xF15D ++#define reg_mccid_scfactor_pos 0 ++#define reg_mccid_scfactor_len 5 ++#define reg_mccid_scfactor_lsb 0 ++#define xd_p_reg_mccid_defaultevaluatingbandwidthfactor (*(volatile byte xdata *) 0xF15E) ++#define p_reg_mccid_defaultevaluatingbandwidthfactor 0xF15E ++#define reg_mccid_defaultevaluatingbandwidthfactor_pos 0 ++#define reg_mccid_defaultevaluatingbandwidthfactor_len 3 ++#define reg_mccid_defaultevaluatingbandwidthfactor_lsb 0 ++#define xd_p_reg_mccid_defaultacipowerlevel (*(volatile byte xdata *) 0xF15F) ++#define p_reg_mccid_defaultacipowerlevel 0xF15F ++#define reg_mccid_defaultacipowerlevel_pos 0 ++#define reg_mccid_defaultacipowerlevel_len 3 ++#define reg_mccid_defaultacipowerlevel_lsb 0 ++#define xd_r_reg_mccid_outputdagc1gain_7_0 (*(volatile byte xdata *) 0xF160) ++#define r_reg_mccid_outputdagc1gain_7_0 0xF160 ++#define reg_mccid_outputdagc1gain_7_0_pos 0 ++#define reg_mccid_outputdagc1gain_7_0_len 8 ++#define reg_mccid_outputdagc1gain_7_0_lsb 0 ++#define xd_r_reg_mccid_outputdagc1gain_9_8 (*(volatile byte xdata *) 0xF161) ++#define r_reg_mccid_outputdagc1gain_9_8 0xF161 ++#define reg_mccid_outputdagc1gain_9_8_pos 0 ++#define reg_mccid_outputdagc1gain_9_8_len 2 ++#define reg_mccid_outputdagc1gain_9_8_lsb 8 ++#define xd_r_reg_mccid_outputdagc1gainshift (*(volatile byte xdata *) 0xF162) ++#define r_reg_mccid_outputdagc1gainshift 0xF162 ++#define reg_mccid_outputdagc1gainshift_pos 0 ++#define reg_mccid_outputdagc1gainshift_len 4 ++#define reg_mccid_outputdagc1gainshift_lsb 0 ++#define xd_p_reg_mccid_defaultacwgcheckccipowerlevel (*(volatile byte xdata *) 0xF163) ++#define p_reg_mccid_defaultacwgcheckccipowerlevel 0xF163 ++#define reg_mccid_defaultacwgcheckccipowerlevel_pos 0 ++#define reg_mccid_defaultacwgcheckccipowerlevel_len 3 ++#define reg_mccid_defaultacwgcheckccipowerlevel_lsb 0 ++#define xd_p_reg_mccid_ccipowerlevelfactor (*(volatile byte xdata *) 0xF166) ++#define p_reg_mccid_ccipowerlevelfactor 0xF166 ++#define reg_mccid_ccipowerlevelfactor_pos 0 ++#define reg_mccid_ccipowerlevelfactor_len 3 ++#define reg_mccid_ccipowerlevelfactor_lsb 0 ++#define xd_p_reg_mccid_scstrobesearchingrange (*(volatile byte xdata *) 0xF167) ++#define p_reg_mccid_scstrobesearchingrange 0xF167 ++#define reg_mccid_scstrobesearchingrange_pos 0 ++#define reg_mccid_scstrobesearchingrange_len 8 ++#define reg_mccid_scstrobesearchingrange_lsb 0 ++#define xd_p_reg_mccid_searchingno (*(volatile byte xdata *) 0xF168) ++#define p_reg_mccid_searchingno 0xF168 ++#define reg_mccid_searchingno_pos 0 ++#define reg_mccid_searchingno_len 6 ++#define reg_mccid_searchingno_lsb 0 ++#define xd_p_reg_mccid_scannedacifrequencyresolution (*(volatile byte xdata *) 0xF169) ++#define p_reg_mccid_scannedacifrequencyresolution 0xF169 ++#define reg_mccid_scannedacifrequencyresolution_pos 0 ++#define reg_mccid_scannedacifrequencyresolution_len 4 ++#define reg_mccid_scannedacifrequencyresolution_lsb 0 ++#define xd_p_reg_mccid_fft0_maskmaxtoneindex_7_0 (*(volatile byte xdata *) 0xF16A) ++#define p_reg_mccid_fft0_maskmaxtoneindex_7_0 0xF16A ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_pos 0 ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_len 8 ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_lsb 0 ++#define xd_p_reg_mccid_fft0_maskmaxtoneindex_12_8 (*(volatile byte xdata *) 0xF16B) ++#define p_reg_mccid_fft0_maskmaxtoneindex_12_8 0xF16B ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_pos 0 ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_len 5 ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_lsb 8 ++#define xd_p_reg_mccid_fft0_state (*(volatile byte xdata *) 0xF16C) ++#define p_reg_mccid_fft0_state 0xF16C ++#define reg_mccid_fft0_state_pos 0 ++#define reg_mccid_fft0_state_len 1 ++#define reg_mccid_fft0_state_lsb 0 ++#define xd_p_reg_mccid_fft1_state (*(volatile byte xdata *) 0xF16D) ++#define p_reg_mccid_fft1_state 0xF16D ++#define reg_mccid_fft1_state_pos 0 ++#define reg_mccid_fft1_state_len 1 ++#define reg_mccid_fft1_state_lsb 0 ++#define xd_p_reg_mccid_fft0_maskmintoneindex_7_0 (*(volatile byte xdata *) 0xF16E) ++#define p_reg_mccid_fft0_maskmintoneindex_7_0 0xF16E ++#define reg_mccid_fft0_maskmintoneindex_7_0_pos 0 ++#define reg_mccid_fft0_maskmintoneindex_7_0_len 8 ++#define reg_mccid_fft0_maskmintoneindex_7_0_lsb 0 ++#define xd_p_reg_mccid_fft0_maskmintoneindex_12_8 (*(volatile byte xdata *) 0xF16F) ++#define p_reg_mccid_fft0_maskmintoneindex_12_8 0xF16F ++#define reg_mccid_fft0_maskmintoneindex_12_8_pos 0 ++#define reg_mccid_fft0_maskmintoneindex_12_8_len 5 ++#define reg_mccid_fft0_maskmintoneindex_12_8_lsb 8 ++#define xd_p_reg_mccid_acipowerlevelfactor (*(volatile byte xdata *) 0xF170) ++#define p_reg_mccid_acipowerlevelfactor 0xF170 ++#define reg_mccid_acipowerlevelfactor_pos 0 ++#define reg_mccid_acipowerlevelfactor_len 3 ++#define reg_mccid_acipowerlevelfactor_lsb 0 ++#define xd_p_reg_mccid_fft1_maskmaxtoneindex_7_0 (*(volatile byte xdata *) 0xF171) ++#define p_reg_mccid_fft1_maskmaxtoneindex_7_0 0xF171 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_pos 0 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_len 8 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_lsb 0 ++#define xd_p_reg_mccid_fft1_maskmaxtoneindex_12_8 (*(volatile byte xdata *) 0xF172) ++#define p_reg_mccid_fft1_maskmaxtoneindex_12_8 0xF172 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_pos 0 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_len 5 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_lsb 8 ++#define xd_p_reg_mccid_fft1_maskmintoneindex_7_0 (*(volatile byte xdata *) 0xF173) ++#define p_reg_mccid_fft1_maskmintoneindex_7_0 0xF173 ++#define reg_mccid_fft1_maskmintoneindex_7_0_pos 0 ++#define reg_mccid_fft1_maskmintoneindex_7_0_len 8 ++#define reg_mccid_fft1_maskmintoneindex_7_0_lsb 0 ++#define xd_p_reg_mccid_fft1_maskmintoneindex_12_8 (*(volatile byte xdata *) 0xF174) ++#define p_reg_mccid_fft1_maskmintoneindex_12_8 0xF174 ++#define reg_mccid_fft1_maskmintoneindex_12_8_pos 0 ++#define reg_mccid_fft1_maskmintoneindex_12_8_len 5 ++#define reg_mccid_fft1_maskmintoneindex_12_8_lsb 8 ++#define xd_p_reg_mccid_reset (*(volatile byte xdata *) 0xF175) ++#define p_reg_mccid_reset 0xF175 ++#define reg_mccid_reset_pos 0 ++#define reg_mccid_reset_len 1 ++#define reg_mccid_reset_lsb 0 ++#define xd_p_reg_mccid_gaincmpreset (*(volatile byte xdata *) 0xF176) ++#define p_reg_mccid_gaincmpreset 0xF176 ++#define reg_mccid_gaincmpreset_pos 0 ++#define reg_mccid_gaincmpreset_len 1 ++#define reg_mccid_gaincmpreset_lsb 0 ++#define xd_p_reg_mccid_acwgreset (*(volatile byte xdata *) 0xF177) ++#define p_reg_mccid_acwgreset 0xF177 ++#define reg_mccid_acwgreset_pos 0 ++#define reg_mccid_acwgreset_len 1 ++#define reg_mccid_acwgreset_lsb 0 ++#define xd_p_reg_mccid_ccif0_ofsmstateenable (*(volatile byte xdata *) 0xF178) ++#define p_reg_mccid_ccif0_ofsmstateenable 0xF178 ++#define reg_mccid_ccif0_ofsmstateenable_pos 0 ++#define reg_mccid_ccif0_ofsmstateenable_len 1 ++#define reg_mccid_ccif0_ofsmstateenable_lsb 0 ++#define xd_p_reg_mccid_ccif1_ofsmstateenable (*(volatile byte xdata *) 0xF179) ++#define p_reg_mccid_ccif1_ofsmstateenable 0xF179 ++#define reg_mccid_ccif1_ofsmstateenable_pos 0 ++#define reg_mccid_ccif1_ofsmstateenable_len 1 ++#define reg_mccid_ccif1_ofsmstateenable_lsb 0 ++#define xd_p_reg_mccid_fft0_ofsmstateenable (*(volatile byte xdata *) 0xF17A) ++#define p_reg_mccid_fft0_ofsmstateenable 0xF17A ++#define reg_mccid_fft0_ofsmstateenable_pos 0 ++#define reg_mccid_fft0_ofsmstateenable_len 1 ++#define reg_mccid_fft0_ofsmstateenable_lsb 0 ++#define xd_p_reg_mccid_fft1_ofsmstateenable (*(volatile byte xdata *) 0xF17B) ++#define p_reg_mccid_fft1_ofsmstateenable 0xF17B ++#define reg_mccid_fft1_ofsmstateenable_pos 0 ++#define reg_mccid_fft1_ofsmstateenable_len 1 ++#define reg_mccid_fft1_ofsmstateenable_lsb 0 ++#define xd_p_reg_mccid_fftfiltermaskchange (*(volatile byte xdata *) 0xF17C) ++#define p_reg_mccid_fftfiltermaskchange 0xF17C ++#define reg_mccid_fftfiltermaskchange_pos 0 ++#define reg_mccid_fftfiltermaskchange_len 1 ++#define reg_mccid_fftfiltermaskchange_lsb 0 ++#define xd_r_reg_mccid_maxacipowertone_7_0 (*(volatile byte xdata *) 0xF17D) ++#define r_reg_mccid_maxacipowertone_7_0 0xF17D ++#define reg_mccid_maxacipowertone_7_0_pos 0 ++#define reg_mccid_maxacipowertone_7_0_len 8 ++#define reg_mccid_maxacipowertone_7_0_lsb 0 ++#define xd_r_reg_mccid_maxacipowertone_12_8 (*(volatile byte xdata *) 0xF17E) ++#define r_reg_mccid_maxacipowertone_12_8 0xF17E ++#define reg_mccid_maxacipowertone_12_8_pos 0 ++#define reg_mccid_maxacipowertone_12_8_len 5 ++#define reg_mccid_maxacipowertone_12_8_lsb 8 ++#define xd_r_reg_mccid_ccidisappear (*(volatile byte xdata *) 0xF17F) ++#define r_reg_mccid_ccidisappear 0xF17F ++#define reg_mccid_ccidisappear_pos 0 ++#define reg_mccid_ccidisappear_len 1 ++#define reg_mccid_ccidisappear_lsb 0 ++#define xd_r_reg_mccid_ccilocatordone (*(volatile byte xdata *) 0xF182) ++#define r_reg_mccid_ccilocatordone 0xF182 ++#define reg_mccid_ccilocatordone_pos 0 ++#define reg_mccid_ccilocatordone_len 1 ++#define reg_mccid_ccilocatordone_lsb 0 ++#define xd_p_reg_mccid_enablecciftrigger (*(volatile byte xdata *) 0xF183) ++#define p_reg_mccid_enablecciftrigger 0xF183 ++#define reg_mccid_enablecciftrigger_pos 0 ++#define reg_mccid_enablecciftrigger_len 1 ++#define reg_mccid_enablecciftrigger_lsb 0 ++#define xd_p_reg_mccid_disableacwglaunchevaluationbandwidthtrigger (*(volatile byte xdata *) 0xF184) ++#define p_reg_mccid_disableacwglaunchevaluationbandwidthtrigger 0xF184 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_pos 0 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_len 1 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_lsb 0 ++#define xd_p_reg_mccid_control_by_ofsm (*(volatile byte xdata *) 0xF185) ++#define p_reg_mccid_control_by_ofsm 0xF185 ++#define reg_mccid_control_by_ofsm_pos 0 ++#define reg_mccid_control_by_ofsm_len 1 ++#define reg_mccid_control_by_ofsm_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolccilocator (*(volatile byte xdata *) 0xF186) ++#define p_reg_mccid_ofsmcontrolccilocator 0xF186 ++#define reg_mccid_ofsmcontrolccilocator_pos 0 ++#define reg_mccid_ofsmcontrolccilocator_len 1 ++#define reg_mccid_ofsmcontrolccilocator_lsb 0 ++#define xd_p_reg_mccid_disablepotentialccitriggerccilocator (*(volatile byte xdata *) 0xF187) ++#define p_reg_mccid_disablepotentialccitriggerccilocator 0xF187 ++#define reg_mccid_disablepotentialccitriggerccilocator_pos 0 ++#define reg_mccid_disablepotentialccitriggerccilocator_len 1 ++#define reg_mccid_disablepotentialccitriggerccilocator_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolccitesting (*(volatile byte xdata *) 0xF188) ++#define p_reg_mccid_ofsmcontrolccitesting 0xF188 ++#define reg_mccid_ofsmcontrolccitesting_pos 0 ++#define reg_mccid_ofsmcontrolccitesting_len 1 ++#define reg_mccid_ofsmcontrolccitesting_lsb 0 ++#define xd_p_reg_mccid_disableccitestingtriggercheckcci (*(volatile byte xdata *) 0xF189) ++#define p_reg_mccid_disableccitestingtriggercheckcci 0xF189 ++#define reg_mccid_disableccitestingtriggercheckcci_pos 0 ++#define reg_mccid_disableccitestingtriggercheckcci_len 1 ++#define reg_mccid_disableccitestingtriggercheckcci_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolacwgsetccifscstrobe (*(volatile byte xdata *) 0xF18A) ++#define p_reg_mccid_ofsmcontrolacwgsetccifscstrobe 0xF18A ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_pos 0 ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_len 1 ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_lsb 0 ++#define xd_p_reg_mccid_disableacwgevaluatingbandwidthtrigger (*(volatile byte xdata *) 0xF18B) ++#define p_reg_mccid_disableacwgevaluatingbandwidthtrigger 0xF18B ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_pos 0 ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_len 1 ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolevaluatingbandwidth (*(volatile byte xdata *) 0xF18C) ++#define p_reg_mccid_ofsmcontrolevaluatingbandwidth 0xF18C ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_pos 0 ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_len 1 ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolscanningaci (*(volatile byte xdata *) 0xF18D) ++#define p_reg_mccid_ofsmcontrolscanningaci 0xF18D ++#define reg_mccid_ofsmcontrolscanningaci_pos 0 ++#define reg_mccid_ofsmcontrolscanningaci_len 1 ++#define reg_mccid_ofsmcontrolscanningaci_lsb 0 ++#define xd_p_reg_mccid_disablescanningaci (*(volatile byte xdata *) 0xF18E) ++#define p_reg_mccid_disablescanningaci 0xF18E ++#define reg_mccid_disablescanningaci_pos 0 ++#define reg_mccid_disablescanningaci_len 1 ++#define reg_mccid_disablescanningaci_lsb 0 ++#define xd_p_reg_mccid_disableacwgccidetecting (*(volatile byte xdata *) 0xF18F) ++#define p_reg_mccid_disableacwgccidetecting 0xF18F ++#define reg_mccid_disableacwgccidetecting_pos 0 ++#define reg_mccid_disableacwgccidetecting_len 1 ++#define reg_mccid_disableacwgccidetecting_lsb 0 ++#define xd_p_reg_mccid_ofsmcontrolccitimertrigger (*(volatile byte xdata *) 0xF190) ++#define p_reg_mccid_ofsmcontrolccitimertrigger 0xF190 ++#define reg_mccid_ofsmcontrolccitimertrigger_pos 0 ++#define reg_mccid_ofsmcontrolccitimertrigger_len 1 ++#define reg_mccid_ofsmcontrolccitimertrigger_lsb 0 ++#define xd_p_reg_mccid_disableccitimertrigger (*(volatile byte xdata *) 0xF191) ++#define p_reg_mccid_disableccitimertrigger 0xF191 ++#define reg_mccid_disableccitimertrigger_pos 0 ++#define reg_mccid_disableccitimertrigger_len 1 ++#define reg_mccid_disableccitimertrigger_lsb 0 ++#define xd_p_reg_mccid_ofsmdisableccitriggercounting (*(volatile byte xdata *) 0xF192) ++#define p_reg_mccid_ofsmdisableccitriggercounting 0xF192 ++#define reg_mccid_ofsmdisableccitriggercounting_pos 0 ++#define reg_mccid_ofsmdisableccitriggercounting_len 1 ++#define reg_mccid_ofsmdisableccitriggercounting_lsb 0 ++#define xd_p_reg_mccid_enableccifilteraci (*(volatile byte xdata *) 0xF193) ++#define p_reg_mccid_enableccifilteraci 0xF193 ++#define reg_mccid_enableccifilteraci_pos 0 ++#define reg_mccid_enableccifilteraci_len 1 ++#define reg_mccid_enableccifilteraci_lsb 0 ++#define xd_p_reg_mccid_scannedfcwbfs_7_0 (*(volatile byte xdata *) 0xF194) ++#define p_reg_mccid_scannedfcwbfs_7_0 0xF194 ++#define reg_mccid_scannedfcwbfs_7_0_pos 0 ++#define reg_mccid_scannedfcwbfs_7_0_len 8 ++#define reg_mccid_scannedfcwbfs_7_0_lsb 0 ++#define xd_p_reg_mccid_scannedfcwbfs_13_8 (*(volatile byte xdata *) 0xF195) ++#define p_reg_mccid_scannedfcwbfs_13_8 0xF195 ++#define reg_mccid_scannedfcwbfs_13_8_pos 0 ++#define reg_mccid_scannedfcwbfs_13_8_len 6 ++#define reg_mccid_scannedfcwbfs_13_8_lsb 8 ++#define xd_p_reg_mccid_acwgevaluatingbandwidth (*(volatile byte xdata *) 0xF196) ++#define p_reg_mccid_acwgevaluatingbandwidth 0xF196 ++#define reg_mccid_acwgevaluatingbandwidth_pos 0 ++#define reg_mccid_acwgevaluatingbandwidth_len 1 ++#define reg_mccid_acwgevaluatingbandwidth_lsb 0 ++#define xd_p_reg_mccid_acwglaunchevaluationbandwidth (*(volatile byte xdata *) 0xF197) ++#define p_reg_mccid_acwglaunchevaluationbandwidth 0xF197 ++#define reg_mccid_acwglaunchevaluationbandwidth_pos 0 ++#define reg_mccid_acwglaunchevaluationbandwidth_len 1 ++#define reg_mccid_acwglaunchevaluationbandwidth_lsb 0 ++#define xd_p_reg_mccid_scannedcandidate (*(volatile byte xdata *) 0xF198) ++#define p_reg_mccid_scannedcandidate 0xF198 ++#define reg_mccid_scannedcandidate_pos 0 ++#define reg_mccid_scannedcandidate_len 3 ++#define reg_mccid_scannedcandidate_lsb 0 ++#define xd_p_reg_mccid_scstrobesearchingcandidate (*(volatile byte xdata *) 0xF199) ++#define p_reg_mccid_scstrobesearchingcandidate 0xF199 ++#define reg_mccid_scstrobesearchingcandidate_pos 0 ++#define reg_mccid_scstrobesearchingcandidate_len 2 ++#define reg_mccid_scstrobesearchingcandidate_lsb 0 ++#define xd_p_reg_mccid_potentialcci (*(volatile byte xdata *) 0xF19A) ++#define p_reg_mccid_potentialcci 0xF19A ++#define reg_mccid_potentialcci_pos 0 ++#define reg_mccid_potentialcci_len 1 ++#define reg_mccid_potentialcci_lsb 0 ++#define xd_p_reg_mccid_cciftimertrigger (*(volatile byte xdata *) 0xF19B) ++#define p_reg_mccid_cciftimertrigger 0xF19B ++#define reg_mccid_cciftimertrigger_pos 0 ++#define reg_mccid_cciftimertrigger_len 1 ++#define reg_mccid_cciftimertrigger_lsb 0 ++#define xd_p_reg_mccid_ccitesting (*(volatile byte xdata *) 0xF19C) ++#define p_reg_mccid_ccitesting 0xF19C ++#define reg_mccid_ccitesting_pos 0 ++#define reg_mccid_ccitesting_len 1 ++#define reg_mccid_ccitesting_lsb 0 ++#define xd_p_reg_mccid_defaultccilocatormissno (*(volatile byte xdata *) 0xF19D) ++#define p_reg_mccid_defaultccilocatormissno 0xF19D ++#define reg_mccid_defaultccilocatormissno_pos 0 ++#define reg_mccid_defaultccilocatormissno_len 8 ++#define reg_mccid_defaultccilocatormissno_lsb 0 ++#define xd_p_reg_mccid_dagc1_use_despow (*(volatile byte xdata *) 0xF19E) ++#define p_reg_mccid_dagc1_use_despow 0xF19E ++#define reg_mccid_dagc1_use_despow_pos 0 ++#define reg_mccid_dagc1_use_despow_len 1 ++#define reg_mccid_dagc1_use_despow_lsb 0 ++#define xd_p_reg_mccid_scannedacifrequencybegin_7_0 (*(volatile byte xdata *) 0xF19F) ++#define p_reg_mccid_scannedacifrequencybegin_7_0 0xF19F ++#define reg_mccid_scannedacifrequencybegin_7_0_pos 0 ++#define reg_mccid_scannedacifrequencybegin_7_0_len 8 ++#define reg_mccid_scannedacifrequencybegin_7_0_lsb 0 ++#define xd_p_reg_mccid_scannedacifrequencybegin_13_8 (*(volatile byte xdata *) 0xF1A0) ++#define p_reg_mccid_scannedacifrequencybegin_13_8 0xF1A0 ++#define reg_mccid_scannedacifrequencybegin_13_8_pos 0 ++#define reg_mccid_scannedacifrequencybegin_13_8_len 6 ++#define reg_mccid_scannedacifrequencybegin_13_8_lsb 8 ++#define xd_p_reg_mccid_scannedacifrequencyend_7_0 (*(volatile byte xdata *) 0xF1A1) ++#define p_reg_mccid_scannedacifrequencyend_7_0 0xF1A1 ++#define reg_mccid_scannedacifrequencyend_7_0_pos 0 ++#define reg_mccid_scannedacifrequencyend_7_0_len 8 ++#define reg_mccid_scannedacifrequencyend_7_0_lsb 0 ++#define xd_p_reg_mccid_scannedacifrequencyend_13_8 (*(volatile byte xdata *) 0xF1A2) ++#define p_reg_mccid_scannedacifrequencyend_13_8 0xF1A2 ++#define reg_mccid_scannedacifrequencyend_13_8_pos 0 ++#define reg_mccid_scannedacifrequencyend_13_8_len 6 ++#define reg_mccid_scannedacifrequencyend_13_8_lsb 8 ++#define xd_p_reg_bfs_fcw_7_0 (*(volatile byte xdata *) 0xF1A3) ++#define p_reg_bfs_fcw_7_0 0xF1A3 ++#define reg_bfs_fcw_7_0_pos 0 ++#define reg_bfs_fcw_7_0_len 8 ++#define reg_bfs_fcw_7_0_lsb 0 ++#define xd_p_reg_bfs_fcw_15_8 (*(volatile byte xdata *) 0xF1A4) ++#define p_reg_bfs_fcw_15_8 0xF1A4 ++#define reg_bfs_fcw_15_8_pos 0 ++#define reg_bfs_fcw_15_8_len 8 ++#define reg_bfs_fcw_15_8_lsb 8 ++#define xd_p_reg_bfs_fcw_22_16 (*(volatile byte xdata *) 0xF1A5) ++#define p_reg_bfs_fcw_22_16 0xF1A5 ++#define reg_bfs_fcw_22_16_pos 0 ++#define reg_bfs_fcw_22_16_len 7 ++#define reg_bfs_fcw_22_16_lsb 16 ++#define xd_p_reg_cfoe_fcw_inv (*(volatile byte xdata *) 0xF1A6) ++#define p_reg_cfoe_fcw_inv 0xF1A6 ++#define reg_cfoe_fcw_inv_pos 0 ++#define reg_cfoe_fcw_inv_len 1 ++#define reg_cfoe_fcw_inv_lsb 0 ++#define xd_p_reg_bfs_0if (*(volatile byte xdata *) 0xF1A7) ++#define p_reg_bfs_0if 0xF1A7 ++#define reg_bfs_0if_pos 0 ++#define reg_bfs_0if_len 1 ++#define reg_bfs_0if_lsb 0 ++#define xd_p_reg_sadc_clk (*(volatile byte xdata *) 0xF1A9) ++#define p_reg_sadc_clk 0xF1A9 ++#define reg_sadc_clk_pos 0 ++#define reg_sadc_clk_len 1 ++#define reg_sadc_clk_lsb 0 ++#define xd_p_reg_sadc_tx (*(volatile byte xdata *) 0xF1AA) ++#define p_reg_sadc_tx 0xF1AA ++#define reg_sadc_tx_pos 0 ++#define reg_sadc_tx_len 1 ++#define reg_sadc_tx_lsb 0 ++#define xd_p_reg_sadc_rx (*(volatile byte xdata *) 0xF1AB) ++#define p_reg_sadc_rx 0xF1AB ++#define reg_sadc_rx_pos 0 ++#define reg_sadc_rx_len 1 ++#define reg_sadc_rx_lsb 0 ++#define xd_p_reg_sadc_cs (*(volatile byte xdata *) 0xF1AC) ++#define p_reg_sadc_cs 0xF1AC ++#define reg_sadc_cs_pos 0 ++#define reg_sadc_cs_len 1 ++#define reg_sadc_cs_lsb 0 ++#define xd_p_reg_fix_fcw_7_0 (*(volatile byte xdata *) 0xF1AD) ++#define p_reg_fix_fcw_7_0 0xF1AD ++#define reg_fix_fcw_7_0_pos 0 ++#define reg_fix_fcw_7_0_len 8 ++#define reg_fix_fcw_7_0_lsb 0 ++#define xd_p_reg_fix_fcw_15_8 (*(volatile byte xdata *) 0xF1AE) ++#define p_reg_fix_fcw_15_8 0xF1AE ++#define reg_fix_fcw_15_8_pos 0 ++#define reg_fix_fcw_15_8_len 8 ++#define reg_fix_fcw_15_8_lsb 8 ++#define xd_p_reg_fix_fcw_22_16 (*(volatile byte xdata *) 0xF1AF) ++#define p_reg_fix_fcw_22_16 0xF1AF ++#define reg_fix_fcw_22_16_pos 0 ++#define reg_fix_fcw_22_16_len 7 ++#define reg_fix_fcw_22_16_lsb 16 ++#define xd_r_reg_bfs_fcw_offset_7_0 (*(volatile byte xdata *) 0xF1B0) ++#define r_reg_bfs_fcw_offset_7_0 0xF1B0 ++#define reg_bfs_fcw_offset_7_0_pos 0 ++#define reg_bfs_fcw_offset_7_0_len 8 ++#define reg_bfs_fcw_offset_7_0_lsb 0 ++#define xd_r_reg_bfs_fcw_offset_15_8 (*(volatile byte xdata *) 0xF1B1) ++#define r_reg_bfs_fcw_offset_15_8 0xF1B1 ++#define reg_bfs_fcw_offset_15_8_pos 0 ++#define reg_bfs_fcw_offset_15_8_len 8 ++#define reg_bfs_fcw_offset_15_8_lsb 8 ++#define xd_r_reg_bfs_fcw_offset_22_16 (*(volatile byte xdata *) 0xF1B2) ++#define r_reg_bfs_fcw_offset_22_16 0xF1B2 ++#define reg_bfs_fcw_offset_22_16_pos 0 ++#define reg_bfs_fcw_offset_22_16_len 7 ++#define reg_bfs_fcw_offset_22_16_lsb 16 ++#define xd_r_bfs_fcw_q_7_0 (*(volatile byte xdata *) 0xF1B3) ++#define r_bfs_fcw_q_7_0 0xF1B3 ++#define bfs_fcw_q_7_0_pos 0 ++#define bfs_fcw_q_7_0_len 8 ++#define bfs_fcw_q_7_0_lsb 0 ++#define xd_r_bfs_fcw_q_15_8 (*(volatile byte xdata *) 0xF1B4) ++#define r_bfs_fcw_q_15_8 0xF1B4 ++#define bfs_fcw_q_15_8_pos 0 ++#define bfs_fcw_q_15_8_len 8 ++#define bfs_fcw_q_15_8_lsb 8 ++#define xd_r_bfs_fcw_q_22_16 (*(volatile byte xdata *) 0xF1B5) ++#define r_bfs_fcw_q_22_16 0xF1B5 ++#define bfs_fcw_q_22_16_pos 0 ++#define bfs_fcw_q_22_16_len 7 ++#define bfs_fcw_q_22_16_lsb 16 ++#define xd_p_reg_dagc3_use_despow (*(volatile byte xdata *) 0xF1B6) ++#define p_reg_dagc3_use_despow 0xF1B6 ++#define reg_dagc3_use_despow_pos 0 ++#define reg_dagc3_use_despow_len 1 ++#define reg_dagc3_use_despow_lsb 0 ++#define xd_p_reg_dagc3_log_2_accumulate (*(volatile byte xdata *) 0xF1B7) ++#define p_reg_dagc3_log_2_accumulate 0xF1B7 ++#define reg_dagc3_log_2_accumulate_pos 0 ++#define reg_dagc3_log_2_accumulate_len 5 ++#define reg_dagc3_log_2_accumulate_lsb 0 ++#define xd_p_reg_dagc3_desired_level_7_0 (*(volatile byte xdata *) 0xF1BC) ++#define p_reg_dagc3_desired_level_7_0 0xF1BC ++#define reg_dagc3_desired_level_7_0_pos 0 ++#define reg_dagc3_desired_level_7_0_len 8 ++#define reg_dagc3_desired_level_7_0_lsb 0 ++#define xd_p_reg_dagc3_desired_level_8 (*(volatile byte xdata *) 0xF1BD) ++#define p_reg_dagc3_desired_level_8 0xF1BD ++#define reg_dagc3_desired_level_8_pos 0 ++#define reg_dagc3_desired_level_8_len 1 ++#define reg_dagc3_desired_level_8_lsb 8 ++#define xd_p_reg_dagc3_apply_delay (*(volatile byte xdata *) 0xF1BE) ++#define p_reg_dagc3_apply_delay 0xF1BE ++#define reg_dagc3_apply_delay_pos 0 ++#define reg_dagc3_apply_delay_len 7 ++#define reg_dagc3_apply_delay_lsb 0 ++#define xd_p_reg_dagc3_bp_scale (*(volatile byte xdata *) 0xF1BF) ++#define p_reg_dagc3_bp_scale 0xF1BF ++#define reg_dagc3_bp_scale_pos 0 ++#define reg_dagc3_bp_scale_len 3 ++#define reg_dagc3_bp_scale_lsb 0 ++#define xd_p_reg_dagc3_in_sat_cnt_7_0 (*(volatile byte xdata *) 0xF1C0) ++#define p_reg_dagc3_in_sat_cnt_7_0 0xF1C0 ++#define reg_dagc3_in_sat_cnt_7_0_pos 0 ++#define reg_dagc3_in_sat_cnt_7_0_len 8 ++#define reg_dagc3_in_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_dagc3_in_sat_cnt_15_8 (*(volatile byte xdata *) 0xF1C1) ++#define p_reg_dagc3_in_sat_cnt_15_8 0xF1C1 ++#define reg_dagc3_in_sat_cnt_15_8_pos 0 ++#define reg_dagc3_in_sat_cnt_15_8_len 8 ++#define reg_dagc3_in_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_dagc3_in_sat_cnt_23_16 (*(volatile byte xdata *) 0xF1C2) ++#define p_reg_dagc3_in_sat_cnt_23_16 0xF1C2 ++#define reg_dagc3_in_sat_cnt_23_16_pos 0 ++#define reg_dagc3_in_sat_cnt_23_16_len 8 ++#define reg_dagc3_in_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_dagc3_in_sat_cnt_31_24 (*(volatile byte xdata *) 0xF1C3) ++#define p_reg_dagc3_in_sat_cnt_31_24 0xF1C3 ++#define reg_dagc3_in_sat_cnt_31_24_pos 0 ++#define reg_dagc3_in_sat_cnt_31_24_len 8 ++#define reg_dagc3_in_sat_cnt_31_24_lsb 24 ++#define xd_p_reg_dagc3_out_sat_cnt_7_0 (*(volatile byte xdata *) 0xF1C4) ++#define p_reg_dagc3_out_sat_cnt_7_0 0xF1C4 ++#define reg_dagc3_out_sat_cnt_7_0_pos 0 ++#define reg_dagc3_out_sat_cnt_7_0_len 8 ++#define reg_dagc3_out_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_dagc3_out_sat_cnt_15_8 (*(volatile byte xdata *) 0xF1C5) ++#define p_reg_dagc3_out_sat_cnt_15_8 0xF1C5 ++#define reg_dagc3_out_sat_cnt_15_8_pos 0 ++#define reg_dagc3_out_sat_cnt_15_8_len 8 ++#define reg_dagc3_out_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_dagc3_out_sat_cnt_23_16 (*(volatile byte xdata *) 0xF1C6) ++#define p_reg_dagc3_out_sat_cnt_23_16 0xF1C6 ++#define reg_dagc3_out_sat_cnt_23_16_pos 0 ++#define reg_dagc3_out_sat_cnt_23_16_len 8 ++#define reg_dagc3_out_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_dagc3_out_sat_cnt_31_24 (*(volatile byte xdata *) 0xF1C7) ++#define p_reg_dagc3_out_sat_cnt_31_24 0xF1C7 ++#define reg_dagc3_out_sat_cnt_31_24_pos 0 ++#define reg_dagc3_out_sat_cnt_31_24_len 8 ++#define reg_dagc3_out_sat_cnt_31_24_lsb 24 ++#define xd_r_bfs_dagc3_multiplier_7_0 (*(volatile byte xdata *) 0xF1C8) ++#define r_bfs_dagc3_multiplier_7_0 0xF1C8 ++#define bfs_dagc3_multiplier_7_0_pos 0 ++#define bfs_dagc3_multiplier_7_0_len 8 ++#define bfs_dagc3_multiplier_7_0_lsb 0 ++#define xd_r_bfs_dagc3_multiplier_15_8 (*(volatile byte xdata *) 0xF1C9) ++#define r_bfs_dagc3_multiplier_15_8 0xF1C9 ++#define bfs_dagc3_multiplier_15_8_pos 0 ++#define bfs_dagc3_multiplier_15_8_len 8 ++#define bfs_dagc3_multiplier_15_8_lsb 8 ++#define xd_r_bfs_dagc3_right_shift_bits (*(volatile byte xdata *) 0xF1CA) ++#define r_bfs_dagc3_right_shift_bits 0xF1CA ++#define bfs_dagc3_right_shift_bits_pos 0 ++#define bfs_dagc3_right_shift_bits_len 4 ++#define bfs_dagc3_right_shift_bits_lsb 0 ++#define xd_p_reg_dagc3_fixed_gain_7_0 (*(volatile byte xdata *) 0xF1CB) ++#define p_reg_dagc3_fixed_gain_7_0 0xF1CB ++#define reg_dagc3_fixed_gain_7_0_pos 0 ++#define reg_dagc3_fixed_gain_7_0_len 8 ++#define reg_dagc3_fixed_gain_7_0_lsb 0 ++#define xd_p_reg_dagc3_fixed_gain_11_8 (*(volatile byte xdata *) 0xF1CC) ++#define p_reg_dagc3_fixed_gain_11_8 0xF1CC ++#define reg_dagc3_fixed_gain_11_8_pos 0 ++#define reg_dagc3_fixed_gain_11_8_len 4 ++#define reg_dagc3_fixed_gain_11_8_lsb 8 ++#define xd_p_reg_f_adc_7_0 (*(volatile byte xdata *) 0xF1CD) ++#define p_reg_f_adc_7_0 0xF1CD ++#define reg_f_adc_7_0_pos 0 ++#define reg_f_adc_7_0_len 8 ++#define reg_f_adc_7_0_lsb 0 ++#define xd_p_reg_f_adc_15_8 (*(volatile byte xdata *) 0xF1CE) ++#define p_reg_f_adc_15_8 0xF1CE ++#define reg_f_adc_15_8_pos 0 ++#define reg_f_adc_15_8_len 8 ++#define reg_f_adc_15_8_lsb 8 ++#define xd_p_reg_f_adc_23_16 (*(volatile byte xdata *) 0xF1CF) ++#define p_reg_f_adc_23_16 0xF1CF ++#define reg_f_adc_23_16_pos 0 ++#define reg_f_adc_23_16_len 8 ++#define reg_f_adc_23_16_lsb 16 ++#define xd_p_reg_fste_frac_step_size_7_0 (*(volatile byte xdata *) 0xF1D0) ++#define p_reg_fste_frac_step_size_7_0 0xF1D0 ++#define reg_fste_frac_step_size_7_0_pos 0 ++#define reg_fste_frac_step_size_7_0_len 8 ++#define reg_fste_frac_step_size_7_0_lsb 0 ++#define xd_p_reg_fste_frac_step_size_15_8 (*(volatile byte xdata *) 0xF1D1) ++#define p_reg_fste_frac_step_size_15_8 0xF1D1 ++#define reg_fste_frac_step_size_15_8_pos 0 ++#define reg_fste_frac_step_size_15_8_len 8 ++#define reg_fste_frac_step_size_15_8_lsb 8 ++#define xd_p_reg_fste_frac_step_size_19_16 (*(volatile byte xdata *) 0xF1D2) ++#define p_reg_fste_frac_step_size_19_16 0xF1D2 ++#define reg_fste_frac_step_size_19_16_pos 0 ++#define reg_fste_frac_step_size_19_16_len 4 ++#define reg_fste_frac_step_size_19_16_lsb 16 ++#define xd_r_intp_mu_7_0 (*(volatile byte xdata *) 0xF1D3) ++#define r_intp_mu_7_0 0xF1D3 ++#define intp_mu_7_0_pos 0 ++#define intp_mu_7_0_len 8 ++#define intp_mu_7_0_lsb 0 ++#define xd_r_intp_mu_15_8 (*(volatile byte xdata *) 0xF1D4) ++#define r_intp_mu_15_8 0xF1D4 ++#define intp_mu_15_8_pos 0 ++#define intp_mu_15_8_len 8 ++#define intp_mu_15_8_lsb 8 ++#define xd_r_intp_mu_23_16 (*(volatile byte xdata *) 0xF1D5) ++#define r_intp_mu_23_16 0xF1D5 ++#define intp_mu_23_16_pos 0 ++#define intp_mu_23_16_len 8 ++#define intp_mu_23_16_lsb 16 ++#define xd_r_intp_mu_25_24 (*(volatile byte xdata *) 0xF1D6) ++#define r_intp_mu_25_24 0xF1D6 ++#define intp_mu_25_24_pos 0 ++#define intp_mu_25_24_len 2 ++#define intp_mu_25_24_lsb 24 ++#define xd_p_intp_muq_7_0 (*(volatile byte xdata *) 0xF1D7) ++#define p_intp_muq_7_0 0xF1D7 ++#define intp_muq_7_0_pos 0 ++#define intp_muq_7_0_len 8 ++#define intp_muq_7_0_lsb 0 ++#define xd_p_intp_muq_15_8 (*(volatile byte xdata *) 0xF1D8) ++#define p_intp_muq_15_8 0xF1D8 ++#define intp_muq_15_8_pos 0 ++#define intp_muq_15_8_len 8 ++#define intp_muq_15_8_lsb 8 ++#define xd_p_intp_muq_23_16 (*(volatile byte xdata *) 0xF1D9) ++#define p_intp_muq_23_16 0xF1D9 ++#define intp_muq_23_16_pos 0 ++#define intp_muq_23_16_len 8 ++#define intp_muq_23_16_lsb 16 ++#define xd_p_reg_sfoe_inv (*(volatile byte xdata *) 0xF1DA) ++#define p_reg_sfoe_inv 0xF1DA ++#define reg_sfoe_inv_pos 0 ++#define reg_sfoe_inv_len 1 ++#define reg_sfoe_inv_lsb 0 ++#define xd_p_intp_ext_en (*(volatile byte xdata *) 0xF1DB) ++#define p_intp_ext_en 0xF1DB ++#define intp_ext_en_pos 0 ++#define intp_ext_en_len 1 ++#define intp_ext_en_lsb 0 ++#define xd_r_intp_ext_done (*(volatile byte xdata *) 0xF1DC) ++#define r_intp_ext_done 0xF1DC ++#define intp_ext_done_pos 0 ++#define intp_ext_done_len 1 ++#define intp_ext_done_lsb 0 ++#define xd_p_intp_ext_in_7_0 (*(volatile byte xdata *) 0xF1DD) ++#define p_intp_ext_in_7_0 0xF1DD ++#define intp_ext_in_7_0_pos 0 ++#define intp_ext_in_7_0_len 8 ++#define intp_ext_in_7_0_lsb 0 ++#define xd_p_intp_ext_in_15_8 (*(volatile byte xdata *) 0xF1DE) ++#define p_intp_ext_in_15_8 0xF1DE ++#define intp_ext_in_15_8_pos 0 ++#define intp_ext_in_15_8_len 8 ++#define intp_ext_in_15_8_lsb 8 ++#define xd_p_intp_ext_in_23_16 (*(volatile byte xdata *) 0xF1DF) ++#define p_intp_ext_in_23_16 0xF1DF ++#define intp_ext_in_23_16_pos 0 ++#define intp_ext_in_23_16_len 8 ++#define intp_ext_in_23_16_lsb 16 ++#define xd_p_intp_ext_in_25_24 (*(volatile byte xdata *) 0xF1E0) ++#define p_intp_ext_in_25_24 0xF1E0 ++#define intp_ext_in_25_24_pos 0 ++#define intp_ext_in_25_24_len 2 ++#define intp_ext_in_25_24_lsb 24 ++#define xd_r_intp_ext_out_7_0 (*(volatile byte xdata *) 0xF1E1) ++#define r_intp_ext_out_7_0 0xF1E1 ++#define intp_ext_out_7_0_pos 0 ++#define intp_ext_out_7_0_len 8 ++#define intp_ext_out_7_0_lsb 0 ++#define xd_r_intp_ext_out_15_8 (*(volatile byte xdata *) 0xF1E2) ++#define r_intp_ext_out_15_8 0xF1E2 ++#define intp_ext_out_15_8_pos 0 ++#define intp_ext_out_15_8_len 8 ++#define intp_ext_out_15_8_lsb 8 ++#define xd_r_intp_ext_out_23_16 (*(volatile byte xdata *) 0xF1E3) ++#define r_intp_ext_out_23_16 0xF1E3 ++#define intp_ext_out_23_16_pos 0 ++#define intp_ext_out_23_16_len 8 ++#define intp_ext_out_23_16_lsb 16 ++#define xd_r_intp_ext_out_28_24 (*(volatile byte xdata *) 0xF1E4) ++#define r_intp_ext_out_28_24 0xF1E4 ++#define intp_ext_out_28_24_pos 0 ++#define intp_ext_out_28_24_len 5 ++#define intp_ext_out_28_24_lsb 24 ++#define xd_p_reg_agc_rst (*(volatile byte xdata *) 0xF1E5) ++#define p_reg_agc_rst 0xF1E5 ++#define reg_agc_rst_pos 0 ++#define reg_agc_rst_len 1 ++#define reg_agc_rst_lsb 0 ++#define xd_p_rf_agc_en (*(volatile byte xdata *) 0xF1E6) ++#define p_rf_agc_en 0xF1E6 ++#define rf_agc_en_pos 0 ++#define rf_agc_en_len 1 ++#define rf_agc_en_lsb 0 ++#define xd_p_agc_lock (*(volatile byte xdata *) 0xF1E7) ++#define p_agc_lock 0xF1E7 ++#define agc_lock_pos 0 ++#define agc_lock_len 1 ++#define agc_lock_lsb 0 ++#define xd_p_reg_tinr_rst (*(volatile byte xdata *) 0xF1E8) ++#define p_reg_tinr_rst 0xF1E8 ++#define reg_tinr_rst_pos 0 ++#define reg_tinr_rst_len 1 ++#define reg_tinr_rst_lsb 0 ++#define xd_p_reg_tinr_en (*(volatile byte xdata *) 0xF1E9) ++#define p_reg_tinr_en 0xF1E9 ++#define reg_tinr_en_pos 0 ++#define reg_tinr_en_len 1 ++#define reg_tinr_en_lsb 0 ++#define xd_p_reg_bfs_en (*(volatile byte xdata *) 0xF1EA) ++#define p_reg_bfs_en 0xF1EA ++#define reg_bfs_en_pos 0 ++#define reg_bfs_en_len 1 ++#define reg_bfs_en_lsb 0 ++#define xd_p_reg_bfs_rst (*(volatile byte xdata *) 0xF1EB) ++#define p_reg_bfs_rst 0xF1EB ++#define reg_bfs_rst_pos 0 ++#define reg_bfs_rst_len 1 ++#define reg_bfs_rst_lsb 0 ++#define xd_p_reg_bfs_byp (*(volatile byte xdata *) 0xF1EC) ++#define p_reg_bfs_byp 0xF1EC ++#define reg_bfs_byp_pos 0 ++#define reg_bfs_byp_len 1 ++#define reg_bfs_byp_lsb 0 ++#define xd_p_intp_en (*(volatile byte xdata *) 0xF1EF) ++#define p_intp_en 0xF1EF ++#define intp_en_pos 0 ++#define intp_en_len 1 ++#define intp_en_lsb 0 ++#define xd_p_intp_rst (*(volatile byte xdata *) 0xF1F0) ++#define p_intp_rst 0xF1F0 ++#define intp_rst_pos 0 ++#define intp_rst_len 1 ++#define intp_rst_lsb 0 ++#define xd_p_reg_p_acif_en (*(volatile byte xdata *) 0xF1F2) ++#define p_reg_p_acif_en 0xF1F2 ++#define reg_p_acif_en_pos 0 ++#define reg_p_acif_en_len 1 ++#define reg_p_acif_en_lsb 0 ++#define xd_p_reg_p_acif_rst (*(volatile byte xdata *) 0xF1F3) ++#define p_reg_p_acif_rst 0xF1F3 ++#define reg_p_acif_rst_pos 0 ++#define reg_p_acif_rst_len 1 ++#define reg_p_acif_rst_lsb 0 ++#define xd_p_reg_p_acif_byp (*(volatile byte xdata *) 0xF1F4) ++#define p_reg_p_acif_byp 0xF1F4 ++#define reg_p_acif_byp_pos 0 ++#define reg_p_acif_byp_len 1 ++#define reg_p_acif_byp_lsb 0 ++#define xd_p_dagc2_rst (*(volatile byte xdata *) 0xF1F6) ++#define p_dagc2_rst 0xF1F6 ++#define dagc2_rst_pos 0 ++#define dagc2_rst_len 1 ++#define dagc2_rst_lsb 0 ++#define xd_p_dagc2_en (*(volatile byte xdata *) 0xF1F7) ++#define p_dagc2_en 0xF1F7 ++#define dagc2_en_pos 0 ++#define dagc2_en_len 1 ++#define dagc2_en_lsb 0 ++#define xd_p_dagc2_mode (*(volatile byte xdata *) 0xF1F8) ++#define p_dagc2_mode 0xF1F8 ++#define dagc2_mode_pos 0 ++#define dagc2_mode_len 2 ++#define dagc2_mode_lsb 0 ++#define xd_p_dagc2_done (*(volatile byte xdata *) 0xF1F9) ++#define p_dagc2_done 0xF1F9 ++#define dagc2_done_pos 0 ++#define dagc2_done_len 1 ++#define dagc2_done_lsb 0 ++#define xd_p_dagc3_rst (*(volatile byte xdata *) 0xF1FA) ++#define p_dagc3_rst 0xF1FA ++#define dagc3_rst_pos 0 ++#define dagc3_rst_len 1 ++#define dagc3_rst_lsb 0 ++#define xd_p_dagc3_en (*(volatile byte xdata *) 0xF1FB) ++#define p_dagc3_en 0xF1FB ++#define dagc3_en_pos 0 ++#define dagc3_en_len 1 ++#define dagc3_en_lsb 0 ++#define xd_p_dagc3_mode (*(volatile byte xdata *) 0xF1FC) ++#define p_dagc3_mode 0xF1FC ++#define dagc3_mode_pos 0 ++#define dagc3_mode_len 2 ++#define dagc3_mode_lsb 0 ++#define xd_p_dagc3_done (*(volatile byte xdata *) 0xF1FD) ++#define p_dagc3_done 0xF1FD ++#define dagc3_done_pos 0 ++#define dagc3_done_len 1 ++#define dagc3_done_lsb 0 ++#define xd_p_reg_dagc2_desired_level_7_0 (*(volatile byte xdata *) 0xF202) ++#define p_reg_dagc2_desired_level_7_0 0xF202 ++#define reg_dagc2_desired_level_7_0_pos 0 ++#define reg_dagc2_desired_level_7_0_len 8 ++#define reg_dagc2_desired_level_7_0_lsb 0 ++#define xd_p_reg_dagc2_desired_level_8 (*(volatile byte xdata *) 0xF203) ++#define p_reg_dagc2_desired_level_8 0xF203 ++#define reg_dagc2_desired_level_8_pos 0 ++#define reg_dagc2_desired_level_8_len 1 ++#define reg_dagc2_desired_level_8_lsb 8 ++#define xd_p_reg_dagc2_apply_delay (*(volatile byte xdata *) 0xF204) ++#define p_reg_dagc2_apply_delay 0xF204 ++#define reg_dagc2_apply_delay_pos 0 ++#define reg_dagc2_apply_delay_len 7 ++#define reg_dagc2_apply_delay_lsb 0 ++#define xd_p_reg_dagc2_bypass_scale_ctl (*(volatile byte xdata *) 0xF205) ++#define p_reg_dagc2_bypass_scale_ctl 0xF205 ++#define reg_dagc2_bypass_scale_ctl_pos 0 ++#define reg_dagc2_bypass_scale_ctl_len 3 ++#define reg_dagc2_bypass_scale_ctl_lsb 0 ++#define xd_p_reg_dagc2_programmable_shift2 (*(volatile byte xdata *) 0xF206) ++#define p_reg_dagc2_programmable_shift2 0xF206 ++#define reg_dagc2_programmable_shift2_pos 0 ++#define reg_dagc2_programmable_shift2_len 8 ++#define reg_dagc2_programmable_shift2_lsb 0 ++#define xd_p_reg_dagc2_in_sat_cnt_7_0 (*(volatile byte xdata *) 0xF207) ++#define p_reg_dagc2_in_sat_cnt_7_0 0xF207 ++#define reg_dagc2_in_sat_cnt_7_0_pos 0 ++#define reg_dagc2_in_sat_cnt_7_0_len 8 ++#define reg_dagc2_in_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_dagc2_in_sat_cnt_15_8 (*(volatile byte xdata *) 0xF208) ++#define p_reg_dagc2_in_sat_cnt_15_8 0xF208 ++#define reg_dagc2_in_sat_cnt_15_8_pos 0 ++#define reg_dagc2_in_sat_cnt_15_8_len 8 ++#define reg_dagc2_in_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_dagc2_in_sat_cnt_23_16 (*(volatile byte xdata *) 0xF209) ++#define p_reg_dagc2_in_sat_cnt_23_16 0xF209 ++#define reg_dagc2_in_sat_cnt_23_16_pos 0 ++#define reg_dagc2_in_sat_cnt_23_16_len 8 ++#define reg_dagc2_in_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_dagc2_in_sat_cnt_31_24 (*(volatile byte xdata *) 0xF20A) ++#define p_reg_dagc2_in_sat_cnt_31_24 0xF20A ++#define reg_dagc2_in_sat_cnt_31_24_pos 0 ++#define reg_dagc2_in_sat_cnt_31_24_len 8 ++#define reg_dagc2_in_sat_cnt_31_24_lsb 24 ++#define xd_p_reg_dagc2_out_sat_cnt_7_0 (*(volatile byte xdata *) 0xF20B) ++#define p_reg_dagc2_out_sat_cnt_7_0 0xF20B ++#define reg_dagc2_out_sat_cnt_7_0_pos 0 ++#define reg_dagc2_out_sat_cnt_7_0_len 8 ++#define reg_dagc2_out_sat_cnt_7_0_lsb 0 ++#define xd_p_reg_dagc2_out_sat_cnt_15_8 (*(volatile byte xdata *) 0xF20C) ++#define p_reg_dagc2_out_sat_cnt_15_8 0xF20C ++#define reg_dagc2_out_sat_cnt_15_8_pos 0 ++#define reg_dagc2_out_sat_cnt_15_8_len 8 ++#define reg_dagc2_out_sat_cnt_15_8_lsb 8 ++#define xd_p_reg_dagc2_out_sat_cnt_23_16 (*(volatile byte xdata *) 0xF20D) ++#define p_reg_dagc2_out_sat_cnt_23_16 0xF20D ++#define reg_dagc2_out_sat_cnt_23_16_pos 0 ++#define reg_dagc2_out_sat_cnt_23_16_len 8 ++#define reg_dagc2_out_sat_cnt_23_16_lsb 16 ++#define xd_p_reg_dagc2_out_sat_cnt_31_24 (*(volatile byte xdata *) 0xF20E) ++#define p_reg_dagc2_out_sat_cnt_31_24 0xF20E ++#define reg_dagc2_out_sat_cnt_31_24_pos 0 ++#define reg_dagc2_out_sat_cnt_31_24_len 8 ++#define reg_dagc2_out_sat_cnt_31_24_lsb 24 ++#define xd_r_reg_dagc2_multiplier_7_0 (*(volatile byte xdata *) 0xF20F) ++#define r_reg_dagc2_multiplier_7_0 0xF20F ++#define reg_dagc2_multiplier_7_0_pos 0 ++#define reg_dagc2_multiplier_7_0_len 8 ++#define reg_dagc2_multiplier_7_0_lsb 0 ++#define xd_r_reg_dagc2_multiplier_15_8 (*(volatile byte xdata *) 0xF210) ++#define r_reg_dagc2_multiplier_15_8 0xF210 ++#define reg_dagc2_multiplier_15_8_pos 0 ++#define reg_dagc2_multiplier_15_8_len 8 ++#define reg_dagc2_multiplier_15_8_lsb 8 ++#define xd_r_reg_dagc2_right_shift_bits (*(volatile byte xdata *) 0xF211) ++#define r_reg_dagc2_right_shift_bits 0xF211 ++#define reg_dagc2_right_shift_bits_pos 0 ++#define reg_dagc2_right_shift_bits_len 4 ++#define reg_dagc2_right_shift_bits_lsb 0 ++#define xd_p_reg_dagc2_smbuf_err (*(volatile byte xdata *) 0xF212) ++#define p_reg_dagc2_smbuf_err 0xF212 ++#define reg_dagc2_smbuf_err_pos 0 ++#define reg_dagc2_smbuf_err_len 1 ++#define reg_dagc2_smbuf_err_lsb 0 ++#define xd_p_reg_dagc2_cplxconj (*(volatile byte xdata *) 0xF213) ++#define p_reg_dagc2_cplxconj 0xF213 ++#define reg_dagc2_cplxconj_pos 0 ++#define reg_dagc2_cplxconj_len 1 ++#define reg_dagc2_cplxconj_lsb 0 ++#define xd_p_reg_dagc2_use_despow (*(volatile byte xdata *) 0xF214) ++#define p_reg_dagc2_use_despow 0xF214 ++#define reg_dagc2_use_despow_pos 0 ++#define reg_dagc2_use_despow_len 1 ++#define reg_dagc2_use_despow_lsb 0 ++#define xd_p_reg_dagc2_log_2_accumulate (*(volatile byte xdata *) 0xF215) ++#define p_reg_dagc2_log_2_accumulate 0xF215 ++#define reg_dagc2_log_2_accumulate_pos 0 ++#define reg_dagc2_log_2_accumulate_len 5 ++#define reg_dagc2_log_2_accumulate_lsb 0 ++#define xd_r_dagc2_dca_gain (*(volatile byte xdata *) 0xF216) ++#define r_dagc2_dca_gain 0xF216 ++#define dagc2_dca_gain_pos 0 ++#define dagc2_dca_gain_len 8 ++#define dagc2_dca_gain_lsb 0 ++#define xd_p_reg_dca_gain_offset (*(volatile byte xdata *) 0xF217) ++#define p_reg_dca_gain_offset 0xF217 ++#define reg_dca_gain_offset_pos 0 ++#define reg_dca_gain_offset_len 8 ++#define reg_dca_gain_offset_lsb 0 ++#define xd_p_reg_dagc2_FG_mode (*(volatile byte xdata *) 0xF218) ++#define p_reg_dagc2_FG_mode 0xF218 ++#define reg_dagc2_FG_mode_pos 0 ++#define reg_dagc2_FG_mode_len 1 ++#define reg_dagc2_FG_mode_lsb 0 ++#define xd_p_reg_dagc2_fixed_gain_7_0 (*(volatile byte xdata *) 0xF219) ++#define p_reg_dagc2_fixed_gain_7_0 0xF219 ++#define reg_dagc2_fixed_gain_7_0_pos 0 ++#define reg_dagc2_fixed_gain_7_0_len 8 ++#define reg_dagc2_fixed_gain_7_0_lsb 0 ++#define xd_p_reg_dagc2_fixed_gain_11_8 (*(volatile byte xdata *) 0xF21A) ++#define p_reg_dagc2_fixed_gain_11_8 0xF21A ++#define reg_dagc2_fixed_gain_11_8_pos 0 ++#define reg_dagc2_fixed_gain_11_8_len 4 ++#define reg_dagc2_fixed_gain_11_8_lsb 8 ++#define xd_p_reg_td_debug_7_0 (*(volatile byte xdata *) 0xF21B) ++#define p_reg_td_debug_7_0 0xF21B ++#define reg_td_debug_7_0_pos 0 ++#define reg_td_debug_7_0_len 8 ++#define reg_td_debug_7_0_lsb 0 ++#define xd_p_reg_td_debug_15_8 (*(volatile byte xdata *) 0xF21C) ++#define p_reg_td_debug_15_8 0xF21C ++#define reg_td_debug_15_8_pos 0 ++#define reg_td_debug_15_8_len 8 ++#define reg_td_debug_15_8_lsb 8 ++#define xd_p_reg_td_debug_23_16 (*(volatile byte xdata *) 0xF21D) ++#define p_reg_td_debug_23_16 0xF21D ++#define reg_td_debug_23_16_pos 0 ++#define reg_td_debug_23_16_len 8 ++#define reg_td_debug_23_16_lsb 16 ++#define xd_p_reg_td_debug_30_24 (*(volatile byte xdata *) 0xF21E) ++#define p_reg_td_debug_30_24 0xF21E ++#define reg_td_debug_30_24_pos 0 ++#define reg_td_debug_30_24_len 7 ++#define reg_td_debug_30_24_lsb 24 ++#define xd_g_reg_tpsd_txmod (*(volatile byte xdata *) 0xF900) ++#define g_reg_tpsd_txmod 0xF900 ++#define reg_tpsd_txmod_pos 0 ++#define reg_tpsd_txmod_len 2 ++#define reg_tpsd_txmod_lsb 0 ++#define xd_g_reg_tpsd_gi (*(volatile byte xdata *) 0xF901) ++#define g_reg_tpsd_gi 0xF901 ++#define reg_tpsd_gi_pos 0 ++#define reg_tpsd_gi_len 2 ++#define reg_tpsd_gi_lsb 0 ++#define xd_g_reg_tpsd_hier (*(volatile byte xdata *) 0xF902) ++#define g_reg_tpsd_hier 0xF902 ++#define reg_tpsd_hier_pos 0 ++#define reg_tpsd_hier_len 3 ++#define reg_tpsd_hier_lsb 0 ++#define xd_g_reg_tpsd_const (*(volatile byte xdata *) 0xF903) ++#define g_reg_tpsd_const 0xF903 ++#define reg_tpsd_const_pos 0 ++#define reg_tpsd_const_len 2 ++#define reg_tpsd_const_lsb 0 ++#define xd_g_reg_bw (*(volatile byte xdata *) 0xF904) ++#define g_reg_bw 0xF904 ++#define reg_bw_pos 0 ++#define reg_bw_len 2 ++#define reg_bw_lsb 0 ++#define xd_g_reg_dec_pri (*(volatile byte xdata *) 0xF905) ++#define g_reg_dec_pri 0xF905 ++#define reg_dec_pri_pos 0 ++#define reg_dec_pri_len 1 ++#define reg_dec_pri_lsb 0 ++#define xd_g_reg_tpsd_hpcr (*(volatile byte xdata *) 0xF906) ++#define g_reg_tpsd_hpcr 0xF906 ++#define reg_tpsd_hpcr_pos 0 ++#define reg_tpsd_hpcr_len 3 ++#define reg_tpsd_hpcr_lsb 0 ++#define xd_g_reg_tpsd_lpcr (*(volatile byte xdata *) 0xF907) ++#define g_reg_tpsd_lpcr 0xF907 ++#define reg_tpsd_lpcr_pos 0 ++#define reg_tpsd_lpcr_len 3 ++#define reg_tpsd_lpcr_lsb 0 ++#define xd_g_reg_tpsd_indep (*(volatile byte xdata *) 0xF908) ++#define g_reg_tpsd_indep 0xF908 ++#define reg_tpsd_indep_pos 0 ++#define reg_tpsd_indep_len 1 ++#define reg_tpsd_indep_lsb 0 ++#define xd_g_reg_tpsd_tslice (*(volatile byte xdata *) 0xF909) ++#define g_reg_tpsd_tslice 0xF909 ++#define reg_tpsd_tslice_pos 0 ++#define reg_tpsd_tslice_len 1 ++#define reg_tpsd_tslice_lsb 0 ++#define xd_g_reg_tpsd_mpefec (*(volatile byte xdata *) 0xF90A) ++#define g_reg_tpsd_mpefec 0xF90A ++#define reg_tpsd_mpefec_pos 0 ++#define reg_tpsd_mpefec_len 1 ++#define reg_tpsd_mpefec_lsb 0 ++#define xd_g_reg_sntc_en (*(volatile byte xdata *) 0xF90B) ++#define g_reg_sntc_en 0xF90B ++#define reg_sntc_en_pos 0 ++#define reg_sntc_en_len 1 ++#define reg_sntc_en_lsb 0 ++#define xd_g_reg_intp_sys_div (*(volatile byte xdata *) 0xF90C) ++#define g_reg_intp_sys_div 0xF90C ++#define reg_intp_sys_div_pos 0 ++#define reg_intp_sys_div_len 1 ++#define reg_intp_sys_div_lsb 0 ++#define xd_g_reg_clk_sntc_sel (*(volatile byte xdata *) 0xF90D) ++#define g_reg_clk_sntc_sel 0xF90D ++#define reg_clk_sntc_sel_pos 0 ++#define reg_clk_sntc_sel_len 3 ++#define reg_clk_sntc_sel_lsb 0 ++#define xd_g_reg_clk_sys40 (*(volatile byte xdata *) 0xF90E) ++#define g_reg_clk_sys40 0xF90E ++#define reg_clk_sys40_pos 0 ++#define reg_clk_sys40_len 1 ++#define reg_clk_sys40_lsb 0 ++#define xd_g_reg_intp_sys_polarity (*(volatile byte xdata *) 0xF90F) ++#define g_reg_intp_sys_polarity 0xF90F ++#define reg_intp_sys_polarity_pos 0 ++#define reg_intp_sys_polarity_len 1 ++#define reg_intp_sys_polarity_lsb 0 ++#define xd_g_reg_intp_sys_sc_7_0 (*(volatile byte xdata *) 0xF910) ++#define g_reg_intp_sys_sc_7_0 0xF910 ++#define reg_intp_sys_sc_7_0_pos 0 ++#define reg_intp_sys_sc_7_0_len 8 ++#define reg_intp_sys_sc_7_0_lsb 0 ++#define xd_g_reg_intp_sys_sc_15_8 (*(volatile byte xdata *) 0xF911) ++#define g_reg_intp_sys_sc_15_8 0xF911 ++#define reg_intp_sys_sc_15_8_pos 0 ++#define reg_intp_sys_sc_15_8_len 8 ++#define reg_intp_sys_sc_15_8_lsb 8 ++#define xd_g_reg_intp_sys_sc_23_16 (*(volatile byte xdata *) 0xF912) ++#define g_reg_intp_sys_sc_23_16 0xF912 ++#define reg_intp_sys_sc_23_16_pos 0 ++#define reg_intp_sys_sc_23_16_len 8 ++#define reg_intp_sys_sc_23_16_lsb 16 ++#define xd_g_reg_intp_sys_sc_26_24 (*(volatile byte xdata *) 0xF913) ++#define g_reg_intp_sys_sc_26_24 0xF913 ++#define reg_intp_sys_sc_26_24_pos 0 ++#define reg_intp_sys_sc_26_24_len 3 ++#define reg_intp_sys_sc_26_24_lsb 24 ++#define xd_g_reg_ofsm_clk (*(volatile byte xdata *) 0xF914) ++#define g_reg_ofsm_clk 0xF914 ++#define reg_ofsm_clk_pos 0 ++#define reg_ofsm_clk_len 3 ++#define reg_ofsm_clk_lsb 0 ++#define xd_g_reg_fclk_cfg (*(volatile byte xdata *) 0xF915) ++#define g_reg_fclk_cfg 0xF915 ++#define reg_fclk_cfg_pos 0 ++#define reg_fclk_cfg_len 1 ++#define reg_fclk_cfg_lsb 0 ++#define xd_g_reg_fclk_idi (*(volatile byte xdata *) 0xF916) ++#define g_reg_fclk_idi 0xF916 ++#define reg_fclk_idi_pos 0 ++#define reg_fclk_idi_len 1 ++#define reg_fclk_idi_lsb 0 ++#define xd_g_reg_fclk_odi (*(volatile byte xdata *) 0xF917) ++#define g_reg_fclk_odi 0xF917 ++#define reg_fclk_odi_pos 0 ++#define reg_fclk_odi_len 1 ++#define reg_fclk_odi_lsb 0 ++#define xd_g_reg_fclk_rsd (*(volatile byte xdata *) 0xF918) ++#define g_reg_fclk_rsd 0xF918 ++#define reg_fclk_rsd_pos 0 ++#define reg_fclk_rsd_len 1 ++#define reg_fclk_rsd_lsb 0 ++#define xd_g_reg_fclk_vtb (*(volatile byte xdata *) 0xF919) ++#define g_reg_fclk_vtb 0xF919 ++#define reg_fclk_vtb_pos 0 ++#define reg_fclk_vtb_len 1 ++#define reg_fclk_vtb_lsb 0 ++#define xd_g_reg_fclk_cste (*(volatile byte xdata *) 0xF91A) ++#define g_reg_fclk_cste 0xF91A ++#define reg_fclk_cste_pos 0 ++#define reg_fclk_cste_len 1 ++#define reg_fclk_cste_lsb 0 ++#define xd_g_reg_fclk_mp2if (*(volatile byte xdata *) 0xF91B) ++#define g_reg_fclk_mp2if 0xF91B ++#define reg_fclk_mp2if_pos 0 ++#define reg_fclk_mp2if_len 1 ++#define reg_fclk_mp2if_lsb 0 ++#define xd_p_reg_adcout_sync (*(volatile byte xdata *) 0xFA00) ++#define p_reg_adcout_sync 0xFA00 ++#define reg_adcout_sync_pos 0 ++#define reg_adcout_sync_len 1 ++#define reg_adcout_sync_lsb 0 ++#define xd_p_reg_dagc2o_edge1 (*(volatile byte xdata *) 0xFA01) ++#define p_reg_dagc2o_edge1 0xFA01 ++#define reg_dagc2o_edge1_pos 0 ++#define reg_dagc2o_edge1_len 1 ++#define reg_dagc2o_edge1_lsb 0 ++#define xd_p_reg_dagc2o_edge0 (*(volatile byte xdata *) 0xFA02) ++#define p_reg_dagc2o_edge0 0xFA02 ++#define reg_dagc2o_edge0_pos 0 ++#define reg_dagc2o_edge0_len 1 ++#define reg_dagc2o_edge0_lsb 0 ++#define xd_p_reg_second_rom_on (*(volatile byte xdata *) 0xFA03) ++#define p_reg_second_rom_on 0xFA03 ++#define reg_second_rom_on_pos 0 ++#define reg_second_rom_on_len 1 ++#define reg_second_rom_on_lsb 0 ++#define xd_p_reg_bypass_host2tuner (*(volatile byte xdata *) 0xFA04) ++#define p_reg_bypass_host2tuner 0xFA04 ++#define reg_bypass_host2tuner_pos 0 ++#define reg_bypass_host2tuner_len 1 ++#define reg_bypass_host2tuner_lsb 0 ++#endif ++// biu_reg.h 6-27-2007 ++// gen_biu Ver 1.0 generated by tienchi ++#define xd_p_cfoe_NS_coeff1_7_0 (*(volatile byte xdata *) 0xF400) ++#define p_cfoe_NS_coeff1_7_0 0xF400 ++#define cfoe_NS_coeff1_7_0_pos 0 ++#define cfoe_NS_coeff1_7_0_len 8 ++#define cfoe_NS_coeff1_7_0_lsb 0 ++#define xd_p_cfoe_NS_coeff1_15_8 (*(volatile byte xdata *) 0xF401) ++#define p_cfoe_NS_coeff1_15_8 0xF401 ++#define cfoe_NS_coeff1_15_8_pos 0 ++#define cfoe_NS_coeff1_15_8_len 8 ++#define cfoe_NS_coeff1_15_8_lsb 8 ++#define xd_p_cfoe_NS_coeff1_23_16 (*(volatile byte xdata *) 0xF402) ++#define p_cfoe_NS_coeff1_23_16 0xF402 ++#define cfoe_NS_coeff1_23_16_pos 0 ++#define cfoe_NS_coeff1_23_16_len 8 ++#define cfoe_NS_coeff1_23_16_lsb 16 ++#define xd_p_cfoe_NS_coeff1_25_24 (*(volatile byte xdata *) 0xF403) ++#define p_cfoe_NS_coeff1_25_24 0xF403 ++#define cfoe_NS_coeff1_25_24_pos 0 ++#define cfoe_NS_coeff1_25_24_len 2 ++#define cfoe_NS_coeff1_25_24_lsb 24 ++#define xd_p_cfoe_NS_coeff2_7_0 (*(volatile byte xdata *) 0xF404) ++#define p_cfoe_NS_coeff2_7_0 0xF404 ++#define cfoe_NS_coeff2_7_0_pos 0 ++#define cfoe_NS_coeff2_7_0_len 8 ++#define cfoe_NS_coeff2_7_0_lsb 0 ++#define xd_p_cfoe_NS_coeff2_15_8 (*(volatile byte xdata *) 0xF405) ++#define p_cfoe_NS_coeff2_15_8 0xF405 ++#define cfoe_NS_coeff2_15_8_pos 0 ++#define cfoe_NS_coeff2_15_8_len 8 ++#define cfoe_NS_coeff2_15_8_lsb 8 ++#define xd_p_cfoe_NS_coeff2_23_16 (*(volatile byte xdata *) 0xF406) ++#define p_cfoe_NS_coeff2_23_16 0xF406 ++#define cfoe_NS_coeff2_23_16_pos 0 ++#define cfoe_NS_coeff2_23_16_len 8 ++#define cfoe_NS_coeff2_23_16_lsb 16 ++#define xd_p_cfoe_NS_coeff2_24 (*(volatile byte xdata *) 0xF407) ++#define p_cfoe_NS_coeff2_24 0xF407 ++#define cfoe_NS_coeff2_24_pos 0 ++#define cfoe_NS_coeff2_24_len 1 ++#define cfoe_NS_coeff2_24_lsb 24 ++#define xd_p_cfoe_lf_c1_7_0 (*(volatile byte xdata *) 0xF408) ++#define p_cfoe_lf_c1_7_0 0xF408 ++#define cfoe_lf_c1_7_0_pos 0 ++#define cfoe_lf_c1_7_0_len 8 ++#define cfoe_lf_c1_7_0_lsb 0 ++#define xd_p_cfoe_lf_c1_9_8 (*(volatile byte xdata *) 0xF409) ++#define p_cfoe_lf_c1_9_8 0xF409 ++#define cfoe_lf_c1_9_8_pos 0 ++#define cfoe_lf_c1_9_8_len 2 ++#define cfoe_lf_c1_9_8_lsb 8 ++#define xd_p_cfoe_lf_c2_7_0 (*(volatile byte xdata *) 0xF40A) ++#define p_cfoe_lf_c2_7_0 0xF40A ++#define cfoe_lf_c2_7_0_pos 0 ++#define cfoe_lf_c2_7_0_len 8 ++#define cfoe_lf_c2_7_0_lsb 0 ++#define xd_p_cfoe_lf_c2_9_8 (*(volatile byte xdata *) 0xF40B) ++#define p_cfoe_lf_c2_9_8 0xF40B ++#define cfoe_lf_c2_9_8_pos 0 ++#define cfoe_lf_c2_9_8_len 2 ++#define cfoe_lf_c2_9_8_lsb 8 ++#define xd_p_cfoe_ifod_7_0 (*(volatile byte xdata *) 0xF40C) ++#define p_cfoe_ifod_7_0 0xF40C ++#define cfoe_ifod_7_0_pos 0 ++#define cfoe_ifod_7_0_len 8 ++#define cfoe_ifod_7_0_lsb 0 ++#define xd_p_cfoe_ifod_10_8 (*(volatile byte xdata *) 0xF40D) ++#define p_cfoe_ifod_10_8 0xF40D ++#define cfoe_ifod_10_8_pos 0 ++#define cfoe_ifod_10_8_len 3 ++#define cfoe_ifod_10_8_lsb 8 ++#define xd_p_cfoe_Divg_ctr_th (*(volatile byte xdata *) 0xF40E) ++#define p_cfoe_Divg_ctr_th 0xF40E ++#define cfoe_Divg_ctr_th_pos 0 ++#define cfoe_Divg_ctr_th_len 4 ++#define cfoe_Divg_ctr_th_lsb 0 ++#define xd_p_cfoe_FOT_divg_th (*(volatile byte xdata *) 0xF40F) ++#define p_cfoe_FOT_divg_th 0xF40F ++#define cfoe_FOT_divg_th_pos 0 ++#define cfoe_FOT_divg_th_len 8 ++#define cfoe_FOT_divg_th_lsb 0 ++#define xd_p_cfoe_FOT_cnvg_th (*(volatile byte xdata *) 0xF410) ++#define p_cfoe_FOT_cnvg_th 0xF410 ++#define cfoe_FOT_cnvg_th_pos 0 ++#define cfoe_FOT_cnvg_th_len 8 ++#define cfoe_FOT_cnvg_th_lsb 0 ++#define xd_p_reg_cfoe_offset_7_0 (*(volatile byte xdata *) 0xF411) ++#define p_reg_cfoe_offset_7_0 0xF411 ++#define reg_cfoe_offset_7_0_pos 0 ++#define reg_cfoe_offset_7_0_len 8 ++#define reg_cfoe_offset_7_0_lsb 0 ++#define xd_p_reg_cfoe_offset_10_8 (*(volatile byte xdata *) 0xF412) ++#define p_reg_cfoe_offset_10_8 0xF412 ++#define reg_cfoe_offset_10_8_pos 0 ++#define reg_cfoe_offset_10_8_len 3 ++#define reg_cfoe_offset_10_8_lsb 8 ++#define xd_p_reg_cfoe_ifoe_sign_corr (*(volatile byte xdata *) 0xF413) ++#define p_reg_cfoe_ifoe_sign_corr 0xF413 ++#define reg_cfoe_ifoe_sign_corr_pos 0 ++#define reg_cfoe_ifoe_sign_corr_len 1 ++#define reg_cfoe_ifoe_sign_corr_lsb 0 ++#define xd_p_cfoe_FOT_pullin_cnt_clr (*(volatile byte xdata *) 0xF414) ++#define p_cfoe_FOT_pullin_cnt_clr 0xF414 ++#define cfoe_FOT_pullin_cnt_clr_pos 0 ++#define cfoe_FOT_pullin_cnt_clr_len 1 ++#define cfoe_FOT_pullin_cnt_clr_lsb 0 ++#define xd_p_cfoe_FOT_spec_inv (*(volatile byte xdata *) 0xF415) ++#define p_cfoe_FOT_spec_inv 0xF415 ++#define cfoe_FOT_spec_inv_pos 0 ++#define cfoe_FOT_spec_inv_len 1 ++#define cfoe_FOT_spec_inv_lsb 0 ++#define xd_p_cfoe_FOT_pullin_ctr_th (*(volatile byte xdata *) 0xF416) ++#define p_cfoe_FOT_pullin_ctr_th 0xF416 ++#define cfoe_FOT_pullin_ctr_th_pos 0 ++#define cfoe_FOT_pullin_ctr_th_len 4 ++#define cfoe_FOT_pullin_ctr_th_lsb 0 ++#define xd_p_cfoe_FOT_sf_ctr_th (*(volatile byte xdata *) 0xF417) ++#define p_cfoe_FOT_sf_ctr_th 0xF417 ++#define cfoe_FOT_sf_ctr_th_pos 0 ++#define cfoe_FOT_sf_ctr_th_len 4 ++#define cfoe_FOT_sf_ctr_th_lsb 0 ++#define xd_p_cfoe_FOT_pullin_th (*(volatile byte xdata *) 0xF418) ++#define p_cfoe_FOT_pullin_th 0xF418 ++#define cfoe_FOT_pullin_th_pos 0 ++#define cfoe_FOT_pullin_th_len 8 ++#define cfoe_FOT_pullin_th_lsb 0 ++#define xd_p_cfoe_FOT_kalman_cnt (*(volatile byte xdata *) 0xF419) ++#define p_cfoe_FOT_kalman_cnt 0xF419 ++#define cfoe_FOT_kalman_cnt_pos 0 ++#define cfoe_FOT_kalman_cnt_len 4 ++#define cfoe_FOT_kalman_cnt_lsb 0 ++#define xd_p_cfoe_FOT_fsm_info (*(volatile byte xdata *) 0xF41A) ++#define p_cfoe_FOT_fsm_info 0xF41A ++#define cfoe_FOT_fsm_info_pos 0 ++#define cfoe_FOT_fsm_info_len 4 ++#define cfoe_FOT_fsm_info_lsb 0 ++#define xd_r_cfoe_FOT_pullin_cnt (*(volatile byte xdata *) 0xF41B) ++#define r_cfoe_FOT_pullin_cnt 0xF41B ++#define cfoe_FOT_pullin_cnt_pos 0 ++#define cfoe_FOT_pullin_cnt_len 4 ++#define cfoe_FOT_pullin_cnt_lsb 0 ++#define xd_r_cfoe_FOT_sf_cnt (*(volatile byte xdata *) 0xF41C) ++#define r_cfoe_FOT_sf_cnt 0xF41C ++#define cfoe_FOT_sf_cnt_pos 0 ++#define cfoe_FOT_sf_cnt_len 4 ++#define cfoe_FOT_sf_cnt_lsb 0 ++#define xd_r_reg_r_cfoe_ifoe_ifo_metric (*(volatile byte xdata *) 0xF41D) ++#define r_reg_r_cfoe_ifoe_ifo_metric 0xF41D ++#define reg_r_cfoe_ifoe_ifo_metric_pos 0 ++#define reg_r_cfoe_ifoe_ifo_metric_len 8 ++#define reg_r_cfoe_ifoe_ifo_metric_lsb 0 ++#define xd_r_reg_r_cfoe_ifoe_cos2num_7_0 (*(volatile byte xdata *) 0xF41E) ++#define r_reg_r_cfoe_ifoe_cos2num_7_0 0xF41E ++#define reg_r_cfoe_ifoe_cos2num_7_0_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_7_0_len 8 ++#define reg_r_cfoe_ifoe_cos2num_7_0_lsb 0 ++#define xd_r_reg_r_cfoe_ifoe_cos2num_15_8 (*(volatile byte xdata *) 0xF41F) ++#define r_reg_r_cfoe_ifoe_cos2num_15_8 0xF41F ++#define reg_r_cfoe_ifoe_cos2num_15_8_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_15_8_len 8 ++#define reg_r_cfoe_ifoe_cos2num_15_8_lsb 8 ++#define xd_r_reg_r_cfoe_ifoe_cos2num_19_16 (*(volatile byte xdata *) 0xF420) ++#define r_reg_r_cfoe_ifoe_cos2num_19_16 0xF420 ++#define reg_r_cfoe_ifoe_cos2num_19_16_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_19_16_len 4 ++#define reg_r_cfoe_ifoe_cos2num_19_16_lsb 16 ++#define xd_p_ste_Nu (*(volatile byte xdata *) 0xF460) ++#define p_ste_Nu 0xF460 ++#define ste_Nu_pos 0 ++#define ste_Nu_len 3 ++#define ste_Nu_lsb 0 ++#define xd_p_ste_GI (*(volatile byte xdata *) 0xF461) ++#define p_ste_GI 0xF461 ++#define ste_GI_pos 0 ++#define ste_GI_len 3 ++#define ste_GI_lsb 0 ++#define xd_p_ste_symbol_num (*(volatile byte xdata *) 0xF463) ++#define p_ste_symbol_num 0xF463 ++#define ste_symbol_num_pos 0 ++#define ste_symbol_num_len 3 ++#define ste_symbol_num_lsb 0 ++#define xd_p_ste_sample_num (*(volatile byte xdata *) 0xF464) ++#define p_ste_sample_num 0xF464 ++#define ste_sample_num_pos 0 ++#define ste_sample_num_len 2 ++#define ste_sample_num_lsb 0 ++#define xd_p_ste_symbol_num_4K (*(volatile byte xdata *) 0xF465) ++#define p_ste_symbol_num_4K 0xF465 ++#define ste_symbol_num_4K_pos 0 ++#define ste_symbol_num_4K_len 3 ++#define ste_symbol_num_4K_lsb 0 ++#define xd_p_ste_FFT_offset_7_0 (*(volatile byte xdata *) 0xF466) ++#define p_ste_FFT_offset_7_0 0xF466 ++#define ste_FFT_offset_7_0_pos 0 ++#define ste_FFT_offset_7_0_len 8 ++#define ste_FFT_offset_7_0_lsb 0 ++#define xd_p_ste_FFT_offset_13_8 (*(volatile byte xdata *) 0xF467) ++#define p_ste_FFT_offset_13_8 0xF467 ++#define ste_FFT_offset_13_8_pos 0 ++#define ste_FFT_offset_13_8_len 6 ++#define ste_FFT_offset_13_8_lsb 8 ++#define xd_p_ste_sample_num_4K (*(volatile byte xdata *) 0xF468) ++#define p_ste_sample_num_4K 0xF468 ++#define ste_sample_num_4K_pos 0 ++#define ste_sample_num_4K_len 2 ++#define ste_sample_num_4K_lsb 0 ++#define xd_p_ste_adv_start_7_0 (*(volatile byte xdata *) 0xF469) ++#define p_ste_adv_start_7_0 0xF469 ++#define ste_adv_start_7_0_pos 0 ++#define ste_adv_start_7_0_len 8 ++#define ste_adv_start_7_0_lsb 0 ++#define xd_p_ste_adv_start_10_8 (*(volatile byte xdata *) 0xF46A) ++#define p_ste_adv_start_10_8 0xF46A ++#define ste_adv_start_10_8_pos 0 ++#define ste_adv_start_10_8_len 3 ++#define ste_adv_start_10_8_lsb 8 ++#define xd_p_ste_symbol_num_8K (*(volatile byte xdata *) 0xF46B) ++#define p_ste_symbol_num_8K 0xF46B ++#define ste_symbol_num_8K_pos 0 ++#define ste_symbol_num_8K_len 3 ++#define ste_symbol_num_8K_lsb 0 ++#define xd_p_ste_sample_num_8K (*(volatile byte xdata *) 0xF46C) ++#define p_ste_sample_num_8K 0xF46C ++#define ste_sample_num_8K_pos 0 ++#define ste_sample_num_8K_len 2 ++#define ste_sample_num_8K_lsb 0 ++#define xd_p_ste_adv_stop (*(volatile byte xdata *) 0xF46D) ++#define p_ste_adv_stop 0xF46D ++#define ste_adv_stop_pos 0 ++#define ste_adv_stop_len 8 ++#define ste_adv_stop_lsb 0 ++#define xd_r_ste_P_value_7_0 (*(volatile byte xdata *) 0xF46E) ++#define r_ste_P_value_7_0 0xF46E ++#define ste_P_value_7_0_pos 0 ++#define ste_P_value_7_0_len 8 ++#define ste_P_value_7_0_lsb 0 ++#define xd_r_ste_P_value_10_8 (*(volatile byte xdata *) 0xF46F) ++#define r_ste_P_value_10_8 0xF46F ++#define ste_P_value_10_8_pos 0 ++#define ste_P_value_10_8_len 3 ++#define ste_P_value_10_8_lsb 8 ++#define xd_p_reg_ste_tstmod (*(volatile byte xdata *) 0xF470) ++#define p_reg_ste_tstmod 0xF470 ++#define reg_ste_tstmod_pos 0 ++#define reg_ste_tstmod_len 1 ++#define reg_ste_tstmod_lsb 0 ++#define xd_p_reg_ste_buf_en (*(volatile byte xdata *) 0xF471) ++#define p_reg_ste_buf_en 0xF471 ++#define reg_ste_buf_en_pos 0 ++#define reg_ste_buf_en_len 1 ++#define reg_ste_buf_en_lsb 0 ++#define xd_r_ste_M_value_7_0 (*(volatile byte xdata *) 0xF472) ++#define r_ste_M_value_7_0 0xF472 ++#define ste_M_value_7_0_pos 0 ++#define ste_M_value_7_0_len 8 ++#define ste_M_value_7_0_lsb 0 ++#define xd_r_ste_M_value_10_8 (*(volatile byte xdata *) 0xF473) ++#define r_ste_M_value_10_8 0xF473 ++#define ste_M_value_10_8_pos 0 ++#define ste_M_value_10_8_len 3 ++#define ste_M_value_10_8_lsb 8 ++#define xd_r_ste_H1 (*(volatile byte xdata *) 0xF474) ++#define r_ste_H1 0xF474 ++#define ste_H1_pos 0 ++#define ste_H1_len 7 ++#define ste_H1_lsb 0 ++#define xd_r_ste_H2 (*(volatile byte xdata *) 0xF475) ++#define r_ste_H2 0xF475 ++#define ste_H2_pos 0 ++#define ste_H2_len 7 ++#define ste_H2_lsb 0 ++#define xd_r_ste_H3 (*(volatile byte xdata *) 0xF476) ++#define r_ste_H3 0xF476 ++#define ste_H3_pos 0 ++#define ste_H3_len 7 ++#define ste_H3_lsb 0 ++#define xd_r_ste_H4 (*(volatile byte xdata *) 0xF477) ++#define r_ste_H4 0xF477 ++#define ste_H4_pos 0 ++#define ste_H4_len 7 ++#define ste_H4_lsb 0 ++#define xd_r_ste_Corr_value_I_7_0 (*(volatile byte xdata *) 0xF478) ++#define r_ste_Corr_value_I_7_0 0xF478 ++#define ste_Corr_value_I_7_0_pos 0 ++#define ste_Corr_value_I_7_0_len 8 ++#define ste_Corr_value_I_7_0_lsb 0 ++#define xd_r_ste_Corr_value_I_15_8 (*(volatile byte xdata *) 0xF479) ++#define r_ste_Corr_value_I_15_8 0xF479 ++#define ste_Corr_value_I_15_8_pos 0 ++#define ste_Corr_value_I_15_8_len 8 ++#define ste_Corr_value_I_15_8_lsb 8 ++#define xd_r_ste_Corr_value_I_23_16 (*(volatile byte xdata *) 0xF47A) ++#define r_ste_Corr_value_I_23_16 0xF47A ++#define ste_Corr_value_I_23_16_pos 0 ++#define ste_Corr_value_I_23_16_len 8 ++#define ste_Corr_value_I_23_16_lsb 16 ++#define xd_r_ste_Corr_value_I_27_24 (*(volatile byte xdata *) 0xF47B) ++#define r_ste_Corr_value_I_27_24 0xF47B ++#define ste_Corr_value_I_27_24_pos 0 ++#define ste_Corr_value_I_27_24_len 4 ++#define ste_Corr_value_I_27_24_lsb 24 ++#define xd_r_ste_Corr_value_Q_7_0 (*(volatile byte xdata *) 0xF47C) ++#define r_ste_Corr_value_Q_7_0 0xF47C ++#define ste_Corr_value_Q_7_0_pos 0 ++#define ste_Corr_value_Q_7_0_len 8 ++#define ste_Corr_value_Q_7_0_lsb 0 ++#define xd_r_ste_Corr_value_Q_15_8 (*(volatile byte xdata *) 0xF47D) ++#define r_ste_Corr_value_Q_15_8 0xF47D ++#define ste_Corr_value_Q_15_8_pos 0 ++#define ste_Corr_value_Q_15_8_len 8 ++#define ste_Corr_value_Q_15_8_lsb 8 ++#define xd_r_ste_Corr_value_Q_23_16 (*(volatile byte xdata *) 0xF47E) ++#define r_ste_Corr_value_Q_23_16 0xF47E ++#define ste_Corr_value_Q_23_16_pos 0 ++#define ste_Corr_value_Q_23_16_len 8 ++#define ste_Corr_value_Q_23_16_lsb 16 ++#define xd_r_ste_Corr_value_Q_27_24 (*(volatile byte xdata *) 0xF47F) ++#define r_ste_Corr_value_Q_27_24 0xF47F ++#define ste_Corr_value_Q_27_24_pos 0 ++#define ste_Corr_value_Q_27_24_len 4 ++#define ste_Corr_value_Q_27_24_lsb 24 ++#define xd_r_ste_J_num_7_0 (*(volatile byte xdata *) 0xF480) ++#define r_ste_J_num_7_0 0xF480 ++#define ste_J_num_7_0_pos 0 ++#define ste_J_num_7_0_len 8 ++#define ste_J_num_7_0_lsb 0 ++#define xd_r_ste_J_num_15_8 (*(volatile byte xdata *) 0xF481) ++#define r_ste_J_num_15_8 0xF481 ++#define ste_J_num_15_8_pos 0 ++#define ste_J_num_15_8_len 8 ++#define ste_J_num_15_8_lsb 8 ++#define xd_r_ste_J_num_23_16 (*(volatile byte xdata *) 0xF482) ++#define r_ste_J_num_23_16 0xF482 ++#define ste_J_num_23_16_pos 0 ++#define ste_J_num_23_16_len 8 ++#define ste_J_num_23_16_lsb 16 ++#define xd_r_ste_J_num_31_24 (*(volatile byte xdata *) 0xF483) ++#define r_ste_J_num_31_24 0xF483 ++#define ste_J_num_31_24_pos 0 ++#define ste_J_num_31_24_len 8 ++#define ste_J_num_31_24_lsb 24 ++#define xd_r_ste_J_den_7_0 (*(volatile byte xdata *) 0xF484) ++#define r_ste_J_den_7_0 0xF484 ++#define ste_J_den_7_0_pos 0 ++#define ste_J_den_7_0_len 8 ++#define ste_J_den_7_0_lsb 0 ++#define xd_r_ste_J_den_15_8 (*(volatile byte xdata *) 0xF485) ++#define r_ste_J_den_15_8 0xF485 ++#define ste_J_den_15_8_pos 0 ++#define ste_J_den_15_8_len 8 ++#define ste_J_den_15_8_lsb 8 ++#define xd_r_ste_J_den_18_16 (*(volatile byte xdata *) 0xF486) ++#define r_ste_J_den_18_16 0xF486 ++#define ste_J_den_18_16_pos 0 ++#define ste_J_den_18_16_len 3 ++#define ste_J_den_18_16_lsb 16 ++#define xd_r_ste_Beacon_Indicator (*(volatile byte xdata *) 0xF488) ++#define r_ste_Beacon_Indicator 0xF488 ++#define ste_Beacon_Indicator_pos 0 ++#define ste_Beacon_Indicator_len 1 ++#define ste_Beacon_Indicator_lsb 0 ++#define xd_p_ste_got_sntc_bcn (*(volatile byte xdata *) 0xF48B) ++#define p_ste_got_sntc_bcn 0xF48B ++#define ste_got_sntc_bcn_pos 0 ++#define ste_got_sntc_bcn_len 1 ++#define ste_got_sntc_bcn_lsb 0 ++#define xd_r_tpsd_Frame_Num (*(volatile byte xdata *) 0xF4C0) ++#define r_tpsd_Frame_Num 0xF4C0 ++#define tpsd_Frame_Num_pos 0 ++#define tpsd_Frame_Num_len 2 ++#define tpsd_Frame_Num_lsb 0 ++#define xd_r_tpsd_Constel (*(volatile byte xdata *) 0xF4C1) ++#define r_tpsd_Constel 0xF4C1 ++#define tpsd_Constel_pos 0 ++#define tpsd_Constel_len 2 ++#define tpsd_Constel_lsb 0 ++#define xd_r_tpsd_GI (*(volatile byte xdata *) 0xF4C2) ++#define r_tpsd_GI 0xF4C2 ++#define tpsd_GI_pos 0 ++#define tpsd_GI_len 2 ++#define tpsd_GI_lsb 0 ++#define xd_r_tpsd_Mode (*(volatile byte xdata *) 0xF4C3) ++#define r_tpsd_Mode 0xF4C3 ++#define tpsd_Mode_pos 0 ++#define tpsd_Mode_len 2 ++#define tpsd_Mode_lsb 0 ++#define xd_r_tpsd_CR_HP (*(volatile byte xdata *) 0xF4C4) ++#define r_tpsd_CR_HP 0xF4C4 ++#define tpsd_CR_HP_pos 0 ++#define tpsd_CR_HP_len 3 ++#define tpsd_CR_HP_lsb 0 ++#define xd_r_tpsd_CR_LP (*(volatile byte xdata *) 0xF4C5) ++#define r_tpsd_CR_LP 0xF4C5 ++#define tpsd_CR_LP_pos 0 ++#define tpsd_CR_LP_len 3 ++#define tpsd_CR_LP_lsb 0 ++#define xd_r_tpsd_Hie (*(volatile byte xdata *) 0xF4C6) ++#define r_tpsd_Hie 0xF4C6 ++#define tpsd_Hie_pos 0 ++#define tpsd_Hie_len 3 ++#define tpsd_Hie_lsb 0 ++#define xd_r_tpsd_Res_Bits (*(volatile byte xdata *) 0xF4C7) ++#define r_tpsd_Res_Bits 0xF4C7 ++#define tpsd_Res_Bits_pos 0 ++#define tpsd_Res_Bits_len 5 ++#define tpsd_Res_Bits_lsb 0 ++#define xd_r_tpsd_Res_Bits_0 (*(volatile byte xdata *) 0xF4C8) ++#define r_tpsd_Res_Bits_0 0xF4C8 ++#define tpsd_Res_Bits_0_pos 0 ++#define tpsd_Res_Bits_0_len 1 ++#define tpsd_Res_Bits_0_lsb 0 ++#define xd_r_tpsd_LengthInd (*(volatile byte xdata *) 0xF4C9) ++#define r_tpsd_LengthInd 0xF4C9 ++#define tpsd_LengthInd_pos 0 ++#define tpsd_LengthInd_len 6 ++#define tpsd_LengthInd_lsb 0 ++#define xd_r_tpsd_Cell_Id_7_0 (*(volatile byte xdata *) 0xF4CA) ++#define r_tpsd_Cell_Id_7_0 0xF4CA ++#define tpsd_Cell_Id_7_0_pos 0 ++#define tpsd_Cell_Id_7_0_len 8 ++#define tpsd_Cell_Id_7_0_lsb 0 ++#define xd_r_tpsd_Cell_Id_15_8 (*(volatile byte xdata *) 0xF4CB) ++#define r_tpsd_Cell_Id_15_8 0xF4CB ++#define tpsd_Cell_Id_15_8_pos 0 ++#define tpsd_Cell_Id_15_8_len 8 ++#define tpsd_Cell_Id_15_8_lsb 0 ++#define xd_r_tpsd_use_InDepthInt (*(volatile byte xdata *) 0xF4CC) ++#define r_tpsd_use_InDepthInt 0xF4CC ++#define tpsd_use_InDepthInt_pos 0 ++#define tpsd_use_InDepthInt_len 1 ++#define tpsd_use_InDepthInt_lsb 0 ++#define xd_r_tpsd_use_TimeSlicing_HP (*(volatile byte xdata *) 0xF4CD) ++#define r_tpsd_use_TimeSlicing_HP 0xF4CD ++#define tpsd_use_TimeSlicing_HP_pos 0 ++#define tpsd_use_TimeSlicing_HP_len 1 ++#define tpsd_use_TimeSlicing_HP_lsb 0 ++#define xd_r_tpsd_use_mpe_fec_HP (*(volatile byte xdata *) 0xF4CE) ++#define r_tpsd_use_mpe_fec_HP 0xF4CE ++#define tpsd_use_mpe_fec_HP_pos 0 ++#define tpsd_use_mpe_fec_HP_len 1 ++#define tpsd_use_mpe_fec_HP_lsb 0 ++#define xd_r_tpsd_use_TimeSlicing_LP (*(volatile byte xdata *) 0xF4CF) ++#define r_tpsd_use_TimeSlicing_LP 0xF4CF ++#define tpsd_use_TimeSlicing_LP_pos 0 ++#define tpsd_use_TimeSlicing_LP_len 1 ++#define tpsd_use_TimeSlicing_LP_lsb 0 ++#define xd_r_tpsd_use_mpe_fec_LP (*(volatile byte xdata *) 0xF4D0) ++#define r_tpsd_use_mpe_fec_LP 0xF4D0 ++#define tpsd_use_mpe_fec_LP_pos 0 ++#define tpsd_use_mpe_fec_LP_len 1 ++#define tpsd_use_mpe_fec_LP_lsb 0 ++#define xd_r_tpsd_leng23_ind_return (*(volatile byte xdata *) 0xF4D1) ++#define r_tpsd_leng23_ind_return 0xF4D1 ++#define tpsd_leng23_ind_return_pos 0 ++#define tpsd_leng23_ind_return_len 1 ++#define tpsd_leng23_ind_return_lsb 0 ++#define xd_p_reg_fft_re_exp (*(volatile byte xdata *) 0xF500) ++#define p_reg_fft_re_exp 0xF500 ++#define reg_fft_re_exp_pos 0 ++#define reg_fft_re_exp_len 4 ++#define reg_fft_re_exp_lsb 0 ++#define xd_p_reg_fft_re_mts (*(volatile byte xdata *) 0xF501) ++#define p_reg_fft_re_mts 0xF501 ++#define reg_fft_re_mts_pos 0 ++#define reg_fft_re_mts_len 8 ++#define reg_fft_re_mts_lsb 0 ++#define xd_p_reg_fft_im_exp (*(volatile byte xdata *) 0xF502) ++#define p_reg_fft_im_exp 0xF502 ++#define reg_fft_im_exp_pos 0 ++#define reg_fft_im_exp_len 4 ++#define reg_fft_im_exp_lsb 0 ++#define xd_p_reg_fft_im_mts (*(volatile byte xdata *) 0xF503) ++#define p_reg_fft_im_mts 0xF503 ++#define reg_fft_im_mts_pos 0 ++#define reg_fft_im_mts_len 8 ++#define reg_fft_im_mts_lsb 0 ++#define xd_p_reg_fft_conjugate (*(volatile byte xdata *) 0xF504) ++#define p_reg_fft_conjugate 0xF504 ++#define reg_fft_conjugate_pos 0 ++#define reg_fft_conjugate_len 1 ++#define reg_fft_conjugate_lsb 0 ++#define xd_p_reg_fft_power_en (*(volatile byte xdata *) 0xF505) ++#define p_reg_fft_power_en 0xF505 ++#define reg_fft_power_en_pos 0 ++#define reg_fft_power_en_len 1 ++#define reg_fft_power_en_lsb 0 ++#define xd_p_reg_fft_power_factor (*(volatile byte xdata *) 0xF506) ++#define p_reg_fft_power_factor 0xF506 ++#define reg_fft_power_factor_pos 0 ++#define reg_fft_power_factor_len 6 ++#define reg_fft_power_factor_lsb 0 ++#define xd_p_reg_fft_power_in (*(volatile byte xdata *) 0xF507) ++#define p_reg_fft_power_in 0xF507 ++#define reg_fft_power_in_pos 0 ++#define reg_fft_power_in_len 8 ++#define reg_fft_power_in_lsb 0 ++#define xd_p_reg_fft_mask_from0_7_0 (*(volatile byte xdata *) 0xF508) ++#define p_reg_fft_mask_from0_7_0 0xF508 ++#define reg_fft_mask_from0_7_0_pos 0 ++#define reg_fft_mask_from0_7_0_len 8 ++#define reg_fft_mask_from0_7_0_lsb 0 ++#define xd_p_reg_fft_mask_from0_12_8 (*(volatile byte xdata *) 0xF509) ++#define p_reg_fft_mask_from0_12_8 0xF509 ++#define reg_fft_mask_from0_12_8_pos 0 ++#define reg_fft_mask_from0_12_8_len 5 ++#define reg_fft_mask_from0_12_8_lsb 8 ++#define xd_p_reg_fft_mask_to0_7_0 (*(volatile byte xdata *) 0xF50A) ++#define p_reg_fft_mask_to0_7_0 0xF50A ++#define reg_fft_mask_to0_7_0_pos 0 ++#define reg_fft_mask_to0_7_0_len 8 ++#define reg_fft_mask_to0_7_0_lsb 0 ++#define xd_p_reg_fft_mask_to0_12_8 (*(volatile byte xdata *) 0xF50B) ++#define p_reg_fft_mask_to0_12_8 0xF50B ++#define reg_fft_mask_to0_12_8_pos 0 ++#define reg_fft_mask_to0_12_8_len 5 ++#define reg_fft_mask_to0_12_8_lsb 8 ++#define xd_p_reg_fft_mask_from1_7_0 (*(volatile byte xdata *) 0xF50C) ++#define p_reg_fft_mask_from1_7_0 0xF50C ++#define reg_fft_mask_from1_7_0_pos 0 ++#define reg_fft_mask_from1_7_0_len 8 ++#define reg_fft_mask_from1_7_0_lsb 0 ++#define xd_p_reg_fft_mask_from1_12_8 (*(volatile byte xdata *) 0xF50D) ++#define p_reg_fft_mask_from1_12_8 0xF50D ++#define reg_fft_mask_from1_12_8_pos 0 ++#define reg_fft_mask_from1_12_8_len 5 ++#define reg_fft_mask_from1_12_8_lsb 8 ++#define xd_p_reg_fft_mask_to1_7_0 (*(volatile byte xdata *) 0xF50E) ++#define p_reg_fft_mask_to1_7_0 0xF50E ++#define reg_fft_mask_to1_7_0_pos 0 ++#define reg_fft_mask_to1_7_0_len 8 ++#define reg_fft_mask_to1_7_0_lsb 0 ++#define xd_p_reg_fft_mask_to1_12_8 (*(volatile byte xdata *) 0xF50F) ++#define p_reg_fft_mask_to1_12_8 0xF50F ++#define reg_fft_mask_to1_12_8_pos 0 ++#define reg_fft_mask_to1_12_8_len 5 ++#define reg_fft_mask_to1_12_8_lsb 8 ++#define xd_p_reg_fft_mask_from2_7_0 (*(volatile byte xdata *) 0xF510) ++#define p_reg_fft_mask_from2_7_0 0xF510 ++#define reg_fft_mask_from2_7_0_pos 0 ++#define reg_fft_mask_from2_7_0_len 8 ++#define reg_fft_mask_from2_7_0_lsb 0 ++#define xd_p_reg_fft_mask_from2_12_8 (*(volatile byte xdata *) 0xF511) ++#define p_reg_fft_mask_from2_12_8 0xF511 ++#define reg_fft_mask_from2_12_8_pos 0 ++#define reg_fft_mask_from2_12_8_len 5 ++#define reg_fft_mask_from2_12_8_lsb 8 ++#define xd_p_reg_fft_mask_to2_7_0 (*(volatile byte xdata *) 0xF512) ++#define p_reg_fft_mask_to2_7_0 0xF512 ++#define reg_fft_mask_to2_7_0_pos 0 ++#define reg_fft_mask_to2_7_0_len 8 ++#define reg_fft_mask_to2_7_0_lsb 0 ++#define xd_p_reg_fft_mask_to2_12_8 (*(volatile byte xdata *) 0xF513) ++#define p_reg_fft_mask_to2_12_8 0xF513 ++#define reg_fft_mask_to2_12_8_pos 0 ++#define reg_fft_mask_to2_12_8_len 5 ++#define reg_fft_mask_to2_12_8_lsb 8 ++#define xd_p_reg_fft_mask_from3_7_0 (*(volatile byte xdata *) 0xF514) ++#define p_reg_fft_mask_from3_7_0 0xF514 ++#define reg_fft_mask_from3_7_0_pos 0 ++#define reg_fft_mask_from3_7_0_len 8 ++#define reg_fft_mask_from3_7_0_lsb 0 ++#define xd_p_reg_fft_mask_from3_12_8 (*(volatile byte xdata *) 0xF515) ++#define p_reg_fft_mask_from3_12_8 0xF515 ++#define reg_fft_mask_from3_12_8_pos 0 ++#define reg_fft_mask_from3_12_8_len 5 ++#define reg_fft_mask_from3_12_8_lsb 8 ++#define xd_p_reg_fft_mask_to3_7_0 (*(volatile byte xdata *) 0xF516) ++#define p_reg_fft_mask_to3_7_0 0xF516 ++#define reg_fft_mask_to3_7_0_pos 0 ++#define reg_fft_mask_to3_7_0_len 8 ++#define reg_fft_mask_to3_7_0_lsb 0 ++#define xd_p_reg_fft_mask_to3_12_8 (*(volatile byte xdata *) 0xF517) ++#define p_reg_fft_mask_to3_12_8 0xF517 ++#define reg_fft_mask_to3_12_8_pos 0 ++#define reg_fft_mask_to3_12_8_len 5 ++#define reg_fft_mask_to3_12_8_lsb 8 ++#define xd_r_fd_sntc_frame_num (*(volatile byte xdata *) 0xF518) ++#define r_fd_sntc_frame_num 0xF518 ++#define fd_sntc_frame_num_pos 0 ++#define fd_sntc_frame_num_len 2 ++#define fd_sntc_frame_num_lsb 0 ++#define xd_r_fd_sntc_symbol_count (*(volatile byte xdata *) 0xF519) ++#define r_fd_sntc_symbol_count 0xF519 ++#define fd_sntc_symbol_count_pos 0 ++#define fd_sntc_symbol_count_len 7 ++#define fd_sntc_symbol_count_lsb 0 ++#define xd_p_reg_sntc_cnt_lo (*(volatile byte xdata *) 0xF51A) ++#define p_reg_sntc_cnt_lo 0xF51A ++#define reg_sntc_cnt_lo_pos 0 ++#define reg_sntc_cnt_lo_len 8 ++#define reg_sntc_cnt_lo_lsb 0 ++#define xd_p_reg_sntc_cnt_hi (*(volatile byte xdata *) 0xF51B) ++#define p_reg_sntc_cnt_hi 0xF51B ++#define reg_sntc_cnt_hi_pos 0 ++#define reg_sntc_cnt_hi_len 7 ++#define reg_sntc_cnt_hi_lsb 0 ++#define xd_p_reg_sntc_fft_in (*(volatile byte xdata *) 0xF51C) ++#define p_reg_sntc_fft_in 0xF51C ++#define reg_sntc_fft_in_pos 0 ++#define reg_sntc_fft_in_len 1 ++#define reg_sntc_fft_in_lsb 0 ++#define xd_r_fd_sntc_en (*(volatile byte xdata *) 0xF51D) ++#define r_fd_sntc_en 0xF51D ++#define fd_sntc_en_pos 0 ++#define fd_sntc_en_len 1 ++#define fd_sntc_en_lsb 0 ++#define xd_p_reg_sntc_x2 (*(volatile byte xdata *) 0xF51E) ++#define p_reg_sntc_x2 0xF51E ++#define reg_sntc_x2_pos 0 ++#define reg_sntc_x2_len 1 ++#define reg_sntc_x2_lsb 0 ++#define xd_p_reg_cge_en_7_0 (*(volatile byte xdata *) 0xF51F) ++#define p_reg_cge_en_7_0 0xF51F ++#define reg_cge_en_7_0_pos 0 ++#define reg_cge_en_7_0_len 8 ++#define reg_cge_en_7_0_lsb 0 ++#define xd_p_reg_cge_en_15_8 (*(volatile byte xdata *) 0xF520) ++#define p_reg_cge_en_15_8 0xF520 ++#define reg_cge_en_15_8_pos 0 ++#define reg_cge_en_15_8_len 8 ++#define reg_cge_en_15_8_lsb 8 ++#define xd_p_reg_cge_en_23_16 (*(volatile byte xdata *) 0xF521) ++#define p_reg_cge_en_23_16 0xF521 ++#define reg_cge_en_23_16_pos 0 ++#define reg_cge_en_23_16_len 8 ++#define reg_cge_en_23_16_lsb 16 ++#define xd_p_reg_cge_en_31_24 (*(volatile byte xdata *) 0xF522) ++#define p_reg_cge_en_31_24 0xF522 ++#define reg_cge_en_31_24_pos 0 ++#define reg_cge_en_31_24_len 8 ++#define reg_cge_en_31_24_lsb 24 ++#define xd_p_reg_cge_en_39_32 (*(volatile byte xdata *) 0xF523) ++#define p_reg_cge_en_39_32 0xF523 ++#define reg_cge_en_39_32_pos 0 ++#define reg_cge_en_39_32_len 8 ++#define reg_cge_en_39_32_lsb 32 ++#define xd_p_reg_cge_en_43_40 (*(volatile byte xdata *) 0xF524) ++#define p_reg_cge_en_43_40 0xF524 ++#define reg_cge_en_43_40_pos 0 ++#define reg_cge_en_43_40_len 4 ++#define reg_cge_en_43_40_lsb 40 ++#define xd_p_reg_fft_sat_en (*(volatile byte xdata *) 0xF525) ++#define p_reg_fft_sat_en 0xF525 ++#define reg_fft_sat_en_pos 0 ++#define reg_fft_sat_en_len 1 ++#define reg_fft_sat_en_lsb 0 ++#define xd_p_reg_fft_sat_count_clr (*(volatile byte xdata *) 0xF526) ++#define p_reg_fft_sat_count_clr 0xF526 ++#define reg_fft_sat_count_clr_pos 0 ++#define reg_fft_sat_count_clr_len 1 ++#define reg_fft_sat_count_clr_lsb 0 ++#define xd_p_reg_fft_rescale_round (*(volatile byte xdata *) 0xF527) ++#define p_reg_fft_rescale_round 0xF527 ++#define reg_fft_rescale_round_pos 0 ++#define reg_fft_rescale_round_len 1 ++#define reg_fft_rescale_round_lsb 0 ++#define xd_r_reg_fft_sat_count_12_7_0 (*(volatile byte xdata *) 0xF528) ++#define r_reg_fft_sat_count_12_7_0 0xF528 ++#define reg_fft_sat_count_12_7_0_pos 0 ++#define reg_fft_sat_count_12_7_0_len 8 ++#define reg_fft_sat_count_12_7_0_lsb 0 ++#define xd_r_reg_fft_sat_count_12_15_8 (*(volatile byte xdata *) 0xF529) ++#define r_reg_fft_sat_count_12_15_8 0xF529 ++#define reg_fft_sat_count_12_15_8_pos 0 ++#define reg_fft_sat_count_12_15_8_len 8 ++#define reg_fft_sat_count_12_15_8_lsb 8 ++#define xd_r_reg_fft_sat_count_10_7_0 (*(volatile byte xdata *) 0xF52A) ++#define r_reg_fft_sat_count_10_7_0 0xF52A ++#define reg_fft_sat_count_10_7_0_pos 0 ++#define reg_fft_sat_count_10_7_0_len 8 ++#define reg_fft_sat_count_10_7_0_lsb 0 ++#define xd_r_reg_fft_sat_count_10_15_8 (*(volatile byte xdata *) 0xF52B) ++#define r_reg_fft_sat_count_10_15_8 0xF52B ++#define reg_fft_sat_count_10_15_8_pos 0 ++#define reg_fft_sat_count_10_15_8_len 8 ++#define reg_fft_sat_count_10_15_8_lsb 8 ++#define xd_p_reg_fft_capture_idx_7_0 (*(volatile byte xdata *) 0xF52C) ++#define p_reg_fft_capture_idx_7_0 0xF52C ++#define reg_fft_capture_idx_7_0_pos 0 ++#define reg_fft_capture_idx_7_0_len 8 ++#define reg_fft_capture_idx_7_0_lsb 0 ++#define xd_p_reg_fft_capture_idx_12_8 (*(volatile byte xdata *) 0xF52D) ++#define p_reg_fft_capture_idx_12_8 0xF52D ++#define reg_fft_capture_idx_12_8_pos 0 ++#define reg_fft_capture_idx_12_8_len 5 ++#define reg_fft_capture_idx_12_8_lsb 8 ++#define xd_p_reg_fft_capture (*(volatile byte xdata *) 0xF52E) ++#define p_reg_fft_capture 0xF52E ++#define reg_fft_capture_pos 0 ++#define reg_fft_capture_len 1 ++#define reg_fft_capture_lsb 0 ++#define xd_p_reg_gp_trigger_fd (*(volatile byte xdata *) 0xF52F) ++#define p_reg_gp_trigger_fd 0xF52F ++#define reg_gp_trigger_fd_pos 0 ++#define reg_gp_trigger_fd_len 1 ++#define reg_gp_trigger_fd_lsb 0 ++#define xd_p_reg_trigger_sel_fd (*(volatile byte xdata *) 0xF530) ++#define p_reg_trigger_sel_fd 0xF530 ++#define reg_trigger_sel_fd_pos 0 ++#define reg_trigger_sel_fd_len 2 ++#define reg_trigger_sel_fd_lsb 0 ++#define xd_p_reg_trigger_module_sel_fd (*(volatile byte xdata *) 0xF531) ++#define p_reg_trigger_module_sel_fd 0xF531 ++#define reg_trigger_module_sel_fd_pos 0 ++#define reg_trigger_module_sel_fd_len 6 ++#define reg_trigger_module_sel_fd_lsb 0 ++#define xd_p_reg_trigger_set_sel_fd (*(volatile byte xdata *) 0xF532) ++#define p_reg_trigger_set_sel_fd 0xF532 ++#define reg_trigger_set_sel_fd_pos 0 ++#define reg_trigger_set_sel_fd_len 6 ++#define reg_trigger_set_sel_fd_lsb 0 ++#define xd_r_reg_fft_idx_pre_max_7_0 (*(volatile byte xdata *) 0xF533) ++#define r_reg_fft_idx_pre_max_7_0 0xF533 ++#define reg_fft_idx_pre_max_7_0_pos 0 ++#define reg_fft_idx_pre_max_7_0_len 8 ++#define reg_fft_idx_pre_max_7_0_lsb 0 ++#define xd_r_reg_fft_idx_pre_max_12_8 (*(volatile byte xdata *) 0xF534) ++#define r_reg_fft_idx_pre_max_12_8 0xF534 ++#define reg_fft_idx_pre_max_12_8_pos 0 ++#define reg_fft_idx_pre_max_12_8_len 5 ++#define reg_fft_idx_pre_max_12_8_lsb 8 ++#define xd_r_reg_fft_crc (*(volatile byte xdata *) 0xF535) ++#define r_reg_fft_crc 0xF535 ++#define reg_fft_crc_pos 0 ++#define reg_fft_crc_len 8 ++#define reg_fft_crc_lsb 0 ++#define xd_p_fd_fft_shift_max (*(volatile byte xdata *) 0xF536) ++#define p_fd_fft_shift_max 0xF536 ++#define fd_fft_shift_max_pos 0 ++#define fd_fft_shift_max_len 4 ++#define fd_fft_shift_max_lsb 0 ++#define xd_p_fd_fft_frame_num (*(volatile byte xdata *) 0xF537) ++#define p_fd_fft_frame_num 0xF537 ++#define fd_fft_frame_num_pos 0 ++#define fd_fft_frame_num_len 2 ++#define fd_fft_frame_num_lsb 0 ++#define xd_p_fd_fft_symbol_count (*(volatile byte xdata *) 0xF538) ++#define p_fd_fft_symbol_count 0xF538 ++#define fd_fft_symbol_count_pos 0 ++#define fd_fft_symbol_count_len 7 ++#define fd_fft_symbol_count_lsb 0 ++#define xd_r_reg_fft_idx_max_7_0 (*(volatile byte xdata *) 0xF539) ++#define r_reg_fft_idx_max_7_0 0xF539 ++#define reg_fft_idx_max_7_0_pos 0 ++#define reg_fft_idx_max_7_0_len 8 ++#define reg_fft_idx_max_7_0_lsb 0 ++#define xd_r_reg_fft_idx_max_12_8 (*(volatile byte xdata *) 0xF53A) ++#define r_reg_fft_idx_max_12_8 0xF53A ++#define reg_fft_idx_max_12_8_pos 0 ++#define reg_fft_idx_max_12_8_len 5 ++#define reg_fft_idx_max_12_8_lsb 8 ++#define xd_p_reg_fft_rotate_en (*(volatile byte xdata *) 0xF53B) ++#define p_reg_fft_rotate_en 0xF53B ++#define reg_fft_rotate_en_pos 0 ++#define reg_fft_rotate_en_len 1 ++#define reg_fft_rotate_en_lsb 0 ++#define xd_p_reg_fft_rotate_base_7_0 (*(volatile byte xdata *) 0xF53C) ++#define p_reg_fft_rotate_base_7_0 0xF53C ++#define reg_fft_rotate_base_7_0_pos 0 ++#define reg_fft_rotate_base_7_0_len 8 ++#define reg_fft_rotate_base_7_0_lsb 0 ++#define xd_p_reg_fft_rotate_base_12_8 (*(volatile byte xdata *) 0xF53D) ++#define p_reg_fft_rotate_base_12_8 0xF53D ++#define reg_fft_rotate_base_12_8_pos 0 ++#define reg_fft_rotate_base_12_8_len 5 ++#define reg_fft_rotate_base_12_8_lsb 8 ++#define xd_r_fd_fpcc_cp_corr_signn (*(volatile byte xdata *) 0xF53E) ++#define r_fd_fpcc_cp_corr_signn 0xF53E ++#define fd_fpcc_cp_corr_signn_pos 0 ++#define fd_fpcc_cp_corr_signn_len 8 ++#define fd_fpcc_cp_corr_signn_lsb 0 ++#define xd_p_reg_feq_s1 (*(volatile byte xdata *) 0xF53F) ++#define p_reg_feq_s1 0xF53F ++#define reg_feq_s1_pos 0 ++#define reg_feq_s1_len 5 ++#define reg_feq_s1_lsb 0 ++#define xd_p_reg_feq_sat_ind (*(volatile byte xdata *) 0xF540) ++#define p_reg_feq_sat_ind 0xF540 ++#define reg_feq_sat_ind_pos 0 ++#define reg_feq_sat_ind_len 3 ++#define reg_feq_sat_ind_lsb 0 ++#define xd_p_reg_p_csi_cal_en (*(volatile byte xdata *) 0xF541) ++#define p_reg_p_csi_cal_en 0xF541 ++#define reg_p_csi_cal_en_pos 0 ++#define reg_p_csi_cal_en_len 1 ++#define reg_p_csi_cal_en_lsb 0 ++#define xd_p_reg_p_csi_ar_mode (*(volatile byte xdata *) 0xF542) ++#define p_reg_p_csi_ar_mode 0xF542 ++#define reg_p_csi_ar_mode_pos 0 ++#define reg_p_csi_ar_mode_len 2 ++#define reg_p_csi_ar_mode_lsb 0 ++#define xd_p_reg_p_csi_accu_sym_num (*(volatile byte xdata *) 0xF543) ++#define p_reg_p_csi_accu_sym_num 0xF543 ++#define reg_p_csi_accu_sym_num_pos 0 ++#define reg_p_csi_accu_sym_num_len 8 ++#define reg_p_csi_accu_sym_num_lsb 0 ++#define xd_p_reg_p_csi_eh2_shift_thr (*(volatile byte xdata *) 0xF544) ++#define p_reg_p_csi_eh2_shift_thr 0xF544 ++#define reg_p_csi_eh2_shift_thr_pos 0 ++#define reg_p_csi_eh2_shift_thr_len 4 ++#define reg_p_csi_eh2_shift_thr_lsb 0 ++#define xd_p_reg_p_feq_protect_eh2_shift_thr (*(volatile byte xdata *) 0xF545) ++#define p_reg_p_feq_protect_eh2_shift_thr 0xF545 ++#define reg_p_feq_protect_eh2_shift_thr_pos 0 ++#define reg_p_feq_protect_eh2_shift_thr_len 4 ++#define reg_p_feq_protect_eh2_shift_thr_lsb 0 ++#define xd_p_reg_p_csi_error_accu_s1 (*(volatile byte xdata *) 0xF546) ++#define p_reg_p_csi_error_accu_s1 0xF546 ++#define reg_p_csi_error_accu_s1_pos 0 ++#define reg_p_csi_error_accu_s1_len 6 ++#define reg_p_csi_error_accu_s1_lsb 0 ++#define xd_p_reg_p_csi_shift2 (*(volatile byte xdata *) 0xF547) ++#define p_reg_p_csi_shift2 0xF547 ++#define reg_p_csi_shift2_pos 0 ++#define reg_p_csi_shift2_len 4 ++#define reg_p_csi_shift2_lsb 0 ++#define xd_p_reg_p_csi_mul2 (*(volatile byte xdata *) 0xF548) ++#define p_reg_p_csi_mul2 0xF548 ++#define reg_p_csi_mul2_pos 0 ++#define reg_p_csi_mul2_len 8 ++#define reg_p_csi_mul2_lsb 0 ++#define xd_p_reg_p_csi_level2_7_0 (*(volatile byte xdata *) 0xF549) ++#define p_reg_p_csi_level2_7_0 0xF549 ++#define reg_p_csi_level2_7_0_pos 0 ++#define reg_p_csi_level2_7_0_len 8 ++#define reg_p_csi_level2_7_0_lsb 0 ++#define xd_p_reg_p_csi_level2_8 (*(volatile byte xdata *) 0xF54A) ++#define p_reg_p_csi_level2_8 0xF54A ++#define reg_p_csi_level2_8_pos 0 ++#define reg_p_csi_level2_8_len 1 ++#define reg_p_csi_level2_8_lsb 8 ++#define xd_p_reg_p_feq_protect_ratio (*(volatile byte xdata *) 0xF54B) ++#define p_reg_p_feq_protect_ratio 0xF54B ++#define reg_p_feq_protect_ratio_pos 0 ++#define reg_p_feq_protect_ratio_len 8 ++#define reg_p_feq_protect_ratio_lsb 0 ++#define xd_r_reg_csi_rdy (*(volatile byte xdata *) 0xF54C) ++#define r_reg_csi_rdy 0xF54C ++#define reg_csi_rdy_pos 0 ++#define reg_csi_rdy_len 1 ++#define reg_csi_rdy_lsb 0 ++#define xd_p_reg_p_feq_h2protect_en (*(volatile byte xdata *) 0xF54D) ++#define p_reg_p_feq_h2protect_en 0xF54D ++#define reg_p_feq_h2protect_en_pos 0 ++#define reg_p_feq_h2protect_en_len 1 ++#define reg_p_feq_h2protect_en_lsb 0 ++#define xd_r_reg_tpsd_lock_f0 (*(volatile byte xdata *) 0xF54E) ++#define r_reg_tpsd_lock_f0 0xF54E ++#define reg_tpsd_lock_f0_pos 0 ++#define reg_tpsd_lock_f0_len 1 ++#define reg_tpsd_lock_f0_lsb 0 ++#define xd_r_reg_tpsd_lock_f1 (*(volatile byte xdata *) 0xF54F) ++#define r_reg_tpsd_lock_f1 0xF54F ++#define reg_tpsd_lock_f1_pos 0 ++#define reg_tpsd_lock_f1_len 1 ++#define reg_tpsd_lock_f1_lsb 0 ++#define xd_p_reg_p_csi_sp_idx_7_0 (*(volatile byte xdata *) 0xF550) ++#define p_reg_p_csi_sp_idx_7_0 0xF550 ++#define reg_p_csi_sp_idx_7_0_pos 0 ++#define reg_p_csi_sp_idx_7_0_len 8 ++#define reg_p_csi_sp_idx_7_0_lsb 0 ++#define xd_p_reg_p_csi_sp_idx_11_8 (*(volatile byte xdata *) 0xF551) ++#define p_reg_p_csi_sp_idx_11_8 0xF551 ++#define reg_p_csi_sp_idx_11_8_pos 0 ++#define reg_p_csi_sp_idx_11_8_len 4 ++#define reg_p_csi_sp_idx_11_8_lsb 8 ++#define xd_p_fd_fpcc_cp_corr_tone_th (*(volatile byte xdata *) 0xF552) ++#define p_fd_fpcc_cp_corr_tone_th 0xF552 ++#define fd_fpcc_cp_corr_tone_th_pos 0 ++#define fd_fpcc_cp_corr_tone_th_len 6 ++#define fd_fpcc_cp_corr_tone_th_lsb 0 ++#define xd_p_fd_fpcc_cp_corr_symbol_log_th (*(volatile byte xdata *) 0xF553) ++#define p_fd_fpcc_cp_corr_symbol_log_th 0xF553 ++#define fd_fpcc_cp_corr_symbol_log_th_pos 0 ++#define fd_fpcc_cp_corr_symbol_log_th_len 4 ++#define fd_fpcc_cp_corr_symbol_log_th_lsb 0 ++#define xd_p_fd_fpcc_cp_corr_int (*(volatile byte xdata *) 0xF554) ++#define p_fd_fpcc_cp_corr_int 0xF554 ++#define fd_fpcc_cp_corr_int_pos 0 ++#define fd_fpcc_cp_corr_int_len 1 ++#define fd_fpcc_cp_corr_int_lsb 0 ++#define xd_p_reg_fpcc_cp_memidx (*(volatile byte xdata *) 0xF555) ++#define p_reg_fpcc_cp_memidx 0xF555 ++#define reg_fpcc_cp_memidx_pos 0 ++#define reg_fpcc_cp_memidx_len 8 ++#define reg_fpcc_cp_memidx_lsb 0 ++#define xd_p_reg_fpcc_cpmask_en (*(volatile byte xdata *) 0xF556) ++#define p_reg_fpcc_cpmask_en 0xF556 ++#define reg_fpcc_cpmask_en_pos 0 ++#define reg_fpcc_cpmask_en_len 1 ++#define reg_fpcc_cpmask_en_lsb 0 ++#define xd_p_reg_fpcc_cp_grpidx (*(volatile byte xdata *) 0xF557) ++#define p_reg_fpcc_cp_grpidx 0xF557 ++#define reg_fpcc_cp_grpidx_pos 0 ++#define reg_fpcc_cp_grpidx_len 5 ++#define reg_fpcc_cp_grpidx_lsb 0 ++#define xd_r_reg_fpcc_cp_sts (*(volatile byte xdata *) 0xF558) ++#define r_reg_fpcc_cp_sts 0xF558 ++#define reg_fpcc_cp_sts_pos 0 ++#define reg_fpcc_cp_sts_len 1 ++#define reg_fpcc_cp_sts_lsb 0 ++#define xd_p_reg_sfoe_ns_7_0 (*(volatile byte xdata *) 0xF559) ++#define p_reg_sfoe_ns_7_0 0xF559 ++#define reg_sfoe_ns_7_0_pos 0 ++#define reg_sfoe_ns_7_0_len 8 ++#define reg_sfoe_ns_7_0_lsb 0 ++#define xd_p_reg_sfoe_ns_14_8 (*(volatile byte xdata *) 0xF55A) ++#define p_reg_sfoe_ns_14_8 0xF55A ++#define reg_sfoe_ns_14_8_pos 0 ++#define reg_sfoe_ns_14_8_len 7 ++#define reg_sfoe_ns_14_8_lsb 8 ++#define xd_p_reg_sfoe_c1_7_0 (*(volatile byte xdata *) 0xF55B) ++#define p_reg_sfoe_c1_7_0 0xF55B ++#define reg_sfoe_c1_7_0_pos 0 ++#define reg_sfoe_c1_7_0_len 8 ++#define reg_sfoe_c1_7_0_lsb 0 ++#define xd_p_reg_sfoe_c1_9_8 (*(volatile byte xdata *) 0xF55C) ++#define p_reg_sfoe_c1_9_8 0xF55C ++#define reg_sfoe_c1_9_8_pos 0 ++#define reg_sfoe_c1_9_8_len 2 ++#define reg_sfoe_c1_9_8_lsb 8 ++#define xd_p_reg_sfoe_c2_7_0 (*(volatile byte xdata *) 0xF55D) ++#define p_reg_sfoe_c2_7_0 0xF55D ++#define reg_sfoe_c2_7_0_pos 0 ++#define reg_sfoe_c2_7_0_len 8 ++#define reg_sfoe_c2_7_0_lsb 0 ++#define xd_p_reg_sfoe_c2_9_8 (*(volatile byte xdata *) 0xF55E) ++#define p_reg_sfoe_c2_9_8 0xF55E ++#define reg_sfoe_c2_9_8_pos 0 ++#define reg_sfoe_c2_9_8_len 2 ++#define reg_sfoe_c2_9_8_lsb 8 ++#define xd_p_reg_sfoe_lm_counter_th (*(volatile byte xdata *) 0xF55F) ++#define p_reg_sfoe_lm_counter_th 0xF55F ++#define reg_sfoe_lm_counter_th_pos 0 ++#define reg_sfoe_lm_counter_th_len 4 ++#define reg_sfoe_lm_counter_th_lsb 0 ++#define xd_p_reg_sfoe_spec_inv (*(volatile byte xdata *) 0xF560) ++#define p_reg_sfoe_spec_inv 0xF560 ++#define reg_sfoe_spec_inv_pos 0 ++#define reg_sfoe_spec_inv_len 1 ++#define reg_sfoe_spec_inv_lsb 0 ++#define xd_p_reg_sfoe_convg_th (*(volatile byte xdata *) 0xF561) ++#define p_reg_sfoe_convg_th 0xF561 ++#define reg_sfoe_convg_th_pos 0 ++#define reg_sfoe_convg_th_len 8 ++#define reg_sfoe_convg_th_lsb 0 ++#define xd_p_reg_sfoe_divg_th (*(volatile byte xdata *) 0xF562) ++#define p_reg_sfoe_divg_th 0xF562 ++#define reg_sfoe_divg_th_pos 0 ++#define reg_sfoe_divg_th_len 8 ++#define reg_sfoe_divg_th_lsb 0 ++#define xd_p_reg_sfoe_pullin_ctr_th (*(volatile byte xdata *) 0xF563) ++#define p_reg_sfoe_pullin_ctr_th 0xF563 ++#define reg_sfoe_pullin_ctr_th_pos 0 ++#define reg_sfoe_pullin_ctr_th_len 4 ++#define reg_sfoe_pullin_ctr_th_lsb 0 ++#define xd_p_reg_sfoe_sf_ctr_th (*(volatile byte xdata *) 0xF564) ++#define p_reg_sfoe_sf_ctr_th 0xF564 ++#define reg_sfoe_sf_ctr_th_pos 0 ++#define reg_sfoe_sf_ctr_th_len 4 ++#define reg_sfoe_sf_ctr_th_lsb 0 ++#define xd_p_reg_sfoe_pullin_th (*(volatile byte xdata *) 0xF565) ++#define p_reg_sfoe_pullin_th 0xF565 ++#define reg_sfoe_pullin_th_pos 0 ++#define reg_sfoe_pullin_th_len 8 ++#define reg_sfoe_pullin_th_lsb 0 ++#define xd_p_reg_sfoe_kalman_cnt (*(volatile byte xdata *) 0xF566) ++#define p_reg_sfoe_kalman_cnt 0xF566 ++#define reg_sfoe_kalman_cnt_pos 0 ++#define reg_sfoe_kalman_cnt_len 4 ++#define reg_sfoe_kalman_cnt_lsb 0 ++#define xd_p_reg_sfoe_fsm_info (*(volatile byte xdata *) 0xF567) ++#define p_reg_sfoe_fsm_info 0xF567 ++#define reg_sfoe_fsm_info_pos 0 ++#define reg_sfoe_fsm_info_len 4 ++#define reg_sfoe_fsm_info_lsb 0 ++#define xd_r_reg_sfoe_pullin_cnt (*(volatile byte xdata *) 0xF568) ++#define r_reg_sfoe_pullin_cnt 0xF568 ++#define reg_sfoe_pullin_cnt_pos 0 ++#define reg_sfoe_pullin_cnt_len 4 ++#define reg_sfoe_pullin_cnt_lsb 0 ++#define xd_r_reg_sfoe_sf_cnt (*(volatile byte xdata *) 0xF569) ++#define r_reg_sfoe_sf_cnt 0xF569 ++#define reg_sfoe_sf_cnt_pos 0 ++#define reg_sfoe_sf_cnt_len 4 ++#define reg_sfoe_sf_cnt_lsb 0 ++#define xd_p_reg_fste_phase_ini_7_0 (*(volatile byte xdata *) 0xF56A) ++#define p_reg_fste_phase_ini_7_0 0xF56A ++#define reg_fste_phase_ini_7_0_pos 0 ++#define reg_fste_phase_ini_7_0_len 8 ++#define reg_fste_phase_ini_7_0_lsb 0 ++#define xd_p_reg_fste_phase_ini_11_8 (*(volatile byte xdata *) 0xF56B) ++#define p_reg_fste_phase_ini_11_8 0xF56B ++#define reg_fste_phase_ini_11_8_pos 0 ++#define reg_fste_phase_ini_11_8_len 4 ++#define reg_fste_phase_ini_11_8_lsb 8 ++#define xd_p_reg_fste_phase_inc_7_0 (*(volatile byte xdata *) 0xF56C) ++#define p_reg_fste_phase_inc_7_0 0xF56C ++#define reg_fste_phase_inc_7_0_pos 0 ++#define reg_fste_phase_inc_7_0_len 8 ++#define reg_fste_phase_inc_7_0_lsb 0 ++#define xd_p_reg_fste_phase_inc_11_8 (*(volatile byte xdata *) 0xF56D) ++#define p_reg_fste_phase_inc_11_8 0xF56D ++#define reg_fste_phase_inc_11_8_pos 0 ++#define reg_fste_phase_inc_11_8_len 4 ++#define reg_fste_phase_inc_11_8_lsb 8 ++#define xd_p_reg_fste_acum_cost_cnt_max (*(volatile byte xdata *) 0xF56E) ++#define p_reg_fste_acum_cost_cnt_max 0xF56E ++#define reg_fste_acum_cost_cnt_max_pos 0 ++#define reg_fste_acum_cost_cnt_max_len 4 ++#define reg_fste_acum_cost_cnt_max_lsb 0 ++#define xd_p_reg_fste_step_size_std (*(volatile byte xdata *) 0xF56F) ++#define p_reg_fste_step_size_std 0xF56F ++#define reg_fste_step_size_std_pos 0 ++#define reg_fste_step_size_std_len 4 ++#define reg_fste_step_size_std_lsb 0 ++#define xd_p_reg_fste_step_size_max (*(volatile byte xdata *) 0xF570) ++#define p_reg_fste_step_size_max 0xF570 ++#define reg_fste_step_size_max_pos 0 ++#define reg_fste_step_size_max_len 4 ++#define reg_fste_step_size_max_lsb 0 ++#define xd_p_reg_fste_rpd_dir_cnt_max (*(volatile byte xdata *) 0xF571) ++#define p_reg_fste_rpd_dir_cnt_max 0xF571 ++#define reg_fste_rpd_dir_cnt_max_pos 0 ++#define reg_fste_rpd_dir_cnt_max_len 4 ++#define reg_fste_rpd_dir_cnt_max_lsb 0 ++#define xd_p_reg_fste_frac_cost_cnt_max_7_0 (*(volatile byte xdata *) 0xF572) ++#define p_reg_fste_frac_cost_cnt_max_7_0 0xF572 ++#define reg_fste_frac_cost_cnt_max_7_0_pos 0 ++#define reg_fste_frac_cost_cnt_max_7_0_len 8 ++#define reg_fste_frac_cost_cnt_max_7_0_lsb 0 ++#define xd_p_reg_fste_frac_cost_cnt_max_9_8 (*(volatile byte xdata *) 0xF573) ++#define p_reg_fste_frac_cost_cnt_max_9_8 0xF573 ++#define reg_fste_frac_cost_cnt_max_9_8_pos 0 ++#define reg_fste_frac_cost_cnt_max_9_8_len 2 ++#define reg_fste_frac_cost_cnt_max_9_8_lsb 8 ++#define xd_p_reg_fste_isLongWeakTail (*(volatile byte xdata *) 0xF574) ++#define p_reg_fste_isLongWeakTail 0xF574 ++#define reg_fste_isLongWeakTail_pos 0 ++#define reg_fste_isLongWeakTail_len 1 ++#define reg_fste_isLongWeakTail_lsb 0 ++#define xd_p_reg_fste_isLongWeakHead (*(volatile byte xdata *) 0xF575) ++#define p_reg_fste_isLongWeakHead 0xF575 ++#define reg_fste_isLongWeakHead_pos 0 ++#define reg_fste_isLongWeakHead_len 1 ++#define reg_fste_isLongWeakHead_lsb 0 ++#define xd_p_reg_fste_w0_7_0 (*(volatile byte xdata *) 0xF576) ++#define p_reg_fste_w0_7_0 0xF576 ++#define reg_fste_w0_7_0_pos 0 ++#define reg_fste_w0_7_0_len 8 ++#define reg_fste_w0_7_0_lsb 0 ++#define xd_p_reg_fste_w0_9_8 (*(volatile byte xdata *) 0xF577) ++#define p_reg_fste_w0_9_8 0xF577 ++#define reg_fste_w0_9_8_pos 0 ++#define reg_fste_w0_9_8_len 2 ++#define reg_fste_w0_9_8_lsb 8 ++#define xd_p_reg_fste_w1_7_0 (*(volatile byte xdata *) 0xF578) ++#define p_reg_fste_w1_7_0 0xF578 ++#define reg_fste_w1_7_0_pos 0 ++#define reg_fste_w1_7_0_len 8 ++#define reg_fste_w1_7_0_lsb 0 ++#define xd_p_reg_fste_w1_9_8 (*(volatile byte xdata *) 0xF579) ++#define p_reg_fste_w1_9_8 0xF579 ++#define reg_fste_w1_9_8_pos 0 ++#define reg_fste_w1_9_8_len 2 ++#define reg_fste_w1_9_8_lsb 8 ++#define xd_p_reg_fste_w2_7_0 (*(volatile byte xdata *) 0xF57A) ++#define p_reg_fste_w2_7_0 0xF57A ++#define reg_fste_w2_7_0_pos 0 ++#define reg_fste_w2_7_0_len 8 ++#define reg_fste_w2_7_0_lsb 0 ++#define xd_p_reg_fste_w2_9_8 (*(volatile byte xdata *) 0xF57B) ++#define p_reg_fste_w2_9_8 0xF57B ++#define reg_fste_w2_9_8_pos 0 ++#define reg_fste_w2_9_8_len 2 ++#define reg_fste_w2_9_8_lsb 8 ++#define xd_p_reg_fste_w3_7_0 (*(volatile byte xdata *) 0xF57C) ++#define p_reg_fste_w3_7_0 0xF57C ++#define reg_fste_w3_7_0_pos 0 ++#define reg_fste_w3_7_0_len 8 ++#define reg_fste_w3_7_0_lsb 0 ++#define xd_p_reg_fste_w3_9_8 (*(volatile byte xdata *) 0xF57D) ++#define p_reg_fste_w3_9_8 0xF57D ++#define reg_fste_w3_9_8_pos 0 ++#define reg_fste_w3_9_8_len 2 ++#define reg_fste_w3_9_8_lsb 8 ++#define xd_p_reg_fste_w4_7_0 (*(volatile byte xdata *) 0xF57E) ++#define p_reg_fste_w4_7_0 0xF57E ++#define reg_fste_w4_7_0_pos 0 ++#define reg_fste_w4_7_0_len 8 ++#define reg_fste_w4_7_0_lsb 0 ++#define xd_p_reg_fste_w4_9_8 (*(volatile byte xdata *) 0xF57F) ++#define p_reg_fste_w4_9_8 0xF57F ++#define reg_fste_w4_9_8_pos 0 ++#define reg_fste_w4_9_8_len 2 ++#define reg_fste_w4_9_8_lsb 8 ++#define xd_p_reg_fste_w5_7_0 (*(volatile byte xdata *) 0xF580) ++#define p_reg_fste_w5_7_0 0xF580 ++#define reg_fste_w5_7_0_pos 0 ++#define reg_fste_w5_7_0_len 8 ++#define reg_fste_w5_7_0_lsb 0 ++#define xd_p_reg_fste_w5_9_8 (*(volatile byte xdata *) 0xF581) ++#define p_reg_fste_w5_9_8 0xF581 ++#define reg_fste_w5_9_8_pos 0 ++#define reg_fste_w5_9_8_len 2 ++#define reg_fste_w5_9_8_lsb 8 ++#define xd_p_reg_fste_w6_7_0 (*(volatile byte xdata *) 0xF582) ++#define p_reg_fste_w6_7_0 0xF582 ++#define reg_fste_w6_7_0_pos 0 ++#define reg_fste_w6_7_0_len 8 ++#define reg_fste_w6_7_0_lsb 0 ++#define xd_p_reg_fste_w6_9_8 (*(volatile byte xdata *) 0xF583) ++#define p_reg_fste_w6_9_8 0xF583 ++#define reg_fste_w6_9_8_pos 0 ++#define reg_fste_w6_9_8_len 2 ++#define reg_fste_w6_9_8_lsb 8 ++#define xd_p_reg_fste_w7_7_0 (*(volatile byte xdata *) 0xF584) ++#define p_reg_fste_w7_7_0 0xF584 ++#define reg_fste_w7_7_0_pos 0 ++#define reg_fste_w7_7_0_len 8 ++#define reg_fste_w7_7_0_lsb 0 ++#define xd_p_reg_fste_w7_9_8 (*(volatile byte xdata *) 0xF585) ++#define p_reg_fste_w7_9_8 0xF585 ++#define reg_fste_w7_9_8_pos 0 ++#define reg_fste_w7_9_8_len 2 ++#define reg_fste_w7_9_8_lsb 8 ++#define xd_p_reg_fste_w8_7_0 (*(volatile byte xdata *) 0xF586) ++#define p_reg_fste_w8_7_0 0xF586 ++#define reg_fste_w8_7_0_pos 0 ++#define reg_fste_w8_7_0_len 8 ++#define reg_fste_w8_7_0_lsb 0 ++#define xd_p_reg_fste_w8_9_8 (*(volatile byte xdata *) 0xF587) ++#define p_reg_fste_w8_9_8 0xF587 ++#define reg_fste_w8_9_8_pos 0 ++#define reg_fste_w8_9_8_len 2 ++#define reg_fste_w8_9_8_lsb 8 ++#define xd_p_reg_fste_w9_7_0 (*(volatile byte xdata *) 0xF588) ++#define p_reg_fste_w9_7_0 0xF588 ++#define reg_fste_w9_7_0_pos 0 ++#define reg_fste_w9_7_0_len 8 ++#define reg_fste_w9_7_0_lsb 0 ++#define xd_p_reg_fste_w9_9_8 (*(volatile byte xdata *) 0xF589) ++#define p_reg_fste_w9_9_8 0xF589 ++#define reg_fste_w9_9_8_pos 0 ++#define reg_fste_w9_9_8_len 2 ++#define reg_fste_w9_9_8_lsb 8 ++#define xd_p_reg_fste_wa_7_0 (*(volatile byte xdata *) 0xF58A) ++#define p_reg_fste_wa_7_0 0xF58A ++#define reg_fste_wa_7_0_pos 0 ++#define reg_fste_wa_7_0_len 8 ++#define reg_fste_wa_7_0_lsb 0 ++#define xd_p_reg_fste_wa_9_8 (*(volatile byte xdata *) 0xF58B) ++#define p_reg_fste_wa_9_8 0xF58B ++#define reg_fste_wa_9_8_pos 0 ++#define reg_fste_wa_9_8_len 2 ++#define reg_fste_wa_9_8_lsb 8 ++#define xd_p_reg_fste_wb_7_0 (*(volatile byte xdata *) 0xF58C) ++#define p_reg_fste_wb_7_0 0xF58C ++#define reg_fste_wb_7_0_pos 0 ++#define reg_fste_wb_7_0_len 8 ++#define reg_fste_wb_7_0_lsb 0 ++#define xd_p_reg_fste_wb_9_8 (*(volatile byte xdata *) 0xF58D) ++#define p_reg_fste_wb_9_8 0xF58D ++#define reg_fste_wb_9_8_pos 0 ++#define reg_fste_wb_9_8_len 2 ++#define reg_fste_wb_9_8_lsb 8 ++#define xd_p_reg_fste_wc_7_0 (*(volatile byte xdata *) 0xF58E) ++#define p_reg_fste_wc_7_0 0xF58E ++#define reg_fste_wc_7_0_pos 0 ++#define reg_fste_wc_7_0_len 8 ++#define reg_fste_wc_7_0_lsb 0 ++#define xd_p_reg_fste_wc_9_8 (*(volatile byte xdata *) 0xF58F) ++#define p_reg_fste_wc_9_8 0xF58F ++#define reg_fste_wc_9_8_pos 0 ++#define reg_fste_wc_9_8_len 2 ++#define reg_fste_wc_9_8_lsb 8 ++#define xd_p_reg_fste_wd_7_0 (*(volatile byte xdata *) 0xF590) ++#define p_reg_fste_wd_7_0 0xF590 ++#define reg_fste_wd_7_0_pos 0 ++#define reg_fste_wd_7_0_len 8 ++#define reg_fste_wd_7_0_lsb 0 ++#define xd_p_reg_fste_wd_9_8 (*(volatile byte xdata *) 0xF591) ++#define p_reg_fste_wd_9_8 0xF591 ++#define reg_fste_wd_9_8_pos 0 ++#define reg_fste_wd_9_8_len 2 ++#define reg_fste_wd_9_8_lsb 8 ++#define xd_p_reg_fste_we_7_0 (*(volatile byte xdata *) 0xF592) ++#define p_reg_fste_we_7_0 0xF592 ++#define reg_fste_we_7_0_pos 0 ++#define reg_fste_we_7_0_len 8 ++#define reg_fste_we_7_0_lsb 0 ++#define xd_p_reg_fste_we_9_8 (*(volatile byte xdata *) 0xF593) ++#define p_reg_fste_we_9_8 0xF593 ++#define reg_fste_we_9_8_pos 0 ++#define reg_fste_we_9_8_len 2 ++#define reg_fste_we_9_8_lsb 8 ++#define xd_p_reg_fste_wf_7_0 (*(volatile byte xdata *) 0xF594) ++#define p_reg_fste_wf_7_0 0xF594 ++#define reg_fste_wf_7_0_pos 0 ++#define reg_fste_wf_7_0_len 8 ++#define reg_fste_wf_7_0_lsb 0 ++#define xd_p_reg_fste_wf_9_8 (*(volatile byte xdata *) 0xF595) ++#define p_reg_fste_wf_9_8 0xF595 ++#define reg_fste_wf_9_8_pos 0 ++#define reg_fste_wf_9_8_len 2 ++#define reg_fste_wf_9_8_lsb 8 ++#define xd_p_reg_fste_wg_7_0 (*(volatile byte xdata *) 0xF596) ++#define p_reg_fste_wg_7_0 0xF596 ++#define reg_fste_wg_7_0_pos 0 ++#define reg_fste_wg_7_0_len 8 ++#define reg_fste_wg_7_0_lsb 0 ++#define xd_p_reg_fste_wg_9_8 (*(volatile byte xdata *) 0xF597) ++#define p_reg_fste_wg_9_8 0xF597 ++#define reg_fste_wg_9_8_pos 0 ++#define reg_fste_wg_9_8_len 2 ++#define reg_fste_wg_9_8_lsb 8 ++#define xd_p_reg_fste_wh_7_0 (*(volatile byte xdata *) 0xF598) ++#define p_reg_fste_wh_7_0 0xF598 ++#define reg_fste_wh_7_0_pos 0 ++#define reg_fste_wh_7_0_len 8 ++#define reg_fste_wh_7_0_lsb 0 ++#define xd_p_reg_fste_wh_9_8 (*(volatile byte xdata *) 0xF599) ++#define p_reg_fste_wh_9_8 0xF599 ++#define reg_fste_wh_9_8_pos 0 ++#define reg_fste_wh_9_8_len 2 ++#define reg_fste_wh_9_8_lsb 8 ++#define xd_r_fd_fste_i_adj_org (*(volatile byte xdata *) 0xF59A) ++#define r_fd_fste_i_adj_org 0xF59A ++#define fd_fste_i_adj_org_pos 0 ++#define fd_fste_i_adj_org_len 5 ++#define fd_fste_i_adj_org_lsb 0 ++#define xd_r_fd_fste_f_adj_7_0 (*(volatile byte xdata *) 0xF59B) ++#define r_fd_fste_f_adj_7_0 0xF59B ++#define fd_fste_f_adj_7_0_pos 0 ++#define fd_fste_f_adj_7_0_len 8 ++#define fd_fste_f_adj_7_0_lsb 0 ++#define xd_r_fd_fste_f_adj_15_8 (*(volatile byte xdata *) 0xF59C) ++#define r_fd_fste_f_adj_15_8 0xF59C ++#define fd_fste_f_adj_15_8_pos 0 ++#define fd_fste_f_adj_15_8_len 8 ++#define fd_fste_f_adj_15_8_lsb 8 ++#define xd_r_fd_fste_f_adj_19_16 (*(volatile byte xdata *) 0xF59D) ++#define r_fd_fste_f_adj_19_16 0xF59D ++#define fd_fste_f_adj_19_16_pos 0 ++#define fd_fste_f_adj_19_16_len 4 ++#define fd_fste_f_adj_19_16_lsb 16 ++#define xd_p_reg_fste_ehw_7_0 (*(volatile byte xdata *) 0xF59E) ++#define p_reg_fste_ehw_7_0 0xF59E ++#define reg_fste_ehw_7_0_pos 0 ++#define reg_fste_ehw_7_0_len 8 ++#define reg_fste_ehw_7_0_lsb 0 ++#define xd_p_reg_fste_ehw_12_8 (*(volatile byte xdata *) 0xF59F) ++#define p_reg_fste_ehw_12_8 0xF59F ++#define reg_fste_ehw_12_8_pos 0 ++#define reg_fste_ehw_12_8_len 5 ++#define reg_fste_ehw_12_8_lsb 8 ++#define xd_p_reg_fste_i_adj_vld (*(volatile byte xdata *) 0xF5A0) ++#define p_reg_fste_i_adj_vld 0xF5A0 ++#define reg_fste_i_adj_vld_pos 0 ++#define reg_fste_i_adj_vld_len 1 ++#define reg_fste_i_adj_vld_lsb 0 ++#define xd_p_reg_fste_ceTimesPhasor_real (*(volatile byte xdata *) 0xF5A1) ++#define p_reg_fste_ceTimesPhasor_real 0xF5A1 ++#define reg_fste_ceTimesPhasor_real_pos 0 ++#define reg_fste_ceTimesPhasor_real_len 1 ++#define reg_fste_ceTimesPhasor_real_lsb 0 ++#define xd_p_reg_fste_ceTimesPhasor_imag (*(volatile byte xdata *) 0xF5A2) ++#define p_reg_fste_ceTimesPhasor_imag 0xF5A2 ++#define reg_fste_ceTimesPhasor_imag_pos 0 ++#define reg_fste_ceTimesPhasor_imag_len 1 ++#define reg_fste_ceTimesPhasor_imag_lsb 0 ++#define xd_p_reg_fste_cerTimesW_real (*(volatile byte xdata *) 0xF5A3) ++#define p_reg_fste_cerTimesW_real 0xF5A3 ++#define reg_fste_cerTimesW_real_pos 0 ++#define reg_fste_cerTimesW_real_len 1 ++#define reg_fste_cerTimesW_real_lsb 0 ++#define xd_p_reg_fste_cerTimesW_imag (*(volatile byte xdata *) 0xF5A4) ++#define p_reg_fste_cerTimesW_imag 0xF5A4 ++#define reg_fste_cerTimesW_imag_pos 0 ++#define reg_fste_cerTimesW_imag_len 1 ++#define reg_fste_cerTimesW_imag_lsb 0 ++#define xd_p_reg_fste_cerTimesWAccum_real (*(volatile byte xdata *) 0xF5A5) ++#define p_reg_fste_cerTimesWAccum_real 0xF5A5 ++#define reg_fste_cerTimesWAccum_real_pos 0 ++#define reg_fste_cerTimesWAccum_real_len 1 ++#define reg_fste_cerTimesWAccum_real_lsb 0 ++#define xd_p_reg_fste_cerTimesWAccum_imag (*(volatile byte xdata *) 0xF5A6) ++#define p_reg_fste_cerTimesWAccum_imag 0xF5A6 ++#define reg_fste_cerTimesWAccum_imag_pos 0 ++#define reg_fste_cerTimesWAccum_imag_len 1 ++#define reg_fste_cerTimesWAccum_imag_lsb 0 ++#define xd_p_reg_fste_cost (*(volatile byte xdata *) 0xF5A7) ++#define p_reg_fste_cost 0xF5A7 ++#define reg_fste_cost_pos 0 ++#define reg_fste_cost_len 1 ++#define reg_fste_cost_lsb 0 ++#define xd_p_fd_tpsd_en (*(volatile byte xdata *) 0xF5A8) ++#define p_fd_tpsd_en 0xF5A8 ++#define fd_tpsd_en_pos 0 ++#define fd_tpsd_en_len 1 ++#define fd_tpsd_en_lsb 0 ++#define xd_p_fd_tpsd_lock (*(volatile byte xdata *) 0xF5A9) ++#define p_fd_tpsd_lock 0xF5A9 ++#define fd_tpsd_lock_pos 0 ++#define fd_tpsd_lock_len 1 ++#define fd_tpsd_lock_lsb 0 ++#define xd_r_fd_tpsd_s19 (*(volatile byte xdata *) 0xF5AA) ++#define r_fd_tpsd_s19 0xF5AA ++#define fd_tpsd_s19_pos 0 ++#define fd_tpsd_s19_len 1 ++#define fd_tpsd_s19_lsb 0 ++#define xd_r_fd_tpsd_s17 (*(volatile byte xdata *) 0xF5AB) ++#define r_fd_tpsd_s17 0xF5AB ++#define fd_tpsd_s17_pos 0 ++#define fd_tpsd_s17_len 1 ++#define fd_tpsd_s17_lsb 0 ++#define xd_p_fd_sfr_ste_en (*(volatile byte xdata *) 0xF5AC) ++#define p_fd_sfr_ste_en 0xF5AC ++#define fd_sfr_ste_en_pos 0 ++#define fd_sfr_ste_en_len 1 ++#define fd_sfr_ste_en_lsb 0 ++#define xd_p_fd_sfr_ste_mode (*(volatile byte xdata *) 0xF5AD) ++#define p_fd_sfr_ste_mode 0xF5AD ++#define fd_sfr_ste_mode_pos 0 ++#define fd_sfr_ste_mode_len 2 ++#define fd_sfr_ste_mode_lsb 0 ++#define xd_p_fd_sfr_ste_done (*(volatile byte xdata *) 0xF5AE) ++#define p_fd_sfr_ste_done 0xF5AE ++#define fd_sfr_ste_done_pos 0 ++#define fd_sfr_ste_done_len 1 ++#define fd_sfr_ste_done_lsb 0 ++#define xd_p_reg_cfoe_ffoe_en (*(volatile byte xdata *) 0xF5AF) ++#define p_reg_cfoe_ffoe_en 0xF5AF ++#define reg_cfoe_ffoe_en_pos 0 ++#define reg_cfoe_ffoe_en_len 1 ++#define reg_cfoe_ffoe_en_lsb 0 ++#define xd_p_reg_cfoe_ifoe_en (*(volatile byte xdata *) 0xF5B0) ++#define p_reg_cfoe_ifoe_en 0xF5B0 ++#define reg_cfoe_ifoe_en_pos 0 ++#define reg_cfoe_ifoe_en_len 1 ++#define reg_cfoe_ifoe_en_lsb 0 ++#define xd_p_reg_cfoe_fot_en (*(volatile byte xdata *) 0xF5B1) ++#define p_reg_cfoe_fot_en 0xF5B1 ++#define reg_cfoe_fot_en_pos 0 ++#define reg_cfoe_fot_en_len 1 ++#define reg_cfoe_fot_en_lsb 0 ++#define xd_p_reg_cfoe_fot_lm_en (*(volatile byte xdata *) 0xF5B2) ++#define p_reg_cfoe_fot_lm_en 0xF5B2 ++#define reg_cfoe_fot_lm_en_pos 0 ++#define reg_cfoe_fot_lm_en_len 1 ++#define reg_cfoe_fot_lm_en_lsb 0 ++#define xd_p_reg_cfoe_fot_rst (*(volatile byte xdata *) 0xF5B3) ++#define p_reg_cfoe_fot_rst 0xF5B3 ++#define reg_cfoe_fot_rst_pos 0 ++#define reg_cfoe_fot_rst_len 1 ++#define reg_cfoe_fot_rst_lsb 0 ++#define xd_r_fd_cfoe_ffoe_done (*(volatile byte xdata *) 0xF5B4) ++#define r_fd_cfoe_ffoe_done 0xF5B4 ++#define fd_cfoe_ffoe_done_pos 0 ++#define fd_cfoe_ffoe_done_len 1 ++#define fd_cfoe_ffoe_done_lsb 0 ++#define xd_p_fd_cfoe_metric_vld (*(volatile byte xdata *) 0xF5B5) ++#define p_fd_cfoe_metric_vld 0xF5B5 ++#define fd_cfoe_metric_vld_pos 0 ++#define fd_cfoe_metric_vld_len 1 ++#define fd_cfoe_metric_vld_lsb 0 ++#define xd_p_reg_cfoe_ifod_vld (*(volatile byte xdata *) 0xF5B6) ++#define p_reg_cfoe_ifod_vld 0xF5B6 ++#define reg_cfoe_ifod_vld_pos 0 ++#define reg_cfoe_ifod_vld_len 1 ++#define reg_cfoe_ifod_vld_lsb 0 ++#define xd_r_fd_cfoe_ifoe_done (*(volatile byte xdata *) 0xF5B7) ++#define r_fd_cfoe_ifoe_done 0xF5B7 ++#define fd_cfoe_ifoe_done_pos 0 ++#define fd_cfoe_ifoe_done_len 1 ++#define fd_cfoe_ifoe_done_lsb 0 ++#define xd_p_reg_cfoe_ifoe_spec_inv (*(volatile byte xdata *) 0xF5B8) ++#define p_reg_cfoe_ifoe_spec_inv 0xF5B8 ++#define reg_cfoe_ifoe_spec_inv_pos 0 ++#define reg_cfoe_ifoe_spec_inv_len 1 ++#define reg_cfoe_ifoe_spec_inv_lsb 0 ++#define xd_p_reg_cfoe_divg_int (*(volatile byte xdata *) 0xF5B9) ++#define p_reg_cfoe_divg_int 0xF5B9 ++#define reg_cfoe_divg_int_pos 0 ++#define reg_cfoe_divg_int_len 1 ++#define reg_cfoe_divg_int_lsb 0 ++#define xd_r_reg_cfoe_divg_flag (*(volatile byte xdata *) 0xF5BA) ++#define r_reg_cfoe_divg_flag 0xF5BA ++#define reg_cfoe_divg_flag_pos 0 ++#define reg_cfoe_divg_flag_len 1 ++#define reg_cfoe_divg_flag_lsb 0 ++#define xd_p_reg_sfoe_en (*(volatile byte xdata *) 0xF5BB) ++#define p_reg_sfoe_en 0xF5BB ++#define reg_sfoe_en_pos 0 ++#define reg_sfoe_en_len 1 ++#define reg_sfoe_en_lsb 0 ++#define xd_p_reg_sfoe_dis (*(volatile byte xdata *) 0xF5BC) ++#define p_reg_sfoe_dis 0xF5BC ++#define reg_sfoe_dis_pos 0 ++#define reg_sfoe_dis_len 1 ++#define reg_sfoe_dis_lsb 0 ++#define xd_p_reg_sfoe_rst (*(volatile byte xdata *) 0xF5BD) ++#define p_reg_sfoe_rst 0xF5BD ++#define reg_sfoe_rst_pos 0 ++#define reg_sfoe_rst_len 1 ++#define reg_sfoe_rst_lsb 0 ++#define xd_p_reg_sfoe_vld_int (*(volatile byte xdata *) 0xF5BE) ++#define p_reg_sfoe_vld_int 0xF5BE ++#define reg_sfoe_vld_int_pos 0 ++#define reg_sfoe_vld_int_len 1 ++#define reg_sfoe_vld_int_lsb 0 ++#define xd_p_reg_sfoe_lm_en (*(volatile byte xdata *) 0xF5BF) ++#define p_reg_sfoe_lm_en 0xF5BF ++#define reg_sfoe_lm_en_pos 0 ++#define reg_sfoe_lm_en_len 1 ++#define reg_sfoe_lm_en_lsb 0 ++#define xd_p_reg_sfoe_divg_int (*(volatile byte xdata *) 0xF5C0) ++#define p_reg_sfoe_divg_int 0xF5C0 ++#define reg_sfoe_divg_int_pos 0 ++#define reg_sfoe_divg_int_len 1 ++#define reg_sfoe_divg_int_lsb 0 ++#define xd_r_reg_sfoe_divg_flag (*(volatile byte xdata *) 0xF5C1) ++#define r_reg_sfoe_divg_flag 0xF5C1 ++#define reg_sfoe_divg_flag_pos 0 ++#define reg_sfoe_divg_flag_len 1 ++#define reg_sfoe_divg_flag_lsb 0 ++#define xd_p_reg_fft_rst (*(volatile byte xdata *) 0xF5C2) ++#define p_reg_fft_rst 0xF5C2 ++#define reg_fft_rst_pos 0 ++#define reg_fft_rst_len 1 ++#define reg_fft_rst_lsb 0 ++#define xd_p_reg_fft_mask2_en (*(volatile byte xdata *) 0xF5C3) ++#define p_reg_fft_mask2_en 0xF5C3 ++#define reg_fft_mask2_en_pos 0 ++#define reg_fft_mask2_en_len 1 ++#define reg_fft_mask2_en_lsb 0 ++#define xd_p_reg_fft_mask3_en (*(volatile byte xdata *) 0xF5C4) ++#define p_reg_fft_mask3_en 0xF5C4 ++#define reg_fft_mask3_en_pos 0 ++#define reg_fft_mask3_en_len 1 ++#define reg_fft_mask3_en_lsb 0 ++#define xd_p_reg_fft_crc_en (*(volatile byte xdata *) 0xF5C5) ++#define p_reg_fft_crc_en 0xF5C5 ++#define reg_fft_crc_en_pos 0 ++#define reg_fft_crc_en_len 1 ++#define reg_fft_crc_en_lsb 0 ++#define xd_p_reg_fft_mask0_en (*(volatile byte xdata *) 0xF5C6) ++#define p_reg_fft_mask0_en 0xF5C6 ++#define reg_fft_mask0_en_pos 0 ++#define reg_fft_mask0_en_len 1 ++#define reg_fft_mask0_en_lsb 0 ++#define xd_p_reg_fft_mask1_en (*(volatile byte xdata *) 0xF5C7) ++#define p_reg_fft_mask1_en 0xF5C7 ++#define reg_fft_mask1_en_pos 0 ++#define reg_fft_mask1_en_len 1 ++#define reg_fft_mask1_en_lsb 0 ++#define xd_p_fd_fste_en (*(volatile byte xdata *) 0xF5C8) ++#define p_fd_fste_en 0xF5C8 ++#define fd_fste_en_pos 0 ++#define fd_fste_en_len 1 ++#define fd_fste_en_lsb 0 ++#define xd_p_reg_feq_eh2_comp_en (*(volatile byte xdata *) 0xF5C9) ++#define p_reg_feq_eh2_comp_en 0xF5C9 ++#define reg_feq_eh2_comp_en_pos 0 ++#define reg_feq_eh2_comp_en_len 1 ++#define reg_feq_eh2_comp_en_lsb 0 ++#define xd_p_reg_feq_read_update (*(volatile byte xdata *) 0xF5CA) ++#define p_reg_feq_read_update 0xF5CA ++#define reg_feq_read_update_pos 0 ++#define reg_feq_read_update_len 1 ++#define reg_feq_read_update_lsb 0 ++#define xd_p_reg_feq_data_vld (*(volatile byte xdata *) 0xF5CB) ++#define p_reg_feq_data_vld 0xF5CB ++#define reg_feq_data_vld_pos 0 ++#define reg_feq_data_vld_len 1 ++#define reg_feq_data_vld_lsb 0 ++#define xd_p_reg_feq_tone_idx_7_0 (*(volatile byte xdata *) 0xF5CC) ++#define p_reg_feq_tone_idx_7_0 0xF5CC ++#define reg_feq_tone_idx_7_0_pos 0 ++#define reg_feq_tone_idx_7_0_len 8 ++#define reg_feq_tone_idx_7_0_lsb 0 ++#define xd_p_reg_feq_tone_idx_12_8 (*(volatile byte xdata *) 0xF5CD) ++#define p_reg_feq_tone_idx_12_8 0xF5CD ++#define reg_feq_tone_idx_12_8_pos 0 ++#define reg_feq_tone_idx_12_8_len 5 ++#define reg_feq_tone_idx_12_8_lsb 8 ++#define xd_r_reg_feq_data_re_7_0 (*(volatile byte xdata *) 0xF5CE) ++#define r_reg_feq_data_re_7_0 0xF5CE ++#define reg_feq_data_re_7_0_pos 0 ++#define reg_feq_data_re_7_0_len 8 ++#define reg_feq_data_re_7_0_lsb 0 ++#define xd_r_reg_feq_data_re_15_8 (*(volatile byte xdata *) 0xF5CF) ++#define r_reg_feq_data_re_15_8 0xF5CF ++#define reg_feq_data_re_15_8_pos 0 ++#define reg_feq_data_re_15_8_len 8 ++#define reg_feq_data_re_15_8_lsb 8 ++#define xd_r_reg_feq_data_re_21_16 (*(volatile byte xdata *) 0xF5D0) ++#define r_reg_feq_data_re_21_16 0xF5D0 ++#define reg_feq_data_re_21_16_pos 0 ++#define reg_feq_data_re_21_16_len 6 ++#define reg_feq_data_re_21_16_lsb 16 ++#define xd_r_reg_feq_data_im_7_0 (*(volatile byte xdata *) 0xF5D1) ++#define r_reg_feq_data_im_7_0 0xF5D1 ++#define reg_feq_data_im_7_0_pos 0 ++#define reg_feq_data_im_7_0_len 8 ++#define reg_feq_data_im_7_0_lsb 0 ++#define xd_r_reg_feq_data_im_15_8 (*(volatile byte xdata *) 0xF5D2) ++#define r_reg_feq_data_im_15_8 0xF5D2 ++#define reg_feq_data_im_15_8_pos 0 ++#define reg_feq_data_im_15_8_len 8 ++#define reg_feq_data_im_15_8_lsb 8 ++#define xd_r_reg_feq_data_im_21_16 (*(volatile byte xdata *) 0xF5D3) ++#define r_reg_feq_data_im_21_16 0xF5D3 ++#define reg_feq_data_im_21_16_pos 0 ++#define reg_feq_data_im_21_16_len 6 ++#define reg_feq_data_im_21_16_lsb 16 ++#define xd_r_reg_feq_data_h2_7_0 (*(volatile byte xdata *) 0xF5D4) ++#define r_reg_feq_data_h2_7_0 0xF5D4 ++#define reg_feq_data_h2_7_0_pos 0 ++#define reg_feq_data_h2_7_0_len 8 ++#define reg_feq_data_h2_7_0_lsb 0 ++#define xd_r_reg_feq_data_h2_15_8 (*(volatile byte xdata *) 0xF5D5) ++#define r_reg_feq_data_h2_15_8 0xF5D5 ++#define reg_feq_data_h2_15_8_pos 0 ++#define reg_feq_data_h2_15_8_len 8 ++#define reg_feq_data_h2_15_8_lsb 8 ++#define xd_r_reg_feq_data_h2_18_16 (*(volatile byte xdata *) 0xF5D6) ++#define r_reg_feq_data_h2_18_16 0xF5D6 ++#define reg_feq_data_h2_18_16_pos 0 ++#define reg_feq_data_h2_18_16_len 3 ++#define reg_feq_data_h2_18_16_lsb 16 ++#define xd_p_reg_fs_en (*(volatile byte xdata *) 0xF5D7) ++#define p_reg_fs_en 0xF5D7 ++#define reg_fs_en_pos 0 ++#define reg_fs_en_len 1 ++#define reg_fs_en_lsb 0 ++#define xd_p_reg_fs_offset (*(volatile byte xdata *) 0xF5D8) ++#define p_reg_fs_offset 0xF5D8 ++#define reg_fs_offset_pos 0 ++#define reg_fs_offset_len 3 ++#define reg_fs_offset_lsb 0 ++#define xd_p_reg_fs_debug (*(volatile byte xdata *) 0xF5D9) ++#define p_reg_fs_debug 0xF5D9 ++#define reg_fs_debug_pos 0 ++#define reg_fs_debug_len 1 ++#define reg_fs_debug_lsb 0 ++#define xd_p_reg_fs_half_inv (*(volatile byte xdata *) 0xF5DA) ++#define p_reg_fs_half_inv 0xF5DA ++#define reg_fs_half_inv_pos 0 ++#define reg_fs_half_inv_len 1 ++#define reg_fs_half_inv_lsb 0 ++#define xd_p_reg_cdpf_currentfftposition_7_0 (*(volatile byte xdata *) 0xF5DB) ++#define p_reg_cdpf_currentfftposition_7_0 0xF5DB ++#define reg_cdpf_currentfftposition_7_0_pos 0 ++#define reg_cdpf_currentfftposition_7_0_len 8 ++#define reg_cdpf_currentfftposition_7_0_lsb 0 ++#define xd_p_reg_cdpf_currentfftposition_14_8 (*(volatile byte xdata *) 0xF5DC) ++#define p_reg_cdpf_currentfftposition_14_8 0xF5DC ++#define reg_cdpf_currentfftposition_14_8_pos 0 ++#define reg_cdpf_currentfftposition_14_8_len 7 ++#define reg_cdpf_currentfftposition_14_8_lsb 8 ++#define xd_r_reg_cdpf_fftshift_7_0 (*(volatile byte xdata *) 0xF5DD) ++#define r_reg_cdpf_fftshift_7_0 0xF5DD ++#define reg_cdpf_fftshift_7_0_pos 0 ++#define reg_cdpf_fftshift_7_0_len 8 ++#define reg_cdpf_fftshift_7_0_lsb 0 ++#define xd_r_reg_cdpf_fftshift_13_8 (*(volatile byte xdata *) 0xF5DE) ++#define r_reg_cdpf_fftshift_13_8 0xF5DE ++#define reg_cdpf_fftshift_13_8_pos 0 ++#define reg_cdpf_fftshift_13_8_len 6 ++#define reg_cdpf_fftshift_13_8_lsb 8 ++#define xd_p_reg_cdpf_channelpowerdown_7_0 (*(volatile byte xdata *) 0xF5DF) ++#define p_reg_cdpf_channelpowerdown_7_0 0xF5DF ++#define reg_cdpf_channelpowerdown_7_0_pos 0 ++#define reg_cdpf_channelpowerdown_7_0_len 8 ++#define reg_cdpf_channelpowerdown_7_0_lsb 0 ++#define xd_p_reg_cdpf_channelpowerdown_10_8 (*(volatile byte xdata *) 0xF5E0) ++#define p_reg_cdpf_channelpowerdown_10_8 0xF5E0 ++#define reg_cdpf_channelpowerdown_10_8_pos 0 ++#define reg_cdpf_channelpowerdown_10_8_len 3 ++#define reg_cdpf_channelpowerdown_10_8_lsb 8 ++#define xd_p_reg_cdpf_state (*(volatile byte xdata *) 0xF5E1) ++#define p_reg_cdpf_state 0xF5E1 ++#define reg_cdpf_state_pos 0 ++#define reg_cdpf_state_len 4 ++#define reg_cdpf_state_lsb 0 ++#define xd_p_reg_cdpf_echotestsearchingrange (*(volatile byte xdata *) 0xF5E2) ++#define p_reg_cdpf_echotestsearchingrange 0xF5E2 ++#define reg_cdpf_echotestsearchingrange_pos 0 ++#define reg_cdpf_echotestsearchingrange_len 8 ++#define reg_cdpf_echotestsearchingrange_lsb 0 ++#define xd_p_reg_cdpf_rxsymboldelay (*(volatile byte xdata *) 0xF5E3) ++#define p_reg_cdpf_rxsymboldelay 0xF5E3 ++#define reg_cdpf_rxsymboldelay_pos 0 ++#define reg_cdpf_rxsymboldelay_len 4 ++#define reg_cdpf_rxsymboldelay_lsb 0 ++#define xd_p_reg_cdpf_ceavesymbolno (*(volatile byte xdata *) 0xF5E4) ++#define p_reg_cdpf_ceavesymbolno 0xF5E4 ++#define reg_cdpf_ceavesymbolno_pos 0 ++#define reg_cdpf_ceavesymbolno_len 4 ++#define reg_cdpf_ceavesymbolno_lsb 0 ++#define xd_p_reg_cdpf_ceshift (*(volatile byte xdata *) 0xF5E5) ++#define p_reg_cdpf_ceshift 0xF5E5 ++#define reg_cdpf_ceshift_pos 0 ++#define reg_cdpf_ceshift_len 3 ++#define reg_cdpf_ceshift_lsb 0 ++#define xd_p_reg_cdpf_postpreechotry (*(volatile byte xdata *) 0xF5E6) ++#define p_reg_cdpf_postpreechotry 0xF5E6 ++#define reg_cdpf_postpreechotry_pos 0 ++#define reg_cdpf_postpreechotry_len 2 ++#define reg_cdpf_postpreechotry_lsb 0 ++#define xd_p_reg_cdpf_en (*(volatile byte xdata *) 0xF5E7) ++#define p_reg_cdpf_en 0xF5E7 ++#define reg_cdpf_en_pos 0 ++#define reg_cdpf_en_len 1 ++#define reg_cdpf_en_lsb 0 ++#define xd_p_reg_cdpf_stateready (*(volatile byte xdata *) 0xF5E8) ++#define p_reg_cdpf_stateready 0xF5E8 ++#define reg_cdpf_stateready_pos 0 ++#define reg_cdpf_stateready_len 1 ++#define reg_cdpf_stateready_lsb 0 ++#define xd_r_reg_cdpf_prepostpowercompare (*(volatile byte xdata *) 0xF5E9) ++#define r_reg_cdpf_prepostpowercompare 0xF5E9 ++#define reg_cdpf_prepostpowercompare_pos 0 ++#define reg_cdpf_prepostpowercompare_len 1 ++#define reg_cdpf_prepostpowercompare_lsb 0 ++#define xd_r_reg_cdpf_candidateno (*(volatile byte xdata *) 0xF5EA) ++#define r_reg_cdpf_candidateno 0xF5EA ++#define reg_cdpf_candidateno_pos 0 ++#define reg_cdpf_candidateno_len 6 ++#define reg_cdpf_candidateno_lsb 0 ++#define xd_p_reg_cdpf_preechopower_7_0 (*(volatile byte xdata *) 0xF5EB) ++#define p_reg_cdpf_preechopower_7_0 0xF5EB ++#define reg_cdpf_preechopower_7_0_pos 0 ++#define reg_cdpf_preechopower_7_0_len 8 ++#define reg_cdpf_preechopower_7_0_lsb 0 ++#define xd_p_reg_cdpf_preechopower_15_8 (*(volatile byte xdata *) 0xF5EC) ++#define p_reg_cdpf_preechopower_15_8 0xF5EC ++#define reg_cdpf_preechopower_15_8_pos 0 ++#define reg_cdpf_preechopower_15_8_len 8 ++#define reg_cdpf_preechopower_15_8_lsb 8 ++#define xd_p_reg_cdpf_postechopower_7_0 (*(volatile byte xdata *) 0xF5ED) ++#define p_reg_cdpf_postechopower_7_0 0xF5ED ++#define reg_cdpf_postechopower_7_0_pos 0 ++#define reg_cdpf_postechopower_7_0_len 8 ++#define reg_cdpf_postechopower_7_0_lsb 0 ++#define xd_p_reg_cdpf_postechopower_15_8 (*(volatile byte xdata *) 0xF5EE) ++#define p_reg_cdpf_postechopower_15_8 0xF5EE ++#define reg_cdpf_postechopower_15_8_pos 0 ++#define reg_cdpf_postechopower_15_8_len 8 ++#define reg_cdpf_postechopower_15_8_lsb 8 ++#define xd_p_reg_cdpf_searchingend (*(volatile byte xdata *) 0xF5EF) ++#define p_reg_cdpf_searchingend 0xF5EF ++#define reg_cdpf_searchingend_pos 0 ++#define reg_cdpf_searchingend_len 8 ++#define reg_cdpf_searchingend_lsb 0 ++#define xd_r_reg_cdpf_candidate_7_0 (*(volatile byte xdata *) 0xF5F0) ++#define r_reg_cdpf_candidate_7_0 0xF5F0 ++#define reg_cdpf_candidate_7_0_pos 0 ++#define reg_cdpf_candidate_7_0_len 8 ++#define reg_cdpf_candidate_7_0_lsb 0 ++#define xd_r_reg_cdpf_candidate_15_8 (*(volatile byte xdata *) 0xF5F1) ++#define r_reg_cdpf_candidate_15_8 0xF5F1 ++#define reg_cdpf_candidate_15_8_pos 0 ++#define reg_cdpf_candidate_15_8_len 8 ++#define reg_cdpf_candidate_15_8_lsb 8 ++#define xd_p_reg_cdpf_candidate_rptr (*(volatile byte xdata *) 0xF5F2) ++#define p_reg_cdpf_candidate_rptr 0xF5F2 ++#define reg_cdpf_candidate_rptr_pos 0 ++#define reg_cdpf_candidate_rptr_len 7 ++#define reg_cdpf_candidate_rptr_lsb 0 ++#define xd_p_reg_cdpf_candidate_rptr_force (*(volatile byte xdata *) 0xF5F3) ++#define p_reg_cdpf_candidate_rptr_force 0xF5F3 ++#define reg_cdpf_candidate_rptr_force_pos 0 ++#define reg_cdpf_candidate_rptr_force_len 1 ++#define reg_cdpf_candidate_rptr_force_lsb 0 ++#define xd_p_reg_cdpf_trialshiftoffset_7_0 (*(volatile byte xdata *) 0xF5F4) ++#define p_reg_cdpf_trialshiftoffset_7_0 0xF5F4 ++#define reg_cdpf_trialshiftoffset_7_0_pos 0 ++#define reg_cdpf_trialshiftoffset_7_0_len 8 ++#define reg_cdpf_trialshiftoffset_7_0_lsb 0 ++#define xd_p_reg_cdpf_trialshiftoffset_13_8 (*(volatile byte xdata *) 0xF5F5) ++#define p_reg_cdpf_trialshiftoffset_13_8 0xF5F5 ++#define reg_cdpf_trialshiftoffset_13_8_pos 0 ++#define reg_cdpf_trialshiftoffset_13_8_len 6 ++#define reg_cdpf_trialshiftoffset_13_8_lsb 8 ++#define xd_p_reg_cdpf_channellength_7_0 (*(volatile byte xdata *) 0xF5F6) ++#define p_reg_cdpf_channellength_7_0 0xF5F6 ++#define reg_cdpf_channellength_7_0_pos 0 ++#define reg_cdpf_channellength_7_0_len 8 ++#define reg_cdpf_channellength_7_0_lsb 0 ++#define xd_p_reg_cdpf_channellength_12_8 (*(volatile byte xdata *) 0xF5F7) ++#define p_reg_cdpf_channellength_12_8 0xF5F7 ++#define reg_cdpf_channellength_12_8_pos 0 ++#define reg_cdpf_channellength_12_8_len 5 ++#define reg_cdpf_channellength_12_8_lsb 8 ++#define xd_p_reg_cdpf_hardwaresort (*(volatile byte xdata *) 0xF5F8) ++#define p_reg_cdpf_hardwaresort 0xF5F8 ++#define reg_cdpf_hardwaresort_pos 0 ++#define reg_cdpf_hardwaresort_len 1 ++#define reg_cdpf_hardwaresort_lsb 0 ++#define xd_p_reg_cdpf_maxcandidateno (*(volatile byte xdata *) 0xF5F9) ++#define p_reg_cdpf_maxcandidateno 0xF5F9 ++#define reg_cdpf_maxcandidateno_pos 0 ++#define reg_cdpf_maxcandidateno_len 3 ++#define reg_cdpf_maxcandidateno_lsb 0 ++#define xd_p_reg_cdpf_channelleftindex (*(volatile byte xdata *) 0xF5FA) ++#define p_reg_cdpf_channelleftindex 0xF5FA ++#define reg_cdpf_channelleftindex_pos 0 ++#define reg_cdpf_channelleftindex_len 4 ++#define reg_cdpf_channelleftindex_lsb 0 ++#define xd_r_reg_cdpf_fdishift_7_0 (*(volatile byte xdata *) 0xF5FB) ++#define r_reg_cdpf_fdishift_7_0 0xF5FB ++#define reg_cdpf_fdishift_7_0_pos 0 ++#define reg_cdpf_fdishift_7_0_len 8 ++#define reg_cdpf_fdishift_7_0_lsb 0 ++#define xd_r_reg_cdpf_fdishift_15_8 (*(volatile byte xdata *) 0xF5FC) ++#define r_reg_cdpf_fdishift_15_8 0xF5FC ++#define reg_cdpf_fdishift_15_8_pos 0 ++#define reg_cdpf_fdishift_15_8_len 8 ++#define reg_cdpf_fdishift_15_8_lsb 8 ++#define xd_p_reg_cdpf_guardband (*(volatile byte xdata *) 0xF5FD) ++#define p_reg_cdpf_guardband 0xF5FD ++#define reg_cdpf_guardband_pos 0 ++#define reg_cdpf_guardband_len 5 ++#define reg_cdpf_guardband_lsb 0 ++#define xd_p_reg_cdpf_maxtonemaxindex_7_0 (*(volatile byte xdata *) 0xF5FE) ++#define p_reg_cdpf_maxtonemaxindex_7_0 0xF5FE ++#define reg_cdpf_maxtonemaxindex_7_0_pos 0 ++#define reg_cdpf_maxtonemaxindex_7_0_len 8 ++#define reg_cdpf_maxtonemaxindex_7_0_lsb 0 ++#define xd_p_reg_cdpf_maxtonemaxindex_12_8 (*(volatile byte xdata *) 0xF5FF) ++#define p_reg_cdpf_maxtonemaxindex_12_8 0xF5FF ++#define reg_cdpf_maxtonemaxindex_12_8_pos 0 ++#define reg_cdpf_maxtonemaxindex_12_8_len 5 ++#define reg_cdpf_maxtonemaxindex_12_8_lsb 8 ++#define xd_p_reg_cdpf_fdiw0 (*(volatile byte xdata *) 0xF600) ++#define p_reg_cdpf_fdiw0 0xF600 ++#define reg_cdpf_fdiw0_pos 0 ++#define reg_cdpf_fdiw0_len 7 ++#define reg_cdpf_fdiw0_lsb 0 ++#define xd_p_reg_cdpf_fdiw1 (*(volatile byte xdata *) 0xF601) ++#define p_reg_cdpf_fdiw1 0xF601 ++#define reg_cdpf_fdiw1_pos 0 ++#define reg_cdpf_fdiw1_len 7 ++#define reg_cdpf_fdiw1_lsb 0 ++#define xd_p_reg_cdpf_fdiw2 (*(volatile byte xdata *) 0xF602) ++#define p_reg_cdpf_fdiw2 0xF602 ++#define reg_cdpf_fdiw2_pos 0 ++#define reg_cdpf_fdiw2_len 7 ++#define reg_cdpf_fdiw2_lsb 0 ++#define xd_p_reg_cdpf_fdiw3 (*(volatile byte xdata *) 0xF603) ++#define p_reg_cdpf_fdiw3 0xF603 ++#define reg_cdpf_fdiw3_pos 0 ++#define reg_cdpf_fdiw3_len 7 ++#define reg_cdpf_fdiw3_lsb 0 ++#define xd_p_reg_cdpf_fdiw4 (*(volatile byte xdata *) 0xF604) ++#define p_reg_cdpf_fdiw4 0xF604 ++#define reg_cdpf_fdiw4_pos 0 ++#define reg_cdpf_fdiw4_len 7 ++#define reg_cdpf_fdiw4_lsb 0 ++#define xd_p_reg_cdpf_fdiw5 (*(volatile byte xdata *) 0xF605) ++#define p_reg_cdpf_fdiw5 0xF605 ++#define reg_cdpf_fdiw5_pos 0 ++#define reg_cdpf_fdiw5_len 7 ++#define reg_cdpf_fdiw5_lsb 0 ++#define xd_p_reg_cdpf_fdiw6 (*(volatile byte xdata *) 0xF606) ++#define p_reg_cdpf_fdiw6 0xF606 ++#define reg_cdpf_fdiw6_pos 0 ++#define reg_cdpf_fdiw6_len 7 ++#define reg_cdpf_fdiw6_lsb 0 ++#define xd_p_reg_cdpf_fdiw7 (*(volatile byte xdata *) 0xF607) ++#define p_reg_cdpf_fdiw7 0xF607 ++#define reg_cdpf_fdiw7_pos 0 ++#define reg_cdpf_fdiw7_len 7 ++#define reg_cdpf_fdiw7_lsb 0 ++#define xd_r_reg_cdpf_fdiwindowsize (*(volatile byte xdata *) 0xF608) ++#define r_reg_cdpf_fdiwindowsize 0xF608 ++#define reg_cdpf_fdiwindowsize_pos 0 ++#define reg_cdpf_fdiwindowsize_len 4 ++#define reg_cdpf_fdiwindowsize_lsb 0 ++#define xd_p_reg_stes_mode (*(volatile byte xdata *) 0xF609) ++#define p_reg_stes_mode 0xF609 ++#define reg_stes_mode_pos 0 ++#define reg_stes_mode_len 1 ++#define reg_stes_mode_lsb 0 ++#define xd_p_reg_stes_done_st (*(volatile byte xdata *) 0xF60A) ++#define p_reg_stes_done_st 0xF60A ++#define reg_stes_done_st_pos 0 ++#define reg_stes_done_st_len 2 ++#define reg_stes_done_st_lsb 0 ++#define xd_p_reg_stes_done (*(volatile byte xdata *) 0xF60B) ++#define p_reg_stes_done 0xF60B ++#define reg_stes_done_pos 0 ++#define reg_stes_done_len 1 ++#define reg_stes_done_lsb 0 ++#define xd_p_reg_stes_timing_7_0 (*(volatile byte xdata *) 0xF60C) ++#define p_reg_stes_timing_7_0 0xF60C ++#define reg_stes_timing_7_0_pos 0 ++#define reg_stes_timing_7_0_len 8 ++#define reg_stes_timing_7_0_lsb 0 ++#define xd_p_reg_stes_timing_15_8 (*(volatile byte xdata *) 0xF60D) ++#define p_reg_stes_timing_15_8 0xF60D ++#define reg_stes_timing_15_8_pos 0 ++#define reg_stes_timing_15_8_len 8 ++#define reg_stes_timing_15_8_lsb 8 ++#define xd_p_reg_stes_sym_tot_adj_thre_7_0 (*(volatile byte xdata *) 0xF60E) ++#define p_reg_stes_sym_tot_adj_thre_7_0 0xF60E ++#define reg_stes_sym_tot_adj_thre_7_0_pos 0 ++#define reg_stes_sym_tot_adj_thre_7_0_len 8 ++#define reg_stes_sym_tot_adj_thre_7_0_lsb 0 ++#define xd_p_reg_stes_sym_tot_adj_thre_15_8 (*(volatile byte xdata *) 0xF60F) ++#define p_reg_stes_sym_tot_adj_thre_15_8 0xF60F ++#define reg_stes_sym_tot_adj_thre_15_8_pos 0 ++#define reg_stes_sym_tot_adj_thre_15_8_len 8 ++#define reg_stes_sym_tot_adj_thre_15_8_lsb 8 ++#define xd_p_reg_stes_sym_thre_9_2 (*(volatile byte xdata *) 0xF610) ++#define p_reg_stes_sym_thre_9_2 0xF610 ++#define reg_stes_sym_thre_9_2_pos 0 ++#define reg_stes_sym_thre_9_2_len 8 ++#define reg_stes_sym_thre_9_2_lsb 0 ++#define xd_p_reg_stes_sym_wo_adj_thre_9_2 (*(volatile byte xdata *) 0xF611) ++#define p_reg_stes_sym_wo_adj_thre_9_2 0xF611 ++#define reg_stes_sym_wo_adj_thre_9_2_pos 0 ++#define reg_stes_sym_wo_adj_thre_9_2_len 8 ++#define reg_stes_sym_wo_adj_thre_9_2_lsb 0 ++#define xd_p_reg_fste_i_adj_7_0 (*(volatile byte xdata *) 0xF612) ++#define p_reg_fste_i_adj_7_0 0xF612 ++#define reg_fste_i_adj_7_0_pos 0 ++#define reg_fste_i_adj_7_0_len 8 ++#define reg_fste_i_adj_7_0_lsb 0 ++#define xd_p_reg_fste_i_adj_15_8 (*(volatile byte xdata *) 0xF613) ++#define p_reg_fste_i_adj_15_8 0xF613 ++#define reg_fste_i_adj_15_8_pos 0 ++#define reg_fste_i_adj_15_8_len 8 ++#define reg_fste_i_adj_15_8_lsb 8 ++#define xd_r_fd_stes_iadj_val_7_0 (*(volatile byte xdata *) 0xF614) ++#define r_fd_stes_iadj_val_7_0 0xF614 ++#define fd_stes_iadj_val_7_0_pos 0 ++#define fd_stes_iadj_val_7_0_len 8 ++#define fd_stes_iadj_val_7_0_lsb 0 ++#define xd_r_fd_stes_iadj_val_15_8 (*(volatile byte xdata *) 0xF615) ++#define r_fd_stes_iadj_val_15_8 0xF615 ++#define fd_stes_iadj_val_15_8_pos 0 ++#define fd_stes_iadj_val_15_8_len 8 ++#define fd_stes_iadj_val_15_8_lsb 8 ++#define xd_r_fd_stes_symb_cnt_9_2 (*(volatile byte xdata *) 0xF616) ++#define r_fd_stes_symb_cnt_9_2 0xF616 ++#define fd_stes_symb_cnt_9_2_pos 0 ++#define fd_stes_symb_cnt_9_2_len 8 ++#define fd_stes_symb_cnt_9_2_lsb 0 ++#define xd_r_fd_stes_snoi_cnt_9_2 (*(volatile byte xdata *) 0xF617) ++#define r_fd_stes_snoi_cnt_9_2 0xF617 ++#define fd_stes_snoi_cnt_9_2_pos 0 ++#define fd_stes_snoi_cnt_9_2_len 8 ++#define fd_stes_snoi_cnt_9_2_lsb 0 ++#define xd_r_fd_last_iadj_val_7_0 (*(volatile byte xdata *) 0xF618) ++#define r_fd_last_iadj_val_7_0 0xF618 ++#define fd_last_iadj_val_7_0_pos 0 ++#define fd_last_iadj_val_7_0_len 8 ++#define fd_last_iadj_val_7_0_lsb 0 ++#define xd_r_fd_last_iadj_val_15_8 (*(volatile byte xdata *) 0xF619) ++#define r_fd_last_iadj_val_15_8 0xF619 ++#define fd_last_iadj_val_15_8_pos 0 ++#define fd_last_iadj_val_15_8_len 8 ++#define fd_last_iadj_val_15_8_lsb 8 ++#define xd_p_reg_stes_bypass (*(volatile byte xdata *) 0xF61A) ++#define p_reg_stes_bypass 0xF61A ++#define reg_stes_bypass_pos 0 ++#define reg_stes_bypass_len 1 ++#define reg_stes_bypass_lsb 0 ++#define xd_p_reg_stes_best_timing_idx (*(volatile byte xdata *) 0xF61B) ++#define p_reg_stes_best_timing_idx 0xF61B ++#define reg_stes_best_timing_idx_pos 0 ++#define reg_stes_best_timing_idx_len 4 ++#define reg_stes_best_timing_idx_lsb 0 ++#define xd_p_reg_stes_iadj_val_7_0 (*(volatile byte xdata *) 0xF61C) ++#define p_reg_stes_iadj_val_7_0 0xF61C ++#define reg_stes_iadj_val_7_0_pos 0 ++#define reg_stes_iadj_val_7_0_len 8 ++#define reg_stes_iadj_val_7_0_lsb 0 ++#define xd_p_reg_stes_iadj_val_15_8 (*(volatile byte xdata *) 0xF61D) ++#define p_reg_stes_iadj_val_15_8 0xF61D ++#define reg_stes_iadj_val_15_8_pos 0 ++#define reg_stes_iadj_val_15_8_len 8 ++#define reg_stes_iadj_val_15_8_lsb 8 ++#define xd_p_reg_p_ste_start_guard_7_0 (*(volatile byte xdata *) 0xF620) ++#define p_reg_p_ste_start_guard_7_0 0xF620 ++#define reg_p_ste_start_guard_7_0_pos 0 ++#define reg_p_ste_start_guard_7_0_len 8 ++#define reg_p_ste_start_guard_7_0_lsb 0 ++#define xd_p_reg_p_ste_start_guard_9_8 (*(volatile byte xdata *) 0xF621) ++#define p_reg_p_ste_start_guard_9_8 0xF621 ++#define reg_p_ste_start_guard_9_8_pos 0 ++#define reg_p_ste_start_guard_9_8_len 2 ++#define reg_p_ste_start_guard_9_8_lsb 8 ++#define xd_p_reg_p_ste_end_guard_7_0 (*(volatile byte xdata *) 0xF622) ++#define p_reg_p_ste_end_guard_7_0 0xF622 ++#define reg_p_ste_end_guard_7_0_pos 0 ++#define reg_p_ste_end_guard_7_0_len 8 ++#define reg_p_ste_end_guard_7_0_lsb 0 ++#define xd_p_reg_p_ste_end_guard_9_8 (*(volatile byte xdata *) 0xF623) ++#define p_reg_p_ste_end_guard_9_8 0xF623 ++#define reg_p_ste_end_guard_9_8_pos 0 ++#define reg_p_ste_end_guard_9_8_len 2 ++#define reg_p_ste_end_guard_9_8_lsb 8 ++#define xd_r_reg_r_ste_wrong_beacon_count (*(volatile byte xdata *) 0xF624) ++#define r_reg_r_ste_wrong_beacon_count 0xF624 ++#define reg_r_ste_wrong_beacon_count_pos 0 ++#define reg_r_ste_wrong_beacon_count_len 7 ++#define reg_r_ste_wrong_beacon_count_lsb 0 ++#define xd_p_reg_p_fccid_en (*(volatile byte xdata *) 0xF625) ++#define p_reg_p_fccid_en 0xF625 ++#define reg_p_fccid_en_pos 0 ++#define reg_p_fccid_en_len 1 ++#define reg_p_fccid_en_lsb 0 ++#define xd_p_reg_p_fccid_fft_ave_symbol_num (*(volatile byte xdata *) 0xF626) ++#define p_reg_p_fccid_fft_ave_symbol_num 0xF626 ++#define reg_p_fccid_fft_ave_symbol_num_pos 0 ++#define reg_p_fccid_fft_ave_symbol_num_len 6 ++#define reg_p_fccid_fft_ave_symbol_num_lsb 0 ++#define xd_p_reg_p_fccid_fft_work_start_tone_7_0 (*(volatile byte xdata *) 0xF627) ++#define p_reg_p_fccid_fft_work_start_tone_7_0 0xF627 ++#define reg_p_fccid_fft_work_start_tone_7_0_pos 0 ++#define reg_p_fccid_fft_work_start_tone_7_0_len 8 ++#define reg_p_fccid_fft_work_start_tone_7_0_lsb 0 ++#define xd_p_reg_p_fccid_fft_work_start_tone_12_8 (*(volatile byte xdata *) 0xF628) ++#define p_reg_p_fccid_fft_work_start_tone_12_8 0xF628 ++#define reg_p_fccid_fft_work_start_tone_12_8_pos 0 ++#define reg_p_fccid_fft_work_start_tone_12_8_len 5 ++#define reg_p_fccid_fft_work_start_tone_12_8_lsb 8 ++#define xd_p_reg_p_fccid_fft_work_end_tone_7_0 (*(volatile byte xdata *) 0xF629) ++#define p_reg_p_fccid_fft_work_end_tone_7_0 0xF629 ++#define reg_p_fccid_fft_work_end_tone_7_0_pos 0 ++#define reg_p_fccid_fft_work_end_tone_7_0_len 8 ++#define reg_p_fccid_fft_work_end_tone_7_0_lsb 0 ++#define xd_p_reg_p_fccid_fft_work_end_tone_12_8 (*(volatile byte xdata *) 0xF62A) ++#define p_reg_p_fccid_fft_work_end_tone_12_8 0xF62A ++#define reg_p_fccid_fft_work_end_tone_12_8_pos 0 ++#define reg_p_fccid_fft_work_end_tone_12_8_len 5 ++#define reg_p_fccid_fft_work_end_tone_12_8_lsb 8 ++#define xd_p_reg_p_fccid_peak_to_th_divider (*(volatile byte xdata *) 0xF62B) ++#define p_reg_p_fccid_peak_to_th_divider 0xF62B ++#define reg_p_fccid_peak_to_th_divider_pos 0 ++#define reg_p_fccid_peak_to_th_divider_len 4 ++#define reg_p_fccid_peak_to_th_divider_lsb 0 ++#define xd_p_reg_p_fccid_peak_to_th_mode (*(volatile byte xdata *) 0xF62C) ++#define p_reg_p_fccid_peak_to_th_mode 0xF62C ++#define reg_p_fccid_peak_to_th_mode_pos 0 ++#define reg_p_fccid_peak_to_th_mode_len 2 ++#define reg_p_fccid_peak_to_th_mode_lsb 0 ++#define xd_p_reg_p_fccid_search_mode (*(volatile byte xdata *) 0xF62D) ++#define p_reg_p_fccid_search_mode 0xF62D ++#define reg_p_fccid_search_mode_pos 0 ++#define reg_p_fccid_search_mode_len 1 ++#define reg_p_fccid_search_mode_lsb 0 ++#define xd_p_reg_p_fccid_group_th (*(volatile byte xdata *) 0xF62E) ++#define p_reg_p_fccid_group_th 0xF62E ++#define reg_p_fccid_group_th_pos 0 ++#define reg_p_fccid_group_th_len 7 ++#define reg_p_fccid_group_th_lsb 0 ++#define xd_p_reg_p_fccid_search_rdy (*(volatile byte xdata *) 0xF62F) ++#define p_reg_p_fccid_search_rdy 0xF62F ++#define reg_p_fccid_search_rdy_pos 0 ++#define reg_p_fccid_search_rdy_len 1 ++#define reg_p_fccid_search_rdy_lsb 0 ++#define xd_r_reg_r_fccid_fft_ave_read_out_7_0 (*(volatile byte xdata *) 0xF630) ++#define r_reg_r_fccid_fft_ave_read_out_7_0 0xF630 ++#define reg_r_fccid_fft_ave_read_out_7_0_pos 0 ++#define reg_r_fccid_fft_ave_read_out_7_0_len 8 ++#define reg_r_fccid_fft_ave_read_out_7_0_lsb 0 ++#define xd_r_reg_r_fccid_fft_ave_read_out_15_8 (*(volatile byte xdata *) 0xF631) ++#define r_reg_r_fccid_fft_ave_read_out_15_8 0xF631 ++#define reg_r_fccid_fft_ave_read_out_15_8_pos 0 ++#define reg_r_fccid_fft_ave_read_out_15_8_len 8 ++#define reg_r_fccid_fft_ave_read_out_15_8_lsb 8 ++#define xd_r_reg_r_fccid_large_tone_num_7_0 (*(volatile byte xdata *) 0xF632) ++#define r_reg_r_fccid_large_tone_num_7_0 0xF632 ++#define reg_r_fccid_large_tone_num_7_0_pos 0 ++#define reg_r_fccid_large_tone_num_7_0_len 8 ++#define reg_r_fccid_large_tone_num_7_0_lsb 0 ++#define xd_r_reg_r_fccid_large_tone_num_12_8 (*(volatile byte xdata *) 0xF633) ++#define r_reg_r_fccid_large_tone_num_12_8 0xF633 ++#define reg_r_fccid_large_tone_num_12_8_pos 0 ++#define reg_r_fccid_large_tone_num_12_8_len 5 ++#define reg_r_fccid_large_tone_num_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci1_start_tone_7_0 (*(volatile byte xdata *) 0xF634) ++#define r_reg_r_fccid_cci1_start_tone_7_0 0xF634 ++#define reg_r_fccid_cci1_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci1_start_tone_7_0_len 8 ++#define reg_r_fccid_cci1_start_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci1_start_tone_12_8 (*(volatile byte xdata *) 0xF635) ++#define r_reg_r_fccid_cci1_start_tone_12_8 0xF635 ++#define reg_r_fccid_cci1_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci1_start_tone_12_8_len 5 ++#define reg_r_fccid_cci1_start_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci1_end_tone_7_0 (*(volatile byte xdata *) 0xF636) ++#define r_reg_r_fccid_cci1_end_tone_7_0 0xF636 ++#define reg_r_fccid_cci1_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci1_end_tone_7_0_len 8 ++#define reg_r_fccid_cci1_end_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci1_end_tone_12_8 (*(volatile byte xdata *) 0xF637) ++#define r_reg_r_fccid_cci1_end_tone_12_8 0xF637 ++#define reg_r_fccid_cci1_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci1_end_tone_12_8_len 5 ++#define reg_r_fccid_cci1_end_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci1_peak_7_0 (*(volatile byte xdata *) 0xF638) ++#define r_reg_r_fccid_cci1_peak_7_0 0xF638 ++#define reg_r_fccid_cci1_peak_7_0_pos 0 ++#define reg_r_fccid_cci1_peak_7_0_len 8 ++#define reg_r_fccid_cci1_peak_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci1_peak_15_8 (*(volatile byte xdata *) 0xF639) ++#define r_reg_r_fccid_cci1_peak_15_8 0xF639 ++#define reg_r_fccid_cci1_peak_15_8_pos 0 ++#define reg_r_fccid_cci1_peak_15_8_len 8 ++#define reg_r_fccid_cci1_peak_15_8_lsb 8 ++#define xd_r_reg_r_fccid_cci2_start_tone_7_0 (*(volatile byte xdata *) 0xF63A) ++#define r_reg_r_fccid_cci2_start_tone_7_0 0xF63A ++#define reg_r_fccid_cci2_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci2_start_tone_7_0_len 8 ++#define reg_r_fccid_cci2_start_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci2_start_tone_12_8 (*(volatile byte xdata *) 0xF63B) ++#define r_reg_r_fccid_cci2_start_tone_12_8 0xF63B ++#define reg_r_fccid_cci2_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci2_start_tone_12_8_len 5 ++#define reg_r_fccid_cci2_start_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci2_end_tone_7_0 (*(volatile byte xdata *) 0xF63C) ++#define r_reg_r_fccid_cci2_end_tone_7_0 0xF63C ++#define reg_r_fccid_cci2_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci2_end_tone_7_0_len 8 ++#define reg_r_fccid_cci2_end_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci2_end_tone_12_8 (*(volatile byte xdata *) 0xF63D) ++#define r_reg_r_fccid_cci2_end_tone_12_8 0xF63D ++#define reg_r_fccid_cci2_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci2_end_tone_12_8_len 5 ++#define reg_r_fccid_cci2_end_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci2_peak_7_0 (*(volatile byte xdata *) 0xF63E) ++#define r_reg_r_fccid_cci2_peak_7_0 0xF63E ++#define reg_r_fccid_cci2_peak_7_0_pos 0 ++#define reg_r_fccid_cci2_peak_7_0_len 8 ++#define reg_r_fccid_cci2_peak_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci2_peak_15_8 (*(volatile byte xdata *) 0xF63F) ++#define r_reg_r_fccid_cci2_peak_15_8 0xF63F ++#define reg_r_fccid_cci2_peak_15_8_pos 0 ++#define reg_r_fccid_cci2_peak_15_8_len 8 ++#define reg_r_fccid_cci2_peak_15_8_lsb 8 ++#define xd_r_reg_r_fccid_cci3_start_tone_7_0 (*(volatile byte xdata *) 0xF640) ++#define r_reg_r_fccid_cci3_start_tone_7_0 0xF640 ++#define reg_r_fccid_cci3_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci3_start_tone_7_0_len 8 ++#define reg_r_fccid_cci3_start_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci3_start_tone_12_8 (*(volatile byte xdata *) 0xF641) ++#define r_reg_r_fccid_cci3_start_tone_12_8 0xF641 ++#define reg_r_fccid_cci3_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci3_start_tone_12_8_len 5 ++#define reg_r_fccid_cci3_start_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci3_end_tone_7_0 (*(volatile byte xdata *) 0xF642) ++#define r_reg_r_fccid_cci3_end_tone_7_0 0xF642 ++#define reg_r_fccid_cci3_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci3_end_tone_7_0_len 8 ++#define reg_r_fccid_cci3_end_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci3_end_tone_12_8 (*(volatile byte xdata *) 0xF643) ++#define r_reg_r_fccid_cci3_end_tone_12_8 0xF643 ++#define reg_r_fccid_cci3_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci3_end_tone_12_8_len 5 ++#define reg_r_fccid_cci3_end_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci3_peak_7_0 (*(volatile byte xdata *) 0xF644) ++#define r_reg_r_fccid_cci3_peak_7_0 0xF644 ++#define reg_r_fccid_cci3_peak_7_0_pos 0 ++#define reg_r_fccid_cci3_peak_7_0_len 8 ++#define reg_r_fccid_cci3_peak_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci3_peak_15_8 (*(volatile byte xdata *) 0xF645) ++#define r_reg_r_fccid_cci3_peak_15_8 0xF645 ++#define reg_r_fccid_cci3_peak_15_8_pos 0 ++#define reg_r_fccid_cci3_peak_15_8_len 8 ++#define reg_r_fccid_cci3_peak_15_8_lsb 8 ++#define xd_r_reg_r_fccid_cci4_start_tone_7_0 (*(volatile byte xdata *) 0xF646) ++#define r_reg_r_fccid_cci4_start_tone_7_0 0xF646 ++#define reg_r_fccid_cci4_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci4_start_tone_7_0_len 8 ++#define reg_r_fccid_cci4_start_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci4_start_tone_12_8 (*(volatile byte xdata *) 0xF647) ++#define r_reg_r_fccid_cci4_start_tone_12_8 0xF647 ++#define reg_r_fccid_cci4_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci4_start_tone_12_8_len 5 ++#define reg_r_fccid_cci4_start_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci4_end_tone_7_0 (*(volatile byte xdata *) 0xF648) ++#define r_reg_r_fccid_cci4_end_tone_7_0 0xF648 ++#define reg_r_fccid_cci4_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci4_end_tone_7_0_len 8 ++#define reg_r_fccid_cci4_end_tone_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci4_end_tone_12_8 (*(volatile byte xdata *) 0xF649) ++#define r_reg_r_fccid_cci4_end_tone_12_8 0xF649 ++#define reg_r_fccid_cci4_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci4_end_tone_12_8_len 5 ++#define reg_r_fccid_cci4_end_tone_12_8_lsb 8 ++#define xd_r_reg_r_fccid_cci4_peak_7_0 (*(volatile byte xdata *) 0xF64A) ++#define r_reg_r_fccid_cci4_peak_7_0 0xF64A ++#define reg_r_fccid_cci4_peak_7_0_pos 0 ++#define reg_r_fccid_cci4_peak_7_0_len 8 ++#define reg_r_fccid_cci4_peak_7_0_lsb 0 ++#define xd_r_reg_r_fccid_cci4_peak_15_8 (*(volatile byte xdata *) 0xF64B) ++#define r_reg_r_fccid_cci4_peak_15_8 0xF64B ++#define reg_r_fccid_cci4_peak_15_8_pos 0 ++#define reg_r_fccid_cci4_peak_15_8_len 8 ++#define reg_r_fccid_cci4_peak_15_8_lsb 8 ++#define xd_r_reg_r_fccid_cci1_rank (*(volatile byte xdata *) 0xF64C) ++#define r_reg_r_fccid_cci1_rank 0xF64C ++#define reg_r_fccid_cci1_rank_pos 0 ++#define reg_r_fccid_cci1_rank_len 3 ++#define reg_r_fccid_cci1_rank_lsb 0 ++#define xd_r_reg_r_fccid_cci2_rank (*(volatile byte xdata *) 0xF64D) ++#define r_reg_r_fccid_cci2_rank 0xF64D ++#define reg_r_fccid_cci2_rank_pos 0 ++#define reg_r_fccid_cci2_rank_len 3 ++#define reg_r_fccid_cci2_rank_lsb 0 ++#define xd_r_reg_r_fccid_cci3_rank (*(volatile byte xdata *) 0xF64E) ++#define r_reg_r_fccid_cci3_rank 0xF64E ++#define reg_r_fccid_cci3_rank_pos 0 ++#define reg_r_fccid_cci3_rank_len 3 ++#define reg_r_fccid_cci3_rank_lsb 0 ++#define xd_r_reg_r_fccid_cci4_rank (*(volatile byte xdata *) 0xF64F) ++#define r_reg_r_fccid_cci4_rank 0xF64F ++#define reg_r_fccid_cci4_rank_pos 0 ++#define reg_r_fccid_cci4_rank_len 3 ++#define reg_r_fccid_cci4_rank_lsb 0 ++#define xd_p_reg_p_csi_shift3 (*(volatile byte xdata *) 0xF650) ++#define p_reg_p_csi_shift3 0xF650 ++#define reg_p_csi_shift3_pos 0 ++#define reg_p_csi_shift3_len 4 ++#define reg_p_csi_shift3_lsb 0 ++#define xd_p_reg_p_csi_mul3 (*(volatile byte xdata *) 0xF651) ++#define p_reg_p_csi_mul3 0xF651 ++#define reg_p_csi_mul3_pos 0 ++#define reg_p_csi_mul3_len 8 ++#define reg_p_csi_mul3_lsb 0 ++#define xd_p_reg_p_csi_level3_7_0 (*(volatile byte xdata *) 0xF652) ++#define p_reg_p_csi_level3_7_0 0xF652 ++#define reg_p_csi_level3_7_0_pos 0 ++#define reg_p_csi_level3_7_0_len 8 ++#define reg_p_csi_level3_7_0_lsb 0 ++#define xd_p_reg_p_csi_level3_8 (*(volatile byte xdata *) 0xF653) ++#define p_reg_p_csi_level3_8 0xF653 ++#define reg_p_csi_level3_8_pos 0 ++#define reg_p_csi_level3_8_len 1 ++#define reg_p_csi_level3_8_lsb 8 ++#define xd_p_reg_p_csi_fftout_shift_fix_value (*(volatile byte xdata *) 0xF654) ++#define p_reg_p_csi_fftout_shift_fix_value 0xF654 ++#define reg_p_csi_fftout_shift_fix_value_pos 0 ++#define reg_p_csi_fftout_shift_fix_value_len 4 ++#define reg_p_csi_fftout_shift_fix_value_lsb 0 ++#define xd_p_reg_p_feq_scale_pow (*(volatile byte xdata *) 0xF655) ++#define p_reg_p_feq_scale_pow 0xF655 ++#define reg_p_feq_scale_pow_pos 0 ++#define reg_p_feq_scale_pow_len 6 ++#define reg_p_feq_scale_pow_lsb 0 ++#define xd_p_reg_p_csi_cp_idx (*(volatile byte xdata *) 0xF656) ++#define p_reg_p_csi_cp_idx 0xF656 ++#define reg_p_csi_cp_idx_pos 0 ++#define reg_p_csi_cp_idx_len 8 ++#define reg_p_csi_cp_idx_lsb 0 ++#define xd_p_reg_p_csi_outsh_zero_th_7_0 (*(volatile byte xdata *) 0xF657) ++#define p_reg_p_csi_outsh_zero_th_7_0 0xF657 ++#define reg_p_csi_outsh_zero_th_7_0_pos 0 ++#define reg_p_csi_outsh_zero_th_7_0_len 8 ++#define reg_p_csi_outsh_zero_th_7_0_lsb 0 ++#define xd_p_reg_p_csi_outsh_zero_th_10_8 (*(volatile byte xdata *) 0xF658) ++#define p_reg_p_csi_outsh_zero_th_10_8 0xF658 ++#define reg_p_csi_outsh_zero_th_10_8_pos 0 ++#define reg_p_csi_outsh_zero_th_10_8_len 3 ++#define reg_p_csi_outsh_zero_th_10_8_lsb 8 ++#define xd_p_reg_p_csi_ar_ratio (*(volatile byte xdata *) 0xF659) ++#define p_reg_p_csi_ar_ratio 0xF659 ++#define reg_p_csi_ar_ratio_pos 0 ++#define reg_p_csi_ar_ratio_len 8 ++#define reg_p_csi_ar_ratio_lsb 0 ++#define xd_p_reg_r_csi_cp_vld (*(volatile byte xdata *) 0xF65A) ++#define p_reg_r_csi_cp_vld 0xF65A ++#define reg_r_csi_cp_vld_pos 0 ++#define reg_r_csi_cp_vld_len 1 ++#define reg_r_csi_cp_vld_lsb 0 ++#define xd_p_reg_r_csi_sp_vld (*(volatile byte xdata *) 0xF65B) ++#define p_reg_r_csi_sp_vld 0xF65B ++#define reg_r_csi_sp_vld_pos 0 ++#define reg_r_csi_sp_vld_len 1 ++#define reg_r_csi_sp_vld_lsb 0 ++#define xd_p_reg_p_csi_fft_out_shift_en (*(volatile byte xdata *) 0xF65C) ++#define p_reg_p_csi_fft_out_shift_en 0xF65C ++#define reg_p_csi_fft_out_shift_en_pos 0 ++#define reg_p_csi_fft_out_shift_en_len 1 ++#define reg_p_csi_fft_out_shift_en_lsb 0 ++#define xd_p_reg_p_csi_feq_out_shift_en (*(volatile byte xdata *) 0xF65D) ++#define p_reg_p_csi_feq_out_shift_en 0xF65D ++#define reg_p_csi_feq_out_shift_en_pos 0 ++#define reg_p_csi_feq_out_shift_en_len 1 ++#define reg_p_csi_feq_out_shift_en_lsb 0 ++#define xd_p_reg_r_csi_cp_fft_out (*(volatile byte xdata *) 0xF65E) ++#define p_reg_r_csi_cp_fft_out 0xF65E ++#define reg_r_csi_cp_fft_out_pos 0 ++#define reg_r_csi_cp_fft_out_len 1 ++#define reg_r_csi_cp_fft_out_lsb 0 ++#define xd_p_reg_r_csi_sp_feq_log2_out (*(volatile byte xdata *) 0xF65F) ++#define p_reg_r_csi_sp_feq_log2_out 0xF65F ++#define reg_r_csi_sp_feq_log2_out_pos 0 ++#define reg_r_csi_sp_feq_log2_out_len 8 ++#define reg_r_csi_sp_feq_log2_out_lsb 0 ++#define xd_p_reg_r_csi_sp_fft_out (*(volatile byte xdata *) 0xF660) ++#define p_reg_r_csi_sp_fft_out 0xF660 ++#define reg_r_csi_sp_fft_out_pos 0 ++#define reg_r_csi_sp_fft_out_len 1 ++#define reg_r_csi_sp_fft_out_lsb 0 ++#define xd_p_reg_p_feq_eh2_from_fpcc_en (*(volatile byte xdata *) 0xF661) ++#define p_reg_p_feq_eh2_from_fpcc_en 0xF661 ++#define reg_p_feq_eh2_from_fpcc_en_pos 0 ++#define reg_p_feq_eh2_from_fpcc_en_len 1 ++#define reg_p_feq_eh2_from_fpcc_en_lsb 0 ++#define xd_r_reg_r_fccid_fft_ave_peak_7_0 (*(volatile byte xdata *) 0xF662) ++#define r_reg_r_fccid_fft_ave_peak_7_0 0xF662 ++#define reg_r_fccid_fft_ave_peak_7_0_pos 0 ++#define reg_r_fccid_fft_ave_peak_7_0_len 8 ++#define reg_r_fccid_fft_ave_peak_7_0_lsb 0 ++#define xd_r_reg_r_fccid_fft_ave_peak_15_8 (*(volatile byte xdata *) 0xF663) ++#define r_reg_r_fccid_fft_ave_peak_15_8 0xF663 ++#define reg_r_fccid_fft_ave_peak_15_8_pos 0 ++#define reg_r_fccid_fft_ave_peak_15_8_len 8 ++#define reg_r_fccid_fft_ave_peak_15_8_lsb 8 ++#define xd_r_reg_r_fccid_fft_ave_peak_23_16 (*(volatile byte xdata *) 0xF664) ++#define r_reg_r_fccid_fft_ave_peak_23_16 0xF664 ++#define reg_r_fccid_fft_ave_peak_23_16_pos 0 ++#define reg_r_fccid_fft_ave_peak_23_16_len 8 ++#define reg_r_fccid_fft_ave_peak_23_16_lsb 16 ++#define xd_r_reg_r_fccid_fft_ave_peak_26_24 (*(volatile byte xdata *) 0xF665) ++#define r_reg_r_fccid_fft_ave_peak_26_24 0xF665 ++#define reg_r_fccid_fft_ave_peak_26_24_pos 0 ++#define reg_r_fccid_fft_ave_peak_26_24_len 3 ++#define reg_r_fccid_fft_ave_peak_26_24_lsb 24 ++#define xd_p_reg_p_fccid_fft_ave_read_rdy (*(volatile byte xdata *) 0xF666) ++#define p_reg_p_fccid_fft_ave_read_rdy 0xF666 ++#define reg_p_fccid_fft_ave_read_rdy_pos 0 ++#define reg_p_fccid_fft_ave_read_rdy_len 1 ++#define reg_p_fccid_fft_ave_read_rdy_lsb 0 ++#define xd_p_reg_p_fccid_fft_ave_read_index_7_0 (*(volatile byte xdata *) 0xF667) ++#define p_reg_p_fccid_fft_ave_read_index_7_0 0xF667 ++#define reg_p_fccid_fft_ave_read_index_7_0_pos 0 ++#define reg_p_fccid_fft_ave_read_index_7_0_len 8 ++#define reg_p_fccid_fft_ave_read_index_7_0_lsb 0 ++#define xd_p_reg_p_fccid_fft_ave_read_index_12_8 (*(volatile byte xdata *) 0xF668) ++#define p_reg_p_fccid_fft_ave_read_index_12_8 0xF668 ++#define reg_p_fccid_fft_ave_read_index_12_8_pos 0 ++#define reg_p_fccid_fft_ave_read_index_12_8_len 5 ++#define reg_p_fccid_fft_ave_read_index_12_8_lsb 8 ++#define xd_p_reg_cdpf_candidate_rw (*(volatile byte xdata *) 0xF669) ++#define p_reg_cdpf_candidate_rw 0xF669 ++#define reg_cdpf_candidate_rw_pos 0 ++#define reg_cdpf_candidate_rw_len 1 ++#define reg_cdpf_candidate_rw_lsb 0 ++#define xd_p_reg_cdpf_candidate_prog_7_0 (*(volatile byte xdata *) 0xF66A) ++#define p_reg_cdpf_candidate_prog_7_0 0xF66A ++#define reg_cdpf_candidate_prog_7_0_pos 0 ++#define reg_cdpf_candidate_prog_7_0_len 8 ++#define reg_cdpf_candidate_prog_7_0_lsb 0 ++#define xd_p_reg_cdpf_candidate_prog_15_8 (*(volatile byte xdata *) 0xF66B) ++#define p_reg_cdpf_candidate_prog_15_8 0xF66B ++#define reg_cdpf_candidate_prog_15_8_pos 0 ++#define reg_cdpf_candidate_prog_15_8_len 8 ++#define reg_cdpf_candidate_prog_15_8_lsb 8 ++#define xd_p_reg_cdpf_candidateno_prog (*(volatile byte xdata *) 0xF66C) ++#define p_reg_cdpf_candidateno_prog 0xF66C ++#define reg_cdpf_candidateno_prog_pos 0 ++#define reg_cdpf_candidateno_prog_len 6 ++#define reg_cdpf_candidateno_prog_lsb 0 ++#define xd_p_reg_cdpf_candidateno_switch (*(volatile byte xdata *) 0xF66D) ++#define p_reg_cdpf_candidateno_switch 0xF66D ++#define reg_cdpf_candidateno_switch_pos 0 ++#define reg_cdpf_candidateno_switch_len 1 ++#define reg_cdpf_candidateno_switch_lsb 0 ++#define xd_g_reg_tpsd_txmod (*(volatile byte xdata *) 0xF900) ++#define g_reg_tpsd_txmod 0xF900 ++#define reg_tpsd_txmod_pos 0 ++#define reg_tpsd_txmod_len 2 ++#define reg_tpsd_txmod_lsb 0 ++#define xd_g_reg_tpsd_gi (*(volatile byte xdata *) 0xF901) ++#define g_reg_tpsd_gi 0xF901 ++#define reg_tpsd_gi_pos 0 ++#define reg_tpsd_gi_len 2 ++#define reg_tpsd_gi_lsb 0 ++#define xd_g_reg_tpsd_hier (*(volatile byte xdata *) 0xF902) ++#define g_reg_tpsd_hier 0xF902 ++#define reg_tpsd_hier_pos 0 ++#define reg_tpsd_hier_len 3 ++#define reg_tpsd_hier_lsb 0 ++#define xd_g_reg_tpsd_const (*(volatile byte xdata *) 0xF903) ++#define g_reg_tpsd_const 0xF903 ++#define reg_tpsd_const_pos 0 ++#define reg_tpsd_const_len 2 ++#define reg_tpsd_const_lsb 0 ++#define xd_g_reg_bw (*(volatile byte xdata *) 0xF904) ++#define g_reg_bw 0xF904 ++#define reg_bw_pos 0 ++#define reg_bw_len 2 ++#define reg_bw_lsb 0 ++#define xd_g_reg_dec_pri (*(volatile byte xdata *) 0xF905) ++#define g_reg_dec_pri 0xF905 ++#define reg_dec_pri_pos 0 ++#define reg_dec_pri_len 1 ++#define reg_dec_pri_lsb 0 ++#define xd_g_reg_tpsd_hpcr (*(volatile byte xdata *) 0xF906) ++#define g_reg_tpsd_hpcr 0xF906 ++#define reg_tpsd_hpcr_pos 0 ++#define reg_tpsd_hpcr_len 3 ++#define reg_tpsd_hpcr_lsb 0 ++#define xd_g_reg_tpsd_lpcr (*(volatile byte xdata *) 0xF907) ++#define g_reg_tpsd_lpcr 0xF907 ++#define reg_tpsd_lpcr_pos 0 ++#define reg_tpsd_lpcr_len 3 ++#define reg_tpsd_lpcr_lsb 0 ++#define xd_g_reg_tpsd_indep (*(volatile byte xdata *) 0xF908) ++#define g_reg_tpsd_indep 0xF908 ++#define reg_tpsd_indep_pos 0 ++#define reg_tpsd_indep_len 1 ++#define reg_tpsd_indep_lsb 0 ++#define xd_g_reg_tpsd_tslice (*(volatile byte xdata *) 0xF909) ++#define g_reg_tpsd_tslice 0xF909 ++#define reg_tpsd_tslice_pos 0 ++#define reg_tpsd_tslice_len 1 ++#define reg_tpsd_tslice_lsb 0 ++#define xd_g_reg_tpsd_mpefec (*(volatile byte xdata *) 0xF90A) ++#define g_reg_tpsd_mpefec 0xF90A ++#define reg_tpsd_mpefec_pos 0 ++#define reg_tpsd_mpefec_len 1 ++#define reg_tpsd_mpefec_lsb 0 ++#define xd_g_reg_sntc_en (*(volatile byte xdata *) 0xF90B) ++#define g_reg_sntc_en 0xF90B ++#define reg_sntc_en_pos 0 ++#define reg_sntc_en_len 1 ++#define reg_sntc_en_lsb 0 ++#define xd_g_reg_intp_sys_div (*(volatile byte xdata *) 0xF90C) ++#define g_reg_intp_sys_div 0xF90C ++#define reg_intp_sys_div_pos 0 ++#define reg_intp_sys_div_len 1 ++#define reg_intp_sys_div_lsb 0 ++#define xd_g_reg_clk_sntc_sel (*(volatile byte xdata *) 0xF90D) ++#define g_reg_clk_sntc_sel 0xF90D ++#define reg_clk_sntc_sel_pos 0 ++#define reg_clk_sntc_sel_len 3 ++#define reg_clk_sntc_sel_lsb 0 ++#define xd_p_reg_ce_gs_force (*(volatile byte xdata *) 0xFD00) ++#define p_reg_ce_gs_force 0xFD00 ++#define reg_ce_gs_force_pos 0 ++#define reg_ce_gs_force_len 1 ++#define reg_ce_gs_force_lsb 0 ++#define xd_p_reg_ce_dagcgain_delay (*(volatile byte xdata *) 0xFD01) ++#define p_reg_ce_dagcgain_delay 0xFD01 ++#define reg_ce_dagcgain_delay_pos 0 ++#define reg_ce_dagcgain_delay_len 2 ++#define reg_ce_dagcgain_delay_lsb 0 ++#define xd_p_reg_ce_derot_en (*(volatile byte xdata *) 0xFD02) ++#define p_reg_ce_derot_en 0xFD02 ++#define reg_ce_derot_en_pos 0 ++#define reg_ce_derot_en_len 1 ++#define reg_ce_derot_en_lsb 0 ++#define xd_p_reg_ce_fctrl_en (*(volatile byte xdata *) 0xFD05) ++#define p_reg_ce_fctrl_en 0xFD05 ++#define reg_ce_fctrl_en_pos 0 ++#define reg_ce_fctrl_en_len 1 ++#define reg_ce_fctrl_en_lsb 0 ++#define xd_p_reg_ce_en (*(volatile byte xdata *) 0xFD06) ++#define p_reg_ce_en 0xFD06 ++#define reg_ce_en_pos 0 ++#define reg_ce_en_len 1 ++#define reg_ce_en_lsb 0 ++#define xd_p_reg_ce_sat_wes (*(volatile byte xdata *) 0xFD07) ++#define p_reg_ce_sat_wes 0xFD07 ++#define reg_ce_sat_wes_pos 0 ++#define reg_ce_sat_wes_len 1 ++#define reg_ce_sat_wes_lsb 0 ++#define xd_p_reg_ce_sat_sigma2 (*(volatile byte xdata *) 0xFD08) ++#define p_reg_ce_sat_sigma2 0xFD08 ++#define reg_ce_sat_sigma2_pos 0 ++#define reg_ce_sat_sigma2_len 1 ++#define reg_ce_sat_sigma2_lsb 0 ++#define xd_p_reg_ce_sat_tdi_br_re (*(volatile byte xdata *) 0xFD09) ++#define p_reg_ce_sat_tdi_br_re 0xFD09 ++#define reg_ce_sat_tdi_br_re_pos 0 ++#define reg_ce_sat_tdi_br_re_len 1 ++#define reg_ce_sat_tdi_br_re_lsb 0 ++#define xd_p_reg_ce_sat_tdi_br_im (*(volatile byte xdata *) 0xFD0A) ++#define p_reg_ce_sat_tdi_br_im 0xFD0A ++#define reg_ce_sat_tdi_br_im_pos 0 ++#define reg_ce_sat_tdi_br_im_len 1 ++#define reg_ce_sat_tdi_br_im_lsb 0 ++#define xd_p_reg_ce_sat_tdi_ar_re (*(volatile byte xdata *) 0xFD0B) ++#define p_reg_ce_sat_tdi_ar_re 0xFD0B ++#define reg_ce_sat_tdi_ar_re_pos 0 ++#define reg_ce_sat_tdi_ar_re_len 1 ++#define reg_ce_sat_tdi_ar_re_lsb 0 ++#define xd_p_reg_ce_sat_tdi_ar_im (*(volatile byte xdata *) 0xFD0C) ++#define p_reg_ce_sat_tdi_ar_im 0xFD0C ++#define reg_ce_sat_tdi_ar_im_pos 0 ++#define reg_ce_sat_tdi_ar_im_len 1 ++#define reg_ce_sat_tdi_ar_im_lsb 0 ++#define xd_p_reg_ce_sat_fdi_br_re (*(volatile byte xdata *) 0xFD0D) ++#define p_reg_ce_sat_fdi_br_re 0xFD0D ++#define reg_ce_sat_fdi_br_re_pos 0 ++#define reg_ce_sat_fdi_br_re_len 1 ++#define reg_ce_sat_fdi_br_re_lsb 0 ++#define xd_p_reg_ce_sat_fdi_br_im (*(volatile byte xdata *) 0xFD0E) ++#define p_reg_ce_sat_fdi_br_im 0xFD0E ++#define reg_ce_sat_fdi_br_im_pos 0 ++#define reg_ce_sat_fdi_br_im_len 1 ++#define reg_ce_sat_fdi_br_im_lsb 0 ++#define xd_p_reg_ce_var_forced_value (*(volatile byte xdata *) 0xFD0F) ++#define p_reg_ce_var_forced_value 0xFD0F ++#define reg_ce_var_forced_value_pos 0 ++#define reg_ce_var_forced_value_len 3 ++#define reg_ce_var_forced_value_lsb 0 ++#define xd_p_reg_ce_s1 (*(volatile byte xdata *) 0xFD10) ++#define p_reg_ce_s1 0xFD10 ++#define reg_ce_s1_pos 0 ++#define reg_ce_s1_len 5 ++#define reg_ce_s1_lsb 0 ++#define xd_r_reg_ce_tdi_flatness_7_0 (*(volatile byte xdata *) 0xFD11) ++#define r_reg_ce_tdi_flatness_7_0 0xFD11 ++#define reg_ce_tdi_flatness_7_0_pos 0 ++#define reg_ce_tdi_flatness_7_0_len 8 ++#define reg_ce_tdi_flatness_7_0_lsb 0 ++#define xd_r_reg_ce_tdi_flatness_8 (*(volatile byte xdata *) 0xFD12) ++#define r_reg_ce_tdi_flatness_8 0xFD12 ++#define reg_ce_tdi_flatness_8_pos 0 ++#define reg_ce_tdi_flatness_8_len 1 ++#define reg_ce_tdi_flatness_8_lsb 8 ++#define xd_r_reg_ce_tone_7_0 (*(volatile byte xdata *) 0xFD13) ++#define r_reg_ce_tone_7_0 0xFD13 ++#define reg_ce_tone_7_0_pos 0 ++#define reg_ce_tone_7_0_len 8 ++#define reg_ce_tone_7_0_lsb 0 ++#define xd_r_reg_ce_tone_12_8 (*(volatile byte xdata *) 0xFD14) ++#define r_reg_ce_tone_12_8 0xFD14 ++#define reg_ce_tone_12_8_pos 0 ++#define reg_ce_tone_12_8_len 5 ++#define reg_ce_tone_12_8_lsb 8 ++#define xd_p_reg_ce_centroid_drift_th (*(volatile byte xdata *) 0xFD15) ++#define p_reg_ce_centroid_drift_th 0xFD15 ++#define reg_ce_centroid_drift_th_pos 0 ++#define reg_ce_centroid_drift_th_len 8 ++#define reg_ce_centroid_drift_th_lsb 0 ++#define xd_p_reg_ce_centroid_bias_inc_7_0 (*(volatile byte xdata *) 0xFD16) ++#define p_reg_ce_centroid_bias_inc_7_0 0xFD16 ++#define reg_ce_centroid_bias_inc_7_0_pos 0 ++#define reg_ce_centroid_bias_inc_7_0_len 8 ++#define reg_ce_centroid_bias_inc_7_0_lsb 0 ++#define xd_p_reg_ce_centroid_bias_inc_8 (*(volatile byte xdata *) 0xFD17) ++#define p_reg_ce_centroid_bias_inc_8 0xFD17 ++#define reg_ce_centroid_bias_inc_8_pos 0 ++#define reg_ce_centroid_bias_inc_8_len 1 ++#define reg_ce_centroid_bias_inc_8_lsb 8 ++#define xd_p_reg_ce_centroid_count_max (*(volatile byte xdata *) 0xFD18) ++#define p_reg_ce_centroid_count_max 0xFD18 ++#define reg_ce_centroid_count_max_pos 0 ++#define reg_ce_centroid_count_max_len 4 ++#define reg_ce_centroid_count_max_lsb 0 ++#define xd_p_reg_ce_var_th0_7_0 (*(volatile byte xdata *) 0xFD19) ++#define p_reg_ce_var_th0_7_0 0xFD19 ++#define reg_ce_var_th0_7_0_pos 0 ++#define reg_ce_var_th0_7_0_len 8 ++#define reg_ce_var_th0_7_0_lsb 0 ++#define xd_p_reg_ce_var_th0_15_8 (*(volatile byte xdata *) 0xFD1A) ++#define p_reg_ce_var_th0_15_8 0xFD1A ++#define reg_ce_var_th0_15_8_pos 0 ++#define reg_ce_var_th0_15_8_len 8 ++#define reg_ce_var_th0_15_8_lsb 8 ++#define xd_p_reg_ce_var_th1_7_0 (*(volatile byte xdata *) 0xFD1B) ++#define p_reg_ce_var_th1_7_0 0xFD1B ++#define reg_ce_var_th1_7_0_pos 0 ++#define reg_ce_var_th1_7_0_len 8 ++#define reg_ce_var_th1_7_0_lsb 0 ++#define xd_p_reg_ce_var_th1_15_8 (*(volatile byte xdata *) 0xFD1C) ++#define p_reg_ce_var_th1_15_8 0xFD1C ++#define reg_ce_var_th1_15_8_pos 0 ++#define reg_ce_var_th1_15_8_len 8 ++#define reg_ce_var_th1_15_8_lsb 8 ++#define xd_p_reg_ce_var_th2_7_0 (*(volatile byte xdata *) 0xFD1D) ++#define p_reg_ce_var_th2_7_0 0xFD1D ++#define reg_ce_var_th2_7_0_pos 0 ++#define reg_ce_var_th2_7_0_len 8 ++#define reg_ce_var_th2_7_0_lsb 0 ++#define xd_p_reg_ce_var_th2_15_8 (*(volatile byte xdata *) 0xFD1E) ++#define p_reg_ce_var_th2_15_8 0xFD1E ++#define reg_ce_var_th2_15_8_pos 0 ++#define reg_ce_var_th2_15_8_len 8 ++#define reg_ce_var_th2_15_8_lsb 8 ++#define xd_p_reg_ce_var_th3_7_0 (*(volatile byte xdata *) 0xFD1F) ++#define p_reg_ce_var_th3_7_0 0xFD1F ++#define reg_ce_var_th3_7_0_pos 0 ++#define reg_ce_var_th3_7_0_len 8 ++#define reg_ce_var_th3_7_0_lsb 0 ++#define xd_p_reg_ce_var_th3_15_8 (*(volatile byte xdata *) 0xFD20) ++#define p_reg_ce_var_th3_15_8 0xFD20 ++#define reg_ce_var_th3_15_8_pos 0 ++#define reg_ce_var_th3_15_8_len 8 ++#define reg_ce_var_th3_15_8_lsb 8 ++#define xd_p_reg_ce_var_th4_7_0 (*(volatile byte xdata *) 0xFD21) ++#define p_reg_ce_var_th4_7_0 0xFD21 ++#define reg_ce_var_th4_7_0_pos 0 ++#define reg_ce_var_th4_7_0_len 8 ++#define reg_ce_var_th4_7_0_lsb 0 ++#define xd_p_reg_ce_var_th4_15_8 (*(volatile byte xdata *) 0xFD22) ++#define p_reg_ce_var_th4_15_8 0xFD22 ++#define reg_ce_var_th4_15_8_pos 0 ++#define reg_ce_var_th4_15_8_len 8 ++#define reg_ce_var_th4_15_8_lsb 8 ++#define xd_p_reg_ce_var_th5_7_0 (*(volatile byte xdata *) 0xFD23) ++#define p_reg_ce_var_th5_7_0 0xFD23 ++#define reg_ce_var_th5_7_0_pos 0 ++#define reg_ce_var_th5_7_0_len 8 ++#define reg_ce_var_th5_7_0_lsb 0 ++#define xd_p_reg_ce_var_th5_15_8 (*(volatile byte xdata *) 0xFD24) ++#define p_reg_ce_var_th5_15_8 0xFD24 ++#define reg_ce_var_th5_15_8_pos 0 ++#define reg_ce_var_th5_15_8_len 8 ++#define reg_ce_var_th5_15_8_lsb 8 ++#define xd_p_reg_ce_var_th6_7_0 (*(volatile byte xdata *) 0xFD25) ++#define p_reg_ce_var_th6_7_0 0xFD25 ++#define reg_ce_var_th6_7_0_pos 0 ++#define reg_ce_var_th6_7_0_len 8 ++#define reg_ce_var_th6_7_0_lsb 0 ++#define xd_p_reg_ce_var_th6_15_8 (*(volatile byte xdata *) 0xFD26) ++#define p_reg_ce_var_th6_15_8 0xFD26 ++#define reg_ce_var_th6_15_8_pos 0 ++#define reg_ce_var_th6_15_8_len 8 ++#define reg_ce_var_th6_15_8_lsb 8 ++#define xd_p_reg_ce_var_max (*(volatile byte xdata *) 0xFD27) ++#define p_reg_ce_var_max 0xFD27 ++#define reg_ce_var_max_pos 0 ++#define reg_ce_var_max_len 3 ++#define reg_ce_var_max_lsb 0 ++#define xd_p_reg_ce_cent_forced_en (*(volatile byte xdata *) 0xFD28) ++#define p_reg_ce_cent_forced_en 0xFD28 ++#define reg_ce_cent_forced_en_pos 0 ++#define reg_ce_cent_forced_en_len 1 ++#define reg_ce_cent_forced_en_lsb 0 ++#define xd_p_reg_ce_var_forced_en (*(volatile byte xdata *) 0xFD29) ++#define p_reg_ce_var_forced_en 0xFD29 ++#define reg_ce_var_forced_en_pos 0 ++#define reg_ce_var_forced_en_len 1 ++#define reg_ce_var_forced_en_lsb 0 ++#define xd_p_reg_ce_fctrl_auto_reset_en (*(volatile byte xdata *) 0xFD2A) ++#define p_reg_ce_fctrl_auto_reset_en 0xFD2A ++#define reg_ce_fctrl_auto_reset_en_pos 0 ++#define reg_ce_fctrl_auto_reset_en_len 1 ++#define reg_ce_fctrl_auto_reset_en_lsb 0 ++#define xd_p_reg_ce_cent_auto_clr_en (*(volatile byte xdata *) 0xFD2B) ++#define p_reg_ce_cent_auto_clr_en 0xFD2B ++#define reg_ce_cent_auto_clr_en_pos 0 ++#define reg_ce_cent_auto_clr_en_len 1 ++#define reg_ce_cent_auto_clr_en_lsb 0 ++#define xd_p_reg_ce_fctrl_reset (*(volatile byte xdata *) 0xFD2C) ++#define p_reg_ce_fctrl_reset 0xFD2C ++#define reg_ce_fctrl_reset_pos 0 ++#define reg_ce_fctrl_reset_len 1 ++#define reg_ce_fctrl_reset_lsb 0 ++#define xd_p_reg_ce_cent_forced_value_7_0 (*(volatile byte xdata *) 0xFD2D) ++#define p_reg_ce_cent_forced_value_7_0 0xFD2D ++#define reg_ce_cent_forced_value_7_0_pos 0 ++#define reg_ce_cent_forced_value_7_0_len 8 ++#define reg_ce_cent_forced_value_7_0_lsb 0 ++#define xd_p_reg_ce_cent_forced_value_11_8 (*(volatile byte xdata *) 0xFD2E) ++#define p_reg_ce_cent_forced_value_11_8 0xFD2E ++#define reg_ce_cent_forced_value_11_8_pos 0 ++#define reg_ce_cent_forced_value_11_8_len 4 ++#define reg_ce_cent_forced_value_11_8_lsb 8 ++#define xd_p_reg_ce_cent_auto_clr_value_7_0 (*(volatile byte xdata *) 0xFD2F) ++#define p_reg_ce_cent_auto_clr_value_7_0 0xFD2F ++#define reg_ce_cent_auto_clr_value_7_0_pos 0 ++#define reg_ce_cent_auto_clr_value_7_0_len 8 ++#define reg_ce_cent_auto_clr_value_7_0_lsb 0 ++#define xd_p_reg_ce_cent_auto_clr_value_11_8 (*(volatile byte xdata *) 0xFD30) ++#define p_reg_ce_cent_auto_clr_value_11_8 0xFD30 ++#define reg_ce_cent_auto_clr_value_11_8_pos 0 ++#define reg_ce_cent_auto_clr_value_11_8_len 4 ++#define reg_ce_cent_auto_clr_value_11_8_lsb 8 ++#define xd_p_reg_ce_centroid_max_7_0 (*(volatile byte xdata *) 0xFD31) ++#define p_reg_ce_centroid_max_7_0 0xFD31 ++#define reg_ce_centroid_max_7_0_pos 0 ++#define reg_ce_centroid_max_7_0_len 8 ++#define reg_ce_centroid_max_7_0_lsb 0 ++#define xd_p_reg_ce_centroid_max_11_8 (*(volatile byte xdata *) 0xFD32) ++#define p_reg_ce_centroid_max_11_8 0xFD32 ++#define reg_ce_centroid_max_11_8_pos 0 ++#define reg_ce_centroid_max_11_8_len 4 ++#define reg_ce_centroid_max_11_8_lsb 8 ++#define xd_p_reg_ce_fctrl_rd (*(volatile byte xdata *) 0xFD33) ++#define p_reg_ce_fctrl_rd 0xFD33 ++#define reg_ce_fctrl_rd_pos 0 ++#define reg_ce_fctrl_rd_len 1 ++#define reg_ce_fctrl_rd_lsb 0 ++#define xd_r_reg_ce_centroid_out_7_0 (*(volatile byte xdata *) 0xFD34) ++#define r_reg_ce_centroid_out_7_0 0xFD34 ++#define reg_ce_centroid_out_7_0_pos 0 ++#define reg_ce_centroid_out_7_0_len 8 ++#define reg_ce_centroid_out_7_0_lsb 0 ++#define xd_r_reg_ce_centroid_out_11_8 (*(volatile byte xdata *) 0xFD35) ++#define r_reg_ce_centroid_out_11_8 0xFD35 ++#define reg_ce_centroid_out_11_8_pos 0 ++#define reg_ce_centroid_out_11_8_len 4 ++#define reg_ce_centroid_out_11_8_lsb 8 ++#define xd_r_reg_ce_fctrl_rdy (*(volatile byte xdata *) 0xFD36) ++#define r_reg_ce_fctrl_rdy 0xFD36 ++#define reg_ce_fctrl_rdy_pos 0 ++#define reg_ce_fctrl_rdy_len 1 ++#define reg_ce_fctrl_rdy_lsb 0 ++#define xd_r_reg_ce_var (*(volatile byte xdata *) 0xFD37) ++#define r_reg_ce_var 0xFD37 ++#define reg_ce_var_pos 0 ++#define reg_ce_var_len 3 ++#define reg_ce_var_lsb 0 ++#define xd_r_reg_ce_bias_7_0 (*(volatile byte xdata *) 0xFD38) ++#define r_reg_ce_bias_7_0 0xFD38 ++#define reg_ce_bias_7_0_pos 0 ++#define reg_ce_bias_7_0_len 8 ++#define reg_ce_bias_7_0_lsb 0 ++#define xd_r_reg_ce_bias_11_8 (*(volatile byte xdata *) 0xFD39) ++#define r_reg_ce_bias_11_8 0xFD39 ++#define reg_ce_bias_11_8_pos 0 ++#define reg_ce_bias_11_8_len 4 ++#define reg_ce_bias_11_8_lsb 8 ++#define xd_r_reg_ce_m1_7_0 (*(volatile byte xdata *) 0xFD3A) ++#define r_reg_ce_m1_7_0 0xFD3A ++#define reg_ce_m1_7_0_pos 0 ++#define reg_ce_m1_7_0_len 8 ++#define reg_ce_m1_7_0_lsb 0 ++#define xd_r_reg_ce_m1_11_8 (*(volatile byte xdata *) 0xFD3B) ++#define r_reg_ce_m1_11_8 0xFD3B ++#define reg_ce_m1_11_8_pos 0 ++#define reg_ce_m1_11_8_len 4 ++#define reg_ce_m1_11_8_lsb 8 ++#define xd_r_reg_ce_rh0_7_0 (*(volatile byte xdata *) 0xFD3C) ++#define r_reg_ce_rh0_7_0 0xFD3C ++#define reg_ce_rh0_7_0_pos 0 ++#define reg_ce_rh0_7_0_len 8 ++#define reg_ce_rh0_7_0_lsb 0 ++#define xd_r_reg_ce_rh0_15_8 (*(volatile byte xdata *) 0xFD3D) ++#define r_reg_ce_rh0_15_8 0xFD3D ++#define reg_ce_rh0_15_8_pos 0 ++#define reg_ce_rh0_15_8_len 8 ++#define reg_ce_rh0_15_8_lsb 8 ++#define xd_r_reg_ce_rh0_23_16 (*(volatile byte xdata *) 0xFD3E) ++#define r_reg_ce_rh0_23_16 0xFD3E ++#define reg_ce_rh0_23_16_pos 0 ++#define reg_ce_rh0_23_16_len 8 ++#define reg_ce_rh0_23_16_lsb 16 ++#define xd_r_reg_ce_rh0_31_24 (*(volatile byte xdata *) 0xFD3F) ++#define r_reg_ce_rh0_31_24 0xFD3F ++#define reg_ce_rh0_31_24_pos 0 ++#define reg_ce_rh0_31_24_len 8 ++#define reg_ce_rh0_31_24_lsb 24 ++#define xd_p_reg_ce_tdi_delta (*(volatile byte xdata *) 0xFD40) ++#define p_reg_ce_tdi_delta 0xFD40 ++#define reg_ce_tdi_delta_pos 0 ++#define reg_ce_tdi_delta_len 3 ++#define reg_ce_tdi_delta_lsb 0 ++#define xd_p_reg_ce_fdi_delta (*(volatile byte xdata *) 0xFD41) ++#define p_reg_ce_fdi_delta 0xFD41 ++#define reg_ce_fdi_delta_pos 0 ++#define reg_ce_fdi_delta_len 3 ++#define reg_ce_fdi_delta_lsb 0 ++#define xd_p_reg_ce_fste_delta (*(volatile byte xdata *) 0xFD42) ++#define p_reg_ce_fste_delta 0xFD42 ++#define reg_ce_fste_delta_pos 0 ++#define reg_ce_fste_delta_len 3 ++#define reg_ce_fste_delta_lsb 0 ++#define xd_r_reg_ce_fft_s1 (*(volatile byte xdata *) 0xFD43) ++#define r_reg_ce_fft_s1 0xFD43 ++#define reg_ce_fft_s1_pos 0 ++#define reg_ce_fft_s1_len 4 ++#define reg_ce_fft_s1_lsb 0 ++#define xd_r_reg_feq_fix_eh2_7_0 (*(volatile byte xdata *) 0xFD44) ++#define r_reg_feq_fix_eh2_7_0 0xFD44 ++#define reg_feq_fix_eh2_7_0_pos 0 ++#define reg_feq_fix_eh2_7_0_len 8 ++#define reg_feq_fix_eh2_7_0_lsb 0 ++#define xd_r_reg_feq_fix_eh2_15_8 (*(volatile byte xdata *) 0xFD45) ++#define r_reg_feq_fix_eh2_15_8 0xFD45 ++#define reg_feq_fix_eh2_15_8_pos 0 ++#define reg_feq_fix_eh2_15_8_len 8 ++#define reg_feq_fix_eh2_15_8_lsb 8 ++#define xd_r_reg_feq_fix_eh2_23_16 (*(volatile byte xdata *) 0xFD46) ++#define r_reg_feq_fix_eh2_23_16 0xFD46 ++#define reg_feq_fix_eh2_23_16_pos 0 ++#define reg_feq_fix_eh2_23_16_len 8 ++#define reg_feq_fix_eh2_23_16_lsb 16 ++#define xd_r_reg_feq_fix_eh2_31_24 (*(volatile byte xdata *) 0xFD47) ++#define r_reg_feq_fix_eh2_31_24 0xFD47 ++#define reg_feq_fix_eh2_31_24_pos 0 ++#define reg_feq_fix_eh2_31_24_len 8 ++#define reg_feq_fix_eh2_31_24_lsb 24 ++#define xd_r_reg_ce_m2_central_7_0 (*(volatile byte xdata *) 0xFD48) ++#define r_reg_ce_m2_central_7_0 0xFD48 ++#define reg_ce_m2_central_7_0_pos 0 ++#define reg_ce_m2_central_7_0_len 8 ++#define reg_ce_m2_central_7_0_lsb 0 ++#define xd_r_reg_ce_m2_central_15_8 (*(volatile byte xdata *) 0xFD49) ++#define r_reg_ce_m2_central_15_8 0xFD49 ++#define reg_ce_m2_central_15_8_pos 0 ++#define reg_ce_m2_central_15_8_len 8 ++#define reg_ce_m2_central_15_8_lsb 8 ++#define xd_r_reg_ce_sigma2_7_0 (*(volatile byte xdata *) 0xFD4A) ++#define r_reg_ce_sigma2_7_0 0xFD4A ++#define reg_ce_sigma2_7_0_pos 0 ++#define reg_ce_sigma2_7_0_len 8 ++#define reg_ce_sigma2_7_0_lsb 0 ++#define xd_r_reg_ce_sigma2_15_8 (*(volatile byte xdata *) 0xFD4B) ++#define r_reg_ce_sigma2_15_8 0xFD4B ++#define reg_ce_sigma2_15_8_pos 0 ++#define reg_ce_sigma2_15_8_len 8 ++#define reg_ce_sigma2_15_8_lsb 8 ++#define xd_r_reg_ce_sigma2_19_16 (*(volatile byte xdata *) 0xFD4C) ++#define r_reg_ce_sigma2_19_16 0xFD4C ++#define reg_ce_sigma2_19_16_pos 0 ++#define reg_ce_sigma2_19_16_len 4 ++#define reg_ce_sigma2_19_16_lsb 16 ++#define xd_r_reg_ce_data_im_7_0 (*(volatile byte xdata *) 0xFD4D) ++#define r_reg_ce_data_im_7_0 0xFD4D ++#define reg_ce_data_im_7_0_pos 0 ++#define reg_ce_data_im_7_0_len 8 ++#define reg_ce_data_im_7_0_lsb 0 ++#define xd_r_reg_ce_data_im_14_8 (*(volatile byte xdata *) 0xFD4E) ++#define r_reg_ce_data_im_14_8 0xFD4E ++#define reg_ce_data_im_14_8_pos 0 ++#define reg_ce_data_im_14_8_len 7 ++#define reg_ce_data_im_14_8_lsb 8 ++#define xd_r_reg_ce_data_re_7_0 (*(volatile byte xdata *) 0xFD4F) ++#define r_reg_ce_data_re_7_0 0xFD4F ++#define reg_ce_data_re_7_0_pos 0 ++#define reg_ce_data_re_7_0_len 8 ++#define reg_ce_data_re_7_0_lsb 0 ++#define xd_r_reg_ce_data_re_14_8 (*(volatile byte xdata *) 0xFD50) ++#define r_reg_ce_data_re_14_8 0xFD50 ++#define reg_ce_data_re_14_8_pos 0 ++#define reg_ce_data_re_14_8_len 7 ++#define reg_ce_data_re_14_8_lsb 8 ++#define xd_p_reg_ce_var_default_value (*(volatile byte xdata *) 0xFD51) ++#define p_reg_ce_var_default_value 0xFD51 ++#define reg_ce_var_default_value_pos 0 ++#define reg_ce_var_default_value_len 3 ++#define reg_ce_var_default_value_lsb 0 ++#define xd_p_reg_ce_cent_default_value_7_0 (*(volatile byte xdata *) 0xFD52) ++#define p_reg_ce_cent_default_value_7_0 0xFD52 ++#define reg_ce_cent_default_value_7_0_pos 0 ++#define reg_ce_cent_default_value_7_0_len 8 ++#define reg_ce_cent_default_value_7_0_lsb 0 ++#define xd_p_reg_ce_cent_default_value_11_8 (*(volatile byte xdata *) 0xFD53) ++#define p_reg_ce_cent_default_value_11_8 0xFD53 ++#define reg_ce_cent_default_value_11_8_pos 0 ++#define reg_ce_cent_default_value_11_8_len 4 ++#define reg_ce_cent_default_value_11_8_lsb 8 ++#define xd_r_reg_ce_var_hw (*(volatile byte xdata *) 0xFD54) ++#define r_reg_ce_var_hw 0xFD54 ++#define reg_ce_var_hw_pos 0 ++#define reg_ce_var_hw_len 3 ++#define reg_ce_var_hw_lsb 0 ++#define xd_r_reg_ce_cent_hw_7_0 (*(volatile byte xdata *) 0xFD55) ++#define r_reg_ce_cent_hw_7_0 0xFD55 ++#define reg_ce_cent_hw_7_0_pos 0 ++#define reg_ce_cent_hw_7_0_len 8 ++#define reg_ce_cent_hw_7_0_lsb 0 ++#define xd_r_reg_ce_cent_hw_11_8 (*(volatile byte xdata *) 0xFD56) ++#define r_reg_ce_cent_hw_11_8 0xFD56 ++#define reg_ce_cent_hw_11_8_pos 0 ++#define reg_ce_cent_hw_11_8_len 4 ++#define reg_ce_cent_hw_11_8_lsb 8 ++#define xd_p_reg_ce_fdi_cp_test_en (*(volatile byte xdata *) 0xFD57) ++#define p_reg_ce_fdi_cp_test_en 0xFD57 ++#define reg_ce_fdi_cp_test_en_pos 0 ++#define reg_ce_fdi_cp_test_en_len 1 ++#define reg_ce_fdi_cp_test_en_lsb 0 ++#define xd_p_reg_ce_cptestindex0_7_0 (*(volatile byte xdata *) 0xFD58) ++#define p_reg_ce_cptestindex0_7_0 0xFD58 ++#define reg_ce_cptestindex0_7_0_pos 0 ++#define reg_ce_cptestindex0_7_0_len 8 ++#define reg_ce_cptestindex0_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex0_12_8 (*(volatile byte xdata *) 0xFD59) ++#define p_reg_ce_cptestindex0_12_8 0xFD59 ++#define reg_ce_cptestindex0_12_8_pos 0 ++#define reg_ce_cptestindex0_12_8_len 5 ++#define reg_ce_cptestindex0_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi0 (*(volatile byte xdata *) 0xFD5A) ++#define p_reg_ce_cptestfdi0 0xFD5A ++#define reg_ce_cptestfdi0_pos 0 ++#define reg_ce_cptestfdi0_len 3 ++#define reg_ce_cptestfdi0_lsb 0 ++#define xd_p_reg_ce_cptestindex1_7_0 (*(volatile byte xdata *) 0xFD5B) ++#define p_reg_ce_cptestindex1_7_0 0xFD5B ++#define reg_ce_cptestindex1_7_0_pos 0 ++#define reg_ce_cptestindex1_7_0_len 8 ++#define reg_ce_cptestindex1_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex1_12_8 (*(volatile byte xdata *) 0xFD5C) ++#define p_reg_ce_cptestindex1_12_8 0xFD5C ++#define reg_ce_cptestindex1_12_8_pos 0 ++#define reg_ce_cptestindex1_12_8_len 5 ++#define reg_ce_cptestindex1_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi1 (*(volatile byte xdata *) 0xFD5D) ++#define p_reg_ce_cptestfdi1 0xFD5D ++#define reg_ce_cptestfdi1_pos 0 ++#define reg_ce_cptestfdi1_len 3 ++#define reg_ce_cptestfdi1_lsb 0 ++#define xd_p_reg_ce_cptestindex2_7_0 (*(volatile byte xdata *) 0xFD5E) ++#define p_reg_ce_cptestindex2_7_0 0xFD5E ++#define reg_ce_cptestindex2_7_0_pos 0 ++#define reg_ce_cptestindex2_7_0_len 8 ++#define reg_ce_cptestindex2_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex2_12_8 (*(volatile byte xdata *) 0xFD5F) ++#define p_reg_ce_cptestindex2_12_8 0xFD5F ++#define reg_ce_cptestindex2_12_8_pos 0 ++#define reg_ce_cptestindex2_12_8_len 5 ++#define reg_ce_cptestindex2_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi2 (*(volatile byte xdata *) 0xFD60) ++#define p_reg_ce_cptestfdi2 0xFD60 ++#define reg_ce_cptestfdi2_pos 0 ++#define reg_ce_cptestfdi2_len 3 ++#define reg_ce_cptestfdi2_lsb 0 ++#define xd_p_reg_ce_cptestindex3_7_0 (*(volatile byte xdata *) 0xFD61) ++#define p_reg_ce_cptestindex3_7_0 0xFD61 ++#define reg_ce_cptestindex3_7_0_pos 0 ++#define reg_ce_cptestindex3_7_0_len 8 ++#define reg_ce_cptestindex3_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex3_12_8 (*(volatile byte xdata *) 0xFD62) ++#define p_reg_ce_cptestindex3_12_8 0xFD62 ++#define reg_ce_cptestindex3_12_8_pos 0 ++#define reg_ce_cptestindex3_12_8_len 5 ++#define reg_ce_cptestindex3_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi3 (*(volatile byte xdata *) 0xFD63) ++#define p_reg_ce_cptestfdi3 0xFD63 ++#define reg_ce_cptestfdi3_pos 0 ++#define reg_ce_cptestfdi3_len 3 ++#define reg_ce_cptestfdi3_lsb 0 ++#define xd_p_reg_ce_cptestindex4_7_0 (*(volatile byte xdata *) 0xFD64) ++#define p_reg_ce_cptestindex4_7_0 0xFD64 ++#define reg_ce_cptestindex4_7_0_pos 0 ++#define reg_ce_cptestindex4_7_0_len 8 ++#define reg_ce_cptestindex4_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex4_12_8 (*(volatile byte xdata *) 0xFD65) ++#define p_reg_ce_cptestindex4_12_8 0xFD65 ++#define reg_ce_cptestindex4_12_8_pos 0 ++#define reg_ce_cptestindex4_12_8_len 5 ++#define reg_ce_cptestindex4_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi4 (*(volatile byte xdata *) 0xFD66) ++#define p_reg_ce_cptestfdi4 0xFD66 ++#define reg_ce_cptestfdi4_pos 0 ++#define reg_ce_cptestfdi4_len 3 ++#define reg_ce_cptestfdi4_lsb 0 ++#define xd_p_reg_ce_cptestindex5_7_0 (*(volatile byte xdata *) 0xFD67) ++#define p_reg_ce_cptestindex5_7_0 0xFD67 ++#define reg_ce_cptestindex5_7_0_pos 0 ++#define reg_ce_cptestindex5_7_0_len 8 ++#define reg_ce_cptestindex5_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex5_12_8 (*(volatile byte xdata *) 0xFD68) ++#define p_reg_ce_cptestindex5_12_8 0xFD68 ++#define reg_ce_cptestindex5_12_8_pos 0 ++#define reg_ce_cptestindex5_12_8_len 5 ++#define reg_ce_cptestindex5_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi5 (*(volatile byte xdata *) 0xFD69) ++#define p_reg_ce_cptestfdi5 0xFD69 ++#define reg_ce_cptestfdi5_pos 0 ++#define reg_ce_cptestfdi5_len 3 ++#define reg_ce_cptestfdi5_lsb 0 ++#define xd_p_reg_ce_cptestindex6_7_0 (*(volatile byte xdata *) 0xFD6A) ++#define p_reg_ce_cptestindex6_7_0 0xFD6A ++#define reg_ce_cptestindex6_7_0_pos 0 ++#define reg_ce_cptestindex6_7_0_len 8 ++#define reg_ce_cptestindex6_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex6_12_8 (*(volatile byte xdata *) 0xFD6B) ++#define p_reg_ce_cptestindex6_12_8 0xFD6B ++#define reg_ce_cptestindex6_12_8_pos 0 ++#define reg_ce_cptestindex6_12_8_len 5 ++#define reg_ce_cptestindex6_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi6 (*(volatile byte xdata *) 0xFD6C) ++#define p_reg_ce_cptestfdi6 0xFD6C ++#define reg_ce_cptestfdi6_pos 0 ++#define reg_ce_cptestfdi6_len 3 ++#define reg_ce_cptestfdi6_lsb 0 ++#define xd_p_reg_ce_cptestindex7_7_0 (*(volatile byte xdata *) 0xFD6D) ++#define p_reg_ce_cptestindex7_7_0 0xFD6D ++#define reg_ce_cptestindex7_7_0_pos 0 ++#define reg_ce_cptestindex7_7_0_len 8 ++#define reg_ce_cptestindex7_7_0_lsb 0 ++#define xd_p_reg_ce_cptestindex7_12_8 (*(volatile byte xdata *) 0xFD6E) ++#define p_reg_ce_cptestindex7_12_8 0xFD6E ++#define reg_ce_cptestindex7_12_8_pos 0 ++#define reg_ce_cptestindex7_12_8_len 5 ++#define reg_ce_cptestindex7_12_8_lsb 8 ++#define xd_p_reg_ce_cptestfdi7 (*(volatile byte xdata *) 0xFD6F) ++#define p_reg_ce_cptestfdi7 0xFD6F ++#define reg_ce_cptestfdi7_pos 0 ++#define reg_ce_cptestfdi7_len 3 ++#define reg_ce_cptestfdi7_lsb 0 ++#define xd_p_reg_ce_cp_replace_tdiout_en (*(volatile byte xdata *) 0xFD74) ++#define p_reg_ce_cp_replace_tdiout_en 0xFD74 ++#define reg_ce_cp_replace_tdiout_en_pos 0 ++#define reg_ce_cp_replace_tdiout_en_len 1 ++#define reg_ce_cp_replace_tdiout_en_lsb 0 ++#define xd_p_reg_ce_tdi_mask0_en (*(volatile byte xdata *) 0xFD7D) ++#define p_reg_ce_tdi_mask0_en 0xFD7D ++#define reg_ce_tdi_mask0_en_pos 0 ++#define reg_ce_tdi_mask0_en_len 1 ++#define reg_ce_tdi_mask0_en_lsb 0 ++#define xd_p_reg_ce_tdi_mask_from0_7_0 (*(volatile byte xdata *) 0xFD7E) ++#define p_reg_ce_tdi_mask_from0_7_0 0xFD7E ++#define reg_ce_tdi_mask_from0_7_0_pos 0 ++#define reg_ce_tdi_mask_from0_7_0_len 8 ++#define reg_ce_tdi_mask_from0_7_0_lsb 0 ++#define xd_p_reg_ce_tdi_mask_from0_12_8 (*(volatile byte xdata *) 0xFD7F) ++#define p_reg_ce_tdi_mask_from0_12_8 0xFD7F ++#define reg_ce_tdi_mask_from0_12_8_pos 0 ++#define reg_ce_tdi_mask_from0_12_8_len 5 ++#define reg_ce_tdi_mask_from0_12_8_lsb 8 ++#define xd_p_reg_ce_tdi_mask_to0_7_0 (*(volatile byte xdata *) 0xFD80) ++#define p_reg_ce_tdi_mask_to0_7_0 0xFD80 ++#define reg_ce_tdi_mask_to0_7_0_pos 0 ++#define reg_ce_tdi_mask_to0_7_0_len 8 ++#define reg_ce_tdi_mask_to0_7_0_lsb 0 ++#define xd_p_reg_ce_tdi_mask_to0_12_8 (*(volatile byte xdata *) 0xFD81) ++#define p_reg_ce_tdi_mask_to0_12_8 0xFD81 ++#define reg_ce_tdi_mask_to0_12_8_pos 0 ++#define reg_ce_tdi_mask_to0_12_8_len 5 ++#define reg_ce_tdi_mask_to0_12_8_lsb 8 ++#define xd_p_reg_ce_tdi_mask1_en (*(volatile byte xdata *) 0xFD82) ++#define p_reg_ce_tdi_mask1_en 0xFD82 ++#define reg_ce_tdi_mask1_en_pos 0 ++#define reg_ce_tdi_mask1_en_len 1 ++#define reg_ce_tdi_mask1_en_lsb 0 ++#define xd_p_reg_ce_tdi_mask_from1_7_0 (*(volatile byte xdata *) 0xFD83) ++#define p_reg_ce_tdi_mask_from1_7_0 0xFD83 ++#define reg_ce_tdi_mask_from1_7_0_pos 0 ++#define reg_ce_tdi_mask_from1_7_0_len 8 ++#define reg_ce_tdi_mask_from1_7_0_lsb 0 ++#define xd_p_reg_ce_tdi_mask_from1_12_8 (*(volatile byte xdata *) 0xFD84) ++#define p_reg_ce_tdi_mask_from1_12_8 0xFD84 ++#define reg_ce_tdi_mask_from1_12_8_pos 0 ++#define reg_ce_tdi_mask_from1_12_8_len 5 ++#define reg_ce_tdi_mask_from1_12_8_lsb 8 ++#define xd_p_reg_ce_tdi_mask_to1_7_0 (*(volatile byte xdata *) 0xFD85) ++#define p_reg_ce_tdi_mask_to1_7_0 0xFD85 ++#define reg_ce_tdi_mask_to1_7_0_pos 0 ++#define reg_ce_tdi_mask_to1_7_0_len 8 ++#define reg_ce_tdi_mask_to1_7_0_lsb 0 ++#define xd_p_reg_ce_tdi_mask_to1_12_8 (*(volatile byte xdata *) 0xFD86) ++#define p_reg_ce_tdi_mask_to1_12_8 0xFD86 ++#define reg_ce_tdi_mask_to1_12_8_pos 0 ++#define reg_ce_tdi_mask_to1_12_8_len 5 ++#define reg_ce_tdi_mask_to1_12_8_lsb 8 ++#define xd_p_reg_ce_2nd_var_max (*(volatile byte xdata *) 0xFD87) ++#define p_reg_ce_2nd_var_max 0xFD87 ++#define reg_ce_2nd_var_max_pos 0 ++#define reg_ce_2nd_var_max_len 3 ++#define reg_ce_2nd_var_max_lsb 0 ++#define xd_p_reg_ce_2nd_cent_forced_en (*(volatile byte xdata *) 0xFD88) ++#define p_reg_ce_2nd_cent_forced_en 0xFD88 ++#define reg_ce_2nd_cent_forced_en_pos 0 ++#define reg_ce_2nd_cent_forced_en_len 1 ++#define reg_ce_2nd_cent_forced_en_lsb 0 ++#define xd_p_reg_ce_2nd_var_forced_en (*(volatile byte xdata *) 0xFD89) ++#define p_reg_ce_2nd_var_forced_en 0xFD89 ++#define reg_ce_2nd_var_forced_en_pos 0 ++#define reg_ce_2nd_var_forced_en_len 1 ++#define reg_ce_2nd_var_forced_en_lsb 0 ++#define xd_p_reg_ce_2nd_fctrl_auto_reset_en (*(volatile byte xdata *) 0xFD8A) ++#define p_reg_ce_2nd_fctrl_auto_reset_en 0xFD8A ++#define reg_ce_2nd_fctrl_auto_reset_en_pos 0 ++#define reg_ce_2nd_fctrl_auto_reset_en_len 1 ++#define reg_ce_2nd_fctrl_auto_reset_en_lsb 0 ++#define xd_p_reg_ce_2nd_cent_auto_clr_en (*(volatile byte xdata *) 0xFD8B) ++#define p_reg_ce_2nd_cent_auto_clr_en 0xFD8B ++#define reg_ce_2nd_cent_auto_clr_en_pos 0 ++#define reg_ce_2nd_cent_auto_clr_en_len 1 ++#define reg_ce_2nd_cent_auto_clr_en_lsb 0 ++#define xd_p_reg_ce_2nd_cent_forced_value_7_0 (*(volatile byte xdata *) 0xFD8C) ++#define p_reg_ce_2nd_cent_forced_value_7_0 0xFD8C ++#define reg_ce_2nd_cent_forced_value_7_0_pos 0 ++#define reg_ce_2nd_cent_forced_value_7_0_len 8 ++#define reg_ce_2nd_cent_forced_value_7_0_lsb 0 ++#define xd_p_reg_ce_2nd_cent_forced_value_11_8 (*(volatile byte xdata *) 0xFD8D) ++#define p_reg_ce_2nd_cent_forced_value_11_8 0xFD8D ++#define reg_ce_2nd_cent_forced_value_11_8_pos 0 ++#define reg_ce_2nd_cent_forced_value_11_8_len 4 ++#define reg_ce_2nd_cent_forced_value_11_8_lsb 8 ++#define xd_p_reg_ce_2nd_cent_auto_clr_value_7_0 (*(volatile byte xdata *) 0xFD8E) ++#define p_reg_ce_2nd_cent_auto_clr_value_7_0 0xFD8E ++#define reg_ce_2nd_cent_auto_clr_value_7_0_pos 0 ++#define reg_ce_2nd_cent_auto_clr_value_7_0_len 8 ++#define reg_ce_2nd_cent_auto_clr_value_7_0_lsb 0 ++#define xd_p_reg_ce_2nd_cent_auto_clr_value_11_8 (*(volatile byte xdata *) 0xFD8F) ++#define p_reg_ce_2nd_cent_auto_clr_value_11_8 0xFD8F ++#define reg_ce_2nd_cent_auto_clr_value_11_8_pos 0 ++#define reg_ce_2nd_cent_auto_clr_value_11_8_len 4 ++#define reg_ce_2nd_cent_auto_clr_value_11_8_lsb 8 ++#define xd_p_reg_ce_gs_s1_var (*(volatile byte xdata *) 0xFD90) ++#define p_reg_ce_gs_s1_var 0xFD90 ++#define reg_ce_gs_s1_var_pos 0 ++#define reg_ce_gs_s1_var_len 4 ++#define reg_ce_gs_s1_var_lsb 0 ++#define xd_p_reg_ce_2nd_centroid_max_7_0 (*(volatile byte xdata *) 0xFD91) ++#define p_reg_ce_2nd_centroid_max_7_0 0xFD91 ++#define reg_ce_2nd_centroid_max_7_0_pos 0 ++#define reg_ce_2nd_centroid_max_7_0_len 8 ++#define reg_ce_2nd_centroid_max_7_0_lsb 0 ++#define xd_p_reg_ce_2nd_centroid_max_11_8 (*(volatile byte xdata *) 0xFD92) ++#define p_reg_ce_2nd_centroid_max_11_8 0xFD92 ++#define reg_ce_2nd_centroid_max_11_8_pos 0 ++#define reg_ce_2nd_centroid_max_11_8_len 4 ++#define reg_ce_2nd_centroid_max_11_8_lsb 8 ++#define xd_r_reg_ce_2nd_centroid_out_7_0 (*(volatile byte xdata *) 0xFD93) ++#define r_reg_ce_2nd_centroid_out_7_0 0xFD93 ++#define reg_ce_2nd_centroid_out_7_0_pos 0 ++#define reg_ce_2nd_centroid_out_7_0_len 8 ++#define reg_ce_2nd_centroid_out_7_0_lsb 0 ++#define xd_r_reg_ce_2nd_centroid_out_11_8 (*(volatile byte xdata *) 0xFD94) ++#define r_reg_ce_2nd_centroid_out_11_8 0xFD94 ++#define reg_ce_2nd_centroid_out_11_8_pos 0 ++#define reg_ce_2nd_centroid_out_11_8_len 4 ++#define reg_ce_2nd_centroid_out_11_8_lsb 8 ++#define xd_r_reg_ce_2nd_fctrl_rdy (*(volatile byte xdata *) 0xFD95) ++#define r_reg_ce_2nd_fctrl_rdy 0xFD95 ++#define reg_ce_2nd_fctrl_rdy_pos 0 ++#define reg_ce_2nd_fctrl_rdy_len 1 ++#define reg_ce_2nd_fctrl_rdy_lsb 0 ++#define xd_r_reg_ce_2nd_var (*(volatile byte xdata *) 0xFD96) ++#define r_reg_ce_2nd_var 0xFD96 ++#define reg_ce_2nd_var_pos 0 ++#define reg_ce_2nd_var_len 3 ++#define reg_ce_2nd_var_lsb 0 ++#define xd_r_reg_ce_2nd_bias_7_0 (*(volatile byte xdata *) 0xFD97) ++#define r_reg_ce_2nd_bias_7_0 0xFD97 ++#define reg_ce_2nd_bias_7_0_pos 0 ++#define reg_ce_2nd_bias_7_0_len 8 ++#define reg_ce_2nd_bias_7_0_lsb 0 ++#define xd_r_reg_ce_2nd_bias_11_8 (*(volatile byte xdata *) 0xFD98) ++#define r_reg_ce_2nd_bias_11_8 0xFD98 ++#define reg_ce_2nd_bias_11_8_pos 0 ++#define reg_ce_2nd_bias_11_8_len 4 ++#define reg_ce_2nd_bias_11_8_lsb 8 ++#define xd_r_reg_ce_2nd_m1_7_0 (*(volatile byte xdata *) 0xFD99) ++#define r_reg_ce_2nd_m1_7_0 0xFD99 ++#define reg_ce_2nd_m1_7_0_pos 0 ++#define reg_ce_2nd_m1_7_0_len 8 ++#define reg_ce_2nd_m1_7_0_lsb 0 ++#define xd_r_reg_ce_2nd_m1_11_8 (*(volatile byte xdata *) 0xFD9A) ++#define r_reg_ce_2nd_m1_11_8 0xFD9A ++#define reg_ce_2nd_m1_11_8_pos 0 ++#define reg_ce_2nd_m1_11_8_len 4 ++#define reg_ce_2nd_m1_11_8_lsb 8 ++#define xd_p_reg_ce_2nd_var_forced_value (*(volatile byte xdata *) 0xFD9B) ++#define p_reg_ce_2nd_var_forced_value 0xFD9B ++#define reg_ce_2nd_var_forced_value_pos 0 ++#define reg_ce_2nd_var_forced_value_len 3 ++#define reg_ce_2nd_var_forced_value_lsb 0 ++#define xd_r_reg_ce_2nd_m2_central_7_0 (*(volatile byte xdata *) 0xFD9C) ++#define r_reg_ce_2nd_m2_central_7_0 0xFD9C ++#define reg_ce_2nd_m2_central_7_0_pos 0 ++#define reg_ce_2nd_m2_central_7_0_len 8 ++#define reg_ce_2nd_m2_central_7_0_lsb 0 ++#define xd_r_reg_ce_2nd_m2_central_15_8 (*(volatile byte xdata *) 0xFD9D) ++#define r_reg_ce_2nd_m2_central_15_8 0xFD9D ++#define reg_ce_2nd_m2_central_15_8_pos 0 ++#define reg_ce_2nd_m2_central_15_8_len 8 ++#define reg_ce_2nd_m2_central_15_8_lsb 8 ++#define xd_p_reg_ce_2nd_var_default_value (*(volatile byte xdata *) 0xFD9E) ++#define p_reg_ce_2nd_var_default_value 0xFD9E ++#define reg_ce_2nd_var_default_value_pos 0 ++#define reg_ce_2nd_var_default_value_len 3 ++#define reg_ce_2nd_var_default_value_lsb 0 ++#define xd_p_reg_ce_2nd_cent_default_value_7_0 (*(volatile byte xdata *) 0xFD9F) ++#define p_reg_ce_2nd_cent_default_value_7_0 0xFD9F ++#define reg_ce_2nd_cent_default_value_7_0_pos 0 ++#define reg_ce_2nd_cent_default_value_7_0_len 8 ++#define reg_ce_2nd_cent_default_value_7_0_lsb 0 ++#define xd_p_reg_ce_2nd_cent_default_value_11_8 (*(volatile byte xdata *) 0xFDA0) ++#define p_reg_ce_2nd_cent_default_value_11_8 0xFDA0 ++#define reg_ce_2nd_cent_default_value_11_8_pos 0 ++#define reg_ce_2nd_cent_default_value_11_8_len 4 ++#define reg_ce_2nd_cent_default_value_11_8_lsb 8 ++#define xd_p_reg_ce_use_fdi_long (*(volatile byte xdata *) 0xFDA1) ++#define p_reg_ce_use_fdi_long 0xFDA1 ++#define reg_ce_use_fdi_long_pos 0 ++#define reg_ce_use_fdi_long_len 1 ++#define reg_ce_use_fdi_long_lsb 0 ++#define xd_p_reg_p_ce_tdi_lms_en (*(volatile byte xdata *) 0xFDA2) ++#define p_reg_p_ce_tdi_lms_en 0xFDA2 ++#define reg_p_ce_tdi_lms_en_pos 0 ++#define reg_p_ce_tdi_lms_en_len 1 ++#define reg_p_ce_tdi_lms_en_lsb 0 ++#define xd_p_reg_p_ce_tdi_lms_bufshift (*(volatile byte xdata *) 0xFDA3) ++#define p_reg_p_ce_tdi_lms_bufshift 0xFDA3 ++#define reg_p_ce_tdi_lms_bufshift_pos 0 ++#define reg_p_ce_tdi_lms_bufshift_len 2 ++#define reg_p_ce_tdi_lms_bufshift_lsb 0 ++#define xd_p_reg_p_ce_tdi_lms_ave_ratio (*(volatile byte xdata *) 0xFDA4) ++#define p_reg_p_ce_tdi_lms_ave_ratio 0xFDA4 ++#define reg_p_ce_tdi_lms_ave_ratio_pos 0 ++#define reg_p_ce_tdi_lms_ave_ratio_len 5 ++#define reg_p_ce_tdi_lms_ave_ratio_lsb 0 ++#define xd_p_reg_p_ce_conf2_in_con0_en (*(volatile byte xdata *) 0xFDA5) ++#define p_reg_p_ce_conf2_in_con0_en 0xFDA5 ++#define reg_p_ce_conf2_in_con0_en_pos 0 ++#define reg_p_ce_conf2_in_con0_en_len 1 ++#define reg_p_ce_conf2_in_con0_en_lsb 0 ++// biu_reg.h 7-6-2007 ++// gen_biu Ver 1.0 generated by ++#define xd_p_fec_rsd_packet_unit_7_0 (*(volatile byte xdata *) 0xF700) ++#define p_fec_rsd_packet_unit_7_0 0xF700 ++#define fec_rsd_packet_unit_7_0_pos 0 ++#define fec_rsd_packet_unit_7_0_len 8 ++#define fec_rsd_packet_unit_7_0_lsb 0 ++#define xd_p_fec_rsd_packet_unit_15_8 (*(volatile byte xdata *) 0xF701) ++#define p_fec_rsd_packet_unit_15_8 0xF701 ++#define fec_rsd_packet_unit_15_8_pos 0 ++#define fec_rsd_packet_unit_15_8_len 8 ++#define fec_rsd_packet_unit_15_8_lsb 8 ++#define xd_r_reg_rsd_bit_err_cnt_7_0 (*(volatile byte xdata *) 0xF702) ++#define r_reg_rsd_bit_err_cnt_7_0 0xF702 ++#define reg_rsd_bit_err_cnt_7_0_pos 0 ++#define reg_rsd_bit_err_cnt_7_0_len 8 ++#define reg_rsd_bit_err_cnt_7_0_lsb 0 ++#define xd_r_reg_rsd_bit_err_cnt_15_8 (*(volatile byte xdata *) 0xF703) ++#define r_reg_rsd_bit_err_cnt_15_8 0xF703 ++#define reg_rsd_bit_err_cnt_15_8_pos 0 ++#define reg_rsd_bit_err_cnt_15_8_len 8 ++#define reg_rsd_bit_err_cnt_15_8_lsb 8 ++#define xd_r_reg_rsd_bit_err_cnt_23_16 (*(volatile byte xdata *) 0xF704) ++#define r_reg_rsd_bit_err_cnt_23_16 0xF704 ++#define reg_rsd_bit_err_cnt_23_16_pos 0 ++#define reg_rsd_bit_err_cnt_23_16_len 8 ++#define reg_rsd_bit_err_cnt_23_16_lsb 16 ++#define xd_r_reg_rsd_abort_packet_cnt_7_0 (*(volatile byte xdata *) 0xF705) ++#define r_reg_rsd_abort_packet_cnt_7_0 0xF705 ++#define reg_rsd_abort_packet_cnt_7_0_pos 0 ++#define reg_rsd_abort_packet_cnt_7_0_len 8 ++#define reg_rsd_abort_packet_cnt_7_0_lsb 0 ++#define xd_r_reg_rsd_abort_packet_cnt_15_8 (*(volatile byte xdata *) 0xF706) ++#define r_reg_rsd_abort_packet_cnt_15_8 0xF706 ++#define reg_rsd_abort_packet_cnt_15_8_pos 0 ++#define reg_rsd_abort_packet_cnt_15_8_len 8 ++#define reg_rsd_abort_packet_cnt_15_8_lsb 8 ++#define xd_p_fec_RSD_PKT_NUM_PER_UNIT_7_0 (*(volatile byte xdata *) 0xF707) ++#define p_fec_RSD_PKT_NUM_PER_UNIT_7_0 0xF707 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_pos 0 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_len 8 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_lsb 0 ++#define xd_p_fec_RSD_PKT_NUM_PER_UNIT_15_8 (*(volatile byte xdata *) 0xF708) ++#define p_fec_RSD_PKT_NUM_PER_UNIT_15_8 0xF708 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_pos 0 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_len 8 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_lsb 8 ++#define xd_p_fec_RS_TH_1_7_0 (*(volatile byte xdata *) 0xF709) ++#define p_fec_RS_TH_1_7_0 0xF709 ++#define fec_RS_TH_1_7_0_pos 0 ++#define fec_RS_TH_1_7_0_len 8 ++#define fec_RS_TH_1_7_0_lsb 0 ++#define xd_p_fec_RS_TH_1_15_8 (*(volatile byte xdata *) 0xF70A) ++#define p_fec_RS_TH_1_15_8 0xF70A ++#define fec_RS_TH_1_15_8_pos 0 ++#define fec_RS_TH_1_15_8_len 8 ++#define fec_RS_TH_1_15_8_lsb 8 ++#define xd_p_fec_RS_TH_2 (*(volatile byte xdata *) 0xF70B) ++#define p_fec_RS_TH_2 0xF70B ++#define fec_RS_TH_2_pos 0 ++#define fec_RS_TH_2_len 8 ++#define fec_RS_TH_2_lsb 0 ++#define xd_p_fec_rsd_ber_rst (*(volatile byte xdata *) 0xF70C) ++#define p_fec_rsd_ber_rst 0xF70C ++#define fec_rsd_ber_rst_pos 0 ++#define fec_rsd_ber_rst_len 1 ++#define fec_rsd_ber_rst_lsb 0 ++#define xd_p_reg_rsd_ber_rdy (*(volatile byte xdata *) 0xF70D) ++#define p_reg_rsd_ber_rdy 0xF70D ++#define reg_rsd_ber_rdy_pos 0 ++#define reg_rsd_ber_rdy_len 1 ++#define reg_rsd_ber_rdy_lsb 0 ++#define xd_p_reg_rsd_trigger_retrain (*(volatile byte xdata *) 0xF70E) ++#define p_reg_rsd_trigger_retrain 0xF70E ++#define reg_rsd_trigger_retrain_pos 0 ++#define reg_rsd_trigger_retrain_len 1 ++#define reg_rsd_trigger_retrain_lsb 0 ++#define xd_p_reg_sync_recover (*(volatile byte xdata *) 0xF70F) ++#define p_reg_sync_recover 0xF70F ++#define reg_sync_recover_pos 0 ++#define reg_sync_recover_len 1 ++#define reg_sync_recover_lsb 0 ++#define xd_p_fec_crc_en (*(volatile byte xdata *) 0xF710) ++#define p_fec_crc_en 0xF710 ++#define fec_crc_en_pos 0 ++#define fec_crc_en_len 1 ++#define fec_crc_en_lsb 0 ++#define xd_p_fec_mon_en (*(volatile byte xdata *) 0xF711) ++#define p_fec_mon_en 0xF711 ++#define fec_mon_en_pos 0 ++#define fec_mon_en_len 1 ++#define fec_mon_en_lsb 0 ++#define xd_p_reg_sync_chk (*(volatile byte xdata *) 0xF712) ++#define p_reg_sync_chk 0xF712 ++#define reg_sync_chk_pos 0 ++#define reg_sync_chk_len 1 ++#define reg_sync_chk_lsb 0 ++#define xd_p_fec_dummy_reg_2 (*(volatile byte xdata *) 0xF713) ++#define p_fec_dummy_reg_2 0xF713 ++#define fec_dummy_reg_2_pos 0 ++#define fec_dummy_reg_2_len 3 ++#define fec_dummy_reg_2_lsb 0 ++#define xd_p_reg_fec_data_en (*(volatile byte xdata *) 0xF714) ++#define p_reg_fec_data_en 0xF714 ++#define reg_fec_data_en_pos 0 ++#define reg_fec_data_en_len 1 ++#define reg_fec_data_en_lsb 0 ++#define xd_p_fec_vtb_rsd_mon_en (*(volatile byte xdata *) 0xF715) ++#define p_fec_vtb_rsd_mon_en 0xF715 ++#define fec_vtb_rsd_mon_en_pos 0 ++#define fec_vtb_rsd_mon_en_len 1 ++#define fec_vtb_rsd_mon_en_lsb 0 ++#define xd_p_reg_fec_sw_rst (*(volatile byte xdata *) 0xF716) ++#define p_reg_fec_sw_rst 0xF716 ++#define reg_fec_sw_rst_pos 0 ++#define reg_fec_sw_rst_len 1 ++#define reg_fec_sw_rst_lsb 0 ++#define xd_r_fec_vtb_pm_crc (*(volatile byte xdata *) 0xF717) ++#define r_fec_vtb_pm_crc 0xF717 ++#define fec_vtb_pm_crc_pos 0 ++#define fec_vtb_pm_crc_len 8 ++#define fec_vtb_pm_crc_lsb 0 ++#define xd_r_fec_vtb_tb_7_crc (*(volatile byte xdata *) 0xF718) ++#define r_fec_vtb_tb_7_crc 0xF718 ++#define fec_vtb_tb_7_crc_pos 0 ++#define fec_vtb_tb_7_crc_len 8 ++#define fec_vtb_tb_7_crc_lsb 0 ++#define xd_r_fec_vtb_tb_6_crc (*(volatile byte xdata *) 0xF719) ++#define r_fec_vtb_tb_6_crc 0xF719 ++#define fec_vtb_tb_6_crc_pos 0 ++#define fec_vtb_tb_6_crc_len 8 ++#define fec_vtb_tb_6_crc_lsb 0 ++#define xd_r_fec_vtb_tb_5_crc (*(volatile byte xdata *) 0xF71A) ++#define r_fec_vtb_tb_5_crc 0xF71A ++#define fec_vtb_tb_5_crc_pos 0 ++#define fec_vtb_tb_5_crc_len 8 ++#define fec_vtb_tb_5_crc_lsb 0 ++#define xd_r_fec_vtb_tb_4_crc (*(volatile byte xdata *) 0xF71B) ++#define r_fec_vtb_tb_4_crc 0xF71B ++#define fec_vtb_tb_4_crc_pos 0 ++#define fec_vtb_tb_4_crc_len 8 ++#define fec_vtb_tb_4_crc_lsb 0 ++#define xd_r_fec_vtb_tb_3_crc (*(volatile byte xdata *) 0xF71C) ++#define r_fec_vtb_tb_3_crc 0xF71C ++#define fec_vtb_tb_3_crc_pos 0 ++#define fec_vtb_tb_3_crc_len 8 ++#define fec_vtb_tb_3_crc_lsb 0 ++#define xd_r_fec_vtb_tb_2_crc (*(volatile byte xdata *) 0xF71D) ++#define r_fec_vtb_tb_2_crc 0xF71D ++#define fec_vtb_tb_2_crc_pos 0 ++#define fec_vtb_tb_2_crc_len 8 ++#define fec_vtb_tb_2_crc_lsb 0 ++#define xd_r_fec_vtb_tb_1_crc (*(volatile byte xdata *) 0xF71E) ++#define r_fec_vtb_tb_1_crc 0xF71E ++#define fec_vtb_tb_1_crc_pos 0 ++#define fec_vtb_tb_1_crc_len 8 ++#define fec_vtb_tb_1_crc_lsb 0 ++#define xd_r_fec_vtb_tb_0_crc (*(volatile byte xdata *) 0xF71F) ++#define r_fec_vtb_tb_0_crc 0xF71F ++#define fec_vtb_tb_0_crc_pos 0 ++#define fec_vtb_tb_0_crc_len 8 ++#define fec_vtb_tb_0_crc_lsb 0 ++#define xd_r_fec_rsd_bank0_crc (*(volatile byte xdata *) 0xF720) ++#define r_fec_rsd_bank0_crc 0xF720 ++#define fec_rsd_bank0_crc_pos 0 ++#define fec_rsd_bank0_crc_len 8 ++#define fec_rsd_bank0_crc_lsb 0 ++#define xd_r_fec_rsd_bank1_crc (*(volatile byte xdata *) 0xF721) ++#define r_fec_rsd_bank1_crc 0xF721 ++#define fec_rsd_bank1_crc_pos 0 ++#define fec_rsd_bank1_crc_len 8 ++#define fec_rsd_bank1_crc_lsb 0 ++#define xd_r_fec_idi_vtb_crc (*(volatile byte xdata *) 0xF722) ++#define r_fec_idi_vtb_crc 0xF722 ++#define fec_idi_vtb_crc_pos 0 ++#define fec_idi_vtb_crc_len 8 ++#define fec_idi_vtb_crc_lsb 0 ++#define xd_p_reg_fec_rsd_packet_unit_exp (*(volatile byte xdata *) 0xF723) ++#define p_reg_fec_rsd_packet_unit_exp 0xF723 ++#define reg_fec_rsd_packet_unit_exp_pos 0 ++#define reg_fec_rsd_packet_unit_exp_len 4 ++#define reg_fec_rsd_packet_unit_exp_lsb 0 ++#define xd_p_reg_rsd_bit_err_exp_rdy (*(volatile byte xdata *) 0xF724) ++#define p_reg_rsd_bit_err_exp_rdy 0xF724 ++#define reg_rsd_bit_err_exp_rdy_pos 0 ++#define reg_rsd_bit_err_exp_rdy_len 1 ++#define reg_rsd_bit_err_exp_rdy_lsb 0 ++#define xd_r_reg_rsd_bit_err_exp (*(volatile byte xdata *) 0xF725) ++#define r_reg_rsd_bit_err_exp 0xF725 ++#define reg_rsd_bit_err_exp_pos 0 ++#define reg_rsd_bit_err_exp_len 5 ++#define reg_rsd_bit_err_exp_lsb 0 ++#define xd_p_fec_rsd_packet_unit1_7_0 (*(volatile byte xdata *) 0xF726) ++#define p_fec_rsd_packet_unit1_7_0 0xF726 ++#define fec_rsd_packet_unit1_7_0_pos 0 ++#define fec_rsd_packet_unit1_7_0_len 8 ++#define fec_rsd_packet_unit1_7_0_lsb 0 ++#define xd_p_fec_rsd_packet_unit1_15_8 (*(volatile byte xdata *) 0xF727) ++#define p_fec_rsd_packet_unit1_15_8 0xF727 ++#define fec_rsd_packet_unit1_15_8_pos 0 ++#define fec_rsd_packet_unit1_15_8_len 8 ++#define fec_rsd_packet_unit1_15_8_lsb 8 ++#define xd_r_reg_rsd_bit_err_cnt1_7_0 (*(volatile byte xdata *) 0xF728) ++#define r_reg_rsd_bit_err_cnt1_7_0 0xF728 ++#define reg_rsd_bit_err_cnt1_7_0_pos 0 ++#define reg_rsd_bit_err_cnt1_7_0_len 8 ++#define reg_rsd_bit_err_cnt1_7_0_lsb 0 ++#define xd_r_reg_rsd_bit_err_cnt1_15_8 (*(volatile byte xdata *) 0xF729) ++#define r_reg_rsd_bit_err_cnt1_15_8 0xF729 ++#define reg_rsd_bit_err_cnt1_15_8_pos 0 ++#define reg_rsd_bit_err_cnt1_15_8_len 8 ++#define reg_rsd_bit_err_cnt1_15_8_lsb 8 ++#define xd_r_reg_rsd_bit_err_cnt1_23_16 (*(volatile byte xdata *) 0xF72A) ++#define r_reg_rsd_bit_err_cnt1_23_16 0xF72A ++#define reg_rsd_bit_err_cnt1_23_16_pos 0 ++#define reg_rsd_bit_err_cnt1_23_16_len 8 ++#define reg_rsd_bit_err_cnt1_23_16_lsb 16 ++#define xd_r_reg_rsd_abort_packet_cnt1_7_0 (*(volatile byte xdata *) 0xF72B) ++#define r_reg_rsd_abort_packet_cnt1_7_0 0xF72B ++#define reg_rsd_abort_packet_cnt1_7_0_pos 0 ++#define reg_rsd_abort_packet_cnt1_7_0_len 8 ++#define reg_rsd_abort_packet_cnt1_7_0_lsb 0 ++#define xd_r_reg_rsd_abort_packet_cnt1_15_8 (*(volatile byte xdata *) 0xF72C) ++#define r_reg_rsd_abort_packet_cnt1_15_8 0xF72C ++#define reg_rsd_abort_packet_cnt1_15_8_pos 0 ++#define reg_rsd_abort_packet_cnt1_15_8_len 8 ++#define reg_rsd_abort_packet_cnt1_15_8_lsb 8 ++#define xd_p_fec_rsd_ber_rst1 (*(volatile byte xdata *) 0xF72D) ++#define p_fec_rsd_ber_rst1 0xF72D ++#define fec_rsd_ber_rst1_pos 0 ++#define fec_rsd_ber_rst1_len 1 ++#define fec_rsd_ber_rst1_lsb 0 ++#define xd_p_reg_rsd_ber_rdy1 (*(volatile byte xdata *) 0xF72E) ++#define p_reg_rsd_ber_rdy1 0xF72E ++#define reg_rsd_ber_rdy1_pos 0 ++#define reg_rsd_ber_rdy1_len 1 ++#define reg_rsd_ber_rdy1_lsb 0 ++#define xd_p_reg_dca_txmod_sel (*(volatile byte xdata *) 0xF72F) ++#define p_reg_dca_txmod_sel 0xF72F ++#define reg_dca_txmod_sel_pos 0 ++#define reg_dca_txmod_sel_len 1 ++#define reg_dca_txmod_sel_lsb 0 ++#define xd_p_reg_dca_platch (*(volatile byte xdata *) 0xF730) ++#define p_reg_dca_platch 0xF730 ++#define reg_dca_platch_pos 0 ++#define reg_dca_platch_len 1 ++#define reg_dca_platch_lsb 0 ++#define xd_p_reg_dca_upper_chip (*(volatile byte xdata *) 0xF731) ++#define p_reg_dca_upper_chip 0xF731 ++#define reg_dca_upper_chip_pos 0 ++#define reg_dca_upper_chip_len 1 ++#define reg_dca_upper_chip_lsb 0 ++#define xd_p_reg_dca_lower_chip (*(volatile byte xdata *) 0xF732) ++#define p_reg_dca_lower_chip 0xF732 ++#define reg_dca_lower_chip_pos 0 ++#define reg_dca_lower_chip_len 1 ++#define reg_dca_lower_chip_lsb 0 ++#define xd_p_reg_dca_enl (*(volatile byte xdata *) 0xF733) ++#define p_reg_dca_enl 0xF733 ++#define reg_dca_enl_pos 0 ++#define reg_dca_enl_len 1 ++#define reg_dca_enl_lsb 0 ++#define xd_p_reg_dca_enu (*(volatile byte xdata *) 0xF734) ++#define p_reg_dca_enu 0xF734 ++#define reg_dca_enu_pos 0 ++#define reg_dca_enu_len 1 ++#define reg_dca_enu_lsb 0 ++#define xd_p_reg_dca_th (*(volatile byte xdata *) 0xF735) ++#define p_reg_dca_th 0xF735 ++#define reg_dca_th_pos 0 ++#define reg_dca_th_len 5 ++#define reg_dca_th_lsb 0 ++#define xd_p_reg_dca_scale (*(volatile byte xdata *) 0xF736) ++#define p_reg_dca_scale 0xF736 ++#define reg_dca_scale_pos 0 ++#define reg_dca_scale_len 4 ++#define reg_dca_scale_lsb 0 ++#define xd_p_reg_dca_tone_7_0 (*(volatile byte xdata *) 0xF737) ++#define p_reg_dca_tone_7_0 0xF737 ++#define reg_dca_tone_7_0_pos 0 ++#define reg_dca_tone_7_0_len 8 ++#define reg_dca_tone_7_0_lsb 0 ++#define xd_p_reg_dca_tone_12_8 (*(volatile byte xdata *) 0xF738) ++#define p_reg_dca_tone_12_8 0xF738 ++#define reg_dca_tone_12_8_pos 0 ++#define reg_dca_tone_12_8_len 5 ++#define reg_dca_tone_12_8_lsb 8 ++#define xd_p_reg_dca_time_7_0 (*(volatile byte xdata *) 0xF739) ++#define p_reg_dca_time_7_0 0xF739 ++#define reg_dca_time_7_0_pos 0 ++#define reg_dca_time_7_0_len 8 ++#define reg_dca_time_7_0_lsb 0 ++#define xd_p_reg_dca_time_15_8 (*(volatile byte xdata *) 0xF73A) ++#define p_reg_dca_time_15_8 0xF73A ++#define reg_dca_time_15_8_pos 0 ++#define reg_dca_time_15_8_len 8 ++#define reg_dca_time_15_8_lsb 8 ++#define xd_r_fec_dcasm (*(volatile byte xdata *) 0xF73B) ++#define r_fec_dcasm 0xF73B ++#define fec_dcasm_pos 0 ++#define fec_dcasm_len 3 ++#define fec_dcasm_lsb 0 ++#define xd_p_reg_dca_stand_alone (*(volatile byte xdata *) 0xF73C) ++#define p_reg_dca_stand_alone 0xF73C ++#define reg_dca_stand_alone_pos 0 ++#define reg_dca_stand_alone_len 1 ++#define reg_dca_stand_alone_lsb 0 ++#define xd_p_reg_dca_upper_out_en (*(volatile byte xdata *) 0xF73D) ++#define p_reg_dca_upper_out_en 0xF73D ++#define reg_dca_upper_out_en_pos 0 ++#define reg_dca_upper_out_en_len 1 ++#define reg_dca_upper_out_en_lsb 0 ++#define xd_p_reg_dca_rc_en (*(volatile byte xdata *) 0xF73E) ++#define p_reg_dca_rc_en 0xF73E ++#define reg_dca_rc_en_pos 0 ++#define reg_dca_rc_en_len 1 ++#define reg_dca_rc_en_lsb 0 ++#define xd_p_reg_dca_retrain_send (*(volatile byte xdata *) 0xF73F) ++#define p_reg_dca_retrain_send 0xF73F ++#define reg_dca_retrain_send_pos 0 ++#define reg_dca_retrain_send_len 1 ++#define reg_dca_retrain_send_lsb 0 ++#define xd_p_reg_dca_retrain_rec (*(volatile byte xdata *) 0xF740) ++#define p_reg_dca_retrain_rec 0xF740 ++#define reg_dca_retrain_rec_pos 0 ++#define reg_dca_retrain_rec_len 1 ++#define reg_dca_retrain_rec_lsb 0 ++#define xd_p_reg_dca_gi_gap (*(volatile byte xdata *) 0xF741) ++#define p_reg_dca_gi_gap 0xF741 ++#define reg_dca_gi_gap_pos 0 ++#define reg_dca_gi_gap_len 8 ++#define reg_dca_gi_gap_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_txmod (*(volatile byte xdata *) 0xF742) ++#define r_reg_dca_rec_up_tpsd_txmod 0xF742 ++#define reg_dca_rec_up_tpsd_txmod_pos 0 ++#define reg_dca_rec_up_tpsd_txmod_len 2 ++#define reg_dca_rec_up_tpsd_txmod_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_const (*(volatile byte xdata *) 0xF743) ++#define r_reg_dca_rec_up_tpsd_const 0xF743 ++#define reg_dca_rec_up_tpsd_const_pos 0 ++#define reg_dca_rec_up_tpsd_const_len 2 ++#define reg_dca_rec_up_tpsd_const_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_indep (*(volatile byte xdata *) 0xF744) ++#define r_reg_dca_rec_up_tpsd_indep 0xF744 ++#define reg_dca_rec_up_tpsd_indep_pos 0 ++#define reg_dca_rec_up_tpsd_indep_len 1 ++#define reg_dca_rec_up_tpsd_indep_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_hier (*(volatile byte xdata *) 0xF745) ++#define r_reg_dca_rec_up_tpsd_hier 0xF745 ++#define reg_dca_rec_up_tpsd_hier_pos 0 ++#define reg_dca_rec_up_tpsd_hier_len 2 ++#define reg_dca_rec_up_tpsd_hier_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_hpcr (*(volatile byte xdata *) 0xF746) ++#define r_reg_dca_rec_up_tpsd_hpcr 0xF746 ++#define reg_dca_rec_up_tpsd_hpcr_pos 0 ++#define reg_dca_rec_up_tpsd_hpcr_len 3 ++#define reg_dca_rec_up_tpsd_hpcr_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_lpcr (*(volatile byte xdata *) 0xF747) ++#define r_reg_dca_rec_up_tpsd_lpcr 0xF747 ++#define reg_dca_rec_up_tpsd_lpcr_pos 0 ++#define reg_dca_rec_up_tpsd_lpcr_len 3 ++#define reg_dca_rec_up_tpsd_lpcr_lsb 0 ++#define xd_r_reg_dca_rec_up_tpsd_lock (*(volatile byte xdata *) 0xF748) ++#define r_reg_dca_rec_up_tpsd_lock 0xF748 ++#define reg_dca_rec_up_tpsd_lock_pos 0 ++#define reg_dca_rec_up_tpsd_lock_len 1 ++#define reg_dca_rec_up_tpsd_lock_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_txmod (*(volatile byte xdata *) 0xF749) ++#define r_reg_dca_rec_lo_tpsd_txmod 0xF749 ++#define reg_dca_rec_lo_tpsd_txmod_pos 0 ++#define reg_dca_rec_lo_tpsd_txmod_len 2 ++#define reg_dca_rec_lo_tpsd_txmod_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_const (*(volatile byte xdata *) 0xF74A) ++#define r_reg_dca_rec_lo_tpsd_const 0xF74A ++#define reg_dca_rec_lo_tpsd_const_pos 0 ++#define reg_dca_rec_lo_tpsd_const_len 2 ++#define reg_dca_rec_lo_tpsd_const_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_indep (*(volatile byte xdata *) 0xF74B) ++#define r_reg_dca_rec_lo_tpsd_indep 0xF74B ++#define reg_dca_rec_lo_tpsd_indep_pos 0 ++#define reg_dca_rec_lo_tpsd_indep_len 1 ++#define reg_dca_rec_lo_tpsd_indep_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_hier (*(volatile byte xdata *) 0xF74C) ++#define r_reg_dca_rec_lo_tpsd_hier 0xF74C ++#define reg_dca_rec_lo_tpsd_hier_pos 0 ++#define reg_dca_rec_lo_tpsd_hier_len 2 ++#define reg_dca_rec_lo_tpsd_hier_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_hpcr (*(volatile byte xdata *) 0xF74D) ++#define r_reg_dca_rec_lo_tpsd_hpcr 0xF74D ++#define reg_dca_rec_lo_tpsd_hpcr_pos 0 ++#define reg_dca_rec_lo_tpsd_hpcr_len 3 ++#define reg_dca_rec_lo_tpsd_hpcr_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_lpcr (*(volatile byte xdata *) 0xF74E) ++#define r_reg_dca_rec_lo_tpsd_lpcr 0xF74E ++#define reg_dca_rec_lo_tpsd_lpcr_pos 0 ++#define reg_dca_rec_lo_tpsd_lpcr_len 3 ++#define reg_dca_rec_lo_tpsd_lpcr_lsb 0 ++#define xd_r_reg_dca_rec_lo_tpsd_lock (*(volatile byte xdata *) 0xF74F) ++#define r_reg_dca_rec_lo_tpsd_lock 0xF74F ++#define reg_dca_rec_lo_tpsd_lock_pos 0 ++#define reg_dca_rec_lo_tpsd_lock_len 1 ++#define reg_dca_rec_lo_tpsd_lock_lsb 0 ++#define xd_p_reg_dca_gpr_ctr_up_send (*(volatile byte xdata *) 0xF750) ++#define p_reg_dca_gpr_ctr_up_send 0xF750 ++#define reg_dca_gpr_ctr_up_send_pos 0 ++#define reg_dca_gpr_ctr_up_send_len 8 ++#define reg_dca_gpr_ctr_up_send_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_0 (*(volatile byte xdata *) 0xF751) ++#define p_reg_dca_gpr_dat_up_send_0 0xF751 ++#define reg_dca_gpr_dat_up_send_0_pos 0 ++#define reg_dca_gpr_dat_up_send_0_len 8 ++#define reg_dca_gpr_dat_up_send_0_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_1 (*(volatile byte xdata *) 0xF752) ++#define p_reg_dca_gpr_dat_up_send_1 0xF752 ++#define reg_dca_gpr_dat_up_send_1_pos 0 ++#define reg_dca_gpr_dat_up_send_1_len 8 ++#define reg_dca_gpr_dat_up_send_1_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_2 (*(volatile byte xdata *) 0xF753) ++#define p_reg_dca_gpr_dat_up_send_2 0xF753 ++#define reg_dca_gpr_dat_up_send_2_pos 0 ++#define reg_dca_gpr_dat_up_send_2_len 8 ++#define reg_dca_gpr_dat_up_send_2_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_3 (*(volatile byte xdata *) 0xF754) ++#define p_reg_dca_gpr_dat_up_send_3 0xF754 ++#define reg_dca_gpr_dat_up_send_3_pos 0 ++#define reg_dca_gpr_dat_up_send_3_len 8 ++#define reg_dca_gpr_dat_up_send_3_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_4 (*(volatile byte xdata *) 0xF755) ++#define p_reg_dca_gpr_dat_up_send_4 0xF755 ++#define reg_dca_gpr_dat_up_send_4_pos 0 ++#define reg_dca_gpr_dat_up_send_4_len 8 ++#define reg_dca_gpr_dat_up_send_4_lsb 0 ++#define xd_p_reg_dca_gpr_dat_up_send_5 (*(volatile byte xdata *) 0xF756) ++#define p_reg_dca_gpr_dat_up_send_5 0xF756 ++#define reg_dca_gpr_dat_up_send_5_pos 0 ++#define reg_dca_gpr_dat_up_send_5_len 8 ++#define reg_dca_gpr_dat_up_send_5_lsb 0 ++#define xd_p_reg_dca_over_wr_up_send (*(volatile byte xdata *) 0xF757) ++#define p_reg_dca_over_wr_up_send 0xF757 ++#define reg_dca_over_wr_up_send_pos 0 ++#define reg_dca_over_wr_up_send_len 1 ++#define reg_dca_over_wr_up_send_lsb 0 ++#define xd_p_reg_dca_int_up_send (*(volatile byte xdata *) 0xF758) ++#define p_reg_dca_int_up_send 0xF758 ++#define reg_dca_int_up_send_pos 0 ++#define reg_dca_int_up_send_len 1 ++#define reg_dca_int_up_send_lsb 0 ++#define xd_p_reg_dca_gpr_ctr_lo_send (*(volatile byte xdata *) 0xF759) ++#define p_reg_dca_gpr_ctr_lo_send 0xF759 ++#define reg_dca_gpr_ctr_lo_send_pos 0 ++#define reg_dca_gpr_ctr_lo_send_len 8 ++#define reg_dca_gpr_ctr_lo_send_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_0 (*(volatile byte xdata *) 0xF75A) ++#define p_reg_dca_gpr_dat_lo_send_0 0xF75A ++#define reg_dca_gpr_dat_lo_send_0_pos 0 ++#define reg_dca_gpr_dat_lo_send_0_len 8 ++#define reg_dca_gpr_dat_lo_send_0_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_1 (*(volatile byte xdata *) 0xF75B) ++#define p_reg_dca_gpr_dat_lo_send_1 0xF75B ++#define reg_dca_gpr_dat_lo_send_1_pos 0 ++#define reg_dca_gpr_dat_lo_send_1_len 8 ++#define reg_dca_gpr_dat_lo_send_1_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_2 (*(volatile byte xdata *) 0xF75C) ++#define p_reg_dca_gpr_dat_lo_send_2 0xF75C ++#define reg_dca_gpr_dat_lo_send_2_pos 0 ++#define reg_dca_gpr_dat_lo_send_2_len 8 ++#define reg_dca_gpr_dat_lo_send_2_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_3 (*(volatile byte xdata *) 0xF75D) ++#define p_reg_dca_gpr_dat_lo_send_3 0xF75D ++#define reg_dca_gpr_dat_lo_send_3_pos 0 ++#define reg_dca_gpr_dat_lo_send_3_len 8 ++#define reg_dca_gpr_dat_lo_send_3_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_4 (*(volatile byte xdata *) 0xF75E) ++#define p_reg_dca_gpr_dat_lo_send_4 0xF75E ++#define reg_dca_gpr_dat_lo_send_4_pos 0 ++#define reg_dca_gpr_dat_lo_send_4_len 8 ++#define reg_dca_gpr_dat_lo_send_4_lsb 0 ++#define xd_p_reg_dca_gpr_dat_lo_send_5 (*(volatile byte xdata *) 0xF75F) ++#define p_reg_dca_gpr_dat_lo_send_5 0xF75F ++#define reg_dca_gpr_dat_lo_send_5_pos 0 ++#define reg_dca_gpr_dat_lo_send_5_len 8 ++#define reg_dca_gpr_dat_lo_send_5_lsb 0 ++#define xd_p_reg_dca_over_wr_lo_send (*(volatile byte xdata *) 0xF760) ++#define p_reg_dca_over_wr_lo_send 0xF760 ++#define reg_dca_over_wr_lo_send_pos 0 ++#define reg_dca_over_wr_lo_send_len 1 ++#define reg_dca_over_wr_lo_send_lsb 0 ++#define xd_p_reg_dca_int_lo_send (*(volatile byte xdata *) 0xF761) ++#define p_reg_dca_int_lo_send 0xF761 ++#define reg_dca_int_lo_send_pos 0 ++#define reg_dca_int_lo_send_len 1 ++#define reg_dca_int_lo_send_lsb 0 ++#define xd_r_reg_dca_gpr_ctr_up_rec (*(volatile byte xdata *) 0xF762) ++#define r_reg_dca_gpr_ctr_up_rec 0xF762 ++#define reg_dca_gpr_ctr_up_rec_pos 0 ++#define reg_dca_gpr_ctr_up_rec_len 8 ++#define reg_dca_gpr_ctr_up_rec_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_0 (*(volatile byte xdata *) 0xF763) ++#define r_reg_dca_gpr_dat_up_rec_0 0xF763 ++#define reg_dca_gpr_dat_up_rec_0_pos 0 ++#define reg_dca_gpr_dat_up_rec_0_len 8 ++#define reg_dca_gpr_dat_up_rec_0_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_1 (*(volatile byte xdata *) 0xF764) ++#define r_reg_dca_gpr_dat_up_rec_1 0xF764 ++#define reg_dca_gpr_dat_up_rec_1_pos 0 ++#define reg_dca_gpr_dat_up_rec_1_len 8 ++#define reg_dca_gpr_dat_up_rec_1_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_2 (*(volatile byte xdata *) 0xF765) ++#define r_reg_dca_gpr_dat_up_rec_2 0xF765 ++#define reg_dca_gpr_dat_up_rec_2_pos 0 ++#define reg_dca_gpr_dat_up_rec_2_len 8 ++#define reg_dca_gpr_dat_up_rec_2_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_3 (*(volatile byte xdata *) 0xF766) ++#define r_reg_dca_gpr_dat_up_rec_3 0xF766 ++#define reg_dca_gpr_dat_up_rec_3_pos 0 ++#define reg_dca_gpr_dat_up_rec_3_len 8 ++#define reg_dca_gpr_dat_up_rec_3_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_4 (*(volatile byte xdata *) 0xF767) ++#define r_reg_dca_gpr_dat_up_rec_4 0xF767 ++#define reg_dca_gpr_dat_up_rec_4_pos 0 ++#define reg_dca_gpr_dat_up_rec_4_len 8 ++#define reg_dca_gpr_dat_up_rec_4_lsb 0 ++#define xd_r_reg_dca_gpr_dat_up_rec_5 (*(volatile byte xdata *) 0xF768) ++#define r_reg_dca_gpr_dat_up_rec_5 0xF768 ++#define reg_dca_gpr_dat_up_rec_5_pos 0 ++#define reg_dca_gpr_dat_up_rec_5_len 8 ++#define reg_dca_gpr_dat_up_rec_5_lsb 0 ++#define xd_r_reg_dca_over_wr_up_rec (*(volatile byte xdata *) 0xF769) ++#define r_reg_dca_over_wr_up_rec 0xF769 ++#define reg_dca_over_wr_up_rec_pos 0 ++#define reg_dca_over_wr_up_rec_len 1 ++#define reg_dca_over_wr_up_rec_lsb 0 ++#define xd_p_reg_dca_int_up_rec (*(volatile byte xdata *) 0xF76A) ++#define p_reg_dca_int_up_rec 0xF76A ++#define reg_dca_int_up_rec_pos 0 ++#define reg_dca_int_up_rec_len 1 ++#define reg_dca_int_up_rec_lsb 0 ++#define xd_p_reg_dca_fw_read_yet_up (*(volatile byte xdata *) 0xF76B) ++#define p_reg_dca_fw_read_yet_up 0xF76B ++#define reg_dca_fw_read_yet_up_pos 0 ++#define reg_dca_fw_read_yet_up_len 1 ++#define reg_dca_fw_read_yet_up_lsb 0 ++#define xd_r_reg_dca_gpr_ctr_lo_rec (*(volatile byte xdata *) 0xF76C) ++#define r_reg_dca_gpr_ctr_lo_rec 0xF76C ++#define reg_dca_gpr_ctr_lo_rec_pos 0 ++#define reg_dca_gpr_ctr_lo_rec_len 8 ++#define reg_dca_gpr_ctr_lo_rec_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_0 (*(volatile byte xdata *) 0xF76D) ++#define r_reg_dca_gpr_dat_lo_rec_0 0xF76D ++#define reg_dca_gpr_dat_lo_rec_0_pos 0 ++#define reg_dca_gpr_dat_lo_rec_0_len 8 ++#define reg_dca_gpr_dat_lo_rec_0_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_1 (*(volatile byte xdata *) 0xF76E) ++#define r_reg_dca_gpr_dat_lo_rec_1 0xF76E ++#define reg_dca_gpr_dat_lo_rec_1_pos 0 ++#define reg_dca_gpr_dat_lo_rec_1_len 8 ++#define reg_dca_gpr_dat_lo_rec_1_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_2 (*(volatile byte xdata *) 0xF76F) ++#define r_reg_dca_gpr_dat_lo_rec_2 0xF76F ++#define reg_dca_gpr_dat_lo_rec_2_pos 0 ++#define reg_dca_gpr_dat_lo_rec_2_len 8 ++#define reg_dca_gpr_dat_lo_rec_2_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_3 (*(volatile byte xdata *) 0xF770) ++#define r_reg_dca_gpr_dat_lo_rec_3 0xF770 ++#define reg_dca_gpr_dat_lo_rec_3_pos 0 ++#define reg_dca_gpr_dat_lo_rec_3_len 8 ++#define reg_dca_gpr_dat_lo_rec_3_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_4 (*(volatile byte xdata *) 0xF771) ++#define r_reg_dca_gpr_dat_lo_rec_4 0xF771 ++#define reg_dca_gpr_dat_lo_rec_4_pos 0 ++#define reg_dca_gpr_dat_lo_rec_4_len 8 ++#define reg_dca_gpr_dat_lo_rec_4_lsb 0 ++#define xd_r_reg_dca_gpr_dat_lo_rec_5 (*(volatile byte xdata *) 0xF772) ++#define r_reg_dca_gpr_dat_lo_rec_5 0xF772 ++#define reg_dca_gpr_dat_lo_rec_5_pos 0 ++#define reg_dca_gpr_dat_lo_rec_5_len 8 ++#define reg_dca_gpr_dat_lo_rec_5_lsb 0 ++#define xd_r_reg_dca_over_wr_lo_rec (*(volatile byte xdata *) 0xF773) ++#define r_reg_dca_over_wr_lo_rec 0xF773 ++#define reg_dca_over_wr_lo_rec_pos 0 ++#define reg_dca_over_wr_lo_rec_len 1 ++#define reg_dca_over_wr_lo_rec_lsb 0 ++#define xd_p_reg_dca_int_lo_rec (*(volatile byte xdata *) 0xF774) ++#define p_reg_dca_int_lo_rec 0xF774 ++#define reg_dca_int_lo_rec_pos 0 ++#define reg_dca_int_lo_rec_len 1 ++#define reg_dca_int_lo_rec_lsb 0 ++#define xd_p_reg_dca_fw_read_yet_lo (*(volatile byte xdata *) 0xF775) ++#define p_reg_dca_fw_read_yet_lo 0xF775 ++#define reg_dca_fw_read_yet_lo_pos 0 ++#define reg_dca_fw_read_yet_lo_len 1 ++#define reg_dca_fw_read_yet_lo_lsb 0 ++#define xd_p_reg_dca_en (*(volatile byte xdata *) 0xF776) ++#define p_reg_dca_en 0xF776 ++#define reg_dca_en_pos 0 ++#define reg_dca_en_len 1 ++#define reg_dca_en_lsb 0 ++#define xd_p_reg_dca_ulrdy_delay (*(volatile byte xdata *) 0xF777) ++#define p_reg_dca_ulrdy_delay 0xF777 ++#define reg_dca_ulrdy_delay_pos 0 ++#define reg_dca_ulrdy_delay_len 8 ++#define reg_dca_ulrdy_delay_lsb 0 ++#define xd_p_reg_dca_fpga_latch (*(volatile byte xdata *) 0xF778) ++#define p_reg_dca_fpga_latch 0xF778 ++#define reg_dca_fpga_latch_pos 0 ++#define reg_dca_fpga_latch_len 8 ++#define reg_dca_fpga_latch_lsb 0 ++#define xd_p_reg_dca_vldld_err (*(volatile byte xdata *) 0xF779) ++#define p_reg_dca_vldld_err 0xF779 ++#define reg_dca_vldld_err_pos 0 ++#define reg_dca_vldld_err_len 1 ++#define reg_dca_vldld_err_lsb 0 ++#define xd_p_reg_dca_vldud_err (*(volatile byte xdata *) 0xF77A) ++#define p_reg_dca_vldud_err 0xF77A ++#define reg_dca_vldud_err_pos 0 ++#define reg_dca_vldud_err_len 1 ++#define reg_dca_vldud_err_lsb 0 ++#define xd_p_reg_dca_modeu_err (*(volatile byte xdata *) 0xF77B) ++#define p_reg_dca_modeu_err 0xF77B ++#define reg_dca_modeu_err_pos 0 ++#define reg_dca_modeu_err_len 1 ++#define reg_dca_modeu_err_lsb 0 ++#define xd_p_reg_dca_model_err (*(volatile byte xdata *) 0xF77C) ++#define p_reg_dca_model_err 0xF77C ++#define reg_dca_model_err_pos 0 ++#define reg_dca_model_err_len 1 ++#define reg_dca_model_err_lsb 0 ++#define xd_p_reg_dca_interrupt (*(volatile byte xdata *) 0xF77D) ++#define p_reg_dca_interrupt 0xF77D ++#define reg_dca_interrupt_pos 0 ++#define reg_dca_interrupt_len 1 ++#define reg_dca_interrupt_lsb 0 ++#define xd_p_reg_dca_auto_reset_en (*(volatile byte xdata *) 0xF77E) ++#define p_reg_dca_auto_reset_en 0xF77E ++#define reg_dca_auto_reset_en_pos 0 ++#define reg_dca_auto_reset_en_len 1 ++#define reg_dca_auto_reset_en_lsb 0 ++#define xd_p_reg_qnt_valuew_7_0 (*(volatile byte xdata *) 0xF77F) ++#define p_reg_qnt_valuew_7_0 0xF77F ++#define reg_qnt_valuew_7_0_pos 0 ++#define reg_qnt_valuew_7_0_len 8 ++#define reg_qnt_valuew_7_0_lsb 0 ++#define xd_p_reg_qnt_valuew_10_8 (*(volatile byte xdata *) 0xF780) ++#define p_reg_qnt_valuew_10_8 0xF780 ++#define reg_qnt_valuew_10_8_pos 0 ++#define reg_qnt_valuew_10_8_len 3 ++#define reg_qnt_valuew_10_8_lsb 8 ++#define xd_p_reg_qnt_nfvaluew_7_0 (*(volatile byte xdata *) 0xF781) ++#define p_reg_qnt_nfvaluew_7_0 0xF781 ++#define reg_qnt_nfvaluew_7_0_pos 0 ++#define reg_qnt_nfvaluew_7_0_len 8 ++#define reg_qnt_nfvaluew_7_0_lsb 0 ++#define xd_p_reg_qnt_nfvaluew_10_8 (*(volatile byte xdata *) 0xF782) ++#define p_reg_qnt_nfvaluew_10_8 0xF782 ++#define reg_qnt_nfvaluew_10_8_pos 0 ++#define reg_qnt_nfvaluew_10_8_len 3 ++#define reg_qnt_nfvaluew_10_8_lsb 8 ++#define xd_p_reg_qnt_flatness_thr_7_0 (*(volatile byte xdata *) 0xF783) ++#define p_reg_qnt_flatness_thr_7_0 0xF783 ++#define reg_qnt_flatness_thr_7_0_pos 0 ++#define reg_qnt_flatness_thr_7_0_len 8 ++#define reg_qnt_flatness_thr_7_0_lsb 0 ++#define xd_p_reg_qnt_flatness_thr_8 (*(volatile byte xdata *) 0xF784) ++#define p_reg_qnt_flatness_thr_8 0xF784 ++#define reg_qnt_flatness_thr_8_pos 0 ++#define reg_qnt_flatness_thr_8_len 1 ++#define reg_qnt_flatness_thr_8_lsb 8 ++#define xd_p_reg_llr_to_be_monitor (*(volatile byte xdata *) 0xF785) ++#define p_reg_llr_to_be_monitor 0xF785 ++#define reg_llr_to_be_monitor_pos 0 ++#define reg_llr_to_be_monitor_len 1 ++#define reg_llr_to_be_monitor_lsb 0 ++#define xd_p_reg_qnt_vbc_rdy (*(volatile byte xdata *) 0xF786) ++#define p_reg_qnt_vbc_rdy 0xF786 ++#define reg_qnt_vbc_rdy_pos 0 ++#define reg_qnt_vbc_rdy_len 1 ++#define reg_qnt_vbc_rdy_lsb 0 ++#define xd_p_reg_qnt_noncmb_vbc_rdy (*(volatile byte xdata *) 0xF787) ++#define p_reg_qnt_noncmb_vbc_rdy 0xF787 ++#define reg_qnt_noncmb_vbc_rdy_pos 0 ++#define reg_qnt_noncmb_vbc_rdy_len 1 ++#define reg_qnt_noncmb_vbc_rdy_lsb 0 ++#define xd_p_reg_use_eh2_mean (*(volatile byte xdata *) 0xF788) ++#define p_reg_use_eh2_mean 0xF788 ++#define reg_use_eh2_mean_pos 0 ++#define reg_use_eh2_mean_len 1 ++#define reg_use_eh2_mean_lsb 0 ++#define xd_p_reg_qnt_vbc_ccid_mode (*(volatile byte xdata *) 0xF789) ++#define p_reg_qnt_vbc_ccid_mode 0xF789 ++#define reg_qnt_vbc_ccid_mode_pos 0 ++#define reg_qnt_vbc_ccid_mode_len 1 ++#define reg_qnt_vbc_ccid_mode_lsb 0 ++#define xd_p_reg_qnt_cci_bandsize (*(volatile byte xdata *) 0xF78A) ++#define p_reg_qnt_cci_bandsize 0xF78A ++#define reg_qnt_cci_bandsize_pos 0 ++#define reg_qnt_cci_bandsize_len 4 ++#define reg_qnt_cci_bandsize_lsb 0 ++#define xd_p_reg_qnt_vbc_sframe_num (*(volatile byte xdata *) 0xF78B) ++#define p_reg_qnt_vbc_sframe_num 0xF78B ++#define reg_qnt_vbc_sframe_num_pos 0 ++#define reg_qnt_vbc_sframe_num_len 8 ++#define reg_qnt_vbc_sframe_num_lsb 0 ++#define xd_p_reg_sbx_gain_diff_7_0 (*(volatile byte xdata *) 0xF78C) ++#define p_reg_sbx_gain_diff_7_0 0xF78C ++#define reg_sbx_gain_diff_7_0_pos 0 ++#define reg_sbx_gain_diff_7_0_len 8 ++#define reg_sbx_gain_diff_7_0_lsb 0 ++#define xd_p_reg_sbx_gain_diff_8 (*(volatile byte xdata *) 0xF78D) ++#define p_reg_sbx_gain_diff_8 0xF78D ++#define reg_sbx_gain_diff_8_pos 0 ++#define reg_sbx_gain_diff_8_len 1 ++#define reg_sbx_gain_diff_8_lsb 8 ++#define xd_p_reg_sbx_gain_diff_rdy (*(volatile byte xdata *) 0xF78E) ++#define p_reg_sbx_gain_diff_rdy 0xF78E ++#define reg_sbx_gain_diff_rdy_pos 0 ++#define reg_sbx_gain_diff_rdy_len 1 ++#define reg_sbx_gain_diff_rdy_lsb 0 ++#define xd_p_reg_sbx_noncmb_gain_diff_7_0 (*(volatile byte xdata *) 0xF78F) ++#define p_reg_sbx_noncmb_gain_diff_7_0 0xF78F ++#define reg_sbx_noncmb_gain_diff_7_0_pos 0 ++#define reg_sbx_noncmb_gain_diff_7_0_len 8 ++#define reg_sbx_noncmb_gain_diff_7_0_lsb 0 ++#define xd_p_reg_sbx_noncmb_gain_diff_8 (*(volatile byte xdata *) 0xF790) ++#define p_reg_sbx_noncmb_gain_diff_8 0xF790 ++#define reg_sbx_noncmb_gain_diff_8_pos 0 ++#define reg_sbx_noncmb_gain_diff_8_len 1 ++#define reg_sbx_noncmb_gain_diff_8_lsb 8 ++#define xd_p_reg_sbx_noncmb_gain_diff_rdy (*(volatile byte xdata *) 0xF791) ++#define p_reg_sbx_noncmb_gain_diff_rdy 0xF791 ++#define reg_sbx_noncmb_gain_diff_rdy_pos 0 ++#define reg_sbx_noncmb_gain_diff_rdy_len 1 ++#define reg_sbx_noncmb_gain_diff_rdy_lsb 0 ++#define xd_r_reg_qnt_vbc_err_7_0 (*(volatile byte xdata *) 0xF792) ++#define r_reg_qnt_vbc_err_7_0 0xF792 ++#define reg_qnt_vbc_err_7_0_pos 0 ++#define reg_qnt_vbc_err_7_0_len 8 ++#define reg_qnt_vbc_err_7_0_lsb 0 ++#define xd_r_reg_qnt_vbc_err_15_8 (*(volatile byte xdata *) 0xF793) ++#define r_reg_qnt_vbc_err_15_8 0xF793 ++#define reg_qnt_vbc_err_15_8_pos 0 ++#define reg_qnt_vbc_err_15_8_len 8 ++#define reg_qnt_vbc_err_15_8_lsb 8 ++#define xd_r_reg_qnt_vbc_err_23_16 (*(volatile byte xdata *) 0xF794) ++#define r_reg_qnt_vbc_err_23_16 0xF794 ++#define reg_qnt_vbc_err_23_16_pos 0 ++#define reg_qnt_vbc_err_23_16_len 8 ++#define reg_qnt_vbc_err_23_16_lsb 16 ++#define xd_r_reg_qnt_noncmb_vbc_err_7_0 (*(volatile byte xdata *) 0xF795) ++#define r_reg_qnt_noncmb_vbc_err_7_0 0xF795 ++#define reg_qnt_noncmb_vbc_err_7_0_pos 0 ++#define reg_qnt_noncmb_vbc_err_7_0_len 8 ++#define reg_qnt_noncmb_vbc_err_7_0_lsb 0 ++#define xd_r_reg_qnt_noncmb_vbc_err_15_8 (*(volatile byte xdata *) 0xF796) ++#define r_reg_qnt_noncmb_vbc_err_15_8 0xF796 ++#define reg_qnt_noncmb_vbc_err_15_8_pos 0 ++#define reg_qnt_noncmb_vbc_err_15_8_len 8 ++#define reg_qnt_noncmb_vbc_err_15_8_lsb 8 ++#define xd_r_reg_qnt_noncmb_vbc_err_23_16 (*(volatile byte xdata *) 0xF797) ++#define r_reg_qnt_noncmb_vbc_err_23_16 0xF797 ++#define reg_qnt_noncmb_vbc_err_23_16_pos 0 ++#define reg_qnt_noncmb_vbc_err_23_16_len 8 ++#define reg_qnt_noncmb_vbc_err_23_16_lsb 16 ++#define xd_p_reg_sbx_signalquality_threshold (*(volatile byte xdata *) 0xF798) ++#define p_reg_sbx_signalquality_threshold 0xF798 ++#define reg_sbx_signalquality_threshold_pos 0 ++#define reg_sbx_signalquality_threshold_len 4 ++#define reg_sbx_signalquality_threshold_lsb 0 ++#define xd_r_reg_sbx_signalquality_ind (*(volatile byte xdata *) 0xF799) ++#define r_reg_sbx_signalquality_ind 0xF799 ++#define reg_sbx_signalquality_ind_pos 0 ++#define reg_sbx_signalquality_ind_len 1 ++#define reg_sbx_signalquality_ind_lsb 0 ++#define xd_p_reg_p_sbxqnt_th1 (*(volatile byte xdata *) 0xF79A) ++#define p_reg_p_sbxqnt_th1 0xF79A ++#define reg_p_sbxqnt_th1_pos 0 ++#define reg_p_sbxqnt_th1_len 8 ++#define reg_p_sbxqnt_th1_lsb 0 ++#define xd_p_reg_p_sbxqnt_th2 (*(volatile byte xdata *) 0xF79B) ++#define p_reg_p_sbxqnt_th2 0xF79B ++#define reg_p_sbxqnt_th2_pos 0 ++#define reg_p_sbxqnt_th2_len 8 ++#define reg_p_sbxqnt_th2_lsb 0 ++#define xd_p_reg_p_sbxqnt_th3 (*(volatile byte xdata *) 0xF79C) ++#define p_reg_p_sbxqnt_th3 0xF79C ++#define reg_p_sbxqnt_th3_pos 0 ++#define reg_p_sbxqnt_th3_len 8 ++#define reg_p_sbxqnt_th3_lsb 0 ++#define xd_p_reg_p_sbxqnt_th4 (*(volatile byte xdata *) 0xF79D) ++#define p_reg_p_sbxqnt_th4 0xF79D ++#define reg_p_sbxqnt_th4_pos 0 ++#define reg_p_sbxqnt_th4_len 8 ++#define reg_p_sbxqnt_th4_lsb 0 ++#define xd_p_reg_p_sbxqnt_th5 (*(volatile byte xdata *) 0xF79E) ++#define p_reg_p_sbxqnt_th5 0xF79E ++#define reg_p_sbxqnt_th5_pos 0 ++#define reg_p_sbxqnt_th5_len 8 ++#define reg_p_sbxqnt_th5_lsb 0 ++#define xd_p_reg_p_sbxqnt_th6 (*(volatile byte xdata *) 0xF79F) ++#define p_reg_p_sbxqnt_th6 0xF79F ++#define reg_p_sbxqnt_th6_pos 0 ++#define reg_p_sbxqnt_th6_len 8 ++#define reg_p_sbxqnt_th6_lsb 0 ++#define xd_p_reg_p_sbxqnt_th7 (*(volatile byte xdata *) 0xF800) ++#define p_reg_p_sbxqnt_th7 0xF800 ++#define reg_p_sbxqnt_th7_pos 0 ++#define reg_p_sbxqnt_th7_len 8 ++#define reg_p_sbxqnt_th7_lsb 0 ++#define xd_p_reg_p_sbxqnt_th8 (*(volatile byte xdata *) 0xF801) ++#define p_reg_p_sbxqnt_th8 0xF801 ++#define reg_p_sbxqnt_th8_pos 0 ++#define reg_p_sbxqnt_th8_len 8 ++#define reg_p_sbxqnt_th8_lsb 0 ++#define xd_p_reg_p_sbxqnt_th9 (*(volatile byte xdata *) 0xF802) ++#define p_reg_p_sbxqnt_th9 0xF802 ++#define reg_p_sbxqnt_th9_pos 0 ++#define reg_p_sbxqnt_th9_len 8 ++#define reg_p_sbxqnt_th9_lsb 0 ++#define xd_p_reg_p_sbxqnt_th10 (*(volatile byte xdata *) 0xF803) ++#define p_reg_p_sbxqnt_th10 0xF803 ++#define reg_p_sbxqnt_th10_pos 0 ++#define reg_p_sbxqnt_th10_len 8 ++#define reg_p_sbxqnt_th10_lsb 0 ++#define xd_p_reg_p_sbxqnt_th11 (*(volatile byte xdata *) 0xF804) ++#define p_reg_p_sbxqnt_th11 0xF804 ++#define reg_p_sbxqnt_th11_pos 0 ++#define reg_p_sbxqnt_th11_len 8 ++#define reg_p_sbxqnt_th11_lsb 0 ++#define xd_p_reg_p_sbxqnt_th12 (*(volatile byte xdata *) 0xF805) ++#define p_reg_p_sbxqnt_th12 0xF805 ++#define reg_p_sbxqnt_th12_pos 0 ++#define reg_p_sbxqnt_th12_len 8 ++#define reg_p_sbxqnt_th12_lsb 0 ++#define xd_p_reg_p_sbxqnt_th13_7_0 (*(volatile byte xdata *) 0xF806) ++#define p_reg_p_sbxqnt_th13_7_0 0xF806 ++#define reg_p_sbxqnt_th13_7_0_pos 0 ++#define reg_p_sbxqnt_th13_7_0_len 8 ++#define reg_p_sbxqnt_th13_7_0_lsb 0 ++#define xd_p_reg_p_sbxqnt_th13_9_8 (*(volatile byte xdata *) 0xF807) ++#define p_reg_p_sbxqnt_th13_9_8 0xF807 ++#define reg_p_sbxqnt_th13_9_8_pos 0 ++#define reg_p_sbxqnt_th13_9_8_len 2 ++#define reg_p_sbxqnt_th13_9_8_lsb 8 ++#define xd_p_reg_p_sbxqnt_th14_7_0 (*(volatile byte xdata *) 0xF808) ++#define p_reg_p_sbxqnt_th14_7_0 0xF808 ++#define reg_p_sbxqnt_th14_7_0_pos 0 ++#define reg_p_sbxqnt_th14_7_0_len 8 ++#define reg_p_sbxqnt_th14_7_0_lsb 0 ++#define xd_p_reg_p_sbxqnt_th14_9_8 (*(volatile byte xdata *) 0xF809) ++#define p_reg_p_sbxqnt_th14_9_8 0xF809 ++#define reg_p_sbxqnt_th14_9_8_pos 0 ++#define reg_p_sbxqnt_th14_9_8_len 2 ++#define reg_p_sbxqnt_th14_9_8_lsb 8 ++#define xd_p_reg_p_sbxqnt_th15_7_0 (*(volatile byte xdata *) 0xF80A) ++#define p_reg_p_sbxqnt_th15_7_0 0xF80A ++#define reg_p_sbxqnt_th15_7_0_pos 0 ++#define reg_p_sbxqnt_th15_7_0_len 8 ++#define reg_p_sbxqnt_th15_7_0_lsb 0 ++#define xd_p_reg_p_sbxqnt_th15_9_8 (*(volatile byte xdata *) 0xF80B) ++#define p_reg_p_sbxqnt_th15_9_8 0xF80B ++#define reg_p_sbxqnt_th15_9_8_pos 0 ++#define reg_p_sbxqnt_th15_9_8_len 2 ++#define reg_p_sbxqnt_th15_9_8_lsb 8 ++#define xd_p_reg_p_sbxqnt_vzh2_th0 (*(volatile byte xdata *) 0xF80C) ++#define p_reg_p_sbxqnt_vzh2_th0 0xF80C ++#define reg_p_sbxqnt_vzh2_th0_pos 0 ++#define reg_p_sbxqnt_vzh2_th0_len 8 ++#define reg_p_sbxqnt_vzh2_th0_lsb 0 ++#define xd_p_reg_p_sbxqnt_vzh2_th1 (*(volatile byte xdata *) 0xF80D) ++#define p_reg_p_sbxqnt_vzh2_th1 0xF80D ++#define reg_p_sbxqnt_vzh2_th1_pos 0 ++#define reg_p_sbxqnt_vzh2_th1_len 8 ++#define reg_p_sbxqnt_vzh2_th1_lsb 0 ++#define xd_p_reg_p_sbxqnt_vzh2_th2 (*(volatile byte xdata *) 0xF80E) ++#define p_reg_p_sbxqnt_vzh2_th2 0xF80E ++#define reg_p_sbxqnt_vzh2_th2_pos 0 ++#define reg_p_sbxqnt_vzh2_th2_len 8 ++#define reg_p_sbxqnt_vzh2_th2_lsb 0 ++#define xd_p_reg_p_qnt_w_comp1 (*(volatile byte xdata *) 0xF80F) ++#define p_reg_p_qnt_w_comp1 0xF80F ++#define reg_p_qnt_w_comp1_pos 0 ++#define reg_p_qnt_w_comp1_len 8 ++#define reg_p_qnt_w_comp1_lsb 0 ++#define xd_p_reg_p_qnt_w_comp2 (*(volatile byte xdata *) 0xF810) ++#define p_reg_p_qnt_w_comp2 0xF810 ++#define reg_p_qnt_w_comp2_pos 0 ++#define reg_p_qnt_w_comp2_len 8 ++#define reg_p_qnt_w_comp2_lsb 0 ++#define xd_p_reg_p_qnt_w_comp3 (*(volatile byte xdata *) 0xF811) ++#define p_reg_p_qnt_w_comp3 0xF811 ++#define reg_p_qnt_w_comp3_pos 0 ++#define reg_p_qnt_w_comp3_len 8 ++#define reg_p_qnt_w_comp3_lsb 0 ++#define xd_p_reg_p_vtb_in_0 (*(volatile byte xdata *) 0xF821) ++#define p_reg_p_vtb_in_0 0xF821 ++#define reg_p_vtb_in_0_pos 0 ++#define reg_p_vtb_in_0_len 6 ++#define reg_p_vtb_in_0_lsb 0 ++#define xd_p_reg_p_vtb_in_1 (*(volatile byte xdata *) 0xF822) ++#define p_reg_p_vtb_in_1 0xF822 ++#define reg_p_vtb_in_1_pos 0 ++#define reg_p_vtb_in_1_len 6 ++#define reg_p_vtb_in_1_lsb 0 ++#define xd_p_reg_p_vtb_in_2 (*(volatile byte xdata *) 0xF823) ++#define p_reg_p_vtb_in_2 0xF823 ++#define reg_p_vtb_in_2_pos 0 ++#define reg_p_vtb_in_2_len 6 ++#define reg_p_vtb_in_2_lsb 0 ++#define xd_p_reg_p_vtb_in_3 (*(volatile byte xdata *) 0xF824) ++#define p_reg_p_vtb_in_3 0xF824 ++#define reg_p_vtb_in_3_pos 0 ++#define reg_p_vtb_in_3_len 6 ++#define reg_p_vtb_in_3_lsb 0 ++#define xd_p_reg_p_vtb_in_4 (*(volatile byte xdata *) 0xF825) ++#define p_reg_p_vtb_in_4 0xF825 ++#define reg_p_vtb_in_4_pos 0 ++#define reg_p_vtb_in_4_len 6 ++#define reg_p_vtb_in_4_lsb 0 ++#define xd_p_reg_p_vtb_in_5 (*(volatile byte xdata *) 0xF826) ++#define p_reg_p_vtb_in_5 0xF826 ++#define reg_p_vtb_in_5_pos 0 ++#define reg_p_vtb_in_5_len 6 ++#define reg_p_vtb_in_5_lsb 0 ++#define xd_p_reg_p_vtb_in_6 (*(volatile byte xdata *) 0xF827) ++#define p_reg_p_vtb_in_6 0xF827 ++#define reg_p_vtb_in_6_pos 0 ++#define reg_p_vtb_in_6_len 6 ++#define reg_p_vtb_in_6_lsb 0 ++#define xd_p_reg_p_vtb_in_7 (*(volatile byte xdata *) 0xF828) ++#define p_reg_p_vtb_in_7 0xF828 ++#define reg_p_vtb_in_7_pos 0 ++#define reg_p_vtb_in_7_len 6 ++#define reg_p_vtb_in_7_lsb 0 ++#define xd_p_reg_p_vtb_in_8 (*(volatile byte xdata *) 0xF829) ++#define p_reg_p_vtb_in_8 0xF829 ++#define reg_p_vtb_in_8_pos 0 ++#define reg_p_vtb_in_8_len 6 ++#define reg_p_vtb_in_8_lsb 0 ++#define xd_p_reg_p_vtb_in_9 (*(volatile byte xdata *) 0xF82A) ++#define p_reg_p_vtb_in_9 0xF82A ++#define reg_p_vtb_in_9_pos 0 ++#define reg_p_vtb_in_9_len 6 ++#define reg_p_vtb_in_9_lsb 0 ++#define xd_p_reg_p_vtb_in_10 (*(volatile byte xdata *) 0xF82B) ++#define p_reg_p_vtb_in_10 0xF82B ++#define reg_p_vtb_in_10_pos 0 ++#define reg_p_vtb_in_10_len 6 ++#define reg_p_vtb_in_10_lsb 0 ++#define xd_p_reg_p_vtb_in_11 (*(volatile byte xdata *) 0xF82C) ++#define p_reg_p_vtb_in_11 0xF82C ++#define reg_p_vtb_in_11_pos 0 ++#define reg_p_vtb_in_11_len 6 ++#define reg_p_vtb_in_11_lsb 0 ++#define xd_p_reg_p_vtb_in_12 (*(volatile byte xdata *) 0xF82D) ++#define p_reg_p_vtb_in_12 0xF82D ++#define reg_p_vtb_in_12_pos 0 ++#define reg_p_vtb_in_12_len 6 ++#define reg_p_vtb_in_12_lsb 0 ++#define xd_p_reg_p_vtb_in_13 (*(volatile byte xdata *) 0xF82E) ++#define p_reg_p_vtb_in_13 0xF82E ++#define reg_p_vtb_in_13_pos 0 ++#define reg_p_vtb_in_13_len 6 ++#define reg_p_vtb_in_13_lsb 0 ++#define xd_p_reg_p_vtb_in_14 (*(volatile byte xdata *) 0xF82F) ++#define p_reg_p_vtb_in_14 0xF82F ++#define reg_p_vtb_in_14_pos 0 ++#define reg_p_vtb_in_14_len 6 ++#define reg_p_vtb_in_14_lsb 0 ++#define xd_p_reg_p_vtb_in_15 (*(volatile byte xdata *) 0xF830) ++#define p_reg_p_vtb_in_15 0xF830 ++#define reg_p_vtb_in_15_pos 0 ++#define reg_p_vtb_in_15_len 6 ++#define reg_p_vtb_in_15_lsb 0 ++#define xd_I2C_i2c_m_slave_addr (*(volatile byte xdata *) 0xF940) ++#define I2C_i2c_m_slave_addr 0xF940 ++#define i2c_m_slave_addr_pos 0 ++#define i2c_m_slave_addr_len 8 ++#define i2c_m_slave_addr_lsb 0 ++#define xd_I2C_i2c_m_data1 (*(volatile byte xdata *) 0xF941) ++#define I2C_i2c_m_data1 0xF941 ++#define i2c_m_data1_pos 0 ++#define i2c_m_data1_len 8 ++#define i2c_m_data1_lsb 0 ++#define xd_I2C_i2c_m_data2 (*(volatile byte xdata *) 0xF942) ++#define I2C_i2c_m_data2 0xF942 ++#define i2c_m_data2_pos 0 ++#define i2c_m_data2_len 8 ++#define i2c_m_data2_lsb 0 ++#define xd_I2C_i2c_m_data3 (*(volatile byte xdata *) 0xF943) ++#define I2C_i2c_m_data3 0xF943 ++#define i2c_m_data3_pos 0 ++#define i2c_m_data3_len 8 ++#define i2c_m_data3_lsb 0 ++#define xd_I2C_i2c_m_data4 (*(volatile byte xdata *) 0xF944) ++#define I2C_i2c_m_data4 0xF944 ++#define i2c_m_data4_pos 0 ++#define i2c_m_data4_len 8 ++#define i2c_m_data4_lsb 0 ++#define xd_I2C_i2c_m_data5 (*(volatile byte xdata *) 0xF945) ++#define I2C_i2c_m_data5 0xF945 ++#define i2c_m_data5_pos 0 ++#define i2c_m_data5_len 8 ++#define i2c_m_data5_lsb 0 ++#define xd_I2C_i2c_m_data6 (*(volatile byte xdata *) 0xF946) ++#define I2C_i2c_m_data6 0xF946 ++#define i2c_m_data6_pos 0 ++#define i2c_m_data6_len 8 ++#define i2c_m_data6_lsb 0 ++#define xd_I2C_i2c_m_data7 (*(volatile byte xdata *) 0xF947) ++#define I2C_i2c_m_data7 0xF947 ++#define i2c_m_data7_pos 0 ++#define i2c_m_data7_len 8 ++#define i2c_m_data7_lsb 0 ++#define xd_I2C_i2c_m_data8 (*(volatile byte xdata *) 0xF948) ++#define I2C_i2c_m_data8 0xF948 ++#define i2c_m_data8_pos 0 ++#define i2c_m_data8_len 8 ++#define i2c_m_data8_lsb 0 ++#define xd_I2C_i2c_m_data9 (*(volatile byte xdata *) 0xF949) ++#define I2C_i2c_m_data9 0xF949 ++#define i2c_m_data9_pos 0 ++#define i2c_m_data9_len 8 ++#define i2c_m_data9_lsb 0 ++#define xd_I2C_i2c_m_data10 (*(volatile byte xdata *) 0xF94A) ++#define I2C_i2c_m_data10 0xF94A ++#define i2c_m_data10_pos 0 ++#define i2c_m_data10_len 8 ++#define i2c_m_data10_lsb 0 ++#define xd_I2C_i2c_m_data11 (*(volatile byte xdata *) 0xF94B) ++#define I2C_i2c_m_data11 0xF94B ++#define i2c_m_data11_pos 0 ++#define i2c_m_data11_len 8 ++#define i2c_m_data11_lsb 0 ++#define xd_I2C_i2c_m_data12 (*(volatile byte xdata *) 0xF94C) ++#define I2C_i2c_m_data12 0xF94C ++#define i2c_m_data12_pos 0 ++#define i2c_m_data12_len 8 ++#define i2c_m_data12_lsb 0 ++#define xd_I2C_i2c_m_data13 (*(volatile byte xdata *) 0xF94D) ++#define I2C_i2c_m_data13 0xF94D ++#define i2c_m_data13_pos 0 ++#define i2c_m_data13_len 8 ++#define i2c_m_data13_lsb 0 ++#define xd_I2C_i2c_m_data14 (*(volatile byte xdata *) 0xF94E) ++#define I2C_i2c_m_data14 0xF94E ++#define i2c_m_data14_pos 0 ++#define i2c_m_data14_len 8 ++#define i2c_m_data14_lsb 0 ++#define xd_I2C_i2c_m_data15 (*(volatile byte xdata *) 0xF94F) ++#define I2C_i2c_m_data15 0xF94F ++#define i2c_m_data15_pos 0 ++#define i2c_m_data15_len 8 ++#define i2c_m_data15_lsb 0 ++#define xd_I2C_i2c_m_data16 (*(volatile byte xdata *) 0xF950) ++#define I2C_i2c_m_data16 0xF950 ++#define i2c_m_data16_pos 0 ++#define i2c_m_data16_len 8 ++#define i2c_m_data16_lsb 0 ++#define xd_I2C_i2c_m_data17 (*(volatile byte xdata *) 0xF951) ++#define I2C_i2c_m_data17 0xF951 ++#define i2c_m_data17_pos 0 ++#define i2c_m_data17_len 8 ++#define i2c_m_data17_lsb 0 ++#define xd_I2C_i2c_m_data18 (*(volatile byte xdata *) 0xF952) ++#define I2C_i2c_m_data18 0xF952 ++#define i2c_m_data18_pos 0 ++#define i2c_m_data18_len 8 ++#define i2c_m_data18_lsb 0 ++#define xd_I2C_i2c_m_data19 (*(volatile byte xdata *) 0xF953) ++#define I2C_i2c_m_data19 0xF953 ++#define i2c_m_data19_pos 0 ++#define i2c_m_data19_len 8 ++#define i2c_m_data19_lsb 0 ++#define xd_I2C_i2c_m_cmd_rw (*(volatile byte xdata *) 0xF954) ++#define I2C_i2c_m_cmd_rw 0xF954 ++#define i2c_m_cmd_rw_pos 0 ++#define i2c_m_cmd_rw_len 1 ++#define i2c_m_cmd_rw_lsb 0 ++#define xd_I2C_i2c_m_cmd_rwlen (*(volatile byte xdata *) 0xF954) ++#define I2C_i2c_m_cmd_rwlen 0xF954 ++#define i2c_m_cmd_rwlen_pos 3 ++#define i2c_m_cmd_rwlen_len 4 ++#define i2c_m_cmd_rwlen_lsb 0 ++#define xd_I2C_i2c_m_status_cmd_exe (*(volatile byte xdata *) 0xF955) ++#define I2C_i2c_m_status_cmd_exe 0xF955 ++#define i2c_m_status_cmd_exe_pos 0 ++#define i2c_m_status_cmd_exe_len 1 ++#define i2c_m_status_cmd_exe_lsb 0 ++#define xd_I2C_i2c_m_status_wdat_done (*(volatile byte xdata *) 0xF955) ++#define I2C_i2c_m_status_wdat_done 0xF955 ++#define i2c_m_status_wdat_done_pos 1 ++#define i2c_m_status_wdat_done_len 1 ++#define i2c_m_status_wdat_done_lsb 0 ++#define xd_I2C_i2c_m_status_wdat_fail (*(volatile byte xdata *) 0xF955) ++#define I2C_i2c_m_status_wdat_fail 0xF955 ++#define i2c_m_status_wdat_fail_pos 2 ++#define i2c_m_status_wdat_fail_len 1 ++#define i2c_m_status_wdat_fail_lsb 0 ++#define xd_I2C_i2c_m_status_rdat_rdy (*(volatile byte xdata *) 0xF955) ++#define I2C_i2c_m_status_rdat_rdy 0xF955 ++#define i2c_m_status_rdat_rdy_pos 3 ++#define i2c_m_status_rdat_rdy_len 1 ++#define i2c_m_status_rdat_rdy_lsb 0 ++#define xd_I2C_i2c_m_period (*(volatile byte xdata *) 0xF956) ++#define I2C_i2c_m_period 0xF956 ++#define i2c_m_period_pos 0 ++#define i2c_m_period_len 8 ++#define i2c_m_period_lsb 0 ++#define xd_I2C_i2c_m_reg_msb_lsb (*(volatile byte xdata *) 0xF957) ++#define I2C_i2c_m_reg_msb_lsb 0xF957 ++#define i2c_m_reg_msb_lsb_pos 0 ++#define i2c_m_reg_msb_lsb_len 1 ++#define i2c_m_reg_msb_lsb_lsb 0 ++#define xd_I2C_reg_ofdm_rst (*(volatile byte xdata *) 0xF957) ++#define I2C_reg_ofdm_rst 0xF957 ++#define reg_ofdm_rst_pos 1 ++#define reg_ofdm_rst_len 1 ++#define reg_ofdm_rst_lsb 0 ++#define xd_I2C_reg_sample_period_on_tuner (*(volatile byte xdata *) 0xF957) ++#define I2C_reg_sample_period_on_tuner 0xF957 ++#define reg_sample_period_on_tuner_pos 2 ++#define reg_sample_period_on_tuner_len 1 ++#define reg_sample_period_on_tuner_lsb 0 ++#define xd_I2C_reg_sel_tuner (*(volatile byte xdata *) 0xF957) ++#define I2C_reg_sel_tuner 0xF957 ++#define reg_sel_tuner_pos 3 ++#define reg_sel_tuner_len 1 ++#define reg_sel_tuner_lsb 0 ++#define xd_I2C_reg_ofdm_rst_en (*(volatile byte xdata *) 0xF957) ++#define I2C_reg_ofdm_rst_en 0xF957 ++#define reg_ofdm_rst_en_pos 4 ++#define reg_ofdm_rst_en_len 1 ++#define reg_ofdm_rst_en_lsb 0 ++#define xd_p_mp2if_psb_overflow (*(volatile byte xdata *) 0xF980) ++#define p_mp2if_psb_overflow 0xF980 ++#define mp2if_psb_overflow_pos 0 ++#define mp2if_psb_overflow_len 1 ++#define mp2if_psb_overflow_lsb 0 ++#define xd_p_mp2if_no_modify_tei_bit (*(volatile byte xdata *) 0xF981) ++#define p_mp2if_no_modify_tei_bit 0xF981 ++#define mp2if_no_modify_tei_bit_pos 0 ++#define mp2if_no_modify_tei_bit_len 1 ++#define mp2if_no_modify_tei_bit_lsb 0 ++#define xd_p_mp2if_keep_sf_sync_byte (*(volatile byte xdata *) 0xF982) ++#define p_mp2if_keep_sf_sync_byte 0xF982 ++#define mp2if_keep_sf_sync_byte_pos 0 ++#define mp2if_keep_sf_sync_byte_len 1 ++#define mp2if_keep_sf_sync_byte_lsb 0 ++#define xd_p_mp2if_data_access_disable (*(volatile byte xdata *) 0xF983) ++#define p_mp2if_data_access_disable 0xF983 ++#define mp2if_data_access_disable_pos 0 ++#define mp2if_data_access_disable_len 1 ++#define mp2if_data_access_disable_lsb 0 ++#define xd_p_mp2if_mpeg_ser_do7 (*(volatile byte xdata *) 0xF984) ++#define p_mp2if_mpeg_ser_do7 0xF984 ++#define mp2if_mpeg_ser_do7_pos 0 ++#define mp2if_mpeg_ser_do7_len 1 ++#define mp2if_mpeg_ser_do7_lsb 0 ++#define xd_p_mp2if_mpeg_ser_mode (*(volatile byte xdata *) 0xF985) ++#define p_mp2if_mpeg_ser_mode 0xF985 ++#define mp2if_mpeg_ser_mode_pos 0 ++#define mp2if_mpeg_ser_mode_len 1 ++#define mp2if_mpeg_ser_mode_lsb 0 ++#define xd_p_mp2if_mpeg_par_mode (*(volatile byte xdata *) 0xF986) ++#define p_mp2if_mpeg_par_mode 0xF986 ++#define mp2if_mpeg_par_mode_pos 0 ++#define mp2if_mpeg_par_mode_len 1 ++#define mp2if_mpeg_par_mode_lsb 0 ++#define xd_r_mp2if_psb_empty (*(volatile byte xdata *) 0xF987) ++#define r_mp2if_psb_empty 0xF987 ++#define mp2if_psb_empty_pos 0 ++#define mp2if_psb_empty_len 1 ++#define mp2if_psb_empty_lsb 0 ++#define xd_r_mp2if_ts_not_188 (*(volatile byte xdata *) 0xF988) ++#define r_mp2if_ts_not_188 0xF988 ++#define mp2if_ts_not_188_pos 0 ++#define mp2if_ts_not_188_len 1 ++#define mp2if_ts_not_188_lsb 0 ++#define xd_p_mp2if_mssync_len (*(volatile byte xdata *) 0xF989) ++#define p_mp2if_mssync_len 0xF989 ++#define mp2if_mssync_len_pos 0 ++#define mp2if_mssync_len_len 1 ++#define mp2if_mssync_len_lsb 0 ++#define xd_p_mp2if_msdo_msb (*(volatile byte xdata *) 0xF98A) ++#define p_mp2if_msdo_msb 0xF98A ++#define mp2if_msdo_msb_pos 0 ++#define mp2if_msdo_msb_len 1 ++#define mp2if_msdo_msb_lsb 0 ++#define xd_p_mp2if_mpeg_clk_gated (*(volatile byte xdata *) 0xF98B) ++#define p_mp2if_mpeg_clk_gated 0xF98B ++#define mp2if_mpeg_clk_gated_pos 0 ++#define mp2if_mpeg_clk_gated_len 1 ++#define mp2if_mpeg_clk_gated_lsb 0 ++#define xd_p_mp2if_mpeg_err_pol (*(volatile byte xdata *) 0xF98C) ++#define p_mp2if_mpeg_err_pol 0xF98C ++#define mp2if_mpeg_err_pol_pos 0 ++#define mp2if_mpeg_err_pol_len 1 ++#define mp2if_mpeg_err_pol_lsb 0 ++#define xd_p_mp2if_mpeg_sync_pol (*(volatile byte xdata *) 0xF98D) ++#define p_mp2if_mpeg_sync_pol 0xF98D ++#define mp2if_mpeg_sync_pol_pos 0 ++#define mp2if_mpeg_sync_pol_len 1 ++#define mp2if_mpeg_sync_pol_lsb 0 ++#define xd_p_mp2if_mpeg_vld_pol (*(volatile byte xdata *) 0xF98E) ++#define p_mp2if_mpeg_vld_pol 0xF98E ++#define mp2if_mpeg_vld_pol_pos 0 ++#define mp2if_mpeg_vld_pol_len 1 ++#define mp2if_mpeg_vld_pol_lsb 0 ++#define xd_p_mp2if_mpeg_clk_pol (*(volatile byte xdata *) 0xF98F) ++#define p_mp2if_mpeg_clk_pol 0xF98F ++#define mp2if_mpeg_clk_pol_pos 0 ++#define mp2if_mpeg_clk_pol_len 1 ++#define mp2if_mpeg_clk_pol_lsb 0 ++#define xd_p_reg_mpeg_full_speed (*(volatile byte xdata *) 0xF990) ++#define p_reg_mpeg_full_speed 0xF990 ++#define reg_mpeg_full_speed_pos 0 ++#define reg_mpeg_full_speed_len 1 ++#define reg_mpeg_full_speed_lsb 0 ++#define xd_p_mp2if_pid_complement (*(volatile byte xdata *) 0xF991) ++#define p_mp2if_pid_complement 0xF991 ++#define mp2if_pid_complement_pos 0 ++#define mp2if_pid_complement_len 1 ++#define mp2if_pid_complement_lsb 0 ++#define xd_p_mp2if_pid_rst (*(volatile byte xdata *) 0xF992) ++#define p_mp2if_pid_rst 0xF992 ++#define mp2if_pid_rst_pos 0 ++#define mp2if_pid_rst_len 1 ++#define mp2if_pid_rst_lsb 0 ++#define xd_p_mp2if_pid_en (*(volatile byte xdata *) 0xF993) ++#define p_mp2if_pid_en 0xF993 ++#define mp2if_pid_en_pos 0 ++#define mp2if_pid_en_len 1 ++#define mp2if_pid_en_lsb 0 ++#define xd_p_mp2if_pid_index_en (*(volatile byte xdata *) 0xF994) ++#define p_mp2if_pid_index_en 0xF994 ++#define mp2if_pid_index_en_pos 0 ++#define mp2if_pid_index_en_len 1 ++#define mp2if_pid_index_en_lsb 0 ++#define xd_p_mp2if_pid_index (*(volatile byte xdata *) 0xF995) ++#define p_mp2if_pid_index 0xF995 ++#define mp2if_pid_index_pos 0 ++#define mp2if_pid_index_len 5 ++#define mp2if_pid_index_lsb 0 ++#define xd_p_mp2if_pid_dat_l (*(volatile byte xdata *) 0xF996) ++#define p_mp2if_pid_dat_l 0xF996 ++#define mp2if_pid_dat_l_pos 0 ++#define mp2if_pid_dat_l_len 8 ++#define mp2if_pid_dat_l_lsb 0 ++#define xd_p_mp2if_pid_dat_h (*(volatile byte xdata *) 0xF997) ++#define p_mp2if_pid_dat_h 0xF997 ++#define mp2if_pid_dat_h_pos 0 ++#define mp2if_pid_dat_h_len 5 ++#define mp2if_pid_dat_h_lsb 0 ++#define xd_p_reg_latch_clk (*(volatile byte xdata *) 0xF998) ++#define p_reg_latch_clk 0xF998 ++#define reg_latch_clk_pos 0 ++#define reg_latch_clk_len 1 ++#define reg_latch_clk_lsb 0 ++#define xd_r_mp2if_sync_byte_locked (*(volatile byte xdata *) 0xF999) ++#define r_mp2if_sync_byte_locked 0xF999 ++#define mp2if_sync_byte_locked_pos 0 ++#define mp2if_sync_byte_locked_len 1 ++#define mp2if_sync_byte_locked_lsb 0 ++#define xd_p_mp2if_ignore_sync_byte (*(volatile byte xdata *) 0xF99A) ++#define p_mp2if_ignore_sync_byte 0xF99A ++#define mp2if_ignore_sync_byte_pos 0 ++#define mp2if_ignore_sync_byte_len 1 ++#define mp2if_ignore_sync_byte_lsb 0 ++#define xd_p_reg_mp2if_clk_en (*(volatile byte xdata *) 0xF99B) ++#define p_reg_mp2if_clk_en 0xF99B ++#define reg_mp2if_clk_en_pos 0 ++#define reg_mp2if_clk_en_len 1 ++#define reg_mp2if_clk_en_lsb 0 ++#define xd_p_reg_mpeg_vld_tgl (*(volatile byte xdata *) 0xF99C) ++#define p_reg_mpeg_vld_tgl 0xF99C ++#define reg_mpeg_vld_tgl_pos 0 ++#define reg_mpeg_vld_tgl_len 1 ++#define reg_mpeg_vld_tgl_lsb 0 ++#define xd_p_reg_mp2_sw_rst (*(volatile byte xdata *) 0xF99D) ++#define p_reg_mp2_sw_rst 0xF99D ++#define reg_mp2_sw_rst_pos 0 ++#define reg_mp2_sw_rst_len 1 ++#define reg_mp2_sw_rst_lsb 0 ++#define xd_p_mp2if_psb_en (*(volatile byte xdata *) 0xF99E) ++#define p_mp2if_psb_en 0xF99E ++#define mp2if_psb_en_pos 0 ++#define mp2if_psb_en_len 1 ++#define mp2if_psb_en_lsb 0 ++#define xd_r_mp2if_usb20_mode (*(volatile byte xdata *) 0xF99F) ++#define r_mp2if_usb20_mode 0xF99F ++#define mp2if_usb20_mode_pos 0 ++#define mp2if_usb20_mode_len 1 ++#define mp2if_usb20_mode_lsb 0 ++#define xd_r_mp2if_strap_usb20_mode (*(volatile byte xdata *) 0xF9A0) ++#define r_mp2if_strap_usb20_mode 0xF9A0 ++#define mp2if_strap_usb20_mode_pos 0 ++#define mp2if_strap_usb20_mode_len 1 ++#define mp2if_strap_usb20_mode_lsb 0 ++#define xd_r_mp2if_lost_pkt_cnt_l (*(volatile byte xdata *) 0xF9A1) ++#define r_mp2if_lost_pkt_cnt_l 0xF9A1 ++#define mp2if_lost_pkt_cnt_l_pos 0 ++#define mp2if_lost_pkt_cnt_l_len 8 ++#define mp2if_lost_pkt_cnt_l_lsb 0 ++#define xd_r_mp2if_lost_pkt_cnt_h (*(volatile byte xdata *) 0xF9A2) ++#define r_mp2if_lost_pkt_cnt_h 0xF9A2 ++#define mp2if_lost_pkt_cnt_h_pos 0 ++#define mp2if_lost_pkt_cnt_h_len 8 ++#define mp2if_lost_pkt_cnt_h_lsb 0 ++#define xd_p_reg_mp2if2_en (*(volatile byte xdata *) 0xF9A3) ++#define p_reg_mp2if2_en 0xF9A3 ++#define reg_mp2if2_en_pos 0 ++#define reg_mp2if2_en_len 1 ++#define reg_mp2if2_en_lsb 0 ++#define xd_p_reg_mp2if2_sw_rst (*(volatile byte xdata *) 0xF9A4) ++#define p_reg_mp2if2_sw_rst 0xF9A4 ++#define reg_mp2if2_sw_rst_pos 0 ++#define reg_mp2if2_sw_rst_len 1 ++#define reg_mp2if2_sw_rst_lsb 0 ++#define xd_p_reg_mp2if2_half_psb (*(volatile byte xdata *) 0xF9A5) ++#define p_reg_mp2if2_half_psb 0xF9A5 ++#define reg_mp2if2_half_psb_pos 0 ++#define reg_mp2if2_half_psb_len 1 ++#define reg_mp2if2_half_psb_lsb 0 ++#define xd_p_reg_ts_byte_endian (*(volatile byte xdata *) 0xF9A6) ++#define p_reg_ts_byte_endian 0xF9A6 ++#define reg_ts_byte_endian_pos 0 ++#define reg_ts_byte_endian_len 1 ++#define reg_ts_byte_endian_lsb 0 ++#define xd_p_reg_mp2_dioif (*(volatile byte xdata *) 0xF9A7) ++#define p_reg_mp2_dioif 0xF9A7 ++#define reg_mp2_dioif_pos 0 ++#define reg_mp2_dioif_len 1 ++#define reg_mp2_dioif_lsb 0 ++#define xd_p_reg_mp2_dioif_fast (*(volatile byte xdata *) 0xF9A8) ++#define p_reg_mp2_dioif_fast 0xF9A8 ++#define reg_mp2_dioif_fast_pos 0 ++#define reg_mp2_dioif_fast_len 1 ++#define reg_mp2_dioif_fast_lsb 0 ++#define xd_p_reg_tpsd_bw_mp2if (*(volatile byte xdata *) 0xF9A9) ++#define p_reg_tpsd_bw_mp2if 0xF9A9 ++#define reg_tpsd_bw_mp2if_pos 0 ++#define reg_tpsd_bw_mp2if_len 2 ++#define reg_tpsd_bw_mp2if_lsb 0 ++#define xd_p_reg_tpsd_gi_mp2if (*(volatile byte xdata *) 0xF9AA) ++#define p_reg_tpsd_gi_mp2if 0xF9AA ++#define reg_tpsd_gi_mp2if_pos 0 ++#define reg_tpsd_gi_mp2if_len 2 ++#define reg_tpsd_gi_mp2if_lsb 0 ++#define xd_p_reg_tpsd_cr_mp2if (*(volatile byte xdata *) 0xF9AB) ++#define p_reg_tpsd_cr_mp2if 0xF9AB ++#define reg_tpsd_cr_mp2if_pos 0 ++#define reg_tpsd_cr_mp2if_len 3 ++#define reg_tpsd_cr_mp2if_lsb 0 ++#define xd_p_reg_tpsd_cons_mp2if (*(volatile byte xdata *) 0xF9AC) ++#define p_reg_tpsd_cons_mp2if 0xF9AC ++#define reg_tpsd_cons_mp2if_pos 0 ++#define reg_tpsd_cons_mp2if_len 2 ++#define reg_tpsd_cons_mp2if_lsb 0 ++#define xd_p_reg_fw_table_en (*(volatile byte xdata *) 0xF9AD) ++#define p_reg_fw_table_en 0xF9AD ++#define reg_fw_table_en_pos 0 ++#define reg_fw_table_en_len 1 ++#define reg_fw_table_en_lsb 0 ++#define xd_p_reg_p_aud_pk_gen_aud_pk_size (*(volatile byte xdata *) 0xF9AD) ++#define p_reg_p_aud_pk_gen_aud_pk_size 0xF9AD ++#define reg_p_aud_pk_gen_aud_pk_size_pos 1 ++#define reg_p_aud_pk_gen_aud_pk_size_len 6 ++#define reg_p_aud_pk_gen_aud_pk_size_lsb 0 ++#define xd_p_mp2if_psb_num_blk (*(volatile byte xdata *) 0xF9AE) ++#define p_mp2if_psb_num_blk 0xF9AE ++#define mp2if_psb_num_blk_pos 0 ++#define mp2if_psb_num_blk_len 6 ++#define mp2if_psb_num_blk_lsb 0 ++#define xd_p_reg_fec_fake (*(volatile byte xdata *) 0xF9AF) ++#define p_reg_fec_fake 0xF9AF ++#define reg_fec_fake_pos 0 ++#define reg_fec_fake_len 1 ++#define reg_fec_fake_lsb 0 ++#define xd_p_reg_p_ccir_atv_en (*(volatile byte xdata *) 0xF9AF) ++#define p_reg_p_ccir_atv_en 0xF9AF ++#define reg_p_ccir_atv_en_pos 1 ++#define reg_p_ccir_atv_en_len 1 ++#define reg_p_ccir_atv_en_lsb 0 ++#define xd_p_reg_video_stop_n (*(volatile byte xdata *) 0xF9AF) ++#define p_reg_video_stop_n 0xF9AF ++#define reg_video_stop_n_pos 2 ++#define reg_video_stop_n_len 1 ++#define reg_video_stop_n_lsb 0 ++#define xd_p_reg_audio_stop_n (*(volatile byte xdata *) 0xF9AF) ++#define p_reg_audio_stop_n 0xF9AF ++#define reg_audio_stop_n_pos 3 ++#define reg_audio_stop_n_len 1 ++#define reg_audio_stop_n_lsb 0 ++#define xd_p_mp2if_i2smode (*(volatile byte xdata *) 0xF9AF) ++#define p_mp2if_i2smode 0xF9AF ++#define mp2if_i2smode_pos 4 ++#define mp2if_i2smode_len 2 ++#define mp2if_i2smode_lsb 0 ++#define xd_p_mp2if_word_size (*(volatile byte xdata *) 0xF9AF) ++#define p_mp2if_word_size 0xF9AF ++#define mp2if_word_size_pos 6 ++#define mp2if_word_size_len 2 ++#define mp2if_word_size_lsb 0 ++#define xd_p_reg_packet_gap (*(volatile byte xdata *) 0xF9B0) ++#define p_reg_packet_gap 0xF9B0 ++#define reg_packet_gap_pos 0 ++#define reg_packet_gap_len 8 ++#define reg_packet_gap_lsb 0 ++#define xd_p_reg_ts_dat_inv (*(volatile byte xdata *) 0xF9B2) ++#define p_reg_ts_dat_inv 0xF9B2 ++#define reg_ts_dat_inv_pos 0 ++#define reg_ts_dat_inv_len 1 ++#define reg_ts_dat_inv_lsb 0 ++#define xd_p_reg_ts_lsb_1st (*(volatile byte xdata *) 0xF9B3) ++#define p_reg_ts_lsb_1st 0xF9B3 ++#define reg_ts_lsb_1st_pos 0 ++#define reg_ts_lsb_1st_len 1 ++#define reg_ts_lsb_1st_lsb 0 ++#define xd_p_reg_ts_capt_bg_sel (*(volatile byte xdata *) 0xF9B4) ++#define p_reg_ts_capt_bg_sel 0xF9B4 ++#define reg_ts_capt_bg_sel_pos 0 ++#define reg_ts_capt_bg_sel_len 1 ++#define reg_ts_capt_bg_sel_lsb 0 ++#define xd_p_reg_mp2if_stop_en (*(volatile byte xdata *) 0xF9B5) ++#define p_reg_mp2if_stop_en 0xF9B5 ++#define reg_mp2if_stop_en_pos 0 ++#define reg_mp2if_stop_en_len 1 ++#define reg_mp2if_stop_en_lsb 0 ++#define xd_p_reg_mp2if2_pes_base (*(volatile byte xdata *) 0xF9B6) ++#define p_reg_mp2if2_pes_base 0xF9B6 ++#define reg_mp2if2_pes_base_pos 0 ++#define reg_mp2if2_pes_base_len 1 ++#define reg_mp2if2_pes_base_lsb 0 ++#define xd_p_reg_ts_sync_inv (*(volatile byte xdata *) 0xF9B7) ++#define p_reg_ts_sync_inv 0xF9B7 ++#define reg_ts_sync_inv_pos 0 ++#define reg_ts_sync_inv_len 1 ++#define reg_ts_sync_inv_lsb 0 ++#define xd_p_reg_ts_vld_inv (*(volatile byte xdata *) 0xF9B8) ++#define p_reg_ts_vld_inv 0xF9B8 ++#define reg_ts_vld_inv_pos 0 ++#define reg_ts_vld_inv_len 1 ++#define reg_ts_vld_inv_lsb 0 ++#define xd_p_reg_sys_buf_overflow (*(volatile byte xdata *) 0xF9B9) ++#define p_reg_sys_buf_overflow 0xF9B9 ++#define reg_sys_buf_overflow_pos 0 ++#define reg_sys_buf_overflow_len 1 ++#define reg_sys_buf_overflow_lsb 0 ++#define xd_p_reg_top_dummy0 (*(volatile byte xdata *) 0xF9BB) ++#define p_reg_top_dummy0 0xF9BB ++#define reg_top_dummy0_pos 0 ++#define reg_top_dummy0_len 8 ++#define reg_top_dummy0_lsb 0 ++#define xd_p_reg_top_dummy1 (*(volatile byte xdata *) 0xF9BC) ++#define p_reg_top_dummy1 0xF9BC ++#define reg_top_dummy1_pos 0 ++#define reg_top_dummy1_len 8 ++#define reg_top_dummy1_lsb 0 ++#define xd_p_reg_top_dummy2 (*(volatile byte xdata *) 0xF9BD) ++#define p_reg_top_dummy2 0xF9BD ++#define reg_top_dummy2_pos 0 ++#define reg_top_dummy2_len 8 ++#define reg_top_dummy2_lsb 0 ++#define xd_p_reg_top_dummy3 (*(volatile byte xdata *) 0xF9BE) ++#define p_reg_top_dummy3 0xF9BE ++#define reg_top_dummy3_pos 0 ++#define reg_top_dummy3_len 8 ++#define reg_top_dummy3_lsb 0 ++#define xd_p_reg_top_dummy4 (*(volatile byte xdata *) 0xF9BF) ++#define p_reg_top_dummy4 0xF9BF ++#define reg_top_dummy4_pos 0 ++#define reg_top_dummy4_len 8 ++#define reg_top_dummy4_lsb 0 ++#define xd_p_reg_top_dummy5 (*(volatile byte xdata *) 0xF9C0) ++#define p_reg_top_dummy5 0xF9C0 ++#define reg_top_dummy5_pos 0 ++#define reg_top_dummy5_len 8 ++#define reg_top_dummy5_lsb 0 ++#define xd_p_reg_top_dummy6 (*(volatile byte xdata *) 0xF9C1) ++#define p_reg_top_dummy6 0xF9C1 ++#define reg_top_dummy6_pos 0 ++#define reg_top_dummy6_len 8 ++#define reg_top_dummy6_lsb 0 ++#define xd_p_reg_top_dummy7 (*(volatile byte xdata *) 0xF9C2) ++#define p_reg_top_dummy7 0xF9C2 ++#define reg_top_dummy7_pos 0 ++#define reg_top_dummy7_len 8 ++#define reg_top_dummy7_lsb 0 ++#define xd_p_reg_top_dummy8 (*(volatile byte xdata *) 0xF9C3) ++#define p_reg_top_dummy8 0xF9C3 ++#define reg_top_dummy8_pos 0 ++#define reg_top_dummy8_len 8 ++#define reg_top_dummy8_lsb 0 ++#define xd_p_reg_top_dummy9 (*(volatile byte xdata *) 0xF9C4) ++#define p_reg_top_dummy9 0xF9C4 ++#define reg_top_dummy9_pos 0 ++#define reg_top_dummy9_len 8 ++#define reg_top_dummy9_lsb 0 ++#define xd_p_reg_top_dummyA (*(volatile byte xdata *) 0xF9C5) ++#define p_reg_top_dummyA 0xF9C5 ++#define reg_top_dummyA_pos 0 ++#define reg_top_dummyA_len 8 ++#define reg_top_dummyA_lsb 0 ++#define xd_p_reg_top_dummyB (*(volatile byte xdata *) 0xF9C6) ++#define p_reg_top_dummyB 0xF9C6 ++#define reg_top_dummyB_pos 0 ++#define reg_top_dummyB_len 8 ++#define reg_top_dummyB_lsb 0 ++#define xd_p_reg_top_dummyC (*(volatile byte xdata *) 0xF9C7) ++#define p_reg_top_dummyC 0xF9C7 ++#define reg_top_dummyC_pos 0 ++#define reg_top_dummyC_len 8 ++#define reg_top_dummyC_lsb 0 ++#define xd_p_reg_top_dummyD (*(volatile byte xdata *) 0xF9C8) ++#define p_reg_top_dummyD 0xF9C8 ++#define reg_top_dummyD_pos 0 ++#define reg_top_dummyD_len 8 ++#define reg_top_dummyD_lsb 0 ++#define xd_p_reg_top_dummyE (*(volatile byte xdata *) 0xF9C9) ++#define p_reg_top_dummyE 0xF9C9 ++#define reg_top_dummyE_pos 0 ++#define reg_top_dummyE_len 8 ++#define reg_top_dummyE_lsb 0 ++#define xd_p_reg_top_dummyF (*(volatile byte xdata *) 0xF9CA) ++#define p_reg_top_dummyF 0xF9CA ++#define reg_top_dummyF_pos 0 ++#define reg_top_dummyF_len 8 ++#define reg_top_dummyF_lsb 0 ++#define xd_p_reg_mp2if_clk_coeff (*(volatile byte xdata *) 0xF9CB) ++#define p_reg_mp2if_clk_coeff 0xF9CB ++#define reg_mp2if_clk_coeff_pos 0 ++#define reg_mp2if_clk_coeff_len 7 ++#define reg_mp2if_clk_coeff_lsb 0 ++#define xd_p_reg_tsip_en (*(volatile byte xdata *) 0xF9CC) ++#define p_reg_tsip_en 0xF9CC ++#define reg_tsip_en_pos 0 ++#define reg_tsip_en_len 1 ++#define reg_tsip_en_lsb 0 ++#define xd_p_reg_tsis_en (*(volatile byte xdata *) 0xF9CD) ++#define p_reg_tsis_en 0xF9CD ++#define reg_tsis_en_pos 0 ++#define reg_tsis_en_len 1 ++#define reg_tsis_en_lsb 0 ++#define xd_p_reg_tsip_br (*(volatile byte xdata *) 0xF9CE) ++#define p_reg_tsip_br 0xF9CE ++#define reg_tsip_br_pos 0 ++#define reg_tsip_br_len 1 ++#define reg_tsip_br_lsb 0 ++#define xd_p_reg_tsip_frm_inv (*(volatile byte xdata *) 0xF9D0) ++#define p_reg_tsip_frm_inv 0xF9D0 ++#define reg_tsip_frm_inv_pos 0 ++#define reg_tsip_frm_inv_len 1 ++#define reg_tsip_frm_inv_lsb 0 ++#define xd_p_reg_tsip_str_inv (*(volatile byte xdata *) 0xF9D1) ++#define p_reg_tsip_str_inv 0xF9D1 ++#define reg_tsip_str_inv_pos 0 ++#define reg_tsip_str_inv_len 1 ++#define reg_tsip_str_inv_lsb 0 ++#define xd_p_reg_tsip_fail_inv (*(volatile byte xdata *) 0xF9D2) ++#define p_reg_tsip_fail_inv 0xF9D2 ++#define reg_tsip_fail_inv_pos 0 ++#define reg_tsip_fail_inv_len 1 ++#define reg_tsip_fail_inv_lsb 0 ++#define xd_p_reg_tsip_frm_ignore (*(volatile byte xdata *) 0xF9D3) ++#define p_reg_tsip_frm_ignore 0xF9D3 ++#define reg_tsip_frm_ignore_pos 0 ++#define reg_tsip_frm_ignore_len 1 ++#define reg_tsip_frm_ignore_lsb 0 ++#define xd_p_reg_tsip_str_ignore (*(volatile byte xdata *) 0xF9D4) ++#define p_reg_tsip_str_ignore 0xF9D4 ++#define reg_tsip_str_ignore_pos 0 ++#define reg_tsip_str_ignore_len 1 ++#define reg_tsip_str_ignore_lsb 0 ++#define xd_p_reg_tsip_fail_ignore (*(volatile byte xdata *) 0xF9D5) ++#define p_reg_tsip_fail_ignore 0xF9D5 ++#define reg_tsip_fail_ignore_pos 0 ++#define reg_tsip_fail_ignore_len 1 ++#define reg_tsip_fail_ignore_lsb 0 ++#define xd_p_reg_tsip_endian (*(volatile byte xdata *) 0xF9D6) ++#define p_reg_tsip_endian 0xF9D6 ++#define reg_tsip_endian_pos 0 ++#define reg_tsip_endian_len 1 ++#define reg_tsip_endian_lsb 0 ++#define xd_p_reg_tsip_overflow (*(volatile byte xdata *) 0xF9D7) ++#define p_reg_tsip_overflow 0xF9D7 ++#define reg_tsip_overflow_pos 0 ++#define reg_tsip_overflow_len 1 ++#define reg_tsip_overflow_lsb 0 ++#define xd_p_reg_ts_in_src (*(volatile byte xdata *) 0xF9D8) ++#define p_reg_ts_in_src 0xF9D8 ++#define reg_ts_in_src_pos 0 ++#define reg_ts_in_src_len 1 ++#define reg_ts_in_src_lsb 0 ++#define xd_r_reg_clk_sel (*(volatile byte xdata *) 0xF9D9) ++#define r_reg_clk_sel 0xF9D9 ++#define reg_clk_sel_pos 0 ++#define reg_clk_sel_len 2 ++#define reg_clk_sel_lsb 0 ++#define xd_r_reg_tog_sel (*(volatile byte xdata *) 0xF9DA) ++#define r_reg_tog_sel 0xF9DA ++#define reg_tog_sel_pos 0 ++#define reg_tog_sel_len 2 ++#define reg_tog_sel_lsb 0 ++#define xd_p_reg_ts_str_ignore (*(volatile byte xdata *) 0xF9DB) ++#define p_reg_ts_str_ignore 0xF9DB ++#define reg_ts_str_ignore_pos 0 ++#define reg_ts_str_ignore_len 1 ++#define reg_ts_str_ignore_lsb 0 ++#define xd_p_reg_ts_frm_ignore (*(volatile byte xdata *) 0xF9DC) ++#define p_reg_ts_frm_ignore 0xF9DC ++#define reg_ts_frm_ignore_pos 0 ++#define reg_ts_frm_ignore_len 1 ++#define reg_ts_frm_ignore_lsb 0 ++#define xd_p_reg_clk_sel_fix (*(volatile byte xdata *) 0xF9DD) ++#define p_reg_clk_sel_fix 0xF9DD ++#define reg_clk_sel_fix_pos 0 ++#define reg_clk_sel_fix_len 2 ++#define reg_clk_sel_fix_lsb 0 ++#define xd_p_reg_tog_sel_fix (*(volatile byte xdata *) 0xF9DE) ++#define p_reg_tog_sel_fix 0xF9DE ++#define reg_tog_sel_fix_pos 0 ++#define reg_tog_sel_fix_len 2 ++#define reg_tog_sel_fix_lsb 0 ++#define xd_p_reg_en_fix (*(volatile byte xdata *) 0xF9DF) ++#define p_reg_en_fix 0xF9DF ++#define reg_en_fix_pos 0 ++#define reg_en_fix_len 1 ++#define reg_en_fix_lsb 0 ++#define xd_p_reg_check_tpsd_hier (*(volatile byte xdata *) 0xF9E0) ++#define p_reg_check_tpsd_hier 0xF9E0 ++#define reg_check_tpsd_hier_pos 0 ++#define reg_check_tpsd_hier_len 1 ++#define reg_check_tpsd_hier_lsb 0 ++#define xd_p_reg_p_i2s_master_mode (*(volatile byte xdata *) 0xF9E1) ++#define p_reg_p_i2s_master_mode 0xF9E1 ++#define reg_p_i2s_master_mode_pos 0 ++#define reg_p_i2s_master_mode_len 1 ++#define reg_p_i2s_master_mode_lsb 0 ++#define xd_p_reg_p_sc_lr_ratio (*(volatile byte xdata *) 0xF9E2) ++#define p_reg_p_sc_lr_ratio 0xF9E2 ++#define reg_p_sc_lr_ratio_pos 0 ++#define reg_p_sc_lr_ratio_len 2 ++#define reg_p_sc_lr_ratio_lsb 0 ++#define xd_p_reg_p_i2s_fs_type (*(volatile byte xdata *) 0xF9E2) ++#define p_reg_p_i2s_fs_type 0xF9E2 ++#define reg_p_i2s_fs_type_pos 2 ++#define reg_p_i2s_fs_type_len 2 ++#define reg_p_i2s_fs_type_lsb 0 ++#define xd_r_reg_r_pp_fullq (*(volatile byte xdata *) 0xF9E3) ++#define r_reg_r_pp_fullq 0xF9E3 ++#define reg_r_pp_fullq_pos 0 ++#define reg_r_pp_fullq_len 1 ++#define reg_r_pp_fullq_lsb 0 ++#define xd_p_reg_r_ccir_rst (*(volatile byte xdata *) 0xF9E3) ++#define p_reg_r_ccir_rst 0xF9E3 ++#define reg_r_ccir_rst_pos 1 ++#define reg_r_ccir_rst_len 1 ++#define reg_r_ccir_rst_lsb 0 ++#define xd_p_reg_p_full_en (*(volatile byte xdata *) 0xF9E3) ++#define p_reg_p_full_en 0xF9E3 ++#define reg_p_full_en_pos 2 ++#define reg_p_full_en_len 1 ++#define reg_p_full_en_lsb 0 ++#define xd_p_reg_p_vbi_dis (*(volatile byte xdata *) 0xF9E3) ++#define p_reg_p_vbi_dis 0xF9E3 ++#define reg_p_vbi_dis_pos 3 ++#define reg_p_vbi_dis_len 1 ++#define reg_p_vbi_dis_lsb 0 ++#define xd_p_reg_p_ccir_all (*(volatile byte xdata *) 0xF9E3) ++#define p_reg_p_ccir_all 0xF9E3 ++#define reg_p_ccir_all_pos 4 ++#define reg_p_ccir_all_len 1 ++#define reg_p_ccir_all_lsb 0 ++#define xd_p_reg_p_ccir_vbi_raw_en (*(volatile byte xdata *) 0xF9E3) ++#define p_reg_p_ccir_vbi_raw_en 0xF9E3 ++#define reg_p_ccir_vbi_raw_en_pos 5 ++#define reg_p_ccir_vbi_raw_en_len 1 ++#define reg_p_ccir_vbi_raw_en_lsb 0 ++#define xd_p_reg_err_byte_en (*(volatile byte xdata *) 0xF9E4) ++#define p_reg_err_byte_en 0xF9E4 ++#define reg_err_byte_en_pos 0 ++#define reg_err_byte_en_len 1 ++#define reg_err_byte_en_lsb 0 ++#define xd_p_reg_mp2_f_adc_7_0 (*(volatile byte xdata *) 0xF9E5) ++#define p_reg_mp2_f_adc_7_0 0xF9E5 ++#define reg_mp2_f_adc_7_0_pos 0 ++#define reg_mp2_f_adc_7_0_len 8 ++#define reg_mp2_f_adc_7_0_lsb 0 ++#define xd_p_reg_mp2_f_adc_15_8 (*(volatile byte xdata *) 0xF9E6) ++#define p_reg_mp2_f_adc_15_8 0xF9E6 ++#define reg_mp2_f_adc_15_8_pos 0 ++#define reg_mp2_f_adc_15_8_len 8 ++#define reg_mp2_f_adc_15_8_lsb 8 ++#define xd_p_reg_mp2_f_adc_23_16 (*(volatile byte xdata *) 0xF9E7) ++#define p_reg_mp2_f_adc_23_16 0xF9E7 ++#define reg_mp2_f_adc_23_16_pos 0 ++#define reg_mp2_f_adc_23_16_len 8 ++#define reg_mp2_f_adc_23_16_lsb 16 ++#define xd_p_reg_set_util (*(volatile byte xdata *) 0xF9E8) ++#define p_reg_set_util 0xF9E8 ++#define reg_set_util_pos 0 ++#define reg_set_util_len 8 ++#define reg_set_util_lsb 0 ++#define xd_r_reg_err_byte (*(volatile byte xdata *) 0xF9E9) ++#define r_reg_err_byte 0xF9E9 ++#define reg_err_byte_pos 0 ++#define reg_err_byte_len 8 ++#define reg_err_byte_lsb 0 ++#define xd_p_reg_p_ln_num1 (*(volatile byte xdata *) 0xF9EA) ++#define p_reg_p_ln_num1 0xF9EA ++#define reg_p_ln_num1_pos 0 ++#define reg_p_ln_num1_len 5 ++#define reg_p_ln_num1_lsb 0 ++#define xd_p_reg_p_ln_num2_2_0 (*(volatile byte xdata *) 0xF9EA) ++#define p_reg_p_ln_num2_2_0 0xF9EA ++#define reg_p_ln_num2_2_0_pos 5 ++#define reg_p_ln_num2_2_0_len 3 ++#define reg_p_ln_num2_2_0_lsb 0 ++#define xd_p_reg_p_ln_num2_4_3 (*(volatile byte xdata *) 0xF9EB) ++#define p_reg_p_ln_num2_4_3 0xF9EB ++#define reg_p_ln_num2_4_3_pos 0 ++#define reg_p_ln_num2_4_3_len 2 ++#define reg_p_ln_num2_4_3_lsb 3 ++#define xd_p_reg_p_ln_num3_5_0 (*(volatile byte xdata *) 0xF9EB) ++#define p_reg_p_ln_num3_5_0 0xF9EB ++#define reg_p_ln_num3_5_0_pos 2 ++#define reg_p_ln_num3_5_0_len 6 ++#define reg_p_ln_num3_5_0_lsb 0 ++#define xd_p_reg_p_ln_num3_8_6 (*(volatile byte xdata *) 0xF9EC) ++#define p_reg_p_ln_num3_8_6 0xF9EC ++#define reg_p_ln_num3_8_6_pos 0 ++#define reg_p_ln_num3_8_6_len 3 ++#define reg_p_ln_num3_8_6_lsb 6 ++#define xd_p_reg_p_ln_num4_4_0 (*(volatile byte xdata *) 0xF9EC) ++#define p_reg_p_ln_num4_4_0 0xF9EC ++#define reg_p_ln_num4_4_0_pos 3 ++#define reg_p_ln_num4_4_0_len 5 ++#define reg_p_ln_num4_4_0_lsb 0 ++#define xd_p_reg_p_ln_num4_8_5 (*(volatile byte xdata *) 0xF9ED) ++#define p_reg_p_ln_num4_8_5 0xF9ED ++#define reg_p_ln_num4_8_5_pos 0 ++#define reg_p_ln_num4_8_5_len 4 ++#define reg_p_ln_num4_8_5_lsb 5 ++#define xd_p_reg_p_ln_num5_3_0 (*(volatile byte xdata *) 0xF9ED) ++#define p_reg_p_ln_num5_3_0 0xF9ED ++#define reg_p_ln_num5_3_0_pos 4 ++#define reg_p_ln_num5_3_0_len 4 ++#define reg_p_ln_num5_3_0_lsb 0 ++#define xd_p_reg_p_ln_num5_8_4 (*(volatile byte xdata *) 0xF9EE) ++#define p_reg_p_ln_num5_8_4 0xF9EE ++#define reg_p_ln_num5_8_4_pos 0 ++#define reg_p_ln_num5_8_4_len 5 ++#define reg_p_ln_num5_8_4_lsb 4 ++#define xd_p_reg_p_ln_num6_2_0 (*(volatile byte xdata *) 0xF9EE) ++#define p_reg_p_ln_num6_2_0 0xF9EE ++#define reg_p_ln_num6_2_0_pos 5 ++#define reg_p_ln_num6_2_0_len 3 ++#define reg_p_ln_num6_2_0_lsb 0 ++#define xd_p_reg_p_ln_num6_8_3 (*(volatile byte xdata *) 0xF9EF) ++#define p_reg_p_ln_num6_8_3 0xF9EF ++#define reg_p_ln_num6_8_3_pos 0 ++#define reg_p_ln_num6_8_3_len 6 ++#define reg_p_ln_num6_8_3_lsb 3 ++#define xd_p_reg_p_pixel_num_7_0 (*(volatile byte xdata *) 0xF9F0) ++#define p_reg_p_pixel_num_7_0 0xF9F0 ++#define reg_p_pixel_num_7_0_pos 0 ++#define reg_p_pixel_num_7_0_len 8 ++#define reg_p_pixel_num_7_0_lsb 0 ++#define xd_p_reg_p_pixel_num_10_8 (*(volatile byte xdata *) 0xF9F1) ++#define p_reg_p_pixel_num_10_8 0xF9F1 ++#define reg_p_pixel_num_10_8_pos 0 ++#define reg_p_pixel_num_10_8_len 3 ++#define reg_p_pixel_num_10_8_lsb 8 ++#define xd_p_reg_p_ccir_yuv_en (*(volatile byte xdata *) 0xF9F1) ++#define p_reg_p_ccir_yuv_en 0xF9F1 ++#define reg_p_ccir_yuv_en_pos 3 ++#define reg_p_ccir_yuv_en_len 1 ++#define reg_p_ccir_yuv_en_lsb 0 ++#define xd_p_reg_p_ccir_size_sft (*(volatile byte xdata *) 0xF9F1) ++#define p_reg_p_ccir_size_sft 0xF9F1 ++#define reg_p_ccir_size_sft_pos 4 ++#define reg_p_ccir_size_sft_len 2 ++#define reg_p_ccir_size_sft_lsb 0 ++#define xd_p_reg_p_psb_cnt_sft (*(volatile byte xdata *) 0xF9F1) ++#define p_reg_p_psb_cnt_sft 0xF9F1 ++#define reg_p_psb_cnt_sft_pos 6 ++#define reg_p_psb_cnt_sft_len 2 ++#define reg_p_psb_cnt_sft_lsb 0 ++#define xd_p_reg_p_tpsd_lock_trigger (*(volatile byte xdata *) 0xF9F2) ++#define p_reg_p_tpsd_lock_trigger 0xF9F2 ++#define reg_p_tpsd_lock_trigger_pos 0 ++#define reg_p_tpsd_lock_trigger_len 1 ++#define reg_p_tpsd_lock_trigger_lsb 0 ++#define xd_p_reg_p_ccir_clk_sel (*(volatile byte xdata *) 0xF9F3) ++#define p_reg_p_ccir_clk_sel 0xF9F3 ++#define reg_p_ccir_clk_sel_pos 0 ++#define reg_p_ccir_clk_sel_len 1 ++#define reg_p_ccir_clk_sel_lsb 0 ++#define xd_p_reg_i2c_16_8_data_sel (*(volatile byte xdata *) 0xFB00) ++#define p_reg_i2c_16_8_data_sel 0xFB00 ++#define reg_i2c_16_8_data_sel_pos 0 ++#define reg_i2c_16_8_data_sel_len 1 ++#define reg_i2c_16_8_data_sel_lsb 0 ++#define xd_p_reg_i2c_slave_trigger_byte (*(volatile byte xdata *) 0xFB01) ++#define p_reg_i2c_slave_trigger_byte 0xFB01 ++#define reg_i2c_slave_trigger_byte_pos 0 ++#define reg_i2c_slave_trigger_byte_len 1 ++#define reg_i2c_slave_trigger_byte_lsb 0 ++#define xd_p_reg_wdti_level (*(volatile byte xdata *) 0xFB05) ++#define p_reg_wdti_level 0xFB05 ++#define reg_wdti_level_pos 0 ++#define reg_wdti_level_len 1 ++#define reg_wdti_level_lsb 0 ++#define xd_p_reg_rssi_avg_sel_lat (*(volatile byte xdata *) 0xFB06) ++#define p_reg_rssi_avg_sel_lat 0xFB06 ++#define reg_rssi_avg_sel_lat_pos 0 ++#define reg_rssi_avg_sel_lat_len 2 ++#define reg_rssi_avg_sel_lat_lsb 0 ++#define xd_r_ofsm_rssi_avg_7_0 (*(volatile byte xdata *) 0xFB07) ++#define r_ofsm_rssi_avg_7_0 0xFB07 ++#define ofsm_rssi_avg_7_0_pos 0 ++#define ofsm_rssi_avg_7_0_len 8 ++#define ofsm_rssi_avg_7_0_lsb 0 ++#define xd_r_ofsm_rssi_avg_9_8 (*(volatile byte xdata *) 0xFB08) ++#define r_ofsm_rssi_avg_9_8 0xFB08 ++#define ofsm_rssi_avg_9_8_pos 0 ++#define ofsm_rssi_avg_9_8_len 2 ++#define ofsm_rssi_avg_9_8_lsb 8 ++#define xd_r_ofsm_mbist_fail_mon51 (*(volatile byte xdata *) 0xFB09) ++#define r_ofsm_mbist_fail_mon51 0xFB09 ++#define ofsm_mbist_fail_mon51_pos 0 ++#define ofsm_mbist_fail_mon51_len 1 ++#define ofsm_mbist_fail_mon51_lsb 0 ++#define xd_r_ofsm_mbist_fail_com (*(volatile byte xdata *) 0xFB0A) ++#define r_ofsm_mbist_fail_com 0xFB0A ++#define ofsm_mbist_fail_com_pos 0 ++#define ofsm_mbist_fail_com_len 1 ++#define ofsm_mbist_fail_com_lsb 0 ++#define xd_r_ofsm_mbist_fail_fft (*(volatile byte xdata *) 0xFB0B) ++#define r_ofsm_mbist_fail_fft 0xFB0B ++#define ofsm_mbist_fail_fft_pos 0 ++#define ofsm_mbist_fail_fft_len 1 ++#define ofsm_mbist_fail_fft_lsb 0 ++#define xd_r_ofsm_mbist_fail_fd (*(volatile byte xdata *) 0xFB0C) ++#define r_ofsm_mbist_fail_fd 0xFB0C ++#define ofsm_mbist_fail_fd_pos 0 ++#define ofsm_mbist_fail_fd_len 1 ++#define ofsm_mbist_fail_fd_lsb 0 ++#define xd_r_ofsm_mbist_fail_link (*(volatile byte xdata *) 0xFB0D) ++#define r_ofsm_mbist_fail_link 0xFB0D ++#define ofsm_mbist_fail_link_pos 0 ++#define ofsm_mbist_fail_link_len 1 ++#define ofsm_mbist_fail_link_lsb 0 ++#define xd_r_ofsm_mbist_fail_mpe (*(volatile byte xdata *) 0xFB0E) ++#define r_ofsm_mbist_fail_mpe 0xFB0E ++#define ofsm_mbist_fail_mpe_pos 0 ++#define ofsm_mbist_fail_mpe_len 1 ++#define ofsm_mbist_fail_mpe_lsb 0 ++#define xd_r_ofsm_mbist_done_mpe (*(volatile byte xdata *) 0xFB0F) ++#define r_ofsm_mbist_done_mpe 0xFB0F ++#define ofsm_mbist_done_mpe_pos 0 ++#define ofsm_mbist_done_mpe_len 1 ++#define ofsm_mbist_done_mpe_lsb 0 ++#define xd_r_ofsm_mbist_mode_mpe (*(volatile byte xdata *) 0xFB10) ++#define r_ofsm_mbist_mode_mpe 0xFB10 ++#define ofsm_mbist_mode_mpe_pos 0 ++#define ofsm_mbist_mode_mpe_len 1 ++#define ofsm_mbist_mode_mpe_lsb 0 ++#define xd_p_ofsm_cmd_reg (*(volatile byte xdata *) 0xFB11) ++#define p_ofsm_cmd_reg 0xFB11 ++#define ofsm_cmd_reg_pos 0 ++#define ofsm_cmd_reg_len 8 ++#define ofsm_cmd_reg_lsb 0 ++#define xd_p_ofsm_addr_reg_h (*(volatile byte xdata *) 0xFB12) ++#define p_ofsm_addr_reg_h 0xFB12 ++#define ofsm_addr_reg_h_pos 0 ++#define ofsm_addr_reg_h_len 8 ++#define ofsm_addr_reg_h_lsb 0 ++#define xd_p_ofsm_addr_reg_l (*(volatile byte xdata *) 0xFB13) ++#define p_ofsm_addr_reg_l 0xFB13 ++#define ofsm_addr_reg_l_pos 0 ++#define ofsm_addr_reg_l_len 8 ++#define ofsm_addr_reg_l_lsb 0 ++#define xd_p_ofsm_data_reg_0 (*(volatile byte xdata *) 0xFB14) ++#define p_ofsm_data_reg_0 0xFB14 ++#define ofsm_data_reg_0_pos 0 ++#define ofsm_data_reg_0_len 8 ++#define ofsm_data_reg_0_lsb 0 ++#define xd_p_ofsm_data_reg_1 (*(volatile byte xdata *) 0xFB15) ++#define p_ofsm_data_reg_1 0xFB15 ++#define ofsm_data_reg_1_pos 0 ++#define ofsm_data_reg_1_len 8 ++#define ofsm_data_reg_1_lsb 0 ++#define xd_p_ofsm_data_reg_2 (*(volatile byte xdata *) 0xFB16) ++#define p_ofsm_data_reg_2 0xFB16 ++#define ofsm_data_reg_2_pos 0 ++#define ofsm_data_reg_2_len 8 ++#define ofsm_data_reg_2_lsb 0 ++#define xd_p_ofsm_data_reg_3 (*(volatile byte xdata *) 0xFB17) ++#define p_ofsm_data_reg_3 0xFB17 ++#define ofsm_data_reg_3_pos 0 ++#define ofsm_data_reg_3_len 8 ++#define ofsm_data_reg_3_lsb 0 ++#define xd_p_ofsm_data_reg_4 (*(volatile byte xdata *) 0xFB18) ++#define p_ofsm_data_reg_4 0xFB18 ++#define ofsm_data_reg_4_pos 0 ++#define ofsm_data_reg_4_len 8 ++#define ofsm_data_reg_4_lsb 0 ++#define xd_p_ofsm_data_reg_5 (*(volatile byte xdata *) 0xFB19) ++#define p_ofsm_data_reg_5 0xFB19 ++#define ofsm_data_reg_5_pos 0 ++#define ofsm_data_reg_5_len 8 ++#define ofsm_data_reg_5_lsb 0 ++#define xd_p_ofsm_data_reg_6 (*(volatile byte xdata *) 0xFB1A) ++#define p_ofsm_data_reg_6 0xFB1A ++#define ofsm_data_reg_6_pos 0 ++#define ofsm_data_reg_6_len 8 ++#define ofsm_data_reg_6_lsb 0 ++#define xd_p_ofsm_data_reg_7 (*(volatile byte xdata *) 0xFB1B) ++#define p_ofsm_data_reg_7 0xFB1B ++#define ofsm_data_reg_7_pos 0 ++#define ofsm_data_reg_7_len 8 ++#define ofsm_data_reg_7_lsb 0 ++#define xd_p_ofsm_data_reg_8 (*(volatile byte xdata *) 0xFB1C) ++#define p_ofsm_data_reg_8 0xFB1C ++#define ofsm_data_reg_8_pos 0 ++#define ofsm_data_reg_8_len 8 ++#define ofsm_data_reg_8_lsb 0 ++#define xd_p_ofsm_data_reg_9 (*(volatile byte xdata *) 0xFB1D) ++#define p_ofsm_data_reg_9 0xFB1D ++#define ofsm_data_reg_9_pos 0 ++#define ofsm_data_reg_9_len 8 ++#define ofsm_data_reg_9_lsb 0 ++#define xd_p_ofsm_data_reg_10 (*(volatile byte xdata *) 0xFB1E) ++#define p_ofsm_data_reg_10 0xFB1E ++#define ofsm_data_reg_10_pos 0 ++#define ofsm_data_reg_10_len 8 ++#define ofsm_data_reg_10_lsb 0 ++#define xd_p_ofsm_data_reg_11 (*(volatile byte xdata *) 0xFB1F) ++#define p_ofsm_data_reg_11 0xFB1F ++#define ofsm_data_reg_11_pos 0 ++#define ofsm_data_reg_11_len 8 ++#define ofsm_data_reg_11_lsb 0 ++#define xd_p_ofsm_data_reg_12 (*(volatile byte xdata *) 0xFB20) ++#define p_ofsm_data_reg_12 0xFB20 ++#define ofsm_data_reg_12_pos 0 ++#define ofsm_data_reg_12_len 8 ++#define ofsm_data_reg_12_lsb 0 ++#define xd_p_ofsm_data_reg_13 (*(volatile byte xdata *) 0xFB21) ++#define p_ofsm_data_reg_13 0xFB21 ++#define ofsm_data_reg_13_pos 0 ++#define ofsm_data_reg_13_len 8 ++#define ofsm_data_reg_13_lsb 0 ++#define xd_p_ofsm_data_reg_14 (*(volatile byte xdata *) 0xFB22) ++#define p_ofsm_data_reg_14 0xFB22 ++#define ofsm_data_reg_14_pos 0 ++#define ofsm_data_reg_14_len 8 ++#define ofsm_data_reg_14_lsb 0 ++#define xd_p_ofsm_data_reg_15 (*(volatile byte xdata *) 0xFB23) ++#define p_ofsm_data_reg_15 0xFB23 ++#define ofsm_data_reg_15_pos 0 ++#define ofsm_data_reg_15_len 8 ++#define ofsm_data_reg_15_lsb 0 ++#define xd_p_reg_afe_mem0 (*(volatile byte xdata *) 0xFB24) ++#define p_reg_afe_mem0 0xFB24 ++#define reg_afe_mem0_pos 0 ++#define reg_afe_mem0_len 8 ++#define reg_afe_mem0_lsb 0 ++#define xd_p_reg_afe_mem1 (*(volatile byte xdata *) 0xFB25) ++#define p_reg_afe_mem1 0xFB25 ++#define reg_afe_mem1_pos 0 ++#define reg_afe_mem1_len 8 ++#define reg_afe_mem1_lsb 0 ++#define xd_p_reg_afe_mem2 (*(volatile byte xdata *) 0xFB26) ++#define p_reg_afe_mem2 0xFB26 ++#define reg_afe_mem2_pos 0 ++#define reg_afe_mem2_len 8 ++#define reg_afe_mem2_lsb 0 ++#define xd_p_reg_afe_mem3 (*(volatile byte xdata *) 0xFB27) ++#define p_reg_afe_mem3 0xFB27 ++#define reg_afe_mem3_pos 0 ++#define reg_afe_mem3_len 8 ++#define reg_afe_mem3_lsb 0 ++#define xd_p_reg_afe_mem4 (*(volatile byte xdata *) 0xFB28) ++#define p_reg_afe_mem4 0xFB28 ++#define reg_afe_mem4_pos 0 ++#define reg_afe_mem4_len 8 ++#define reg_afe_mem4_lsb 0 ++#define xd_p_reg_afe_mem5 (*(volatile byte xdata *) 0xFB29) ++#define p_reg_afe_mem5 0xFB29 ++#define reg_afe_mem5_pos 0 ++#define reg_afe_mem5_len 8 ++#define reg_afe_mem5_lsb 0 ++#define xd_p_reg_afe_mem6 (*(volatile byte xdata *) 0xFB2A) ++#define p_reg_afe_mem6 0xFB2A ++#define reg_afe_mem6_pos 0 ++#define reg_afe_mem6_len 8 ++#define reg_afe_mem6_lsb 0 ++#define xd_p_reg_afe_mem7 (*(volatile byte xdata *) 0xFB2B) ++#define p_reg_afe_mem7 0xFB2B ++#define reg_afe_mem7_pos 0 ++#define reg_afe_mem7_len 8 ++#define reg_afe_mem7_lsb 0 ++#define xd_p_reg_i2cbootreq (*(volatile byte xdata *) 0xFB2C) ++#define p_reg_i2cbootreq 0xFB2C ++#define reg_i2cbootreq_pos 0 ++#define reg_i2cbootreq_len 1 ++#define reg_i2cbootreq_lsb 0 ++#define xd_p_reg_rst_i2cm (*(volatile byte xdata *) 0xFB30) ++#define p_reg_rst_i2cm 0xFB30 ++#define reg_rst_i2cm_pos 0 ++#define reg_rst_i2cm_len 1 ++#define reg_rst_i2cm_lsb 0 ++#define xd_p_reg_rst_i2cs (*(volatile byte xdata *) 0xFB31) ++#define p_reg_rst_i2cs 0xFB31 ++#define reg_rst_i2cs_pos 0 ++#define reg_rst_i2cs_len 1 ++#define reg_rst_i2cs_lsb 0 ++#define xd_r_reg_top_gpioscli (*(volatile byte xdata *) 0xFB32) ++#define r_reg_top_gpioscli 0xFB32 ++#define reg_top_gpioscli_pos 0 ++#define reg_top_gpioscli_len 1 ++#define reg_top_gpioscli_lsb 0 ++#define xd_p_reg_top_gpiosclo (*(volatile byte xdata *) 0xFB33) ++#define p_reg_top_gpiosclo 0xFB33 ++#define reg_top_gpiosclo_pos 0 ++#define reg_top_gpiosclo_len 1 ++#define reg_top_gpiosclo_lsb 0 ++#define xd_p_reg_top_gpiosclen (*(volatile byte xdata *) 0xFB34) ++#define p_reg_top_gpiosclen 0xFB34 ++#define reg_top_gpiosclen_pos 0 ++#define reg_top_gpiosclen_len 1 ++#define reg_top_gpiosclen_lsb 0 ++#define xd_p_reg_top_gpiosclon (*(volatile byte xdata *) 0xFB35) ++#define p_reg_top_gpiosclon 0xFB35 ++#define reg_top_gpiosclon_pos 0 ++#define reg_top_gpiosclon_len 1 ++#define reg_top_gpiosclon_lsb 0 ++#define xd_r_reg_top_gpiosdai (*(volatile byte xdata *) 0xFB36) ++#define r_reg_top_gpiosdai 0xFB36 ++#define reg_top_gpiosdai_pos 0 ++#define reg_top_gpiosdai_len 1 ++#define reg_top_gpiosdai_lsb 0 ++#define xd_p_reg_top_gpiosdao (*(volatile byte xdata *) 0xFB37) ++#define p_reg_top_gpiosdao 0xFB37 ++#define reg_top_gpiosdao_pos 0 ++#define reg_top_gpiosdao_len 1 ++#define reg_top_gpiosdao_lsb 0 ++#define xd_p_reg_top_gpiosdaen (*(volatile byte xdata *) 0xFB38) ++#define p_reg_top_gpiosdaen 0xFB38 ++#define reg_top_gpiosdaen_pos 0 ++#define reg_top_gpiosdaen_len 1 ++#define reg_top_gpiosdaen_lsb 0 ++#define xd_p_reg_top_gpiosdaon (*(volatile byte xdata *) 0xFB39) ++#define p_reg_top_gpiosdaon 0xFB39 ++#define reg_top_gpiosdaon_pos 0 ++#define reg_top_gpiosdaon_len 1 ++#define reg_top_gpiosdaon_lsb 0 ++#define xd_p_reg_fix_rom_en (*(volatile byte xdata *) 0xFB3A) ++#define p_reg_fix_rom_en 0xFB3A ++#define reg_fix_rom_en_pos 0 ++#define reg_fix_rom_en_len 1 ++#define reg_fix_rom_en_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_0 (*(volatile byte xdata *) 0xFB3B) ++#define p_reg_ofsm_bug_addh_0 0xFB3B ++#define reg_ofsm_bug_addh_0_pos 0 ++#define reg_ofsm_bug_addh_0_len 8 ++#define reg_ofsm_bug_addh_0_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_0 (*(volatile byte xdata *) 0xFB3C) ++#define p_reg_ofsm_bug_addl_0 0xFB3C ++#define reg_ofsm_bug_addl_0_pos 0 ++#define reg_ofsm_bug_addl_0_len 8 ++#define reg_ofsm_bug_addl_0_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_1 (*(volatile byte xdata *) 0xFB3D) ++#define p_reg_ofsm_bug_addh_1 0xFB3D ++#define reg_ofsm_bug_addh_1_pos 0 ++#define reg_ofsm_bug_addh_1_len 8 ++#define reg_ofsm_bug_addh_1_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_1 (*(volatile byte xdata *) 0xFB3E) ++#define p_reg_ofsm_bug_addl_1 0xFB3E ++#define reg_ofsm_bug_addl_1_pos 0 ++#define reg_ofsm_bug_addl_1_len 8 ++#define reg_ofsm_bug_addl_1_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_2 (*(volatile byte xdata *) 0xFB3F) ++#define p_reg_ofsm_bug_addh_2 0xFB3F ++#define reg_ofsm_bug_addh_2_pos 0 ++#define reg_ofsm_bug_addh_2_len 8 ++#define reg_ofsm_bug_addh_2_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_2 (*(volatile byte xdata *) 0xFB40) ++#define p_reg_ofsm_bug_addl_2 0xFB40 ++#define reg_ofsm_bug_addl_2_pos 0 ++#define reg_ofsm_bug_addl_2_len 8 ++#define reg_ofsm_bug_addl_2_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_3 (*(volatile byte xdata *) 0xFB41) ++#define p_reg_ofsm_bug_addh_3 0xFB41 ++#define reg_ofsm_bug_addh_3_pos 0 ++#define reg_ofsm_bug_addh_3_len 8 ++#define reg_ofsm_bug_addh_3_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_3 (*(volatile byte xdata *) 0xFB42) ++#define p_reg_ofsm_bug_addl_3 0xFB42 ++#define reg_ofsm_bug_addl_3_pos 0 ++#define reg_ofsm_bug_addl_3_len 8 ++#define reg_ofsm_bug_addl_3_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_4 (*(volatile byte xdata *) 0xFB43) ++#define p_reg_ofsm_bug_addh_4 0xFB43 ++#define reg_ofsm_bug_addh_4_pos 0 ++#define reg_ofsm_bug_addh_4_len 8 ++#define reg_ofsm_bug_addh_4_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_4 (*(volatile byte xdata *) 0xFB44) ++#define p_reg_ofsm_bug_addl_4 0xFB44 ++#define reg_ofsm_bug_addl_4_pos 0 ++#define reg_ofsm_bug_addl_4_len 8 ++#define reg_ofsm_bug_addl_4_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_5 (*(volatile byte xdata *) 0xFB45) ++#define p_reg_ofsm_bug_addh_5 0xFB45 ++#define reg_ofsm_bug_addh_5_pos 0 ++#define reg_ofsm_bug_addh_5_len 8 ++#define reg_ofsm_bug_addh_5_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_5 (*(volatile byte xdata *) 0xFB46) ++#define p_reg_ofsm_bug_addl_5 0xFB46 ++#define reg_ofsm_bug_addl_5_pos 0 ++#define reg_ofsm_bug_addl_5_len 8 ++#define reg_ofsm_bug_addl_5_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_6 (*(volatile byte xdata *) 0xFB47) ++#define p_reg_ofsm_bug_addh_6 0xFB47 ++#define reg_ofsm_bug_addh_6_pos 0 ++#define reg_ofsm_bug_addh_6_len 8 ++#define reg_ofsm_bug_addh_6_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_6 (*(volatile byte xdata *) 0xFB48) ++#define p_reg_ofsm_bug_addl_6 0xFB48 ++#define reg_ofsm_bug_addl_6_pos 0 ++#define reg_ofsm_bug_addl_6_len 8 ++#define reg_ofsm_bug_addl_6_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_7 (*(volatile byte xdata *) 0xFB49) ++#define p_reg_ofsm_bug_addh_7 0xFB49 ++#define reg_ofsm_bug_addh_7_pos 0 ++#define reg_ofsm_bug_addh_7_len 8 ++#define reg_ofsm_bug_addh_7_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_7 (*(volatile byte xdata *) 0xFB4A) ++#define p_reg_ofsm_bug_addl_7 0xFB4A ++#define reg_ofsm_bug_addl_7_pos 0 ++#define reg_ofsm_bug_addl_7_len 8 ++#define reg_ofsm_bug_addl_7_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_8 (*(volatile byte xdata *) 0xFB4B) ++#define p_reg_ofsm_bug_addh_8 0xFB4B ++#define reg_ofsm_bug_addh_8_pos 0 ++#define reg_ofsm_bug_addh_8_len 8 ++#define reg_ofsm_bug_addh_8_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_8 (*(volatile byte xdata *) 0xFB4C) ++#define p_reg_ofsm_bug_addl_8 0xFB4C ++#define reg_ofsm_bug_addl_8_pos 0 ++#define reg_ofsm_bug_addl_8_len 8 ++#define reg_ofsm_bug_addl_8_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_9 (*(volatile byte xdata *) 0xFB4D) ++#define p_reg_ofsm_bug_addh_9 0xFB4D ++#define reg_ofsm_bug_addh_9_pos 0 ++#define reg_ofsm_bug_addh_9_len 8 ++#define reg_ofsm_bug_addh_9_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_9 (*(volatile byte xdata *) 0xFB4E) ++#define p_reg_ofsm_bug_addl_9 0xFB4E ++#define reg_ofsm_bug_addl_9_pos 0 ++#define reg_ofsm_bug_addl_9_len 8 ++#define reg_ofsm_bug_addl_9_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_10 (*(volatile byte xdata *) 0xFB4F) ++#define p_reg_ofsm_bug_addh_10 0xFB4F ++#define reg_ofsm_bug_addh_10_pos 0 ++#define reg_ofsm_bug_addh_10_len 8 ++#define reg_ofsm_bug_addh_10_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_10 (*(volatile byte xdata *) 0xFB50) ++#define p_reg_ofsm_bug_addl_10 0xFB50 ++#define reg_ofsm_bug_addl_10_pos 0 ++#define reg_ofsm_bug_addl_10_len 8 ++#define reg_ofsm_bug_addl_10_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_11 (*(volatile byte xdata *) 0xFB51) ++#define p_reg_ofsm_bug_addh_11 0xFB51 ++#define reg_ofsm_bug_addh_11_pos 0 ++#define reg_ofsm_bug_addh_11_len 8 ++#define reg_ofsm_bug_addh_11_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_11 (*(volatile byte xdata *) 0xFB52) ++#define p_reg_ofsm_bug_addl_11 0xFB52 ++#define reg_ofsm_bug_addl_11_pos 0 ++#define reg_ofsm_bug_addl_11_len 8 ++#define reg_ofsm_bug_addl_11_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_12 (*(volatile byte xdata *) 0xFB53) ++#define p_reg_ofsm_bug_addh_12 0xFB53 ++#define reg_ofsm_bug_addh_12_pos 0 ++#define reg_ofsm_bug_addh_12_len 8 ++#define reg_ofsm_bug_addh_12_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_12 (*(volatile byte xdata *) 0xFB54) ++#define p_reg_ofsm_bug_addl_12 0xFB54 ++#define reg_ofsm_bug_addl_12_pos 0 ++#define reg_ofsm_bug_addl_12_len 8 ++#define reg_ofsm_bug_addl_12_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_13 (*(volatile byte xdata *) 0xFB55) ++#define p_reg_ofsm_bug_addh_13 0xFB55 ++#define reg_ofsm_bug_addh_13_pos 0 ++#define reg_ofsm_bug_addh_13_len 8 ++#define reg_ofsm_bug_addh_13_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_13 (*(volatile byte xdata *) 0xFB56) ++#define p_reg_ofsm_bug_addl_13 0xFB56 ++#define reg_ofsm_bug_addl_13_pos 0 ++#define reg_ofsm_bug_addl_13_len 8 ++#define reg_ofsm_bug_addl_13_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_14 (*(volatile byte xdata *) 0xFB57) ++#define p_reg_ofsm_bug_addh_14 0xFB57 ++#define reg_ofsm_bug_addh_14_pos 0 ++#define reg_ofsm_bug_addh_14_len 8 ++#define reg_ofsm_bug_addh_14_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_14 (*(volatile byte xdata *) 0xFB58) ++#define p_reg_ofsm_bug_addl_14 0xFB58 ++#define reg_ofsm_bug_addl_14_pos 0 ++#define reg_ofsm_bug_addl_14_len 8 ++#define reg_ofsm_bug_addl_14_lsb 0 ++#define xd_p_reg_ofsm_bug_addh_15 (*(volatile byte xdata *) 0xFB59) ++#define p_reg_ofsm_bug_addh_15 0xFB59 ++#define reg_ofsm_bug_addh_15_pos 0 ++#define reg_ofsm_bug_addh_15_len 8 ++#define reg_ofsm_bug_addh_15_lsb 0 ++#define xd_p_reg_ofsm_bug_addl_15 (*(volatile byte xdata *) 0xFB5A) ++#define p_reg_ofsm_bug_addl_15 0xFB5A ++#define reg_ofsm_bug_addl_15_pos 0 ++#define reg_ofsm_bug_addl_15_len 8 ++#define reg_ofsm_bug_addl_15_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_0 (*(volatile byte xdata *) 0xFB5B) ++#define p_reg_ofsm_jmp_addh_0 0xFB5B ++#define reg_ofsm_jmp_addh_0_pos 0 ++#define reg_ofsm_jmp_addh_0_len 8 ++#define reg_ofsm_jmp_addh_0_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_0 (*(volatile byte xdata *) 0xFB5C) ++#define p_reg_ofsm_jmp_addl_0 0xFB5C ++#define reg_ofsm_jmp_addl_0_pos 0 ++#define reg_ofsm_jmp_addl_0_len 8 ++#define reg_ofsm_jmp_addl_0_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_1 (*(volatile byte xdata *) 0xFB5D) ++#define p_reg_ofsm_jmp_addh_1 0xFB5D ++#define reg_ofsm_jmp_addh_1_pos 0 ++#define reg_ofsm_jmp_addh_1_len 8 ++#define reg_ofsm_jmp_addh_1_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_1 (*(volatile byte xdata *) 0xFB5E) ++#define p_reg_ofsm_jmp_addl_1 0xFB5E ++#define reg_ofsm_jmp_addl_1_pos 0 ++#define reg_ofsm_jmp_addl_1_len 8 ++#define reg_ofsm_jmp_addl_1_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_2 (*(volatile byte xdata *) 0xFB5F) ++#define p_reg_ofsm_jmp_addh_2 0xFB5F ++#define reg_ofsm_jmp_addh_2_pos 0 ++#define reg_ofsm_jmp_addh_2_len 8 ++#define reg_ofsm_jmp_addh_2_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_2 (*(volatile byte xdata *) 0xFB60) ++#define p_reg_ofsm_jmp_addl_2 0xFB60 ++#define reg_ofsm_jmp_addl_2_pos 0 ++#define reg_ofsm_jmp_addl_2_len 8 ++#define reg_ofsm_jmp_addl_2_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_3 (*(volatile byte xdata *) 0xFB61) ++#define p_reg_ofsm_jmp_addh_3 0xFB61 ++#define reg_ofsm_jmp_addh_3_pos 0 ++#define reg_ofsm_jmp_addh_3_len 8 ++#define reg_ofsm_jmp_addh_3_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_3 (*(volatile byte xdata *) 0xFB62) ++#define p_reg_ofsm_jmp_addl_3 0xFB62 ++#define reg_ofsm_jmp_addl_3_pos 0 ++#define reg_ofsm_jmp_addl_3_len 8 ++#define reg_ofsm_jmp_addl_3_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_4 (*(volatile byte xdata *) 0xFB63) ++#define p_reg_ofsm_jmp_addh_4 0xFB63 ++#define reg_ofsm_jmp_addh_4_pos 0 ++#define reg_ofsm_jmp_addh_4_len 8 ++#define reg_ofsm_jmp_addh_4_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_4 (*(volatile byte xdata *) 0xFB64) ++#define p_reg_ofsm_jmp_addl_4 0xFB64 ++#define reg_ofsm_jmp_addl_4_pos 0 ++#define reg_ofsm_jmp_addl_4_len 8 ++#define reg_ofsm_jmp_addl_4_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_5 (*(volatile byte xdata *) 0xFB65) ++#define p_reg_ofsm_jmp_addh_5 0xFB65 ++#define reg_ofsm_jmp_addh_5_pos 0 ++#define reg_ofsm_jmp_addh_5_len 8 ++#define reg_ofsm_jmp_addh_5_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_5 (*(volatile byte xdata *) 0xFB66) ++#define p_reg_ofsm_jmp_addl_5 0xFB66 ++#define reg_ofsm_jmp_addl_5_pos 0 ++#define reg_ofsm_jmp_addl_5_len 8 ++#define reg_ofsm_jmp_addl_5_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_6 (*(volatile byte xdata *) 0xFB67) ++#define p_reg_ofsm_jmp_addh_6 0xFB67 ++#define reg_ofsm_jmp_addh_6_pos 0 ++#define reg_ofsm_jmp_addh_6_len 8 ++#define reg_ofsm_jmp_addh_6_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_6 (*(volatile byte xdata *) 0xFB68) ++#define p_reg_ofsm_jmp_addl_6 0xFB68 ++#define reg_ofsm_jmp_addl_6_pos 0 ++#define reg_ofsm_jmp_addl_6_len 8 ++#define reg_ofsm_jmp_addl_6_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_7 (*(volatile byte xdata *) 0xFB69) ++#define p_reg_ofsm_jmp_addh_7 0xFB69 ++#define reg_ofsm_jmp_addh_7_pos 0 ++#define reg_ofsm_jmp_addh_7_len 8 ++#define reg_ofsm_jmp_addh_7_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_7 (*(volatile byte xdata *) 0xFB6A) ++#define p_reg_ofsm_jmp_addl_7 0xFB6A ++#define reg_ofsm_jmp_addl_7_pos 0 ++#define reg_ofsm_jmp_addl_7_len 8 ++#define reg_ofsm_jmp_addl_7_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_8 (*(volatile byte xdata *) 0xFB6B) ++#define p_reg_ofsm_jmp_addh_8 0xFB6B ++#define reg_ofsm_jmp_addh_8_pos 0 ++#define reg_ofsm_jmp_addh_8_len 8 ++#define reg_ofsm_jmp_addh_8_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_8 (*(volatile byte xdata *) 0xFB6C) ++#define p_reg_ofsm_jmp_addl_8 0xFB6C ++#define reg_ofsm_jmp_addl_8_pos 0 ++#define reg_ofsm_jmp_addl_8_len 8 ++#define reg_ofsm_jmp_addl_8_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_9 (*(volatile byte xdata *) 0xFB6D) ++#define p_reg_ofsm_jmp_addh_9 0xFB6D ++#define reg_ofsm_jmp_addh_9_pos 0 ++#define reg_ofsm_jmp_addh_9_len 8 ++#define reg_ofsm_jmp_addh_9_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_9 (*(volatile byte xdata *) 0xFB6E) ++#define p_reg_ofsm_jmp_addl_9 0xFB6E ++#define reg_ofsm_jmp_addl_9_pos 0 ++#define reg_ofsm_jmp_addl_9_len 8 ++#define reg_ofsm_jmp_addl_9_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_10 (*(volatile byte xdata *) 0xFB6F) ++#define p_reg_ofsm_jmp_addh_10 0xFB6F ++#define reg_ofsm_jmp_addh_10_pos 0 ++#define reg_ofsm_jmp_addh_10_len 8 ++#define reg_ofsm_jmp_addh_10_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_10 (*(volatile byte xdata *) 0xFB70) ++#define p_reg_ofsm_jmp_addl_10 0xFB70 ++#define reg_ofsm_jmp_addl_10_pos 0 ++#define reg_ofsm_jmp_addl_10_len 8 ++#define reg_ofsm_jmp_addl_10_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_11 (*(volatile byte xdata *) 0xFB71) ++#define p_reg_ofsm_jmp_addh_11 0xFB71 ++#define reg_ofsm_jmp_addh_11_pos 0 ++#define reg_ofsm_jmp_addh_11_len 8 ++#define reg_ofsm_jmp_addh_11_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_11 (*(volatile byte xdata *) 0xFB72) ++#define p_reg_ofsm_jmp_addl_11 0xFB72 ++#define reg_ofsm_jmp_addl_11_pos 0 ++#define reg_ofsm_jmp_addl_11_len 8 ++#define reg_ofsm_jmp_addl_11_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_12 (*(volatile byte xdata *) 0xFB73) ++#define p_reg_ofsm_jmp_addh_12 0xFB73 ++#define reg_ofsm_jmp_addh_12_pos 0 ++#define reg_ofsm_jmp_addh_12_len 8 ++#define reg_ofsm_jmp_addh_12_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_12 (*(volatile byte xdata *) 0xFB74) ++#define p_reg_ofsm_jmp_addl_12 0xFB74 ++#define reg_ofsm_jmp_addl_12_pos 0 ++#define reg_ofsm_jmp_addl_12_len 8 ++#define reg_ofsm_jmp_addl_12_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_13 (*(volatile byte xdata *) 0xFB75) ++#define p_reg_ofsm_jmp_addh_13 0xFB75 ++#define reg_ofsm_jmp_addh_13_pos 0 ++#define reg_ofsm_jmp_addh_13_len 8 ++#define reg_ofsm_jmp_addh_13_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_13 (*(volatile byte xdata *) 0xFB76) ++#define p_reg_ofsm_jmp_addl_13 0xFB76 ++#define reg_ofsm_jmp_addl_13_pos 0 ++#define reg_ofsm_jmp_addl_13_len 8 ++#define reg_ofsm_jmp_addl_13_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_14 (*(volatile byte xdata *) 0xFB77) ++#define p_reg_ofsm_jmp_addh_14 0xFB77 ++#define reg_ofsm_jmp_addh_14_pos 0 ++#define reg_ofsm_jmp_addh_14_len 8 ++#define reg_ofsm_jmp_addh_14_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_14 (*(volatile byte xdata *) 0xFB78) ++#define p_reg_ofsm_jmp_addl_14 0xFB78 ++#define reg_ofsm_jmp_addl_14_pos 0 ++#define reg_ofsm_jmp_addl_14_len 8 ++#define reg_ofsm_jmp_addl_14_lsb 0 ++#define xd_p_reg_ofsm_jmp_addh_15 (*(volatile byte xdata *) 0xFB79) ++#define p_reg_ofsm_jmp_addh_15 0xFB79 ++#define reg_ofsm_jmp_addh_15_pos 0 ++#define reg_ofsm_jmp_addh_15_len 8 ++#define reg_ofsm_jmp_addh_15_lsb 0 ++#define xd_p_reg_ofsm_jmp_addl_15 (*(volatile byte xdata *) 0xFB7A) ++#define p_reg_ofsm_jmp_addl_15 0xFB7A ++#define reg_ofsm_jmp_addl_15_pos 0 ++#define reg_ofsm_jmp_addl_15_len 8 ++#define reg_ofsm_jmp_addl_15_lsb 0 ++#define xd_p_reg_sw_mon51 (*(volatile byte xdata *) 0xFB7B) ++#define p_reg_sw_mon51 0xFB7B ++#define reg_sw_mon51_pos 0 ++#define reg_sw_mon51_len 7 ++#define reg_sw_mon51_lsb 0 ++#define xd_p_reg_ofdm_mon51_flag (*(volatile byte xdata *) 0xFB7C) ++#define p_reg_ofdm_mon51_flag 0xFB7C ++#define reg_ofdm_mon51_flag_pos 0 ++#define reg_ofdm_mon51_flag_len 1 ++#define reg_ofdm_mon51_flag_lsb 0 ++#define xd_p_reg_ofdm_force_mon51 (*(volatile byte xdata *) 0xFB7D) ++#define p_reg_ofdm_force_mon51 0xFB7D ++#define reg_ofdm_force_mon51_pos 0 ++#define reg_ofdm_force_mon51_len 1 ++#define reg_ofdm_force_mon51_lsb 0 ++#define xd_p_reg_ofdm_which_cpu (*(volatile byte xdata *) 0xFB7E) ++#define p_reg_ofdm_which_cpu 0xFB7E ++#define reg_ofdm_which_cpu_pos 0 ++#define reg_ofdm_which_cpu_len 1 ++#define reg_ofdm_which_cpu_lsb 0 ++#define xd_p_reg_ofdm_code_ready (*(volatile byte xdata *) 0xFB7F) ++#define p_reg_ofdm_code_ready 0xFB7F ++#define reg_ofdm_code_ready_pos 0 ++#define reg_ofdm_code_ready_len 1 ++#define reg_ofdm_code_ready_lsb 0 ++#define xd_p_reg_ofdm_mailbox_wend (*(volatile byte xdata *) 0xFB80) ++#define p_reg_ofdm_mailbox_wend 0xFB80 ++#define reg_ofdm_mailbox_wend_pos 0 ++#define reg_ofdm_mailbox_wend_len 1 ++#define reg_ofdm_mailbox_wend_lsb 0 ++#define xd_r_reg_fast_slow_train (*(volatile byte xdata *) 0xFB81) ++#define r_reg_fast_slow_train 0xFB81 ++#define reg_fast_slow_train_pos 0 ++#define reg_fast_slow_train_len 1 ++#define reg_fast_slow_train_lsb 0 ++#define xd_p_reg_ofdm_mailbox_wptr (*(volatile byte xdata *) 0xFB82) ++#define p_reg_ofdm_mailbox_wptr 0xFB82 ++#define reg_ofdm_mailbox_wptr_pos 0 ++#define reg_ofdm_mailbox_wptr_len 8 ++#define reg_ofdm_mailbox_wptr_lsb 0 ++#define xd_p_reg_ofdm_mailbox_int (*(volatile byte xdata *) 0xFB86) ++#define p_reg_ofdm_mailbox_int 0xFB86 ++#define reg_ofdm_mailbox_int_pos 0 ++#define reg_ofdm_mailbox_int_len 1 ++#define reg_ofdm_mailbox_int_lsb 0 ++#define xd_p_reg_ofdm_lnk2ofdm_int (*(volatile byte xdata *) 0xFB87) ++#define p_reg_ofdm_lnk2ofdm_int 0xFB87 ++#define reg_ofdm_lnk2ofdm_int_pos 0 ++#define reg_ofdm_lnk2ofdm_int_len 1 ++#define reg_ofdm_lnk2ofdm_int_lsb 0 ++#define xd_p_reg_ofdm_ofdm2lnk_int (*(volatile byte xdata *) 0xFB88) ++#define p_reg_ofdm_ofdm2lnk_int 0xFB88 ++#define reg_ofdm_ofdm2lnk_int_pos 0 ++#define reg_ofdm_ofdm2lnk_int_len 1 ++#define reg_ofdm_ofdm2lnk_int_lsb 0 ++#define xd_r_reg_load_ofdm_reg (*(volatile byte xdata *) 0xFB8F) ++#define r_reg_load_ofdm_reg 0xFB8F ++#define reg_load_ofdm_reg_pos 0 ++#define reg_load_ofdm_reg_len 1 ++#define reg_load_ofdm_reg_lsb 0 ++#define xd_p_reg_lnk_mbx_rd_length_7_0 (*(volatile byte xdata *) 0xFB90) ++#define p_reg_lnk_mbx_rd_length_7_0 0xFB90 ++#define reg_lnk_mbx_rd_length_7_0_pos 0 ++#define reg_lnk_mbx_rd_length_7_0_len 8 ++#define reg_lnk_mbx_rd_length_7_0_lsb 0 ++#define xd_p_reg_lnk_mbx_rd_length_15_8 (*(volatile byte xdata *) 0xFB91) ++#define p_reg_lnk_mbx_rd_length_15_8 0xFB91 ++#define reg_lnk_mbx_rd_length_15_8_pos 0 ++#define reg_lnk_mbx_rd_length_15_8_len 8 ++#define reg_lnk_mbx_rd_length_15_8_lsb 8 ++#define xd_p_reg_lnk_mbx_rd_length_17_16 (*(volatile byte xdata *) 0xFB92) ++#define p_reg_lnk_mbx_rd_length_17_16 0xFB92 ++#define reg_lnk_mbx_rd_length_17_16_pos 0 ++#define reg_lnk_mbx_rd_length_17_16_len 2 ++#define reg_lnk_mbx_rd_length_17_16_lsb 16 ++#define xd_p_reg_lnk_rd_data_sel (*(volatile byte xdata *) 0xFB93) ++#define p_reg_lnk_rd_data_sel 0xFB93 ++#define reg_lnk_rd_data_sel_pos 0 ++#define reg_lnk_rd_data_sel_len 2 ++#define reg_lnk_rd_data_sel_lsb 0 ++#define xd_p_reg_ofdm2lnk_data_7_0 (*(volatile byte xdata *) 0xFB96) ++#define p_reg_ofdm2lnk_data_7_0 0xFB96 ++#define reg_ofdm2lnk_data_7_0_pos 0 ++#define reg_ofdm2lnk_data_7_0_len 8 ++#define reg_ofdm2lnk_data_7_0_lsb 0 ++#define xd_p_reg_ofdm2lnk_data_15_8 (*(volatile byte xdata *) 0xFB97) ++#define p_reg_ofdm2lnk_data_15_8 0xFB97 ++#define reg_ofdm2lnk_data_15_8_pos 0 ++#define reg_ofdm2lnk_data_15_8_len 8 ++#define reg_ofdm2lnk_data_15_8_lsb 8 ++#define xd_p_reg_ofdm2lnk_data_23_16 (*(volatile byte xdata *) 0xFB98) ++#define p_reg_ofdm2lnk_data_23_16 0xFB98 ++#define reg_ofdm2lnk_data_23_16_pos 0 ++#define reg_ofdm2lnk_data_23_16_len 8 ++#define reg_ofdm2lnk_data_23_16_lsb 16 ++#define xd_p_reg_ofdm2lnk_data_31_24 (*(volatile byte xdata *) 0xFB99) ++#define p_reg_ofdm2lnk_data_31_24 0xFB99 ++#define reg_ofdm2lnk_data_31_24_pos 0 ++#define reg_ofdm2lnk_data_31_24_len 8 ++#define reg_ofdm2lnk_data_31_24_lsb 24 ++#define xd_p_reg_ofdm2lnk_data_39_32 (*(volatile byte xdata *) 0xFB9A) ++#define p_reg_ofdm2lnk_data_39_32 0xFB9A ++#define reg_ofdm2lnk_data_39_32_pos 0 ++#define reg_ofdm2lnk_data_39_32_len 8 ++#define reg_ofdm2lnk_data_39_32_lsb 32 ++#define xd_p_reg_ofdm2lnk_data_47_40 (*(volatile byte xdata *) 0xFB9B) ++#define p_reg_ofdm2lnk_data_47_40 0xFB9B ++#define reg_ofdm2lnk_data_47_40_pos 0 ++#define reg_ofdm2lnk_data_47_40_len 8 ++#define reg_ofdm2lnk_data_47_40_lsb 40 ++#define xd_p_reg_ofdm2lnk_data_55_48 (*(volatile byte xdata *) 0xFB9C) ++#define p_reg_ofdm2lnk_data_55_48 0xFB9C ++#define reg_ofdm2lnk_data_55_48_pos 0 ++#define reg_ofdm2lnk_data_55_48_len 8 ++#define reg_ofdm2lnk_data_55_48_lsb 48 ++#define xd_p_reg_ofdm2lnk_data_63_56 (*(volatile byte xdata *) 0xFB9D) ++#define p_reg_ofdm2lnk_data_63_56 0xFB9D ++#define reg_ofdm2lnk_data_63_56_pos 0 ++#define reg_ofdm2lnk_data_63_56_len 8 ++#define reg_ofdm2lnk_data_63_56_lsb 56 ++#define xd_p_reg_lnktoofdm_data_7_0 (*(volatile byte xdata *) 0xFB9E) ++#define p_reg_lnktoofdm_data_7_0 0xFB9E ++#define reg_lnktoofdm_data_7_0_pos 0 ++#define reg_lnktoofdm_data_7_0_len 8 ++#define reg_lnktoofdm_data_7_0_lsb 0 ++#define xd_p_reg_lnktoofdm_data_15_8 (*(volatile byte xdata *) 0xFB9F) ++#define p_reg_lnktoofdm_data_15_8 0xFB9F ++#define reg_lnktoofdm_data_15_8_pos 0 ++#define reg_lnktoofdm_data_15_8_len 8 ++#define reg_lnktoofdm_data_15_8_lsb 8 ++#define xd_p_reg_lnktoofdm_data_23_16 (*(volatile byte xdata *) 0xFBA0) ++#define p_reg_lnktoofdm_data_23_16 0xFBA0 ++#define reg_lnktoofdm_data_23_16_pos 0 ++#define reg_lnktoofdm_data_23_16_len 8 ++#define reg_lnktoofdm_data_23_16_lsb 16 ++#define xd_p_reg_lnktoofdm_data_31_24 (*(volatile byte xdata *) 0xFBA1) ++#define p_reg_lnktoofdm_data_31_24 0xFBA1 ++#define reg_lnktoofdm_data_31_24_pos 0 ++#define reg_lnktoofdm_data_31_24_len 8 ++#define reg_lnktoofdm_data_31_24_lsb 24 ++#define xd_p_reg_lnktoofdm_data_39_32 (*(volatile byte xdata *) 0xFBA2) ++#define p_reg_lnktoofdm_data_39_32 0xFBA2 ++#define reg_lnktoofdm_data_39_32_pos 0 ++#define reg_lnktoofdm_data_39_32_len 8 ++#define reg_lnktoofdm_data_39_32_lsb 32 ++#define xd_p_reg_lnktoofdm_data_47_40 (*(volatile byte xdata *) 0xFBA3) ++#define p_reg_lnktoofdm_data_47_40 0xFBA3 ++#define reg_lnktoofdm_data_47_40_pos 0 ++#define reg_lnktoofdm_data_47_40_len 8 ++#define reg_lnktoofdm_data_47_40_lsb 40 ++#define xd_p_reg_lnktoofdm_data_55_48 (*(volatile byte xdata *) 0xFBA4) ++#define p_reg_lnktoofdm_data_55_48 0xFBA4 ++#define reg_lnktoofdm_data_55_48_pos 0 ++#define reg_lnktoofdm_data_55_48_len 8 ++#define reg_lnktoofdm_data_55_48_lsb 48 ++#define xd_p_reg_lnktoofdm_data_63_56 (*(volatile byte xdata *) 0xFBA5) ++#define p_reg_lnktoofdm_data_63_56 0xFBA5 ++#define reg_lnktoofdm_data_63_56_pos 0 ++#define reg_lnktoofdm_data_63_56_len 8 ++#define reg_lnktoofdm_data_63_56_lsb 56 ++#define xd_p_reg_dbgif32_sel (*(volatile byte xdata *) 0xFBA6) ++#define p_reg_dbgif32_sel 0xFBA6 ++#define reg_dbgif32_sel_pos 0 ++#define reg_dbgif32_sel_len 2 ++#define reg_dbgif32_sel_lsb 0 ++#define xd_p_reg_dyn1_clk (*(volatile byte xdata *) 0xFBA7) ++#define p_reg_dyn1_clk 0xFBA7 ++#define reg_dyn1_clk_pos 0 ++#define reg_dyn1_clk_len 1 ++#define reg_dyn1_clk_lsb 0 ++#define xd_p_reg_dyn0_clk (*(volatile byte xdata *) 0xFBA8) ++#define p_reg_dyn0_clk 0xFBA8 ++#define reg_dyn0_clk_pos 0 ++#define reg_dyn0_clk_len 1 ++#define reg_dyn0_clk_lsb 0 ++#define xd_p_reg_free_clk (*(volatile byte xdata *) 0xFBA9) ++#define p_reg_free_clk 0xFBA9 ++#define reg_free_clk_pos 0 ++#define reg_free_clk_len 1 ++#define reg_free_clk_lsb 0 ++#define xd_p_reg_ofdm_stick_mem_end_7_0 (*(volatile byte xdata *) 0xFBAD) ++#define p_reg_ofdm_stick_mem_end_7_0 0xFBAD ++#define reg_ofdm_stick_mem_end_7_0_pos 0 ++#define reg_ofdm_stick_mem_end_7_0_len 8 ++#define reg_ofdm_stick_mem_end_7_0_lsb 0 ++#define xd_p_reg_ofdm_stick_mem_end_15_8 (*(volatile byte xdata *) 0xFBAE) ++#define p_reg_ofdm_stick_mem_end_15_8 0xFBAE ++#define reg_ofdm_stick_mem_end_15_8_pos 0 ++#define reg_ofdm_stick_mem_end_15_8_len 8 ++#define reg_ofdm_stick_mem_end_15_8_lsb 8 ++#define xd_p_reg_ofdm_cpu_reset (*(volatile byte xdata *) 0xFBAF) ++#define p_reg_ofdm_cpu_reset 0xFBAF ++#define reg_ofdm_cpu_reset_pos 0 ++#define reg_ofdm_cpu_reset_len 1 ++#define reg_ofdm_cpu_reset_lsb 0 ++#define xd_p_reg_ofdm_bank_float_en (*(volatile byte xdata *) 0xFBB0) ++#define p_reg_ofdm_bank_float_en 0xFBB0 ++#define reg_ofdm_bank_float_en_pos 0 ++#define reg_ofdm_bank_float_en_len 1 ++#define reg_ofdm_bank_float_en_lsb 0 ++#define xd_p_reg_ofdm_bank_float_start (*(volatile byte xdata *) 0xFBB1) ++#define p_reg_ofdm_bank_float_start 0xFBB1 ++#define reg_ofdm_bank_float_start_pos 0 ++#define reg_ofdm_bank_float_start_len 8 ++#define reg_ofdm_bank_float_start_lsb 0 ++#define xd_p_reg_ofdm_bank_float_stop (*(volatile byte xdata *) 0xFBB2) ++#define p_reg_ofdm_bank_float_stop 0xFBB2 ++#define reg_ofdm_bank_float_stop_pos 0 ++#define reg_ofdm_bank_float_stop_len 8 ++#define reg_ofdm_bank_float_stop_lsb 0 ++#define xd_r_ofsm_bond0_i (*(volatile byte xdata *) 0xFBB3) ++#define r_ofsm_bond0_i 0xFBB3 ++#define ofsm_bond0_i_pos 0 ++#define ofsm_bond0_i_len 1 ++#define ofsm_bond0_i_lsb 0 ++#define xd_r_ofsm_bond1_i (*(volatile byte xdata *) 0xFBB4) ++#define r_ofsm_bond1_i 0xFBB4 ++#define ofsm_bond1_i_pos 0 ++#define ofsm_bond1_i_len 1 ++#define ofsm_bond1_i_lsb 0 ++#define xd_r_io_mux_pwron_clk_strap (*(volatile byte xdata *) 0xD800) ++#define r_io_mux_pwron_clk_strap 0xD800 ++#define io_mux_pwron_clk_strap_pos 0 ++#define io_mux_pwron_clk_strap_len 4 ++#define io_mux_pwron_clk_strap_lsb 0 ++#define xd_r_io_mux_pwron_mode_strap (*(volatile byte xdata *) 0xD801) ++#define r_io_mux_pwron_mode_strap 0xD801 ++#define io_mux_pwron_mode_strap_pos 0 ++#define io_mux_pwron_mode_strap_len 4 ++#define io_mux_pwron_mode_strap_lsb 0 ++#define xd_r_io_mux_pwron_hosta (*(volatile byte xdata *) 0xD802) ++#define r_io_mux_pwron_hosta 0xD802 ++#define io_mux_pwron_hosta_pos 0 ++#define io_mux_pwron_hosta_len 1 ++#define io_mux_pwron_hosta_lsb 0 ++#define xd_r_reg_top_revid (*(volatile byte xdata *) 0xD803) ++#define r_reg_top_revid 0xD803 ++#define reg_top_revid_pos 0 ++#define reg_top_revid_len 4 ++#define reg_top_revid_lsb 0 ++#define xd_r_io_mux_bond0_i (*(volatile byte xdata *) 0xD804) ++#define r_io_mux_bond0_i 0xD804 ++#define io_mux_bond0_i_pos 0 ++#define io_mux_bond0_i_len 1 ++#define io_mux_bond0_i_lsb 0 ++#define xd_r_io_mux_bondu0_i (*(volatile byte xdata *) 0xD805) ++#define r_io_mux_bondu0_i 0xD805 ++#define io_mux_bondu0_i_pos 0 ++#define io_mux_bondu0_i_len 1 ++#define io_mux_bondu0_i_lsb 0 ++#define xd_p_reg_ofsm_suspend (*(volatile byte xdata *) 0xD806) ++#define p_reg_ofsm_suspend 0xD806 ++#define reg_ofsm_suspend_pos 0 ++#define reg_ofsm_suspend_len 1 ++#define reg_ofsm_suspend_lsb 0 ++#define xd_p_reg_tslice_off (*(volatile byte xdata *) 0xD807) ++#define p_reg_tslice_off 0xD807 ++#define reg_tslice_off_pos 0 ++#define reg_tslice_off_len 1 ++#define reg_tslice_off_lsb 0 ++#define xd_p_io_mux_wake_int (*(volatile byte xdata *) 0xD808) ++#define p_io_mux_wake_int 0xD808 ++#define io_mux_wake_int_pos 0 ++#define io_mux_wake_int_len 1 ++#define io_mux_wake_int_lsb 0 ++#define xd_p_reg_top_pwrdw_hwen (*(volatile byte xdata *) 0xD809) ++#define p_reg_top_pwrdw_hwen 0xD809 ++#define reg_top_pwrdw_hwen_pos 0 ++#define reg_top_pwrdw_hwen_len 1 ++#define reg_top_pwrdw_hwen_lsb 0 ++#define xd_p_reg_top_pwrdw_inv (*(volatile byte xdata *) 0xD80A) ++#define p_reg_top_pwrdw_inv 0xD80A ++#define reg_top_pwrdw_inv_pos 0 ++#define reg_top_pwrdw_inv_len 1 ++#define reg_top_pwrdw_inv_lsb 0 ++#define xd_p_reg_top_pwrdw (*(volatile byte xdata *) 0xD80B) ++#define p_reg_top_pwrdw 0xD80B ++#define reg_top_pwrdw_pos 0 ++#define reg_top_pwrdw_len 1 ++#define reg_top_pwrdw_lsb 0 ++#define xd_p_io_mux_wake_int_en (*(volatile byte xdata *) 0xD80C) ++#define p_io_mux_wake_int_en 0xD80C ++#define io_mux_wake_int_en_pos 0 ++#define io_mux_wake_int_en_len 1 ++#define io_mux_wake_int_en_lsb 0 ++#define xd_p_io_mux_pwrdw_int (*(volatile byte xdata *) 0xD80D) ++#define p_io_mux_pwrdw_int 0xD80D ++#define io_mux_pwrdw_int_pos 0 ++#define io_mux_pwrdw_int_len 1 ++#define io_mux_pwrdw_int_lsb 0 ++#define xd_p_reg_top_adcdly (*(volatile byte xdata *) 0xD80E) ++#define p_reg_top_adcdly 0xD80E ++#define reg_top_adcdly_pos 0 ++#define reg_top_adcdly_len 2 ++#define reg_top_adcdly_lsb 0 ++#define xd_p_reg_top_debug (*(volatile byte xdata *) 0xD80F) ++#define p_reg_top_debug 0xD80F ++#define reg_top_debug_pos 0 ++#define reg_top_debug_len 1 ++#define reg_top_debug_lsb 0 ++#define xd_p_reg_top_pcout (*(volatile byte xdata *) 0xD810) ++#define p_reg_top_pcout 0xD810 ++#define reg_top_pcout_pos 0 ++#define reg_top_pcout_len 1 ++#define reg_top_pcout_lsb 0 ++#define xd_p_reg_top_rs232 (*(volatile byte xdata *) 0xD811) ++#define p_reg_top_rs232 0xD811 ++#define reg_top_rs232_pos 0 ++#define reg_top_rs232_len 1 ++#define reg_top_rs232_lsb 0 ++#define xd_p_reg_iqmode (*(volatile byte xdata *) 0xD812) ++#define p_reg_iqmode 0xD812 ++#define reg_iqmode_pos 0 ++#define reg_iqmode_len 1 ++#define reg_iqmode_lsb 0 ++#define xd_p_reg_top_rstfd (*(volatile byte xdata *) 0xD813) ++#define p_reg_top_rstfd 0xD813 ++#define reg_top_rstfd_pos 0 ++#define reg_top_rstfd_len 1 ++#define reg_top_rstfd_lsb 0 ++#define xd_p_reg_sdio_clksel (*(volatile byte xdata *) 0xD814) ++#define p_reg_sdio_clksel 0xD814 ++#define reg_sdio_clksel_pos 0 ++#define reg_sdio_clksel_len 1 ++#define reg_sdio_clksel_lsb 0 ++#define xd_p_reg_utmi_clksel (*(volatile byte xdata *) 0xD815) ++#define p_reg_utmi_clksel 0xD815 ++#define reg_utmi_clksel_pos 0 ++#define reg_utmi_clksel_len 8 ++#define reg_utmi_clksel_lsb 0 ++#define xd_p_reg_top_suscnt (*(volatile byte xdata *) 0xD816) ++#define p_reg_top_suscnt 0xD816 ++#define reg_top_suscnt_pos 0 ++#define reg_top_suscnt_len 2 ++#define reg_top_suscnt_lsb 0 ++#define xd_p_reg_top_dist2f (*(volatile byte xdata *) 0xD817) ++#define p_reg_top_dist2f 0xD817 ++#define reg_top_dist2f_pos 0 ++#define reg_top_dist2f_len 1 ++#define reg_top_dist2f_lsb 0 ++#define xd_p_reg_top_extusb (*(volatile byte xdata *) 0xD818) ++#define p_reg_top_extusb 0xD818 ++#define reg_top_extusb_pos 0 ++#define reg_top_extusb_len 1 ++#define reg_top_extusb_lsb 0 ++#define xd_p_reg_top_adcfifo (*(volatile byte xdata *) 0xD819) ++#define p_reg_top_adcfifo 0xD819 ++#define reg_top_adcfifo_pos 0 ++#define reg_top_adcfifo_len 1 ++#define reg_top_adcfifo_lsb 0 ++#define xd_p_reg_top_clkoen (*(volatile byte xdata *) 0xD81A) ++#define p_reg_top_clkoen 0xD81A ++#define reg_top_clkoen_pos 0 ++#define reg_top_clkoen_len 1 ++#define reg_top_clkoen_lsb 0 ++#define xd_p_reg_top_stpck (*(volatile byte xdata *) 0xD81B) ++#define p_reg_top_stpck 0xD81B ++#define reg_top_stpck_pos 0 ++#define reg_top_stpck_len 1 ++#define reg_top_stpck_lsb 0 ++#define xd_p_reg_top_freeck (*(volatile byte xdata *) 0xD81C) ++#define p_reg_top_freeck 0xD81C ++#define reg_top_freeck_pos 0 ++#define reg_top_freeck_len 1 ++#define reg_top_freeck_lsb 0 ++#define xd_p_reg_top_dio_sel (*(volatile byte xdata *) 0xD81D) ++#define p_reg_top_dio_sel 0xD81D ++#define reg_top_dio_sel_pos 0 ++#define reg_top_dio_sel_len 1 ++#define reg_top_dio_sel_lsb 0 ++#define xd_p_reg_top_int_en (*(volatile byte xdata *) 0xD81E) ++#define p_reg_top_int_en 0xD81E ++#define reg_top_int_en_pos 0 ++#define reg_top_int_en_len 1 ++#define reg_top_int_en_lsb 0 ++#define xd_p_reg_top_int_inv (*(volatile byte xdata *) 0xD81F) ++#define p_reg_top_int_inv 0xD81F ++#define reg_top_int_inv_pos 0 ++#define reg_top_int_inv_len 1 ++#define reg_top_int_inv_lsb 0 ++#define xd_p_reg_tsip_clk_inv (*(volatile byte xdata *) 0xD820) ++#define p_reg_tsip_clk_inv 0xD820 ++#define reg_tsip_clk_inv_pos 0 ++#define reg_tsip_clk_inv_len 1 ++#define reg_tsip_clk_inv_lsb 0 ++#define xd_p_reg_ts_clk_inv (*(volatile byte xdata *) 0xD821) ++#define p_reg_ts_clk_inv 0xD821 ++#define reg_ts_clk_inv_pos 0 ++#define reg_ts_clk_inv_len 1 ++#define reg_ts_clk_inv_lsb 0 ++#define xd_p_reg_ts_hybrid (*(volatile byte xdata *) 0xD822) ++#define p_reg_ts_hybrid 0xD822 ++#define reg_ts_hybrid_pos 0 ++#define reg_ts_hybrid_len 1 ++#define reg_ts_hybrid_lsb 0 ++#define xd_p_reg_ccir_sel (*(volatile byte xdata *) 0xD823) ++#define p_reg_ccir_sel 0xD823 ++#define reg_ccir_sel_pos 0 ++#define reg_ccir_sel_len 4 ++#define reg_ccir_sel_lsb 0 ++#define xd_p_reg_top_sys_gate (*(volatile byte xdata *) 0xD824) ++#define p_reg_top_sys_gate 0xD824 ++#define reg_top_sys_gate_pos 0 ++#define reg_top_sys_gate_len 1 ++#define reg_top_sys_gate_lsb 0 ++#define xd_p_reg_top_padpu (*(volatile byte xdata *) 0xD825) ++#define p_reg_top_padpu 0xD825 ++#define reg_top_padpu_pos 0 ++#define reg_top_padpu_len 1 ++#define reg_top_padpu_lsb 0 ++#define xd_p_reg_top_padpd (*(volatile byte xdata *) 0xD826) ++#define p_reg_top_padpd 0xD826 ++#define reg_top_padpd_pos 0 ++#define reg_top_padpd_len 1 ++#define reg_top_padpd_lsb 0 ++#define xd_p_reg_top_padodpu (*(volatile byte xdata *) 0xD827) ++#define p_reg_top_padodpu 0xD827 ++#define reg_top_padodpu_pos 0 ++#define reg_top_padodpu_len 1 ++#define reg_top_padodpu_lsb 0 ++#define xd_p_reg_top_thirdodpu (*(volatile byte xdata *) 0xD828) ++#define p_reg_top_thirdodpu 0xD828 ++#define reg_top_thirdodpu_pos 0 ++#define reg_top_thirdodpu_len 1 ++#define reg_top_thirdodpu_lsb 0 ++#define xd_p_reg_top_agc_od (*(volatile byte xdata *) 0xD829) ++#define p_reg_top_agc_od 0xD829 ++#define reg_top_agc_od_pos 0 ++#define reg_top_agc_od_len 1 ++#define reg_top_agc_od_lsb 0 ++#define xd_p_reg_top_padmpdr2 (*(volatile byte xdata *) 0xD82A) ++#define p_reg_top_padmpdr2 0xD82A ++#define reg_top_padmpdr2_pos 0 ++#define reg_top_padmpdr2_len 1 ++#define reg_top_padmpdr2_lsb 0 ++#define xd_p_reg_top_padmpdr4 (*(volatile byte xdata *) 0xD82B) ++#define p_reg_top_padmpdr4 0xD82B ++#define reg_top_padmpdr4_pos 0 ++#define reg_top_padmpdr4_len 1 ++#define reg_top_padmpdr4_lsb 0 ++#define xd_p_reg_top_padmpdr8 (*(volatile byte xdata *) 0xD82C) ++#define p_reg_top_padmpdr8 0xD82C ++#define reg_top_padmpdr8_pos 0 ++#define reg_top_padmpdr8_len 1 ++#define reg_top_padmpdr8_lsb 0 ++#define xd_p_reg_top_padmpdrsr (*(volatile byte xdata *) 0xD82D) ++#define p_reg_top_padmpdrsr 0xD82D ++#define reg_top_padmpdrsr_pos 0 ++#define reg_top_padmpdrsr_len 1 ++#define reg_top_padmpdrsr_lsb 0 ++#define xd_p_reg_top_padmppu (*(volatile byte xdata *) 0xD82E) ++#define p_reg_top_padmppu 0xD82E ++#define reg_top_padmppu_pos 0 ++#define reg_top_padmppu_len 1 ++#define reg_top_padmppu_lsb 0 ++#define xd_p_reg_top_padmppd (*(volatile byte xdata *) 0xD82F) ++#define p_reg_top_padmppd 0xD82F ++#define reg_top_padmppd_pos 0 ++#define reg_top_padmppd_len 1 ++#define reg_top_padmppd_lsb 0 ++#define xd_p_reg_top_padmiscdr2 (*(volatile byte xdata *) 0xD830) ++#define p_reg_top_padmiscdr2 0xD830 ++#define reg_top_padmiscdr2_pos 0 ++#define reg_top_padmiscdr2_len 1 ++#define reg_top_padmiscdr2_lsb 0 ++#define xd_p_reg_top_padmiscdr4 (*(volatile byte xdata *) 0xD831) ++#define p_reg_top_padmiscdr4 0xD831 ++#define reg_top_padmiscdr4_pos 0 ++#define reg_top_padmiscdr4_len 1 ++#define reg_top_padmiscdr4_lsb 0 ++#define xd_p_reg_top_padmiscdr8 (*(volatile byte xdata *) 0xD832) ++#define p_reg_top_padmiscdr8 0xD832 ++#define reg_top_padmiscdr8_pos 0 ++#define reg_top_padmiscdr8_len 1 ++#define reg_top_padmiscdr8_lsb 0 ++#define xd_p_reg_top_padmiscdrsr (*(volatile byte xdata *) 0xD833) ++#define p_reg_top_padmiscdrsr 0xD833 ++#define reg_top_padmiscdrsr_pos 0 ++#define reg_top_padmiscdrsr_len 1 ++#define reg_top_padmiscdrsr_lsb 0 ++#define xd_p_reg_top_padmiscpu (*(volatile byte xdata *) 0xD834) ++#define p_reg_top_padmiscpu 0xD834 ++#define reg_top_padmiscpu_pos 0 ++#define reg_top_padmiscpu_len 1 ++#define reg_top_padmiscpu_lsb 0 ++#define xd_p_reg_top_padmiscpd (*(volatile byte xdata *) 0xD835) ++#define p_reg_top_padmiscpd 0xD835 ++#define reg_top_padmiscpd_pos 0 ++#define reg_top_padmiscpd_len 1 ++#define reg_top_padmiscpd_lsb 0 ++#define xd_p_reg_host_b0_smt (*(volatile byte xdata *) 0xD836) ++#define p_reg_host_b0_smt 0xD836 ++#define reg_host_b0_smt_pos 0 ++#define reg_host_b0_smt_len 1 ++#define reg_host_b0_smt_lsb 0 ++#define xd_p_reg_host_b1_smt (*(volatile byte xdata *) 0xD837) ++#define p_reg_host_b1_smt 0xD837 ++#define reg_host_b1_smt_pos 0 ++#define reg_host_b1_smt_len 1 ++#define reg_host_b1_smt_lsb 0 ++#define xd_p_reg_host_b2_smt (*(volatile byte xdata *) 0xD838) ++#define p_reg_host_b2_smt 0xD838 ++#define reg_host_b2_smt_pos 0 ++#define reg_host_b2_smt_len 1 ++#define reg_host_b2_smt_lsb 0 ++#define xd_p_reg_host_b3_smt (*(volatile byte xdata *) 0xD839) ++#define p_reg_host_b3_smt 0xD839 ++#define reg_host_b3_smt_pos 0 ++#define reg_host_b3_smt_len 1 ++#define reg_host_b3_smt_lsb 0 ++#define xd_p_reg_host_b4_smt (*(volatile byte xdata *) 0xD83A) ++#define p_reg_host_b4_smt 0xD83A ++#define reg_host_b4_smt_pos 0 ++#define reg_host_b4_smt_len 1 ++#define reg_host_b4_smt_lsb 0 ++#define xd_p_reg_host_b5_smt (*(volatile byte xdata *) 0xD83B) ++#define p_reg_host_b5_smt 0xD83B ++#define reg_host_b5_smt_pos 0 ++#define reg_host_b5_smt_len 1 ++#define reg_host_b5_smt_lsb 0 ++#define xd_p_reg_host_b6_smt (*(volatile byte xdata *) 0xD83C) ++#define p_reg_host_b6_smt 0xD83C ++#define reg_host_b6_smt_pos 0 ++#define reg_host_b6_smt_len 1 ++#define reg_host_b6_smt_lsb 0 ++#define xd_p_reg_host_b7_smt (*(volatile byte xdata *) 0xD83D) ++#define p_reg_host_b7_smt 0xD83D ++#define reg_host_b7_smt_pos 0 ++#define reg_host_b7_smt_len 1 ++#define reg_host_b7_smt_lsb 0 ++#define xd_p_reg_host_b8_smt (*(volatile byte xdata *) 0xD83E) ++#define p_reg_host_b8_smt 0xD83E ++#define reg_host_b8_smt_pos 0 ++#define reg_host_b8_smt_len 1 ++#define reg_host_b8_smt_lsb 0 ++#define xd_p_reg_host_b9_smt (*(volatile byte xdata *) 0xD83F) ++#define p_reg_host_b9_smt 0xD83F ++#define reg_host_b9_smt_pos 0 ++#define reg_host_b9_smt_len 1 ++#define reg_host_b9_smt_lsb 0 ++#define xd_p_reg_host_b10_smt (*(volatile byte xdata *) 0xD840) ++#define p_reg_host_b10_smt 0xD840 ++#define reg_host_b10_smt_pos 0 ++#define reg_host_b10_smt_len 1 ++#define reg_host_b10_smt_lsb 0 ++#define xd_p_reg_host_b11_smt (*(volatile byte xdata *) 0xD841) ++#define p_reg_host_b11_smt 0xD841 ++#define reg_host_b11_smt_pos 0 ++#define reg_host_b11_smt_len 1 ++#define reg_host_b11_smt_lsb 0 ++#define xd_p_reg_host_a0_smt (*(volatile byte xdata *) 0xD842) ++#define p_reg_host_a0_smt 0xD842 ++#define reg_host_a0_smt_pos 0 ++#define reg_host_a0_smt_len 1 ++#define reg_host_a0_smt_lsb 0 ++#define xd_p_reg_host_a1_smt (*(volatile byte xdata *) 0xD843) ++#define p_reg_host_a1_smt 0xD843 ++#define reg_host_a1_smt_pos 0 ++#define reg_host_a1_smt_len 1 ++#define reg_host_a1_smt_lsb 0 ++#define xd_p_reg_host_a2_smt (*(volatile byte xdata *) 0xD844) ++#define p_reg_host_a2_smt 0xD844 ++#define reg_host_a2_smt_pos 0 ++#define reg_host_a2_smt_len 1 ++#define reg_host_a2_smt_lsb 0 ++#define xd_p_reg_host_a3_smt (*(volatile byte xdata *) 0xD845) ++#define p_reg_host_a3_smt 0xD845 ++#define reg_host_a3_smt_pos 0 ++#define reg_host_a3_smt_len 1 ++#define reg_host_a3_smt_lsb 0 ++#define xd_p_reg_host_a4_smt (*(volatile byte xdata *) 0xD846) ++#define p_reg_host_a4_smt 0xD846 ++#define reg_host_a4_smt_pos 0 ++#define reg_host_a4_smt_len 1 ++#define reg_host_a4_smt_lsb 0 ++#define xd_p_reg_host_a5_smt (*(volatile byte xdata *) 0xD847) ++#define p_reg_host_a5_smt 0xD847 ++#define reg_host_a5_smt_pos 0 ++#define reg_host_a5_smt_len 1 ++#define reg_host_a5_smt_lsb 0 ++#define xd_p_reg_host_a6_smt (*(volatile byte xdata *) 0xD848) ++#define p_reg_host_a6_smt 0xD848 ++#define reg_host_a6_smt_pos 0 ++#define reg_host_a6_smt_len 1 ++#define reg_host_a6_smt_lsb 0 ++#define xd_p_reg_host_a7_smt (*(volatile byte xdata *) 0xD849) ++#define p_reg_host_a7_smt 0xD849 ++#define reg_host_a7_smt_pos 0 ++#define reg_host_a7_smt_len 1 ++#define reg_host_a7_smt_lsb 0 ++#define xd_p_reg_host_a8_smt (*(volatile byte xdata *) 0xD84A) ++#define p_reg_host_a8_smt 0xD84A ++#define reg_host_a8_smt_pos 0 ++#define reg_host_a8_smt_len 1 ++#define reg_host_a8_smt_lsb 0 ++#define xd_p_reg_host_a9_smt (*(volatile byte xdata *) 0xD84B) ++#define p_reg_host_a9_smt 0xD84B ++#define reg_host_a9_smt_pos 0 ++#define reg_host_a9_smt_len 1 ++#define reg_host_a9_smt_lsb 0 ++#define xd_p_reg_host_a10_smt (*(volatile byte xdata *) 0xD84C) ++#define p_reg_host_a10_smt 0xD84C ++#define reg_host_a10_smt_pos 0 ++#define reg_host_a10_smt_len 1 ++#define reg_host_a10_smt_lsb 0 ++#define xd_p_reg_host_a11_smt (*(volatile byte xdata *) 0xD84D) ++#define p_reg_host_a11_smt 0xD84D ++#define reg_host_a11_smt_pos 0 ++#define reg_host_a11_smt_len 1 ++#define reg_host_a11_smt_lsb 0 ++#define xd_p_reg_testmode_pds (*(volatile byte xdata *) 0xD84E) ++#define p_reg_testmode_pds 0xD84E ++#define reg_testmode_pds_pos 0 ++#define reg_testmode_pds_len 3 ++#define reg_testmode_pds_lsb 0 ++#define xd_p_reg_debug31_pds (*(volatile byte xdata *) 0xD84F) ++#define p_reg_debug31_pds 0xD84F ++#define reg_debug31_pds_pos 0 ++#define reg_debug31_pds_len 3 ++#define reg_debug31_pds_lsb 0 ++#define xd_p_reg_debug30_pds (*(volatile byte xdata *) 0xD850) ++#define p_reg_debug30_pds 0xD850 ++#define reg_debug30_pds_pos 0 ++#define reg_debug30_pds_len 3 ++#define reg_debug30_pds_lsb 0 ++#define xd_p_reg_debug29_pds (*(volatile byte xdata *) 0xD851) ++#define p_reg_debug29_pds 0xD851 ++#define reg_debug29_pds_pos 0 ++#define reg_debug29_pds_len 3 ++#define reg_debug29_pds_lsb 0 ++#define xd_p_reg_debug28_pds (*(volatile byte xdata *) 0xD852) ++#define p_reg_debug28_pds 0xD852 ++#define reg_debug28_pds_pos 0 ++#define reg_debug28_pds_len 3 ++#define reg_debug28_pds_lsb 0 ++#define xd_p_reg_debug27_pds (*(volatile byte xdata *) 0xD853) ++#define p_reg_debug27_pds 0xD853 ++#define reg_debug27_pds_pos 0 ++#define reg_debug27_pds_len 3 ++#define reg_debug27_pds_lsb 0 ++#define xd_p_reg_debug26_pds (*(volatile byte xdata *) 0xD854) ++#define p_reg_debug26_pds 0xD854 ++#define reg_debug26_pds_pos 0 ++#define reg_debug26_pds_len 3 ++#define reg_debug26_pds_lsb 0 ++#define xd_p_reg_debug25_pds (*(volatile byte xdata *) 0xD855) ++#define p_reg_debug25_pds 0xD855 ++#define reg_debug25_pds_pos 0 ++#define reg_debug25_pds_len 3 ++#define reg_debug25_pds_lsb 0 ++#define xd_p_reg_debug24_pds (*(volatile byte xdata *) 0xD856) ++#define p_reg_debug24_pds 0xD856 ++#define reg_debug24_pds_pos 0 ++#define reg_debug24_pds_len 3 ++#define reg_debug24_pds_lsb 0 ++#define xd_p_reg_debug23_pds (*(volatile byte xdata *) 0xD857) ++#define p_reg_debug23_pds 0xD857 ++#define reg_debug23_pds_pos 0 ++#define reg_debug23_pds_len 3 ++#define reg_debug23_pds_lsb 0 ++#define xd_p_reg_debug22_pds (*(volatile byte xdata *) 0xD858) ++#define p_reg_debug22_pds 0xD858 ++#define reg_debug22_pds_pos 0 ++#define reg_debug22_pds_len 3 ++#define reg_debug22_pds_lsb 0 ++#define xd_p_reg_gpioh1_pds (*(volatile byte xdata *) 0xD859) ++#define p_reg_gpioh1_pds 0xD859 ++#define reg_gpioh1_pds_pos 0 ++#define reg_gpioh1_pds_len 3 ++#define reg_gpioh1_pds_lsb 0 ++#define xd_p_reg_gpioh2_pds (*(volatile byte xdata *) 0xD85A) ++#define p_reg_gpioh2_pds 0xD85A ++#define reg_gpioh2_pds_pos 0 ++#define reg_gpioh2_pds_len 3 ++#define reg_gpioh2_pds_lsb 0 ++#define xd_p_reg_gpioh3_pds (*(volatile byte xdata *) 0xD85B) ++#define p_reg_gpioh3_pds 0xD85B ++#define reg_gpioh3_pds_pos 0 ++#define reg_gpioh3_pds_len 3 ++#define reg_gpioh3_pds_lsb 0 ++#define xd_p_reg_gpioh4_pds (*(volatile byte xdata *) 0xD85C) ++#define p_reg_gpioh4_pds 0xD85C ++#define reg_gpioh4_pds_pos 0 ++#define reg_gpioh4_pds_len 3 ++#define reg_gpioh4_pds_lsb 0 ++#define xd_p_reg_iosda_pds (*(volatile byte xdata *) 0xD85D) ++#define p_reg_iosda_pds 0xD85D ++#define reg_iosda_pds_pos 0 ++#define reg_iosda_pds_len 3 ++#define reg_iosda_pds_lsb 0 ++#define xd_p_reg_ioscl_pds (*(volatile byte xdata *) 0xD85E) ++#define p_reg_ioscl_pds 0xD85E ++#define reg_ioscl_pds_pos 0 ++#define reg_ioscl_pds_len 3 ++#define reg_ioscl_pds_lsb 0 ++#define xd_p_reg_gpioh5_pds (*(volatile byte xdata *) 0xD85F) ++#define p_reg_gpioh5_pds 0xD85F ++#define reg_gpioh5_pds_pos 0 ++#define reg_gpioh5_pds_len 3 ++#define reg_gpioh5_pds_lsb 0 ++#define xd_p_reg_bond0_pds (*(volatile byte xdata *) 0xD860) ++#define p_reg_bond0_pds 0xD860 ++#define reg_bond0_pds_pos 0 ++#define reg_bond0_pds_len 3 ++#define reg_bond0_pds_lsb 0 ++#define xd_p_reg_i2caddr6_pds (*(volatile byte xdata *) 0xD861) ++#define p_reg_i2caddr6_pds 0xD861 ++#define reg_i2caddr6_pds_pos 0 ++#define reg_i2caddr6_pds_len 3 ++#define reg_i2caddr6_pds_lsb 0 ++#define xd_p_reg_i2caddr5_pds (*(volatile byte xdata *) 0xD862) ++#define p_reg_i2caddr5_pds 0xD862 ++#define reg_i2caddr5_pds_pos 0 ++#define reg_i2caddr5_pds_len 3 ++#define reg_i2caddr5_pds_lsb 0 ++#define xd_p_reg_i2caddr4_pds (*(volatile byte xdata *) 0xD863) ++#define p_reg_i2caddr4_pds 0xD863 ++#define reg_i2caddr4_pds_pos 0 ++#define reg_i2caddr4_pds_len 3 ++#define reg_i2caddr4_pds_lsb 0 ++#define xd_p_reg_host_a0_pds (*(volatile byte xdata *) 0xD864) ++#define p_reg_host_a0_pds 0xD864 ++#define reg_host_a0_pds_pos 0 ++#define reg_host_a0_pds_len 3 ++#define reg_host_a0_pds_lsb 0 ++#define xd_p_reg_host_a1_pds (*(volatile byte xdata *) 0xD865) ++#define p_reg_host_a1_pds 0xD865 ++#define reg_host_a1_pds_pos 0 ++#define reg_host_a1_pds_len 3 ++#define reg_host_a1_pds_lsb 0 ++#define xd_p_reg_debug21_pds (*(volatile byte xdata *) 0xD866) ++#define p_reg_debug21_pds 0xD866 ++#define reg_debug21_pds_pos 0 ++#define reg_debug21_pds_len 3 ++#define reg_debug21_pds_lsb 0 ++#define xd_p_reg_debug20_pds (*(volatile byte xdata *) 0xD867) ++#define p_reg_debug20_pds 0xD867 ++#define reg_debug20_pds_pos 0 ++#define reg_debug20_pds_len 3 ++#define reg_debug20_pds_lsb 0 ++#define xd_p_reg_debug19_pds (*(volatile byte xdata *) 0xD868) ++#define p_reg_debug19_pds 0xD868 ++#define reg_debug19_pds_pos 0 ++#define reg_debug19_pds_len 3 ++#define reg_debug19_pds_lsb 0 ++#define xd_p_reg_debug18_pds (*(volatile byte xdata *) 0xD869) ++#define p_reg_debug18_pds 0xD869 ++#define reg_debug18_pds_pos 0 ++#define reg_debug18_pds_len 3 ++#define reg_debug18_pds_lsb 0 ++#define xd_p_reg_debug17_pds (*(volatile byte xdata *) 0xD86A) ++#define p_reg_debug17_pds 0xD86A ++#define reg_debug17_pds_pos 0 ++#define reg_debug17_pds_len 3 ++#define reg_debug17_pds_lsb 0 ++#define xd_p_reg_host_a2_pds (*(volatile byte xdata *) 0xD86B) ++#define p_reg_host_a2_pds 0xD86B ++#define reg_host_a2_pds_pos 0 ++#define reg_host_a2_pds_len 3 ++#define reg_host_a2_pds_lsb 0 ++#define xd_p_reg_host_a3_pds (*(volatile byte xdata *) 0xD86C) ++#define p_reg_host_a3_pds 0xD86C ++#define reg_host_a3_pds_pos 0 ++#define reg_host_a3_pds_len 3 ++#define reg_host_a3_pds_lsb 0 ++#define xd_p_reg_host_a4_pds (*(volatile byte xdata *) 0xD86D) ++#define p_reg_host_a4_pds 0xD86D ++#define reg_host_a4_pds_pos 0 ++#define reg_host_a4_pds_len 3 ++#define reg_host_a4_pds_lsb 0 ++#define xd_p_reg_host_a5_pds (*(volatile byte xdata *) 0xD86E) ++#define p_reg_host_a5_pds 0xD86E ++#define reg_host_a5_pds_pos 0 ++#define reg_host_a5_pds_len 3 ++#define reg_host_a5_pds_lsb 0 ++#define xd_p_reg_host_a6_pds (*(volatile byte xdata *) 0xD86F) ++#define p_reg_host_a6_pds 0xD86F ++#define reg_host_a6_pds_pos 0 ++#define reg_host_a6_pds_len 3 ++#define reg_host_a6_pds_lsb 0 ++#define xd_p_reg_p160sel_pds (*(volatile byte xdata *) 0xD870) ++#define p_reg_p160sel_pds 0xD870 ++#define reg_p160sel_pds_pos 0 ++#define reg_p160sel_pds_len 3 ++#define reg_p160sel_pds_lsb 0 ++#define xd_p_reg_gpioh13_pds (*(volatile byte xdata *) 0xD871) ++#define p_reg_gpioh13_pds 0xD871 ++#define reg_gpioh13_pds_pos 0 ++#define reg_gpioh13_pds_len 3 ++#define reg_gpioh13_pds_lsb 0 ++#define xd_p_reg_gpioh12_pds (*(volatile byte xdata *) 0xD872) ++#define p_reg_gpioh12_pds 0xD872 ++#define reg_gpioh12_pds_pos 0 ++#define reg_gpioh12_pds_len 3 ++#define reg_gpioh12_pds_lsb 0 ++#define xd_p_reg_gpioh11_pds (*(volatile byte xdata *) 0xD873) ++#define p_reg_gpioh11_pds 0xD873 ++#define reg_gpioh11_pds_pos 0 ++#define reg_gpioh11_pds_len 3 ++#define reg_gpioh11_pds_lsb 0 ++#define xd_p_reg_host_a7_pds (*(volatile byte xdata *) 0xD874) ++#define p_reg_host_a7_pds 0xD874 ++#define reg_host_a7_pds_pos 0 ++#define reg_host_a7_pds_len 3 ++#define reg_host_a7_pds_lsb 0 ++#define xd_p_reg_host_a8_pds (*(volatile byte xdata *) 0xD875) ++#define p_reg_host_a8_pds 0xD875 ++#define reg_host_a8_pds_pos 0 ++#define reg_host_a8_pds_len 3 ++#define reg_host_a8_pds_lsb 0 ++#define xd_p_reg_host_a9_pds (*(volatile byte xdata *) 0xD876) ++#define p_reg_host_a9_pds 0xD876 ++#define reg_host_a9_pds_pos 0 ++#define reg_host_a9_pds_len 3 ++#define reg_host_a9_pds_lsb 0 ++#define xd_p_reg_host_a10_pds (*(volatile byte xdata *) 0xD877) ++#define p_reg_host_a10_pds 0xD877 ++#define reg_host_a10_pds_pos 0 ++#define reg_host_a10_pds_len 3 ++#define reg_host_a10_pds_lsb 0 ++#define xd_p_reg_host_a11_pds (*(volatile byte xdata *) 0xD878) ++#define p_reg_host_a11_pds 0xD878 ++#define reg_host_a11_pds_pos 0 ++#define reg_host_a11_pds_len 3 ++#define reg_host_a11_pds_lsb 0 ++#define xd_p_reg_bondu0_pds (*(volatile byte xdata *) 0xD879) ++#define p_reg_bondu0_pds 0xD879 ++#define reg_bondu0_pds_pos 0 ++#define reg_bondu0_pds_len 3 ++#define reg_bondu0_pds_lsb 0 ++#define xd_p_reg_host_b0_pds (*(volatile byte xdata *) 0xD87A) ++#define p_reg_host_b0_pds 0xD87A ++#define reg_host_b0_pds_pos 0 ++#define reg_host_b0_pds_len 3 ++#define reg_host_b0_pds_lsb 0 ++#define xd_p_reg_host_b1_pds (*(volatile byte xdata *) 0xD87B) ++#define p_reg_host_b1_pds 0xD87B ++#define reg_host_b1_pds_pos 0 ++#define reg_host_b1_pds_len 3 ++#define reg_host_b1_pds_lsb 0 ++#define xd_p_reg_host_b2_pds (*(volatile byte xdata *) 0xD87C) ++#define p_reg_host_b2_pds 0xD87C ++#define reg_host_b2_pds_pos 0 ++#define reg_host_b2_pds_len 3 ++#define reg_host_b2_pds_lsb 0 ++#define xd_p_reg_host_b3_pds (*(volatile byte xdata *) 0xD87D) ++#define p_reg_host_b3_pds 0xD87D ++#define reg_host_b3_pds_pos 0 ++#define reg_host_b3_pds_len 3 ++#define reg_host_b3_pds_lsb 0 ++#define xd_p_reg_host_b4_pds (*(volatile byte xdata *) 0xD87E) ++#define p_reg_host_b4_pds 0xD87E ++#define reg_host_b4_pds_pos 0 ++#define reg_host_b4_pds_len 3 ++#define reg_host_b4_pds_lsb 0 ++#define xd_p_reg_host_b5_pds (*(volatile byte xdata *) 0xD87F) ++#define p_reg_host_b5_pds 0xD87F ++#define reg_host_b5_pds_pos 0 ++#define reg_host_b5_pds_len 3 ++#define reg_host_b5_pds_lsb 0 ++#define xd_p_reg_host_b6_pds (*(volatile byte xdata *) 0xD880) ++#define p_reg_host_b6_pds 0xD880 ++#define reg_host_b6_pds_pos 0 ++#define reg_host_b6_pds_len 3 ++#define reg_host_b6_pds_lsb 0 ++#define xd_p_reg_host_b7_pds (*(volatile byte xdata *) 0xD881) ++#define p_reg_host_b7_pds 0xD881 ++#define reg_host_b7_pds_pos 0 ++#define reg_host_b7_pds_len 3 ++#define reg_host_b7_pds_lsb 0 ++#define xd_p_reg_afe_f12_pds (*(volatile byte xdata *) 0xD882) ++#define p_reg_afe_f12_pds 0xD882 ++#define reg_afe_f12_pds_pos 0 ++#define reg_afe_f12_pds_len 3 ++#define reg_afe_f12_pds_lsb 0 ++#define xd_p_reg_host_b8_pds (*(volatile byte xdata *) 0xD883) ++#define p_reg_host_b8_pds 0xD883 ++#define reg_host_b8_pds_pos 0 ++#define reg_host_b8_pds_len 3 ++#define reg_host_b8_pds_lsb 0 ++#define xd_p_reg_host_b9_pds (*(volatile byte xdata *) 0xD884) ++#define p_reg_host_b9_pds 0xD884 ++#define reg_host_b9_pds_pos 0 ++#define reg_host_b9_pds_len 3 ++#define reg_host_b9_pds_lsb 0 ++#define xd_p_reg_host_b10_pds (*(volatile byte xdata *) 0xD885) ++#define p_reg_host_b10_pds 0xD885 ++#define reg_host_b10_pds_pos 0 ++#define reg_host_b10_pds_len 3 ++#define reg_host_b10_pds_lsb 0 ++#define xd_p_reg_host_b11_pds (*(volatile byte xdata *) 0xD886) ++#define p_reg_host_b11_pds 0xD886 ++#define reg_host_b11_pds_pos 0 ++#define reg_host_b11_pds_len 3 ++#define reg_host_b11_pds_lsb 0 ++#define xd_p_reg_debug16_pds (*(volatile byte xdata *) 0xD887) ++#define p_reg_debug16_pds 0xD887 ++#define reg_debug16_pds_pos 0 ++#define reg_debug16_pds_len 3 ++#define reg_debug16_pds_lsb 0 ++#define xd_p_reg_debug15_pds (*(volatile byte xdata *) 0xD888) ++#define p_reg_debug15_pds 0xD888 ++#define reg_debug15_pds_pos 0 ++#define reg_debug15_pds_len 3 ++#define reg_debug15_pds_lsb 0 ++#define xd_p_reg_debug14_pds (*(volatile byte xdata *) 0xD889) ++#define p_reg_debug14_pds 0xD889 ++#define reg_debug14_pds_pos 0 ++#define reg_debug14_pds_len 3 ++#define reg_debug14_pds_lsb 0 ++#define xd_p_reg_debug13_pds (*(volatile byte xdata *) 0xD88A) ++#define p_reg_debug13_pds 0xD88A ++#define reg_debug13_pds_pos 0 ++#define reg_debug13_pds_len 3 ++#define reg_debug13_pds_lsb 0 ++#define xd_p_reg_debug12_pds (*(volatile byte xdata *) 0xD88B) ++#define p_reg_debug12_pds 0xD88B ++#define reg_debug12_pds_pos 0 ++#define reg_debug12_pds_len 3 ++#define reg_debug12_pds_lsb 0 ++#define xd_p_reg_debug11_pds (*(volatile byte xdata *) 0xD88C) ++#define p_reg_debug11_pds 0xD88C ++#define reg_debug11_pds_pos 0 ++#define reg_debug11_pds_len 3 ++#define reg_debug11_pds_lsb 0 ++#define xd_p_reg_debug10_pds (*(volatile byte xdata *) 0xD88D) ++#define p_reg_debug10_pds 0xD88D ++#define reg_debug10_pds_pos 0 ++#define reg_debug10_pds_len 3 ++#define reg_debug10_pds_lsb 0 ++#define xd_p_reg_debug9_pds (*(volatile byte xdata *) 0xD88E) ++#define p_reg_debug9_pds 0xD88E ++#define reg_debug9_pds_pos 0 ++#define reg_debug9_pds_len 3 ++#define reg_debug9_pds_lsb 0 ++#define xd_p_reg_debug8_pds (*(volatile byte xdata *) 0xD88F) ++#define p_reg_debug8_pds 0xD88F ++#define reg_debug8_pds_pos 0 ++#define reg_debug8_pds_len 3 ++#define reg_debug8_pds_lsb 0 ++#define xd_p_reg_debug7_pds (*(volatile byte xdata *) 0xD890) ++#define p_reg_debug7_pds 0xD890 ++#define reg_debug7_pds_pos 0 ++#define reg_debug7_pds_len 3 ++#define reg_debug7_pds_lsb 0 ++#define xd_p_reg_debug6_pds (*(volatile byte xdata *) 0xD891) ++#define p_reg_debug6_pds 0xD891 ++#define reg_debug6_pds_pos 0 ++#define reg_debug6_pds_len 3 ++#define reg_debug6_pds_lsb 0 ++#define xd_p_reg_debug5_pds (*(volatile byte xdata *) 0xD892) ++#define p_reg_debug5_pds 0xD892 ++#define reg_debug5_pds_pos 0 ++#define reg_debug5_pds_len 3 ++#define reg_debug5_pds_lsb 0 ++#define xd_p_reg_debug4_pds (*(volatile byte xdata *) 0xD893) ++#define p_reg_debug4_pds 0xD893 ++#define reg_debug4_pds_pos 0 ++#define reg_debug4_pds_len 3 ++#define reg_debug4_pds_lsb 0 ++#define xd_p_reg_clko_pds (*(volatile byte xdata *) 0xD894) ++#define p_reg_clko_pds 0xD894 ++#define reg_clko_pds_pos 0 ++#define reg_clko_pds_len 3 ++#define reg_clko_pds_lsb 0 ++#define xd_p_reg_gpioh6_pds (*(volatile byte xdata *) 0xD895) ++#define p_reg_gpioh6_pds 0xD895 ++#define reg_gpioh6_pds_pos 0 ++#define reg_gpioh6_pds_len 3 ++#define reg_gpioh6_pds_lsb 0 ++#define xd_p_reg_gpioh7_pds (*(volatile byte xdata *) 0xD896) ++#define p_reg_gpioh7_pds 0xD896 ++#define reg_gpioh7_pds_pos 0 ++#define reg_gpioh7_pds_len 3 ++#define reg_gpioh7_pds_lsb 0 ++#define xd_p_reg_gpioh8_pds (*(volatile byte xdata *) 0xD897) ++#define p_reg_gpioh8_pds 0xD897 ++#define reg_gpioh8_pds_pos 0 ++#define reg_gpioh8_pds_len 3 ++#define reg_gpioh8_pds_lsb 0 ++#define xd_p_reg_gpioh9_pds (*(volatile byte xdata *) 0xD898) ++#define p_reg_gpioh9_pds 0xD898 ++#define reg_gpioh9_pds_pos 0 ++#define reg_gpioh9_pds_len 3 ++#define reg_gpioh9_pds_lsb 0 ++#define xd_p_reg_gpioh10_pds (*(volatile byte xdata *) 0xD899) ++#define p_reg_gpioh10_pds 0xD899 ++#define reg_gpioh10_pds_pos 0 ++#define reg_gpioh10_pds_len 3 ++#define reg_gpioh10_pds_lsb 0 ++#define xd_p_reg_debug3_pds (*(volatile byte xdata *) 0xD89A) ++#define p_reg_debug3_pds 0xD89A ++#define reg_debug3_pds_pos 0 ++#define reg_debug3_pds_len 3 ++#define reg_debug3_pds_lsb 0 ++#define xd_p_reg_debug2_pds (*(volatile byte xdata *) 0xD89B) ++#define p_reg_debug2_pds 0xD89B ++#define reg_debug2_pds_pos 0 ++#define reg_debug2_pds_len 3 ++#define reg_debug2_pds_lsb 0 ++#define xd_p_reg_debug1_pds (*(volatile byte xdata *) 0xD89C) ++#define p_reg_debug1_pds 0xD89C ++#define reg_debug1_pds_pos 0 ++#define reg_debug1_pds_len 3 ++#define reg_debug1_pds_lsb 0 ++#define xd_p_reg_debug0_pds (*(volatile byte xdata *) 0xD89D) ++#define p_reg_debug0_pds 0xD89D ++#define reg_debug0_pds_pos 0 ++#define reg_debug0_pds_len 3 ++#define reg_debug0_pds_lsb 0 ++#define xd_p_reg_gpiot1_pds (*(volatile byte xdata *) 0xD89E) ++#define p_reg_gpiot1_pds 0xD89E ++#define reg_gpiot1_pds_pos 0 ++#define reg_gpiot1_pds_len 3 ++#define reg_gpiot1_pds_lsb 0 ++#define xd_p_reg_gpiot2_pds (*(volatile byte xdata *) 0xD89F) ++#define p_reg_gpiot2_pds 0xD89F ++#define reg_gpiot2_pds_pos 0 ++#define reg_gpiot2_pds_len 3 ++#define reg_gpiot2_pds_lsb 0 ++#define xd_p_reg_rfagc_pds (*(volatile byte xdata *) 0xD8A0) ++#define p_reg_rfagc_pds 0xD8A0 ++#define reg_rfagc_pds_pos 0 ++#define reg_rfagc_pds_len 3 ++#define reg_rfagc_pds_lsb 0 ++#define xd_p_reg_ifagc_pds (*(volatile byte xdata *) 0xD8A1) ++#define p_reg_ifagc_pds 0xD8A1 ++#define reg_ifagc_pds_pos 0 ++#define reg_ifagc_pds_len 3 ++#define reg_ifagc_pds_lsb 0 ++#define xd_p_reg_gpiot3_pds (*(volatile byte xdata *) 0xD8A2) ++#define p_reg_gpiot3_pds 0xD8A2 ++#define reg_gpiot3_pds_pos 0 ++#define reg_gpiot3_pds_len 3 ++#define reg_gpiot3_pds_lsb 0 ++#define xd_p_reg_i2caddr3_pds (*(volatile byte xdata *) 0xD8A3) ++#define p_reg_i2caddr3_pds 0xD8A3 ++#define reg_i2caddr3_pds_pos 0 ++#define reg_i2caddr3_pds_len 3 ++#define reg_i2caddr3_pds_lsb 0 ++#define xd_p_reg_i2caddr2_pds (*(volatile byte xdata *) 0xD8A4) ++#define p_reg_i2caddr2_pds 0xD8A4 ++#define reg_i2caddr2_pds_pos 0 ++#define reg_i2caddr2_pds_len 3 ++#define reg_i2caddr2_pds_lsb 0 ++#define xd_p_reg_i2caddr1_pds (*(volatile byte xdata *) 0xD8A5) ++#define p_reg_i2caddr1_pds 0xD8A5 ++#define reg_i2caddr1_pds_pos 0 ++#define reg_i2caddr1_pds_len 3 ++#define reg_i2caddr1_pds_lsb 0 ++#define xd_p_reg_afe_sel33_pds (*(volatile byte xdata *) 0xD8A6) ++#define p_reg_afe_sel33_pds 0xD8A6 ++#define reg_afe_sel33_pds_pos 0 ++#define reg_afe_sel33_pds_len 3 ++#define reg_afe_sel33_pds_lsb 0 ++#define xd_p_reg_iotunscl_pds (*(volatile byte xdata *) 0xD8A7) ++#define p_reg_iotunscl_pds 0xD8A7 ++#define reg_iotunscl_pds_pos 0 ++#define reg_iotunscl_pds_len 3 ++#define reg_iotunscl_pds_lsb 0 ++#define xd_p_reg_iotunsda_pds (*(volatile byte xdata *) 0xD8A8) ++#define p_reg_iotunsda_pds 0xD8A8 ++#define reg_iotunsda_pds_pos 0 ++#define reg_iotunsda_pds_len 3 ++#define reg_iotunsda_pds_lsb 0 ++#define xd_p_reg_rxdofsm_pds (*(volatile byte xdata *) 0xD8A9) ++#define p_reg_rxdofsm_pds 0xD8A9 ++#define reg_rxdofsm_pds_pos 0 ++#define reg_rxdofsm_pds_len 3 ++#define reg_rxdofsm_pds_lsb 0 ++#define xd_p_reg_txdofsm_pds (*(volatile byte xdata *) 0xD8AA) ++#define p_reg_txdofsm_pds 0xD8AA ++#define reg_txdofsm_pds_pos 0 ++#define reg_txdofsm_pds_len 3 ++#define reg_txdofsm_pds_lsb 0 ++#define xd_p_reg_rxdlink_pds (*(volatile byte xdata *) 0xD8AB) ++#define p_reg_rxdlink_pds 0xD8AB ++#define reg_rxdlink_pds_pos 0 ++#define reg_rxdlink_pds_len 3 ++#define reg_rxdlink_pds_lsb 0 ++#define xd_p_reg_txdlink_pds (*(volatile byte xdata *) 0xD8AC) ++#define p_reg_txdlink_pds 0xD8AC ++#define reg_txdlink_pds_pos 0 ++#define reg_txdlink_pds_len 3 ++#define reg_txdlink_pds_lsb 0 ++#define xd_p_reg_ck_test_pds (*(volatile byte xdata *) 0xD8AD) ++#define p_reg_ck_test_pds 0xD8AD ++#define reg_ck_test_pds_pos 0 ++#define reg_ck_test_pds_len 3 ++#define reg_ck_test_pds_lsb 0 ++#define xd_r_reg_top_gpioh1_i (*(volatile byte xdata *) 0xD8AE) ++#define r_reg_top_gpioh1_i 0xD8AE ++#define reg_top_gpioh1_i_pos 0 ++#define reg_top_gpioh1_i_len 1 ++#define reg_top_gpioh1_i_lsb 0 ++#define xd_p_reg_top_gpioh1_o (*(volatile byte xdata *) 0xD8AF) ++#define p_reg_top_gpioh1_o 0xD8AF ++#define reg_top_gpioh1_o_pos 0 ++#define reg_top_gpioh1_o_len 1 ++#define reg_top_gpioh1_o_lsb 0 ++#define xd_p_reg_top_gpioh1_en (*(volatile byte xdata *) 0xD8B0) ++#define p_reg_top_gpioh1_en 0xD8B0 ++#define reg_top_gpioh1_en_pos 0 ++#define reg_top_gpioh1_en_len 1 ++#define reg_top_gpioh1_en_lsb 0 ++#define xd_p_reg_top_gpioh1_on (*(volatile byte xdata *) 0xD8B1) ++#define p_reg_top_gpioh1_on 0xD8B1 ++#define reg_top_gpioh1_on_pos 0 ++#define reg_top_gpioh1_on_len 1 ++#define reg_top_gpioh1_on_lsb 0 ++#define xd_r_reg_top_gpioh3_i (*(volatile byte xdata *) 0xD8B2) ++#define r_reg_top_gpioh3_i 0xD8B2 ++#define reg_top_gpioh3_i_pos 0 ++#define reg_top_gpioh3_i_len 1 ++#define reg_top_gpioh3_i_lsb 0 ++#define xd_p_reg_top_gpioh3_o (*(volatile byte xdata *) 0xD8B3) ++#define p_reg_top_gpioh3_o 0xD8B3 ++#define reg_top_gpioh3_o_pos 0 ++#define reg_top_gpioh3_o_len 1 ++#define reg_top_gpioh3_o_lsb 0 ++#define xd_p_reg_top_gpioh3_en (*(volatile byte xdata *) 0xD8B4) ++#define p_reg_top_gpioh3_en 0xD8B4 ++#define reg_top_gpioh3_en_pos 0 ++#define reg_top_gpioh3_en_len 1 ++#define reg_top_gpioh3_en_lsb 0 ++#define xd_p_reg_top_gpioh3_on (*(volatile byte xdata *) 0xD8B5) ++#define p_reg_top_gpioh3_on 0xD8B5 ++#define reg_top_gpioh3_on_pos 0 ++#define reg_top_gpioh3_on_len 1 ++#define reg_top_gpioh3_on_lsb 0 ++#define xd_r_reg_top_gpioh2_i (*(volatile byte xdata *) 0xD8B6) ++#define r_reg_top_gpioh2_i 0xD8B6 ++#define reg_top_gpioh2_i_pos 0 ++#define reg_top_gpioh2_i_len 1 ++#define reg_top_gpioh2_i_lsb 0 ++#define xd_p_reg_top_gpioh2_o (*(volatile byte xdata *) 0xD8B7) ++#define p_reg_top_gpioh2_o 0xD8B7 ++#define reg_top_gpioh2_o_pos 0 ++#define reg_top_gpioh2_o_len 1 ++#define reg_top_gpioh2_o_lsb 0 ++#define xd_p_reg_top_gpioh2_en (*(volatile byte xdata *) 0xD8B8) ++#define p_reg_top_gpioh2_en 0xD8B8 ++#define reg_top_gpioh2_en_pos 0 ++#define reg_top_gpioh2_en_len 1 ++#define reg_top_gpioh2_en_lsb 0 ++#define xd_p_reg_top_gpioh2_on (*(volatile byte xdata *) 0xD8B9) ++#define p_reg_top_gpioh2_on 0xD8B9 ++#define reg_top_gpioh2_on_pos 0 ++#define reg_top_gpioh2_on_len 1 ++#define reg_top_gpioh2_on_lsb 0 ++#define xd_r_reg_top_gpioh5_i (*(volatile byte xdata *) 0xD8BA) ++#define r_reg_top_gpioh5_i 0xD8BA ++#define reg_top_gpioh5_i_pos 0 ++#define reg_top_gpioh5_i_len 1 ++#define reg_top_gpioh5_i_lsb 0 ++#define xd_p_reg_top_gpioh5_o (*(volatile byte xdata *) 0xD8BB) ++#define p_reg_top_gpioh5_o 0xD8BB ++#define reg_top_gpioh5_o_pos 0 ++#define reg_top_gpioh5_o_len 1 ++#define reg_top_gpioh5_o_lsb 0 ++#define xd_p_reg_top_gpioh5_en (*(volatile byte xdata *) 0xD8BC) ++#define p_reg_top_gpioh5_en 0xD8BC ++#define reg_top_gpioh5_en_pos 0 ++#define reg_top_gpioh5_en_len 1 ++#define reg_top_gpioh5_en_lsb 0 ++#define xd_p_reg_top_gpioh5_on (*(volatile byte xdata *) 0xD8BD) ++#define p_reg_top_gpioh5_on 0xD8BD ++#define reg_top_gpioh5_on_pos 0 ++#define reg_top_gpioh5_on_len 1 ++#define reg_top_gpioh5_on_lsb 0 ++#define xd_r_reg_top_gpioh4_i (*(volatile byte xdata *) 0xD8BE) ++#define r_reg_top_gpioh4_i 0xD8BE ++#define reg_top_gpioh4_i_pos 0 ++#define reg_top_gpioh4_i_len 1 ++#define reg_top_gpioh4_i_lsb 0 ++#define xd_p_reg_top_gpioh4_o (*(volatile byte xdata *) 0xD8BF) ++#define p_reg_top_gpioh4_o 0xD8BF ++#define reg_top_gpioh4_o_pos 0 ++#define reg_top_gpioh4_o_len 1 ++#define reg_top_gpioh4_o_lsb 0 ++#define xd_p_reg_top_gpioh4_en (*(volatile byte xdata *) 0xD8C0) ++#define p_reg_top_gpioh4_en 0xD8C0 ++#define reg_top_gpioh4_en_pos 0 ++#define reg_top_gpioh4_en_len 1 ++#define reg_top_gpioh4_en_lsb 0 ++#define xd_p_reg_top_gpioh4_on (*(volatile byte xdata *) 0xD8C1) ++#define p_reg_top_gpioh4_on 0xD8C1 ++#define reg_top_gpioh4_on_pos 0 ++#define reg_top_gpioh4_on_len 1 ++#define reg_top_gpioh4_on_lsb 0 ++#define xd_r_reg_top_gpioh7_i (*(volatile byte xdata *) 0xD8C2) ++#define r_reg_top_gpioh7_i 0xD8C2 ++#define reg_top_gpioh7_i_pos 0 ++#define reg_top_gpioh7_i_len 1 ++#define reg_top_gpioh7_i_lsb 0 ++#define xd_p_reg_top_gpioh7_o (*(volatile byte xdata *) 0xD8C3) ++#define p_reg_top_gpioh7_o 0xD8C3 ++#define reg_top_gpioh7_o_pos 0 ++#define reg_top_gpioh7_o_len 1 ++#define reg_top_gpioh7_o_lsb 0 ++#define xd_p_reg_top_gpioh7_en (*(volatile byte xdata *) 0xD8C4) ++#define p_reg_top_gpioh7_en 0xD8C4 ++#define reg_top_gpioh7_en_pos 0 ++#define reg_top_gpioh7_en_len 1 ++#define reg_top_gpioh7_en_lsb 0 ++#define xd_p_reg_top_gpioh7_on (*(volatile byte xdata *) 0xD8C5) ++#define p_reg_top_gpioh7_on 0xD8C5 ++#define reg_top_gpioh7_on_pos 0 ++#define reg_top_gpioh7_on_len 1 ++#define reg_top_gpioh7_on_lsb 0 ++#define xd_r_reg_top_gpioh6_i (*(volatile byte xdata *) 0xD8C6) ++#define r_reg_top_gpioh6_i 0xD8C6 ++#define reg_top_gpioh6_i_pos 0 ++#define reg_top_gpioh6_i_len 1 ++#define reg_top_gpioh6_i_lsb 0 ++#define xd_p_reg_top_gpioh6_o (*(volatile byte xdata *) 0xD8C7) ++#define p_reg_top_gpioh6_o 0xD8C7 ++#define reg_top_gpioh6_o_pos 0 ++#define reg_top_gpioh6_o_len 1 ++#define reg_top_gpioh6_o_lsb 0 ++#define xd_p_reg_top_gpioh6_en (*(volatile byte xdata *) 0xD8C8) ++#define p_reg_top_gpioh6_en 0xD8C8 ++#define reg_top_gpioh6_en_pos 0 ++#define reg_top_gpioh6_en_len 1 ++#define reg_top_gpioh6_en_lsb 0 ++#define xd_p_reg_top_gpioh6_on (*(volatile byte xdata *) 0xD8C9) ++#define p_reg_top_gpioh6_on 0xD8C9 ++#define reg_top_gpioh6_on_pos 0 ++#define reg_top_gpioh6_on_len 1 ++#define reg_top_gpioh6_on_lsb 0 ++#define xd_r_reg_top_gpioh9_i (*(volatile byte xdata *) 0xD8CA) ++#define r_reg_top_gpioh9_i 0xD8CA ++#define reg_top_gpioh9_i_pos 0 ++#define reg_top_gpioh9_i_len 1 ++#define reg_top_gpioh9_i_lsb 0 ++#define xd_p_reg_top_gpioh9_o (*(volatile byte xdata *) 0xD8CB) ++#define p_reg_top_gpioh9_o 0xD8CB ++#define reg_top_gpioh9_o_pos 0 ++#define reg_top_gpioh9_o_len 1 ++#define reg_top_gpioh9_o_lsb 0 ++#define xd_p_reg_top_gpioh9_en (*(volatile byte xdata *) 0xD8CC) ++#define p_reg_top_gpioh9_en 0xD8CC ++#define reg_top_gpioh9_en_pos 0 ++#define reg_top_gpioh9_en_len 1 ++#define reg_top_gpioh9_en_lsb 0 ++#define xd_p_reg_top_gpioh9_on (*(volatile byte xdata *) 0xD8CD) ++#define p_reg_top_gpioh9_on 0xD8CD ++#define reg_top_gpioh9_on_pos 0 ++#define reg_top_gpioh9_on_len 1 ++#define reg_top_gpioh9_on_lsb 0 ++#define xd_r_reg_top_gpioh8_i (*(volatile byte xdata *) 0xD8CE) ++#define r_reg_top_gpioh8_i 0xD8CE ++#define reg_top_gpioh8_i_pos 0 ++#define reg_top_gpioh8_i_len 1 ++#define reg_top_gpioh8_i_lsb 0 ++#define xd_p_reg_top_gpioh8_o (*(volatile byte xdata *) 0xD8CF) ++#define p_reg_top_gpioh8_o 0xD8CF ++#define reg_top_gpioh8_o_pos 0 ++#define reg_top_gpioh8_o_len 1 ++#define reg_top_gpioh8_o_lsb 0 ++#define xd_p_reg_top_gpioh8_en (*(volatile byte xdata *) 0xD8D0) ++#define p_reg_top_gpioh8_en 0xD8D0 ++#define reg_top_gpioh8_en_pos 0 ++#define reg_top_gpioh8_en_len 1 ++#define reg_top_gpioh8_en_lsb 0 ++#define xd_p_reg_top_gpioh8_on (*(volatile byte xdata *) 0xD8D1) ++#define p_reg_top_gpioh8_on 0xD8D1 ++#define reg_top_gpioh8_on_pos 0 ++#define reg_top_gpioh8_on_len 1 ++#define reg_top_gpioh8_on_lsb 0 ++#define xd_r_reg_top_gpioh11_i (*(volatile byte xdata *) 0xD8D2) ++#define r_reg_top_gpioh11_i 0xD8D2 ++#define reg_top_gpioh11_i_pos 0 ++#define reg_top_gpioh11_i_len 1 ++#define reg_top_gpioh11_i_lsb 0 ++#define xd_p_reg_top_gpioh11_o (*(volatile byte xdata *) 0xD8D3) ++#define p_reg_top_gpioh11_o 0xD8D3 ++#define reg_top_gpioh11_o_pos 0 ++#define reg_top_gpioh11_o_len 1 ++#define reg_top_gpioh11_o_lsb 0 ++#define xd_p_reg_top_gpioh11_en (*(volatile byte xdata *) 0xD8D4) ++#define p_reg_top_gpioh11_en 0xD8D4 ++#define reg_top_gpioh11_en_pos 0 ++#define reg_top_gpioh11_en_len 1 ++#define reg_top_gpioh11_en_lsb 0 ++#define xd_p_reg_top_gpioh11_on (*(volatile byte xdata *) 0xD8D5) ++#define p_reg_top_gpioh11_on 0xD8D5 ++#define reg_top_gpioh11_on_pos 0 ++#define reg_top_gpioh11_on_len 1 ++#define reg_top_gpioh11_on_lsb 0 ++#define xd_r_reg_top_gpioh10_i (*(volatile byte xdata *) 0xD8D6) ++#define r_reg_top_gpioh10_i 0xD8D6 ++#define reg_top_gpioh10_i_pos 0 ++#define reg_top_gpioh10_i_len 1 ++#define reg_top_gpioh10_i_lsb 0 ++#define xd_p_reg_top_gpioh10_o (*(volatile byte xdata *) 0xD8D7) ++#define p_reg_top_gpioh10_o 0xD8D7 ++#define reg_top_gpioh10_o_pos 0 ++#define reg_top_gpioh10_o_len 1 ++#define reg_top_gpioh10_o_lsb 0 ++#define xd_p_reg_top_gpioh10_en (*(volatile byte xdata *) 0xD8D8) ++#define p_reg_top_gpioh10_en 0xD8D8 ++#define reg_top_gpioh10_en_pos 0 ++#define reg_top_gpioh10_en_len 1 ++#define reg_top_gpioh10_en_lsb 0 ++#define xd_p_reg_top_gpioh10_on (*(volatile byte xdata *) 0xD8D9) ++#define p_reg_top_gpioh10_on 0xD8D9 ++#define reg_top_gpioh10_on_pos 0 ++#define reg_top_gpioh10_on_len 1 ++#define reg_top_gpioh10_on_lsb 0 ++#define xd_r_reg_top_gpioh13_i (*(volatile byte xdata *) 0xD8DA) ++#define r_reg_top_gpioh13_i 0xD8DA ++#define reg_top_gpioh13_i_pos 0 ++#define reg_top_gpioh13_i_len 1 ++#define reg_top_gpioh13_i_lsb 0 ++#define xd_p_reg_top_gpioh13_o (*(volatile byte xdata *) 0xD8DB) ++#define p_reg_top_gpioh13_o 0xD8DB ++#define reg_top_gpioh13_o_pos 0 ++#define reg_top_gpioh13_o_len 1 ++#define reg_top_gpioh13_o_lsb 0 ++#define xd_p_reg_top_gpioh13_en (*(volatile byte xdata *) 0xD8DC) ++#define p_reg_top_gpioh13_en 0xD8DC ++#define reg_top_gpioh13_en_pos 0 ++#define reg_top_gpioh13_en_len 1 ++#define reg_top_gpioh13_en_lsb 0 ++#define xd_p_reg_top_gpioh13_on (*(volatile byte xdata *) 0xD8DD) ++#define p_reg_top_gpioh13_on 0xD8DD ++#define reg_top_gpioh13_on_pos 0 ++#define reg_top_gpioh13_on_len 1 ++#define reg_top_gpioh13_on_lsb 0 ++#define xd_r_reg_top_gpioh12_i (*(volatile byte xdata *) 0xD8DE) ++#define r_reg_top_gpioh12_i 0xD8DE ++#define reg_top_gpioh12_i_pos 0 ++#define reg_top_gpioh12_i_len 1 ++#define reg_top_gpioh12_i_lsb 0 ++#define xd_p_reg_top_gpioh12_o (*(volatile byte xdata *) 0xD8DF) ++#define p_reg_top_gpioh12_o 0xD8DF ++#define reg_top_gpioh12_o_pos 0 ++#define reg_top_gpioh12_o_len 1 ++#define reg_top_gpioh12_o_lsb 0 ++#define xd_p_reg_top_gpioh12_en (*(volatile byte xdata *) 0xD8E0) ++#define p_reg_top_gpioh12_en 0xD8E0 ++#define reg_top_gpioh12_en_pos 0 ++#define reg_top_gpioh12_en_len 1 ++#define reg_top_gpioh12_en_lsb 0 ++#define xd_p_reg_top_gpioh12_on (*(volatile byte xdata *) 0xD8E1) ++#define p_reg_top_gpioh12_on 0xD8E1 ++#define reg_top_gpioh12_on_pos 0 ++#define reg_top_gpioh12_on_len 1 ++#define reg_top_gpioh12_on_lsb 0 ++#define xd_r_reg_top_gpiot1_i (*(volatile byte xdata *) 0xD8E2) ++#define r_reg_top_gpiot1_i 0xD8E2 ++#define reg_top_gpiot1_i_pos 0 ++#define reg_top_gpiot1_i_len 1 ++#define reg_top_gpiot1_i_lsb 0 ++#define xd_p_reg_top_gpiot1_o (*(volatile byte xdata *) 0xD8E3) ++#define p_reg_top_gpiot1_o 0xD8E3 ++#define reg_top_gpiot1_o_pos 0 ++#define reg_top_gpiot1_o_len 1 ++#define reg_top_gpiot1_o_lsb 0 ++#define xd_p_reg_top_gpiot1_en (*(volatile byte xdata *) 0xD8E4) ++#define p_reg_top_gpiot1_en 0xD8E4 ++#define reg_top_gpiot1_en_pos 0 ++#define reg_top_gpiot1_en_len 1 ++#define reg_top_gpiot1_en_lsb 0 ++#define xd_p_reg_top_gpiot1_on (*(volatile byte xdata *) 0xD8E5) ++#define p_reg_top_gpiot1_on 0xD8E5 ++#define reg_top_gpiot1_on_pos 0 ++#define reg_top_gpiot1_on_len 1 ++#define reg_top_gpiot1_on_lsb 0 ++#define xd_r_reg_top_gpiot3_i (*(volatile byte xdata *) 0xD8E6) ++#define r_reg_top_gpiot3_i 0xD8E6 ++#define reg_top_gpiot3_i_pos 0 ++#define reg_top_gpiot3_i_len 1 ++#define reg_top_gpiot3_i_lsb 0 ++#define xd_p_reg_top_gpiot3_o (*(volatile byte xdata *) 0xD8E7) ++#define p_reg_top_gpiot3_o 0xD8E7 ++#define reg_top_gpiot3_o_pos 0 ++#define reg_top_gpiot3_o_len 1 ++#define reg_top_gpiot3_o_lsb 0 ++#define xd_p_reg_top_gpiot3_en (*(volatile byte xdata *) 0xD8E8) ++#define p_reg_top_gpiot3_en 0xD8E8 ++#define reg_top_gpiot3_en_pos 0 ++#define reg_top_gpiot3_en_len 1 ++#define reg_top_gpiot3_en_lsb 0 ++#define xd_p_reg_top_gpiot3_on (*(volatile byte xdata *) 0xD8E9) ++#define p_reg_top_gpiot3_on 0xD8E9 ++#define reg_top_gpiot3_on_pos 0 ++#define reg_top_gpiot3_on_len 1 ++#define reg_top_gpiot3_on_lsb 0 ++#define xd_r_reg_top_gpiot2_i (*(volatile byte xdata *) 0xD8EA) ++#define r_reg_top_gpiot2_i 0xD8EA ++#define reg_top_gpiot2_i_pos 0 ++#define reg_top_gpiot2_i_len 1 ++#define reg_top_gpiot2_i_lsb 0 ++#define xd_p_reg_top_gpiot2_o (*(volatile byte xdata *) 0xD8EB) ++#define p_reg_top_gpiot2_o 0xD8EB ++#define reg_top_gpiot2_o_pos 0 ++#define reg_top_gpiot2_o_len 1 ++#define reg_top_gpiot2_o_lsb 0 ++#define xd_p_reg_top_gpiot2_en (*(volatile byte xdata *) 0xD8EC) ++#define p_reg_top_gpiot2_en 0xD8EC ++#define reg_top_gpiot2_en_pos 0 ++#define reg_top_gpiot2_en_len 1 ++#define reg_top_gpiot2_en_lsb 0 ++#define xd_p_reg_top_gpiot2_on (*(volatile byte xdata *) 0xD8ED) ++#define p_reg_top_gpiot2_on 0xD8ED ++#define reg_top_gpiot2_on_pos 0 ++#define reg_top_gpiot2_on_len 1 ++#define reg_top_gpiot2_on_lsb 0 ++#define xd_p_reg_top_lock2_out (*(volatile byte xdata *) 0xD8EE) ++#define p_reg_top_lock2_out 0xD8EE ++#define reg_top_lock2_out_pos 0 ++#define reg_top_lock2_out_len 1 ++#define reg_top_lock2_out_lsb 0 ++#define xd_p_reg_top_lock2_tpsd (*(volatile byte xdata *) 0xD8EF) ++#define p_reg_top_lock2_tpsd 0xD8EF ++#define reg_top_lock2_tpsd_pos 0 ++#define reg_top_lock2_tpsd_len 1 ++#define reg_top_lock2_tpsd_lsb 0 ++#define xd_p_reg_top_lock2_o (*(volatile byte xdata *) 0xD8F0) ++#define p_reg_top_lock2_o 0xD8F0 ++#define reg_top_lock2_o_pos 0 ++#define reg_top_lock2_o_len 1 ++#define reg_top_lock2_o_lsb 0 ++#define xd_p_reg_top_lock2_en (*(volatile byte xdata *) 0xD8F1) ++#define p_reg_top_lock2_en 0xD8F1 ++#define reg_top_lock2_en_pos 0 ++#define reg_top_lock2_en_len 1 ++#define reg_top_lock2_en_lsb 0 ++#define xd_p_reg_top_lock2_on (*(volatile byte xdata *) 0xD8F2) ++#define p_reg_top_lock2_on 0xD8F2 ++#define reg_top_lock2_on_pos 0 ++#define reg_top_lock2_on_len 1 ++#define reg_top_lock2_on_lsb 0 ++#define xd_p_reg_top_lock1_out (*(volatile byte xdata *) 0xD8F3) ++#define p_reg_top_lock1_out 0xD8F3 ++#define reg_top_lock1_out_pos 0 ++#define reg_top_lock1_out_len 1 ++#define reg_top_lock1_out_lsb 0 ++#define xd_p_reg_top_lock1_tpsd (*(volatile byte xdata *) 0xD8F4) ++#define p_reg_top_lock1_tpsd 0xD8F4 ++#define reg_top_lock1_tpsd_pos 0 ++#define reg_top_lock1_tpsd_len 1 ++#define reg_top_lock1_tpsd_lsb 0 ++#define xd_p_reg_top_lock1_o (*(volatile byte xdata *) 0xD8F5) ++#define p_reg_top_lock1_o 0xD8F5 ++#define reg_top_lock1_o_pos 0 ++#define reg_top_lock1_o_len 1 ++#define reg_top_lock1_o_lsb 0 ++#define xd_p_reg_top_lock1_en (*(volatile byte xdata *) 0xD8F6) ++#define p_reg_top_lock1_en 0xD8F6 ++#define reg_top_lock1_en_pos 0 ++#define reg_top_lock1_en_len 1 ++#define reg_top_lock1_en_lsb 0 ++#define xd_p_reg_top_lock1_on (*(volatile byte xdata *) 0xD8F7) ++#define p_reg_top_lock1_on 0xD8F7 ++#define reg_top_lock1_on_pos 0 ++#define reg_top_lock1_on_len 1 ++#define reg_top_lock1_on_lsb 0 ++#define xd_p_reg_top_lock4_out (*(volatile byte xdata *) 0xD8F8) ++#define p_reg_top_lock4_out 0xD8F8 ++#define reg_top_lock4_out_pos 0 ++#define reg_top_lock4_out_len 1 ++#define reg_top_lock4_out_lsb 0 ++#define xd_p_reg_top_lock4_tpsd (*(volatile byte xdata *) 0xD8F9) ++#define p_reg_top_lock4_tpsd 0xD8F9 ++#define reg_top_lock4_tpsd_pos 0 ++#define reg_top_lock4_tpsd_len 1 ++#define reg_top_lock4_tpsd_lsb 0 ++#define xd_p_reg_top_lock4_o (*(volatile byte xdata *) 0xD8FA) ++#define p_reg_top_lock4_o 0xD8FA ++#define reg_top_lock4_o_pos 0 ++#define reg_top_lock4_o_len 1 ++#define reg_top_lock4_o_lsb 0 ++#define xd_p_reg_top_lock4_en (*(volatile byte xdata *) 0xD8FB) ++#define p_reg_top_lock4_en 0xD8FB ++#define reg_top_lock4_en_pos 0 ++#define reg_top_lock4_en_len 1 ++#define reg_top_lock4_en_lsb 0 ++#define xd_p_reg_top_lock4_on (*(volatile byte xdata *) 0xD8FC) ++#define p_reg_top_lock4_on 0xD8FC ++#define reg_top_lock4_on_pos 0 ++#define reg_top_lock4_on_len 1 ++#define reg_top_lock4_on_lsb 0 ++#define xd_p_reg_top_lock3_out (*(volatile byte xdata *) 0xD8FD) ++#define p_reg_top_lock3_out 0xD8FD ++#define reg_top_lock3_out_pos 0 ++#define reg_top_lock3_out_len 1 ++#define reg_top_lock3_out_lsb 0 ++#define xd_p_reg_top_lock3_tpsd (*(volatile byte xdata *) 0xD8FE) ++#define p_reg_top_lock3_tpsd 0xD8FE ++#define reg_top_lock3_tpsd_pos 0 ++#define reg_top_lock3_tpsd_len 1 ++#define reg_top_lock3_tpsd_lsb 0 ++#define xd_p_reg_top_lock3_o (*(volatile byte xdata *) 0xD8FF) ++#define p_reg_top_lock3_o 0xD8FF ++#define reg_top_lock3_o_pos 0 ++#define reg_top_lock3_o_len 1 ++#define reg_top_lock3_o_lsb 0 ++#define xd_p_reg_top_lock3_en (*(volatile byte xdata *) 0xD900) ++#define p_reg_top_lock3_en 0xD900 ++#define reg_top_lock3_en_pos 0 ++#define reg_top_lock3_en_len 1 ++#define reg_top_lock3_en_lsb 0 ++#define xd_p_reg_top_lock3_on (*(volatile byte xdata *) 0xD901) ++#define p_reg_top_lock3_on 0xD901 ++#define reg_top_lock3_on_pos 0 ++#define reg_top_lock3_on_len 1 ++#define reg_top_lock3_on_lsb 0 ++#define xd_p_reg_top_pwm0_en (*(volatile byte xdata *) 0xD902) ++#define p_reg_top_pwm0_en 0xD902 ++#define reg_top_pwm0_en_pos 0 ++#define reg_top_pwm0_en_len 1 ++#define reg_top_pwm0_en_lsb 0 ++#define xd_p_reg_top_pwm1_en (*(volatile byte xdata *) 0xD903) ++#define p_reg_top_pwm1_en 0xD903 ++#define reg_top_pwm1_en_pos 0 ++#define reg_top_pwm1_en_len 1 ++#define reg_top_pwm1_en_lsb 0 ++#define xd_p_reg_top_pwm2_en (*(volatile byte xdata *) 0xD904) ++#define p_reg_top_pwm2_en 0xD904 ++#define reg_top_pwm2_en_pos 0 ++#define reg_top_pwm2_en_len 1 ++#define reg_top_pwm2_en_lsb 0 ++#define xd_p_reg_top_pwm3_en (*(volatile byte xdata *) 0xD905) ++#define p_reg_top_pwm3_en 0xD905 ++#define reg_top_pwm3_en_pos 0 ++#define reg_top_pwm3_en_len 1 ++#define reg_top_pwm3_en_lsb 0 ++#define xd_p_reg_top_pwm0_gpio (*(volatile byte xdata *) 0xD906) ++#define p_reg_top_pwm0_gpio 0xD906 ++#define reg_top_pwm0_gpio_pos 0 ++#define reg_top_pwm0_gpio_len 1 ++#define reg_top_pwm0_gpio_lsb 0 ++#define xd_p_reg_top_pwm0_pos (*(volatile byte xdata *) 0xD907) ++#define p_reg_top_pwm0_pos 0xD907 ++#define reg_top_pwm0_pos_pos 0 ++#define reg_top_pwm0_pos_len 3 ++#define reg_top_pwm0_pos_lsb 0 ++#define xd_p_reg_top_pwm0_width (*(volatile byte xdata *) 0xD908) ++#define p_reg_top_pwm0_width 0xD908 ++#define reg_top_pwm0_width_pos 0 ++#define reg_top_pwm0_width_len 2 ++#define reg_top_pwm0_width_lsb 0 ++#define xd_p_reg_top_pwm0_duration (*(volatile byte xdata *) 0xD909) ++#define p_reg_top_pwm0_duration 0xD909 ++#define reg_top_pwm0_duration_pos 0 ++#define reg_top_pwm0_duration_len 8 ++#define reg_top_pwm0_duration_lsb 0 ++#define xd_p_reg_top_pwm1_gpio (*(volatile byte xdata *) 0xD90A) ++#define p_reg_top_pwm1_gpio 0xD90A ++#define reg_top_pwm1_gpio_pos 0 ++#define reg_top_pwm1_gpio_len 1 ++#define reg_top_pwm1_gpio_lsb 0 ++#define xd_p_reg_top_pwm1_pos (*(volatile byte xdata *) 0xD90B) ++#define p_reg_top_pwm1_pos 0xD90B ++#define reg_top_pwm1_pos_pos 0 ++#define reg_top_pwm1_pos_len 3 ++#define reg_top_pwm1_pos_lsb 0 ++#define xd_p_reg_top_pwm1_width (*(volatile byte xdata *) 0xD90C) ++#define p_reg_top_pwm1_width 0xD90C ++#define reg_top_pwm1_width_pos 0 ++#define reg_top_pwm1_width_len 2 ++#define reg_top_pwm1_width_lsb 0 ++#define xd_p_reg_top_pwm1_duration (*(volatile byte xdata *) 0xD90D) ++#define p_reg_top_pwm1_duration 0xD90D ++#define reg_top_pwm1_duration_pos 0 ++#define reg_top_pwm1_duration_len 8 ++#define reg_top_pwm1_duration_lsb 0 ++#define xd_p_reg_top_pwm2_gpio (*(volatile byte xdata *) 0xD90E) ++#define p_reg_top_pwm2_gpio 0xD90E ++#define reg_top_pwm2_gpio_pos 0 ++#define reg_top_pwm2_gpio_len 1 ++#define reg_top_pwm2_gpio_lsb 0 ++#define xd_p_reg_top_pwm2_pos (*(volatile byte xdata *) 0xD90F) ++#define p_reg_top_pwm2_pos 0xD90F ++#define reg_top_pwm2_pos_pos 0 ++#define reg_top_pwm2_pos_len 3 ++#define reg_top_pwm2_pos_lsb 0 ++#define xd_p_reg_top_pwm2_width (*(volatile byte xdata *) 0xD910) ++#define p_reg_top_pwm2_width 0xD910 ++#define reg_top_pwm2_width_pos 0 ++#define reg_top_pwm2_width_len 2 ++#define reg_top_pwm2_width_lsb 0 ++#define xd_p_reg_top_pwm2_duration (*(volatile byte xdata *) 0xD911) ++#define p_reg_top_pwm2_duration 0xD911 ++#define reg_top_pwm2_duration_pos 0 ++#define reg_top_pwm2_duration_len 8 ++#define reg_top_pwm2_duration_lsb 0 ++#define xd_p_reg_top_pwm3_gpio (*(volatile byte xdata *) 0xD912) ++#define p_reg_top_pwm3_gpio 0xD912 ++#define reg_top_pwm3_gpio_pos 0 ++#define reg_top_pwm3_gpio_len 1 ++#define reg_top_pwm3_gpio_lsb 0 ++#define xd_p_reg_top_pwm3_pos (*(volatile byte xdata *) 0xD913) ++#define p_reg_top_pwm3_pos 0xD913 ++#define reg_top_pwm3_pos_pos 0 ++#define reg_top_pwm3_pos_len 3 ++#define reg_top_pwm3_pos_lsb 0 ++#define xd_p_reg_top_pwm3_width (*(volatile byte xdata *) 0xD914) ++#define p_reg_top_pwm3_width 0xD914 ++#define reg_top_pwm3_width_pos 0 ++#define reg_top_pwm3_width_len 2 ++#define reg_top_pwm3_width_lsb 0 ++#define xd_p_reg_top_pwm3_duration (*(volatile byte xdata *) 0xD915) ++#define p_reg_top_pwm3_duration 0xD915 ++#define reg_top_pwm3_duration_pos 0 ++#define reg_top_pwm3_duration_len 8 ++#define reg_top_pwm3_duration_lsb 0 ++#define xd_p_reg_top_hosta_mpeg_par_mode (*(volatile byte xdata *) 0xD916) ++#define p_reg_top_hosta_mpeg_par_mode 0xD916 ++#define reg_top_hosta_mpeg_par_mode_pos 0 ++#define reg_top_hosta_mpeg_par_mode_len 1 ++#define reg_top_hosta_mpeg_par_mode_lsb 0 ++#define xd_p_reg_top_hosta_mpeg_ser_mode (*(volatile byte xdata *) 0xD917) ++#define p_reg_top_hosta_mpeg_ser_mode 0xD917 ++#define reg_top_hosta_mpeg_ser_mode_pos 0 ++#define reg_top_hosta_mpeg_ser_mode_len 1 ++#define reg_top_hosta_mpeg_ser_mode_lsb 0 ++#define xd_p_reg_top_hosta_mpeg_ser_do7 (*(volatile byte xdata *) 0xD918) ++#define p_reg_top_hosta_mpeg_ser_do7 0xD918 ++#define reg_top_hosta_mpeg_ser_do7_pos 0 ++#define reg_top_hosta_mpeg_ser_do7_len 1 ++#define reg_top_hosta_mpeg_ser_do7_lsb 0 ++#define xd_p_reg_top_hosta_dca_upper (*(volatile byte xdata *) 0xD919) ++#define p_reg_top_hosta_dca_upper 0xD919 ++#define reg_top_hosta_dca_upper_pos 0 ++#define reg_top_hosta_dca_upper_len 1 ++#define reg_top_hosta_dca_upper_lsb 0 ++#define xd_p_reg_top_hosta_dca_lower (*(volatile byte xdata *) 0xD91A) ++#define p_reg_top_hosta_dca_lower 0xD91A ++#define reg_top_hosta_dca_lower_pos 0 ++#define reg_top_hosta_dca_lower_len 1 ++#define reg_top_hosta_dca_lower_lsb 0 ++#define xd_p_reg_top_hostb_mpeg_par_mode (*(volatile byte xdata *) 0xD91B) ++#define p_reg_top_hostb_mpeg_par_mode 0xD91B ++#define reg_top_hostb_mpeg_par_mode_pos 0 ++#define reg_top_hostb_mpeg_par_mode_len 1 ++#define reg_top_hostb_mpeg_par_mode_lsb 0 ++#define xd_p_reg_top_hostb_mpeg_ser_mode (*(volatile byte xdata *) 0xD91C) ++#define p_reg_top_hostb_mpeg_ser_mode 0xD91C ++#define reg_top_hostb_mpeg_ser_mode_pos 0 ++#define reg_top_hostb_mpeg_ser_mode_len 1 ++#define reg_top_hostb_mpeg_ser_mode_lsb 0 ++#define xd_p_reg_top_hostb_mpeg_ser_do7 (*(volatile byte xdata *) 0xD91D) ++#define p_reg_top_hostb_mpeg_ser_do7 0xD91D ++#define reg_top_hostb_mpeg_ser_do7_pos 0 ++#define reg_top_hostb_mpeg_ser_do7_len 1 ++#define reg_top_hostb_mpeg_ser_do7_lsb 0 ++#define xd_p_reg_top_hostb_dca_upper (*(volatile byte xdata *) 0xD91E) ++#define p_reg_top_hostb_dca_upper 0xD91E ++#define reg_top_hostb_dca_upper_pos 0 ++#define reg_top_hostb_dca_upper_len 1 ++#define reg_top_hostb_dca_upper_lsb 0 ++#define xd_p_reg_top_hostb_dca_lower (*(volatile byte xdata *) 0xD91F) ++#define p_reg_top_hostb_dca_lower 0xD91F ++#define reg_top_hostb_dca_lower_pos 0 ++#define reg_top_hostb_dca_lower_len 1 ++#define reg_top_hostb_dca_lower_lsb 0 ++#define xd_p_reg_top_host_reverse (*(volatile byte xdata *) 0xD920) ++#define p_reg_top_host_reverse 0xD920 ++#define reg_top_host_reverse_pos 0 ++#define reg_top_host_reverse_len 1 ++#define reg_top_host_reverse_lsb 0 ++#define xd_p_reg_top_hosta_ccir (*(volatile byte xdata *) 0xD921) ++#define p_reg_top_hosta_ccir 0xD921 ++#define reg_top_hosta_ccir_pos 0 ++#define reg_top_hosta_ccir_len 1 ++#define reg_top_hosta_ccir_lsb 0 ++#define xd_p_reg_top_hostb_ccir (*(volatile byte xdata *) 0xD922) ++#define p_reg_top_hostb_ccir 0xD922 ++#define reg_top_hostb_ccir_pos 0 ++#define reg_top_hostb_ccir_len 1 ++#define reg_top_hostb_ccir_lsb 0 ++#define xd_p_reg_top_i2s_master_mode (*(volatile byte xdata *) 0xD923) ++#define p_reg_top_i2s_master_mode 0xD923 ++#define reg_top_i2s_master_mode_pos 0 ++#define reg_top_i2s_master_mode_len 1 ++#define reg_top_i2s_master_mode_lsb 0 ++#define xd_p_reg_usb_cfg_speed (*(volatile byte xdata *) 0xDD00) ++#define p_reg_usb_cfg_speed 0xDD00 ++#define reg_usb_cfg_speed_pos 0 ++#define reg_usb_cfg_speed_len 1 ++#define reg_usb_cfg_speed_lsb 0 ++#define xd_p_reg_usb_cfg_utmi16 (*(volatile byte xdata *) 0xDD00) ++#define p_reg_usb_cfg_utmi16 0xDD00 ++#define reg_usb_cfg_utmi16_pos 1 ++#define reg_usb_cfg_utmi16_len 1 ++#define reg_usb_cfg_utmi16_lsb 0 ++#define xd_p_reg_usb_cfg_test (*(volatile byte xdata *) 0xDD00) ++#define p_reg_usb_cfg_test 0xDD00 ++#define reg_usb_cfg_test_pos 3 ++#define reg_usb_cfg_test_len 3 ++#define reg_usb_cfg_test_lsb 0 ++#define xd_p_reg_usb_port_sim_reset (*(volatile byte xdata *) 0xDD00) ++#define p_reg_usb_port_sim_reset 0xDD00 ++#define reg_usb_port_sim_reset_pos 6 ++#define reg_usb_port_sim_reset_len 1 ++#define reg_usb_port_sim_reset_lsb 0 ++#define xd_p_reg_usb_port_run (*(volatile byte xdata *) 0xDD00) ++#define p_reg_usb_port_run 0xDD00 ++#define reg_usb_port_run_pos 7 ++#define reg_usb_port_run_len 1 ++#define reg_usb_port_run_lsb 0 ++#define xd_r_usb_line_state_0 (*(volatile byte xdata *) 0xDD01) ++#define r_usb_line_state_0 0xDD01 ++#define usb_line_state_0_pos 0 ++#define usb_line_state_0_len 1 ++#define usb_line_state_0_lsb 0 ++#define xd_r_usb_line_state_1 (*(volatile byte xdata *) 0xDD01) ++#define r_usb_line_state_1 0xDD01 ++#define usb_line_state_1_pos 1 ++#define usb_line_state_1_len 1 ++#define usb_line_state_1_lsb 0 ++#define xd_r_reg_usb_status_speed (*(volatile byte xdata *) 0xDD01) ++#define r_reg_usb_status_speed 0xDD01 ++#define reg_usb_status_speed_pos 2 ++#define reg_usb_status_speed_len 1 ++#define reg_usb_status_speed_lsb 0 ++#define xd_r_reg_usb_status_connect (*(volatile byte xdata *) 0xDD01) ++#define r_reg_usb_status_connect 0xDD01 ++#define reg_usb_status_connect_pos 3 ++#define reg_usb_status_connect_len 1 ++#define reg_usb_status_connect_lsb 0 ++#define xd_r_reg_usb_rx_buf (*(volatile byte xdata *) 0xDD01) ++#define r_reg_usb_rx_buf 0xDD01 ++#define reg_usb_rx_buf_pos 4 ++#define reg_usb_rx_buf_len 1 ++#define reg_usb_rx_buf_lsb 0 ++#define xd_r_reg_usb_port_reset (*(volatile byte xdata *) 0xDD01) ++#define r_reg_usb_port_reset 0xDD01 ++#define reg_usb_port_reset_pos 5 ++#define reg_usb_port_reset_len 1 ++#define reg_usb_port_reset_lsb 0 ++#define xd_r_reg_usb_port_suspend (*(volatile byte xdata *) 0xDD01) ++#define r_reg_usb_port_suspend 0xDD01 ++#define reg_usb_port_suspend_pos 6 ++#define reg_usb_port_suspend_len 1 ++#define reg_usb_port_suspend_lsb 0 ++#define xd_p_reg_ep1_tx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep1_tx_type 0xDD07 ++#define reg_ep1_tx_type_pos 2 ++#define reg_ep1_tx_type_len 1 ++#define reg_ep1_tx_type_lsb 0 ++#define xd_p_reg_ep2_rx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep2_rx_type 0xDD07 ++#define reg_ep2_rx_type_pos 3 ++#define reg_ep2_rx_type_len 1 ++#define reg_ep2_rx_type_lsb 0 ++#define xd_p_reg_ep3_tx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep3_tx_type 0xDD07 ++#define reg_ep3_tx_type_pos 4 ++#define reg_ep3_tx_type_len 1 ++#define reg_ep3_tx_type_lsb 0 ++#define xd_p_reg_ep4_tx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep4_tx_type 0xDD07 ++#define reg_ep4_tx_type_pos 5 ++#define reg_ep4_tx_type_len 1 ++#define reg_ep4_tx_type_lsb 0 ++#define xd_p_reg_ep5_tx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep5_tx_type 0xDD07 ++#define reg_ep5_tx_type_pos 6 ++#define reg_ep5_tx_type_len 1 ++#define reg_ep5_tx_type_lsb 0 ++#define xd_p_reg_ep6_tx_type (*(volatile byte xdata *) 0xDD07) ++#define p_reg_ep6_tx_type 0xDD07 ++#define reg_ep6_tx_type_pos 7 ++#define reg_ep6_tx_type_len 1 ++#define reg_ep6_tx_type_lsb 0 ++#define xd_p_reg_ep0_max_pkt (*(volatile byte xdata *) 0xDD08) ++#define p_reg_ep0_max_pkt 0xDD08 ++#define reg_ep0_max_pkt_pos 0 ++#define reg_ep0_max_pkt_len 8 ++#define reg_ep0_max_pkt_lsb 0 ++#define xd_p_reg_ep2_max_pkt (*(volatile byte xdata *) 0xDD0A) ++#define p_reg_ep2_max_pkt 0xDD0A ++#define reg_ep2_max_pkt_pos 0 ++#define reg_ep2_max_pkt_len 8 ++#define reg_ep2_max_pkt_lsb 0 ++#define xd_p_reg_ep4_max_pkt (*(volatile byte xdata *) 0xDD0C) ++#define p_reg_ep4_max_pkt 0xDD0C ++#define reg_ep4_max_pkt_pos 0 ++#define reg_ep4_max_pkt_len 8 ++#define reg_ep4_max_pkt_lsb 0 ++#define xd_p_reg_ep5_max_pkt (*(volatile byte xdata *) 0xDD0D) ++#define p_reg_ep5_max_pkt 0xDD0D ++#define reg_ep5_max_pkt_pos 0 ++#define reg_ep5_max_pkt_len 8 ++#define reg_ep5_max_pkt_lsb 0 ++#define xd_p_reg_ep6_max_pkt_7_0 (*(volatile byte xdata *) 0xDD0E) ++#define p_reg_ep6_max_pkt_7_0 0xDD0E ++#define reg_ep6_max_pkt_7_0_pos 0 ++#define reg_ep6_max_pkt_7_0_len 8 ++#define reg_ep6_max_pkt_7_0_lsb 0 ++#define xd_p_reg_ep6_max_pkt_15_8 (*(volatile byte xdata *) 0xDD0F) ++#define p_reg_ep6_max_pkt_15_8 0xDD0F ++#define reg_ep6_max_pkt_15_8_pos 0 ++#define reg_ep6_max_pkt_15_8_len 8 ++#define reg_ep6_max_pkt_15_8_lsb 8 ++#define xd_p_reg_usb_addr (*(volatile byte xdata *) 0xDD10) ++#define p_reg_usb_addr 0xDD10 ++#define reg_usb_addr_pos 0 ++#define reg_usb_addr_len 7 ++#define reg_usb_addr_lsb 0 ++#define xd_p_reg_usb_addr_now (*(volatile byte xdata *) 0xDD10) ++#define p_reg_usb_addr_now 0xDD10 ++#define reg_usb_addr_now_pos 7 ++#define reg_usb_addr_now_len 1 ++#define reg_usb_addr_now_lsb 0 ++#define xd_p_reg_ep0_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep0_tx_en 0xDD11 ++#define reg_ep0_tx_en_pos 0 ++#define reg_ep0_tx_en_len 1 ++#define reg_ep0_tx_en_lsb 0 ++#define xd_p_reg_ep0_rx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep0_rx_en 0xDD11 ++#define reg_ep0_rx_en_pos 1 ++#define reg_ep0_rx_en_len 1 ++#define reg_ep0_rx_en_lsb 0 ++#define xd_p_reg_ep1_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep1_tx_en 0xDD11 ++#define reg_ep1_tx_en_pos 2 ++#define reg_ep1_tx_en_len 1 ++#define reg_ep1_tx_en_lsb 0 ++#define xd_p_reg_ep2_rx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep2_rx_en 0xDD11 ++#define reg_ep2_rx_en_pos 3 ++#define reg_ep2_rx_en_len 1 ++#define reg_ep2_rx_en_lsb 0 ++#define xd_p_reg_ep3_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep3_tx_en 0xDD11 ++#define reg_ep3_tx_en_pos 4 ++#define reg_ep3_tx_en_len 1 ++#define reg_ep3_tx_en_lsb 0 ++#define xd_p_reg_ep4_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep4_tx_en 0xDD11 ++#define reg_ep4_tx_en_pos 5 ++#define reg_ep4_tx_en_len 1 ++#define reg_ep4_tx_en_lsb 0 ++#define xd_p_reg_ep5_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep5_tx_en 0xDD11 ++#define reg_ep5_tx_en_pos 6 ++#define reg_ep5_tx_en_len 1 ++#define reg_ep5_tx_en_lsb 0 ++#define xd_p_reg_ep6_tx_en (*(volatile byte xdata *) 0xDD11) ++#define p_reg_ep6_tx_en 0xDD11 ++#define reg_ep6_tx_en_pos 7 ++#define reg_ep6_tx_en_len 1 ++#define reg_ep6_tx_en_lsb 0 ++#define xd_p_reg_ep0_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep0_tx_stall 0xDD12 ++#define reg_ep0_tx_stall_pos 0 ++#define reg_ep0_tx_stall_len 1 ++#define reg_ep0_tx_stall_lsb 0 ++#define xd_p_reg_ep0_rx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep0_rx_stall 0xDD12 ++#define reg_ep0_rx_stall_pos 1 ++#define reg_ep0_rx_stall_len 1 ++#define reg_ep0_rx_stall_lsb 0 ++#define xd_p_reg_ep1_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep1_tx_stall 0xDD12 ++#define reg_ep1_tx_stall_pos 2 ++#define reg_ep1_tx_stall_len 1 ++#define reg_ep1_tx_stall_lsb 0 ++#define xd_p_reg_ep2_rx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep2_rx_stall 0xDD12 ++#define reg_ep2_rx_stall_pos 3 ++#define reg_ep2_rx_stall_len 1 ++#define reg_ep2_rx_stall_lsb 0 ++#define xd_p_reg_ep3_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep3_tx_stall 0xDD12 ++#define reg_ep3_tx_stall_pos 4 ++#define reg_ep3_tx_stall_len 1 ++#define reg_ep3_tx_stall_lsb 0 ++#define xd_p_reg_ep4_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep4_tx_stall 0xDD12 ++#define reg_ep4_tx_stall_pos 5 ++#define reg_ep4_tx_stall_len 1 ++#define reg_ep4_tx_stall_lsb 0 ++#define xd_p_reg_ep5_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep5_tx_stall 0xDD12 ++#define reg_ep5_tx_stall_pos 6 ++#define reg_ep5_tx_stall_len 1 ++#define reg_ep5_tx_stall_lsb 0 ++#define xd_p_reg_ep6_tx_stall (*(volatile byte xdata *) 0xDD12) ++#define p_reg_ep6_tx_stall 0xDD12 ++#define reg_ep6_tx_stall_pos 7 ++#define reg_ep6_tx_stall_len 1 ++#define reg_ep6_tx_stall_lsb 0 ++#define xd_p_reg_ep0_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep0_tx_nak 0xDD13 ++#define reg_ep0_tx_nak_pos 0 ++#define reg_ep0_tx_nak_len 1 ++#define reg_ep0_tx_nak_lsb 0 ++#define xd_p_reg_ep0_rx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep0_rx_nak 0xDD13 ++#define reg_ep0_rx_nak_pos 1 ++#define reg_ep0_rx_nak_len 1 ++#define reg_ep0_rx_nak_lsb 0 ++#define xd_p_reg_ep1_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep1_tx_nak 0xDD13 ++#define reg_ep1_tx_nak_pos 2 ++#define reg_ep1_tx_nak_len 1 ++#define reg_ep1_tx_nak_lsb 0 ++#define xd_p_reg_ep2_rx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep2_rx_nak 0xDD13 ++#define reg_ep2_rx_nak_pos 3 ++#define reg_ep2_rx_nak_len 1 ++#define reg_ep2_rx_nak_lsb 0 ++#define xd_p_reg_ep3_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep3_tx_nak 0xDD13 ++#define reg_ep3_tx_nak_pos 4 ++#define reg_ep3_tx_nak_len 1 ++#define reg_ep3_tx_nak_lsb 0 ++#define xd_p_reg_ep4_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep4_tx_nak 0xDD13 ++#define reg_ep4_tx_nak_pos 5 ++#define reg_ep4_tx_nak_len 1 ++#define reg_ep4_tx_nak_lsb 0 ++#define xd_p_reg_ep5_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep5_tx_nak 0xDD13 ++#define reg_ep5_tx_nak_pos 6 ++#define reg_ep5_tx_nak_len 1 ++#define reg_ep5_tx_nak_lsb 0 ++#define xd_p_reg_ep6_tx_nak (*(volatile byte xdata *) 0xDD13) ++#define p_reg_ep6_tx_nak 0xDD13 ++#define reg_ep6_tx_nak_pos 7 ++#define reg_ep6_tx_nak_len 1 ++#define reg_ep6_tx_nak_lsb 0 ++#define xd_p_reg_ep0_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep0_tx_nak_int_en 0xDD14 ++#define reg_ep0_tx_nak_int_en_pos 0 ++#define reg_ep0_tx_nak_int_en_len 1 ++#define reg_ep0_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep0_rx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep0_rx_nak_int_en 0xDD14 ++#define reg_ep0_rx_nak_int_en_pos 1 ++#define reg_ep0_rx_nak_int_en_len 1 ++#define reg_ep0_rx_nak_int_en_lsb 0 ++#define xd_p_reg_ep1_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep1_tx_nak_int_en 0xDD14 ++#define reg_ep1_tx_nak_int_en_pos 2 ++#define reg_ep1_tx_nak_int_en_len 1 ++#define reg_ep1_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep2_rx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep2_rx_nak_int_en 0xDD14 ++#define reg_ep2_rx_nak_int_en_pos 3 ++#define reg_ep2_rx_nak_int_en_len 1 ++#define reg_ep2_rx_nak_int_en_lsb 0 ++#define xd_p_reg_ep3_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep3_tx_nak_int_en 0xDD14 ++#define reg_ep3_tx_nak_int_en_pos 4 ++#define reg_ep3_tx_nak_int_en_len 1 ++#define reg_ep3_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep4_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep4_tx_nak_int_en 0xDD14 ++#define reg_ep4_tx_nak_int_en_pos 5 ++#define reg_ep4_tx_nak_int_en_len 1 ++#define reg_ep4_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep5_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep5_tx_nak_int_en 0xDD14 ++#define reg_ep5_tx_nak_int_en_pos 6 ++#define reg_ep5_tx_nak_int_en_len 1 ++#define reg_ep5_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep6_tx_nak_int_en (*(volatile byte xdata *) 0xDD14) ++#define p_reg_ep6_tx_nak_int_en 0xDD14 ++#define reg_ep6_tx_nak_int_en_pos 7 ++#define reg_ep6_tx_nak_int_en_len 1 ++#define reg_ep6_tx_nak_int_en_lsb 0 ++#define xd_p_reg_ep0_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep0_tx_done_int_en 0xDD15 ++#define reg_ep0_tx_done_int_en_pos 0 ++#define reg_ep0_tx_done_int_en_len 1 ++#define reg_ep0_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep0_rx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep0_rx_done_int_en 0xDD15 ++#define reg_ep0_rx_done_int_en_pos 1 ++#define reg_ep0_rx_done_int_en_len 1 ++#define reg_ep0_rx_done_int_en_lsb 0 ++#define xd_p_reg_ep1_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep1_tx_done_int_en 0xDD15 ++#define reg_ep1_tx_done_int_en_pos 2 ++#define reg_ep1_tx_done_int_en_len 1 ++#define reg_ep1_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep2_rx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep2_rx_done_int_en 0xDD15 ++#define reg_ep2_rx_done_int_en_pos 3 ++#define reg_ep2_rx_done_int_en_len 1 ++#define reg_ep2_rx_done_int_en_lsb 0 ++#define xd_p_reg_ep3_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep3_tx_done_int_en 0xDD15 ++#define reg_ep3_tx_done_int_en_pos 4 ++#define reg_ep3_tx_done_int_en_len 1 ++#define reg_ep3_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep4_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep4_tx_done_int_en 0xDD15 ++#define reg_ep4_tx_done_int_en_pos 5 ++#define reg_ep4_tx_done_int_en_len 1 ++#define reg_ep4_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep5_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep5_tx_done_int_en 0xDD15 ++#define reg_ep5_tx_done_int_en_pos 6 ++#define reg_ep5_tx_done_int_en_len 1 ++#define reg_ep5_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep6_tx_done_int_en (*(volatile byte xdata *) 0xDD15) ++#define p_reg_ep6_tx_done_int_en 0xDD15 ++#define reg_ep6_tx_done_int_en_pos 7 ++#define reg_ep6_tx_done_int_en_len 1 ++#define reg_ep6_tx_done_int_en_lsb 0 ++#define xd_p_reg_ep0_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep0_tx_fail_int_en 0xDD16 ++#define reg_ep0_tx_fail_int_en_pos 0 ++#define reg_ep0_tx_fail_int_en_len 1 ++#define reg_ep0_tx_fail_int_en_lsb 0 ++#define xd_p_reg_ep0_rx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep0_rx_fail_int_en 0xDD16 ++#define reg_ep0_rx_fail_int_en_pos 1 ++#define reg_ep0_rx_fail_int_en_len 1 ++#define reg_ep0_rx_fail_int_en_lsb 0 ++#define xd_p_reg_ep1_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep1_tx_fail_int_en 0xDD16 ++#define reg_ep1_tx_fail_int_en_pos 2 ++#define reg_ep1_tx_fail_int_en_len 1 ++#define reg_ep1_tx_fail_int_en_lsb 0 ++#define xd_p_reg_ep2_rx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep2_rx_fail_int_en 0xDD16 ++#define reg_ep2_rx_fail_int_en_pos 3 ++#define reg_ep2_rx_fail_int_en_len 1 ++#define reg_ep2_rx_fail_int_en_lsb 0 ++#define xd_p_reg_ep3_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep3_tx_fail_int_en 0xDD16 ++#define reg_ep3_tx_fail_int_en_pos 4 ++#define reg_ep3_tx_fail_int_en_len 1 ++#define reg_ep3_tx_fail_int_en_lsb 0 ++#define xd_p_reg_ep4_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep4_tx_fail_int_en 0xDD16 ++#define reg_ep4_tx_fail_int_en_pos 5 ++#define reg_ep4_tx_fail_int_en_len 1 ++#define reg_ep4_tx_fail_int_en_lsb 0 ++#define xd_p_reg_ep5_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep5_tx_fail_int_en 0xDD16 ++#define reg_ep5_tx_fail_int_en_pos 6 ++#define reg_ep5_tx_fail_int_en_len 1 ++#define reg_ep5_tx_fail_int_en_lsb 0 ++#define xd_p_reg_ep6_tx_fail_int_en (*(volatile byte xdata *) 0xDD16) ++#define p_reg_ep6_tx_fail_int_en 0xDD16 ++#define reg_ep6_tx_fail_int_en_pos 7 ++#define reg_ep6_tx_fail_int_en_len 1 ++#define reg_ep6_tx_fail_int_en_lsb 0 ++#define xd_p_reg_suspend_int_en (*(volatile byte xdata *) 0xDD17) ++#define p_reg_suspend_int_en 0xDD17 ++#define reg_suspend_int_en_pos 0 ++#define reg_suspend_int_en_len 1 ++#define reg_suspend_int_en_lsb 0 ++#define xd_p_reg_bus_reset_int_en (*(volatile byte xdata *) 0xDD17) ++#define p_reg_bus_reset_int_en 0xDD17 ++#define reg_bus_reset_int_en_pos 1 ++#define reg_bus_reset_int_en_len 1 ++#define reg_bus_reset_int_en_lsb 0 ++#define xd_p_reg_ep0_setup_int_en (*(volatile byte xdata *) 0xDD17) ++#define p_reg_ep0_setup_int_en 0xDD17 ++#define reg_ep0_setup_int_en_pos 2 ++#define reg_ep0_setup_int_en_len 1 ++#define reg_ep0_setup_int_en_lsb 0 ++#define xd_p_reg_ep0_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep0_tx_nak_int 0xDD18 ++#define reg_ep0_tx_nak_int_pos 0 ++#define reg_ep0_tx_nak_int_len 1 ++#define reg_ep0_tx_nak_int_lsb 0 ++#define xd_p_reg_ep0_rx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep0_rx_nak_int 0xDD18 ++#define reg_ep0_rx_nak_int_pos 1 ++#define reg_ep0_rx_nak_int_len 1 ++#define reg_ep0_rx_nak_int_lsb 0 ++#define xd_p_reg_ep1_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep1_tx_nak_int 0xDD18 ++#define reg_ep1_tx_nak_int_pos 2 ++#define reg_ep1_tx_nak_int_len 1 ++#define reg_ep1_tx_nak_int_lsb 0 ++#define xd_p_reg_ep2_rx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep2_rx_nak_int 0xDD18 ++#define reg_ep2_rx_nak_int_pos 3 ++#define reg_ep2_rx_nak_int_len 1 ++#define reg_ep2_rx_nak_int_lsb 0 ++#define xd_p_reg_ep3_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep3_tx_nak_int 0xDD18 ++#define reg_ep3_tx_nak_int_pos 4 ++#define reg_ep3_tx_nak_int_len 1 ++#define reg_ep3_tx_nak_int_lsb 0 ++#define xd_p_reg_ep4_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep4_tx_nak_int 0xDD18 ++#define reg_ep4_tx_nak_int_pos 5 ++#define reg_ep4_tx_nak_int_len 1 ++#define reg_ep4_tx_nak_int_lsb 0 ++#define xd_p_reg_ep5_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep5_tx_nak_int 0xDD18 ++#define reg_ep5_tx_nak_int_pos 6 ++#define reg_ep5_tx_nak_int_len 1 ++#define reg_ep5_tx_nak_int_lsb 0 ++#define xd_p_reg_ep6_tx_nak_int (*(volatile byte xdata *) 0xDD18) ++#define p_reg_ep6_tx_nak_int 0xDD18 ++#define reg_ep6_tx_nak_int_pos 7 ++#define reg_ep6_tx_nak_int_len 1 ++#define reg_ep6_tx_nak_int_lsb 0 ++#define xd_p_reg_ep0_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep0_tx_done_int 0xDD19 ++#define reg_ep0_tx_done_int_pos 0 ++#define reg_ep0_tx_done_int_len 1 ++#define reg_ep0_tx_done_int_lsb 0 ++#define xd_p_reg_ep0_rx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep0_rx_done_int 0xDD19 ++#define reg_ep0_rx_done_int_pos 1 ++#define reg_ep0_rx_done_int_len 1 ++#define reg_ep0_rx_done_int_lsb 0 ++#define xd_p_reg_ep1_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep1_tx_done_int 0xDD19 ++#define reg_ep1_tx_done_int_pos 2 ++#define reg_ep1_tx_done_int_len 1 ++#define reg_ep1_tx_done_int_lsb 0 ++#define xd_p_reg_ep2_rx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep2_rx_done_int 0xDD19 ++#define reg_ep2_rx_done_int_pos 3 ++#define reg_ep2_rx_done_int_len 1 ++#define reg_ep2_rx_done_int_lsb 0 ++#define xd_p_reg_ep3_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep3_tx_done_int 0xDD19 ++#define reg_ep3_tx_done_int_pos 4 ++#define reg_ep3_tx_done_int_len 1 ++#define reg_ep3_tx_done_int_lsb 0 ++#define xd_p_reg_ep4_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep4_tx_done_int 0xDD19 ++#define reg_ep4_tx_done_int_pos 5 ++#define reg_ep4_tx_done_int_len 1 ++#define reg_ep4_tx_done_int_lsb 0 ++#define xd_p_reg_ep5_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep5_tx_done_int 0xDD19 ++#define reg_ep5_tx_done_int_pos 6 ++#define reg_ep5_tx_done_int_len 1 ++#define reg_ep5_tx_done_int_lsb 0 ++#define xd_p_reg_ep6_tx_done_int (*(volatile byte xdata *) 0xDD19) ++#define p_reg_ep6_tx_done_int 0xDD19 ++#define reg_ep6_tx_done_int_pos 7 ++#define reg_ep6_tx_done_int_len 1 ++#define reg_ep6_tx_done_int_lsb 0 ++#define xd_p_reg_ep0_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep0_tx_fail_int 0xDD1A ++#define reg_ep0_tx_fail_int_pos 0 ++#define reg_ep0_tx_fail_int_len 1 ++#define reg_ep0_tx_fail_int_lsb 0 ++#define xd_p_reg_ep0_rx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep0_rx_fail_int 0xDD1A ++#define reg_ep0_rx_fail_int_pos 1 ++#define reg_ep0_rx_fail_int_len 1 ++#define reg_ep0_rx_fail_int_lsb 0 ++#define xd_p_reg_ep1_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep1_tx_fail_int 0xDD1A ++#define reg_ep1_tx_fail_int_pos 2 ++#define reg_ep1_tx_fail_int_len 1 ++#define reg_ep1_tx_fail_int_lsb 0 ++#define xd_p_reg_ep2_rx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep2_rx_fail_int 0xDD1A ++#define reg_ep2_rx_fail_int_pos 3 ++#define reg_ep2_rx_fail_int_len 1 ++#define reg_ep2_rx_fail_int_lsb 0 ++#define xd_p_reg_ep3_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep3_tx_fail_int 0xDD1A ++#define reg_ep3_tx_fail_int_pos 4 ++#define reg_ep3_tx_fail_int_len 1 ++#define reg_ep3_tx_fail_int_lsb 0 ++#define xd_p_reg_ep4_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep4_tx_fail_int 0xDD1A ++#define reg_ep4_tx_fail_int_pos 5 ++#define reg_ep4_tx_fail_int_len 1 ++#define reg_ep4_tx_fail_int_lsb 0 ++#define xd_p_reg_ep5_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep5_tx_fail_int 0xDD1A ++#define reg_ep5_tx_fail_int_pos 6 ++#define reg_ep5_tx_fail_int_len 1 ++#define reg_ep5_tx_fail_int_lsb 0 ++#define xd_p_reg_ep6_tx_fail_int (*(volatile byte xdata *) 0xDD1A) ++#define p_reg_ep6_tx_fail_int 0xDD1A ++#define reg_ep6_tx_fail_int_pos 7 ++#define reg_ep6_tx_fail_int_len 1 ++#define reg_ep6_tx_fail_int_lsb 0 ++#define xd_p_reg_suspend_int (*(volatile byte xdata *) 0xDD1B) ++#define p_reg_suspend_int 0xDD1B ++#define reg_suspend_int_pos 0 ++#define reg_suspend_int_len 1 ++#define reg_suspend_int_lsb 0 ++#define xd_p_reg_bus_reset_int (*(volatile byte xdata *) 0xDD1B) ++#define p_reg_bus_reset_int 0xDD1B ++#define reg_bus_reset_int_pos 1 ++#define reg_bus_reset_int_len 1 ++#define reg_bus_reset_int_lsb 0 ++#define xd_p_reg_ep0_setup_int (*(volatile byte xdata *) 0xDD1B) ++#define p_reg_ep0_setup_int 0xDD1B ++#define reg_ep0_setup_int_pos 2 ++#define reg_ep0_setup_int_len 1 ++#define reg_ep0_setup_int_lsb 0 ++#define xd_r_usbc_int (*(volatile byte xdata *) 0xDD1B) ++#define r_usbc_int 0xDD1B ++#define usbc_int_pos 3 ++#define usbc_int_len 1 ++#define usbc_int_lsb 0 ++#define xd_r_usb_ir_int (*(volatile byte xdata *) 0xDD1B) ++#define r_usb_ir_int 0xDD1B ++#define usb_ir_int_pos 4 ++#define usb_ir_int_len 1 ++#define usb_ir_int_lsb 0 ++#define xd_p_reg_ep0_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep0_tx_rst 0xDD1D ++#define reg_ep0_tx_rst_pos 0 ++#define reg_ep0_tx_rst_len 1 ++#define reg_ep0_tx_rst_lsb 0 ++#define xd_p_reg_ep0_rx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep0_rx_rst 0xDD1D ++#define reg_ep0_rx_rst_pos 1 ++#define reg_ep0_rx_rst_len 1 ++#define reg_ep0_rx_rst_lsb 0 ++#define xd_p_reg_ep1_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep1_tx_rst 0xDD1D ++#define reg_ep1_tx_rst_pos 2 ++#define reg_ep1_tx_rst_len 1 ++#define reg_ep1_tx_rst_lsb 0 ++#define xd_p_reg_ep2_rx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep2_rx_rst 0xDD1D ++#define reg_ep2_rx_rst_pos 3 ++#define reg_ep2_rx_rst_len 1 ++#define reg_ep2_rx_rst_lsb 0 ++#define xd_p_reg_ep3_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep3_tx_rst 0xDD1D ++#define reg_ep3_tx_rst_pos 4 ++#define reg_ep3_tx_rst_len 1 ++#define reg_ep3_tx_rst_lsb 0 ++#define xd_p_reg_ep4_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep4_tx_rst 0xDD1D ++#define reg_ep4_tx_rst_pos 5 ++#define reg_ep4_tx_rst_len 1 ++#define reg_ep4_tx_rst_lsb 0 ++#define xd_p_reg_ep5_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep5_tx_rst 0xDD1D ++#define reg_ep5_tx_rst_pos 6 ++#define reg_ep5_tx_rst_len 1 ++#define reg_ep5_tx_rst_lsb 0 ++#define xd_p_reg_ep6_tx_rst (*(volatile byte xdata *) 0xDD1D) ++#define p_reg_ep6_tx_rst 0xDD1D ++#define reg_ep6_tx_rst_pos 7 ++#define reg_ep6_tx_rst_len 1 ++#define reg_ep6_tx_rst_lsb 0 ++#define xd_r_reg_ep0_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep0_tx_active 0xDD1E ++#define reg_ep0_tx_active_pos 0 ++#define reg_ep0_tx_active_len 1 ++#define reg_ep0_tx_active_lsb 0 ++#define xd_r_reg_ep0_rx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep0_rx_active 0xDD1E ++#define reg_ep0_rx_active_pos 1 ++#define reg_ep0_rx_active_len 1 ++#define reg_ep0_rx_active_lsb 0 ++#define xd_r_reg_ep1_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep1_tx_active 0xDD1E ++#define reg_ep1_tx_active_pos 2 ++#define reg_ep1_tx_active_len 1 ++#define reg_ep1_tx_active_lsb 0 ++#define xd_r_reg_ep2_rx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep2_rx_active 0xDD1E ++#define reg_ep2_rx_active_pos 3 ++#define reg_ep2_rx_active_len 1 ++#define reg_ep2_rx_active_lsb 0 ++#define xd_r_reg_ep3_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep3_tx_active 0xDD1E ++#define reg_ep3_tx_active_pos 4 ++#define reg_ep3_tx_active_len 1 ++#define reg_ep3_tx_active_lsb 0 ++#define xd_r_reg_ep4_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep4_tx_active 0xDD1E ++#define reg_ep4_tx_active_pos 5 ++#define reg_ep4_tx_active_len 1 ++#define reg_ep4_tx_active_lsb 0 ++#define xd_r_reg_ep5_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep5_tx_active 0xDD1E ++#define reg_ep5_tx_active_pos 6 ++#define reg_ep5_tx_active_len 1 ++#define reg_ep5_tx_active_lsb 0 ++#define xd_r_reg_ep6_tx_active (*(volatile byte xdata *) 0xDD1E) ++#define r_reg_ep6_tx_active 0xDD1E ++#define reg_ep6_tx_active_pos 7 ++#define reg_ep6_tx_active_len 1 ++#define reg_ep6_tx_active_lsb 0 ++#define xd_p_reg_usb_setup_reset (*(volatile byte xdata *) 0xDD1F) ++#define p_reg_usb_setup_reset 0xDD1F ++#define reg_usb_setup_reset_pos 0 ++#define reg_usb_setup_reset_len 1 ++#define reg_usb_setup_reset_lsb 0 ++#define xd_p_reg_usb_ep4_retry_new (*(volatile byte xdata *) 0xDD1F) ++#define p_reg_usb_ep4_retry_new 0xDD1F ++#define reg_usb_ep4_retry_new_pos 1 ++#define reg_usb_ep4_retry_new_len 1 ++#define reg_usb_ep4_retry_new_lsb 0 ++#define xd_p_reg_usb_ep5_retry_new (*(volatile byte xdata *) 0xDD1F) ++#define p_reg_usb_ep5_retry_new 0xDD1F ++#define reg_usb_ep5_retry_new_pos 2 ++#define reg_usb_ep5_retry_new_len 1 ++#define reg_usb_ep5_retry_new_lsb 0 ++#define xd_p_reg_usb_ep6_retry_new (*(volatile byte xdata *) 0xDD1F) ++#define p_reg_usb_ep6_retry_new 0xDD1F ++#define reg_usb_ep6_retry_new_pos 3 ++#define reg_usb_ep6_retry_new_len 1 ++#define reg_usb_ep6_retry_new_lsb 0 ++#define xd_p_reg_usb_iso_mult_cnt (*(volatile byte xdata *) 0xDD20) ++#define p_reg_usb_iso_mult_cnt 0xDD20 ++#define reg_usb_iso_mult_cnt_pos 0 ++#define reg_usb_iso_mult_cnt_len 2 ++#define reg_usb_iso_mult_cnt_lsb 0 ++#define xd_p_reg_p_iso_fix_en (*(volatile byte xdata *) 0xDD21) ++#define p_reg_p_iso_fix_en 0xDD21 ++#define reg_p_iso_fix_en_pos 0 ++#define reg_p_iso_fix_en_len 1 ++#define reg_p_iso_fix_en_lsb 0 ++#define xd_p_reg_p_iso_fix_rst (*(volatile byte xdata *) 0xDD22) ++#define p_reg_p_iso_fix_rst 0xDD22 ++#define reg_p_iso_fix_rst_pos 0 ++#define reg_p_iso_fix_rst_len 1 ++#define reg_p_iso_fix_rst_lsb 0 ++#define xd_p_reg_p_read_point_7_0 (*(volatile byte xdata *) 0xDD23) ++#define p_reg_p_read_point_7_0 0xDD23 ++#define reg_p_read_point_7_0_pos 0 ++#define reg_p_read_point_7_0_len 8 ++#define reg_p_read_point_7_0_lsb 0 ++#define xd_p_reg_p_read_point_11_8 (*(volatile byte xdata *) 0xDD24) ++#define p_reg_p_read_point_11_8 0xDD24 ++#define reg_p_read_point_11_8_pos 0 ++#define reg_p_read_point_11_8_len 4 ++#define reg_p_read_point_11_8_lsb 8 ++#define xd_p_reg_p_dbg_ctrl (*(volatile byte xdata *) 0xDD25) ++#define p_reg_p_dbg_ctrl 0xDD25 ++#define reg_p_dbg_ctrl_pos 0 ++#define reg_p_dbg_ctrl_len 3 ++#define reg_p_dbg_ctrl_lsb 0 ++#define xd_p_reg_p_data_swap (*(volatile byte xdata *) 0xDD26) ++#define p_reg_p_data_swap 0xDD26 ++#define reg_p_data_swap_pos 0 ++#define reg_p_data_swap_len 2 ++#define reg_p_data_swap_lsb 0 ++#define xd_p_reg_ep_rx_addr (*(volatile byte xdata *) 0xDD80) ++#define p_reg_ep_rx_addr 0xDD80 ++#define reg_ep_rx_addr_pos 2 ++#define reg_ep_rx_addr_len 6 ++#define reg_ep_rx_addr_lsb 0 ++#define xd_p_reg_ep0_tx_addr (*(volatile byte xdata *) 0xDD81) ++#define p_reg_ep0_tx_addr 0xDD81 ++#define reg_ep0_tx_addr_pos 2 ++#define reg_ep0_tx_addr_len 6 ++#define reg_ep0_tx_addr_lsb 0 ++#define xd_p_reg_ep1_tx_addr (*(volatile byte xdata *) 0xDD82) ++#define p_reg_ep1_tx_addr 0xDD82 ++#define reg_ep1_tx_addr_pos 2 ++#define reg_ep1_tx_addr_len 6 ++#define reg_ep1_tx_addr_lsb 0 ++#define xd_p_reg_ep3_tx_addr (*(volatile byte xdata *) 0xDD83) ++#define p_reg_ep3_tx_addr 0xDD83 ++#define reg_ep3_tx_addr_pos 2 ++#define reg_ep3_tx_addr_len 6 ++#define reg_ep3_tx_addr_lsb 0 ++#define xd_p_reg_ep_rx_len (*(volatile byte xdata *) 0xDD84) ++#define p_reg_ep_rx_len 0xDD84 ++#define reg_ep_rx_len_pos 0 ++#define reg_ep_rx_len_len 8 ++#define reg_ep_rx_len_lsb 0 ++#define xd_p_reg_ep0_tx_len (*(volatile byte xdata *) 0xDD85) ++#define p_reg_ep0_tx_len 0xDD85 ++#define reg_ep0_tx_len_pos 0 ++#define reg_ep0_tx_len_len 8 ++#define reg_ep0_tx_len_lsb 0 ++#define xd_p_reg_ep1_tx_len (*(volatile byte xdata *) 0xDD86) ++#define p_reg_ep1_tx_len 0xDD86 ++#define reg_ep1_tx_len_pos 0 ++#define reg_ep1_tx_len_len 8 ++#define reg_ep1_tx_len_lsb 0 ++#define xd_p_reg_ep3_tx_len (*(volatile byte xdata *) 0xDD87) ++#define p_reg_ep3_tx_len 0xDD87 ++#define reg_ep3_tx_len_pos 0 ++#define reg_ep3_tx_len_len 8 ++#define reg_ep3_tx_len_lsb 0 ++#define xd_p_reg_ep4_tx_len_7_0 (*(volatile byte xdata *) 0xDD88) ++#define p_reg_ep4_tx_len_7_0 0xDD88 ++#define reg_ep4_tx_len_7_0_pos 0 ++#define reg_ep4_tx_len_7_0_len 8 ++#define reg_ep4_tx_len_7_0_lsb 0 ++#define xd_p_reg_ep4_tx_len_15_8 (*(volatile byte xdata *) 0xDD89) ++#define p_reg_ep4_tx_len_15_8 0xDD89 ++#define reg_ep4_tx_len_15_8_pos 0 ++#define reg_ep4_tx_len_15_8_len 8 ++#define reg_ep4_tx_len_15_8_lsb 8 ++#define xd_p_reg_ep5_tx_len_7_0 (*(volatile byte xdata *) 0xDD8A) ++#define p_reg_ep5_tx_len_7_0 0xDD8A ++#define reg_ep5_tx_len_7_0_pos 0 ++#define reg_ep5_tx_len_7_0_len 8 ++#define reg_ep5_tx_len_7_0_lsb 0 ++#define xd_p_reg_ep5_tx_len_15_8 (*(volatile byte xdata *) 0xDD8B) ++#define p_reg_ep5_tx_len_15_8 0xDD8B ++#define reg_ep5_tx_len_15_8_pos 0 ++#define reg_ep5_tx_len_15_8_len 8 ++#define reg_ep5_tx_len_15_8_lsb 8 ++#define xd_p_reg_usb_reset_addr (*(volatile byte xdata *) 0xDD8C) ++#define p_reg_usb_reset_addr 0xDD8C ++#define reg_usb_reset_addr_pos 0 ++#define reg_usb_reset_addr_len 7 ++#define reg_usb_reset_addr_lsb 0 ++#define xd_p_reg_usb_reset (*(volatile byte xdata *) 0xDD8C) ++#define p_reg_usb_reset 0xDD8C ++#define reg_usb_reset_pos 7 ++#define reg_usb_reset_len 1 ++#define reg_usb_reset_lsb 0 ++#define xd_p_reg_usb_sync_in (*(volatile byte xdata *) 0xDD8D) ++#define p_reg_usb_sync_in 0xDD8D ++#define reg_usb_sync_in_pos 0 ++#define reg_usb_sync_in_len 1 ++#define reg_usb_sync_in_lsb 0 ++#define xd_p_reg_usb_sync_txready (*(volatile byte xdata *) 0xDD8D) ++#define p_reg_usb_sync_txready 0xDD8D ++#define reg_usb_sync_txready_pos 1 ++#define reg_usb_sync_txready_len 1 ++#define reg_usb_sync_txready_lsb 0 ++#define xd_p_reg_utmi_phy_suspend (*(volatile byte xdata *) 0xDD8D) ++#define p_reg_utmi_phy_suspend 0xDD8D ++#define reg_utmi_phy_suspend_pos 2 ++#define reg_utmi_phy_suspend_len 1 ++#define reg_utmi_phy_suspend_lsb 0 ++#define xd_p_reg_usb_min_len (*(volatile byte xdata *) 0xDD8D) ++#define p_reg_usb_min_len 0xDD8D ++#define reg_usb_min_len_pos 3 ++#define reg_usb_min_len_len 1 ++#define reg_usb_min_len_lsb 0 ++#define xd_p_reg_usb_phy_clksel (*(volatile byte xdata *) 0xDD8D) ++#define p_reg_usb_phy_clksel 0xDD8D ++#define reg_usb_phy_clksel_pos 4 ++#define reg_usb_phy_clksel_len 1 ++#define reg_usb_phy_clksel_lsb 0 ++#define xd_p_reg_ep6_tx_len_7_0 (*(volatile byte xdata *) 0xDD8E) ++#define p_reg_ep6_tx_len_7_0 0xDD8E ++#define reg_ep6_tx_len_7_0_pos 0 ++#define reg_ep6_tx_len_7_0_len 8 ++#define reg_ep6_tx_len_7_0_lsb 0 ++#define xd_p_reg_ep6_tx_len_15_8 (*(volatile byte xdata *) 0xDD8F) ++#define p_reg_ep6_tx_len_15_8 0xDD8F ++#define reg_ep6_tx_len_15_8_pos 0 ++#define reg_ep6_tx_len_15_8_len 8 ++#define reg_ep6_tx_len_15_8_lsb 8 ++#define xd_p_reg_usb_clk_phase (*(volatile byte xdata *) 0xDD93) ++#define p_reg_usb_clk_phase 0xDD93 ++#define reg_usb_clk_phase_pos 0 ++#define reg_usb_clk_phase_len 2 ++#define reg_usb_clk_phase_lsb 0 ++#define xd_p_reg_usb_clk_sel (*(volatile byte xdata *) 0xDD93) ++#define p_reg_usb_clk_sel 0xDD93 ++#define reg_usb_clk_sel_pos 4 ++#define reg_usb_clk_sel_len 4 ++#define reg_usb_clk_sel_lsb 0 ++#define xd_p_reg_usb_fifo_ptr (*(volatile byte xdata *) 0xDD94) ++#define p_reg_usb_fifo_ptr 0xDD94 ++#define reg_usb_fifo_ptr_pos 0 ++#define reg_usb_fifo_ptr_len 3 ++#define reg_usb_fifo_ptr_lsb 0 ++#define xd_p_reg_usb_fifo_byte (*(volatile byte xdata *) 0xDD94) ++#define p_reg_usb_fifo_byte 0xDD94 ++#define reg_usb_fifo_byte_pos 3 ++#define reg_usb_fifo_byte_len 2 ++#define reg_usb_fifo_byte_lsb 0 ++#define xd_p_reg_usb_fifo_sys (*(volatile byte xdata *) 0xDD94) ++#define p_reg_usb_fifo_sys 0xDD94 ++#define reg_usb_fifo_sys_pos 5 ++#define reg_usb_fifo_sys_len 1 ++#define reg_usb_fifo_sys_lsb 0 ++#define xd_p_usbdma_utmi_d_ctl_7_0 (*(volatile byte xdata *) 0xDD9E) ++#define p_usbdma_utmi_d_ctl_7_0 0xDD9E ++#define usbdma_utmi_d_ctl_7_0_pos 0 ++#define usbdma_utmi_d_ctl_7_0_len 8 ++#define usbdma_utmi_d_ctl_7_0_lsb 0 ++#define xd_p_usbdma_utmi_d_ctl_13_8 (*(volatile byte xdata *) 0xDD9F) ++#define p_usbdma_utmi_d_ctl_13_8 0xDD9F ++#define usbdma_utmi_d_ctl_13_8_pos 0 ++#define usbdma_utmi_d_ctl_13_8_len 6 ++#define usbdma_utmi_d_ctl_13_8_lsb 8 ++#define xd_p_usbdma_utmi_a_ctl_7_0 (*(volatile byte xdata *) 0xDDA0) ++#define p_usbdma_utmi_a_ctl_7_0 0xDDA0 ++#define usbdma_utmi_a_ctl_7_0_pos 0 ++#define usbdma_utmi_a_ctl_7_0_len 8 ++#define usbdma_utmi_a_ctl_7_0_lsb 0 ++#define xd_p_usbdma_utmi_a_ctl_15_8 (*(volatile byte xdata *) 0xDDA1) ++#define p_usbdma_utmi_a_ctl_15_8 0xDDA1 ++#define usbdma_utmi_a_ctl_15_8_pos 0 ++#define usbdma_utmi_a_ctl_15_8_len 8 ++#define usbdma_utmi_a_ctl_15_8_lsb 8 ++#define xd_p_usbdma_utmi_a_ctl_23_16 (*(volatile byte xdata *) 0xDDA2) ++#define p_usbdma_utmi_a_ctl_23_16 0xDDA2 ++#define usbdma_utmi_a_ctl_23_16_pos 0 ++#define usbdma_utmi_a_ctl_23_16_len 8 ++#define usbdma_utmi_a_ctl_23_16_lsb 16 ++#define xd_p_usbdma_utmi_a_ctl_31_24 (*(volatile byte xdata *) 0xDDA3) ++#define p_usbdma_utmi_a_ctl_31_24 0xDDA3 ++#define usbdma_utmi_a_ctl_31_24_pos 0 ++#define usbdma_utmi_a_ctl_31_24_len 8 ++#define usbdma_utmi_a_ctl_31_24_lsb 24 ++#define xd_p_usbdma_utmi_a_ctl_39_32 (*(volatile byte xdata *) 0xDDA4) ++#define p_usbdma_utmi_a_ctl_39_32 0xDDA4 ++#define usbdma_utmi_a_ctl_39_32_pos 0 ++#define usbdma_utmi_a_ctl_39_32_len 8 ++#define usbdma_utmi_a_ctl_39_32_lsb 32 ++#define xd_p_usbdma_utmi_a_ctl_47_40 (*(volatile byte xdata *) 0xDDA5) ++#define p_usbdma_utmi_a_ctl_47_40 0xDDA5 ++#define usbdma_utmi_a_ctl_47_40_pos 0 ++#define usbdma_utmi_a_ctl_47_40_len 8 ++#define usbdma_utmi_a_ctl_47_40_lsb 40 ++#define xd_p_usbdma_utmi_pwrmode (*(volatile byte xdata *) 0xDDA6) ++#define p_usbdma_utmi_pwrmode 0xDDA6 ++#define usbdma_utmi_pwrmode_pos 3 ++#define usbdma_utmi_pwrmode_len 1 ++#define usbdma_utmi_pwrmode_lsb 0 ++#define xd_p_usbdma_utmi_test_out (*(volatile byte xdata *) 0xDDA6) ++#define p_usbdma_utmi_test_out 0xDDA6 ++#define usbdma_utmi_test_out_pos 4 ++#define usbdma_utmi_test_out_len 1 ++#define usbdma_utmi_test_out_lsb 0 ++#define xd_p_usbdma_utmi_vbus_int_en (*(volatile byte xdata *) 0xDDA7) ++#define p_usbdma_utmi_vbus_int_en 0xDDA7 ++#define usbdma_utmi_vbus_int_en_pos 0 ++#define usbdma_utmi_vbus_int_en_len 1 ++#define usbdma_utmi_vbus_int_en_lsb 0 ++#define xd_p_usbdma_utmi_vbus_int_pol (*(volatile byte xdata *) 0xDDA7) ++#define p_usbdma_utmi_vbus_int_pol 0xDDA7 ++#define usbdma_utmi_vbus_int_pol_pos 1 ++#define usbdma_utmi_vbus_int_pol_len 1 ++#define usbdma_utmi_vbus_int_pol_lsb 0 ++#define xd_r_usbdma_utmi_vbus_int (*(volatile byte xdata *) 0xDDA8) ++#define r_usbdma_utmi_vbus_int 0xDDA8 ++#define usbdma_utmi_vbus_int_pos 0 ++#define usbdma_utmi_vbus_int_len 1 ++#define usbdma_utmi_vbus_int_lsb 0 ++#define xd_r_usbdma_utmi_vbus_status (*(volatile byte xdata *) 0xDDA8) ++#define r_usbdma_utmi_vbus_status 0xDDA8 ++#define usbdma_utmi_vbus_status_pos 1 ++#define usbdma_utmi_vbus_status_len 1 ++#define usbdma_utmi_vbus_status_lsb 0 ++#define xd_r_usbdma_utmi_clkrdy (*(volatile byte xdata *) 0xDDA8) ++#define r_usbdma_utmi_clkrdy 0xDDA8 ++#define usbdma_utmi_clkrdy_pos 2 ++#define usbdma_utmi_clkrdy_len 1 ++#define usbdma_utmi_clkrdy_lsb 0 ++#define xd_p_reg_p_usb_iso_ccir_rst (*(volatile byte xdata *) 0xDDA9) ++#define p_reg_p_usb_iso_ccir_rst 0xDDA9 ++#define reg_p_usb_iso_ccir_rst_pos 0 ++#define reg_p_usb_iso_ccir_rst_len 1 ++#define reg_p_usb_iso_ccir_rst_lsb 0 ++#define xd_p_reg_p_usb_iso_ccir (*(volatile byte xdata *) 0xDDA9) ++#define p_reg_p_usb_iso_ccir 0xDDA9 ++#define reg_p_usb_iso_ccir_pos 1 ++#define reg_p_usb_iso_ccir_len 1 ++#define reg_p_usb_iso_ccir_lsb 0 ++#define xd_p_reg_p_ccir_fix_en (*(volatile byte xdata *) 0xDDAA) ++#define p_reg_p_ccir_fix_en 0xDDAA ++#define reg_p_ccir_fix_en_pos 0 ++#define reg_p_ccir_fix_en_len 1 ++#define reg_p_ccir_fix_en_lsb 0 ++#define xd_p_ir_sys_clk (*(volatile byte xdata *) 0xDF80) ++#define p_ir_sys_clk 0xDF80 ++#define ir_sys_clk_pos 0 ++#define ir_sys_clk_len 8 ++#define ir_sys_clk_lsb 0 ++#define xd_p_ir_sample_clk (*(volatile byte xdata *) 0xDF81) ++#define p_ir_sample_clk 0xDF81 ++#define ir_sample_clk_pos 0 ++#define ir_sample_clk_len 2 ++#define ir_sample_clk_lsb 0 ++#define xd_p_ir_idle_polarity (*(volatile byte xdata *) 0xDF81) ++#define p_ir_idle_polarity 0xDF81 ++#define ir_idle_polarity_pos 2 ++#define ir_idle_polarity_len 1 ++#define ir_idle_polarity_lsb 0 ++#define xd_p_ir_fifo_ovfl (*(volatile byte xdata *) 0xDF82) ++#define p_ir_fifo_ovfl 0xDF82 ++#define ir_fifo_ovfl_pos 0 ++#define ir_fifo_ovfl_len 1 ++#define ir_fifo_ovfl_lsb 0 ++#define xd_r_ir_fifo_empty (*(volatile byte xdata *) 0xDF82) ++#define r_ir_fifo_empty 0xDF82 ++#define ir_fifo_empty_pos 1 ++#define ir_fifo_empty_len 1 ++#define ir_fifo_empty_lsb 0 ++#define xd_r_ir_fifo_cnt (*(volatile byte xdata *) 0xDF82) ++#define r_ir_fifo_cnt 0xDF82 ++#define ir_fifo_cnt_pos 2 ++#define ir_fifo_cnt_len 3 ++#define ir_fifo_cnt_lsb 0 ++#define xd_p_ir_fifo_rst (*(volatile byte xdata *) 0xDF82) ++#define p_ir_fifo_rst 0xDF82 ++#define ir_fifo_rst_pos 5 ++#define ir_fifo_rst_len 1 ++#define ir_fifo_rst_lsb 0 ++#define xd_p_reg_ir_out_th0_7_0 (*(volatile byte xdata *) 0xDF84) ++#define p_reg_ir_out_th0_7_0 0xDF84 ++#define reg_ir_out_th0_7_0_pos 0 ++#define reg_ir_out_th0_7_0_len 8 ++#define reg_ir_out_th0_7_0_lsb 0 ++#define xd_p_reg_ir_out_th0_14_8 (*(volatile byte xdata *) 0xDF85) ++#define p_reg_ir_out_th0_14_8 0xDF85 ++#define reg_ir_out_th0_14_8_pos 0 ++#define reg_ir_out_th0_14_8_len 7 ++#define reg_ir_out_th0_14_8_lsb 8 ++#define xd_p_reg_ir_out_th1_7_0 (*(volatile byte xdata *) 0xDF86) ++#define p_reg_ir_out_th1_7_0 0xDF86 ++#define reg_ir_out_th1_7_0_pos 0 ++#define reg_ir_out_th1_7_0_len 8 ++#define reg_ir_out_th1_7_0_lsb 0 ++#define xd_p_reg_ir_out_th1_14_8 (*(volatile byte xdata *) 0xDF87) ++#define p_reg_ir_out_th1_14_8 0xDF87 ++#define reg_ir_out_th1_14_8_pos 0 ++#define reg_ir_out_th1_14_8_len 7 ++#define reg_ir_out_th1_14_8_lsb 8 ++#define xd_p_reg_ir_out_th2_7_0 (*(volatile byte xdata *) 0xDF88) ++#define p_reg_ir_out_th2_7_0 0xDF88 ++#define reg_ir_out_th2_7_0_pos 0 ++#define reg_ir_out_th2_7_0_len 8 ++#define reg_ir_out_th2_7_0_lsb 0 ++#define xd_p_reg_ir_out_th2_14_8 (*(volatile byte xdata *) 0xDF89) ++#define p_reg_ir_out_th2_14_8 0xDF89 ++#define reg_ir_out_th2_14_8_pos 0 ++#define reg_ir_out_th2_14_8_len 7 ++#define reg_ir_out_th2_14_8_lsb 8 ++#define xd_p_reg_ir_out_th3_7_0 (*(volatile byte xdata *) 0xDF8A) ++#define p_reg_ir_out_th3_7_0 0xDF8A ++#define reg_ir_out_th3_7_0_pos 0 ++#define reg_ir_out_th3_7_0_len 8 ++#define reg_ir_out_th3_7_0_lsb 0 ++#define xd_p_reg_ir_out_th3_14_8 (*(volatile byte xdata *) 0xDF8B) ++#define p_reg_ir_out_th3_14_8 0xDF8B ++#define reg_ir_out_th3_14_8_pos 0 ++#define reg_ir_out_th3_14_8_len 7 ++#define reg_ir_out_th3_14_8_lsb 8 ++#define xd_p_reg_ir_out_th4_7_0 (*(volatile byte xdata *) 0xDF8C) ++#define p_reg_ir_out_th4_7_0 0xDF8C ++#define reg_ir_out_th4_7_0_pos 0 ++#define reg_ir_out_th4_7_0_len 8 ++#define reg_ir_out_th4_7_0_lsb 0 ++#define xd_p_reg_ir_out_th4_14_8 (*(volatile byte xdata *) 0xDF8D) ++#define p_reg_ir_out_th4_14_8 0xDF8D ++#define reg_ir_out_th4_14_8_pos 0 ++#define reg_ir_out_th4_14_8_len 7 ++#define reg_ir_out_th4_14_8_lsb 8 ++#define xd_p_reg_ir_out_th5_7_0 (*(volatile byte xdata *) 0xDF8E) ++#define p_reg_ir_out_th5_7_0 0xDF8E ++#define reg_ir_out_th5_7_0_pos 0 ++#define reg_ir_out_th5_7_0_len 8 ++#define reg_ir_out_th5_7_0_lsb 0 ++#define xd_p_reg_ir_out_th5_14_8 (*(volatile byte xdata *) 0xDF8F) ++#define p_reg_ir_out_th5_14_8 0xDF8F ++#define reg_ir_out_th5_14_8_pos 0 ++#define reg_ir_out_th5_14_8_len 7 ++#define reg_ir_out_th5_14_8_lsb 8 ++#define xd_p_reg_ir_out_th6_7_0 (*(volatile byte xdata *) 0xDF90) ++#define p_reg_ir_out_th6_7_0 0xDF90 ++#define reg_ir_out_th6_7_0_pos 0 ++#define reg_ir_out_th6_7_0_len 8 ++#define reg_ir_out_th6_7_0_lsb 0 ++#define xd_p_reg_ir_out_th6_14_8 (*(volatile byte xdata *) 0xDF91) ++#define p_reg_ir_out_th6_14_8 0xDF91 ++#define reg_ir_out_th6_14_8_pos 0 ++#define reg_ir_out_th6_14_8_len 7 ++#define reg_ir_out_th6_14_8_lsb 8 ++#define xd_p_reg_ir_out_th7_7_0 (*(volatile byte xdata *) 0xDF92) ++#define p_reg_ir_out_th7_7_0 0xDF92 ++#define reg_ir_out_th7_7_0_pos 0 ++#define reg_ir_out_th7_7_0_len 8 ++#define reg_ir_out_th7_7_0_lsb 0 ++#define xd_p_reg_ir_out_th7_14_8 (*(volatile byte xdata *) 0xDF93) ++#define p_reg_ir_out_th7_14_8 0xDF93 ++#define reg_ir_out_th7_14_8_pos 0 ++#define reg_ir_out_th7_14_8_len 7 ++#define reg_ir_out_th7_14_8_lsb 8 ++#define xd_p_reg_ir_out_th8_7_0 (*(volatile byte xdata *) 0xDF94) ++#define p_reg_ir_out_th8_7_0 0xDF94 ++#define reg_ir_out_th8_7_0_pos 0 ++#define reg_ir_out_th8_7_0_len 8 ++#define reg_ir_out_th8_7_0_lsb 0 ++#define xd_p_reg_ir_out_th8_14_8 (*(volatile byte xdata *) 0xDF95) ++#define p_reg_ir_out_th8_14_8 0xDF95 ++#define reg_ir_out_th8_14_8_pos 0 ++#define reg_ir_out_th8_14_8_len 7 ++#define reg_ir_out_th8_14_8_lsb 8 ++#define xd_p_reg_ir_out_th9_7_0 (*(volatile byte xdata *) 0xDF96) ++#define p_reg_ir_out_th9_7_0 0xDF96 ++#define reg_ir_out_th9_7_0_pos 0 ++#define reg_ir_out_th9_7_0_len 8 ++#define reg_ir_out_th9_7_0_lsb 0 ++#define xd_p_reg_ir_out_th9_14_8 (*(volatile byte xdata *) 0xDF97) ++#define p_reg_ir_out_th9_14_8 0xDF97 ++#define reg_ir_out_th9_14_8_pos 0 ++#define reg_ir_out_th9_14_8_len 7 ++#define reg_ir_out_th9_14_8_lsb 8 ++#define xd_p_reg_ir_out_th10_7_0 (*(volatile byte xdata *) 0xDF98) ++#define p_reg_ir_out_th10_7_0 0xDF98 ++#define reg_ir_out_th10_7_0_pos 0 ++#define reg_ir_out_th10_7_0_len 8 ++#define reg_ir_out_th10_7_0_lsb 0 ++#define xd_p_reg_ir_out_th10_14_8 (*(volatile byte xdata *) 0xDF99) ++#define p_reg_ir_out_th10_14_8 0xDF99 ++#define reg_ir_out_th10_14_8_pos 0 ++#define reg_ir_out_th10_14_8_len 7 ++#define reg_ir_out_th10_14_8_lsb 8 ++#define xd_p_reg_ir_out_th11_7_0 (*(volatile byte xdata *) 0xDF9A) ++#define p_reg_ir_out_th11_7_0 0xDF9A ++#define reg_ir_out_th11_7_0_pos 0 ++#define reg_ir_out_th11_7_0_len 8 ++#define reg_ir_out_th11_7_0_lsb 0 ++#define xd_p_reg_ir_out_th11_14_8 (*(volatile byte xdata *) 0xDF9B) ++#define p_reg_ir_out_th11_14_8 0xDF9B ++#define reg_ir_out_th11_14_8_pos 0 ++#define reg_ir_out_th11_14_8_len 7 ++#define reg_ir_out_th11_14_8_lsb 8 ++#define xd_p_reg_ir_out_th12_7_0 (*(volatile byte xdata *) 0xDF9C) ++#define p_reg_ir_out_th12_7_0 0xDF9C ++#define reg_ir_out_th12_7_0_pos 0 ++#define reg_ir_out_th12_7_0_len 8 ++#define reg_ir_out_th12_7_0_lsb 0 ++#define xd_p_reg_ir_out_th12_14_8 (*(volatile byte xdata *) 0xDF9D) ++#define p_reg_ir_out_th12_14_8 0xDF9D ++#define reg_ir_out_th12_14_8_pos 0 ++#define reg_ir_out_th12_14_8_len 7 ++#define reg_ir_out_th12_14_8_lsb 8 ++#define xd_p_reg_ir_out_th13_7_0 (*(volatile byte xdata *) 0xDF9E) ++#define p_reg_ir_out_th13_7_0 0xDF9E ++#define reg_ir_out_th13_7_0_pos 0 ++#define reg_ir_out_th13_7_0_len 8 ++#define reg_ir_out_th13_7_0_lsb 0 ++#define xd_p_reg_ir_out_th13_14_8 (*(volatile byte xdata *) 0xDF9F) ++#define p_reg_ir_out_th13_14_8 0xDF9F ++#define reg_ir_out_th13_14_8_pos 0 ++#define reg_ir_out_th13_14_8_len 7 ++#define reg_ir_out_th13_14_8_lsb 8 ++#define xd_p_reg_ir_out_th14_7_0 (*(volatile byte xdata *) 0xDFA0) ++#define p_reg_ir_out_th14_7_0 0xDFA0 ++#define reg_ir_out_th14_7_0_pos 0 ++#define reg_ir_out_th14_7_0_len 8 ++#define reg_ir_out_th14_7_0_lsb 0 ++#define xd_p_reg_ir_out_th14_14_8 (*(volatile byte xdata *) 0xDFA1) ++#define p_reg_ir_out_th14_14_8 0xDFA1 ++#define reg_ir_out_th14_14_8_pos 0 ++#define reg_ir_out_th14_14_8_len 7 ++#define reg_ir_out_th14_14_8_lsb 8 ++#define xd_p_reg_tuner_data_7_0 (*(volatile byte xdata *) 0xF000) ++#define p_reg_tuner_data_7_0 0xF000 ++#define reg_tuner_data_7_0_pos 0 ++#define reg_tuner_data_7_0_len 8 ++#define reg_tuner_data_7_0_lsb 0 ++#define xd_p_reg_tuner_data_15_8 (*(volatile byte xdata *) 0xF001) ++#define p_reg_tuner_data_15_8 0xF001 ++#define reg_tuner_data_15_8_pos 0 ++#define reg_tuner_data_15_8_len 8 ++#define reg_tuner_data_15_8_lsb 8 ++#define xd_p_reg_tuner_data_23_16 (*(volatile byte xdata *) 0xF002) ++#define p_reg_tuner_data_23_16 0xF002 ++#define reg_tuner_data_23_16_pos 0 ++#define reg_tuner_data_23_16_len 8 ++#define reg_tuner_data_23_16_lsb 16 ++#define xd_p_reg_tuner_data_31_24 (*(volatile byte xdata *) 0xF003) ++#define p_reg_tuner_data_31_24 0xF003 ++#define reg_tuner_data_31_24_pos 0 ++#define reg_tuner_data_31_24_len 8 ++#define reg_tuner_data_31_24_lsb 24 ++#define xd_p_reg_tuner_data_39_32 (*(volatile byte xdata *) 0xF004) ++#define p_reg_tuner_data_39_32 0xF004 ++#define reg_tuner_data_39_32_pos 0 ++#define reg_tuner_data_39_32_len 8 ++#define reg_tuner_data_39_32_lsb 32 ++#define xd_p_reg_tuner_data_47_40 (*(volatile byte xdata *) 0xF005) ++#define p_reg_tuner_data_47_40 0xF005 ++#define reg_tuner_data_47_40_pos 0 ++#define reg_tuner_data_47_40_len 8 ++#define reg_tuner_data_47_40_lsb 40 ++#define xd_p_reg_tuner_data_55_48 (*(volatile byte xdata *) 0xF006) ++#define p_reg_tuner_data_55_48 0xF006 ++#define reg_tuner_data_55_48_pos 0 ++#define reg_tuner_data_55_48_len 8 ++#define reg_tuner_data_55_48_lsb 48 ++#define xd_p_reg_tuner_data_63_56 (*(volatile byte xdata *) 0xF007) ++#define p_reg_tuner_data_63_56 0xF007 ++#define reg_tuner_data_63_56_pos 0 ++#define reg_tuner_data_63_56_len 8 ++#define reg_tuner_data_63_56_lsb 56 ++#define xd_p_reg_tuner_data_71_64 (*(volatile byte xdata *) 0xF008) ++#define p_reg_tuner_data_71_64 0xF008 ++#define reg_tuner_data_71_64_pos 0 ++#define reg_tuner_data_71_64_len 8 ++#define reg_tuner_data_71_64_lsb 64 ++#define xd_p_reg_tuner_data_79_72 (*(volatile byte xdata *) 0xF009) ++#define p_reg_tuner_data_79_72 0xF009 ++#define reg_tuner_data_79_72_pos 0 ++#define reg_tuner_data_79_72_len 8 ++#define reg_tuner_data_79_72_lsb 72 ++#define xd_p_reg_tuner_data_87_80 (*(volatile byte xdata *) 0xF00A) ++#define p_reg_tuner_data_87_80 0xF00A ++#define reg_tuner_data_87_80_pos 0 ++#define reg_tuner_data_87_80_len 8 ++#define reg_tuner_data_87_80_lsb 80 ++#define xd_p_reg_tuner_data_95_88 (*(volatile byte xdata *) 0xF00B) ++#define p_reg_tuner_data_95_88 0xF00B ++#define reg_tuner_data_95_88_pos 0 ++#define reg_tuner_data_95_88_len 8 ++#define reg_tuner_data_95_88_lsb 88 ++#define xd_p_reg_tuner_data_103_96 (*(volatile byte xdata *) 0xF00C) ++#define p_reg_tuner_data_103_96 0xF00C ++#define reg_tuner_data_103_96_pos 0 ++#define reg_tuner_data_103_96_len 8 ++#define reg_tuner_data_103_96_lsb 96 ++#define xd_p_reg_tuner_data_111_104 (*(volatile byte xdata *) 0xF00D) ++#define p_reg_tuner_data_111_104 0xF00D ++#define reg_tuner_data_111_104_pos 0 ++#define reg_tuner_data_111_104_len 8 ++#define reg_tuner_data_111_104_lsb 104 ++#define xd_p_reg_tuner_data_119_112 (*(volatile byte xdata *) 0xF00E) ++#define p_reg_tuner_data_119_112 0xF00E ++#define reg_tuner_data_119_112_pos 0 ++#define reg_tuner_data_119_112_len 8 ++#define reg_tuner_data_119_112_lsb 112 ++#define xd_p_reg_tuner_data_127_120 (*(volatile byte xdata *) 0xF00F) ++#define p_reg_tuner_data_127_120 0xF00F ++#define reg_tuner_data_127_120_pos 0 ++#define reg_tuner_data_127_120_len 8 ++#define reg_tuner_data_127_120_lsb 120 ++#define xd_p_reg_tuner_data_135_128 (*(volatile byte xdata *) 0xF010) ++#define p_reg_tuner_data_135_128 0xF010 ++#define reg_tuner_data_135_128_pos 0 ++#define reg_tuner_data_135_128_len 8 ++#define reg_tuner_data_135_128_lsb 128 ++#define xd_p_reg_tuner_data_143_136 (*(volatile byte xdata *) 0xF011) ++#define p_reg_tuner_data_143_136 0xF011 ++#define reg_tuner_data_143_136_pos 0 ++#define reg_tuner_data_143_136_len 8 ++#define reg_tuner_data_143_136_lsb 136 ++#define xd_p_reg_tuner_data_151_144 (*(volatile byte xdata *) 0xF012) ++#define p_reg_tuner_data_151_144 0xF012 ++#define reg_tuner_data_151_144_pos 0 ++#define reg_tuner_data_151_144_len 8 ++#define reg_tuner_data_151_144_lsb 144 ++#define xd_p_reg_tuner_data_159_152 (*(volatile byte xdata *) 0xF013) ++#define p_reg_tuner_data_159_152 0xF013 ++#define reg_tuner_data_159_152_pos 0 ++#define reg_tuner_data_159_152_len 8 ++#define reg_tuner_data_159_152_lsb 152 ++#define xd_p_reg_tuner_data_167_160 (*(volatile byte xdata *) 0xF014) ++#define p_reg_tuner_data_167_160 0xF014 ++#define reg_tuner_data_167_160_pos 0 ++#define reg_tuner_data_167_160_len 8 ++#define reg_tuner_data_167_160_lsb 160 ++#define xd_p_reg_tuner_data_175_168 (*(volatile byte xdata *) 0xF015) ++#define p_reg_tuner_data_175_168 0xF015 ++#define reg_tuner_data_175_168_pos 0 ++#define reg_tuner_data_175_168_len 8 ++#define reg_tuner_data_175_168_lsb 168 ++#define xd_p_reg_tuner_data_183_176 (*(volatile byte xdata *) 0xF016) ++#define p_reg_tuner_data_183_176 0xF016 ++#define reg_tuner_data_183_176_pos 0 ++#define reg_tuner_data_183_176_len 8 ++#define reg_tuner_data_183_176_lsb 176 ++#define xd_p_reg_tuner_data_191_184 (*(volatile byte xdata *) 0xF017) ++#define p_reg_tuner_data_191_184 0xF017 ++#define reg_tuner_data_191_184_pos 0 ++#define reg_tuner_data_191_184_len 8 ++#define reg_tuner_data_191_184_lsb 184 ++#define xd_p_reg_tuner_data_199_192 (*(volatile byte xdata *) 0xF018) ++#define p_reg_tuner_data_199_192 0xF018 ++#define reg_tuner_data_199_192_pos 0 ++#define reg_tuner_data_199_192_len 8 ++#define reg_tuner_data_199_192_lsb 192 ++#define xd_p_reg_tuner_data_207_200 (*(volatile byte xdata *) 0xF019) ++#define p_reg_tuner_data_207_200 0xF019 ++#define reg_tuner_data_207_200_pos 0 ++#define reg_tuner_data_207_200_len 8 ++#define reg_tuner_data_207_200_lsb 200 ++#define xd_p_reg_tuner_data_215_208 (*(volatile byte xdata *) 0xF01A) ++#define p_reg_tuner_data_215_208 0xF01A ++#define reg_tuner_data_215_208_pos 0 ++#define reg_tuner_data_215_208_len 8 ++#define reg_tuner_data_215_208_lsb 208 ++#define xd_p_reg_tuner_data_223_216 (*(volatile byte xdata *) 0xF01B) ++#define p_reg_tuner_data_223_216 0xF01B ++#define reg_tuner_data_223_216_pos 0 ++#define reg_tuner_data_223_216_len 8 ++#define reg_tuner_data_223_216_lsb 216 ++#define xd_p_reg_tuner_data_231_224 (*(volatile byte xdata *) 0xF01C) ++#define p_reg_tuner_data_231_224 0xF01C ++#define reg_tuner_data_231_224_pos 0 ++#define reg_tuner_data_231_224_len 8 ++#define reg_tuner_data_231_224_lsb 224 ++#define xd_p_reg_tuner_data_239_232 (*(volatile byte xdata *) 0xF01D) ++#define p_reg_tuner_data_239_232 0xF01D ++#define reg_tuner_data_239_232_pos 0 ++#define reg_tuner_data_239_232_len 8 ++#define reg_tuner_data_239_232_lsb 232 ++#define xd_p_reg_tuner_data_247_240 (*(volatile byte xdata *) 0xF01E) ++#define p_reg_tuner_data_247_240 0xF01E ++#define reg_tuner_data_247_240_pos 0 ++#define reg_tuner_data_247_240_len 8 ++#define reg_tuner_data_247_240_lsb 240 ++#define xd_p_reg_tuner_data_255_248 (*(volatile byte xdata *) 0xF01F) ++#define p_reg_tuner_data_255_248 0xF01F ++#define reg_tuner_data_255_248_pos 0 ++#define reg_tuner_data_255_248_len 8 ++#define reg_tuner_data_255_248_lsb 248 ++#define xd_p_reg_tuner_data_263_256 (*(volatile byte xdata *) 0xF020) ++#define p_reg_tuner_data_263_256 0xF020 ++#define reg_tuner_data_263_256_pos 0 ++#define reg_tuner_data_263_256_len 8 ++#define reg_tuner_data_263_256_lsb 256 ++#define xd_p_reg_tuner_data_271_264 (*(volatile byte xdata *) 0xF021) ++#define p_reg_tuner_data_271_264 0xF021 ++#define reg_tuner_data_271_264_pos 0 ++#define reg_tuner_data_271_264_len 8 ++#define reg_tuner_data_271_264_lsb 264 ++#define xd_p_reg_tuner_data_279_272 (*(volatile byte xdata *) 0xF022) ++#define p_reg_tuner_data_279_272 0xF022 ++#define reg_tuner_data_279_272_pos 0 ++#define reg_tuner_data_279_272_len 8 ++#define reg_tuner_data_279_272_lsb 272 ++#define xd_p_reg_tuner_data_287_280 (*(volatile byte xdata *) 0xF023) ++#define p_reg_tuner_data_287_280 0xF023 ++#define reg_tuner_data_287_280_pos 0 ++#define reg_tuner_data_287_280_len 8 ++#define reg_tuner_data_287_280_lsb 280 ++#define xd_p_reg_tuner_data_295_288 (*(volatile byte xdata *) 0xF024) ++#define p_reg_tuner_data_295_288 0xF024 ++#define reg_tuner_data_295_288_pos 0 ++#define reg_tuner_data_295_288_len 8 ++#define reg_tuner_data_295_288_lsb 288 ++#define xd_p_reg_tuner_data_303_296 (*(volatile byte xdata *) 0xF025) ++#define p_reg_tuner_data_303_296 0xF025 ++#define reg_tuner_data_303_296_pos 0 ++#define reg_tuner_data_303_296_len 8 ++#define reg_tuner_data_303_296_lsb 296 ++#define xd_p_reg_tuner_data_311_304 (*(volatile byte xdata *) 0xF026) ++#define p_reg_tuner_data_311_304 0xF026 ++#define reg_tuner_data_311_304_pos 0 ++#define reg_tuner_data_311_304_len 8 ++#define reg_tuner_data_311_304_lsb 304 ++#define xd_p_reg_tuner_data_319_312 (*(volatile byte xdata *) 0xF027) ++#define p_reg_tuner_data_319_312 0xF027 ++#define reg_tuner_data_319_312_pos 0 ++#define reg_tuner_data_319_312_len 8 ++#define reg_tuner_data_319_312_lsb 312 ++#define xd_p_reg_tuner_data_327_320 (*(volatile byte xdata *) 0xF028) ++#define p_reg_tuner_data_327_320 0xF028 ++#define reg_tuner_data_327_320_pos 0 ++#define reg_tuner_data_327_320_len 8 ++#define reg_tuner_data_327_320_lsb 320 ++#define xd_p_reg_tuner_data_335_328 (*(volatile byte xdata *) 0xF029) ++#define p_reg_tuner_data_335_328 0xF029 ++#define reg_tuner_data_335_328_pos 0 ++#define reg_tuner_data_335_328_len 8 ++#define reg_tuner_data_335_328_lsb 328 ++#define xd_p_reg_tuner_data_343_336 (*(volatile byte xdata *) 0xF02A) ++#define p_reg_tuner_data_343_336 0xF02A ++#define reg_tuner_data_343_336_pos 0 ++#define reg_tuner_data_343_336_len 8 ++#define reg_tuner_data_343_336_lsb 336 ++#define xd_p_reg_tuner_data_351_344 (*(volatile byte xdata *) 0xF02B) ++#define p_reg_tuner_data_351_344 0xF02B ++#define reg_tuner_data_351_344_pos 0 ++#define reg_tuner_data_351_344_len 8 ++#define reg_tuner_data_351_344_lsb 344 ++#define xd_p_reg_tuner_data_359_352 (*(volatile byte xdata *) 0xF02C) ++#define p_reg_tuner_data_359_352 0xF02C ++#define reg_tuner_data_359_352_pos 0 ++#define reg_tuner_data_359_352_len 8 ++#define reg_tuner_data_359_352_lsb 352 ++#define xd_p_reg_tuner_data_367_360 (*(volatile byte xdata *) 0xF02D) ++#define p_reg_tuner_data_367_360 0xF02D ++#define reg_tuner_data_367_360_pos 0 ++#define reg_tuner_data_367_360_len 8 ++#define reg_tuner_data_367_360_lsb 360 ++#define xd_p_reg_tuner_data_375_368 (*(volatile byte xdata *) 0xF02E) ++#define p_reg_tuner_data_375_368 0xF02E ++#define reg_tuner_data_375_368_pos 0 ++#define reg_tuner_data_375_368_len 8 ++#define reg_tuner_data_375_368_lsb 368 ++#define xd_p_reg_tuner_data_383_376 (*(volatile byte xdata *) 0xF02F) ++#define p_reg_tuner_data_383_376 0xF02F ++#define reg_tuner_data_383_376_pos 0 ++#define reg_tuner_data_383_376_len 8 ++#define reg_tuner_data_383_376_lsb 376 ++#define xd_p_reg_tuner_data_391_384 (*(volatile byte xdata *) 0xF030) ++#define p_reg_tuner_data_391_384 0xF030 ++#define reg_tuner_data_391_384_pos 0 ++#define reg_tuner_data_391_384_len 8 ++#define reg_tuner_data_391_384_lsb 384 ++#define xd_p_reg_tuner_data_399_392 (*(volatile byte xdata *) 0xF031) ++#define p_reg_tuner_data_399_392 0xF031 ++#define reg_tuner_data_399_392_pos 0 ++#define reg_tuner_data_399_392_len 8 ++#define reg_tuner_data_399_392_lsb 392 ++#define xd_p_reg_tuner_data_407_400 (*(volatile byte xdata *) 0xF032) ++#define p_reg_tuner_data_407_400 0xF032 ++#define reg_tuner_data_407_400_pos 0 ++#define reg_tuner_data_407_400_len 8 ++#define reg_tuner_data_407_400_lsb 400 ++#define xd_p_reg_tuner_data_415_408 (*(volatile byte xdata *) 0xF033) ++#define p_reg_tuner_data_415_408 0xF033 ++#define reg_tuner_data_415_408_pos 0 ++#define reg_tuner_data_415_408_len 8 ++#define reg_tuner_data_415_408_lsb 408 ++#define xd_p_reg_tuner_data_423_416 (*(volatile byte xdata *) 0xF034) ++#define p_reg_tuner_data_423_416 0xF034 ++#define reg_tuner_data_423_416_pos 0 ++#define reg_tuner_data_423_416_len 8 ++#define reg_tuner_data_423_416_lsb 416 ++#define xd_p_reg_tuner_data_431_424 (*(volatile byte xdata *) 0xF035) ++#define p_reg_tuner_data_431_424 0xF035 ++#define reg_tuner_data_431_424_pos 0 ++#define reg_tuner_data_431_424_len 8 ++#define reg_tuner_data_431_424_lsb 424 ++#define xd_p_reg_tuner_data_439_432 (*(volatile byte xdata *) 0xF036) ++#define p_reg_tuner_data_439_432 0xF036 ++#define reg_tuner_data_439_432_pos 0 ++#define reg_tuner_data_439_432_len 8 ++#define reg_tuner_data_439_432_lsb 432 ++#define xd_p_reg_tuner_data_447_440 (*(volatile byte xdata *) 0xF037) ++#define p_reg_tuner_data_447_440 0xF037 ++#define reg_tuner_data_447_440_pos 0 ++#define reg_tuner_data_447_440_len 8 ++#define reg_tuner_data_447_440_lsb 440 ++#define xd_p_reg_tuner_data_455_448 (*(volatile byte xdata *) 0xF038) ++#define p_reg_tuner_data_455_448 0xF038 ++#define reg_tuner_data_455_448_pos 0 ++#define reg_tuner_data_455_448_len 8 ++#define reg_tuner_data_455_448_lsb 448 ++#define xd_p_reg_tuner_data_463_456 (*(volatile byte xdata *) 0xF039) ++#define p_reg_tuner_data_463_456 0xF039 ++#define reg_tuner_data_463_456_pos 0 ++#define reg_tuner_data_463_456_len 8 ++#define reg_tuner_data_463_456_lsb 456 ++#define xd_p_reg_tuner_data_471_464 (*(volatile byte xdata *) 0xF03A) ++#define p_reg_tuner_data_471_464 0xF03A ++#define reg_tuner_data_471_464_pos 0 ++#define reg_tuner_data_471_464_len 8 ++#define reg_tuner_data_471_464_lsb 464 ++#define xd_p_reg_tuner_data_479_472 (*(volatile byte xdata *) 0xF03B) ++#define p_reg_tuner_data_479_472 0xF03B ++#define reg_tuner_data_479_472_pos 0 ++#define reg_tuner_data_479_472_len 8 ++#define reg_tuner_data_479_472_lsb 472 ++#define xd_p_reg_tuner_data_487_480 (*(volatile byte xdata *) 0xF03C) ++#define p_reg_tuner_data_487_480 0xF03C ++#define reg_tuner_data_487_480_pos 0 ++#define reg_tuner_data_487_480_len 8 ++#define reg_tuner_data_487_480_lsb 480 ++#define xd_p_reg_tuner_data_495_488 (*(volatile byte xdata *) 0xF03D) ++#define p_reg_tuner_data_495_488 0xF03D ++#define reg_tuner_data_495_488_pos 0 ++#define reg_tuner_data_495_488_len 8 ++#define reg_tuner_data_495_488_lsb 488 ++#define xd_p_reg_tuner_data_503_496 (*(volatile byte xdata *) 0xF03E) ++#define p_reg_tuner_data_503_496 0xF03E ++#define reg_tuner_data_503_496_pos 0 ++#define reg_tuner_data_503_496_len 8 ++#define reg_tuner_data_503_496_lsb 496 ++#define xd_p_reg_tuner_data_511_504 (*(volatile byte xdata *) 0xF03F) ++#define p_reg_tuner_data_511_504 0xF03F ++#define reg_tuner_data_511_504_pos 0 ++#define reg_tuner_data_511_504_len 8 ++#define reg_tuner_data_511_504_lsb 504 ++#define xd_p_reg_tuner_data_519_512 (*(volatile byte xdata *) 0xF040) ++#define p_reg_tuner_data_519_512 0xF040 ++#define reg_tuner_data_519_512_pos 0 ++#define reg_tuner_data_519_512_len 8 ++#define reg_tuner_data_519_512_lsb 512 ++#define xd_p_reg_tuner_data_527_520 (*(volatile byte xdata *) 0xF041) ++#define p_reg_tuner_data_527_520 0xF041 ++#define reg_tuner_data_527_520_pos 0 ++#define reg_tuner_data_527_520_len 8 ++#define reg_tuner_data_527_520_lsb 520 ++#define xd_p_reg_tuner_data_535_528 (*(volatile byte xdata *) 0xF042) ++#define p_reg_tuner_data_535_528 0xF042 ++#define reg_tuner_data_535_528_pos 0 ++#define reg_tuner_data_535_528_len 8 ++#define reg_tuner_data_535_528_lsb 528 ++#define xd_p_reg_tuner_data_543_536 (*(volatile byte xdata *) 0xF043) ++#define p_reg_tuner_data_543_536 0xF043 ++#define reg_tuner_data_543_536_pos 0 ++#define reg_tuner_data_543_536_len 8 ++#define reg_tuner_data_543_536_lsb 536 ++#define xd_p_reg_tuner_data_551_544 (*(volatile byte xdata *) 0xF044) ++#define p_reg_tuner_data_551_544 0xF044 ++#define reg_tuner_data_551_544_pos 0 ++#define reg_tuner_data_551_544_len 8 ++#define reg_tuner_data_551_544_lsb 544 ++#define xd_p_reg_tuner_data_559_552 (*(volatile byte xdata *) 0xF045) ++#define p_reg_tuner_data_559_552 0xF045 ++#define reg_tuner_data_559_552_pos 0 ++#define reg_tuner_data_559_552_len 8 ++#define reg_tuner_data_559_552_lsb 552 ++#define xd_p_reg_tuner_data_567_560 (*(volatile byte xdata *) 0xF046) ++#define p_reg_tuner_data_567_560 0xF046 ++#define reg_tuner_data_567_560_pos 0 ++#define reg_tuner_data_567_560_len 8 ++#define reg_tuner_data_567_560_lsb 560 ++#define xd_p_reg_tuner_data_575_568 (*(volatile byte xdata *) 0xF047) ++#define p_reg_tuner_data_575_568 0xF047 ++#define reg_tuner_data_575_568_pos 0 ++#define reg_tuner_data_575_568_len 8 ++#define reg_tuner_data_575_568_lsb 568 ++#define xd_p_reg_tuner_data_583_576 (*(volatile byte xdata *) 0xF048) ++#define p_reg_tuner_data_583_576 0xF048 ++#define reg_tuner_data_583_576_pos 0 ++#define reg_tuner_data_583_576_len 8 ++#define reg_tuner_data_583_576_lsb 576 ++#define xd_p_reg_tuner_data_591_584 (*(volatile byte xdata *) 0xF049) ++#define p_reg_tuner_data_591_584 0xF049 ++#define reg_tuner_data_591_584_pos 0 ++#define reg_tuner_data_591_584_len 8 ++#define reg_tuner_data_591_584_lsb 584 ++#define xd_p_reg_tuner_data_599_592 (*(volatile byte xdata *) 0xF04A) ++#define p_reg_tuner_data_599_592 0xF04A ++#define reg_tuner_data_599_592_pos 0 ++#define reg_tuner_data_599_592_len 8 ++#define reg_tuner_data_599_592_lsb 592 ++#define xd_p_reg_tuner_data_607_600 (*(volatile byte xdata *) 0xF04B) ++#define p_reg_tuner_data_607_600 0xF04B ++#define reg_tuner_data_607_600_pos 0 ++#define reg_tuner_data_607_600_len 8 ++#define reg_tuner_data_607_600_lsb 600 ++#define xd_p_reg_tuner_data_615_608 (*(volatile byte xdata *) 0xF04C) ++#define p_reg_tuner_data_615_608 0xF04C ++#define reg_tuner_data_615_608_pos 0 ++#define reg_tuner_data_615_608_len 8 ++#define reg_tuner_data_615_608_lsb 608 ++#define xd_p_reg_tuner_data_623_616 (*(volatile byte xdata *) 0xF04D) ++#define p_reg_tuner_data_623_616 0xF04D ++#define reg_tuner_data_623_616_pos 0 ++#define reg_tuner_data_623_616_len 8 ++#define reg_tuner_data_623_616_lsb 616 ++#define xd_p_reg_tuner_data_631_624 (*(volatile byte xdata *) 0xF04E) ++#define p_reg_tuner_data_631_624 0xF04E ++#define reg_tuner_data_631_624_pos 0 ++#define reg_tuner_data_631_624_len 8 ++#define reg_tuner_data_631_624_lsb 624 ++#define xd_p_reg_tuner_data_639_632 (*(volatile byte xdata *) 0xF04F) ++#define p_reg_tuner_data_639_632 0xF04F ++#define reg_tuner_data_639_632_pos 0 ++#define reg_tuner_data_639_632_len 8 ++#define reg_tuner_data_639_632_lsb 632 ++#define xd_p_reg_tuner_data_647_640 (*(volatile byte xdata *) 0xF050) ++#define p_reg_tuner_data_647_640 0xF050 ++#define reg_tuner_data_647_640_pos 0 ++#define reg_tuner_data_647_640_len 8 ++#define reg_tuner_data_647_640_lsb 640 ++#define xd_p_reg_tuner_data_655_648 (*(volatile byte xdata *) 0xF051) ++#define p_reg_tuner_data_655_648 0xF051 ++#define reg_tuner_data_655_648_pos 0 ++#define reg_tuner_data_655_648_len 8 ++#define reg_tuner_data_655_648_lsb 648 ++#define xd_p_reg_tuner_data_663_656 (*(volatile byte xdata *) 0xF052) ++#define p_reg_tuner_data_663_656 0xF052 ++#define reg_tuner_data_663_656_pos 0 ++#define reg_tuner_data_663_656_len 8 ++#define reg_tuner_data_663_656_lsb 656 ++#define xd_p_reg_tuner_data_671_664 (*(volatile byte xdata *) 0xF053) ++#define p_reg_tuner_data_671_664 0xF053 ++#define reg_tuner_data_671_664_pos 0 ++#define reg_tuner_data_671_664_len 8 ++#define reg_tuner_data_671_664_lsb 664 ++#define xd_p_reg_tuner_data_679_672 (*(volatile byte xdata *) 0xF054) ++#define p_reg_tuner_data_679_672 0xF054 ++#define reg_tuner_data_679_672_pos 0 ++#define reg_tuner_data_679_672_len 8 ++#define reg_tuner_data_679_672_lsb 672 ++#define xd_p_reg_tuner_data_687_680 (*(volatile byte xdata *) 0xF055) ++#define p_reg_tuner_data_687_680 0xF055 ++#define reg_tuner_data_687_680_pos 0 ++#define reg_tuner_data_687_680_len 8 ++#define reg_tuner_data_687_680_lsb 680 ++#define xd_p_reg_tuner_data_695_688 (*(volatile byte xdata *) 0xF056) ++#define p_reg_tuner_data_695_688 0xF056 ++#define reg_tuner_data_695_688_pos 0 ++#define reg_tuner_data_695_688_len 8 ++#define reg_tuner_data_695_688_lsb 688 ++#define xd_p_reg_tuner_data_703_696 (*(volatile byte xdata *) 0xF057) ++#define p_reg_tuner_data_703_696 0xF057 ++#define reg_tuner_data_703_696_pos 0 ++#define reg_tuner_data_703_696_len 8 ++#define reg_tuner_data_703_696_lsb 696 ++#define xd_p_reg_tuner_data_711_704 (*(volatile byte xdata *) 0xF058) ++#define p_reg_tuner_data_711_704 0xF058 ++#define reg_tuner_data_711_704_pos 0 ++#define reg_tuner_data_711_704_len 8 ++#define reg_tuner_data_711_704_lsb 704 ++#define xd_p_reg_tuner_data_719_712 (*(volatile byte xdata *) 0xF059) ++#define p_reg_tuner_data_719_712 0xF059 ++#define reg_tuner_data_719_712_pos 0 ++#define reg_tuner_data_719_712_len 8 ++#define reg_tuner_data_719_712_lsb 712 ++#define xd_p_reg_tuner_data_727_720 (*(volatile byte xdata *) 0xF05A) ++#define p_reg_tuner_data_727_720 0xF05A ++#define reg_tuner_data_727_720_pos 0 ++#define reg_tuner_data_727_720_len 8 ++#define reg_tuner_data_727_720_lsb 720 ++#define xd_p_reg_tuner_data_735_728 (*(volatile byte xdata *) 0xF05B) ++#define p_reg_tuner_data_735_728 0xF05B ++#define reg_tuner_data_735_728_pos 0 ++#define reg_tuner_data_735_728_len 8 ++#define reg_tuner_data_735_728_lsb 728 ++#define xd_p_reg_tuner_data_743_736 (*(volatile byte xdata *) 0xF05C) ++#define p_reg_tuner_data_743_736 0xF05C ++#define reg_tuner_data_743_736_pos 0 ++#define reg_tuner_data_743_736_len 8 ++#define reg_tuner_data_743_736_lsb 736 ++#define xd_p_reg_tuner_data_751_744 (*(volatile byte xdata *) 0xF05D) ++#define p_reg_tuner_data_751_744 0xF05D ++#define reg_tuner_data_751_744_pos 0 ++#define reg_tuner_data_751_744_len 8 ++#define reg_tuner_data_751_744_lsb 744 ++#define xd_p_reg_tuner_data_759_752 (*(volatile byte xdata *) 0xF05E) ++#define p_reg_tuner_data_759_752 0xF05E ++#define reg_tuner_data_759_752_pos 0 ++#define reg_tuner_data_759_752_len 8 ++#define reg_tuner_data_759_752_lsb 752 ++#define xd_p_reg_tuner_data_767_760 (*(volatile byte xdata *) 0xF05F) ++#define p_reg_tuner_data_767_760 0xF05F ++#define reg_tuner_data_767_760_pos 0 ++#define reg_tuner_data_767_760_len 8 ++#define reg_tuner_data_767_760_lsb 760 ++#define xd_p_reg_tuner_data_775_768 (*(volatile byte xdata *) 0xF060) ++#define p_reg_tuner_data_775_768 0xF060 ++#define reg_tuner_data_775_768_pos 0 ++#define reg_tuner_data_775_768_len 8 ++#define reg_tuner_data_775_768_lsb 768 ++#define xd_p_reg_tuner_data_783_776 (*(volatile byte xdata *) 0xF061) ++#define p_reg_tuner_data_783_776 0xF061 ++#define reg_tuner_data_783_776_pos 0 ++#define reg_tuner_data_783_776_len 8 ++#define reg_tuner_data_783_776_lsb 776 ++#define xd_p_reg_tuner_data_791_784 (*(volatile byte xdata *) 0xF062) ++#define p_reg_tuner_data_791_784 0xF062 ++#define reg_tuner_data_791_784_pos 0 ++#define reg_tuner_data_791_784_len 8 ++#define reg_tuner_data_791_784_lsb 784 ++#define xd_p_reg_tuner_data_799_792 (*(volatile byte xdata *) 0xF063) ++#define p_reg_tuner_data_799_792 0xF063 ++#define reg_tuner_data_799_792_pos 0 ++#define reg_tuner_data_799_792_len 8 ++#define reg_tuner_data_799_792_lsb 792 ++#define xd_p_reg_tuner_data_807_800 (*(volatile byte xdata *) 0xF064) ++#define p_reg_tuner_data_807_800 0xF064 ++#define reg_tuner_data_807_800_pos 0 ++#define reg_tuner_data_807_800_len 8 ++#define reg_tuner_data_807_800_lsb 800 ++#define xd_p_reg_tuner_data_815_808 (*(volatile byte xdata *) 0xF065) ++#define p_reg_tuner_data_815_808 0xF065 ++#define reg_tuner_data_815_808_pos 0 ++#define reg_tuner_data_815_808_len 8 ++#define reg_tuner_data_815_808_lsb 808 ++#define xd_p_reg_tuner_data_823_816 (*(volatile byte xdata *) 0xF066) ++#define p_reg_tuner_data_823_816 0xF066 ++#define reg_tuner_data_823_816_pos 0 ++#define reg_tuner_data_823_816_len 8 ++#define reg_tuner_data_823_816_lsb 816 ++#define xd_p_reg_tuner_data_831_824 (*(volatile byte xdata *) 0xF067) ++#define p_reg_tuner_data_831_824 0xF067 ++#define reg_tuner_data_831_824_pos 0 ++#define reg_tuner_data_831_824_len 8 ++#define reg_tuner_data_831_824_lsb 824 ++#define xd_p_reg_tuner_data_839_832 (*(volatile byte xdata *) 0xF068) ++#define p_reg_tuner_data_839_832 0xF068 ++#define reg_tuner_data_839_832_pos 0 ++#define reg_tuner_data_839_832_len 8 ++#define reg_tuner_data_839_832_lsb 832 ++#define xd_p_reg_tuner_data_847_840 (*(volatile byte xdata *) 0xF069) ++#define p_reg_tuner_data_847_840 0xF069 ++#define reg_tuner_data_847_840_pos 0 ++#define reg_tuner_data_847_840_len 8 ++#define reg_tuner_data_847_840_lsb 840 ++#define xd_p_reg_tuner_data_855_848 (*(volatile byte xdata *) 0xF06A) ++#define p_reg_tuner_data_855_848 0xF06A ++#define reg_tuner_data_855_848_pos 0 ++#define reg_tuner_data_855_848_len 8 ++#define reg_tuner_data_855_848_lsb 848 ++#define xd_p_reg_tuner_data_863_856 (*(volatile byte xdata *) 0xF06B) ++#define p_reg_tuner_data_863_856 0xF06B ++#define reg_tuner_data_863_856_pos 0 ++#define reg_tuner_data_863_856_len 8 ++#define reg_tuner_data_863_856_lsb 856 ++#define xd_p_reg_tuner_data_871_864 (*(volatile byte xdata *) 0xF06C) ++#define p_reg_tuner_data_871_864 0xF06C ++#define reg_tuner_data_871_864_pos 0 ++#define reg_tuner_data_871_864_len 8 ++#define reg_tuner_data_871_864_lsb 864 ++#define xd_p_reg_tuner_data_879_872 (*(volatile byte xdata *) 0xF06D) ++#define p_reg_tuner_data_879_872 0xF06D ++#define reg_tuner_data_879_872_pos 0 ++#define reg_tuner_data_879_872_len 8 ++#define reg_tuner_data_879_872_lsb 872 ++#define xd_p_reg_tuner_data_887_880 (*(volatile byte xdata *) 0xF06E) ++#define p_reg_tuner_data_887_880 0xF06E ++#define reg_tuner_data_887_880_pos 0 ++#define reg_tuner_data_887_880_len 8 ++#define reg_tuner_data_887_880_lsb 880 ++#define xd_p_reg_tuner_data_895_888 (*(volatile byte xdata *) 0xF06F) ++#define p_reg_tuner_data_895_888 0xF06F ++#define reg_tuner_data_895_888_pos 0 ++#define reg_tuner_data_895_888_len 8 ++#define reg_tuner_data_895_888_lsb 888 ++#define xd_p_reg_tuner_data_903_896 (*(volatile byte xdata *) 0xF070) ++#define p_reg_tuner_data_903_896 0xF070 ++#define reg_tuner_data_903_896_pos 0 ++#define reg_tuner_data_903_896_len 8 ++#define reg_tuner_data_903_896_lsb 896 ++#define xd_p_reg_tuner_data_911_904 (*(volatile byte xdata *) 0xF071) ++#define p_reg_tuner_data_911_904 0xF071 ++#define reg_tuner_data_911_904_pos 0 ++#define reg_tuner_data_911_904_len 8 ++#define reg_tuner_data_911_904_lsb 904 ++#define xd_p_reg_tuner_data_919_912 (*(volatile byte xdata *) 0xF072) ++#define p_reg_tuner_data_919_912 0xF072 ++#define reg_tuner_data_919_912_pos 0 ++#define reg_tuner_data_919_912_len 8 ++#define reg_tuner_data_919_912_lsb 912 ++#define xd_p_reg_tuner_data_927_920 (*(volatile byte xdata *) 0xF073) ++#define p_reg_tuner_data_927_920 0xF073 ++#define reg_tuner_data_927_920_pos 0 ++#define reg_tuner_data_927_920_len 8 ++#define reg_tuner_data_927_920_lsb 920 ++#define xd_p_reg_tuner_data_935_928 (*(volatile byte xdata *) 0xF074) ++#define p_reg_tuner_data_935_928 0xF074 ++#define reg_tuner_data_935_928_pos 0 ++#define reg_tuner_data_935_928_len 8 ++#define reg_tuner_data_935_928_lsb 928 ++#define xd_p_reg_tuner_data_943_936 (*(volatile byte xdata *) 0xF075) ++#define p_reg_tuner_data_943_936 0xF075 ++#define reg_tuner_data_943_936_pos 0 ++#define reg_tuner_data_943_936_len 8 ++#define reg_tuner_data_943_936_lsb 936 ++#define xd_p_reg_tuner_data_951_944 (*(volatile byte xdata *) 0xF076) ++#define p_reg_tuner_data_951_944 0xF076 ++#define reg_tuner_data_951_944_pos 0 ++#define reg_tuner_data_951_944_len 8 ++#define reg_tuner_data_951_944_lsb 944 ++#define xd_p_reg_tuner_data_959_952 (*(volatile byte xdata *) 0xF077) ++#define p_reg_tuner_data_959_952 0xF077 ++#define reg_tuner_data_959_952_pos 0 ++#define reg_tuner_data_959_952_len 8 ++#define reg_tuner_data_959_952_lsb 952 ++#define xd_p_reg_tuner_data_967_960 (*(volatile byte xdata *) 0xF078) ++#define p_reg_tuner_data_967_960 0xF078 ++#define reg_tuner_data_967_960_pos 0 ++#define reg_tuner_data_967_960_len 8 ++#define reg_tuner_data_967_960_lsb 960 ++#define xd_p_reg_tuner_data_975_968 (*(volatile byte xdata *) 0xF079) ++#define p_reg_tuner_data_975_968 0xF079 ++#define reg_tuner_data_975_968_pos 0 ++#define reg_tuner_data_975_968_len 8 ++#define reg_tuner_data_975_968_lsb 968 ++#define xd_p_reg_tuner_data_983_976 (*(volatile byte xdata *) 0xF07A) ++#define p_reg_tuner_data_983_976 0xF07A ++#define reg_tuner_data_983_976_pos 0 ++#define reg_tuner_data_983_976_len 8 ++#define reg_tuner_data_983_976_lsb 976 ++#define xd_p_reg_tuner_data_991_984 (*(volatile byte xdata *) 0xF07B) ++#define p_reg_tuner_data_991_984 0xF07B ++#define reg_tuner_data_991_984_pos 0 ++#define reg_tuner_data_991_984_len 8 ++#define reg_tuner_data_991_984_lsb 984 ++#define xd_p_reg_tuner_data_999_992 (*(volatile byte xdata *) 0xF07C) ++#define p_reg_tuner_data_999_992 0xF07C ++#define reg_tuner_data_999_992_pos 0 ++#define reg_tuner_data_999_992_len 8 ++#define reg_tuner_data_999_992_lsb 992 ++#define xd_p_reg_tuner_data_1007_1000 (*(volatile byte xdata *) 0xF07D) ++#define p_reg_tuner_data_1007_1000 0xF07D ++#define reg_tuner_data_1007_1000_pos 0 ++#define reg_tuner_data_1007_1000_len 8 ++#define reg_tuner_data_1007_1000_lsb 1000 ++#define xd_p_reg_tuner_data_1015_1008 (*(volatile byte xdata *) 0xF07E) ++#define p_reg_tuner_data_1015_1008 0xF07E ++#define reg_tuner_data_1015_1008_pos 0 ++#define reg_tuner_data_1015_1008_len 8 ++#define reg_tuner_data_1015_1008_lsb 1008 ++#define xd_p_reg_tuner_data_1023_1016 (*(volatile byte xdata *) 0xF07F) ++#define p_reg_tuner_data_1023_1016 0xF07F ++#define reg_tuner_data_1023_1016_pos 0 ++#define reg_tuner_data_1023_1016_len 8 ++#define reg_tuner_data_1023_1016_lsb 1016 ++#define xd_p_reg_tuner_data_1031_1024 (*(volatile byte xdata *) 0xF080) ++#define p_reg_tuner_data_1031_1024 0xF080 ++#define reg_tuner_data_1031_1024_pos 0 ++#define reg_tuner_data_1031_1024_len 8 ++#define reg_tuner_data_1031_1024_lsb 1024 ++#define xd_p_reg_tuner_data_1039_1032 (*(volatile byte xdata *) 0xF081) ++#define p_reg_tuner_data_1039_1032 0xF081 ++#define reg_tuner_data_1039_1032_pos 0 ++#define reg_tuner_data_1039_1032_len 8 ++#define reg_tuner_data_1039_1032_lsb 1032 ++#define xd_p_reg_tuner_data_1047_1040 (*(volatile byte xdata *) 0xF082) ++#define p_reg_tuner_data_1047_1040 0xF082 ++#define reg_tuner_data_1047_1040_pos 0 ++#define reg_tuner_data_1047_1040_len 8 ++#define reg_tuner_data_1047_1040_lsb 1040 ++#define xd_p_reg_tuner_data_1055_1048 (*(volatile byte xdata *) 0xF083) ++#define p_reg_tuner_data_1055_1048 0xF083 ++#define reg_tuner_data_1055_1048_pos 0 ++#define reg_tuner_data_1055_1048_len 8 ++#define reg_tuner_data_1055_1048_lsb 1048 ++#define xd_p_reg_tuner_data_1063_1056 (*(volatile byte xdata *) 0xF084) ++#define p_reg_tuner_data_1063_1056 0xF084 ++#define reg_tuner_data_1063_1056_pos 0 ++#define reg_tuner_data_1063_1056_len 8 ++#define reg_tuner_data_1063_1056_lsb 1056 ++#define xd_p_reg_tuner_data_1071_1064 (*(volatile byte xdata *) 0xF085) ++#define p_reg_tuner_data_1071_1064 0xF085 ++#define reg_tuner_data_1071_1064_pos 0 ++#define reg_tuner_data_1071_1064_len 8 ++#define reg_tuner_data_1071_1064_lsb 1064 ++#define xd_p_reg_tuner_data_1079_1072 (*(volatile byte xdata *) 0xF086) ++#define p_reg_tuner_data_1079_1072 0xF086 ++#define reg_tuner_data_1079_1072_pos 0 ++#define reg_tuner_data_1079_1072_len 8 ++#define reg_tuner_data_1079_1072_lsb 1072 ++#define xd_p_reg_tuner_data_1087_1080 (*(volatile byte xdata *) 0xF087) ++#define p_reg_tuner_data_1087_1080 0xF087 ++#define reg_tuner_data_1087_1080_pos 0 ++#define reg_tuner_data_1087_1080_len 8 ++#define reg_tuner_data_1087_1080_lsb 1080 ++#define xd_p_reg_tuner_data_1095_1088 (*(volatile byte xdata *) 0xF088) ++#define p_reg_tuner_data_1095_1088 0xF088 ++#define reg_tuner_data_1095_1088_pos 0 ++#define reg_tuner_data_1095_1088_len 8 ++#define reg_tuner_data_1095_1088_lsb 1088 ++#define xd_p_reg_tuner_data_1103_1096 (*(volatile byte xdata *) 0xF089) ++#define p_reg_tuner_data_1103_1096 0xF089 ++#define reg_tuner_data_1103_1096_pos 0 ++#define reg_tuner_data_1103_1096_len 8 ++#define reg_tuner_data_1103_1096_lsb 1096 ++#define xd_p_reg_tuner_data_1111_1104 (*(volatile byte xdata *) 0xF08A) ++#define p_reg_tuner_data_1111_1104 0xF08A ++#define reg_tuner_data_1111_1104_pos 0 ++#define reg_tuner_data_1111_1104_len 8 ++#define reg_tuner_data_1111_1104_lsb 1104 ++#define xd_p_reg_tuner_data_1119_1112 (*(volatile byte xdata *) 0xF08B) ++#define p_reg_tuner_data_1119_1112 0xF08B ++#define reg_tuner_data_1119_1112_pos 0 ++#define reg_tuner_data_1119_1112_len 8 ++#define reg_tuner_data_1119_1112_lsb 1112 ++#define xd_p_reg_tuner_data_1127_1120 (*(volatile byte xdata *) 0xF08C) ++#define p_reg_tuner_data_1127_1120 0xF08C ++#define reg_tuner_data_1127_1120_pos 0 ++#define reg_tuner_data_1127_1120_len 8 ++#define reg_tuner_data_1127_1120_lsb 1120 ++#define xd_p_reg_tuner_data_1135_1128 (*(volatile byte xdata *) 0xF08D) ++#define p_reg_tuner_data_1135_1128 0xF08D ++#define reg_tuner_data_1135_1128_pos 0 ++#define reg_tuner_data_1135_1128_len 8 ++#define reg_tuner_data_1135_1128_lsb 1128 ++#define xd_p_reg_tuner_data_1143_1136 (*(volatile byte xdata *) 0xF08E) ++#define p_reg_tuner_data_1143_1136 0xF08E ++#define reg_tuner_data_1143_1136_pos 0 ++#define reg_tuner_data_1143_1136_len 8 ++#define reg_tuner_data_1143_1136_lsb 1136 ++#define xd_p_reg_tuner_data_1151_1144 (*(volatile byte xdata *) 0xF08F) ++#define p_reg_tuner_data_1151_1144 0xF08F ++#define reg_tuner_data_1151_1144_pos 0 ++#define reg_tuner_data_1151_1144_len 8 ++#define reg_tuner_data_1151_1144_lsb 1144 ++#define xd_p_reg_tuner_data_1159_1152 (*(volatile byte xdata *) 0xF090) ++#define p_reg_tuner_data_1159_1152 0xF090 ++#define reg_tuner_data_1159_1152_pos 0 ++#define reg_tuner_data_1159_1152_len 8 ++#define reg_tuner_data_1159_1152_lsb 1152 ++#define xd_p_reg_tuner_data_1167_1160 (*(volatile byte xdata *) 0xF091) ++#define p_reg_tuner_data_1167_1160 0xF091 ++#define reg_tuner_data_1167_1160_pos 0 ++#define reg_tuner_data_1167_1160_len 8 ++#define reg_tuner_data_1167_1160_lsb 1160 ++#define xd_p_reg_tuner_data_1175_1168 (*(volatile byte xdata *) 0xF092) ++#define p_reg_tuner_data_1175_1168 0xF092 ++#define reg_tuner_data_1175_1168_pos 0 ++#define reg_tuner_data_1175_1168_len 8 ++#define reg_tuner_data_1175_1168_lsb 1168 ++#define xd_p_reg_tuner_data_1183_1176 (*(volatile byte xdata *) 0xF093) ++#define p_reg_tuner_data_1183_1176 0xF093 ++#define reg_tuner_data_1183_1176_pos 0 ++#define reg_tuner_data_1183_1176_len 8 ++#define reg_tuner_data_1183_1176_lsb 1176 ++#define xd_p_reg_tuner_data_1191_1184 (*(volatile byte xdata *) 0xF094) ++#define p_reg_tuner_data_1191_1184 0xF094 ++#define reg_tuner_data_1191_1184_pos 0 ++#define reg_tuner_data_1191_1184_len 8 ++#define reg_tuner_data_1191_1184_lsb 1184 ++#define xd_p_reg_tuner_data_1199_1192 (*(volatile byte xdata *) 0xF095) ++#define p_reg_tuner_data_1199_1192 0xF095 ++#define reg_tuner_data_1199_1192_pos 0 ++#define reg_tuner_data_1199_1192_len 8 ++#define reg_tuner_data_1199_1192_lsb 1192 ++#define xd_p_reg_tuner_data_1207_1200 (*(volatile byte xdata *) 0xF096) ++#define p_reg_tuner_data_1207_1200 0xF096 ++#define reg_tuner_data_1207_1200_pos 0 ++#define reg_tuner_data_1207_1200_len 8 ++#define reg_tuner_data_1207_1200_lsb 1200 ++#define xd_p_reg_tuner_data_1215_1208 (*(volatile byte xdata *) 0xF097) ++#define p_reg_tuner_data_1215_1208 0xF097 ++#define reg_tuner_data_1215_1208_pos 0 ++#define reg_tuner_data_1215_1208_len 8 ++#define reg_tuner_data_1215_1208_lsb 1208 ++#define xd_p_reg_tuner_data_1223_1216 (*(volatile byte xdata *) 0xF098) ++#define p_reg_tuner_data_1223_1216 0xF098 ++#define reg_tuner_data_1223_1216_pos 0 ++#define reg_tuner_data_1223_1216_len 8 ++#define reg_tuner_data_1223_1216_lsb 1216 ++#define xd_p_reg_tuner_data_1231_1224 (*(volatile byte xdata *) 0xF099) ++#define p_reg_tuner_data_1231_1224 0xF099 ++#define reg_tuner_data_1231_1224_pos 0 ++#define reg_tuner_data_1231_1224_len 8 ++#define reg_tuner_data_1231_1224_lsb 1224 ++#define xd_p_reg_tuner_data_1239_1232 (*(volatile byte xdata *) 0xF09A) ++#define p_reg_tuner_data_1239_1232 0xF09A ++#define reg_tuner_data_1239_1232_pos 0 ++#define reg_tuner_data_1239_1232_len 8 ++#define reg_tuner_data_1239_1232_lsb 1232 ++#define xd_p_reg_tuner_data_1247_1240 (*(volatile byte xdata *) 0xF09B) ++#define p_reg_tuner_data_1247_1240 0xF09B ++#define reg_tuner_data_1247_1240_pos 0 ++#define reg_tuner_data_1247_1240_len 8 ++#define reg_tuner_data_1247_1240_lsb 1240 ++#define xd_p_reg_tuner_data_1255_1248 (*(volatile byte xdata *) 0xF09C) ++#define p_reg_tuner_data_1255_1248 0xF09C ++#define reg_tuner_data_1255_1248_pos 0 ++#define reg_tuner_data_1255_1248_len 8 ++#define reg_tuner_data_1255_1248_lsb 1248 ++#define xd_p_reg_tuner_data_1263_1256 (*(volatile byte xdata *) 0xF09D) ++#define p_reg_tuner_data_1263_1256 0xF09D ++#define reg_tuner_data_1263_1256_pos 0 ++#define reg_tuner_data_1263_1256_len 8 ++#define reg_tuner_data_1263_1256_lsb 1256 ++#define xd_p_reg_tuner_data_1271_1264 (*(volatile byte xdata *) 0xF09E) ++#define p_reg_tuner_data_1271_1264 0xF09E ++#define reg_tuner_data_1271_1264_pos 0 ++#define reg_tuner_data_1271_1264_len 8 ++#define reg_tuner_data_1271_1264_lsb 1264 ++#define xd_p_reg_tuner_data_1279_1272 (*(volatile byte xdata *) 0xF09F) ++#define p_reg_tuner_data_1279_1272 0xF09F ++#define reg_tuner_data_1279_1272_pos 0 ++#define reg_tuner_data_1279_1272_len 8 ++#define reg_tuner_data_1279_1272_lsb 1272 ++#define xd_p_reg_tuner_data_1287_1280 (*(volatile byte xdata *) 0xF0A0) ++#define p_reg_tuner_data_1287_1280 0xF0A0 ++#define reg_tuner_data_1287_1280_pos 0 ++#define reg_tuner_data_1287_1280_len 8 ++#define reg_tuner_data_1287_1280_lsb 1280 ++#define xd_p_reg_tuner_data_1295_1288 (*(volatile byte xdata *) 0xF0A1) ++#define p_reg_tuner_data_1295_1288 0xF0A1 ++#define reg_tuner_data_1295_1288_pos 0 ++#define reg_tuner_data_1295_1288_len 8 ++#define reg_tuner_data_1295_1288_lsb 1288 ++#define xd_p_reg_tuner_data_1303_1296 (*(volatile byte xdata *) 0xF0A2) ++#define p_reg_tuner_data_1303_1296 0xF0A2 ++#define reg_tuner_data_1303_1296_pos 0 ++#define reg_tuner_data_1303_1296_len 8 ++#define reg_tuner_data_1303_1296_lsb 1296 ++#define xd_p_reg_tuner_data_1311_1304 (*(volatile byte xdata *) 0xF0A3) ++#define p_reg_tuner_data_1311_1304 0xF0A3 ++#define reg_tuner_data_1311_1304_pos 0 ++#define reg_tuner_data_1311_1304_len 8 ++#define reg_tuner_data_1311_1304_lsb 1304 ++#define xd_p_reg_tuner_data_1319_1312 (*(volatile byte xdata *) 0xF0A4) ++#define p_reg_tuner_data_1319_1312 0xF0A4 ++#define reg_tuner_data_1319_1312_pos 0 ++#define reg_tuner_data_1319_1312_len 8 ++#define reg_tuner_data_1319_1312_lsb 1312 ++#define xd_p_reg_tuner_data_1327_1320 (*(volatile byte xdata *) 0xF0A5) ++#define p_reg_tuner_data_1327_1320 0xF0A5 ++#define reg_tuner_data_1327_1320_pos 0 ++#define reg_tuner_data_1327_1320_len 8 ++#define reg_tuner_data_1327_1320_lsb 1320 ++#define xd_p_reg_tuner_data_1335_1328 (*(volatile byte xdata *) 0xF0A6) ++#define p_reg_tuner_data_1335_1328 0xF0A6 ++#define reg_tuner_data_1335_1328_pos 0 ++#define reg_tuner_data_1335_1328_len 8 ++#define reg_tuner_data_1335_1328_lsb 1328 ++#define xd_p_reg_tuner_data_1343_1336 (*(volatile byte xdata *) 0xF0A7) ++#define p_reg_tuner_data_1343_1336 0xF0A7 ++#define reg_tuner_data_1343_1336_pos 0 ++#define reg_tuner_data_1343_1336_len 8 ++#define reg_tuner_data_1343_1336_lsb 1336 ++#define xd_p_reg_tuner_data_1351_1344 (*(volatile byte xdata *) 0xF0A8) ++#define p_reg_tuner_data_1351_1344 0xF0A8 ++#define reg_tuner_data_1351_1344_pos 0 ++#define reg_tuner_data_1351_1344_len 8 ++#define reg_tuner_data_1351_1344_lsb 1344 ++#define xd_p_reg_tuner_data_1359_1352 (*(volatile byte xdata *) 0xF0A9) ++#define p_reg_tuner_data_1359_1352 0xF0A9 ++#define reg_tuner_data_1359_1352_pos 0 ++#define reg_tuner_data_1359_1352_len 8 ++#define reg_tuner_data_1359_1352_lsb 1352 ++#define xd_p_reg_tuner_data_1367_1360 (*(volatile byte xdata *) 0xF0AA) ++#define p_reg_tuner_data_1367_1360 0xF0AA ++#define reg_tuner_data_1367_1360_pos 0 ++#define reg_tuner_data_1367_1360_len 8 ++#define reg_tuner_data_1367_1360_lsb 1360 ++#define xd_p_reg_tuner_data_1375_1368 (*(volatile byte xdata *) 0xF0AB) ++#define p_reg_tuner_data_1375_1368 0xF0AB ++#define reg_tuner_data_1375_1368_pos 0 ++#define reg_tuner_data_1375_1368_len 8 ++#define reg_tuner_data_1375_1368_lsb 1368 ++#define xd_p_reg_tuner_data_1383_1376 (*(volatile byte xdata *) 0xF0AC) ++#define p_reg_tuner_data_1383_1376 0xF0AC ++#define reg_tuner_data_1383_1376_pos 0 ++#define reg_tuner_data_1383_1376_len 8 ++#define reg_tuner_data_1383_1376_lsb 1376 ++#define xd_p_reg_tuner_data_1391_1384 (*(volatile byte xdata *) 0xF0AD) ++#define p_reg_tuner_data_1391_1384 0xF0AD ++#define reg_tuner_data_1391_1384_pos 0 ++#define reg_tuner_data_1391_1384_len 8 ++#define reg_tuner_data_1391_1384_lsb 1384 ++#define xd_p_reg_tuner_data_1399_1392 (*(volatile byte xdata *) 0xF0AE) ++#define p_reg_tuner_data_1399_1392 0xF0AE ++#define reg_tuner_data_1399_1392_pos 0 ++#define reg_tuner_data_1399_1392_len 8 ++#define reg_tuner_data_1399_1392_lsb 1392 ++#define xd_p_reg_tuner_data_1407_1400 (*(volatile byte xdata *) 0xF0AF) ++#define p_reg_tuner_data_1407_1400 0xF0AF ++#define reg_tuner_data_1407_1400_pos 0 ++#define reg_tuner_data_1407_1400_len 8 ++#define reg_tuner_data_1407_1400_lsb 1400 ++#define xd_p_reg_tuner_data_1415_1408 (*(volatile byte xdata *) 0xF0B0) ++#define p_reg_tuner_data_1415_1408 0xF0B0 ++#define reg_tuner_data_1415_1408_pos 0 ++#define reg_tuner_data_1415_1408_len 8 ++#define reg_tuner_data_1415_1408_lsb 1408 ++#define xd_p_reg_tuner_data_1423_1416 (*(volatile byte xdata *) 0xF0B1) ++#define p_reg_tuner_data_1423_1416 0xF0B1 ++#define reg_tuner_data_1423_1416_pos 0 ++#define reg_tuner_data_1423_1416_len 8 ++#define reg_tuner_data_1423_1416_lsb 1416 ++#define xd_p_reg_tuner_data_1431_1424 (*(volatile byte xdata *) 0xF0B2) ++#define p_reg_tuner_data_1431_1424 0xF0B2 ++#define reg_tuner_data_1431_1424_pos 0 ++#define reg_tuner_data_1431_1424_len 8 ++#define reg_tuner_data_1431_1424_lsb 1424 ++#define xd_p_reg_tuner_data_1439_1432 (*(volatile byte xdata *) 0xF0B3) ++#define p_reg_tuner_data_1439_1432 0xF0B3 ++#define reg_tuner_data_1439_1432_pos 0 ++#define reg_tuner_data_1439_1432_len 8 ++#define reg_tuner_data_1439_1432_lsb 1432 ++#define xd_p_reg_tuner_data_1447_1440 (*(volatile byte xdata *) 0xF0B4) ++#define p_reg_tuner_data_1447_1440 0xF0B4 ++#define reg_tuner_data_1447_1440_pos 0 ++#define reg_tuner_data_1447_1440_len 8 ++#define reg_tuner_data_1447_1440_lsb 1440 ++#define xd_p_reg_tuner_data_1455_1448 (*(volatile byte xdata *) 0xF0B5) ++#define p_reg_tuner_data_1455_1448 0xF0B5 ++#define reg_tuner_data_1455_1448_pos 0 ++#define reg_tuner_data_1455_1448_len 8 ++#define reg_tuner_data_1455_1448_lsb 1448 ++#define xd_p_reg_tuner_data_1463_1456 (*(volatile byte xdata *) 0xF0B6) ++#define p_reg_tuner_data_1463_1456 0xF0B6 ++#define reg_tuner_data_1463_1456_pos 0 ++#define reg_tuner_data_1463_1456_len 8 ++#define reg_tuner_data_1463_1456_lsb 1456 ++#define xd_p_reg_tuner_data_1471_1464 (*(volatile byte xdata *) 0xF0B7) ++#define p_reg_tuner_data_1471_1464 0xF0B7 ++#define reg_tuner_data_1471_1464_pos 0 ++#define reg_tuner_data_1471_1464_len 8 ++#define reg_tuner_data_1471_1464_lsb 1464 ++#define xd_p_reg_tuner_data_1479_1472 (*(volatile byte xdata *) 0xF0B8) ++#define p_reg_tuner_data_1479_1472 0xF0B8 ++#define reg_tuner_data_1479_1472_pos 0 ++#define reg_tuner_data_1479_1472_len 8 ++#define reg_tuner_data_1479_1472_lsb 1472 ++#define xd_p_reg_tuner_data_1487_1480 (*(volatile byte xdata *) 0xF0B9) ++#define p_reg_tuner_data_1487_1480 0xF0B9 ++#define reg_tuner_data_1487_1480_pos 0 ++#define reg_tuner_data_1487_1480_len 8 ++#define reg_tuner_data_1487_1480_lsb 1480 ++#define xd_p_reg_tuner_data_1495_1488 (*(volatile byte xdata *) 0xF0BA) ++#define p_reg_tuner_data_1495_1488 0xF0BA ++#define reg_tuner_data_1495_1488_pos 0 ++#define reg_tuner_data_1495_1488_len 8 ++#define reg_tuner_data_1495_1488_lsb 1488 ++#define xd_p_reg_tuner_data_1503_1496 (*(volatile byte xdata *) 0xF0BB) ++#define p_reg_tuner_data_1503_1496 0xF0BB ++#define reg_tuner_data_1503_1496_pos 0 ++#define reg_tuner_data_1503_1496_len 8 ++#define reg_tuner_data_1503_1496_lsb 1496 ++#define xd_p_reg_tuner_data_1511_1504 (*(volatile byte xdata *) 0xF0BC) ++#define p_reg_tuner_data_1511_1504 0xF0BC ++#define reg_tuner_data_1511_1504_pos 0 ++#define reg_tuner_data_1511_1504_len 8 ++#define reg_tuner_data_1511_1504_lsb 1504 ++#define xd_p_reg_tuner_data_1519_1512 (*(volatile byte xdata *) 0xF0BD) ++#define p_reg_tuner_data_1519_1512 0xF0BD ++#define reg_tuner_data_1519_1512_pos 0 ++#define reg_tuner_data_1519_1512_len 8 ++#define reg_tuner_data_1519_1512_lsb 1512 ++#define xd_p_reg_tuner_data_1527_1520 (*(volatile byte xdata *) 0xF0BE) ++#define p_reg_tuner_data_1527_1520 0xF0BE ++#define reg_tuner_data_1527_1520_pos 0 ++#define reg_tuner_data_1527_1520_len 8 ++#define reg_tuner_data_1527_1520_lsb 1520 ++#define xd_p_reg_tuner_data_1535_1528 (*(volatile byte xdata *) 0xF0BF) ++#define p_reg_tuner_data_1535_1528 0xF0BF ++#define reg_tuner_data_1535_1528_pos 0 ++#define reg_tuner_data_1535_1528_len 8 ++#define reg_tuner_data_1535_1528_lsb 1528 ++#define xd_p_reg_tuner_data_1543_1536 (*(volatile byte xdata *) 0xF0C0) ++#define p_reg_tuner_data_1543_1536 0xF0C0 ++#define reg_tuner_data_1543_1536_pos 0 ++#define reg_tuner_data_1543_1536_len 8 ++#define reg_tuner_data_1543_1536_lsb 1536 ++#define xd_p_reg_tuner_data_1551_1544 (*(volatile byte xdata *) 0xF0C1) ++#define p_reg_tuner_data_1551_1544 0xF0C1 ++#define reg_tuner_data_1551_1544_pos 0 ++#define reg_tuner_data_1551_1544_len 8 ++#define reg_tuner_data_1551_1544_lsb 1544 ++#define xd_p_reg_tuner_data_1559_1552 (*(volatile byte xdata *) 0xF0C2) ++#define p_reg_tuner_data_1559_1552 0xF0C2 ++#define reg_tuner_data_1559_1552_pos 0 ++#define reg_tuner_data_1559_1552_len 8 ++#define reg_tuner_data_1559_1552_lsb 1552 ++#define xd_p_reg_tuner_data_1567_1560 (*(volatile byte xdata *) 0xF0C3) ++#define p_reg_tuner_data_1567_1560 0xF0C3 ++#define reg_tuner_data_1567_1560_pos 0 ++#define reg_tuner_data_1567_1560_len 8 ++#define reg_tuner_data_1567_1560_lsb 1560 ++#define xd_p_reg_tuner_data_1575_1568 (*(volatile byte xdata *) 0xF0C4) ++#define p_reg_tuner_data_1575_1568 0xF0C4 ++#define reg_tuner_data_1575_1568_pos 0 ++#define reg_tuner_data_1575_1568_len 8 ++#define reg_tuner_data_1575_1568_lsb 1568 ++#define xd_p_reg_tuner_data_1583_1576 (*(volatile byte xdata *) 0xF0C5) ++#define p_reg_tuner_data_1583_1576 0xF0C5 ++#define reg_tuner_data_1583_1576_pos 0 ++#define reg_tuner_data_1583_1576_len 8 ++#define reg_tuner_data_1583_1576_lsb 1576 ++#define xd_p_reg_tuner_data_1591_1584 (*(volatile byte xdata *) 0xF0C6) ++#define p_reg_tuner_data_1591_1584 0xF0C6 ++#define reg_tuner_data_1591_1584_pos 0 ++#define reg_tuner_data_1591_1584_len 8 ++#define reg_tuner_data_1591_1584_lsb 1584 ++#define xd_p_reg_tuner_data_1599_1592 (*(volatile byte xdata *) 0xF0C7) ++#define p_reg_tuner_data_1599_1592 0xF0C7 ++#define reg_tuner_data_1599_1592_pos 0 ++#define reg_tuner_data_1599_1592_len 8 ++#define reg_tuner_data_1599_1592_lsb 1592 ++#define xd_p_reg_tuner_data_1607_1600 (*(volatile byte xdata *) 0xF0C8) ++#define p_reg_tuner_data_1607_1600 0xF0C8 ++#define reg_tuner_data_1607_1600_pos 0 ++#define reg_tuner_data_1607_1600_len 8 ++#define reg_tuner_data_1607_1600_lsb 1600 ++#define xd_p_reg_tuner_data_1615_1608 (*(volatile byte xdata *) 0xF0C9) ++#define p_reg_tuner_data_1615_1608 0xF0C9 ++#define reg_tuner_data_1615_1608_pos 0 ++#define reg_tuner_data_1615_1608_len 8 ++#define reg_tuner_data_1615_1608_lsb 1608 ++#define xd_p_reg_tuner_data_1623_1616 (*(volatile byte xdata *) 0xF0CA) ++#define p_reg_tuner_data_1623_1616 0xF0CA ++#define reg_tuner_data_1623_1616_pos 0 ++#define reg_tuner_data_1623_1616_len 8 ++#define reg_tuner_data_1623_1616_lsb 1616 ++#define xd_p_reg_tuner_data_1631_1624 (*(volatile byte xdata *) 0xF0CB) ++#define p_reg_tuner_data_1631_1624 0xF0CB ++#define reg_tuner_data_1631_1624_pos 0 ++#define reg_tuner_data_1631_1624_len 8 ++#define reg_tuner_data_1631_1624_lsb 1624 ++#define xd_p_reg_tuner_data_1639_1632 (*(volatile byte xdata *) 0xF0CC) ++#define p_reg_tuner_data_1639_1632 0xF0CC ++#define reg_tuner_data_1639_1632_pos 0 ++#define reg_tuner_data_1639_1632_len 8 ++#define reg_tuner_data_1639_1632_lsb 1632 ++#define xd_p_reg_tuner_data_1647_1640 (*(volatile byte xdata *) 0xF0CD) ++#define p_reg_tuner_data_1647_1640 0xF0CD ++#define reg_tuner_data_1647_1640_pos 0 ++#define reg_tuner_data_1647_1640_len 8 ++#define reg_tuner_data_1647_1640_lsb 1640 ++#define xd_p_reg_tuner_data_1655_1648 (*(volatile byte xdata *) 0xF0CE) ++#define p_reg_tuner_data_1655_1648 0xF0CE ++#define reg_tuner_data_1655_1648_pos 0 ++#define reg_tuner_data_1655_1648_len 8 ++#define reg_tuner_data_1655_1648_lsb 1648 ++#define xd_p_reg_tuner_data_1663_1656 (*(volatile byte xdata *) 0xF0CF) ++#define p_reg_tuner_data_1663_1656 0xF0CF ++#define reg_tuner_data_1663_1656_pos 0 ++#define reg_tuner_data_1663_1656_len 8 ++#define reg_tuner_data_1663_1656_lsb 1656 ++#define xd_p_reg_tuner_data_1671_1664 (*(volatile byte xdata *) 0xF0D0) ++#define p_reg_tuner_data_1671_1664 0xF0D0 ++#define reg_tuner_data_1671_1664_pos 0 ++#define reg_tuner_data_1671_1664_len 8 ++#define reg_tuner_data_1671_1664_lsb 1664 ++#define xd_p_reg_tuner_data_1679_1672 (*(volatile byte xdata *) 0xF0D1) ++#define p_reg_tuner_data_1679_1672 0xF0D1 ++#define reg_tuner_data_1679_1672_pos 0 ++#define reg_tuner_data_1679_1672_len 8 ++#define reg_tuner_data_1679_1672_lsb 1672 ++#define xd_p_reg_tuner_data_1687_1680 (*(volatile byte xdata *) 0xF0D2) ++#define p_reg_tuner_data_1687_1680 0xF0D2 ++#define reg_tuner_data_1687_1680_pos 0 ++#define reg_tuner_data_1687_1680_len 8 ++#define reg_tuner_data_1687_1680_lsb 1680 ++#define xd_p_reg_tuner_data_1695_1688 (*(volatile byte xdata *) 0xF0D3) ++#define p_reg_tuner_data_1695_1688 0xF0D3 ++#define reg_tuner_data_1695_1688_pos 0 ++#define reg_tuner_data_1695_1688_len 8 ++#define reg_tuner_data_1695_1688_lsb 1688 ++#define xd_p_reg_tuner_data_1703_1696 (*(volatile byte xdata *) 0xF0D4) ++#define p_reg_tuner_data_1703_1696 0xF0D4 ++#define reg_tuner_data_1703_1696_pos 0 ++#define reg_tuner_data_1703_1696_len 8 ++#define reg_tuner_data_1703_1696_lsb 1696 ++#define xd_p_reg_tuner_data_1711_1704 (*(volatile byte xdata *) 0xF0D5) ++#define p_reg_tuner_data_1711_1704 0xF0D5 ++#define reg_tuner_data_1711_1704_pos 0 ++#define reg_tuner_data_1711_1704_len 8 ++#define reg_tuner_data_1711_1704_lsb 1704 ++#define xd_p_reg_tuner_data_1719_1712 (*(volatile byte xdata *) 0xF0D6) ++#define p_reg_tuner_data_1719_1712 0xF0D6 ++#define reg_tuner_data_1719_1712_pos 0 ++#define reg_tuner_data_1719_1712_len 8 ++#define reg_tuner_data_1719_1712_lsb 1712 ++#define xd_p_reg_tuner_data_1727_1720 (*(volatile byte xdata *) 0xF0D7) ++#define p_reg_tuner_data_1727_1720 0xF0D7 ++#define reg_tuner_data_1727_1720_pos 0 ++#define reg_tuner_data_1727_1720_len 8 ++#define reg_tuner_data_1727_1720_lsb 1720 ++#define xd_p_reg_tuner_data_1735_1728 (*(volatile byte xdata *) 0xF0D8) ++#define p_reg_tuner_data_1735_1728 0xF0D8 ++#define reg_tuner_data_1735_1728_pos 0 ++#define reg_tuner_data_1735_1728_len 8 ++#define reg_tuner_data_1735_1728_lsb 1728 ++#define xd_p_reg_tuner_data_1743_1736 (*(volatile byte xdata *) 0xF0D9) ++#define p_reg_tuner_data_1743_1736 0xF0D9 ++#define reg_tuner_data_1743_1736_pos 0 ++#define reg_tuner_data_1743_1736_len 8 ++#define reg_tuner_data_1743_1736_lsb 1736 ++#define xd_p_reg_tuner_data_1751_1744 (*(volatile byte xdata *) 0xF0DA) ++#define p_reg_tuner_data_1751_1744 0xF0DA ++#define reg_tuner_data_1751_1744_pos 0 ++#define reg_tuner_data_1751_1744_len 8 ++#define reg_tuner_data_1751_1744_lsb 1744 ++#define xd_p_reg_tuner_data_1759_1752 (*(volatile byte xdata *) 0xF0DB) ++#define p_reg_tuner_data_1759_1752 0xF0DB ++#define reg_tuner_data_1759_1752_pos 0 ++#define reg_tuner_data_1759_1752_len 8 ++#define reg_tuner_data_1759_1752_lsb 1752 ++#define xd_p_reg_tuner_data_1767_1760 (*(volatile byte xdata *) 0xF0DC) ++#define p_reg_tuner_data_1767_1760 0xF0DC ++#define reg_tuner_data_1767_1760_pos 0 ++#define reg_tuner_data_1767_1760_len 8 ++#define reg_tuner_data_1767_1760_lsb 1760 ++#define xd_p_reg_tuner_data_1775_1768 (*(volatile byte xdata *) 0xF0DD) ++#define p_reg_tuner_data_1775_1768 0xF0DD ++#define reg_tuner_data_1775_1768_pos 0 ++#define reg_tuner_data_1775_1768_len 8 ++#define reg_tuner_data_1775_1768_lsb 1768 ++#define xd_p_reg_tuner_data_1783_1776 (*(volatile byte xdata *) 0xF0DE) ++#define p_reg_tuner_data_1783_1776 0xF0DE ++#define reg_tuner_data_1783_1776_pos 0 ++#define reg_tuner_data_1783_1776_len 8 ++#define reg_tuner_data_1783_1776_lsb 1776 ++#define xd_p_reg_tuner_data_1791_1784 (*(volatile byte xdata *) 0xF0DF) ++#define p_reg_tuner_data_1791_1784 0xF0DF ++#define reg_tuner_data_1791_1784_pos 0 ++#define reg_tuner_data_1791_1784_len 8 ++#define reg_tuner_data_1791_1784_lsb 1784 ++#define xd_p_reg_tuner_data_1799_1792 (*(volatile byte xdata *) 0xF0E0) ++#define p_reg_tuner_data_1799_1792 0xF0E0 ++#define reg_tuner_data_1799_1792_pos 0 ++#define reg_tuner_data_1799_1792_len 8 ++#define reg_tuner_data_1799_1792_lsb 1792 ++#define xd_p_reg_tuner_data_1807_1800 (*(volatile byte xdata *) 0xF0E1) ++#define p_reg_tuner_data_1807_1800 0xF0E1 ++#define reg_tuner_data_1807_1800_pos 0 ++#define reg_tuner_data_1807_1800_len 8 ++#define reg_tuner_data_1807_1800_lsb 1800 ++#define xd_p_reg_tuner_data_1815_1808 (*(volatile byte xdata *) 0xF0E2) ++#define p_reg_tuner_data_1815_1808 0xF0E2 ++#define reg_tuner_data_1815_1808_pos 0 ++#define reg_tuner_data_1815_1808_len 8 ++#define reg_tuner_data_1815_1808_lsb 1808 ++#define xd_p_reg_tuner_data_1823_1816 (*(volatile byte xdata *) 0xF0E3) ++#define p_reg_tuner_data_1823_1816 0xF0E3 ++#define reg_tuner_data_1823_1816_pos 0 ++#define reg_tuner_data_1823_1816_len 8 ++#define reg_tuner_data_1823_1816_lsb 1816 ++#define xd_p_reg_tuner_data_1831_1824 (*(volatile byte xdata *) 0xF0E4) ++#define p_reg_tuner_data_1831_1824 0xF0E4 ++#define reg_tuner_data_1831_1824_pos 0 ++#define reg_tuner_data_1831_1824_len 8 ++#define reg_tuner_data_1831_1824_lsb 1824 ++#define xd_p_reg_tuner_data_1839_1832 (*(volatile byte xdata *) 0xF0E5) ++#define p_reg_tuner_data_1839_1832 0xF0E5 ++#define reg_tuner_data_1839_1832_pos 0 ++#define reg_tuner_data_1839_1832_len 8 ++#define reg_tuner_data_1839_1832_lsb 1832 ++#define xd_p_reg_tuner_data_1847_1840 (*(volatile byte xdata *) 0xF0E6) ++#define p_reg_tuner_data_1847_1840 0xF0E6 ++#define reg_tuner_data_1847_1840_pos 0 ++#define reg_tuner_data_1847_1840_len 8 ++#define reg_tuner_data_1847_1840_lsb 1840 ++#define xd_p_reg_tuner_data_1855_1848 (*(volatile byte xdata *) 0xF0E7) ++#define p_reg_tuner_data_1855_1848 0xF0E7 ++#define reg_tuner_data_1855_1848_pos 0 ++#define reg_tuner_data_1855_1848_len 8 ++#define reg_tuner_data_1855_1848_lsb 1848 ++#define xd_p_reg_tuner_data_1863_1856 (*(volatile byte xdata *) 0xF0E8) ++#define p_reg_tuner_data_1863_1856 0xF0E8 ++#define reg_tuner_data_1863_1856_pos 0 ++#define reg_tuner_data_1863_1856_len 8 ++#define reg_tuner_data_1863_1856_lsb 1856 ++#define xd_p_reg_tuner_data_1871_1864 (*(volatile byte xdata *) 0xF0E9) ++#define p_reg_tuner_data_1871_1864 0xF0E9 ++#define reg_tuner_data_1871_1864_pos 0 ++#define reg_tuner_data_1871_1864_len 8 ++#define reg_tuner_data_1871_1864_lsb 1864 ++#define xd_p_reg_tuner_data_1879_1872 (*(volatile byte xdata *) 0xF0EA) ++#define p_reg_tuner_data_1879_1872 0xF0EA ++#define reg_tuner_data_1879_1872_pos 0 ++#define reg_tuner_data_1879_1872_len 8 ++#define reg_tuner_data_1879_1872_lsb 1872 ++#define xd_p_reg_tuner_data_1887_1880 (*(volatile byte xdata *) 0xF0EB) ++#define p_reg_tuner_data_1887_1880 0xF0EB ++#define reg_tuner_data_1887_1880_pos 0 ++#define reg_tuner_data_1887_1880_len 8 ++#define reg_tuner_data_1887_1880_lsb 1880 ++#define xd_p_reg_tuner_data_1895_1888 (*(volatile byte xdata *) 0xF0EC) ++#define p_reg_tuner_data_1895_1888 0xF0EC ++#define reg_tuner_data_1895_1888_pos 0 ++#define reg_tuner_data_1895_1888_len 8 ++#define reg_tuner_data_1895_1888_lsb 1888 ++#define xd_p_reg_tuner_data_1903_1896 (*(volatile byte xdata *) 0xF0ED) ++#define p_reg_tuner_data_1903_1896 0xF0ED ++#define reg_tuner_data_1903_1896_pos 0 ++#define reg_tuner_data_1903_1896_len 8 ++#define reg_tuner_data_1903_1896_lsb 1896 ++#define xd_p_reg_tuner_data_1911_1904 (*(volatile byte xdata *) 0xF0EE) ++#define p_reg_tuner_data_1911_1904 0xF0EE ++#define reg_tuner_data_1911_1904_pos 0 ++#define reg_tuner_data_1911_1904_len 8 ++#define reg_tuner_data_1911_1904_lsb 1904 ++#define xd_p_reg_tuner_data_1919_1912 (*(volatile byte xdata *) 0xF0EF) ++#define p_reg_tuner_data_1919_1912 0xF0EF ++#define reg_tuner_data_1919_1912_pos 0 ++#define reg_tuner_data_1919_1912_len 8 ++#define reg_tuner_data_1919_1912_lsb 1912 ++#define xd_p_reg_tuner_data_1927_1920 (*(volatile byte xdata *) 0xF0F0) ++#define p_reg_tuner_data_1927_1920 0xF0F0 ++#define reg_tuner_data_1927_1920_pos 0 ++#define reg_tuner_data_1927_1920_len 8 ++#define reg_tuner_data_1927_1920_lsb 1920 ++#define xd_p_reg_tuner_data_1935_1928 (*(volatile byte xdata *) 0xF0F1) ++#define p_reg_tuner_data_1935_1928 0xF0F1 ++#define reg_tuner_data_1935_1928_pos 0 ++#define reg_tuner_data_1935_1928_len 8 ++#define reg_tuner_data_1935_1928_lsb 1928 ++#define xd_p_reg_tuner_data_1943_1936 (*(volatile byte xdata *) 0xF0F2) ++#define p_reg_tuner_data_1943_1936 0xF0F2 ++#define reg_tuner_data_1943_1936_pos 0 ++#define reg_tuner_data_1943_1936_len 8 ++#define reg_tuner_data_1943_1936_lsb 1936 ++#define xd_p_reg_tuner_data_1951_1944 (*(volatile byte xdata *) 0xF0F3) ++#define p_reg_tuner_data_1951_1944 0xF0F3 ++#define reg_tuner_data_1951_1944_pos 0 ++#define reg_tuner_data_1951_1944_len 8 ++#define reg_tuner_data_1951_1944_lsb 1944 ++#define xd_p_reg_tuner_data_1959_1952 (*(volatile byte xdata *) 0xF0F4) ++#define p_reg_tuner_data_1959_1952 0xF0F4 ++#define reg_tuner_data_1959_1952_pos 0 ++#define reg_tuner_data_1959_1952_len 8 ++#define reg_tuner_data_1959_1952_lsb 1952 ++#define xd_p_reg_tuner_data_1967_1960 (*(volatile byte xdata *) 0xF0F5) ++#define p_reg_tuner_data_1967_1960 0xF0F5 ++#define reg_tuner_data_1967_1960_pos 0 ++#define reg_tuner_data_1967_1960_len 8 ++#define reg_tuner_data_1967_1960_lsb 1960 ++#define xd_p_reg_tuner_data_1975_1968 (*(volatile byte xdata *) 0xF0F6) ++#define p_reg_tuner_data_1975_1968 0xF0F6 ++#define reg_tuner_data_1975_1968_pos 0 ++#define reg_tuner_data_1975_1968_len 8 ++#define reg_tuner_data_1975_1968_lsb 1968 ++#define xd_p_reg_tuner_data_1983_1976 (*(volatile byte xdata *) 0xF0F7) ++#define p_reg_tuner_data_1983_1976 0xF0F7 ++#define reg_tuner_data_1983_1976_pos 0 ++#define reg_tuner_data_1983_1976_len 8 ++#define reg_tuner_data_1983_1976_lsb 1976 ++#define xd_p_reg_tuner_data_1991_1984 (*(volatile byte xdata *) 0xF0F8) ++#define p_reg_tuner_data_1991_1984 0xF0F8 ++#define reg_tuner_data_1991_1984_pos 0 ++#define reg_tuner_data_1991_1984_len 8 ++#define reg_tuner_data_1991_1984_lsb 1984 ++#define xd_p_reg_tuner_data_1999_1992 (*(volatile byte xdata *) 0xF0F9) ++#define p_reg_tuner_data_1999_1992 0xF0F9 ++#define reg_tuner_data_1999_1992_pos 0 ++#define reg_tuner_data_1999_1992_len 8 ++#define reg_tuner_data_1999_1992_lsb 1992 ++#define xd_p_reg_tuner_data_2007_2000 (*(volatile byte xdata *) 0xF0FA) ++#define p_reg_tuner_data_2007_2000 0xF0FA ++#define reg_tuner_data_2007_2000_pos 0 ++#define reg_tuner_data_2007_2000_len 8 ++#define reg_tuner_data_2007_2000_lsb 2000 ++#define xd_p_reg_tuner_data_2015_2008 (*(volatile byte xdata *) 0xF0FB) ++#define p_reg_tuner_data_2015_2008 0xF0FB ++#define reg_tuner_data_2015_2008_pos 0 ++#define reg_tuner_data_2015_2008_len 8 ++#define reg_tuner_data_2015_2008_lsb 2008 ++#define xd_p_reg_tuner_data_2023_2016 (*(volatile byte xdata *) 0xF0FC) ++#define p_reg_tuner_data_2023_2016 0xF0FC ++#define reg_tuner_data_2023_2016_pos 0 ++#define reg_tuner_data_2023_2016_len 8 ++#define reg_tuner_data_2023_2016_lsb 2016 ++#define xd_p_reg_tuner_data_2031_2024 (*(volatile byte xdata *) 0xF0FD) ++#define p_reg_tuner_data_2031_2024 0xF0FD ++#define reg_tuner_data_2031_2024_pos 0 ++#define reg_tuner_data_2031_2024_len 8 ++#define reg_tuner_data_2031_2024_lsb 2024 ++#define xd_p_reg_tuner_data_2039_2032 (*(volatile byte xdata *) 0xF0FE) ++#define p_reg_tuner_data_2039_2032 0xF0FE ++#define reg_tuner_data_2039_2032_pos 0 ++#define reg_tuner_data_2039_2032_len 8 ++#define reg_tuner_data_2039_2032_lsb 2032 ++#define xd_p_reg_tuner_data_2047_2040 (*(volatile byte xdata *) 0xF0FF) ++#define p_reg_tuner_data_2047_2040 0xF0FF ++#define reg_tuner_data_2047_2040_pos 0 ++#define reg_tuner_data_2047_2040_len 8 ++#define reg_tuner_data_2047_2040_lsb 2040 ++#define xd_p_reg_tuner_master_rd_wr (*(volatile byte xdata *) 0xF100) ++#define p_reg_tuner_master_rd_wr 0xF100 ++#define reg_tuner_master_rd_wr_pos 0 ++#define reg_tuner_master_rd_wr_len 1 ++#define reg_tuner_master_rd_wr_lsb 0 ++#define xd_p_reg_tuner_master_length (*(volatile byte xdata *) 0xF101) ++#define p_reg_tuner_master_length 0xF101 ++#define reg_tuner_master_length_pos 0 ++#define reg_tuner_master_length_len 8 ++#define reg_tuner_master_length_lsb 0 ++#define xd_p_reg_tuner_cmd_exe (*(volatile byte xdata *) 0xF102) ++#define p_reg_tuner_cmd_exe 0xF102 ++#define reg_tuner_cmd_exe_pos 0 ++#define reg_tuner_cmd_exe_len 1 ++#define reg_tuner_cmd_exe_lsb 0 ++#define xd_p_reg_tuner_wdat_done (*(volatile byte xdata *) 0xF102) ++#define p_reg_tuner_wdat_done 0xF102 ++#define reg_tuner_wdat_done_pos 1 ++#define reg_tuner_wdat_done_len 1 ++#define reg_tuner_wdat_done_lsb 0 ++#define xd_p_reg_tuner_wdat_fail (*(volatile byte xdata *) 0xF102) ++#define p_reg_tuner_wdat_fail 0xF102 ++#define reg_tuner_wdat_fail_pos 2 ++#define reg_tuner_wdat_fail_len 1 ++#define reg_tuner_wdat_fail_lsb 0 ++#define xd_p_reg_tuner_ofsm_i2cm_rdat_rdy (*(volatile byte xdata *) 0xF102) ++#define p_reg_tuner_ofsm_i2cm_rdat_rdy 0xF102 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_pos 3 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_len 1 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_lsb 0 ++#define xd_p_reg_tuner_current_state (*(volatile byte xdata *) 0xF102) ++#define p_reg_tuner_current_state 0xF102 ++#define reg_tuner_current_state_pos 4 ++#define reg_tuner_current_state_len 3 ++#define reg_tuner_current_state_lsb 0 ++#define xd_p_reg_one_cycle_counter_tuner (*(volatile byte xdata *) 0xF103) ++#define p_reg_one_cycle_counter_tuner 0xF103 ++#define reg_one_cycle_counter_tuner_pos 0 ++#define reg_one_cycle_counter_tuner_len 8 ++#define reg_one_cycle_counter_tuner_lsb 0 ++#define xd_p_reg_msb_lsb (*(volatile byte xdata *) 0xF104) ++#define p_reg_msb_lsb 0xF104 ++#define reg_msb_lsb_pos 0 ++#define reg_msb_lsb_len 1 ++#define reg_msb_lsb_lsb 0 ++#define xd_p_reg_ofdm_rst (*(volatile byte xdata *) 0xF104) ++#define p_reg_ofdm_rst 0xF104 ++#define xd_p_reg_sel_thirdi2c (*(volatile byte xdata *) 0xF104) ++#define p_reg_sel_thirdi2c 0xF104 ++#define reg_sel_thirdi2c_pos 2 ++#define reg_sel_thirdi2c_len 1 ++#define reg_sel_thirdi2c_lsb 0 ++#define xd_p_reg_sel_tuner (*(volatile byte xdata *) 0xF104) ++#define p_reg_sel_tuner 0xF104 ++#define xd_p_reg_ofdm_rst_en (*(volatile byte xdata *) 0xF104) ++#define p_reg_ofdm_rst_en 0xF104 ++#define xd_p_reg_sdio_cccr_v (*(volatile byte xdata *) 0xF140) ++#define p_reg_sdio_cccr_v 0xF140 ++#define reg_sdio_cccr_v_pos 0 ++#define reg_sdio_cccr_v_len 4 ++#define reg_sdio_cccr_v_lsb 0 ++#define xd_p_reg_sdio_sdio_v (*(volatile byte xdata *) 0xF140) ++#define p_reg_sdio_sdio_v 0xF140 ++#define reg_sdio_sdio_v_pos 4 ++#define reg_sdio_sdio_v_len 4 ++#define reg_sdio_sdio_v_lsb 0 ++#define xd_p_reg_sdioc_sd_v (*(volatile byte xdata *) 0xF141) ++#define p_reg_sdioc_sd_v 0xF141 ++#define reg_sdioc_sd_v_pos 0 ++#define reg_sdioc_sd_v_len 4 ++#define reg_sdioc_sd_v_lsb 0 ++#define xd_p_reg_sdioc_ior1 (*(volatile byte xdata *) 0xF143) ++#define p_reg_sdioc_ior1 0xF143 ++#define reg_sdioc_ior1_pos 1 ++#define reg_sdioc_ior1_len 1 ++#define reg_sdioc_ior1_lsb 0 ++#define xd_p_reg_sdioc_int1 (*(volatile byte xdata *) 0xF145) ++#define p_reg_sdioc_int1 0xF145 ++#define reg_sdioc_int1_pos 1 ++#define reg_sdioc_int1_len 1 ++#define reg_sdioc_int1_lsb 0 ++#define xd_p_reg_sdioc_scsi (*(volatile byte xdata *) 0xF147) ++#define p_reg_sdioc_scsi 0xF147 ++#define reg_sdioc_scsi_pos 6 ++#define reg_sdioc_scsi_len 1 ++#define reg_sdioc_scsi_lsb 0 ++#define xd_p_reg_sdioc_sdc (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_sdc 0xF148 ++#define reg_sdioc_sdc_pos 0 ++#define reg_sdioc_sdc_len 1 ++#define reg_sdioc_sdc_lsb 0 ++#define xd_p_reg_sdioc_smb (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_smb 0xF148 ++#define reg_sdioc_smb_pos 1 ++#define reg_sdioc_smb_len 1 ++#define reg_sdioc_smb_lsb 0 ++#define xd_p_reg_sdioc_srw (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_srw 0xF148 ++#define reg_sdioc_srw_pos 2 ++#define reg_sdioc_srw_len 1 ++#define reg_sdioc_srw_lsb 0 ++#define xd_p_reg_sdioc_sbs (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_sbs 0xF148 ++#define reg_sdioc_sbs_pos 3 ++#define reg_sdioc_sbs_len 1 ++#define reg_sdioc_sbs_lsb 0 ++#define xd_p_reg_sdioc_s4mi (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_s4mi 0xF148 ++#define reg_sdioc_s4mi_pos 4 ++#define reg_sdioc_s4mi_len 1 ++#define reg_sdioc_s4mi_lsb 0 ++#define xd_p_reg_sdioc_lsc (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_lsc 0xF148 ++#define reg_sdioc_lsc_pos 6 ++#define reg_sdioc_lsc_len 1 ++#define reg_sdioc_lsc_lsb 0 ++#define xd_p_reg_sdioc_4bls (*(volatile byte xdata *) 0xF148) ++#define p_reg_sdioc_4bls 0xF148 ++#define reg_sdioc_4bls_pos 7 ++#define reg_sdioc_4bls_len 1 ++#define reg_sdioc_4bls_lsb 0 ++#define xd_p_reg_sdioc_cis_7_0 (*(volatile byte xdata *) 0xF149) ++#define p_reg_sdioc_cis_7_0 0xF149 ++#define reg_sdioc_cis_7_0_pos 0 ++#define reg_sdioc_cis_7_0_len 8 ++#define reg_sdioc_cis_7_0_lsb 0 ++#define xd_p_reg_sdioc_cis_15_8 (*(volatile byte xdata *) 0xF14A) ++#define p_reg_sdioc_cis_15_8 0xF14A ++#define reg_sdioc_cis_15_8_pos 0 ++#define reg_sdioc_cis_15_8_len 8 ++#define reg_sdioc_cis_15_8_lsb 8 ++#define xd_p_reg_sdioc_cis_23_16 (*(volatile byte xdata *) 0xF14B) ++#define p_reg_sdioc_cis_23_16 0xF14B ++#define reg_sdioc_cis_23_16_pos 0 ++#define reg_sdioc_cis_23_16_len 8 ++#define reg_sdioc_cis_23_16_lsb 16 ++#define xd_p_reg_sdioc_fs (*(volatile byte xdata *) 0xF14D) ++#define p_reg_sdioc_fs 0xF14D ++#define reg_sdioc_fs_pos 0 ++#define reg_sdioc_fs_len 4 ++#define reg_sdioc_fs_lsb 0 ++#define xd_p_reg_sdioc_df (*(volatile byte xdata *) 0xF14D) ++#define p_reg_sdioc_df 0xF14D ++#define reg_sdioc_df_pos 7 ++#define reg_sdioc_df_len 1 ++#define reg_sdioc_df_lsb 0 ++#define xd_p_reg_sdioc_ex1 (*(volatile byte xdata *) 0xF14E) ++#define p_reg_sdioc_ex1 0xF14E ++#define reg_sdioc_ex1_pos 1 ++#define reg_sdioc_ex1_len 1 ++#define reg_sdioc_ex1_lsb 0 ++#define xd_p_reg_sdioc_rf1 (*(volatile byte xdata *) 0xF14F) ++#define p_reg_sdioc_rf1 0xF14F ++#define reg_sdioc_rf1_pos 1 ++#define reg_sdioc_rf1_len 1 ++#define reg_sdioc_rf1_lsb 0 ++#define xd_p_reg_sdioc_smpc (*(volatile byte xdata *) 0xF152) ++#define p_reg_sdioc_smpc 0xF152 ++#define reg_sdioc_smpc_pos 0 ++#define reg_sdioc_smpc_len 1 ++#define reg_sdioc_smpc_lsb 0 ++#define xd_p_reg_sdioc_f1_code (*(volatile byte xdata *) 0xF160) ++#define p_reg_sdioc_f1_code 0xF160 ++#define reg_sdioc_f1_code_pos 0 ++#define reg_sdioc_f1_code_len 4 ++#define reg_sdioc_f1_code_lsb 0 ++#define xd_p_reg_sdioc_scsa (*(volatile byte xdata *) 0xF160) ++#define p_reg_sdioc_scsa 0xF160 ++#define reg_sdioc_scsa_pos 6 ++#define reg_sdioc_scsa_len 1 ++#define reg_sdioc_scsa_lsb 0 ++#define xd_p_reg_sdioc_csa_en (*(volatile byte xdata *) 0xF160) ++#define p_reg_sdioc_csa_en 0xF160 ++#define reg_sdioc_csa_en_pos 7 ++#define reg_sdioc_csa_en_len 1 ++#define reg_sdioc_csa_en_lsb 0 ++#define xd_p_reg_sdioc_f1_ext_code (*(volatile byte xdata *) 0xF161) ++#define p_reg_sdioc_f1_ext_code 0xF161 ++#define reg_sdioc_f1_ext_code_pos 0 ++#define reg_sdioc_f1_ext_code_len 8 ++#define reg_sdioc_f1_ext_code_lsb 0 ++#define xd_p_reg_sdioc_sps (*(volatile byte xdata *) 0xF162) ++#define p_reg_sdioc_sps 0xF162 ++#define reg_sdioc_sps_pos 0 ++#define reg_sdioc_sps_len 1 ++#define reg_sdioc_sps_lsb 0 ++#define xd_p_reg_sdioc_func1_cis_ptr_7_0 (*(volatile byte xdata *) 0xF169) ++#define p_reg_sdioc_func1_cis_ptr_7_0 0xF169 ++#define reg_sdioc_func1_cis_ptr_7_0_pos 0 ++#define reg_sdioc_func1_cis_ptr_7_0_len 8 ++#define reg_sdioc_func1_cis_ptr_7_0_lsb 0 ++#define xd_p_reg_sdioc_func1_cis_ptr_15_8 (*(volatile byte xdata *) 0xF16A) ++#define p_reg_sdioc_func1_cis_ptr_15_8 0xF16A ++#define reg_sdioc_func1_cis_ptr_15_8_pos 0 ++#define reg_sdioc_func1_cis_ptr_15_8_len 8 ++#define reg_sdioc_func1_cis_ptr_15_8_lsb 8 ++#define xd_p_reg_sdioc_func1_cis_ptr_23_16 (*(volatile byte xdata *) 0xF16B) ++#define p_reg_sdioc_func1_cis_ptr_23_16 0xF16B ++#define reg_sdioc_func1_cis_ptr_23_16_pos 0 ++#define reg_sdioc_func1_cis_ptr_23_16_len 8 ++#define reg_sdioc_func1_cis_ptr_23_16_lsb 16 ++#define xd_p_reg_sdio_FUNCID0_0 (*(volatile byte xdata *) 0xF180) ++#define p_reg_sdio_FUNCID0_0 0xF180 ++#define reg_sdio_FUNCID0_0_pos 0 ++#define reg_sdio_FUNCID0_0_len 8 ++#define reg_sdio_FUNCID0_0_lsb 0 ++#define xd_p_reg_sdio_FUNCID0_1 (*(volatile byte xdata *) 0xF181) ++#define p_reg_sdio_FUNCID0_1 0xF181 ++#define reg_sdio_FUNCID0_1_pos 0 ++#define reg_sdio_FUNCID0_1_len 8 ++#define reg_sdio_FUNCID0_1_lsb 0 ++#define xd_p_reg_sdio_FUNCID0_2 (*(volatile byte xdata *) 0xF182) ++#define p_reg_sdio_FUNCID0_2 0xF182 ++#define reg_sdio_FUNCID0_2_pos 0 ++#define reg_sdio_FUNCID0_2_len 8 ++#define reg_sdio_FUNCID0_2_lsb 0 ++#define xd_p_reg_sdio_FUNCID0_3 (*(volatile byte xdata *) 0xF183) ++#define p_reg_sdio_FUNCID0_3 0xF183 ++#define reg_sdio_FUNCID0_3_pos 0 ++#define reg_sdio_FUNCID0_3_len 8 ++#define reg_sdio_FUNCID0_3_lsb 0 ++#define xd_p_reg_sdio_MANFID0_0 (*(volatile byte xdata *) 0xF184) ++#define p_reg_sdio_MANFID0_0 0xF184 ++#define reg_sdio_MANFID0_0_pos 0 ++#define reg_sdio_MANFID0_0_len 8 ++#define reg_sdio_MANFID0_0_lsb 0 ++#define xd_p_reg_sdio_MANFID0_1 (*(volatile byte xdata *) 0xF185) ++#define p_reg_sdio_MANFID0_1 0xF185 ++#define reg_sdio_MANFID0_1_pos 0 ++#define reg_sdio_MANFID0_1_len 8 ++#define reg_sdio_MANFID0_1_lsb 0 ++#define xd_p_reg_sdio_MANFID0_2_7_0 (*(volatile byte xdata *) 0xF186) ++#define p_reg_sdio_MANFID0_2_7_0 0xF186 ++#define reg_sdio_MANFID0_2_7_0_pos 0 ++#define reg_sdio_MANFID0_2_7_0_len 8 ++#define reg_sdio_MANFID0_2_7_0_lsb 0 ++#define xd_p_reg_sdio_MANFID0_2_15_8 (*(volatile byte xdata *) 0xF187) ++#define p_reg_sdio_MANFID0_2_15_8 0xF187 ++#define reg_sdio_MANFID0_2_15_8_pos 0 ++#define reg_sdio_MANFID0_2_15_8_len 8 ++#define reg_sdio_MANFID0_2_15_8_lsb 8 ++#define xd_p_reg_sdio_MANFID0_4_7_0 (*(volatile byte xdata *) 0xF188) ++#define p_reg_sdio_MANFID0_4_7_0 0xF188 ++#define reg_sdio_MANFID0_4_7_0_pos 0 ++#define reg_sdio_MANFID0_4_7_0_len 8 ++#define reg_sdio_MANFID0_4_7_0_lsb 0 ++#define xd_p_reg_sdio_MANFID0_4_15_8 (*(volatile byte xdata *) 0xF189) ++#define p_reg_sdio_MANFID0_4_15_8 0xF189 ++#define reg_sdio_MANFID0_4_15_8_pos 0 ++#define reg_sdio_MANFID0_4_15_8_len 8 ++#define reg_sdio_MANFID0_4_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE0_0 (*(volatile byte xdata *) 0xF18A) ++#define p_reg_sdio_FUNCE0_0 0xF18A ++#define reg_sdio_FUNCE0_0_pos 0 ++#define reg_sdio_FUNCE0_0_len 8 ++#define reg_sdio_FUNCE0_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE0_1 (*(volatile byte xdata *) 0xF18B) ++#define p_reg_sdio_FUNCE0_1 0xF18B ++#define reg_sdio_FUNCE0_1_pos 0 ++#define reg_sdio_FUNCE0_1_len 8 ++#define reg_sdio_FUNCE0_1_lsb 0 ++#define xd_p_reg_sdio_FUNCE0_2 (*(volatile byte xdata *) 0xF18C) ++#define p_reg_sdio_FUNCE0_2 0xF18C ++#define reg_sdio_FUNCE0_2_pos 0 ++#define reg_sdio_FUNCE0_2_len 8 ++#define reg_sdio_FUNCE0_2_lsb 0 ++#define xd_p_reg_sdio_FUNCE0_3_7_0 (*(volatile byte xdata *) 0xF18D) ++#define p_reg_sdio_FUNCE0_3_7_0 0xF18D ++#define reg_sdio_FUNCE0_3_7_0_pos 0 ++#define reg_sdio_FUNCE0_3_7_0_len 8 ++#define reg_sdio_FUNCE0_3_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE0_3_15_8 (*(volatile byte xdata *) 0xF18E) ++#define p_reg_sdio_FUNCE0_3_15_8 0xF18E ++#define reg_sdio_FUNCE0_3_15_8_pos 0 ++#define reg_sdio_FUNCE0_3_15_8_len 8 ++#define reg_sdio_FUNCE0_3_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE0_5 (*(volatile byte xdata *) 0xF18F) ++#define p_reg_sdio_FUNCE0_5 0xF18F ++#define reg_sdio_FUNCE0_5_pos 0 ++#define reg_sdio_FUNCE0_5_len 8 ++#define reg_sdio_FUNCE0_5_lsb 0 ++#define xd_p_reg_sdio_VERS_10_0 (*(volatile byte xdata *) 0xF190) ++#define p_reg_sdio_VERS_10_0 0xF190 ++#define reg_sdio_VERS_10_0_pos 0 ++#define reg_sdio_VERS_10_0_len 8 ++#define reg_sdio_VERS_10_0_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1 (*(volatile byte xdata *) 0xF191) ++#define p_reg_sdio_VERS_10_1 0xF191 ++#define reg_sdio_VERS_10_1_pos 0 ++#define reg_sdio_VERS_10_1_len 8 ++#define reg_sdio_VERS_10_1_lsb 0 ++#define xd_p_reg_sdio_VERS_10_2 (*(volatile byte xdata *) 0xF192) ++#define p_reg_sdio_VERS_10_2 0xF192 ++#define reg_sdio_VERS_10_2_pos 0 ++#define reg_sdio_VERS_10_2_len 8 ++#define reg_sdio_VERS_10_2_lsb 0 ++#define xd_p_reg_sdio_VERS_10_3 (*(volatile byte xdata *) 0xF193) ++#define p_reg_sdio_VERS_10_3 0xF193 ++#define reg_sdio_VERS_10_3_pos 0 ++#define reg_sdio_VERS_10_3_len 8 ++#define reg_sdio_VERS_10_3_lsb 0 ++#define xd_p_reg_sdio_VERS_10_4 (*(volatile byte xdata *) 0xF194) ++#define p_reg_sdio_VERS_10_4 0xF194 ++#define reg_sdio_VERS_10_4_pos 0 ++#define reg_sdio_VERS_10_4_len 8 ++#define reg_sdio_VERS_10_4_lsb 0 ++#define xd_p_reg_sdio_VERS_10_5 (*(volatile byte xdata *) 0xF195) ++#define p_reg_sdio_VERS_10_5 0xF195 ++#define reg_sdio_VERS_10_5_pos 0 ++#define reg_sdio_VERS_10_5_len 8 ++#define reg_sdio_VERS_10_5_lsb 0 ++#define xd_p_reg_sdio_VERS_10_6 (*(volatile byte xdata *) 0xF196) ++#define p_reg_sdio_VERS_10_6 0xF196 ++#define reg_sdio_VERS_10_6_pos 0 ++#define reg_sdio_VERS_10_6_len 8 ++#define reg_sdio_VERS_10_6_lsb 0 ++#define xd_p_reg_sdio_VERS_10_7 (*(volatile byte xdata *) 0xF197) ++#define p_reg_sdio_VERS_10_7 0xF197 ++#define reg_sdio_VERS_10_7_pos 0 ++#define reg_sdio_VERS_10_7_len 8 ++#define reg_sdio_VERS_10_7_lsb 0 ++#define xd_p_reg_sdio_VERS_10_8 (*(volatile byte xdata *) 0xF198) ++#define p_reg_sdio_VERS_10_8 0xF198 ++#define reg_sdio_VERS_10_8_pos 0 ++#define reg_sdio_VERS_10_8_len 8 ++#define reg_sdio_VERS_10_8_lsb 0 ++#define xd_p_reg_sdio_VERS_10_9 (*(volatile byte xdata *) 0xF199) ++#define p_reg_sdio_VERS_10_9 0xF199 ++#define reg_sdio_VERS_10_9_pos 0 ++#define reg_sdio_VERS_10_9_len 8 ++#define reg_sdio_VERS_10_9_lsb 0 ++#define xd_p_reg_sdio_VERS_10_A (*(volatile byte xdata *) 0xF19A) ++#define p_reg_sdio_VERS_10_A 0xF19A ++#define reg_sdio_VERS_10_A_pos 0 ++#define reg_sdio_VERS_10_A_len 8 ++#define reg_sdio_VERS_10_A_lsb 0 ++#define xd_p_reg_sdio_VERS_10_B (*(volatile byte xdata *) 0xF19B) ++#define p_reg_sdio_VERS_10_B 0xF19B ++#define reg_sdio_VERS_10_B_pos 0 ++#define reg_sdio_VERS_10_B_len 8 ++#define reg_sdio_VERS_10_B_lsb 0 ++#define xd_p_reg_sdio_VERS_10_C (*(volatile byte xdata *) 0xF19C) ++#define p_reg_sdio_VERS_10_C 0xF19C ++#define reg_sdio_VERS_10_C_pos 0 ++#define reg_sdio_VERS_10_C_len 8 ++#define reg_sdio_VERS_10_C_lsb 0 ++#define xd_p_reg_sdio_VERS_10_D (*(volatile byte xdata *) 0xF19D) ++#define p_reg_sdio_VERS_10_D 0xF19D ++#define reg_sdio_VERS_10_D_pos 0 ++#define reg_sdio_VERS_10_D_len 8 ++#define reg_sdio_VERS_10_D_lsb 0 ++#define xd_p_reg_sdio_VERS_10_E (*(volatile byte xdata *) 0xF19E) ++#define p_reg_sdio_VERS_10_E 0xF19E ++#define reg_sdio_VERS_10_E_pos 0 ++#define reg_sdio_VERS_10_E_len 8 ++#define reg_sdio_VERS_10_E_lsb 0 ++#define xd_p_reg_sdio_VERS_10_F (*(volatile byte xdata *) 0xF19F) ++#define p_reg_sdio_VERS_10_F 0xF19F ++#define reg_sdio_VERS_10_F_pos 0 ++#define reg_sdio_VERS_10_F_len 8 ++#define reg_sdio_VERS_10_F_lsb 0 ++#define xd_p_reg_sdio_VERS_10_10 (*(volatile byte xdata *) 0xF1A0) ++#define p_reg_sdio_VERS_10_10 0xF1A0 ++#define reg_sdio_VERS_10_10_pos 0 ++#define reg_sdio_VERS_10_10_len 8 ++#define reg_sdio_VERS_10_10_lsb 0 ++#define xd_p_reg_sdio_VERS_10_11 (*(volatile byte xdata *) 0xF1A1) ++#define p_reg_sdio_VERS_10_11 0xF1A1 ++#define reg_sdio_VERS_10_11_pos 0 ++#define reg_sdio_VERS_10_11_len 8 ++#define reg_sdio_VERS_10_11_lsb 0 ++#define xd_p_reg_sdio_VERS_10_12 (*(volatile byte xdata *) 0xF1A2) ++#define p_reg_sdio_VERS_10_12 0xF1A2 ++#define reg_sdio_VERS_10_12_pos 0 ++#define reg_sdio_VERS_10_12_len 8 ++#define reg_sdio_VERS_10_12_lsb 0 ++#define xd_p_reg_sdio_VERS_10_13 (*(volatile byte xdata *) 0xF1A3) ++#define p_reg_sdio_VERS_10_13 0xF1A3 ++#define reg_sdio_VERS_10_13_pos 0 ++#define reg_sdio_VERS_10_13_len 8 ++#define reg_sdio_VERS_10_13_lsb 0 ++#define xd_p_reg_sdio_VERS_10_14 (*(volatile byte xdata *) 0xF1A4) ++#define p_reg_sdio_VERS_10_14 0xF1A4 ++#define reg_sdio_VERS_10_14_pos 0 ++#define reg_sdio_VERS_10_14_len 8 ++#define reg_sdio_VERS_10_14_lsb 0 ++#define xd_p_reg_sdio_VERS_10_15 (*(volatile byte xdata *) 0xF1A5) ++#define p_reg_sdio_VERS_10_15 0xF1A5 ++#define reg_sdio_VERS_10_15_pos 0 ++#define reg_sdio_VERS_10_15_len 8 ++#define reg_sdio_VERS_10_15_lsb 0 ++#define xd_p_reg_sdio_VERS_10_16 (*(volatile byte xdata *) 0xF1A6) ++#define p_reg_sdio_VERS_10_16 0xF1A6 ++#define reg_sdio_VERS_10_16_pos 0 ++#define reg_sdio_VERS_10_16_len 8 ++#define reg_sdio_VERS_10_16_lsb 0 ++#define xd_p_reg_sdio_VERS_10_17 (*(volatile byte xdata *) 0xF1A7) ++#define p_reg_sdio_VERS_10_17 0xF1A7 ++#define reg_sdio_VERS_10_17_pos 0 ++#define reg_sdio_VERS_10_17_len 8 ++#define reg_sdio_VERS_10_17_lsb 0 ++#define xd_p_reg_sdio_VERS_10_18 (*(volatile byte xdata *) 0xF1A8) ++#define p_reg_sdio_VERS_10_18 0xF1A8 ++#define reg_sdio_VERS_10_18_pos 0 ++#define reg_sdio_VERS_10_18_len 8 ++#define reg_sdio_VERS_10_18_lsb 0 ++#define xd_p_reg_sdio_VERS_10_19 (*(volatile byte xdata *) 0xF1A9) ++#define p_reg_sdio_VERS_10_19 0xF1A9 ++#define reg_sdio_VERS_10_19_pos 0 ++#define reg_sdio_VERS_10_19_len 8 ++#define reg_sdio_VERS_10_19_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1A (*(volatile byte xdata *) 0xF1AA) ++#define p_reg_sdio_VERS_10_1A 0xF1AA ++#define reg_sdio_VERS_10_1A_pos 0 ++#define reg_sdio_VERS_10_1A_len 8 ++#define reg_sdio_VERS_10_1A_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1B (*(volatile byte xdata *) 0xF1AB) ++#define p_reg_sdio_VERS_10_1B 0xF1AB ++#define reg_sdio_VERS_10_1B_pos 0 ++#define reg_sdio_VERS_10_1B_len 8 ++#define reg_sdio_VERS_10_1B_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1C (*(volatile byte xdata *) 0xF1AC) ++#define p_reg_sdio_VERS_10_1C 0xF1AC ++#define reg_sdio_VERS_10_1C_pos 0 ++#define reg_sdio_VERS_10_1C_len 8 ++#define reg_sdio_VERS_10_1C_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1D (*(volatile byte xdata *) 0xF1AD) ++#define p_reg_sdio_VERS_10_1D 0xF1AD ++#define reg_sdio_VERS_10_1D_pos 0 ++#define reg_sdio_VERS_10_1D_len 8 ++#define reg_sdio_VERS_10_1D_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1E (*(volatile byte xdata *) 0xF1AE) ++#define p_reg_sdio_VERS_10_1E 0xF1AE ++#define reg_sdio_VERS_10_1E_pos 0 ++#define reg_sdio_VERS_10_1E_len 8 ++#define reg_sdio_VERS_10_1E_lsb 0 ++#define xd_p_reg_sdio_VERS_10_1F (*(volatile byte xdata *) 0xF1AF) ++#define p_reg_sdio_VERS_10_1F 0xF1AF ++#define reg_sdio_VERS_10_1F_pos 0 ++#define reg_sdio_VERS_10_1F_len 8 ++#define reg_sdio_VERS_10_1F_lsb 0 ++#define xd_p_reg_sdio_VERS_10_20 (*(volatile byte xdata *) 0xF1B0) ++#define p_reg_sdio_VERS_10_20 0xF1B0 ++#define reg_sdio_VERS_10_20_pos 0 ++#define reg_sdio_VERS_10_20_len 8 ++#define reg_sdio_VERS_10_20_lsb 0 ++#define xd_p_reg_sdio_VERS_10_21 (*(volatile byte xdata *) 0xF1B1) ++#define p_reg_sdio_VERS_10_21 0xF1B1 ++#define reg_sdio_VERS_10_21_pos 0 ++#define reg_sdio_VERS_10_21_len 8 ++#define reg_sdio_VERS_10_21_lsb 0 ++#define xd_p_reg_sdio_VERS_10_22 (*(volatile byte xdata *) 0xF1B2) ++#define p_reg_sdio_VERS_10_22 0xF1B2 ++#define reg_sdio_VERS_10_22_pos 0 ++#define reg_sdio_VERS_10_22_len 8 ++#define reg_sdio_VERS_10_22_lsb 0 ++#define xd_p_reg_sdio_VERS_10_23 (*(volatile byte xdata *) 0xF1B3) ++#define p_reg_sdio_VERS_10_23 0xF1B3 ++#define reg_sdio_VERS_10_23_pos 0 ++#define reg_sdio_VERS_10_23_len 8 ++#define reg_sdio_VERS_10_23_lsb 0 ++#define xd_p_reg_sdio_VERS_10_24 (*(volatile byte xdata *) 0xF1B4) ++#define p_reg_sdio_VERS_10_24 0xF1B4 ++#define reg_sdio_VERS_10_24_pos 0 ++#define reg_sdio_VERS_10_24_len 8 ++#define reg_sdio_VERS_10_24_lsb 0 ++#define xd_p_reg_sdio_VERS_10_25 (*(volatile byte xdata *) 0xF1B5) ++#define p_reg_sdio_VERS_10_25 0xF1B5 ++#define reg_sdio_VERS_10_25_pos 0 ++#define reg_sdio_VERS_10_25_len 8 ++#define reg_sdio_VERS_10_25_lsb 0 ++#define xd_p_reg_sdio_VERS_10_26 (*(volatile byte xdata *) 0xF1B6) ++#define p_reg_sdio_VERS_10_26 0xF1B6 ++#define reg_sdio_VERS_10_26_pos 0 ++#define reg_sdio_VERS_10_26_len 8 ++#define reg_sdio_VERS_10_26_lsb 0 ++#define xd_p_reg_sdio_VERS_10_27 (*(volatile byte xdata *) 0xF1B7) ++#define p_reg_sdio_VERS_10_27 0xF1B7 ++#define reg_sdio_VERS_10_27_pos 0 ++#define reg_sdio_VERS_10_27_len 8 ++#define reg_sdio_VERS_10_27_lsb 0 ++#define xd_p_reg_sdio_END0 (*(volatile byte xdata *) 0xF1B8) ++#define p_reg_sdio_END0 0xF1B8 ++#define reg_sdio_END0_pos 0 ++#define reg_sdio_END0_len 8 ++#define reg_sdio_END0_lsb 0 ++#define xd_p_reg_sdio_FUNCID1_0 (*(volatile byte xdata *) 0xF1C0) ++#define p_reg_sdio_FUNCID1_0 0xF1C0 ++#define reg_sdio_FUNCID1_0_pos 0 ++#define reg_sdio_FUNCID1_0_len 8 ++#define reg_sdio_FUNCID1_0_lsb 0 ++#define xd_p_reg_sdio_FUNCID1_1 (*(volatile byte xdata *) 0xF1C1) ++#define p_reg_sdio_FUNCID1_1 0xF1C1 ++#define reg_sdio_FUNCID1_1_pos 0 ++#define reg_sdio_FUNCID1_1_len 8 ++#define reg_sdio_FUNCID1_1_lsb 0 ++#define xd_p_reg_sdio_FUNCID1_2 (*(volatile byte xdata *) 0xF1C2) ++#define p_reg_sdio_FUNCID1_2 0xF1C2 ++#define reg_sdio_FUNCID1_2_pos 0 ++#define reg_sdio_FUNCID1_2_len 8 ++#define reg_sdio_FUNCID1_2_lsb 0 ++#define xd_p_reg_sdio_FUNCID1_3 (*(volatile byte xdata *) 0xF1C3) ++#define p_reg_sdio_FUNCID1_3 0xF1C3 ++#define reg_sdio_FUNCID1_3_pos 0 ++#define reg_sdio_FUNCID1_3_len 8 ++#define reg_sdio_FUNCID1_3_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_0 (*(volatile byte xdata *) 0xF1C4) ++#define p_reg_sdio_FUNCE1_0 0xF1C4 ++#define reg_sdio_FUNCE1_0_pos 0 ++#define reg_sdio_FUNCE1_0_len 8 ++#define reg_sdio_FUNCE1_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_1 (*(volatile byte xdata *) 0xF1C5) ++#define p_reg_sdio_FUNCE1_1 0xF1C5 ++#define reg_sdio_FUNCE1_1_pos 0 ++#define reg_sdio_FUNCE1_1_len 8 ++#define reg_sdio_FUNCE1_1_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_2 (*(volatile byte xdata *) 0xF1C6) ++#define p_reg_sdio_FUNCE1_2 0xF1C6 ++#define reg_sdio_FUNCE1_2_pos 0 ++#define reg_sdio_FUNCE1_2_len 8 ++#define reg_sdio_FUNCE1_2_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_3 (*(volatile byte xdata *) 0xF1C7) ++#define p_reg_sdio_FUNCE1_3 0xF1C7 ++#define reg_sdio_FUNCE1_3_pos 0 ++#define reg_sdio_FUNCE1_3_len 8 ++#define reg_sdio_FUNCE1_3_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_4 (*(volatile byte xdata *) 0xF1C8) ++#define p_reg_sdio_FUNCE1_4 0xF1C8 ++#define reg_sdio_FUNCE1_4_pos 0 ++#define reg_sdio_FUNCE1_4_len 8 ++#define reg_sdio_FUNCE1_4_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_5_7_0 (*(volatile byte xdata *) 0xF1C9) ++#define p_reg_sdio_FUNCE1_5_7_0 0xF1C9 ++#define reg_sdio_FUNCE1_5_7_0_pos 0 ++#define reg_sdio_FUNCE1_5_7_0_len 8 ++#define reg_sdio_FUNCE1_5_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_5_15_8 (*(volatile byte xdata *) 0xF1CA) ++#define p_reg_sdio_FUNCE1_5_15_8 0xF1CA ++#define reg_sdio_FUNCE1_5_15_8_pos 0 ++#define reg_sdio_FUNCE1_5_15_8_len 8 ++#define reg_sdio_FUNCE1_5_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_5_23_16 (*(volatile byte xdata *) 0xF1CB) ++#define p_reg_sdio_FUNCE1_5_23_16 0xF1CB ++#define reg_sdio_FUNCE1_5_23_16_pos 0 ++#define reg_sdio_FUNCE1_5_23_16_len 8 ++#define reg_sdio_FUNCE1_5_23_16_lsb 16 ++#define xd_p_reg_sdio_FUNCE1_5_31_24 (*(volatile byte xdata *) 0xF1CC) ++#define p_reg_sdio_FUNCE1_5_31_24 0xF1CC ++#define reg_sdio_FUNCE1_5_31_24_pos 0 ++#define reg_sdio_FUNCE1_5_31_24_len 8 ++#define reg_sdio_FUNCE1_5_31_24_lsb 24 ++#define xd_p_reg_sdio_FUNCE1_9_7_0 (*(volatile byte xdata *) 0xF1CD) ++#define p_reg_sdio_FUNCE1_9_7_0 0xF1CD ++#define reg_sdio_FUNCE1_9_7_0_pos 0 ++#define reg_sdio_FUNCE1_9_7_0_len 8 ++#define reg_sdio_FUNCE1_9_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_9_15_8 (*(volatile byte xdata *) 0xF1CE) ++#define p_reg_sdio_FUNCE1_9_15_8 0xF1CE ++#define reg_sdio_FUNCE1_9_15_8_pos 0 ++#define reg_sdio_FUNCE1_9_15_8_len 8 ++#define reg_sdio_FUNCE1_9_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_9_23_16 (*(volatile byte xdata *) 0xF1CF) ++#define p_reg_sdio_FUNCE1_9_23_16 0xF1CF ++#define reg_sdio_FUNCE1_9_23_16_pos 0 ++#define reg_sdio_FUNCE1_9_23_16_len 8 ++#define reg_sdio_FUNCE1_9_23_16_lsb 16 ++#define xd_p_reg_sdio_FUNCE1_9_31_24 (*(volatile byte xdata *) 0xF1D0) ++#define p_reg_sdio_FUNCE1_9_31_24 0xF1D0 ++#define reg_sdio_FUNCE1_9_31_24_pos 0 ++#define reg_sdio_FUNCE1_9_31_24_len 8 ++#define reg_sdio_FUNCE1_9_31_24_lsb 24 ++#define xd_p_reg_sdio_FUNCE1_D (*(volatile byte xdata *) 0xF1D1) ++#define p_reg_sdio_FUNCE1_D 0xF1D1 ++#define reg_sdio_FUNCE1_D_pos 0 ++#define reg_sdio_FUNCE1_D_len 8 ++#define reg_sdio_FUNCE1_D_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_E_7_0 (*(volatile byte xdata *) 0xF1D2) ++#define p_reg_sdio_FUNCE1_E_7_0 0xF1D2 ++#define reg_sdio_FUNCE1_E_7_0_pos 0 ++#define reg_sdio_FUNCE1_E_7_0_len 8 ++#define reg_sdio_FUNCE1_E_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_E_15_8 (*(volatile byte xdata *) 0xF1D3) ++#define p_reg_sdio_FUNCE1_E_15_8 0xF1D3 ++#define reg_sdio_FUNCE1_E_15_8_pos 0 ++#define reg_sdio_FUNCE1_E_15_8_len 8 ++#define reg_sdio_FUNCE1_E_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_10_7_0 (*(volatile byte xdata *) 0xF1D4) ++#define p_reg_sdio_FUNCE1_10_7_0 0xF1D4 ++#define reg_sdio_FUNCE1_10_7_0_pos 0 ++#define reg_sdio_FUNCE1_10_7_0_len 8 ++#define reg_sdio_FUNCE1_10_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_10_15_8 (*(volatile byte xdata *) 0xF1D5) ++#define p_reg_sdio_FUNCE1_10_15_8 0xF1D5 ++#define reg_sdio_FUNCE1_10_15_8_pos 0 ++#define reg_sdio_FUNCE1_10_15_8_len 8 ++#define reg_sdio_FUNCE1_10_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_10_23_16 (*(volatile byte xdata *) 0xF1D6) ++#define p_reg_sdio_FUNCE1_10_23_16 0xF1D6 ++#define reg_sdio_FUNCE1_10_23_16_pos 0 ++#define reg_sdio_FUNCE1_10_23_16_len 8 ++#define reg_sdio_FUNCE1_10_23_16_lsb 16 ++#define xd_p_reg_sdio_FUNCE1_10_31_24 (*(volatile byte xdata *) 0xF1D7) ++#define p_reg_sdio_FUNCE1_10_31_24 0xF1D7 ++#define reg_sdio_FUNCE1_10_31_24_pos 0 ++#define reg_sdio_FUNCE1_10_31_24_len 8 ++#define reg_sdio_FUNCE1_10_31_24_lsb 24 ++#define xd_p_reg_sdio_FUNCE1_14 (*(volatile byte xdata *) 0xF1D8) ++#define p_reg_sdio_FUNCE1_14 0xF1D8 ++#define reg_sdio_FUNCE1_14_pos 0 ++#define reg_sdio_FUNCE1_14_len 8 ++#define reg_sdio_FUNCE1_14_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_15 (*(volatile byte xdata *) 0xF1D9) ++#define p_reg_sdio_FUNCE1_15 0xF1D9 ++#define reg_sdio_FUNCE1_15_pos 0 ++#define reg_sdio_FUNCE1_15_len 8 ++#define reg_sdio_FUNCE1_15_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_16 (*(volatile byte xdata *) 0xF1DA) ++#define p_reg_sdio_FUNCE1_16 0xF1DA ++#define reg_sdio_FUNCE1_16_pos 0 ++#define reg_sdio_FUNCE1_16_len 8 ++#define reg_sdio_FUNCE1_16_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_17 (*(volatile byte xdata *) 0xF1DB) ++#define p_reg_sdio_FUNCE1_17 0xF1DB ++#define reg_sdio_FUNCE1_17_pos 0 ++#define reg_sdio_FUNCE1_17_len 8 ++#define reg_sdio_FUNCE1_17_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_18 (*(volatile byte xdata *) 0xF1DC) ++#define p_reg_sdio_FUNCE1_18 0xF1DC ++#define reg_sdio_FUNCE1_18_pos 0 ++#define reg_sdio_FUNCE1_18_len 8 ++#define reg_sdio_FUNCE1_18_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_19 (*(volatile byte xdata *) 0xF1DD) ++#define p_reg_sdio_FUNCE1_19 0xF1DD ++#define reg_sdio_FUNCE1_19_pos 0 ++#define reg_sdio_FUNCE1_19_len 8 ++#define reg_sdio_FUNCE1_19_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_1A_7_0 (*(volatile byte xdata *) 0xF1DE) ++#define p_reg_sdio_FUNCE1_1A_7_0 0xF1DE ++#define reg_sdio_FUNCE1_1A_7_0_pos 0 ++#define reg_sdio_FUNCE1_1A_7_0_len 8 ++#define reg_sdio_FUNCE1_1A_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_1A_15_8 (*(volatile byte xdata *) 0xF1DF) ++#define p_reg_sdio_FUNCE1_1A_15_8 0xF1DF ++#define reg_sdio_FUNCE1_1A_15_8_pos 0 ++#define reg_sdio_FUNCE1_1A_15_8_len 8 ++#define reg_sdio_FUNCE1_1A_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_1C_7_0 (*(volatile byte xdata *) 0xF1E0) ++#define p_reg_sdio_FUNCE1_1C_7_0 0xF1E0 ++#define reg_sdio_FUNCE1_1C_7_0_pos 0 ++#define reg_sdio_FUNCE1_1C_7_0_len 8 ++#define reg_sdio_FUNCE1_1C_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_1C_15_8 (*(volatile byte xdata *) 0xF1E1) ++#define p_reg_sdio_FUNCE1_1C_15_8 0xF1E1 ++#define reg_sdio_FUNCE1_1C_15_8_pos 0 ++#define reg_sdio_FUNCE1_1C_15_8_len 8 ++#define reg_sdio_FUNCE1_1C_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_1E_7_0 (*(volatile byte xdata *) 0xF1E2) ++#define p_reg_sdio_FUNCE1_1E_7_0 0xF1E2 ++#define reg_sdio_FUNCE1_1E_7_0_pos 0 ++#define reg_sdio_FUNCE1_1E_7_0_len 8 ++#define reg_sdio_FUNCE1_1E_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_1E_15_8 (*(volatile byte xdata *) 0xF1E3) ++#define p_reg_sdio_FUNCE1_1E_15_8 0xF1E3 ++#define reg_sdio_FUNCE1_1E_15_8_pos 0 ++#define reg_sdio_FUNCE1_1E_15_8_len 8 ++#define reg_sdio_FUNCE1_1E_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_20_7_0 (*(volatile byte xdata *) 0xF1E4) ++#define p_reg_sdio_FUNCE1_20_7_0 0xF1E4 ++#define reg_sdio_FUNCE1_20_7_0_pos 0 ++#define reg_sdio_FUNCE1_20_7_0_len 8 ++#define reg_sdio_FUNCE1_20_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_20_15_8 (*(volatile byte xdata *) 0xF1E5) ++#define p_reg_sdio_FUNCE1_20_15_8 0xF1E5 ++#define reg_sdio_FUNCE1_20_15_8_pos 0 ++#define reg_sdio_FUNCE1_20_15_8_len 8 ++#define reg_sdio_FUNCE1_20_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_22_7_0 (*(volatile byte xdata *) 0xF1E6) ++#define p_reg_sdio_FUNCE1_22_7_0 0xF1E6 ++#define reg_sdio_FUNCE1_22_7_0_pos 0 ++#define reg_sdio_FUNCE1_22_7_0_len 8 ++#define reg_sdio_FUNCE1_22_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_22_15_8 (*(volatile byte xdata *) 0xF1E7) ++#define p_reg_sdio_FUNCE1_22_15_8 0xF1E7 ++#define reg_sdio_FUNCE1_22_15_8_pos 0 ++#define reg_sdio_FUNCE1_22_15_8_len 8 ++#define reg_sdio_FUNCE1_22_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_24_7_0 (*(volatile byte xdata *) 0xF1E8) ++#define p_reg_sdio_FUNCE1_24_7_0 0xF1E8 ++#define reg_sdio_FUNCE1_24_7_0_pos 0 ++#define reg_sdio_FUNCE1_24_7_0_len 8 ++#define reg_sdio_FUNCE1_24_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_24_15_8 (*(volatile byte xdata *) 0xF1E9) ++#define p_reg_sdio_FUNCE1_24_15_8 0xF1E9 ++#define reg_sdio_FUNCE1_24_15_8_pos 0 ++#define reg_sdio_FUNCE1_24_15_8_len 8 ++#define reg_sdio_FUNCE1_24_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_26_7_0 (*(volatile byte xdata *) 0xF1EA) ++#define p_reg_sdio_FUNCE1_26_7_0 0xF1EA ++#define reg_sdio_FUNCE1_26_7_0_pos 0 ++#define reg_sdio_FUNCE1_26_7_0_len 8 ++#define reg_sdio_FUNCE1_26_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_26_15_8 (*(volatile byte xdata *) 0xF1EB) ++#define p_reg_sdio_FUNCE1_26_15_8 0xF1EB ++#define reg_sdio_FUNCE1_26_15_8_pos 0 ++#define reg_sdio_FUNCE1_26_15_8_len 8 ++#define reg_sdio_FUNCE1_26_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_28_7_0 (*(volatile byte xdata *) 0xF1EC) ++#define p_reg_sdio_FUNCE1_28_7_0 0xF1EC ++#define reg_sdio_FUNCE1_28_7_0_pos 0 ++#define reg_sdio_FUNCE1_28_7_0_len 8 ++#define reg_sdio_FUNCE1_28_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_28_15_8 (*(volatile byte xdata *) 0xF1ED) ++#define p_reg_sdio_FUNCE1_28_15_8 0xF1ED ++#define reg_sdio_FUNCE1_28_15_8_pos 0 ++#define reg_sdio_FUNCE1_28_15_8_len 8 ++#define reg_sdio_FUNCE1_28_15_8_lsb 8 ++#define xd_p_reg_sdio_FUNCE1_2A_7_0 (*(volatile byte xdata *) 0xF1EE) ++#define p_reg_sdio_FUNCE1_2A_7_0 0xF1EE ++#define reg_sdio_FUNCE1_2A_7_0_pos 0 ++#define reg_sdio_FUNCE1_2A_7_0_len 8 ++#define reg_sdio_FUNCE1_2A_7_0_lsb 0 ++#define xd_p_reg_sdio_FUNCE1_2A_15_8 (*(volatile byte xdata *) 0xF1EF) ++#define p_reg_sdio_FUNCE1_2A_15_8 0xF1EF ++#define reg_sdio_FUNCE1_2A_15_8_pos 0 ++#define reg_sdio_FUNCE1_2A_15_8_len 8 ++#define reg_sdio_FUNCE1_2A_15_8_lsb 8 ++#define xd_p_reg_sdio_END1 (*(volatile byte xdata *) 0xF1F0) ++#define p_reg_sdio_END1 0xF1F0 ++#define reg_sdio_END1_pos 0 ++#define reg_sdio_END1_len 8 ++#define reg_sdio_END1_lsb 0 ++#define xd_r_sdioc_tx_fifo_empty (*(volatile byte xdata *) 0xF210) ++#define r_sdioc_tx_fifo_empty 0xF210 ++#define sdioc_tx_fifo_empty_pos 0 ++#define sdioc_tx_fifo_empty_len 1 ++#define sdioc_tx_fifo_empty_lsb 0 ++#define xd_p_reg_sdio_53ra (*(volatile byte xdata *) 0xF210) ++#define p_reg_sdio_53ra 0xF210 ++#define reg_sdio_53ra_pos 1 ++#define reg_sdio_53ra_len 1 ++#define reg_sdio_53ra_lsb 0 ++#define xd_p_reg_sdioc_rd_wait_dly (*(volatile byte xdata *) 0xF210) ++#define p_reg_sdioc_rd_wait_dly 0xF210 ++#define reg_sdioc_rd_wait_dly_pos 4 ++#define reg_sdioc_rd_wait_dly_len 2 ++#define reg_sdioc_rd_wait_dly_lsb 0 ++#define xd_p_reg_write_mbx_complete (*(volatile byte xdata *) 0xF211) ++#define p_reg_write_mbx_complete 0xF211 ++#define reg_write_mbx_complete_pos 0 ++#define reg_write_mbx_complete_len 1 ++#define reg_write_mbx_complete_lsb 0 ++#define xd_p_reg_sdioc_sw_err (*(volatile byte xdata *) 0xF211) ++#define p_reg_sdioc_sw_err 0xF211 ++#define reg_sdioc_sw_err_pos 1 ++#define reg_sdioc_sw_err_len 1 ++#define reg_sdioc_sw_err_lsb 0 ++#define xd_p_reg_sdioc_tran_dat_dly (*(volatile byte xdata *) 0xF211) ++#define p_reg_sdioc_tran_dat_dly 0xF211 ++#define reg_sdioc_tran_dat_dly_pos 4 ++#define reg_sdioc_tran_dat_dly_len 3 ++#define reg_sdioc_tran_dat_dly_lsb 0 ++#define xd_p_reg_sdioc_external_int_en (*(volatile byte xdata *) 0xF212) ++#define p_reg_sdioc_external_int_en 0xF212 ++#define reg_sdioc_external_int_en_pos 1 ++#define reg_sdioc_external_int_en_len 1 ++#define reg_sdioc_external_int_en_lsb 0 ++#define xd_r_reg_sdioc_external_int (*(volatile byte xdata *) 0xF212) ++#define r_reg_sdioc_external_int 0xF212 ++#define reg_sdioc_external_int_pos 2 ++#define reg_sdioc_external_int_len 1 ++#define reg_sdioc_external_int_lsb 0 ++#define xd_p_reg_auto_clrWB_en (*(volatile byte xdata *) 0xF213) ++#define p_reg_auto_clrWB_en 0xF213 ++#define reg_auto_clrWB_en_pos 0 ++#define reg_auto_clrWB_en_len 1 ++#define reg_auto_clrWB_en_lsb 0 ++#define xd_p_reg_sdioc_crc_s_dly (*(volatile byte xdata *) 0xF213) ++#define p_reg_sdioc_crc_s_dly 0xF213 ++#define reg_sdioc_crc_s_dly_pos 1 ++#define reg_sdioc_crc_s_dly_len 1 ++#define reg_sdioc_crc_s_dly_lsb 0 ++#define xd_p_reg_sdioc_neg_out_sel (*(volatile byte xdata *) 0xF213) ++#define p_reg_sdioc_neg_out_sel 0xF213 ++#define reg_sdioc_neg_out_sel_pos 2 ++#define reg_sdioc_neg_out_sel_len 1 ++#define reg_sdioc_neg_out_sel_lsb 0 ++#define xd_p_reg_sdioc_tx_fifo_rst (*(volatile byte xdata *) 0xF213) ++#define p_reg_sdioc_tx_fifo_rst 0xF213 ++#define reg_sdioc_tx_fifo_rst_pos 4 ++#define reg_sdioc_tx_fifo_rst_len 1 ++#define reg_sdioc_tx_fifo_rst_lsb 0 ++#define xd_p_reg_sdioc_rx_fifo_rst (*(volatile byte xdata *) 0xF213) ++#define p_reg_sdioc_rx_fifo_rst 0xF213 ++#define reg_sdioc_rx_fifo_rst_pos 5 ++#define reg_sdioc_rx_fifo_rst_len 1 ++#define reg_sdioc_rx_fifo_rst_lsb 0 ++#define xd_p_reg_sdioc_auto_rst_sm_en (*(volatile byte xdata *) 0xF213) ++#define p_reg_sdioc_auto_rst_sm_en 0xF213 ++#define reg_sdioc_auto_rst_sm_en_pos 6 ++#define reg_sdioc_auto_rst_sm_en_len 1 ++#define reg_sdioc_auto_rst_sm_en_lsb 0 ++#define xd_p_sdio_link_clr_Wbusy_en (*(volatile byte xdata *) 0xF214) ++#define p_sdio_link_clr_Wbusy_en 0xF214 ++#define sdio_link_clr_Wbusy_en_pos 0 ++#define sdio_link_clr_Wbusy_en_len 1 ++#define sdio_link_clr_Wbusy_en_lsb 0 ++#define xd_p_sdio_link_clr_Wbusy (*(volatile byte xdata *) 0xF214) ++#define p_sdio_link_clr_Wbusy 0xF214 ++#define sdio_link_clr_Wbusy_pos 1 ++#define sdio_link_clr_Wbusy_len 1 ++#define sdio_link_clr_Wbusy_lsb 0 ++#define xd_p_reg_sdioc_dbg_sel (*(volatile byte xdata *) 0xF214) ++#define p_reg_sdioc_dbg_sel 0xF214 ++#define reg_sdioc_dbg_sel_pos 4 ++#define reg_sdioc_dbg_sel_len 4 ++#define reg_sdioc_dbg_sel_lsb 0 ++#define xd_p_reg_sdioc_skip_ocr (*(volatile byte xdata *) 0xF215) ++#define p_reg_sdioc_skip_ocr 0xF215 ++#define reg_sdioc_skip_ocr_pos 0 ++#define reg_sdioc_skip_ocr_len 1 ++#define reg_sdioc_skip_ocr_lsb 0 ++#define xd_p_reg_sdioc_spi_ns (*(volatile byte xdata *) 0xF215) ++#define p_reg_sdioc_spi_ns 0xF215 ++#define reg_sdioc_spi_ns_pos 1 ++#define reg_sdioc_spi_ns_len 1 ++#define reg_sdioc_spi_ns_lsb 0 ++#define xd_r_sdio_spi_mode (*(volatile byte xdata *) 0xF215) ++#define r_sdio_spi_mode 0xF215 ++#define sdio_spi_mode_pos 7 ++#define sdio_spi_mode_len 1 ++#define sdio_spi_mode_lsb 0 ++#define xd_r_link_ofsm_mailbox_int (*(volatile byte xdata *) 0xF402) ++#define r_link_ofsm_mailbox_int 0xF402 ++#define link_ofsm_mailbox_int_pos 4 ++#define link_ofsm_mailbox_int_len 1 ++#define link_ofsm_mailbox_int_lsb 0 ++#define xd_r_link_ofsm_dvbt_int (*(volatile byte xdata *) 0xF403) ++#define r_link_ofsm_dvbt_int 0xF403 ++#define link_ofsm_dvbt_int_pos 2 ++#define link_ofsm_dvbt_int_len 1 ++#define link_ofsm_dvbt_int_lsb 0 ++#define xd_p_reg_dvbt_intsts (*(volatile byte xdata *) 0xF404) ++#define p_reg_dvbt_intsts 0xF404 ++#define reg_dvbt_intsts_pos 2 ++#define reg_dvbt_intsts_len 1 ++#define reg_dvbt_intsts_lsb 0 ++#define xd_p_reg_link_mailbox_int (*(volatile byte xdata *) 0xF405) ++#define p_reg_link_mailbox_int 0xF405 ++#define reg_link_mailbox_int_pos 5 ++#define reg_link_mailbox_int_len 1 ++#define reg_link_mailbox_int_lsb 0 ++#define xd_p_reg_mailbox_wptr_rst (*(volatile byte xdata *) 0xF408) ++#define p_reg_mailbox_wptr_rst 0xF408 ++#define reg_mailbox_wptr_rst_pos 0 ++#define reg_mailbox_wptr_rst_len 1 ++#define reg_mailbox_wptr_rst_lsb 0 ++#define xd_p_reg_link_mailbox_wptr (*(volatile byte xdata *) 0xF409) ++#define p_reg_link_mailbox_wptr 0xF409 ++#define reg_link_mailbox_wptr_pos 0 ++#define reg_link_mailbox_wptr_len 8 ++#define reg_link_mailbox_wptr_lsb 0 ++#define xd_p_reg_link_mailbox_wend (*(volatile byte xdata *) 0xF410) ++#define p_reg_link_mailbox_wend 0xF410 ++#define reg_link_mailbox_wend_pos 0 ++#define reg_link_mailbox_wend_len 1 ++#define reg_link_mailbox_wend_lsb 0 ++#define xd_p_reg_rd_data_sel (*(volatile byte xdata *) 0xF411) ++#define p_reg_rd_data_sel 0xF411 ++#define reg_rd_data_sel_pos 0 ++#define reg_rd_data_sel_len 2 ++#define reg_rd_data_sel_lsb 0 ++#define xd_p_reg_fifo_rd_length_7_0 (*(volatile byte xdata *) 0xF412) ++#define p_reg_fifo_rd_length_7_0 0xF412 ++#define reg_fifo_rd_length_7_0_pos 0 ++#define reg_fifo_rd_length_7_0_len 8 ++#define reg_fifo_rd_length_7_0_lsb 0 ++#define xd_p_reg_fifo_rd_length_15_8 (*(volatile byte xdata *) 0xF413) ++#define p_reg_fifo_rd_length_15_8 0xF413 ++#define reg_fifo_rd_length_15_8_pos 0 ++#define reg_fifo_rd_length_15_8_len 8 ++#define reg_fifo_rd_length_15_8_lsb 8 ++#define xd_p_reg_fifo_rd_length_17_16 (*(volatile byte xdata *) 0xF414) ++#define p_reg_fifo_rd_length_17_16 0xF414 ++#define reg_fifo_rd_length_17_16_pos 0 ++#define reg_fifo_rd_length_17_16_len 2 ++#define reg_fifo_rd_length_17_16_lsb 16 ++#define xd_p_reg_rst_fifo_rptr (*(volatile byte xdata *) 0xF414) ++#define p_reg_rst_fifo_rptr 0xF414 ++#define reg_rst_fifo_rptr_pos 6 ++#define reg_rst_fifo_rptr_len 1 ++#define reg_rst_fifo_rptr_lsb 0 ++#define xd_p_reg_force_sel (*(volatile byte xdata *) 0xF414) ++#define p_reg_force_sel 0xF414 ++#define reg_force_sel_pos 7 ++#define reg_force_sel_len 1 ++#define reg_force_sel_lsb 0 ++#define xd_p_reg_fifo_rptr_7_0 (*(volatile byte xdata *) 0xF415) ++#define p_reg_fifo_rptr_7_0 0xF415 ++#define reg_fifo_rptr_7_0_pos 0 ++#define reg_fifo_rptr_7_0_len 8 ++#define reg_fifo_rptr_7_0_lsb 0 ++#define xd_p_reg_fifo_rptr_15_8 (*(volatile byte xdata *) 0xF416) ++#define p_reg_fifo_rptr_15_8 0xF416 ++#define reg_fifo_rptr_15_8_pos 0 ++#define reg_fifo_rptr_15_8_len 8 ++#define reg_fifo_rptr_15_8_lsb 8 ++#define xd_p_reg_fifo_rptr_17_16 (*(volatile byte xdata *) 0xF417) ++#define p_reg_fifo_rptr_17_16 0xF417 ++#define reg_fifo_rptr_17_16_pos 0 ++#define reg_fifo_rptr_17_16_len 2 ++#define reg_fifo_rptr_17_16_lsb 16 ++#define xd_p_reg_max_package_size_7_0 (*(volatile byte xdata *) 0xF418) ++#define p_reg_max_package_size_7_0 0xF418 ++#define reg_max_package_size_7_0_pos 0 ++#define reg_max_package_size_7_0_len 8 ++#define reg_max_package_size_7_0_lsb 0 ++#define xd_p_reg_max_package_size_11_8 (*(volatile byte xdata *) 0xF419) ++#define p_reg_max_package_size_11_8 0xF419 ++#define reg_max_package_size_11_8_pos 0 ++#define reg_max_package_size_11_8_len 4 ++#define reg_max_package_size_11_8_lsb 8 ++#define xd_p_reg_dvbt_en (*(volatile byte xdata *) 0xF41A) ++#define p_reg_dvbt_en 0xF41A ++#define reg_dvbt_en_pos 0 ++#define reg_dvbt_en_len 1 ++#define reg_dvbt_en_lsb 0 ++#define xd_p_reg_dvbt_bufsize (*(volatile byte xdata *) 0xF41A) ++#define p_reg_dvbt_bufsize 0xF41A ++#define reg_dvbt_bufsize_pos 1 ++#define reg_dvbt_bufsize_len 1 ++#define reg_dvbt_bufsize_lsb 0 ++#define xd_p_reg_dvbt_path (*(volatile byte xdata *) 0xF41A) ++#define p_reg_dvbt_path 0xF41A ++#define reg_dvbt_path_pos 2 ++#define reg_dvbt_path_len 1 ++#define reg_dvbt_path_lsb 0 ++#define xd_p_reg_dvbt_r5 (*(volatile byte xdata *) 0xF41A) ++#define p_reg_dvbt_r5 0xF41A ++#define reg_dvbt_r5_pos 3 ++#define reg_dvbt_r5_len 1 ++#define reg_dvbt_r5_lsb 0 ++#define xd_p_reg_mailbox_inten (*(volatile byte xdata *) 0xF41E) ++#define p_reg_mailbox_inten 0xF41E ++#define reg_mailbox_inten_pos 4 ++#define reg_mailbox_inten_len 1 ++#define reg_mailbox_inten_lsb 0 ++#define xd_p_reg_dvbt_inten (*(volatile byte xdata *) 0xF41F) ++#define p_reg_dvbt_inten 0xF41F ++#define reg_dvbt_inten_pos 2 ++#define reg_dvbt_inten_len 1 ++#define reg_dvbt_inten_lsb 0 ++#define xd_r_link_ofsm_ip_length_7_0 (*(volatile byte xdata *) 0xF447) ++#define r_link_ofsm_ip_length_7_0 0xF447 ++#define link_ofsm_ip_length_7_0_pos 0 ++#define link_ofsm_ip_length_7_0_len 8 ++#define link_ofsm_ip_length_7_0_lsb 0 ++#define xd_r_link_ofsm_ip_length_11_8 (*(volatile byte xdata *) 0xF448) ++#define r_link_ofsm_ip_length_11_8 0xF448 ++#define link_ofsm_ip_length_11_8_pos 0 ++#define link_ofsm_ip_length_11_8_len 4 ++#define link_ofsm_ip_length_11_8_lsb 8 ++#define xd_r_link_ofsm_ip_valid (*(volatile byte xdata *) 0xF448) ++#define r_link_ofsm_ip_valid 0xF448 ++#define link_ofsm_ip_valid_pos 7 ++#define link_ofsm_ip_valid_len 1 ++#define link_ofsm_ip_valid_lsb 0 ++#define xd_p_reg_spi_master (*(volatile byte xdata *) 0xF600) ++#define p_reg_spi_master 0xF600 ++#define reg_spi_master_pos 0 ++#define reg_spi_master_len 1 ++#define reg_spi_master_lsb 0 ++#define xd_p_reg_spi_bit (*(volatile byte xdata *) 0xF601) ++#define p_reg_spi_bit 0xF601 ++#define reg_spi_bit_pos 0 ++#define reg_spi_bit_len 2 ++#define reg_spi_bit_lsb 0 ++#define xd_p_reg_spi_cs (*(volatile byte xdata *) 0xF602) ++#define p_reg_spi_cs 0xF602 ++#define reg_spi_cs_pos 0 ++#define reg_spi_cs_len 1 ++#define reg_spi_cs_lsb 0 ++#define xd_p_reg_spi_polarity (*(volatile byte xdata *) 0xF602) ++#define p_reg_spi_polarity 0xF602 ++#define reg_spi_polarity_pos 1 ++#define reg_spi_polarity_len 1 ++#define reg_spi_polarity_lsb 0 ++#define xd_p_reg_spi_phase (*(volatile byte xdata *) 0xF602) ++#define p_reg_spi_phase 0xF602 ++#define reg_spi_phase_pos 2 ++#define reg_spi_phase_len 1 ++#define reg_spi_phase_lsb 0 ++#define xd_p_reg_spi_1st_byte (*(volatile byte xdata *) 0xF603) ++#define p_reg_spi_1st_byte 0xF603 ++#define reg_spi_1st_byte_pos 0 ++#define reg_spi_1st_byte_len 4 ++#define reg_spi_1st_byte_lsb 0 ++#define xd_p_reg_spi_clk_div (*(volatile byte xdata *) 0xF603) ++#define p_reg_spi_clk_div 0xF603 ++#define reg_spi_clk_div_pos 4 ++#define reg_spi_clk_div_len 4 ++#define reg_spi_clk_div_lsb 0 ++#define xd_p_reg_spi_rst (*(volatile byte xdata *) 0xF604) ++#define p_reg_spi_rst 0xF604 ++#define reg_spi_rst_pos 0 ++#define reg_spi_rst_len 1 ++#define reg_spi_rst_lsb 0 ++#define xd_r_reg_spi_tx_done (*(volatile byte xdata *) 0xF604) ++#define r_reg_spi_tx_done 0xF604 ++#define reg_spi_tx_done_pos 1 ++#define reg_spi_tx_done_len 1 ++#define reg_spi_tx_done_lsb 0 ++#define xd_r_reg_spi_rx_done (*(volatile byte xdata *) 0xF604) ++#define r_reg_spi_rx_done 0xF604 ++#define reg_spi_rx_done_pos 2 ++#define reg_spi_rx_done_len 1 ++#define reg_spi_rx_done_lsb 0 ++#define xd_p_reg_spi_dbg_sel (*(volatile byte xdata *) 0xF604) ++#define p_reg_spi_dbg_sel 0xF604 ++#define reg_spi_dbg_sel_pos 3 ++#define reg_spi_dbg_sel_len 1 ++#define reg_spi_dbg_sel_lsb 0 ++#define xd_r_reg_spi_crc_err (*(volatile byte xdata *) 0xF604) ++#define r_reg_spi_crc_err 0xF604 ++#define reg_spi_crc_err_pos 4 ++#define reg_spi_crc_err_len 4 ++#define reg_spi_crc_err_lsb 0 ++#define xd_r_link_ofsm_usb20_mode (*(volatile byte xdata *) 0xF613) ++#define r_link_ofsm_usb20_mode 0xF613 ++#define link_ofsm_usb20_mode_pos 0 ++#define link_ofsm_usb20_mode_len 1 ++#define link_ofsm_usb20_mode_lsb 0 ++#define xd_r_link_ofsm_strap_usb20_mode (*(volatile byte xdata *) 0xF613) ++#define r_link_ofsm_strap_usb20_mode 0xF613 ++#define link_ofsm_strap_usb20_mode_pos 1 ++#define link_ofsm_strap_usb20_mode_len 1 ++#define link_ofsm_strap_usb20_mode_lsb 0 ++#define xd_p_reg_link_stick_mem_end_7_0 (*(volatile byte xdata *) 0xF618) ++#define p_reg_link_stick_mem_end_7_0 0xF618 ++#define reg_link_stick_mem_end_7_0_pos 0 ++#define reg_link_stick_mem_end_7_0_len 8 ++#define reg_link_stick_mem_end_7_0_lsb 0 ++#define xd_p_reg_link_stick_mem_end_15_8 (*(volatile byte xdata *) 0xF619) ++#define p_reg_link_stick_mem_end_15_8 0xF619 ++#define reg_link_stick_mem_end_15_8_pos 0 ++#define reg_link_stick_mem_end_15_8_len 8 ++#define reg_link_stick_mem_end_15_8_lsb 8 ++#define xd_p_reg_ofdm_auto_write_addr_l (*(volatile byte xdata *) 0xF61A) ++#define p_reg_ofdm_auto_write_addr_l 0xF61A ++#define reg_ofdm_auto_write_addr_l_pos 0 ++#define reg_ofdm_auto_write_addr_l_len 8 ++#define reg_ofdm_auto_write_addr_l_lsb 0 ++#define xd_p_reg_ofdm_auto_write_addr_h (*(volatile byte xdata *) 0xF61B) ++#define p_reg_ofdm_auto_write_addr_h 0xF61B ++#define reg_ofdm_auto_write_addr_h_pos 0 ++#define reg_ofdm_auto_write_addr_h_len 8 ++#define reg_ofdm_auto_write_addr_h_lsb 0 ++#define xd_p_reg_link_auto_write_addr_l (*(volatile byte xdata *) 0xF61C) ++#define p_reg_link_auto_write_addr_l 0xF61C ++#define reg_link_auto_write_addr_l_pos 0 ++#define reg_link_auto_write_addr_l_len 8 ++#define reg_link_auto_write_addr_l_lsb 0 ++#define xd_p_reg_link_auto_write_addr_h (*(volatile byte xdata *) 0xF61D) ++#define p_reg_link_auto_write_addr_h 0xF61D ++#define reg_link_auto_write_addr_h_pos 0 ++#define reg_link_auto_write_addr_h_len 8 ++#define reg_link_auto_write_addr_h_lsb 0 ++#define xd_p_reg_mailbox_auto_write_addr (*(volatile byte xdata *) 0xF61E) ++#define p_reg_mailbox_auto_write_addr 0xF61E ++#define reg_mailbox_auto_write_addr_pos 0 ++#define reg_mailbox_auto_write_addr_len 8 ++#define reg_mailbox_auto_write_addr_lsb 0 ++#define xd_p_reg_usbmem_auto_write_addr (*(volatile byte xdata *) 0xF61F) ++#define p_reg_usbmem_auto_write_addr 0xF61F ++#define reg_usbmem_auto_write_addr_pos 0 ++#define reg_usbmem_auto_write_addr_len 8 ++#define reg_usbmem_auto_write_addr_lsb 0 ++#define xd_p_reg_mailbox_auto_read_addr (*(volatile byte xdata *) 0xF620) ++#define p_reg_mailbox_auto_read_addr 0xF620 ++#define reg_mailbox_auto_read_addr_pos 0 ++#define reg_mailbox_auto_read_addr_len 8 ++#define reg_mailbox_auto_read_addr_lsb 0 ++#define xd_p_reg_usbmem_auto_read_addr (*(volatile byte xdata *) 0xF621) ++#define p_reg_usbmem_auto_read_addr 0xF621 ++#define reg_usbmem_auto_read_addr_pos 0 ++#define reg_usbmem_auto_read_addr_len 8 ++#define reg_usbmem_auto_read_addr_lsb 0 ++#define xd_p_reg_auto_write_ofdm (*(volatile byte xdata *) 0xF622) ++#define p_reg_auto_write_ofdm 0xF622 ++#define reg_auto_write_ofdm_pos 0 ++#define reg_auto_write_ofdm_len 1 ++#define reg_auto_write_ofdm_lsb 0 ++#define xd_p_reg_auto_write_link (*(volatile byte xdata *) 0xF622) ++#define p_reg_auto_write_link 0xF622 ++#define reg_auto_write_link_pos 1 ++#define reg_auto_write_link_len 1 ++#define reg_auto_write_link_lsb 0 ++#define xd_p_reg_auto_write_mailbox (*(volatile byte xdata *) 0xF622) ++#define p_reg_auto_write_mailbox 0xF622 ++#define reg_auto_write_mailbox_pos 2 ++#define reg_auto_write_mailbox_len 1 ++#define reg_auto_write_mailbox_lsb 0 ++#define xd_p_reg_auto_write_usbmem (*(volatile byte xdata *) 0xF622) ++#define p_reg_auto_write_usbmem 0xF622 ++#define reg_auto_write_usbmem_pos 3 ++#define reg_auto_write_usbmem_len 1 ++#define reg_auto_write_usbmem_lsb 0 ++#define xd_p_reg_auto_write_i2cm (*(volatile byte xdata *) 0xF622) ++#define p_reg_auto_write_i2cm 0xF622 ++#define reg_auto_write_i2cm_pos 4 ++#define reg_auto_write_i2cm_len 1 ++#define reg_auto_write_i2cm_lsb 0 ++#define xd_p_reg_auto_read_mailbox (*(volatile byte xdata *) 0xF623) ++#define p_reg_auto_read_mailbox 0xF623 ++#define reg_auto_read_mailbox_pos 0 ++#define reg_auto_read_mailbox_len 1 ++#define reg_auto_read_mailbox_lsb 0 ++#define xd_p_reg_auto_read_rom (*(volatile byte xdata *) 0xF623) ++#define p_reg_auto_read_rom 0xF623 ++#define reg_auto_read_rom_pos 1 ++#define reg_auto_read_rom_len 1 ++#define reg_auto_read_rom_lsb 0 ++#define xd_p_reg_auto_sum_l (*(volatile byte xdata *) 0xF624) ++#define p_reg_auto_sum_l 0xF624 ++#define reg_auto_sum_l_pos 0 ++#define reg_auto_sum_l_len 8 ++#define reg_auto_sum_l_lsb 0 ++#define xd_p_reg_auto_sum_h (*(volatile byte xdata *) 0xF625) ++#define p_reg_auto_sum_h 0xF625 ++#define reg_auto_sum_h_pos 0 ++#define reg_auto_sum_h_len 8 ++#define reg_auto_sum_h_lsb 0 ++#define xd_p_reg_auto_sum_to_h (*(volatile byte xdata *) 0xF626) ++#define p_reg_auto_sum_to_h 0xF626 ++#define reg_auto_sum_to_h_pos 0 ++#define reg_auto_sum_to_h_len 1 ++#define reg_auto_sum_to_h_lsb 0 ++#define xd_p_reg_auto_sum_en (*(volatile byte xdata *) 0xF627) ++#define p_reg_auto_sum_en 0xF627 ++#define reg_auto_sum_en_pos 0 ++#define reg_auto_sum_en_len 1 ++#define reg_auto_sum_en_lsb 0 ++#define xd_p_reg_rom_remap_begin_7_0 (*(volatile byte xdata *) 0xF628) ++#define p_reg_rom_remap_begin_7_0 0xF628 ++#define reg_rom_remap_begin_7_0_pos 0 ++#define reg_rom_remap_begin_7_0_len 8 ++#define reg_rom_remap_begin_7_0_lsb 0 ++#define xd_p_reg_rom_remap_begin_15_8 (*(volatile byte xdata *) 0xF629) ++#define p_reg_rom_remap_begin_15_8 0xF629 ++#define reg_rom_remap_begin_15_8_pos 0 ++#define reg_rom_remap_begin_15_8_len 8 ++#define reg_rom_remap_begin_15_8_lsb 8 ++#define xd_p_reg_rom_remap_end_7_0 (*(volatile byte xdata *) 0xF62A) ++#define p_reg_rom_remap_end_7_0 0xF62A ++#define reg_rom_remap_end_7_0_pos 0 ++#define reg_rom_remap_end_7_0_len 8 ++#define reg_rom_remap_end_7_0_lsb 0 ++#define xd_p_reg_rom_remap_end_15_8 (*(volatile byte xdata *) 0xF62B) ++#define p_reg_rom_remap_end_15_8 0xF62B ++#define reg_rom_remap_end_15_8_pos 0 ++#define reg_rom_remap_end_15_8_len 8 ++#define reg_rom_remap_end_15_8_lsb 8 ++#define xd_p_reg_rom_remap_delta_7_0 (*(volatile byte xdata *) 0xF62C) ++#define p_reg_rom_remap_delta_7_0 0xF62C ++#define reg_rom_remap_delta_7_0_pos 0 ++#define reg_rom_remap_delta_7_0_len 8 ++#define reg_rom_remap_delta_7_0_lsb 0 ++#define xd_p_reg_rom_remap_delta_15_8 (*(volatile byte xdata *) 0xF62D) ++#define p_reg_rom_remap_delta_15_8 0xF62D ++#define reg_rom_remap_delta_15_8_pos 0 ++#define reg_rom_remap_delta_15_8_len 8 ++#define reg_rom_remap_delta_15_8_lsb 8 ++#define xd_p_reg_rom_remap_en (*(volatile byte xdata *) 0xF62E) ++#define p_reg_rom_remap_en 0xF62E ++#define reg_rom_remap_en_pos 0 ++#define reg_rom_remap_en_len 1 ++#define reg_rom_remap_en_lsb 0 ++#define xd_p_reg_rom_remap_ofdm (*(volatile byte xdata *) 0xF62E) ++#define p_reg_rom_remap_ofdm 0xF62E ++#define reg_rom_remap_ofdm_pos 1 ++#define reg_rom_remap_ofdm_len 1 ++#define reg_rom_remap_ofdm_lsb 0 ++#define xd_p_reg_link_cpu_reset (*(volatile byte xdata *) 0xF62F) ++#define p_reg_link_cpu_reset 0xF62F ++#define reg_link_cpu_reset_pos 0 ++#define reg_link_cpu_reset_len 1 ++#define reg_link_cpu_reset_lsb 0 ++#define xd_p_reg_i2cm_auto_write_addr (*(volatile byte xdata *) 0xF630) ++#define p_reg_i2cm_auto_write_addr 0xF630 ++#define reg_i2cm_auto_write_addr_pos 0 ++#define reg_i2cm_auto_write_addr_len 8 ++#define reg_i2cm_auto_write_addr_lsb 0 ++#define xd_p_reg_link_bank_float_en (*(volatile byte xdata *) 0xF631) ++#define p_reg_link_bank_float_en 0xF631 ++#define reg_link_bank_float_en_pos 0 ++#define reg_link_bank_float_en_len 1 ++#define reg_link_bank_float_en_lsb 0 ++#define xd_p_reg_link_bank_float_start (*(volatile byte xdata *) 0xF632) ++#define p_reg_link_bank_float_start 0xF632 ++#define reg_link_bank_float_start_pos 0 ++#define reg_link_bank_float_start_len 8 ++#define reg_link_bank_float_start_lsb 0 ++#define xd_p_reg_link_bank_float_stop (*(volatile byte xdata *) 0xF633) ++#define p_reg_link_bank_float_stop 0xF633 ++#define reg_link_bank_float_stop_pos 0 ++#define reg_link_bank_float_stop_len 8 ++#define reg_link_bank_float_stop_lsb 0 ++#define xd_p_reg_rom_auto_read_addr_7_0 (*(volatile byte xdata *) 0xF638) ++#define p_reg_rom_auto_read_addr_7_0 0xF638 ++#define reg_rom_auto_read_addr_7_0_pos 0 ++#define reg_rom_auto_read_addr_7_0_len 8 ++#define reg_rom_auto_read_addr_7_0_lsb 0 ++#define xd_p_reg_rom_auto_read_addr_15_8 (*(volatile byte xdata *) 0xF639) ++#define p_reg_rom_auto_read_addr_15_8 0xF639 ++#define reg_rom_auto_read_addr_15_8_pos 0 ++#define reg_rom_auto_read_addr_15_8_len 8 ++#define reg_rom_auto_read_addr_15_8_lsb 8 ++#define xd_p_reg_link_ofsm_dummy_7_0 (*(volatile byte xdata *) 0xF640) ++#define p_reg_link_ofsm_dummy_7_0 0xF640 ++#define reg_link_ofsm_dummy_7_0_pos 0 ++#define reg_link_ofsm_dummy_7_0_len 8 ++#define reg_link_ofsm_dummy_7_0_lsb 0 ++#define xd_p_reg_link_ofsm_dummy_15_8 (*(volatile byte xdata *) 0xF641) ++#define p_reg_link_ofsm_dummy_15_8 0xF641 ++#define reg_link_ofsm_dummy_15_8_pos 0 ++#define reg_link_ofsm_dummy_15_8_len 8 ++#define reg_link_ofsm_dummy_15_8_lsb 8 ++#define xd_p_reg_link_ofsm_dummy_23_16 (*(volatile byte xdata *) 0xF642) ++#define p_reg_link_ofsm_dummy_23_16 0xF642 ++#define reg_link_ofsm_dummy_23_16_pos 0 ++#define reg_link_ofsm_dummy_23_16_len 8 ++#define reg_link_ofsm_dummy_23_16_lsb 16 ++#define xd_p_reg_link_ofsm_dummy_31_24 (*(volatile byte xdata *) 0xF643) ++#define p_reg_link_ofsm_dummy_31_24 0xF643 ++#define reg_link_ofsm_dummy_31_24_pos 0 ++#define reg_link_ofsm_dummy_31_24_len 8 ++#define reg_link_ofsm_dummy_31_24_lsb 24 ++#define xd_p_reg_link_ofsm_dummy_39_32 (*(volatile byte xdata *) 0xF644) ++#define p_reg_link_ofsm_dummy_39_32 0xF644 ++#define reg_link_ofsm_dummy_39_32_pos 0 ++#define reg_link_ofsm_dummy_39_32_len 8 ++#define reg_link_ofsm_dummy_39_32_lsb 32 ++#define xd_p_reg_link_ofsm_dummy_47_40 (*(volatile byte xdata *) 0xF645) ++#define p_reg_link_ofsm_dummy_47_40 0xF645 ++#define reg_link_ofsm_dummy_47_40_pos 0 ++#define reg_link_ofsm_dummy_47_40_len 8 ++#define reg_link_ofsm_dummy_47_40_lsb 40 ++#define xd_p_reg_link_ofsm_dummy_55_48 (*(volatile byte xdata *) 0xF646) ++#define p_reg_link_ofsm_dummy_55_48 0xF646 ++#define reg_link_ofsm_dummy_55_48_pos 0 ++#define reg_link_ofsm_dummy_55_48_len 8 ++#define reg_link_ofsm_dummy_55_48_lsb 48 ++#define xd_p_reg_link_ofsm_dummy_63_56 (*(volatile byte xdata *) 0xF647) ++#define p_reg_link_ofsm_dummy_63_56 0xF647 ++#define reg_link_ofsm_dummy_63_56_pos 0 ++#define reg_link_ofsm_dummy_63_56_len 8 ++#define reg_link_ofsm_dummy_63_56_lsb 56 ++#define xd_p_reg_link_ofsm_dummy_71_64 (*(volatile byte xdata *) 0xF648) ++#define p_reg_link_ofsm_dummy_71_64 0xF648 ++#define reg_link_ofsm_dummy_71_64_pos 0 ++#define reg_link_ofsm_dummy_71_64_len 8 ++#define reg_link_ofsm_dummy_71_64_lsb 64 ++#define xd_p_reg_link_ofsm_dummy_79_72 (*(volatile byte xdata *) 0xF649) ++#define p_reg_link_ofsm_dummy_79_72 0xF649 ++#define reg_link_ofsm_dummy_79_72_pos 0 ++#define reg_link_ofsm_dummy_79_72_len 8 ++#define reg_link_ofsm_dummy_79_72_lsb 72 ++#define xd_p_reg_sdio_mode (*(volatile byte xdata *) 0xF66F) ++#define p_reg_sdio_mode 0xF66F ++#define reg_sdio_mode_pos 0 ++#define reg_sdio_mode_len 1 ++#define reg_sdio_mode_lsb 0 ++#define xd_p_reg_lnk2ofdm_data_7_0 (*(volatile byte xdata *) 0xF6A0) ++#define p_reg_lnk2ofdm_data_7_0 0xF6A0 ++#define reg_lnk2ofdm_data_7_0_pos 0 ++#define reg_lnk2ofdm_data_7_0_len 8 ++#define reg_lnk2ofdm_data_7_0_lsb 0 ++#define xd_p_reg_lnk2ofdm_data_15_8 (*(volatile byte xdata *) 0xF6A1) ++#define p_reg_lnk2ofdm_data_15_8 0xF6A1 ++#define reg_lnk2ofdm_data_15_8_pos 0 ++#define reg_lnk2ofdm_data_15_8_len 8 ++#define reg_lnk2ofdm_data_15_8_lsb 8 ++#define xd_p_reg_lnk2ofdm_data_23_16 (*(volatile byte xdata *) 0xF6A2) ++#define p_reg_lnk2ofdm_data_23_16 0xF6A2 ++#define reg_lnk2ofdm_data_23_16_pos 0 ++#define reg_lnk2ofdm_data_23_16_len 8 ++#define reg_lnk2ofdm_data_23_16_lsb 16 ++#define xd_p_reg_lnk2ofdm_data_31_24 (*(volatile byte xdata *) 0xF6A3) ++#define p_reg_lnk2ofdm_data_31_24 0xF6A3 ++#define reg_lnk2ofdm_data_31_24_pos 0 ++#define reg_lnk2ofdm_data_31_24_len 8 ++#define reg_lnk2ofdm_data_31_24_lsb 24 ++#define xd_p_reg_lnk2ofdm_data_39_32 (*(volatile byte xdata *) 0xF6A4) ++#define p_reg_lnk2ofdm_data_39_32 0xF6A4 ++#define reg_lnk2ofdm_data_39_32_pos 0 ++#define reg_lnk2ofdm_data_39_32_len 8 ++#define reg_lnk2ofdm_data_39_32_lsb 32 ++#define xd_p_reg_lnk2ofdm_data_47_40 (*(volatile byte xdata *) 0xF6A5) ++#define p_reg_lnk2ofdm_data_47_40 0xF6A5 ++#define reg_lnk2ofdm_data_47_40_pos 0 ++#define reg_lnk2ofdm_data_47_40_len 8 ++#define reg_lnk2ofdm_data_47_40_lsb 40 ++#define xd_p_reg_lnk2ofdm_data_55_48 (*(volatile byte xdata *) 0xF6A6) ++#define p_reg_lnk2ofdm_data_55_48 0xF6A6 ++#define reg_lnk2ofdm_data_55_48_pos 0 ++#define reg_lnk2ofdm_data_55_48_len 8 ++#define reg_lnk2ofdm_data_55_48_lsb 48 ++#define xd_p_reg_lnk2ofdm_data_63_56 (*(volatile byte xdata *) 0xF6A7) ++#define p_reg_lnk2ofdm_data_63_56 0xF6A7 ++#define reg_lnk2ofdm_data_63_56_pos 0 ++#define reg_lnk2ofdm_data_63_56_len 8 ++#define reg_lnk2ofdm_data_63_56_lsb 56 ++#define xd_p_reg_ofdmtolnk_data_7_0 (*(volatile byte xdata *) 0xF6A8) ++#define p_reg_ofdmtolnk_data_7_0 0xF6A8 ++#define reg_ofdmtolnk_data_7_0_pos 0 ++#define reg_ofdmtolnk_data_7_0_len 8 ++#define reg_ofdmtolnk_data_7_0_lsb 0 ++#define xd_p_reg_ofdmtolnk_data_15_8 (*(volatile byte xdata *) 0xF6A9) ++#define p_reg_ofdmtolnk_data_15_8 0xF6A9 ++#define reg_ofdmtolnk_data_15_8_pos 0 ++#define reg_ofdmtolnk_data_15_8_len 8 ++#define reg_ofdmtolnk_data_15_8_lsb 8 ++#define xd_p_reg_ofdmtolnk_data_23_16 (*(volatile byte xdata *) 0xF6AA) ++#define p_reg_ofdmtolnk_data_23_16 0xF6AA ++#define reg_ofdmtolnk_data_23_16_pos 0 ++#define reg_ofdmtolnk_data_23_16_len 8 ++#define reg_ofdmtolnk_data_23_16_lsb 16 ++#define xd_p_reg_ofdmtolnk_data_31_24 (*(volatile byte xdata *) 0xF6AB) ++#define p_reg_ofdmtolnk_data_31_24 0xF6AB ++#define reg_ofdmtolnk_data_31_24_pos 0 ++#define reg_ofdmtolnk_data_31_24_len 8 ++#define reg_ofdmtolnk_data_31_24_lsb 24 ++#define xd_p_reg_ofdmtolnk_data_39_32 (*(volatile byte xdata *) 0xF6AC) ++#define p_reg_ofdmtolnk_data_39_32 0xF6AC ++#define reg_ofdmtolnk_data_39_32_pos 0 ++#define reg_ofdmtolnk_data_39_32_len 8 ++#define reg_ofdmtolnk_data_39_32_lsb 32 ++#define xd_p_reg_ofdmtolnk_data_47_40 (*(volatile byte xdata *) 0xF6AD) ++#define p_reg_ofdmtolnk_data_47_40 0xF6AD ++#define reg_ofdmtolnk_data_47_40_pos 0 ++#define reg_ofdmtolnk_data_47_40_len 8 ++#define reg_ofdmtolnk_data_47_40_lsb 40 ++#define xd_p_reg_ofdmtolnk_data_55_48 (*(volatile byte xdata *) 0xF6AE) ++#define p_reg_ofdmtolnk_data_55_48 0xF6AE ++#define reg_ofdmtolnk_data_55_48_pos 0 ++#define reg_ofdmtolnk_data_55_48_len 8 ++#define reg_ofdmtolnk_data_55_48_lsb 48 ++#define xd_p_reg_ofdmtolnk_data_63_56 (*(volatile byte xdata *) 0xF6AF) ++#define p_reg_ofdmtolnk_data_63_56 0xF6AF ++#define reg_ofdmtolnk_data_63_56_pos 0 ++#define reg_ofdmtolnk_data_63_56_len 8 ++#define reg_ofdmtolnk_data_63_56_lsb 56 ++#define xd_p_reg_mon51_flag (*(volatile byte xdata *) 0xF6B0) ++#define p_reg_mon51_flag 0xF6B0 ++#define reg_mon51_flag_pos 0 ++#define reg_mon51_flag_len 1 ++#define reg_mon51_flag_lsb 0 ++#define xd_p_reg_force_mon51 (*(volatile byte xdata *) 0xF6B1) ++#define p_reg_force_mon51 0xF6B1 ++#define reg_force_mon51_pos 0 ++#define reg_force_mon51_len 1 ++#define reg_force_mon51_lsb 0 ++#define xd_p_reg_which_cpu (*(volatile byte xdata *) 0xF6B2) ++#define p_reg_which_cpu 0xF6B2 ++#define reg_which_cpu_pos 0 ++#define reg_which_cpu_len 1 ++#define reg_which_cpu_lsb 0 ++#define xd_p_reg_program_ofdm_code_ready (*(volatile byte xdata *) 0xF6B3) ++#define p_reg_program_ofdm_code_ready 0xF6B3 ++#define reg_program_ofdm_code_ready_pos 0 ++#define reg_program_ofdm_code_ready_len 1 ++#define reg_program_ofdm_code_ready_lsb 0 ++#define xd_p_reg_link_wr_ofdm_en (*(volatile byte xdata *) 0xF6B3) ++#define p_reg_link_wr_ofdm_en 0xF6B3 ++#define reg_link_wr_ofdm_en_pos 1 ++#define reg_link_wr_ofdm_en_len 1 ++#define reg_link_wr_ofdm_en_lsb 0 ++#define xd_p_reg_i2c_mode (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_i2c_mode 0xF6B4 ++#define reg_i2c_mode_pos 0 ++#define reg_i2c_mode_len 1 ++#define reg_i2c_mode_lsb 0 ++#define xd_p_reg_sw_reset_sdio (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_sw_reset_sdio 0xF6B4 ++#define reg_sw_reset_sdio_pos 1 ++#define reg_sw_reset_sdio_len 1 ++#define reg_sw_reset_sdio_lsb 0 ++#define xd_p_reg_debug_mpefec_sel (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_debug_mpefec_sel 0xF6B4 ++#define reg_debug_mpefec_sel_pos 2 ++#define reg_debug_mpefec_sel_len 1 ++#define reg_debug_mpefec_sel_lsb 0 ++#define xd_p_reg_lnk_dynamic_clk (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_lnk_dynamic_clk 0xF6B4 ++#define reg_lnk_dynamic_clk_pos 3 ++#define reg_lnk_dynamic_clk_len 1 ++#define reg_lnk_dynamic_clk_lsb 0 ++#define xd_p_reg_lnk_free_clk (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_lnk_free_clk 0xF6B4 ++#define reg_lnk_free_clk_pos 4 ++#define reg_lnk_free_clk_len 1 ++#define reg_lnk_free_clk_lsb 0 ++#define xd_p_reg_i2c_sample_rate_up_en (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_i2c_sample_rate_up_en 0xF6B4 ++#define reg_i2c_sample_rate_up_en_pos 5 ++#define reg_i2c_sample_rate_up_en_len 1 ++#define reg_i2c_sample_rate_up_en_lsb 0 ++#define xd_p_reg_i2c_start_patch (*(volatile byte xdata *) 0xF6B4) ++#define p_reg_i2c_start_patch 0xF6B4 ++#define reg_i2c_start_patch_pos 6 ++#define reg_i2c_start_patch_len 1 ++#define reg_i2c_start_patch_lsb 0 ++#define xd_p_reg_link_i2cs_msb (*(volatile byte xdata *) 0xF6B5) ++#define p_reg_link_i2cs_msb 0xF6B5 ++#define reg_link_i2cs_msb_pos 1 ++#define reg_link_i2cs_msb_len 1 ++#define reg_link_i2cs_msb_lsb 0 ++#define xd_p_reg_link_ofsm_dbg_en (*(volatile byte xdata *) 0xF6B5) ++#define p_reg_link_ofsm_dbg_en 0xF6B5 ++#define reg_link_ofsm_dbg_en_pos 4 ++#define reg_link_ofsm_dbg_en_len 1 ++#define reg_link_ofsm_dbg_en_lsb 0 ++#define xd_p_reg_link_i2c_dbg_sel (*(volatile byte xdata *) 0xF6B5) ++#define p_reg_link_i2c_dbg_sel 0xF6B5 ++#define reg_link_i2c_dbg_sel_pos 5 ++#define reg_link_i2c_dbg_sel_len 1 ++#define reg_link_i2c_dbg_sel_lsb 0 ++#define xd_p_reg_fast_slow_train (*(volatile byte xdata *) 0xF6DD) ++#define p_reg_fast_slow_train 0xF6DD ++#define xd_p_reg_lnk2ofdm_int (*(volatile byte xdata *) 0xF6DE) ++#define p_reg_lnk2ofdm_int 0xF6DE ++#define reg_lnk2ofdm_int_pos 0 ++#define reg_lnk2ofdm_int_len 1 ++#define reg_lnk2ofdm_int_lsb 0 ++#define xd_p_reg_ofdm2lnk_int (*(volatile byte xdata *) 0xF6DF) ++#define p_reg_ofdm2lnk_int 0xF6DF ++#define reg_ofdm2lnk_int_pos 0 ++#define reg_ofdm2lnk_int_len 1 ++#define reg_ofdm2lnk_int_lsb 0 ++#define xd_p_reg_load_ofdm_reg (*(volatile byte xdata *) 0xF6E4) ++#define p_reg_load_ofdm_reg 0xF6E4 ++#define xd_p_link_ofsm_cmd_reg (*(volatile byte xdata *) 0xF6EA) ++#define p_link_ofsm_cmd_reg 0xF6EA ++#define link_ofsm_cmd_reg_pos 0 ++#define link_ofsm_cmd_reg_len 8 ++#define link_ofsm_cmd_reg_lsb 0 ++#define xd_p_link_ofsm_addr_reg_h (*(volatile byte xdata *) 0xF6EB) ++#define p_link_ofsm_addr_reg_h 0xF6EB ++#define link_ofsm_addr_reg_h_pos 0 ++#define link_ofsm_addr_reg_h_len 8 ++#define link_ofsm_addr_reg_h_lsb 0 ++#define xd_p_link_ofsm_addr_reg_l (*(volatile byte xdata *) 0xF6EC) ++#define p_link_ofsm_addr_reg_l 0xF6EC ++#define link_ofsm_addr_reg_l_pos 0 ++#define link_ofsm_addr_reg_l_len 8 ++#define link_ofsm_addr_reg_l_lsb 0 ++#define xd_p_link_ofsm_data_reg_0 (*(volatile byte xdata *) 0xF6ED) ++#define p_link_ofsm_data_reg_0 0xF6ED ++#define link_ofsm_data_reg_0_pos 0 ++#define link_ofsm_data_reg_0_len 8 ++#define link_ofsm_data_reg_0_lsb 0 ++#define xd_p_link_ofsm_data_reg_1 (*(volatile byte xdata *) 0xF6EE) ++#define p_link_ofsm_data_reg_1 0xF6EE ++#define link_ofsm_data_reg_1_pos 0 ++#define link_ofsm_data_reg_1_len 8 ++#define link_ofsm_data_reg_1_lsb 0 ++#define xd_p_link_ofsm_data_reg_2 (*(volatile byte xdata *) 0xF6EF) ++#define p_link_ofsm_data_reg_2 0xF6EF ++#define link_ofsm_data_reg_2_pos 0 ++#define link_ofsm_data_reg_2_len 8 ++#define link_ofsm_data_reg_2_lsb 0 ++#define xd_p_link_ofsm_data_reg_3 (*(volatile byte xdata *) 0xF6F0) ++#define p_link_ofsm_data_reg_3 0xF6F0 ++#define link_ofsm_data_reg_3_pos 0 ++#define link_ofsm_data_reg_3_len 8 ++#define link_ofsm_data_reg_3_lsb 0 ++#define xd_p_link_ofsm_data_reg_4 (*(volatile byte xdata *) 0xF6F1) ++#define p_link_ofsm_data_reg_4 0xF6F1 ++#define link_ofsm_data_reg_4_pos 0 ++#define link_ofsm_data_reg_4_len 8 ++#define link_ofsm_data_reg_4_lsb 0 ++#define xd_p_link_ofsm_data_reg_5 (*(volatile byte xdata *) 0xF6F2) ++#define p_link_ofsm_data_reg_5 0xF6F2 ++#define link_ofsm_data_reg_5_pos 0 ++#define link_ofsm_data_reg_5_len 8 ++#define link_ofsm_data_reg_5_lsb 0 ++#define xd_p_link_ofsm_data_reg_6 (*(volatile byte xdata *) 0xF6F3) ++#define p_link_ofsm_data_reg_6 0xF6F3 ++#define link_ofsm_data_reg_6_pos 0 ++#define link_ofsm_data_reg_6_len 8 ++#define link_ofsm_data_reg_6_lsb 0 ++#define xd_p_link_ofsm_data_reg_7 (*(volatile byte xdata *) 0xF6F4) ++#define p_link_ofsm_data_reg_7 0xF6F4 ++#define link_ofsm_data_reg_7_pos 0 ++#define link_ofsm_data_reg_7_len 8 ++#define link_ofsm_data_reg_7_lsb 0 ++#define xd_p_link_ofsm_data_reg_8 (*(volatile byte xdata *) 0xF6F5) ++#define p_link_ofsm_data_reg_8 0xF6F5 ++#define link_ofsm_data_reg_8_pos 0 ++#define link_ofsm_data_reg_8_len 8 ++#define link_ofsm_data_reg_8_lsb 0 ++#define xd_p_link_ofsm_data_reg_9 (*(volatile byte xdata *) 0xF6F6) ++#define p_link_ofsm_data_reg_9 0xF6F6 ++#define link_ofsm_data_reg_9_pos 0 ++#define link_ofsm_data_reg_9_len 8 ++#define link_ofsm_data_reg_9_lsb 0 ++#define xd_p_link_ofsm_data_reg_10 (*(volatile byte xdata *) 0xF6F7) ++#define p_link_ofsm_data_reg_10 0xF6F7 ++#define link_ofsm_data_reg_10_pos 0 ++#define link_ofsm_data_reg_10_len 8 ++#define link_ofsm_data_reg_10_lsb 0 ++#define xd_p_link_ofsm_data_reg_11 (*(volatile byte xdata *) 0xF6F8) ++#define p_link_ofsm_data_reg_11 0xF6F8 ++#define link_ofsm_data_reg_11_pos 0 ++#define link_ofsm_data_reg_11_len 8 ++#define link_ofsm_data_reg_11_lsb 0 ++#define xd_p_link_ofsm_data_reg_12 (*(volatile byte xdata *) 0xF6F9) ++#define p_link_ofsm_data_reg_12 0xF6F9 ++#define link_ofsm_data_reg_12_pos 0 ++#define link_ofsm_data_reg_12_len 8 ++#define link_ofsm_data_reg_12_lsb 0 ++#define xd_p_link_ofsm_data_reg_13 (*(volatile byte xdata *) 0xF6FA) ++#define p_link_ofsm_data_reg_13 0xF6FA ++#define link_ofsm_data_reg_13_pos 0 ++#define link_ofsm_data_reg_13_len 8 ++#define link_ofsm_data_reg_13_lsb 0 ++#define xd_p_link_ofsm_data_reg_14 (*(volatile byte xdata *) 0xF6FB) ++#define p_link_ofsm_data_reg_14 0xF6FB ++#define link_ofsm_data_reg_14_pos 0 ++#define link_ofsm_data_reg_14_len 8 ++#define link_ofsm_data_reg_14_lsb 0 ++#define xd_p_link_ofsm_data_reg_15 (*(volatile byte xdata *) 0xF6FC) ++#define p_link_ofsm_data_reg_15 0xF6FC ++#define link_ofsm_data_reg_15_pos 0 ++#define link_ofsm_data_reg_15_len 8 ++#define link_ofsm_data_reg_15_lsb 0 ++#define xd_p_reg_debug_mux (*(volatile byte xdata *) 0xF6FE) ++#define p_reg_debug_mux 0xF6FE ++#define reg_debug_mux_pos 3 ++#define reg_debug_mux_len 1 ++#define reg_debug_mux_lsb 0 ++#define xd_p_reg_top_gpioon0 (*(volatile byte xdata *) 0xF6FF) ++#define p_reg_top_gpioon0 0xF6FF ++#define reg_top_gpioon0_pos 0 ++#define reg_top_gpioon0_len 1 ++#define reg_top_gpioon0_lsb 0 ++#define xd_p_reg_p_dmb_phy_is_dvb (*(volatile byte xdata *) 0xDC31) ++#define p_reg_p_dmb_phy_is_dvb 0xDC31 ++#define reg_p_dmb_phy_is_dvb_pos 0 ++#define reg_p_dmb_phy_is_dvb_len 1 ++#define reg_p_dmb_phy_is_dvb_lsb 0 ++#define xd_p_reg_p_dmb_xt_reset (*(volatile byte xdata *) 0xDC32) ++#define p_reg_p_dmb_xt_reset 0xDC32 ++#define reg_p_dmb_xt_reset_pos 0 ++#define reg_p_dmb_xt_reset_len 1 ++#define reg_p_dmb_xt_reset_lsb 0 ++#define xd_p_reg_p_dmb_sw_reset (*(volatile byte xdata *) 0xDC33) ++#define p_reg_p_dmb_sw_reset 0xDC33 ++#define reg_p_dmb_sw_reset_pos 0 ++#define reg_p_dmb_sw_reset_len 1 ++#define reg_p_dmb_sw_reset_lsb 0 +diff --git a/drivers/media/dvb/dvb-usb/a867_standard.c b/drivers/media/dvb/dvb-usb/a867_standard.c +new file mode 100644 +index 0000000..8b4f4b3 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_standard.c +@@ -0,0 +1,4668 @@ ++#include "a867_standard.h" ++//#include ++#include "a867_cmd.h" ++#include "a867_user.h" ++#include "a867_af903x.h" ++ ++// turn on/off debug in this file ++#define DEBUG_STANDARD 0 ++ ++#if !DEBUG_STANDARD ++ #undef deb_info ++ #define deb_info(fmt, args...) do {} while(0) ++#endif ++ ++#include "a867_firmware.h" ++ ++#define Standard_MAX_BIT 8 ++#define Standard_MAX_CLOCK 12 ++#define Standard_MAX_BAND 3 ++ ++ ++const Byte Standard_bitMask[Standard_MAX_BIT] = { ++ 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF ++}; ++ ++const ClockTable Standard_clockTable[Standard_MAX_CLOCK] = ++{ ++ { 20480, 20480000 }, /** FPGA */ ++ { 16384, 20480000 }, /** 16.38MHz */ ++ { 20480, 20480000 }, /** 20.48MHz */ ++ { 36000, 20250000 }, /** 36.00MHz */ ++ { 30000, 20156250 }, /** 30.00MHz */ ++ { 26000, 20583333 }, /** 26.00MHz */ ++ { 28000, 20416667 }, /** 28.00MHz */ ++ { 32000, 20500000 }, /** 32.00MHz */ ++ { 34000, 20187500 }, /** 34.00MHz */ ++ { 24000, 20500000 }, /** 24.00MHz */ ++ { 22000, 20625000 }, /** 22.00MHz */ ++ { 12000, 20250000 } /** 12.00MHz */ ++}; ++ ++const BandTable Standard_bandTable[Standard_MAX_BAND] = ++{ ++ { 174000, 230000 }, /** VHF */ ++ { 350000, 900000 }, /** UHF */ ++ { 1670000, 1680000 } /** L-BAND */ ++}; ++ ++#if User_USE_DRIVER ++Dword Standard_getDriver ( ++ IN Demodulator* demodulator, ++ OUT Handle* handle ++) { ++ Dword error = Error_NO_ERROR; ++ TCHAR registry1[100] = TEXT("\\Drivers\\SDCARD\\ClientDrivers\\Custom\\MANF-0296-CARDID-5347-FUNC-1"); ++ TCHAR registry2[100] = TEXT("\\Drivers\\SDCARD\\ClientDrivers\\Custom\\MANF-03BE-CARDID-0001-FUNC-1"); ++ TCHAR name[256]; ++ TCHAR shortBuffer[32]; ++ DWORD len = 16; ++ DWORD i; ++ HKEY hKey, hSubKey; ++ DWORD size; ++ ++ /** Open the HKLM\Drivers\Active key in registry */ ++ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Drivers\\Active"), 0, 0, &hKey) == ERROR_SUCCESS) { ++ /** Get subkeys count */ ++ if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &i, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { ++ /** Browse subkeys in reverse order (pluggable cards are not at the beginning of the list !) */ ++ while (i) { ++ i--; ++ /** Select the subkey */ ++ size = sizeof(shortBuffer); ++ if (RegEnumKeyEx(hKey, i, shortBuffer, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { ++ /** Open the subkey */ ++ shortBuffer[sizeof(shortBuffer)-1] = '\0'; ++ _stprintf(name, TEXT("Drivers\\Active\\%s"), shortBuffer); ++ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, name, 0, 0, &hSubKey) == ERROR_SUCCESS) { ++ size = sizeof(name); ++ if (RegQueryValueEx(hSubKey, TEXT("Key"), NULL, NULL, (LPBYTE) name, &size) == ERROR_SUCCESS) { ++ if ((_tcsncmp(name, registry1, _tcsclen(registry1)) == 0) || (_tcsncmp(name, registry2, _tcsclen(registry2)) == 0)) { ++ /** This is the good PnPID, now get the serial com in the "Name" value */ ++ size = len; ++ if (RegQueryValueEx(hSubKey, TEXT("Name"), NULL, NULL, (LPBYTE) name, &size) == ERROR_SUCCESS) { ++ /** Found ! */ ++ RegCloseKey(hSubKey); ++ RegCloseKey(hKey); ++ /** OK */ ++ goto exit; ++ } ++ } ++ } ++ ++ /** Close the subkey */ ++ RegCloseKey(hSubKey); ++ } ++ } ++ } ++ } ++ } ++ /** Close the key */ ++ RegCloseKey(hKey); ++ ++exit : ++ *handle = CreateFile (name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); ++ ++ return (error); ++} ++#endif ++ ++ ++Dword Standard_writeRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte value ++) { ++ Dword ret; ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ret = (Standard_writeRegisters (demodulator, chip, processor, registerAddress, 1, &value)); ++ if(ret) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, ret); ++ } ++ return ret; ++ ++} ++ ++ ++Dword Standard_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ WriteRegistersRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.processor = processor; ++ request.registerAddress = registerAddress; ++ request.bufferLength = bufferLength; ++ User_memoryCopy (demodulator, request.buffer, buffer, bufferLength); ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_WRITEREGISTERS, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ if (registerAddress > 0x000000FF) { ++ registerAddressLength = 2; ++ } else { ++ registerAddressLength = 1; ++ } ++ } else { ++ registerAddressLength = 2; ++ } ++ if (ganymede->cmdDescription->writeRegisters != NULL) { ++ error = ganymede->cmdDescription->writeRegisters (demodulator, chip, processor, registerAddress, registerAddressLength, bufferLength, buffer); ++ } ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++) { ++ Dword error = Error_NO_ERROR; ++ Byte valueSetsAddressLength; ++ Ganymede* ganymede; ++ ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ valueSetsAddressLength = 2; ++ } else { ++ valueSetsAddressLength = 2; ++ } ++ if (ganymede->cmdDescription->writeScatterRegisters != NULL) { ++ error = ganymede->cmdDescription->writeScatterRegisters (demodulator, chip, processor, valueSetsAddressLength, valueSetsLength, valueSets); ++ } ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->cmdDescription->writeTunerRegisters != NULL) { ++ error = ganymede->cmdDescription->writeTunerRegisters (demodulator, chip, ganymede->tunerDescription->tunerAddress, registerAddress, ganymede->tunerDescription->registerAddressLength, bufferLength, buffer); ++ } ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_writeGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Byte writeBuffer[256]; ++ Byte i; ++ Ganymede* ganymede; ++ Dword error; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ writeBuffer[0] = bufferLength; ++ writeBuffer[1] = interfaceIndex; ++ writeBuffer[2] = slaveAddress; ++ ++ for (i = 0; i < bufferLength; i++) { ++ writeBuffer[3 + i] = buffer[i]; ++ } ++ error = (Standard_sendCommand (demodulator, Command_GENERIC_WRITE, chip, Processor_LINK, bufferLength + 3, writeBuffer, 0, NULL)); ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return error; ++} ++ ++ ++Dword Standard_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ WriteEepromValuesRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.registerAddress = registerAddress; ++ request.bufferLength = bufferLength; ++ User_memoryCopy (demodulator, request.buffer, buffer, bufferLength); ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_WRITEEEPROMVALUES, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte eepromAddress; ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Read EEPROM address. */ ++ /*error = ganymede->cmdDescription.readRegisters (demodulator, chip, Processor_LINK, 0xBFF0, 1, &eepromAddress); ++ if (error) goto exit; ++ */ ++ eepromAddress = 0x01; ++ ++ /** Read EEPROM valid length of register. */ ++ /*error = ganymede->cmdDescription.readRegisters (demodulator, chip, Processor_LINK, 0xBFF1, 1, ®isterAddressLength); ++ if (error) goto exit; ++ */ ++ registerAddressLength = 0x01; ++ ++ if (ganymede->cmdDescription->writeEepromValues != NULL) { ++ error = ganymede->cmdDescription->writeEepromValues (demodulator, chip, eepromAddress, registerAddress, registerAddressLength, bufferLength, buffer); ++ } ++ ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_writeRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ WriteRegisterBitsRequest request; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.processor = processor; ++ request.registerAddress = registerAddress; ++ request.position = position; ++ request.length = length; ++ request.value = value; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_WRITEREGISTERBITS, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ if (registerAddress > 0x000000FF) { ++ registerAddressLength = 2; ++ } else { ++ registerAddressLength = 1; ++ } ++ } else { ++ registerAddressLength = 2; ++ } ++ if (length == 8) { ++ if (ganymede->cmdDescription->writeRegisters != NULL) { ++ error = ganymede->cmdDescription->writeRegisters (demodulator, chip, processor, registerAddress, registerAddressLength, 1, &value); ++ } ++ } else { ++ if (ganymede->cmdDescription->modifyRegister != NULL) { ++ error = ganymede->cmdDescription->modifyRegister (demodulator, chip, processor, registerAddress, registerAddressLength, position, length, value); ++ } ++ } ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_readRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ OUT Byte* value ++) { ++ Dword error; ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ++ error = (Standard_readRegisters (demodulator, chip, processor, registerAddress, 1, value)); ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return error; ++} ++ ++ ++Dword Standard_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ReadRegistersRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.processor = processor; ++ request.registerAddress = registerAddress; ++ request.bufferLength = bufferLength; ++ request.buffer = buffer; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_READREGISTERS, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ if (registerAddress > 0x000000FF) { ++ registerAddressLength = 2; ++ } else { ++ registerAddressLength = 1; ++ } ++ } else { ++ registerAddressLength = 2; ++ } ++ if (ganymede->cmdDescription->readRegisters != NULL) { ++ error = ganymede->cmdDescription->readRegisters (demodulator, chip, processor, registerAddress, registerAddressLength, bufferLength, buffer); ++ } ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++) { ++ Dword error = Error_NO_ERROR; ++ Byte valueSetsAddressLength; ++ Ganymede* ganymede; ++ ++// deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ valueSetsAddressLength = 2; ++ } else { ++ valueSetsAddressLength = 2; ++ } ++ ++ if (ganymede->cmdDescription->readScatterRegisters != NULL) { ++ error = ganymede->cmdDescription->readScatterRegisters (demodulator, chip, processor, valueSetsAddressLength, valueSetsLength, valueSets); ++ } ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ReadTunerRegistersRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.registerAddress = registerAddress; ++ request.bufferLength = bufferLength; ++ request.buffer = buffer; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_READTUNERREGISTERS, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->cmdDescription->readTunerRegisters != NULL) { ++ ++ if (registerAddress == 0xffff && ganymede->tunerDescription->registerAddressLength == 1) ++ { ++ error = ganymede->cmdDescription->readTunerRegisters (demodulator, chip, ++ ganymede->tunerDescription->tunerAddress, registerAddress, 0, bufferLength, buffer); ++ } ++ else ++ { ++ error = ganymede->cmdDescription->readTunerRegisters (demodulator, chip, ++ ganymede->tunerDescription->tunerAddress, registerAddress, ++ ganymede->tunerDescription->registerAddressLength, bufferLength, buffer); ++ } ++ } ++#endif ++ ++ if(error) ++ { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_readGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++) { ++ Byte writeBuffer[3]; ++ Ganymede* ganymede; ++ Dword error; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ writeBuffer[0] = bufferLength; ++ writeBuffer[1] = interfaceIndex; ++ writeBuffer[2] = slaveAddress; ++ ++ error = (Standard_sendCommand (demodulator, Command_GENERIC_READ, chip, Processor_LINK, 3, writeBuffer, bufferLength, buffer)); ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return error; ++} ++ ++ ++Dword Standard_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ReadEepromValuesRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.registerAddress = registerAddress; ++ request.bufferLength = bufferLength; ++ request.buffer = buffer; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_READEEPROMVALUES, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte eepromAddress; ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Read EEPROM address. */ ++ /*error = ganymede->cmdDescription.readRegisters (demodulator, chip, Processor_LINK, 0xBFF0, 1, &eepromAddress); ++ if (error) goto exit; ++ */ ++ eepromAddress = 0x01; ++ ++ /** Read EEPROM valid length of register. */ ++ /*error = ganymede->cmdDescription.readRegisters (demodulator, chip, Processor_LINK, 0xBFF1, 1, ®isterAddressLength); ++ if (error) goto exit; ++ */ ++ registerAddressLength = 0x01; ++ ++ if (ganymede->cmdDescription->readEepromValues != NULL) { ++ error = ganymede->cmdDescription->readEepromValues (demodulator, chip, eepromAddress, registerAddress, registerAddressLength, bufferLength, buffer); ++ } ++ ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_readRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ OUT Byte* value ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ReadRegisterBitsRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.processor = processor; ++ request.registerAddress = registerAddress; ++ request.position = position; ++ request.length = length; ++ request.value = value; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_READREGISTERBITS, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte temp = 0; ++ Byte registerAddressLength; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (processor == Processor_LINK) { ++ if (registerAddress > 0x000000FF) { ++ registerAddressLength = 2; ++ } else { ++ registerAddressLength = 1; ++ } ++ } else { ++ registerAddressLength = 2; ++ } ++ if (ganymede->cmdDescription->readRegisters != NULL) { ++ error = ganymede->cmdDescription->readRegisters (demodulator, chip, processor, registerAddress, registerAddressLength, 1, &temp); ++ } ++ if (error) goto exit; ++ ++ if (length == 8) { ++ *value = temp; ++ } else { ++ temp = REG_GET (temp, position, length); ++ *value = temp; ++ } ++ ++#endif ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_sendCommand ( ++ IN Demodulator* demodulator, ++ OUT Word command, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->cmdDescription->sendCommand != NULL) { ++ error = ganymede->cmdDescription->sendCommand (demodulator, command, chip, processor, writeBufferLength, writeBuffer, readBufferLength, readBuffer); ++ } ++#endif ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getHardwareVersion ( ++ IN Demodulator* demodulator, ++ OUT Dword* version ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte hwVer0; ++ Byte hwVer1; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_readRegister (demodulator, 0, Processor_OFDM, 0xFFF0, &hwVer0); ++ if (error) goto exit; ++ error = Standard_readRegister (demodulator, 0, Processor_OFDM, 0xFFF1, &hwVer1); ++ if (error) goto exit; ++ ++ /** HW Version = HWVer + Top_Ver */ ++ *version = (Dword) (hwVer1 << 8) + (Dword) hwVer0; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getFirmwareVersion ( ++ IN Demodulator* demodulator, ++ IN Processor processor, ++ OUT Dword* version ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetFirmwareVersionRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.processor = processor; ++ request.version = version; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETFIRMWAREVERSION, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte writeBuffer[1]; ++ Byte readBuffer[4]; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if ((ganymede->busId == Bus_I2M) || (ganymede->busId == Bus_I2U)) { ++ *version = 0xFFFFFFFF; ++ goto exit; ++ } ++ ++ writeBuffer[0] = 1; ++ error = Standard_sendCommand (demodulator, Command_QUERYINFO, 0, processor, 1, writeBuffer, 4, readBuffer); ++ if (error) goto exit; ++ ++ *version = (Dword) (((Dword) readBuffer[0] << 24) + ((Dword) readBuffer[1] << 16) + ((Dword) readBuffer[2] << 8) + (Dword) readBuffer[3]); ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getPostVitBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* postErrorCount, /** 24 bits */ ++ OUT Dword* postBitCount, /** 16 bits */ ++ OUT Word* abortCount ++) { ++ Dword error = Error_NO_ERROR; ++ Dword errorCount; ++ Dword bitCount; ++ Byte buffer[7]; ++ Word abort; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ *postErrorCount = 0; ++ *postBitCount = 0; ++ ++ error = Standard_readRegisters (demodulator, chip, Processor_OFDM, rsd_abort_packet_cnt_7_0, r_rsd_packet_unit_15_8 - rsd_abort_packet_cnt_7_0 + 1, buffer); ++ if (error) goto exit; ++ ++ abort = ((Word) buffer[rsd_abort_packet_cnt_15_8 - rsd_abort_packet_cnt_7_0] << 8) + buffer[rsd_abort_packet_cnt_7_0 - rsd_abort_packet_cnt_7_0]; ++ errorCount = ((Dword) buffer[rsd_bit_err_cnt_23_16 - rsd_abort_packet_cnt_7_0] << 16) + ((Dword) buffer[rsd_bit_err_cnt_15_8 - rsd_abort_packet_cnt_7_0] << 8) + buffer[rsd_bit_err_cnt_7_0 - rsd_abort_packet_cnt_7_0]; ++ bitCount = ((Dword) buffer[r_rsd_packet_unit_15_8 - rsd_abort_packet_cnt_7_0] << 8) + buffer[r_rsd_packet_unit_7_0 - rsd_abort_packet_cnt_7_0]; ++ if (bitCount == 0) { ++ /*error = Error_RSD_PKT_CNT_0;*/ ++ *postErrorCount = 1; ++ *postBitCount = 2; ++ *abortCount = 1000; ++ goto exit; ++ } ++ ++ *abortCount = abort; ++ bitCount = bitCount - (Dword)abort; ++ if (bitCount == 0) { ++ *postErrorCount = 1; ++ *postBitCount = 2; ++ } else { ++ *postErrorCount = errorCount - (Dword) abort * 8 * 8; ++ *postBitCount = bitCount * 204 * 8; ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_resetPostVitErrorCount ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ /** Reset counter for next time we get post Viterbi BER */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_reg_rsd_ber_rdy, reg_rsd_ber_rdy_pos, reg_rsd_ber_rdy_len, 1); ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_wordToInt ( ++ IN Demodulator* demodulator, ++ short* value, ++ Word input ++) { ++ Dword error = Error_NO_ERROR; ++ short volt; ++ //Dword dwUpVoltX100 = 330; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ input = input & 0x03FF; ++ ++ if (input >= 512) { ++ volt = (short) input - (short) 0x400ul; ++ } else { ++ volt = (short) input; ++ } ++ ++ *value = volt; ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getRfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* rfAgc ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++#if User_USE_DRIVER ++#else ++ /** get rf_agc_control */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, r_reg_aagc_rf_gain, reg_aagc_rf_gain_pos, reg_aagc_rf_gain_len, rfAgc); ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getIfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* ifAgc ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++#if User_USE_DRIVER ++#else ++ /** get if_agc_control */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, r_reg_aagc_if_gain, reg_aagc_if_gain_pos, reg_aagc_if_gain_len, ifAgc); ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getAgcGain ( ++ IN Demodulator* demodulator, ++ IN Word registerHi, ++ IN Word registerLo, ++ IN Byte position, ++ IN Byte length, ++ OUT Word *value ++) { ++ Dword error = Error_NO_ERROR; ++ Byte temp0; ++ Byte temp1; ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ++ error = Standard_readRegister (demodulator, 0, Processor_OFDM, registerLo, &temp0); ++ if (error) goto exit; ++ error = Standard_readRegisterBits (demodulator, 0, Processor_OFDM, registerHi, position, length, &temp1); ++ if (error) goto exit; ++ ++ *value = (Word) (temp1 << 8) + (Word) temp0; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setAgcGain ( ++ IN Demodulator* demodulator, ++ IN Word registerHi, ++ IN Word registerLo, ++ IN Byte position, ++ IN Byte length, ++ IN Word value ++) { ++ Dword error = Error_NO_ERROR; ++ Byte temp0; ++ Byte temp1; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ temp0 = (Byte) (value & 0x00FF); ++ temp1 = (Byte) ((value & 0x0300) >> 8); ++ ++ error = Standard_writeRegister (demodulator, 0, Processor_OFDM, registerLo, temp0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, registerHi, position, length, temp1); ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_resetAgc ( ++ IN Demodulator* demodulator ++) { ++ Dword error = Error_NO_ERROR; ++ //Byte temp = 0; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_aagc_top_th_dis, reg_aagc_top_th_dis_pos, reg_aagc_top_th_dis_len, 0x00); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_aagc_top_reload, reg_aagc_top_reload_pos, reg_aagc_top_reload_len, 0x01); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_agc_rst, reg_agc_rst_pos, reg_agc_rst_len, 0x01); ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getSignalQuality ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* quality ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_readRegister (demodulator, chip, Processor_OFDM, signal_quality, quality); ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getSignalStrength ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* strength ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_readRegister (demodulator, chip, Processor_OFDM, signal_strength, strength); ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getSignalStrengthDbm ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long rfpullUpVolt_X10, /** RF pull up voltage multiplied by 10 */ ++ IN Long ifpullUpVolt_X10, /** IF pull up voltage multiplied by 10 */ ++ OUT Long* strengthDbm /** DBm */ ++) ++{ ++ Dword error = Error_NO_ERROR; ++ Byte temp; ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ++ if ((rfpullUpVolt_X10 == 0) || (ifpullUpVolt_X10 == 0)) { ++ error = Error_INV_PULLUP_VOLT; ++ goto exit; ++ } ++ ++ error = Standard_readRegister (demodulator, chip, Processor_OFDM, est_rf_level_dbm, &temp); ++ if (error) goto exit; ++ ++ *strengthDbm = (Long) (temp * -1); ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_divider ( ++ IN Demodulator* demodulator, ++ IN Dword a, ++ IN Dword b, ++ IN Dword x ++) { ++ Dword answer = 0; ++ Dword c = 0; ++ Dword i = 0; ++ ++ if (a > b) { ++ c = a / b; ++ a = a - c * b; ++ } ++ ++ for (i = 0; i < x; i++) { ++ if (a >= b) { ++ answer += 1; ++ a-=b; ++ } ++ a <<= 1; ++ answer <<= 1; ++ } ++ ++ answer = (c << (Long) x) + answer; ++ ++ return (answer); ++} ++ ++ ++Dword Standard_computeCrystal ( ++ IN Demodulator* demodulator, ++ IN Long crystalFrequency, /** Crystal frequency (Hz) */ ++ OUT Dword* crystal ++) { ++ Dword error = Error_NO_ERROR; ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ++ *crystal = (Long) Standard_divider (demodulator, (Dword) crystalFrequency, 1000000ul, 19ul); ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_computeAdc ( ++ IN Demodulator* demodulator, ++ IN Long adcFrequency, /** ADC frequency (Hz) */ ++ OUT Dword* adc ++) ++{ ++ Dword error = Error_NO_ERROR; ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ++ *adc = (Long) Standard_divider (demodulator, (Dword) adcFrequency, 1000000ul, 19ul); ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_computeFcw ( ++ IN Demodulator* demodulator, ++ IN Long adcFrequency, /** ADC frequency (Hz) */ ++ IN Long ifFrequency, /** IF frequency (Hz) */ ++ IN Bool inversion, /** RF spectrum inversion */ ++ OUT Dword* fcw ++) { ++ Dword error = Error_NO_ERROR; ++ Long ifFreq; ++ Long adcFreq; ++ Long adcFreqHalf; ++ Long adcFreqSample; ++ Long invBfs; ++ Long controlWord; ++ Byte adcMultiplier; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ adcFreq = adcFrequency; ++ ifFreq = ifFrequency; ++ adcFreqHalf = adcFreq / 2; ++ ++ if (inversion == True) ++ ifFreq = -1 * ifFreq; ++ ++ adcFreqSample = ifFreq; ++ ++ if (adcFreqSample >= 0) ++ invBfs = 1; ++ else { ++ invBfs = -1; ++ adcFreqSample = adcFreqSample * -1; ++ } ++ ++ while (adcFreqSample > adcFreqHalf) ++ adcFreqSample = adcFreqSample - adcFreq; ++ ++ /** Sample, spectrum at positive frequency */ ++ if(adcFreqSample >= 0) ++ invBfs = invBfs * -1; ++ else { ++ invBfs = invBfs * 1; ++ adcFreqSample = adcFreqSample * (-1); /** Absolute value */ ++ } ++ ++ controlWord = (Long) Standard_divider (demodulator, (Dword) adcFreqSample, (Dword) adcFreq, 23ul); ++ ++ if (invBfs == -1) { ++ controlWord *= -1; ++ } ++ ++ /** Get ADC multiplier */ ++ error = Standard_readRegister (demodulator, 0, Processor_OFDM, adcx2, &adcMultiplier); ++ if (error) goto exit; ++ ++ if (adcMultiplier == 1) { ++ controlWord /= 2; ++ } ++ ++ *fcw = controlWord & 0x7FFFFF; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_selectBandwidth ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, /** KHz */ ++ IN Dword adcFrequency /** Hz, ex: 20480000 */ ++) { ++ Dword error = Error_NO_ERROR; ++ Dword coeff1_2048Nu; ++ Dword coeff1_4096Nu; ++ Dword coeff1_8191Nu; ++ Dword coeff1_8192Nu; ++ Dword coeff1_8193Nu; ++ Dword coeff2_2k; ++ Dword coeff2_4k; ++ Dword coeff2_8k; ++ Word bfsfcw_fftindex_ratio; ++ Word fftindex_bfsfcw_ratio; ++ ++ Byte temp0; ++ Byte temp1; ++ Byte temp2; ++ Byte temp3; ++ Byte buffer[36]; ++ Byte bw; ++ Byte adcMultiplier; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ if (bandwidth == 5000) ++ bw = 3; ++ else if (bandwidth == 6000) ++ bw = 0; ++ else if (bandwidth == 7000) ++ bw = 1; ++ else if (bandwidth == 8000) ++ bw = 2; ++ else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_bw, reg_bw_pos, reg_bw_len, bw); ++ if (error) goto exit; ++ ++ /** Program CFOE */ ++ if (adcFrequency == 20156250) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x02449b5c; ++ coeff1_4096Nu = 0x01224dae; ++ coeff1_8191Nu = 0x00912b60; ++ coeff1_8192Nu = 0x009126d7; ++ coeff1_8193Nu = 0x0091224e; ++ coeff2_2k = 0x01224dae; ++ coeff2_4k = 0x009126d7; ++ coeff2_8k = 0x0048936b; ++ bfsfcw_fftindex_ratio = 0x0387; ++ fftindex_bfsfcw_ratio = 0x0122; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02b8ba6e; ++ coeff1_4096Nu = 0x015c5d37; ++ coeff1_8191Nu = 0x00ae340d; ++ coeff1_8192Nu = 0x00ae2e9b; ++ coeff1_8193Nu = 0x00ae292a; ++ coeff2_2k = 0x015c5d37; ++ coeff2_4k = 0x00ae2e9b; ++ coeff2_8k = 0x0057174e; ++ bfsfcw_fftindex_ratio = 0x02f1; ++ fftindex_bfsfcw_ratio = 0x015c; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x032cd980; ++ coeff1_4096Nu = 0x01966cc0; ++ coeff1_8191Nu = 0x00cb3cba; ++ coeff1_8192Nu = 0x00cb3660; ++ coeff1_8193Nu = 0x00cb3007; ++ coeff2_2k = 0x01966cc0; ++ coeff2_4k = 0x00cb3660; ++ coeff2_8k = 0x00659b30; ++ bfsfcw_fftindex_ratio = 0x0285; ++ fftindex_bfsfcw_ratio = 0x0196; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x03a0f893; ++ coeff1_4096Nu = 0x01d07c49; ++ coeff1_8191Nu = 0x00e84567; ++ coeff1_8192Nu = 0x00e83e25; ++ coeff1_8193Nu = 0x00e836e3; ++ coeff2_2k = 0x01d07c49; ++ coeff2_4k = 0x00e83e25; ++ coeff2_8k = 0x00741f12; ++ bfsfcw_fftindex_ratio = 0x0234; ++ fftindex_bfsfcw_ratio = 0x01d0; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20187500) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x0243b546; ++ coeff1_4096Nu = 0x0121daa3; ++ coeff1_8191Nu = 0x0090f1d9; ++ coeff1_8192Nu = 0x0090ed51; ++ coeff1_8193Nu = 0x0090e8ca; ++ coeff2_2k = 0x0121daa3; ++ coeff2_4k = 0x0090ed51; ++ coeff2_8k = 0x004876a9; ++ bfsfcw_fftindex_ratio = 0x0388; ++ fftindex_bfsfcw_ratio = 0x0122; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02b7a654; ++ coeff1_4096Nu = 0x015bd32a; ++ coeff1_8191Nu = 0x00adef04; ++ coeff1_8192Nu = 0x00ade995; ++ coeff1_8193Nu = 0x00ade426; ++ coeff2_2k = 0x015bd32a; ++ coeff2_4k = 0x00ade995; ++ coeff2_8k = 0x0056f4ca; ++ bfsfcw_fftindex_ratio = 0x02f2; ++ fftindex_bfsfcw_ratio = 0x015c; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x032b9761; ++ coeff1_4096Nu = 0x0195cbb1; ++ coeff1_8191Nu = 0x00caec30; ++ coeff1_8192Nu = 0x00cae5d8; ++ coeff1_8193Nu = 0x00cadf81; ++ coeff2_2k = 0x0195cbb1; ++ coeff2_4k = 0x00cae5d8; ++ coeff2_8k = 0x006572ec; ++ bfsfcw_fftindex_ratio = 0x0286; ++ fftindex_bfsfcw_ratio = 0x0196; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x039f886f; ++ coeff1_4096Nu = 0x01cfc438; ++ coeff1_8191Nu = 0x00e7e95b; ++ coeff1_8192Nu = 0x00e7e21c; ++ coeff1_8193Nu = 0x00e7dadd; ++ coeff2_2k = 0x01cfc438; ++ coeff2_4k = 0x00e7e21c; ++ coeff2_8k = 0x0073f10e; ++ bfsfcw_fftindex_ratio = 0x0235; ++ fftindex_bfsfcw_ratio = 0x01d0; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20250000) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x0241eb3b; ++ coeff1_4096Nu = 0x0120f59e; ++ coeff1_8191Nu = 0x00907f53; ++ coeff1_8192Nu = 0x00907acf; ++ coeff1_8193Nu = 0x0090764b; ++ coeff2_2k = 0x0120f59e; ++ coeff2_4k = 0x00907acf; ++ coeff2_8k = 0x00483d67; ++ bfsfcw_fftindex_ratio = 0x038b; ++ fftindex_bfsfcw_ratio = 0x0121; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02b580ad; ++ coeff1_4096Nu = 0x015ac057; ++ coeff1_8191Nu = 0x00ad6597; ++ coeff1_8192Nu = 0x00ad602b; ++ coeff1_8193Nu = 0x00ad5ac1; ++ coeff2_2k = 0x015ac057; ++ coeff2_4k = 0x00ad602b; ++ coeff2_8k = 0x0056b016; ++ bfsfcw_fftindex_ratio = 0x02f4; ++ fftindex_bfsfcw_ratio = 0x015b; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x03291620; ++ coeff1_4096Nu = 0x01948b10; ++ coeff1_8191Nu = 0x00ca4bda; ++ coeff1_8192Nu = 0x00ca4588; ++ coeff1_8193Nu = 0x00ca3f36; ++ coeff2_2k = 0x01948b10; ++ coeff2_4k = 0x00ca4588; ++ coeff2_8k = 0x006522c4; ++ bfsfcw_fftindex_ratio = 0x0288; ++ fftindex_bfsfcw_ratio = 0x0195; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x039cab92; ++ coeff1_4096Nu = 0x01ce55c9; ++ coeff1_8191Nu = 0x00e7321e; ++ coeff1_8192Nu = 0x00e72ae4; ++ coeff1_8193Nu = 0x00e723ab; ++ coeff2_2k = 0x01ce55c9; ++ coeff2_4k = 0x00e72ae4; ++ coeff2_8k = 0x00739572; ++ bfsfcw_fftindex_ratio = 0x0237; ++ fftindex_bfsfcw_ratio = 0x01ce; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20583333) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x02402402; ++ coeff1_4096Nu = 0x01201201; ++ coeff1_8191Nu = 0x00900d81; ++ coeff1_8192Nu = 0x00900901; ++ coeff1_8193Nu = 0x00900480; ++ coeff2_2k = 0x01201201; ++ coeff2_4k = 0x00900901; ++ coeff2_8k = 0x00480480; ++ bfsfcw_fftindex_ratio = 0x038e; ++ fftindex_bfsfcw_ratio = 0x0120; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02b35e69; ++ coeff1_4096Nu = 0x0159af35; ++ coeff1_8191Nu = 0x00acdd01; ++ coeff1_8192Nu = 0x00acd79a; ++ coeff1_8193Nu = 0x00acd234; ++ coeff2_2k = 0x0159af35; ++ coeff2_4k = 0x00acd79a; ++ coeff2_8k = 0x00566bcd; ++ bfsfcw_fftindex_ratio = 0x02f6; ++ fftindex_bfsfcw_ratio = 0x015a; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x032698d0; ++ coeff1_4096Nu = 0x01934c68; ++ coeff1_8191Nu = 0x00c9ac81; ++ coeff1_8192Nu = 0x00c9a634; ++ coeff1_8193Nu = 0x00c99fe7; ++ coeff2_2k = 0x01934c68; ++ coeff2_4k = 0x00c9a634; ++ coeff2_8k = 0x0064d31a; ++ bfsfcw_fftindex_ratio = 0x028a; ++ fftindex_bfsfcw_ratio = 0x0193; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x0399d337; ++ coeff1_4096Nu = 0x01cce99b; ++ coeff1_8191Nu = 0x00e67c02; ++ coeff1_8192Nu = 0x00e674ce; ++ coeff1_8193Nu = 0x00e66d9a; ++ coeff2_2k = 0x01cce99b; ++ coeff2_4k = 0x00e674ce; ++ coeff2_8k = 0x00733a67; ++ bfsfcw_fftindex_ratio = 0x0239; ++ fftindex_bfsfcw_ratio = 0x01cd; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20416667) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x023d337f; ++ coeff1_4096Nu = 0x011e99c0; ++ coeff1_8191Nu = 0x008f515a; ++ coeff1_8192Nu = 0x008f4ce0; ++ coeff1_8193Nu = 0x008f4865; ++ coeff2_2k = 0x011e99c0; ++ coeff2_4k = 0x008f4ce0; ++ coeff2_8k = 0x0047a670; ++ bfsfcw_fftindex_ratio = 0x0393; ++ fftindex_bfsfcw_ratio = 0x011f; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02afd765; ++ coeff1_4096Nu = 0x0157ebb3; ++ coeff1_8191Nu = 0x00abfb39; ++ coeff1_8192Nu = 0x00abf5d9; ++ coeff1_8193Nu = 0x00abf07a; ++ coeff2_2k = 0x0157ebb3; ++ coeff2_4k = 0x00abf5d9; ++ coeff2_8k = 0x0055faed; ++ bfsfcw_fftindex_ratio = 0x02fa; ++ fftindex_bfsfcw_ratio = 0x0158; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x03227b4b; ++ coeff1_4096Nu = 0x01913da6; ++ coeff1_8191Nu = 0x00c8a518; ++ coeff1_8192Nu = 0x00c89ed3; ++ coeff1_8193Nu = 0x00c8988e; ++ coeff2_2k = 0x01913da6; ++ coeff2_4k = 0x00c89ed3; ++ coeff2_8k = 0x00644f69; ++ bfsfcw_fftindex_ratio = 0x028d; ++ fftindex_bfsfcw_ratio = 0x0191; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x03951f32; ++ coeff1_4096Nu = 0x01ca8f99; ++ coeff1_8191Nu = 0x00e54ef7; ++ coeff1_8192Nu = 0x00e547cc; ++ coeff1_8193Nu = 0x00e540a2; ++ coeff2_2k = 0x01ca8f99; ++ coeff2_4k = 0x00e547cc; ++ coeff2_8k = 0x0072a3e6; ++ bfsfcw_fftindex_ratio = 0x023c; ++ fftindex_bfsfcw_ratio = 0x01cb; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20480000) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x023b6db7; ++ coeff1_4096Nu = 0x011db6db; ++ coeff1_8191Nu = 0x008edfe5; ++ coeff1_8192Nu = 0x008edb6e; ++ coeff1_8193Nu = 0x008ed6f7; ++ coeff2_2k = 0x011db6db; ++ coeff2_4k = 0x008edb6e; ++ coeff2_8k = 0x00476db7; ++ bfsfcw_fftindex_ratio = 0x0396; ++ fftindex_bfsfcw_ratio = 0x011e; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02adb6db; ++ coeff1_4096Nu = 0x0156db6e; ++ coeff1_8191Nu = 0x00ab7312; ++ coeff1_8192Nu = 0x00ab6db7; ++ coeff1_8193Nu = 0x00ab685c; ++ coeff2_2k = 0x0156db6e; ++ coeff2_4k = 0x00ab6db7; ++ coeff2_8k = 0x0055b6db; ++ bfsfcw_fftindex_ratio = 0x02fd; ++ fftindex_bfsfcw_ratio = 0x0157; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x03200000; ++ coeff1_4096Nu = 0x01900000; ++ coeff1_8191Nu = 0x00c80640; ++ coeff1_8192Nu = 0x00c80000; ++ coeff1_8193Nu = 0x00c7f9c0; ++ coeff2_2k = 0x01900000; ++ coeff2_4k = 0x00c80000; ++ coeff2_8k = 0x00640000; ++ bfsfcw_fftindex_ratio = 0x028f; ++ fftindex_bfsfcw_ratio = 0x0190; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x03924925; ++ coeff1_4096Nu = 0x01c92492; ++ coeff1_8191Nu = 0x00e4996e; ++ coeff1_8192Nu = 0x00e49249; ++ coeff1_8193Nu = 0x00e48b25; ++ coeff2_2k = 0x01c92492; ++ coeff2_4k = 0x00e49249; ++ coeff2_8k = 0x00724925; ++ bfsfcw_fftindex_ratio = 0x023d; ++ fftindex_bfsfcw_ratio = 0x01c9; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20500000) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x023adeff; ++ coeff1_4096Nu = 0x011d6f80; ++ coeff1_8191Nu = 0x008ebc36; ++ coeff1_8192Nu = 0x008eb7c0; ++ coeff1_8193Nu = 0x008eb34a; ++ coeff2_2k = 0x011d6f80; ++ coeff2_4k = 0x008eb7c0; ++ coeff2_8k = 0x00475be0; ++ bfsfcw_fftindex_ratio = 0x0396; ++ fftindex_bfsfcw_ratio = 0x011d; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02ad0b99; ++ coeff1_4096Nu = 0x015685cc; ++ coeff1_8191Nu = 0x00ab4840; ++ coeff1_8192Nu = 0x00ab42e6; ++ coeff1_8193Nu = 0x00ab3d8c; ++ coeff2_2k = 0x015685cc; ++ coeff2_4k = 0x00ab42e6; ++ coeff2_8k = 0x0055a173; ++ bfsfcw_fftindex_ratio = 0x02fd; ++ fftindex_bfsfcw_ratio = 0x0157; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x031f3832; ++ coeff1_4096Nu = 0x018f9c19; ++ coeff1_8191Nu = 0x00c7d44b; ++ coeff1_8192Nu = 0x00c7ce0c; ++ coeff1_8193Nu = 0x00c7c7ce; ++ coeff2_2k = 0x018f9c19; ++ coeff2_4k = 0x00c7ce0c; ++ coeff2_8k = 0x0063e706; ++ bfsfcw_fftindex_ratio = 0x0290; ++ fftindex_bfsfcw_ratio = 0x0190; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x039164cb; ++ coeff1_4096Nu = 0x01c8b266; ++ coeff1_8191Nu = 0x00e46056; ++ coeff1_8192Nu = 0x00e45933; ++ coeff1_8193Nu = 0x00e45210; ++ coeff2_2k = 0x01c8b266; ++ coeff2_4k = 0x00e45933; ++ coeff2_8k = 0x00722c99; ++ bfsfcw_fftindex_ratio = 0x023e; ++ fftindex_bfsfcw_ratio = 0x01c9; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else if (adcFrequency == 20625000) { ++ if (bandwidth == 5000) { ++ coeff1_2048Nu = 0x02376948; ++ coeff1_4096Nu = 0x011bb4a4; ++ coeff1_8191Nu = 0x008ddec1; ++ coeff1_8192Nu = 0x008dda52; ++ coeff1_8193Nu = 0x008dd5e3; ++ coeff2_2k = 0x011bb4a4; ++ coeff2_4k = 0x008dda52; ++ coeff2_8k = 0x0046ed29; ++ bfsfcw_fftindex_ratio = 0x039c; ++ fftindex_bfsfcw_ratio = 0x011c; ++ } else if (bandwidth == 6000) { ++ coeff1_2048Nu = 0x02a8e4bd; ++ coeff1_4096Nu = 0x0154725e; ++ coeff1_8191Nu = 0x00aa3e81; ++ coeff1_8192Nu = 0x00aa392f; ++ coeff1_8193Nu = 0x00aa33de; ++ coeff2_2k = 0x0154725e; ++ coeff2_4k = 0x00aa392f; ++ coeff2_8k = 0x00551c98; ++ bfsfcw_fftindex_ratio = 0x0302; ++ fftindex_bfsfcw_ratio = 0x0154; ++ } else if (bandwidth == 7000) { ++ coeff1_2048Nu = 0x031a6032; ++ coeff1_4096Nu = 0x018d3019; ++ coeff1_8191Nu = 0x00c69e41; ++ coeff1_8192Nu = 0x00c6980c; ++ coeff1_8193Nu = 0x00c691d8; ++ coeff2_2k = 0x018d3019; ++ coeff2_4k = 0x00c6980c; ++ coeff2_8k = 0x00634c06; ++ bfsfcw_fftindex_ratio = 0x0294; ++ fftindex_bfsfcw_ratio = 0x018d; ++ } else if (bandwidth == 8000) { ++ coeff1_2048Nu = 0x038bdba6; ++ coeff1_4096Nu = 0x01c5edd3; ++ coeff1_8191Nu = 0x00e2fe02; ++ coeff1_8192Nu = 0x00e2f6ea; ++ coeff1_8193Nu = 0x00e2efd2; ++ coeff2_2k = 0x01c5edd3; ++ coeff2_4k = 0x00e2f6ea; ++ coeff2_8k = 0x00717b75; ++ bfsfcw_fftindex_ratio = 0x0242; ++ fftindex_bfsfcw_ratio = 0x01c6; ++ } else { ++ error = Error_INVALID_BW; ++ goto exit; ++ } ++ } else { ++ error = Error_INVALID_XTAL_FREQ; ++ goto exit; ++ } ++ ++ ++ /** Get ADC multiplier */ ++ error = Standard_readRegister (demodulator, 0, Processor_OFDM, adcx2, &adcMultiplier); ++ if (error) goto exit; ++ ++ if (adcMultiplier == 1) { ++ coeff1_2048Nu /= 2; ++ coeff1_4096Nu /= 2; ++ coeff1_8191Nu /= 2; ++ coeff1_8192Nu /= 2; ++ coeff1_8193Nu /= 2 ; ++ coeff2_2k /= 2; ++ coeff2_4k /= 2; ++ coeff2_8k /= 2; ++ } ++ ++ /** Write coeff1_2048Nu */ ++ /** Get Byte0 */ ++ temp0 = (Byte) (coeff1_2048Nu & 0x000000FF); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff1_2048Nu & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff1_2048Nu & 0x00FF0000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff1_2048Nu & 0x03000000) >> 24); ++ ++ /** Gig endian to make 8051 happy */ ++ buffer[cfoe_NS_2048_coeff1_25_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_2048_coeff1_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_2048_coeff1_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_2048_coeff1_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff2_2k */ ++ /** Get Byte0 */ ++ temp0 = (Byte) ((coeff2_2k & 0x000000FF)); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff2_2k & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff2_2k & 0x00FF0000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff2_2k & 0x01000000) >> 24); ++ ++ /** Gig endian to make 8051 happy */ ++ buffer[cfoe_NS_2k_coeff2_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_2k_coeff2_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_2k_coeff2_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_2k_coeff2_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff1_8191Nu */ ++ /** Get Byte0 */ ++ temp0 = (Byte) ((coeff1_8191Nu & 0x000000FF)); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff1_8191Nu & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff1_8191Nu & 0x00FFC000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff1_8191Nu & 0x03000000) >> 24); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[cfoe_NS_8191_coeff1_25_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_8191_coeff1_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_8191_coeff1_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_8191_coeff1_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff1_8192Nu */ ++ /** Get Byte0 */ ++ temp0 = (Byte) (coeff1_8192Nu & 0x000000FF); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff1_8192Nu & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff1_8192Nu & 0x00FFC000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff1_8192Nu & 0x03000000) >> 24); ++ ++ /** Gig endian to make 8051 happy */ ++ buffer[cfoe_NS_8192_coeff1_25_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_8192_coeff1_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_8192_coeff1_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_8192_coeff1_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff1_8193Nu */ ++ /** Get Byte0 */ ++ temp0 = (Byte) ((coeff1_8193Nu & 0x000000FF)); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff1_8193Nu & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff1_8193Nu & 0x00FFC000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff1_8193Nu & 0x03000000) >> 24); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[cfoe_NS_8193_coeff1_25_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_8193_coeff1_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_8193_coeff1_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_8193_coeff1_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff2_8k */ ++ /** Get Byte0 */ ++ temp0 = (Byte) ((coeff2_8k & 0x000000FF)); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff2_8k & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff2_8k & 0x00FF0000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff2_8k & 0x01000000) >> 24); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[cfoe_NS_8k_coeff2_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_8k_coeff2_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_8k_coeff2_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_8k_coeff2_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff1_4096Nu */ ++ /** Get Byte0 */ ++ temp0 = (Byte) (coeff1_4096Nu & 0x000000FF); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff1_4096Nu & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff1_4096Nu & 0x00FF0000) >> 16); ++ /** Get Byte3[1:0] */ ++ /** Bit[7:2] will be written soon and so don't have to care them */ ++ temp3 = (Byte) ((coeff1_4096Nu & 0x03000000) >> 24); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[cfoe_NS_4096_coeff1_25_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_4096_coeff1_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_4096_coeff1_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_4096_coeff1_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Write coeff2_4k */ ++ /** Get Byte0 */ ++ temp0 = (Byte) ((coeff2_4k & 0x000000FF)); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((coeff2_4k & 0x0000FF00) >> 8); ++ /** Get Byte2 */ ++ temp2 = (Byte) ((coeff2_4k & 0x00FF0000) >> 16); ++ /** Get Byte3 */ ++ temp3 = (Byte) ((coeff2_4k & 0x01000000) >> 24); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[cfoe_NS_4k_coeff2_24 - cfoe_NS_2048_coeff1_25_24] = temp3; ++ buffer[cfoe_NS_4k_coeff2_23_16 - cfoe_NS_2048_coeff1_25_24] = temp2; ++ buffer[cfoe_NS_4k_coeff2_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[cfoe_NS_4k_coeff2_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Get Byte0 */ ++ temp0 = (Byte) (bfsfcw_fftindex_ratio & 0x00FF); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((bfsfcw_fftindex_ratio & 0xFF00) >> 8); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[bfsfcw_fftindex_ratio_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[bfsfcw_fftindex_ratio_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ /** Get Byte0 */ ++ temp0 = (Byte) (fftindex_bfsfcw_ratio & 0x00FF); ++ /** Get Byte1 */ ++ temp1 = (Byte) ((fftindex_bfsfcw_ratio & 0xFF00) >> 8); ++ ++ /** Big endian to make 8051 happy */ ++ buffer[fftindex_bfsfcw_ratio_15_8 - cfoe_NS_2048_coeff1_25_24] = temp1; ++ buffer[fftindex_bfsfcw_ratio_7_0 - cfoe_NS_2048_coeff1_25_24] = temp0; ++ ++ error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, cfoe_NS_2048_coeff1_25_24, 36, buffer); ++ if (error) goto exit; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Byte* firmwareCodes, ++ IN Segment* firmwareSegments, ++ IN Byte* firmwarePartitions ++) { ++ Dword error = Error_NO_ERROR; ++ Dword beginPartition; ++ Dword endPartition; ++ Dword version; ++ Dword firmwareLength; ++ Byte* firmwareCodesPointer; ++ Word command; ++ Dword i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Set I2C master clock speed. */ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_one_cycle_counter_tuner, User_I2C_SPEED); ++ if (error) goto exit; ++ ++ firmwareCodesPointer = firmwareCodes; ++ beginPartition = 0; ++ endPartition = firmwarePartitions[0]; ++ ++ for (i = beginPartition; i < endPartition; i++) { ++ firmwareLength = firmwareSegments[i].segmentLength; ++ if (firmwareSegments[i].segmentType == 0) { ++ /** Dwonload firmware */ ++ error = Standard_sendCommand (demodulator, Command_FW_DOWNLOAD_BEGIN, 0, Processor_LINK, 0, NULL, 0, NULL); ++ if (error) goto exit; ++ if (ganymede->cmdDescription->loadFirmware != NULL) { ++ error = ganymede->cmdDescription->loadFirmware (demodulator, firmwareLength, firmwareCodesPointer); ++ } ++ if (error) goto exit; ++ error = Standard_sendCommand (demodulator, Command_FW_DOWNLOAD_END, 0, Processor_LINK, 0, NULL, 0, NULL); ++ if (error) goto exit; ++ } else if (firmwareSegments[i].segmentType == 1) { ++ /** Copy firmware */ ++ error = Standard_sendCommand (demodulator, Command_SCATTER_WRITE, 0, Processor_LINK, firmwareLength, firmwareCodesPointer, 0, NULL); ++ if (error) goto exit; ++ } else { ++ /** Direct write firmware */ ++ command = (Word) (firmwareCodesPointer[0] << 8) + (Word) firmwareCodesPointer[1]; ++ error = Standard_sendCommand (demodulator, command, 0, Processor_LINK, firmwareLength - 2, firmwareCodesPointer + 2, 0, NULL); ++ if (error) goto exit; ++ } ++ firmwareCodesPointer += firmwareLength; ++ } ++ ++ /** Boot */ ++ error = Standard_sendCommand (demodulator, Command_BOOT, 0, Processor_LINK, 0, NULL, 0, NULL); ++ if (error) goto exit; ++ ++ User_delay (demodulator, 10); ++ ++ /** Check if firmware is running */ ++ version = 0; ++ error = Standard_getFirmwareVersion (demodulator, Processor_LINK, &version); ++ if (error) goto exit; ++ if (version == 0) ++ error = Error_BOOT_FAIL; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_loadScript ( ++ IN Demodulator* demodulator, ++ IN StreamType streamType, ++ IN Word* scriptSets, ++ IN ValueSet* scripts, ++ IN Word* tunerScriptSets, ++ IN ValueSet* tunerScripts ++) { ++ Dword error = Error_NO_ERROR; ++ Word beginScript; ++ Word endScript; ++ //Byte adcType = 0; ++ Byte i; ++ Word j; ++ Byte value; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ ++ if ((scriptSets[0] != 0) && (scripts != NULL)) ++ { ++ beginScript = 0; ++ endScript = scriptSets[0]; ++ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ /** Load OFSM init script */ ++ for (j = beginScript; j < endScript; j++) { ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, scripts[j].address, scripts[j].value); ++ if (error) goto exit; ++ } ++ } ++ } ++ ++ /** Detect difference between A and B */ ++ error = Standard_readRegister (demodulator, 0, Processor_LINK, 0x384F, &value); ++ if (error) goto exit; ++ ++ if ((tunerScriptSets[0] != 0) && (tunerScripts != NULL)) ++ { ++ if (tunerScriptSets[1] != 0 && value == 0xFF) ++ { ++ beginScript = tunerScriptSets[0]; ++ endScript = tunerScriptSets[0] + tunerScriptSets[1]; ++ } else { ++ beginScript = 0; ++ endScript = tunerScriptSets[0]; ++ } ++ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ /** Load tuner init script */ ++ for (j = beginScript; j < endScript; j++) { ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, tunerScripts[j].address, tunerScripts[j].value); ++ if (error) goto exit; ++ } ++ } ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_loadIrTable ( ++ IN Demodulator* demodulator, ++ IN Word tableLength, ++ IN Byte* table ++) { ++ Dword error = Error_NO_ERROR; ++ Byte baseHigh; ++ Byte baseLow; ++ Word registerBase; ++ Word i; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_readRegister (demodulator, 0, Processor_LINK, 0x417F, &baseHigh); ++ if (error) goto exit; ++ error = Standard_readRegister (demodulator, 0, Processor_LINK, 0x4180, &baseLow); ++ if (error) goto exit; ++ ++ registerBase = (Word) (baseHigh << 8) + (Word) baseLow; ++ ++ if (registerBase) { ++ for (i = 0; i < tableLength; i++) { ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, registerBase + i, table[i]); ++ if (error) goto exit; ++ } ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_initialize ( ++ IN Demodulator* demodulator, ++ IN Byte chipNumber, ++ IN Word sawBandwidth, ++ IN StreamType streamType, ++ IN Architecture architecture ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ InitializeRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ ganymede->driver = NULL; ++ error = Standard_getDriver (demodulator, &ganymede->driver); ++ ++ if (ganymede->driver != NULL) { ++ request.chipNumber = chipNumber; ++ request.sawBandwidth = sawBandwidth; ++ request.streamType = streamType; ++ request.architecture = architecture; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_INITIALIZE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Dword crystal = 0; ++ Dword adc = 0; ++ Dword fcw = 0; ++ Byte buffer[4]; ++ Dword version = 0; ++ Word* tunerScriptSets = NULL; ++ ValueSet* tunerScripts = NULL; ++ ++ ++ Byte i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ ganymede->chipNumber = chipNumber; ++ ganymede->options = 0x0000; ++ ganymede->fcw = 0x00000000; ++ ganymede->frequency[0] = 642000; ++ ganymede->frequency[1] = 642000; ++ ganymede->initialized = False; ++ ++ if (ganymede->busId == 0xFFFF) { ++ goto exit; ++ } ++ ++ ++ if (ganymede->tunerDescription->tunerId == 0xFFFF) { ++ goto exit; ++ } ++ ++ error = Standard_getFirmwareVersion (demodulator, Processor_LINK, &version); ++ if (error) goto exit; ++ if (version != 0) { ++ ganymede->booted = True; ++ } else { ++ ganymede->booted = False; ++ } ++ ++ ++ ++ ++ ganymede->firmwareCodes = Firmware_codes; ++ ganymede->firmwareSegments = Firmware_segments; ++#if 1 //j017,set to 1 //j014+s ++ ganymede->firmwarePartitions = Firmware_partitions; ++#else ++ ganymede->firmwarePartitions = Firmware_new_partitions; ++#endif //j014+e ++ ganymede->scriptSets = Firmware_scriptSets; ++ ganymede->scripts = Firmware_scripts; ++ ++ /** Set up by default tunerDescription */ /** release1remove */ ++ tunerScriptSets = ganymede->tunerDescription->tunerScriptSets; ++ tunerScripts = ganymede->tunerDescription->tunerScript; ++ ++ ++ error = Standard_readRegisterBits (demodulator, 0, Processor_LINK, r_io_mux_pwron_clk_strap, io_mux_pwron_clk_strap_pos, io_mux_pwron_clk_strap_len, &i); ++ if (error) goto exit; ++ ++ ganymede->crystalFrequency = Standard_clockTable[i].crystalFrequency; ++ ganymede->adcFrequency = Standard_clockTable[i].adcFrequency; ++ ++ ganymede->dataReady = False; ++ ++ /** Write secondary I2C address to device */ ++ /** it is needed to write i2c address prior to fw-downloading */ ++ if (ganymede->chipNumber > 1) { ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, 0x417F, ((PDEVICE_CONTEXT)demodulator->userData)->Map.I2C_SLAVE_ADDR); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, 0x417F, 0x00); ++ if (error) goto exit; ++ } ++ ++ if (ganymede->firmwareCodes != NULL) { ++ if (ganymede->booted == False) { ++ error = Standard_loadFirmware (demodulator, ganymede->firmwareCodes, ganymede->firmwareSegments, ganymede->firmwarePartitions); ++ if (error) goto exit; ++ ganymede->booted = True; ++ } ++ } ++ ++ /** Detect the HostA or HostB */ ++ error = Standard_readRegisterBits (demodulator, 0, Processor_LINK, r_io_mux_pwron_hosta, io_mux_pwron_hosta_pos, io_mux_pwron_hosta_len, &ganymede->hostInterface[0]); ++ if (error) goto exit; ++ ++ ++ /** Tell firmware the type of tuner. */ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegister (demodulator, i, Processor_LINK, p_reg_link_ofsm_dummy_15_8, (Byte) ganymede->tunerDescription->tunerId); ++ if (error) goto exit; ++ ++ /** Set read-update bit to 1 for constellation */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_feq_read_update, reg_feq_read_update_pos, reg_feq_read_update_len, 1); ++ if (error) goto exit; ++ ++ /** Enable FEC Monitor */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_fec_vtb_rsd_mon_en, fec_vtb_rsd_mon_en_pos, fec_vtb_rsd_mon_en_len, 1); ++ if (error) goto exit; ++ } ++ ++ /** Compute ADC and load them to device */ ++ error = Standard_computeCrystal (demodulator, (Long) ganymede->crystalFrequency * 1000, &crystal); ++ if (error) goto exit; ++ ++ buffer[0] = (Byte) (crystal & 0x000000FF); ++ buffer[1] = (Byte) ((crystal & 0x0000FF00) >> 8); ++ buffer[2] = (Byte) ((crystal & 0x00FF0000) >> 16); ++ buffer[3] = (Byte) ((crystal & 0xFF000000) >> 24); ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisters (demodulator, i, Processor_OFDM, crystal_clk_7_0, 4, buffer); ++ if (error) goto exit; ++ } ++ ++ /** Compute ADC and load them to device */ ++ error = Standard_computeAdc (demodulator, (Long) ganymede->adcFrequency, &adc); ++ if (error) goto exit; ++ ++ buffer[0] = (Byte) (adc & 0x000000FF); ++ buffer[1] = (Byte) ((adc & 0x0000FF00) >> 8); ++ buffer[2] = (Byte) ((adc & 0x00FF0000) >> 16); ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisters (demodulator, i, Processor_OFDM, p_reg_f_adc_7_0, 3, buffer); ++ if (error) goto exit; ++ } ++ ++ /** Compute FCW and load them to device */ ++ error = Standard_computeFcw (demodulator, (Long) ganymede->adcFrequency, (Long) ganymede->tunerDescription->ifFrequency, ganymede->tunerDescription->inversion, &fcw); ++ if (error) goto exit; ++ ganymede->fcw = fcw; ++ ++ buffer[0] = (Byte) (fcw & 0x000000FF); ++ buffer[1] = (Byte) ((fcw & 0x0000FF00) >> 8); ++ buffer[2] = (Byte) ((fcw & 0x007F0000) >> 16); ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisters (demodulator, i, Processor_OFDM, bfs_fcw_7_0, bfs_fcw_22_16 - bfs_fcw_7_0 + 1, buffer); ++ if (error) goto exit; ++ } ++ ++ /** Set the desired stream type */ ++ error = Standard_setStreamType (demodulator, streamType); ++ if (error) goto exit; ++ ++ /** Set the desired architecture type */ ++ error = Standard_setArchitecture (demodulator, architecture); ++ if (error) goto exit; ++ ++ if (ganymede->scripts != NULL) { ++ error = Standard_loadScript (demodulator, streamType, ganymede->scriptSets, ganymede->scripts, tunerScriptSets, tunerScripts); ++ if (error) goto exit; ++ } ++ ++ if (ganymede->tunerDescription->openTuner != NULL) { ++ if ((ganymede->busId != Bus_I2M) && (ganymede->busId != Bus_I2U)) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = ganymede->tunerDescription->openTuner (demodulator, i); ++ if (error) goto exit; ++ } ++ } ++ } ++ ++#if User_USE_INTERRUPT ++ if (ganymede->busId == Bus_SDIO) { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_sdioc_external_int_en, reg_sdioc_external_int_en_pos, reg_sdioc_external_int_en_len, 1); ++ if (error) goto exit; ++ } ++#endif ++ ++ for (i = 0; i< ganymede->chipNumber; i++) { ++ ++ /** Set H/W MPEG2 locked detection **/ ++ error = Standard_writeRegister (demodulator, i, Processor_LINK, p_reg_top_lock3_out, 1); ++ if (error) goto exit; ++ ++ /** Set registers for driving power 0xD830 **/ ++ error = Standard_writeRegister (demodulator, i, Processor_LINK, p_reg_top_padmiscdr2, 1); ++ if (error) goto exit; ++ ++ /** Set registers for driving power 0xD831 **/ ++ error = Standard_writeRegister (demodulator, i, Processor_LINK, p_reg_top_padmiscdr4, 0); ++ if (error) goto exit; ++ ++ /** Set registers for driving power 0xD832 **/ ++ error = Standard_writeRegister (demodulator, i, Processor_LINK, p_reg_top_padmiscdr8, 0); ++ if (error) goto exit; ++ } ++ ++ ganymede->initialized = True; ++ ++#endif ++exit: ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_finalize ( ++ IN Demodulator* demodulator ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ FinalizeRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_FINALIZE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->tunerDescription->closeTuner != NULL) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = ganymede->tunerDescription->closeTuner (demodulator, i); ++ } ++ } ++ ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isAgcLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ *locked = False; ++ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, p_agc_lock, agc_lock_pos, agc_lock_len, &temp); ++ if (error) goto exit; ++ if (temp) *locked = True; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isCfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ *locked = False; ++ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, r_reg_cfoe_divg_flag, reg_cfoe_divg_flag_pos, reg_cfoe_divg_flag_len, &temp); ++ if (error) goto exit; ++ if (!temp) *locked = True; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isSfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ *locked = False; ++ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, r_reg_sfoe_divg_flag, reg_sfoe_divg_flag_pos, reg_sfoe_divg_flag_len, &temp); ++ if (error) goto exit; ++ if (!temp) *locked = True; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isTpsLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ *locked = False; ++ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, p_fd_tpsd_lock, fd_tpsd_lock_pos, fd_tpsd_lock_len, &temp); ++ if (error) goto exit; ++ if (temp) *locked = True; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isMpeg2Locked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ *locked = False; ++ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, r_mp2if_sync_byte_locked, mp2if_sync_byte_locked_pos, mp2if_sync_byte_locked_len, &temp); ++ if (error) goto exit; ++ if (temp) *locked = True; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_isLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++) { ++ Dword error = Error_NO_ERROR; ++ ++ Word emptyLoop = 0; ++ Word tpsLoop = 0; ++ Word mpeg2Loop = 0; ++ Byte channels[2]; ++ Byte begin; ++ Byte end; ++ Byte i; ++ Byte emptyChannel = 1; ++ Byte tpsLocked = 0; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ IsLockedRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.locked = locked; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_ISLOCKED, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ ++ *locked = False; ++ ++ if (ganymede->architecture == Architecture_DCA) { ++ begin = 0; ++ end = ganymede->chipNumber; ++ } else { ++ begin = chip; ++ end = begin + 1; ++ } ++ ++ for (i = begin; i < end; i++) { ++ ganymede->statistic[i].signalPresented = False; ++ ganymede->statistic[i].signalLocked = False; ++ ganymede->statistic[i].signalQuality = 0; ++ ganymede->statistic[i].signalStrength = 0; ++ } ++ ++ channels[0] = 2; ++ channels[1] = 2; ++ while (emptyLoop < 40) { ++ for (i = begin; i < end; i++) { ++ error = Standard_readRegister (demodulator, i, Processor_OFDM, empty_channel_status, &channels[i]); ++ if (error) goto exit; ++ } ++ if ((channels[0] == 1) || (channels[1] == 1)) { ++ emptyChannel = 0; ++ break; ++ } ++ if ((channels[0] == 2) && (channels[1] == 2)) { ++ emptyChannel = 1; ++ goto exit; ++ } ++ User_delay (demodulator, 25); ++ emptyLoop++; ++ } ++ ++ if (emptyChannel == 1) goto exit; ++ ++ while (tpsLoop < 50) { ++ for (i = begin; i < end; i++) { ++ /** Empty channel */ ++ error = Standard_isTpsLocked (demodulator, i, &ganymede->statistic[i].signalPresented); ++ if (error) goto exit; ++ if (ganymede->statistic[i].signalPresented == True) { ++ tpsLocked = 1; ++ break; ++ } ++ } ++ ++ if (tpsLocked == 1) break; ++ ++ User_delay (demodulator, 25); ++ tpsLoop++; ++ } ++ ++ if (tpsLocked == 0) goto exit; ++ ++ while (mpeg2Loop < 40) { ++ if (ganymede->architecture == Architecture_DCA) { ++ error = Standard_isMpeg2Locked (demodulator, 0, &ganymede->statistic[0].signalLocked); ++ if (error) goto exit; ++ if (ganymede->statistic[0].signalLocked == True) { ++ for (i = begin; i < end; i++) { ++ ganymede->statistic[i].signalQuality = 80; ++ ganymede->statistic[i].signalStrength = 80; ++ } ++ *locked = True; ++ break; ++ } ++ } else { ++ error = Standard_isMpeg2Locked (demodulator, chip, &ganymede->statistic[chip].signalLocked); ++ if (error) goto exit; ++ if (ganymede->statistic[chip].signalLocked == True) { ++ ganymede->statistic[chip].signalQuality = 80; ++ ganymede->statistic[chip].signalStrength = 80; ++ *locked = True; ++ break; ++ } ++ } ++ User_delay (demodulator, 25); ++ mpeg2Loop++; ++ } ++ for (i = begin; i < end; i++) { ++ ganymede->statistic[i].signalQuality = 0; ++ ganymede->statistic[i].signalStrength = 20; ++ } ++ ++exit: ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setPriority ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Priority priority ++) ++{ ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte pri; ++ Byte cr; ++ Byte valuew_7_0 = 0; ++ Byte valuew_10_8 = 0; ++ Byte nfvaluew_7_0 = 0; ++ Byte nfvaluew_10_8 = 0; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ if (priority == Priority_HIGH) { ++ pri = 1; ++ /** Get code rate here */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_hpcr, reg_tpsd_hpcr_pos, reg_tpsd_hpcr_len, &cr); ++ if (error) goto exit; ++ } else { ++ pri = 0; ++ /** Get code rate here */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_lpcr, reg_tpsd_lpcr_pos, reg_tpsd_lpcr_len, &cr); ++ if (error) goto exit; ++ } ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_dec_pri, reg_dec_pri_pos, reg_dec_pri_len, pri); ++ if (error) goto exit; ++ ++ /** Set sbx quantizer */ ++ switch (cr) { ++ case 0 : ++ valuew_7_0 = 0x20; ++ valuew_10_8 = 0x03; ++ nfvaluew_7_0 = 0x00; ++ nfvaluew_10_8 = 0x01; ++ break; ++ case 1 : ++ valuew_7_0 = 0x5E; ++ valuew_10_8 = 0x01; ++ nfvaluew_7_0 = 0x80; ++ nfvaluew_10_8 = 0x00; ++ break; ++ case 2 : ++ valuew_7_0 = 0x2C; ++ valuew_10_8 = 0x01; ++ nfvaluew_7_0 = 0x55; ++ nfvaluew_10_8 = 0x00; ++ break; ++ case 3 : ++ valuew_7_0 = 0xFA; ++ valuew_10_8 = 0x00; ++ nfvaluew_7_0 = 0x40; ++ nfvaluew_10_8 = 0x00; ++ break; ++ case 4 : ++ valuew_7_0 = 0xC8; ++ valuew_10_8 = 0x00; ++ nfvaluew_7_0 = 0x33; ++ nfvaluew_10_8 = 0x00; ++ break; ++ } ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_qnt_valuew_7_0, valuew_7_0); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_qnt_valuew_10_8, valuew_10_8); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_qnt_nfvaluew_7_0, nfvaluew_7_0); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_qnt_nfvaluew_10_8, nfvaluew_10_8); ++ if (error) goto exit; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_reset ( ++ IN Demodulator* demodulator ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte value; ++ Byte i; ++ Byte j; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ ++ /** Enable OFDM reset */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, I2C_reg_ofdm_rst_en, reg_ofdm_rst_en_pos, reg_ofdm_rst_en_len, 0x01); ++ if (error) goto exit; ++ ++ /** Start reset mechanism */ ++ value = 0x00; ++ error = Standard_writeRegisters (demodulator, i, Processor_OFDM, RESET_STATE, 1, &value); ++ if (error) goto exit; ++ ++ /** Clear ofdm reset */ ++ for (j = 0; j < 150; j++) { ++ error = Standard_readRegisterBits (demodulator, i, Processor_OFDM, I2C_reg_ofdm_rst, reg_ofdm_rst_pos, reg_ofdm_rst_len, &value); ++ if (error) goto exit; ++ if (value) break; ++ User_delay (demodulator, 10); ++ } ++ ++ if (j == 150) { ++ error = Error_RESET_TIMEOUT; ++ goto exit; ++ } ++ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, I2C_reg_ofdm_rst, reg_ofdm_rst_pos, reg_ofdm_rst_len, 0); ++ if (error) goto exit; ++ ++ /** Disable OFDM reset */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, I2C_reg_ofdm_rst_en, reg_ofdm_rst_en_pos, reg_ofdm_rst_en_len, 0x00); ++ if (error) goto exit; ++ } ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_programFcw ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long shift, /** Hz */ ++ IN Dword adcFrequency /** Hz */ ++) ++{ ++ Dword error = Error_NO_ERROR; ++ Dword fcw; ++ Long fcwShift; ++ Byte temp0; ++ Byte temp1; ++ Byte temp2; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get shift freq */ ++ fcwShift = (shift * 8 * 1024 + (Long) adcFrequency / (2 * 1024)) / (Long) adcFrequency * 1024; ++ ++ fcw = (Dword) ((Long) ganymede->fcw + fcwShift); ++ ++ temp0 = (Byte) (fcw & 0x000000FF); ++ temp1 = (Byte) ((fcw & 0x0000FF00) >> 8); ++ temp2 = (Byte) ((fcw & 0x007F0000) >> 16); ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_bfs_fcw_7_0, temp0); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_bfs_fcw_15_8, temp1); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_reg_bfs_fcw_22_16, temp2); ++ if (error) goto exit; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelModulation* channelModulation ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetChannelModulationRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.channelModulation = channelModulation; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETCHANNELMODULATION, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte temp; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get constellation type */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_const, reg_tpsd_const_pos, reg_tpsd_const_len, &temp); ++ if (error) goto exit; ++ channelModulation->constellation = (Constellation) temp; ++ ++ /** Get TPS hierachy and alpha value */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_hier, reg_tpsd_hier_pos, reg_tpsd_hier_len, &temp); ++ if (error) goto exit; ++ channelModulation->hierarchy = (Hierarchy)temp; ++ ++ /** Get high/low priority */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_dec_pri, reg_dec_pri_pos, reg_dec_pri_len, &temp); ++ if (error) goto exit; ++ if (temp) ++ channelModulation->priority = Priority_HIGH; ++ else ++ channelModulation->priority = Priority_LOW; ++ ++ /** Get high code rate */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_hpcr, reg_tpsd_hpcr_pos, reg_tpsd_hpcr_len, &temp); ++ if (error) goto exit; ++ channelModulation->highCodeRate = (CodeRate) temp; ++ ++ /** Get low code rate */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_lpcr, reg_tpsd_lpcr_pos, reg_tpsd_lpcr_len, &temp); ++ if (error) goto exit; ++ channelModulation->lowCodeRate = (CodeRate) temp; ++ ++ /** Get guard interval */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_gi, reg_tpsd_gi_pos, reg_tpsd_gi_len, &temp); ++ if (error) goto exit; ++ channelModulation->interval = (Interval) temp; ++ ++ /** Get FFT mode */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_txmod, reg_tpsd_txmod_pos, reg_tpsd_txmod_len, &temp); ++ if (error) goto exit; ++ channelModulation->transmissionMode = (TransmissionModes) temp; ++ ++ /** Get bandwidth */ ++ error = Standard_readRegisterBits (demodulator, chip, Processor_OFDM, g_reg_bw, reg_bw_pos, reg_bw_len, &temp); ++ if (error) goto exit; ++ channelModulation->bandwidth = (Bandwidth) temp; ++ ++ /** Get frequency */ ++ channelModulation->frequency = ganymede->frequency[chip]; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN ChannelModulation* channelModulation ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Byte temp; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Set constellation type */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_const, reg_tpsd_const_pos, reg_tpsd_const_len, (Byte) channelModulation->constellation); ++ if (error) goto exit; ++ ++ /** Set TPS hierachy and alpha value */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_hier, reg_tpsd_hier_pos, reg_tpsd_hier_len, (Byte) channelModulation->hierarchy); ++ if (error) goto exit; ++ ++ /** Set high/low priority */ ++ if (channelModulation->priority == Priority_HIGH) ++ temp = 1; ++ else ++ temp = 0; ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_dec_pri, reg_dec_pri_pos, reg_dec_pri_len, temp); ++ if (error) goto exit; ++ ++ /** Set high code rate */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_hpcr, reg_tpsd_hpcr_pos, reg_tpsd_hpcr_len, (Byte) channelModulation->highCodeRate); ++ if (error) goto exit; ++ ++ /** Set low code rate */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_lpcr, reg_tpsd_lpcr_pos, reg_tpsd_lpcr_len, (Byte) channelModulation->lowCodeRate); ++ if (error) goto exit; ++ ++ /** Set guard interval */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_gi, reg_tpsd_gi_pos, reg_tpsd_gi_len, (Byte) channelModulation->interval); ++ if (error) goto exit; ++ ++ /** Set FFT mode */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_tpsd_txmod, reg_tpsd_txmod_pos, reg_tpsd_txmod_len, (Byte) channelModulation->transmissionMode); ++ if (error) goto exit; ++ ++ /** Set bandwidth */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, g_reg_bw, reg_bw_pos, reg_bw_len, (Byte) channelModulation->bandwidth); ++ if (error) goto exit; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++Dword Standard_setFrequency ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Dword frequency ++) { ++ Dword error = Error_NO_ERROR; ++ Byte band; ++ Byte i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Clear easy mode flag first */ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, Training_Mode, 0x00); ++ if (error) goto exit; ++ ++ /** Clear empty_channel_status lock flag */ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, empty_channel_status, 0x00); ++ if (error) goto exit; ++ ++ /** Clear MPEG2 lock flag */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, r_mp2if_sync_byte_locked, mp2if_sync_byte_locked_pos, mp2if_sync_byte_locked_len, 0x00); ++ if (error) goto exit; ++ ++ /** Determine frequency band */ ++ band = 0xFF; ++ for (i = 0; i < Standard_MAX_BAND; i++) { ++ if ((frequency >= Standard_bandTable[i].minimum) && (frequency <= Standard_bandTable[i].maximum)) { ++ band = i; ++ break; ++ } ++ } ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, FreBand, band); ++ if (error) goto exit; ++ ++ if (ganymede->tunerDescription->setTuner != NULL) { ++ if ((ganymede->busId != Bus_I2M) && (ganymede->busId != Bus_I2U)) { ++ error = ganymede->tunerDescription->setTuner (demodulator, chip, ganymede->bandwidth[chip], frequency); ++ if (error) goto exit; ++ } ++ } ++ ++ /** Trigger ofsm */ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, trigger_ofsm, 0); ++ if (error) goto exit; ++ ++ ganymede->frequency[chip] = frequency; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setFrequencyForRetrain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Dword frequency, ++ IN Word bandwidth, ++ IN ChannelModulation* channelModulation ++) ++{ ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Clear MPEG2 lock flag first */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, r_mp2if_sync_byte_locked, mp2if_sync_byte_locked_pos, mp2if_sync_byte_locked_len, 0); ++ if (error) goto exit; ++ ++ /** Set frequency for all chips */ ++ if (ganymede->tunerDescription->setTuner != NULL) { ++ error = ganymede->tunerDescription->setTuner (demodulator, chip, bandwidth, frequency); ++ if (error) goto exit; ++ } ++ ++ /** Trigger ofsm */ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, trigger_ofsm, 0); ++ if (error) goto exit; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_maskDcaOutput ( ++ IN Demodulator* demodulator ++) { ++ Dword error = Error_NO_ERROR; ++ Byte i; ++ Bool dcaValid = False; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if ((ganymede->chipNumber > 1) && (ganymede->architecture == Architecture_DCA)) ++ dcaValid = True; ++ ++ if (dcaValid == True) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_dca_upper_out_en, reg_dca_upper_out_en_pos, reg_dca_upper_out_en_len, 0); ++ if (error) goto exit; ++ } ++ User_delay (demodulator, 5); ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_acquireChannel ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++) { ++ Dword error = Error_NO_ERROR; ++ ++ Byte begin; ++ Byte end; ++ Byte i; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ AcquireChannelRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.frequency = frequency; ++ request.bandwidth = bandwidth; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_ACQUIRECHANNEL, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ deb_info("Enter %s , bw=%d, freq=%d\n", __FUNCTION__, bandwidth, frequency); ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->architecture == Architecture_DCA) { ++ begin = 0; ++ end = ganymede->chipNumber; ++ } else { ++ begin = chip; ++ end = begin + 1; ++ } ++ ++ for (i = begin; i < end; i++) { ++ error = Standard_selectBandwidth (demodulator, i, bandwidth, ganymede->adcFrequency); ++ if (error) goto exit; ++ ganymede->bandwidth[i] = bandwidth; ++ } ++ ++ error = Standard_maskDcaOutput (demodulator); ++ if (error) goto exit; ++ ++ /** Set frequency */ ++ for (i = begin; i < end; i++) { ++ error = Standard_setFrequency (demodulator, i, frequency); ++ if (error) goto exit; ++ } ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setStreamType ( ++ IN Demodulator* demodulator, ++ IN StreamType streamType ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ SetStreamTypeRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.streamType = streamType; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_SETSTREAMTYPE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ //Dword warning = Error_NO_ERROR; ++ Ganymede* ganymede; ++ Byte i; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Enable DVB-T interrupt if next stream type is StreamType_DVBT_DATAGRAM */ ++ if (streamType == StreamType_DVBT_DATAGRAM) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_inten, reg_dvbt_inten_pos, reg_dvbt_inten_len, 1); ++ if (error) goto exit; ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_mpeg_full_speed, reg_mpeg_full_speed_pos, reg_mpeg_full_speed_len, 0); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_mpeg_full_speed, reg_mpeg_full_speed_pos, reg_mpeg_full_speed_len, 1); ++ if (error) goto exit; ++ } ++ } ++ } ++ ++ /** Enable DVB-T mode */ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_en, reg_dvbt_en_pos, reg_dvbt_en_len, 1); ++ if (error) goto exit; ++ } ++ ++ /** Enter sub mode */ ++ switch (streamType) { ++ ++ case StreamType_NONE : ++ goto exit; ++ break; ++ ++ case StreamType_DVBT_DATAGRAM : ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_par_mode, mp2if_mpeg_par_mode_pos, mp2if_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ /** Fix current leakage */ ++ if (ganymede->chipNumber > 1) { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_par_mode, reg_top_hostb_mpeg_par_mode_pos, reg_top_hostb_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } else { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_par_mode, reg_top_hostb_mpeg_par_mode_pos, reg_top_hostb_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } else { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_par_mode, mp2if_mpeg_par_mode_pos, mp2if_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ ++ /** Fix current leakage */ ++ if (ganymede->chipNumber > 1) { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_par_mode, reg_top_hostb_mpeg_par_mode_pos, reg_top_hostb_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ } else { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hostb_mpeg_par_mode, reg_top_hostb_mpeg_par_mode_pos, reg_top_hostb_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } ++ } ++ break; ++ case StreamType_DVBT_PARALLEL : ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_mp2if_mpeg_par_mode, mp2if_mpeg_par_mode_pos, mp2if_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ ++ if (i == 0) { ++ if (ganymede->hostInterface[0]) { ++ /** HostA interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } else { ++ /** HostB interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hostb_mpeg_par_mode, reg_top_hostb_mpeg_par_mode_pos, reg_top_hostb_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } else { ++ /** HostA interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } ++ break; ++ case StreamType_DVBT_SERIAL : ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ ++ if (i == 0) { ++ if (ganymede->hostInterface[0]) { ++ /** HostA interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ } else { ++ /** HostB interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ } ++ } else { ++ /** HostA interface is enabled */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ } ++ } ++ break; ++ } ++ error = User_mpegConfig (demodulator); ++ ++ ganymede->streamType = streamType; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setArchitecture ( ++ IN Demodulator* demodulator, ++ IN Architecture architecture ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ SetArchitectureRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.architecture = architecture; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_SETARCHITECTURE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Word frameSize; ++ Byte packetSize; ++ Byte buffer[2]; ++ Byte standAlone[2]; ++ Byte upperChip[2]; ++ Byte upperHost[2]; ++ Byte lowerChip[2]; ++ Byte lowerHost[2]; ++ Byte dcaEnable[2]; ++ Byte phaseLatch[2]; ++ Byte fpgaLatch[2]; ++ Byte i; ++ Bool pipValid = False; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (architecture == Architecture_DCA) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ standAlone[i] = 0; ++ upperChip[i] = 0; ++ upperHost[i] = 0; ++ lowerChip[i] = 0; ++ lowerHost[i] = 0; ++ dcaEnable[i] = 1; ++ phaseLatch[i] = 0; ++ fpgaLatch[i] = 0; ++ } ++ if (ganymede->chipNumber == 1) { ++ standAlone[0] = 1; ++ dcaEnable[0] = 0; ++ } else { ++ upperChip[ganymede->chipNumber - 1] = 1; ++ upperHost[0] = 1; ++ lowerChip[0] = 1; ++ lowerHost[ganymede->chipNumber - 1] = 1; ++ phaseLatch[0] = 1; ++ phaseLatch[ganymede->chipNumber - 1] = 1; ++ fpgaLatch[0] = 0x66; ++ fpgaLatch[ganymede->chipNumber - 1] = 0x66; ++ } ++ } else { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ standAlone[i] = 1; ++ upperChip[i] = 0; ++ upperHost[i] = 0; ++ lowerChip[i] = 0; ++ lowerHost[i] = 0; ++ dcaEnable[i] = 0; ++ phaseLatch[i] = 0; ++ fpgaLatch[i] = 0; ++ } ++ } ++ ++ if (ganymede->initialized == True) { ++ error = Standard_maskDcaOutput (demodulator); ++ if (error) goto exit; ++ } ++ ++ /** Set upper chip first in order to avoid I/O conflict */ ++ for (i = ganymede->chipNumber; i > 0; i--) { ++ /** Set dca_upper_chip */ ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_OFDM, p_reg_dca_upper_chip, reg_dca_upper_chip_pos, reg_dca_upper_chip_len, upperChip[i - 1]); ++ if (error) goto exit; ++ if (i == 1) { ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_upper, reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, upperHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_upper, reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, 0); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_upper, reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, upperHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_upper, reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, 0); ++ if (error) goto exit; ++ } ++ } else { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_upper, reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, upperHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_upper, reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, 0); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_upper, reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, upperHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_upper, reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, 0); ++ if (error) goto exit; ++ } ++ } ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_upper, reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, upperHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_upper, reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, 0); ++ if (error) goto exit; ++ } ++ ++ /** Set dca_lower_chip */ ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_OFDM, p_reg_dca_lower_chip, reg_dca_lower_chip_pos, reg_dca_lower_chip_len, lowerChip[i - 1]); ++ if (error) goto exit; ++ if (i == 1) { ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_lower, reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, lowerHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_lower, reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, 0); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_lower, reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, lowerHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_lower, reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, 0); ++ if (error) goto exit; ++ } ++ } else { ++ if (ganymede->hostInterface[0]) { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_lower, reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, lowerHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_lower, reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, 0); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_lower, reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, lowerHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_lower, reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, 0); ++ if (error) goto exit; ++ } ++ } ++ } else { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hostb_dca_lower, reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, lowerHost[i - 1]); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_top_hosta_dca_lower, reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, 0); ++ if (error) goto exit; ++ } ++ ++ /** Set phase latch */ ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_OFDM, p_reg_dca_platch, reg_dca_platch_pos, reg_dca_platch_len, phaseLatch[i - 1]); ++ if (error) goto exit; ++ ++ /** Set fpga latch */ ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_OFDM, p_reg_dca_fpga_latch, reg_dca_fpga_latch_pos, reg_dca_fpga_latch_len, fpgaLatch[i - 1]); ++ if (error) goto exit; ++ } ++ ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ /** Set stand alone */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_dca_stand_alone, reg_dca_stand_alone_pos, reg_dca_stand_alone_len, standAlone[i]); ++ if (error) goto exit; ++ ++ /** Set DCA enable */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_dca_en, reg_dca_en_pos, reg_dca_en_len, dcaEnable[i]); ++ if (error) goto exit; ++ } ++ ++ if (ganymede->initialized == True) { ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, trigger_ofsm, 0); ++ if (error) goto exit; ++ } ++ } ++ ++ ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ frameSize = User_USB20_FRAME_SIZE_DW; ++ packetSize = (Byte) (User_USB20_MAX_PACKET_SIZE / 4); ++ ++ if (ganymede->busId == Bus_USB11) { ++ frameSize = User_USB11_FRAME_SIZE_DW; ++ packetSize = (Byte) (User_USB11_MAX_PACKET_SIZE / 4); ++ } ++ ++ if ((ganymede->chipNumber > 1) && (architecture == Architecture_PIP)) ++ pipValid = True; ++#if 0 //j011+s ++ /** Reset EP4 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2_sw_rst, reg_mp2_sw_rst_pos, reg_mp2_sw_rst_len, 1); ++ if (error) goto exit; ++#endif //j011+e ++ ++ /** Reset EP5 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if2_sw_rst, reg_mp2if2_sw_rst_pos, reg_mp2if2_sw_rst_len, 1); ++ if (error) goto exit; ++ ++ /** Disable EP4 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep4_tx_en, reg_ep4_tx_en_pos, reg_ep4_tx_en_len, 0); ++ if (error) goto exit; ++ ++ /** Disable EP5 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep5_tx_en, reg_ep5_tx_en_pos, reg_ep5_tx_en_len, 0); ++ if (error) goto exit; ++ ++ /** Disable EP4 NAK */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep4_tx_nak, reg_ep4_tx_nak_pos, reg_ep4_tx_nak_len, 0); ++ if (error) goto exit; ++ ++ /** Disable EP5 NAK */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep5_tx_nak, reg_ep5_tx_nak_pos, reg_ep5_tx_nak_len, 0); ++ if (error) goto exit; ++ ++ /** Enable EP4 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep4_tx_en, reg_ep4_tx_en_pos, reg_ep4_tx_en_len, 1); ++ if (error) goto exit; ++ ++ /** Set EP4 transfer length */ ++ buffer[p_reg_ep4_tx_len_7_0 - p_reg_ep4_tx_len_7_0] = (Byte) frameSize; ++ buffer[p_reg_ep4_tx_len_15_8 - p_reg_ep4_tx_len_7_0] = (Byte) (frameSize >> 8); ++ error = Standard_writeRegisters (demodulator, 0, Processor_LINK, p_reg_ep4_tx_len_7_0, 2, buffer); ++ ++ /** Set EP4 packet size */ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_ep4_max_pkt, packetSize); ++ if (error) goto exit; ++ ++ if (pipValid == True) { ++ /** Enable EP5 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_LINK, p_reg_ep5_tx_en, reg_ep5_tx_en_pos, reg_ep5_tx_en_len, 1); ++ if (error) goto exit; ++ ++ /** Set EP5 transfer length */ ++ buffer[p_reg_ep5_tx_len_7_0 - p_reg_ep5_tx_len_7_0] = (Byte) frameSize; ++ buffer[p_reg_ep5_tx_len_15_8 - p_reg_ep5_tx_len_7_0] = (Byte) (frameSize >> 8); ++ error = Standard_writeRegisters (demodulator, 0, Processor_LINK, p_reg_ep5_tx_len_7_0, 2, buffer); ++ ++ /** Set EP5 packet size */ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_ep5_max_pkt, packetSize); ++ if (error) goto exit; ++ } ++ ++ ++ /** Disable 15 SER/PAR mode */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_mp2if_mpeg_par_mode, mp2if_mpeg_par_mode_pos, mp2if_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ ++ if (pipValid == True) { ++ /** Enable mp2if2 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if2_en, reg_mp2if2_en_pos, reg_mp2if2_en_len, 1); ++ if (error) goto exit; ++ ++ for (i = 1; i < ganymede->chipNumber; i++) { ++ /** Enable serial mode */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ ++ /** Enable HostB serial */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 1); ++ if (error) goto exit; ++ } ++ ++ /** Enable tsis */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_tsis_en, reg_tsis_en_pos, reg_tsis_en_len, 1); ++ if (error) goto exit; ++ } else { ++ /** Disable mp2if2 */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if2_en, reg_mp2if2_en_pos, reg_mp2if2_en_len, 0); ++ if (error) goto exit; ++ ++ for (i = 1; i < ganymede->chipNumber; i++) { ++ /** Disable serial mode */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_mp2if_mpeg_ser_mode, mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ ++ /** Disable HostB serial */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hostb_mpeg_ser_mode, reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ } ++ ++ /** Disable tsis */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_tsis_en, reg_tsis_en_pos, reg_tsis_en_len, 0); ++ if (error) goto exit; ++ } ++ ++ /** Negate EP4 reset */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2_sw_rst, reg_mp2_sw_rst_pos, reg_mp2_sw_rst_len, 0); ++ if (error) goto exit; ++ ++ /** Negate EP5 reset */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if2_sw_rst, reg_mp2if2_sw_rst_pos, reg_mp2if2_sw_rst_len, 0); ++ if (error) goto exit; ++ ++ if (pipValid == True) { ++ /** Split 15 PSB to 1K + 1K and enable flow control */ ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if2_half_psb, reg_mp2if2_half_psb_pos, reg_mp2if2_half_psb_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, 0, Processor_OFDM, p_reg_mp2if_stop_en, reg_mp2if_stop_en_pos, reg_mp2if_stop_en_len, 1); ++ if (error) goto exit; ++ ++ for (i = 1; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_mpeg_full_speed, reg_mpeg_full_speed_pos, reg_mpeg_full_speed_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_mp2if_stop_en, reg_mp2if_stop_en_pos, reg_mp2if_stop_en_len, 0); ++ if (error) goto exit; ++ } ++ } ++ } ++ ++ ganymede->architecture = architecture; ++ ++exit: ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte superFrameCount, ++ IN Word packetUnit ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ SetStatisticRangeRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.superFrameCount = superFrameCount; ++ request.packetUnit = packetUnit; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_SETSTATISTICRANGE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte temp0; ++ Byte temp1; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ /** Set super frame count */ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, qnt_vbc_sframe_num, superFrameCount); ++ if (error) goto exit; ++ ++ /** Set packet unit. */ ++ temp0 = (Byte) packetUnit; ++ temp1 = (Byte) (packetUnit >> 8); ++ error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, rsd_packet_unit_7_0, 1, &temp0); ++ if (error) goto exit; ++ error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, rsd_packet_unit_15_8, 1, &temp1); ++ if (error) goto exit; ++ ++exit: ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte* frameCount, ++ IN Word* packetUnit ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetStatisticRangeRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.superFrameCount = superFrameCount; ++ request.packetUnit = packetUnit; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETSTATISTICRANGE, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte temp0; ++ Byte temp1; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ /** Get super frame count */ ++ error = Standard_readRegister (demodulator, chip, Processor_OFDM, qnt_vbc_sframe_num, frameCount); ++ if (error) goto exit; ++ ++ /** Get packet unit. */ ++ error = Standard_readRegisters (demodulator, chip, Processor_OFDM, r_rsd_packet_unit_7_0, 1, &temp0); ++ if (error) goto exit; ++ error = Standard_readRegisters (demodulator, chip, Processor_OFDM, r_rsd_packet_unit_15_8, 1, &temp1); ++ if (error) goto exit; ++ *packetUnit = (Word) (temp1 << 8) + (Word) temp0; ++ ++exit: ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Statistic* statistic ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetStatisticRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.statistic = statistic; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETSTATISTIC, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ Byte quality; ++ Byte strength; ++ Byte buffer[2]; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get statistic by stream type */ ++ error = Standard_readRegisters (demodulator, chip, Processor_OFDM, tpsd_lock, mpeg_lock - tpsd_lock + 1, buffer); ++ if (error) goto exit; ++ ++ if (buffer[tpsd_lock - tpsd_lock]) ++ ganymede->statistic[chip].signalPresented = True; ++ else ++ ganymede->statistic[chip].signalPresented = False; ++ ++ if (buffer[mpeg_lock - tpsd_lock]) ++ ganymede->statistic[chip].signalLocked = True; ++ else ++ ganymede->statistic[chip].signalLocked = False; ++ ++ error = Standard_getSignalQuality (demodulator, chip, &quality); ++ if (error) goto exit; ++ ++ ganymede->statistic[chip].signalQuality = quality; ++ ++ error = Standard_getSignalStrength (demodulator, chip, &strength); ++ if (error) goto exit; ++ ++ ganymede->statistic[chip].signalStrength = strength; ++ ++ *statistic = ganymede->statistic[chip]; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getInterrupts ( ++ IN Demodulator* demodulator, ++ OUT Interrupts* interrupts ++) { ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ Byte value = 0; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get interrupts by stream type */ ++ ++ ++ *interrupts = Interrupt_NONE; ++ ++ /** Read the interrupts register to determine the type of interrupts. */ ++ error = Standard_readRegister (demodulator, 0, Processor_LINK, r_link_ofsm_dvbt_int, &value); ++ if (error) goto exit; ++ ++ if (value & 0x04) { ++ ganymede->dataReady = True; ++ *interrupts |= Interrupt_DVBT; ++ } ++ ++exit: ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_clearInterrupt ( ++ IN Demodulator* demodulator, ++ IN Interrupt interrupt ++) { ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ Byte value = 0; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Clear interrupt by stream type */ ++ ++ //error = ganymede->dvbtStandardDescription.clearInterrupt (demodulator, interrupt); ++ value = (Byte) interrupt; ++ ++ /** Clear the specific interrupt. */ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_dvbt_intsts, value); ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getDataLength ( ++ IN Demodulator* demodulator, ++ OUT Dword* dataLength, ++ OUT Bool* valid /** used in DVBH mode */ ++) { ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get data length by stream type */ ++ switch (ganymede->burstSize) { ++ case BurstSize_1024 : ++ *dataLength = 1024; ++ break; ++ case BurstSize_2048 : ++ *dataLength = 2048; ++ break; ++ case BurstSize_4096 : ++ *dataLength = 4096; ++ break; ++ } ++ *valid = True; ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get data by stream type */ ++ ++ //error = ganymede->dvbtStandardDescription.getData (demodulator, bufferLength, buffer); ++ ++ if (bufferLength == 0) { ++ error = Error_INVALID_DATA_LENGTH; ++ goto exit; ++ } ++ ++ ++ /** IP datagram is locate in a special register 0xF00000 */ ++ error = ganymede->cmdDescription->receiveData (demodulator, 0xF00000, bufferLength, buffer); ++ if (error) goto exit; ++ ++ ganymede->dataReady = False; ++ ++exit: ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++/** combine Standard_getLength and Standard_getData */ ++Dword Standard_getDatagram ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ GetDatagramRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.bufferLength = bufferLength; ++ request.buffer = buffer; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_GETDATAGRAM, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Ganymede* ganymede; ++ Dword length = 0; ++ Byte value; ++ // Bool ready = False; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Get datagram by stream type */ ++ ++ //error = ganymede->dvbtStandardDescription.getDatagram (demodulator, bufferLength, buffer); ++ ++#if User_USE_INTERRUPT ++#else ++ ++ error = Standard_readRegisterBits (demodulator, 0, Processor_LINK, r_link_ofsm_ip_valid, link_ofsm_ip_valid_pos, link_ofsm_ip_valid_len, &value); ++ if (error) goto exit; ++ ++ if (value) { ++ ganymede->dataReady = True; ++ } ++ if (ganymede->dataReady == False) { ++ *bufferLength = 0; ++ error = Error_NOT_READY; ++ goto exit; ++ } ++#endif ++ switch (ganymede->burstSize) { ++ case BurstSize_1024 : ++ length = 1024; ++ break; ++ case BurstSize_2048 : ++ length = 2048; ++ break; ++ case BurstSize_4096 : ++ length = 4096; ++ break; ++ } ++ if (*bufferLength >= length) { ++ //error = Dvbt_getData (demodulator, length, (Byte*) buffer); ++ //if (error) goto exit; ++ ++ if (bufferLength == 0) { ++ error = Error_INVALID_DATA_LENGTH; ++ goto exit; ++ } ++ ++ ++ /** IP datagram is locate in a special register 0xF00000 */ ++ error = ganymede->cmdDescription->receiveData (demodulator, 0xF00000, length, buffer); ++ if (error) goto exit; ++ ++ *bufferLength = length; ++ ++ ganymede->dataReady = False; ++ ++ *bufferLength = length; ++ } else { ++ error = Error_BUFFER_INSUFFICIENT; ++ } ++ ++ ++exit: ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++/** get ir raw code (4 bytes) */ ++Dword Standard_getIrCode ( ++ IN Demodulator* demodulator, ++ OUT Dword* code ++) { ++ Dword error = Error_NO_ERROR; ++ Byte readBuffer[4]; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ error = Standard_sendCommand (demodulator, Command_IR_GET, 0, Processor_LINK, 0, NULL, 4, readBuffer); ++ if (error) goto exit; ++ ++ *code = (Dword) ((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]); ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_reboot ( ++ IN Demodulator* demodulator ++) { ++ Dword error = Error_NO_ERROR; ++ Dword version; ++ Byte i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ error = Standard_getFirmwareVersion (demodulator, Processor_LINK, &version); ++ if (error) goto exit; ++ if (version == 0xFFFFFFFF) goto exit; /** I2M and I2U */ ++ if (version != 0) { ++ for (i = ganymede->chipNumber; i > 0; i--) { ++ error = ganymede->cmdDescription->reboot (demodulator, i - 1); ++ if (error) goto exit; ++ User_delay (demodulator, 1); ++ } ++ ++ User_delay (demodulator, 10); ++ ++ version = 1; ++ for (i = 0; i < 30; i++) { ++ error = Standard_getFirmwareVersion (demodulator, Processor_LINK, &version); ++ if (error == Error_NO_ERROR) break; ++ User_delay (demodulator, 10); ++ } ++ if (error) goto exit; ++ if (version != 0) ++ error = Error_REBOOT_FAIL; ++ } ++ for (i = ganymede->chipNumber; i > 0; i--) { ++ error = Standard_writeRegisterBits (demodulator, i - 1, Processor_LINK, p_reg_p_dmb_sw_reset, reg_p_dmb_sw_reset_pos, reg_p_dmb_sw_reset_len, 1); ++ if (error) goto exit; ++ } ++ ++ ganymede->booted = False; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_controlPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ControlPowerSavingRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.control = control; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_CONTROLPOWERSAVING, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte temp; ++ Byte begin; ++ Byte end; ++ Byte i; ++ Byte j; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s control=%d-\n", __FUNCTION__, control); ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->architecture == Architecture_DCA) { ++ begin = 0; ++ end = ganymede->chipNumber; ++ } else { ++ begin = chip; ++ end = begin + 1; ++ } ++ ++ if (control) { ++ /** Power up case */ ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ for (i = begin; i < end; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_afe_mem0, 3, 1, 0); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, suspend_flag, 0); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, trigger_ofsm, 0); ++ if (error) goto exit; ++ ++ } ++ } else { /** TS, SPI, and SDIO case */ ++ /** not implemented yet */ ++ } ++ ++ /** Fixed current leakage */ ++ switch (ganymede->busId) { ++ case Bus_SPI : ++ case Bus_SDIO : ++ case Bus_USB : ++ case Bus_USB11 : ++ if (ganymede->chipNumber > 1) { ++ for (i = 1; i < ganymede->chipNumber; i++) { ++ /** Disable HostA parallel */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 0); ++ if (error) goto exit; ++ } ++ } ++ break; ++ } ++ } else { ++ /** Power down case */ ++ if ((ganymede->busId == Bus_USB) || (ganymede->busId == Bus_USB11)) { ++ for (i = begin; i < end; i++) { ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, suspend_flag, 1); ++ if (error) goto exit; ++ error = Standard_writeRegister (demodulator, i, Processor_OFDM, trigger_ofsm, 0); ++ if (error) goto exit; ++ ++ for (j = 0; j < 150; j++) { ++ error = Standard_readRegister (demodulator, i, Processor_OFDM, suspend_flag, &temp); ++ if (error) goto exit; ++ if (!temp) break; ++ User_delay (demodulator, 10); ++ } ++ error = Standard_writeRegisterBits (demodulator, i, Processor_OFDM, p_reg_afe_mem0, 3, 1, 1); ++ if (error) goto exit; ++ } ++ } else { /** TS SPI SDIO */ ++ /** not implemented yet */ ++ } ++ ++ /** Fixed current leakage */ ++ switch (ganymede->busId) { ++ case Bus_SPI : ++ case Bus_SDIO : ++ case Bus_USB : ++ case Bus_USB11 : ++ if (ganymede->chipNumber > 1) { ++ for (i = 1; i < ganymede->chipNumber; i++) { ++ /** Enable HostA parallel */ ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_ser_mode, reg_top_hosta_mpeg_ser_mode_pos, reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_top_hosta_mpeg_par_mode, reg_top_hosta_mpeg_par_mode_pos, reg_top_hosta_mpeg_par_mode_len, 1); ++ if (error) goto exit; ++ } ++ } ++ break; ++ } ++ } ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_controlTunerPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte control ++) { ++ Dword error = Error_NO_ERROR; ++ ++ deb_info("Enter %s control=%d-\n", __FUNCTION__, control); ++ if (control) { ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_en, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_on, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_o, 1); ++ if (error) goto exit; ++ } else { ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_en, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_on, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, 0, Processor_LINK, p_reg_top_gpioh7_o, 0); ++ if (error) goto exit; ++ } ++ ++exit: ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_runCode ( ++ IN Demodulator* demodulator, ++ IN Word code ++) { ++ Dword error = Error_NO_ERROR; ++ Byte writeBuffer[2]; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ writeBuffer[0] = (Byte) (code >> 8); ++ writeBuffer[1] = (Byte) code; ++ error = Standard_sendCommand (demodulator, Command_RUN_CODE, 0, Processor_LINK, 2, writeBuffer, 0, NULL); ++ if (error) goto exit; ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_controlPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ ControlPidFilterRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.control = control; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_CONTROLPIDFILTER, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_en, mp2if_pid_en_pos, mp2if_pid_en_len, control); ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_resetPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++#else ++ Ganymede* ganymede; ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_rst, mp2if_pid_rst_pos, mp2if_pid_rst_len, 1); ++ if (error) goto exit; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++Dword Standard_addPidToFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++) { ++ Dword error = Error_NO_ERROR; ++ ++#if User_USE_DRIVER ++ DWORD number; ++ BOOL result; ++ AddPidRequest request; ++ Ganymede* ganymede; ++ ++ ganymede = (Ganymede*) demodulator; ++ ++ if (ganymede->driver != NULL) { ++ request.chip = chip; ++ request.pid = pid; ++ result = DeviceIoControl ( ++ ganymede->driver, ++ IOCTL_AFA_DEMOD_ADDPID, ++ &request, ++ sizeof (request), ++ NULL, ++ 0, ++ &number, ++ NULL ++ ); ++ error = request.error; ++ } else { ++ error = Error_DRIVER_INVALID; ++ } ++#else ++ Byte writeBuffer[2]; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ /** Enable pid filter */ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_en, mp2if_pid_en_pos, mp2if_pid_en_len, 1); ++ if (error) goto exit; ++ ++ writeBuffer[0] = (Byte) pid.value; ++ writeBuffer[1] = (Byte) (pid.value >> 8); ++ ++ error = Standard_writeRegisters (demodulator, chip, Processor_OFDM, p_mp2if_pid_dat_l, 2, writeBuffer); ++ if (error) goto exit; ++ ++ error = Standard_writeRegisterBits (demodulator, chip, Processor_OFDM, p_mp2if_pid_index_en, mp2if_pid_index_en_pos, mp2if_pid_index_en_len, 1); ++ if (error) goto exit; ++ ++ error = Standard_writeRegister (demodulator, chip, Processor_OFDM, p_mp2if_pid_index, index); ++ if (error) goto exit; ++ ++exit : ++#endif ++ ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_setBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize burstSize ++) { ++ Dword error = Error_NO_ERROR; ++ Byte i; ++ Ganymede* ganymede; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ ganymede = (Ganymede*) demodulator; ++ ++ ++ if (burstSize == BurstSize_4096) { ++ error = Error_NOT_SUPPORT; ++ goto exit; ++ } ++ ++ ++ switch (burstSize) { ++ case BurstSize_1024 : ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_path, reg_dvbt_path_pos, reg_dvbt_path_len, 1); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_bufsize, reg_dvbt_bufsize_pos, reg_dvbt_bufsize_len, 1); ++ if (error) goto exit; ++ } ++ ganymede->burstSize = BurstSize_1024; ++ break; ++ case BurstSize_2048 : ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_path, reg_dvbt_path_pos, reg_dvbt_path_len, 1); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_bufsize, reg_dvbt_bufsize_pos, reg_dvbt_bufsize_len, 0); ++ if (error) goto exit; ++ } ++ ganymede->burstSize = BurstSize_2048; ++ ++ break; ++ case BurstSize_4096 : ++ for (i = 0; i < ganymede->chipNumber; i++) { ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_path, reg_dvbt_path_pos, reg_dvbt_path_len, 0); ++ if (error) goto exit; ++ error = Standard_writeRegisterBits (demodulator, i, Processor_LINK, p_reg_dvbt_bufsize, reg_dvbt_bufsize_pos, reg_dvbt_bufsize_len, 1); ++ if (error) goto exit; ++ } ++ ganymede->burstSize = BurstSize_4096; ++ break; ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} ++ ++ ++Dword Standard_getBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize* burstSize ++) { ++ Dword error = Error_NO_ERROR; ++ Byte path; ++ Byte size; ++ ++ deb_info("Enter %s -\n", __FUNCTION__); ++ error = Standard_readRegisterBits (demodulator, 0, Processor_LINK, p_reg_dvbt_path, reg_dvbt_path_pos, reg_dvbt_path_len, &path); ++ if (error) goto exit; ++ error = Standard_readRegisterBits (demodulator, 0, Processor_LINK, p_reg_dvbt_bufsize, reg_dvbt_bufsize_pos, reg_dvbt_bufsize_len, &size); ++ if (error) goto exit; ++ ++ if (path) { ++ if (size) { ++ *burstSize = BurstSize_1024; ++ } else { ++ *burstSize = BurstSize_2048; ++ } ++ } else { ++ if (size) { ++ *burstSize = BurstSize_4096; ++ } else { ++ *burstSize = BurstSize_2048; ++ } ++ } ++ ++exit : ++ if(error) { ++ deb_info("%s error, ret=0x%x\n", __FUNCTION__, error); ++ } ++ return (error); ++} +diff --git a/drivers/media/dvb/dvb-usb/a867_standard.h b/drivers/media/dvb/dvb-usb/a867_standard.h +new file mode 100644 +index 0000000..6001dbf +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_standard.h +@@ -0,0 +1,1142 @@ ++#ifndef __STANDARD_H__ ++#define __STANDARD_H__ ++ ++ ++#include "a867_type.h" ++#include "a867_user.h" ++#include "a867_error.h" ++#include "a867_register.h" ++#include "a867_variable.h" ++#include "a867_version.h" ++ ++#if User_USE_DRIVER ++#include ++#include "iocontrol.h" ++#endif ++ ++ ++/** ++ * Write one byte (8 bits) to a specific register in demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be written. ++ * @param value the value to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte value ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the start address of the registers to be written. ++ * @param bufferLength the number of registers to be written. ++ * @param buffer a byte array which is used to store values to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a collection of values to discontiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param valueSetsLength the number of values to be written. ++ * @param valueSets a ValueSet array which is used to store values to be ++ * written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in slave device. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the registers to be read. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous registers in slave device ++ * through specified interface (1, 2, 3). ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param interfaceIndex the index of interface. The possible values are ++ * 1~3. ++ * @param slaveAddress the I2c address of slave device. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Write a sequence of bytes to the contiguous cells in the EEPROM. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5 (firmware will detect EEPROM address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the cells to be written. ++ * @param bufferLength the number of cells to be written. ++ * @param buffer a byte array which is used to store values to be written. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Modify bits in the specific register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be written. ++ * @param position the start position of bits to be modified (0 means the ++ * LSB of the specifyed register). ++ * @param length the length of bits. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_writeRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++); ++ ++ ++/** ++ * Read one byte (8 bits) from a specific register in demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param value the pointer used to store the value read from demodulator ++ * register. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readRegister ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ OUT Byte* value ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Read a collection of values to discontiguous registers from demodulator. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param valueSetsLength the number of values to be read. ++ * @param valueSets a ValueSet array which is used to store values to be ++ * read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readScatterRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in tuner. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the registers to be read. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readTunerRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous registers in slave device ++ * through specified interface (1, 2, 3). ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 6 (one more byte to specify tuner address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param interfaceIndex the index of interface. The possible values are ++ * 1~3. ++ * @param slaveAddress the I2c address of slave device. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readGenericRegisters ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte interfaceIndex, ++ IN Byte slaveAddress, ++ IN Byte bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Read a sequence of bytes from the contiguous cells in the EEPROM. ++ * The maximum burst size is restricted by the capacity of bus. If bus ++ * could transfer N bytes in one cycle, then the maximum value of ++ * bufferLength would be N - 5 (firmware will detect EEPROM address). ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param registerAddress the start address of the cells to be read. ++ * @param registerAddressLength the valid bytes of registerAddress. ++ * @param bufferLength the number of cells to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readEepromValues ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word registerAddress, ++ IN Byte bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Read bits of the specified register. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param registerAddress the address of the register to be read. ++ * @param position the start position of bits to be read (0 means the ++ * LSB of the specifyed register). ++ * @param length the length of bits. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_readRegisterBits ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte position, ++ IN Byte length, ++ OUT Byte* value ++); ++ ++ ++/** ++ * Send the command to device. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param command the command to be send. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param processor The processor of specified register. Because each chip ++ * has two processor so user have to specify the processor. The ++ * possible values are Processor_LINK and Processor_OFDM. ++ * @param writeBufferLength the number of registers to be write. ++ * @param writeBuffer a byte array which is used to store values to be write. ++ * @param readBufferLength the number of registers to be read. ++ * @param readBuffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_sendCommand ( ++ IN Demodulator* demodulator, ++ OUT Word command, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * Get the version of hardware. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param version the version of hardware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getHardwareVersion ( ++ IN Demodulator* demodulator, ++ OUT Dword* version ++); ++ ++ ++/** ++ * Get the version of firmware. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param version the version of firmware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getFirmwareVersion ( ++ IN Demodulator* demodulator, ++ IN Processor processor, ++ OUT Dword* version ++); ++ ++ ++/** ++ * Get RF AGC gain. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param rfAgc the value of RF AGC. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getRfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* rfAgc ++); ++ ++ ++/** ++ * Get IF AGC gain. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param ifAgc the value of IF AGC. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getIfAgcGain ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* ifAgc ++); ++ ++ ++/** ++ * Load the IR table for USB device. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param tableLength The length of IR table. ++ * @param table The content of IR table. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_loadIrTable ( ++ IN Demodulator* demodulator, ++ IN Word tableLength, ++ IN Byte* table ++); ++ ++ ++/** ++ * Program the bandwidth related parameters to demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param bandwidth DVB channel bandwidth in MHz. The possible values ++ * are 5, 6, 7, and 8 (MHz). ++ * @param adcFrequency The value of desire internal ADC frequency (Hz). ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_selectBandwidth ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, /** KHz */ ++ IN Dword adcFrequency /** Hz, ex: 20480000 */ ++); ++ ++ ++/** ++ * Mask DCA output. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_maskDcaOutput ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Load firmware to device ++ * ++ * @param demodulator the handle of demodulator. ++ * @streamType current stream type (useless for Ganymede). ++ * @firmwareCodes pointer to fw binary. ++ * @firmwareSegments pointer to fw segments. ++ * @firmwarePartitions pointer to fw partition (useless for Ganymede). ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_loadFirmware ( ++ IN Demodulator* demodulator, ++ IN Byte* firmwareCodes, ++ IN Segment* firmwareSegments, ++ IN Byte* firmwarePartitions ++); ++ ++/** ++ * First, download firmware from host to demodulator. Actually, firmware is ++ * put in firmware.h as a part of source code. Therefore, in order to ++ * update firmware the host have to re-compile the source code. ++ * Second, setting all parameters which will be need at the beginning. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chipNumber The total number of demodulators. ++ * @param sawBandwidth SAW filter bandwidth in MHz. The possible values ++ * are 6000, 7000, and 8000 (KHz). ++ * @param streamType The format of output stream. ++ * @param architecture the architecture of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_initialize ( ++ IN Demodulator* demodulator, ++ IN Byte chipNumber, ++ IN Word sawBandwidth, ++ IN StreamType streamType, ++ IN Architecture architecture ++); ++ ++ ++/** ++ * Power off the demodulators. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_finalize ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isAgcLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isCfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isSfoeLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isTpsLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isMpeg2Locked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param locked the result of frequency tuning. True if there is ++ * demodulator can lock signal, False otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_isLocked ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Bool* locked ++); ++ ++ ++/** ++ * Set priorty of modulation. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param priority modulation priority. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_setPriority ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Priority priority ++); ++ ++ ++/** ++ * Reset demodulator. ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_reset ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Get channel modulation related information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param channelModulation The modulation of channel. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ */ ++Dword Standard_getChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT ChannelModulation* channelModulation ++); ++ ++ ++/** ++ * Set channel modulation related information. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param channelModulation The modulation of channel. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ */ ++Dword Standard_setChannelModulation ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN ChannelModulation* channelModulation ++); ++ ++ ++/** ++ * Set frequency. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param frequency The desired frequency. ++ * @return Error_NO_ERROR: successful, other non-zero error code otherwise. ++ */ ++Dword Standard_setFrequency ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Dword frequency ++); ++ ++ ++/** ++ * Specify the bandwidth of channel and tune the channel to the specific ++ * frequency. Afterwards, host could use output parameter dvbH to determine ++ * if there is a DVB-H signal. ++ * In DVB-T mode, after calling this function the output parameter dvbH ++ * should return False and host could use output parameter "locked" to check ++ * if the channel has correct TS output. ++ * In DVB-H mode, after calling this function the output parameter dvbH should ++ * return True and host could start get platform thereafter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param bandwidth The channel bandwidth. ++ * DVB-T: 5000, 6000, 7000, and 8000 (KHz). ++ * DVB-H: 5000, 6000, 7000, and 8000 (KHz). ++ * T-DMB: 5000, 6000, 7000, and 8000 (KHz). ++ * FM: 100, and 200 (KHz). ++ * @param frequency the channel frequency in KHz. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_acquireChannel ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++ ++ ++ ++/** ++ * Set the output stream type of chip. Because the device could output in ++ * many stream type, therefore host have to choose one type before receive ++ * data. ++ * ++ * Note: Please refer to the example of Standard_acquireChannel when host want ++ * to detect the available channels. ++ * Note: After host know all the available channels, and want to change to ++ * specific channel, host have to choose output mode before receive ++ * data. Please refer the example of Standard_setStreamType. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param streamType the possible values are ++ * DVB-H: StreamType_DVBH_DATAGRAM ++ * StreamType_DVBH_DATABURST ++ * DVB-T: StreamType_DVBT_DATAGRAM ++ * StreamType_DVBT_PARALLEL ++ * StreamType_DVBT_SERIAL ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_setStreamType ( ++ IN Demodulator* demodulator, ++ IN StreamType streamType ++); ++ ++ ++/** ++ * Set the architecture of chip. When two of our device are using, they could ++ * be operated in Diversity Combine Architecture (DCA) or (PIP). Therefore, ++ * host could decide which mode to be operated. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param architecture the possible values are ++ * Architecture_DCA ++ * Architecture_PIP ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_setArchitecture ( ++ IN Demodulator* demodulator, ++ IN Architecture architecture ++); ++ ++ ++/** ++ * Set the counting range for Post-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param postErrorCount the number of super frame for Pre-Viterbi. ++ * @param postBitCount the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getPostVitBer ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Dword* postErrorCount, /** 24 bits */ ++ OUT Dword* postBitCount, /** 16 bits */ ++ OUT Word* abortCount ++); ++ ++ ++/** ++ * Get siganl quality. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param quality The value of signal quality. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getSignalQuality ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* quality ++); ++ ++ ++/** ++ * Get siganl strength. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param strength The value of signal strength. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getSignalStrength ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Byte* strength ++); ++ ++ ++/** ++ * Get signal strength in dbm ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param rfpullUpVolt_X10 the pullup voltag of RF multiply 10. ++ * @param ifpullUpVolt_X10 the pullup voltag of IF multiply 10. ++ * @param strengthDbm The value of signal strength in DBm. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getSignalStrengthDbm ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Long rfpullUpVolt_X10, /** RF pull up voltage multiplied by 10 */ ++ IN Long ifpullUpVolt_X10, /** IF pull up voltage multiplied by 10 */ ++ OUT Long* strengthDbm /** DBm */ ++); ++ ++ ++/** ++ * Set the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. NOTE: When the architecture is set to Architecture_DCA ++ * this parameter is regard as don't care. ++ * @param frameCount the number of super frame for Pre-Viterbi. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_setStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte superFrameCount, ++ IN Word packetUnit ++); ++ ++ ++/** ++ * Get the counting range for Pre-Viterbi and Post-Viterbi. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param frameCount the number of super frame for Pre-Viterbi. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getStatisticRange ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte* frameCount, ++ IN Word* packetUnit ++); ++ ++ ++/** ++ * Get the statistic values of demodulator, it includes Pre-Viterbi BER, ++ * Post-Viterbi BER, Abort Count, Signal Presented Flag, Signal Locked Flag, ++ * Signal Quality, Signal Strength, Delta-T for DVB-H time slicing. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param statistic the structure that store all statistic values. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getStatistic ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ OUT Statistic* statistic ++); ++ ++ ++/** ++ * Get interrupt status. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param interrupts the type of interrupts. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getInterrupts ( ++ IN Demodulator* demodulator, ++ OUT Interrupts* interrupts ++); ++ ++ ++/** ++ * Clear interrupt status. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param interrupt interrupt name. ++ * @param packetUnit the number of packet unit for Post-Viterbi. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_clearInterrupt ( ++ IN Demodulator* demodulator, ++ IN Interrupt interrupt ++); ++ ++ ++/** ++ * Get data length. ++ * In DVB-T mode, data length should always equals 2K, ++ * In DVB-H mode, data length would be the length of IP datagram. ++ * NOTE: data can't be transfer via I2C bus, in order to transfer data ++ * host must provide SPI bus. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param dataLength the length of data. ++ * @param valid True if the data length is valid. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getDataLength ( ++ IN Demodulator* demodulator, ++ OUT Dword* dataLength, ++ OUT Bool* valid ++); ++ ++ ++/** ++ * Get DVB-T data. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength the length of buffer. ++ * @param buffer buffer used to get Data. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_getData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Get datagram from device. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength the number of registers to be read. ++ * @param buffer a byte array which is used to store values to be read. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_BUFFER_INSUFFICIENT: if buffer is too small. ++ */ ++Dword Standard_getDatagram ( ++ IN Demodulator* demodulator, ++ OUT Dword* bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param code the value of IR raw code, the size should be 4 or 6, ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_getIrCode ( ++ IN Demodulator* demodulator, ++ OUT Dword* code ++); ++ ++ ++/** ++ * Return to boot code ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_reboot ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param contorl 1: Power up, 0: Power down; ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_controlPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param contorl 1: Power up, 0: Power down; ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_controlTunerPowerSaving ( ++ IN Demodulator* demodulator, ++ IN Byte control ++); ++ ++ ++/** ++ * ++ * @param demodulator the handle of demodulator. ++ * @param code the address of function pointer in firmware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_runCode ( ++ IN Demodulator* demodulator, ++ IN Word code ++); ++ ++ ++/** ++ * Control PID fileter ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param contorl 0: Disable, 1: Enable. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @example
++ * 
++ */ ++Dword Standard_controlPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte control ++); ++ ++ ++/** ++ * Reset PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_resetPidFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * Add PID to PID filter. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param chip The index of demodulator. The possible values are ++ * 0~7. ++ * @param pid the PID that will be add to PID filter. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++Dword Standard_addPidToFilter ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte index, ++ IN Pid pid ++); ++ ++ ++/** ++ * Set datagram burst size. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param burstSize the burst size. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_NOT_SUPPORT: if the burst size is not support. ++ */ ++Dword Standard_setBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize burstSize ++); ++ ++ ++/** ++ * Get datagram burst size. ++ * ++ * @param demodulator the handle of demodulator. ++ * @param burstSize the burst size. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ * @return Error_NOT_SUPPORT: if the burst size is not support. ++ */ ++Dword Standard_getBurstSize ( ++ IN Demodulator* demodulator, ++ IN BurstSize* burstSize ++); ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_type.h b/drivers/media/dvb/dvb-usb/a867_type.h +new file mode 100644 +index 0000000..d57d36e +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_type.h +@@ -0,0 +1,968 @@ ++#ifndef __TYPE_H__ ++#define __TYPE_H__ ++ ++#include ++#include "a867_userdef.h"// for Linux ++ ++ ++//#define IN ++//#define OUT ++//#define INOUT ++ ++//j010+s ++#define TS_PACKET_COUNT 44 ++//j010+e ++ ++ ++/** ++ * The type of handle. ++ */ ++typedef void* Handle; ++ ++ ++/** ++ * The type defination of 8-bits unsigned type. ++ */ ++typedef unsigned char Byte; ++ ++ ++/** ++ * The type defination of 16-bits unsigned type. ++ */ ++typedef unsigned short Word; ++ ++ ++/** ++ * The type defination of 32-bits unsigned type. ++ */ ++typedef unsigned int Dword; ++ ++ ++/** ++ * The type defination of 16-bits signed type. ++ */ ++typedef short Short; ++ ++ ++/** ++ * The type defination of 32-bits signed type. ++ */ ++typedef int Long; ++ ++ ++ ++#include "a867_inttype.h" /** release1remove */ ++ ++/** ++ * The type defination of Bool ++ */ ++typedef enum { ++ False = 0, ++ True = 1 ++} Bool; ++ ++ ++/** ++ * The type defination of Segment ++ */ ++typedef struct { ++ Byte segmentType; /** 0:Firmware download 1:Rom copy 2:Direct command */ ++ Dword segmentLength; ++} Segment; ++ ++ ++/** ++ * The type defination of Bandwidth. ++ */ ++typedef enum { ++ Bandwidth_6M = 0, /** Signal bandwidth is 6MHz */ ++ Bandwidth_7M, /** Signal bandwidth is 7MHz */ ++ Bandwidth_8M, /** Signal bandwidth is 8MHz */ ++ Bandwidth_5M /** Signal bandwidth is 5MHz */ ++} Bandwidth; ++ ++ ++/** ++ * The type defination of TransmissionMode. ++ */ ++typedef enum { ++ TransmissionMode_2K = 0, /** OFDM frame consists of 2048 different carriers (2K FFT mode) */ ++ TransmissionMode_8K = 1, /** OFDM frame consists of 8192 different carriers (8K FFT mode) */ ++ TransmissionMode_4K = 2 /** OFDM frame consists of 4096 different carriers (4K FFT mode) */ ++} TransmissionModes; ++ ++ ++/** ++ * The type defination of Constellation. ++ */ ++typedef enum { ++ Constellation_QPSK = 0, /** Signal uses QPSK constellation */ ++ Constellation_16QAM, /** Signal uses 16QAM constellation */ ++ Constellation_64QAM /** Signal uses 64QAM constellation */ ++} Constellation; ++ ++ ++/** ++ * The type defination of Interval. ++ */ ++typedef enum { ++ Interval_1_OVER_32 = 0, /** Guard interval is 1/32 of symbol length */ ++ Interval_1_OVER_16, /** Guard interval is 1/16 of symbol length */ ++ Interval_1_OVER_8, /** Guard interval is 1/8 of symbol length */ ++ Interval_1_OVER_4 /** Guard interval is 1/4 of symbol length */ ++} Interval; ++ ++ ++/** ++ * The type defination of Priority. ++ */ ++typedef enum { ++ Priority_HIGH = 0, /** DVB-T and DVB-H - identifies high-priority stream */ ++ Priority_LOW /** DVB-T and DVB-H - identifies low-priority stream */ ++} Priority; ++ ++ ++/** ++ * The type defination of CodeRate. ++ */ ++typedef enum { ++ CodeRate_1_OVER_2 = 0, /** Signal uses FEC coding ratio of 1/2 */ ++ CodeRate_2_OVER_3, /** Signal uses FEC coding ratio of 2/3 */ ++ CodeRate_3_OVER_4, /** Signal uses FEC coding ratio of 3/4 */ ++ CodeRate_5_OVER_6, /** Signal uses FEC coding ratio of 5/6 */ ++ CodeRate_7_OVER_8, /** Signal uses FEC coding ratio of 7/8 */ ++ CodeRate_NONE /** None, NXT doesn't have this one */ ++} CodeRate; ++ ++ ++/** ++ * TPS Hierarchy and Alpha value. ++ */ ++typedef enum { ++ Hierarchy_NONE = 0, /** Signal is non-hierarchical */ ++ Hierarchy_ALPHA_1, /** Signalling format uses alpha of 1 */ ++ Hierarchy_ALPHA_2, /** Signalling format uses alpha of 2 */ ++ Hierarchy_ALPHA_4 /** Signalling format uses alpha of 4 */ ++} Hierarchy; ++ ++ ++/** ++ * The defination of SubchannelType. ++ */ ++typedef enum { ++ SubchannelType_AUDIO = 0, /** Signal in subchannel is audio format */ ++ SubchannelType_VIDEO = 1, /** Signal in subchannel is video format */ ++ SubchannelType_PACKET = 3, /** Signal in subchannel is packet format */ ++ SubchannelType_ENHANCEPACKET = 4 /** Signal in subchannel is enhance packet format */ ++} SubchannelType; ++ ++ ++/** ++ * The defination of ProtectionLevel. ++ */ ++typedef enum { ++ ProtectionLevel_NONE = 0x00, /** The protection level of subchannel is none */ ++ ProtectionLevel_PL1 = 0x01, /** The protection level of subchannel is level 1 */ ++ ProtectionLevel_PL2 = 0x02, /** The protection level of subchannel is level 2 */ ++ ProtectionLevel_PL3 = 0x03, /** The protection level of subchannel is level 3 */ ++ ProtectionLevel_PL4 = 0x04, /** The protection level of subchannel is level 4 */ ++ ProtectionLevel_PL5 = 0x05, /** The protection level of subchannel is level 5 */ ++ ProtectionLevel_PL1A = 0x1A, /** The protection level of subchannel is level 1A */ ++ ProtectionLevel_PL2A = 0x2A, /** The protection level of subchannel is level 2A */ ++ ProtectionLevel_PL3A = 0x3A, /** The protection level of subchannel is level 3A */ ++ ProtectionLevel_PL4A = 0x4A, /** The protection level of subchannel is level 4A */ ++ ProtectionLevel_PL1B = 0x1B, /** The protection level of subchannel is level 1B */ ++ ProtectionLevel_PL2B = 0x2B, /** The protection level of subchannel is level 2B */ ++ ProtectionLevel_PL3B = 0x3B, /** The protection level of subchannel is level 3B */ ++ ProtectionLevel_PL4B = 0x4B /** The protection level of subchannel is level 4B */ ++} ProtectionLevel; ++ ++ ++/** ++ * The defination of ChannelInformation. ++ */ ++typedef struct { ++ Dword frequency; /** Channel frequency in KHz. */ ++ TransmissionModes transmissionMode; /** Number of carriers used for OFDM signal */ ++ Constellation constellation; /** Constellation scheme (FFT mode) in use */ ++ Interval interval; /** Fraction of symbol length used as guard (Guard Interval) */ ++ Priority priority; /** The priority of stream */ ++ CodeRate highCodeRate; /** FEC coding ratio of high-priority stream */ ++ CodeRate lowCodeRate; /** FEC coding ratio of low-priority stream */ ++ Hierarchy hierarchy; /** Hierarchy levels of OFDM signal */ ++ Bandwidth bandwidth; ++} ChannelModulation; ++ ++ ++/** ++ * The defination of SubchannelModulation. This structure is used to ++ * represent subchannel modulation when device is operate in T-DMB/DAB mode. ++ * ++ */ ++typedef struct { ++ Byte subchannelId; /** The ID of subchannel. */ ++ Word subchannelSize; /** The size of subchannel. */ ++ Word bitRate; /** The bit rate of subchannel. */ ++ Byte transmissionMode; /** The transmission mode of subchannel, possible values are: 1, 2, 3, 4. */ ++ ProtectionLevel protectionLevel; /** The protection level of subchannel. */ ++ SubchannelType subchannelType; /** The type of subchannel */ ++ Byte conditionalAccess; /** If a conditional access exist */ ++ Byte tiiPrimary; /** TII primary */ ++ Byte tiiCombination; /** TII combination */ ++} SubchannelModulation; ++ ++ ++/** ++ * The type defination of IpVersion. ++ */ ++typedef enum { ++ IpVersion_IPV4 = 0, /** The IP version if IPv4 */ ++ IpVersion_IPV6 = 1 /** The IP version if IPv6 */ ++} IpVersion; ++ ++ ++/** ++ * The type defination of Ip. ++ */ ++typedef struct { ++ IpVersion version; /** The version of IP. See the defination of IpVersion. */ ++ Priority priority; /** The priority of IP. See the defination of Priority. */ ++ Bool cache; /** True: IP datagram will be cached in device's buffer. Fasle: IP datagram will be transfer to host. */ ++ Byte address[16]; /** The byte array to store IP address. */ ++} Ip; ++ ++ ++/** ++ * The type defination of Platform. ++ * Mostly used is in DVB-H standard ++ */ ++typedef struct { ++ Dword platformId; /** The ID of platform. */ ++ char iso639LanguageCode[3]; /** The ISO 639 language code for platform name. */ ++ Byte platformNameLength; /** The length of platform name. */ ++ char platformName[32]; /** The char array to store platform name. */ ++ Word bandwidth; /** The operating channel bandwith of this platform. */ ++ Dword frequency; /** The operating channel frequency of this platform. */ ++ Byte* information; /** The extra information about this platform. */ ++ Word informationLength; /** The length of information. */ ++ Bool hasInformation; /** The flag to indicate if there exist extra information. */ ++ IpVersion ipVersion; /** The IP version of this platform. */ ++} Platform; ++ ++ ++/** ++ * The type defination of Label. ++ */ ++typedef struct { ++ Byte charSet; ++ Word charFlag; ++ Byte string[16]; ++} Label; ++ ++ ++/** ++ * The type defination of Ensemble. ++ */ ++typedef struct { ++ Word ensembleId; ++ Label ensembleLabel; ++ Byte totalServices; ++} Ensemble; ++ ++ ++/** ++ * The type defination of Service. ++ * Mostly used is in T-DMB standard ++ */ ++typedef struct { ++ Byte serviceType; /** Service Type(P/D): 0x00: Program, 0x80: Data */ ++ Dword serviceId; ++ Dword frequency; ++ Label serviceLabel; ++ Byte totalComponents; ++} Service; ++ ++ ++/** ++ * The type defination of Service Component. ++ */ ++typedef struct { ++ Byte serviceType; /** Service Type(P/D): 0x00: Program, 0x80: Data */ ++ Dword serviceId; /** Service ID */ ++ Word componentId; /** Stream audio/data is subchid, packet mode is SCId */ ++ Byte componentIdService; /** Component ID within Service */ ++ Label componentLabel; /** The label of component. See the defination of Label. */ ++ Byte language; /** Language code */ ++ Byte primary; /** Primary/Secondary */ ++ Byte conditionalAccess; /** Conditional Access flag */ ++ Byte componentType; /** Component Type (A/D) */ ++ Byte transmissionId; /** Transmission Mechanism ID */ ++} Component; ++ ++ ++/** ++ * The type defination of Target. ++ */ ++typedef enum { ++ SectionType_MPE = 0, /** Stands for MPE data. */ ++ SectionType_SIPSI, /** Stands for SI/PSI table, but don't have to specify table ID. */ ++ SectionType_TABLE /** Stands for SI/PSI table. */ ++} SectionType; ++ ++ ++/** ++ * The type defination of FrameRow. ++ */ ++typedef enum { ++ FrameRow_256 = 0, /** There should be 256 rows for each column in MPE-FEC frame. */ ++ FrameRow_512, /** There should be 512 rows for each column in MPE-FEC frame. */ ++ FrameRow_768, /** There should be 768 rows for each column in MPE-FEC frame. */ ++ FrameRow_1024 /** There should be 1024 rows for each column in MPE-FEC frame. */ ++} FrameRow; ++ ++ ++/** ++ * The type defination of Pid. ++ * ++ * In DVB-T mode, only value is valid. In DVB-H mode, ++ * as sectionType = SectionType_SIPSI: only value is valid. ++ * as sectionType = SectionType_TABLE: both value and table is valid. ++ * as sectionType = SectionType_MPE: except table all other fields is valid. ++ */ ++typedef struct { ++ Byte table; /** The table ID. Which is used to filter specific SI/PSI table. */ ++ Byte duration; /** The maximum burst duration. It can be specify to 0xFF if user don't know the exact value. */ ++ FrameRow frameRow; /** The frame row of MPE-FEC. It means the exact number of rows for each column in MPE-FEC frame. */ ++ SectionType sectionType; /** The section type of pid. See the defination of SectionType. */ ++ Priority priority; /** The priority of MPE data. Only valid when sectionType is set to SectionType_MPE. */ ++ IpVersion version; /** The IP version of MPE data. Only valid when sectionType is set to SectionType_MPE. */ ++ Bool cache; /** True: MPE data will be cached in device's buffer. Fasle: MPE will be transfer to host. */ ++ Word value; /** The 13 bits Packet ID. */ ++} Pid; ++ ++ ++/** ++ * The type defination of ValueSet. ++ */ ++typedef struct { ++ Dword address; /** The address of target register */ ++ Byte value; /** The value of target register */ ++} ValueSet; ++ ++ ++/** ++ * The type defination of Datetime. ++ */ ++typedef struct { ++ Dword mjd; /** The mjd of datetime */ ++ Byte configuration; /** The configuration of datetime */ ++ Byte hours; /** The hours of datetime */ ++ Byte minutes; /** The minutes of datetime */ ++ Byte seconds; /** The seconds of datetime */ ++ Word milliseconds; /** The milli seconds of datetime */ ++} Datetime; ++ ++ ++/** ++ * The type defination of Interrupts. ++ */ ++typedef Word Interrupts; ++ ++ ++/** ++ * The type defination of Interrupt. ++ */ ++typedef enum { ++ Interrupt_NONE = 0x0000, /** No interrupt. */ ++ Interrupt_SIPSI = 0x0001, ++ Interrupt_DVBH = 0x0002, ++ Interrupt_DVBT = 0x0004, ++ Interrupt_PLATFORM = 0x0008, ++ Interrupt_VERSION = 0x0010, ++ Interrupt_FREQUENCY = 0x0020, ++ Interrupt_SOFTWARE1 = 0x0040, ++ Interrupt_SOFTWARE2 = 0x0080, ++ Interrupt_FIC = 0x0100, ++ Interrupt_MSC = 0x0200, ++ Interrupt_MCISI = 0x0400 ++} Interrupt; ++ ++ ++/** ++ * The type defination of Multiplier. ++ */ ++typedef enum { ++ Multiplier_1X = 0, ++ Multiplier_2X ++} Multiplier; ++ ++ ++/** ++ * The type defination of StreamType. ++ */ ++typedef enum { ++ StreamType_NONE = 0, /** Invalid (Null) StreamType */ ++ StreamType_DVBT_DATAGRAM, /** DVB-T mode, store data in device buffer */ ++ StreamType_DVBT_PARALLEL, /** DVB-T mode, output via paralle interface */ ++ StreamType_DVBT_SERIAL, /** DVB-T mode, output via serial interface */ ++} StreamType; ++ ++ ++/** ++ * The type defination of StreamType. ++ */ ++typedef enum { ++ Architecture_NONE = 0, /** Inavalid (Null) Architecture. */ ++ Architecture_DCA, /** Diversity combine architecture. Only valid when chip number > 1. */ ++ Architecture_PIP /** Picture in picture. Only valid when chip number > 1. */ ++} Architecture; ++ ++ ++/** ++ * The type defination of ClockTable. ++ */ ++typedef struct { ++ Dword crystalFrequency; /** The frequency of crystal. */ ++ Dword adcFrequency; /** The frequency of ADC. */ ++} ClockTable; ++ ++ ++/** ++ * The type defination of BandTable. ++ */ ++typedef struct { ++ Dword minimum; /** The minimum frequency of this band */ ++ Dword maximum; /** The maximum frequency of this band */ ++} BandTable; ++ ++ ++/** ++ * The type defination of MeanTable. ++ */ ++typedef struct { ++ Dword mean; ++ Dword errorCount; ++} MeanTable; ++ ++ ++/** ++ * The type defination of Polarity. ++ */ ++typedef enum { ++ Polarity_NORMAL = 0, ++ Polarity_INVERSE ++} Polarity; ++ ++ ++/** ++ * The type defination of Processor. ++ */ ++typedef enum { ++ Processor_LINK = 0, ++ Processor_OFDM = 8 ++} Processor; ++ ++ ++/** ++ * The type defination of BurstSize. ++ */ ++typedef enum { ++ BurstSize_1024 = 0, ++ BurstSize_2048, ++ BurstSize_4096 ++} BurstSize; ++ ++ ++/** ++ * The type defination of Demodulator. ++ */ ++typedef struct { ++ Handle userData; ++ Handle driver; ++} Demodulator; ++ ++ ++#include "a867_user.h" ++ ++ ++/** ++ * The type defination of Statistic. ++ */ ++typedef struct { ++ Bool signalPresented; /** Signal is presented. */ ++ Bool signalLocked; /** Signal is locked. */ ++ Byte signalQuality; /** Signal quality, from 0 (poor) to 100 (good). */ ++ Byte signalStrength; /** Signal strength from 0 (weak) to 100 (strong). */ ++ Byte frameErrorRatio; /** Frame Error Ratio (error ratio before MPE-FEC), from 0 (no error) to 100 (all error). */ ++ Byte mpefecFrameErrorRatio; /** MPE-FEC Frame Error Ratio (error ratio after MPE-FEC). from 0 (no error) to 100 (all error). */ ++} Statistic; ++ ++ ++/** ++ * General demodulator register-write function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be written. ++ * @param bufferLength number, 1-8, of registers to be written. ++ * @param buffer buffer used to store values to be written to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*WriteRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * General demodulator register-read function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*WriteScatterRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ IN ValueSet* valueSets ++); ++ ++ ++/** ++ * General tuner register-write function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be written. ++ * @param bufferLength number, 1-8, of registers to be written. ++ * @param buffer buffer used to store values to be written to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*WriteTunerRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * General write EEPROM function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be written. ++ * @param buffer buffer used to store values to be written to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*WriteEepromValues) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte writeBufferLength, ++ IN Byte* writeBuffer ++); ++ ++ ++/** ++ * General demodulator register-read function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ReadRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * General demodulator register-read function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ReadScatterRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Byte valueSetsAddressLength, ++ IN Byte valueSetsLength, ++ OUT ValueSet* valueSets ++); ++ ++ ++/** ++ * General tuner register-read function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ReadTunerRegisters) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte tunerAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ IN Byte* readBuffer ++); ++ ++ ++/** ++ * General read EEPROM function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ReadEepromValues) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Byte eepromAddress, ++ IN Word registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * General demodulator register-read function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ModifyRegister) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword registerAddress, ++ IN Byte registerAddressLength, ++ IN Byte position, ++ IN Byte length, ++ IN Byte value ++); ++ ++ ++/** ++ * General load firmware function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param length The length of firmware. ++ * @param firmware The byte array of firmware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*LoadFirmware) ( ++ IN Demodulator* demodulator, ++ IN Dword firmwareLength, ++ IN Byte* firmware ++); ++ ++ ++/** ++ * General reboot function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param length The length of firmware. ++ * @param firmware The byte array of firmware. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*Reboot) ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * Find and Get bus handle used to control bus ++ * ++ * @param demodulator the handle of demodulator. ++ * @param handle The bus handle. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*GetBus) ( ++ IN Demodulator* demodulator, ++ OUT Handle* handle ++); ++ ++ ++/** ++ * Find and Get bus handle used to control bus ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength The length to transmit. ++ * @param buffer The buffer which we store the data to send. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*BusTx) ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Find and Get bus handle used to control bus ++ * ++ * @param demodulator the handle of demodulator. ++ * @param bufferLength The length to transmit. ++ * @param buffer The buffer which we store the data to send. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*BusRx) ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Find and Get bus handle used to control bus ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress The starting address of memory to get. ++ * @param readBufferLength The length of buffer to receive data. ++ * @param readBuffer The buffer use to store received data ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*BusRxData) ( ++ IN Demodulator* demodulator, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++/** ++ * General send command function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param command The command which you wan. ++ * @param valueLength value length. ++ * @param valueBuffer value buffer. ++ * @param referenceLength reference length. ++ * @param referenceBuffer reference buffer. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*SendCommand) ( ++ IN Demodulator* demodulator, ++ IN Word command, ++ IN Byte chip, ++ IN Processor processor, ++ IN Dword writeBufferLength, ++ IN Byte* writeBuffer, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * General read EEPROM function ++ * ++ * @param demodulator the handle of demodulator. ++ * @param registerAddress address of register to be read. ++ * @param bufferLength number, 1-8, of registers to be read. ++ * @param buffer buffer used to store values to be read to specified ++ * registers. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*ReceiveData) ( ++ IN Demodulator* demodulator, ++ IN Dword registerAddress, ++ IN Dword readBufferLength, ++ OUT Byte* readBuffer ++); ++ ++ ++/** ++ * The type defination of BusDescription ++ */ ++typedef struct { ++ GetBus getBus; ++ BusTx busTx; ++ BusRx busRx; ++ BusRxData busRxData; ++} BusDescription; ++ ++ ++/** ++ * The type defination of BusDescription ++ */ ++typedef struct { ++ Dword mailBoxSize; ++ BusDescription* busDescription; ++ WriteRegisters writeRegisters; ++ WriteScatterRegisters writeScatterRegisters; ++ WriteTunerRegisters writeTunerRegisters; ++ WriteEepromValues writeEepromValues; ++ ReadRegisters readRegisters; ++ ReadScatterRegisters readScatterRegisters; ++ ReadTunerRegisters readTunerRegisters; ++ ReadEepromValues readEepromValues; ++ ModifyRegister modifyRegister; ++ LoadFirmware loadFirmware; ++ Reboot reboot; ++ SendCommand sendCommand; ++ ReceiveData receiveData; ++} CmdDescription; ++ ++ ++/** ++ * General tuner opening function ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*OpenTuner) ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * General tuner closing function ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*CloseTuner) ( ++ IN Demodulator* demodulator, ++ IN Byte chip ++); ++ ++ ++/** ++ * General tuner setting function ++ * ++ * @param demodulator the handle of demodulator. ++ * @return Error_NO_ERROR: successful, non-zero error code otherwise. ++ */ ++typedef Dword (*SetTuner) ( ++ IN Demodulator* demodulator, ++ IN Byte chip, ++ IN Word bandwidth, ++ IN Dword frequency ++); ++ ++ ++/** ++ * The type defination of TunerDescription ++ */ ++typedef struct { ++ OpenTuner openTuner; ++ CloseTuner closeTuner; ++ SetTuner setTuner; ++ ValueSet* tunerScript; ++ Word* tunerScriptSets; ++ Byte tunerAddress; ++ Byte registerAddressLength; ++ Dword ifFrequency; ++ Bool inversion; ++ Word tunerId; ++} TunerDescription; ++ ++ ++/** ++ * The data structure of DefaultDemodulator ++ */ ++typedef struct { ++ /** Basic structure */ ++ Handle userData; ++ Handle driver; ++ Dword options; ++ Word busId; ++ CmdDescription* cmdDescription; ++ Word tunerId; ++ TunerDescription *tunerDescription; ++} DefaultDemodulator; ++ ++ ++/** ++ * The data structure of Ganymede ++ */ ++typedef struct { ++ /** Basic structure */ ++ Handle userData; ++ Handle driver; ++ Dword options; ++ Word busId; ++ CmdDescription* cmdDescription; ++ TunerDescription *tunerDescription; ++ Byte* firmwareCodes; ++ Segment* firmwareSegments; ++ Byte* firmwarePartitions; ++ Word* scriptSets; ++ ValueSet* scripts; ++ Word* tunerScriptSets; ++ ValueSet* tunerScripts; ++ Byte chipNumber; ++ Dword crystalFrequency; ++ Dword adcFrequency; ++ StreamType streamType; ++ Architecture architecture; ++ Word bandwidth[2]; ++ Dword frequency[2]; ++ Dword fcw; ++ Statistic statistic[2]; ++ ChannelStatistic channelStatistic[2]; /** release1remove */ ++ Byte hostInterface[2]; ++ Bool booted; ++ Bool initialized; ++ ++ /** DVB-T structure */ ++ Bool dataReady; ++ BurstSize burstSize; ++ ++ Byte GPIO8Value[2]; ++} Ganymede; ++ ++ ++extern const Byte Standard_bitMask[8]; ++#define REG_MASK(pos, len) (Standard_bitMask[len-1] << pos) ++#define REG_CLEAR(temp, pos, len) (temp & (~REG_MASK(pos, len))) ++#define REG_CREATE(val, temp, pos, len) ((val << pos) | (REG_CLEAR(temp, pos, len))) ++#define REG_GET(value, pos, len) ((value & REG_MASK(pos, len)) >> pos) ++#define LOWBYTE(w) ((Byte)((w) & 0xff)) ++#define HIGHBYTE(w) ((Byte)((w >> 8) & 0xff)) ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_usb-urb.c b/drivers/media/dvb/dvb-usb/a867_usb-urb.c +new file mode 100644 +index 0000000..5caec20 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_usb-urb.c +@@ -0,0 +1,247 @@ ++/* usb-urb.c is part of the DVB USB library. ++ * ++ * Copyright (C) 2004-6 Patrick Boettcher (patrick.boettcher@desy.de) ++ * see dvb-usb-init.c for copyright information. ++ * ++ * This file keeps functions for initializing and handling the ++ * BULK and ISOC USB data transfers in a generic way. ++ * Can be used for DVB-only and also, that's the plan, for ++ * Hybrid USB devices (analog and DVB). ++ */ ++#include "dvb-usb-common.h" ++ ++/* URB stuff for streaming */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ++static void usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) ++#else ++static void usb_urb_complete(struct urb *urb) ++#endif ++{ ++ struct usb_data_stream *stream = urb->context; ++ int ptype = usb_pipetype(urb->pipe); ++ int i; ++ u8 *b; ++ ++ deb_uxfer("'%s' urb completed. status: %d, length: %d/%d, pack_num: %d, errors: %d\n", ++ ptype == PIPE_ISOCHRONOUS ? "isoc" : "bulk", ++ urb->status,urb->actual_length,urb->transfer_buffer_length, ++ urb->number_of_packets,urb->error_count); ++ ++ switch (urb->status) { ++ case 0: /* success */ ++ case -ETIMEDOUT: /* NAK */ ++ break; ++ case -ECONNRESET: /* kill */ ++ case -ENOENT: ++ case -ESHUTDOWN: ++ return; ++ default: /* error */ ++ deb_ts("urb completition error %d.\n", urb->status); ++ break; ++ } ++ ++ b = (u8 *) urb->transfer_buffer; ++ switch (ptype) { ++ case PIPE_ISOCHRONOUS: ++ for (i = 0; i < urb->number_of_packets; i++) { ++ ++ if (urb->iso_frame_desc[i].status != 0) ++ deb_ts("iso frame descriptor has an error: %d\n",urb->iso_frame_desc[i].status); ++ else if (urb->iso_frame_desc[i].actual_length > 0) ++ stream->complete(stream, b + urb->iso_frame_desc[i].offset, urb->iso_frame_desc[i].actual_length); ++ ++ urb->iso_frame_desc[i].status = 0; ++ urb->iso_frame_desc[i].actual_length = 0; ++ } ++ debug_dump(b,20,deb_uxfer); ++ break; ++ case PIPE_BULK: ++ if (urb->actual_length > 0) ++ stream->complete(stream, b, urb->actual_length); ++ break; ++ default: ++ err("unkown endpoint type in completition handler."); ++ return; ++ } ++ usb_submit_urb(urb,GFP_ATOMIC); ++} ++ ++int usb_urb_kill(struct usb_data_stream *stream) ++{ ++ int i; ++ for (i = 0; i < stream->urbs_submitted; i++) { ++ deb_ts("killing URB no. %d.\n",i); ++ ++ /* stop the URB */ ++ usb_kill_urb(stream->urb_list[i]); ++ } ++ stream->urbs_submitted = 0; ++ return 0; ++} ++ ++int usb_urb_submit(struct usb_data_stream *stream) ++{ ++ int i,ret; ++ for (i = 0; i < stream->urbs_initialized; i++) { ++ deb_ts("submitting URB no. %d\n",i); ++ if ((ret = usb_submit_urb(stream->urb_list[i],GFP_ATOMIC))) { ++ err("could not submit URB no. %d - get them all back",i); ++ usb_urb_kill(stream); ++ return ret; ++ } ++ stream->urbs_submitted++; ++ } ++ return 0; ++} ++ ++static int usb_free_stream_buffers(struct usb_data_stream *stream) ++{ ++ if (stream->state & USB_STATE_URB_BUF) { ++ while (stream->buf_num) { ++ stream->buf_num--; ++ deb_mem("freeing buffer %d\n",stream->buf_num); ++ usb_buffer_free(stream->udev, stream->buf_size, ++ stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); ++ } ++ } ++ ++ stream->state &= ~USB_STATE_URB_BUF; ++ ++ return 0; ++} ++ ++static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num, unsigned long size) ++{ ++ stream->buf_num = 0; ++ stream->buf_size = size; ++ ++ deb_mem("all in all I will use %lu bytes for streaming\n",num*size); ++ ++ for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) { ++ deb_mem("allocating buffer %d\n",stream->buf_num); ++ if (( stream->buf_list[stream->buf_num] = ++ usb_buffer_alloc(stream->udev, size, GFP_ATOMIC, ++ &stream->dma_addr[stream->buf_num]) ) == NULL) { ++ deb_mem("not enough memory for urb-buffer allocation.\n"); ++ usb_free_stream_buffers(stream); ++ return -ENOMEM; ++ } ++ deb_mem("buffer %d: %p (dma: %Lu)\n", ++ stream->buf_num, ++stream->buf_list[stream->buf_num], (long long)stream->dma_addr[stream->buf_num]); ++ memset(stream->buf_list[stream->buf_num],0,size); ++ stream->state |= USB_STATE_URB_BUF; ++ } ++ deb_mem("allocation successful\n"); ++ ++ return 0; ++} ++ ++static int usb_bulk_urb_init(struct usb_data_stream *stream) ++{ ++ int i; ++ ++ if ((i = usb_allocate_stream_buffers(stream,stream->props.count, ++ stream->props.u.bulk.buffersize)) < 0) ++ return i; ++ ++ /* allocate the URBs */ ++ for (i = 0; i < stream->props.count; i++) { ++ if ((stream->urb_list[i] = usb_alloc_urb(0,GFP_ATOMIC)) == NULL) ++ return -ENOMEM; ++ ++ usb_fill_bulk_urb( stream->urb_list[i], stream->udev, ++ usb_rcvbulkpipe(stream->udev,stream->props.endpoint), ++ stream->buf_list[i], ++ stream->props.u.bulk.buffersize, ++ usb_urb_complete, stream); ++ ++ stream->urb_list[i]->transfer_flags = 0; ++ stream->urbs_initialized++; ++ } ++ return 0; ++} ++ ++static int usb_isoc_urb_init(struct usb_data_stream *stream) ++{ ++ int i,j; ++ ++ if ((i = usb_allocate_stream_buffers(stream,stream->props.count, ++ stream->props.u.isoc.framesize*stream->props.u.isoc.framesperurb)) < 0) ++ return i; ++ ++ /* allocate the URBs */ ++ for (i = 0; i < stream->props.count; i++) { ++ struct urb *urb; ++ int frame_offset = 0; ++ if ((stream->urb_list[i] = ++ usb_alloc_urb(stream->props.u.isoc.framesperurb,GFP_ATOMIC)) == NULL) ++ return -ENOMEM; ++ ++ urb = stream->urb_list[i]; ++ ++ urb->dev = stream->udev; ++ urb->context = stream; ++ urb->complete = usb_urb_complete; ++ urb->pipe = usb_rcvisocpipe(stream->udev,stream->props.endpoint); ++ urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; ++ urb->interval = stream->props.u.isoc.interval; ++ urb->number_of_packets = stream->props.u.isoc.framesperurb; ++ urb->transfer_buffer_length = stream->buf_size; ++ urb->transfer_buffer = stream->buf_list[i]; ++ urb->transfer_dma = stream->dma_addr[i]; ++ ++ for (j = 0; j < stream->props.u.isoc.framesperurb; j++) { ++ urb->iso_frame_desc[j].offset = frame_offset; ++ urb->iso_frame_desc[j].length = stream->props.u.isoc.framesize; ++ frame_offset += stream->props.u.isoc.framesize; ++ } ++ ++ stream->urbs_initialized++; ++ } ++ return 0; ++} ++ ++int usb_urb_init(struct usb_data_stream *stream, struct usb_data_stream_properties *props) ++{ ++ if (stream == NULL || props == NULL) ++ return -EINVAL; ++ ++ memcpy(&stream->props, props, sizeof(*props)); ++ ++ usb_clear_halt(stream->udev,usb_rcvbulkpipe(stream->udev,stream->props.endpoint)); ++ ++ if (stream->complete == NULL) { ++ err("there is no data callback - this doesn't make sense."); ++ return -EINVAL; ++ } ++ ++ switch (stream->props.type) { ++ case USB_BULK: ++ return usb_bulk_urb_init(stream); ++ case USB_ISOC: ++ return usb_isoc_urb_init(stream); ++ default: ++ err("unkown URB-type for data transfer."); ++ return -EINVAL; ++ } ++} ++ ++int usb_urb_exit(struct usb_data_stream *stream) ++{ ++ int i; ++ ++ usb_urb_kill(stream); ++ ++ for (i = 0; i < stream->urbs_initialized; i++) { ++ if (stream->urb_list[i] != NULL) { ++ deb_mem("freeing URB no. %d.\n",i); ++ /* free the URBs */ ++ usb_free_urb(stream->urb_list[i]); ++ } ++ } ++ stream->urbs_initialized = 0; ++ ++ usb_free_stream_buffers(stream); ++ return 0; ++} +diff --git a/drivers/media/dvb/dvb-usb/a867_usb2impl.c b/drivers/media/dvb/dvb-usb/a867_usb2impl.c +new file mode 100644 +index 0000000..23b0629 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_usb2impl.c +@@ -0,0 +1,171 @@ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) ++#include ++#else ++#include ++#endif ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "a867_usb2impl.h" ++#include "a867_af903x.h" ++ ++#ifdef UNDER_CE ++ ++Handle Usb2_handle = NULL; ++ ++ ++Dword Usb2_getDriver ( ++ IN Demodulator* demodulator, ++ OUT Handle* handle ++) { ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword Usb2_writeControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++) { ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword Usb2_readControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword Usb2_readDataBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ return (Error_NO_ERROR); ++} ++ ++#else ++ ++#ifndef _WIN32_WINNT ++#define _WIN32_WINNT 0x0500 ++#endif ++ ++Handle Usb2_handle = 0; ++/* ++bool (__cdecl *Usb2_initialize) ( ++); ++void (__cdecl *Usb2_finalize) ( ++); ++bool (__cdecl *Usb2_writeControl) ( ++ Byte* poutBuf, ++ unsigned long WriteLen, ++ unsigned long* pnBytesWrite ++); ++bool (__cdecl *Usb2_readControl) ( ++ Byte* pinBuf, ++ unsigned long ReadLen, ++ unsigned long* pnBytesRead ++); ++bool (__cdecl *Usb2_readData) ( ++ BYTE* pinBuf, ++ ULONG ReadLen ++); ++*/ ++ ++Dword Usb2_getDriver ( ++ IN Demodulator* demodulator, ++ OUT Handle* handle ++) { ++ Dword error = Error_NO_ERROR; ++/* ++ HINSTANCE instance = NULL; ++ ++ instance = LoadLibrary ("AF15BDAEX.dll"); ++ Usb2_initialize = (bool (__cdecl *) ( ++ )) GetProcAddress (instance, "af15_init"); ++ Usb2_finalize = (void (__cdecl *) ( ++ )) GetProcAddress (instance, "af15_exit"); ++ Usb2_writeControl = (bool (__cdecl *) ( ++ BYTE* poutBuf, ++ ULONG WriteLen, ++ ULONG* pnBytesWrite ++ )) GetProcAddress (instance, "af15_WriteBulkData"); ++ Usb2_readControl = (bool (__cdecl *) ( ++ BYTE* pinBuf, ++ ULONG ReadLen, ++ ULONG* pnBytesRead ++ )) GetProcAddress (instance, "af15_ReadBulkData"); ++ Usb2_readData = (bool (__cdecl *) ( ++ BYTE* pinBuf, ++ ULONG ReadLen ++ )) GetProcAddress (instance, "af15_GetTsData"); ++ ++ if (!Usb2_initialize ()) ++ error = Error_DRIVER_INVALID; ++ ++ *handle = (Handle) instance; ++*/ ++ return (error); ++} ++ ++ ++Dword Usb2_writeControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++) { ++// Ganymede *pGanymede = (Ganymede *)demodulator; ++ Dword ret,act_len; ++ ret = usb_bulk_msg(usb_get_dev(udevs), ++ usb_sndbulkpipe(usb_get_dev(udevs), 0x02), ++ buffer, ++ bufferLength, ++ &act_len, ++ 1000); ++ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword Usb2_readControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++// Ganymede *pGanymede = (Ganymede *)demodulator; ++ Dword ret, nBytesRead; ++ ret = usb_bulk_msg(usb_get_dev(udevs), ++ usb_rcvbulkpipe(usb_get_dev(udevs),129), ++ buffer, ++ 255, ++ &nBytesRead, ++ 1000); ++ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword Usb2_readDataBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ return (Error_NO_ERROR); ++} ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_usb2impl.h b/drivers/media/dvb/dvb-usb/a867_usb2impl.h +new file mode 100644 +index 0000000..34b8fe1 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_usb2impl.h +@@ -0,0 +1,38 @@ ++#ifndef __USB2IMPL_H__ ++#define __USB2IMPL_H__ ++ ++ ++#include "a867_type.h" ++#include "a867_error.h" ++#include "a867_user.h" ++#include "a867_cmd.h" ++ ++ ++Dword Usb2_getDriver ( ++ IN Demodulator* demodulator, ++ OUT Handle* handle ++); ++ ++ ++Dword Usb2_writeControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++); ++ ++ ++Dword Usb2_readControlBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++Dword Usb2_readDataBus ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++ ++#endif ++ +diff --git a/drivers/media/dvb/dvb-usb/a867_user.c b/drivers/media/dvb/dvb-usb/a867_user.c +new file mode 100644 +index 0000000..7e75f05 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_user.c +@@ -0,0 +1,236 @@ ++#include "a867_user.h" ++#include "a867_af903x.h" ++ ++ ++/** ++ * Handle for specific bus driver ++ */ ++Handle User_handle = NULL; ++ ++ ++/** ++ * Totoal number of chip ++ */ ++Byte User_chipNumber; ++ ++ ++/** ++ * Current index of chip ++ */ ++Byte User_chipIndex; ++ ++ ++/** ++ * Variable of critical section ++ */ ++ ++Dword User_memoryCopy ( ++ IN Demodulator* demodulator, ++ IN void* dest, ++ IN void* src, ++ IN Dword count ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * memcpy(dest, src, (size_t)count); ++ * return (0); ++ */ ++ //memcpy (dest, src, (size_t)count); ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_memoryFree ( ++ IN Demodulator* demodulator, ++ IN void* mem ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * free(pMem); ++ * return (0); ++ */ ++ //free (mem); ++ //ExFreePool(mem); ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_printf ( ++ IN Demodulator* demodulator, ++ IN const char* format, ++ IN ... ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * va_list arg; ++ * ++ * va_start(arg, format); ++ * vprintf(format, arg); ++ * va_end(arg); ++ * return (0); ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_delay ( ++ IN Demodulator* demodulator, ++ IN Dword dwMs ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * delay(dwMs); ++ * return (0); ++ */ ++ //Sleep (dwMs); ++ unsigned long j = (HZ*dwMs)/1000; ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ schedule_timeout(j); ++ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_createCriticalSection ( ++ IN Demodulator* demodulator ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * return (0); ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_deleteCriticalSection ( ++ IN Demodulator* demodulator ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * return (0); ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_enterCriticalSection ( ++ IN Demodulator* demodulator ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * return (0); ++ */ ++ PDEVICE_CONTEXT PDC = (PDEVICE_CONTEXT)demodulator->userData; ++ if( PDC ) { ++ down(&PDC->regLock); ++ } ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_leaveCriticalSection ( ++ IN Demodulator* demodulator ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * return (0); ++ */ ++ ++ PDEVICE_CONTEXT PDC = (PDEVICE_CONTEXT)demodulator->userData; ++ if( PDC ) { ++ up(&PDC->regLock); ++ } ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_mpegConfig ( ++ IN Demodulator* demodulator ++) { ++ /* ++ * ToDo: Add code here ++ * ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_busTx ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * short i; ++ * ++ * start(); ++ * write_i2c(uc2WireAddr); ++ * ack(); ++ * for (i = 0; i < bufferLength; i++) { ++ * write_i2c(*(ucpBuffer + i)); ++ * ack(); ++ * } ++ * stop(); ++ * ++ * // If no error happened return 0, else return error code. ++ * return (0); ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_busRx ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ /* ++ * ToDo: Add code here ++ * ++ * //Pseudo code ++ * short i; ++ * ++ * start(); ++ * write_i2c(uc2WireAddr | 0x01); ++ * ack(); ++ * for (i = 0; i < bufferLength - 1; i++) { ++ * read_i2c(*(ucpBuffer + i)); ++ * ack(); ++ * } ++ * read_i2c(*(ucpBuffer + bufferLength - 1)); ++ * nack(); ++ * stop(); ++ * ++ * // If no error happened return 0, else return error code. ++ * return (0); ++ */ ++ return (Error_NO_ERROR); ++} ++ ++ ++Dword User_busRxData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++) { ++ return (Error_NO_ERROR); ++} +diff --git a/drivers/media/dvb/dvb-usb/a867_user.h b/drivers/media/dvb/dvb-usb/a867_user.h +new file mode 100644 +index 0000000..464f521 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_user.h +@@ -0,0 +1,155 @@ ++#ifndef __USER_H__ ++#define __USER_H__ ++ ++ ++//#include ++#include "a867_type.h" ++#include "a867_error.h" ++//#include //for Linux mdelay ++#include //for Linux mdelay ++ ++ ++ ++#define User_USE_INTERRUPT 0 ++#define User_USE_DRIVER 0 ++ ++/** Define timeout count for acquirePlatform and setPlatform, the default value 300 means 30 seconds. */ ++#define User_TIMEOUT_COUNT 300 ++ ++/** Define I2C master speed, the default value 0x0D means 197KHz (1000000000 / (24.4 * 16 * User_I2C_SPEED)). */ ++#define User_I2C_SPEED 0x0D ++ ++/** Define I2C address of secondary chip when Diversity mode or PIP mode is active. */ ++#define User_I2C_ADDRESS 0x3A//0x38 ++ ++/** Define USB frame size */ ++#define User_USB20_MAX_PACKET_SIZE 512 ++//j010+s ++//#define User_USB20_FRAME_SIZE (188 * 348) ++#define User_USB20_FRAME_SIZE (188 * TS_PACKET_COUNT) ++//j010+e ++#define User_USB20_FRAME_SIZE_DW (User_USB20_FRAME_SIZE / 4) ++#define User_USB11_MAX_PACKET_SIZE 64 ++#define User_USB11_FRAME_SIZE (188 * 21) ++#define User_USB11_FRAME_SIZE_DW (User_USB11_FRAME_SIZE / 4) ++ ++typedef unsigned char tBYTE; // 1 byte ++typedef unsigned short tWORD; // 2 bytes ++typedef unsigned int tDWORD; // 4 bytes ++typedef int tINT; // 4 bytes ++typedef void * tHANDLE; ++ ++/** ++ * Memory copy Function ++ */ ++Dword User_memoryCopy ( ++ IN Demodulator* demodulator, ++ IN void* dest, ++ IN void* src, ++ IN Dword count ++); ++ ++ ++/** ++ * Memory free Function ++ */ ++Dword User_memoryFree ( ++ IN Demodulator* demodulator, ++ IN void* mem ++); ++ ++ ++/** ++ * Print Function ++ */ ++Dword User_printf ( ++ IN Demodulator* demodulator, ++ IN const char* format, ++ IN ... ++); ++ ++ ++/** ++ * Delay Function ++ */ ++Dword User_delay ( ++ IN Demodulator* demodulator, ++ IN Dword dwMs ++); ++ ++ ++/** ++ * Creat and initialize critical section ++ */ ++Dword User_createCriticalSection ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Delete critical section ++ */ ++Dword User_deleteCriticalSection ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Enter critical section ++ */ ++Dword User_enterCriticalSection ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Leave critical section ++ */ ++Dword User_leaveCriticalSection ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Config MPEG2 interface ++ */ ++Dword User_mpegConfig ( ++ IN Demodulator* demodulator ++); ++ ++ ++/** ++ * Write data via "Control Bus" ++ * I2C mode : uc2WireAddr mean demodulator chip address, the default value is 0x38 ++ * USB mode : uc2WireAddr is useless, don't have to send this data ++ */ ++Dword User_busTx ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ IN Byte* buffer ++); ++ ++ ++/** ++ * Read data via "Control Bus" ++ * I2C mode : uc2WireAddr mean demodulator chip address, the default value is 0x38 ++ * USB mode : uc2WireAddr is useless, don't have to send this data ++ */ ++Dword User_busRx ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++ ++ ++/** ++ * Read data via "Data Bus" ++ * I2C mode : uc2WireAddr mean demodulator chip address, the default value is 0x38 ++ * USB mode : uc2WireAddr is useless, don't have to send this data ++ */ ++Dword User_busRxData ( ++ IN Demodulator* demodulator, ++ IN Dword bufferLength, ++ OUT Byte* buffer ++); ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_userdef.h b/drivers/media/dvb/dvb-usb/a867_userdef.h +new file mode 100644 +index 0000000..c4be11d +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_userdef.h +@@ -0,0 +1,25 @@ ++#ifndef _USERDEF_H_ ++#define _USERDEF_H_ ++ ++ ++//typedef unsigned char BYTE; // 1 byte ++//typedef unsigned short WORD; // 2 bytes ++//typedef unsigned long DWORD; // 4 bytes ++typedef int INT; // 4 bytes ++//typedef void * HANDLE; ++ ++//#define NULL 0 ++ ++#ifdef IN ++#undef IN ++#endif ++ ++#ifdef OUT ++#undef OUT ++#endif ++ ++#define IN ++#define OUT ++#define INOUT ++ ++#endif // _USERDEF_H_ +diff --git a/drivers/media/dvb/dvb-usb/a867_variable.h b/drivers/media/dvb/dvb-usb/a867_variable.h +new file mode 100644 +index 0000000..53d6fbc +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_variable.h +@@ -0,0 +1,260 @@ ++#ifndef __VARIABLE_H__ ++#define __VARIABLE_H__ ++//this file define variable which initialized by AP ++//CFOE------------------------------------------ ++ ++//These variables are initialized by API. ++//Don't change the order of the definition of these variables. ++ ++ ++//2k ++//BASE Address 0x418B ++#define var_addr_base 0x418b ++#define log_addr_base 0x418d ++#define log_data_base 0x418f ++// Do NOT touch the following line: used by script ++// --- @xx++ Start variable block ++//Initialization.. ++//API relative ++//BASE Address 0x0000 ++#define trigger_ofsm 0x0000 ++#define cfoe_NS_2048_coeff1_25_24 0x0001 ++#define cfoe_NS_2048_coeff1_23_16 0x0002 ++#define cfoe_NS_2048_coeff1_15_8 0x0003 ++#define cfoe_NS_2048_coeff1_7_0 0x0004 ++#define cfoe_NS_2k_coeff2_24 0x0005 ++#define cfoe_NS_2k_coeff2_23_16 0x0006 ++#define cfoe_NS_2k_coeff2_15_8 0x0007 ++#define cfoe_NS_2k_coeff2_7_0 0x0008 ++ ++//8k.. ++ ++#define cfoe_NS_8191_coeff1_25_24 0x0009 ++#define cfoe_NS_8191_coeff1_23_16 0x000a ++#define cfoe_NS_8191_coeff1_15_8 0x000b ++#define cfoe_NS_8191_coeff1_7_0 0x000c ++#define cfoe_NS_8192_coeff1_25_24 0x000d ++#define cfoe_NS_8192_coeff1_23_16 0x000e ++#define cfoe_NS_8192_coeff1_15_8 0x000f ++#define cfoe_NS_8192_coeff1_7_0 0x0010 ++#define cfoe_NS_8193_coeff1_25_24 0x0011 ++#define cfoe_NS_8193_coeff1_23_16 0x0012 ++#define cfoe_NS_8193_coeff1_15_8 0x0013 ++#define cfoe_NS_8193_coeff1_7_0 0x0014 ++ ++#define cfoe_NS_8k_coeff2_24 0x0015 ++#define cfoe_NS_8k_coeff2_23_16 0x0016 ++#define cfoe_NS_8k_coeff2_15_8 0x0017 ++#define cfoe_NS_8k_coeff2_7_0 0x0018 ++ ++//4k ++#define cfoe_NS_4096_coeff1_25_24 0x0019 ++#define cfoe_NS_4096_coeff1_23_16 0x001a ++#define cfoe_NS_4096_coeff1_15_8 0x001b ++#define cfoe_NS_4096_coeff1_7_0 0x001c ++#define cfoe_NS_4k_coeff2_24 0x001d ++#define cfoe_NS_4k_coeff2_23_16 0x001e ++#define cfoe_NS_4k_coeff2_15_8 0x001f ++#define cfoe_NS_4k_coeff2_7_0 0x0020 ++ ++#define bfsfcw_fftindex_ratio_7_0 0x0021 ++#define bfsfcw_fftindex_ratio_15_8 0x0022 ++#define fftindex_bfsfcw_ratio_7_0 0x0023 ++#define fftindex_bfsfcw_ratio_15_8 0x0024 ++ ++ ++ ++#define crystal_clk_7_0 0x0025 ++#define crystal_clk_15_8 0x0026 ++#define crystal_clk_23_16 0x0027 ++#define crystal_clk_31_24 0x0028 ++ ++ ++#define bfs_fcw_7_0 0x0029 ++#define bfs_fcw_15_8 0x002a ++#define bfs_fcw_22_16 0x002b ++ ++//---------------------------------------------- ++//statistic performance.. ++ ++#define qnt_vbc_err_7_0 0x002c //snr ++#define qnt_vbc_err_15_8 0x002d //snr ++#define qnt_vbc_err_23_16 0x002e //snr ++#define r_qnt_vbc_sframe_num 0x002f ++#define tpsd_const 0x0030 ++#define tpsd_txmod 0x0031 ++ ++#define rsd_abort_packet_cnt_7_0 0x0032 ++#define rsd_abort_packet_cnt_15_8 0x0033 ++#define rsd_bit_err_cnt_7_0 0x0034 ++#define rsd_bit_err_cnt_15_8 0x0035 ++#define rsd_bit_err_cnt_23_16 0x0036 ++#define r_rsd_packet_unit_7_0 0x0037 ++#define r_rsd_packet_unit_15_8 0x0038 ++ ++#define qnt_vbc_sframe_num 0x0039 ++#define rsd_packet_unit_7_0 0x003a ++#define rsd_packet_unit_15_8 0x003b ++ ++#define tpsd_lock 0x003c ++#define mpeg_lock 0x003d ++#define RsdSequence 0x003e ++#define VtbSequence 0x003f ++ ++#define Training_Mode 0x0040 ++#define RESET_STATE 0x0041 ++#define unplug_flg 0x0042 ++#define aci_0 0x0043 ++#define aci_1 0x0044 ++ ++#define adcx2 0x0045 ++#define tuner_ID 0x0046 ++#define empty_channel_status 0x0047 ++#define signal_strength 0x0048 ++#define signal_quality 0x0049 ++#define est_rf_level_dbm 0x004a ++#define FreBand 0x004b ++#define suspend_flag 0x004c ++//GUI relative ++//Initial OFSM ++#define API_Reserved 0x004d ++#define var_ofsm_state 0x004e ++#define OfdmGuiRCN_H 0x004f ++#define OfdmGuiRCN_L 0x0050 ++#define antenna_unplugged 0x0051 ++#define strong_signal_detected 0x0052 ++#define channelFlatnessInd 0x0053 ++#define Flatness_Ind_nonCmb 0x0054 ++#define AutoDetectedSpectrumInv 0x0055 ++#define IsSpectrumInv 0x0056 ++#define strong_detect_bypass 0x0057 ++#define ss_dtop_bypass 0x0058 ++#define retrain_dtop_bypass 0x0059 ++#define EnableTimeSlice 0x005a ++#define SynchronizationType 0x005b ++#define ApplyFastSynchronizationToEchoChannel 0x005c ++#define ApplyPwmToRfIf 0x005d ++#define ChannelNo 0x005e ++ ++//release to AAGC document.. ++#define csi_bypass 0x005f ++#define mobile_bypass 0x0060 ++#define EnableSpeedLog 0x0061 ++ ++//regression used only.. ++#define r_rsd_abort_total_packet_7_0 0x0062 ++#define r_rsd_abort_total_packet_15_8 0x0063 ++#define r_rsd_abort_total_packet_23_16 0x0064 ++#define MaxRsdSequence 0x0065 ++#define RsdFrameNo 0x0066 ++#define MPESuperFrameNo 0x0067 ++ ++#define AgcDesiredLevel 0x0068 ++#define MinRfGain 0x0069 ++#define MaxIfGain 0x006a ++#define RssiOffset 0x006b ++#define RssiResidual 0x006c ++//Dtop ++ ++#define strong_weak_signal_default 0x006d ++#define unplug_th 0x006e ++#define afe_mem4_rssi_comp 0x006f ++ ++#define aagc_speed_detect_count 0x0070 ++#define aagc_mobile_thr 0x0071 ++#define aagc_nonmobile_thr 0x0072 ++#define agc_counter 0x0073 ++#define DisableAagcTop 0x0074 ++#define AgcReset 0x0075 ++#define AgcUp 0x0076 ++#define AgcDown 0x0077 ++#define AgcHold 0x0078 ++#define PwmCtrlHw 0x0079 ++#define MaxAgcGain 0x007a ++#define IniAgcGain 0x007b ++#define mccid_bypass 0x007c ++#define CdpfEnDefaultEchoRange 0x007d ++#define CdpfIniTestNo 0x007e ++#define timing_err_level 0x007f ++#define timing_retrain_cnt 0x0080 ++#define ChannelDiffThr 0x0081 ++ ++#define adjacent_on 0x0082 ++#define near_adjacent_on 0x0083 ++#define adjacent_off 0x0084 ++#define near_adjacent_off 0x0085 ++#define max_rf_agc_7_0 0x0086 ++#define max_rf_agc_9_8 0x0087 ++#define rf_top_numerator_s_7_0 0x0088 ++#define rf_top_numerator_s_9_8 0x0089 ++ ++#define gui_tdi_lms_en 0x008a ++#define fccid_strobe_scale 0x008b ++#define fccid_strobe_numerator 0x008c ++#define fccid_strobe_base 0x008d ++#define use_fccid 0x008e ++#define fft_ave_symbol_num 0x008f ++#define large_tone_num_th_7_0 0x0090 ++#define large_tone_num_th_15_8 0x0091 ++#define use_3m_lpf_th 0x0092 ++#define ce_var_min_8k 0x0093 ++#define ce_var_min_4k 0x0094 ++#define ce_var_min_2k 0x0095 ++#define ce_var_min_8k_non_flat 0x0096 ++#define flatness_thr 0x0097 ++#define non_mobile_signal_level_offset 0x0098 ++#define gui_ar_csi_en 0x0099 ++#define h2_echo_detected 0x009a ++#define signal_strength_rf_high 0x009b ++#define signal_strength_rf_low 0x009c ++#define signal_strength_if_high 0x009d ++#define signal_strength_if_low 0x009e ++//flatness ++#define flatness_thr_high 0x009f ++#define flatness_thr_low 0x00a0 ++ ++//softbit quality ++#define sbq1 0x00a1 ++#define sbq2 0x00a2 ++ ++//DCA ++#define dyna_dca_offset_en 0x00a3 ++#define dca_sbq_bad_th 0x00a4 ++#define detect_timing_err_en 0x00a5 ++#define flatness_from_h2_echo 0x00a6 ++ ++#define timging_error_detection 0x00a7 ++#define ce_forced_by_rotate 0x00a8 ++#define fccid_fft_mask_en 0x00a9 ++#define second_fctrl_unforce_en 0x00aa ++#define force_fdi0_at_high_mobile_en 0x00ab ++#define high_mobile_detected 0x00ac ++#define flatness_detection_en 0x00ad ++#define ChooseFsteCostFunctionFromCdpf 0x00ae ++#define signal_level 0x00af ++#define TryConf2En 0x00b0 ++#define Lower_tpsd_lock 0x00b1 ++#define Upper_tpsd_lock 0x00b2 ++ ++#define AgcCtrlType 0x00b3 ++#define opt_LNA_Rssi_scale 0x00b4 ++#define StopByTcl 0x00b5 ++#define RssiCalibration 0x00b6 ++#define AciDesiredSignalLevel_h 0x00b7 ++#define AciDesiredSignalLevel_l 0x00b8 ++#define ECO_ASIC 0x00b9 ++#define NXP_USE_I2C 0x00ba ++#define rf_freqency_23_16 0x00bb ++#define rf_freqency_15_8 0x00bc ++#define rf_freqency_7_0 0x00bd ++#define iqik_en 0x00be ++#define dcc_en 0x00bf ++#define VHFPinEnTh 0x00c0 ++#define ACIdetection 0x00c1 ++#define PinDiode 0x00c2 ++#define LNA_Gain 0x00c3 ++#define RSSI_LNA_ON 0x00c4 ++#define var_end 0x00c5 ++ ++//BASE Address 0xFFFF ++#endif +diff --git a/drivers/media/dvb/dvb-usb/a867_version.h b/drivers/media/dvb/dvb-usb/a867_version.h +new file mode 100644 +index 0000000..c3d3ddd +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/a867_version.h +@@ -0,0 +1,3 @@ ++#define Version_NUMBER 0x0200 ++#define Version_DATE 0x20080314 ++#define Version_BUILD 0x01 +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-af9035.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-af9035.patch new file mode 100644 index 0000000000..de7e8285d6 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-af9035.patch @@ -0,0 +1,15495 @@ +diff --git a/drivers/media/common/tuners/Kconfig b/drivers/media/common/tuners/Kconfig +index 4a6d5ce..feddaf6 100644 +--- a/drivers/media/common/tuners/Kconfig ++++ b/drivers/media/common/tuners/Kconfig +@@ -204,6 +204,13 @@ config MEDIA_TUNER_TDA18218 + help + NXP TDA18218 silicon tuner driver. + ++config MEDIA_TUNER_TUA9001 ++ tristate "Infineon OMNITUNE TUA 9001 silicon tuner" ++ depends on VIDEO_MEDIA && I2C ++ default m ++ help ++ A driver for the silicon tuner OMNITUNE TUA 9001 from Infineon. ++ + config MEDIA_TUNER_TDA18212 + tristate "NXP TDA18212 silicon tuner" + depends on VIDEO_MEDIA && I2C +diff --git a/drivers/media/common/tuners/Makefile b/drivers/media/common/tuners/Makefile +index 8295854..ad2fccd 100644 +--- a/drivers/media/common/tuners/Makefile ++++ b/drivers/media/common/tuners/Makefile +@@ -27,6 +27,7 @@ obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o + obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o + obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o + obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o ++obj-$(CONFIG_MEDIA_TUNER_TUA9001) += tua9001.o + obj-$(CONFIG_MEDIA_TUNER_TDA18212) += tda18212.o + + ccflags-y += -Idrivers/media/dvb/dvb-core +diff --git a/drivers/media/common/tuners/tua9001.c b/drivers/media/common/tuners/tua9001.c +new file mode 100644 +index 0000000..9db9362 +--- /dev/null ++++ b/drivers/media/common/tuners/tua9001.c +@@ -0,0 +1,286 @@ ++/* ++ * Infineon TUA 9001 silicon tuner driver ++ * ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include /* for kzalloc/kfree */ ++#include ++#include "tua9001.h" ++#include "tua9001_priv.h" ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 197120)) ++/* all DVB frontend drivers now work directly with the DVBv5 ++ * structure. This warrants that all drivers will be ++ * getting/setting frontend parameters on a consistent way, in ++ * order to avoid copying data from/to the DVBv3 structs ++ * without need. ++ */ ++#define V4L2_ONLY_DVB_V5 ++#endif ++ ++static int debug; ++module_param(debug, int, 0644); ++MODULE_PARM_DESC(debug, "debug"); ++ ++/* write register */ ++static int tua9001_writereg(struct tua9001_priv *priv, u8 reg, u16 val) ++{ ++ u8 buf[3] = {reg, val >> 8, val & 0xff}; ++ struct i2c_msg msg = { .addr = priv->cfg->i2c_address, ++ .flags = 0, .buf = buf, .len = 3 }; ++ ++ if (i2c_transfer(priv->i2c, &msg, 1) != 1) { ++ err("I2C write failed, reg:%02x", reg); ++ return -EREMOTEIO; ++ } ++ return 0; ++} ++ ++static int tua9001_release(struct dvb_frontend *fe) ++{ ++ kfree(fe->tuner_priv); ++ fe->tuner_priv = NULL; ++ return 0; ++} ++ ++static int tua9001_init(struct dvb_frontend *fe) ++{ ++ struct tua9001_priv *priv = fe->tuner_priv; ++ int ret = 0; ++ u8 i; ++ struct regdesc data[] = { ++ {0x1e, 0x6512}, ++ {0x25, 0xb888}, ++ {0x39, 0x5460}, ++ {0x3b, 0x00c0}, ++ {0x3a, 0xf000}, ++ {0x08, 0x0000}, ++ {0x32, 0x0030}, ++ {0x41, 0x703a}, ++ {0x40, 0x1c78}, ++ {0x2c, 0x1c00}, ++ {0x36, 0xc013}, ++ {0x37, 0x6f18}, ++ {0x27, 0x0008}, ++ {0x2a, 0x0001}, ++ {0x34, 0x0a40}, ++ }; ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c-gate */ ++ ++ for (i = 0; i < ARRAY_SIZE(data); i++) { ++ ret = tua9001_writereg(priv, data[i].reg, data[i].val); ++ if (ret) ++ break; ++ } ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c-gate */ ++ ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int tua9001_set_params(struct dvb_frontend *fe) ++{ ++ struct dtv_frontend_properties *params = &fe->dtv_property_cache; ++ struct tua9001_priv *priv = fe->tuner_priv; ++ int ret; ++ u16 val; ++ u32 freq; ++ u8 i; ++ struct regdesc data[2]; ++ ++ switch (params->bandwidth_hz) { ++#if 0 ++ case 5000000: ++ val = 0x3000; ++ break; ++#endif ++ case 6000000: ++ val = 0x2000; ++ break; ++ case 7000000: ++ val = 0x1000; ++ break; ++ case 8000000: ++ default: ++ val = 0x0000; ++ break; ++ } ++ ++ data[0].reg = 0x04; ++ data[0].val = val; ++ ++freq = params->frequency; ++ ++#define OFFSET 150000000 ++freq = freq - OFFSET; ++freq = freq/1000; ++freq = 48 * freq; ++freq = freq/1000; ++ ++val = freq; ++ ++ data[1].reg = 0x1f; ++ data[1].val = val; ++ ++ ++ deb_info("%s: freq:%d bw:%d freq tuner:%d val:%d\n", __func__, ++ params->frequency, params->bandwidth_hz, priv->frequency, ++ val); ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c-gate */ ++ ++ for (i = 0; i < ARRAY_SIZE(data); i++) { ++ ret = tua9001_writereg(priv, data[i].reg, data[i].val); ++ if (ret) ++ break; ++ } ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c-gate */ ++ ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#else ++static int tua9001_set_params(struct dvb_frontend *fe, ++ struct dvb_frontend_parameters *params) ++{ ++ struct tua9001_priv *priv = fe->tuner_priv; ++ int ret; ++ u16 val; ++ u32 freq; ++ u8 i; ++ struct regdesc data[2]; ++ ++ switch (params->u.ofdm.bandwidth) { ++#if 0 ++ case BANDWIDTH_5_MHZ: ++ val = 0x3000; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ val = 0x2000; ++ break; ++ case BANDWIDTH_7_MHZ: ++ val = 0x1000; ++ break; ++ case BANDWIDTH_8_MHZ: ++ default: ++ val = 0x0000; ++ break; ++ } ++ ++ data[0].reg = 0x04; ++ data[0].val = val; ++ ++freq = params->frequency; ++ ++#define OFFSET 150000000 ++freq = freq - OFFSET; ++freq = freq/1000; ++freq = 48 * freq; ++freq = freq/1000; ++ ++val = freq; ++ ++ data[1].reg = 0x1f; ++ data[1].val = val; ++ ++ ++ deb_info("%s: freq:%d bw:%d freq tuner:%d val:%d\n", __func__, ++ params->frequency, params->u.ofdm.bandwidth, priv->frequency, ++ val); ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c-gate */ ++ ++ for (i = 0; i < ARRAY_SIZE(data); i++) { ++ ret = tua9001_writereg(priv, data[i].reg, data[i].val); ++ if (ret) ++ break; ++ } ++ ++ if (fe->ops.i2c_gate_ctrl) ++ fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c-gate */ ++ ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#endif ++ ++static int tua9001_get_frequency(struct dvb_frontend *fe, u32 *frequency) ++{ ++ struct tua9001_priv *priv = fe->tuner_priv; ++ *frequency = priv->frequency; ++ return 0; ++} ++ ++static const struct dvb_tuner_ops tua9001_tuner_ops = { ++ .info = { ++ .name = "Infineon TUA 9001", ++ ++ .frequency_min = 170000000, ++ .frequency_max = 860000000, ++ .frequency_step = 0, ++ }, ++ ++ .release = tua9001_release, ++ .init = tua9001_init, ++ ++ .set_params = tua9001_set_params, ++ ++ .get_frequency = tua9001_get_frequency, ++}; ++ ++struct dvb_frontend * tua9001_attach(struct dvb_frontend *fe, ++ struct i2c_adapter *i2c, struct tua9001_config *cfg) ++{ ++ struct tua9001_priv *priv = NULL; ++ ++ priv = kzalloc(sizeof(struct tua9001_priv), GFP_KERNEL); ++ if (priv == NULL) ++ return NULL; ++ ++ priv->cfg = cfg; ++ priv->i2c = i2c; ++ ++ info("Infineon TUA 9001 successfully attached."); ++ ++ memcpy(&fe->ops.tuner_ops, &tua9001_tuner_ops, ++ sizeof(struct dvb_tuner_ops)); ++ ++ fe->tuner_priv = priv; ++ return fe; ++} ++EXPORT_SYMBOL(tua9001_attach); ++ ++MODULE_DESCRIPTION("Infineon TUA 9001 silicon tuner driver"); ++MODULE_AUTHOR("Antti Palosaari "); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/media/common/tuners/tua9001.h b/drivers/media/common/tuners/tua9001.h +new file mode 100644 +index 0000000..dd7298d +--- /dev/null ++++ b/drivers/media/common/tuners/tua9001.h +@@ -0,0 +1,46 @@ ++/* ++ * Infineon TUA 9001 silicon tuner driver ++ * ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef TUA9001_H ++#define TUA9001_H ++ ++#include "dvb_frontend.h" ++ ++struct tua9001_config { ++ u8 i2c_address; ++}; ++ ++#if defined(DETACHED_TERRATEC_MODULES) || \ ++ defined(CONFIG_MEDIA_TUNER_TUA9001) || \ ++ (defined(CONFIG_MEDIA_TUNER_TUA9001_MODULE) && defined(MODULE)) ++extern struct dvb_frontend *tua9001_attach(struct dvb_frontend *fe, ++ struct i2c_adapter *i2c, ++ struct tua9001_config *cfg); ++#else ++static inline struct dvb_frontend *tua9001_attach(struct dvb_frontend *fe, ++ struct i2c_adapter *i2c, ++ struct tua9001_config *cfg) ++{ ++ printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); ++ return NULL; ++} ++#endif ++ ++#endif +diff --git a/drivers/media/common/tuners/tua9001_priv.h b/drivers/media/common/tuners/tua9001_priv.h +new file mode 100644 +index 0000000..7588df1 +--- /dev/null ++++ b/drivers/media/common/tuners/tua9001_priv.h +@@ -0,0 +1,53 @@ ++/* ++ * Infineon TUA 9001 silicon tuner driver ++ * ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef TUA9001_PRIV_H ++#define TUA9001_PRIV_H ++ ++#define LOG_PREFIX "tua9001" ++ ++#define dprintk(var, level, args...) \ ++ do { \ ++ if ((var & level)) \ ++ printk(args); \ ++ } while (0) ++ ++#define deb_info(args...) dprintk(debug, 0x01, args) ++ ++#undef err ++#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) ++#undef info ++#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) ++#undef warn ++#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) ++ ++struct regdesc { ++ u8 reg; ++ u16 val; ++}; ++ ++struct tua9001_priv { ++ struct tua9001_config *cfg; ++ struct i2c_adapter *i2c; ++ ++ u32 frequency; ++}; ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig +index 9f203c6..d2014c0 100644 +--- a/drivers/media/dvb/dvb-usb/Kconfig ++++ b/drivers/media/dvb/dvb-usb/Kconfig +@@ -281,6 +281,7 @@ config DVB_USB_DW2102 + select DVB_CX24116 if !DVB_FE_CUSTOMISE + select DVB_SI21XX if !DVB_FE_CUSTOMISE + select DVB_TDA10023 if !DVB_FE_CUSTOMISE ++ select DVB_TDA10021 if !DVB_FE_CUSTOMISE + select DVB_MT312 if !DVB_FE_CUSTOMISE + select DVB_ZL10039 if !DVB_FE_CUSTOMISE + select DVB_DS3000 if !DVB_FE_CUSTOMISE +@@ -339,6 +340,17 @@ config DVB_USB_AF9015 + help + Say Y here to support the Afatech AF9015 based DVB-T USB2.0 receiver + ++config DVB_USB_AF9035 ++ tristate "Afatech AF9035 DVB-T USB2.0 support" ++ depends on DVB_USB ++ default m ++ select DVB_AF9033 ++ select MEDIA_TUNER_TUA9001 if !MEDIA_TUNER_CUSTOMISE ++ select MEDIA_TUNER_TDA18218 if !MEDIA_TUNER_CUSTOMISE ++ select MEDIA_TUNER_MXL5007T if !MEDIA_TUNER_CUSTOMISE ++ help ++ Say Y here to support the Afatech AF9035 based DVB-T USB2.0 receiver ++ + config DVB_USB_CE6230 + tristate "Intel CE6230 DVB-T USB2.0 support" + depends on DVB_USB +diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile +index 26c8b9e..f8b1013 100644 +--- a/drivers/media/dvb/dvb-usb/Makefile ++++ b/drivers/media/dvb/dvb-usb/Makefile +@@ -1,3 +1,4 @@ ++ + dvb-usb-objs = dvb-usb-firmware.o dvb-usb-init.o dvb-usb-urb.o dvb-usb-i2c.o dvb-usb-dvb.o dvb-usb-remote.o usb-urb.o + obj-$(CONFIG_DVB_USB) += dvb-usb.o + +@@ -105,6 +106,9 @@ obj-$(CONFIG_DVB_USB_MXL111SF) += dvb-usb-mxl111sf.o + obj-$(CONFIG_DVB_USB_MXL111SF) += mxl111sf-demod.o + obj-$(CONFIG_DVB_USB_MXL111SF) += mxl111sf-tuner.o + ++dvb-usb-af9035-objs = af9035.o ++obj-$(CONFIG_DVB_USB_AF9035) += dvb-usb-af9035.o ++ + ccflags-y += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ + # due to tuner-xc3028 + ccflags-y += -Idrivers/media/common/tuners +diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c +new file mode 100644 +index 0000000..5f30344 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/af9035.c +@@ -0,0 +1,1268 @@ ++/* ++ * Afatech AF9035 DVB USB driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#include "af9035.h" ++#include "af9033.h" ++#include "tua9001.h" ++#include "mxl5007t.h" ++#include "tda18218.h" ++#include ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 196608)) ++#define V4L2_REFACTORED_MFE_CODE ++#endif ++ ++/* ++ * enable devices supported by the Avemedia A867 proprietary driver; ++ * some of this devices may use an unsupported tuner type (AF9007), ++ * so they may not work; probably those devices belong to the A333 family; ++ */ ++//#define ENABLE_A867_DEVICES ++ ++static int dvb_usb_af9035_debug; ++module_param_named(debug, dvb_usb_af9035_debug, int, 0644); ++MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS); ++DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); ++ ++static DEFINE_MUTEX(af9035_usb_mutex); ++ ++static struct af9035_config af9035_config; ++static struct dvb_usb_device_properties af9035_properties[1]; ++static int af9035_properties_count = ARRAY_SIZE(af9035_properties); ++ ++static struct af9033_config af9035_af9033_config[] = { ++ { ++ .demod_address = 0, ++ .tuner_address = 0, ++ .output_mode = AF9033_TS_MODE_USB, ++ }, { ++ .demod_address = 0, ++ .tuner_address = 0, ++ .output_mode = AF9033_TS_MODE_SERIAL, ++ } ++}; ++ ++static u8 regmask[8] = {0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; ++ ++static int af9035_rw_udev(struct usb_device *udev, struct af9035_req *req) ++{ ++#define BUF_SIZE 63 ++ int act_len, ret; ++ u8 buf[BUF_SIZE]; ++ u32 msg_len; ++ static u8 seq; /* packet sequence number */ ++ u16 checksum = 0; ++ u8 i; ++ ++ /* buffer overflow check */ ++ if (req->wlen > (BUF_SIZE - 6) || req->rlen > (BUF_SIZE - 5)) { ++ err("too much data wlen:%d rlen:%d", req->wlen, req->rlen); ++ return -EINVAL; ++ } ++ ++ if (mutex_lock_interruptible(&af9035_usb_mutex) < 0) ++ return -EAGAIN; ++ ++ buf[0] = req->wlen + 3 + 2; /* 3 header + 2 checksum */ ++ buf[1] = req->mbox; ++ buf[2] = req->cmd; ++ buf[3] = seq++; ++ if (req->wlen) ++ memcpy(&buf[4], req->wbuf, req->wlen); ++ ++ /* calc and add checksum */ ++ for (i = 1; i < buf[0]-1; i++) { ++ if (i % 2) ++ checksum += buf[i] << 8; ++ else ++ checksum += buf[i]; ++ } ++ checksum = ~checksum; ++ ++ buf[buf[0]-1] = (checksum >> 8); ++ buf[buf[0]-0] = (checksum & 0xff); ++ ++ msg_len = buf[0]+1; ++ ++ deb_xfer(">>> "); ++ debug_dump(buf, msg_len, deb_xfer); ++ ++ /* send req */ ++ ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 0x02), buf, msg_len, ++ &act_len, AF9035_USB_TIMEOUT); ++ if (ret) ++ err("bulk message failed:%d (%d/%d)", ret, msg_len, act_len); ++ else ++ if (act_len != msg_len) ++ ret = -EIO; /* all data is not send */ ++ if (ret) ++ goto error_unlock; ++ ++ /* no ack for those packets */ ++ if (req->cmd == CMD_FW_DOWNLOAD) ++ goto exit_unlock; ++ ++ /* receive ack and data if read req */ ++ msg_len = 3 + req->rlen + 2; /* data len + status + seq + checksum */ ++ ret = usb_bulk_msg(udev, usb_rcvbulkpipe(udev, 0x81), buf, msg_len, ++ &act_len, AF9035_USB_TIMEOUT); ++ if (ret) { ++ err("recv bulk message failed:%d", ret); ++ ret = -EIO; ++ goto error_unlock; ++ } ++ ++ deb_xfer("<<< "); ++ debug_dump(buf, act_len, deb_xfer); ++ ++ /* check status */ ++ if (buf[2]) { ++ err("command:%02x failed:%d", req->cmd, buf[2]); ++ ret = -EIO; ++ goto error_unlock; ++ } ++ ++ /* read request, copy returned data to return buf */ ++ if (req->rlen) ++ memcpy(req->rbuf, &buf[3], req->rlen); ++error_unlock: ++exit_unlock: ++ mutex_unlock(&af9035_usb_mutex); ++ ++ return ret; ++} ++ ++static int af9035_write_regs_bis(struct usb_device *d, u8 mbox, u16 reg, ++u8 *val, u8 len) ++{ ++ u8 wbuf[6+len]; ++ struct af9035_req req = {CMD_REG_DEMOD_WRITE, mbox, sizeof(wbuf), wbuf, ++ 0, NULL}; ++ wbuf[0] = len; ++ wbuf[1] = 2; ++ wbuf[2] = 0; ++ wbuf[3] = 0; ++ wbuf[4] = reg >> 8; ++ wbuf[5] = reg & 0xff; ++ memcpy(&wbuf[6], val, len); ++ return af9035_rw_udev(d, &req); ++} ++ ++static int af9035_write_regs(struct dvb_usb_device *d, u8 mbox, u16 reg, ++u8 *val, u8 len) ++{ ++ return af9035_write_regs_bis(d->udev, mbox, reg, val, len); ++} ++ ++static int af9035_read_regs_bis(struct usb_device *d, u8 mbox, u16 reg, u8 *val, ++ u8 len) ++{ ++ u8 wbuf[] = {len, 2, 0, 0, reg >> 8, reg & 0xff}; ++ struct af9035_req req = {CMD_REG_DEMOD_READ, mbox, sizeof(wbuf), wbuf, ++ len, val}; ++ return af9035_rw_udev(d, &req); ++} ++ ++static int af9035_read_regs(struct dvb_usb_device *d, u8 mbox, u16 reg, u8 *val, ++ u8 len) ++{ ++ return af9035_read_regs_bis(d->udev, mbox, reg, val, len); ++} ++ ++static int af9035_write_reg_bis(struct usb_device *d, u8 mbox, u16 reg, u8 val) ++{ ++ return af9035_write_regs_bis(d, mbox, reg, &val, 1); ++} ++ ++static int af9035_write_reg(struct dvb_usb_device *d, u8 mbox, u16 reg, u8 val) ++{ ++ return af9035_write_regs_bis(d->udev, mbox, reg, &val, 1); ++} ++ ++static int af9035_read_reg_bis(struct usb_device *d, u8 mbox, u16 reg, u8 *val) ++{ ++ return af9035_read_regs_bis(d, mbox, reg, val, 1); ++} ++ ++static int af9035_write_reg_bits_bis(struct usb_device *d, u8 mbox, u16 reg, ++ u8 pos, u8 len, u8 val) ++{ ++ int ret; ++ u8 tmp, mask; ++ ++ ret = af9035_read_reg_bis(d, mbox, reg, &tmp); ++ if (ret) ++ return ret; ++ ++ mask = regmask[len - 1] << pos; ++ tmp = (tmp & ~mask) | ((val << pos) & mask); ++ ++ return af9035_write_reg_bis(d, mbox, reg, tmp); ++} ++ ++static int af9035_write_reg_bits(struct dvb_usb_device *d, u8 mbox, u16 reg, ++ u8 pos, u8 len, u8 val) ++{ ++ return af9035_write_reg_bits_bis(d->udev, mbox, reg, pos, len, val); ++} ++ ++static int af9035_read_reg_bits_bis(struct usb_device *d, u8 mbox, u16 reg, ++ u8 pos, u8 len, u8 *val) ++{ ++ int ret; ++ u8 tmp; ++ ++ ret = af9035_read_reg_bis(d, mbox, reg, &tmp); ++ if (ret) ++ return ret; ++ *val = (tmp >> pos) & regmask[len - 1]; ++ return 0; ++} ++ ++static int af9035_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], ++ int num) ++{ ++ struct dvb_usb_device *d = i2c_get_adapdata(adap); ++ int ret = 0, i = 0; ++ u16 reg; ++ u8 mbox; ++ ++ if (mutex_lock_interruptible(&d->i2c_mutex) < 0) ++ return -EAGAIN; ++ ++ while (i < num) { ++ mbox = msg[i].buf[0]; ++ reg = msg[i].buf[1] << 8; ++ reg += msg[i].buf[2]; ++ if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { ++ if (msg[i].addr == ++ af9035_af9033_config[0].demod_address || ++ msg[i].addr == ++ af9035_af9033_config[1].demod_address) { ++ if (af9035_af9033_config[1].demod_address && (msg[i].addr == af9035_af9033_config[1].demod_address)) ++ mbox += 0x10; ++ ret = af9035_read_regs(d, mbox, reg, ++ &msg[i+1].buf[0], msg[i+1].len); ++ } else { ++ /* FIXME */ ++ u8 wbuf[5]; ++ u8 rbuf[BUF_SIZE]; ++ struct af9035_req req = {CMD_REG_TUNER_READ, ++ LINK, sizeof(wbuf), wbuf, msg[i + 1].len, ++ rbuf}; ++ if (af9035_af9033_config[1].tuner_address && ++ (msg[i].addr == af9035_af9033_config[1].tuner_address)) { ++ msg[i].addr = af9035_af9033_config[0].tuner_address; ++ req.mbox += 0x10; ++ } ++ wbuf[0] = msg[i + 1].len; /* read len */ ++ wbuf[1] = msg[i].addr; /* tuner i2c addr */ ++ wbuf[2] = 0x01; /* reg width */ ++ wbuf[3] = 0x00; /* reg MSB */ ++ wbuf[4] = msg[i].buf[0]; /* reg LSB */ ++ ret = af9035_rw_udev(d->udev, &req); ++ memcpy (msg[i + 1].buf, rbuf, msg[i + 1].len); ++ } ++ i += 2; ++ } else { ++ if (msg[i].addr == ++ af9035_af9033_config[0].demod_address || ++ msg[i].addr == ++ af9035_af9033_config[1].demod_address) { ++ if (af9035_af9033_config[1].demod_address && (msg[i].addr == af9035_af9033_config[1].demod_address)) ++ mbox += 0x10; ++ ret = af9035_write_regs(d, mbox, reg, ++ &msg[i].buf[3], msg[i].len-3); ++ } else { ++ u8 wbuf[BUF_SIZE]; ++ struct af9035_req req = {CMD_REG_TUNER_WRITE, ++ LINK, 4 + msg[i].len, wbuf, 0, NULL}; ++ if (af9035_af9033_config[1].tuner_address && ++ (msg[i].addr == af9035_af9033_config[1].tuner_address)) { ++ msg[i].addr = af9035_af9033_config[0].tuner_address; ++ req.mbox += 0x10; ++ } ++ wbuf[0] = msg[i].len - 1; /* write len */ ++ wbuf[1] = msg[i].addr; /* tuner i2c addr */ ++ wbuf[2] = 0x01; /* reg width */ ++ wbuf[3] = 0x00; /* reg MSB */ ++ memcpy (&wbuf[4], msg[i].buf, msg[i].len); ++ ret = af9035_rw_udev(d->udev, &req); ++ } ++ i += 1; ++ } ++ if (ret) ++ goto error; ++ ++ } ++ ret = i; ++error: ++ mutex_unlock(&d->i2c_mutex); ++ ++ return ret; ++} ++ ++static u32 af9035_i2c_func(struct i2c_adapter *adapter) ++{ ++ return I2C_FUNC_I2C; ++} ++ ++static struct i2c_algorithm af9035_i2c_algo = { ++ .master_xfer = af9035_i2c_xfer, ++ .functionality = af9035_i2c_func, ++#ifdef NEED_ALGO_CONTROL ++ .algo_control = dummy_algo_control, ++#endif ++}; ++ ++static int af9035_init_endpoint(struct dvb_usb_device *d) ++{ ++ int ret; ++ u16 frame_size; ++ u8 packet_size; ++ ++ if (d->udev->speed == USB_SPEED_FULL) { ++ frame_size = TS_USB11_FRAME_SIZE/4; ++ packet_size = TS_USB11_MAX_PACKET_SIZE/4; ++ } else { ++ frame_size = TS_USB20_FRAME_SIZE/4; ++ packet_size = TS_USB20_MAX_PACKET_SIZE/4; ++ } ++ ++ deb_info("%s: USB speed:%d frame_size:%04x packet_size:%02x\n", ++ __func__, d->udev->speed, frame_size, packet_size); ++ ++ /* enable EP4 reset */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_mp2_sw_rst, ++ reg_mp2_sw_rst_pos, reg_mp2_sw_rst_len, 1); ++ if (ret) ++ goto error; ++ ++ /* enable EP5 reset */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_mp2if2_sw_rst, ++ reg_mp2if2_sw_rst_pos, reg_mp2if2_sw_rst_len, 1); ++ if (ret) ++ goto error; ++ ++ /* disable EP4 */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep4_tx_en, ++ reg_ep4_tx_en_pos, reg_ep4_tx_en_len, 0); ++ if (ret) ++ goto error; ++ ++ /* disable EP5 */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep5_tx_en, ++ reg_ep5_tx_en_pos, reg_ep5_tx_en_len, 0); ++ if (ret) ++ goto error; ++ ++ /* disable EP4 NAK */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep4_tx_nak, ++ reg_ep4_tx_nak_pos, reg_ep4_tx_nak_len, 0); ++ if (ret) ++ goto error; ++ ++ /* disable EP5 NAK */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep5_tx_nak, ++ reg_ep5_tx_nak_pos, reg_ep5_tx_nak_len, 0); ++ if (ret) ++ goto error; ++ ++ /* enable EP4 */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep4_tx_en, ++ reg_ep4_tx_en_pos, reg_ep4_tx_en_len, 1); ++ if (ret) ++ goto error; ++ ++ /* EP4 xfer length */ ++ ret = af9035_write_regs(d, LINK, p_reg_ep4_tx_len_7_0, ++ (u8 *) &frame_size, sizeof(frame_size)); ++ if (ret) ++ goto error; ++ ++ /* EP4 packet size */ ++ ret = af9035_write_reg(d, LINK, p_reg_ep4_max_pkt, packet_size); ++ if (ret) ++ goto error; ++ ++ /* configure EP5 for dual mode */ ++ if (af9035_config.dual_mode) { ++ /* enable EP5 */ ++ ret = af9035_write_reg_bits(d, LINK, p_reg_ep5_tx_en, ++ reg_ep5_tx_en_pos, reg_ep5_tx_en_len, 1); ++ if (ret) ++ goto error; ++ ++ /* EP5 xfer length */ ++ ret = af9035_write_regs(d, LINK, p_reg_ep5_tx_len_7_0, ++ (u8 *) &frame_size, sizeof(frame_size)); ++ if (ret) ++ goto error; ++ ++ /* EP5 packet size */ ++ ret = af9035_write_reg(d, LINK, p_reg_ep5_max_pkt, packet_size); ++ if (ret) ++ goto error; ++ } ++ ++ /* enable / disable mp2if2 */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_mp2if2_en, ++ reg_mp2if2_en_pos, reg_mp2if2_en_len, af9035_config.dual_mode); ++ if (ret) ++ goto error; ++ ++ /* enable / disable tsis */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_tsis_en, reg_tsis_en_pos, ++ reg_tsis_en_len, af9035_config.dual_mode); ++ if (ret) ++ goto error; ++ ++ /* negate EP4 reset */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_mp2_sw_rst, ++ reg_mp2_sw_rst_pos, reg_mp2_sw_rst_len, 0); ++ if (ret) ++ goto error; ++ ++ /* negate EP5 reset */ ++ ret = af9035_write_reg_bits(d, OFDM, p_reg_mp2if2_sw_rst, ++ reg_mp2if2_sw_rst_pos, reg_mp2if2_sw_rst_len, 0); ++ if (ret) ++ goto error; ++ ++error: ++ if (ret) ++ err("endpoint init failed:%d", ret); ++ return ret; ++} ++ ++static int af9035_init(struct dvb_usb_device *d) ++{ ++ int ret; ++ deb_info("%s:\n", __func__); ++ ++ ret = af9035_init_endpoint(d); ++ if (ret) ++ goto error; ++error: ++ return ret; ++} ++ ++static int af9035_download_firmware(struct usb_device *udev, ++ const struct firmware *fw) ++{ ++ u8 *fw_data_ptr = (u8 *) fw->data; ++ int i, j, len, packets, remainder, ret; ++ u8 wbuf[1]; ++ u8 rbuf[4]; ++ struct af9035_firmware_header fw_hdr; ++ struct af9035_req req = {0, LINK, 0, NULL, 1, rbuf}; ++ struct af9035_req req_fw_dl = {CMD_FW_DOWNLOAD, LINK, 0, NULL, 0, NULL}; ++ struct af9035_req req_rom = {CMD_SCATTER_WRITE, LINK, 0, NULL, 1, rbuf}; ++ struct af9035_req req_fw_ver = {CMD_QUERYINFO, LINK, 1, wbuf, 4, rbuf}; ++ ++ /* read firmware segment info from beginning of the firmware file */ ++ fw_hdr.segment_count = *fw_data_ptr++; ++ deb_info("%s: fw segment count:%d\n", __func__, fw_hdr.segment_count); ++ if (fw_hdr.segment_count > SEGMENT_MAX_COUNT) { ++ warn("too big firmware segmen count:%d", fw_hdr.segment_count); ++ fw_hdr.segment_count = SEGMENT_MAX_COUNT; ++ } ++ for (i = 0; i < fw_hdr.segment_count; i++) { ++ fw_hdr.segment[i].type = (*fw_data_ptr++); ++ fw_hdr.segment[i].len = (*fw_data_ptr++) << 24; ++ fw_hdr.segment[i].len += (*fw_data_ptr++) << 16; ++ fw_hdr.segment[i].len += (*fw_data_ptr++) << 8; ++ fw_hdr.segment[i].len += (*fw_data_ptr++) << 0; ++ deb_info("%s: fw segment type:%d len:%d\n", __func__, ++ fw_hdr.segment[i].type, fw_hdr.segment[i].len); ++ } ++ ++ #define FW_PACKET_MAX_DATA 57 /* 63-4-2, packet_size-header-checksum */ ++ ++ /* download all segments */ ++ for (i = 0; i < fw_hdr.segment_count; i++) { ++ deb_info("%s: segment type:%d\n", __func__, ++ fw_hdr.segment[i].type); ++ if (fw_hdr.segment[i].type == SEGMENT_FW_DOWNLOAD) { ++ /* download begin packet */ ++ req.cmd = CMD_FW_DOWNLOAD_BEGIN; ++ ret = af9035_rw_udev(udev, &req); ++ if (ret) { ++ err("firmware download failed:%d", ret); ++ goto error; ++ } ++ ++ packets = fw_hdr.segment[i].len / FW_PACKET_MAX_DATA; ++ remainder = fw_hdr.segment[i].len % FW_PACKET_MAX_DATA; ++ len = FW_PACKET_MAX_DATA; ++ for (j = 0; j <= packets; j++) { ++ if (j == packets) /* size of the last packet */ ++ len = remainder; ++ ++ req_fw_dl.wlen = len; ++ req_fw_dl.wbuf = fw_data_ptr; ++ ret = af9035_rw_udev(udev, &req_fw_dl); ++ if (ret) { ++ err("firmware download failed at " \ ++ "segment:%d packet:%d err:%d", \ ++ i, j, ret); ++ goto error; ++ } ++ fw_data_ptr += len; ++ } ++ /* download end packet */ ++ req.cmd = CMD_FW_DOWNLOAD_END; ++ ret = af9035_rw_udev(udev, &req); ++ if (ret) { ++ err("firmware download failed:%d", ret); ++ goto error; ++ } ++ } else if (fw_hdr.segment[i].type == SEGMENT_ROM_COPY){ ++ packets = fw_hdr.segment[i].len / FW_PACKET_MAX_DATA; ++ remainder = fw_hdr.segment[i].len % FW_PACKET_MAX_DATA; ++ len = FW_PACKET_MAX_DATA; ++ for (j = 0; j <= packets; j++) { ++ if (j == packets) /* size of the last packet */ ++ len = remainder; ++ ++ req_rom.wlen = len; ++ req_rom.wbuf = fw_data_ptr; ++ ret = af9035_rw_udev(udev, &req_rom); ++ if (ret) { ++ err("firmware download failed at " \ ++ "segment:%d packet:%d err:%d", \ ++ i, j, ret); ++ goto error; ++ } ++ fw_data_ptr += len; ++ } ++ } else { ++ deb_info("%s: segment type:%d not implemented\n", ++ __func__, fw_hdr.segment[i].type); ++ } ++ } ++ ++ /* firmware loaded, request boot */ ++ req.cmd = CMD_BOOT; ++ ret = af9035_rw_udev(udev, &req); ++ if (ret) ++ goto error; ++ ++ /* ensure firmware starts */ ++ wbuf[0] = 1; ++ ret = af9035_rw_udev(udev, &req_fw_ver); ++ if (ret) ++ goto error; ++ ++ deb_info("%s: reply:%02x %02x %02x %02x\n", __func__, ++ rbuf[0], rbuf[1], rbuf[2], rbuf[3]); ++ ++ if (!(rbuf[0] || rbuf[1] || rbuf[2] || rbuf[3])) { ++ err("firmware did not run"); ++ ret = -EIO; ++ } ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++ ++static int af9035_read_eeprom_reg(struct usb_device *udev, u16 reg, u8 *val) ++{ ++ u8 wbuf[] = {1, 2, 0, 0, reg >> 8, reg & 0xff}; ++ struct af9035_req req = {CMD_REG_DEMOD_READ, LINK, sizeof(wbuf), wbuf, ++ 1, val}; ++ return af9035_rw_udev(udev, &req); ++} ++ ++static int af9035_read_config(struct usb_device *udev) ++{ ++ int ret; ++ u8 val, i, offset = 0; ++ ++ /* IR remote controller */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_IR_MODE, &val); ++ if (ret) ++ goto error; ++ deb_info("%s: IR mode:%d\n", __func__, val); ++ ++ /* TS mode - one or two receivers */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_TS_MODE, &val); ++ if (ret) ++ goto error; ++ af9035_config.dual_mode = val; ++ deb_info("%s: TS mode:%d\n", __func__, af9035_config.dual_mode); ++ ++ /* Set adapter0 buffer size according to USB port speed, adapter1 buffer ++ size can be static because it is enabled only USB2.0 */ ++ for (i = 0; i < af9035_properties_count; i++) { ++ /* USB1.1 set smaller buffersize and disable 2nd adapter */ ++ if (udev->speed == USB_SPEED_FULL) { ++#ifdef V4L2_REFACTORED_MFE_CODE ++ af9035_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize ++#else ++ af9035_properties[i].adapter[0].stream.u.bulk.buffersize ++#endif ++ = TS_USB11_MAX_PACKET_SIZE; ++ /* disable 2nd adapter because we don't have ++ PID-filters */ ++ af9035_config.dual_mode = 0; ++ } else { ++#ifdef V4L2_REFACTORED_MFE_CODE ++ af9035_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize ++#else ++ af9035_properties[i].adapter[0].stream.u.bulk.buffersize ++#endif ++ = TS_USB20_FRAME_SIZE; ++ } ++ } ++ ++ if (af9035_config.dual_mode) { ++ /* read 2nd demodulator I2C address */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_2WIREADDR, &val); ++ if (ret) ++ goto error; ++ deb_info("%s: 2nd demod I2C addr:%02x\n", __func__, val); ++ af9035_af9033_config[1].demod_address = val; ++ /* enable 2nd adapter */ ++ for (i = 0; i < af9035_properties_count; i++) ++ af9035_properties[i].num_adapters = 2; ++ } else { ++ /* disable 2nd adapter */ ++ for (i = 0; i < af9035_properties_count; i++) ++ af9035_properties[i].num_adapters = 1; ++ } ++ ++ for (i = 0; i < af9035_properties[0].num_adapters; i++) { ++ if (i == 1) ++ offset = EEPROM_SHIFT; ++ ++ /* saw BW */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_SAW_BW1 + offset, ++ &val); ++ if (ret) ++ goto error; ++ deb_info("%s: [%d] saw BW:%d\n", __func__, i, val); ++ ++ /* xtal */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_XTAL1 + offset, &val); ++ if (ret) ++ goto error; ++ deb_info("%s: [%d] xtal:%d\n", __func__, i, val); ++ ++ /* RF spectrum inversion */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_SPECINV1 + offset, ++ &val); ++ if (ret) ++ goto error; ++ deb_info("%s: [%d] RF spectrum inv:%d\n", __func__, i, val); ++ ++ /* IF */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_IFFREQH1 + offset, ++ &val); ++ if (ret) ++ goto error; ++ af9035_af9033_config[i].if_freq = val << 8; ++ ret = af9035_read_eeprom_reg(udev, EEPROM_IFFREQL1 + offset, ++ &val); ++ if (ret) ++ goto error; ++ af9035_af9033_config[i].if_freq += val; ++ deb_info("%s: [%d] IF:%d\n", __func__, i, ++ af9035_af9033_config[0].if_freq); ++ ++ /* MT2060 IF1 */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_IF1H1 + offset, &val); ++ if (ret) ++ goto error; ++ af9035_config.mt2060_if1[i] = val << 8; ++ ret = af9035_read_eeprom_reg(udev, EEPROM_IF1L1 + offset, &val); ++ if (ret) ++ goto error; ++ af9035_config.mt2060_if1[i] += val; ++ deb_info("%s: [%d] MT2060 IF1:%d\n", __func__, i, ++ af9035_config.mt2060_if1[i]); ++ ++ /* tuner */ ++ ret = af9035_read_eeprom_reg(udev, EEPROM_TUNER_ID1 + offset, ++ &val); ++ if (ret) ++ goto error; ++ switch (val) { ++ case AF9033_TUNER_TUA9001: ++ af9035_af9033_config[i].rf_spec_inv = 1; ++ break; ++ case AF9033_TUNER_MXL5007t: ++ af9035_af9033_config[i].rf_spec_inv = 1; ++ break; ++ case AF9033_TUNER_TDA18218: ++ af9035_af9033_config[i].rf_spec_inv = 1; ++ break; ++ default: ++ warn("tuner ID:%d not supported, please report!", val); ++ return -ENODEV; ++ }; ++ ++ af9035_af9033_config[i].tuner = val; ++ deb_info("%s: [%d] tuner ID:%d\n", __func__, i, val); ++ } ++ ++error: ++ if (ret) ++ err("eeprom read failed:%d", ret); ++ ++ if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_AVERMEDIA) { ++ switch (le16_to_cpu(udev->descriptor.idProduct)) { ++ case USB_PID_AVERMEDIA_A825: ++ case USB_PID_AVERMEDIA_A835: ++ case USB_PID_AVERMEDIA_B835: ++ case USB_PID_AVERMEDIA_A333: ++ case USB_PID_AVERMEDIA_B867: ++ case USB_PID_AVERMEDIA_1867: ++ case USB_PID_AVERMEDIA_0337: ++ case USB_PID_AVERMEDIA_A867: ++ case USB_PID_AVERMEDIA_0867: ++ case USB_PID_AVERMEDIA_F337: ++ case USB_PID_AVERMEDIA_3867: ++ deb_info("%s: AverMedia A825/A835/B835/A333/A867: overriding config\n", __func__); ++ /* set correct IF */ ++ for (i = 0; i < af9035_properties[0].num_adapters; i++) { ++ af9035_af9033_config[i].if_freq = 4570000; ++ } ++ break; ++ default: ++ break; ++ } ++ } ++ ++ return ret; ++} ++ ++static int af9035_aux_init(struct usb_device *d) ++{ ++ int ret; ++ u8 tmp, i; ++ ++ /* get demod crystal and ADC freqs */ ++ ret = af9035_read_reg_bits_bis(d, LINK, ++ r_io_mux_pwron_clk_strap, io_mux_pwron_clk_strap_pos, ++ io_mux_pwron_clk_strap_len, &tmp); ++ if (ret) ++ goto error; ++ ++ for (i = 0; i < af9035_properties[0].num_adapters; i++) { ++ af9035_af9033_config[i].crystal_clock = ++ clock_table[tmp].crystal; ++ af9035_af9033_config[i].adc_clock = ++ clock_table[tmp].adc; ++ } ++ ++ /* write 2nd demod I2C address to device */ ++ ret = af9035_write_reg_bis(d, LINK, 0x417f, ++ af9035_af9033_config[1].demod_address); ++ if (ret) ++ goto error; ++ ++ /* enable / disable clock out for 2nd demod for power saving */ ++ ret = af9035_write_reg_bis(d, LINK, p_reg_top_clkoen, ++ af9035_config.dual_mode); ++ ++error: ++ return ret; ++} ++ ++static int af9035_identify_state(struct usb_device *udev, ++ struct dvb_usb_device_properties *props, ++ struct dvb_usb_device_description **desc, ++ int *cold) ++{ ++ int ret; ++ u8 wbuf[1] = {1}; ++ u8 rbuf[4]; ++ struct af9035_req req = {CMD_QUERYINFO, 0, sizeof(wbuf), wbuf, ++ sizeof(rbuf), rbuf}; ++ ++ ret = af9035_rw_udev(udev, &req); ++ if (ret) ++ return ret; ++ ++ deb_info("%s: reply:%02x %02x %02x %02x\n", __func__, ++ rbuf[0], rbuf[1], rbuf[2], rbuf[3]); ++ if (rbuf[0] || rbuf[1] || rbuf[2] || rbuf[3]) ++ *cold = 0; ++ else ++ *cold = 1; ++ ++ return ret; ++} ++ ++static int af9035_af9033_frontend_attach(struct dvb_usb_adapter *adap) ++{ ++ /* attach demodulator */ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ adap->fe_adap[0].fe = dvb_attach(af9033_attach, &af9035_af9033_config[adap->id], ++ &adap->dev->i2c_adap); ++ ++ return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; ++#else ++ adap->fe = dvb_attach(af9033_attach, &af9035_af9033_config[adap->id], ++ &adap->dev->i2c_adap); ++ ++ return adap->fe == NULL ? -ENODEV : 0; ++#endif ++} ++ ++static struct tua9001_config af9035_tua9001_config[] = { ++ { ++ .i2c_address = 0xc0, ++ } , { ++ .i2c_address = 0xc1, ++ } ++}; ++ ++static struct mxl5007t_config af9035_mxl5007t_config[] = { ++ { ++ .xtal_freq_hz = MxL_XTAL_24_MHZ, ++ .if_freq_hz = MxL_IF_4_57_MHZ, ++ .invert_if = 0, ++ .loop_thru_enable = 0, ++ .clk_out_enable = 0, ++ .clk_out_amp = MxL_CLKOUT_AMP_0_94V, ++ } , { ++ .xtal_freq_hz = MxL_XTAL_24_MHZ, ++ .if_freq_hz = MxL_IF_4_57_MHZ, ++ .invert_if = 0, ++ .loop_thru_enable = 3, ++ .clk_out_enable = 1, ++ .clk_out_amp = MxL_CLKOUT_AMP_0_94V, ++ } ++}; ++ ++static struct tda18218_config af9035_tda18218_config = { ++ .i2c_address = 0xc0, ++ .i2c_wr_max = 17, ++}; ++ ++static int af9035_tuner_attach(struct dvb_usb_adapter *adap) ++{ ++ int ret; ++ deb_info("%s: \n", __func__); ++ ++ switch (af9035_af9033_config[adap->id].tuner) { ++ case AF9033_TUNER_TUA9001: ++ af9035_af9033_config[adap->id].tuner_address = af9035_tua9001_config[adap->id].i2c_address; ++ af9035_af9033_config[adap->id].tuner_address += adap->id; ++ if (adap->id == 0) { ++ /* gpiot3 TUA9001 RESETN ++ gpiot2 TUA9001 RXEN */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot2_en, reg_top_gpiot2_en_pos, ++ reg_top_gpiot2_en_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot2_on, reg_top_gpiot2_on_pos, ++ reg_top_gpiot2_on_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot3_en, reg_top_gpiot3_en_pos, ++ reg_top_gpiot3_en_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot3_on, reg_top_gpiot3_on_pos, ++ reg_top_gpiot3_on_len, 1); ++ ++ /* reset tuner */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o, ++ reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 0); ++ msleep(1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o, ++ reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 1); ++ ++ /* activate tuner - TODO: do that like I2C gate control */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot2_o, ++ reg_top_gpiot2_o_pos, reg_top_gpiot2_o_len, 1); ++ } ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ ret = dvb_attach(tua9001_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, ++#else ++ ret = dvb_attach(tua9001_attach, adap->fe, &adap->dev->i2c_adap, ++#endif ++ &af9035_tua9001_config[adap->id]) == NULL ? -ENODEV : 0; ++ ++ break; ++ case AF9033_TUNER_MXL5007t: ++ af9035_af9033_config[adap->id].tuner_address = 0xc0; ++ af9035_af9033_config[adap->id].tuner_address += adap->id; ++ if (adap->id == 0) { ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh12_en, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh12_on, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh12_o, ++ 0); ++ ++ msleep(30); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh12_o, ++ 1); ++ ++ msleep(300); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh4_en, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh4_on, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh4_o, ++ 0); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh3_en, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh3_on, ++ 1); ++ ++ ret = af9035_write_reg(adap->dev, LINK, ++ p_reg_top_gpioh3_o, ++ 1); ++ } ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ ret = dvb_attach(mxl5007t_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, ++#else ++ ret = dvb_attach(mxl5007t_attach, adap->fe, &adap->dev->i2c_adap, ++#endif ++ af9035_af9033_config[adap->id].tuner_address, ++ &af9035_mxl5007t_config[adap->id]) == NULL ? -ENODEV : 0; ++ ++ break; ++ case AF9033_TUNER_TDA18218: ++ af9035_af9033_config[adap->id].tuner_address = af9035_tua9001_config[adap->id].i2c_address; ++ af9035_af9033_config[adap->id].tuner_address += adap->id; ++ if (adap->id == 0) { ++ /* gpiot3 TUA9001 RESETN ++ gpiot2 TUA9001 RXEN */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot2_en, reg_top_gpiot2_en_pos, ++ reg_top_gpiot2_en_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot2_on, reg_top_gpiot2_on_pos, ++ reg_top_gpiot2_on_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot3_en, reg_top_gpiot3_en_pos, ++ reg_top_gpiot3_en_len, 1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, ++ p_reg_top_gpiot3_on, reg_top_gpiot3_on_pos, ++ reg_top_gpiot3_on_len, 1); ++ ++ /* reset tuner */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o, ++ reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 0); ++ msleep(1); ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot3_o, ++ reg_top_gpiot3_o_pos, reg_top_gpiot3_o_len, 1); ++ ++ /* activate tuner - TODO: do that like I2C gate control */ ++ ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot2_o, ++ reg_top_gpiot2_o_pos, reg_top_gpiot2_o_len, 1); ++ } ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ ret = dvb_attach(tda18218_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, ++#else ++ ret = dvb_attach(tda18218_attach, adap->fe, &adap->dev->i2c_adap, ++#endif ++ &af9035_tda18218_config) == NULL ? -ENODEV : 0; ++ break; ++ default: ++ ret = -ENODEV; ++ err("unknown tuner ID:%d", ++ af9035_af9033_config[adap->id].tuner); ++ } ++ ++ return ret; ++} ++ ++enum af9035_usb_table_entry { ++ AFATECH_AF9035_1000, ++ AFATECH_AF9035_1001, ++ AFATECH_AF9035_1002, ++ AFATECH_AF9035_1003, ++ AFATECH_AF9035_9035, ++ TERRATEC_CINERGY_T_STICK, ++ TERRATEC_CINERGY_T_STICK_2, ++ AVERMEDIA_TWINSTAR, ++ AVERMEDIA_VOLAR_HD, ++ AVERMEDIA_VOLAR_HD_PRO, ++#ifdef ENABLE_A867_DEVICES ++ AVERMEDIA_A333, ++ AVERMEDIA_B867, ++ AVERMEDIA_1867, ++ AVERMEDIA_0337, ++ AVERMEDIA_A867, ++ AVERMEDIA_0867, ++ AVERMEDIA_F337, ++ AVERMEDIA_3867, ++#endif ++}; ++ ++static struct usb_device_id af9035_usb_table[] = { ++ [AFATECH_AF9035_1000] = {USB_DEVICE(USB_VID_AFATECH, ++ USB_PID_AFATECH_AF9035_1000)}, ++ [AFATECH_AF9035_1001] = {USB_DEVICE(USB_VID_AFATECH, ++ USB_PID_AFATECH_AF9035_1001)}, ++ [AFATECH_AF9035_1002] = {USB_DEVICE(USB_VID_AFATECH, ++ USB_PID_AFATECH_AF9035_1002)}, ++ [AFATECH_AF9035_1003] = {USB_DEVICE(USB_VID_AFATECH, ++ USB_PID_AFATECH_AF9035_1003)}, ++ [AFATECH_AF9035_9035] = {USB_DEVICE(USB_VID_AFATECH, ++ USB_PID_AFATECH_AF9035_9035)}, ++ [TERRATEC_CINERGY_T_STICK] = {USB_DEVICE(USB_VID_TERRATEC, ++ USB_PID_TERRATEC_CINERGY_T_STICK)}, ++ [TERRATEC_CINERGY_T_STICK_2] = {USB_DEVICE(USB_VID_TERRATEC, ++ USB_PID_TERRATEC_CINERGY_T_STICK_2)}, ++ [AVERMEDIA_TWINSTAR] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_A825)}, ++ [AVERMEDIA_VOLAR_HD] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_A835)}, ++ [AVERMEDIA_VOLAR_HD_PRO] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_B835)}, ++#ifdef ENABLE_A867_DEVICES ++ [AVERMEDIA_A333] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_A333)}, ++ [AVERMEDIA_B867] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_B867)}, ++ [AVERMEDIA_1867] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_1867)}, ++ [AVERMEDIA_0337] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_0337)}, ++ [AVERMEDIA_A867] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_A867)}, ++ [AVERMEDIA_0867] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_0867)}, ++ [AVERMEDIA_F337] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_F337)}, ++ [AVERMEDIA_3867] = {USB_DEVICE(USB_VID_AVERMEDIA, ++ USB_PID_AVERMEDIA_3867)}, ++#endif ++ { }, ++}; ++ ++MODULE_DEVICE_TABLE(usb, af9035_usb_table); ++ ++static struct dvb_usb_device_properties af9035_properties[] = { ++ { ++ .caps = DVB_USB_IS_AN_I2C_ADAPTER, ++ ++ .usb_ctrl = DEVICE_SPECIFIC, ++ .download_firmware = af9035_download_firmware, ++ .firmware = "dvb-usb-af9035-01.fw", ++ .no_reconnect = 1, ++ ++ .size_of_priv = 0, ++ ++ .adapter = { ++ { ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ .frontend_attach = ++ af9035_af9033_frontend_attach, ++ .tuner_attach = af9035_tuner_attach, ++ .stream = { ++ .type = USB_BULK, ++ .count = 4, ++ .endpoint = 0x84, ++ }, ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ }, ++ { ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ .frontend_attach = ++ af9035_af9033_frontend_attach, ++ .tuner_attach = af9035_tuner_attach, ++ .stream = { ++ .type = USB_BULK, ++ .count = 4, ++ .endpoint = 0x85, ++ .u = { ++ .bulk = { ++ .buffersize = ++ TS_USB20_FRAME_SIZE, ++ } ++ } ++ }, ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ } ++ }, ++ ++ .identify_state = af9035_identify_state, ++ ++ .i2c_algo = &af9035_i2c_algo, ++ ++#ifdef ENABLE_A867_DEVICES ++ .num_device_descs = 6, ++#else ++ .num_device_descs = 4, ++#endif ++ .devices = { ++ { ++ .name = "Afatech AF9035 DVB-T USB2.0 stick", ++ .cold_ids = {&af9035_usb_table[AFATECH_AF9035_1000], ++ &af9035_usb_table[AFATECH_AF9035_1001], ++ &af9035_usb_table[AFATECH_AF9035_1002], ++ &af9035_usb_table[AFATECH_AF9035_1003], ++ &af9035_usb_table[AFATECH_AF9035_9035], NULL}, ++ .warm_ids = {NULL}, ++ }, ++ { ++ .name = "TerraTec Cinergy T Stick", ++ .cold_ids = {&af9035_usb_table[TERRATEC_CINERGY_T_STICK], ++ &af9035_usb_table[TERRATEC_CINERGY_T_STICK_2], NULL}, ++ .warm_ids = {NULL}, ++ }, ++ { ++ .name = "Avermedia TwinStar", ++ .cold_ids = {&af9035_usb_table[AVERMEDIA_TWINSTAR], NULL}, ++ .warm_ids = {NULL}, ++ }, ++ { ++ .name = "Avermedia AverTV Volar HD & HD PRO (A835)", ++ .cold_ids = {&af9035_usb_table[AVERMEDIA_VOLAR_HD], ++ &af9035_usb_table[AVERMEDIA_VOLAR_HD_PRO], NULL}, ++ .warm_ids = {NULL}, ++ }, ++#ifdef ENABLE_A867_DEVICES ++ { ++ .name = "Avermedia A333", ++ .cold_ids = {&af9035_usb_table[AVERMEDIA_A333], ++ &af9035_usb_table[AVERMEDIA_B867], NULL}, ++ .warm_ids = {NULL}, ++ }, ++ { ++ .name = "Avermedia A867", ++ .cold_ids = {&af9035_usb_table[AVERMEDIA_1867], ++ &af9035_usb_table[AVERMEDIA_0337], ++ &af9035_usb_table[AVERMEDIA_A867], ++ &af9035_usb_table[AVERMEDIA_0867], ++ &af9035_usb_table[AVERMEDIA_F337], ++ &af9035_usb_table[AVERMEDIA_3867], NULL}, ++ .warm_ids = {NULL}, ++ }, ++#endif ++ } ++ }, ++}; ++ ++static int af9035_usb_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ int ret = 0; ++ struct dvb_usb_device *d = NULL; ++ struct usb_device *udev = interface_to_usbdev(intf); ++ u8 i; ++ ++ deb_info("%s: interface:%d\n", __func__, ++ intf->cur_altsetting->desc.bInterfaceNumber); ++ ++ /* interface 0 is used by DVB-T receiver and ++ interface 1 is for remote controller (HID) */ ++ if (intf->cur_altsetting->desc.bInterfaceNumber == 0) { ++ ret = af9035_read_config(udev); ++ if (ret) ++ return ret; ++ ++ ret = af9035_aux_init(udev); ++ if (ret) ++ return ret; ++ ++ for (i = 0; i < af9035_properties_count; i++) { ++ ret = dvb_usb_device_init(intf, &af9035_properties[i], ++ THIS_MODULE, &d, adapter_nr); ++ if (!ret) ++ break; ++ if (ret != -ENODEV) ++ return ret; ++ } ++ if (ret) ++ return ret; ++ ++ if (d) ++ ret = af9035_init(d); ++ } ++ ++ return ret; ++} ++ ++/* usb specific object needed to register this driver with the usb subsystem */ ++static struct usb_driver af9035_usb_driver = { ++ .name = "dvb_usb_af9035", ++ .probe = af9035_usb_probe, ++ .disconnect = dvb_usb_device_exit, ++ .id_table = af9035_usb_table, ++}; ++ ++/* module stuff */ ++static int __init af9035_usb_module_init(void) ++{ ++ int ret; ++ ret = usb_register(&af9035_usb_driver); ++ if (ret) ++ err("module init failed:%d", ret); ++ ++ return ret; ++} ++ ++static void __exit af9035_usb_module_exit(void) ++{ ++ /* deregister this driver from the USB subsystem */ ++ usb_deregister(&af9035_usb_driver); ++} ++ ++module_init(af9035_usb_module_init); ++module_exit(af9035_usb_module_exit); ++ ++MODULE_AUTHOR("Antti Palosaari "); ++MODULE_DESCRIPTION("Afatech AF9035 driver"); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/media/dvb/dvb-usb/af9035.h b/drivers/media/dvb/dvb-usb/af9035.h +new file mode 100644 +index 0000000..7c0c971 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/af9035.h +@@ -0,0 +1,187 @@ ++/* ++ * Afatech AF9035 DVB USB driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#ifndef AF9035_H ++#define AF9035_H ++#include "af9033_reg.h" ++ ++#define DVB_USB_LOG_PREFIX "af9035" ++#include "dvb-usb.h" ++ ++#define deb_info(args...) dprintk(dvb_usb_af9035_debug, 0x01, args) ++#define deb_rc(args...) dprintk(dvb_usb_af9035_debug, 0x02, args) ++#define deb_xfer(args...) dprintk(dvb_usb_af9035_debug, 0x04, args) ++#define deb_reg(args...) dprintk(dvb_usb_af9035_debug, 0x08, args) ++#define deb_i2c(args...) dprintk(dvb_usb_af9035_debug, 0x10, args) ++#define deb_fw(args...) dprintk(dvb_usb_af9035_debug, 0x20, args) ++ ++#define AF9035_USB_TIMEOUT 2000 ++ ++#define LINK 0x00 ++#define OFDM 0x80 ++ ++#define TS_MODE_SINGLE 0 ++#define TS_MODE_DCA_PIP 1 ++#define TS_MODE_DCA 2 /* any other value than 0, 1, 3 (?) */ ++#define TS_MODE_PIP 3 ++ ++#define TS_PACKET_SIZE 188 ++#define TS_USB20_PACKET_COUNT 348 ++#define TS_USB20_FRAME_SIZE (TS_PACKET_SIZE*TS_USB20_PACKET_COUNT) ++#define TS_USB11_PACKET_COUNT 21 ++#define TS_USB11_FRAME_SIZE (TS_PACKET_SIZE*TS_USB11_PACKET_COUNT) ++#define TS_USB20_MAX_PACKET_SIZE 512 ++#define TS_USB11_MAX_PACKET_SIZE 64 ++ ++/* EEPROM locations */ ++#define GANY_ONLY 0x42f5 ++#define EEPROM_FLB_OFS 8 ++#define EEPROM_BASE_ADDR (GANY_ONLY + EEPROM_FLB_OFS) ++#define EEPROM_SHIFT (0x10) ++ ++#define EEPROM_IR_MODE (EEPROM_BASE_ADDR+0x10) /* 00:disabled, 01:HID */ ++#define EEPROM_SELSUSPEND (EEPROM_BASE_ADDR+0x28) /* selective suspend mode */ ++#define EEPROM_TS_MODE (EEPROM_BASE_ADDR+0x28+1) /* 0:one ts, 1:dual ts */ ++#define EEPROM_2WIREADDR (EEPROM_BASE_ADDR+0x28+2) /* 2nd demod I2C addr */ ++#define EEPROM_SUSPEND (EEPROM_BASE_ADDR+0x28+3) /* suspend mode */ ++#define EEPROM_IR_TYPE (EEPROM_BASE_ADDR+0x28+4) /* 0:NEC, 1:RC6 */ ++ ++#define EEPROM_SAW_BW1 (EEPROM_BASE_ADDR+0x28+5) ++#define EEPROM_XTAL1 (EEPROM_BASE_ADDR+0x28+6) ++#define EEPROM_SPECINV1 (EEPROM_BASE_ADDR+0x28+7) ++#define EEPROM_TUNER_ID1 (EEPROM_BASE_ADDR+0x30+4) ++#define EEPROM_IFFREQL1 (EEPROM_BASE_ADDR+0x30) ++#define EEPROM_IFFREQH1 (EEPROM_BASE_ADDR+0x30+1) ++#define EEPROM_IF1L1 (EEPROM_BASE_ADDR+0x30+2) ++#define EEPROM_IF1H1 (EEPROM_BASE_ADDR+0x30+3) ++ ++#define EEPROM_SAW_BW2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x28+5) ++#define EEPROM_XTAL2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x28+6) ++#define EEPROM_SPECINV2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x28+7) ++#define EEPROM_TUNER_ID2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x30+4) ++#define EEPROM_IFFREQL2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x30) ++#define EEPROM_IFFREQH2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x30+1) ++#define EEPROM_IF1L2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x30+2) ++#define EEPROM_IF1H2 (EEPROM_BASE_ADDR+EEPROM_SHIFT+0x30+3) ++ ++struct af9035_clock { ++ u32 crystal; ++ u32 adc; ++}; ++ ++static struct af9035_clock clock_table[] = { ++ {20480000, 20480000}, /* FPGA */ ++ {16384000, 20480000}, /* 16.38MHz */ ++ {20480000, 20480000}, /* 20.48MHz */ ++ {36000000, 20250000}, /* 36.00MHz */ ++ {30000000, 20156250}, /* 30.00MHz */ ++ {26000000, 20583333}, /* 26.00MHz */ ++ {28000000, 20416667}, /* 28.00MHz */ ++ {32000000, 20500000}, /* 32.00MHz */ ++ {34000000, 20187500}, /* 34.00MHz */ ++ {24000000, 20500000}, /* 24.00MHz */ ++ {22000000, 20625000}, /* 22.00MHz */ ++ {12000000, 20250000}, /* 12.00MHz */ ++}; ++ ++struct af9035_req { ++ u8 cmd; ++ u8 mbox; ++ u8 wlen; ++ u8 *wbuf; ++ u8 rlen; ++ u8 *rbuf; ++}; ++ ++/* USB commands */ ++#define CMD_REG_DEMOD_READ 0x00 ++#define CMD_REG_DEMOD_WRITE 0x01 ++#define CMD_REG_TUNER_READ 0x02 ++#define CMD_REG_TUNER_WRITE 0x03 ++#define CMD_REG_EEPROM_READ 0x04 ++#define CMD_REG_EEPROM_WRITE 0x05 ++#define CMD_VAR_READ 0x08 ++#define CMD_VAR_WRITE 0x09 ++ ++#define CMD_DATA_READ 0x06 ++ ++#define CMD_PLATFORM_GET 0x0A ++#define CMD_PLATFORM_SET 0x0B ++#define CMD_IP_CACHE 0x0D ++#define CMD_IP_ADD 0x0E ++#define CMD_IP_REMOVE 0x0F ++#define CMD_PID_ADD 0x10 ++#define CMD_PID_REMOVE 0x11 ++/* get SI/PSI table for specific PID "once" */ ++#define CMD_SIPSI_GET 0x12 ++#define CMD_SIPSI_MPE_RESET 0x13 ++#define CMD_H_PID_ADD 0x15 ++#define CMD_H_PID_REMOVE 0x16 ++#define CMD_ABORT 0x17 ++#define CMD_IR_GET 0x18 ++#define CMD_IR_SET 0x19 ++#define CMD_FW_DOWNLOAD_BEGIN 0x24 ++#define CMD_FW_DOWNLOAD 0x21 ++#define CMD_FW_DOWNLOAD_END 0x25 ++#define CMD_QUERYINFO 0x22 ++#define CMD_BOOT 0x23 ++#define CMD_REBOOT 0x23 ++#define CMD_RUN_CODE 0x26 ++#define CMD_SCATTER_READ 0x28 ++#define CMD_SCATTER_WRITE 0x29 ++#define CMD_GENERIC_READ 0x2A ++#define CMD_GENERIC_WRITE 0x2B ++ ++#define CMD_SERVICES_GET 0x83 ++#define CMD_COMPONENT_ADD 0x86 ++#define CMD_COMPONENT_REMOVE 0x87 ++#define CMD_FIG_ADD 0x88 ++#define CMD_FIG_REMOVE 0x89 ++ ++/* this Linux driver does not implement usage of "short command" at all */ ++#define CMD_SHORT_REG_DEMOD_READ 0x02 ++#define CMD_SHORT_REG_DEMOD_WRITE 0X03 ++#define CMD_SHORT_REG_TUNER_READ 0x04 ++#define CMD_SHORT_REG_TUNER_WRITE 0X05 ++ ++struct af9035_config { ++ u8 dual_mode:1; ++ u16 mt2060_if1[2]; ++}; ++ ++struct af9035_segment { ++#define SEGMENT_FW_DOWNLOAD 0 ++#define SEGMENT_ROM_COPY 1 ++#define SEGMENT_DIRECT_CMD 2 ++ u8 type; ++ u32 len; ++}; ++ ++struct af9035_firmware_header { ++#define SEGMENT_MAX_COUNT 50 ++ u8 segment_count; ++ struct af9035_segment segment[SEGMENT_MAX_COUNT]; ++}; ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +index d390dda..9df8f28 100644 +--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h ++++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +@@ -75,6 +75,11 @@ + #define USB_PID_AFATECH_AF9005 0x9020 + #define USB_PID_AFATECH_AF9015_9015 0x9015 + #define USB_PID_AFATECH_AF9015_9016 0x9016 ++#define USB_PID_AFATECH_AF9035_1000 0x1000 ++#define USB_PID_AFATECH_AF9035_1001 0x1001 ++#define USB_PID_AFATECH_AF9035_1002 0x1002 ++#define USB_PID_AFATECH_AF9035_1003 0x1003 ++#define USB_PID_AFATECH_AF9035_9035 0x9035 + #define USB_PID_TREKSTOR_DVBT 0x901b + #define USB_VID_ALINK_DTU 0xf170 + #define USB_PID_ANSONIC_DVBT_USB 0x6000 +@@ -217,6 +222,17 @@ + #define USB_PID_AVERMEDIA_A850T 0x850b + #define USB_PID_AVERMEDIA_A805 0xa805 + #define USB_PID_AVERMEDIA_A815M 0x815a ++#define USB_PID_AVERMEDIA_A825 0x0825 ++#define USB_PID_AVERMEDIA_A835 0xa835 ++#define USB_PID_AVERMEDIA_B835 0xb835 ++#define USB_PID_AVERMEDIA_A333 0xa333 ++#define USB_PID_AVERMEDIA_B867 0xb867 ++#define USB_PID_AVERMEDIA_1867 0x1867 ++#define USB_PID_AVERMEDIA_0337 0x0337 ++#define USB_PID_AVERMEDIA_A867 0xa867 ++#define USB_PID_AVERMEDIA_0867 0x0867 ++#define USB_PID_AVERMEDIA_F337 0xf337 ++#define USB_PID_AVERMEDIA_3867 0x3867 + #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 + #define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d + #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a +@@ -226,6 +242,8 @@ + #define USB_PID_TERRATEC_CINERGY_T_EXPRESS 0x0062 + #define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078 + #define USB_PID_TERRATEC_CINERGY_T_XXS_2 0x00ab ++#define USB_PID_TERRATEC_CINERGY_T_STICK 0x0093 ++#define USB_PID_TERRATEC_CINERGY_T_STICK_2 0x00aa + #define USB_PID_TERRATEC_T3 0x10a0 + #define USB_PID_TERRATEC_T5 0x10a1 + #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e +diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig +index ebb5ed7..907afc0 100644 +--- a/drivers/media/dvb/frontends/Kconfig ++++ b/drivers/media/dvb/frontends/Kconfig +@@ -397,6 +397,13 @@ config DVB_AF9013 + help + Say Y when you want to support this frontend. + ++config DVB_AF9033 ++ tristate "Afatech AF9033 demodulator" ++ depends on DVB_CORE && I2C ++ default m ++ help ++ Say Y when you want to support this frontend. ++ + config DVB_EC100 + tristate "E3C EC100" + depends on DVB_CORE && I2C +diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile +index 00a2063..3a2eb97 100644 +--- a/drivers/media/dvb/frontends/Makefile ++++ b/drivers/media/dvb/frontends/Makefile +@@ -73,6 +73,7 @@ obj-$(CONFIG_DVB_LGS8GXX) += lgs8gxx.o + obj-$(CONFIG_DVB_ATBM8830) += atbm8830.o + obj-$(CONFIG_DVB_DUMMY_FE) += dvb_dummy_fe.o + obj-$(CONFIG_DVB_AF9013) += af9013.o ++obj-$(CONFIG_DVB_AF9033) += af9033.o + obj-$(CONFIG_DVB_CX24116) += cx24116.o + obj-$(CONFIG_DVB_SI21XX) += si21xx.o + obj-$(CONFIG_DVB_STV0288) += stv0288.o +diff --git a/drivers/media/dvb/frontends/af9033.c b/drivers/media/dvb/frontends/af9033.c +new file mode 100644 +index 0000000..747931f +--- /dev/null ++++ b/drivers/media/dvb/frontends/af9033.c +@@ -0,0 +1,1957 @@ ++/* ++ * Afatech AF9033 demodulator driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#include "dvb_frontend.h" ++#include /* for kzalloc/kfree */ ++#include ++#include "af9033_priv.h" ++#include "af9033.h" ++#include "af9033_reg.h" ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 197120)) ++/* all DVB frontend drivers now work directly with the DVBv5 ++ * structure. This warrants that all drivers will be ++ * getting/setting frontend parameters on a consistent way, in ++ * order to avoid copying data from/to the DVBv3 structs ++ * without need. ++ */ ++#define V4L2_ONLY_DVB_V5 ++#endif ++ ++static int af9033_debug; ++module_param_named(debug, af9033_debug, int, 0644); ++MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); ++static int af9033_snrdb; ++module_param_named(snrdb, af9033_snrdb, int, 0644); ++MODULE_PARM_DESC(snrdb, "Turn on/off SNR output as dBx10 (default:off)."); ++ ++struct af9033_state { ++ struct i2c_adapter *i2c; ++ struct dvb_frontend frontend; ++ struct af9033_config config; ++ ++ u16 signal_strength; ++ u32 ber; ++ u32 ucblocks; ++ u16 snr; ++ u32 frequency; ++ unsigned long next_statistics_check; ++}; ++ ++static u8 regmask[8] = {0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; ++ ++/* write multiple registers */ ++static int af9033_write_regs(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 *val, u8 len) ++{ ++ u8 buf[3+len]; ++ struct i2c_msg msg = { ++ .addr = state->config.demod_address, ++ .flags = 0, ++ .len = sizeof(buf), ++ .buf = buf }; ++ ++ buf[0] = mbox; ++ buf[1] = reg >> 8; ++ buf[2] = reg & 0xff; ++ memcpy(&buf[3], val, len); ++ ++ if (i2c_transfer(state->i2c, &msg, 1) != 1) { ++ warn("I2C write failed reg:%04x len:%d", reg, len); ++ return -EREMOTEIO; ++ } ++ return 0; ++} ++ ++/* read multiple registers */ ++static int af9033_read_regs(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 *val, u8 len) ++{ ++ u8 obuf[3] = {mbox, reg >> 8, reg & 0xff}; ++ struct i2c_msg msg[2] = { ++ { ++ .addr = state->config.demod_address, ++ .flags = 0, ++ .len = sizeof(obuf), ++ .buf = obuf ++ }, { ++ .addr = state->config.demod_address, ++ .flags = I2C_M_RD, ++ .len = len, ++ .buf = val ++ } ++ }; ++ ++ if (i2c_transfer(state->i2c, msg, 2) != 2) { ++ warn("I2C read failed reg:%04x", reg); ++ return -EREMOTEIO; ++ } ++ return 0; ++} ++ ++/* write single register */ ++static int af9033_write_reg(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 val) ++{ ++ return af9033_write_regs(state, mbox, reg, &val, 1); ++} ++ ++/* read single register */ ++static int af9033_read_reg(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 *val) ++{ ++ return af9033_read_regs(state, mbox, reg, val, 1); ++} ++ ++/* write single register bits */ ++static int af9033_write_reg_bits(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 pos, u8 len, u8 val) ++{ ++ int ret; ++ u8 tmp, mask; ++ ++ ret = af9033_read_reg(state, mbox, reg, &tmp); ++ if (ret) ++ return ret; ++ ++ mask = regmask[len - 1] << pos; ++ tmp = (tmp & ~mask) | ((val << pos) & mask); ++ ++ return af9033_write_reg(state, mbox, reg, tmp); ++} ++ ++/* read single register bits */ ++static int af9033_read_reg_bits(struct af9033_state *state, u8 mbox, u16 reg, ++ u8 pos, u8 len, u8 *val) ++{ ++ int ret; ++ u8 tmp; ++ ++ ret = af9033_read_reg(state, mbox, reg, &tmp); ++ if (ret) ++ return ret; ++ ++ *val = (tmp >> pos) & regmask[len - 1]; ++ return 0; ++} ++ ++static u32 af913_div(u32 a, u32 b, u32 x) ++{ ++ u32 r = 0, c = 0, i; ++ deb_info("%s: a:%d b:%d x:%d\n", __func__, a, b, x); ++ ++ if (a > b) { ++ c = a / b; ++ a = a - c * b; ++ } ++ ++ for (i = 0; i < x; i++) { ++ if (a >= b) { ++ r += 1; ++ a -= b; ++ } ++ a <<= 1; ++ r <<= 1; ++ } ++ r = (c << (u32)x) + r; ++ ++ deb_info("%s: a:%d b:%d x:%d r:%d r:%x\n", __func__, a, b, x, r, r); ++ return r; ++} ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int af9033_set_coeff(struct af9033_state *state, u32 bw) ++#else ++static int af9033_set_coeff(struct af9033_state *state, fe_bandwidth_t bw) ++#endif ++{ ++ int ret = 0; ++ u8 tmp, i = 0; ++ u8 buf[36]; ++ u32 uninitialized_var(coeff1_2048nu); ++ u32 uninitialized_var(coeff1_4096nu); ++ u32 uninitialized_var(coeff1_8191nu); ++ u32 uninitialized_var(coeff1_8192nu); ++ u32 uninitialized_var(coeff1_8193nu); ++ u32 uninitialized_var(coeff2_2k); ++ u32 uninitialized_var(coeff2_4k); ++ u32 uninitialized_var(coeff2_8k); ++ u16 uninitialized_var(bfsfcw_fftindex_ratio); ++ u16 uninitialized_var(fftindex_bfsfcw_ratio); ++ deb_info("%s: adc_clock:%d bw:%d\n", __func__, ++ state->config.adc_clock, bw); ++ ++#ifdef V4L2_ONLY_DVB_V5 ++#define BANDWIDTH_5_MHZ 5000000 ++#define BANDWIDTH_6_MHZ 6000000 ++#define BANDWIDTH_7_MHZ 7000000 ++#define BANDWIDTH_8_MHZ 8000000 ++#endif ++ ++ switch (state->config.adc_clock) { ++ case 20156250: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x02449b5c; ++ coeff1_4096nu = 0x01224dae; ++ coeff1_8191nu = 0x00912b60; ++ coeff1_8192nu = 0x009126d7; ++ coeff1_8193nu = 0x0091224e; ++ coeff2_2k = 0x01224dae; ++ coeff2_4k = 0x009126d7; ++ coeff2_8k = 0x0048936b; ++ bfsfcw_fftindex_ratio = 0x0387; ++ fftindex_bfsfcw_ratio = 0x0122; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02b8ba6e; ++ coeff1_4096nu = 0x015c5d37; ++ coeff1_8191nu = 0x00ae340d; ++ coeff1_8192nu = 0x00ae2e9b; ++ coeff1_8193nu = 0x00ae292a; ++ coeff2_2k = 0x015c5d37; ++ coeff2_4k = 0x00ae2e9b; ++ coeff2_8k = 0x0057174e; ++ bfsfcw_fftindex_ratio = 0x02f1; ++ fftindex_bfsfcw_ratio = 0x015c; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x032cd980; ++ coeff1_4096nu = 0x01966cc0; ++ coeff1_8191nu = 0x00cb3cba; ++ coeff1_8192nu = 0x00cb3660; ++ coeff1_8193nu = 0x00cb3007; ++ coeff2_2k = 0x01966cc0; ++ coeff2_4k = 0x00cb3660; ++ coeff2_8k = 0x00659b30; ++ bfsfcw_fftindex_ratio = 0x0285; ++ fftindex_bfsfcw_ratio = 0x0196; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x03a0f893; ++ coeff1_4096nu = 0x01d07c49; ++ coeff1_8191nu = 0x00e84567; ++ coeff1_8192nu = 0x00e83e25; ++ coeff1_8193nu = 0x00e836e3; ++ coeff2_2k = 0x01d07c49; ++ coeff2_4k = 0x00e83e25; ++ coeff2_8k = 0x00741f12; ++ bfsfcw_fftindex_ratio = 0x0234; ++ fftindex_bfsfcw_ratio = 0x01d0; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20187500: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x0243b546; ++ coeff1_4096nu = 0x0121daa3; ++ coeff1_8191nu = 0x0090f1d9; ++ coeff1_8192nu = 0x0090ed51; ++ coeff1_8193nu = 0x0090e8ca; ++ coeff2_2k = 0x0121daa3; ++ coeff2_4k = 0x0090ed51; ++ coeff2_8k = 0x004876a9; ++ bfsfcw_fftindex_ratio = 0x0388; ++ fftindex_bfsfcw_ratio = 0x0122; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02b7a654; ++ coeff1_4096nu = 0x015bd32a; ++ coeff1_8191nu = 0x00adef04; ++ coeff1_8192nu = 0x00ade995; ++ coeff1_8193nu = 0x00ade426; ++ coeff2_2k = 0x015bd32a; ++ coeff2_4k = 0x00ade995; ++ coeff2_8k = 0x0056f4ca; ++ bfsfcw_fftindex_ratio = 0x02f2; ++ fftindex_bfsfcw_ratio = 0x015c; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x032b9761; ++ coeff1_4096nu = 0x0195cbb1; ++ coeff1_8191nu = 0x00caec30; ++ coeff1_8192nu = 0x00cae5d8; ++ coeff1_8193nu = 0x00cadf81; ++ coeff2_2k = 0x0195cbb1; ++ coeff2_4k = 0x00cae5d8; ++ coeff2_8k = 0x006572ec; ++ bfsfcw_fftindex_ratio = 0x0286; ++ fftindex_bfsfcw_ratio = 0x0196; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x039f886f; ++ coeff1_4096nu = 0x01cfc438; ++ coeff1_8191nu = 0x00e7e95b; ++ coeff1_8192nu = 0x00e7e21c; ++ coeff1_8193nu = 0x00e7dadd; ++ coeff2_2k = 0x01cfc438; ++ coeff2_4k = 0x00e7e21c; ++ coeff2_8k = 0x0073f10e; ++ bfsfcw_fftindex_ratio = 0x0235; ++ fftindex_bfsfcw_ratio = 0x01d0; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20250000: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x0241eb3b; ++ coeff1_4096nu = 0x0120f59e; ++ coeff1_8191nu = 0x00907f53; ++ coeff1_8192nu = 0x00907acf; ++ coeff1_8193nu = 0x0090764b; ++ coeff2_2k = 0x0120f59e; ++ coeff2_4k = 0x00907acf; ++ coeff2_8k = 0x00483d67; ++ bfsfcw_fftindex_ratio = 0x038b; ++ fftindex_bfsfcw_ratio = 0x0121; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02b580ad; ++ coeff1_4096nu = 0x015ac057; ++ coeff1_8191nu = 0x00ad6597; ++ coeff1_8192nu = 0x00ad602b; ++ coeff1_8193nu = 0x00ad5ac1; ++ coeff2_2k = 0x015ac057; ++ coeff2_4k = 0x00ad602b; ++ coeff2_8k = 0x0056b016; ++ bfsfcw_fftindex_ratio = 0x02f4; ++ fftindex_bfsfcw_ratio = 0x015b; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x03291620; ++ coeff1_4096nu = 0x01948b10; ++ coeff1_8191nu = 0x00ca4bda; ++ coeff1_8192nu = 0x00ca4588; ++ coeff1_8193nu = 0x00ca3f36; ++ coeff2_2k = 0x01948b10; ++ coeff2_4k = 0x00ca4588; ++ coeff2_8k = 0x006522c4; ++ bfsfcw_fftindex_ratio = 0x0288; ++ fftindex_bfsfcw_ratio = 0x0195; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x039cab92; ++ coeff1_4096nu = 0x01ce55c9; ++ coeff1_8191nu = 0x00e7321e; ++ coeff1_8192nu = 0x00e72ae4; ++ coeff1_8193nu = 0x00e723ab; ++ coeff2_2k = 0x01ce55c9; ++ coeff2_4k = 0x00e72ae4; ++ coeff2_8k = 0x00739572; ++ bfsfcw_fftindex_ratio = 0x0237; ++ fftindex_bfsfcw_ratio = 0x01ce; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20583333: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x02388f54; ++ coeff1_4096nu = 0x011c47aa; ++ coeff1_8191nu = 0x008e2846; ++ coeff1_8192nu = 0x008e23d5; ++ coeff1_8193nu = 0x008e1f64; ++ coeff2_2k = 0x011c47aa; ++ coeff2_4k = 0x008e23d5; ++ coeff2_8k = 0x004711ea; ++ bfsfcw_fftindex_ratio = 0x039a; ++ fftindex_bfsfcw_ratio = 0x011c; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02aa4598; ++ coeff1_4096nu = 0x015522cc; ++ coeff1_8191nu = 0x00aa96bb; ++ coeff1_8192nu = 0x00aa9166; ++ coeff1_8193nu = 0x00aa8c12; ++ coeff2_2k = 0x015522cc; ++ coeff2_4k = 0x00aa9166; ++ coeff2_8k = 0x005548b3; ++ bfsfcw_fftindex_ratio = 0x0300; ++ fftindex_bfsfcw_ratio = 0x0155; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x031bfbdc; ++ coeff1_4096nu = 0x018dfdee; ++ coeff1_8191nu = 0x00c7052f; ++ coeff1_8192nu = 0x00c6fef7; ++ coeff1_8193nu = 0x00c6f8bf; ++ coeff2_2k = 0x018dfdee; ++ coeff2_4k = 0x00c6fef7; ++ coeff2_8k = 0x00637f7b; ++ bfsfcw_fftindex_ratio = 0x0293; ++ fftindex_bfsfcw_ratio = 0x018e; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x038db21f; ++ coeff1_4096nu = 0x01c6d910; ++ coeff1_8191nu = 0x00e373a3; ++ coeff1_8192nu = 0x00e36c88; ++ coeff1_8193nu = 0x00e3656d; ++ coeff2_2k = 0x01c6d910; ++ coeff2_4k = 0x00e36c88; ++ coeff2_8k = 0x0071b644; ++ bfsfcw_fftindex_ratio = 0x0240; ++ fftindex_bfsfcw_ratio = 0x01c7; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20416667: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x023d337f; ++ coeff1_4096nu = 0x011e99c0; ++ coeff1_8191nu = 0x008f515a; ++ coeff1_8192nu = 0x008f4ce0; ++ coeff1_8193nu = 0x008f4865; ++ coeff2_2k = 0x011e99c0; ++ coeff2_4k = 0x008f4ce0; ++ coeff2_8k = 0x0047a670; ++ bfsfcw_fftindex_ratio = 0x0393; ++ fftindex_bfsfcw_ratio = 0x011f; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02afd765; ++ coeff1_4096nu = 0x0157ebb3; ++ coeff1_8191nu = 0x00abfb39; ++ coeff1_8192nu = 0x00abf5d9; ++ coeff1_8193nu = 0x00abf07a; ++ coeff2_2k = 0x0157ebb3; ++ coeff2_4k = 0x00abf5d9; ++ coeff2_8k = 0x0055faed; ++ bfsfcw_fftindex_ratio = 0x02fa; ++ fftindex_bfsfcw_ratio = 0x0158; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x03227b4b; ++ coeff1_4096nu = 0x01913da6; ++ coeff1_8191nu = 0x00c8a518; ++ coeff1_8192nu = 0x00c89ed3; ++ coeff1_8193nu = 0x00c8988e; ++ coeff2_2k = 0x01913da6; ++ coeff2_4k = 0x00c89ed3; ++ coeff2_8k = 0x00644f69; ++ bfsfcw_fftindex_ratio = 0x028d; ++ fftindex_bfsfcw_ratio = 0x0191; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x03951f32; ++ coeff1_4096nu = 0x01ca8f99; ++ coeff1_8191nu = 0x00e54ef7; ++ coeff1_8192nu = 0x00e547cc; ++ coeff1_8193nu = 0x00e540a2; ++ coeff2_2k = 0x01ca8f99; ++ coeff2_4k = 0x00e547cc; ++ coeff2_8k = 0x0072a3e6; ++ bfsfcw_fftindex_ratio = 0x023c; ++ fftindex_bfsfcw_ratio = 0x01cb; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20480000: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x023b6db7; ++ coeff1_4096nu = 0x011db6db; ++ coeff1_8191nu = 0x008edfe5; ++ coeff1_8192nu = 0x008edb6e; ++ coeff1_8193nu = 0x008ed6f7; ++ coeff2_2k = 0x011db6db; ++ coeff2_4k = 0x008edb6e; ++ coeff2_8k = 0x00476db7; ++ bfsfcw_fftindex_ratio = 0x0396; ++ fftindex_bfsfcw_ratio = 0x011e; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02adb6db; ++ coeff1_4096nu = 0x0156db6e; ++ coeff1_8191nu = 0x00ab7312; ++ coeff1_8192nu = 0x00ab6db7; ++ coeff1_8193nu = 0x00ab685c; ++ coeff2_2k = 0x0156db6e; ++ coeff2_4k = 0x00ab6db7; ++ coeff2_8k = 0x0055b6db; ++ bfsfcw_fftindex_ratio = 0x02fd; ++ fftindex_bfsfcw_ratio = 0x0157; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x03200000; ++ coeff1_4096nu = 0x01900000; ++ coeff1_8191nu = 0x00c80640; ++ coeff1_8192nu = 0x00c80000; ++ coeff1_8193nu = 0x00c7f9c0; ++ coeff2_2k = 0x01900000; ++ coeff2_4k = 0x00c80000; ++ coeff2_8k = 0x00640000; ++ bfsfcw_fftindex_ratio = 0x028f; ++ fftindex_bfsfcw_ratio = 0x0190; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x03924925; ++ coeff1_4096nu = 0x01c92492; ++ coeff1_8191nu = 0x00e4996e; ++ coeff1_8192nu = 0x00e49249; ++ coeff1_8193nu = 0x00e48b25; ++ coeff2_2k = 0x01c92492; ++ coeff2_4k = 0x00e49249; ++ coeff2_8k = 0x00724925; ++ bfsfcw_fftindex_ratio = 0x023d; ++ fftindex_bfsfcw_ratio = 0x01c9; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20500000: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x023adeff; ++ coeff1_4096nu = 0x011d6f80; ++ coeff1_8191nu = 0x008ebc36; ++ coeff1_8192nu = 0x008eb7c0; ++ coeff1_8193nu = 0x008eb34a; ++ coeff2_2k = 0x011d6f80; ++ coeff2_4k = 0x008eb7c0; ++ coeff2_8k = 0x00475be0; ++ bfsfcw_fftindex_ratio = 0x0396; ++ fftindex_bfsfcw_ratio = 0x011d; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02ad0b99; ++ coeff1_4096nu = 0x015685cc; ++ coeff1_8191nu = 0x00ab4840; ++ coeff1_8192nu = 0x00ab42e6; ++ coeff1_8193nu = 0x00ab3d8c; ++ coeff2_2k = 0x015685cc; ++ coeff2_4k = 0x00ab42e6; ++ coeff2_8k = 0x0055a173; ++ bfsfcw_fftindex_ratio = 0x02fd; ++ fftindex_bfsfcw_ratio = 0x0157; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x031f3832; ++ coeff1_4096nu = 0x018f9c19; ++ coeff1_8191nu = 0x00c7d44b; ++ coeff1_8192nu = 0x00c7ce0c; ++ coeff1_8193nu = 0x00c7c7ce; ++ coeff2_2k = 0x018f9c19; ++ coeff2_4k = 0x00c7ce0c; ++ coeff2_8k = 0x0063e706; ++ bfsfcw_fftindex_ratio = 0x0290; ++ fftindex_bfsfcw_ratio = 0x0190; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x039164cb; ++ coeff1_4096nu = 0x01c8b266; ++ coeff1_8191nu = 0x00e46056; ++ coeff1_8192nu = 0x00e45933; ++ coeff1_8193nu = 0x00e45210; ++ coeff2_2k = 0x01c8b266; ++ coeff2_4k = 0x00e45933; ++ coeff2_8k = 0x00722c99; ++ bfsfcw_fftindex_ratio = 0x023e; ++ fftindex_bfsfcw_ratio = 0x01c9; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ case 20625000: ++ switch (bw) { ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ coeff1_2048nu = 0x02376948; ++ coeff1_4096nu = 0x011bb4a4; ++ coeff1_8191nu = 0x008ddec1; ++ coeff1_8192nu = 0x008dda52; ++ coeff1_8193nu = 0x008dd5e3; ++ coeff2_2k = 0x011bb4a4; ++ coeff2_4k = 0x008dda52; ++ coeff2_8k = 0x0046ed29; ++ bfsfcw_fftindex_ratio = 0x039c; ++ fftindex_bfsfcw_ratio = 0x011c; ++ break; ++#endif ++ case BANDWIDTH_6_MHZ: ++ coeff1_2048nu = 0x02a8e4bd; ++ coeff1_4096nu = 0x0154725e; ++ coeff1_8191nu = 0x00aa3e81; ++ coeff1_8192nu = 0x00aa392f; ++ coeff1_8193nu = 0x00aa33de; ++ coeff2_2k = 0x0154725e; ++ coeff2_4k = 0x00aa392f; ++ coeff2_8k = 0x00551c98; ++ bfsfcw_fftindex_ratio = 0x0302; ++ fftindex_bfsfcw_ratio = 0x0154; ++ break; ++ case BANDWIDTH_7_MHZ: ++ coeff1_2048nu = 0x031a6032; ++ coeff1_4096nu = 0x018d3019; ++ coeff1_8191nu = 0x00c69e41; ++ coeff1_8192nu = 0x00c6980c; ++ coeff1_8193nu = 0x00c691d8; ++ coeff2_2k = 0x018d3019; ++ coeff2_4k = 0x00c6980c; ++ coeff2_8k = 0x00634c06; ++ bfsfcw_fftindex_ratio = 0x0294; ++ fftindex_bfsfcw_ratio = 0x018d; ++ break; ++ case BANDWIDTH_8_MHZ: ++ coeff1_2048nu = 0x038bdba6; ++ coeff1_4096nu = 0x01c5edd3; ++ coeff1_8191nu = 0x00e2fe02; ++ coeff1_8192nu = 0x00e2f6ea; ++ coeff1_8193nu = 0x00e2efd2; ++ coeff2_2k = 0x01c5edd3; ++ coeff2_4k = 0x00e2f6ea; ++ coeff2_8k = 0x00717b75; ++ bfsfcw_fftindex_ratio = 0x0242; ++ fftindex_bfsfcw_ratio = 0x01c6; ++ break; ++ default: ++ ret = -EINVAL; ++ } ++ break; ++ default: ++ err("invalid xtal freq"); ++ return -EINVAL; ++ } ++ if (ret) { ++ err("invalid bandwidth"); ++ return ret; ++ } ++ ++#ifdef V4L2_ONLY_DVB_V5 ++#undef BANDWIDTH_5_MHZ ++#undef BANDWIDTH_6_MHZ ++#undef BANDWIDTH_7_MHZ ++#undef BANDWIDTH_8_MHZ ++#endif ++ ++ /* adc multiplier */ ++ ret = af9033_read_reg(state, OFDM, api_adcx2, &tmp); ++ if (ret) ++ return ret; ++ ++ if (tmp == 1) { ++ coeff1_2048nu /= 2; ++ coeff1_4096nu /= 2; ++ coeff1_8191nu /= 2; ++ coeff1_8192nu /= 2; ++ coeff1_8193nu /= 2 ; ++ coeff2_2k /= 2; ++ coeff2_4k /= 2; ++ coeff2_8k /= 2; ++ } ++ ++ buf[i++] = (u8) ((coeff1_2048nu & 0x03000000) >> 24); ++ buf[i++] = (u8) ((coeff1_2048nu & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff1_2048nu & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff1_2048nu & 0x000000ff)); ++ buf[i++] = (u8) ((coeff1_4096nu & 0x03000000) >> 24); ++ buf[i++] = (u8) ((coeff1_4096nu & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff1_4096nu & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff1_4096nu & 0x000000ff)); ++ buf[i++] = (u8) ((coeff1_8191nu & 0x03000000) >> 24); ++ buf[i++] = (u8) ((coeff1_8191nu & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff1_8191nu & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff1_8191nu & 0x000000ff)); ++ buf[i++] = (u8) ((coeff1_8192nu & 0x03000000) >> 24); ++ buf[i++] = (u8) ((coeff1_8192nu & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff1_8192nu & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff1_8192nu & 0x000000ff)); ++ buf[i++] = (u8) ((coeff1_8193nu & 0x03000000) >> 24); ++ buf[i++] = (u8) ((coeff1_8193nu & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff1_8193nu & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff1_8193nu & 0x000000ff)); ++ buf[i++] = (u8) ((coeff2_8k & 0x01000000) >> 24); ++ buf[i++] = (u8) ((coeff2_8k & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff2_8k & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff2_8k & 0x000000ff)); ++ buf[i++] = (u8) ((coeff2_2k & 0x01000000) >> 24); ++ buf[i++] = (u8) ((coeff2_2k & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff2_2k & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff2_2k & 0x000000ff)); ++ buf[i++] = (u8) ((coeff2_4k & 0x01000000) >> 24); ++ buf[i++] = (u8) ((coeff2_4k & 0x00ff0000) >> 16); ++ buf[i++] = (u8) ((coeff2_4k & 0x0000ff00) >> 8); ++ buf[i++] = (u8) ((coeff2_4k & 0x000000ff)); ++ buf[i++] = (u8) ((bfsfcw_fftindex_ratio & 0x00ff)); ++ buf[i++] = (u8) ((bfsfcw_fftindex_ratio & 0xff00) >> 8); ++ buf[i++] = (u8) ((fftindex_bfsfcw_ratio & 0x00ff)); ++ buf[i++] = (u8) ((fftindex_bfsfcw_ratio & 0xff00) >> 8); ++ ++ deb_info("%s: coeff:", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ /* program */ ++ return af9033_write_regs(state, OFDM, api_cfoe_NS_2048_coeff1_25_24, ++ buf, sizeof(buf)); ++} ++ ++static int af9033_set_crystal_ctrl(struct af9033_state *state) ++{ ++ u8 buf[4]; ++ u32 crystal_cw; ++ deb_info("%s: crystal_clock:%d\n", __func__, ++ state->config.crystal_clock); ++ ++ crystal_cw = af913_div(state->config.crystal_clock, 1000000ul, 19ul); ++ ++ buf[0] = (u8) ((crystal_cw & 0x000000ff)); ++ buf[1] = (u8) ((crystal_cw & 0x0000ff00) >> 8); ++ buf[2] = (u8) ((crystal_cw & 0x00ff0000) >> 16); ++ buf[3] = (u8) ((crystal_cw & 0xff000000) >> 24); ++ ++ deb_info("%s: crystal_cw:", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ /* program */ ++ return af9033_write_regs(state, OFDM, api_crystal_clk_7_0, buf, ++ sizeof(buf)); ++} ++ ++static int af9033_set_adc_ctrl(struct af9033_state *state) ++{ ++ u8 buf[3]; ++ u32 adc_cw; ++ deb_info("%s: adc_clock:%d\n", __func__, state->config.adc_clock); ++ ++ adc_cw = af913_div(state->config.adc_clock, 1000000ul, 19ul); ++ ++ buf[0] = (u8) ((adc_cw & 0x000000ff)); ++ buf[1] = (u8) ((adc_cw & 0x0000ff00) >> 8); ++ buf[2] = (u8) ((adc_cw & 0x00ff0000) >> 16); ++ ++ deb_info("%s: adc_cw:", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ /* program */ ++ return af9033_write_regs(state, OFDM, p_reg_f_adc_7_0, buf, ++ sizeof(buf)); ++} ++ ++static int af9033_set_freq_ctrl(struct af9033_state *state) ++{ ++ int ret; ++ u8 buf[3], tmp; ++ u32 adc_freq, freq_cw; ++ s8 bfs_spec_inv; ++ int if_sample_freq; ++ ++ bfs_spec_inv = state->config.rf_spec_inv ? -1 : 1; ++ ++ adc_freq = state->config.adc_clock; ++ if_sample_freq = state->config.if_freq; ++ ++ while (if_sample_freq > (adc_freq / 2)) ++ if_sample_freq = if_sample_freq - adc_freq; ++ ++ if (if_sample_freq >= 0) ++ bfs_spec_inv = bfs_spec_inv * (-1); ++ else ++ if_sample_freq = if_sample_freq * (-1); ++ ++ freq_cw = af913_div(if_sample_freq, adc_freq, 23ul); ++ ++ if (bfs_spec_inv == -1) ++ freq_cw *= -1; ++ ++ /* adc multiplier */ ++ ret = af9033_read_reg(state, OFDM, api_adcx2, &tmp); ++ if (ret) ++ return ret; ++ ++ if (tmp == 1) ++ freq_cw /= 2; ++ ++ buf[0] = (u8) ((freq_cw & 0x000000ff)); ++ buf[1] = (u8) ((freq_cw & 0x0000ff00) >> 8); ++ buf[2] = (u8) ((freq_cw & 0x007f0000) >> 16); ++ ++ deb_info("%s: freq_cw:", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ /* program */ ++ return af9033_write_regs(state, OFDM, api_bfs_fcw_7_0, buf, ++ sizeof(buf)); ++} ++static void af9033_release(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ kfree(state); ++} ++ ++static int af9033_init(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret, i, len; ++ u8 tmp0, tmp1; ++ struct regdesc *init; ++ deb_info("%s\n", __func__); ++ ++ /* power on */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_afe_mem0, 3, 1, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg(state, OFDM, api_suspend_flag, 0); ++ if (ret) ++ goto error; ++ ++ /* tell to the firmware type of the tuner */ ++ ret = af9033_write_reg(state, LINK, p_reg_link_ofsm_dummy_15_8, ++ state->config.tuner); ++ if (ret) ++ goto error; ++ ++ /* set read-update bit for constellation */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_feq_read_update, ++ reg_feq_read_update_pos, reg_feq_read_update_len, 1); ++ if (ret) ++ goto error; ++ ++ /* enable FEC monitor */ ++ ret = af9033_write_reg_bits(state, OFDM, p_fec_vtb_rsd_mon_en, ++ fec_vtb_rsd_mon_en_pos, fec_vtb_rsd_mon_en_len, 1); ++ if (ret) ++ goto error; ++ ++ /* program crystal control */ ++ ret = af9033_set_crystal_ctrl(state); ++ if (ret) ++ goto error; ++ ++ /* program ADC control */ ++ ret = af9033_set_adc_ctrl(state); ++ if (ret) ++ goto error; ++ ++ /* enable DVB-T interrupt */ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_dvbt_inten, ++ reg_dvbt_inten_pos, reg_dvbt_inten_len, 1); ++ if (ret) ++ goto error; ++ ++ /* enable DVB-T mode */ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_dvbt_en, ++ reg_dvbt_en_pos, reg_dvbt_en_len, 1); ++ if (ret) ++ goto error; ++ ++ /* set dca_upper_chip */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_dca_upper_chip, ++ reg_dca_upper_chip_pos, reg_dca_upper_chip_len, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_top_hostb_dca_upper, ++ reg_top_hostb_dca_upper_pos, reg_top_hostb_dca_upper_len, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_top_hosta_dca_upper, ++ reg_top_hosta_dca_upper_pos, reg_top_hosta_dca_upper_len, 0); ++ if (ret) ++ goto error; ++ ++ /* set dca_lower_chip */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_dca_lower_chip, ++ reg_dca_lower_chip_pos, reg_dca_lower_chip_len, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_top_hostb_dca_lower, ++ reg_top_hostb_dca_lower_pos, reg_top_hostb_dca_lower_len, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg_bits(state, LINK, p_reg_top_hosta_dca_lower, ++ reg_top_hosta_dca_lower_pos, reg_top_hosta_dca_lower_len, 0); ++ if (ret) ++ goto error; ++ ++ /* set phase latch */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_dca_platch, ++ reg_dca_platch_pos, reg_dca_platch_len, 0); ++ if (ret) ++ goto error; ++ ++ /* set fpga latch */ ++ ret = af9033_write_reg(state, OFDM, p_reg_dca_fpga_latch, 0); ++ if (ret) ++ goto error; ++ ++ /* set stand alone */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_dca_stand_alone, ++ reg_dca_stand_alone_pos, reg_dca_stand_alone_len, 1); ++ if (ret) ++ goto error; ++ ++ /* set DCA enable */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_dca_en, reg_dca_en_pos, ++ reg_dca_en_len, 0); ++ if (ret) ++ goto error; ++ ++ /* load OFSM settings */ ++ deb_info("%s: load ofsm settings\n", __func__); ++ len = ARRAY_SIZE(ofsm_init); ++ init = ofsm_init; ++ for (i = 0; i < len; i++) { ++ ret = af9033_write_reg(state, OFDM, init[i].addr, init[i].val); ++ if (ret) ++ goto error; ++ } ++ ++ /* load tuner specific settings */ ++ deb_info("%s: load tuner specific settings\n", __func__); ++ switch (state->config.tuner) { ++ case AF9033_TUNER_TUA9001: ++ len = ARRAY_SIZE(tuner_init_tua9001); ++ init = tuner_init_tua9001; ++ break; ++ case AF9033_TUNER_MXL5007t: ++ len = ARRAY_SIZE(tuner_init_mxl5007t); ++ init = tuner_init_mxl5007t; ++ break; ++ case AF9033_TUNER_TDA18218: ++ len = ARRAY_SIZE(tuner_init_tda18218); ++ init = tuner_init_tda18218; ++ break; ++ default: ++ len = 0; ++ init = NULL; ++ break; ++ } ++ for (i = 0; i < len; i++) { ++ ret = af9033_write_reg(state, OFDM, init[i].addr, init[i].val); ++ if (ret) ++ goto error; ++ } ++ ++ /* set H/W MPEG2 locked detection **/ ++ ret = af9033_write_reg(state, LINK, p_reg_top_lock3_out, 1); ++ if (ret) ++ goto error; ++ ++ /* set registers for driving power */ ++ ret = af9033_write_reg(state, LINK, p_reg_top_padmiscdr2, 1); ++ if (ret) ++ goto error; ++ ++ /* et registers for driving power */ ++ ret = af9033_write_reg(state, LINK, p_reg_top_padmiscdr4, 0); ++ if (ret) ++ goto error; ++ ++ /* set registers for driving power */ ++ ret = af9033_write_reg(state, LINK, p_reg_top_padmiscdr8, 0); ++ if (ret) ++ goto error; ++ ++ /* set TS mode */ ++ deb_info("%s: setting ts mode\n", __func__); ++ tmp0 = 0; /* parallel mode */ ++ tmp1 = 0; /* serial mode */ ++ switch (state->config.output_mode) { ++ case AF9033_TS_MODE_PARALLEL: ++ tmp0 = 1; ++ break; ++ case AF9033_TS_MODE_SERIAL: ++ tmp1 = 1; ++ break; ++ case AF9033_TS_MODE_USB: ++ /* usb mode for AF9035 */ ++ default: ++ break; ++ } ++ ret = af9033_write_reg_bits(state, OFDM, p_mp2if_mpeg_par_mode, ++ mp2if_mpeg_par_mode_pos, mp2if_mpeg_par_mode_len, tmp0); ++ if (ret) ++ goto error; ++ ret = af9033_write_reg_bits(state, OFDM, p_mp2if_mpeg_ser_mode, ++ mp2if_mpeg_ser_mode_pos, mp2if_mpeg_ser_mode_len, tmp1); ++ if (ret) ++ goto error; ++ ++ if (state->config.output_mode == AF9033_TS_MODE_SERIAL) { ++ ret = af9033_write_reg_bits(state, LINK, p_reg_top_hostb_mpeg_ser_mode, ++ reg_top_hostb_mpeg_ser_mode_pos, reg_top_hostb_mpeg_ser_mode_len, 1); ++ if (ret) ++ goto error; ++ } ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++ ++static int af9033_sleep(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 tmp, i; ++ deb_info("%s\n", __func__); ++ ++ ret = af9033_write_reg(state, OFDM, api_suspend_flag, 1); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg(state, OFDM, api_trigger_ofsm, 0); ++ if (ret) ++ goto error; ++ ++ for (i = 0; i < 150; i++) { ++ ret = af9033_read_reg(state, OFDM, api_suspend_flag, &tmp); ++ if (ret) ++ goto error; ++ if (!tmp) ++ break; ++ msleep(10); ++ } ++ if (tmp) { ++ deb_info("%s: power off time outs\n", __func__); ++ return -ETIMEDOUT; ++ } ++ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_afe_mem0, 3, 1, 1); ++ if (ret) ++ goto error; ++ ++ /* fixed current leakage (?) */ ++ if (state->config.output_mode != AF9033_TS_MODE_USB) { ++ /* enable parallel TS */ ++ ret = af9033_write_reg_bits(state, LINK, ++ p_reg_top_hosta_mpeg_ser_mode, ++ reg_top_hosta_mpeg_ser_mode_pos, ++ reg_top_hosta_mpeg_ser_mode_len, 0); ++ if (ret) ++ goto error; ++ ++ ret = af9033_write_reg_bits(state, LINK, ++ p_reg_top_hosta_mpeg_par_mode, ++ reg_top_hosta_mpeg_par_mode_pos, ++ reg_top_hosta_mpeg_par_mode_len, 1); ++ } ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int af9033_set_frontend(struct dvb_frontend *fe) ++{ ++ struct dtv_frontend_properties *params = &fe->dtv_property_cache; ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 tmp; ++ deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency, ++ params->bandwidth_hz); ++ ++ state->frequency = params->frequency; ++ ++ /* program tuner */ ++ if (fe->ops.tuner_ops.set_params) ++ fe->ops.tuner_ops.set_params(fe); ++ ++ /* program CFOE coefficients */ ++ ret = af9033_set_coeff(state, params->bandwidth_hz); ++ if (ret) ++ goto error; ++ ++ /* program frequency control */ ++ ret = af9033_set_freq_ctrl(state); ++ if (ret) ++ goto error; ++ ++ /* program bandwidth */ ++ switch (params->bandwidth_hz) { ++ case 6000000: ++ tmp = 0; ++ break; ++ case 7000000: ++ tmp = 1; ++ break; ++ case 8000000: ++ tmp = 2; ++ break; ++#if 0 /* keep */ ++ case 5000000: ++ tmp = 3; ++ break; ++#endif ++ default: ++ deb_info("%s: invalid bandwidth\n", __func__); ++ return -EINVAL; ++ } ++ ret = af9033_write_reg_bits(state, OFDM, g_reg_bw, reg_bw_pos, ++ reg_bw_len, tmp); ++ if (ret) ++ goto error; ++ ++ /* clear easy mode flag */ ++ ret = af9033_write_reg(state, OFDM, api_Training_Mode, 0x00); ++ if (ret) ++ goto error; ++ ++ /* clear empty channel flag */ ++ ret = af9033_write_reg(state, OFDM, api_empty_channel_status, 0x00); ++ if (ret) ++ goto error; ++ ++ /* clear MPEG2 lock flag */ ++ ret = af9033_write_reg_bits(state, OFDM, r_mp2if_sync_byte_locked, ++ mp2if_sync_byte_locked_pos, mp2if_sync_byte_locked_len, 0x00); ++ if (ret) ++ goto error; ++ ++ /* set frequency band ++ 174 - 230 MHz VHF band = 0x00 ++ 350 - 900 MHz UHF band = 0x01 ++ 1670 - 1680 MHz L-BAND band = 0x02 ++ otherwise band = 0xff */ ++ /* TODO: are both min/max ranges really required... */ ++ if ((state->frequency >= 174000000) && (state->frequency <= 230000000)) ++ tmp = 0x00; /* VHF */ ++ else if ((state->frequency >= 350000000) && (state->frequency <= 900000000)) ++ tmp = 0x01; /* UHF */ ++ else if ((state->frequency >= 1670000000) && (state->frequency <= 1680000000)) ++ tmp = 0x02; /* L-BAND */ ++ else ++ tmp = 0xff; ++ ++ ret = af9033_write_reg(state, OFDM, api_FreBand, tmp); ++ if (ret) ++ goto error; ++ ++ /* trigger ofsm */ ++ ret = af9033_write_reg(state, OFDM, api_trigger_ofsm, 0); ++ if (ret) ++ goto error; ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#else ++static int af9033_set_frontend(struct dvb_frontend *fe, ++ struct dvb_frontend_parameters *params) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 tmp; ++ deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency, ++ params->u.ofdm.bandwidth); ++ ++ state->frequency = params->frequency; ++ ++ /* program tuner */ ++ if (fe->ops.tuner_ops.set_params) ++ fe->ops.tuner_ops.set_params(fe, params); ++ ++ /* program CFOE coefficients */ ++ ret = af9033_set_coeff(state, params->u.ofdm.bandwidth); ++ if (ret) ++ goto error; ++ ++ /* program frequency control */ ++ ret = af9033_set_freq_ctrl(state); ++ if (ret) ++ goto error; ++ ++ /* program bandwidth */ ++ switch (params->u.ofdm.bandwidth) { ++ case BANDWIDTH_6_MHZ: ++ tmp = 0; ++ break; ++ case BANDWIDTH_7_MHZ: ++ tmp = 1; ++ break; ++ case BANDWIDTH_8_MHZ: ++ tmp = 2; ++ break; ++#if 0 /* keep */ ++ case BANDWIDTH_5_MHZ: ++ tmp = 3; ++ break; ++#endif ++ default: ++ deb_info("%s: invalid bandwidth\n", __func__); ++ return -EINVAL; ++ } ++ ret = af9033_write_reg_bits(state, OFDM, g_reg_bw, reg_bw_pos, ++ reg_bw_len, tmp); ++ if (ret) ++ goto error; ++ ++ /* clear easy mode flag */ ++ ret = af9033_write_reg(state, OFDM, api_Training_Mode, 0x00); ++ if (ret) ++ goto error; ++ ++ /* clear empty channel flag */ ++ ret = af9033_write_reg(state, OFDM, api_empty_channel_status, 0x00); ++ if (ret) ++ goto error; ++ ++ /* clear MPEG2 lock flag */ ++ ret = af9033_write_reg_bits(state, OFDM, r_mp2if_sync_byte_locked, ++ mp2if_sync_byte_locked_pos, mp2if_sync_byte_locked_len, 0x00); ++ if (ret) ++ goto error; ++ ++ /* set frequency band ++ 174 - 230 MHz VHF band = 0x00 ++ 350 - 900 MHz UHF band = 0x01 ++ 1670 - 1680 MHz L-BAND band = 0x02 ++ otherwise band = 0xff */ ++ /* TODO: are both min/max ranges really required... */ ++ if ((state->frequency >= 174000000) && (state->frequency <= 230000000)) ++ tmp = 0x00; /* VHF */ ++ else if ((state->frequency >= 350000000) && (state->frequency <= 900000000)) ++ tmp = 0x01; /* UHF */ ++ else if ((state->frequency >= 1670000000) && (state->frequency <= 1680000000)) ++ tmp = 0x02; /* L-BAND */ ++ else ++ tmp = 0xff; ++ ++ ret = af9033_write_reg(state, OFDM, api_FreBand, tmp); ++ if (ret) ++ goto error; ++ ++ /* trigger ofsm */ ++ ret = af9033_write_reg(state, OFDM, api_trigger_ofsm, 0); ++ if (ret) ++ goto error; ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#endif ++ ++static int af9033_get_tune_settings(struct dvb_frontend *fe, ++ struct dvb_frontend_tune_settings *fesettings) ++{ ++ fesettings->min_delay_ms = 800; ++ fesettings->step_size = 0; ++ fesettings->max_drift = 0; ++ ++ return 0; ++} ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int af9033_get_frontend(struct dvb_frontend *fe) ++{ ++ struct dtv_frontend_properties *p = &fe->dtv_property_cache; ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 buf[8]; ++ deb_info("%s\n", __func__); ++#define TRANSMISSION_MODE (g_reg_tpsd_txmod - g_reg_tpsd_txmod) ++#define GUARD_INTERVAL (g_reg_tpsd_gi - g_reg_tpsd_txmod) ++#define HIERARCHY (g_reg_tpsd_hier - g_reg_tpsd_txmod) ++#define CONSTELLATION (g_reg_tpsd_const - g_reg_tpsd_txmod) ++#define BANDWIDTH (g_reg_bw - g_reg_tpsd_txmod) ++#define PRIORITY (g_reg_dec_pri - g_reg_tpsd_txmod) ++#define CODE_RATE_HP (g_reg_tpsd_hpcr - g_reg_tpsd_txmod) ++#define CODE_RATE_LP (g_reg_tpsd_lpcr - g_reg_tpsd_txmod) ++ ++ /* read all needed registers */ ++ ret = af9033_read_regs(state, OFDM, g_reg_tpsd_txmod, buf, sizeof(buf)); ++ if (ret) ++ goto error; ++ ++ deb_info("%s: ", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ switch ((buf[CONSTELLATION] >> 0) & 3) { ++ case 0: ++ p->modulation = QPSK; ++ break; ++ case 1: ++ p->modulation = QAM_16; ++ break; ++ case 2: ++ p->modulation = QAM_64; ++ break; ++ } ++ ++ switch ((buf[TRANSMISSION_MODE] >> 0) & 3) { ++ case 0: ++ p->transmission_mode = TRANSMISSION_MODE_2K; ++ break; ++ case 1: ++ p->transmission_mode = TRANSMISSION_MODE_8K; ++ break; ++#if 0 /* keep */ ++ case 2: ++ p->transmission_mode = TRANSMISSION_MODE_4K; ++ break; ++#endif ++ } ++ ++ switch ((buf[GUARD_INTERVAL] >> 0) & 3) { ++ case 0: ++ p->guard_interval = GUARD_INTERVAL_1_32; ++ break; ++ case 1: ++ p->guard_interval = GUARD_INTERVAL_1_16; ++ break; ++ case 2: ++ p->guard_interval = GUARD_INTERVAL_1_8; ++ break; ++ case 3: ++ p->guard_interval = GUARD_INTERVAL_1_4; ++ break; ++ } ++ ++ switch ((buf[HIERARCHY] >> 0) & 7) { ++ case 0: ++ p->hierarchy = HIERARCHY_NONE; ++ break; ++ case 1: ++ p->hierarchy = HIERARCHY_1; ++ break; ++ case 2: ++ p->hierarchy = HIERARCHY_2; ++ break; ++ case 3: ++ p->hierarchy = HIERARCHY_4; ++ break; ++ } ++ ++ switch ((buf[CODE_RATE_HP] >> 0) & 7) { ++ case 0: ++ p->code_rate_HP = FEC_1_2; ++ break; ++ case 1: ++ p->code_rate_HP = FEC_2_3; ++ break; ++ case 2: ++ p->code_rate_HP = FEC_3_4; ++ break; ++ case 3: ++ p->code_rate_HP = FEC_5_6; ++ break; ++ case 4: ++ p->code_rate_HP = FEC_7_8; ++ break; ++ case 5: ++ p->code_rate_HP = FEC_NONE; ++ break; ++ } ++ ++ switch ((buf[CODE_RATE_LP] >> 0) & 7) { ++ case 0: ++ p->code_rate_LP = FEC_1_2; ++ break; ++ case 1: ++ p->code_rate_LP = FEC_2_3; ++ break; ++ case 2: ++ p->code_rate_LP = FEC_3_4; ++ break; ++ case 3: ++ p->code_rate_LP = FEC_5_6; ++ break; ++ case 4: ++ p->code_rate_LP = FEC_7_8; ++ break; ++ case 5: ++ p->code_rate_LP = FEC_NONE; ++ break; ++ } ++ ++ switch ((buf[BANDWIDTH] >> 0) & 3) { ++ case 0: ++ p->bandwidth_hz = 6000000; ++ break; ++ case 1: ++ p->bandwidth_hz = 7000000; ++ break; ++ case 2: ++ p->bandwidth_hz = 8000000; ++ break; ++#if 0 /* keep */ ++ case 3: ++ p->bandwidth_hz = 5000000; ++ break; ++#endif ++ } ++ ++ p->inversion = INVERSION_AUTO; ++ p->frequency = state->frequency; ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#else ++static int af9033_get_frontend(struct dvb_frontend *fe, ++ struct dvb_frontend_parameters *p) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 buf[8]; ++ deb_info("%s\n", __func__); ++#define TRANSMISSION_MODE (g_reg_tpsd_txmod - g_reg_tpsd_txmod) ++#define GUARD_INTERVAL (g_reg_tpsd_gi - g_reg_tpsd_txmod) ++#define HIERARCHY (g_reg_tpsd_hier - g_reg_tpsd_txmod) ++#define CONSTELLATION (g_reg_tpsd_const - g_reg_tpsd_txmod) ++#define BANDWIDTH (g_reg_bw - g_reg_tpsd_txmod) ++#define PRIORITY (g_reg_dec_pri - g_reg_tpsd_txmod) ++#define CODE_RATE_HP (g_reg_tpsd_hpcr - g_reg_tpsd_txmod) ++#define CODE_RATE_LP (g_reg_tpsd_lpcr - g_reg_tpsd_txmod) ++ ++ /* read all needed registers */ ++ ret = af9033_read_regs(state, OFDM, g_reg_tpsd_txmod, buf, sizeof(buf)); ++ if (ret) ++ goto error; ++ ++ deb_info("%s: ", __func__); ++ debug_dump(buf, sizeof(buf), deb_info); ++ ++ switch ((buf[CONSTELLATION] >> 0) & 3) { ++ case 0: ++ p->u.ofdm.constellation = QPSK; ++ break; ++ case 1: ++ p->u.ofdm.constellation = QAM_16; ++ break; ++ case 2: ++ p->u.ofdm.constellation = QAM_64; ++ break; ++ } ++ ++ switch ((buf[TRANSMISSION_MODE] >> 0) & 3) { ++ case 0: ++ p->u.ofdm.transmission_mode = TRANSMISSION_MODE_2K; ++ break; ++ case 1: ++ p->u.ofdm.transmission_mode = TRANSMISSION_MODE_8K; ++ break; ++#if 0 /* keep */ ++ case 2: ++ p->u.ofdm.transmission_mode = TRANSMISSION_MODE_4K; ++ break; ++#endif ++ } ++ ++ switch ((buf[GUARD_INTERVAL] >> 0) & 3) { ++ case 0: ++ p->u.ofdm.guard_interval = GUARD_INTERVAL_1_32; ++ break; ++ case 1: ++ p->u.ofdm.guard_interval = GUARD_INTERVAL_1_16; ++ break; ++ case 2: ++ p->u.ofdm.guard_interval = GUARD_INTERVAL_1_8; ++ break; ++ case 3: ++ p->u.ofdm.guard_interval = GUARD_INTERVAL_1_4; ++ break; ++ } ++ ++ switch ((buf[HIERARCHY] >> 0) & 7) { ++ case 0: ++ p->u.ofdm.hierarchy_information = HIERARCHY_NONE; ++ break; ++ case 1: ++ p->u.ofdm.hierarchy_information = HIERARCHY_1; ++ break; ++ case 2: ++ p->u.ofdm.hierarchy_information = HIERARCHY_2; ++ break; ++ case 3: ++ p->u.ofdm.hierarchy_information = HIERARCHY_4; ++ break; ++ } ++ ++ switch ((buf[CODE_RATE_HP] >> 0) & 7) { ++ case 0: ++ p->u.ofdm.code_rate_HP = FEC_1_2; ++ break; ++ case 1: ++ p->u.ofdm.code_rate_HP = FEC_2_3; ++ break; ++ case 2: ++ p->u.ofdm.code_rate_HP = FEC_3_4; ++ break; ++ case 3: ++ p->u.ofdm.code_rate_HP = FEC_5_6; ++ break; ++ case 4: ++ p->u.ofdm.code_rate_HP = FEC_7_8; ++ break; ++ case 5: ++ p->u.ofdm.code_rate_HP = FEC_NONE; ++ break; ++ } ++ ++ switch ((buf[CODE_RATE_LP] >> 0) & 7) { ++ case 0: ++ p->u.ofdm.code_rate_LP = FEC_1_2; ++ break; ++ case 1: ++ p->u.ofdm.code_rate_LP = FEC_2_3; ++ break; ++ case 2: ++ p->u.ofdm.code_rate_LP = FEC_3_4; ++ break; ++ case 3: ++ p->u.ofdm.code_rate_LP = FEC_5_6; ++ break; ++ case 4: ++ p->u.ofdm.code_rate_LP = FEC_7_8; ++ break; ++ case 5: ++ p->u.ofdm.code_rate_HP = FEC_NONE; ++ break; ++ } ++ ++ switch ((buf[BANDWIDTH] >> 0) & 3) { ++ case 0: ++ p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ; ++ break; ++ case 1: ++ p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ; ++ break; ++ case 2: ++ p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ; ++ break; ++#if 0 /* keep */ ++ case 3: ++ p->u.ofdm.bandwidth = BANDWIDTH_5_MHZ; ++ break; ++#endif ++ } ++ ++ p->inversion = INVERSION_AUTO; ++ p->frequency = state->frequency; ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++#endif ++ ++static int af9033_update_ber_ucblocks(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 buf[3]; ++ u32 error_bit_count = 0; ++ u32 total_bit_count = 0; ++ u16 abort_packet_count = 0; ++ ++ /* don't update ber / ucblocks unnecessary often */ ++ if (time_before(jiffies, state->next_statistics_check)) ++ return 0; ++ ++ /* set minimum ber / ucblocks update interval */ ++ state->next_statistics_check = jiffies + msecs_to_jiffies(500); ++ ++ state->ber = 0; ++ ++ /* no need to check ber / ucblocks in case of no lock */ ++ ret = af9033_read_reg_bits(state, OFDM, ++ r_mp2if_sync_byte_locked, mp2if_sync_byte_locked_pos, ++ mp2if_sync_byte_locked_len, buf); ++ if (ret) ++ goto error; ++ if (!buf[0]) ++ goto exit; ++ ++ /* get abort packet count */ ++ ret = af9033_read_regs(state, OFDM, api_rsd_abort_packet_cnt_7_0, buf, ++ sizeof(buf) - 1); ++ if (ret) ++ goto error; ++ ++ abort_packet_count = (buf[1] << 8) + buf[0]; ++ ++ /* get error bit count */ ++ ret = af9033_read_regs(state, OFDM, api_rsd_bit_err_cnt_7_0, buf, ++ sizeof(buf)); ++ if (ret) ++ goto error; ++ ++ error_bit_count = (buf[2] << 16) + (buf[1] << 8) + buf[0]; ++ error_bit_count = error_bit_count - abort_packet_count * 8 * 8; ++ ++ /* get used RSD counting period (it is 10000 by defaut) */ ++ ret = af9033_read_regs(state, OFDM, api_r_rsd_packet_unit_7_0, buf, ++ sizeof(buf) - 1); ++ if (ret) ++ goto error; ++ ++ total_bit_count = (buf[1] << 8) + buf[0]; ++ total_bit_count = total_bit_count - abort_packet_count; ++ total_bit_count = total_bit_count * 204 * 8; ++ ++ if (total_bit_count) ++ state->ber = error_bit_count * 1000000000 / total_bit_count; ++ ++ state->ucblocks += abort_packet_count; ++ ++ deb_info("%s: err bits:%d total bits:%d abort count:%d\n", __func__, ++ error_bit_count, total_bit_count, abort_packet_count); ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++exit: ++ return ret; ++} ++ ++static int af9033_update_snr(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 buf[3], i, len; ++ u32 snr_val; ++ struct snr_table *uninitialized_var(snr_table); ++ ++ /* read snr registers */ ++ ret = af9033_read_regs(state, OFDM, api_qnt_vbc_err_7_0, buf, ++ sizeof(buf)); ++ if (ret) ++ goto error; ++ snr_val = (buf[2] << 16) + (buf[1] << 8) + buf[0]; ++ ++ /* read current constellation */ ++ ret = af9033_read_reg_bits(state, OFDM, g_reg_tpsd_const, ++ reg_tpsd_const_pos, reg_tpsd_const_len, &buf[0]); ++ if (ret) ++ goto error; ++ ++ switch (buf[0]) { ++ case 0: ++ len = ARRAY_SIZE(qpsk_snr_table); ++ snr_table = qpsk_snr_table; ++ break; ++ case 1: ++ len = ARRAY_SIZE(qam16_snr_table); ++ snr_table = qam16_snr_table; ++ break; ++ case 2: ++ len = ARRAY_SIZE(qam64_snr_table); ++ snr_table = qam64_snr_table; ++ break; ++ default: ++ len = 0; ++ } ++ ++ /* get snr from lookup table */ ++ for (i = 0; i < len; i++) { ++ if (snr_val < snr_table[i].val) { ++ state->snr = snr_table[i].snr * 10; ++ break; ++ } ++ } ++ deb_info("%s: snr_val:%x snr:%x\n", __func__, snr_val, state->snr); ++ ++ if (len && !af9033_snrdb) ++ state->snr = (0xffff / (snr_table[len - 1].snr * 10)) * state->snr; ++ ++error: ++ return ret; ++} ++ ++static int af9033_update_signal_strength(struct dvb_frontend *fe) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ u8 strength; ++ ++ /* read signal strength from 0-100 scale */ ++ ret = af9033_read_reg(state, OFDM, api_signal_strength, &strength); ++ if (ret) ++ goto error; ++ ++ /* scale value to 0x0000-0xffff */ ++ state->signal_strength = strength * 0xffff / 100; ++ ++error: ++ return ret; ++} ++ ++static int af9033_read_status(struct dvb_frontend *fe, fe_status_t *status) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret = 0; ++ u8 tmp; ++ *status = 0; ++ ++ /* empty channel; 0:no result, 1:signal, 2:empty */ ++ ret = af9033_read_reg(state, OFDM, api_empty_channel_status, &tmp); ++ if (ret) ++ goto error; ++ if (tmp == 0x01) /* have signal */ ++ *status |= FE_HAS_SIGNAL; ++ ++ if (tmp != 0x02) { ++ /* TPS lock */ ++ ret = af9033_read_reg_bits(state, OFDM, p_fd_tpsd_lock, ++ fd_tpsd_lock_pos, fd_tpsd_lock_len, &tmp); ++ if (ret) ++ goto error; ++ if (tmp) ++ *status |= FE_HAS_VITERBI | FE_HAS_CARRIER; ++ ++ /* MPEG2 lock */ ++ ret = af9033_read_reg_bits(state, OFDM, ++ r_mp2if_sync_byte_locked, mp2if_sync_byte_locked_pos, ++ mp2if_sync_byte_locked_len, &tmp); ++ if (ret) ++ goto error; ++ if (tmp) ++ *status |= FE_HAS_SYNC | FE_HAS_LOCK; ++ } ++ ++ /* update ber / ucblocks */ ++ ret = af9033_update_ber_ucblocks(fe); ++ ++error: ++ if (ret) ++ deb_info("%s: failed:%d\n", __func__, ret); ++ ++ return ret; ++} ++ ++static int af9033_read_ber(struct dvb_frontend *fe, u32 *ber) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ deb_info("%s\n", __func__); ++ ret = af9033_update_ber_ucblocks(fe); ++ *ber = state->ber; ++ return ret; ++} ++ ++static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ deb_info("%s\n", __func__); ++ ret = af9033_update_signal_strength(fe); ++ if (ret) ++ goto error; ++ ret = af9033_update_ber_ucblocks(fe); ++ *strength = state->signal_strength; ++error: ++ return ret; ++} ++ ++static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ deb_info("%s\n", __func__); ++ ret = af9033_update_snr(fe); ++ if (ret) ++ goto error; ++ ret = af9033_update_ber_ucblocks(fe); ++ *snr = state->snr; ++error: ++ return ret; ++} ++ ++static int af9033_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ int ret; ++ deb_info("%s\n", __func__); ++ ret = af9033_update_ber_ucblocks(fe); ++ *ucblocks = state->ucblocks; ++ return ret; ++} ++ ++static int af9033_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ++{ ++ struct af9033_state *state = fe->demodulator_priv; ++ deb_info("%s: enable:%d\n", __func__, enable); ++ ++ return af9033_write_reg_bits(state, LINK, p_reg_bypass_host2tuner, ++ reg_bypass_host2tuner_pos, reg_bypass_host2tuner_len, enable); ++} ++ ++static struct dvb_frontend_ops af9033_ops; ++ ++struct dvb_frontend *af9033_attach(const struct af9033_config *config, ++ struct i2c_adapter *i2c) ++{ ++ int ret; ++ struct af9033_state *state = NULL; ++ u8 buf[8]; ++ deb_info("%s:\n", __func__); ++ ++ /* allocate memory for the internal state */ ++ state = kzalloc(sizeof(struct af9033_state), GFP_KERNEL); ++ if (state == NULL) ++ goto error; ++ ++ /* setup the state */ ++ state->i2c = i2c; ++ memcpy(&state->config, config, sizeof(struct af9033_config)); ++ ++ /* firmware version */ ++ ret = af9033_read_regs(state, LINK, 0x83e9, &buf[0], sizeof(buf) / 2); ++ if (ret) ++ goto error; ++ ++ ret = af9033_read_regs(state, OFDM, 0x4191, &buf[4], sizeof(buf) / 2); ++ if (ret) ++ goto error; ++ ++ info("firmware version: LINK:%d.%d.%d.%d OFDM:%d.%d.%d.%d", ++ buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); ++ ++ /* settings for mp2if */ ++ if (state->config.output_mode == AF9033_TS_MODE_USB) { ++ /* split 15 PSB to 1K + 1K and enable flow control */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_mp2if2_half_psb, ++ reg_mp2if2_half_psb_pos, reg_mp2if2_half_psb_len, 0); ++ if (ret) ++ goto error; ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_mp2if_stop_en, ++ reg_mp2if_stop_en_pos, reg_mp2if_stop_en_len, 1); ++ } else { ++ /* AF9033 set mpeg to full speed */ ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_mpeg_full_speed, ++ reg_mpeg_full_speed_pos, reg_mpeg_full_speed_len, 0); ++ if (ret) ++ goto error; ++ ret = af9033_write_reg_bits(state, OFDM, p_reg_mp2if_stop_en, ++ reg_mp2if_stop_en_pos, reg_mp2if_stop_en_len, 0); ++ } ++ if (ret) ++ goto error; ++ ++ /* set to 0 as open drain for tuner i2c */ ++ ret = af9033_write_reg(state, LINK, p_reg_top_padodpu, 0); ++ if (ret) ++ goto error; ++ ++ /* set to 0 as push pull for tuner AGC */ ++ ret = af9033_write_reg(state, LINK, p_reg_top_agc_od, 0); ++ if (ret) ++ goto error; ++ ++ /* create dvb_frontend */ ++ memcpy(&state->frontend.ops, &af9033_ops, ++ sizeof(struct dvb_frontend_ops)); ++ state->frontend.demodulator_priv = state; ++ ++ return &state->frontend; ++error: ++ kfree(state); ++ return NULL; ++} ++EXPORT_SYMBOL(af9033_attach); ++ ++static struct dvb_frontend_ops af9033_ops = { ++#ifdef V4L2_ONLY_DVB_V5 ++ .delsys = { SYS_DVBT }, ++#endif ++ .info = { ++ .name = "Afatech AF9033 DVB-T", ++#ifndef V4L2_ONLY_DVB_V5 ++ .type = FE_OFDM, ++#endif ++ .frequency_min = 44250000, ++ .frequency_max = 867250000, ++ .frequency_stepsize = 62500, ++ .frequency_tolerance = 0, ++ .caps = ++ FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | ++ FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | ++ FE_CAN_QPSK | FE_CAN_QAM_16 | ++ FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | ++ FE_CAN_TRANSMISSION_MODE_AUTO | ++ FE_CAN_GUARD_INTERVAL_AUTO | ++ FE_CAN_HIERARCHY_AUTO | ++ FE_CAN_RECOVER | ++ FE_CAN_MUTE_TS ++ }, ++ ++ .release = af9033_release, ++ ++ .init = af9033_init, ++ .sleep = af9033_sleep, ++ ++ .set_frontend = af9033_set_frontend, ++ .get_tune_settings = af9033_get_tune_settings, ++ ++ .get_frontend = af9033_get_frontend, ++ ++ .read_status = af9033_read_status, ++ .read_ber = af9033_read_ber, ++ .read_signal_strength = af9033_read_signal_strength, ++ .read_snr = af9033_read_snr, ++ .read_ucblocks = af9033_read_ucblocks, ++ ++ .i2c_gate_ctrl = af9033_i2c_gate_ctrl, ++}; ++ ++MODULE_AUTHOR("Antti Palosaari "); ++MODULE_DESCRIPTION("Afatech AF9033 DVB-T demodulator driver"); ++MODULE_LICENSE("GPL"); +diff --git a/drivers/media/dvb/frontends/af9033.h b/drivers/media/dvb/frontends/af9033.h +new file mode 100644 +index 0000000..53d2e80 +--- /dev/null ++++ b/drivers/media/dvb/frontends/af9033.h +@@ -0,0 +1,100 @@ ++/* ++ * Afatech AF9033 demodulator driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#ifndef AF9033_H ++#define AF9033_H ++ ++#include ++ ++enum af9033_ts_mode { ++ AF9033_TS_MODE_PARALLEL, ++ AF9033_TS_MODE_SERIAL, ++ AF9033_TS_MODE_USB, /* only for AF9035 */ ++}; ++ ++enum af9033_tuner { ++ AF9033_TUNER_TUA9001 = 0x27, /* Infineon TUA 9001 */ ++ AF9033_TUNER_FC0011 = 0x28, /* Fitipower FC0011 */ ++ AF9033_TUNER_MXL5007t = 0xa0, /* Maxlinear MXL5007t */ ++ AF9033_TUNER_TDA18218 = 0xa1, /* NXP TDA 18218HN */ ++}; ++ ++/* clock setting table: ++ ================================= ++ adc_clock crystal_clock Xtal ++ ================================= ++ 20480000 20480000 FPGA ++ 16384000 20480000 16.38MHz ++ 20480000 20480000 20.48MHz ++ 36000000 20250000 36.00MHz ++ 30000000 20156250 30.00MHz ++ 26000000 20583333 26.00MHz ++ 28000000 20416667 28.00MHz ++ 32000000 20500000 32.00MHz ++ 34000000 20187500 34.00MHz ++ 24000000 20500000 24.00MHz ++ 22000000 20625000 22.00MHz ++ 12000000 20250000 12.00MHz ++*/ ++ ++struct af9033_config { ++ /* demodulator's I2C address */ ++ u8 demod_address; ++ ++ u8 tuner_address; ++ ++ /* xtal clock Hz */ ++ u32 crystal_clock; ++ ++ /* ADC clock Hz */ ++ u32 adc_clock; ++ ++ /* tuner ID */ ++ u8 tuner; ++ ++ /* intermediate frequency Hz */ ++ u32 if_freq; ++ ++ /* TS data output mode */ ++ u8 output_mode:2; ++ ++ /* RF spectrum inversion */ ++ u8 rf_spec_inv:1; ++}; ++ ++ ++#if defined(CONFIG_DVB_AF9033) || \ ++ (defined(CONFIG_DVB_AF9033_MODULE) && defined(MODULE)) ++extern struct dvb_frontend *af9033_attach(const struct af9033_config *config, ++ struct i2c_adapter *i2c); ++#else ++static inline struct dvb_frontend *af9033_attach( ++const struct af9033_config *config, struct i2c_adapter *i2c) ++{ ++ printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); ++ return NULL; ++} ++#endif /* CONFIG_DVB_AF9033 */ ++ ++#endif /* AF9033_H */ +diff --git a/drivers/media/dvb/frontends/af9033_priv.h b/drivers/media/dvb/frontends/af9033_priv.h +new file mode 100644 +index 0000000..6474bfa +--- /dev/null ++++ b/drivers/media/dvb/frontends/af9033_priv.h +@@ -0,0 +1,383 @@ ++/* ++ * Afatech AF9033 demodulator driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#ifndef AF9033_PRIV_H ++#define AF9033_PRIV_H ++ ++#define LOG_PREFIX "af9033" ++ ++#define dprintk(var, level, args...) \ ++ do { if ((var & level)) printk(args); } while (0) ++ ++#define debug_dump(b, l, func) {\ ++ int loop_; \ ++ for (loop_ = 0; loop_ < l; loop_++) \ ++ func("%02x ", b[loop_]); \ ++ func("\n");\ ++} ++ ++#define deb_info(args...) dprintk(af9033_debug, 0x01, args) ++ ++#undef err ++#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) ++#undef info ++#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) ++#undef warn ++#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) ++ ++#define LINK 0x00 ++#define OFDM 0x80 ++ ++struct regdesc { ++ u16 addr; ++ u8 val; ++}; ++ ++struct snr_table { ++ u32 val; ++ u8 snr; ++}; ++ ++/* QPSK SNR lookup table */ ++static struct snr_table qpsk_snr_table[] = { ++ {0x000b4771, 0}, ++ {0x000c1aed, 1}, ++ {0x000d0d27, 2}, ++ {0x000e4d19, 3}, ++ {0x000e5da8, 4}, ++ {0x00107097, 5}, ++ {0x00116975, 6}, ++ {0x001252d9, 7}, ++ {0x00131fa4, 8}, ++ {0x0013d5e1, 9}, ++ {0x00148e53, 10}, ++ {0x0015358b, 11}, ++ {0x0015dd29, 12}, ++ {0x00168112, 13}, ++ {0x00170b61, 14}, ++ {0x0017a532, 15}, ++ {0x00180f94, 16}, ++ {0x00186ed2, 17}, ++ {0x0018b271, 18}, ++ {0x0018e118, 19}, ++ {0x0018ff4b, 20}, ++ {0x00190af1, 21}, ++ {0x00191451, 22}, ++ {0xffffffff, 23}, ++}; ++ ++/* QAM16 SNR lookup table */ ++static struct snr_table qam16_snr_table[] = { ++ {0x0004f0d5, 0}, ++ {0x0005387a, 1}, ++ {0x000573a4, 2}, ++ {0x0005a99e, 3}, ++ {0x0005cc80, 4}, ++ {0x0005eb62, 5}, ++ {0x0005fecf, 6}, ++ {0x00060b80, 7}, ++ {0x00062501, 8}, ++ {0x00064865, 9}, ++ {0x00069604, 10}, ++ {0x0006f356, 11}, ++ {0x0007706a, 12}, ++ {0x000804d3, 13}, ++ {0x00089d1a, 14}, ++ {0x00093e3d, 15}, ++ {0x0009e35d, 16}, ++ {0x000a7c3c, 17}, ++ {0x000afaf8, 18}, ++ {0x000b719d, 19}, ++ {0x000bda6a, 20}, ++ {0x000c0c75, 21}, ++ {0x000c3f7d, 22}, ++ {0x000c5e62, 23}, ++ {0x000c6c31, 24}, ++ {0x000c7925, 25}, ++ {0xffffffff, 26}, ++}; ++ ++/* QAM64 SNR lookup table */ ++static struct snr_table qam64_snr_table[] = { ++ {0x000256d0, 0}, ++ {0x00027a65, 1}, ++ {0x00029873, 2}, ++ {0x0002b7fe, 3}, ++ {0x0002cf1e, 4}, ++ {0x0002e234, 5}, ++ {0x0002f409, 6}, ++ {0x00030046, 7}, ++ {0x00030844, 8}, ++ {0x00030a02, 9}, ++ {0x00030cde, 10}, ++ {0x00031031, 11}, ++ {0x0003144c, 12}, ++ {0x000315dd, 13}, ++ {0x00031920, 14}, ++ {0x000322d0, 15}, ++ {0x000339fc, 16}, ++ {0x000364a1, 17}, ++ {0x00038bcc, 18}, ++ {0x0003c7d3, 19}, ++ {0x000408cc, 20}, ++ {0x00043bed, 21}, ++ {0x00048061, 22}, ++ {0x0004be95, 23}, ++ {0x0004fa7d, 24}, ++ {0x00052405, 25}, ++ {0x0005570d, 26}, ++ {0x00059feb, 27}, ++ {0x0005bf38, 28}, ++ {0xffffffff, 29}, ++}; ++ ++static struct regdesc ofsm_init[] = { ++ {0x0051, 0x01}, ++ {0x0070, 0x0A}, ++ {0x007E, 0x04}, ++ {0x0081, 0x0A}, ++ {0x008A, 0x01}, ++ {0x008E, 0x01}, ++ {0x0092, 0x06}, ++ {0x0099, 0x01}, ++ {0x009F, 0xE1}, ++ {0x00A0, 0xCF}, ++ {0x00A3, 0x01}, ++ {0x00A5, 0x01}, ++ {0x00A6, 0x01}, ++ {0x00A9, 0x00}, ++ {0x00AA, 0x01}, ++ {0x00AB, 0x01}, ++ {0x00B0, 0x01}, ++ {0x00C0, 0x05}, ++ {0x00C4, 0x19}, ++ {0xF000, 0x0F}, ++ {0xF016, 0x10}, ++ {0xF017, 0x04}, ++ {0xF018, 0x05}, ++ {0xF019, 0x04}, ++ {0xF01A, 0x05}, ++ {0xF021, 0x03}, ++ {0xF022, 0x0A}, ++ {0xF023, 0x0A}, ++ {0xF02B, 0x00}, ++ {0xF02C, 0x01}, ++ {0xF064, 0x03}, ++ {0xF065, 0xF9}, ++ {0xF066, 0x03}, ++ {0xF067, 0x01}, ++ {0xF06F, 0xE0}, ++ {0xF070, 0x03}, ++ {0xF072, 0x0F}, ++ {0xF073, 0x03}, ++ {0xF078, 0x00}, ++ {0xF087, 0x00}, ++ {0xF09B, 0x3F}, ++ {0xF09C, 0x00}, ++ {0xF09D, 0x20}, ++ {0xF09E, 0x00}, ++ {0xF09F, 0x0C}, ++ {0xF0A0, 0x00}, ++ {0xF130, 0x04}, ++ {0xF132, 0x04}, ++ {0xF144, 0x1A}, ++ {0xF146, 0x00}, ++ {0xF14A, 0x01}, ++ {0xF14C, 0x00}, ++ {0xF14D, 0x00}, ++ {0xF14F, 0x04}, ++ {0xF158, 0x7F}, ++ {0xF15A, 0x00}, ++ {0xF15B, 0x08}, ++ {0xF15D, 0x03}, ++ {0xF15E, 0x05}, ++ {0xF163, 0x05}, ++ {0xF166, 0x01}, ++ {0xF167, 0x40}, ++ {0xF168, 0x0F}, ++ {0xF17A, 0x00}, ++ {0xF17B, 0x00}, ++ {0xF183, 0x01}, ++ {0xF19D, 0x40}, ++ {0xF1BC, 0x36}, ++ {0xF1BD, 0x00}, ++ {0xF1CB, 0xA0}, ++ {0xF1CC, 0x01}, ++ {0xF204, 0x10}, ++ {0xF214, 0x00}, ++ {0xF40E, 0x0A}, ++ {0xF40F, 0x40}, ++ {0xF410, 0x08}, ++ {0xF55F, 0x0A}, ++ {0xF561, 0x15}, ++ {0xF562, 0x20}, ++ {0xF5DF, 0xFB}, ++ {0xF5E0, 0x00}, ++ {0xF5E3, 0x09}, ++ {0xF5E4, 0x01}, ++ {0xF5E5, 0x01}, ++ {0xF5F8, 0x01}, ++ {0xF5FD, 0x01}, ++ {0xF600, 0x05}, ++ {0xF601, 0x08}, ++ {0xF602, 0x0B}, ++ {0xF603, 0x0E}, ++ {0xF604, 0x11}, ++ {0xF605, 0x14}, ++ {0xF606, 0x17}, ++ {0xF607, 0x1F}, ++ {0xF60E, 0x00}, ++ {0xF60F, 0x04}, ++ {0xF610, 0x32}, ++ {0xF611, 0x10}, ++ {0xF707, 0xFC}, ++ {0xF708, 0x00}, ++ {0xF709, 0x37}, ++ {0xF70A, 0x00}, ++ {0xF78B, 0x01}, ++ {0xF80F, 0x40}, ++ {0xF810, 0x54}, ++ {0xF811, 0x5A}, ++ {0xF905, 0x01}, ++ {0xFB06, 0x03}, ++ {0xFD8B, 0x00} ++}; ++ ++/* Infineon TUA 9001 tuner init ++ AF9033_TUNER_TUA9001 = 0x27 */ ++static struct regdesc tuner_init_tua9001[] = { ++ {0x0046, 0x27}, ++ {0x0057, 0x00}, ++ {0x0058, 0x01}, ++ {0x005f, 0x00}, ++ {0x0060, 0x00}, ++ {0x006d, 0x00}, ++ {0x0071, 0x05}, ++ {0x0072, 0x02}, ++ {0x0074, 0x01}, ++ {0x0075, 0x03}, ++ {0x0076, 0x02}, ++ {0x0077, 0x00}, ++ {0x0078, 0x01}, ++ {0x0079, 0x00}, ++ {0x007a, 0x7E}, ++ {0x007b, 0x3E}, ++ {0x0093, 0x00}, ++ {0x0094, 0x01}, ++ {0x0095, 0x02}, ++ {0x0096, 0x01}, ++ {0x0098, 0x0A}, ++ {0x009b, 0x05}, ++ {0x009c, 0x80}, ++ {0x00b3, 0x00}, ++ {0x00c1, 0x01}, ++ {0x00c2, 0x00}, ++ {0xF007, 0x00}, ++ {0xF01F, 0x82}, ++ {0xF020, 0x00}, ++ {0xF029, 0x82}, ++ {0xF02A, 0x00}, ++ {0xF047, 0x00}, ++ {0xF054, 0x00}, ++ {0xF055, 0x00}, ++ {0xF077, 0x01}, ++ {0xF1E6, 0x00}, ++}; ++ ++/* NXP TDA18218 tuner init ++ AF9033_TUNER_TDA18218 = 161 */ ++static struct regdesc tuner_init_tda18218[] = { ++ {0x0046, 0x27}, ++ {0x0071, 0x05}, ++ {0x0072, 0x02}, ++ {0x0074, 0x01}, ++ {0x0075, 0x03}, ++ {0x0076, 0x02}, ++ {0x0077, 0x00}, ++ {0x0078, 0x01}, ++ {0x007a, 0x7e}, ++ {0x007b, 0x3e}, ++ {0x0098, 0x0a}, ++ {0x00b3, 0x00}, ++ {0xf007, 0x00}, ++ {0xf01f, 0x82}, ++ {0xf020, 0x00}, ++ {0xf047, 0x00}, ++ {0xf077, 0x01}, ++ {0xf1e6, 0x00}, ++ {0x0057, 0x00}, ++ {0x0058, 0x01}, ++ {0x005f, 0x00}, ++ {0x0060, 0x00}, ++ {0x006d, 0x00}, ++ {0x0079, 0x00}, ++ {0x0093, 0x00}, ++ {0x0094, 0x01}, ++ {0x0095, 0x02}, ++ {0x0096, 0x01}, ++ {0x009b, 0x05}, ++ {0x009c, 0x80}, ++ {0x00c1, 0x01}, ++ {0x00c2, 0x00}, ++ {0xf029, 0x82}, ++ {0xf02a, 0x00}, ++ {0xf054, 0x00}, ++ {0xf055, 0x00}, ++}; ++ ++static struct regdesc tuner_init_mxl5007t[] = { ++ {0x0046, 0x1b}, ++ {0x0057, 0x01}, ++ {0x0058, 0x01}, ++ {0x005f, 0x00}, ++ {0x0060, 0x00}, ++ {0x0068, 0x96}, ++ {0x0071, 0x05}, ++ {0x0072, 0x02}, ++ {0x0074, 0x01}, ++ {0x0079, 0x01}, ++ {0x0093, 0x00}, ++ {0x0094, 0x00}, ++ {0x0095, 0x00}, ++ {0x0096, 0x00}, ++ {0x00b3, 0x01}, ++ {0x00c1, 0x01}, ++ {0x00c2, 0x00}, ++ {0xF007, 0x00}, ++ {0xF00C, 0x19}, ++ {0xF00D, 0x1a}, ++ {0xF012, 0xda}, ++ {0xF013, 0x00}, ++ {0xF014, 0x00}, ++ {0xF015, 0x02}, ++ {0xF01F, 0x82}, ++ {0xF020, 0x00}, ++ {0xF029, 0x82}, ++ {0xF02A, 0x00}, ++ {0xF077, 0x02}, ++ {0xF1E6, 0x00}, ++}; ++ ++#endif /* AF9033_PRIV_H */ ++ +diff --git a/drivers/media/dvb/frontends/af9033_reg.h b/drivers/media/dvb/frontends/af9033_reg.h +new file mode 100644 +index 0000000..078276c +--- /dev/null ++++ b/drivers/media/dvb/frontends/af9033_reg.h +@@ -0,0 +1,11006 @@ ++/* ++ * Afatech AF9033 demodulator driver ++ * ++ * Copyright (C) 2008 Afatech ++ * Copyright (C) 2009 Antti Palosaari ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++ * Thanks to TerraTec for a support received. ++ */ ++ ++#ifndef AF9033_REG_H ++#define AF9033_REG_H ++ ++/* these variables are initialized by API */ ++#define api_var_addr_base 0x418b ++#define api_log_addr_base 0x418d ++#define api_log_data_base 0x418f ++#define api_LowerLocalRetrain 0x43bb ++ ++#define api_trigger_ofsm 0x0000 ++#define api_cfoe_NS_2048_coeff1_25_24 0x0001 ++#define api_cfoe_NS_2048_coeff1_23_16 0x0002 ++#define api_cfoe_NS_2048_coeff1_15_8 0x0003 ++#define api_cfoe_NS_2048_coeff1_7_0 0x0004 ++#define api_cfoe_NS_2k_coeff2_24 0x0005 ++#define api_cfoe_NS_2k_coeff2_23_16 0x0006 ++#define api_cfoe_NS_2k_coeff2_15_8 0x0007 ++#define api_cfoe_NS_2k_coeff2_7_0 0x0008 ++#define api_cfoe_NS_8191_coeff1_25_24 0x0009 ++#define api_cfoe_NS_8191_coeff1_23_16 0x000a ++#define api_cfoe_NS_8191_coeff1_15_8 0x000b ++#define api_cfoe_NS_8191_coeff1_7_0 0x000c ++#define api_cfoe_NS_8192_coeff1_25_24 0x000d ++#define api_cfoe_NS_8192_coeff1_23_16 0x000e ++#define api_cfoe_NS_8192_coeff1_15_8 0x000f ++#define api_cfoe_NS_8192_coeff1_7_0 0x0010 ++#define api_cfoe_NS_8193_coeff1_25_24 0x0011 ++#define api_cfoe_NS_8193_coeff1_23_16 0x0012 ++#define api_cfoe_NS_8193_coeff1_15_8 0x0013 ++#define api_cfoe_NS_8193_coeff1_7_0 0x0014 ++#define api_cfoe_NS_8k_coeff2_24 0x0015 ++#define api_cfoe_NS_8k_coeff2_23_16 0x0016 ++#define api_cfoe_NS_8k_coeff2_15_8 0x0017 ++#define api_cfoe_NS_8k_coeff2_7_0 0x0018 ++#define api_cfoe_NS_4096_coeff1_25_24 0x0019 ++#define api_cfoe_NS_4096_coeff1_23_16 0x001a ++#define api_cfoe_NS_4096_coeff1_15_8 0x001b ++#define api_cfoe_NS_4096_coeff1_7_0 0x001c ++#define api_cfoe_NS_4k_coeff2_24 0x001d ++#define api_cfoe_NS_4k_coeff2_23_16 0x001e ++#define api_cfoe_NS_4k_coeff2_15_8 0x001f ++#define api_cfoe_NS_4k_coeff2_7_0 0x0020 ++ ++#define api_bfsfcw_fftindex_ratio_7_0 0x0021 ++#define api_bfsfcw_fftindex_ratio_15_8 0x0022 ++#define api_fftindex_bfsfcw_ratio_7_0 0x0023 ++#define api_fftindex_bfsfcw_ratio_15_8 0x0024 ++ ++#define api_crystal_clk_7_0 0x0025 ++#define api_crystal_clk_15_8 0x0026 ++#define api_crystal_clk_23_16 0x0027 ++#define api_crystal_clk_31_24 0x0028 ++ ++#define api_bfs_fcw_7_0 0x0029 ++#define api_bfs_fcw_15_8 0x002a ++#define api_bfs_fcw_22_16 0x002b ++ ++#define api_qnt_vbc_err_7_0 0x002c ++#define api_qnt_vbc_err_15_8 0x002d ++#define api_qnt_vbc_err_23_16 0x002e ++#define api_r_qnt_vbc_sframe_num 0x002f ++#define api_tpsd_const 0x0030 ++#define api_tpsd_txmod 0x0031 ++ ++#define api_rsd_abort_packet_cnt_7_0 0x0032 ++#define api_rsd_abort_packet_cnt_15_8 0x0033 ++#define api_rsd_bit_err_cnt_7_0 0x0034 ++#define api_rsd_bit_err_cnt_15_8 0x0035 ++#define api_rsd_bit_err_cnt_23_16 0x0036 ++#define api_r_rsd_packet_unit_7_0 0x0037 ++#define api_r_rsd_packet_unit_15_8 0x0038 ++ ++#define api_qnt_vbc_sframe_num 0x0039 ++#define api_rsd_packet_unit_7_0 0x003a ++#define api_rsd_packet_unit_15_8 0x003b ++ ++#define api_tpsd_lock 0x003c ++#define api_mpeg_lock 0x003d ++#define api_RsdSequence 0x003e ++#define api_VtbSequence 0x003f ++ ++#define api_Training_Mode 0x0040 ++#define api_RESET_STATE 0x0041 ++#define api_EXT_LNA_OFF 0x0042 ++#define api_aci_0 0x0043 ++#define api_aci_1 0x0044 ++ ++#define api_adcx2 0x0045 ++#define api_tuner_ID 0x0046 ++#define api_empty_channel_status 0x0047 ++#define api_signal_strength 0x0048 ++#define api_signal_quality 0x0049 ++#define api_est_rf_level_dbm 0x004a ++#define api_FreBand 0x004b ++#define api_suspend_flag 0x004c ++#define api_SupportRelayCommandWrite 0x004d ++#define api_RelayCommandWrite 0x004e ++ ++#define api_OfdmGuiRCN_H 0x004f ++#define api_OfdmGuiRCN_L 0x0050 ++#define api_antenna_unplugged 0x0051 ++#define api_strong_signal_detected 0x0052 ++#define api_channelFlatnessInd 0x0053 ++#define api_Flatness_Ind_nonCmb 0x0054 ++#define api_AutoDetectedSpectrumInv 0x0055 ++#define api_IsSpectrumInv 0x0056 ++#define api_strong_detect_bypass 0x0057 ++#define api_ss_dtop_bypass 0x0058 ++#define api_retrain_dtop_bypass 0x0059 ++#define api_EnableTimeSlice 0x005a ++#define api_SynchronizationType 0x005b ++#define api_ApplyFastSynchronizationToEchoChannel 0x005c ++#define api_ApplyPwmToRfIf 0x005d ++#define api_ChannelNo 0x005e ++ ++#define api_csi_bypass 0x005f ++#define api_mobile_bypass 0x0060 ++#define api_EnableSpeedLog 0x0061 ++ ++#define api_r_rsd_abort_total_packet_7_0 0x0062 ++#define api_r_rsd_abort_total_packet_15_8 0x0063 ++#define api_r_rsd_abort_total_packet_23_16 0x0064 ++#define api_MaxRsdSequence 0x0065 ++#define api_RsdFrameNo 0x0066 ++#define api_MPESuperFrameNo 0x0067 ++ ++#define api_AgcDesiredLevel 0x0068 ++#define api_MinRfGain 0x0069 ++#define api_MaxIfGain 0x006a ++#define api_RssiOffset 0x006b ++#define api_RssiResidual 0x006c ++ ++#define api_strong_weak_signal_default 0x006d ++#define api_PionDiodeDefaultResetInVHF 0x006e ++#define api_afe_mem4_rssi_comp 0x006f ++ ++#define api_aagc_speed_detect_count 0x0070 ++#define api_aagc_mobile_thr 0x0071 ++#define api_aagc_nonmobile_thr 0x0072 ++#define api_agc_counter 0x0073 ++#define api_DisableAagcTop 0x0074 ++#define api_AgcReset 0x0075 ++#define api_AgcUp 0x0076 ++#define api_AgcDown 0x0077 ++#define api_AgcHold 0x0078 ++#define api_PwmCtrlHw 0x0079 ++#define api_MaxAgcGain 0x007a ++#define api_IniAgcGain 0x007b ++#define api_mccid_bypass 0x007c ++#define api_CdpfEnDefaultEchoRange 0x007d ++#define api_CdpfIniTestNoSteady 0x007e ++#define api_timing_err_level 0x007f ++#define api_timing_retrain_cnt 0x0080 ++#define api_ChannelDiffThrSteady 0x0081 ++ ++#define api_adjacent_on 0x0082 ++#define api_near_adjacent_on 0x0083 ++#define api_adjacent_off 0x0084 ++#define api_near_adjacent_off 0x0085 ++#define api_max_rf_agc_7_0 0x0086 ++#define api_max_rf_agc_9_8 0x0087 ++#define api_rf_top_numerator_s_7_0 0x0088 ++#define api_rf_top_numerator_s_9_8 0x0089 ++ ++#define api_gui_tdi_lms_en 0x008a ++#define api_fccid_strobe_scale 0x008b ++#define api_fccid_strobe_numerator 0x008c ++#define api_fccid_strobe_base 0x008d ++#define api_use_fccid 0x008e ++#define api_fft_ave_symbol_num 0x008f ++#define api_large_tone_num_th_7_0 0x0090 ++#define api_large_tone_num_th_15_8 0x0091 ++#define api_use_3m_lpf_th 0x0092 ++#define api_ce_var_min_8k 0x0093 ++#define api_ce_var_min_4k 0x0094 ++#define api_ce_var_min_2k 0x0095 ++#define api_ce_var_min_8k_non_flat 0x0096 ++#define api_flatness_thr 0x0097 ++#define api_non_mobile_signal_level_offset 0x0098 ++#define api_gui_ar_csi_en 0x0099 ++#define api_h2_echo_detected 0x009a ++#define api_gain_offset_O 0x009b ++#define api_gain_slope_O 0x009c ++#define api_pin_diode_gain_loss 0x009d ++#define api_signal_strength_if_low 0x009e ++ ++#define api_flatness_thr_high 0x009f ++#define api_flatness_thr_low 0x00a0 ++ ++#define api_sbq1 0x00a1 ++#define api_sbq2 0x00a2 ++ ++#define api_dyna_dca_offset_en 0x00a3 ++#define api_dca_sbq_bad_th 0x00a4 ++#define api_detect_timing_err_en 0x00a5 ++#define api_flatness_from_h2_echo 0x00a6 ++ ++#define api_timging_error_detection 0x00a7 ++#define api_ce_forced_by_rotate 0x00a8 ++#define api_fccid_fft_mask_en 0x00a9 ++#define api_second_fctrl_unforce_en 0x00aa ++#define api_force_fdi0_at_high_mobile_en 0x00ab ++#define api_high_mobile_detected 0x00ac ++#define api_flatness_detection_en 0x00ad ++#define api_ChooseFsteCostFunctionFromCdpf 0x00ae ++#define api_signal_level 0x00af ++#define api_TryConf2En 0x00b0 ++#define api_Lower_tpsd_lock 0x00b1 ++#define api_Upper_tpsd_lock 0x00b2 ++ ++#define api_AgcCtrlType 0x00b3 ++#define api_opt_LNA_Rssi_scale 0x00b4 ++#define api_StopByTcl 0x00b5 ++#define api_RssiCalibration 0x00b6 ++#define api_AciDesiredSignalLevel_h 0x00b7 ++#define api_AciDesiredSignalLevel_l 0x00b8 ++#define api_ECO_ASIC 0x00b9 ++#define api_NXP_USE_I2C 0x00ba ++#define api_rf_freqency_23_16 0x00bb ++#define api_rf_freqency_15_8 0x00bc ++#define api_rf_freqency_7_0 0x00bd ++#define api_iqik_en 0x00be ++#define api_dcc_en 0x00bf ++#define api_CdpfIniTestNoMobile 0x00c0 ++#define api_ACIdetection 0x00c1 ++#define api_PinDiode 0x00c2 ++#define api_LNA_Gain 0x00c3 ++#define api_ChannelDiffThrMobile 0x00c4 ++#define api_var_end 0x00c5 ++ ++/* registers */ ++#define p_reg_p_aagc_log_2_acc 0xF000 ++#define reg_p_aagc_log_2_acc_pos 0 ++#define reg_p_aagc_log_2_acc_len 4 ++#define reg_p_aagc_log_2_acc_lsb 0 ++#define p_reg_p_aagc_signal_level_rdy 0xF001 ++#define reg_p_aagc_signal_level_rdy_pos 0 ++#define reg_p_aagc_signal_level_rdy_len 1 ++#define reg_p_aagc_signal_level_rdy_lsb 0 ++#define r_reg_r_aagc_signal_level_7_0 0xF002 ++#define reg_r_aagc_signal_level_7_0_pos 0 ++#define reg_r_aagc_signal_level_7_0_len 8 ++#define reg_r_aagc_signal_level_7_0_lsb 0 ++#define r_reg_r_aagc_signal_level_9_8 0xF003 ++#define reg_r_aagc_signal_level_9_8_pos 0 ++#define reg_r_aagc_signal_level_9_8_len 2 ++#define reg_r_aagc_signal_level_9_8_lsb 8 ++#define p_reg_p_aagc_rf_if_swap 0xF004 ++#define reg_p_aagc_rf_if_swap_pos 0 ++#define reg_p_aagc_rf_if_swap_len 1 ++#define reg_p_aagc_rf_if_swap_lsb 0 ++#define p_reg_p_pwm_rf_if_from_hw 0xF006 ++#define reg_p_pwm_rf_if_from_hw_pos 0 ++#define reg_p_pwm_rf_if_from_hw_len 1 ++#define reg_p_pwm_rf_if_from_hw_lsb 0 ++#define p_reg_aagc_out_if_inv 0xF007 ++#define reg_aagc_out_if_inv_pos 0 ++#define reg_aagc_out_if_inv_len 1 ++#define reg_aagc_out_if_inv_lsb 0 ++#define p_reg_aagc_int_en 0xF008 ++#define reg_aagc_int_en_pos 0 ++#define reg_aagc_int_en_len 1 ++#define reg_aagc_int_en_lsb 0 ++#define p_reg_aagc_lock_change_flag 0xF009 ++#define reg_aagc_lock_change_flag_pos 0 ++#define reg_aagc_lock_change_flag_len 1 ++#define reg_aagc_lock_change_flag_lsb 0 ++#define p_reg_aagc_rf_loop_bw_scale_acquire 0xF00A ++#define reg_aagc_rf_loop_bw_scale_acquire_pos 0 ++#define reg_aagc_rf_loop_bw_scale_acquire_len 5 ++#define reg_aagc_rf_loop_bw_scale_acquire_lsb 0 ++#define p_reg_aagc_rf_loop_bw_scale_track 0xF00B ++#define reg_aagc_rf_loop_bw_scale_track_pos 0 ++#define reg_aagc_rf_loop_bw_scale_track_len 5 ++#define reg_aagc_rf_loop_bw_scale_track_lsb 0 ++#define p_reg_aagc_if_loop_bw_scale_acquire 0xF00C ++#define reg_aagc_if_loop_bw_scale_acquire_pos 0 ++#define reg_aagc_if_loop_bw_scale_acquire_len 5 ++#define reg_aagc_if_loop_bw_scale_acquire_lsb 0 ++#define p_reg_aagc_if_loop_bw_scale_track 0xF00D ++#define reg_aagc_if_loop_bw_scale_track_pos 0 ++#define reg_aagc_if_loop_bw_scale_track_len 5 ++#define reg_aagc_if_loop_bw_scale_track_lsb 0 ++#define p_reg_aagc_max_rf_agc_7_0 0xF00E ++#define reg_aagc_max_rf_agc_7_0_pos 0 ++#define reg_aagc_max_rf_agc_7_0_len 8 ++#define reg_aagc_max_rf_agc_7_0_lsb 0 ++#define p_reg_aagc_max_rf_agc_9_8 0xF00F ++#define reg_aagc_max_rf_agc_9_8_pos 0 ++#define reg_aagc_max_rf_agc_9_8_len 2 ++#define reg_aagc_max_rf_agc_9_8_lsb 8 ++#define p_reg_aagc_min_rf_agc_7_0 0xF010 ++#define reg_aagc_min_rf_agc_7_0_pos 0 ++#define reg_aagc_min_rf_agc_7_0_len 8 ++#define reg_aagc_min_rf_agc_7_0_lsb 0 ++#define p_reg_aagc_min_rf_agc_9_8 0xF011 ++#define reg_aagc_min_rf_agc_9_8_pos 0 ++#define reg_aagc_min_rf_agc_9_8_len 2 ++#define reg_aagc_min_rf_agc_9_8_lsb 8 ++#define p_reg_aagc_max_if_agc_7_0 0xF012 ++#define reg_aagc_max_if_agc_7_0_pos 0 ++#define reg_aagc_max_if_agc_7_0_len 8 ++#define reg_aagc_max_if_agc_7_0_lsb 0 ++#define p_reg_aagc_max_if_agc_9_8 0xF013 ++#define reg_aagc_max_if_agc_9_8_pos 0 ++#define reg_aagc_max_if_agc_9_8_len 2 ++#define reg_aagc_max_if_agc_9_8_lsb 8 ++#define p_reg_aagc_min_if_agc_7_0 0xF014 ++#define reg_aagc_min_if_agc_7_0_pos 0 ++#define reg_aagc_min_if_agc_7_0_len 8 ++#define reg_aagc_min_if_agc_7_0_lsb 0 ++#define p_reg_aagc_min_if_agc_9_8 0xF015 ++#define reg_aagc_min_if_agc_9_8_pos 0 ++#define reg_aagc_min_if_agc_9_8_len 2 ++#define reg_aagc_min_if_agc_9_8_lsb 8 ++#define p_reg_aagc_lock_sample_scale 0xF016 ++#define reg_aagc_lock_sample_scale_pos 0 ++#define reg_aagc_lock_sample_scale_len 5 ++#define reg_aagc_lock_sample_scale_lsb 0 ++#define p_reg_aagc_rf_agc_lock_scale_acquire 0xF017 ++#define reg_aagc_rf_agc_lock_scale_acquire_pos 0 ++#define reg_aagc_rf_agc_lock_scale_acquire_len 3 ++#define reg_aagc_rf_agc_lock_scale_acquire_lsb 0 ++#define p_reg_aagc_rf_agc_lock_scale_track 0xF018 ++#define reg_aagc_rf_agc_lock_scale_track_pos 0 ++#define reg_aagc_rf_agc_lock_scale_track_len 3 ++#define reg_aagc_rf_agc_lock_scale_track_lsb 0 ++#define p_reg_aagc_if_agc_lock_scale_acquire 0xF019 ++#define reg_aagc_if_agc_lock_scale_acquire_pos 0 ++#define reg_aagc_if_agc_lock_scale_acquire_len 3 ++#define reg_aagc_if_agc_lock_scale_acquire_lsb 0 ++#define p_reg_aagc_if_agc_lock_scale_track 0xF01A ++#define reg_aagc_if_agc_lock_scale_track_pos 0 ++#define reg_aagc_if_agc_lock_scale_track_len 3 ++#define reg_aagc_if_agc_lock_scale_track_lsb 0 ++#define p_reg_aagc_rf_top_numerator_s_7_0 0xF01B ++#define reg_aagc_rf_top_numerator_s_7_0_pos 0 ++#define reg_aagc_rf_top_numerator_s_7_0_len 8 ++#define reg_aagc_rf_top_numerator_s_7_0_lsb 0 ++#define p_reg_aagc_rf_top_numerator_s_9_8 0xF01C ++#define reg_aagc_rf_top_numerator_s_9_8_pos 0 ++#define reg_aagc_rf_top_numerator_s_9_8_len 2 ++#define reg_aagc_rf_top_numerator_s_9_8_lsb 8 ++#define p_reg_aagc_if_top_numerator_s_7_0 0xF01D ++#define reg_aagc_if_top_numerator_s_7_0_pos 0 ++#define reg_aagc_if_top_numerator_s_7_0_len 8 ++#define reg_aagc_if_top_numerator_s_7_0_lsb 0 ++#define p_reg_aagc_if_top_numerator_s_9_8 0xF01E ++#define reg_aagc_if_top_numerator_s_9_8_pos 0 ++#define reg_aagc_if_top_numerator_s_9_8_len 2 ++#define reg_aagc_if_top_numerator_s_9_8_lsb 8 ++#define p_reg_aagc_adc_out_desired_s_7_0 0xF01F ++#define reg_aagc_adc_out_desired_s_7_0_pos 0 ++#define reg_aagc_adc_out_desired_s_7_0_len 8 ++#define reg_aagc_adc_out_desired_s_7_0_lsb 0 ++#define p_reg_aagc_adc_out_desired_s_8 0xF020 ++#define reg_aagc_adc_out_desired_s_8_pos 0 ++#define reg_aagc_adc_out_desired_s_8_len 1 ++#define reg_aagc_adc_out_desired_s_8_lsb 8 ++#define p_reg_aagc_lock_count_th 0xF021 ++#define reg_aagc_lock_count_th_pos 0 ++#define reg_aagc_lock_count_th_len 4 ++#define reg_aagc_lock_count_th_lsb 0 ++#define p_reg_aagc_rf_agc_unlock_numerator 0xF022 ++#define reg_aagc_rf_agc_unlock_numerator_pos 0 ++#define reg_aagc_rf_agc_unlock_numerator_len 6 ++#define reg_aagc_rf_agc_unlock_numerator_lsb 0 ++#define p_reg_aagc_if_agc_unlock_numerator 0xF023 ++#define reg_aagc_if_agc_unlock_numerator_pos 0 ++#define reg_aagc_if_agc_unlock_numerator_len 6 ++#define reg_aagc_if_agc_unlock_numerator_lsb 0 ++#define p_reg_aagc_rf_top_numerator_m_7_0 0xF025 ++#define reg_aagc_rf_top_numerator_m_7_0_pos 0 ++#define reg_aagc_rf_top_numerator_m_7_0_len 8 ++#define reg_aagc_rf_top_numerator_m_7_0_lsb 0 ++#define p_reg_aagc_rf_top_numerator_m_9_8 0xF026 ++#define reg_aagc_rf_top_numerator_m_9_8_pos 0 ++#define reg_aagc_rf_top_numerator_m_9_8_len 2 ++#define reg_aagc_rf_top_numerator_m_9_8_lsb 8 ++#define p_reg_aagc_if_top_numerator_m_7_0 0xF027 ++#define reg_aagc_if_top_numerator_m_7_0_pos 0 ++#define reg_aagc_if_top_numerator_m_7_0_len 8 ++#define reg_aagc_if_top_numerator_m_7_0_lsb 0 ++#define p_reg_aagc_if_top_numerator_m_9_8 0xF028 ++#define reg_aagc_if_top_numerator_m_9_8_pos 0 ++#define reg_aagc_if_top_numerator_m_9_8_len 2 ++#define reg_aagc_if_top_numerator_m_9_8_lsb 8 ++#define p_reg_aagc_adc_out_desired_m_7_0 0xF029 ++#define reg_aagc_adc_out_desired_m_7_0_pos 0 ++#define reg_aagc_adc_out_desired_m_7_0_len 8 ++#define reg_aagc_adc_out_desired_m_7_0_lsb 0 ++#define p_reg_aagc_adc_out_desired_m_8 0xF02A ++#define reg_aagc_adc_out_desired_m_8_pos 0 ++#define reg_aagc_adc_out_desired_m_8_len 1 ++#define reg_aagc_adc_out_desired_m_8_lsb 8 ++#define p_reg_aagc_mobile_sel 0xF02B ++#define reg_aagc_mobile_sel_pos 0 ++#define reg_aagc_mobile_sel_len 1 ++#define reg_aagc_mobile_sel_lsb 0 ++#define p_reg_aagc_top_reload 0xF02C ++#define reg_aagc_top_reload_pos 0 ++#define reg_aagc_top_reload_len 1 ++#define reg_aagc_top_reload_lsb 0 ++#define p_reg_aagc_rf_delta_voltage_en 0xF02D ++#define reg_aagc_rf_delta_voltage_en_pos 0 ++#define reg_aagc_rf_delta_voltage_en_len 1 ++#define reg_aagc_rf_delta_voltage_en_lsb 0 ++#define p_reg_aagc_rf_voltage_inc 0xF02E ++#define reg_aagc_rf_voltage_inc_pos 0 ++#define reg_aagc_rf_voltage_inc_len 1 ++#define reg_aagc_rf_voltage_inc_lsb 0 ++#define p_reg_aagc_if_delta_voltage_en 0xF02F ++#define reg_aagc_if_delta_voltage_en_pos 0 ++#define reg_aagc_if_delta_voltage_en_len 1 ++#define reg_aagc_if_delta_voltage_en_lsb 0 ++#define p_reg_aagc_if_voltage_inc 0xF030 ++#define reg_aagc_if_voltage_inc_pos 0 ++#define reg_aagc_if_voltage_inc_len 1 ++#define reg_aagc_if_voltage_inc_lsb 0 ++#define p_reg_aagc_rf_delta_voltage_7_0 0xF032 ++#define reg_aagc_rf_delta_voltage_7_0_pos 0 ++#define reg_aagc_rf_delta_voltage_7_0_len 8 ++#define reg_aagc_rf_delta_voltage_7_0_lsb 0 ++#define p_reg_aagc_rf_delta_voltage_15_8 0xF033 ++#define reg_aagc_rf_delta_voltage_15_8_pos 0 ++#define reg_aagc_rf_delta_voltage_15_8_len 8 ++#define reg_aagc_rf_delta_voltage_15_8_lsb 8 ++#define p_reg_aagc_rf_delta_voltage_23_16 0xF034 ++#define reg_aagc_rf_delta_voltage_23_16_pos 0 ++#define reg_aagc_rf_delta_voltage_23_16_len 8 ++#define reg_aagc_rf_delta_voltage_23_16_lsb 16 ++#define p_reg_aagc_rf_delta_voltage_29_24 0xF035 ++#define reg_aagc_rf_delta_voltage_29_24_pos 0 ++#define reg_aagc_rf_delta_voltage_29_24_len 6 ++#define reg_aagc_rf_delta_voltage_29_24_lsb 24 ++#define p_reg_aagc_if_delta_voltage_7_0 0xF036 ++#define reg_aagc_if_delta_voltage_7_0_pos 0 ++#define reg_aagc_if_delta_voltage_7_0_len 8 ++#define reg_aagc_if_delta_voltage_7_0_lsb 0 ++#define p_reg_aagc_if_delta_voltage_15_8 0xF037 ++#define reg_aagc_if_delta_voltage_15_8_pos 0 ++#define reg_aagc_if_delta_voltage_15_8_len 8 ++#define reg_aagc_if_delta_voltage_15_8_lsb 8 ++#define p_reg_aagc_if_delta_voltage_23_16 0xF038 ++#define reg_aagc_if_delta_voltage_23_16_pos 0 ++#define reg_aagc_if_delta_voltage_23_16_len 8 ++#define reg_aagc_if_delta_voltage_23_16_lsb 16 ++#define p_reg_aagc_if_delta_voltage_29_24 0xF039 ++#define reg_aagc_if_delta_voltage_29_24_pos 0 ++#define reg_aagc_if_delta_voltage_29_24_len 6 ++#define reg_aagc_if_delta_voltage_29_24_lsb 24 ++#define p_reg_aagc_delta_voltage_hold_time 0xF03A ++#define reg_aagc_delta_voltage_hold_time_pos 0 ++#define reg_aagc_delta_voltage_hold_time_len 8 ++#define reg_aagc_delta_voltage_hold_time_lsb 0 ++#define p_reg_aagc_top_th_dis 0xF041 ++#define reg_aagc_top_th_dis_pos 0 ++#define reg_aagc_top_th_dis_len 1 ++#define reg_aagc_top_th_dis_lsb 0 ++#define p_reg_p_aagc_rf_floor_dca 0xF042 ++#define reg_p_aagc_rf_floor_dca_pos 0 ++#define reg_p_aagc_rf_floor_dca_len 8 ++#define reg_p_aagc_rf_floor_dca_lsb 0 ++#define p_reg_p_aagc_if_floor_dca 0xF043 ++#define reg_p_aagc_if_floor_dca_pos 0 ++#define reg_p_aagc_if_floor_dca_len 8 ++#define reg_p_aagc_if_floor_dca_lsb 0 ++#define p_reg_p_aagc_rf_gain_scale_dca 0xF044 ++#define reg_p_aagc_rf_gain_scale_dca_pos 0 ++#define reg_p_aagc_rf_gain_scale_dca_len 3 ++#define reg_p_aagc_rf_gain_scale_dca_lsb 0 ++#define p_reg_p_aagc_if_gain_scale_dca 0xF045 ++#define reg_p_aagc_if_gain_scale_dca_pos 0 ++#define reg_p_aagc_if_gain_scale_dca_len 3 ++#define reg_p_aagc_if_gain_scale_dca_lsb 0 ++#define r_reg_r_aagc_ufl_gain 0xF046 ++#define reg_r_aagc_ufl_gain_pos 0 ++#define reg_r_aagc_ufl_gain_len 8 ++#define reg_r_aagc_ufl_gain_lsb 0 ++#define p_reg_aagc_out_rf_inv 0xF047 ++#define reg_aagc_out_rf_inv_pos 0 ++#define reg_aagc_out_rf_inv_len 1 ++#define reg_aagc_out_rf_inv_lsb 0 ++#define p_reg_p_aagc_save_agc_control 0xF048 ++#define reg_p_aagc_save_agc_control_pos 0 ++#define reg_p_aagc_save_agc_control_len 1 ++#define reg_p_aagc_save_agc_control_lsb 0 ++#define p_reg_aagc_fw_sel 0xF049 ++#define reg_aagc_fw_sel_pos 0 ++#define reg_aagc_fw_sel_len 1 ++#define reg_aagc_fw_sel_lsb 0 ++#define r_reg_r_aagc_rf_control_7_0 0xF04A ++#define reg_r_aagc_rf_control_7_0_pos 0 ++#define reg_r_aagc_rf_control_7_0_len 8 ++#define reg_r_aagc_rf_control_7_0_lsb 0 ++#define r_reg_r_aagc_rf_control_9_8 0xF04B ++#define reg_r_aagc_rf_control_9_8_pos 0 ++#define reg_r_aagc_rf_control_9_8_len 2 ++#define reg_r_aagc_rf_control_9_8_lsb 8 ++#define r_reg_r_aagc_if_control_7_0 0xF04C ++#define reg_r_aagc_if_control_7_0_pos 0 ++#define reg_r_aagc_if_control_7_0_len 8 ++#define reg_r_aagc_if_control_7_0_lsb 0 ++#define r_reg_r_aagc_if_control_9_8 0xF04D ++#define reg_r_aagc_if_control_9_8_pos 0 ++#define reg_r_aagc_if_control_9_8_len 2 ++#define reg_r_aagc_if_control_9_8_lsb 8 ++#define p_reg_aagc_adc_out_desired_from_fw_7_0 0xF04E ++#define reg_aagc_adc_out_desired_from_fw_7_0_pos 0 ++#define reg_aagc_adc_out_desired_from_fw_7_0_len 8 ++#define reg_aagc_adc_out_desired_from_fw_7_0_lsb 0 ++#define p_reg_aagc_adc_out_desired_from_fw_8 0xF04F ++#define reg_aagc_adc_out_desired_from_fw_8_pos 0 ++#define reg_aagc_adc_out_desired_from_fw_8_len 1 ++#define reg_aagc_adc_out_desired_from_fw_8_lsb 8 ++#define p_reg_aagc_init_rf_agc_7_0 0xF050 ++#define reg_aagc_init_rf_agc_7_0_pos 0 ++#define reg_aagc_init_rf_agc_7_0_len 8 ++#define reg_aagc_init_rf_agc_7_0_lsb 0 ++#define p_reg_aagc_init_rf_agc_9_8 0xF051 ++#define reg_aagc_init_rf_agc_9_8_pos 0 ++#define reg_aagc_init_rf_agc_9_8_len 2 ++#define reg_aagc_init_rf_agc_9_8_lsb 8 ++#define p_reg_aagc_init_if_agc_7_0 0xF052 ++#define reg_aagc_init_if_agc_7_0_pos 0 ++#define reg_aagc_init_if_agc_7_0_len 8 ++#define reg_aagc_init_if_agc_7_0_lsb 0 ++#define p_reg_aagc_init_if_agc_9_8 0xF053 ++#define reg_aagc_init_if_agc_9_8_pos 0 ++#define reg_aagc_init_if_agc_9_8_len 2 ++#define reg_aagc_init_if_agc_9_8_lsb 8 ++#define p_reg_p_pwm_if_high_unit_num 0xF054 ++#define reg_p_pwm_if_high_unit_num_pos 0 ++#define reg_p_pwm_if_high_unit_num_len 8 ++#define reg_p_pwm_if_high_unit_num_lsb 0 ++#define p_reg_p_pwm_rf_high_unit_num 0xF055 ++#define reg_p_pwm_rf_high_unit_num_pos 0 ++#define reg_p_pwm_rf_high_unit_num_len 8 ++#define reg_p_pwm_rf_high_unit_num_lsb 0 ++#define p_reg_p_pwm_rf_gpio 0xF058 ++#define reg_p_pwm_rf_gpio_pos 0 ++#define reg_p_pwm_rf_gpio_len 1 ++#define reg_p_pwm_rf_gpio_lsb 0 ++#define p_reg_p_pwm_if_gpio 0xF058 ++#define reg_p_pwm_if_gpio_pos 1 ++#define reg_p_pwm_if_gpio_len 1 ++#define reg_p_pwm_if_gpio_lsb 0 ++#define p_reg_aagc_in_sat_cnt_7_0 0xF05A ++#define reg_aagc_in_sat_cnt_7_0_pos 0 ++#define reg_aagc_in_sat_cnt_7_0_len 8 ++#define reg_aagc_in_sat_cnt_7_0_lsb 0 ++#define p_reg_aagc_in_sat_cnt_15_8 0xF05B ++#define reg_aagc_in_sat_cnt_15_8_pos 0 ++#define reg_aagc_in_sat_cnt_15_8_len 8 ++#define reg_aagc_in_sat_cnt_15_8_lsb 8 ++#define p_reg_aagc_in_sat_cnt_23_16 0xF05C ++#define reg_aagc_in_sat_cnt_23_16_pos 0 ++#define reg_aagc_in_sat_cnt_23_16_len 8 ++#define reg_aagc_in_sat_cnt_23_16_lsb 16 ++#define p_reg_aagc_in_sat_cnt_31_24 0xF05D ++#define reg_aagc_in_sat_cnt_31_24_pos 0 ++#define reg_aagc_in_sat_cnt_31_24_len 8 ++#define reg_aagc_in_sat_cnt_31_24_lsb 24 ++#define p_reg_p_pwm_cycle_unit 0xF05E ++#define reg_p_pwm_cycle_unit_pos 0 ++#define reg_p_pwm_cycle_unit_len 4 ++#define reg_p_pwm_cycle_unit_lsb 0 ++#define p_reg_p_pwm_en 0xF05F ++#define reg_p_pwm_en_pos 0 ++#define reg_p_pwm_en_len 1 ++#define reg_p_pwm_en_lsb 0 ++#define r_reg_aagc_rf_gain 0xF060 ++#define reg_aagc_rf_gain_pos 0 ++#define reg_aagc_rf_gain_len 8 ++#define reg_aagc_rf_gain_lsb 0 ++#define r_reg_aagc_if_gain 0xF061 ++#define reg_aagc_if_gain_pos 0 ++#define reg_aagc_if_gain_len 8 ++#define reg_aagc_if_gain_lsb 0 ++#define r_reg_aagc_current_desired_level_7_0 0xF062 ++#define reg_aagc_current_desired_level_7_0_pos 0 ++#define reg_aagc_current_desired_level_7_0_len 8 ++#define reg_aagc_current_desired_level_7_0_lsb 0 ++#define r_reg_aagc_current_desired_level_8 0xF063 ++#define reg_aagc_current_desired_level_8_pos 0 ++#define reg_aagc_current_desired_level_8_len 1 ++#define reg_aagc_current_desired_level_8_lsb 8 ++#define p_reg_tinr_fifo_size 0xF064 ++#define reg_tinr_fifo_size_pos 0 ++#define reg_tinr_fifo_size_len 5 ++#define reg_tinr_fifo_size_lsb 0 ++#define p_reg_tinr_saturation_th_7_0 0xF065 ++#define reg_tinr_saturation_th_7_0_pos 0 ++#define reg_tinr_saturation_th_7_0_len 8 ++#define reg_tinr_saturation_th_7_0_lsb 0 ++#define p_reg_tinr_saturation_th_9_8 0xF066 ++#define reg_tinr_saturation_th_9_8_pos 0 ++#define reg_tinr_saturation_th_9_8_len 2 ++#define reg_tinr_saturation_th_9_8_lsb 8 ++#define p_reg_tinr_saturation_cnt_th 0xF067 ++#define reg_tinr_saturation_cnt_th_pos 0 ++#define reg_tinr_saturation_cnt_th_len 4 ++#define reg_tinr_saturation_cnt_th_lsb 0 ++#define r_reg_tinr_counter_7_0 0xF068 ++#define reg_tinr_counter_7_0_pos 0 ++#define reg_tinr_counter_7_0_len 8 ++#define reg_tinr_counter_7_0_lsb 0 ++#define r_reg_tinr_counter_15_8 0xF069 ++#define reg_tinr_counter_15_8_pos 0 ++#define reg_tinr_counter_15_8_len 8 ++#define reg_tinr_counter_15_8_lsb 8 ++#define p_reg_tinr_counter_rst 0xF06C ++#define reg_tinr_counter_rst_pos 0 ++#define reg_tinr_counter_rst_len 1 ++#define reg_tinr_counter_rst_lsb 0 ++#define p_reg_tinr_ins_th_7_0 0xF06F ++#define reg_tinr_ins_th_7_0_pos 0 ++#define reg_tinr_ins_th_7_0_len 8 ++#define reg_tinr_ins_th_7_0_lsb 0 ++#define p_reg_tinr_ins_th_9_8 0xF070 ++#define reg_tinr_ins_th_9_8_pos 0 ++#define reg_tinr_ins_th_9_8_len 2 ++#define reg_tinr_ins_th_9_8_lsb 8 ++#define p_reg_tinr_ins_en 0xF071 ++#define reg_tinr_ins_en_pos 0 ++#define reg_tinr_ins_en_len 1 ++#define reg_tinr_ins_en_lsb 0 ++#define p_reg_tinr_ins_size 0xF072 ++#define reg_tinr_ins_size_pos 0 ++#define reg_tinr_ins_size_len 4 ++#define reg_tinr_ins_size_lsb 0 ++#define p_reg_tinr_ins_hnum 0xF073 ++#define reg_tinr_ins_hnum_pos 0 ++#define reg_tinr_ins_hnum_len 4 ++#define reg_tinr_ins_hnum_lsb 0 ++#define r_reg_tinr_ins_hcnt_7_0 0xF074 ++#define reg_tinr_ins_hcnt_7_0_pos 0 ++#define reg_tinr_ins_hcnt_7_0_len 8 ++#define reg_tinr_ins_hcnt_7_0_lsb 0 ++#define r_reg_tinr_ins_hcnt_15_8 0xF075 ++#define reg_tinr_ins_hcnt_15_8_pos 0 ++#define reg_tinr_ins_hcnt_15_8_len 8 ++#define reg_tinr_ins_hcnt_15_8_lsb 8 ++#define p_reg_tinr_in_conj 0xF076 ++#define reg_tinr_in_conj_pos 0 ++#define reg_tinr_in_conj_len 1 ++#define reg_tinr_in_conj_lsb 0 ++#define p_reg_tinr_in_zero_if 0xF077 ++#define reg_tinr_in_zero_if_pos 0 ++#define reg_tinr_in_zero_if_len 2 ++#define reg_tinr_in_zero_if_lsb 0 ++#define p_reg_tinr_in_shift 0xF078 ++#define reg_tinr_in_shift_pos 0 ++#define reg_tinr_in_shift_len 1 ++#define reg_tinr_in_shift_lsb 0 ++#define p_reg_tinr_in_conj_sat_counter_rst 0xF079 ++#define reg_tinr_in_conj_sat_counter_rst_pos 0 ++#define reg_tinr_in_conj_sat_counter_rst_len 1 ++#define reg_tinr_in_conj_sat_counter_rst_lsb 0 ++#define r_reg_tinr_in_conj_sat_counter_7_0 0xF07A ++#define reg_tinr_in_conj_sat_counter_7_0_pos 0 ++#define reg_tinr_in_conj_sat_counter_7_0_len 8 ++#define reg_tinr_in_conj_sat_counter_7_0_lsb 0 ++#define r_reg_tinr_in_conj_sat_counter_14_8 0xF07B ++#define reg_tinr_in_conj_sat_counter_14_8_pos 0 ++#define reg_tinr_in_conj_sat_counter_14_8_len 7 ++#define reg_tinr_in_conj_sat_counter_14_8_lsb 8 ++#define p_reg_p_antif_en 0xF07C ++#define reg_p_antif_en_pos 0 ++#define reg_p_antif_en_len 1 ++#define reg_p_antif_en_lsb 0 ++#define p_reg_p_antif_rst 0xF07D ++#define reg_p_antif_rst_pos 0 ++#define reg_p_antif_rst_len 1 ++#define reg_p_antif_rst_lsb 0 ++#define p_reg_p_antif_byp 0xF07E ++#define reg_p_antif_byp_pos 0 ++#define reg_p_antif_byp_len 1 ++#define reg_p_antif_byp_lsb 0 ++#define p_reg_p_antif_mode 0xF07F ++#define reg_p_antif_mode_pos 0 ++#define reg_p_antif_mode_len 1 ++#define reg_p_antif_mode_lsb 0 ++#define p_reg_p_ds_byp 0xF080 ++#define reg_p_ds_byp_pos 0 ++#define reg_p_ds_byp_len 1 ++#define reg_p_ds_byp_lsb 0 ++#define p_reg_p_antif_dagc5_mode 0xF081 ++#define reg_p_antif_dagc5_mode_pos 0 ++#define reg_p_antif_dagc5_mode_len 2 ++#define reg_p_antif_dagc5_mode_lsb 0 ++#define p_reg_p_antif_dagc5_desired_level_7_0 0xF082 ++#define reg_p_antif_dagc5_desired_level_7_0_pos 0 ++#define reg_p_antif_dagc5_desired_level_7_0_len 8 ++#define reg_p_antif_dagc5_desired_level_7_0_lsb 0 ++#define p_reg_p_antif_dagc5_desired_level_8 0xF083 ++#define reg_p_antif_dagc5_desired_level_8_pos 0 ++#define reg_p_antif_dagc5_desired_level_8_len 1 ++#define reg_p_antif_dagc5_desired_level_8_lsb 8 ++#define p_reg_p_antif_dagc5_apply_delay 0xF084 ++#define reg_p_antif_dagc5_apply_delay_pos 0 ++#define reg_p_antif_dagc5_apply_delay_len 7 ++#define reg_p_antif_dagc5_apply_delay_lsb 0 ++#define p_reg_p_antif_dagc5_fixed_gain_7_0 0xF085 ++#define reg_p_antif_dagc5_fixed_gain_7_0_pos 0 ++#define reg_p_antif_dagc5_fixed_gain_7_0_len 8 ++#define reg_p_antif_dagc5_fixed_gain_7_0_lsb 0 ++#define p_reg_p_antif_dagc5_fixed_gain_11_8 0xF086 ++#define reg_p_antif_dagc5_fixed_gain_11_8_pos 0 ++#define reg_p_antif_dagc5_fixed_gain_11_8_len 4 ++#define reg_p_antif_dagc5_fixed_gain_11_8_lsb 8 ++#define p_reg_p_antif_dagc5_use_despow 0xF087 ++#define reg_p_antif_dagc5_use_despow_pos 0 ++#define reg_p_antif_dagc5_use_despow_len 1 ++#define reg_p_antif_dagc5_use_despow_lsb 0 ++#define p_reg_p_antif_dagc5_log_2_accumulate_num 0xF088 ++#define reg_p_antif_dagc5_log_2_accumulate_num_pos 0 ++#define reg_p_antif_dagc5_log_2_accumulate_num_len 5 ++#define reg_p_antif_dagc5_log_2_accumulate_num_lsb 0 ++#define p_reg_p_antif_dagc5_in_sat_cnt_7_0 0xF089 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_7_0_lsb 0 ++#define p_reg_p_antif_dagc5_in_sat_cnt_15_8 0xF08A ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_15_8_lsb 8 ++#define p_reg_p_antif_dagc5_in_sat_cnt_23_16 0xF08B ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_23_16_lsb 16 ++#define p_reg_p_antif_dagc5_in_sat_cnt_31_24 0xF08C ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_pos 0 ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_len 8 ++#define reg_p_antif_dagc5_in_sat_cnt_31_24_lsb 24 ++#define p_reg_p_antif_dagc5_out_sat_cnt_7_0 0xF08D ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_7_0_lsb 0 ++#define p_reg_p_antif_dagc5_out_sat_cnt_15_8 0xF08E ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_15_8_lsb 8 ++#define p_reg_p_antif_dagc5_out_sat_cnt_23_16 0xF08F ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_23_16_lsb 16 ++#define p_reg_p_antif_dagc5_out_sat_cnt_31_24 0xF090 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_pos 0 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_len 8 ++#define reg_p_antif_dagc5_out_sat_cnt_31_24_lsb 24 ++#define p_reg_p_antif_dagc5_rst 0xF091 ++#define reg_p_antif_dagc5_rst_pos 0 ++#define reg_p_antif_dagc5_rst_len 1 ++#define reg_p_antif_dagc5_rst_lsb 0 ++#define p_reg_p_antif_dagc5_en 0xF092 ++#define reg_p_antif_dagc5_en_pos 0 ++#define reg_p_antif_dagc5_en_len 1 ++#define reg_p_antif_dagc5_en_lsb 0 ++#define p_reg_p_antif_sc_mode 0xF093 ++#define reg_p_antif_sc_mode_pos 0 ++#define reg_p_antif_sc_mode_len 4 ++#define reg_p_antif_sc_mode_lsb 0 ++#define p_reg_p_antif_dagc5_done 0xF094 ++#define reg_p_antif_dagc5_done_pos 0 ++#define reg_p_antif_dagc5_done_len 1 ++#define reg_p_antif_dagc5_done_lsb 0 ++#define r_reg_r_antif_sc_7_0 0xF095 ++#define reg_r_antif_sc_7_0_pos 0 ++#define reg_r_antif_sc_7_0_len 8 ++#define reg_r_antif_sc_7_0_lsb 0 ++#define r_reg_r_antif_sc_15_8 0xF096 ++#define reg_r_antif_sc_15_8_pos 0 ++#define reg_r_antif_sc_15_8_len 8 ++#define reg_r_antif_sc_15_8_lsb 8 ++#define r_reg_r_antif_dagc5_multiplier_7_0 0xF097 ++#define reg_r_antif_dagc5_multiplier_7_0_pos 0 ++#define reg_r_antif_dagc5_multiplier_7_0_len 8 ++#define reg_r_antif_dagc5_multiplier_7_0_lsb 0 ++#define r_reg_r_antif_dagc5_multiplier_15_8 0xF098 ++#define reg_r_antif_dagc5_multiplier_15_8_pos 0 ++#define reg_r_antif_dagc5_multiplier_15_8_len 8 ++#define reg_r_antif_dagc5_multiplier_15_8_lsb 8 ++#define r_reg_r_antif_dagc5_right_shift_bits 0xF099 ++#define reg_r_antif_dagc5_right_shift_bits_pos 0 ++#define reg_r_antif_dagc5_right_shift_bits_len 4 ++#define reg_r_antif_dagc5_right_shift_bits_lsb 0 ++#define p_reg_p_antif_dagc5_bypass_scale_ctl 0xF09A ++#define reg_p_antif_dagc5_bypass_scale_ctl_pos 0 ++#define reg_p_antif_dagc5_bypass_scale_ctl_len 3 ++#define reg_p_antif_dagc5_bypass_scale_ctl_lsb 0 ++#define p_reg_mccid_ccirunno_7_0 0xF09B ++#define reg_mccid_ccirunno_7_0_pos 0 ++#define reg_mccid_ccirunno_7_0_len 8 ++#define reg_mccid_ccirunno_7_0_lsb 0 ++#define p_reg_mccid_ccirunno_8 0xF09C ++#define reg_mccid_ccirunno_8_pos 0 ++#define reg_mccid_ccirunno_8_len 1 ++#define reg_mccid_ccirunno_8_lsb 8 ++#define p_reg_mccid_acirunno_7_0 0xF09D ++#define reg_mccid_acirunno_7_0_pos 0 ++#define reg_mccid_acirunno_7_0_len 8 ++#define reg_mccid_acirunno_7_0_lsb 0 ++#define p_reg_mccid_acirunno_8 0xF09E ++#define reg_mccid_acirunno_8_pos 0 ++#define reg_mccid_acirunno_8_len 1 ++#define reg_mccid_acirunno_8_lsb 8 ++#define p_reg_mccid_maxtonenearrange_7_0 0xF09F ++#define reg_mccid_maxtonenearrange_7_0_pos 0 ++#define reg_mccid_maxtonenearrange_7_0_len 8 ++#define reg_mccid_maxtonenearrange_7_0_lsb 0 ++#define p_reg_mccid_maxtonenearrange_8 0xF0A0 ++#define reg_mccid_maxtonenearrange_8_pos 0 ++#define reg_mccid_maxtonenearrange_8_len 1 ++#define reg_mccid_maxtonenearrange_8_lsb 8 ++#define r_reg_mccid_maxacipower_7_0 0xF0A1 ++#define reg_mccid_maxacipower_7_0_pos 0 ++#define reg_mccid_maxacipower_7_0_len 8 ++#define reg_mccid_maxacipower_7_0_lsb 0 ++#define r_reg_mccid_maxacipower_15_8 0xF0A2 ++#define reg_mccid_maxacipower_15_8_pos 0 ++#define reg_mccid_maxacipower_15_8_len 8 ++#define reg_mccid_maxacipower_15_8_lsb 8 ++#define r_reg_mccid_maxacipower_19_16 0xF0A3 ++#define reg_mccid_maxacipower_19_16_pos 0 ++#define reg_mccid_maxacipower_19_16_len 4 ++#define reg_mccid_maxacipower_19_16_lsb 16 ++#define p_reg_p_dcoe_en 0xF0D5 ++#define reg_p_dcoe_en_pos 0 ++#define reg_p_dcoe_en_len 1 ++#define reg_p_dcoe_en_lsb 0 ++#define p_reg_p_dcoe_rst 0xF0D6 ++#define reg_p_dcoe_rst_pos 0 ++#define reg_p_dcoe_rst_len 1 ++#define reg_p_dcoe_rst_lsb 0 ++#define p_reg_p_dcoe_clear 0xF0D7 ++#define reg_p_dcoe_clear_pos 0 ++#define reg_p_dcoe_clear_len 1 ++#define reg_p_dcoe_clear_lsb 0 ++#define p_reg_p_dcoe_applyloc_7_0 0xF0D8 ++#define reg_p_dcoe_applyloc_7_0_pos 0 ++#define reg_p_dcoe_applyloc_7_0_len 8 ++#define reg_p_dcoe_applyloc_7_0_lsb 0 ++#define p_reg_p_dcoe_applyloc_12_8 0xF0D9 ++#define reg_p_dcoe_applyloc_12_8_pos 0 ++#define reg_p_dcoe_applyloc_12_8_len 5 ++#define reg_p_dcoe_applyloc_12_8_lsb 8 ++#define p_reg_p_dcoe_accnums 0xF0DA ++#define reg_p_dcoe_accnums_pos 0 ++#define reg_p_dcoe_accnums_len 3 ++#define reg_p_dcoe_accnums_lsb 0 ++#define p_reg_p_dcoe_accweightsum_sh 0xF0DB ++#define reg_p_dcoe_accweightsum_sh_pos 0 ++#define reg_p_dcoe_accweightsum_sh_len 3 ++#define reg_p_dcoe_accweightsum_sh_lsb 0 ++#define p_reg_p_dcoe_accweightcurr 0xF0DC ++#define reg_p_dcoe_accweightcurr_pos 0 ++#define reg_p_dcoe_accweightcurr_len 8 ++#define reg_p_dcoe_accweightcurr_lsb 0 ++#define p_reg_dcoe_apply_rd 0xF0DF ++#define reg_dcoe_apply_rd_pos 0 ++#define reg_dcoe_apply_rd_len 1 ++#define reg_dcoe_apply_rd_lsb 0 ++#define r_reg_dcoe_apply_i 0xF0E0 ++#define reg_dcoe_apply_i_pos 0 ++#define reg_dcoe_apply_i_len 8 ++#define reg_dcoe_apply_i_lsb 0 ++#define r_reg_dcoe_apply_q 0xF0E1 ++#define reg_dcoe_apply_q_pos 0 ++#define reg_dcoe_apply_q_len 8 ++#define reg_dcoe_apply_q_lsb 0 ++#define p_reg_p_dcrm_en 0xF0E2 ++#define reg_p_dcrm_en_pos 0 ++#define reg_p_dcrm_en_len 1 ++#define reg_p_dcrm_en_lsb 0 ++#define p_reg_p_dcrm_fir 0xF0E3 ++#define reg_p_dcrm_fir_pos 0 ++#define reg_p_dcrm_fir_len 1 ++#define reg_p_dcrm_fir_lsb 0 ++#define p_reg_p_dcrm_log2_firlen 0xF0E4 ++#define reg_p_dcrm_log2_firlen_pos 0 ++#define reg_p_dcrm_log2_firlen_len 3 ++#define reg_p_dcrm_log2_firlen_lsb 0 ++#define r_reg_dcoe_apply_fir_i 0xF0E5 ++#define reg_dcoe_apply_fir_i_pos 0 ++#define reg_dcoe_apply_fir_i_len 8 ++#define reg_dcoe_apply_fir_i_lsb 0 ++#define r_reg_dcoe_apply_fir_q 0xF0E6 ++#define reg_dcoe_apply_fir_q_pos 0 ++#define reg_dcoe_apply_fir_q_len 8 ++#define reg_dcoe_apply_fir_q_lsb 0 ++#define p_reg_p_dcrm_force_en 0xF0E7 ++#define reg_p_dcrm_force_en_pos 0 ++#define reg_p_dcrm_force_en_len 1 ++#define reg_p_dcrm_force_en_lsb 0 ++#define p_reg_p_dcrm_force_value_i 0xF0E8 ++#define reg_p_dcrm_force_value_i_pos 0 ++#define reg_p_dcrm_force_value_i_len 8 ++#define reg_p_dcrm_force_value_i_lsb 0 ++#define p_reg_p_dcrm_force_value_q 0xF0E9 ++#define reg_p_dcrm_force_value_q_pos 0 ++#define reg_p_dcrm_force_value_q_len 8 ++#define reg_p_dcrm_force_value_q_lsb 0 ++#define p_reg_p_iqip_en 0xF0EA ++#define reg_p_iqip_en_pos 0 ++#define reg_p_iqip_en_len 1 ++#define reg_p_iqip_en_lsb 0 ++#define p_reg_p_iqip_rst 0xF0EB ++#define reg_p_iqip_rst_pos 0 ++#define reg_p_iqip_rst_len 1 ++#define reg_p_iqip_rst_lsb 0 ++#define p_reg_iqip_mu_ld 0xF0EC ++#define reg_iqip_mu_ld_pos 0 ++#define reg_iqip_mu_ld_len 1 ++#define reg_iqip_mu_ld_lsb 0 ++#define p_reg_p_iqip_mu_7_0 0xF0ED ++#define reg_p_iqip_mu_7_0_pos 0 ++#define reg_p_iqip_mu_7_0_len 8 ++#define reg_p_iqip_mu_7_0_lsb 0 ++#define p_reg_p_iqip_mu_11_8 0xF0EE ++#define reg_p_iqip_mu_11_8_pos 0 ++#define reg_p_iqip_mu_11_8_len 4 ++#define reg_p_iqip_mu_11_8_lsb 8 ++#define p_reg_iqip_gs_ld 0xF0EF ++#define reg_iqip_gs_ld_pos 0 ++#define reg_iqip_gs_ld_len 1 ++#define reg_iqip_gs_ld_lsb 0 ++#define p_reg_p_iqip_gsnums 0xF0F0 ++#define reg_p_iqip_gsnums_pos 0 ++#define reg_p_iqip_gsnums_len 4 ++#define reg_p_iqip_gsnums_lsb 0 ++#define p_reg_p_iqip_gsites_7_0 0xF0F1 ++#define reg_p_iqip_gsites_7_0_pos 0 ++#define reg_p_iqip_gsites_7_0_len 8 ++#define reg_p_iqip_gsites_7_0_lsb 0 ++#define p_reg_p_iqip_gsites_15_8 0xF0F2 ++#define reg_p_iqip_gsites_15_8_pos 0 ++#define reg_p_iqip_gsites_15_8_len 8 ++#define reg_p_iqip_gsites_15_8_lsb 8 ++#define p_reg_iqip_w_ld 0xF0F3 ++#define reg_iqip_w_ld_pos 0 ++#define reg_iqip_w_ld_len 1 ++#define reg_iqip_w_ld_lsb 0 ++#define p_reg_p_iqip_w_re_7_0 0xF0F4 ++#define reg_p_iqip_w_re_7_0_pos 0 ++#define reg_p_iqip_w_re_7_0_len 8 ++#define reg_p_iqip_w_re_7_0_lsb 0 ++#define p_reg_p_iqip_w_re_15_8 0xF0F5 ++#define reg_p_iqip_w_re_15_8_pos 0 ++#define reg_p_iqip_w_re_15_8_len 8 ++#define reg_p_iqip_w_re_15_8_lsb 8 ++#define p_reg_p_iqip_w_re_16 0xF0F6 ++#define reg_p_iqip_w_re_16_pos 0 ++#define reg_p_iqip_w_re_16_len 1 ++#define reg_p_iqip_w_re_16_lsb 16 ++#define p_reg_p_iqip_w_im_7_0 0xF0F7 ++#define reg_p_iqip_w_im_7_0_pos 0 ++#define reg_p_iqip_w_im_7_0_len 8 ++#define reg_p_iqip_w_im_7_0_lsb 0 ++#define p_reg_p_iqip_w_im_15_8 0xF0F8 ++#define reg_p_iqip_w_im_15_8_pos 0 ++#define reg_p_iqip_w_im_15_8_len 8 ++#define reg_p_iqip_w_im_15_8_lsb 8 ++#define p_reg_p_iqip_w_im_16 0xF0F9 ++#define reg_p_iqip_w_im_16_pos 0 ++#define reg_p_iqip_w_im_16_len 1 ++#define reg_p_iqip_w_im_16_lsb 16 ++#define p_reg_iqip_accnums_rd 0xF0FA ++#define reg_iqip_accnums_rd_pos 0 ++#define reg_iqip_accnums_rd_len 1 ++#define reg_iqip_accnums_rd_lsb 0 ++#define p_reg_p_iqip_accnums 0xF0FB ++#define reg_p_iqip_accnums_pos 0 ++#define reg_p_iqip_accnums_len 2 ++#define reg_p_iqip_accnums_lsb 0 ++#define p_reg_iqip_accnums_rdy 0xF0FC ++#define reg_iqip_accnums_rdy_pos 0 ++#define reg_iqip_accnums_rdy_len 1 ++#define reg_iqip_accnums_rdy_lsb 0 ++#define r_reg_r_iqip_wacc_re_7_0 0xF0FD ++#define reg_r_iqip_wacc_re_7_0_pos 0 ++#define reg_r_iqip_wacc_re_7_0_len 8 ++#define reg_r_iqip_wacc_re_7_0_lsb 0 ++#define r_reg_r_iqip_wacc_re_15_8 0xF0FE ++#define reg_r_iqip_wacc_re_15_8_pos 0 ++#define reg_r_iqip_wacc_re_15_8_len 8 ++#define reg_r_iqip_wacc_re_15_8_lsb 8 ++#define r_reg_r_iqip_wacc_re_16 0xF0FF ++#define reg_r_iqip_wacc_re_16_pos 0 ++#define reg_r_iqip_wacc_re_16_len 1 ++#define reg_r_iqip_wacc_re_16_lsb 16 ++#define r_reg_r_iqip_wacc_im_7_0 0xF100 ++#define reg_r_iqip_wacc_im_7_0_pos 0 ++#define reg_r_iqip_wacc_im_7_0_len 8 ++#define reg_r_iqip_wacc_im_7_0_lsb 0 ++#define r_reg_r_iqip_wacc_im_15_8 0xF101 ++#define reg_r_iqip_wacc_im_15_8_pos 0 ++#define reg_r_iqip_wacc_im_15_8_len 8 ++#define reg_r_iqip_wacc_im_15_8_lsb 8 ++#define r_reg_r_iqip_wacc_im_16 0xF102 ++#define reg_r_iqip_wacc_im_16_pos 0 ++#define reg_r_iqip_wacc_im_16_len 1 ++#define reg_r_iqip_wacc_im_16_lsb 16 ++#define r_reg_r_iqip_out2cacc_re_7_0 0xF103 ++#define reg_r_iqip_out2cacc_re_7_0_pos 0 ++#define reg_r_iqip_out2cacc_re_7_0_len 8 ++#define reg_r_iqip_out2cacc_re_7_0_lsb 0 ++#define r_reg_r_iqip_out2cacc_re_15_8 0xF104 ++#define reg_r_iqip_out2cacc_re_15_8_pos 0 ++#define reg_r_iqip_out2cacc_re_15_8_len 8 ++#define reg_r_iqip_out2cacc_re_15_8_lsb 8 ++#define r_reg_r_iqip_out2cacc_re_21_16 0xF105 ++#define reg_r_iqip_out2cacc_re_21_16_pos 0 ++#define reg_r_iqip_out2cacc_re_21_16_len 6 ++#define reg_r_iqip_out2cacc_re_21_16_lsb 16 ++#define r_reg_r_iqip_out2cacc_im_7_0 0xF106 ++#define reg_r_iqip_out2cacc_im_7_0_pos 0 ++#define reg_r_iqip_out2cacc_im_7_0_len 8 ++#define reg_r_iqip_out2cacc_im_7_0_lsb 0 ++#define r_reg_r_iqip_out2cacc_im_15_8 0xF107 ++#define reg_r_iqip_out2cacc_im_15_8_pos 0 ++#define reg_r_iqip_out2cacc_im_15_8_len 8 ++#define reg_r_iqip_out2cacc_im_15_8_lsb 8 ++#define r_reg_r_iqip_out2cacc_im_21_16 0xF108 ++#define reg_r_iqip_out2cacc_im_21_16_pos 0 ++#define reg_r_iqip_out2cacc_im_21_16_len 6 ++#define reg_r_iqip_out2cacc_im_21_16_lsb 16 ++#define p_reg_mccid_ccif0_scstrobe 0xF109 ++#define reg_mccid_ccif0_scstrobe_pos 0 ++#define reg_mccid_ccif0_scstrobe_len 7 ++#define reg_mccid_ccif0_scstrobe_lsb 0 ++#define p_reg_mccid_cciftrigger 0xF10A ++#define reg_mccid_cciftrigger_pos 0 ++#define reg_mccid_cciftrigger_len 1 ++#define reg_mccid_cciftrigger_lsb 0 ++#define p_reg_mccid_ccif1_scstrobe 0xF10B ++#define reg_mccid_ccif1_scstrobe_pos 0 ++#define reg_mccid_ccif1_scstrobe_len 7 ++#define reg_mccid_ccif1_scstrobe_lsb 0 ++#define p_reg_mccid_ccif0_fcwccif_7_0 0xF10E ++#define reg_mccid_ccif0_fcwccif_7_0_pos 0 ++#define reg_mccid_ccif0_fcwccif_7_0_len 8 ++#define reg_mccid_ccif0_fcwccif_7_0_lsb 0 ++#define p_reg_mccid_ccif0_fcwccif_13_8 0xF10F ++#define reg_mccid_ccif0_fcwccif_13_8_pos 0 ++#define reg_mccid_ccif0_fcwccif_13_8_len 6 ++#define reg_mccid_ccif0_fcwccif_13_8_lsb 8 ++#define p_reg_mccid_ccif0_state 0xF110 ++#define reg_mccid_ccif0_state_pos 0 ++#define reg_mccid_ccif0_state_len 1 ++#define reg_mccid_ccif0_state_lsb 0 ++#define p_reg_mccid_ccif0_acistate 0xF111 ++#define reg_mccid_ccif0_acistate_pos 0 ++#define reg_mccid_ccif0_acistate_len 1 ++#define reg_mccid_ccif0_acistate_lsb 0 ++#define p_reg_mccid_ccif1_fcwccif_7_0 0xF112 ++#define reg_mccid_ccif1_fcwccif_7_0_pos 0 ++#define reg_mccid_ccif1_fcwccif_7_0_len 8 ++#define reg_mccid_ccif1_fcwccif_7_0_lsb 0 ++#define p_reg_mccid_ccif1_fcwccif_13_8 0xF113 ++#define reg_mccid_ccif1_fcwccif_13_8_pos 0 ++#define reg_mccid_ccif1_fcwccif_13_8_len 6 ++#define reg_mccid_ccif1_fcwccif_13_8_lsb 8 ++#define p_reg_mccid_ccif1_state 0xF114 ++#define reg_mccid_ccif1_state_pos 0 ++#define reg_mccid_ccif1_state_len 1 ++#define reg_mccid_ccif1_state_lsb 0 ++#define p_reg_mccid_ccif1_acistate 0xF115 ++#define reg_mccid_ccif1_acistate_pos 0 ++#define reg_mccid_ccif1_acistate_len 1 ++#define reg_mccid_ccif1_acistate_lsb 0 ++#define r_reg_r_acif_saturate 0xF117 ++#define reg_r_acif_saturate_pos 0 ++#define reg_r_acif_saturate_len 8 ++#define reg_r_acif_saturate_lsb 0 ++#define p_reg_tmr_timer0_threshold_7_0 0xF118 ++#define reg_tmr_timer0_threshold_7_0_pos 0 ++#define reg_tmr_timer0_threshold_7_0_len 8 ++#define reg_tmr_timer0_threshold_7_0_lsb 0 ++#define p_reg_tmr_timer0_threshold_15_8 0xF119 ++#define reg_tmr_timer0_threshold_15_8_pos 0 ++#define reg_tmr_timer0_threshold_15_8_len 8 ++#define reg_tmr_timer0_threshold_15_8_lsb 8 ++#define p_reg_tmr_timer0_enable 0xF11A ++#define reg_tmr_timer0_enable_pos 0 ++#define reg_tmr_timer0_enable_len 1 ++#define reg_tmr_timer0_enable_lsb 0 ++#define p_reg_tmr_timer0_clk_sel 0xF11B ++#define reg_tmr_timer0_clk_sel_pos 0 ++#define reg_tmr_timer0_clk_sel_len 1 ++#define reg_tmr_timer0_clk_sel_lsb 0 ++#define p_reg_tmr_timer0_int 0xF11C ++#define reg_tmr_timer0_int_pos 0 ++#define reg_tmr_timer0_int_len 1 ++#define reg_tmr_timer0_int_lsb 0 ++#define p_reg_tmr_timer0_rst 0xF11D ++#define reg_tmr_timer0_rst_pos 0 ++#define reg_tmr_timer0_rst_len 1 ++#define reg_tmr_timer0_rst_lsb 0 ++#define r_reg_tmr_timer0_count_7_0 0xF11E ++#define reg_tmr_timer0_count_7_0_pos 0 ++#define reg_tmr_timer0_count_7_0_len 8 ++#define reg_tmr_timer0_count_7_0_lsb 0 ++#define r_reg_tmr_timer0_count_15_8 0xF11F ++#define reg_tmr_timer0_count_15_8_pos 0 ++#define reg_tmr_timer0_count_15_8_len 8 ++#define reg_tmr_timer0_count_15_8_lsb 8 ++#define p_reg_suspend 0xF120 ++#define reg_suspend_pos 0 ++#define reg_suspend_len 1 ++#define reg_suspend_lsb 0 ++#define p_reg_suspend_rdy 0xF121 ++#define reg_suspend_rdy_pos 0 ++#define reg_suspend_rdy_len 1 ++#define reg_suspend_rdy_lsb 0 ++#define p_reg_resume 0xF122 ++#define reg_resume_pos 0 ++#define reg_resume_len 1 ++#define reg_resume_lsb 0 ++#define p_reg_resume_rdy 0xF123 ++#define reg_resume_rdy_pos 0 ++#define reg_resume_rdy_len 1 ++#define reg_resume_rdy_lsb 0 ++#define p_reg_gp_trigger 0xF124 ++#define reg_gp_trigger_pos 0 ++#define reg_gp_trigger_len 1 ++#define reg_gp_trigger_lsb 0 ++#define p_reg_trigger_sel 0xF125 ++#define reg_trigger_sel_pos 0 ++#define reg_trigger_sel_len 2 ++#define reg_trigger_sel_lsb 0 ++#define p_reg_debug_ofdm 0xF126 ++#define reg_debug_ofdm_pos 0 ++#define reg_debug_ofdm_len 2 ++#define reg_debug_ofdm_lsb 0 ++#define p_reg_trigger_module_sel 0xF127 ++#define reg_trigger_module_sel_pos 0 ++#define reg_trigger_module_sel_len 6 ++#define reg_trigger_module_sel_lsb 0 ++#define p_reg_trigger_set_sel 0xF128 ++#define reg_trigger_set_sel_pos 0 ++#define reg_trigger_set_sel_len 6 ++#define reg_trigger_set_sel_lsb 0 ++#define p_reg_fw_int_mask_n 0xF129 ++#define reg_fw_int_mask_n_pos 0 ++#define reg_fw_int_mask_n_len 1 ++#define reg_fw_int_mask_n_lsb 0 ++#define p_reg_dioif_rst 0xF12A ++#define reg_dioif_rst_pos 0 ++#define reg_dioif_rst_len 1 ++#define reg_dioif_rst_lsb 0 ++#define p_reg_debug_group 0xF12B ++#define reg_debug_group_pos 0 ++#define reg_debug_group_len 4 ++#define reg_debug_group_lsb 0 ++#define p_reg_odbg_clk_sel 0xF12C ++#define reg_odbg_clk_sel_pos 0 ++#define reg_odbg_clk_sel_len 3 ++#define reg_odbg_clk_sel_lsb 0 ++#define p_reg_p_ccif_shift_fre 0xF12F ++#define reg_p_ccif_shift_fre_pos 0 ++#define reg_p_ccif_shift_fre_len 1 ++#define reg_p_ccif_shift_fre_lsb 0 ++#define p_reg_p_ccif_bandwidth_factor 0xF130 ++#define reg_p_ccif_bandwidth_factor_pos 0 ++#define reg_p_ccif_bandwidth_factor_len 3 ++#define reg_p_ccif_bandwidth_factor_lsb 0 ++#define p_reg_ccif_rst 0xF131 ++#define reg_ccif_rst_pos 0 ++#define reg_ccif_rst_len 1 ++#define reg_ccif_rst_lsb 0 ++#define p_reg_p_ccif_min_bandwidth 0xF132 ++#define reg_p_ccif_min_bandwidth_pos 0 ++#define reg_p_ccif_min_bandwidth_len 7 ++#define reg_p_ccif_min_bandwidth_lsb 0 ++#define p_reg_ccif_bq0_state 0xF133 ++#define reg_ccif_bq0_state_pos 0 ++#define reg_ccif_bq0_state_len 1 ++#define reg_ccif_bq0_state_lsb 0 ++#define p_reg_ccif_bq0_outputscaling 0xF134 ++#define reg_ccif_bq0_outputscaling_pos 0 ++#define reg_ccif_bq0_outputscaling_len 5 ++#define reg_ccif_bq0_outputscaling_lsb 0 ++#define p_reg_ccif_bq1_state 0xF135 ++#define reg_ccif_bq1_state_pos 0 ++#define reg_ccif_bq1_state_len 1 ++#define reg_ccif_bq1_state_lsb 0 ++#define p_reg_ccif_bq1_outputscaling 0xF136 ++#define reg_ccif_bq1_outputscaling_pos 0 ++#define reg_ccif_bq1_outputscaling_len 5 ++#define reg_ccif_bq1_outputscaling_lsb 0 ++#define p_reg_ccif_bq0_a1_7_0 0xF137 ++#define reg_ccif_bq0_a1_7_0_pos 0 ++#define reg_ccif_bq0_a1_7_0_len 8 ++#define reg_ccif_bq0_a1_7_0_lsb 0 ++#define p_reg_ccif_bq0_a1_13_8 0xF138 ++#define reg_ccif_bq0_a1_13_8_pos 0 ++#define reg_ccif_bq0_a1_13_8_len 6 ++#define reg_ccif_bq0_a1_13_8_lsb 8 ++#define p_reg_ccif_bq1_a1_7_0 0xF139 ++#define reg_ccif_bq1_a1_7_0_pos 0 ++#define reg_ccif_bq1_a1_7_0_len 8 ++#define reg_ccif_bq1_a1_7_0_lsb 0 ++#define p_reg_ccif_bq1_a1_13_8 0xF13A ++#define reg_ccif_bq1_a1_13_8_pos 0 ++#define reg_ccif_bq1_a1_13_8_len 6 ++#define reg_ccif_bq1_a1_13_8_lsb 8 ++#define p_reg_ccif_bq0_b1_7_0 0xF13B ++#define reg_ccif_bq0_b1_7_0_pos 0 ++#define reg_ccif_bq0_b1_7_0_len 8 ++#define reg_ccif_bq0_b1_7_0_lsb 0 ++#define p_reg_ccif_bq0_b1_13_8 0xF13C ++#define reg_ccif_bq0_b1_13_8_pos 0 ++#define reg_ccif_bq0_b1_13_8_len 6 ++#define reg_ccif_bq0_b1_13_8_lsb 8 ++#define p_reg_ccif_bq1_b1_7_0 0xF13D ++#define reg_ccif_bq1_b1_7_0_pos 0 ++#define reg_ccif_bq1_b1_7_0_len 8 ++#define reg_ccif_bq1_b1_7_0_lsb 0 ++#define p_reg_ccif_bq1_b1_13_8 0xF13E ++#define reg_ccif_bq1_b1_13_8_pos 0 ++#define reg_ccif_bq1_b1_13_8_len 6 ++#define reg_ccif_bq1_b1_13_8_lsb 8 ++#define p_reg_ccif_bq0_b2_7_0 0xF13F ++#define reg_ccif_bq0_b2_7_0_pos 0 ++#define reg_ccif_bq0_b2_7_0_len 8 ++#define reg_ccif_bq0_b2_7_0_lsb 0 ++#define p_reg_ccif_bq0_b2_13_8 0xF140 ++#define reg_ccif_bq0_b2_13_8_pos 0 ++#define reg_ccif_bq0_b2_13_8_len 6 ++#define reg_ccif_bq0_b2_13_8_lsb 8 ++#define p_reg_ccif_bq1_b2_7_0 0xF141 ++#define reg_ccif_bq1_b2_7_0_pos 0 ++#define reg_ccif_bq1_b2_7_0_len 8 ++#define reg_ccif_bq1_b2_7_0_lsb 0 ++#define p_reg_ccif_bq1_b2_13_8 0xF142 ++#define reg_ccif_bq1_b2_13_8_pos 0 ++#define reg_ccif_bq1_b2_13_8_len 6 ++#define reg_ccif_bq1_b2_13_8_lsb 8 ++#define p_reg_ccif_debug_rst 0xF143 ++#define reg_ccif_debug_rst_pos 0 ++#define reg_ccif_debug_rst_len 1 ++#define reg_ccif_debug_rst_lsb 0 ++#define p_reg_mccid_defaultccifscstrobe 0xF144 ++#define reg_mccid_defaultccifscstrobe_pos 0 ++#define reg_mccid_defaultccifscstrobe_len 7 ++#define reg_mccid_defaultccifscstrobe_lsb 0 ++#define p_reg_mccid_monitoringaci 0xF145 ++#define reg_mccid_monitoringaci_pos 0 ++#define reg_mccid_monitoringaci_len 1 ++#define reg_mccid_monitoringaci_lsb 0 ++#define p_reg_mccid_ispassmode 0xF146 ++#define reg_mccid_ispassmode_pos 0 ++#define reg_mccid_ispassmode_len 1 ++#define reg_mccid_ispassmode_lsb 0 ++#define p_reg_mccid_issteadystatemode 0xF147 ++#define reg_mccid_issteadystatemode_pos 0 ++#define reg_mccid_issteadystatemode_len 1 ++#define reg_mccid_issteadystatemode_lsb 0 ++#define p_reg_mccid_fixedgaincmp 0xF148 ++#define reg_mccid_fixedgaincmp_pos 0 ++#define reg_mccid_fixedgaincmp_len 1 ++#define reg_mccid_fixedgaincmp_lsb 0 ++#define p_reg_mccid_misscounter_reset 0xF149 ++#define reg_mccid_misscounter_reset_pos 0 ++#define reg_mccid_misscounter_reset_len 1 ++#define reg_mccid_misscounter_reset_lsb 0 ++#define p_reg_mccid_acwgcheckcciexist 0xF14A ++#define reg_mccid_acwgcheckcciexist_pos 0 ++#define reg_mccid_acwgcheckcciexist_len 1 ++#define reg_mccid_acwgcheckcciexist_lsb 0 ++#define p_reg_mccid_acidone 0xF14B ++#define reg_mccid_acidone_pos 0 ++#define reg_mccid_acidone_len 1 ++#define reg_mccid_acidone_lsb 0 ++#define p_reg_mccid_sxdesiredpower_7_0 0xF14C ++#define reg_mccid_sxdesiredpower_7_0_pos 0 ++#define reg_mccid_sxdesiredpower_7_0_len 8 ++#define reg_mccid_sxdesiredpower_7_0_lsb 0 ++#define p_reg_mccid_sxdesiredpower_9_8 0xF14D ++#define reg_mccid_sxdesiredpower_9_8_pos 0 ++#define reg_mccid_sxdesiredpower_9_8_len 2 ++#define reg_mccid_sxdesiredpower_9_8_lsb 8 ++#define p_reg_mccid_defaultccitimertriggerno 0xF14E ++#define reg_mccid_defaultccitimertriggerno_pos 0 ++#define reg_mccid_defaultccitimertriggerno_len 8 ++#define reg_mccid_defaultccitimertriggerno_lsb 0 ++#define p_reg_mccid_detectedmaxtonecountshift 0xF14F ++#define reg_mccid_detectedmaxtonecountshift_pos 0 ++#define reg_mccid_detectedmaxtonecountshift_len 3 ++#define reg_mccid_detectedmaxtonecountshift_lsb 0 ++#define p_reg_mccid_moveffttoccif_en 0xF151 ++#define reg_mccid_moveffttoccif_en_pos 0 ++#define reg_mccid_moveffttoccif_en_len 1 ++#define reg_mccid_moveffttoccif_en_lsb 0 ++#define p_reg_mccid_fftindextobfsfcwfactor_7_0 0xF152 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_pos 0 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_len 8 ++#define reg_mccid_fftindextobfsfcwfactor_7_0_lsb 0 ++#define p_reg_mccid_fftindextobfsfcwfactor_9_8 0xF153 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_pos 0 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_len 2 ++#define reg_mccid_fftindextobfsfcwfactor_9_8_lsb 8 ++#define p_reg_mccid_bfsfcwffttoindexfactor_7_0 0xF154 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_pos 0 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_len 8 ++#define reg_mccid_bfsfcwffttoindexfactor_7_0_lsb 0 ++#define p_reg_mccid_bfsfcwffttoindexfactor_10_8 0xF155 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_pos 0 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_len 3 ++#define reg_mccid_bfsfcwffttoindexfactor_10_8_lsb 8 ++#define p_reg_mccid_detectedaci 0xF156 ++#define reg_mccid_detectedaci_pos 0 ++#define reg_mccid_detectedaci_len 1 ++#define reg_mccid_detectedaci_lsb 0 ++#define r_reg_mccid_filter_enable 0xF157 ++#define reg_mccid_filter_enable_pos 0 ++#define reg_mccid_filter_enable_len 1 ++#define reg_mccid_filter_enable_lsb 0 ++#define p_reg_mccid_aciscstrobe 0xF158 ++#define reg_mccid_aciscstrobe_pos 0 ++#define reg_mccid_aciscstrobe_len 7 ++#define reg_mccid_aciscstrobe_lsb 0 ++#define p_reg_mccid_scanningaci 0xF159 ++#define reg_mccid_scanningaci_pos 0 ++#define reg_mccid_scanningaci_len 1 ++#define reg_mccid_scanningaci_lsb 0 ++#define p_reg_mccid_windowsizeacciwdcount_7_0 0xF15A ++#define reg_mccid_windowsizeacciwdcount_7_0_pos 0 ++#define reg_mccid_windowsizeacciwdcount_7_0_len 8 ++#define reg_mccid_windowsizeacciwdcount_7_0_lsb 0 ++#define p_reg_mccid_windowsizeacciwdcount_12_8 0xF15B ++#define reg_mccid_windowsizeacciwdcount_12_8_pos 0 ++#define reg_mccid_windowsizeacciwdcount_12_8_len 5 ++#define reg_mccid_windowsizeacciwdcount_12_8_lsb 8 ++#define p_reg_mccid_scannedacionly 0xF15C ++#define reg_mccid_scannedacionly_pos 0 ++#define reg_mccid_scannedacionly_len 1 ++#define reg_mccid_scannedacionly_lsb 0 ++#define p_reg_mccid_scfactor 0xF15D ++#define reg_mccid_scfactor_pos 0 ++#define reg_mccid_scfactor_len 5 ++#define reg_mccid_scfactor_lsb 0 ++#define p_reg_mccid_defaultevaluatingbandwidthfactor 0xF15E ++#define reg_mccid_defaultevaluatingbandwidthfactor_pos 0 ++#define reg_mccid_defaultevaluatingbandwidthfactor_len 3 ++#define reg_mccid_defaultevaluatingbandwidthfactor_lsb 0 ++#define p_reg_mccid_defaultacipowerlevel 0xF15F ++#define reg_mccid_defaultacipowerlevel_pos 0 ++#define reg_mccid_defaultacipowerlevel_len 3 ++#define reg_mccid_defaultacipowerlevel_lsb 0 ++#define r_reg_mccid_outputdagc1gain_7_0 0xF160 ++#define reg_mccid_outputdagc1gain_7_0_pos 0 ++#define reg_mccid_outputdagc1gain_7_0_len 8 ++#define reg_mccid_outputdagc1gain_7_0_lsb 0 ++#define r_reg_mccid_outputdagc1gain_9_8 0xF161 ++#define reg_mccid_outputdagc1gain_9_8_pos 0 ++#define reg_mccid_outputdagc1gain_9_8_len 2 ++#define reg_mccid_outputdagc1gain_9_8_lsb 8 ++#define r_reg_mccid_outputdagc1gainshift 0xF162 ++#define reg_mccid_outputdagc1gainshift_pos 0 ++#define reg_mccid_outputdagc1gainshift_len 4 ++#define reg_mccid_outputdagc1gainshift_lsb 0 ++#define p_reg_mccid_defaultacwgcheckccipowerlevel 0xF163 ++#define reg_mccid_defaultacwgcheckccipowerlevel_pos 0 ++#define reg_mccid_defaultacwgcheckccipowerlevel_len 3 ++#define reg_mccid_defaultacwgcheckccipowerlevel_lsb 0 ++#define p_reg_mccid_ccipowerlevelfactor 0xF166 ++#define reg_mccid_ccipowerlevelfactor_pos 0 ++#define reg_mccid_ccipowerlevelfactor_len 3 ++#define reg_mccid_ccipowerlevelfactor_lsb 0 ++#define p_reg_mccid_scstrobesearchingrange 0xF167 ++#define reg_mccid_scstrobesearchingrange_pos 0 ++#define reg_mccid_scstrobesearchingrange_len 8 ++#define reg_mccid_scstrobesearchingrange_lsb 0 ++#define p_reg_mccid_searchingno 0xF168 ++#define reg_mccid_searchingno_pos 0 ++#define reg_mccid_searchingno_len 6 ++#define reg_mccid_searchingno_lsb 0 ++#define p_reg_mccid_scannedacifrequencyresolution 0xF169 ++#define reg_mccid_scannedacifrequencyresolution_pos 0 ++#define reg_mccid_scannedacifrequencyresolution_len 4 ++#define reg_mccid_scannedacifrequencyresolution_lsb 0 ++#define p_reg_mccid_fft0_maskmaxtoneindex_7_0 0xF16A ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_pos 0 ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_len 8 ++#define reg_mccid_fft0_maskmaxtoneindex_7_0_lsb 0 ++#define p_reg_mccid_fft0_maskmaxtoneindex_12_8 0xF16B ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_pos 0 ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_len 5 ++#define reg_mccid_fft0_maskmaxtoneindex_12_8_lsb 8 ++#define p_reg_mccid_fft0_state 0xF16C ++#define reg_mccid_fft0_state_pos 0 ++#define reg_mccid_fft0_state_len 1 ++#define reg_mccid_fft0_state_lsb 0 ++#define p_reg_mccid_fft1_state 0xF16D ++#define reg_mccid_fft1_state_pos 0 ++#define reg_mccid_fft1_state_len 1 ++#define reg_mccid_fft1_state_lsb 0 ++#define p_reg_mccid_fft0_maskmintoneindex_7_0 0xF16E ++#define reg_mccid_fft0_maskmintoneindex_7_0_pos 0 ++#define reg_mccid_fft0_maskmintoneindex_7_0_len 8 ++#define reg_mccid_fft0_maskmintoneindex_7_0_lsb 0 ++#define p_reg_mccid_fft0_maskmintoneindex_12_8 0xF16F ++#define reg_mccid_fft0_maskmintoneindex_12_8_pos 0 ++#define reg_mccid_fft0_maskmintoneindex_12_8_len 5 ++#define reg_mccid_fft0_maskmintoneindex_12_8_lsb 8 ++#define p_reg_mccid_acipowerlevelfactor 0xF170 ++#define reg_mccid_acipowerlevelfactor_pos 0 ++#define reg_mccid_acipowerlevelfactor_len 3 ++#define reg_mccid_acipowerlevelfactor_lsb 0 ++#define p_reg_mccid_fft1_maskmaxtoneindex_7_0 0xF171 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_pos 0 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_len 8 ++#define reg_mccid_fft1_maskmaxtoneindex_7_0_lsb 0 ++#define p_reg_mccid_fft1_maskmaxtoneindex_12_8 0xF172 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_pos 0 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_len 5 ++#define reg_mccid_fft1_maskmaxtoneindex_12_8_lsb 8 ++#define p_reg_mccid_fft1_maskmintoneindex_7_0 0xF173 ++#define reg_mccid_fft1_maskmintoneindex_7_0_pos 0 ++#define reg_mccid_fft1_maskmintoneindex_7_0_len 8 ++#define reg_mccid_fft1_maskmintoneindex_7_0_lsb 0 ++#define p_reg_mccid_fft1_maskmintoneindex_12_8 0xF174 ++#define reg_mccid_fft1_maskmintoneindex_12_8_pos 0 ++#define reg_mccid_fft1_maskmintoneindex_12_8_len 5 ++#define reg_mccid_fft1_maskmintoneindex_12_8_lsb 8 ++#define p_reg_mccid_reset 0xF175 ++#define reg_mccid_reset_pos 0 ++#define reg_mccid_reset_len 1 ++#define reg_mccid_reset_lsb 0 ++#define p_reg_mccid_gaincmpreset 0xF176 ++#define reg_mccid_gaincmpreset_pos 0 ++#define reg_mccid_gaincmpreset_len 1 ++#define reg_mccid_gaincmpreset_lsb 0 ++#define p_reg_mccid_acwgreset 0xF177 ++#define reg_mccid_acwgreset_pos 0 ++#define reg_mccid_acwgreset_len 1 ++#define reg_mccid_acwgreset_lsb 0 ++#define p_reg_mccid_ccif0_ofsmstateenable 0xF178 ++#define reg_mccid_ccif0_ofsmstateenable_pos 0 ++#define reg_mccid_ccif0_ofsmstateenable_len 1 ++#define reg_mccid_ccif0_ofsmstateenable_lsb 0 ++#define p_reg_mccid_ccif1_ofsmstateenable 0xF179 ++#define reg_mccid_ccif1_ofsmstateenable_pos 0 ++#define reg_mccid_ccif1_ofsmstateenable_len 1 ++#define reg_mccid_ccif1_ofsmstateenable_lsb 0 ++#define p_reg_mccid_fft0_ofsmstateenable 0xF17A ++#define reg_mccid_fft0_ofsmstateenable_pos 0 ++#define reg_mccid_fft0_ofsmstateenable_len 1 ++#define reg_mccid_fft0_ofsmstateenable_lsb 0 ++#define p_reg_mccid_fft1_ofsmstateenable 0xF17B ++#define reg_mccid_fft1_ofsmstateenable_pos 0 ++#define reg_mccid_fft1_ofsmstateenable_len 1 ++#define reg_mccid_fft1_ofsmstateenable_lsb 0 ++#define p_reg_mccid_fftfiltermaskchange 0xF17C ++#define reg_mccid_fftfiltermaskchange_pos 0 ++#define reg_mccid_fftfiltermaskchange_len 1 ++#define reg_mccid_fftfiltermaskchange_lsb 0 ++#define r_reg_mccid_maxacipowertone_7_0 0xF17D ++#define reg_mccid_maxacipowertone_7_0_pos 0 ++#define reg_mccid_maxacipowertone_7_0_len 8 ++#define reg_mccid_maxacipowertone_7_0_lsb 0 ++#define r_reg_mccid_maxacipowertone_12_8 0xF17E ++#define reg_mccid_maxacipowertone_12_8_pos 0 ++#define reg_mccid_maxacipowertone_12_8_len 5 ++#define reg_mccid_maxacipowertone_12_8_lsb 8 ++#define r_reg_mccid_ccidisappear 0xF17F ++#define reg_mccid_ccidisappear_pos 0 ++#define reg_mccid_ccidisappear_len 1 ++#define reg_mccid_ccidisappear_lsb 0 ++#define r_reg_mccid_ccilocatordone 0xF182 ++#define reg_mccid_ccilocatordone_pos 0 ++#define reg_mccid_ccilocatordone_len 1 ++#define reg_mccid_ccilocatordone_lsb 0 ++#define p_reg_mccid_enablecciftrigger 0xF183 ++#define reg_mccid_enablecciftrigger_pos 0 ++#define reg_mccid_enablecciftrigger_len 1 ++#define reg_mccid_enablecciftrigger_lsb 0 ++#define p_reg_mccid_disableacwglaunchevaluationbandwidthtrigger 0xF184 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_pos 0 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_len 1 ++#define reg_mccid_disableacwglaunchevaluationbandwidthtrigger_lsb 0 ++#define p_reg_mccid_control_by_ofsm 0xF185 ++#define reg_mccid_control_by_ofsm_pos 0 ++#define reg_mccid_control_by_ofsm_len 1 ++#define reg_mccid_control_by_ofsm_lsb 0 ++#define p_reg_mccid_ofsmcontrolccilocator 0xF186 ++#define reg_mccid_ofsmcontrolccilocator_pos 0 ++#define reg_mccid_ofsmcontrolccilocator_len 1 ++#define reg_mccid_ofsmcontrolccilocator_lsb 0 ++#define p_reg_mccid_disablepotentialccitriggerccilocator 0xF187 ++#define reg_mccid_disablepotentialccitriggerccilocator_pos 0 ++#define reg_mccid_disablepotentialccitriggerccilocator_len 1 ++#define reg_mccid_disablepotentialccitriggerccilocator_lsb 0 ++#define p_reg_mccid_ofsmcontrolccitesting 0xF188 ++#define reg_mccid_ofsmcontrolccitesting_pos 0 ++#define reg_mccid_ofsmcontrolccitesting_len 1 ++#define reg_mccid_ofsmcontrolccitesting_lsb 0 ++#define p_reg_mccid_disableccitestingtriggercheckcci 0xF189 ++#define reg_mccid_disableccitestingtriggercheckcci_pos 0 ++#define reg_mccid_disableccitestingtriggercheckcci_len 1 ++#define reg_mccid_disableccitestingtriggercheckcci_lsb 0 ++#define p_reg_mccid_ofsmcontrolacwgsetccifscstrobe 0xF18A ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_pos 0 ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_len 1 ++#define reg_mccid_ofsmcontrolacwgsetccifscstrobe_lsb 0 ++#define p_reg_mccid_disableacwgevaluatingbandwidthtrigger 0xF18B ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_pos 0 ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_len 1 ++#define reg_mccid_disableacwgevaluatingbandwidthtrigger_lsb 0 ++#define p_reg_mccid_ofsmcontrolevaluatingbandwidth 0xF18C ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_pos 0 ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_len 1 ++#define reg_mccid_ofsmcontrolevaluatingbandwidth_lsb 0 ++#define p_reg_mccid_ofsmcontrolscanningaci 0xF18D ++#define reg_mccid_ofsmcontrolscanningaci_pos 0 ++#define reg_mccid_ofsmcontrolscanningaci_len 1 ++#define reg_mccid_ofsmcontrolscanningaci_lsb 0 ++#define p_reg_mccid_disablescanningaci 0xF18E ++#define reg_mccid_disablescanningaci_pos 0 ++#define reg_mccid_disablescanningaci_len 1 ++#define reg_mccid_disablescanningaci_lsb 0 ++#define p_reg_mccid_disableacwgccidetecting 0xF18F ++#define reg_mccid_disableacwgccidetecting_pos 0 ++#define reg_mccid_disableacwgccidetecting_len 1 ++#define reg_mccid_disableacwgccidetecting_lsb 0 ++#define p_reg_mccid_ofsmcontrolccitimertrigger 0xF190 ++#define reg_mccid_ofsmcontrolccitimertrigger_pos 0 ++#define reg_mccid_ofsmcontrolccitimertrigger_len 1 ++#define reg_mccid_ofsmcontrolccitimertrigger_lsb 0 ++#define p_reg_mccid_disableccitimertrigger 0xF191 ++#define reg_mccid_disableccitimertrigger_pos 0 ++#define reg_mccid_disableccitimertrigger_len 1 ++#define reg_mccid_disableccitimertrigger_lsb 0 ++#define p_reg_mccid_ofsmdisableccitriggercounting 0xF192 ++#define reg_mccid_ofsmdisableccitriggercounting_pos 0 ++#define reg_mccid_ofsmdisableccitriggercounting_len 1 ++#define reg_mccid_ofsmdisableccitriggercounting_lsb 0 ++#define p_reg_mccid_enableccifilteraci 0xF193 ++#define reg_mccid_enableccifilteraci_pos 0 ++#define reg_mccid_enableccifilteraci_len 1 ++#define reg_mccid_enableccifilteraci_lsb 0 ++#define p_reg_mccid_scannedfcwbfs_7_0 0xF194 ++#define reg_mccid_scannedfcwbfs_7_0_pos 0 ++#define reg_mccid_scannedfcwbfs_7_0_len 8 ++#define reg_mccid_scannedfcwbfs_7_0_lsb 0 ++#define p_reg_mccid_scannedfcwbfs_13_8 0xF195 ++#define reg_mccid_scannedfcwbfs_13_8_pos 0 ++#define reg_mccid_scannedfcwbfs_13_8_len 6 ++#define reg_mccid_scannedfcwbfs_13_8_lsb 8 ++#define p_reg_mccid_acwgevaluatingbandwidth 0xF196 ++#define reg_mccid_acwgevaluatingbandwidth_pos 0 ++#define reg_mccid_acwgevaluatingbandwidth_len 1 ++#define reg_mccid_acwgevaluatingbandwidth_lsb 0 ++#define p_reg_mccid_acwglaunchevaluationbandwidth 0xF197 ++#define reg_mccid_acwglaunchevaluationbandwidth_pos 0 ++#define reg_mccid_acwglaunchevaluationbandwidth_len 1 ++#define reg_mccid_acwglaunchevaluationbandwidth_lsb 0 ++#define p_reg_mccid_scannedcandidate 0xF198 ++#define reg_mccid_scannedcandidate_pos 0 ++#define reg_mccid_scannedcandidate_len 3 ++#define reg_mccid_scannedcandidate_lsb 0 ++#define p_reg_mccid_scstrobesearchingcandidate 0xF199 ++#define reg_mccid_scstrobesearchingcandidate_pos 0 ++#define reg_mccid_scstrobesearchingcandidate_len 2 ++#define reg_mccid_scstrobesearchingcandidate_lsb 0 ++#define p_reg_mccid_potentialcci 0xF19A ++#define reg_mccid_potentialcci_pos 0 ++#define reg_mccid_potentialcci_len 1 ++#define reg_mccid_potentialcci_lsb 0 ++#define p_reg_mccid_cciftimertrigger 0xF19B ++#define reg_mccid_cciftimertrigger_pos 0 ++#define reg_mccid_cciftimertrigger_len 1 ++#define reg_mccid_cciftimertrigger_lsb 0 ++#define p_reg_mccid_ccitesting 0xF19C ++#define reg_mccid_ccitesting_pos 0 ++#define reg_mccid_ccitesting_len 1 ++#define reg_mccid_ccitesting_lsb 0 ++#define p_reg_mccid_defaultccilocatormissno 0xF19D ++#define reg_mccid_defaultccilocatormissno_pos 0 ++#define reg_mccid_defaultccilocatormissno_len 8 ++#define reg_mccid_defaultccilocatormissno_lsb 0 ++#define p_reg_mccid_dagc1_use_despow 0xF19E ++#define reg_mccid_dagc1_use_despow_pos 0 ++#define reg_mccid_dagc1_use_despow_len 1 ++#define reg_mccid_dagc1_use_despow_lsb 0 ++#define p_reg_mccid_scannedacifrequencybegin_7_0 0xF19F ++#define reg_mccid_scannedacifrequencybegin_7_0_pos 0 ++#define reg_mccid_scannedacifrequencybegin_7_0_len 8 ++#define reg_mccid_scannedacifrequencybegin_7_0_lsb 0 ++#define p_reg_mccid_scannedacifrequencybegin_13_8 0xF1A0 ++#define reg_mccid_scannedacifrequencybegin_13_8_pos 0 ++#define reg_mccid_scannedacifrequencybegin_13_8_len 6 ++#define reg_mccid_scannedacifrequencybegin_13_8_lsb 8 ++#define p_reg_mccid_scannedacifrequencyend_7_0 0xF1A1 ++#define reg_mccid_scannedacifrequencyend_7_0_pos 0 ++#define reg_mccid_scannedacifrequencyend_7_0_len 8 ++#define reg_mccid_scannedacifrequencyend_7_0_lsb 0 ++#define p_reg_mccid_scannedacifrequencyend_13_8 0xF1A2 ++#define reg_mccid_scannedacifrequencyend_13_8_pos 0 ++#define reg_mccid_scannedacifrequencyend_13_8_len 6 ++#define reg_mccid_scannedacifrequencyend_13_8_lsb 8 ++#define p_reg_bfs_fcw_7_0 0xF1A3 ++#define reg_bfs_fcw_7_0_pos 0 ++#define reg_bfs_fcw_7_0_len 8 ++#define reg_bfs_fcw_7_0_lsb 0 ++#define p_reg_bfs_fcw_15_8 0xF1A4 ++#define reg_bfs_fcw_15_8_pos 0 ++#define reg_bfs_fcw_15_8_len 8 ++#define reg_bfs_fcw_15_8_lsb 8 ++#define p_reg_bfs_fcw_22_16 0xF1A5 ++#define reg_bfs_fcw_22_16_pos 0 ++#define reg_bfs_fcw_22_16_len 7 ++#define reg_bfs_fcw_22_16_lsb 16 ++#define p_reg_cfoe_fcw_inv 0xF1A6 ++#define reg_cfoe_fcw_inv_pos 0 ++#define reg_cfoe_fcw_inv_len 1 ++#define reg_cfoe_fcw_inv_lsb 0 ++#define p_reg_bfs_0if 0xF1A7 ++#define reg_bfs_0if_pos 0 ++#define reg_bfs_0if_len 1 ++#define reg_bfs_0if_lsb 0 ++#define p_reg_sadc_clk 0xF1A9 ++#define reg_sadc_clk_pos 0 ++#define reg_sadc_clk_len 1 ++#define reg_sadc_clk_lsb 0 ++#define p_reg_sadc_tx 0xF1AA ++#define reg_sadc_tx_pos 0 ++#define reg_sadc_tx_len 1 ++#define reg_sadc_tx_lsb 0 ++#define p_reg_sadc_rx 0xF1AB ++#define reg_sadc_rx_pos 0 ++#define reg_sadc_rx_len 1 ++#define reg_sadc_rx_lsb 0 ++#define p_reg_sadc_cs 0xF1AC ++#define reg_sadc_cs_pos 0 ++#define reg_sadc_cs_len 1 ++#define reg_sadc_cs_lsb 0 ++#define p_reg_fix_fcw_7_0 0xF1AD ++#define reg_fix_fcw_7_0_pos 0 ++#define reg_fix_fcw_7_0_len 8 ++#define reg_fix_fcw_7_0_lsb 0 ++#define p_reg_fix_fcw_15_8 0xF1AE ++#define reg_fix_fcw_15_8_pos 0 ++#define reg_fix_fcw_15_8_len 8 ++#define reg_fix_fcw_15_8_lsb 8 ++#define p_reg_fix_fcw_22_16 0xF1AF ++#define reg_fix_fcw_22_16_pos 0 ++#define reg_fix_fcw_22_16_len 7 ++#define reg_fix_fcw_22_16_lsb 16 ++#define r_reg_bfs_fcw_offset_7_0 0xF1B0 ++#define reg_bfs_fcw_offset_7_0_pos 0 ++#define reg_bfs_fcw_offset_7_0_len 8 ++#define reg_bfs_fcw_offset_7_0_lsb 0 ++#define r_reg_bfs_fcw_offset_15_8 0xF1B1 ++#define reg_bfs_fcw_offset_15_8_pos 0 ++#define reg_bfs_fcw_offset_15_8_len 8 ++#define reg_bfs_fcw_offset_15_8_lsb 8 ++#define r_reg_bfs_fcw_offset_22_16 0xF1B2 ++#define reg_bfs_fcw_offset_22_16_pos 0 ++#define reg_bfs_fcw_offset_22_16_len 7 ++#define reg_bfs_fcw_offset_22_16_lsb 16 ++#define r_bfs_fcw_q_7_0 0xF1B3 ++#define bfs_fcw_q_7_0_pos 0 ++#define bfs_fcw_q_7_0_len 8 ++#define bfs_fcw_q_7_0_lsb 0 ++#define r_bfs_fcw_q_15_8 0xF1B4 ++#define bfs_fcw_q_15_8_pos 0 ++#define bfs_fcw_q_15_8_len 8 ++#define bfs_fcw_q_15_8_lsb 8 ++#define r_bfs_fcw_q_22_16 0xF1B5 ++#define bfs_fcw_q_22_16_pos 0 ++#define bfs_fcw_q_22_16_len 7 ++#define bfs_fcw_q_22_16_lsb 16 ++#define p_reg_dagc3_use_despow 0xF1B6 ++#define reg_dagc3_use_despow_pos 0 ++#define reg_dagc3_use_despow_len 1 ++#define reg_dagc3_use_despow_lsb 0 ++#define p_reg_dagc3_log_2_accumulate 0xF1B7 ++#define reg_dagc3_log_2_accumulate_pos 0 ++#define reg_dagc3_log_2_accumulate_len 5 ++#define reg_dagc3_log_2_accumulate_lsb 0 ++#define p_reg_dagc3_desired_level_7_0 0xF1BC ++#define reg_dagc3_desired_level_7_0_pos 0 ++#define reg_dagc3_desired_level_7_0_len 8 ++#define reg_dagc3_desired_level_7_0_lsb 0 ++#define p_reg_dagc3_desired_level_8 0xF1BD ++#define reg_dagc3_desired_level_8_pos 0 ++#define reg_dagc3_desired_level_8_len 1 ++#define reg_dagc3_desired_level_8_lsb 8 ++#define p_reg_dagc3_apply_delay 0xF1BE ++#define reg_dagc3_apply_delay_pos 0 ++#define reg_dagc3_apply_delay_len 7 ++#define reg_dagc3_apply_delay_lsb 0 ++#define p_reg_dagc3_bp_scale 0xF1BF ++#define reg_dagc3_bp_scale_pos 0 ++#define reg_dagc3_bp_scale_len 3 ++#define reg_dagc3_bp_scale_lsb 0 ++#define p_reg_dagc3_in_sat_cnt_7_0 0xF1C0 ++#define reg_dagc3_in_sat_cnt_7_0_pos 0 ++#define reg_dagc3_in_sat_cnt_7_0_len 8 ++#define reg_dagc3_in_sat_cnt_7_0_lsb 0 ++#define p_reg_dagc3_in_sat_cnt_15_8 0xF1C1 ++#define reg_dagc3_in_sat_cnt_15_8_pos 0 ++#define reg_dagc3_in_sat_cnt_15_8_len 8 ++#define reg_dagc3_in_sat_cnt_15_8_lsb 8 ++#define p_reg_dagc3_in_sat_cnt_23_16 0xF1C2 ++#define reg_dagc3_in_sat_cnt_23_16_pos 0 ++#define reg_dagc3_in_sat_cnt_23_16_len 8 ++#define reg_dagc3_in_sat_cnt_23_16_lsb 16 ++#define p_reg_dagc3_in_sat_cnt_31_24 0xF1C3 ++#define reg_dagc3_in_sat_cnt_31_24_pos 0 ++#define reg_dagc3_in_sat_cnt_31_24_len 8 ++#define reg_dagc3_in_sat_cnt_31_24_lsb 24 ++#define p_reg_dagc3_out_sat_cnt_7_0 0xF1C4 ++#define reg_dagc3_out_sat_cnt_7_0_pos 0 ++#define reg_dagc3_out_sat_cnt_7_0_len 8 ++#define reg_dagc3_out_sat_cnt_7_0_lsb 0 ++#define p_reg_dagc3_out_sat_cnt_15_8 0xF1C5 ++#define reg_dagc3_out_sat_cnt_15_8_pos 0 ++#define reg_dagc3_out_sat_cnt_15_8_len 8 ++#define reg_dagc3_out_sat_cnt_15_8_lsb 8 ++#define p_reg_dagc3_out_sat_cnt_23_16 0xF1C6 ++#define reg_dagc3_out_sat_cnt_23_16_pos 0 ++#define reg_dagc3_out_sat_cnt_23_16_len 8 ++#define reg_dagc3_out_sat_cnt_23_16_lsb 16 ++#define p_reg_dagc3_out_sat_cnt_31_24 0xF1C7 ++#define reg_dagc3_out_sat_cnt_31_24_pos 0 ++#define reg_dagc3_out_sat_cnt_31_24_len 8 ++#define reg_dagc3_out_sat_cnt_31_24_lsb 24 ++#define r_bfs_dagc3_multiplier_7_0 0xF1C8 ++#define bfs_dagc3_multiplier_7_0_pos 0 ++#define bfs_dagc3_multiplier_7_0_len 8 ++#define bfs_dagc3_multiplier_7_0_lsb 0 ++#define r_bfs_dagc3_multiplier_15_8 0xF1C9 ++#define bfs_dagc3_multiplier_15_8_pos 0 ++#define bfs_dagc3_multiplier_15_8_len 8 ++#define bfs_dagc3_multiplier_15_8_lsb 8 ++#define r_bfs_dagc3_right_shift_bits 0xF1CA ++#define bfs_dagc3_right_shift_bits_pos 0 ++#define bfs_dagc3_right_shift_bits_len 4 ++#define bfs_dagc3_right_shift_bits_lsb 0 ++#define p_reg_dagc3_fixed_gain_7_0 0xF1CB ++#define reg_dagc3_fixed_gain_7_0_pos 0 ++#define reg_dagc3_fixed_gain_7_0_len 8 ++#define reg_dagc3_fixed_gain_7_0_lsb 0 ++#define p_reg_dagc3_fixed_gain_11_8 0xF1CC ++#define reg_dagc3_fixed_gain_11_8_pos 0 ++#define reg_dagc3_fixed_gain_11_8_len 4 ++#define reg_dagc3_fixed_gain_11_8_lsb 8 ++#define p_reg_f_adc_7_0 0xF1CD ++#define reg_f_adc_7_0_pos 0 ++#define reg_f_adc_7_0_len 8 ++#define reg_f_adc_7_0_lsb 0 ++#define p_reg_f_adc_15_8 0xF1CE ++#define reg_f_adc_15_8_pos 0 ++#define reg_f_adc_15_8_len 8 ++#define reg_f_adc_15_8_lsb 8 ++#define p_reg_f_adc_23_16 0xF1CF ++#define reg_f_adc_23_16_pos 0 ++#define reg_f_adc_23_16_len 8 ++#define reg_f_adc_23_16_lsb 16 ++#define p_reg_fste_frac_step_size_7_0 0xF1D0 ++#define reg_fste_frac_step_size_7_0_pos 0 ++#define reg_fste_frac_step_size_7_0_len 8 ++#define reg_fste_frac_step_size_7_0_lsb 0 ++#define p_reg_fste_frac_step_size_15_8 0xF1D1 ++#define reg_fste_frac_step_size_15_8_pos 0 ++#define reg_fste_frac_step_size_15_8_len 8 ++#define reg_fste_frac_step_size_15_8_lsb 8 ++#define p_reg_fste_frac_step_size_19_16 0xF1D2 ++#define reg_fste_frac_step_size_19_16_pos 0 ++#define reg_fste_frac_step_size_19_16_len 4 ++#define reg_fste_frac_step_size_19_16_lsb 16 ++#define r_intp_mu_7_0 0xF1D3 ++#define intp_mu_7_0_pos 0 ++#define intp_mu_7_0_len 8 ++#define intp_mu_7_0_lsb 0 ++#define r_intp_mu_15_8 0xF1D4 ++#define intp_mu_15_8_pos 0 ++#define intp_mu_15_8_len 8 ++#define intp_mu_15_8_lsb 8 ++#define r_intp_mu_23_16 0xF1D5 ++#define intp_mu_23_16_pos 0 ++#define intp_mu_23_16_len 8 ++#define intp_mu_23_16_lsb 16 ++#define r_intp_mu_25_24 0xF1D6 ++#define intp_mu_25_24_pos 0 ++#define intp_mu_25_24_len 2 ++#define intp_mu_25_24_lsb 24 ++#define p_intp_muq_7_0 0xF1D7 ++#define intp_muq_7_0_pos 0 ++#define intp_muq_7_0_len 8 ++#define intp_muq_7_0_lsb 0 ++#define p_intp_muq_15_8 0xF1D8 ++#define intp_muq_15_8_pos 0 ++#define intp_muq_15_8_len 8 ++#define intp_muq_15_8_lsb 8 ++#define p_intp_muq_23_16 0xF1D9 ++#define intp_muq_23_16_pos 0 ++#define intp_muq_23_16_len 8 ++#define intp_muq_23_16_lsb 16 ++#define p_reg_sfoe_inv 0xF1DA ++#define reg_sfoe_inv_pos 0 ++#define reg_sfoe_inv_len 1 ++#define reg_sfoe_inv_lsb 0 ++#define p_intp_ext_en 0xF1DB ++#define intp_ext_en_pos 0 ++#define intp_ext_en_len 1 ++#define intp_ext_en_lsb 0 ++#define r_intp_ext_done 0xF1DC ++#define intp_ext_done_pos 0 ++#define intp_ext_done_len 1 ++#define intp_ext_done_lsb 0 ++#define p_intp_ext_in_7_0 0xF1DD ++#define intp_ext_in_7_0_pos 0 ++#define intp_ext_in_7_0_len 8 ++#define intp_ext_in_7_0_lsb 0 ++#define p_intp_ext_in_15_8 0xF1DE ++#define intp_ext_in_15_8_pos 0 ++#define intp_ext_in_15_8_len 8 ++#define intp_ext_in_15_8_lsb 8 ++#define p_intp_ext_in_23_16 0xF1DF ++#define intp_ext_in_23_16_pos 0 ++#define intp_ext_in_23_16_len 8 ++#define intp_ext_in_23_16_lsb 16 ++#define p_intp_ext_in_25_24 0xF1E0 ++#define intp_ext_in_25_24_pos 0 ++#define intp_ext_in_25_24_len 2 ++#define intp_ext_in_25_24_lsb 24 ++#define r_intp_ext_out_7_0 0xF1E1 ++#define intp_ext_out_7_0_pos 0 ++#define intp_ext_out_7_0_len 8 ++#define intp_ext_out_7_0_lsb 0 ++#define r_intp_ext_out_15_8 0xF1E2 ++#define intp_ext_out_15_8_pos 0 ++#define intp_ext_out_15_8_len 8 ++#define intp_ext_out_15_8_lsb 8 ++#define r_intp_ext_out_23_16 0xF1E3 ++#define intp_ext_out_23_16_pos 0 ++#define intp_ext_out_23_16_len 8 ++#define intp_ext_out_23_16_lsb 16 ++#define r_intp_ext_out_28_24 0xF1E4 ++#define intp_ext_out_28_24_pos 0 ++#define intp_ext_out_28_24_len 5 ++#define intp_ext_out_28_24_lsb 24 ++#define p_reg_agc_rst 0xF1E5 ++#define reg_agc_rst_pos 0 ++#define reg_agc_rst_len 1 ++#define reg_agc_rst_lsb 0 ++#define p_rf_agc_en 0xF1E6 ++#define rf_agc_en_pos 0 ++#define rf_agc_en_len 1 ++#define rf_agc_en_lsb 0 ++#define p_agc_lock 0xF1E7 ++#define agc_lock_pos 0 ++#define agc_lock_len 1 ++#define agc_lock_lsb 0 ++#define p_reg_tinr_rst 0xF1E8 ++#define reg_tinr_rst_pos 0 ++#define reg_tinr_rst_len 1 ++#define reg_tinr_rst_lsb 0 ++#define p_reg_tinr_en 0xF1E9 ++#define reg_tinr_en_pos 0 ++#define reg_tinr_en_len 1 ++#define reg_tinr_en_lsb 0 ++#define p_reg_bfs_en 0xF1EA ++#define reg_bfs_en_pos 0 ++#define reg_bfs_en_len 1 ++#define reg_bfs_en_lsb 0 ++#define p_reg_bfs_rst 0xF1EB ++#define reg_bfs_rst_pos 0 ++#define reg_bfs_rst_len 1 ++#define reg_bfs_rst_lsb 0 ++#define p_reg_bfs_byp 0xF1EC ++#define reg_bfs_byp_pos 0 ++#define reg_bfs_byp_len 1 ++#define reg_bfs_byp_lsb 0 ++#define p_intp_en 0xF1EF ++#define intp_en_pos 0 ++#define intp_en_len 1 ++#define intp_en_lsb 0 ++#define p_intp_rst 0xF1F0 ++#define intp_rst_pos 0 ++#define intp_rst_len 1 ++#define intp_rst_lsb 0 ++#define p_reg_p_acif_en 0xF1F2 ++#define reg_p_acif_en_pos 0 ++#define reg_p_acif_en_len 1 ++#define reg_p_acif_en_lsb 0 ++#define p_reg_p_acif_rst 0xF1F3 ++#define reg_p_acif_rst_pos 0 ++#define reg_p_acif_rst_len 1 ++#define reg_p_acif_rst_lsb 0 ++#define p_reg_p_acif_byp 0xF1F4 ++#define reg_p_acif_byp_pos 0 ++#define reg_p_acif_byp_len 1 ++#define reg_p_acif_byp_lsb 0 ++#define p_dagc2_rst 0xF1F6 ++#define dagc2_rst_pos 0 ++#define dagc2_rst_len 1 ++#define dagc2_rst_lsb 0 ++#define p_dagc2_en 0xF1F7 ++#define dagc2_en_pos 0 ++#define dagc2_en_len 1 ++#define dagc2_en_lsb 0 ++#define p_dagc2_mode 0xF1F8 ++#define dagc2_mode_pos 0 ++#define dagc2_mode_len 2 ++#define dagc2_mode_lsb 0 ++#define p_dagc2_done 0xF1F9 ++#define dagc2_done_pos 0 ++#define dagc2_done_len 1 ++#define dagc2_done_lsb 0 ++#define p_dagc3_rst 0xF1FA ++#define dagc3_rst_pos 0 ++#define dagc3_rst_len 1 ++#define dagc3_rst_lsb 0 ++#define p_dagc3_en 0xF1FB ++#define dagc3_en_pos 0 ++#define dagc3_en_len 1 ++#define dagc3_en_lsb 0 ++#define p_dagc3_mode 0xF1FC ++#define dagc3_mode_pos 0 ++#define dagc3_mode_len 2 ++#define dagc3_mode_lsb 0 ++#define p_dagc3_done 0xF1FD ++#define dagc3_done_pos 0 ++#define dagc3_done_len 1 ++#define dagc3_done_lsb 0 ++#define p_reg_dagc2_desired_level_7_0 0xF202 ++#define reg_dagc2_desired_level_7_0_pos 0 ++#define reg_dagc2_desired_level_7_0_len 8 ++#define reg_dagc2_desired_level_7_0_lsb 0 ++#define p_reg_dagc2_desired_level_8 0xF203 ++#define reg_dagc2_desired_level_8_pos 0 ++#define reg_dagc2_desired_level_8_len 1 ++#define reg_dagc2_desired_level_8_lsb 8 ++#define p_reg_dagc2_apply_delay 0xF204 ++#define reg_dagc2_apply_delay_pos 0 ++#define reg_dagc2_apply_delay_len 7 ++#define reg_dagc2_apply_delay_lsb 0 ++#define p_reg_dagc2_bypass_scale_ctl 0xF205 ++#define reg_dagc2_bypass_scale_ctl_pos 0 ++#define reg_dagc2_bypass_scale_ctl_len 3 ++#define reg_dagc2_bypass_scale_ctl_lsb 0 ++#define p_reg_dagc2_programmable_shift2 0xF206 ++#define reg_dagc2_programmable_shift2_pos 0 ++#define reg_dagc2_programmable_shift2_len 8 ++#define reg_dagc2_programmable_shift2_lsb 0 ++#define p_reg_dagc2_in_sat_cnt_7_0 0xF207 ++#define reg_dagc2_in_sat_cnt_7_0_pos 0 ++#define reg_dagc2_in_sat_cnt_7_0_len 8 ++#define reg_dagc2_in_sat_cnt_7_0_lsb 0 ++#define p_reg_dagc2_in_sat_cnt_15_8 0xF208 ++#define reg_dagc2_in_sat_cnt_15_8_pos 0 ++#define reg_dagc2_in_sat_cnt_15_8_len 8 ++#define reg_dagc2_in_sat_cnt_15_8_lsb 8 ++#define p_reg_dagc2_in_sat_cnt_23_16 0xF209 ++#define reg_dagc2_in_sat_cnt_23_16_pos 0 ++#define reg_dagc2_in_sat_cnt_23_16_len 8 ++#define reg_dagc2_in_sat_cnt_23_16_lsb 16 ++#define p_reg_dagc2_in_sat_cnt_31_24 0xF20A ++#define reg_dagc2_in_sat_cnt_31_24_pos 0 ++#define reg_dagc2_in_sat_cnt_31_24_len 8 ++#define reg_dagc2_in_sat_cnt_31_24_lsb 24 ++#define p_reg_dagc2_out_sat_cnt_7_0 0xF20B ++#define reg_dagc2_out_sat_cnt_7_0_pos 0 ++#define reg_dagc2_out_sat_cnt_7_0_len 8 ++#define reg_dagc2_out_sat_cnt_7_0_lsb 0 ++#define p_reg_dagc2_out_sat_cnt_15_8 0xF20C ++#define reg_dagc2_out_sat_cnt_15_8_pos 0 ++#define reg_dagc2_out_sat_cnt_15_8_len 8 ++#define reg_dagc2_out_sat_cnt_15_8_lsb 8 ++#define p_reg_dagc2_out_sat_cnt_23_16 0xF20D ++#define reg_dagc2_out_sat_cnt_23_16_pos 0 ++#define reg_dagc2_out_sat_cnt_23_16_len 8 ++#define reg_dagc2_out_sat_cnt_23_16_lsb 16 ++#define p_reg_dagc2_out_sat_cnt_31_24 0xF20E ++#define reg_dagc2_out_sat_cnt_31_24_pos 0 ++#define reg_dagc2_out_sat_cnt_31_24_len 8 ++#define reg_dagc2_out_sat_cnt_31_24_lsb 24 ++#define r_reg_dagc2_multiplier_7_0 0xF20F ++#define reg_dagc2_multiplier_7_0_pos 0 ++#define reg_dagc2_multiplier_7_0_len 8 ++#define reg_dagc2_multiplier_7_0_lsb 0 ++#define r_reg_dagc2_multiplier_15_8 0xF210 ++#define reg_dagc2_multiplier_15_8_pos 0 ++#define reg_dagc2_multiplier_15_8_len 8 ++#define reg_dagc2_multiplier_15_8_lsb 8 ++#define r_reg_dagc2_right_shift_bits 0xF211 ++#define reg_dagc2_right_shift_bits_pos 0 ++#define reg_dagc2_right_shift_bits_len 4 ++#define reg_dagc2_right_shift_bits_lsb 0 ++#define p_reg_dagc2_smbuf_err 0xF212 ++#define reg_dagc2_smbuf_err_pos 0 ++#define reg_dagc2_smbuf_err_len 1 ++#define reg_dagc2_smbuf_err_lsb 0 ++#define p_reg_dagc2_cplxconj 0xF213 ++#define reg_dagc2_cplxconj_pos 0 ++#define reg_dagc2_cplxconj_len 1 ++#define reg_dagc2_cplxconj_lsb 0 ++#define p_reg_dagc2_use_despow 0xF214 ++#define reg_dagc2_use_despow_pos 0 ++#define reg_dagc2_use_despow_len 1 ++#define reg_dagc2_use_despow_lsb 0 ++#define p_reg_dagc2_log_2_accumulate 0xF215 ++#define reg_dagc2_log_2_accumulate_pos 0 ++#define reg_dagc2_log_2_accumulate_len 5 ++#define reg_dagc2_log_2_accumulate_lsb 0 ++#define r_dagc2_dca_gain 0xF216 ++#define dagc2_dca_gain_pos 0 ++#define dagc2_dca_gain_len 8 ++#define dagc2_dca_gain_lsb 0 ++#define p_reg_dca_gain_offset 0xF217 ++#define reg_dca_gain_offset_pos 0 ++#define reg_dca_gain_offset_len 8 ++#define reg_dca_gain_offset_lsb 0 ++#define p_reg_dagc2_FG_mode 0xF218 ++#define reg_dagc2_FG_mode_pos 0 ++#define reg_dagc2_FG_mode_len 1 ++#define reg_dagc2_FG_mode_lsb 0 ++#define p_reg_dagc2_fixed_gain_7_0 0xF219 ++#define reg_dagc2_fixed_gain_7_0_pos 0 ++#define reg_dagc2_fixed_gain_7_0_len 8 ++#define reg_dagc2_fixed_gain_7_0_lsb 0 ++#define p_reg_dagc2_fixed_gain_11_8 0xF21A ++#define reg_dagc2_fixed_gain_11_8_pos 0 ++#define reg_dagc2_fixed_gain_11_8_len 4 ++#define reg_dagc2_fixed_gain_11_8_lsb 8 ++#define p_reg_td_debug_7_0 0xF21B ++#define reg_td_debug_7_0_pos 0 ++#define reg_td_debug_7_0_len 8 ++#define reg_td_debug_7_0_lsb 0 ++#define p_reg_td_debug_15_8 0xF21C ++#define reg_td_debug_15_8_pos 0 ++#define reg_td_debug_15_8_len 8 ++#define reg_td_debug_15_8_lsb 8 ++#define p_reg_td_debug_23_16 0xF21D ++#define reg_td_debug_23_16_pos 0 ++#define reg_td_debug_23_16_len 8 ++#define reg_td_debug_23_16_lsb 16 ++#define p_reg_td_debug_30_24 0xF21E ++#define reg_td_debug_30_24_pos 0 ++#define reg_td_debug_30_24_len 7 ++#define reg_td_debug_30_24_lsb 24 ++#define g_reg_clk_sys40 0xF90E ++#define reg_clk_sys40_pos 0 ++#define reg_clk_sys40_len 1 ++#define reg_clk_sys40_lsb 0 ++#define g_reg_intp_sys_polarity 0xF90F ++#define reg_intp_sys_polarity_pos 0 ++#define reg_intp_sys_polarity_len 1 ++#define reg_intp_sys_polarity_lsb 0 ++#define g_reg_intp_sys_sc_7_0 0xF910 ++#define reg_intp_sys_sc_7_0_pos 0 ++#define reg_intp_sys_sc_7_0_len 8 ++#define reg_intp_sys_sc_7_0_lsb 0 ++#define g_reg_intp_sys_sc_15_8 0xF911 ++#define reg_intp_sys_sc_15_8_pos 0 ++#define reg_intp_sys_sc_15_8_len 8 ++#define reg_intp_sys_sc_15_8_lsb 8 ++#define g_reg_intp_sys_sc_23_16 0xF912 ++#define reg_intp_sys_sc_23_16_pos 0 ++#define reg_intp_sys_sc_23_16_len 8 ++#define reg_intp_sys_sc_23_16_lsb 16 ++#define g_reg_intp_sys_sc_26_24 0xF913 ++#define reg_intp_sys_sc_26_24_pos 0 ++#define reg_intp_sys_sc_26_24_len 3 ++#define reg_intp_sys_sc_26_24_lsb 24 ++#define g_reg_ofsm_clk 0xF914 ++#define reg_ofsm_clk_pos 0 ++#define reg_ofsm_clk_len 3 ++#define reg_ofsm_clk_lsb 0 ++#define g_reg_fclk_cfg 0xF915 ++#define reg_fclk_cfg_pos 0 ++#define reg_fclk_cfg_len 1 ++#define reg_fclk_cfg_lsb 0 ++#define g_reg_fclk_idi 0xF916 ++#define reg_fclk_idi_pos 0 ++#define reg_fclk_idi_len 1 ++#define reg_fclk_idi_lsb 0 ++#define g_reg_fclk_odi 0xF917 ++#define reg_fclk_odi_pos 0 ++#define reg_fclk_odi_len 1 ++#define reg_fclk_odi_lsb 0 ++#define g_reg_fclk_rsd 0xF918 ++#define reg_fclk_rsd_pos 0 ++#define reg_fclk_rsd_len 1 ++#define reg_fclk_rsd_lsb 0 ++#define g_reg_fclk_vtb 0xF919 ++#define reg_fclk_vtb_pos 0 ++#define reg_fclk_vtb_len 1 ++#define reg_fclk_vtb_lsb 0 ++#define g_reg_fclk_cste 0xF91A ++#define reg_fclk_cste_pos 0 ++#define reg_fclk_cste_len 1 ++#define reg_fclk_cste_lsb 0 ++#define g_reg_fclk_mp2if 0xF91B ++#define reg_fclk_mp2if_pos 0 ++#define reg_fclk_mp2if_len 1 ++#define reg_fclk_mp2if_lsb 0 ++#define p_reg_adcout_sync 0xFA00 ++#define reg_adcout_sync_pos 0 ++#define reg_adcout_sync_len 1 ++#define reg_adcout_sync_lsb 0 ++#define p_reg_dagc2o_edge1 0xFA01 ++#define reg_dagc2o_edge1_pos 0 ++#define reg_dagc2o_edge1_len 1 ++#define reg_dagc2o_edge1_lsb 0 ++#define p_reg_dagc2o_edge0 0xFA02 ++#define reg_dagc2o_edge0_pos 0 ++#define reg_dagc2o_edge0_len 1 ++#define reg_dagc2o_edge0_lsb 0 ++#define p_reg_second_rom_on 0xFA03 ++#define reg_second_rom_on_pos 0 ++#define reg_second_rom_on_len 1 ++#define reg_second_rom_on_lsb 0 ++#define p_reg_bypass_host2tuner 0xFA04 ++#define reg_bypass_host2tuner_pos 0 ++#define reg_bypass_host2tuner_len 1 ++#define reg_bypass_host2tuner_lsb 0 ++#define p_cfoe_NS_coeff1_7_0 0xF400 ++#define cfoe_NS_coeff1_7_0_pos 0 ++#define cfoe_NS_coeff1_7_0_len 8 ++#define cfoe_NS_coeff1_7_0_lsb 0 ++#define p_cfoe_NS_coeff1_15_8 0xF401 ++#define cfoe_NS_coeff1_15_8_pos 0 ++#define cfoe_NS_coeff1_15_8_len 8 ++#define cfoe_NS_coeff1_15_8_lsb 8 ++#define p_cfoe_NS_coeff1_23_16 0xF402 ++#define cfoe_NS_coeff1_23_16_pos 0 ++#define cfoe_NS_coeff1_23_16_len 8 ++#define cfoe_NS_coeff1_23_16_lsb 16 ++#define p_cfoe_NS_coeff1_25_24 0xF403 ++#define cfoe_NS_coeff1_25_24_pos 0 ++#define cfoe_NS_coeff1_25_24_len 2 ++#define cfoe_NS_coeff1_25_24_lsb 24 ++#define p_cfoe_NS_coeff2_7_0 0xF404 ++#define cfoe_NS_coeff2_7_0_pos 0 ++#define cfoe_NS_coeff2_7_0_len 8 ++#define cfoe_NS_coeff2_7_0_lsb 0 ++#define p_cfoe_NS_coeff2_15_8 0xF405 ++#define cfoe_NS_coeff2_15_8_pos 0 ++#define cfoe_NS_coeff2_15_8_len 8 ++#define cfoe_NS_coeff2_15_8_lsb 8 ++#define p_cfoe_NS_coeff2_23_16 0xF406 ++#define cfoe_NS_coeff2_23_16_pos 0 ++#define cfoe_NS_coeff2_23_16_len 8 ++#define cfoe_NS_coeff2_23_16_lsb 16 ++#define p_cfoe_NS_coeff2_24 0xF407 ++#define cfoe_NS_coeff2_24_pos 0 ++#define cfoe_NS_coeff2_24_len 1 ++#define cfoe_NS_coeff2_24_lsb 24 ++#define p_cfoe_lf_c1_7_0 0xF408 ++#define cfoe_lf_c1_7_0_pos 0 ++#define cfoe_lf_c1_7_0_len 8 ++#define cfoe_lf_c1_7_0_lsb 0 ++#define p_cfoe_lf_c1_9_8 0xF409 ++#define cfoe_lf_c1_9_8_pos 0 ++#define cfoe_lf_c1_9_8_len 2 ++#define cfoe_lf_c1_9_8_lsb 8 ++#define p_cfoe_lf_c2_7_0 0xF40A ++#define cfoe_lf_c2_7_0_pos 0 ++#define cfoe_lf_c2_7_0_len 8 ++#define cfoe_lf_c2_7_0_lsb 0 ++#define p_cfoe_lf_c2_9_8 0xF40B ++#define cfoe_lf_c2_9_8_pos 0 ++#define cfoe_lf_c2_9_8_len 2 ++#define cfoe_lf_c2_9_8_lsb 8 ++#define p_cfoe_ifod_7_0 0xF40C ++#define cfoe_ifod_7_0_pos 0 ++#define cfoe_ifod_7_0_len 8 ++#define cfoe_ifod_7_0_lsb 0 ++#define p_cfoe_ifod_10_8 0xF40D ++#define cfoe_ifod_10_8_pos 0 ++#define cfoe_ifod_10_8_len 3 ++#define cfoe_ifod_10_8_lsb 8 ++#define p_cfoe_Divg_ctr_th 0xF40E ++#define cfoe_Divg_ctr_th_pos 0 ++#define cfoe_Divg_ctr_th_len 4 ++#define cfoe_Divg_ctr_th_lsb 0 ++#define p_cfoe_FOT_divg_th 0xF40F ++#define cfoe_FOT_divg_th_pos 0 ++#define cfoe_FOT_divg_th_len 8 ++#define cfoe_FOT_divg_th_lsb 0 ++#define p_cfoe_FOT_cnvg_th 0xF410 ++#define cfoe_FOT_cnvg_th_pos 0 ++#define cfoe_FOT_cnvg_th_len 8 ++#define cfoe_FOT_cnvg_th_lsb 0 ++#define p_reg_cfoe_offset_7_0 0xF411 ++#define reg_cfoe_offset_7_0_pos 0 ++#define reg_cfoe_offset_7_0_len 8 ++#define reg_cfoe_offset_7_0_lsb 0 ++#define p_reg_cfoe_offset_10_8 0xF412 ++#define reg_cfoe_offset_10_8_pos 0 ++#define reg_cfoe_offset_10_8_len 3 ++#define reg_cfoe_offset_10_8_lsb 8 ++#define p_reg_cfoe_ifoe_sign_corr 0xF413 ++#define reg_cfoe_ifoe_sign_corr_pos 0 ++#define reg_cfoe_ifoe_sign_corr_len 1 ++#define reg_cfoe_ifoe_sign_corr_lsb 0 ++#define p_cfoe_FOT_pullin_cnt_clr 0xF414 ++#define cfoe_FOT_pullin_cnt_clr_pos 0 ++#define cfoe_FOT_pullin_cnt_clr_len 1 ++#define cfoe_FOT_pullin_cnt_clr_lsb 0 ++#define p_cfoe_FOT_spec_inv 0xF415 ++#define cfoe_FOT_spec_inv_pos 0 ++#define cfoe_FOT_spec_inv_len 1 ++#define cfoe_FOT_spec_inv_lsb 0 ++#define p_cfoe_FOT_pullin_ctr_th 0xF416 ++#define cfoe_FOT_pullin_ctr_th_pos 0 ++#define cfoe_FOT_pullin_ctr_th_len 4 ++#define cfoe_FOT_pullin_ctr_th_lsb 0 ++#define p_cfoe_FOT_sf_ctr_th 0xF417 ++#define cfoe_FOT_sf_ctr_th_pos 0 ++#define cfoe_FOT_sf_ctr_th_len 4 ++#define cfoe_FOT_sf_ctr_th_lsb 0 ++#define p_cfoe_FOT_pullin_th 0xF418 ++#define cfoe_FOT_pullin_th_pos 0 ++#define cfoe_FOT_pullin_th_len 8 ++#define cfoe_FOT_pullin_th_lsb 0 ++#define p_cfoe_FOT_kalman_cnt 0xF419 ++#define cfoe_FOT_kalman_cnt_pos 0 ++#define cfoe_FOT_kalman_cnt_len 4 ++#define cfoe_FOT_kalman_cnt_lsb 0 ++#define p_cfoe_FOT_fsm_info 0xF41A ++#define cfoe_FOT_fsm_info_pos 0 ++#define cfoe_FOT_fsm_info_len 4 ++#define cfoe_FOT_fsm_info_lsb 0 ++#define r_cfoe_FOT_pullin_cnt 0xF41B ++#define cfoe_FOT_pullin_cnt_pos 0 ++#define cfoe_FOT_pullin_cnt_len 4 ++#define cfoe_FOT_pullin_cnt_lsb 0 ++#define r_cfoe_FOT_sf_cnt 0xF41C ++#define cfoe_FOT_sf_cnt_pos 0 ++#define cfoe_FOT_sf_cnt_len 4 ++#define cfoe_FOT_sf_cnt_lsb 0 ++#define r_reg_r_cfoe_ifoe_ifo_metric 0xF41D ++#define reg_r_cfoe_ifoe_ifo_metric_pos 0 ++#define reg_r_cfoe_ifoe_ifo_metric_len 8 ++#define reg_r_cfoe_ifoe_ifo_metric_lsb 0 ++#define r_reg_r_cfoe_ifoe_cos2num_7_0 0xF41E ++#define reg_r_cfoe_ifoe_cos2num_7_0_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_7_0_len 8 ++#define reg_r_cfoe_ifoe_cos2num_7_0_lsb 0 ++#define r_reg_r_cfoe_ifoe_cos2num_15_8 0xF41F ++#define reg_r_cfoe_ifoe_cos2num_15_8_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_15_8_len 8 ++#define reg_r_cfoe_ifoe_cos2num_15_8_lsb 8 ++#define r_reg_r_cfoe_ifoe_cos2num_19_16 0xF420 ++#define reg_r_cfoe_ifoe_cos2num_19_16_pos 0 ++#define reg_r_cfoe_ifoe_cos2num_19_16_len 4 ++#define reg_r_cfoe_ifoe_cos2num_19_16_lsb 16 ++#define p_ste_Nu 0xF460 ++#define ste_Nu_pos 0 ++#define ste_Nu_len 3 ++#define ste_Nu_lsb 0 ++#define p_ste_GI 0xF461 ++#define ste_GI_pos 0 ++#define ste_GI_len 3 ++#define ste_GI_lsb 0 ++#define p_ste_symbol_num 0xF463 ++#define ste_symbol_num_pos 0 ++#define ste_symbol_num_len 3 ++#define ste_symbol_num_lsb 0 ++#define p_ste_sample_num 0xF464 ++#define ste_sample_num_pos 0 ++#define ste_sample_num_len 2 ++#define ste_sample_num_lsb 0 ++#define p_ste_symbol_num_4K 0xF465 ++#define ste_symbol_num_4K_pos 0 ++#define ste_symbol_num_4K_len 3 ++#define ste_symbol_num_4K_lsb 0 ++#define p_ste_FFT_offset_7_0 0xF466 ++#define ste_FFT_offset_7_0_pos 0 ++#define ste_FFT_offset_7_0_len 8 ++#define ste_FFT_offset_7_0_lsb 0 ++#define p_ste_FFT_offset_13_8 0xF467 ++#define ste_FFT_offset_13_8_pos 0 ++#define ste_FFT_offset_13_8_len 6 ++#define ste_FFT_offset_13_8_lsb 8 ++#define p_ste_sample_num_4K 0xF468 ++#define ste_sample_num_4K_pos 0 ++#define ste_sample_num_4K_len 2 ++#define ste_sample_num_4K_lsb 0 ++#define p_ste_adv_start_7_0 0xF469 ++#define ste_adv_start_7_0_pos 0 ++#define ste_adv_start_7_0_len 8 ++#define ste_adv_start_7_0_lsb 0 ++#define p_ste_adv_start_10_8 0xF46A ++#define ste_adv_start_10_8_pos 0 ++#define ste_adv_start_10_8_len 3 ++#define ste_adv_start_10_8_lsb 8 ++#define p_ste_symbol_num_8K 0xF46B ++#define ste_symbol_num_8K_pos 0 ++#define ste_symbol_num_8K_len 3 ++#define ste_symbol_num_8K_lsb 0 ++#define p_ste_sample_num_8K 0xF46C ++#define ste_sample_num_8K_pos 0 ++#define ste_sample_num_8K_len 2 ++#define ste_sample_num_8K_lsb 0 ++#define p_ste_adv_stop 0xF46D ++#define ste_adv_stop_pos 0 ++#define ste_adv_stop_len 8 ++#define ste_adv_stop_lsb 0 ++#define r_ste_P_value_7_0 0xF46E ++#define ste_P_value_7_0_pos 0 ++#define ste_P_value_7_0_len 8 ++#define ste_P_value_7_0_lsb 0 ++#define r_ste_P_value_10_8 0xF46F ++#define ste_P_value_10_8_pos 0 ++#define ste_P_value_10_8_len 3 ++#define ste_P_value_10_8_lsb 8 ++#define p_reg_ste_tstmod 0xF470 ++#define reg_ste_tstmod_pos 0 ++#define reg_ste_tstmod_len 1 ++#define reg_ste_tstmod_lsb 0 ++#define p_reg_ste_buf_en 0xF471 ++#define reg_ste_buf_en_pos 0 ++#define reg_ste_buf_en_len 1 ++#define reg_ste_buf_en_lsb 0 ++#define r_ste_M_value_7_0 0xF472 ++#define ste_M_value_7_0_pos 0 ++#define ste_M_value_7_0_len 8 ++#define ste_M_value_7_0_lsb 0 ++#define r_ste_M_value_10_8 0xF473 ++#define ste_M_value_10_8_pos 0 ++#define ste_M_value_10_8_len 3 ++#define ste_M_value_10_8_lsb 8 ++#define r_ste_H1 0xF474 ++#define ste_H1_pos 0 ++#define ste_H1_len 7 ++#define ste_H1_lsb 0 ++#define r_ste_H2 0xF475 ++#define ste_H2_pos 0 ++#define ste_H2_len 7 ++#define ste_H2_lsb 0 ++#define r_ste_H3 0xF476 ++#define ste_H3_pos 0 ++#define ste_H3_len 7 ++#define ste_H3_lsb 0 ++#define r_ste_H4 0xF477 ++#define ste_H4_pos 0 ++#define ste_H4_len 7 ++#define ste_H4_lsb 0 ++#define r_ste_Corr_value_I_7_0 0xF478 ++#define ste_Corr_value_I_7_0_pos 0 ++#define ste_Corr_value_I_7_0_len 8 ++#define ste_Corr_value_I_7_0_lsb 0 ++#define r_ste_Corr_value_I_15_8 0xF479 ++#define ste_Corr_value_I_15_8_pos 0 ++#define ste_Corr_value_I_15_8_len 8 ++#define ste_Corr_value_I_15_8_lsb 8 ++#define r_ste_Corr_value_I_23_16 0xF47A ++#define ste_Corr_value_I_23_16_pos 0 ++#define ste_Corr_value_I_23_16_len 8 ++#define ste_Corr_value_I_23_16_lsb 16 ++#define r_ste_Corr_value_I_27_24 0xF47B ++#define ste_Corr_value_I_27_24_pos 0 ++#define ste_Corr_value_I_27_24_len 4 ++#define ste_Corr_value_I_27_24_lsb 24 ++#define r_ste_Corr_value_Q_7_0 0xF47C ++#define ste_Corr_value_Q_7_0_pos 0 ++#define ste_Corr_value_Q_7_0_len 8 ++#define ste_Corr_value_Q_7_0_lsb 0 ++#define r_ste_Corr_value_Q_15_8 0xF47D ++#define ste_Corr_value_Q_15_8_pos 0 ++#define ste_Corr_value_Q_15_8_len 8 ++#define ste_Corr_value_Q_15_8_lsb 8 ++#define r_ste_Corr_value_Q_23_16 0xF47E ++#define ste_Corr_value_Q_23_16_pos 0 ++#define ste_Corr_value_Q_23_16_len 8 ++#define ste_Corr_value_Q_23_16_lsb 16 ++#define r_ste_Corr_value_Q_27_24 0xF47F ++#define ste_Corr_value_Q_27_24_pos 0 ++#define ste_Corr_value_Q_27_24_len 4 ++#define ste_Corr_value_Q_27_24_lsb 24 ++#define r_ste_J_num_7_0 0xF480 ++#define ste_J_num_7_0_pos 0 ++#define ste_J_num_7_0_len 8 ++#define ste_J_num_7_0_lsb 0 ++#define r_ste_J_num_15_8 0xF481 ++#define ste_J_num_15_8_pos 0 ++#define ste_J_num_15_8_len 8 ++#define ste_J_num_15_8_lsb 8 ++#define r_ste_J_num_23_16 0xF482 ++#define ste_J_num_23_16_pos 0 ++#define ste_J_num_23_16_len 8 ++#define ste_J_num_23_16_lsb 16 ++#define r_ste_J_num_31_24 0xF483 ++#define ste_J_num_31_24_pos 0 ++#define ste_J_num_31_24_len 8 ++#define ste_J_num_31_24_lsb 24 ++#define r_ste_J_den_7_0 0xF484 ++#define ste_J_den_7_0_pos 0 ++#define ste_J_den_7_0_len 8 ++#define ste_J_den_7_0_lsb 0 ++#define r_ste_J_den_15_8 0xF485 ++#define ste_J_den_15_8_pos 0 ++#define ste_J_den_15_8_len 8 ++#define ste_J_den_15_8_lsb 8 ++#define r_ste_J_den_18_16 0xF486 ++#define ste_J_den_18_16_pos 0 ++#define ste_J_den_18_16_len 3 ++#define ste_J_den_18_16_lsb 16 ++#define r_ste_Beacon_Indicator 0xF488 ++#define ste_Beacon_Indicator_pos 0 ++#define ste_Beacon_Indicator_len 1 ++#define ste_Beacon_Indicator_lsb 0 ++#define p_ste_got_sntc_bcn 0xF48B ++#define ste_got_sntc_bcn_pos 0 ++#define ste_got_sntc_bcn_len 1 ++#define ste_got_sntc_bcn_lsb 0 ++#define r_tpsd_Frame_Num 0xF4C0 ++#define tpsd_Frame_Num_pos 0 ++#define tpsd_Frame_Num_len 2 ++#define tpsd_Frame_Num_lsb 0 ++#define r_tpsd_Constel 0xF4C1 ++#define tpsd_Constel_pos 0 ++#define tpsd_Constel_len 2 ++#define tpsd_Constel_lsb 0 ++#define r_tpsd_GI 0xF4C2 ++#define tpsd_GI_pos 0 ++#define tpsd_GI_len 2 ++#define tpsd_GI_lsb 0 ++#define r_tpsd_Mode 0xF4C3 ++#define tpsd_Mode_pos 0 ++#define tpsd_Mode_len 2 ++#define tpsd_Mode_lsb 0 ++#define r_tpsd_CR_HP 0xF4C4 ++#define tpsd_CR_HP_pos 0 ++#define tpsd_CR_HP_len 3 ++#define tpsd_CR_HP_lsb 0 ++#define r_tpsd_CR_LP 0xF4C5 ++#define tpsd_CR_LP_pos 0 ++#define tpsd_CR_LP_len 3 ++#define tpsd_CR_LP_lsb 0 ++#define r_tpsd_Hie 0xF4C6 ++#define tpsd_Hie_pos 0 ++#define tpsd_Hie_len 3 ++#define tpsd_Hie_lsb 0 ++#define r_tpsd_Res_Bits 0xF4C7 ++#define tpsd_Res_Bits_pos 0 ++#define tpsd_Res_Bits_len 5 ++#define tpsd_Res_Bits_lsb 0 ++#define r_tpsd_Res_Bits_0 0xF4C8 ++#define tpsd_Res_Bits_0_pos 0 ++#define tpsd_Res_Bits_0_len 1 ++#define tpsd_Res_Bits_0_lsb 0 ++#define r_tpsd_LengthInd 0xF4C9 ++#define tpsd_LengthInd_pos 0 ++#define tpsd_LengthInd_len 6 ++#define tpsd_LengthInd_lsb 0 ++#define r_tpsd_Cell_Id_7_0 0xF4CA ++#define tpsd_Cell_Id_7_0_pos 0 ++#define tpsd_Cell_Id_7_0_len 8 ++#define tpsd_Cell_Id_7_0_lsb 0 ++#define r_tpsd_Cell_Id_15_8 0xF4CB ++#define tpsd_Cell_Id_15_8_pos 0 ++#define tpsd_Cell_Id_15_8_len 8 ++#define tpsd_Cell_Id_15_8_lsb 0 ++#define r_tpsd_use_InDepthInt 0xF4CC ++#define tpsd_use_InDepthInt_pos 0 ++#define tpsd_use_InDepthInt_len 1 ++#define tpsd_use_InDepthInt_lsb 0 ++#define r_tpsd_use_TimeSlicing_HP 0xF4CD ++#define tpsd_use_TimeSlicing_HP_pos 0 ++#define tpsd_use_TimeSlicing_HP_len 1 ++#define tpsd_use_TimeSlicing_HP_lsb 0 ++#define r_tpsd_use_mpe_fec_HP 0xF4CE ++#define tpsd_use_mpe_fec_HP_pos 0 ++#define tpsd_use_mpe_fec_HP_len 1 ++#define tpsd_use_mpe_fec_HP_lsb 0 ++#define r_tpsd_use_TimeSlicing_LP 0xF4CF ++#define tpsd_use_TimeSlicing_LP_pos 0 ++#define tpsd_use_TimeSlicing_LP_len 1 ++#define tpsd_use_TimeSlicing_LP_lsb 0 ++#define r_tpsd_use_mpe_fec_LP 0xF4D0 ++#define tpsd_use_mpe_fec_LP_pos 0 ++#define tpsd_use_mpe_fec_LP_len 1 ++#define tpsd_use_mpe_fec_LP_lsb 0 ++#define r_tpsd_leng23_ind_return 0xF4D1 ++#define tpsd_leng23_ind_return_pos 0 ++#define tpsd_leng23_ind_return_len 1 ++#define tpsd_leng23_ind_return_lsb 0 ++#define p_reg_fft_re_exp 0xF500 ++#define reg_fft_re_exp_pos 0 ++#define reg_fft_re_exp_len 4 ++#define reg_fft_re_exp_lsb 0 ++#define p_reg_fft_re_mts 0xF501 ++#define reg_fft_re_mts_pos 0 ++#define reg_fft_re_mts_len 8 ++#define reg_fft_re_mts_lsb 0 ++#define p_reg_fft_im_exp 0xF502 ++#define reg_fft_im_exp_pos 0 ++#define reg_fft_im_exp_len 4 ++#define reg_fft_im_exp_lsb 0 ++#define p_reg_fft_im_mts 0xF503 ++#define reg_fft_im_mts_pos 0 ++#define reg_fft_im_mts_len 8 ++#define reg_fft_im_mts_lsb 0 ++#define p_reg_fft_conjugate 0xF504 ++#define reg_fft_conjugate_pos 0 ++#define reg_fft_conjugate_len 1 ++#define reg_fft_conjugate_lsb 0 ++#define p_reg_fft_power_en 0xF505 ++#define reg_fft_power_en_pos 0 ++#define reg_fft_power_en_len 1 ++#define reg_fft_power_en_lsb 0 ++#define p_reg_fft_power_factor 0xF506 ++#define reg_fft_power_factor_pos 0 ++#define reg_fft_power_factor_len 6 ++#define reg_fft_power_factor_lsb 0 ++#define p_reg_fft_power_in 0xF507 ++#define reg_fft_power_in_pos 0 ++#define reg_fft_power_in_len 8 ++#define reg_fft_power_in_lsb 0 ++#define p_reg_fft_mask_from0_7_0 0xF508 ++#define reg_fft_mask_from0_7_0_pos 0 ++#define reg_fft_mask_from0_7_0_len 8 ++#define reg_fft_mask_from0_7_0_lsb 0 ++#define p_reg_fft_mask_from0_12_8 0xF509 ++#define reg_fft_mask_from0_12_8_pos 0 ++#define reg_fft_mask_from0_12_8_len 5 ++#define reg_fft_mask_from0_12_8_lsb 8 ++#define p_reg_fft_mask_to0_7_0 0xF50A ++#define reg_fft_mask_to0_7_0_pos 0 ++#define reg_fft_mask_to0_7_0_len 8 ++#define reg_fft_mask_to0_7_0_lsb 0 ++#define p_reg_fft_mask_to0_12_8 0xF50B ++#define reg_fft_mask_to0_12_8_pos 0 ++#define reg_fft_mask_to0_12_8_len 5 ++#define reg_fft_mask_to0_12_8_lsb 8 ++#define p_reg_fft_mask_from1_7_0 0xF50C ++#define reg_fft_mask_from1_7_0_pos 0 ++#define reg_fft_mask_from1_7_0_len 8 ++#define reg_fft_mask_from1_7_0_lsb 0 ++#define p_reg_fft_mask_from1_12_8 0xF50D ++#define reg_fft_mask_from1_12_8_pos 0 ++#define reg_fft_mask_from1_12_8_len 5 ++#define reg_fft_mask_from1_12_8_lsb 8 ++#define p_reg_fft_mask_to1_7_0 0xF50E ++#define reg_fft_mask_to1_7_0_pos 0 ++#define reg_fft_mask_to1_7_0_len 8 ++#define reg_fft_mask_to1_7_0_lsb 0 ++#define p_reg_fft_mask_to1_12_8 0xF50F ++#define reg_fft_mask_to1_12_8_pos 0 ++#define reg_fft_mask_to1_12_8_len 5 ++#define reg_fft_mask_to1_12_8_lsb 8 ++#define p_reg_fft_mask_from2_7_0 0xF510 ++#define reg_fft_mask_from2_7_0_pos 0 ++#define reg_fft_mask_from2_7_0_len 8 ++#define reg_fft_mask_from2_7_0_lsb 0 ++#define p_reg_fft_mask_from2_12_8 0xF511 ++#define reg_fft_mask_from2_12_8_pos 0 ++#define reg_fft_mask_from2_12_8_len 5 ++#define reg_fft_mask_from2_12_8_lsb 8 ++#define p_reg_fft_mask_to2_7_0 0xF512 ++#define reg_fft_mask_to2_7_0_pos 0 ++#define reg_fft_mask_to2_7_0_len 8 ++#define reg_fft_mask_to2_7_0_lsb 0 ++#define p_reg_fft_mask_to2_12_8 0xF513 ++#define reg_fft_mask_to2_12_8_pos 0 ++#define reg_fft_mask_to2_12_8_len 5 ++#define reg_fft_mask_to2_12_8_lsb 8 ++#define p_reg_fft_mask_from3_7_0 0xF514 ++#define reg_fft_mask_from3_7_0_pos 0 ++#define reg_fft_mask_from3_7_0_len 8 ++#define reg_fft_mask_from3_7_0_lsb 0 ++#define p_reg_fft_mask_from3_12_8 0xF515 ++#define reg_fft_mask_from3_12_8_pos 0 ++#define reg_fft_mask_from3_12_8_len 5 ++#define reg_fft_mask_from3_12_8_lsb 8 ++#define p_reg_fft_mask_to3_7_0 0xF516 ++#define reg_fft_mask_to3_7_0_pos 0 ++#define reg_fft_mask_to3_7_0_len 8 ++#define reg_fft_mask_to3_7_0_lsb 0 ++#define p_reg_fft_mask_to3_12_8 0xF517 ++#define reg_fft_mask_to3_12_8_pos 0 ++#define reg_fft_mask_to3_12_8_len 5 ++#define reg_fft_mask_to3_12_8_lsb 8 ++#define r_fd_sntc_frame_num 0xF518 ++#define fd_sntc_frame_num_pos 0 ++#define fd_sntc_frame_num_len 2 ++#define fd_sntc_frame_num_lsb 0 ++#define r_fd_sntc_symbol_count 0xF519 ++#define fd_sntc_symbol_count_pos 0 ++#define fd_sntc_symbol_count_len 7 ++#define fd_sntc_symbol_count_lsb 0 ++#define p_reg_sntc_cnt_lo 0xF51A ++#define reg_sntc_cnt_lo_pos 0 ++#define reg_sntc_cnt_lo_len 8 ++#define reg_sntc_cnt_lo_lsb 0 ++#define p_reg_sntc_cnt_hi 0xF51B ++#define reg_sntc_cnt_hi_pos 0 ++#define reg_sntc_cnt_hi_len 7 ++#define reg_sntc_cnt_hi_lsb 0 ++#define p_reg_sntc_fft_in 0xF51C ++#define reg_sntc_fft_in_pos 0 ++#define reg_sntc_fft_in_len 1 ++#define reg_sntc_fft_in_lsb 0 ++#define r_fd_sntc_en 0xF51D ++#define fd_sntc_en_pos 0 ++#define fd_sntc_en_len 1 ++#define fd_sntc_en_lsb 0 ++#define p_reg_sntc_x2 0xF51E ++#define reg_sntc_x2_pos 0 ++#define reg_sntc_x2_len 1 ++#define reg_sntc_x2_lsb 0 ++#define p_reg_cge_en_7_0 0xF51F ++#define reg_cge_en_7_0_pos 0 ++#define reg_cge_en_7_0_len 8 ++#define reg_cge_en_7_0_lsb 0 ++#define p_reg_cge_en_15_8 0xF520 ++#define reg_cge_en_15_8_pos 0 ++#define reg_cge_en_15_8_len 8 ++#define reg_cge_en_15_8_lsb 8 ++#define p_reg_cge_en_23_16 0xF521 ++#define reg_cge_en_23_16_pos 0 ++#define reg_cge_en_23_16_len 8 ++#define reg_cge_en_23_16_lsb 16 ++#define p_reg_cge_en_31_24 0xF522 ++#define reg_cge_en_31_24_pos 0 ++#define reg_cge_en_31_24_len 8 ++#define reg_cge_en_31_24_lsb 24 ++#define p_reg_cge_en_39_32 0xF523 ++#define reg_cge_en_39_32_pos 0 ++#define reg_cge_en_39_32_len 8 ++#define reg_cge_en_39_32_lsb 32 ++#define p_reg_cge_en_43_40 0xF524 ++#define reg_cge_en_43_40_pos 0 ++#define reg_cge_en_43_40_len 4 ++#define reg_cge_en_43_40_lsb 40 ++#define p_reg_fft_sat_en 0xF525 ++#define reg_fft_sat_en_pos 0 ++#define reg_fft_sat_en_len 1 ++#define reg_fft_sat_en_lsb 0 ++#define p_reg_fft_sat_count_clr 0xF526 ++#define reg_fft_sat_count_clr_pos 0 ++#define reg_fft_sat_count_clr_len 1 ++#define reg_fft_sat_count_clr_lsb 0 ++#define p_reg_fft_rescale_round 0xF527 ++#define reg_fft_rescale_round_pos 0 ++#define reg_fft_rescale_round_len 1 ++#define reg_fft_rescale_round_lsb 0 ++#define r_reg_fft_sat_count_12_7_0 0xF528 ++#define reg_fft_sat_count_12_7_0_pos 0 ++#define reg_fft_sat_count_12_7_0_len 8 ++#define reg_fft_sat_count_12_7_0_lsb 0 ++#define r_reg_fft_sat_count_12_15_8 0xF529 ++#define reg_fft_sat_count_12_15_8_pos 0 ++#define reg_fft_sat_count_12_15_8_len 8 ++#define reg_fft_sat_count_12_15_8_lsb 8 ++#define r_reg_fft_sat_count_10_7_0 0xF52A ++#define reg_fft_sat_count_10_7_0_pos 0 ++#define reg_fft_sat_count_10_7_0_len 8 ++#define reg_fft_sat_count_10_7_0_lsb 0 ++#define r_reg_fft_sat_count_10_15_8 0xF52B ++#define reg_fft_sat_count_10_15_8_pos 0 ++#define reg_fft_sat_count_10_15_8_len 8 ++#define reg_fft_sat_count_10_15_8_lsb 8 ++#define p_reg_fft_capture_idx_7_0 0xF52C ++#define reg_fft_capture_idx_7_0_pos 0 ++#define reg_fft_capture_idx_7_0_len 8 ++#define reg_fft_capture_idx_7_0_lsb 0 ++#define p_reg_fft_capture_idx_12_8 0xF52D ++#define reg_fft_capture_idx_12_8_pos 0 ++#define reg_fft_capture_idx_12_8_len 5 ++#define reg_fft_capture_idx_12_8_lsb 8 ++#define p_reg_fft_capture 0xF52E ++#define reg_fft_capture_pos 0 ++#define reg_fft_capture_len 1 ++#define reg_fft_capture_lsb 0 ++#define p_reg_gp_trigger_fd 0xF52F ++#define reg_gp_trigger_fd_pos 0 ++#define reg_gp_trigger_fd_len 1 ++#define reg_gp_trigger_fd_lsb 0 ++#define p_reg_trigger_sel_fd 0xF530 ++#define reg_trigger_sel_fd_pos 0 ++#define reg_trigger_sel_fd_len 2 ++#define reg_trigger_sel_fd_lsb 0 ++#define p_reg_trigger_module_sel_fd 0xF531 ++#define reg_trigger_module_sel_fd_pos 0 ++#define reg_trigger_module_sel_fd_len 6 ++#define reg_trigger_module_sel_fd_lsb 0 ++#define p_reg_trigger_set_sel_fd 0xF532 ++#define reg_trigger_set_sel_fd_pos 0 ++#define reg_trigger_set_sel_fd_len 6 ++#define reg_trigger_set_sel_fd_lsb 0 ++#define r_reg_fft_idx_pre_max_7_0 0xF533 ++#define reg_fft_idx_pre_max_7_0_pos 0 ++#define reg_fft_idx_pre_max_7_0_len 8 ++#define reg_fft_idx_pre_max_7_0_lsb 0 ++#define r_reg_fft_idx_pre_max_12_8 0xF534 ++#define reg_fft_idx_pre_max_12_8_pos 0 ++#define reg_fft_idx_pre_max_12_8_len 5 ++#define reg_fft_idx_pre_max_12_8_lsb 8 ++#define r_reg_fft_crc 0xF535 ++#define reg_fft_crc_pos 0 ++#define reg_fft_crc_len 8 ++#define reg_fft_crc_lsb 0 ++#define p_fd_fft_shift_max 0xF536 ++#define fd_fft_shift_max_pos 0 ++#define fd_fft_shift_max_len 4 ++#define fd_fft_shift_max_lsb 0 ++#define p_fd_fft_frame_num 0xF537 ++#define fd_fft_frame_num_pos 0 ++#define fd_fft_frame_num_len 2 ++#define fd_fft_frame_num_lsb 0 ++#define p_fd_fft_symbol_count 0xF538 ++#define fd_fft_symbol_count_pos 0 ++#define fd_fft_symbol_count_len 7 ++#define fd_fft_symbol_count_lsb 0 ++#define r_reg_fft_idx_max_7_0 0xF539 ++#define reg_fft_idx_max_7_0_pos 0 ++#define reg_fft_idx_max_7_0_len 8 ++#define reg_fft_idx_max_7_0_lsb 0 ++#define r_reg_fft_idx_max_12_8 0xF53A ++#define reg_fft_idx_max_12_8_pos 0 ++#define reg_fft_idx_max_12_8_len 5 ++#define reg_fft_idx_max_12_8_lsb 8 ++#define p_reg_fft_rotate_en 0xF53B ++#define reg_fft_rotate_en_pos 0 ++#define reg_fft_rotate_en_len 1 ++#define reg_fft_rotate_en_lsb 0 ++#define p_reg_fft_rotate_base_7_0 0xF53C ++#define reg_fft_rotate_base_7_0_pos 0 ++#define reg_fft_rotate_base_7_0_len 8 ++#define reg_fft_rotate_base_7_0_lsb 0 ++#define p_reg_fft_rotate_base_12_8 0xF53D ++#define reg_fft_rotate_base_12_8_pos 0 ++#define reg_fft_rotate_base_12_8_len 5 ++#define reg_fft_rotate_base_12_8_lsb 8 ++#define r_fd_fpcc_cp_corr_signn 0xF53E ++#define fd_fpcc_cp_corr_signn_pos 0 ++#define fd_fpcc_cp_corr_signn_len 8 ++#define fd_fpcc_cp_corr_signn_lsb 0 ++#define p_reg_feq_s1 0xF53F ++#define reg_feq_s1_pos 0 ++#define reg_feq_s1_len 5 ++#define reg_feq_s1_lsb 0 ++#define p_reg_feq_sat_ind 0xF540 ++#define reg_feq_sat_ind_pos 0 ++#define reg_feq_sat_ind_len 3 ++#define reg_feq_sat_ind_lsb 0 ++#define p_reg_p_csi_cal_en 0xF541 ++#define reg_p_csi_cal_en_pos 0 ++#define reg_p_csi_cal_en_len 1 ++#define reg_p_csi_cal_en_lsb 0 ++#define p_reg_p_csi_ar_mode 0xF542 ++#define reg_p_csi_ar_mode_pos 0 ++#define reg_p_csi_ar_mode_len 2 ++#define reg_p_csi_ar_mode_lsb 0 ++#define p_reg_p_csi_accu_sym_num 0xF543 ++#define reg_p_csi_accu_sym_num_pos 0 ++#define reg_p_csi_accu_sym_num_len 8 ++#define reg_p_csi_accu_sym_num_lsb 0 ++#define p_reg_p_csi_eh2_shift_thr 0xF544 ++#define reg_p_csi_eh2_shift_thr_pos 0 ++#define reg_p_csi_eh2_shift_thr_len 4 ++#define reg_p_csi_eh2_shift_thr_lsb 0 ++#define p_reg_p_feq_protect_eh2_shift_thr 0xF545 ++#define reg_p_feq_protect_eh2_shift_thr_pos 0 ++#define reg_p_feq_protect_eh2_shift_thr_len 4 ++#define reg_p_feq_protect_eh2_shift_thr_lsb 0 ++#define p_reg_p_csi_error_accu_s1 0xF546 ++#define reg_p_csi_error_accu_s1_pos 0 ++#define reg_p_csi_error_accu_s1_len 6 ++#define reg_p_csi_error_accu_s1_lsb 0 ++#define p_reg_p_csi_shift2 0xF547 ++#define reg_p_csi_shift2_pos 0 ++#define reg_p_csi_shift2_len 4 ++#define reg_p_csi_shift2_lsb 0 ++#define p_reg_p_csi_mul2 0xF548 ++#define reg_p_csi_mul2_pos 0 ++#define reg_p_csi_mul2_len 8 ++#define reg_p_csi_mul2_lsb 0 ++#define p_reg_p_csi_level2_7_0 0xF549 ++#define reg_p_csi_level2_7_0_pos 0 ++#define reg_p_csi_level2_7_0_len 8 ++#define reg_p_csi_level2_7_0_lsb 0 ++#define p_reg_p_csi_level2_8 0xF54A ++#define reg_p_csi_level2_8_pos 0 ++#define reg_p_csi_level2_8_len 1 ++#define reg_p_csi_level2_8_lsb 8 ++#define p_reg_p_feq_protect_ratio 0xF54B ++#define reg_p_feq_protect_ratio_pos 0 ++#define reg_p_feq_protect_ratio_len 8 ++#define reg_p_feq_protect_ratio_lsb 0 ++#define r_reg_csi_rdy 0xF54C ++#define reg_csi_rdy_pos 0 ++#define reg_csi_rdy_len 1 ++#define reg_csi_rdy_lsb 0 ++#define p_reg_p_feq_h2protect_en 0xF54D ++#define reg_p_feq_h2protect_en_pos 0 ++#define reg_p_feq_h2protect_en_len 1 ++#define reg_p_feq_h2protect_en_lsb 0 ++#define r_reg_tpsd_lock_f0 0xF54E ++#define reg_tpsd_lock_f0_pos 0 ++#define reg_tpsd_lock_f0_len 1 ++#define reg_tpsd_lock_f0_lsb 0 ++#define r_reg_tpsd_lock_f1 0xF54F ++#define reg_tpsd_lock_f1_pos 0 ++#define reg_tpsd_lock_f1_len 1 ++#define reg_tpsd_lock_f1_lsb 0 ++#define p_reg_p_csi_sp_idx_7_0 0xF550 ++#define reg_p_csi_sp_idx_7_0_pos 0 ++#define reg_p_csi_sp_idx_7_0_len 8 ++#define reg_p_csi_sp_idx_7_0_lsb 0 ++#define p_reg_p_csi_sp_idx_11_8 0xF551 ++#define reg_p_csi_sp_idx_11_8_pos 0 ++#define reg_p_csi_sp_idx_11_8_len 4 ++#define reg_p_csi_sp_idx_11_8_lsb 8 ++#define p_fd_fpcc_cp_corr_tone_th 0xF552 ++#define fd_fpcc_cp_corr_tone_th_pos 0 ++#define fd_fpcc_cp_corr_tone_th_len 6 ++#define fd_fpcc_cp_corr_tone_th_lsb 0 ++#define p_fd_fpcc_cp_corr_symbol_log_th 0xF553 ++#define fd_fpcc_cp_corr_symbol_log_th_pos 0 ++#define fd_fpcc_cp_corr_symbol_log_th_len 4 ++#define fd_fpcc_cp_corr_symbol_log_th_lsb 0 ++#define p_fd_fpcc_cp_corr_int 0xF554 ++#define fd_fpcc_cp_corr_int_pos 0 ++#define fd_fpcc_cp_corr_int_len 1 ++#define fd_fpcc_cp_corr_int_lsb 0 ++#define p_reg_fpcc_cp_memidx 0xF555 ++#define reg_fpcc_cp_memidx_pos 0 ++#define reg_fpcc_cp_memidx_len 8 ++#define reg_fpcc_cp_memidx_lsb 0 ++#define p_reg_fpcc_cpmask_en 0xF556 ++#define reg_fpcc_cpmask_en_pos 0 ++#define reg_fpcc_cpmask_en_len 1 ++#define reg_fpcc_cpmask_en_lsb 0 ++#define p_reg_fpcc_cp_grpidx 0xF557 ++#define reg_fpcc_cp_grpidx_pos 0 ++#define reg_fpcc_cp_grpidx_len 5 ++#define reg_fpcc_cp_grpidx_lsb 0 ++#define r_reg_fpcc_cp_sts 0xF558 ++#define reg_fpcc_cp_sts_pos 0 ++#define reg_fpcc_cp_sts_len 1 ++#define reg_fpcc_cp_sts_lsb 0 ++#define p_reg_sfoe_ns_7_0 0xF559 ++#define reg_sfoe_ns_7_0_pos 0 ++#define reg_sfoe_ns_7_0_len 8 ++#define reg_sfoe_ns_7_0_lsb 0 ++#define p_reg_sfoe_ns_14_8 0xF55A ++#define reg_sfoe_ns_14_8_pos 0 ++#define reg_sfoe_ns_14_8_len 7 ++#define reg_sfoe_ns_14_8_lsb 8 ++#define p_reg_sfoe_c1_7_0 0xF55B ++#define reg_sfoe_c1_7_0_pos 0 ++#define reg_sfoe_c1_7_0_len 8 ++#define reg_sfoe_c1_7_0_lsb 0 ++#define p_reg_sfoe_c1_9_8 0xF55C ++#define reg_sfoe_c1_9_8_pos 0 ++#define reg_sfoe_c1_9_8_len 2 ++#define reg_sfoe_c1_9_8_lsb 8 ++#define p_reg_sfoe_c2_7_0 0xF55D ++#define reg_sfoe_c2_7_0_pos 0 ++#define reg_sfoe_c2_7_0_len 8 ++#define reg_sfoe_c2_7_0_lsb 0 ++#define p_reg_sfoe_c2_9_8 0xF55E ++#define reg_sfoe_c2_9_8_pos 0 ++#define reg_sfoe_c2_9_8_len 2 ++#define reg_sfoe_c2_9_8_lsb 8 ++#define p_reg_sfoe_lm_counter_th 0xF55F ++#define reg_sfoe_lm_counter_th_pos 0 ++#define reg_sfoe_lm_counter_th_len 4 ++#define reg_sfoe_lm_counter_th_lsb 0 ++#define p_reg_sfoe_spec_inv 0xF560 ++#define reg_sfoe_spec_inv_pos 0 ++#define reg_sfoe_spec_inv_len 1 ++#define reg_sfoe_spec_inv_lsb 0 ++#define p_reg_sfoe_convg_th 0xF561 ++#define reg_sfoe_convg_th_pos 0 ++#define reg_sfoe_convg_th_len 8 ++#define reg_sfoe_convg_th_lsb 0 ++#define p_reg_sfoe_divg_th 0xF562 ++#define reg_sfoe_divg_th_pos 0 ++#define reg_sfoe_divg_th_len 8 ++#define reg_sfoe_divg_th_lsb 0 ++#define p_reg_sfoe_pullin_ctr_th 0xF563 ++#define reg_sfoe_pullin_ctr_th_pos 0 ++#define reg_sfoe_pullin_ctr_th_len 4 ++#define reg_sfoe_pullin_ctr_th_lsb 0 ++#define p_reg_sfoe_sf_ctr_th 0xF564 ++#define reg_sfoe_sf_ctr_th_pos 0 ++#define reg_sfoe_sf_ctr_th_len 4 ++#define reg_sfoe_sf_ctr_th_lsb 0 ++#define p_reg_sfoe_pullin_th 0xF565 ++#define reg_sfoe_pullin_th_pos 0 ++#define reg_sfoe_pullin_th_len 8 ++#define reg_sfoe_pullin_th_lsb 0 ++#define p_reg_sfoe_kalman_cnt 0xF566 ++#define reg_sfoe_kalman_cnt_pos 0 ++#define reg_sfoe_kalman_cnt_len 4 ++#define reg_sfoe_kalman_cnt_lsb 0 ++#define p_reg_sfoe_fsm_info 0xF567 ++#define reg_sfoe_fsm_info_pos 0 ++#define reg_sfoe_fsm_info_len 4 ++#define reg_sfoe_fsm_info_lsb 0 ++#define r_reg_sfoe_pullin_cnt 0xF568 ++#define reg_sfoe_pullin_cnt_pos 0 ++#define reg_sfoe_pullin_cnt_len 4 ++#define reg_sfoe_pullin_cnt_lsb 0 ++#define r_reg_sfoe_sf_cnt 0xF569 ++#define reg_sfoe_sf_cnt_pos 0 ++#define reg_sfoe_sf_cnt_len 4 ++#define reg_sfoe_sf_cnt_lsb 0 ++#define p_reg_fste_phase_ini_7_0 0xF56A ++#define reg_fste_phase_ini_7_0_pos 0 ++#define reg_fste_phase_ini_7_0_len 8 ++#define reg_fste_phase_ini_7_0_lsb 0 ++#define p_reg_fste_phase_ini_11_8 0xF56B ++#define reg_fste_phase_ini_11_8_pos 0 ++#define reg_fste_phase_ini_11_8_len 4 ++#define reg_fste_phase_ini_11_8_lsb 8 ++#define p_reg_fste_phase_inc_7_0 0xF56C ++#define reg_fste_phase_inc_7_0_pos 0 ++#define reg_fste_phase_inc_7_0_len 8 ++#define reg_fste_phase_inc_7_0_lsb 0 ++#define p_reg_fste_phase_inc_11_8 0xF56D ++#define reg_fste_phase_inc_11_8_pos 0 ++#define reg_fste_phase_inc_11_8_len 4 ++#define reg_fste_phase_inc_11_8_lsb 8 ++#define p_reg_fste_acum_cost_cnt_max 0xF56E ++#define reg_fste_acum_cost_cnt_max_pos 0 ++#define reg_fste_acum_cost_cnt_max_len 4 ++#define reg_fste_acum_cost_cnt_max_lsb 0 ++#define p_reg_fste_step_size_std 0xF56F ++#define reg_fste_step_size_std_pos 0 ++#define reg_fste_step_size_std_len 4 ++#define reg_fste_step_size_std_lsb 0 ++#define p_reg_fste_step_size_max 0xF570 ++#define reg_fste_step_size_max_pos 0 ++#define reg_fste_step_size_max_len 4 ++#define reg_fste_step_size_max_lsb 0 ++#define p_reg_fste_rpd_dir_cnt_max 0xF571 ++#define reg_fste_rpd_dir_cnt_max_pos 0 ++#define reg_fste_rpd_dir_cnt_max_len 4 ++#define reg_fste_rpd_dir_cnt_max_lsb 0 ++#define p_reg_fste_frac_cost_cnt_max_7_0 0xF572 ++#define reg_fste_frac_cost_cnt_max_7_0_pos 0 ++#define reg_fste_frac_cost_cnt_max_7_0_len 8 ++#define reg_fste_frac_cost_cnt_max_7_0_lsb 0 ++#define p_reg_fste_frac_cost_cnt_max_9_8 0xF573 ++#define reg_fste_frac_cost_cnt_max_9_8_pos 0 ++#define reg_fste_frac_cost_cnt_max_9_8_len 2 ++#define reg_fste_frac_cost_cnt_max_9_8_lsb 8 ++#define p_reg_fste_isLongWeakTail 0xF574 ++#define reg_fste_isLongWeakTail_pos 0 ++#define reg_fste_isLongWeakTail_len 1 ++#define reg_fste_isLongWeakTail_lsb 0 ++#define p_reg_fste_isLongWeakHead 0xF575 ++#define reg_fste_isLongWeakHead_pos 0 ++#define reg_fste_isLongWeakHead_len 1 ++#define reg_fste_isLongWeakHead_lsb 0 ++#define p_reg_fste_w0_7_0 0xF576 ++#define reg_fste_w0_7_0_pos 0 ++#define reg_fste_w0_7_0_len 8 ++#define reg_fste_w0_7_0_lsb 0 ++#define p_reg_fste_w0_9_8 0xF577 ++#define reg_fste_w0_9_8_pos 0 ++#define reg_fste_w0_9_8_len 2 ++#define reg_fste_w0_9_8_lsb 8 ++#define p_reg_fste_w1_7_0 0xF578 ++#define reg_fste_w1_7_0_pos 0 ++#define reg_fste_w1_7_0_len 8 ++#define reg_fste_w1_7_0_lsb 0 ++#define p_reg_fste_w1_9_8 0xF579 ++#define reg_fste_w1_9_8_pos 0 ++#define reg_fste_w1_9_8_len 2 ++#define reg_fste_w1_9_8_lsb 8 ++#define p_reg_fste_w2_7_0 0xF57A ++#define reg_fste_w2_7_0_pos 0 ++#define reg_fste_w2_7_0_len 8 ++#define reg_fste_w2_7_0_lsb 0 ++#define p_reg_fste_w2_9_8 0xF57B ++#define reg_fste_w2_9_8_pos 0 ++#define reg_fste_w2_9_8_len 2 ++#define reg_fste_w2_9_8_lsb 8 ++#define p_reg_fste_w3_7_0 0xF57C ++#define reg_fste_w3_7_0_pos 0 ++#define reg_fste_w3_7_0_len 8 ++#define reg_fste_w3_7_0_lsb 0 ++#define p_reg_fste_w3_9_8 0xF57D ++#define reg_fste_w3_9_8_pos 0 ++#define reg_fste_w3_9_8_len 2 ++#define reg_fste_w3_9_8_lsb 8 ++#define p_reg_fste_w4_7_0 0xF57E ++#define reg_fste_w4_7_0_pos 0 ++#define reg_fste_w4_7_0_len 8 ++#define reg_fste_w4_7_0_lsb 0 ++#define p_reg_fste_w4_9_8 0xF57F ++#define reg_fste_w4_9_8_pos 0 ++#define reg_fste_w4_9_8_len 2 ++#define reg_fste_w4_9_8_lsb 8 ++#define p_reg_fste_w5_7_0 0xF580 ++#define reg_fste_w5_7_0_pos 0 ++#define reg_fste_w5_7_0_len 8 ++#define reg_fste_w5_7_0_lsb 0 ++#define p_reg_fste_w5_9_8 0xF581 ++#define reg_fste_w5_9_8_pos 0 ++#define reg_fste_w5_9_8_len 2 ++#define reg_fste_w5_9_8_lsb 8 ++#define p_reg_fste_w6_7_0 0xF582 ++#define reg_fste_w6_7_0_pos 0 ++#define reg_fste_w6_7_0_len 8 ++#define reg_fste_w6_7_0_lsb 0 ++#define p_reg_fste_w6_9_8 0xF583 ++#define reg_fste_w6_9_8_pos 0 ++#define reg_fste_w6_9_8_len 2 ++#define reg_fste_w6_9_8_lsb 8 ++#define p_reg_fste_w7_7_0 0xF584 ++#define reg_fste_w7_7_0_pos 0 ++#define reg_fste_w7_7_0_len 8 ++#define reg_fste_w7_7_0_lsb 0 ++#define p_reg_fste_w7_9_8 0xF585 ++#define reg_fste_w7_9_8_pos 0 ++#define reg_fste_w7_9_8_len 2 ++#define reg_fste_w7_9_8_lsb 8 ++#define p_reg_fste_w8_7_0 0xF586 ++#define reg_fste_w8_7_0_pos 0 ++#define reg_fste_w8_7_0_len 8 ++#define reg_fste_w8_7_0_lsb 0 ++#define p_reg_fste_w8_9_8 0xF587 ++#define reg_fste_w8_9_8_pos 0 ++#define reg_fste_w8_9_8_len 2 ++#define reg_fste_w8_9_8_lsb 8 ++#define p_reg_fste_w9_7_0 0xF588 ++#define reg_fste_w9_7_0_pos 0 ++#define reg_fste_w9_7_0_len 8 ++#define reg_fste_w9_7_0_lsb 0 ++#define p_reg_fste_w9_9_8 0xF589 ++#define reg_fste_w9_9_8_pos 0 ++#define reg_fste_w9_9_8_len 2 ++#define reg_fste_w9_9_8_lsb 8 ++#define p_reg_fste_wa_7_0 0xF58A ++#define reg_fste_wa_7_0_pos 0 ++#define reg_fste_wa_7_0_len 8 ++#define reg_fste_wa_7_0_lsb 0 ++#define p_reg_fste_wa_9_8 0xF58B ++#define reg_fste_wa_9_8_pos 0 ++#define reg_fste_wa_9_8_len 2 ++#define reg_fste_wa_9_8_lsb 8 ++#define p_reg_fste_wb_7_0 0xF58C ++#define reg_fste_wb_7_0_pos 0 ++#define reg_fste_wb_7_0_len 8 ++#define reg_fste_wb_7_0_lsb 0 ++#define p_reg_fste_wb_9_8 0xF58D ++#define reg_fste_wb_9_8_pos 0 ++#define reg_fste_wb_9_8_len 2 ++#define reg_fste_wb_9_8_lsb 8 ++#define p_reg_fste_wc_7_0 0xF58E ++#define reg_fste_wc_7_0_pos 0 ++#define reg_fste_wc_7_0_len 8 ++#define reg_fste_wc_7_0_lsb 0 ++#define p_reg_fste_wc_9_8 0xF58F ++#define reg_fste_wc_9_8_pos 0 ++#define reg_fste_wc_9_8_len 2 ++#define reg_fste_wc_9_8_lsb 8 ++#define p_reg_fste_wd_7_0 0xF590 ++#define reg_fste_wd_7_0_pos 0 ++#define reg_fste_wd_7_0_len 8 ++#define reg_fste_wd_7_0_lsb 0 ++#define p_reg_fste_wd_9_8 0xF591 ++#define reg_fste_wd_9_8_pos 0 ++#define reg_fste_wd_9_8_len 2 ++#define reg_fste_wd_9_8_lsb 8 ++#define p_reg_fste_we_7_0 0xF592 ++#define reg_fste_we_7_0_pos 0 ++#define reg_fste_we_7_0_len 8 ++#define reg_fste_we_7_0_lsb 0 ++#define p_reg_fste_we_9_8 0xF593 ++#define reg_fste_we_9_8_pos 0 ++#define reg_fste_we_9_8_len 2 ++#define reg_fste_we_9_8_lsb 8 ++#define p_reg_fste_wf_7_0 0xF594 ++#define reg_fste_wf_7_0_pos 0 ++#define reg_fste_wf_7_0_len 8 ++#define reg_fste_wf_7_0_lsb 0 ++#define p_reg_fste_wf_9_8 0xF595 ++#define reg_fste_wf_9_8_pos 0 ++#define reg_fste_wf_9_8_len 2 ++#define reg_fste_wf_9_8_lsb 8 ++#define p_reg_fste_wg_7_0 0xF596 ++#define reg_fste_wg_7_0_pos 0 ++#define reg_fste_wg_7_0_len 8 ++#define reg_fste_wg_7_0_lsb 0 ++#define p_reg_fste_wg_9_8 0xF597 ++#define reg_fste_wg_9_8_pos 0 ++#define reg_fste_wg_9_8_len 2 ++#define reg_fste_wg_9_8_lsb 8 ++#define p_reg_fste_wh_7_0 0xF598 ++#define reg_fste_wh_7_0_pos 0 ++#define reg_fste_wh_7_0_len 8 ++#define reg_fste_wh_7_0_lsb 0 ++#define p_reg_fste_wh_9_8 0xF599 ++#define reg_fste_wh_9_8_pos 0 ++#define reg_fste_wh_9_8_len 2 ++#define reg_fste_wh_9_8_lsb 8 ++#define r_fd_fste_i_adj_org 0xF59A ++#define fd_fste_i_adj_org_pos 0 ++#define fd_fste_i_adj_org_len 5 ++#define fd_fste_i_adj_org_lsb 0 ++#define r_fd_fste_f_adj_7_0 0xF59B ++#define fd_fste_f_adj_7_0_pos 0 ++#define fd_fste_f_adj_7_0_len 8 ++#define fd_fste_f_adj_7_0_lsb 0 ++#define r_fd_fste_f_adj_15_8 0xF59C ++#define fd_fste_f_adj_15_8_pos 0 ++#define fd_fste_f_adj_15_8_len 8 ++#define fd_fste_f_adj_15_8_lsb 8 ++#define r_fd_fste_f_adj_19_16 0xF59D ++#define fd_fste_f_adj_19_16_pos 0 ++#define fd_fste_f_adj_19_16_len 4 ++#define fd_fste_f_adj_19_16_lsb 16 ++#define p_reg_fste_ehw_7_0 0xF59E ++#define reg_fste_ehw_7_0_pos 0 ++#define reg_fste_ehw_7_0_len 8 ++#define reg_fste_ehw_7_0_lsb 0 ++#define p_reg_fste_ehw_12_8 0xF59F ++#define reg_fste_ehw_12_8_pos 0 ++#define reg_fste_ehw_12_8_len 5 ++#define reg_fste_ehw_12_8_lsb 8 ++#define p_reg_fste_i_adj_vld 0xF5A0 ++#define reg_fste_i_adj_vld_pos 0 ++#define reg_fste_i_adj_vld_len 1 ++#define reg_fste_i_adj_vld_lsb 0 ++#define p_reg_fste_ceTimesPhasor_real 0xF5A1 ++#define reg_fste_ceTimesPhasor_real_pos 0 ++#define reg_fste_ceTimesPhasor_real_len 1 ++#define reg_fste_ceTimesPhasor_real_lsb 0 ++#define p_reg_fste_ceTimesPhasor_imag 0xF5A2 ++#define reg_fste_ceTimesPhasor_imag_pos 0 ++#define reg_fste_ceTimesPhasor_imag_len 1 ++#define reg_fste_ceTimesPhasor_imag_lsb 0 ++#define p_reg_fste_cerTimesW_real 0xF5A3 ++#define reg_fste_cerTimesW_real_pos 0 ++#define reg_fste_cerTimesW_real_len 1 ++#define reg_fste_cerTimesW_real_lsb 0 ++#define p_reg_fste_cerTimesW_imag 0xF5A4 ++#define reg_fste_cerTimesW_imag_pos 0 ++#define reg_fste_cerTimesW_imag_len 1 ++#define reg_fste_cerTimesW_imag_lsb 0 ++#define p_reg_fste_cerTimesWAccum_real 0xF5A5 ++#define reg_fste_cerTimesWAccum_real_pos 0 ++#define reg_fste_cerTimesWAccum_real_len 1 ++#define reg_fste_cerTimesWAccum_real_lsb 0 ++#define p_reg_fste_cerTimesWAccum_imag 0xF5A6 ++#define reg_fste_cerTimesWAccum_imag_pos 0 ++#define reg_fste_cerTimesWAccum_imag_len 1 ++#define reg_fste_cerTimesWAccum_imag_lsb 0 ++#define p_reg_fste_cost 0xF5A7 ++#define reg_fste_cost_pos 0 ++#define reg_fste_cost_len 1 ++#define reg_fste_cost_lsb 0 ++#define p_fd_tpsd_en 0xF5A8 ++#define fd_tpsd_en_pos 0 ++#define fd_tpsd_en_len 1 ++#define fd_tpsd_en_lsb 0 ++#define p_fd_tpsd_lock 0xF5A9 ++#define fd_tpsd_lock_pos 0 ++#define fd_tpsd_lock_len 1 ++#define fd_tpsd_lock_lsb 0 ++#define r_fd_tpsd_s19 0xF5AA ++#define fd_tpsd_s19_pos 0 ++#define fd_tpsd_s19_len 1 ++#define fd_tpsd_s19_lsb 0 ++#define r_fd_tpsd_s17 0xF5AB ++#define fd_tpsd_s17_pos 0 ++#define fd_tpsd_s17_len 1 ++#define fd_tpsd_s17_lsb 0 ++#define p_fd_sfr_ste_en 0xF5AC ++#define fd_sfr_ste_en_pos 0 ++#define fd_sfr_ste_en_len 1 ++#define fd_sfr_ste_en_lsb 0 ++#define p_fd_sfr_ste_mode 0xF5AD ++#define fd_sfr_ste_mode_pos 0 ++#define fd_sfr_ste_mode_len 2 ++#define fd_sfr_ste_mode_lsb 0 ++#define p_fd_sfr_ste_done 0xF5AE ++#define fd_sfr_ste_done_pos 0 ++#define fd_sfr_ste_done_len 1 ++#define fd_sfr_ste_done_lsb 0 ++#define p_reg_cfoe_ffoe_en 0xF5AF ++#define reg_cfoe_ffoe_en_pos 0 ++#define reg_cfoe_ffoe_en_len 1 ++#define reg_cfoe_ffoe_en_lsb 0 ++#define p_reg_cfoe_ifoe_en 0xF5B0 ++#define reg_cfoe_ifoe_en_pos 0 ++#define reg_cfoe_ifoe_en_len 1 ++#define reg_cfoe_ifoe_en_lsb 0 ++#define p_reg_cfoe_fot_en 0xF5B1 ++#define reg_cfoe_fot_en_pos 0 ++#define reg_cfoe_fot_en_len 1 ++#define reg_cfoe_fot_en_lsb 0 ++#define p_reg_cfoe_fot_lm_en 0xF5B2 ++#define reg_cfoe_fot_lm_en_pos 0 ++#define reg_cfoe_fot_lm_en_len 1 ++#define reg_cfoe_fot_lm_en_lsb 0 ++#define p_reg_cfoe_fot_rst 0xF5B3 ++#define reg_cfoe_fot_rst_pos 0 ++#define reg_cfoe_fot_rst_len 1 ++#define reg_cfoe_fot_rst_lsb 0 ++#define r_fd_cfoe_ffoe_done 0xF5B4 ++#define fd_cfoe_ffoe_done_pos 0 ++#define fd_cfoe_ffoe_done_len 1 ++#define fd_cfoe_ffoe_done_lsb 0 ++#define p_fd_cfoe_metric_vld 0xF5B5 ++#define fd_cfoe_metric_vld_pos 0 ++#define fd_cfoe_metric_vld_len 1 ++#define fd_cfoe_metric_vld_lsb 0 ++#define p_reg_cfoe_ifod_vld 0xF5B6 ++#define reg_cfoe_ifod_vld_pos 0 ++#define reg_cfoe_ifod_vld_len 1 ++#define reg_cfoe_ifod_vld_lsb 0 ++#define r_fd_cfoe_ifoe_done 0xF5B7 ++#define fd_cfoe_ifoe_done_pos 0 ++#define fd_cfoe_ifoe_done_len 1 ++#define fd_cfoe_ifoe_done_lsb 0 ++#define p_reg_cfoe_ifoe_spec_inv 0xF5B8 ++#define reg_cfoe_ifoe_spec_inv_pos 0 ++#define reg_cfoe_ifoe_spec_inv_len 1 ++#define reg_cfoe_ifoe_spec_inv_lsb 0 ++#define p_reg_cfoe_divg_int 0xF5B9 ++#define reg_cfoe_divg_int_pos 0 ++#define reg_cfoe_divg_int_len 1 ++#define reg_cfoe_divg_int_lsb 0 ++#define r_reg_cfoe_divg_flag 0xF5BA ++#define reg_cfoe_divg_flag_pos 0 ++#define reg_cfoe_divg_flag_len 1 ++#define reg_cfoe_divg_flag_lsb 0 ++#define p_reg_sfoe_en 0xF5BB ++#define reg_sfoe_en_pos 0 ++#define reg_sfoe_en_len 1 ++#define reg_sfoe_en_lsb 0 ++#define p_reg_sfoe_dis 0xF5BC ++#define reg_sfoe_dis_pos 0 ++#define reg_sfoe_dis_len 1 ++#define reg_sfoe_dis_lsb 0 ++#define p_reg_sfoe_rst 0xF5BD ++#define reg_sfoe_rst_pos 0 ++#define reg_sfoe_rst_len 1 ++#define reg_sfoe_rst_lsb 0 ++#define p_reg_sfoe_vld_int 0xF5BE ++#define reg_sfoe_vld_int_pos 0 ++#define reg_sfoe_vld_int_len 1 ++#define reg_sfoe_vld_int_lsb 0 ++#define p_reg_sfoe_lm_en 0xF5BF ++#define reg_sfoe_lm_en_pos 0 ++#define reg_sfoe_lm_en_len 1 ++#define reg_sfoe_lm_en_lsb 0 ++#define p_reg_sfoe_divg_int 0xF5C0 ++#define reg_sfoe_divg_int_pos 0 ++#define reg_sfoe_divg_int_len 1 ++#define reg_sfoe_divg_int_lsb 0 ++#define r_reg_sfoe_divg_flag 0xF5C1 ++#define reg_sfoe_divg_flag_pos 0 ++#define reg_sfoe_divg_flag_len 1 ++#define reg_sfoe_divg_flag_lsb 0 ++#define p_reg_fft_rst 0xF5C2 ++#define reg_fft_rst_pos 0 ++#define reg_fft_rst_len 1 ++#define reg_fft_rst_lsb 0 ++#define p_reg_fft_mask2_en 0xF5C3 ++#define reg_fft_mask2_en_pos 0 ++#define reg_fft_mask2_en_len 1 ++#define reg_fft_mask2_en_lsb 0 ++#define p_reg_fft_mask3_en 0xF5C4 ++#define reg_fft_mask3_en_pos 0 ++#define reg_fft_mask3_en_len 1 ++#define reg_fft_mask3_en_lsb 0 ++#define p_reg_fft_crc_en 0xF5C5 ++#define reg_fft_crc_en_pos 0 ++#define reg_fft_crc_en_len 1 ++#define reg_fft_crc_en_lsb 0 ++#define p_reg_fft_mask0_en 0xF5C6 ++#define reg_fft_mask0_en_pos 0 ++#define reg_fft_mask0_en_len 1 ++#define reg_fft_mask0_en_lsb 0 ++#define p_reg_fft_mask1_en 0xF5C7 ++#define reg_fft_mask1_en_pos 0 ++#define reg_fft_mask1_en_len 1 ++#define reg_fft_mask1_en_lsb 0 ++#define p_fd_fste_en 0xF5C8 ++#define fd_fste_en_pos 0 ++#define fd_fste_en_len 1 ++#define fd_fste_en_lsb 0 ++#define p_reg_feq_eh2_comp_en 0xF5C9 ++#define reg_feq_eh2_comp_en_pos 0 ++#define reg_feq_eh2_comp_en_len 1 ++#define reg_feq_eh2_comp_en_lsb 0 ++#define p_reg_feq_read_update 0xF5CA ++#define reg_feq_read_update_pos 0 ++#define reg_feq_read_update_len 1 ++#define reg_feq_read_update_lsb 0 ++#define p_reg_feq_data_vld 0xF5CB ++#define reg_feq_data_vld_pos 0 ++#define reg_feq_data_vld_len 1 ++#define reg_feq_data_vld_lsb 0 ++#define p_reg_feq_tone_idx_7_0 0xF5CC ++#define reg_feq_tone_idx_7_0_pos 0 ++#define reg_feq_tone_idx_7_0_len 8 ++#define reg_feq_tone_idx_7_0_lsb 0 ++#define p_reg_feq_tone_idx_12_8 0xF5CD ++#define reg_feq_tone_idx_12_8_pos 0 ++#define reg_feq_tone_idx_12_8_len 5 ++#define reg_feq_tone_idx_12_8_lsb 8 ++#define r_reg_feq_data_re_7_0 0xF5CE ++#define reg_feq_data_re_7_0_pos 0 ++#define reg_feq_data_re_7_0_len 8 ++#define reg_feq_data_re_7_0_lsb 0 ++#define r_reg_feq_data_re_15_8 0xF5CF ++#define reg_feq_data_re_15_8_pos 0 ++#define reg_feq_data_re_15_8_len 8 ++#define reg_feq_data_re_15_8_lsb 8 ++#define r_reg_feq_data_re_21_16 0xF5D0 ++#define reg_feq_data_re_21_16_pos 0 ++#define reg_feq_data_re_21_16_len 6 ++#define reg_feq_data_re_21_16_lsb 16 ++#define r_reg_feq_data_im_7_0 0xF5D1 ++#define reg_feq_data_im_7_0_pos 0 ++#define reg_feq_data_im_7_0_len 8 ++#define reg_feq_data_im_7_0_lsb 0 ++#define r_reg_feq_data_im_15_8 0xF5D2 ++#define reg_feq_data_im_15_8_pos 0 ++#define reg_feq_data_im_15_8_len 8 ++#define reg_feq_data_im_15_8_lsb 8 ++#define r_reg_feq_data_im_21_16 0xF5D3 ++#define reg_feq_data_im_21_16_pos 0 ++#define reg_feq_data_im_21_16_len 6 ++#define reg_feq_data_im_21_16_lsb 16 ++#define r_reg_feq_data_h2_7_0 0xF5D4 ++#define reg_feq_data_h2_7_0_pos 0 ++#define reg_feq_data_h2_7_0_len 8 ++#define reg_feq_data_h2_7_0_lsb 0 ++#define r_reg_feq_data_h2_15_8 0xF5D5 ++#define reg_feq_data_h2_15_8_pos 0 ++#define reg_feq_data_h2_15_8_len 8 ++#define reg_feq_data_h2_15_8_lsb 8 ++#define r_reg_feq_data_h2_18_16 0xF5D6 ++#define reg_feq_data_h2_18_16_pos 0 ++#define reg_feq_data_h2_18_16_len 3 ++#define reg_feq_data_h2_18_16_lsb 16 ++#define p_reg_fs_en 0xF5D7 ++#define reg_fs_en_pos 0 ++#define reg_fs_en_len 1 ++#define reg_fs_en_lsb 0 ++#define p_reg_fs_offset 0xF5D8 ++#define reg_fs_offset_pos 0 ++#define reg_fs_offset_len 3 ++#define reg_fs_offset_lsb 0 ++#define p_reg_fs_debug 0xF5D9 ++#define reg_fs_debug_pos 0 ++#define reg_fs_debug_len 1 ++#define reg_fs_debug_lsb 0 ++#define p_reg_fs_half_inv 0xF5DA ++#define reg_fs_half_inv_pos 0 ++#define reg_fs_half_inv_len 1 ++#define reg_fs_half_inv_lsb 0 ++#define p_reg_cdpf_currentfftposition_7_0 0xF5DB ++#define reg_cdpf_currentfftposition_7_0_pos 0 ++#define reg_cdpf_currentfftposition_7_0_len 8 ++#define reg_cdpf_currentfftposition_7_0_lsb 0 ++#define p_reg_cdpf_currentfftposition_14_8 0xF5DC ++#define reg_cdpf_currentfftposition_14_8_pos 0 ++#define reg_cdpf_currentfftposition_14_8_len 7 ++#define reg_cdpf_currentfftposition_14_8_lsb 8 ++#define r_reg_cdpf_fftshift_7_0 0xF5DD ++#define reg_cdpf_fftshift_7_0_pos 0 ++#define reg_cdpf_fftshift_7_0_len 8 ++#define reg_cdpf_fftshift_7_0_lsb 0 ++#define r_reg_cdpf_fftshift_13_8 0xF5DE ++#define reg_cdpf_fftshift_13_8_pos 0 ++#define reg_cdpf_fftshift_13_8_len 6 ++#define reg_cdpf_fftshift_13_8_lsb 8 ++#define p_reg_cdpf_channelpowerdown_7_0 0xF5DF ++#define reg_cdpf_channelpowerdown_7_0_pos 0 ++#define reg_cdpf_channelpowerdown_7_0_len 8 ++#define reg_cdpf_channelpowerdown_7_0_lsb 0 ++#define p_reg_cdpf_channelpowerdown_10_8 0xF5E0 ++#define reg_cdpf_channelpowerdown_10_8_pos 0 ++#define reg_cdpf_channelpowerdown_10_8_len 3 ++#define reg_cdpf_channelpowerdown_10_8_lsb 8 ++#define p_reg_cdpf_state 0xF5E1 ++#define reg_cdpf_state_pos 0 ++#define reg_cdpf_state_len 4 ++#define reg_cdpf_state_lsb 0 ++#define p_reg_cdpf_echotestsearchingrange 0xF5E2 ++#define reg_cdpf_echotestsearchingrange_pos 0 ++#define reg_cdpf_echotestsearchingrange_len 8 ++#define reg_cdpf_echotestsearchingrange_lsb 0 ++#define p_reg_cdpf_rxsymboldelay 0xF5E3 ++#define reg_cdpf_rxsymboldelay_pos 0 ++#define reg_cdpf_rxsymboldelay_len 4 ++#define reg_cdpf_rxsymboldelay_lsb 0 ++#define p_reg_cdpf_ceavesymbolno 0xF5E4 ++#define reg_cdpf_ceavesymbolno_pos 0 ++#define reg_cdpf_ceavesymbolno_len 4 ++#define reg_cdpf_ceavesymbolno_lsb 0 ++#define p_reg_cdpf_ceshift 0xF5E5 ++#define reg_cdpf_ceshift_pos 0 ++#define reg_cdpf_ceshift_len 3 ++#define reg_cdpf_ceshift_lsb 0 ++#define p_reg_cdpf_postpreechotry 0xF5E6 ++#define reg_cdpf_postpreechotry_pos 0 ++#define reg_cdpf_postpreechotry_len 2 ++#define reg_cdpf_postpreechotry_lsb 0 ++#define p_reg_cdpf_en 0xF5E7 ++#define reg_cdpf_en_pos 0 ++#define reg_cdpf_en_len 1 ++#define reg_cdpf_en_lsb 0 ++#define p_reg_cdpf_stateready 0xF5E8 ++#define reg_cdpf_stateready_pos 0 ++#define reg_cdpf_stateready_len 1 ++#define reg_cdpf_stateready_lsb 0 ++#define r_reg_cdpf_prepostpowercompare 0xF5E9 ++#define reg_cdpf_prepostpowercompare_pos 0 ++#define reg_cdpf_prepostpowercompare_len 1 ++#define reg_cdpf_prepostpowercompare_lsb 0 ++#define r_reg_cdpf_candidateno 0xF5EA ++#define reg_cdpf_candidateno_pos 0 ++#define reg_cdpf_candidateno_len 6 ++#define reg_cdpf_candidateno_lsb 0 ++#define p_reg_cdpf_preechopower_7_0 0xF5EB ++#define reg_cdpf_preechopower_7_0_pos 0 ++#define reg_cdpf_preechopower_7_0_len 8 ++#define reg_cdpf_preechopower_7_0_lsb 0 ++#define p_reg_cdpf_preechopower_15_8 0xF5EC ++#define reg_cdpf_preechopower_15_8_pos 0 ++#define reg_cdpf_preechopower_15_8_len 8 ++#define reg_cdpf_preechopower_15_8_lsb 8 ++#define p_reg_cdpf_postechopower_7_0 0xF5ED ++#define reg_cdpf_postechopower_7_0_pos 0 ++#define reg_cdpf_postechopower_7_0_len 8 ++#define reg_cdpf_postechopower_7_0_lsb 0 ++#define p_reg_cdpf_postechopower_15_8 0xF5EE ++#define reg_cdpf_postechopower_15_8_pos 0 ++#define reg_cdpf_postechopower_15_8_len 8 ++#define reg_cdpf_postechopower_15_8_lsb 8 ++#define p_reg_cdpf_searchingend 0xF5EF ++#define reg_cdpf_searchingend_pos 0 ++#define reg_cdpf_searchingend_len 8 ++#define reg_cdpf_searchingend_lsb 0 ++#define r_reg_cdpf_candidate_7_0 0xF5F0 ++#define reg_cdpf_candidate_7_0_pos 0 ++#define reg_cdpf_candidate_7_0_len 8 ++#define reg_cdpf_candidate_7_0_lsb 0 ++#define r_reg_cdpf_candidate_15_8 0xF5F1 ++#define reg_cdpf_candidate_15_8_pos 0 ++#define reg_cdpf_candidate_15_8_len 8 ++#define reg_cdpf_candidate_15_8_lsb 8 ++#define p_reg_cdpf_candidate_rptr 0xF5F2 ++#define reg_cdpf_candidate_rptr_pos 0 ++#define reg_cdpf_candidate_rptr_len 7 ++#define reg_cdpf_candidate_rptr_lsb 0 ++#define p_reg_cdpf_candidate_rptr_force 0xF5F3 ++#define reg_cdpf_candidate_rptr_force_pos 0 ++#define reg_cdpf_candidate_rptr_force_len 1 ++#define reg_cdpf_candidate_rptr_force_lsb 0 ++#define p_reg_cdpf_trialshiftoffset_7_0 0xF5F4 ++#define reg_cdpf_trialshiftoffset_7_0_pos 0 ++#define reg_cdpf_trialshiftoffset_7_0_len 8 ++#define reg_cdpf_trialshiftoffset_7_0_lsb 0 ++#define p_reg_cdpf_trialshiftoffset_13_8 0xF5F5 ++#define reg_cdpf_trialshiftoffset_13_8_pos 0 ++#define reg_cdpf_trialshiftoffset_13_8_len 6 ++#define reg_cdpf_trialshiftoffset_13_8_lsb 8 ++#define p_reg_cdpf_channellength_7_0 0xF5F6 ++#define reg_cdpf_channellength_7_0_pos 0 ++#define reg_cdpf_channellength_7_0_len 8 ++#define reg_cdpf_channellength_7_0_lsb 0 ++#define p_reg_cdpf_channellength_12_8 0xF5F7 ++#define reg_cdpf_channellength_12_8_pos 0 ++#define reg_cdpf_channellength_12_8_len 5 ++#define reg_cdpf_channellength_12_8_lsb 8 ++#define p_reg_cdpf_hardwaresort 0xF5F8 ++#define reg_cdpf_hardwaresort_pos 0 ++#define reg_cdpf_hardwaresort_len 1 ++#define reg_cdpf_hardwaresort_lsb 0 ++#define p_reg_cdpf_maxcandidateno 0xF5F9 ++#define reg_cdpf_maxcandidateno_pos 0 ++#define reg_cdpf_maxcandidateno_len 3 ++#define reg_cdpf_maxcandidateno_lsb 0 ++#define p_reg_cdpf_channelleftindex 0xF5FA ++#define reg_cdpf_channelleftindex_pos 0 ++#define reg_cdpf_channelleftindex_len 4 ++#define reg_cdpf_channelleftindex_lsb 0 ++#define r_reg_cdpf_fdishift_7_0 0xF5FB ++#define reg_cdpf_fdishift_7_0_pos 0 ++#define reg_cdpf_fdishift_7_0_len 8 ++#define reg_cdpf_fdishift_7_0_lsb 0 ++#define r_reg_cdpf_fdishift_15_8 0xF5FC ++#define reg_cdpf_fdishift_15_8_pos 0 ++#define reg_cdpf_fdishift_15_8_len 8 ++#define reg_cdpf_fdishift_15_8_lsb 8 ++#define p_reg_cdpf_guardband 0xF5FD ++#define reg_cdpf_guardband_pos 0 ++#define reg_cdpf_guardband_len 5 ++#define reg_cdpf_guardband_lsb 0 ++#define p_reg_cdpf_maxtonemaxindex_7_0 0xF5FE ++#define reg_cdpf_maxtonemaxindex_7_0_pos 0 ++#define reg_cdpf_maxtonemaxindex_7_0_len 8 ++#define reg_cdpf_maxtonemaxindex_7_0_lsb 0 ++#define p_reg_cdpf_maxtonemaxindex_12_8 0xF5FF ++#define reg_cdpf_maxtonemaxindex_12_8_pos 0 ++#define reg_cdpf_maxtonemaxindex_12_8_len 5 ++#define reg_cdpf_maxtonemaxindex_12_8_lsb 8 ++#define p_reg_cdpf_fdiw0 0xF600 ++#define reg_cdpf_fdiw0_pos 0 ++#define reg_cdpf_fdiw0_len 7 ++#define reg_cdpf_fdiw0_lsb 0 ++#define p_reg_cdpf_fdiw1 0xF601 ++#define reg_cdpf_fdiw1_pos 0 ++#define reg_cdpf_fdiw1_len 7 ++#define reg_cdpf_fdiw1_lsb 0 ++#define p_reg_cdpf_fdiw2 0xF602 ++#define reg_cdpf_fdiw2_pos 0 ++#define reg_cdpf_fdiw2_len 7 ++#define reg_cdpf_fdiw2_lsb 0 ++#define p_reg_cdpf_fdiw3 0xF603 ++#define reg_cdpf_fdiw3_pos 0 ++#define reg_cdpf_fdiw3_len 7 ++#define reg_cdpf_fdiw3_lsb 0 ++#define p_reg_cdpf_fdiw4 0xF604 ++#define reg_cdpf_fdiw4_pos 0 ++#define reg_cdpf_fdiw4_len 7 ++#define reg_cdpf_fdiw4_lsb 0 ++#define p_reg_cdpf_fdiw5 0xF605 ++#define reg_cdpf_fdiw5_pos 0 ++#define reg_cdpf_fdiw5_len 7 ++#define reg_cdpf_fdiw5_lsb 0 ++#define p_reg_cdpf_fdiw6 0xF606 ++#define reg_cdpf_fdiw6_pos 0 ++#define reg_cdpf_fdiw6_len 7 ++#define reg_cdpf_fdiw6_lsb 0 ++#define p_reg_cdpf_fdiw7 0xF607 ++#define reg_cdpf_fdiw7_pos 0 ++#define reg_cdpf_fdiw7_len 7 ++#define reg_cdpf_fdiw7_lsb 0 ++#define r_reg_cdpf_fdiwindowsize 0xF608 ++#define reg_cdpf_fdiwindowsize_pos 0 ++#define reg_cdpf_fdiwindowsize_len 4 ++#define reg_cdpf_fdiwindowsize_lsb 0 ++#define p_reg_stes_mode 0xF609 ++#define reg_stes_mode_pos 0 ++#define reg_stes_mode_len 1 ++#define reg_stes_mode_lsb 0 ++#define p_reg_stes_done_st 0xF60A ++#define reg_stes_done_st_pos 0 ++#define reg_stes_done_st_len 2 ++#define reg_stes_done_st_lsb 0 ++#define p_reg_stes_done 0xF60B ++#define reg_stes_done_pos 0 ++#define reg_stes_done_len 1 ++#define reg_stes_done_lsb 0 ++#define p_reg_stes_timing_7_0 0xF60C ++#define reg_stes_timing_7_0_pos 0 ++#define reg_stes_timing_7_0_len 8 ++#define reg_stes_timing_7_0_lsb 0 ++#define p_reg_stes_timing_15_8 0xF60D ++#define reg_stes_timing_15_8_pos 0 ++#define reg_stes_timing_15_8_len 8 ++#define reg_stes_timing_15_8_lsb 8 ++#define p_reg_stes_sym_tot_adj_thre_7_0 0xF60E ++#define reg_stes_sym_tot_adj_thre_7_0_pos 0 ++#define reg_stes_sym_tot_adj_thre_7_0_len 8 ++#define reg_stes_sym_tot_adj_thre_7_0_lsb 0 ++#define p_reg_stes_sym_tot_adj_thre_15_8 0xF60F ++#define reg_stes_sym_tot_adj_thre_15_8_pos 0 ++#define reg_stes_sym_tot_adj_thre_15_8_len 8 ++#define reg_stes_sym_tot_adj_thre_15_8_lsb 8 ++#define p_reg_stes_sym_thre_9_2 0xF610 ++#define reg_stes_sym_thre_9_2_pos 0 ++#define reg_stes_sym_thre_9_2_len 8 ++#define reg_stes_sym_thre_9_2_lsb 0 ++#define p_reg_stes_sym_wo_adj_thre_9_2 0xF611 ++#define reg_stes_sym_wo_adj_thre_9_2_pos 0 ++#define reg_stes_sym_wo_adj_thre_9_2_len 8 ++#define reg_stes_sym_wo_adj_thre_9_2_lsb 0 ++#define p_reg_fste_i_adj_7_0 0xF612 ++#define reg_fste_i_adj_7_0_pos 0 ++#define reg_fste_i_adj_7_0_len 8 ++#define reg_fste_i_adj_7_0_lsb 0 ++#define p_reg_fste_i_adj_15_8 0xF613 ++#define reg_fste_i_adj_15_8_pos 0 ++#define reg_fste_i_adj_15_8_len 8 ++#define reg_fste_i_adj_15_8_lsb 8 ++#define r_fd_stes_iadj_val_7_0 0xF614 ++#define fd_stes_iadj_val_7_0_pos 0 ++#define fd_stes_iadj_val_7_0_len 8 ++#define fd_stes_iadj_val_7_0_lsb 0 ++#define r_fd_stes_iadj_val_15_8 0xF615 ++#define fd_stes_iadj_val_15_8_pos 0 ++#define fd_stes_iadj_val_15_8_len 8 ++#define fd_stes_iadj_val_15_8_lsb 8 ++#define r_fd_stes_symb_cnt_9_2 0xF616 ++#define fd_stes_symb_cnt_9_2_pos 0 ++#define fd_stes_symb_cnt_9_2_len 8 ++#define fd_stes_symb_cnt_9_2_lsb 0 ++#define r_fd_stes_snoi_cnt_9_2 0xF617 ++#define fd_stes_snoi_cnt_9_2_pos 0 ++#define fd_stes_snoi_cnt_9_2_len 8 ++#define fd_stes_snoi_cnt_9_2_lsb 0 ++#define r_fd_last_iadj_val_7_0 0xF618 ++#define fd_last_iadj_val_7_0_pos 0 ++#define fd_last_iadj_val_7_0_len 8 ++#define fd_last_iadj_val_7_0_lsb 0 ++#define r_fd_last_iadj_val_15_8 0xF619 ++#define fd_last_iadj_val_15_8_pos 0 ++#define fd_last_iadj_val_15_8_len 8 ++#define fd_last_iadj_val_15_8_lsb 8 ++#define p_reg_stes_bypass 0xF61A ++#define reg_stes_bypass_pos 0 ++#define reg_stes_bypass_len 1 ++#define reg_stes_bypass_lsb 0 ++#define p_reg_stes_best_timing_idx 0xF61B ++#define reg_stes_best_timing_idx_pos 0 ++#define reg_stes_best_timing_idx_len 4 ++#define reg_stes_best_timing_idx_lsb 0 ++#define p_reg_stes_iadj_val_7_0 0xF61C ++#define reg_stes_iadj_val_7_0_pos 0 ++#define reg_stes_iadj_val_7_0_len 8 ++#define reg_stes_iadj_val_7_0_lsb 0 ++#define p_reg_stes_iadj_val_15_8 0xF61D ++#define reg_stes_iadj_val_15_8_pos 0 ++#define reg_stes_iadj_val_15_8_len 8 ++#define reg_stes_iadj_val_15_8_lsb 8 ++#define p_reg_p_ste_start_guard_7_0 0xF620 ++#define reg_p_ste_start_guard_7_0_pos 0 ++#define reg_p_ste_start_guard_7_0_len 8 ++#define reg_p_ste_start_guard_7_0_lsb 0 ++#define p_reg_p_ste_start_guard_9_8 0xF621 ++#define reg_p_ste_start_guard_9_8_pos 0 ++#define reg_p_ste_start_guard_9_8_len 2 ++#define reg_p_ste_start_guard_9_8_lsb 8 ++#define p_reg_p_ste_end_guard_7_0 0xF622 ++#define reg_p_ste_end_guard_7_0_pos 0 ++#define reg_p_ste_end_guard_7_0_len 8 ++#define reg_p_ste_end_guard_7_0_lsb 0 ++#define p_reg_p_ste_end_guard_9_8 0xF623 ++#define reg_p_ste_end_guard_9_8_pos 0 ++#define reg_p_ste_end_guard_9_8_len 2 ++#define reg_p_ste_end_guard_9_8_lsb 8 ++#define r_reg_r_ste_wrong_beacon_count 0xF624 ++#define reg_r_ste_wrong_beacon_count_pos 0 ++#define reg_r_ste_wrong_beacon_count_len 7 ++#define reg_r_ste_wrong_beacon_count_lsb 0 ++#define p_reg_p_fccid_en 0xF625 ++#define reg_p_fccid_en_pos 0 ++#define reg_p_fccid_en_len 1 ++#define reg_p_fccid_en_lsb 0 ++#define p_reg_p_fccid_fft_ave_symbol_num 0xF626 ++#define reg_p_fccid_fft_ave_symbol_num_pos 0 ++#define reg_p_fccid_fft_ave_symbol_num_len 6 ++#define reg_p_fccid_fft_ave_symbol_num_lsb 0 ++#define p_reg_p_fccid_fft_work_start_tone_7_0 0xF627 ++#define reg_p_fccid_fft_work_start_tone_7_0_pos 0 ++#define reg_p_fccid_fft_work_start_tone_7_0_len 8 ++#define reg_p_fccid_fft_work_start_tone_7_0_lsb 0 ++#define p_reg_p_fccid_fft_work_start_tone_12_8 0xF628 ++#define reg_p_fccid_fft_work_start_tone_12_8_pos 0 ++#define reg_p_fccid_fft_work_start_tone_12_8_len 5 ++#define reg_p_fccid_fft_work_start_tone_12_8_lsb 8 ++#define p_reg_p_fccid_fft_work_end_tone_7_0 0xF629 ++#define reg_p_fccid_fft_work_end_tone_7_0_pos 0 ++#define reg_p_fccid_fft_work_end_tone_7_0_len 8 ++#define reg_p_fccid_fft_work_end_tone_7_0_lsb 0 ++#define p_reg_p_fccid_fft_work_end_tone_12_8 0xF62A ++#define reg_p_fccid_fft_work_end_tone_12_8_pos 0 ++#define reg_p_fccid_fft_work_end_tone_12_8_len 5 ++#define reg_p_fccid_fft_work_end_tone_12_8_lsb 8 ++#define p_reg_p_fccid_peak_to_th_divider 0xF62B ++#define reg_p_fccid_peak_to_th_divider_pos 0 ++#define reg_p_fccid_peak_to_th_divider_len 4 ++#define reg_p_fccid_peak_to_th_divider_lsb 0 ++#define p_reg_p_fccid_peak_to_th_mode 0xF62C ++#define reg_p_fccid_peak_to_th_mode_pos 0 ++#define reg_p_fccid_peak_to_th_mode_len 2 ++#define reg_p_fccid_peak_to_th_mode_lsb 0 ++#define p_reg_p_fccid_search_mode 0xF62D ++#define reg_p_fccid_search_mode_pos 0 ++#define reg_p_fccid_search_mode_len 1 ++#define reg_p_fccid_search_mode_lsb 0 ++#define p_reg_p_fccid_group_th 0xF62E ++#define reg_p_fccid_group_th_pos 0 ++#define reg_p_fccid_group_th_len 7 ++#define reg_p_fccid_group_th_lsb 0 ++#define p_reg_p_fccid_search_rdy 0xF62F ++#define reg_p_fccid_search_rdy_pos 0 ++#define reg_p_fccid_search_rdy_len 1 ++#define reg_p_fccid_search_rdy_lsb 0 ++#define r_reg_r_fccid_fft_ave_read_out_7_0 0xF630 ++#define reg_r_fccid_fft_ave_read_out_7_0_pos 0 ++#define reg_r_fccid_fft_ave_read_out_7_0_len 8 ++#define reg_r_fccid_fft_ave_read_out_7_0_lsb 0 ++#define r_reg_r_fccid_fft_ave_read_out_15_8 0xF631 ++#define reg_r_fccid_fft_ave_read_out_15_8_pos 0 ++#define reg_r_fccid_fft_ave_read_out_15_8_len 8 ++#define reg_r_fccid_fft_ave_read_out_15_8_lsb 8 ++#define r_reg_r_fccid_large_tone_num_7_0 0xF632 ++#define reg_r_fccid_large_tone_num_7_0_pos 0 ++#define reg_r_fccid_large_tone_num_7_0_len 8 ++#define reg_r_fccid_large_tone_num_7_0_lsb 0 ++#define r_reg_r_fccid_large_tone_num_12_8 0xF633 ++#define reg_r_fccid_large_tone_num_12_8_pos 0 ++#define reg_r_fccid_large_tone_num_12_8_len 5 ++#define reg_r_fccid_large_tone_num_12_8_lsb 8 ++#define r_reg_r_fccid_cci1_start_tone_7_0 0xF634 ++#define reg_r_fccid_cci1_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci1_start_tone_7_0_len 8 ++#define reg_r_fccid_cci1_start_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci1_start_tone_12_8 0xF635 ++#define reg_r_fccid_cci1_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci1_start_tone_12_8_len 5 ++#define reg_r_fccid_cci1_start_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci1_end_tone_7_0 0xF636 ++#define reg_r_fccid_cci1_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci1_end_tone_7_0_len 8 ++#define reg_r_fccid_cci1_end_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci1_end_tone_12_8 0xF637 ++#define reg_r_fccid_cci1_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci1_end_tone_12_8_len 5 ++#define reg_r_fccid_cci1_end_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci1_peak_7_0 0xF638 ++#define reg_r_fccid_cci1_peak_7_0_pos 0 ++#define reg_r_fccid_cci1_peak_7_0_len 8 ++#define reg_r_fccid_cci1_peak_7_0_lsb 0 ++#define r_reg_r_fccid_cci1_peak_15_8 0xF639 ++#define reg_r_fccid_cci1_peak_15_8_pos 0 ++#define reg_r_fccid_cci1_peak_15_8_len 8 ++#define reg_r_fccid_cci1_peak_15_8_lsb 8 ++#define r_reg_r_fccid_cci2_start_tone_7_0 0xF63A ++#define reg_r_fccid_cci2_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci2_start_tone_7_0_len 8 ++#define reg_r_fccid_cci2_start_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci2_start_tone_12_8 0xF63B ++#define reg_r_fccid_cci2_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci2_start_tone_12_8_len 5 ++#define reg_r_fccid_cci2_start_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci2_end_tone_7_0 0xF63C ++#define reg_r_fccid_cci2_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci2_end_tone_7_0_len 8 ++#define reg_r_fccid_cci2_end_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci2_end_tone_12_8 0xF63D ++#define reg_r_fccid_cci2_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci2_end_tone_12_8_len 5 ++#define reg_r_fccid_cci2_end_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci2_peak_7_0 0xF63E ++#define reg_r_fccid_cci2_peak_7_0_pos 0 ++#define reg_r_fccid_cci2_peak_7_0_len 8 ++#define reg_r_fccid_cci2_peak_7_0_lsb 0 ++#define r_reg_r_fccid_cci2_peak_15_8 0xF63F ++#define reg_r_fccid_cci2_peak_15_8_pos 0 ++#define reg_r_fccid_cci2_peak_15_8_len 8 ++#define reg_r_fccid_cci2_peak_15_8_lsb 8 ++#define r_reg_r_fccid_cci3_start_tone_7_0 0xF640 ++#define reg_r_fccid_cci3_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci3_start_tone_7_0_len 8 ++#define reg_r_fccid_cci3_start_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci3_start_tone_12_8 0xF641 ++#define reg_r_fccid_cci3_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci3_start_tone_12_8_len 5 ++#define reg_r_fccid_cci3_start_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci3_end_tone_7_0 0xF642 ++#define reg_r_fccid_cci3_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci3_end_tone_7_0_len 8 ++#define reg_r_fccid_cci3_end_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci3_end_tone_12_8 0xF643 ++#define reg_r_fccid_cci3_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci3_end_tone_12_8_len 5 ++#define reg_r_fccid_cci3_end_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci3_peak_7_0 0xF644 ++#define reg_r_fccid_cci3_peak_7_0_pos 0 ++#define reg_r_fccid_cci3_peak_7_0_len 8 ++#define reg_r_fccid_cci3_peak_7_0_lsb 0 ++#define r_reg_r_fccid_cci3_peak_15_8 0xF645 ++#define reg_r_fccid_cci3_peak_15_8_pos 0 ++#define reg_r_fccid_cci3_peak_15_8_len 8 ++#define reg_r_fccid_cci3_peak_15_8_lsb 8 ++#define r_reg_r_fccid_cci4_start_tone_7_0 0xF646 ++#define reg_r_fccid_cci4_start_tone_7_0_pos 0 ++#define reg_r_fccid_cci4_start_tone_7_0_len 8 ++#define reg_r_fccid_cci4_start_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci4_start_tone_12_8 0xF647 ++#define reg_r_fccid_cci4_start_tone_12_8_pos 0 ++#define reg_r_fccid_cci4_start_tone_12_8_len 5 ++#define reg_r_fccid_cci4_start_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci4_end_tone_7_0 0xF648 ++#define reg_r_fccid_cci4_end_tone_7_0_pos 0 ++#define reg_r_fccid_cci4_end_tone_7_0_len 8 ++#define reg_r_fccid_cci4_end_tone_7_0_lsb 0 ++#define r_reg_r_fccid_cci4_end_tone_12_8 0xF649 ++#define reg_r_fccid_cci4_end_tone_12_8_pos 0 ++#define reg_r_fccid_cci4_end_tone_12_8_len 5 ++#define reg_r_fccid_cci4_end_tone_12_8_lsb 8 ++#define r_reg_r_fccid_cci4_peak_7_0 0xF64A ++#define reg_r_fccid_cci4_peak_7_0_pos 0 ++#define reg_r_fccid_cci4_peak_7_0_len 8 ++#define reg_r_fccid_cci4_peak_7_0_lsb 0 ++#define r_reg_r_fccid_cci4_peak_15_8 0xF64B ++#define reg_r_fccid_cci4_peak_15_8_pos 0 ++#define reg_r_fccid_cci4_peak_15_8_len 8 ++#define reg_r_fccid_cci4_peak_15_8_lsb 8 ++#define r_reg_r_fccid_cci1_rank 0xF64C ++#define reg_r_fccid_cci1_rank_pos 0 ++#define reg_r_fccid_cci1_rank_len 3 ++#define reg_r_fccid_cci1_rank_lsb 0 ++#define r_reg_r_fccid_cci2_rank 0xF64D ++#define reg_r_fccid_cci2_rank_pos 0 ++#define reg_r_fccid_cci2_rank_len 3 ++#define reg_r_fccid_cci2_rank_lsb 0 ++#define r_reg_r_fccid_cci3_rank 0xF64E ++#define reg_r_fccid_cci3_rank_pos 0 ++#define reg_r_fccid_cci3_rank_len 3 ++#define reg_r_fccid_cci3_rank_lsb 0 ++#define r_reg_r_fccid_cci4_rank 0xF64F ++#define reg_r_fccid_cci4_rank_pos 0 ++#define reg_r_fccid_cci4_rank_len 3 ++#define reg_r_fccid_cci4_rank_lsb 0 ++#define p_reg_p_csi_shift3 0xF650 ++#define reg_p_csi_shift3_pos 0 ++#define reg_p_csi_shift3_len 4 ++#define reg_p_csi_shift3_lsb 0 ++#define p_reg_p_csi_mul3 0xF651 ++#define reg_p_csi_mul3_pos 0 ++#define reg_p_csi_mul3_len 8 ++#define reg_p_csi_mul3_lsb 0 ++#define p_reg_p_csi_level3_7_0 0xF652 ++#define reg_p_csi_level3_7_0_pos 0 ++#define reg_p_csi_level3_7_0_len 8 ++#define reg_p_csi_level3_7_0_lsb 0 ++#define p_reg_p_csi_level3_8 0xF653 ++#define reg_p_csi_level3_8_pos 0 ++#define reg_p_csi_level3_8_len 1 ++#define reg_p_csi_level3_8_lsb 8 ++#define p_reg_p_csi_fftout_shift_fix_value 0xF654 ++#define reg_p_csi_fftout_shift_fix_value_pos 0 ++#define reg_p_csi_fftout_shift_fix_value_len 4 ++#define reg_p_csi_fftout_shift_fix_value_lsb 0 ++#define p_reg_p_feq_scale_pow 0xF655 ++#define reg_p_feq_scale_pow_pos 0 ++#define reg_p_feq_scale_pow_len 6 ++#define reg_p_feq_scale_pow_lsb 0 ++#define p_reg_p_csi_cp_idx 0xF656 ++#define reg_p_csi_cp_idx_pos 0 ++#define reg_p_csi_cp_idx_len 8 ++#define reg_p_csi_cp_idx_lsb 0 ++#define p_reg_p_csi_outsh_zero_th_7_0 0xF657 ++#define reg_p_csi_outsh_zero_th_7_0_pos 0 ++#define reg_p_csi_outsh_zero_th_7_0_len 8 ++#define reg_p_csi_outsh_zero_th_7_0_lsb 0 ++#define p_reg_p_csi_outsh_zero_th_10_8 0xF658 ++#define reg_p_csi_outsh_zero_th_10_8_pos 0 ++#define reg_p_csi_outsh_zero_th_10_8_len 3 ++#define reg_p_csi_outsh_zero_th_10_8_lsb 8 ++#define p_reg_p_csi_ar_ratio 0xF659 ++#define reg_p_csi_ar_ratio_pos 0 ++#define reg_p_csi_ar_ratio_len 8 ++#define reg_p_csi_ar_ratio_lsb 0 ++#define p_reg_r_csi_cp_vld 0xF65A ++#define reg_r_csi_cp_vld_pos 0 ++#define reg_r_csi_cp_vld_len 1 ++#define reg_r_csi_cp_vld_lsb 0 ++#define p_reg_r_csi_sp_vld 0xF65B ++#define reg_r_csi_sp_vld_pos 0 ++#define reg_r_csi_sp_vld_len 1 ++#define reg_r_csi_sp_vld_lsb 0 ++#define p_reg_p_csi_fft_out_shift_en 0xF65C ++#define reg_p_csi_fft_out_shift_en_pos 0 ++#define reg_p_csi_fft_out_shift_en_len 1 ++#define reg_p_csi_fft_out_shift_en_lsb 0 ++#define p_reg_p_csi_feq_out_shift_en 0xF65D ++#define reg_p_csi_feq_out_shift_en_pos 0 ++#define reg_p_csi_feq_out_shift_en_len 1 ++#define reg_p_csi_feq_out_shift_en_lsb 0 ++#define p_reg_r_csi_cp_fft_out 0xF65E ++#define reg_r_csi_cp_fft_out_pos 0 ++#define reg_r_csi_cp_fft_out_len 1 ++#define reg_r_csi_cp_fft_out_lsb 0 ++#define p_reg_r_csi_sp_feq_log2_out 0xF65F ++#define reg_r_csi_sp_feq_log2_out_pos 0 ++#define reg_r_csi_sp_feq_log2_out_len 8 ++#define reg_r_csi_sp_feq_log2_out_lsb 0 ++#define p_reg_r_csi_sp_fft_out 0xF660 ++#define reg_r_csi_sp_fft_out_pos 0 ++#define reg_r_csi_sp_fft_out_len 1 ++#define reg_r_csi_sp_fft_out_lsb 0 ++#define p_reg_p_feq_eh2_from_fpcc_en 0xF661 ++#define reg_p_feq_eh2_from_fpcc_en_pos 0 ++#define reg_p_feq_eh2_from_fpcc_en_len 1 ++#define reg_p_feq_eh2_from_fpcc_en_lsb 0 ++#define r_reg_r_fccid_fft_ave_peak_7_0 0xF662 ++#define reg_r_fccid_fft_ave_peak_7_0_pos 0 ++#define reg_r_fccid_fft_ave_peak_7_0_len 8 ++#define reg_r_fccid_fft_ave_peak_7_0_lsb 0 ++#define r_reg_r_fccid_fft_ave_peak_15_8 0xF663 ++#define reg_r_fccid_fft_ave_peak_15_8_pos 0 ++#define reg_r_fccid_fft_ave_peak_15_8_len 8 ++#define reg_r_fccid_fft_ave_peak_15_8_lsb 8 ++#define r_reg_r_fccid_fft_ave_peak_23_16 0xF664 ++#define reg_r_fccid_fft_ave_peak_23_16_pos 0 ++#define reg_r_fccid_fft_ave_peak_23_16_len 8 ++#define reg_r_fccid_fft_ave_peak_23_16_lsb 16 ++#define r_reg_r_fccid_fft_ave_peak_26_24 0xF665 ++#define reg_r_fccid_fft_ave_peak_26_24_pos 0 ++#define reg_r_fccid_fft_ave_peak_26_24_len 3 ++#define reg_r_fccid_fft_ave_peak_26_24_lsb 24 ++#define p_reg_p_fccid_fft_ave_read_rdy 0xF666 ++#define reg_p_fccid_fft_ave_read_rdy_pos 0 ++#define reg_p_fccid_fft_ave_read_rdy_len 1 ++#define reg_p_fccid_fft_ave_read_rdy_lsb 0 ++#define p_reg_p_fccid_fft_ave_read_index_7_0 0xF667 ++#define reg_p_fccid_fft_ave_read_index_7_0_pos 0 ++#define reg_p_fccid_fft_ave_read_index_7_0_len 8 ++#define reg_p_fccid_fft_ave_read_index_7_0_lsb 0 ++#define p_reg_p_fccid_fft_ave_read_index_12_8 0xF668 ++#define reg_p_fccid_fft_ave_read_index_12_8_pos 0 ++#define reg_p_fccid_fft_ave_read_index_12_8_len 5 ++#define reg_p_fccid_fft_ave_read_index_12_8_lsb 8 ++#define p_reg_cdpf_candidate_rw 0xF669 ++#define reg_cdpf_candidate_rw_pos 0 ++#define reg_cdpf_candidate_rw_len 1 ++#define reg_cdpf_candidate_rw_lsb 0 ++#define p_reg_cdpf_candidate_prog_7_0 0xF66A ++#define reg_cdpf_candidate_prog_7_0_pos 0 ++#define reg_cdpf_candidate_prog_7_0_len 8 ++#define reg_cdpf_candidate_prog_7_0_lsb 0 ++#define p_reg_cdpf_candidate_prog_15_8 0xF66B ++#define reg_cdpf_candidate_prog_15_8_pos 0 ++#define reg_cdpf_candidate_prog_15_8_len 8 ++#define reg_cdpf_candidate_prog_15_8_lsb 8 ++#define p_reg_cdpf_candidateno_prog 0xF66C ++#define reg_cdpf_candidateno_prog_pos 0 ++#define reg_cdpf_candidateno_prog_len 6 ++#define reg_cdpf_candidateno_prog_lsb 0 ++#define p_reg_cdpf_candidateno_switch 0xF66D ++#define reg_cdpf_candidateno_switch_pos 0 ++#define reg_cdpf_candidateno_switch_len 1 ++#define reg_cdpf_candidateno_switch_lsb 0 ++#define g_reg_tpsd_txmod 0xF900 ++#define reg_tpsd_txmod_pos 0 ++#define reg_tpsd_txmod_len 2 ++#define reg_tpsd_txmod_lsb 0 ++#define g_reg_tpsd_gi 0xF901 ++#define reg_tpsd_gi_pos 0 ++#define reg_tpsd_gi_len 2 ++#define reg_tpsd_gi_lsb 0 ++#define g_reg_tpsd_hier 0xF902 ++#define reg_tpsd_hier_pos 0 ++#define reg_tpsd_hier_len 3 ++#define reg_tpsd_hier_lsb 0 ++#define g_reg_tpsd_const 0xF903 ++#define reg_tpsd_const_pos 0 ++#define reg_tpsd_const_len 2 ++#define reg_tpsd_const_lsb 0 ++#define g_reg_bw 0xF904 ++#define reg_bw_pos 0 ++#define reg_bw_len 2 ++#define reg_bw_lsb 0 ++#define g_reg_dec_pri 0xF905 ++#define reg_dec_pri_pos 0 ++#define reg_dec_pri_len 1 ++#define reg_dec_pri_lsb 0 ++#define g_reg_tpsd_hpcr 0xF906 ++#define reg_tpsd_hpcr_pos 0 ++#define reg_tpsd_hpcr_len 3 ++#define reg_tpsd_hpcr_lsb 0 ++#define g_reg_tpsd_lpcr 0xF907 ++#define reg_tpsd_lpcr_pos 0 ++#define reg_tpsd_lpcr_len 3 ++#define reg_tpsd_lpcr_lsb 0 ++#define g_reg_tpsd_indep 0xF908 ++#define reg_tpsd_indep_pos 0 ++#define reg_tpsd_indep_len 1 ++#define reg_tpsd_indep_lsb 0 ++#define g_reg_tpsd_tslice 0xF909 ++#define reg_tpsd_tslice_pos 0 ++#define reg_tpsd_tslice_len 1 ++#define reg_tpsd_tslice_lsb 0 ++#define g_reg_tpsd_mpefec 0xF90A ++#define reg_tpsd_mpefec_pos 0 ++#define reg_tpsd_mpefec_len 1 ++#define reg_tpsd_mpefec_lsb 0 ++#define g_reg_sntc_en 0xF90B ++#define reg_sntc_en_pos 0 ++#define reg_sntc_en_len 1 ++#define reg_sntc_en_lsb 0 ++#define g_reg_intp_sys_div 0xF90C ++#define reg_intp_sys_div_pos 0 ++#define reg_intp_sys_div_len 1 ++#define reg_intp_sys_div_lsb 0 ++#define g_reg_clk_sntc_sel 0xF90D ++#define reg_clk_sntc_sel_pos 0 ++#define reg_clk_sntc_sel_len 3 ++#define reg_clk_sntc_sel_lsb 0 ++#define p_reg_ce_gs_force 0xFD00 ++#define reg_ce_gs_force_pos 0 ++#define reg_ce_gs_force_len 1 ++#define reg_ce_gs_force_lsb 0 ++#define p_reg_ce_dagcgain_delay 0xFD01 ++#define reg_ce_dagcgain_delay_pos 0 ++#define reg_ce_dagcgain_delay_len 2 ++#define reg_ce_dagcgain_delay_lsb 0 ++#define p_reg_ce_derot_en 0xFD02 ++#define reg_ce_derot_en_pos 0 ++#define reg_ce_derot_en_len 1 ++#define reg_ce_derot_en_lsb 0 ++#define p_reg_ce_fctrl_en 0xFD05 ++#define reg_ce_fctrl_en_pos 0 ++#define reg_ce_fctrl_en_len 1 ++#define reg_ce_fctrl_en_lsb 0 ++#define p_reg_ce_en 0xFD06 ++#define reg_ce_en_pos 0 ++#define reg_ce_en_len 1 ++#define reg_ce_en_lsb 0 ++#define p_reg_ce_sat_wes 0xFD07 ++#define reg_ce_sat_wes_pos 0 ++#define reg_ce_sat_wes_len 1 ++#define reg_ce_sat_wes_lsb 0 ++#define p_reg_ce_sat_sigma2 0xFD08 ++#define reg_ce_sat_sigma2_pos 0 ++#define reg_ce_sat_sigma2_len 1 ++#define reg_ce_sat_sigma2_lsb 0 ++#define p_reg_ce_sat_tdi_br_re 0xFD09 ++#define reg_ce_sat_tdi_br_re_pos 0 ++#define reg_ce_sat_tdi_br_re_len 1 ++#define reg_ce_sat_tdi_br_re_lsb 0 ++#define p_reg_ce_sat_tdi_br_im 0xFD0A ++#define reg_ce_sat_tdi_br_im_pos 0 ++#define reg_ce_sat_tdi_br_im_len 1 ++#define reg_ce_sat_tdi_br_im_lsb 0 ++#define p_reg_ce_sat_tdi_ar_re 0xFD0B ++#define reg_ce_sat_tdi_ar_re_pos 0 ++#define reg_ce_sat_tdi_ar_re_len 1 ++#define reg_ce_sat_tdi_ar_re_lsb 0 ++#define p_reg_ce_sat_tdi_ar_im 0xFD0C ++#define reg_ce_sat_tdi_ar_im_pos 0 ++#define reg_ce_sat_tdi_ar_im_len 1 ++#define reg_ce_sat_tdi_ar_im_lsb 0 ++#define p_reg_ce_sat_fdi_br_re 0xFD0D ++#define reg_ce_sat_fdi_br_re_pos 0 ++#define reg_ce_sat_fdi_br_re_len 1 ++#define reg_ce_sat_fdi_br_re_lsb 0 ++#define p_reg_ce_sat_fdi_br_im 0xFD0E ++#define reg_ce_sat_fdi_br_im_pos 0 ++#define reg_ce_sat_fdi_br_im_len 1 ++#define reg_ce_sat_fdi_br_im_lsb 0 ++#define p_reg_ce_var_forced_value 0xFD0F ++#define reg_ce_var_forced_value_pos 0 ++#define reg_ce_var_forced_value_len 3 ++#define reg_ce_var_forced_value_lsb 0 ++#define p_reg_ce_s1 0xFD10 ++#define reg_ce_s1_pos 0 ++#define reg_ce_s1_len 5 ++#define reg_ce_s1_lsb 0 ++#define r_reg_ce_tdi_flatness_7_0 0xFD11 ++#define reg_ce_tdi_flatness_7_0_pos 0 ++#define reg_ce_tdi_flatness_7_0_len 8 ++#define reg_ce_tdi_flatness_7_0_lsb 0 ++#define r_reg_ce_tdi_flatness_8 0xFD12 ++#define reg_ce_tdi_flatness_8_pos 0 ++#define reg_ce_tdi_flatness_8_len 1 ++#define reg_ce_tdi_flatness_8_lsb 8 ++#define r_reg_ce_tone_7_0 0xFD13 ++#define reg_ce_tone_7_0_pos 0 ++#define reg_ce_tone_7_0_len 8 ++#define reg_ce_tone_7_0_lsb 0 ++#define r_reg_ce_tone_12_8 0xFD14 ++#define reg_ce_tone_12_8_pos 0 ++#define reg_ce_tone_12_8_len 5 ++#define reg_ce_tone_12_8_lsb 8 ++#define p_reg_ce_centroid_drift_th 0xFD15 ++#define reg_ce_centroid_drift_th_pos 0 ++#define reg_ce_centroid_drift_th_len 8 ++#define reg_ce_centroid_drift_th_lsb 0 ++#define p_reg_ce_centroid_bias_inc_7_0 0xFD16 ++#define reg_ce_centroid_bias_inc_7_0_pos 0 ++#define reg_ce_centroid_bias_inc_7_0_len 8 ++#define reg_ce_centroid_bias_inc_7_0_lsb 0 ++#define p_reg_ce_centroid_bias_inc_8 0xFD17 ++#define reg_ce_centroid_bias_inc_8_pos 0 ++#define reg_ce_centroid_bias_inc_8_len 1 ++#define reg_ce_centroid_bias_inc_8_lsb 8 ++#define p_reg_ce_centroid_count_max 0xFD18 ++#define reg_ce_centroid_count_max_pos 0 ++#define reg_ce_centroid_count_max_len 4 ++#define reg_ce_centroid_count_max_lsb 0 ++#define p_reg_ce_var_th0_7_0 0xFD19 ++#define reg_ce_var_th0_7_0_pos 0 ++#define reg_ce_var_th0_7_0_len 8 ++#define reg_ce_var_th0_7_0_lsb 0 ++#define p_reg_ce_var_th0_15_8 0xFD1A ++#define reg_ce_var_th0_15_8_pos 0 ++#define reg_ce_var_th0_15_8_len 8 ++#define reg_ce_var_th0_15_8_lsb 8 ++#define p_reg_ce_var_th1_7_0 0xFD1B ++#define reg_ce_var_th1_7_0_pos 0 ++#define reg_ce_var_th1_7_0_len 8 ++#define reg_ce_var_th1_7_0_lsb 0 ++#define p_reg_ce_var_th1_15_8 0xFD1C ++#define reg_ce_var_th1_15_8_pos 0 ++#define reg_ce_var_th1_15_8_len 8 ++#define reg_ce_var_th1_15_8_lsb 8 ++#define p_reg_ce_var_th2_7_0 0xFD1D ++#define reg_ce_var_th2_7_0_pos 0 ++#define reg_ce_var_th2_7_0_len 8 ++#define reg_ce_var_th2_7_0_lsb 0 ++#define p_reg_ce_var_th2_15_8 0xFD1E ++#define reg_ce_var_th2_15_8_pos 0 ++#define reg_ce_var_th2_15_8_len 8 ++#define reg_ce_var_th2_15_8_lsb 8 ++#define p_reg_ce_var_th3_7_0 0xFD1F ++#define reg_ce_var_th3_7_0_pos 0 ++#define reg_ce_var_th3_7_0_len 8 ++#define reg_ce_var_th3_7_0_lsb 0 ++#define p_reg_ce_var_th3_15_8 0xFD20 ++#define reg_ce_var_th3_15_8_pos 0 ++#define reg_ce_var_th3_15_8_len 8 ++#define reg_ce_var_th3_15_8_lsb 8 ++#define p_reg_ce_var_th4_7_0 0xFD21 ++#define reg_ce_var_th4_7_0_pos 0 ++#define reg_ce_var_th4_7_0_len 8 ++#define reg_ce_var_th4_7_0_lsb 0 ++#define p_reg_ce_var_th4_15_8 0xFD22 ++#define reg_ce_var_th4_15_8_pos 0 ++#define reg_ce_var_th4_15_8_len 8 ++#define reg_ce_var_th4_15_8_lsb 8 ++#define p_reg_ce_var_th5_7_0 0xFD23 ++#define reg_ce_var_th5_7_0_pos 0 ++#define reg_ce_var_th5_7_0_len 8 ++#define reg_ce_var_th5_7_0_lsb 0 ++#define p_reg_ce_var_th5_15_8 0xFD24 ++#define reg_ce_var_th5_15_8_pos 0 ++#define reg_ce_var_th5_15_8_len 8 ++#define reg_ce_var_th5_15_8_lsb 8 ++#define p_reg_ce_var_th6_7_0 0xFD25 ++#define reg_ce_var_th6_7_0_pos 0 ++#define reg_ce_var_th6_7_0_len 8 ++#define reg_ce_var_th6_7_0_lsb 0 ++#define p_reg_ce_var_th6_15_8 0xFD26 ++#define reg_ce_var_th6_15_8_pos 0 ++#define reg_ce_var_th6_15_8_len 8 ++#define reg_ce_var_th6_15_8_lsb 8 ++#define p_reg_ce_var_max 0xFD27 ++#define reg_ce_var_max_pos 0 ++#define reg_ce_var_max_len 3 ++#define reg_ce_var_max_lsb 0 ++#define p_reg_ce_cent_forced_en 0xFD28 ++#define reg_ce_cent_forced_en_pos 0 ++#define reg_ce_cent_forced_en_len 1 ++#define reg_ce_cent_forced_en_lsb 0 ++#define p_reg_ce_var_forced_en 0xFD29 ++#define reg_ce_var_forced_en_pos 0 ++#define reg_ce_var_forced_en_len 1 ++#define reg_ce_var_forced_en_lsb 0 ++#define p_reg_ce_fctrl_auto_reset_en 0xFD2A ++#define reg_ce_fctrl_auto_reset_en_pos 0 ++#define reg_ce_fctrl_auto_reset_en_len 1 ++#define reg_ce_fctrl_auto_reset_en_lsb 0 ++#define p_reg_ce_cent_auto_clr_en 0xFD2B ++#define reg_ce_cent_auto_clr_en_pos 0 ++#define reg_ce_cent_auto_clr_en_len 1 ++#define reg_ce_cent_auto_clr_en_lsb 0 ++#define p_reg_ce_fctrl_reset 0xFD2C ++#define reg_ce_fctrl_reset_pos 0 ++#define reg_ce_fctrl_reset_len 1 ++#define reg_ce_fctrl_reset_lsb 0 ++#define p_reg_ce_cent_forced_value_7_0 0xFD2D ++#define reg_ce_cent_forced_value_7_0_pos 0 ++#define reg_ce_cent_forced_value_7_0_len 8 ++#define reg_ce_cent_forced_value_7_0_lsb 0 ++#define p_reg_ce_cent_forced_value_11_8 0xFD2E ++#define reg_ce_cent_forced_value_11_8_pos 0 ++#define reg_ce_cent_forced_value_11_8_len 4 ++#define reg_ce_cent_forced_value_11_8_lsb 8 ++#define p_reg_ce_cent_auto_clr_value_7_0 0xFD2F ++#define reg_ce_cent_auto_clr_value_7_0_pos 0 ++#define reg_ce_cent_auto_clr_value_7_0_len 8 ++#define reg_ce_cent_auto_clr_value_7_0_lsb 0 ++#define p_reg_ce_cent_auto_clr_value_11_8 0xFD30 ++#define reg_ce_cent_auto_clr_value_11_8_pos 0 ++#define reg_ce_cent_auto_clr_value_11_8_len 4 ++#define reg_ce_cent_auto_clr_value_11_8_lsb 8 ++#define p_reg_ce_centroid_max_7_0 0xFD31 ++#define reg_ce_centroid_max_7_0_pos 0 ++#define reg_ce_centroid_max_7_0_len 8 ++#define reg_ce_centroid_max_7_0_lsb 0 ++#define p_reg_ce_centroid_max_11_8 0xFD32 ++#define reg_ce_centroid_max_11_8_pos 0 ++#define reg_ce_centroid_max_11_8_len 4 ++#define reg_ce_centroid_max_11_8_lsb 8 ++#define p_reg_ce_fctrl_rd 0xFD33 ++#define reg_ce_fctrl_rd_pos 0 ++#define reg_ce_fctrl_rd_len 1 ++#define reg_ce_fctrl_rd_lsb 0 ++#define r_reg_ce_centroid_out_7_0 0xFD34 ++#define reg_ce_centroid_out_7_0_pos 0 ++#define reg_ce_centroid_out_7_0_len 8 ++#define reg_ce_centroid_out_7_0_lsb 0 ++#define r_reg_ce_centroid_out_11_8 0xFD35 ++#define reg_ce_centroid_out_11_8_pos 0 ++#define reg_ce_centroid_out_11_8_len 4 ++#define reg_ce_centroid_out_11_8_lsb 8 ++#define r_reg_ce_fctrl_rdy 0xFD36 ++#define reg_ce_fctrl_rdy_pos 0 ++#define reg_ce_fctrl_rdy_len 1 ++#define reg_ce_fctrl_rdy_lsb 0 ++#define r_reg_ce_var 0xFD37 ++#define reg_ce_var_pos 0 ++#define reg_ce_var_len 3 ++#define reg_ce_var_lsb 0 ++#define r_reg_ce_bias_7_0 0xFD38 ++#define reg_ce_bias_7_0_pos 0 ++#define reg_ce_bias_7_0_len 8 ++#define reg_ce_bias_7_0_lsb 0 ++#define r_reg_ce_bias_11_8 0xFD39 ++#define reg_ce_bias_11_8_pos 0 ++#define reg_ce_bias_11_8_len 4 ++#define reg_ce_bias_11_8_lsb 8 ++#define r_reg_ce_m1_7_0 0xFD3A ++#define reg_ce_m1_7_0_pos 0 ++#define reg_ce_m1_7_0_len 8 ++#define reg_ce_m1_7_0_lsb 0 ++#define r_reg_ce_m1_11_8 0xFD3B ++#define reg_ce_m1_11_8_pos 0 ++#define reg_ce_m1_11_8_len 4 ++#define reg_ce_m1_11_8_lsb 8 ++#define r_reg_ce_rh0_7_0 0xFD3C ++#define reg_ce_rh0_7_0_pos 0 ++#define reg_ce_rh0_7_0_len 8 ++#define reg_ce_rh0_7_0_lsb 0 ++#define r_reg_ce_rh0_15_8 0xFD3D ++#define reg_ce_rh0_15_8_pos 0 ++#define reg_ce_rh0_15_8_len 8 ++#define reg_ce_rh0_15_8_lsb 8 ++#define r_reg_ce_rh0_23_16 0xFD3E ++#define reg_ce_rh0_23_16_pos 0 ++#define reg_ce_rh0_23_16_len 8 ++#define reg_ce_rh0_23_16_lsb 16 ++#define r_reg_ce_rh0_31_24 0xFD3F ++#define reg_ce_rh0_31_24_pos 0 ++#define reg_ce_rh0_31_24_len 8 ++#define reg_ce_rh0_31_24_lsb 24 ++#define p_reg_ce_tdi_delta 0xFD40 ++#define reg_ce_tdi_delta_pos 0 ++#define reg_ce_tdi_delta_len 3 ++#define reg_ce_tdi_delta_lsb 0 ++#define p_reg_ce_fdi_delta 0xFD41 ++#define reg_ce_fdi_delta_pos 0 ++#define reg_ce_fdi_delta_len 3 ++#define reg_ce_fdi_delta_lsb 0 ++#define p_reg_ce_fste_delta 0xFD42 ++#define reg_ce_fste_delta_pos 0 ++#define reg_ce_fste_delta_len 3 ++#define reg_ce_fste_delta_lsb 0 ++#define r_reg_ce_fft_s1 0xFD43 ++#define reg_ce_fft_s1_pos 0 ++#define reg_ce_fft_s1_len 4 ++#define reg_ce_fft_s1_lsb 0 ++#define r_reg_feq_fix_eh2_7_0 0xFD44 ++#define reg_feq_fix_eh2_7_0_pos 0 ++#define reg_feq_fix_eh2_7_0_len 8 ++#define reg_feq_fix_eh2_7_0_lsb 0 ++#define r_reg_feq_fix_eh2_15_8 0xFD45 ++#define reg_feq_fix_eh2_15_8_pos 0 ++#define reg_feq_fix_eh2_15_8_len 8 ++#define reg_feq_fix_eh2_15_8_lsb 8 ++#define r_reg_feq_fix_eh2_23_16 0xFD46 ++#define reg_feq_fix_eh2_23_16_pos 0 ++#define reg_feq_fix_eh2_23_16_len 8 ++#define reg_feq_fix_eh2_23_16_lsb 16 ++#define r_reg_feq_fix_eh2_31_24 0xFD47 ++#define reg_feq_fix_eh2_31_24_pos 0 ++#define reg_feq_fix_eh2_31_24_len 8 ++#define reg_feq_fix_eh2_31_24_lsb 24 ++#define r_reg_ce_m2_central_7_0 0xFD48 ++#define reg_ce_m2_central_7_0_pos 0 ++#define reg_ce_m2_central_7_0_len 8 ++#define reg_ce_m2_central_7_0_lsb 0 ++#define r_reg_ce_m2_central_15_8 0xFD49 ++#define reg_ce_m2_central_15_8_pos 0 ++#define reg_ce_m2_central_15_8_len 8 ++#define reg_ce_m2_central_15_8_lsb 8 ++#define r_reg_ce_sigma2_7_0 0xFD4A ++#define reg_ce_sigma2_7_0_pos 0 ++#define reg_ce_sigma2_7_0_len 8 ++#define reg_ce_sigma2_7_0_lsb 0 ++#define r_reg_ce_sigma2_15_8 0xFD4B ++#define reg_ce_sigma2_15_8_pos 0 ++#define reg_ce_sigma2_15_8_len 8 ++#define reg_ce_sigma2_15_8_lsb 8 ++#define r_reg_ce_sigma2_19_16 0xFD4C ++#define reg_ce_sigma2_19_16_pos 0 ++#define reg_ce_sigma2_19_16_len 4 ++#define reg_ce_sigma2_19_16_lsb 16 ++#define r_reg_ce_data_im_7_0 0xFD4D ++#define reg_ce_data_im_7_0_pos 0 ++#define reg_ce_data_im_7_0_len 8 ++#define reg_ce_data_im_7_0_lsb 0 ++#define r_reg_ce_data_im_14_8 0xFD4E ++#define reg_ce_data_im_14_8_pos 0 ++#define reg_ce_data_im_14_8_len 7 ++#define reg_ce_data_im_14_8_lsb 8 ++#define r_reg_ce_data_re_7_0 0xFD4F ++#define reg_ce_data_re_7_0_pos 0 ++#define reg_ce_data_re_7_0_len 8 ++#define reg_ce_data_re_7_0_lsb 0 ++#define r_reg_ce_data_re_14_8 0xFD50 ++#define reg_ce_data_re_14_8_pos 0 ++#define reg_ce_data_re_14_8_len 7 ++#define reg_ce_data_re_14_8_lsb 8 ++#define p_reg_ce_var_default_value 0xFD51 ++#define reg_ce_var_default_value_pos 0 ++#define reg_ce_var_default_value_len 3 ++#define reg_ce_var_default_value_lsb 0 ++#define p_reg_ce_cent_default_value_7_0 0xFD52 ++#define reg_ce_cent_default_value_7_0_pos 0 ++#define reg_ce_cent_default_value_7_0_len 8 ++#define reg_ce_cent_default_value_7_0_lsb 0 ++#define p_reg_ce_cent_default_value_11_8 0xFD53 ++#define reg_ce_cent_default_value_11_8_pos 0 ++#define reg_ce_cent_default_value_11_8_len 4 ++#define reg_ce_cent_default_value_11_8_lsb 8 ++#define r_reg_ce_var_hw 0xFD54 ++#define reg_ce_var_hw_pos 0 ++#define reg_ce_var_hw_len 3 ++#define reg_ce_var_hw_lsb 0 ++#define r_reg_ce_cent_hw_7_0 0xFD55 ++#define reg_ce_cent_hw_7_0_pos 0 ++#define reg_ce_cent_hw_7_0_len 8 ++#define reg_ce_cent_hw_7_0_lsb 0 ++#define r_reg_ce_cent_hw_11_8 0xFD56 ++#define reg_ce_cent_hw_11_8_pos 0 ++#define reg_ce_cent_hw_11_8_len 4 ++#define reg_ce_cent_hw_11_8_lsb 8 ++#define p_reg_ce_fdi_cp_test_en 0xFD57 ++#define reg_ce_fdi_cp_test_en_pos 0 ++#define reg_ce_fdi_cp_test_en_len 1 ++#define reg_ce_fdi_cp_test_en_lsb 0 ++#define p_reg_ce_cptestindex0_7_0 0xFD58 ++#define reg_ce_cptestindex0_7_0_pos 0 ++#define reg_ce_cptestindex0_7_0_len 8 ++#define reg_ce_cptestindex0_7_0_lsb 0 ++#define p_reg_ce_cptestindex0_12_8 0xFD59 ++#define reg_ce_cptestindex0_12_8_pos 0 ++#define reg_ce_cptestindex0_12_8_len 5 ++#define reg_ce_cptestindex0_12_8_lsb 8 ++#define p_reg_ce_cptestfdi0 0xFD5A ++#define reg_ce_cptestfdi0_pos 0 ++#define reg_ce_cptestfdi0_len 3 ++#define reg_ce_cptestfdi0_lsb 0 ++#define p_reg_ce_cptestindex1_7_0 0xFD5B ++#define reg_ce_cptestindex1_7_0_pos 0 ++#define reg_ce_cptestindex1_7_0_len 8 ++#define reg_ce_cptestindex1_7_0_lsb 0 ++#define p_reg_ce_cptestindex1_12_8 0xFD5C ++#define reg_ce_cptestindex1_12_8_pos 0 ++#define reg_ce_cptestindex1_12_8_len 5 ++#define reg_ce_cptestindex1_12_8_lsb 8 ++#define p_reg_ce_cptestfdi1 0xFD5D ++#define reg_ce_cptestfdi1_pos 0 ++#define reg_ce_cptestfdi1_len 3 ++#define reg_ce_cptestfdi1_lsb 0 ++#define p_reg_ce_cptestindex2_7_0 0xFD5E ++#define reg_ce_cptestindex2_7_0_pos 0 ++#define reg_ce_cptestindex2_7_0_len 8 ++#define reg_ce_cptestindex2_7_0_lsb 0 ++#define p_reg_ce_cptestindex2_12_8 0xFD5F ++#define reg_ce_cptestindex2_12_8_pos 0 ++#define reg_ce_cptestindex2_12_8_len 5 ++#define reg_ce_cptestindex2_12_8_lsb 8 ++#define p_reg_ce_cptestfdi2 0xFD60 ++#define reg_ce_cptestfdi2_pos 0 ++#define reg_ce_cptestfdi2_len 3 ++#define reg_ce_cptestfdi2_lsb 0 ++#define p_reg_ce_cptestindex3_7_0 0xFD61 ++#define reg_ce_cptestindex3_7_0_pos 0 ++#define reg_ce_cptestindex3_7_0_len 8 ++#define reg_ce_cptestindex3_7_0_lsb 0 ++#define p_reg_ce_cptestindex3_12_8 0xFD62 ++#define reg_ce_cptestindex3_12_8_pos 0 ++#define reg_ce_cptestindex3_12_8_len 5 ++#define reg_ce_cptestindex3_12_8_lsb 8 ++#define p_reg_ce_cptestfdi3 0xFD63 ++#define reg_ce_cptestfdi3_pos 0 ++#define reg_ce_cptestfdi3_len 3 ++#define reg_ce_cptestfdi3_lsb 0 ++#define p_reg_ce_cptestindex4_7_0 0xFD64 ++#define reg_ce_cptestindex4_7_0_pos 0 ++#define reg_ce_cptestindex4_7_0_len 8 ++#define reg_ce_cptestindex4_7_0_lsb 0 ++#define p_reg_ce_cptestindex4_12_8 0xFD65 ++#define reg_ce_cptestindex4_12_8_pos 0 ++#define reg_ce_cptestindex4_12_8_len 5 ++#define reg_ce_cptestindex4_12_8_lsb 8 ++#define p_reg_ce_cptestfdi4 0xFD66 ++#define reg_ce_cptestfdi4_pos 0 ++#define reg_ce_cptestfdi4_len 3 ++#define reg_ce_cptestfdi4_lsb 0 ++#define p_reg_ce_cptestindex5_7_0 0xFD67 ++#define reg_ce_cptestindex5_7_0_pos 0 ++#define reg_ce_cptestindex5_7_0_len 8 ++#define reg_ce_cptestindex5_7_0_lsb 0 ++#define p_reg_ce_cptestindex5_12_8 0xFD68 ++#define reg_ce_cptestindex5_12_8_pos 0 ++#define reg_ce_cptestindex5_12_8_len 5 ++#define reg_ce_cptestindex5_12_8_lsb 8 ++#define p_reg_ce_cptestfdi5 0xFD69 ++#define reg_ce_cptestfdi5_pos 0 ++#define reg_ce_cptestfdi5_len 3 ++#define reg_ce_cptestfdi5_lsb 0 ++#define p_reg_ce_cptestindex6_7_0 0xFD6A ++#define reg_ce_cptestindex6_7_0_pos 0 ++#define reg_ce_cptestindex6_7_0_len 8 ++#define reg_ce_cptestindex6_7_0_lsb 0 ++#define p_reg_ce_cptestindex6_12_8 0xFD6B ++#define reg_ce_cptestindex6_12_8_pos 0 ++#define reg_ce_cptestindex6_12_8_len 5 ++#define reg_ce_cptestindex6_12_8_lsb 8 ++#define p_reg_ce_cptestfdi6 0xFD6C ++#define reg_ce_cptestfdi6_pos 0 ++#define reg_ce_cptestfdi6_len 3 ++#define reg_ce_cptestfdi6_lsb 0 ++#define p_reg_ce_cptestindex7_7_0 0xFD6D ++#define reg_ce_cptestindex7_7_0_pos 0 ++#define reg_ce_cptestindex7_7_0_len 8 ++#define reg_ce_cptestindex7_7_0_lsb 0 ++#define p_reg_ce_cptestindex7_12_8 0xFD6E ++#define reg_ce_cptestindex7_12_8_pos 0 ++#define reg_ce_cptestindex7_12_8_len 5 ++#define reg_ce_cptestindex7_12_8_lsb 8 ++#define p_reg_ce_cptestfdi7 0xFD6F ++#define reg_ce_cptestfdi7_pos 0 ++#define reg_ce_cptestfdi7_len 3 ++#define reg_ce_cptestfdi7_lsb 0 ++#define p_reg_ce_cp_replace_tdiout_en 0xFD74 ++#define reg_ce_cp_replace_tdiout_en_pos 0 ++#define reg_ce_cp_replace_tdiout_en_len 1 ++#define reg_ce_cp_replace_tdiout_en_lsb 0 ++#define p_reg_ce_tdi_mask0_en 0xFD7D ++#define reg_ce_tdi_mask0_en_pos 0 ++#define reg_ce_tdi_mask0_en_len 1 ++#define reg_ce_tdi_mask0_en_lsb 0 ++#define p_reg_ce_tdi_mask_from0_7_0 0xFD7E ++#define reg_ce_tdi_mask_from0_7_0_pos 0 ++#define reg_ce_tdi_mask_from0_7_0_len 8 ++#define reg_ce_tdi_mask_from0_7_0_lsb 0 ++#define p_reg_ce_tdi_mask_from0_12_8 0xFD7F ++#define reg_ce_tdi_mask_from0_12_8_pos 0 ++#define reg_ce_tdi_mask_from0_12_8_len 5 ++#define reg_ce_tdi_mask_from0_12_8_lsb 8 ++#define p_reg_ce_tdi_mask_to0_7_0 0xFD80 ++#define reg_ce_tdi_mask_to0_7_0_pos 0 ++#define reg_ce_tdi_mask_to0_7_0_len 8 ++#define reg_ce_tdi_mask_to0_7_0_lsb 0 ++#define p_reg_ce_tdi_mask_to0_12_8 0xFD81 ++#define reg_ce_tdi_mask_to0_12_8_pos 0 ++#define reg_ce_tdi_mask_to0_12_8_len 5 ++#define reg_ce_tdi_mask_to0_12_8_lsb 8 ++#define p_reg_ce_tdi_mask1_en 0xFD82 ++#define reg_ce_tdi_mask1_en_pos 0 ++#define reg_ce_tdi_mask1_en_len 1 ++#define reg_ce_tdi_mask1_en_lsb 0 ++#define p_reg_ce_tdi_mask_from1_7_0 0xFD83 ++#define reg_ce_tdi_mask_from1_7_0_pos 0 ++#define reg_ce_tdi_mask_from1_7_0_len 8 ++#define reg_ce_tdi_mask_from1_7_0_lsb 0 ++#define p_reg_ce_tdi_mask_from1_12_8 0xFD84 ++#define reg_ce_tdi_mask_from1_12_8_pos 0 ++#define reg_ce_tdi_mask_from1_12_8_len 5 ++#define reg_ce_tdi_mask_from1_12_8_lsb 8 ++#define p_reg_ce_tdi_mask_to1_7_0 0xFD85 ++#define reg_ce_tdi_mask_to1_7_0_pos 0 ++#define reg_ce_tdi_mask_to1_7_0_len 8 ++#define reg_ce_tdi_mask_to1_7_0_lsb 0 ++#define p_reg_ce_tdi_mask_to1_12_8 0xFD86 ++#define reg_ce_tdi_mask_to1_12_8_pos 0 ++#define reg_ce_tdi_mask_to1_12_8_len 5 ++#define reg_ce_tdi_mask_to1_12_8_lsb 8 ++#define p_reg_ce_2nd_var_max 0xFD87 ++#define reg_ce_2nd_var_max_pos 0 ++#define reg_ce_2nd_var_max_len 3 ++#define reg_ce_2nd_var_max_lsb 0 ++#define p_reg_ce_2nd_cent_forced_en 0xFD88 ++#define reg_ce_2nd_cent_forced_en_pos 0 ++#define reg_ce_2nd_cent_forced_en_len 1 ++#define reg_ce_2nd_cent_forced_en_lsb 0 ++#define p_reg_ce_2nd_var_forced_en 0xFD89 ++#define reg_ce_2nd_var_forced_en_pos 0 ++#define reg_ce_2nd_var_forced_en_len 1 ++#define reg_ce_2nd_var_forced_en_lsb 0 ++#define p_reg_ce_2nd_fctrl_auto_reset_en 0xFD8A ++#define reg_ce_2nd_fctrl_auto_reset_en_pos 0 ++#define reg_ce_2nd_fctrl_auto_reset_en_len 1 ++#define reg_ce_2nd_fctrl_auto_reset_en_lsb 0 ++#define p_reg_ce_2nd_cent_auto_clr_en 0xFD8B ++#define reg_ce_2nd_cent_auto_clr_en_pos 0 ++#define reg_ce_2nd_cent_auto_clr_en_len 1 ++#define reg_ce_2nd_cent_auto_clr_en_lsb 0 ++#define p_reg_ce_2nd_cent_forced_value_7_0 0xFD8C ++#define reg_ce_2nd_cent_forced_value_7_0_pos 0 ++#define reg_ce_2nd_cent_forced_value_7_0_len 8 ++#define reg_ce_2nd_cent_forced_value_7_0_lsb 0 ++#define p_reg_ce_2nd_cent_forced_value_11_8 0xFD8D ++#define reg_ce_2nd_cent_forced_value_11_8_pos 0 ++#define reg_ce_2nd_cent_forced_value_11_8_len 4 ++#define reg_ce_2nd_cent_forced_value_11_8_lsb 8 ++#define p_reg_ce_2nd_cent_auto_clr_value_7_0 0xFD8E ++#define reg_ce_2nd_cent_auto_clr_value_7_0_pos 0 ++#define reg_ce_2nd_cent_auto_clr_value_7_0_len 8 ++#define reg_ce_2nd_cent_auto_clr_value_7_0_lsb 0 ++#define p_reg_ce_2nd_cent_auto_clr_value_11_8 0xFD8F ++#define reg_ce_2nd_cent_auto_clr_value_11_8_pos 0 ++#define reg_ce_2nd_cent_auto_clr_value_11_8_len 4 ++#define reg_ce_2nd_cent_auto_clr_value_11_8_lsb 8 ++#define p_reg_ce_gs_s1_var 0xFD90 ++#define reg_ce_gs_s1_var_pos 0 ++#define reg_ce_gs_s1_var_len 4 ++#define reg_ce_gs_s1_var_lsb 0 ++#define p_reg_ce_2nd_centroid_max_7_0 0xFD91 ++#define reg_ce_2nd_centroid_max_7_0_pos 0 ++#define reg_ce_2nd_centroid_max_7_0_len 8 ++#define reg_ce_2nd_centroid_max_7_0_lsb 0 ++#define p_reg_ce_2nd_centroid_max_11_8 0xFD92 ++#define reg_ce_2nd_centroid_max_11_8_pos 0 ++#define reg_ce_2nd_centroid_max_11_8_len 4 ++#define reg_ce_2nd_centroid_max_11_8_lsb 8 ++#define r_reg_ce_2nd_centroid_out_7_0 0xFD93 ++#define reg_ce_2nd_centroid_out_7_0_pos 0 ++#define reg_ce_2nd_centroid_out_7_0_len 8 ++#define reg_ce_2nd_centroid_out_7_0_lsb 0 ++#define r_reg_ce_2nd_centroid_out_11_8 0xFD94 ++#define reg_ce_2nd_centroid_out_11_8_pos 0 ++#define reg_ce_2nd_centroid_out_11_8_len 4 ++#define reg_ce_2nd_centroid_out_11_8_lsb 8 ++#define r_reg_ce_2nd_fctrl_rdy 0xFD95 ++#define reg_ce_2nd_fctrl_rdy_pos 0 ++#define reg_ce_2nd_fctrl_rdy_len 1 ++#define reg_ce_2nd_fctrl_rdy_lsb 0 ++#define r_reg_ce_2nd_var 0xFD96 ++#define reg_ce_2nd_var_pos 0 ++#define reg_ce_2nd_var_len 3 ++#define reg_ce_2nd_var_lsb 0 ++#define r_reg_ce_2nd_bias_7_0 0xFD97 ++#define reg_ce_2nd_bias_7_0_pos 0 ++#define reg_ce_2nd_bias_7_0_len 8 ++#define reg_ce_2nd_bias_7_0_lsb 0 ++#define r_reg_ce_2nd_bias_11_8 0xFD98 ++#define reg_ce_2nd_bias_11_8_pos 0 ++#define reg_ce_2nd_bias_11_8_len 4 ++#define reg_ce_2nd_bias_11_8_lsb 8 ++#define r_reg_ce_2nd_m1_7_0 0xFD99 ++#define reg_ce_2nd_m1_7_0_pos 0 ++#define reg_ce_2nd_m1_7_0_len 8 ++#define reg_ce_2nd_m1_7_0_lsb 0 ++#define r_reg_ce_2nd_m1_11_8 0xFD9A ++#define reg_ce_2nd_m1_11_8_pos 0 ++#define reg_ce_2nd_m1_11_8_len 4 ++#define reg_ce_2nd_m1_11_8_lsb 8 ++#define p_reg_ce_2nd_var_forced_value 0xFD9B ++#define reg_ce_2nd_var_forced_value_pos 0 ++#define reg_ce_2nd_var_forced_value_len 3 ++#define reg_ce_2nd_var_forced_value_lsb 0 ++#define r_reg_ce_2nd_m2_central_7_0 0xFD9C ++#define reg_ce_2nd_m2_central_7_0_pos 0 ++#define reg_ce_2nd_m2_central_7_0_len 8 ++#define reg_ce_2nd_m2_central_7_0_lsb 0 ++#define r_reg_ce_2nd_m2_central_15_8 0xFD9D ++#define reg_ce_2nd_m2_central_15_8_pos 0 ++#define reg_ce_2nd_m2_central_15_8_len 8 ++#define reg_ce_2nd_m2_central_15_8_lsb 8 ++#define p_reg_ce_2nd_var_default_value 0xFD9E ++#define reg_ce_2nd_var_default_value_pos 0 ++#define reg_ce_2nd_var_default_value_len 3 ++#define reg_ce_2nd_var_default_value_lsb 0 ++#define p_reg_ce_2nd_cent_default_value_7_0 0xFD9F ++#define reg_ce_2nd_cent_default_value_7_0_pos 0 ++#define reg_ce_2nd_cent_default_value_7_0_len 8 ++#define reg_ce_2nd_cent_default_value_7_0_lsb 0 ++#define p_reg_ce_2nd_cent_default_value_11_8 0xFDA0 ++#define reg_ce_2nd_cent_default_value_11_8_pos 0 ++#define reg_ce_2nd_cent_default_value_11_8_len 4 ++#define reg_ce_2nd_cent_default_value_11_8_lsb 8 ++#define p_reg_ce_use_fdi_long 0xFDA1 ++#define reg_ce_use_fdi_long_pos 0 ++#define reg_ce_use_fdi_long_len 1 ++#define reg_ce_use_fdi_long_lsb 0 ++#define p_reg_p_ce_tdi_lms_en 0xFDA2 ++#define reg_p_ce_tdi_lms_en_pos 0 ++#define reg_p_ce_tdi_lms_en_len 1 ++#define reg_p_ce_tdi_lms_en_lsb 0 ++#define p_reg_p_ce_tdi_lms_bufshift 0xFDA3 ++#define reg_p_ce_tdi_lms_bufshift_pos 0 ++#define reg_p_ce_tdi_lms_bufshift_len 2 ++#define reg_p_ce_tdi_lms_bufshift_lsb 0 ++#define p_reg_p_ce_tdi_lms_ave_ratio 0xFDA4 ++#define reg_p_ce_tdi_lms_ave_ratio_pos 0 ++#define reg_p_ce_tdi_lms_ave_ratio_len 5 ++#define reg_p_ce_tdi_lms_ave_ratio_lsb 0 ++#define p_reg_p_ce_conf2_in_con0_en 0xFDA5 ++#define reg_p_ce_conf2_in_con0_en_pos 0 ++#define reg_p_ce_conf2_in_con0_en_len 1 ++#define reg_p_ce_conf2_in_con0_en_lsb 0 ++#define p_fec_rsd_packet_unit_7_0 0xF700 ++#define fec_rsd_packet_unit_7_0_pos 0 ++#define fec_rsd_packet_unit_7_0_len 8 ++#define fec_rsd_packet_unit_7_0_lsb 0 ++#define p_fec_rsd_packet_unit_15_8 0xF701 ++#define fec_rsd_packet_unit_15_8_pos 0 ++#define fec_rsd_packet_unit_15_8_len 8 ++#define fec_rsd_packet_unit_15_8_lsb 8 ++#define r_reg_rsd_bit_err_cnt_7_0 0xF702 ++#define reg_rsd_bit_err_cnt_7_0_pos 0 ++#define reg_rsd_bit_err_cnt_7_0_len 8 ++#define reg_rsd_bit_err_cnt_7_0_lsb 0 ++#define r_reg_rsd_bit_err_cnt_15_8 0xF703 ++#define reg_rsd_bit_err_cnt_15_8_pos 0 ++#define reg_rsd_bit_err_cnt_15_8_len 8 ++#define reg_rsd_bit_err_cnt_15_8_lsb 8 ++#define r_reg_rsd_bit_err_cnt_23_16 0xF704 ++#define reg_rsd_bit_err_cnt_23_16_pos 0 ++#define reg_rsd_bit_err_cnt_23_16_len 8 ++#define reg_rsd_bit_err_cnt_23_16_lsb 16 ++#define r_reg_rsd_abort_packet_cnt_7_0 0xF705 ++#define reg_rsd_abort_packet_cnt_7_0_pos 0 ++#define reg_rsd_abort_packet_cnt_7_0_len 8 ++#define reg_rsd_abort_packet_cnt_7_0_lsb 0 ++#define r_reg_rsd_abort_packet_cnt_15_8 0xF706 ++#define reg_rsd_abort_packet_cnt_15_8_pos 0 ++#define reg_rsd_abort_packet_cnt_15_8_len 8 ++#define reg_rsd_abort_packet_cnt_15_8_lsb 8 ++#define p_fec_RSD_PKT_NUM_PER_UNIT_7_0 0xF707 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_pos 0 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_len 8 ++#define fec_RSD_PKT_NUM_PER_UNIT_7_0_lsb 0 ++#define p_fec_RSD_PKT_NUM_PER_UNIT_15_8 0xF708 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_pos 0 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_len 8 ++#define fec_RSD_PKT_NUM_PER_UNIT_15_8_lsb 8 ++#define p_fec_RS_TH_1_7_0 0xF709 ++#define fec_RS_TH_1_7_0_pos 0 ++#define fec_RS_TH_1_7_0_len 8 ++#define fec_RS_TH_1_7_0_lsb 0 ++#define p_fec_RS_TH_1_15_8 0xF70A ++#define fec_RS_TH_1_15_8_pos 0 ++#define fec_RS_TH_1_15_8_len 8 ++#define fec_RS_TH_1_15_8_lsb 8 ++#define p_fec_RS_TH_2 0xF70B ++#define fec_RS_TH_2_pos 0 ++#define fec_RS_TH_2_len 8 ++#define fec_RS_TH_2_lsb 0 ++#define p_fec_rsd_ber_rst 0xF70C ++#define fec_rsd_ber_rst_pos 0 ++#define fec_rsd_ber_rst_len 1 ++#define fec_rsd_ber_rst_lsb 0 ++#define p_reg_rsd_ber_rdy 0xF70D ++#define reg_rsd_ber_rdy_pos 0 ++#define reg_rsd_ber_rdy_len 1 ++#define reg_rsd_ber_rdy_lsb 0 ++#define p_reg_rsd_trigger_retrain 0xF70E ++#define reg_rsd_trigger_retrain_pos 0 ++#define reg_rsd_trigger_retrain_len 1 ++#define reg_rsd_trigger_retrain_lsb 0 ++#define p_reg_sync_recover 0xF70F ++#define reg_sync_recover_pos 0 ++#define reg_sync_recover_len 1 ++#define reg_sync_recover_lsb 0 ++#define p_fec_crc_en 0xF710 ++#define fec_crc_en_pos 0 ++#define fec_crc_en_len 1 ++#define fec_crc_en_lsb 0 ++#define p_fec_mon_en 0xF711 ++#define fec_mon_en_pos 0 ++#define fec_mon_en_len 1 ++#define fec_mon_en_lsb 0 ++#define p_reg_sync_chk 0xF712 ++#define reg_sync_chk_pos 0 ++#define reg_sync_chk_len 1 ++#define reg_sync_chk_lsb 0 ++#define p_fec_dummy_reg_2 0xF713 ++#define fec_dummy_reg_2_pos 0 ++#define fec_dummy_reg_2_len 3 ++#define fec_dummy_reg_2_lsb 0 ++#define p_reg_fec_data_en 0xF714 ++#define reg_fec_data_en_pos 0 ++#define reg_fec_data_en_len 1 ++#define reg_fec_data_en_lsb 0 ++#define p_fec_vtb_rsd_mon_en 0xF715 ++#define fec_vtb_rsd_mon_en_pos 0 ++#define fec_vtb_rsd_mon_en_len 1 ++#define fec_vtb_rsd_mon_en_lsb 0 ++#define p_reg_fec_sw_rst 0xF716 ++#define reg_fec_sw_rst_pos 0 ++#define reg_fec_sw_rst_len 1 ++#define reg_fec_sw_rst_lsb 0 ++#define r_fec_vtb_pm_crc 0xF717 ++#define fec_vtb_pm_crc_pos 0 ++#define fec_vtb_pm_crc_len 8 ++#define fec_vtb_pm_crc_lsb 0 ++#define r_fec_vtb_tb_7_crc 0xF718 ++#define fec_vtb_tb_7_crc_pos 0 ++#define fec_vtb_tb_7_crc_len 8 ++#define fec_vtb_tb_7_crc_lsb 0 ++#define r_fec_vtb_tb_6_crc 0xF719 ++#define fec_vtb_tb_6_crc_pos 0 ++#define fec_vtb_tb_6_crc_len 8 ++#define fec_vtb_tb_6_crc_lsb 0 ++#define r_fec_vtb_tb_5_crc 0xF71A ++#define fec_vtb_tb_5_crc_pos 0 ++#define fec_vtb_tb_5_crc_len 8 ++#define fec_vtb_tb_5_crc_lsb 0 ++#define r_fec_vtb_tb_4_crc 0xF71B ++#define fec_vtb_tb_4_crc_pos 0 ++#define fec_vtb_tb_4_crc_len 8 ++#define fec_vtb_tb_4_crc_lsb 0 ++#define r_fec_vtb_tb_3_crc 0xF71C ++#define fec_vtb_tb_3_crc_pos 0 ++#define fec_vtb_tb_3_crc_len 8 ++#define fec_vtb_tb_3_crc_lsb 0 ++#define r_fec_vtb_tb_2_crc 0xF71D ++#define fec_vtb_tb_2_crc_pos 0 ++#define fec_vtb_tb_2_crc_len 8 ++#define fec_vtb_tb_2_crc_lsb 0 ++#define r_fec_vtb_tb_1_crc 0xF71E ++#define fec_vtb_tb_1_crc_pos 0 ++#define fec_vtb_tb_1_crc_len 8 ++#define fec_vtb_tb_1_crc_lsb 0 ++#define r_fec_vtb_tb_0_crc 0xF71F ++#define fec_vtb_tb_0_crc_pos 0 ++#define fec_vtb_tb_0_crc_len 8 ++#define fec_vtb_tb_0_crc_lsb 0 ++#define r_fec_rsd_bank0_crc 0xF720 ++#define fec_rsd_bank0_crc_pos 0 ++#define fec_rsd_bank0_crc_len 8 ++#define fec_rsd_bank0_crc_lsb 0 ++#define r_fec_rsd_bank1_crc 0xF721 ++#define fec_rsd_bank1_crc_pos 0 ++#define fec_rsd_bank1_crc_len 8 ++#define fec_rsd_bank1_crc_lsb 0 ++#define r_fec_idi_vtb_crc 0xF722 ++#define fec_idi_vtb_crc_pos 0 ++#define fec_idi_vtb_crc_len 8 ++#define fec_idi_vtb_crc_lsb 0 ++#define p_reg_fec_rsd_packet_unit_exp 0xF723 ++#define reg_fec_rsd_packet_unit_exp_pos 0 ++#define reg_fec_rsd_packet_unit_exp_len 4 ++#define reg_fec_rsd_packet_unit_exp_lsb 0 ++#define p_reg_rsd_bit_err_exp_rdy 0xF724 ++#define reg_rsd_bit_err_exp_rdy_pos 0 ++#define reg_rsd_bit_err_exp_rdy_len 1 ++#define reg_rsd_bit_err_exp_rdy_lsb 0 ++#define r_reg_rsd_bit_err_exp 0xF725 ++#define reg_rsd_bit_err_exp_pos 0 ++#define reg_rsd_bit_err_exp_len 5 ++#define reg_rsd_bit_err_exp_lsb 0 ++#define p_fec_rsd_packet_unit1_7_0 0xF726 ++#define fec_rsd_packet_unit1_7_0_pos 0 ++#define fec_rsd_packet_unit1_7_0_len 8 ++#define fec_rsd_packet_unit1_7_0_lsb 0 ++#define p_fec_rsd_packet_unit1_15_8 0xF727 ++#define fec_rsd_packet_unit1_15_8_pos 0 ++#define fec_rsd_packet_unit1_15_8_len 8 ++#define fec_rsd_packet_unit1_15_8_lsb 8 ++#define r_reg_rsd_bit_err_cnt1_7_0 0xF728 ++#define reg_rsd_bit_err_cnt1_7_0_pos 0 ++#define reg_rsd_bit_err_cnt1_7_0_len 8 ++#define reg_rsd_bit_err_cnt1_7_0_lsb 0 ++#define r_reg_rsd_bit_err_cnt1_15_8 0xF729 ++#define reg_rsd_bit_err_cnt1_15_8_pos 0 ++#define reg_rsd_bit_err_cnt1_15_8_len 8 ++#define reg_rsd_bit_err_cnt1_15_8_lsb 8 ++#define r_reg_rsd_bit_err_cnt1_23_16 0xF72A ++#define reg_rsd_bit_err_cnt1_23_16_pos 0 ++#define reg_rsd_bit_err_cnt1_23_16_len 8 ++#define reg_rsd_bit_err_cnt1_23_16_lsb 16 ++#define r_reg_rsd_abort_packet_cnt1_7_0 0xF72B ++#define reg_rsd_abort_packet_cnt1_7_0_pos 0 ++#define reg_rsd_abort_packet_cnt1_7_0_len 8 ++#define reg_rsd_abort_packet_cnt1_7_0_lsb 0 ++#define r_reg_rsd_abort_packet_cnt1_15_8 0xF72C ++#define reg_rsd_abort_packet_cnt1_15_8_pos 0 ++#define reg_rsd_abort_packet_cnt1_15_8_len 8 ++#define reg_rsd_abort_packet_cnt1_15_8_lsb 8 ++#define p_fec_rsd_ber_rst1 0xF72D ++#define fec_rsd_ber_rst1_pos 0 ++#define fec_rsd_ber_rst1_len 1 ++#define fec_rsd_ber_rst1_lsb 0 ++#define p_reg_rsd_ber_rdy1 0xF72E ++#define reg_rsd_ber_rdy1_pos 0 ++#define reg_rsd_ber_rdy1_len 1 ++#define reg_rsd_ber_rdy1_lsb 0 ++#define p_reg_dca_txmod_sel 0xF72F ++#define reg_dca_txmod_sel_pos 0 ++#define reg_dca_txmod_sel_len 1 ++#define reg_dca_txmod_sel_lsb 0 ++#define p_reg_dca_platch 0xF730 ++#define reg_dca_platch_pos 0 ++#define reg_dca_platch_len 1 ++#define reg_dca_platch_lsb 0 ++#define p_reg_dca_upper_chip 0xF731 ++#define reg_dca_upper_chip_pos 0 ++#define reg_dca_upper_chip_len 1 ++#define reg_dca_upper_chip_lsb 0 ++#define p_reg_dca_lower_chip 0xF732 ++#define reg_dca_lower_chip_pos 0 ++#define reg_dca_lower_chip_len 1 ++#define reg_dca_lower_chip_lsb 0 ++#define p_reg_dca_enl 0xF733 ++#define reg_dca_enl_pos 0 ++#define reg_dca_enl_len 1 ++#define reg_dca_enl_lsb 0 ++#define p_reg_dca_enu 0xF734 ++#define reg_dca_enu_pos 0 ++#define reg_dca_enu_len 1 ++#define reg_dca_enu_lsb 0 ++#define p_reg_dca_th 0xF735 ++#define reg_dca_th_pos 0 ++#define reg_dca_th_len 5 ++#define reg_dca_th_lsb 0 ++#define p_reg_dca_scale 0xF736 ++#define reg_dca_scale_pos 0 ++#define reg_dca_scale_len 4 ++#define reg_dca_scale_lsb 0 ++#define p_reg_dca_tone_7_0 0xF737 ++#define reg_dca_tone_7_0_pos 0 ++#define reg_dca_tone_7_0_len 8 ++#define reg_dca_tone_7_0_lsb 0 ++#define p_reg_dca_tone_12_8 0xF738 ++#define reg_dca_tone_12_8_pos 0 ++#define reg_dca_tone_12_8_len 5 ++#define reg_dca_tone_12_8_lsb 8 ++#define p_reg_dca_time_7_0 0xF739 ++#define reg_dca_time_7_0_pos 0 ++#define reg_dca_time_7_0_len 8 ++#define reg_dca_time_7_0_lsb 0 ++#define p_reg_dca_time_15_8 0xF73A ++#define reg_dca_time_15_8_pos 0 ++#define reg_dca_time_15_8_len 8 ++#define reg_dca_time_15_8_lsb 8 ++#define r_fec_dcasm 0xF73B ++#define fec_dcasm_pos 0 ++#define fec_dcasm_len 3 ++#define fec_dcasm_lsb 0 ++#define p_reg_dca_stand_alone 0xF73C ++#define reg_dca_stand_alone_pos 0 ++#define reg_dca_stand_alone_len 1 ++#define reg_dca_stand_alone_lsb 0 ++#define p_reg_dca_upper_out_en 0xF73D ++#define reg_dca_upper_out_en_pos 0 ++#define reg_dca_upper_out_en_len 1 ++#define reg_dca_upper_out_en_lsb 0 ++#define p_reg_dca_rc_en 0xF73E ++#define reg_dca_rc_en_pos 0 ++#define reg_dca_rc_en_len 1 ++#define reg_dca_rc_en_lsb 0 ++#define p_reg_dca_retrain_send 0xF73F ++#define reg_dca_retrain_send_pos 0 ++#define reg_dca_retrain_send_len 1 ++#define reg_dca_retrain_send_lsb 0 ++#define p_reg_dca_retrain_rec 0xF740 ++#define reg_dca_retrain_rec_pos 0 ++#define reg_dca_retrain_rec_len 1 ++#define reg_dca_retrain_rec_lsb 0 ++#define p_reg_dca_gi_gap 0xF741 ++#define reg_dca_gi_gap_pos 0 ++#define reg_dca_gi_gap_len 8 ++#define reg_dca_gi_gap_lsb 0 ++#define r_reg_dca_rec_up_tpsd_txmod 0xF742 ++#define reg_dca_rec_up_tpsd_txmod_pos 0 ++#define reg_dca_rec_up_tpsd_txmod_len 2 ++#define reg_dca_rec_up_tpsd_txmod_lsb 0 ++#define r_reg_dca_rec_up_tpsd_const 0xF743 ++#define reg_dca_rec_up_tpsd_const_pos 0 ++#define reg_dca_rec_up_tpsd_const_len 2 ++#define reg_dca_rec_up_tpsd_const_lsb 0 ++#define r_reg_dca_rec_up_tpsd_indep 0xF744 ++#define reg_dca_rec_up_tpsd_indep_pos 0 ++#define reg_dca_rec_up_tpsd_indep_len 1 ++#define reg_dca_rec_up_tpsd_indep_lsb 0 ++#define r_reg_dca_rec_up_tpsd_hier 0xF745 ++#define reg_dca_rec_up_tpsd_hier_pos 0 ++#define reg_dca_rec_up_tpsd_hier_len 2 ++#define reg_dca_rec_up_tpsd_hier_lsb 0 ++#define r_reg_dca_rec_up_tpsd_hpcr 0xF746 ++#define reg_dca_rec_up_tpsd_hpcr_pos 0 ++#define reg_dca_rec_up_tpsd_hpcr_len 3 ++#define reg_dca_rec_up_tpsd_hpcr_lsb 0 ++#define r_reg_dca_rec_up_tpsd_lpcr 0xF747 ++#define reg_dca_rec_up_tpsd_lpcr_pos 0 ++#define reg_dca_rec_up_tpsd_lpcr_len 3 ++#define reg_dca_rec_up_tpsd_lpcr_lsb 0 ++#define r_reg_dca_rec_up_tpsd_lock 0xF748 ++#define reg_dca_rec_up_tpsd_lock_pos 0 ++#define reg_dca_rec_up_tpsd_lock_len 1 ++#define reg_dca_rec_up_tpsd_lock_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_txmod 0xF749 ++#define reg_dca_rec_lo_tpsd_txmod_pos 0 ++#define reg_dca_rec_lo_tpsd_txmod_len 2 ++#define reg_dca_rec_lo_tpsd_txmod_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_const 0xF74A ++#define reg_dca_rec_lo_tpsd_const_pos 0 ++#define reg_dca_rec_lo_tpsd_const_len 2 ++#define reg_dca_rec_lo_tpsd_const_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_indep 0xF74B ++#define reg_dca_rec_lo_tpsd_indep_pos 0 ++#define reg_dca_rec_lo_tpsd_indep_len 1 ++#define reg_dca_rec_lo_tpsd_indep_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_hier 0xF74C ++#define reg_dca_rec_lo_tpsd_hier_pos 0 ++#define reg_dca_rec_lo_tpsd_hier_len 2 ++#define reg_dca_rec_lo_tpsd_hier_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_hpcr 0xF74D ++#define reg_dca_rec_lo_tpsd_hpcr_pos 0 ++#define reg_dca_rec_lo_tpsd_hpcr_len 3 ++#define reg_dca_rec_lo_tpsd_hpcr_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_lpcr 0xF74E ++#define reg_dca_rec_lo_tpsd_lpcr_pos 0 ++#define reg_dca_rec_lo_tpsd_lpcr_len 3 ++#define reg_dca_rec_lo_tpsd_lpcr_lsb 0 ++#define r_reg_dca_rec_lo_tpsd_lock 0xF74F ++#define reg_dca_rec_lo_tpsd_lock_pos 0 ++#define reg_dca_rec_lo_tpsd_lock_len 1 ++#define reg_dca_rec_lo_tpsd_lock_lsb 0 ++#define p_reg_dca_gpr_ctr_up_send 0xF750 ++#define reg_dca_gpr_ctr_up_send_pos 0 ++#define reg_dca_gpr_ctr_up_send_len 8 ++#define reg_dca_gpr_ctr_up_send_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_0 0xF751 ++#define reg_dca_gpr_dat_up_send_0_pos 0 ++#define reg_dca_gpr_dat_up_send_0_len 8 ++#define reg_dca_gpr_dat_up_send_0_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_1 0xF752 ++#define reg_dca_gpr_dat_up_send_1_pos 0 ++#define reg_dca_gpr_dat_up_send_1_len 8 ++#define reg_dca_gpr_dat_up_send_1_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_2 0xF753 ++#define reg_dca_gpr_dat_up_send_2_pos 0 ++#define reg_dca_gpr_dat_up_send_2_len 8 ++#define reg_dca_gpr_dat_up_send_2_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_3 0xF754 ++#define reg_dca_gpr_dat_up_send_3_pos 0 ++#define reg_dca_gpr_dat_up_send_3_len 8 ++#define reg_dca_gpr_dat_up_send_3_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_4 0xF755 ++#define reg_dca_gpr_dat_up_send_4_pos 0 ++#define reg_dca_gpr_dat_up_send_4_len 8 ++#define reg_dca_gpr_dat_up_send_4_lsb 0 ++#define p_reg_dca_gpr_dat_up_send_5 0xF756 ++#define reg_dca_gpr_dat_up_send_5_pos 0 ++#define reg_dca_gpr_dat_up_send_5_len 8 ++#define reg_dca_gpr_dat_up_send_5_lsb 0 ++#define p_reg_dca_over_wr_up_send 0xF757 ++#define reg_dca_over_wr_up_send_pos 0 ++#define reg_dca_over_wr_up_send_len 1 ++#define reg_dca_over_wr_up_send_lsb 0 ++#define p_reg_dca_int_up_send 0xF758 ++#define reg_dca_int_up_send_pos 0 ++#define reg_dca_int_up_send_len 1 ++#define reg_dca_int_up_send_lsb 0 ++#define p_reg_dca_gpr_ctr_lo_send 0xF759 ++#define reg_dca_gpr_ctr_lo_send_pos 0 ++#define reg_dca_gpr_ctr_lo_send_len 8 ++#define reg_dca_gpr_ctr_lo_send_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_0 0xF75A ++#define reg_dca_gpr_dat_lo_send_0_pos 0 ++#define reg_dca_gpr_dat_lo_send_0_len 8 ++#define reg_dca_gpr_dat_lo_send_0_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_1 0xF75B ++#define reg_dca_gpr_dat_lo_send_1_pos 0 ++#define reg_dca_gpr_dat_lo_send_1_len 8 ++#define reg_dca_gpr_dat_lo_send_1_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_2 0xF75C ++#define reg_dca_gpr_dat_lo_send_2_pos 0 ++#define reg_dca_gpr_dat_lo_send_2_len 8 ++#define reg_dca_gpr_dat_lo_send_2_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_3 0xF75D ++#define reg_dca_gpr_dat_lo_send_3_pos 0 ++#define reg_dca_gpr_dat_lo_send_3_len 8 ++#define reg_dca_gpr_dat_lo_send_3_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_4 0xF75E ++#define reg_dca_gpr_dat_lo_send_4_pos 0 ++#define reg_dca_gpr_dat_lo_send_4_len 8 ++#define reg_dca_gpr_dat_lo_send_4_lsb 0 ++#define p_reg_dca_gpr_dat_lo_send_5 0xF75F ++#define reg_dca_gpr_dat_lo_send_5_pos 0 ++#define reg_dca_gpr_dat_lo_send_5_len 8 ++#define reg_dca_gpr_dat_lo_send_5_lsb 0 ++#define p_reg_dca_over_wr_lo_send 0xF760 ++#define reg_dca_over_wr_lo_send_pos 0 ++#define reg_dca_over_wr_lo_send_len 1 ++#define reg_dca_over_wr_lo_send_lsb 0 ++#define p_reg_dca_int_lo_send 0xF761 ++#define reg_dca_int_lo_send_pos 0 ++#define reg_dca_int_lo_send_len 1 ++#define reg_dca_int_lo_send_lsb 0 ++#define r_reg_dca_gpr_ctr_up_rec 0xF762 ++#define reg_dca_gpr_ctr_up_rec_pos 0 ++#define reg_dca_gpr_ctr_up_rec_len 8 ++#define reg_dca_gpr_ctr_up_rec_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_0 0xF763 ++#define reg_dca_gpr_dat_up_rec_0_pos 0 ++#define reg_dca_gpr_dat_up_rec_0_len 8 ++#define reg_dca_gpr_dat_up_rec_0_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_1 0xF764 ++#define reg_dca_gpr_dat_up_rec_1_pos 0 ++#define reg_dca_gpr_dat_up_rec_1_len 8 ++#define reg_dca_gpr_dat_up_rec_1_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_2 0xF765 ++#define reg_dca_gpr_dat_up_rec_2_pos 0 ++#define reg_dca_gpr_dat_up_rec_2_len 8 ++#define reg_dca_gpr_dat_up_rec_2_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_3 0xF766 ++#define reg_dca_gpr_dat_up_rec_3_pos 0 ++#define reg_dca_gpr_dat_up_rec_3_len 8 ++#define reg_dca_gpr_dat_up_rec_3_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_4 0xF767 ++#define reg_dca_gpr_dat_up_rec_4_pos 0 ++#define reg_dca_gpr_dat_up_rec_4_len 8 ++#define reg_dca_gpr_dat_up_rec_4_lsb 0 ++#define r_reg_dca_gpr_dat_up_rec_5 0xF768 ++#define reg_dca_gpr_dat_up_rec_5_pos 0 ++#define reg_dca_gpr_dat_up_rec_5_len 8 ++#define reg_dca_gpr_dat_up_rec_5_lsb 0 ++#define r_reg_dca_over_wr_up_rec 0xF769 ++#define reg_dca_over_wr_up_rec_pos 0 ++#define reg_dca_over_wr_up_rec_len 1 ++#define reg_dca_over_wr_up_rec_lsb 0 ++#define p_reg_dca_int_up_rec 0xF76A ++#define reg_dca_int_up_rec_pos 0 ++#define reg_dca_int_up_rec_len 1 ++#define reg_dca_int_up_rec_lsb 0 ++#define p_reg_dca_fw_read_yet_up 0xF76B ++#define reg_dca_fw_read_yet_up_pos 0 ++#define reg_dca_fw_read_yet_up_len 1 ++#define reg_dca_fw_read_yet_up_lsb 0 ++#define r_reg_dca_gpr_ctr_lo_rec 0xF76C ++#define reg_dca_gpr_ctr_lo_rec_pos 0 ++#define reg_dca_gpr_ctr_lo_rec_len 8 ++#define reg_dca_gpr_ctr_lo_rec_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_0 0xF76D ++#define reg_dca_gpr_dat_lo_rec_0_pos 0 ++#define reg_dca_gpr_dat_lo_rec_0_len 8 ++#define reg_dca_gpr_dat_lo_rec_0_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_1 0xF76E ++#define reg_dca_gpr_dat_lo_rec_1_pos 0 ++#define reg_dca_gpr_dat_lo_rec_1_len 8 ++#define reg_dca_gpr_dat_lo_rec_1_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_2 0xF76F ++#define reg_dca_gpr_dat_lo_rec_2_pos 0 ++#define reg_dca_gpr_dat_lo_rec_2_len 8 ++#define reg_dca_gpr_dat_lo_rec_2_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_3 0xF770 ++#define reg_dca_gpr_dat_lo_rec_3_pos 0 ++#define reg_dca_gpr_dat_lo_rec_3_len 8 ++#define reg_dca_gpr_dat_lo_rec_3_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_4 0xF771 ++#define reg_dca_gpr_dat_lo_rec_4_pos 0 ++#define reg_dca_gpr_dat_lo_rec_4_len 8 ++#define reg_dca_gpr_dat_lo_rec_4_lsb 0 ++#define r_reg_dca_gpr_dat_lo_rec_5 0xF772 ++#define reg_dca_gpr_dat_lo_rec_5_pos 0 ++#define reg_dca_gpr_dat_lo_rec_5_len 8 ++#define reg_dca_gpr_dat_lo_rec_5_lsb 0 ++#define r_reg_dca_over_wr_lo_rec 0xF773 ++#define reg_dca_over_wr_lo_rec_pos 0 ++#define reg_dca_over_wr_lo_rec_len 1 ++#define reg_dca_over_wr_lo_rec_lsb 0 ++#define p_reg_dca_int_lo_rec 0xF774 ++#define reg_dca_int_lo_rec_pos 0 ++#define reg_dca_int_lo_rec_len 1 ++#define reg_dca_int_lo_rec_lsb 0 ++#define p_reg_dca_fw_read_yet_lo 0xF775 ++#define reg_dca_fw_read_yet_lo_pos 0 ++#define reg_dca_fw_read_yet_lo_len 1 ++#define reg_dca_fw_read_yet_lo_lsb 0 ++#define p_reg_dca_en 0xF776 ++#define reg_dca_en_pos 0 ++#define reg_dca_en_len 1 ++#define reg_dca_en_lsb 0 ++#define p_reg_dca_ulrdy_delay 0xF777 ++#define reg_dca_ulrdy_delay_pos 0 ++#define reg_dca_ulrdy_delay_len 8 ++#define reg_dca_ulrdy_delay_lsb 0 ++#define p_reg_dca_fpga_latch 0xF778 ++#define reg_dca_fpga_latch_pos 0 ++#define reg_dca_fpga_latch_len 8 ++#define reg_dca_fpga_latch_lsb 0 ++#define p_reg_dca_vldld_err 0xF779 ++#define reg_dca_vldld_err_pos 0 ++#define reg_dca_vldld_err_len 1 ++#define reg_dca_vldld_err_lsb 0 ++#define p_reg_dca_vldud_err 0xF77A ++#define reg_dca_vldud_err_pos 0 ++#define reg_dca_vldud_err_len 1 ++#define reg_dca_vldud_err_lsb 0 ++#define p_reg_dca_modeu_err 0xF77B ++#define reg_dca_modeu_err_pos 0 ++#define reg_dca_modeu_err_len 1 ++#define reg_dca_modeu_err_lsb 0 ++#define p_reg_dca_model_err 0xF77C ++#define reg_dca_model_err_pos 0 ++#define reg_dca_model_err_len 1 ++#define reg_dca_model_err_lsb 0 ++#define p_reg_dca_interrupt 0xF77D ++#define reg_dca_interrupt_pos 0 ++#define reg_dca_interrupt_len 1 ++#define reg_dca_interrupt_lsb 0 ++#define p_reg_dca_auto_reset_en 0xF77E ++#define reg_dca_auto_reset_en_pos 0 ++#define reg_dca_auto_reset_en_len 1 ++#define reg_dca_auto_reset_en_lsb 0 ++#define p_reg_qnt_valuew_7_0 0xF77F ++#define reg_qnt_valuew_7_0_pos 0 ++#define reg_qnt_valuew_7_0_len 8 ++#define reg_qnt_valuew_7_0_lsb 0 ++#define p_reg_qnt_valuew_10_8 0xF780 ++#define reg_qnt_valuew_10_8_pos 0 ++#define reg_qnt_valuew_10_8_len 3 ++#define reg_qnt_valuew_10_8_lsb 8 ++#define p_reg_qnt_nfvaluew_7_0 0xF781 ++#define reg_qnt_nfvaluew_7_0_pos 0 ++#define reg_qnt_nfvaluew_7_0_len 8 ++#define reg_qnt_nfvaluew_7_0_lsb 0 ++#define p_reg_qnt_nfvaluew_10_8 0xF782 ++#define reg_qnt_nfvaluew_10_8_pos 0 ++#define reg_qnt_nfvaluew_10_8_len 3 ++#define reg_qnt_nfvaluew_10_8_lsb 8 ++#define p_reg_qnt_flatness_thr_7_0 0xF783 ++#define reg_qnt_flatness_thr_7_0_pos 0 ++#define reg_qnt_flatness_thr_7_0_len 8 ++#define reg_qnt_flatness_thr_7_0_lsb 0 ++#define p_reg_qnt_flatness_thr_8 0xF784 ++#define reg_qnt_flatness_thr_8_pos 0 ++#define reg_qnt_flatness_thr_8_len 1 ++#define reg_qnt_flatness_thr_8_lsb 8 ++#define p_reg_llr_to_be_monitor 0xF785 ++#define reg_llr_to_be_monitor_pos 0 ++#define reg_llr_to_be_monitor_len 1 ++#define reg_llr_to_be_monitor_lsb 0 ++#define p_reg_qnt_vbc_rdy 0xF786 ++#define reg_qnt_vbc_rdy_pos 0 ++#define reg_qnt_vbc_rdy_len 1 ++#define reg_qnt_vbc_rdy_lsb 0 ++#define p_reg_qnt_noncmb_vbc_rdy 0xF787 ++#define reg_qnt_noncmb_vbc_rdy_pos 0 ++#define reg_qnt_noncmb_vbc_rdy_len 1 ++#define reg_qnt_noncmb_vbc_rdy_lsb 0 ++#define p_reg_use_eh2_mean 0xF788 ++#define reg_use_eh2_mean_pos 0 ++#define reg_use_eh2_mean_len 1 ++#define reg_use_eh2_mean_lsb 0 ++#define p_reg_qnt_vbc_ccid_mode 0xF789 ++#define reg_qnt_vbc_ccid_mode_pos 0 ++#define reg_qnt_vbc_ccid_mode_len 1 ++#define reg_qnt_vbc_ccid_mode_lsb 0 ++#define p_reg_qnt_cci_bandsize 0xF78A ++#define reg_qnt_cci_bandsize_pos 0 ++#define reg_qnt_cci_bandsize_len 4 ++#define reg_qnt_cci_bandsize_lsb 0 ++#define p_reg_qnt_vbc_sframe_num 0xF78B ++#define reg_qnt_vbc_sframe_num_pos 0 ++#define reg_qnt_vbc_sframe_num_len 8 ++#define reg_qnt_vbc_sframe_num_lsb 0 ++#define p_reg_sbx_gain_diff_7_0 0xF78C ++#define reg_sbx_gain_diff_7_0_pos 0 ++#define reg_sbx_gain_diff_7_0_len 8 ++#define reg_sbx_gain_diff_7_0_lsb 0 ++#define p_reg_sbx_gain_diff_8 0xF78D ++#define reg_sbx_gain_diff_8_pos 0 ++#define reg_sbx_gain_diff_8_len 1 ++#define reg_sbx_gain_diff_8_lsb 8 ++#define p_reg_sbx_gain_diff_rdy 0xF78E ++#define reg_sbx_gain_diff_rdy_pos 0 ++#define reg_sbx_gain_diff_rdy_len 1 ++#define reg_sbx_gain_diff_rdy_lsb 0 ++#define p_reg_sbx_noncmb_gain_diff_7_0 0xF78F ++#define reg_sbx_noncmb_gain_diff_7_0_pos 0 ++#define reg_sbx_noncmb_gain_diff_7_0_len 8 ++#define reg_sbx_noncmb_gain_diff_7_0_lsb 0 ++#define p_reg_sbx_noncmb_gain_diff_8 0xF790 ++#define reg_sbx_noncmb_gain_diff_8_pos 0 ++#define reg_sbx_noncmb_gain_diff_8_len 1 ++#define reg_sbx_noncmb_gain_diff_8_lsb 8 ++#define p_reg_sbx_noncmb_gain_diff_rdy 0xF791 ++#define reg_sbx_noncmb_gain_diff_rdy_pos 0 ++#define reg_sbx_noncmb_gain_diff_rdy_len 1 ++#define reg_sbx_noncmb_gain_diff_rdy_lsb 0 ++#define r_reg_qnt_vbc_err_7_0 0xF792 ++#define reg_qnt_vbc_err_7_0_pos 0 ++#define reg_qnt_vbc_err_7_0_len 8 ++#define reg_qnt_vbc_err_7_0_lsb 0 ++#define r_reg_qnt_vbc_err_15_8 0xF793 ++#define reg_qnt_vbc_err_15_8_pos 0 ++#define reg_qnt_vbc_err_15_8_len 8 ++#define reg_qnt_vbc_err_15_8_lsb 8 ++#define r_reg_qnt_vbc_err_23_16 0xF794 ++#define reg_qnt_vbc_err_23_16_pos 0 ++#define reg_qnt_vbc_err_23_16_len 8 ++#define reg_qnt_vbc_err_23_16_lsb 16 ++#define r_reg_qnt_noncmb_vbc_err_7_0 0xF795 ++#define reg_qnt_noncmb_vbc_err_7_0_pos 0 ++#define reg_qnt_noncmb_vbc_err_7_0_len 8 ++#define reg_qnt_noncmb_vbc_err_7_0_lsb 0 ++#define r_reg_qnt_noncmb_vbc_err_15_8 0xF796 ++#define reg_qnt_noncmb_vbc_err_15_8_pos 0 ++#define reg_qnt_noncmb_vbc_err_15_8_len 8 ++#define reg_qnt_noncmb_vbc_err_15_8_lsb 8 ++#define r_reg_qnt_noncmb_vbc_err_23_16 0xF797 ++#define reg_qnt_noncmb_vbc_err_23_16_pos 0 ++#define reg_qnt_noncmb_vbc_err_23_16_len 8 ++#define reg_qnt_noncmb_vbc_err_23_16_lsb 16 ++#define p_reg_sbx_signalquality_threshold 0xF798 ++#define reg_sbx_signalquality_threshold_pos 0 ++#define reg_sbx_signalquality_threshold_len 4 ++#define reg_sbx_signalquality_threshold_lsb 0 ++#define r_reg_sbx_signalquality_ind 0xF799 ++#define reg_sbx_signalquality_ind_pos 0 ++#define reg_sbx_signalquality_ind_len 1 ++#define reg_sbx_signalquality_ind_lsb 0 ++#define p_reg_p_sbxqnt_th1 0xF79A ++#define reg_p_sbxqnt_th1_pos 0 ++#define reg_p_sbxqnt_th1_len 8 ++#define reg_p_sbxqnt_th1_lsb 0 ++#define p_reg_p_sbxqnt_th2 0xF79B ++#define reg_p_sbxqnt_th2_pos 0 ++#define reg_p_sbxqnt_th2_len 8 ++#define reg_p_sbxqnt_th2_lsb 0 ++#define p_reg_p_sbxqnt_th3 0xF79C ++#define reg_p_sbxqnt_th3_pos 0 ++#define reg_p_sbxqnt_th3_len 8 ++#define reg_p_sbxqnt_th3_lsb 0 ++#define p_reg_p_sbxqnt_th4 0xF79D ++#define reg_p_sbxqnt_th4_pos 0 ++#define reg_p_sbxqnt_th4_len 8 ++#define reg_p_sbxqnt_th4_lsb 0 ++#define p_reg_p_sbxqnt_th5 0xF79E ++#define reg_p_sbxqnt_th5_pos 0 ++#define reg_p_sbxqnt_th5_len 8 ++#define reg_p_sbxqnt_th5_lsb 0 ++#define p_reg_p_sbxqnt_th6 0xF79F ++#define reg_p_sbxqnt_th6_pos 0 ++#define reg_p_sbxqnt_th6_len 8 ++#define reg_p_sbxqnt_th6_lsb 0 ++#define p_reg_p_sbxqnt_th7 0xF800 ++#define reg_p_sbxqnt_th7_pos 0 ++#define reg_p_sbxqnt_th7_len 8 ++#define reg_p_sbxqnt_th7_lsb 0 ++#define p_reg_p_sbxqnt_th8 0xF801 ++#define reg_p_sbxqnt_th8_pos 0 ++#define reg_p_sbxqnt_th8_len 8 ++#define reg_p_sbxqnt_th8_lsb 0 ++#define p_reg_p_sbxqnt_th9 0xF802 ++#define reg_p_sbxqnt_th9_pos 0 ++#define reg_p_sbxqnt_th9_len 8 ++#define reg_p_sbxqnt_th9_lsb 0 ++#define p_reg_p_sbxqnt_th10 0xF803 ++#define reg_p_sbxqnt_th10_pos 0 ++#define reg_p_sbxqnt_th10_len 8 ++#define reg_p_sbxqnt_th10_lsb 0 ++#define p_reg_p_sbxqnt_th11 0xF804 ++#define reg_p_sbxqnt_th11_pos 0 ++#define reg_p_sbxqnt_th11_len 8 ++#define reg_p_sbxqnt_th11_lsb 0 ++#define p_reg_p_sbxqnt_th12 0xF805 ++#define reg_p_sbxqnt_th12_pos 0 ++#define reg_p_sbxqnt_th12_len 8 ++#define reg_p_sbxqnt_th12_lsb 0 ++#define p_reg_p_sbxqnt_th13_7_0 0xF806 ++#define reg_p_sbxqnt_th13_7_0_pos 0 ++#define reg_p_sbxqnt_th13_7_0_len 8 ++#define reg_p_sbxqnt_th13_7_0_lsb 0 ++#define p_reg_p_sbxqnt_th13_9_8 0xF807 ++#define reg_p_sbxqnt_th13_9_8_pos 0 ++#define reg_p_sbxqnt_th13_9_8_len 2 ++#define reg_p_sbxqnt_th13_9_8_lsb 8 ++#define p_reg_p_sbxqnt_th14_7_0 0xF808 ++#define reg_p_sbxqnt_th14_7_0_pos 0 ++#define reg_p_sbxqnt_th14_7_0_len 8 ++#define reg_p_sbxqnt_th14_7_0_lsb 0 ++#define p_reg_p_sbxqnt_th14_9_8 0xF809 ++#define reg_p_sbxqnt_th14_9_8_pos 0 ++#define reg_p_sbxqnt_th14_9_8_len 2 ++#define reg_p_sbxqnt_th14_9_8_lsb 8 ++#define p_reg_p_sbxqnt_th15_7_0 0xF80A ++#define reg_p_sbxqnt_th15_7_0_pos 0 ++#define reg_p_sbxqnt_th15_7_0_len 8 ++#define reg_p_sbxqnt_th15_7_0_lsb 0 ++#define p_reg_p_sbxqnt_th15_9_8 0xF80B ++#define reg_p_sbxqnt_th15_9_8_pos 0 ++#define reg_p_sbxqnt_th15_9_8_len 2 ++#define reg_p_sbxqnt_th15_9_8_lsb 8 ++#define p_reg_p_sbxqnt_vzh2_th0 0xF80C ++#define reg_p_sbxqnt_vzh2_th0_pos 0 ++#define reg_p_sbxqnt_vzh2_th0_len 8 ++#define reg_p_sbxqnt_vzh2_th0_lsb 0 ++#define p_reg_p_sbxqnt_vzh2_th1 0xF80D ++#define reg_p_sbxqnt_vzh2_th1_pos 0 ++#define reg_p_sbxqnt_vzh2_th1_len 8 ++#define reg_p_sbxqnt_vzh2_th1_lsb 0 ++#define p_reg_p_sbxqnt_vzh2_th2 0xF80E ++#define reg_p_sbxqnt_vzh2_th2_pos 0 ++#define reg_p_sbxqnt_vzh2_th2_len 8 ++#define reg_p_sbxqnt_vzh2_th2_lsb 0 ++#define p_reg_p_qnt_w_comp1 0xF80F ++#define reg_p_qnt_w_comp1_pos 0 ++#define reg_p_qnt_w_comp1_len 8 ++#define reg_p_qnt_w_comp1_lsb 0 ++#define p_reg_p_qnt_w_comp2 0xF810 ++#define reg_p_qnt_w_comp2_pos 0 ++#define reg_p_qnt_w_comp2_len 8 ++#define reg_p_qnt_w_comp2_lsb 0 ++#define p_reg_p_qnt_w_comp3 0xF811 ++#define reg_p_qnt_w_comp3_pos 0 ++#define reg_p_qnt_w_comp3_len 8 ++#define reg_p_qnt_w_comp3_lsb 0 ++#define p_reg_p_vtb_in_0 0xF821 ++#define reg_p_vtb_in_0_pos 0 ++#define reg_p_vtb_in_0_len 6 ++#define reg_p_vtb_in_0_lsb 0 ++#define p_reg_p_vtb_in_1 0xF822 ++#define reg_p_vtb_in_1_pos 0 ++#define reg_p_vtb_in_1_len 6 ++#define reg_p_vtb_in_1_lsb 0 ++#define p_reg_p_vtb_in_2 0xF823 ++#define reg_p_vtb_in_2_pos 0 ++#define reg_p_vtb_in_2_len 6 ++#define reg_p_vtb_in_2_lsb 0 ++#define p_reg_p_vtb_in_3 0xF824 ++#define reg_p_vtb_in_3_pos 0 ++#define reg_p_vtb_in_3_len 6 ++#define reg_p_vtb_in_3_lsb 0 ++#define p_reg_p_vtb_in_4 0xF825 ++#define reg_p_vtb_in_4_pos 0 ++#define reg_p_vtb_in_4_len 6 ++#define reg_p_vtb_in_4_lsb 0 ++#define p_reg_p_vtb_in_5 0xF826 ++#define reg_p_vtb_in_5_pos 0 ++#define reg_p_vtb_in_5_len 6 ++#define reg_p_vtb_in_5_lsb 0 ++#define p_reg_p_vtb_in_6 0xF827 ++#define reg_p_vtb_in_6_pos 0 ++#define reg_p_vtb_in_6_len 6 ++#define reg_p_vtb_in_6_lsb 0 ++#define p_reg_p_vtb_in_7 0xF828 ++#define reg_p_vtb_in_7_pos 0 ++#define reg_p_vtb_in_7_len 6 ++#define reg_p_vtb_in_7_lsb 0 ++#define p_reg_p_vtb_in_8 0xF829 ++#define reg_p_vtb_in_8_pos 0 ++#define reg_p_vtb_in_8_len 6 ++#define reg_p_vtb_in_8_lsb 0 ++#define p_reg_p_vtb_in_9 0xF82A ++#define reg_p_vtb_in_9_pos 0 ++#define reg_p_vtb_in_9_len 6 ++#define reg_p_vtb_in_9_lsb 0 ++#define p_reg_p_vtb_in_10 0xF82B ++#define reg_p_vtb_in_10_pos 0 ++#define reg_p_vtb_in_10_len 6 ++#define reg_p_vtb_in_10_lsb 0 ++#define p_reg_p_vtb_in_11 0xF82C ++#define reg_p_vtb_in_11_pos 0 ++#define reg_p_vtb_in_11_len 6 ++#define reg_p_vtb_in_11_lsb 0 ++#define p_reg_p_vtb_in_12 0xF82D ++#define reg_p_vtb_in_12_pos 0 ++#define reg_p_vtb_in_12_len 6 ++#define reg_p_vtb_in_12_lsb 0 ++#define p_reg_p_vtb_in_13 0xF82E ++#define reg_p_vtb_in_13_pos 0 ++#define reg_p_vtb_in_13_len 6 ++#define reg_p_vtb_in_13_lsb 0 ++#define p_reg_p_vtb_in_14 0xF82F ++#define reg_p_vtb_in_14_pos 0 ++#define reg_p_vtb_in_14_len 6 ++#define reg_p_vtb_in_14_lsb 0 ++#define p_reg_p_vtb_in_15 0xF830 ++#define reg_p_vtb_in_15_pos 0 ++#define reg_p_vtb_in_15_len 6 ++#define reg_p_vtb_in_15_lsb 0 ++#define I2C_i2c_m_slave_addr 0xF940 ++#define i2c_m_slave_addr_pos 0 ++#define i2c_m_slave_addr_len 8 ++#define i2c_m_slave_addr_lsb 0 ++#define I2C_i2c_m_data1 0xF941 ++#define i2c_m_data1_pos 0 ++#define i2c_m_data1_len 8 ++#define i2c_m_data1_lsb 0 ++#define I2C_i2c_m_data2 0xF942 ++#define i2c_m_data2_pos 0 ++#define i2c_m_data2_len 8 ++#define i2c_m_data2_lsb 0 ++#define I2C_i2c_m_data3 0xF943 ++#define i2c_m_data3_pos 0 ++#define i2c_m_data3_len 8 ++#define i2c_m_data3_lsb 0 ++#define I2C_i2c_m_data4 0xF944 ++#define i2c_m_data4_pos 0 ++#define i2c_m_data4_len 8 ++#define i2c_m_data4_lsb 0 ++#define I2C_i2c_m_data5 0xF945 ++#define i2c_m_data5_pos 0 ++#define i2c_m_data5_len 8 ++#define i2c_m_data5_lsb 0 ++#define I2C_i2c_m_data6 0xF946 ++#define i2c_m_data6_pos 0 ++#define i2c_m_data6_len 8 ++#define i2c_m_data6_lsb 0 ++#define I2C_i2c_m_data7 0xF947 ++#define i2c_m_data7_pos 0 ++#define i2c_m_data7_len 8 ++#define i2c_m_data7_lsb 0 ++#define I2C_i2c_m_data8 0xF948 ++#define i2c_m_data8_pos 0 ++#define i2c_m_data8_len 8 ++#define i2c_m_data8_lsb 0 ++#define I2C_i2c_m_data9 0xF949 ++#define i2c_m_data9_pos 0 ++#define i2c_m_data9_len 8 ++#define i2c_m_data9_lsb 0 ++#define I2C_i2c_m_data10 0xF94A ++#define i2c_m_data10_pos 0 ++#define i2c_m_data10_len 8 ++#define i2c_m_data10_lsb 0 ++#define I2C_i2c_m_data11 0xF94B ++#define i2c_m_data11_pos 0 ++#define i2c_m_data11_len 8 ++#define i2c_m_data11_lsb 0 ++#define I2C_i2c_m_data12 0xF94C ++#define i2c_m_data12_pos 0 ++#define i2c_m_data12_len 8 ++#define i2c_m_data12_lsb 0 ++#define I2C_i2c_m_data13 0xF94D ++#define i2c_m_data13_pos 0 ++#define i2c_m_data13_len 8 ++#define i2c_m_data13_lsb 0 ++#define I2C_i2c_m_data14 0xF94E ++#define i2c_m_data14_pos 0 ++#define i2c_m_data14_len 8 ++#define i2c_m_data14_lsb 0 ++#define I2C_i2c_m_data15 0xF94F ++#define i2c_m_data15_pos 0 ++#define i2c_m_data15_len 8 ++#define i2c_m_data15_lsb 0 ++#define I2C_i2c_m_data16 0xF950 ++#define i2c_m_data16_pos 0 ++#define i2c_m_data16_len 8 ++#define i2c_m_data16_lsb 0 ++#define I2C_i2c_m_data17 0xF951 ++#define i2c_m_data17_pos 0 ++#define i2c_m_data17_len 8 ++#define i2c_m_data17_lsb 0 ++#define I2C_i2c_m_data18 0xF952 ++#define i2c_m_data18_pos 0 ++#define i2c_m_data18_len 8 ++#define i2c_m_data18_lsb 0 ++#define I2C_i2c_m_data19 0xF953 ++#define i2c_m_data19_pos 0 ++#define i2c_m_data19_len 8 ++#define i2c_m_data19_lsb 0 ++#define I2C_i2c_m_cmd_rw 0xF954 ++#define i2c_m_cmd_rw_pos 0 ++#define i2c_m_cmd_rw_len 1 ++#define i2c_m_cmd_rw_lsb 0 ++#define I2C_i2c_m_cmd_rwlen 0xF954 ++#define i2c_m_cmd_rwlen_pos 3 ++#define i2c_m_cmd_rwlen_len 4 ++#define i2c_m_cmd_rwlen_lsb 0 ++#define I2C_i2c_m_status_cmd_exe 0xF955 ++#define i2c_m_status_cmd_exe_pos 0 ++#define i2c_m_status_cmd_exe_len 1 ++#define i2c_m_status_cmd_exe_lsb 0 ++#define I2C_i2c_m_status_wdat_done 0xF955 ++#define i2c_m_status_wdat_done_pos 1 ++#define i2c_m_status_wdat_done_len 1 ++#define i2c_m_status_wdat_done_lsb 0 ++#define I2C_i2c_m_status_wdat_fail 0xF955 ++#define i2c_m_status_wdat_fail_pos 2 ++#define i2c_m_status_wdat_fail_len 1 ++#define i2c_m_status_wdat_fail_lsb 0 ++#define I2C_i2c_m_status_rdat_rdy 0xF955 ++#define i2c_m_status_rdat_rdy_pos 3 ++#define i2c_m_status_rdat_rdy_len 1 ++#define i2c_m_status_rdat_rdy_lsb 0 ++#define I2C_i2c_m_period 0xF956 ++#define i2c_m_period_pos 0 ++#define i2c_m_period_len 8 ++#define i2c_m_period_lsb 0 ++#define I2C_i2c_m_reg_msb_lsb 0xF957 ++#define i2c_m_reg_msb_lsb_pos 0 ++#define i2c_m_reg_msb_lsb_len 1 ++#define i2c_m_reg_msb_lsb_lsb 0 ++#define I2C_reg_ofdm_rst 0xF957 ++#define reg_ofdm_rst_pos 1 ++#define reg_ofdm_rst_len 1 ++#define reg_ofdm_rst_lsb 0 ++#define I2C_reg_sample_period_on_tuner 0xF957 ++#define reg_sample_period_on_tuner_pos 2 ++#define reg_sample_period_on_tuner_len 1 ++#define reg_sample_period_on_tuner_lsb 0 ++#define I2C_reg_sel_tuner 0xF957 ++#define reg_sel_tuner_pos 3 ++#define reg_sel_tuner_len 1 ++#define reg_sel_tuner_lsb 0 ++#define I2C_reg_ofdm_rst_en 0xF957 ++#define reg_ofdm_rst_en_pos 4 ++#define reg_ofdm_rst_en_len 1 ++#define reg_ofdm_rst_en_lsb 0 ++#define p_mp2if_psb_overflow 0xF980 ++#define mp2if_psb_overflow_pos 0 ++#define mp2if_psb_overflow_len 1 ++#define mp2if_psb_overflow_lsb 0 ++#define p_mp2if_no_modify_tei_bit 0xF981 ++#define mp2if_no_modify_tei_bit_pos 0 ++#define mp2if_no_modify_tei_bit_len 1 ++#define mp2if_no_modify_tei_bit_lsb 0 ++#define p_mp2if_keep_sf_sync_byte 0xF982 ++#define mp2if_keep_sf_sync_byte_pos 0 ++#define mp2if_keep_sf_sync_byte_len 1 ++#define mp2if_keep_sf_sync_byte_lsb 0 ++#define p_mp2if_data_access_disable 0xF983 ++#define mp2if_data_access_disable_pos 0 ++#define mp2if_data_access_disable_len 1 ++#define mp2if_data_access_disable_lsb 0 ++#define p_mp2if_mpeg_ser_do7 0xF984 ++#define mp2if_mpeg_ser_do7_pos 0 ++#define mp2if_mpeg_ser_do7_len 1 ++#define mp2if_mpeg_ser_do7_lsb 0 ++#define p_mp2if_mpeg_ser_mode 0xF985 ++#define mp2if_mpeg_ser_mode_pos 0 ++#define mp2if_mpeg_ser_mode_len 1 ++#define mp2if_mpeg_ser_mode_lsb 0 ++#define p_mp2if_mpeg_par_mode 0xF986 ++#define mp2if_mpeg_par_mode_pos 0 ++#define mp2if_mpeg_par_mode_len 1 ++#define mp2if_mpeg_par_mode_lsb 0 ++#define r_mp2if_psb_empty 0xF987 ++#define mp2if_psb_empty_pos 0 ++#define mp2if_psb_empty_len 1 ++#define mp2if_psb_empty_lsb 0 ++#define r_mp2if_ts_not_188 0xF988 ++#define mp2if_ts_not_188_pos 0 ++#define mp2if_ts_not_188_len 1 ++#define mp2if_ts_not_188_lsb 0 ++#define p_mp2if_mssync_len 0xF989 ++#define mp2if_mssync_len_pos 0 ++#define mp2if_mssync_len_len 1 ++#define mp2if_mssync_len_lsb 0 ++#define p_mp2if_msdo_msb 0xF98A ++#define mp2if_msdo_msb_pos 0 ++#define mp2if_msdo_msb_len 1 ++#define mp2if_msdo_msb_lsb 0 ++#define p_mp2if_mpeg_clk_gated 0xF98B ++#define mp2if_mpeg_clk_gated_pos 0 ++#define mp2if_mpeg_clk_gated_len 1 ++#define mp2if_mpeg_clk_gated_lsb 0 ++#define p_mp2if_mpeg_err_pol 0xF98C ++#define mp2if_mpeg_err_pol_pos 0 ++#define mp2if_mpeg_err_pol_len 1 ++#define mp2if_mpeg_err_pol_lsb 0 ++#define p_mp2if_mpeg_sync_pol 0xF98D ++#define mp2if_mpeg_sync_pol_pos 0 ++#define mp2if_mpeg_sync_pol_len 1 ++#define mp2if_mpeg_sync_pol_lsb 0 ++#define p_mp2if_mpeg_vld_pol 0xF98E ++#define mp2if_mpeg_vld_pol_pos 0 ++#define mp2if_mpeg_vld_pol_len 1 ++#define mp2if_mpeg_vld_pol_lsb 0 ++#define p_mp2if_mpeg_clk_pol 0xF98F ++#define mp2if_mpeg_clk_pol_pos 0 ++#define mp2if_mpeg_clk_pol_len 1 ++#define mp2if_mpeg_clk_pol_lsb 0 ++#define p_reg_mpeg_full_speed 0xF990 ++#define reg_mpeg_full_speed_pos 0 ++#define reg_mpeg_full_speed_len 1 ++#define reg_mpeg_full_speed_lsb 0 ++#define p_mp2if_pid_complement 0xF991 ++#define mp2if_pid_complement_pos 0 ++#define mp2if_pid_complement_len 1 ++#define mp2if_pid_complement_lsb 0 ++#define p_mp2if_pid_rst 0xF992 ++#define mp2if_pid_rst_pos 0 ++#define mp2if_pid_rst_len 1 ++#define mp2if_pid_rst_lsb 0 ++#define p_mp2if_pid_en 0xF993 ++#define mp2if_pid_en_pos 0 ++#define mp2if_pid_en_len 1 ++#define mp2if_pid_en_lsb 0 ++#define p_mp2if_pid_index_en 0xF994 ++#define mp2if_pid_index_en_pos 0 ++#define mp2if_pid_index_en_len 1 ++#define mp2if_pid_index_en_lsb 0 ++#define p_mp2if_pid_index 0xF995 ++#define mp2if_pid_index_pos 0 ++#define mp2if_pid_index_len 5 ++#define mp2if_pid_index_lsb 0 ++#define p_mp2if_pid_dat_l 0xF996 ++#define mp2if_pid_dat_l_pos 0 ++#define mp2if_pid_dat_l_len 8 ++#define mp2if_pid_dat_l_lsb 0 ++#define p_mp2if_pid_dat_h 0xF997 ++#define mp2if_pid_dat_h_pos 0 ++#define mp2if_pid_dat_h_len 5 ++#define mp2if_pid_dat_h_lsb 0 ++#define p_reg_latch_clk 0xF998 ++#define reg_latch_clk_pos 0 ++#define reg_latch_clk_len 1 ++#define reg_latch_clk_lsb 0 ++#define r_mp2if_sync_byte_locked 0xF999 ++#define mp2if_sync_byte_locked_pos 0 ++#define mp2if_sync_byte_locked_len 1 ++#define mp2if_sync_byte_locked_lsb 0 ++#define p_mp2if_ignore_sync_byte 0xF99A ++#define mp2if_ignore_sync_byte_pos 0 ++#define mp2if_ignore_sync_byte_len 1 ++#define mp2if_ignore_sync_byte_lsb 0 ++#define p_reg_mp2if_clk_en 0xF99B ++#define reg_mp2if_clk_en_pos 0 ++#define reg_mp2if_clk_en_len 1 ++#define reg_mp2if_clk_en_lsb 0 ++#define p_reg_mpeg_vld_tgl 0xF99C ++#define reg_mpeg_vld_tgl_pos 0 ++#define reg_mpeg_vld_tgl_len 1 ++#define reg_mpeg_vld_tgl_lsb 0 ++#define p_reg_mp2_sw_rst 0xF99D ++#define reg_mp2_sw_rst_pos 0 ++#define reg_mp2_sw_rst_len 1 ++#define reg_mp2_sw_rst_lsb 0 ++#define p_mp2if_psb_en 0xF99E ++#define mp2if_psb_en_pos 0 ++#define mp2if_psb_en_len 1 ++#define mp2if_psb_en_lsb 0 ++#define r_mp2if_usb20_mode 0xF99F ++#define mp2if_usb20_mode_pos 0 ++#define mp2if_usb20_mode_len 1 ++#define mp2if_usb20_mode_lsb 0 ++#define r_mp2if_strap_usb20_mode 0xF9A0 ++#define mp2if_strap_usb20_mode_pos 0 ++#define mp2if_strap_usb20_mode_len 1 ++#define mp2if_strap_usb20_mode_lsb 0 ++#define r_mp2if_lost_pkt_cnt_l 0xF9A1 ++#define mp2if_lost_pkt_cnt_l_pos 0 ++#define mp2if_lost_pkt_cnt_l_len 8 ++#define mp2if_lost_pkt_cnt_l_lsb 0 ++#define r_mp2if_lost_pkt_cnt_h 0xF9A2 ++#define mp2if_lost_pkt_cnt_h_pos 0 ++#define mp2if_lost_pkt_cnt_h_len 8 ++#define mp2if_lost_pkt_cnt_h_lsb 0 ++#define p_reg_mp2if2_en 0xF9A3 ++#define reg_mp2if2_en_pos 0 ++#define reg_mp2if2_en_len 1 ++#define reg_mp2if2_en_lsb 0 ++#define p_reg_mp2if2_sw_rst 0xF9A4 ++#define reg_mp2if2_sw_rst_pos 0 ++#define reg_mp2if2_sw_rst_len 1 ++#define reg_mp2if2_sw_rst_lsb 0 ++#define p_reg_mp2if2_half_psb 0xF9A5 ++#define reg_mp2if2_half_psb_pos 0 ++#define reg_mp2if2_half_psb_len 1 ++#define reg_mp2if2_half_psb_lsb 0 ++#define p_reg_ts_byte_endian 0xF9A6 ++#define reg_ts_byte_endian_pos 0 ++#define reg_ts_byte_endian_len 1 ++#define reg_ts_byte_endian_lsb 0 ++#define p_reg_mp2_dioif 0xF9A7 ++#define reg_mp2_dioif_pos 0 ++#define reg_mp2_dioif_len 1 ++#define reg_mp2_dioif_lsb 0 ++#define p_reg_mp2_dioif_fast 0xF9A8 ++#define reg_mp2_dioif_fast_pos 0 ++#define reg_mp2_dioif_fast_len 1 ++#define reg_mp2_dioif_fast_lsb 0 ++#define p_reg_tpsd_bw_mp2if 0xF9A9 ++#define reg_tpsd_bw_mp2if_pos 0 ++#define reg_tpsd_bw_mp2if_len 2 ++#define reg_tpsd_bw_mp2if_lsb 0 ++#define p_reg_tpsd_gi_mp2if 0xF9AA ++#define reg_tpsd_gi_mp2if_pos 0 ++#define reg_tpsd_gi_mp2if_len 2 ++#define reg_tpsd_gi_mp2if_lsb 0 ++#define p_reg_tpsd_cr_mp2if 0xF9AB ++#define reg_tpsd_cr_mp2if_pos 0 ++#define reg_tpsd_cr_mp2if_len 3 ++#define reg_tpsd_cr_mp2if_lsb 0 ++#define p_reg_tpsd_cons_mp2if 0xF9AC ++#define reg_tpsd_cons_mp2if_pos 0 ++#define reg_tpsd_cons_mp2if_len 2 ++#define reg_tpsd_cons_mp2if_lsb 0 ++#define p_reg_fw_table_en 0xF9AD ++#define reg_fw_table_en_pos 0 ++#define reg_fw_table_en_len 1 ++#define reg_fw_table_en_lsb 0 ++#define p_reg_p_aud_pk_gen_aud_pk_size 0xF9AD ++#define reg_p_aud_pk_gen_aud_pk_size_pos 1 ++#define reg_p_aud_pk_gen_aud_pk_size_len 6 ++#define reg_p_aud_pk_gen_aud_pk_size_lsb 0 ++#define p_mp2if_psb_num_blk 0xF9AE ++#define mp2if_psb_num_blk_pos 0 ++#define mp2if_psb_num_blk_len 6 ++#define mp2if_psb_num_blk_lsb 0 ++#define p_reg_fec_fake 0xF9AF ++#define reg_fec_fake_pos 0 ++#define reg_fec_fake_len 1 ++#define reg_fec_fake_lsb 0 ++#define p_reg_p_ccir_atv_en 0xF9AF ++#define reg_p_ccir_atv_en_pos 1 ++#define reg_p_ccir_atv_en_len 1 ++#define reg_p_ccir_atv_en_lsb 0 ++#define p_reg_video_stop_n 0xF9AF ++#define reg_video_stop_n_pos 2 ++#define reg_video_stop_n_len 1 ++#define reg_video_stop_n_lsb 0 ++#define p_reg_audio_stop_n 0xF9AF ++#define reg_audio_stop_n_pos 3 ++#define reg_audio_stop_n_len 1 ++#define reg_audio_stop_n_lsb 0 ++#define p_mp2if_i2smode 0xF9AF ++#define mp2if_i2smode_pos 4 ++#define mp2if_i2smode_len 2 ++#define mp2if_i2smode_lsb 0 ++#define p_mp2if_word_size 0xF9AF ++#define mp2if_word_size_pos 6 ++#define mp2if_word_size_len 2 ++#define mp2if_word_size_lsb 0 ++#define p_reg_packet_gap 0xF9B0 ++#define reg_packet_gap_pos 0 ++#define reg_packet_gap_len 8 ++#define reg_packet_gap_lsb 0 ++#define p_reg_ts_dat_inv 0xF9B2 ++#define reg_ts_dat_inv_pos 0 ++#define reg_ts_dat_inv_len 1 ++#define reg_ts_dat_inv_lsb 0 ++#define p_reg_ts_lsb_1st 0xF9B3 ++#define reg_ts_lsb_1st_pos 0 ++#define reg_ts_lsb_1st_len 1 ++#define reg_ts_lsb_1st_lsb 0 ++#define p_reg_ts_capt_bg_sel 0xF9B4 ++#define reg_ts_capt_bg_sel_pos 0 ++#define reg_ts_capt_bg_sel_len 1 ++#define reg_ts_capt_bg_sel_lsb 0 ++#define p_reg_mp2if_stop_en 0xF9B5 ++#define reg_mp2if_stop_en_pos 0 ++#define reg_mp2if_stop_en_len 1 ++#define reg_mp2if_stop_en_lsb 0 ++#define p_reg_mp2if2_pes_base 0xF9B6 ++#define reg_mp2if2_pes_base_pos 0 ++#define reg_mp2if2_pes_base_len 1 ++#define reg_mp2if2_pes_base_lsb 0 ++#define p_reg_ts_sync_inv 0xF9B7 ++#define reg_ts_sync_inv_pos 0 ++#define reg_ts_sync_inv_len 1 ++#define reg_ts_sync_inv_lsb 0 ++#define p_reg_ts_vld_inv 0xF9B8 ++#define reg_ts_vld_inv_pos 0 ++#define reg_ts_vld_inv_len 1 ++#define reg_ts_vld_inv_lsb 0 ++#define p_reg_sys_buf_overflow 0xF9B9 ++#define reg_sys_buf_overflow_pos 0 ++#define reg_sys_buf_overflow_len 1 ++#define reg_sys_buf_overflow_lsb 0 ++#define p_reg_top_dummy0 0xF9BB ++#define reg_top_dummy0_pos 0 ++#define reg_top_dummy0_len 8 ++#define reg_top_dummy0_lsb 0 ++#define p_reg_top_dummy1 0xF9BC ++#define reg_top_dummy1_pos 0 ++#define reg_top_dummy1_len 8 ++#define reg_top_dummy1_lsb 0 ++#define p_reg_top_dummy2 0xF9BD ++#define reg_top_dummy2_pos 0 ++#define reg_top_dummy2_len 8 ++#define reg_top_dummy2_lsb 0 ++#define p_reg_top_dummy3 0xF9BE ++#define reg_top_dummy3_pos 0 ++#define reg_top_dummy3_len 8 ++#define reg_top_dummy3_lsb 0 ++#define p_reg_top_dummy4 0xF9BF ++#define reg_top_dummy4_pos 0 ++#define reg_top_dummy4_len 8 ++#define reg_top_dummy4_lsb 0 ++#define p_reg_top_dummy5 0xF9C0 ++#define reg_top_dummy5_pos 0 ++#define reg_top_dummy5_len 8 ++#define reg_top_dummy5_lsb 0 ++#define p_reg_top_dummy6 0xF9C1 ++#define reg_top_dummy6_pos 0 ++#define reg_top_dummy6_len 8 ++#define reg_top_dummy6_lsb 0 ++#define p_reg_top_dummy7 0xF9C2 ++#define reg_top_dummy7_pos 0 ++#define reg_top_dummy7_len 8 ++#define reg_top_dummy7_lsb 0 ++#define p_reg_top_dummy8 0xF9C3 ++#define reg_top_dummy8_pos 0 ++#define reg_top_dummy8_len 8 ++#define reg_top_dummy8_lsb 0 ++#define p_reg_top_dummy9 0xF9C4 ++#define reg_top_dummy9_pos 0 ++#define reg_top_dummy9_len 8 ++#define reg_top_dummy9_lsb 0 ++#define p_reg_top_dummyA 0xF9C5 ++#define reg_top_dummyA_pos 0 ++#define reg_top_dummyA_len 8 ++#define reg_top_dummyA_lsb 0 ++#define p_reg_top_dummyB 0xF9C6 ++#define reg_top_dummyB_pos 0 ++#define reg_top_dummyB_len 8 ++#define reg_top_dummyB_lsb 0 ++#define p_reg_top_dummyC 0xF9C7 ++#define reg_top_dummyC_pos 0 ++#define reg_top_dummyC_len 8 ++#define reg_top_dummyC_lsb 0 ++#define p_reg_top_dummyD 0xF9C8 ++#define reg_top_dummyD_pos 0 ++#define reg_top_dummyD_len 8 ++#define reg_top_dummyD_lsb 0 ++#define p_reg_top_dummyE 0xF9C9 ++#define reg_top_dummyE_pos 0 ++#define reg_top_dummyE_len 8 ++#define reg_top_dummyE_lsb 0 ++#define p_reg_top_dummyF 0xF9CA ++#define reg_top_dummyF_pos 0 ++#define reg_top_dummyF_len 8 ++#define reg_top_dummyF_lsb 0 ++#define p_reg_mp2if_clk_coeff 0xF9CB ++#define reg_mp2if_clk_coeff_pos 0 ++#define reg_mp2if_clk_coeff_len 7 ++#define reg_mp2if_clk_coeff_lsb 0 ++#define p_reg_tsip_en 0xF9CC ++#define reg_tsip_en_pos 0 ++#define reg_tsip_en_len 1 ++#define reg_tsip_en_lsb 0 ++#define p_reg_tsis_en 0xF9CD ++#define reg_tsis_en_pos 0 ++#define reg_tsis_en_len 1 ++#define reg_tsis_en_lsb 0 ++#define p_reg_tsip_br 0xF9CE ++#define reg_tsip_br_pos 0 ++#define reg_tsip_br_len 1 ++#define reg_tsip_br_lsb 0 ++#define p_reg_tsip_frm_inv 0xF9D0 ++#define reg_tsip_frm_inv_pos 0 ++#define reg_tsip_frm_inv_len 1 ++#define reg_tsip_frm_inv_lsb 0 ++#define p_reg_tsip_str_inv 0xF9D1 ++#define reg_tsip_str_inv_pos 0 ++#define reg_tsip_str_inv_len 1 ++#define reg_tsip_str_inv_lsb 0 ++#define p_reg_tsip_fail_inv 0xF9D2 ++#define reg_tsip_fail_inv_pos 0 ++#define reg_tsip_fail_inv_len 1 ++#define reg_tsip_fail_inv_lsb 0 ++#define p_reg_tsip_frm_ignore 0xF9D3 ++#define reg_tsip_frm_ignore_pos 0 ++#define reg_tsip_frm_ignore_len 1 ++#define reg_tsip_frm_ignore_lsb 0 ++#define p_reg_tsip_str_ignore 0xF9D4 ++#define reg_tsip_str_ignore_pos 0 ++#define reg_tsip_str_ignore_len 1 ++#define reg_tsip_str_ignore_lsb 0 ++#define p_reg_tsip_fail_ignore 0xF9D5 ++#define reg_tsip_fail_ignore_pos 0 ++#define reg_tsip_fail_ignore_len 1 ++#define reg_tsip_fail_ignore_lsb 0 ++#define p_reg_tsip_endian 0xF9D6 ++#define reg_tsip_endian_pos 0 ++#define reg_tsip_endian_len 1 ++#define reg_tsip_endian_lsb 0 ++#define p_reg_tsip_overflow 0xF9D7 ++#define reg_tsip_overflow_pos 0 ++#define reg_tsip_overflow_len 1 ++#define reg_tsip_overflow_lsb 0 ++#define p_reg_ts_in_src 0xF9D8 ++#define reg_ts_in_src_pos 0 ++#define reg_ts_in_src_len 1 ++#define reg_ts_in_src_lsb 0 ++#define r_reg_clk_sel 0xF9D9 ++#define reg_clk_sel_pos 0 ++#define reg_clk_sel_len 2 ++#define reg_clk_sel_lsb 0 ++#define r_reg_tog_sel 0xF9DA ++#define reg_tog_sel_pos 0 ++#define reg_tog_sel_len 2 ++#define reg_tog_sel_lsb 0 ++#define p_reg_ts_str_ignore 0xF9DB ++#define reg_ts_str_ignore_pos 0 ++#define reg_ts_str_ignore_len 1 ++#define reg_ts_str_ignore_lsb 0 ++#define p_reg_ts_frm_ignore 0xF9DC ++#define reg_ts_frm_ignore_pos 0 ++#define reg_ts_frm_ignore_len 1 ++#define reg_ts_frm_ignore_lsb 0 ++#define p_reg_clk_sel_fix 0xF9DD ++#define reg_clk_sel_fix_pos 0 ++#define reg_clk_sel_fix_len 2 ++#define reg_clk_sel_fix_lsb 0 ++#define p_reg_tog_sel_fix 0xF9DE ++#define reg_tog_sel_fix_pos 0 ++#define reg_tog_sel_fix_len 2 ++#define reg_tog_sel_fix_lsb 0 ++#define p_reg_en_fix 0xF9DF ++#define reg_en_fix_pos 0 ++#define reg_en_fix_len 1 ++#define reg_en_fix_lsb 0 ++#define p_reg_check_tpsd_hier 0xF9E0 ++#define reg_check_tpsd_hier_pos 0 ++#define reg_check_tpsd_hier_len 1 ++#define reg_check_tpsd_hier_lsb 0 ++#define p_reg_p_i2s_master_mode 0xF9E1 ++#define reg_p_i2s_master_mode_pos 0 ++#define reg_p_i2s_master_mode_len 1 ++#define reg_p_i2s_master_mode_lsb 0 ++#define p_reg_p_sc_lr_ratio 0xF9E2 ++#define reg_p_sc_lr_ratio_pos 0 ++#define reg_p_sc_lr_ratio_len 2 ++#define reg_p_sc_lr_ratio_lsb 0 ++#define p_reg_p_i2s_fs_type 0xF9E2 ++#define reg_p_i2s_fs_type_pos 2 ++#define reg_p_i2s_fs_type_len 2 ++#define reg_p_i2s_fs_type_lsb 0 ++#define r_reg_r_pp_fullq 0xF9E3 ++#define reg_r_pp_fullq_pos 0 ++#define reg_r_pp_fullq_len 1 ++#define reg_r_pp_fullq_lsb 0 ++#define p_reg_r_ccir_rst 0xF9E3 ++#define reg_r_ccir_rst_pos 1 ++#define reg_r_ccir_rst_len 1 ++#define reg_r_ccir_rst_lsb 0 ++#define p_reg_p_full_en 0xF9E3 ++#define reg_p_full_en_pos 2 ++#define reg_p_full_en_len 1 ++#define reg_p_full_en_lsb 0 ++#define p_reg_p_vbi_dis 0xF9E3 ++#define reg_p_vbi_dis_pos 3 ++#define reg_p_vbi_dis_len 1 ++#define reg_p_vbi_dis_lsb 0 ++#define p_reg_p_ccir_all 0xF9E3 ++#define reg_p_ccir_all_pos 4 ++#define reg_p_ccir_all_len 1 ++#define reg_p_ccir_all_lsb 0 ++#define p_reg_p_ccir_vbi_raw_en 0xF9E3 ++#define reg_p_ccir_vbi_raw_en_pos 5 ++#define reg_p_ccir_vbi_raw_en_len 1 ++#define reg_p_ccir_vbi_raw_en_lsb 0 ++#define p_reg_err_byte_en 0xF9E4 ++#define reg_err_byte_en_pos 0 ++#define reg_err_byte_en_len 1 ++#define reg_err_byte_en_lsb 0 ++#define p_reg_mp2_f_adc_7_0 0xF9E5 ++#define reg_mp2_f_adc_7_0_pos 0 ++#define reg_mp2_f_adc_7_0_len 8 ++#define reg_mp2_f_adc_7_0_lsb 0 ++#define p_reg_mp2_f_adc_15_8 0xF9E6 ++#define reg_mp2_f_adc_15_8_pos 0 ++#define reg_mp2_f_adc_15_8_len 8 ++#define reg_mp2_f_adc_15_8_lsb 8 ++#define p_reg_mp2_f_adc_23_16 0xF9E7 ++#define reg_mp2_f_adc_23_16_pos 0 ++#define reg_mp2_f_adc_23_16_len 8 ++#define reg_mp2_f_adc_23_16_lsb 16 ++#define p_reg_set_util 0xF9E8 ++#define reg_set_util_pos 0 ++#define reg_set_util_len 8 ++#define reg_set_util_lsb 0 ++#define r_reg_err_byte 0xF9E9 ++#define reg_err_byte_pos 0 ++#define reg_err_byte_len 8 ++#define reg_err_byte_lsb 0 ++#define p_reg_p_ln_num1 0xF9EA ++#define reg_p_ln_num1_pos 0 ++#define reg_p_ln_num1_len 5 ++#define reg_p_ln_num1_lsb 0 ++#define p_reg_p_ln_num2_2_0 0xF9EA ++#define reg_p_ln_num2_2_0_pos 5 ++#define reg_p_ln_num2_2_0_len 3 ++#define reg_p_ln_num2_2_0_lsb 0 ++#define p_reg_p_ln_num2_4_3 0xF9EB ++#define reg_p_ln_num2_4_3_pos 0 ++#define reg_p_ln_num2_4_3_len 2 ++#define reg_p_ln_num2_4_3_lsb 3 ++#define p_reg_p_ln_num3_5_0 0xF9EB ++#define reg_p_ln_num3_5_0_pos 2 ++#define reg_p_ln_num3_5_0_len 6 ++#define reg_p_ln_num3_5_0_lsb 0 ++#define p_reg_p_ln_num3_8_6 0xF9EC ++#define reg_p_ln_num3_8_6_pos 0 ++#define reg_p_ln_num3_8_6_len 3 ++#define reg_p_ln_num3_8_6_lsb 6 ++#define p_reg_p_ln_num4_4_0 0xF9EC ++#define reg_p_ln_num4_4_0_pos 3 ++#define reg_p_ln_num4_4_0_len 5 ++#define reg_p_ln_num4_4_0_lsb 0 ++#define p_reg_p_ln_num4_8_5 0xF9ED ++#define reg_p_ln_num4_8_5_pos 0 ++#define reg_p_ln_num4_8_5_len 4 ++#define reg_p_ln_num4_8_5_lsb 5 ++#define p_reg_p_ln_num5_3_0 0xF9ED ++#define reg_p_ln_num5_3_0_pos 4 ++#define reg_p_ln_num5_3_0_len 4 ++#define reg_p_ln_num5_3_0_lsb 0 ++#define p_reg_p_ln_num5_8_4 0xF9EE ++#define reg_p_ln_num5_8_4_pos 0 ++#define reg_p_ln_num5_8_4_len 5 ++#define reg_p_ln_num5_8_4_lsb 4 ++#define p_reg_p_ln_num6_2_0 0xF9EE ++#define reg_p_ln_num6_2_0_pos 5 ++#define reg_p_ln_num6_2_0_len 3 ++#define reg_p_ln_num6_2_0_lsb 0 ++#define p_reg_p_ln_num6_8_3 0xF9EF ++#define reg_p_ln_num6_8_3_pos 0 ++#define reg_p_ln_num6_8_3_len 6 ++#define reg_p_ln_num6_8_3_lsb 3 ++#define p_reg_p_pixel_num_7_0 0xF9F0 ++#define reg_p_pixel_num_7_0_pos 0 ++#define reg_p_pixel_num_7_0_len 8 ++#define reg_p_pixel_num_7_0_lsb 0 ++#define p_reg_p_pixel_num_10_8 0xF9F1 ++#define reg_p_pixel_num_10_8_pos 0 ++#define reg_p_pixel_num_10_8_len 3 ++#define reg_p_pixel_num_10_8_lsb 8 ++#define p_reg_p_ccir_yuv_en 0xF9F1 ++#define reg_p_ccir_yuv_en_pos 3 ++#define reg_p_ccir_yuv_en_len 1 ++#define reg_p_ccir_yuv_en_lsb 0 ++#define p_reg_p_ccir_size_sft 0xF9F1 ++#define reg_p_ccir_size_sft_pos 4 ++#define reg_p_ccir_size_sft_len 2 ++#define reg_p_ccir_size_sft_lsb 0 ++#define p_reg_p_psb_cnt_sft 0xF9F1 ++#define reg_p_psb_cnt_sft_pos 6 ++#define reg_p_psb_cnt_sft_len 2 ++#define reg_p_psb_cnt_sft_lsb 0 ++#define p_reg_p_tpsd_lock_trigger 0xF9F2 ++#define reg_p_tpsd_lock_trigger_pos 0 ++#define reg_p_tpsd_lock_trigger_len 1 ++#define reg_p_tpsd_lock_trigger_lsb 0 ++#define p_reg_p_ccir_clk_sel 0xF9F3 ++#define reg_p_ccir_clk_sel_pos 0 ++#define reg_p_ccir_clk_sel_len 1 ++#define reg_p_ccir_clk_sel_lsb 0 ++#define p_reg_i2c_16_8_data_sel 0xFB00 ++#define reg_i2c_16_8_data_sel_pos 0 ++#define reg_i2c_16_8_data_sel_len 1 ++#define reg_i2c_16_8_data_sel_lsb 0 ++#define p_reg_i2c_slave_trigger_byte 0xFB01 ++#define reg_i2c_slave_trigger_byte_pos 0 ++#define reg_i2c_slave_trigger_byte_len 1 ++#define reg_i2c_slave_trigger_byte_lsb 0 ++#define p_reg_wdti_level 0xFB05 ++#define reg_wdti_level_pos 0 ++#define reg_wdti_level_len 1 ++#define reg_wdti_level_lsb 0 ++#define p_reg_rssi_avg_sel_lat 0xFB06 ++#define reg_rssi_avg_sel_lat_pos 0 ++#define reg_rssi_avg_sel_lat_len 2 ++#define reg_rssi_avg_sel_lat_lsb 0 ++#define r_ofsm_rssi_avg_7_0 0xFB07 ++#define ofsm_rssi_avg_7_0_pos 0 ++#define ofsm_rssi_avg_7_0_len 8 ++#define ofsm_rssi_avg_7_0_lsb 0 ++#define r_ofsm_rssi_avg_9_8 0xFB08 ++#define ofsm_rssi_avg_9_8_pos 0 ++#define ofsm_rssi_avg_9_8_len 2 ++#define ofsm_rssi_avg_9_8_lsb 8 ++#define r_ofsm_mbist_fail_mon51 0xFB09 ++#define ofsm_mbist_fail_mon51_pos 0 ++#define ofsm_mbist_fail_mon51_len 1 ++#define ofsm_mbist_fail_mon51_lsb 0 ++#define r_ofsm_mbist_fail_com 0xFB0A ++#define ofsm_mbist_fail_com_pos 0 ++#define ofsm_mbist_fail_com_len 1 ++#define ofsm_mbist_fail_com_lsb 0 ++#define r_ofsm_mbist_fail_fft 0xFB0B ++#define ofsm_mbist_fail_fft_pos 0 ++#define ofsm_mbist_fail_fft_len 1 ++#define ofsm_mbist_fail_fft_lsb 0 ++#define r_ofsm_mbist_fail_fd 0xFB0C ++#define ofsm_mbist_fail_fd_pos 0 ++#define ofsm_mbist_fail_fd_len 1 ++#define ofsm_mbist_fail_fd_lsb 0 ++#define r_ofsm_mbist_fail_link 0xFB0D ++#define ofsm_mbist_fail_link_pos 0 ++#define ofsm_mbist_fail_link_len 1 ++#define ofsm_mbist_fail_link_lsb 0 ++#define r_ofsm_mbist_fail_mpe 0xFB0E ++#define ofsm_mbist_fail_mpe_pos 0 ++#define ofsm_mbist_fail_mpe_len 1 ++#define ofsm_mbist_fail_mpe_lsb 0 ++#define r_ofsm_mbist_done_mpe 0xFB0F ++#define ofsm_mbist_done_mpe_pos 0 ++#define ofsm_mbist_done_mpe_len 1 ++#define ofsm_mbist_done_mpe_lsb 0 ++#define r_ofsm_mbist_mode_mpe 0xFB10 ++#define ofsm_mbist_mode_mpe_pos 0 ++#define ofsm_mbist_mode_mpe_len 1 ++#define ofsm_mbist_mode_mpe_lsb 0 ++#define p_ofsm_cmd_reg 0xFB11 ++#define ofsm_cmd_reg_pos 0 ++#define ofsm_cmd_reg_len 8 ++#define ofsm_cmd_reg_lsb 0 ++#define p_ofsm_addr_reg_h 0xFB12 ++#define ofsm_addr_reg_h_pos 0 ++#define ofsm_addr_reg_h_len 8 ++#define ofsm_addr_reg_h_lsb 0 ++#define p_ofsm_addr_reg_l 0xFB13 ++#define ofsm_addr_reg_l_pos 0 ++#define ofsm_addr_reg_l_len 8 ++#define ofsm_addr_reg_l_lsb 0 ++#define p_ofsm_data_reg_0 0xFB14 ++#define ofsm_data_reg_0_pos 0 ++#define ofsm_data_reg_0_len 8 ++#define ofsm_data_reg_0_lsb 0 ++#define p_ofsm_data_reg_1 0xFB15 ++#define ofsm_data_reg_1_pos 0 ++#define ofsm_data_reg_1_len 8 ++#define ofsm_data_reg_1_lsb 0 ++#define p_ofsm_data_reg_2 0xFB16 ++#define ofsm_data_reg_2_pos 0 ++#define ofsm_data_reg_2_len 8 ++#define ofsm_data_reg_2_lsb 0 ++#define p_ofsm_data_reg_3 0xFB17 ++#define ofsm_data_reg_3_pos 0 ++#define ofsm_data_reg_3_len 8 ++#define ofsm_data_reg_3_lsb 0 ++#define p_ofsm_data_reg_4 0xFB18 ++#define ofsm_data_reg_4_pos 0 ++#define ofsm_data_reg_4_len 8 ++#define ofsm_data_reg_4_lsb 0 ++#define p_ofsm_data_reg_5 0xFB19 ++#define ofsm_data_reg_5_pos 0 ++#define ofsm_data_reg_5_len 8 ++#define ofsm_data_reg_5_lsb 0 ++#define p_ofsm_data_reg_6 0xFB1A ++#define ofsm_data_reg_6_pos 0 ++#define ofsm_data_reg_6_len 8 ++#define ofsm_data_reg_6_lsb 0 ++#define p_ofsm_data_reg_7 0xFB1B ++#define ofsm_data_reg_7_pos 0 ++#define ofsm_data_reg_7_len 8 ++#define ofsm_data_reg_7_lsb 0 ++#define p_ofsm_data_reg_8 0xFB1C ++#define ofsm_data_reg_8_pos 0 ++#define ofsm_data_reg_8_len 8 ++#define ofsm_data_reg_8_lsb 0 ++#define p_ofsm_data_reg_9 0xFB1D ++#define ofsm_data_reg_9_pos 0 ++#define ofsm_data_reg_9_len 8 ++#define ofsm_data_reg_9_lsb 0 ++#define p_ofsm_data_reg_10 0xFB1E ++#define ofsm_data_reg_10_pos 0 ++#define ofsm_data_reg_10_len 8 ++#define ofsm_data_reg_10_lsb 0 ++#define p_ofsm_data_reg_11 0xFB1F ++#define ofsm_data_reg_11_pos 0 ++#define ofsm_data_reg_11_len 8 ++#define ofsm_data_reg_11_lsb 0 ++#define p_ofsm_data_reg_12 0xFB20 ++#define ofsm_data_reg_12_pos 0 ++#define ofsm_data_reg_12_len 8 ++#define ofsm_data_reg_12_lsb 0 ++#define p_ofsm_data_reg_13 0xFB21 ++#define ofsm_data_reg_13_pos 0 ++#define ofsm_data_reg_13_len 8 ++#define ofsm_data_reg_13_lsb 0 ++#define p_ofsm_data_reg_14 0xFB22 ++#define ofsm_data_reg_14_pos 0 ++#define ofsm_data_reg_14_len 8 ++#define ofsm_data_reg_14_lsb 0 ++#define p_ofsm_data_reg_15 0xFB23 ++#define ofsm_data_reg_15_pos 0 ++#define ofsm_data_reg_15_len 8 ++#define ofsm_data_reg_15_lsb 0 ++#define p_reg_afe_mem0 0xFB24 ++#define reg_afe_mem0_pos 0 ++#define reg_afe_mem0_len 8 ++#define reg_afe_mem0_lsb 0 ++#define p_reg_afe_mem1 0xFB25 ++#define reg_afe_mem1_pos 0 ++#define reg_afe_mem1_len 8 ++#define reg_afe_mem1_lsb 0 ++#define p_reg_afe_mem2 0xFB26 ++#define reg_afe_mem2_pos 0 ++#define reg_afe_mem2_len 8 ++#define reg_afe_mem2_lsb 0 ++#define p_reg_afe_mem3 0xFB27 ++#define reg_afe_mem3_pos 0 ++#define reg_afe_mem3_len 8 ++#define reg_afe_mem3_lsb 0 ++#define p_reg_afe_mem4 0xFB28 ++#define reg_afe_mem4_pos 0 ++#define reg_afe_mem4_len 8 ++#define reg_afe_mem4_lsb 0 ++#define p_reg_afe_mem5 0xFB29 ++#define reg_afe_mem5_pos 0 ++#define reg_afe_mem5_len 8 ++#define reg_afe_mem5_lsb 0 ++#define p_reg_afe_mem6 0xFB2A ++#define reg_afe_mem6_pos 0 ++#define reg_afe_mem6_len 8 ++#define reg_afe_mem6_lsb 0 ++#define p_reg_afe_mem7 0xFB2B ++#define reg_afe_mem7_pos 0 ++#define reg_afe_mem7_len 8 ++#define reg_afe_mem7_lsb 0 ++#define p_reg_i2cbootreq 0xFB2C ++#define reg_i2cbootreq_pos 0 ++#define reg_i2cbootreq_len 1 ++#define reg_i2cbootreq_lsb 0 ++#define p_reg_rst_i2cm 0xFB30 ++#define reg_rst_i2cm_pos 0 ++#define reg_rst_i2cm_len 1 ++#define reg_rst_i2cm_lsb 0 ++#define p_reg_rst_i2cs 0xFB31 ++#define reg_rst_i2cs_pos 0 ++#define reg_rst_i2cs_len 1 ++#define reg_rst_i2cs_lsb 0 ++#define r_reg_top_gpioscli 0xFB32 ++#define reg_top_gpioscli_pos 0 ++#define reg_top_gpioscli_len 1 ++#define reg_top_gpioscli_lsb 0 ++#define p_reg_top_gpiosclo 0xFB33 ++#define reg_top_gpiosclo_pos 0 ++#define reg_top_gpiosclo_len 1 ++#define reg_top_gpiosclo_lsb 0 ++#define p_reg_top_gpiosclen 0xFB34 ++#define reg_top_gpiosclen_pos 0 ++#define reg_top_gpiosclen_len 1 ++#define reg_top_gpiosclen_lsb 0 ++#define p_reg_top_gpiosclon 0xFB35 ++#define reg_top_gpiosclon_pos 0 ++#define reg_top_gpiosclon_len 1 ++#define reg_top_gpiosclon_lsb 0 ++#define r_reg_top_gpiosdai 0xFB36 ++#define reg_top_gpiosdai_pos 0 ++#define reg_top_gpiosdai_len 1 ++#define reg_top_gpiosdai_lsb 0 ++#define p_reg_top_gpiosdao 0xFB37 ++#define reg_top_gpiosdao_pos 0 ++#define reg_top_gpiosdao_len 1 ++#define reg_top_gpiosdao_lsb 0 ++#define p_reg_top_gpiosdaen 0xFB38 ++#define reg_top_gpiosdaen_pos 0 ++#define reg_top_gpiosdaen_len 1 ++#define reg_top_gpiosdaen_lsb 0 ++#define p_reg_top_gpiosdaon 0xFB39 ++#define reg_top_gpiosdaon_pos 0 ++#define reg_top_gpiosdaon_len 1 ++#define reg_top_gpiosdaon_lsb 0 ++#define p_reg_fix_rom_en 0xFB3A ++#define reg_fix_rom_en_pos 0 ++#define reg_fix_rom_en_len 1 ++#define reg_fix_rom_en_lsb 0 ++#define p_reg_ofsm_bug_addh_0 0xFB3B ++#define reg_ofsm_bug_addh_0_pos 0 ++#define reg_ofsm_bug_addh_0_len 8 ++#define reg_ofsm_bug_addh_0_lsb 0 ++#define p_reg_ofsm_bug_addl_0 0xFB3C ++#define reg_ofsm_bug_addl_0_pos 0 ++#define reg_ofsm_bug_addl_0_len 8 ++#define reg_ofsm_bug_addl_0_lsb 0 ++#define p_reg_ofsm_bug_addh_1 0xFB3D ++#define reg_ofsm_bug_addh_1_pos 0 ++#define reg_ofsm_bug_addh_1_len 8 ++#define reg_ofsm_bug_addh_1_lsb 0 ++#define p_reg_ofsm_bug_addl_1 0xFB3E ++#define reg_ofsm_bug_addl_1_pos 0 ++#define reg_ofsm_bug_addl_1_len 8 ++#define reg_ofsm_bug_addl_1_lsb 0 ++#define p_reg_ofsm_bug_addh_2 0xFB3F ++#define reg_ofsm_bug_addh_2_pos 0 ++#define reg_ofsm_bug_addh_2_len 8 ++#define reg_ofsm_bug_addh_2_lsb 0 ++#define p_reg_ofsm_bug_addl_2 0xFB40 ++#define reg_ofsm_bug_addl_2_pos 0 ++#define reg_ofsm_bug_addl_2_len 8 ++#define reg_ofsm_bug_addl_2_lsb 0 ++#define p_reg_ofsm_bug_addh_3 0xFB41 ++#define reg_ofsm_bug_addh_3_pos 0 ++#define reg_ofsm_bug_addh_3_len 8 ++#define reg_ofsm_bug_addh_3_lsb 0 ++#define p_reg_ofsm_bug_addl_3 0xFB42 ++#define reg_ofsm_bug_addl_3_pos 0 ++#define reg_ofsm_bug_addl_3_len 8 ++#define reg_ofsm_bug_addl_3_lsb 0 ++#define p_reg_ofsm_bug_addh_4 0xFB43 ++#define reg_ofsm_bug_addh_4_pos 0 ++#define reg_ofsm_bug_addh_4_len 8 ++#define reg_ofsm_bug_addh_4_lsb 0 ++#define p_reg_ofsm_bug_addl_4 0xFB44 ++#define reg_ofsm_bug_addl_4_pos 0 ++#define reg_ofsm_bug_addl_4_len 8 ++#define reg_ofsm_bug_addl_4_lsb 0 ++#define p_reg_ofsm_bug_addh_5 0xFB45 ++#define reg_ofsm_bug_addh_5_pos 0 ++#define reg_ofsm_bug_addh_5_len 8 ++#define reg_ofsm_bug_addh_5_lsb 0 ++#define p_reg_ofsm_bug_addl_5 0xFB46 ++#define reg_ofsm_bug_addl_5_pos 0 ++#define reg_ofsm_bug_addl_5_len 8 ++#define reg_ofsm_bug_addl_5_lsb 0 ++#define p_reg_ofsm_bug_addh_6 0xFB47 ++#define reg_ofsm_bug_addh_6_pos 0 ++#define reg_ofsm_bug_addh_6_len 8 ++#define reg_ofsm_bug_addh_6_lsb 0 ++#define p_reg_ofsm_bug_addl_6 0xFB48 ++#define reg_ofsm_bug_addl_6_pos 0 ++#define reg_ofsm_bug_addl_6_len 8 ++#define reg_ofsm_bug_addl_6_lsb 0 ++#define p_reg_ofsm_bug_addh_7 0xFB49 ++#define reg_ofsm_bug_addh_7_pos 0 ++#define reg_ofsm_bug_addh_7_len 8 ++#define reg_ofsm_bug_addh_7_lsb 0 ++#define p_reg_ofsm_bug_addl_7 0xFB4A ++#define reg_ofsm_bug_addl_7_pos 0 ++#define reg_ofsm_bug_addl_7_len 8 ++#define reg_ofsm_bug_addl_7_lsb 0 ++#define p_reg_ofsm_bug_addh_8 0xFB4B ++#define reg_ofsm_bug_addh_8_pos 0 ++#define reg_ofsm_bug_addh_8_len 8 ++#define reg_ofsm_bug_addh_8_lsb 0 ++#define p_reg_ofsm_bug_addl_8 0xFB4C ++#define reg_ofsm_bug_addl_8_pos 0 ++#define reg_ofsm_bug_addl_8_len 8 ++#define reg_ofsm_bug_addl_8_lsb 0 ++#define p_reg_ofsm_bug_addh_9 0xFB4D ++#define reg_ofsm_bug_addh_9_pos 0 ++#define reg_ofsm_bug_addh_9_len 8 ++#define reg_ofsm_bug_addh_9_lsb 0 ++#define p_reg_ofsm_bug_addl_9 0xFB4E ++#define reg_ofsm_bug_addl_9_pos 0 ++#define reg_ofsm_bug_addl_9_len 8 ++#define reg_ofsm_bug_addl_9_lsb 0 ++#define p_reg_ofsm_bug_addh_10 0xFB4F ++#define reg_ofsm_bug_addh_10_pos 0 ++#define reg_ofsm_bug_addh_10_len 8 ++#define reg_ofsm_bug_addh_10_lsb 0 ++#define p_reg_ofsm_bug_addl_10 0xFB50 ++#define reg_ofsm_bug_addl_10_pos 0 ++#define reg_ofsm_bug_addl_10_len 8 ++#define reg_ofsm_bug_addl_10_lsb 0 ++#define p_reg_ofsm_bug_addh_11 0xFB51 ++#define reg_ofsm_bug_addh_11_pos 0 ++#define reg_ofsm_bug_addh_11_len 8 ++#define reg_ofsm_bug_addh_11_lsb 0 ++#define p_reg_ofsm_bug_addl_11 0xFB52 ++#define reg_ofsm_bug_addl_11_pos 0 ++#define reg_ofsm_bug_addl_11_len 8 ++#define reg_ofsm_bug_addl_11_lsb 0 ++#define p_reg_ofsm_bug_addh_12 0xFB53 ++#define reg_ofsm_bug_addh_12_pos 0 ++#define reg_ofsm_bug_addh_12_len 8 ++#define reg_ofsm_bug_addh_12_lsb 0 ++#define p_reg_ofsm_bug_addl_12 0xFB54 ++#define reg_ofsm_bug_addl_12_pos 0 ++#define reg_ofsm_bug_addl_12_len 8 ++#define reg_ofsm_bug_addl_12_lsb 0 ++#define p_reg_ofsm_bug_addh_13 0xFB55 ++#define reg_ofsm_bug_addh_13_pos 0 ++#define reg_ofsm_bug_addh_13_len 8 ++#define reg_ofsm_bug_addh_13_lsb 0 ++#define p_reg_ofsm_bug_addl_13 0xFB56 ++#define reg_ofsm_bug_addl_13_pos 0 ++#define reg_ofsm_bug_addl_13_len 8 ++#define reg_ofsm_bug_addl_13_lsb 0 ++#define p_reg_ofsm_bug_addh_14 0xFB57 ++#define reg_ofsm_bug_addh_14_pos 0 ++#define reg_ofsm_bug_addh_14_len 8 ++#define reg_ofsm_bug_addh_14_lsb 0 ++#define p_reg_ofsm_bug_addl_14 0xFB58 ++#define reg_ofsm_bug_addl_14_pos 0 ++#define reg_ofsm_bug_addl_14_len 8 ++#define reg_ofsm_bug_addl_14_lsb 0 ++#define p_reg_ofsm_bug_addh_15 0xFB59 ++#define reg_ofsm_bug_addh_15_pos 0 ++#define reg_ofsm_bug_addh_15_len 8 ++#define reg_ofsm_bug_addh_15_lsb 0 ++#define p_reg_ofsm_bug_addl_15 0xFB5A ++#define reg_ofsm_bug_addl_15_pos 0 ++#define reg_ofsm_bug_addl_15_len 8 ++#define reg_ofsm_bug_addl_15_lsb 0 ++#define p_reg_ofsm_jmp_addh_0 0xFB5B ++#define reg_ofsm_jmp_addh_0_pos 0 ++#define reg_ofsm_jmp_addh_0_len 8 ++#define reg_ofsm_jmp_addh_0_lsb 0 ++#define p_reg_ofsm_jmp_addl_0 0xFB5C ++#define reg_ofsm_jmp_addl_0_pos 0 ++#define reg_ofsm_jmp_addl_0_len 8 ++#define reg_ofsm_jmp_addl_0_lsb 0 ++#define p_reg_ofsm_jmp_addh_1 0xFB5D ++#define reg_ofsm_jmp_addh_1_pos 0 ++#define reg_ofsm_jmp_addh_1_len 8 ++#define reg_ofsm_jmp_addh_1_lsb 0 ++#define p_reg_ofsm_jmp_addl_1 0xFB5E ++#define reg_ofsm_jmp_addl_1_pos 0 ++#define reg_ofsm_jmp_addl_1_len 8 ++#define reg_ofsm_jmp_addl_1_lsb 0 ++#define p_reg_ofsm_jmp_addh_2 0xFB5F ++#define reg_ofsm_jmp_addh_2_pos 0 ++#define reg_ofsm_jmp_addh_2_len 8 ++#define reg_ofsm_jmp_addh_2_lsb 0 ++#define p_reg_ofsm_jmp_addl_2 0xFB60 ++#define reg_ofsm_jmp_addl_2_pos 0 ++#define reg_ofsm_jmp_addl_2_len 8 ++#define reg_ofsm_jmp_addl_2_lsb 0 ++#define p_reg_ofsm_jmp_addh_3 0xFB61 ++#define reg_ofsm_jmp_addh_3_pos 0 ++#define reg_ofsm_jmp_addh_3_len 8 ++#define reg_ofsm_jmp_addh_3_lsb 0 ++#define p_reg_ofsm_jmp_addl_3 0xFB62 ++#define reg_ofsm_jmp_addl_3_pos 0 ++#define reg_ofsm_jmp_addl_3_len 8 ++#define reg_ofsm_jmp_addl_3_lsb 0 ++#define p_reg_ofsm_jmp_addh_4 0xFB63 ++#define reg_ofsm_jmp_addh_4_pos 0 ++#define reg_ofsm_jmp_addh_4_len 8 ++#define reg_ofsm_jmp_addh_4_lsb 0 ++#define p_reg_ofsm_jmp_addl_4 0xFB64 ++#define reg_ofsm_jmp_addl_4_pos 0 ++#define reg_ofsm_jmp_addl_4_len 8 ++#define reg_ofsm_jmp_addl_4_lsb 0 ++#define p_reg_ofsm_jmp_addh_5 0xFB65 ++#define reg_ofsm_jmp_addh_5_pos 0 ++#define reg_ofsm_jmp_addh_5_len 8 ++#define reg_ofsm_jmp_addh_5_lsb 0 ++#define p_reg_ofsm_jmp_addl_5 0xFB66 ++#define reg_ofsm_jmp_addl_5_pos 0 ++#define reg_ofsm_jmp_addl_5_len 8 ++#define reg_ofsm_jmp_addl_5_lsb 0 ++#define p_reg_ofsm_jmp_addh_6 0xFB67 ++#define reg_ofsm_jmp_addh_6_pos 0 ++#define reg_ofsm_jmp_addh_6_len 8 ++#define reg_ofsm_jmp_addh_6_lsb 0 ++#define p_reg_ofsm_jmp_addl_6 0xFB68 ++#define reg_ofsm_jmp_addl_6_pos 0 ++#define reg_ofsm_jmp_addl_6_len 8 ++#define reg_ofsm_jmp_addl_6_lsb 0 ++#define p_reg_ofsm_jmp_addh_7 0xFB69 ++#define reg_ofsm_jmp_addh_7_pos 0 ++#define reg_ofsm_jmp_addh_7_len 8 ++#define reg_ofsm_jmp_addh_7_lsb 0 ++#define p_reg_ofsm_jmp_addl_7 0xFB6A ++#define reg_ofsm_jmp_addl_7_pos 0 ++#define reg_ofsm_jmp_addl_7_len 8 ++#define reg_ofsm_jmp_addl_7_lsb 0 ++#define p_reg_ofsm_jmp_addh_8 0xFB6B ++#define reg_ofsm_jmp_addh_8_pos 0 ++#define reg_ofsm_jmp_addh_8_len 8 ++#define reg_ofsm_jmp_addh_8_lsb 0 ++#define p_reg_ofsm_jmp_addl_8 0xFB6C ++#define reg_ofsm_jmp_addl_8_pos 0 ++#define reg_ofsm_jmp_addl_8_len 8 ++#define reg_ofsm_jmp_addl_8_lsb 0 ++#define p_reg_ofsm_jmp_addh_9 0xFB6D ++#define reg_ofsm_jmp_addh_9_pos 0 ++#define reg_ofsm_jmp_addh_9_len 8 ++#define reg_ofsm_jmp_addh_9_lsb 0 ++#define p_reg_ofsm_jmp_addl_9 0xFB6E ++#define reg_ofsm_jmp_addl_9_pos 0 ++#define reg_ofsm_jmp_addl_9_len 8 ++#define reg_ofsm_jmp_addl_9_lsb 0 ++#define p_reg_ofsm_jmp_addh_10 0xFB6F ++#define reg_ofsm_jmp_addh_10_pos 0 ++#define reg_ofsm_jmp_addh_10_len 8 ++#define reg_ofsm_jmp_addh_10_lsb 0 ++#define p_reg_ofsm_jmp_addl_10 0xFB70 ++#define reg_ofsm_jmp_addl_10_pos 0 ++#define reg_ofsm_jmp_addl_10_len 8 ++#define reg_ofsm_jmp_addl_10_lsb 0 ++#define p_reg_ofsm_jmp_addh_11 0xFB71 ++#define reg_ofsm_jmp_addh_11_pos 0 ++#define reg_ofsm_jmp_addh_11_len 8 ++#define reg_ofsm_jmp_addh_11_lsb 0 ++#define p_reg_ofsm_jmp_addl_11 0xFB72 ++#define reg_ofsm_jmp_addl_11_pos 0 ++#define reg_ofsm_jmp_addl_11_len 8 ++#define reg_ofsm_jmp_addl_11_lsb 0 ++#define p_reg_ofsm_jmp_addh_12 0xFB73 ++#define reg_ofsm_jmp_addh_12_pos 0 ++#define reg_ofsm_jmp_addh_12_len 8 ++#define reg_ofsm_jmp_addh_12_lsb 0 ++#define p_reg_ofsm_jmp_addl_12 0xFB74 ++#define reg_ofsm_jmp_addl_12_pos 0 ++#define reg_ofsm_jmp_addl_12_len 8 ++#define reg_ofsm_jmp_addl_12_lsb 0 ++#define p_reg_ofsm_jmp_addh_13 0xFB75 ++#define reg_ofsm_jmp_addh_13_pos 0 ++#define reg_ofsm_jmp_addh_13_len 8 ++#define reg_ofsm_jmp_addh_13_lsb 0 ++#define p_reg_ofsm_jmp_addl_13 0xFB76 ++#define reg_ofsm_jmp_addl_13_pos 0 ++#define reg_ofsm_jmp_addl_13_len 8 ++#define reg_ofsm_jmp_addl_13_lsb 0 ++#define p_reg_ofsm_jmp_addh_14 0xFB77 ++#define reg_ofsm_jmp_addh_14_pos 0 ++#define reg_ofsm_jmp_addh_14_len 8 ++#define reg_ofsm_jmp_addh_14_lsb 0 ++#define p_reg_ofsm_jmp_addl_14 0xFB78 ++#define reg_ofsm_jmp_addl_14_pos 0 ++#define reg_ofsm_jmp_addl_14_len 8 ++#define reg_ofsm_jmp_addl_14_lsb 0 ++#define p_reg_ofsm_jmp_addh_15 0xFB79 ++#define reg_ofsm_jmp_addh_15_pos 0 ++#define reg_ofsm_jmp_addh_15_len 8 ++#define reg_ofsm_jmp_addh_15_lsb 0 ++#define p_reg_ofsm_jmp_addl_15 0xFB7A ++#define reg_ofsm_jmp_addl_15_pos 0 ++#define reg_ofsm_jmp_addl_15_len 8 ++#define reg_ofsm_jmp_addl_15_lsb 0 ++#define p_reg_sw_mon51 0xFB7B ++#define reg_sw_mon51_pos 0 ++#define reg_sw_mon51_len 7 ++#define reg_sw_mon51_lsb 0 ++#define p_reg_ofdm_mon51_flag 0xFB7C ++#define reg_ofdm_mon51_flag_pos 0 ++#define reg_ofdm_mon51_flag_len 1 ++#define reg_ofdm_mon51_flag_lsb 0 ++#define p_reg_ofdm_force_mon51 0xFB7D ++#define reg_ofdm_force_mon51_pos 0 ++#define reg_ofdm_force_mon51_len 1 ++#define reg_ofdm_force_mon51_lsb 0 ++#define p_reg_ofdm_which_cpu 0xFB7E ++#define reg_ofdm_which_cpu_pos 0 ++#define reg_ofdm_which_cpu_len 1 ++#define reg_ofdm_which_cpu_lsb 0 ++#define p_reg_ofdm_code_ready 0xFB7F ++#define reg_ofdm_code_ready_pos 0 ++#define reg_ofdm_code_ready_len 1 ++#define reg_ofdm_code_ready_lsb 0 ++#define p_reg_ofdm_mailbox_wend 0xFB80 ++#define reg_ofdm_mailbox_wend_pos 0 ++#define reg_ofdm_mailbox_wend_len 1 ++#define reg_ofdm_mailbox_wend_lsb 0 ++#define r_reg_fast_slow_train 0xFB81 ++#define reg_fast_slow_train_pos 0 ++#define reg_fast_slow_train_len 1 ++#define reg_fast_slow_train_lsb 0 ++#define p_reg_ofdm_mailbox_wptr 0xFB82 ++#define reg_ofdm_mailbox_wptr_pos 0 ++#define reg_ofdm_mailbox_wptr_len 8 ++#define reg_ofdm_mailbox_wptr_lsb 0 ++#define p_reg_ofdm_mailbox_int 0xFB86 ++#define reg_ofdm_mailbox_int_pos 0 ++#define reg_ofdm_mailbox_int_len 1 ++#define reg_ofdm_mailbox_int_lsb 0 ++#define p_reg_ofdm_lnk2ofdm_int 0xFB87 ++#define reg_ofdm_lnk2ofdm_int_pos 0 ++#define reg_ofdm_lnk2ofdm_int_len 1 ++#define reg_ofdm_lnk2ofdm_int_lsb 0 ++#define p_reg_ofdm_ofdm2lnk_int 0xFB88 ++#define reg_ofdm_ofdm2lnk_int_pos 0 ++#define reg_ofdm_ofdm2lnk_int_len 1 ++#define reg_ofdm_ofdm2lnk_int_lsb 0 ++#define r_reg_load_ofdm_reg 0xFB8F ++#define reg_load_ofdm_reg_pos 0 ++#define reg_load_ofdm_reg_len 1 ++#define reg_load_ofdm_reg_lsb 0 ++#define p_reg_lnk_mbx_rd_length_7_0 0xFB90 ++#define reg_lnk_mbx_rd_length_7_0_pos 0 ++#define reg_lnk_mbx_rd_length_7_0_len 8 ++#define reg_lnk_mbx_rd_length_7_0_lsb 0 ++#define p_reg_lnk_mbx_rd_length_15_8 0xFB91 ++#define reg_lnk_mbx_rd_length_15_8_pos 0 ++#define reg_lnk_mbx_rd_length_15_8_len 8 ++#define reg_lnk_mbx_rd_length_15_8_lsb 8 ++#define p_reg_lnk_mbx_rd_length_17_16 0xFB92 ++#define reg_lnk_mbx_rd_length_17_16_pos 0 ++#define reg_lnk_mbx_rd_length_17_16_len 2 ++#define reg_lnk_mbx_rd_length_17_16_lsb 16 ++#define p_reg_lnk_rd_data_sel 0xFB93 ++#define reg_lnk_rd_data_sel_pos 0 ++#define reg_lnk_rd_data_sel_len 2 ++#define reg_lnk_rd_data_sel_lsb 0 ++#define p_reg_ofdm2lnk_data_7_0 0xFB96 ++#define reg_ofdm2lnk_data_7_0_pos 0 ++#define reg_ofdm2lnk_data_7_0_len 8 ++#define reg_ofdm2lnk_data_7_0_lsb 0 ++#define p_reg_ofdm2lnk_data_15_8 0xFB97 ++#define reg_ofdm2lnk_data_15_8_pos 0 ++#define reg_ofdm2lnk_data_15_8_len 8 ++#define reg_ofdm2lnk_data_15_8_lsb 8 ++#define p_reg_ofdm2lnk_data_23_16 0xFB98 ++#define reg_ofdm2lnk_data_23_16_pos 0 ++#define reg_ofdm2lnk_data_23_16_len 8 ++#define reg_ofdm2lnk_data_23_16_lsb 16 ++#define p_reg_ofdm2lnk_data_31_24 0xFB99 ++#define reg_ofdm2lnk_data_31_24_pos 0 ++#define reg_ofdm2lnk_data_31_24_len 8 ++#define reg_ofdm2lnk_data_31_24_lsb 24 ++#define p_reg_ofdm2lnk_data_39_32 0xFB9A ++#define reg_ofdm2lnk_data_39_32_pos 0 ++#define reg_ofdm2lnk_data_39_32_len 8 ++#define reg_ofdm2lnk_data_39_32_lsb 32 ++#define p_reg_ofdm2lnk_data_47_40 0xFB9B ++#define reg_ofdm2lnk_data_47_40_pos 0 ++#define reg_ofdm2lnk_data_47_40_len 8 ++#define reg_ofdm2lnk_data_47_40_lsb 40 ++#define p_reg_ofdm2lnk_data_55_48 0xFB9C ++#define reg_ofdm2lnk_data_55_48_pos 0 ++#define reg_ofdm2lnk_data_55_48_len 8 ++#define reg_ofdm2lnk_data_55_48_lsb 48 ++#define p_reg_ofdm2lnk_data_63_56 0xFB9D ++#define reg_ofdm2lnk_data_63_56_pos 0 ++#define reg_ofdm2lnk_data_63_56_len 8 ++#define reg_ofdm2lnk_data_63_56_lsb 56 ++#define p_reg_lnktoofdm_data_7_0 0xFB9E ++#define reg_lnktoofdm_data_7_0_pos 0 ++#define reg_lnktoofdm_data_7_0_len 8 ++#define reg_lnktoofdm_data_7_0_lsb 0 ++#define p_reg_lnktoofdm_data_15_8 0xFB9F ++#define reg_lnktoofdm_data_15_8_pos 0 ++#define reg_lnktoofdm_data_15_8_len 8 ++#define reg_lnktoofdm_data_15_8_lsb 8 ++#define p_reg_lnktoofdm_data_23_16 0xFBA0 ++#define reg_lnktoofdm_data_23_16_pos 0 ++#define reg_lnktoofdm_data_23_16_len 8 ++#define reg_lnktoofdm_data_23_16_lsb 16 ++#define p_reg_lnktoofdm_data_31_24 0xFBA1 ++#define reg_lnktoofdm_data_31_24_pos 0 ++#define reg_lnktoofdm_data_31_24_len 8 ++#define reg_lnktoofdm_data_31_24_lsb 24 ++#define p_reg_lnktoofdm_data_39_32 0xFBA2 ++#define reg_lnktoofdm_data_39_32_pos 0 ++#define reg_lnktoofdm_data_39_32_len 8 ++#define reg_lnktoofdm_data_39_32_lsb 32 ++#define p_reg_lnktoofdm_data_47_40 0xFBA3 ++#define reg_lnktoofdm_data_47_40_pos 0 ++#define reg_lnktoofdm_data_47_40_len 8 ++#define reg_lnktoofdm_data_47_40_lsb 40 ++#define p_reg_lnktoofdm_data_55_48 0xFBA4 ++#define reg_lnktoofdm_data_55_48_pos 0 ++#define reg_lnktoofdm_data_55_48_len 8 ++#define reg_lnktoofdm_data_55_48_lsb 48 ++#define p_reg_lnktoofdm_data_63_56 0xFBA5 ++#define reg_lnktoofdm_data_63_56_pos 0 ++#define reg_lnktoofdm_data_63_56_len 8 ++#define reg_lnktoofdm_data_63_56_lsb 56 ++#define p_reg_dbgif32_sel 0xFBA6 ++#define reg_dbgif32_sel_pos 0 ++#define reg_dbgif32_sel_len 2 ++#define reg_dbgif32_sel_lsb 0 ++#define p_reg_dyn1_clk 0xFBA7 ++#define reg_dyn1_clk_pos 0 ++#define reg_dyn1_clk_len 1 ++#define reg_dyn1_clk_lsb 0 ++#define p_reg_dyn0_clk 0xFBA8 ++#define reg_dyn0_clk_pos 0 ++#define reg_dyn0_clk_len 1 ++#define reg_dyn0_clk_lsb 0 ++#define p_reg_free_clk 0xFBA9 ++#define reg_free_clk_pos 0 ++#define reg_free_clk_len 1 ++#define reg_free_clk_lsb 0 ++#define p_reg_ofdm_stick_mem_end_7_0 0xFBAD ++#define reg_ofdm_stick_mem_end_7_0_pos 0 ++#define reg_ofdm_stick_mem_end_7_0_len 8 ++#define reg_ofdm_stick_mem_end_7_0_lsb 0 ++#define p_reg_ofdm_stick_mem_end_15_8 0xFBAE ++#define reg_ofdm_stick_mem_end_15_8_pos 0 ++#define reg_ofdm_stick_mem_end_15_8_len 8 ++#define reg_ofdm_stick_mem_end_15_8_lsb 8 ++#define p_reg_ofdm_cpu_reset 0xFBAF ++#define reg_ofdm_cpu_reset_pos 0 ++#define reg_ofdm_cpu_reset_len 1 ++#define reg_ofdm_cpu_reset_lsb 0 ++#define p_reg_ofdm_bank_float_en 0xFBB0 ++#define reg_ofdm_bank_float_en_pos 0 ++#define reg_ofdm_bank_float_en_len 1 ++#define reg_ofdm_bank_float_en_lsb 0 ++#define p_reg_ofdm_bank_float_start 0xFBB1 ++#define reg_ofdm_bank_float_start_pos 0 ++#define reg_ofdm_bank_float_start_len 8 ++#define reg_ofdm_bank_float_start_lsb 0 ++#define p_reg_ofdm_bank_float_stop 0xFBB2 ++#define reg_ofdm_bank_float_stop_pos 0 ++#define reg_ofdm_bank_float_stop_len 8 ++#define reg_ofdm_bank_float_stop_lsb 0 ++#define r_ofsm_bond0_i 0xFBB3 ++#define ofsm_bond0_i_pos 0 ++#define ofsm_bond0_i_len 1 ++#define ofsm_bond0_i_lsb 0 ++#define r_ofsm_bond1_i 0xFBB4 ++#define ofsm_bond1_i_pos 0 ++#define ofsm_bond1_i_len 1 ++#define ofsm_bond1_i_lsb 0 ++#define r_io_mux_pwron_clk_strap 0xD800 ++#define io_mux_pwron_clk_strap_pos 0 ++#define io_mux_pwron_clk_strap_len 4 ++#define io_mux_pwron_clk_strap_lsb 0 ++#define r_io_mux_pwron_mode_strap 0xD801 ++#define io_mux_pwron_mode_strap_pos 0 ++#define io_mux_pwron_mode_strap_len 4 ++#define io_mux_pwron_mode_strap_lsb 0 ++#define r_io_mux_pwron_hosta 0xD802 ++#define io_mux_pwron_hosta_pos 0 ++#define io_mux_pwron_hosta_len 1 ++#define io_mux_pwron_hosta_lsb 0 ++#define r_reg_top_revid 0xD803 ++#define reg_top_revid_pos 0 ++#define reg_top_revid_len 4 ++#define reg_top_revid_lsb 0 ++#define r_io_mux_bond0_i 0xD804 ++#define io_mux_bond0_i_pos 0 ++#define io_mux_bond0_i_len 1 ++#define io_mux_bond0_i_lsb 0 ++#define r_io_mux_bondu0_i 0xD805 ++#define io_mux_bondu0_i_pos 0 ++#define io_mux_bondu0_i_len 1 ++#define io_mux_bondu0_i_lsb 0 ++#define p_reg_ofsm_suspend 0xD806 ++#define reg_ofsm_suspend_pos 0 ++#define reg_ofsm_suspend_len 1 ++#define reg_ofsm_suspend_lsb 0 ++#define p_reg_tslice_off 0xD807 ++#define reg_tslice_off_pos 0 ++#define reg_tslice_off_len 1 ++#define reg_tslice_off_lsb 0 ++#define p_io_mux_wake_int 0xD808 ++#define io_mux_wake_int_pos 0 ++#define io_mux_wake_int_len 1 ++#define io_mux_wake_int_lsb 0 ++#define p_reg_top_pwrdw_hwen 0xD809 ++#define reg_top_pwrdw_hwen_pos 0 ++#define reg_top_pwrdw_hwen_len 1 ++#define reg_top_pwrdw_hwen_lsb 0 ++#define p_reg_top_pwrdw_inv 0xD80A ++#define reg_top_pwrdw_inv_pos 0 ++#define reg_top_pwrdw_inv_len 1 ++#define reg_top_pwrdw_inv_lsb 0 ++#define p_reg_top_pwrdw 0xD80B ++#define reg_top_pwrdw_pos 0 ++#define reg_top_pwrdw_len 1 ++#define reg_top_pwrdw_lsb 0 ++#define p_io_mux_wake_int_en 0xD80C ++#define io_mux_wake_int_en_pos 0 ++#define io_mux_wake_int_en_len 1 ++#define io_mux_wake_int_en_lsb 0 ++#define p_io_mux_pwrdw_int 0xD80D ++#define io_mux_pwrdw_int_pos 0 ++#define io_mux_pwrdw_int_len 1 ++#define io_mux_pwrdw_int_lsb 0 ++#define p_reg_top_adcdly 0xD80E ++#define reg_top_adcdly_pos 0 ++#define reg_top_adcdly_len 2 ++#define reg_top_adcdly_lsb 0 ++#define p_reg_top_debug 0xD80F ++#define reg_top_debug_pos 0 ++#define reg_top_debug_len 1 ++#define reg_top_debug_lsb 0 ++#define p_reg_top_pcout 0xD810 ++#define reg_top_pcout_pos 0 ++#define reg_top_pcout_len 1 ++#define reg_top_pcout_lsb 0 ++#define p_reg_top_rs232 0xD811 ++#define reg_top_rs232_pos 0 ++#define reg_top_rs232_len 1 ++#define reg_top_rs232_lsb 0 ++#define p_reg_iqmode 0xD812 ++#define reg_iqmode_pos 0 ++#define reg_iqmode_len 1 ++#define reg_iqmode_lsb 0 ++#define p_reg_top_rstfd 0xD813 ++#define reg_top_rstfd_pos 0 ++#define reg_top_rstfd_len 1 ++#define reg_top_rstfd_lsb 0 ++#define p_reg_sdio_clksel 0xD814 ++#define reg_sdio_clksel_pos 0 ++#define reg_sdio_clksel_len 1 ++#define reg_sdio_clksel_lsb 0 ++#define p_reg_utmi_clksel 0xD815 ++#define reg_utmi_clksel_pos 0 ++#define reg_utmi_clksel_len 8 ++#define reg_utmi_clksel_lsb 0 ++#define p_reg_top_suscnt 0xD816 ++#define reg_top_suscnt_pos 0 ++#define reg_top_suscnt_len 2 ++#define reg_top_suscnt_lsb 0 ++#define p_reg_top_dist2f 0xD817 ++#define reg_top_dist2f_pos 0 ++#define reg_top_dist2f_len 1 ++#define reg_top_dist2f_lsb 0 ++#define p_reg_top_extusb 0xD818 ++#define reg_top_extusb_pos 0 ++#define reg_top_extusb_len 1 ++#define reg_top_extusb_lsb 0 ++#define p_reg_top_adcfifo 0xD819 ++#define reg_top_adcfifo_pos 0 ++#define reg_top_adcfifo_len 1 ++#define reg_top_adcfifo_lsb 0 ++#define p_reg_top_clkoen 0xD81A ++#define reg_top_clkoen_pos 0 ++#define reg_top_clkoen_len 1 ++#define reg_top_clkoen_lsb 0 ++#define p_reg_top_stpck 0xD81B ++#define reg_top_stpck_pos 0 ++#define reg_top_stpck_len 1 ++#define reg_top_stpck_lsb 0 ++#define p_reg_top_freeck 0xD81C ++#define reg_top_freeck_pos 0 ++#define reg_top_freeck_len 1 ++#define reg_top_freeck_lsb 0 ++#define p_reg_top_dio_sel 0xD81D ++#define reg_top_dio_sel_pos 0 ++#define reg_top_dio_sel_len 1 ++#define reg_top_dio_sel_lsb 0 ++#define p_reg_top_int_en 0xD81E ++#define reg_top_int_en_pos 0 ++#define reg_top_int_en_len 1 ++#define reg_top_int_en_lsb 0 ++#define p_reg_top_int_inv 0xD81F ++#define reg_top_int_inv_pos 0 ++#define reg_top_int_inv_len 1 ++#define reg_top_int_inv_lsb 0 ++#define p_reg_tsip_clk_inv 0xD820 ++#define reg_tsip_clk_inv_pos 0 ++#define reg_tsip_clk_inv_len 1 ++#define reg_tsip_clk_inv_lsb 0 ++#define p_reg_ts_clk_inv 0xD821 ++#define reg_ts_clk_inv_pos 0 ++#define reg_ts_clk_inv_len 1 ++#define reg_ts_clk_inv_lsb 0 ++#define p_reg_ts_hybrid 0xD822 ++#define reg_ts_hybrid_pos 0 ++#define reg_ts_hybrid_len 1 ++#define reg_ts_hybrid_lsb 0 ++#define p_reg_ccir_sel 0xD823 ++#define reg_ccir_sel_pos 0 ++#define reg_ccir_sel_len 4 ++#define reg_ccir_sel_lsb 0 ++#define p_reg_top_sys_gate 0xD824 ++#define reg_top_sys_gate_pos 0 ++#define reg_top_sys_gate_len 1 ++#define reg_top_sys_gate_lsb 0 ++#define p_reg_top_padpu 0xD825 ++#define reg_top_padpu_pos 0 ++#define reg_top_padpu_len 1 ++#define reg_top_padpu_lsb 0 ++#define p_reg_top_padpd 0xD826 ++#define reg_top_padpd_pos 0 ++#define reg_top_padpd_len 1 ++#define reg_top_padpd_lsb 0 ++#define p_reg_top_padodpu 0xD827 ++#define reg_top_padodpu_pos 0 ++#define reg_top_padodpu_len 1 ++#define reg_top_padodpu_lsb 0 ++#define p_reg_top_thirdodpu 0xD828 ++#define reg_top_thirdodpu_pos 0 ++#define reg_top_thirdodpu_len 1 ++#define reg_top_thirdodpu_lsb 0 ++#define p_reg_top_agc_od 0xD829 ++#define reg_top_agc_od_pos 0 ++#define reg_top_agc_od_len 1 ++#define reg_top_agc_od_lsb 0 ++#define p_reg_top_padmpdr2 0xD82A ++#define reg_top_padmpdr2_pos 0 ++#define reg_top_padmpdr2_len 1 ++#define reg_top_padmpdr2_lsb 0 ++#define p_reg_top_padmpdr4 0xD82B ++#define reg_top_padmpdr4_pos 0 ++#define reg_top_padmpdr4_len 1 ++#define reg_top_padmpdr4_lsb 0 ++#define p_reg_top_padmpdr8 0xD82C ++#define reg_top_padmpdr8_pos 0 ++#define reg_top_padmpdr8_len 1 ++#define reg_top_padmpdr8_lsb 0 ++#define p_reg_top_padmpdrsr 0xD82D ++#define reg_top_padmpdrsr_pos 0 ++#define reg_top_padmpdrsr_len 1 ++#define reg_top_padmpdrsr_lsb 0 ++#define p_reg_top_padmppu 0xD82E ++#define reg_top_padmppu_pos 0 ++#define reg_top_padmppu_len 1 ++#define reg_top_padmppu_lsb 0 ++#define p_reg_top_padmppd 0xD82F ++#define reg_top_padmppd_pos 0 ++#define reg_top_padmppd_len 1 ++#define reg_top_padmppd_lsb 0 ++#define p_reg_top_padmiscdr2 0xD830 ++#define reg_top_padmiscdr2_pos 0 ++#define reg_top_padmiscdr2_len 1 ++#define reg_top_padmiscdr2_lsb 0 ++#define p_reg_top_padmiscdr4 0xD831 ++#define reg_top_padmiscdr4_pos 0 ++#define reg_top_padmiscdr4_len 1 ++#define reg_top_padmiscdr4_lsb 0 ++#define p_reg_top_padmiscdr8 0xD832 ++#define reg_top_padmiscdr8_pos 0 ++#define reg_top_padmiscdr8_len 1 ++#define reg_top_padmiscdr8_lsb 0 ++#define p_reg_top_padmiscdrsr 0xD833 ++#define reg_top_padmiscdrsr_pos 0 ++#define reg_top_padmiscdrsr_len 1 ++#define reg_top_padmiscdrsr_lsb 0 ++#define p_reg_top_padmiscpu 0xD834 ++#define reg_top_padmiscpu_pos 0 ++#define reg_top_padmiscpu_len 1 ++#define reg_top_padmiscpu_lsb 0 ++#define p_reg_top_padmiscpd 0xD835 ++#define reg_top_padmiscpd_pos 0 ++#define reg_top_padmiscpd_len 1 ++#define reg_top_padmiscpd_lsb 0 ++#define p_reg_host_b0_smt 0xD836 ++#define reg_host_b0_smt_pos 0 ++#define reg_host_b0_smt_len 1 ++#define reg_host_b0_smt_lsb 0 ++#define p_reg_host_b1_smt 0xD837 ++#define reg_host_b1_smt_pos 0 ++#define reg_host_b1_smt_len 1 ++#define reg_host_b1_smt_lsb 0 ++#define p_reg_host_b2_smt 0xD838 ++#define reg_host_b2_smt_pos 0 ++#define reg_host_b2_smt_len 1 ++#define reg_host_b2_smt_lsb 0 ++#define p_reg_host_b3_smt 0xD839 ++#define reg_host_b3_smt_pos 0 ++#define reg_host_b3_smt_len 1 ++#define reg_host_b3_smt_lsb 0 ++#define p_reg_host_b4_smt 0xD83A ++#define reg_host_b4_smt_pos 0 ++#define reg_host_b4_smt_len 1 ++#define reg_host_b4_smt_lsb 0 ++#define p_reg_host_b5_smt 0xD83B ++#define reg_host_b5_smt_pos 0 ++#define reg_host_b5_smt_len 1 ++#define reg_host_b5_smt_lsb 0 ++#define p_reg_host_b6_smt 0xD83C ++#define reg_host_b6_smt_pos 0 ++#define reg_host_b6_smt_len 1 ++#define reg_host_b6_smt_lsb 0 ++#define p_reg_host_b7_smt 0xD83D ++#define reg_host_b7_smt_pos 0 ++#define reg_host_b7_smt_len 1 ++#define reg_host_b7_smt_lsb 0 ++#define p_reg_host_b8_smt 0xD83E ++#define reg_host_b8_smt_pos 0 ++#define reg_host_b8_smt_len 1 ++#define reg_host_b8_smt_lsb 0 ++#define p_reg_host_b9_smt 0xD83F ++#define reg_host_b9_smt_pos 0 ++#define reg_host_b9_smt_len 1 ++#define reg_host_b9_smt_lsb 0 ++#define p_reg_host_b10_smt 0xD840 ++#define reg_host_b10_smt_pos 0 ++#define reg_host_b10_smt_len 1 ++#define reg_host_b10_smt_lsb 0 ++#define p_reg_host_b11_smt 0xD841 ++#define reg_host_b11_smt_pos 0 ++#define reg_host_b11_smt_len 1 ++#define reg_host_b11_smt_lsb 0 ++#define p_reg_host_a0_smt 0xD842 ++#define reg_host_a0_smt_pos 0 ++#define reg_host_a0_smt_len 1 ++#define reg_host_a0_smt_lsb 0 ++#define p_reg_host_a1_smt 0xD843 ++#define reg_host_a1_smt_pos 0 ++#define reg_host_a1_smt_len 1 ++#define reg_host_a1_smt_lsb 0 ++#define p_reg_host_a2_smt 0xD844 ++#define reg_host_a2_smt_pos 0 ++#define reg_host_a2_smt_len 1 ++#define reg_host_a2_smt_lsb 0 ++#define p_reg_host_a3_smt 0xD845 ++#define reg_host_a3_smt_pos 0 ++#define reg_host_a3_smt_len 1 ++#define reg_host_a3_smt_lsb 0 ++#define p_reg_host_a4_smt 0xD846 ++#define reg_host_a4_smt_pos 0 ++#define reg_host_a4_smt_len 1 ++#define reg_host_a4_smt_lsb 0 ++#define p_reg_host_a5_smt 0xD847 ++#define reg_host_a5_smt_pos 0 ++#define reg_host_a5_smt_len 1 ++#define reg_host_a5_smt_lsb 0 ++#define p_reg_host_a6_smt 0xD848 ++#define reg_host_a6_smt_pos 0 ++#define reg_host_a6_smt_len 1 ++#define reg_host_a6_smt_lsb 0 ++#define p_reg_host_a7_smt 0xD849 ++#define reg_host_a7_smt_pos 0 ++#define reg_host_a7_smt_len 1 ++#define reg_host_a7_smt_lsb 0 ++#define p_reg_host_a8_smt 0xD84A ++#define reg_host_a8_smt_pos 0 ++#define reg_host_a8_smt_len 1 ++#define reg_host_a8_smt_lsb 0 ++#define p_reg_host_a9_smt 0xD84B ++#define reg_host_a9_smt_pos 0 ++#define reg_host_a9_smt_len 1 ++#define reg_host_a9_smt_lsb 0 ++#define p_reg_host_a10_smt 0xD84C ++#define reg_host_a10_smt_pos 0 ++#define reg_host_a10_smt_len 1 ++#define reg_host_a10_smt_lsb 0 ++#define p_reg_host_a11_smt 0xD84D ++#define reg_host_a11_smt_pos 0 ++#define reg_host_a11_smt_len 1 ++#define reg_host_a11_smt_lsb 0 ++#define p_reg_testmode_pds 0xD84E ++#define reg_testmode_pds_pos 0 ++#define reg_testmode_pds_len 3 ++#define reg_testmode_pds_lsb 0 ++#define p_reg_debug31_pds 0xD84F ++#define reg_debug31_pds_pos 0 ++#define reg_debug31_pds_len 3 ++#define reg_debug31_pds_lsb 0 ++#define p_reg_debug30_pds 0xD850 ++#define reg_debug30_pds_pos 0 ++#define reg_debug30_pds_len 3 ++#define reg_debug30_pds_lsb 0 ++#define p_reg_debug29_pds 0xD851 ++#define reg_debug29_pds_pos 0 ++#define reg_debug29_pds_len 3 ++#define reg_debug29_pds_lsb 0 ++#define p_reg_debug28_pds 0xD852 ++#define reg_debug28_pds_pos 0 ++#define reg_debug28_pds_len 3 ++#define reg_debug28_pds_lsb 0 ++#define p_reg_debug27_pds 0xD853 ++#define reg_debug27_pds_pos 0 ++#define reg_debug27_pds_len 3 ++#define reg_debug27_pds_lsb 0 ++#define p_reg_debug26_pds 0xD854 ++#define reg_debug26_pds_pos 0 ++#define reg_debug26_pds_len 3 ++#define reg_debug26_pds_lsb 0 ++#define p_reg_debug25_pds 0xD855 ++#define reg_debug25_pds_pos 0 ++#define reg_debug25_pds_len 3 ++#define reg_debug25_pds_lsb 0 ++#define p_reg_debug24_pds 0xD856 ++#define reg_debug24_pds_pos 0 ++#define reg_debug24_pds_len 3 ++#define reg_debug24_pds_lsb 0 ++#define p_reg_debug23_pds 0xD857 ++#define reg_debug23_pds_pos 0 ++#define reg_debug23_pds_len 3 ++#define reg_debug23_pds_lsb 0 ++#define p_reg_debug22_pds 0xD858 ++#define reg_debug22_pds_pos 0 ++#define reg_debug22_pds_len 3 ++#define reg_debug22_pds_lsb 0 ++#define p_reg_gpioh1_pds 0xD859 ++#define reg_gpioh1_pds_pos 0 ++#define reg_gpioh1_pds_len 3 ++#define reg_gpioh1_pds_lsb 0 ++#define p_reg_gpioh2_pds 0xD85A ++#define reg_gpioh2_pds_pos 0 ++#define reg_gpioh2_pds_len 3 ++#define reg_gpioh2_pds_lsb 0 ++#define p_reg_gpioh3_pds 0xD85B ++#define reg_gpioh3_pds_pos 0 ++#define reg_gpioh3_pds_len 3 ++#define reg_gpioh3_pds_lsb 0 ++#define p_reg_gpioh4_pds 0xD85C ++#define reg_gpioh4_pds_pos 0 ++#define reg_gpioh4_pds_len 3 ++#define reg_gpioh4_pds_lsb 0 ++#define p_reg_iosda_pds 0xD85D ++#define reg_iosda_pds_pos 0 ++#define reg_iosda_pds_len 3 ++#define reg_iosda_pds_lsb 0 ++#define p_reg_ioscl_pds 0xD85E ++#define reg_ioscl_pds_pos 0 ++#define reg_ioscl_pds_len 3 ++#define reg_ioscl_pds_lsb 0 ++#define p_reg_gpioh5_pds 0xD85F ++#define reg_gpioh5_pds_pos 0 ++#define reg_gpioh5_pds_len 3 ++#define reg_gpioh5_pds_lsb 0 ++#define p_reg_bond0_pds 0xD860 ++#define reg_bond0_pds_pos 0 ++#define reg_bond0_pds_len 3 ++#define reg_bond0_pds_lsb 0 ++#define p_reg_i2caddr6_pds 0xD861 ++#define reg_i2caddr6_pds_pos 0 ++#define reg_i2caddr6_pds_len 3 ++#define reg_i2caddr6_pds_lsb 0 ++#define p_reg_i2caddr5_pds 0xD862 ++#define reg_i2caddr5_pds_pos 0 ++#define reg_i2caddr5_pds_len 3 ++#define reg_i2caddr5_pds_lsb 0 ++#define p_reg_i2caddr4_pds 0xD863 ++#define reg_i2caddr4_pds_pos 0 ++#define reg_i2caddr4_pds_len 3 ++#define reg_i2caddr4_pds_lsb 0 ++#define p_reg_host_a0_pds 0xD864 ++#define reg_host_a0_pds_pos 0 ++#define reg_host_a0_pds_len 3 ++#define reg_host_a0_pds_lsb 0 ++#define p_reg_host_a1_pds 0xD865 ++#define reg_host_a1_pds_pos 0 ++#define reg_host_a1_pds_len 3 ++#define reg_host_a1_pds_lsb 0 ++#define p_reg_debug21_pds 0xD866 ++#define reg_debug21_pds_pos 0 ++#define reg_debug21_pds_len 3 ++#define reg_debug21_pds_lsb 0 ++#define p_reg_debug20_pds 0xD867 ++#define reg_debug20_pds_pos 0 ++#define reg_debug20_pds_len 3 ++#define reg_debug20_pds_lsb 0 ++#define p_reg_debug19_pds 0xD868 ++#define reg_debug19_pds_pos 0 ++#define reg_debug19_pds_len 3 ++#define reg_debug19_pds_lsb 0 ++#define p_reg_debug18_pds 0xD869 ++#define reg_debug18_pds_pos 0 ++#define reg_debug18_pds_len 3 ++#define reg_debug18_pds_lsb 0 ++#define p_reg_debug17_pds 0xD86A ++#define reg_debug17_pds_pos 0 ++#define reg_debug17_pds_len 3 ++#define reg_debug17_pds_lsb 0 ++#define p_reg_host_a2_pds 0xD86B ++#define reg_host_a2_pds_pos 0 ++#define reg_host_a2_pds_len 3 ++#define reg_host_a2_pds_lsb 0 ++#define p_reg_host_a3_pds 0xD86C ++#define reg_host_a3_pds_pos 0 ++#define reg_host_a3_pds_len 3 ++#define reg_host_a3_pds_lsb 0 ++#define p_reg_host_a4_pds 0xD86D ++#define reg_host_a4_pds_pos 0 ++#define reg_host_a4_pds_len 3 ++#define reg_host_a4_pds_lsb 0 ++#define p_reg_host_a5_pds 0xD86E ++#define reg_host_a5_pds_pos 0 ++#define reg_host_a5_pds_len 3 ++#define reg_host_a5_pds_lsb 0 ++#define p_reg_host_a6_pds 0xD86F ++#define reg_host_a6_pds_pos 0 ++#define reg_host_a6_pds_len 3 ++#define reg_host_a6_pds_lsb 0 ++#define p_reg_p160sel_pds 0xD870 ++#define reg_p160sel_pds_pos 0 ++#define reg_p160sel_pds_len 3 ++#define reg_p160sel_pds_lsb 0 ++#define p_reg_gpioh13_pds 0xD871 ++#define reg_gpioh13_pds_pos 0 ++#define reg_gpioh13_pds_len 3 ++#define reg_gpioh13_pds_lsb 0 ++#define p_reg_gpioh12_pds 0xD872 ++#define reg_gpioh12_pds_pos 0 ++#define reg_gpioh12_pds_len 3 ++#define reg_gpioh12_pds_lsb 0 ++#define p_reg_gpioh11_pds 0xD873 ++#define reg_gpioh11_pds_pos 0 ++#define reg_gpioh11_pds_len 3 ++#define reg_gpioh11_pds_lsb 0 ++#define p_reg_host_a7_pds 0xD874 ++#define reg_host_a7_pds_pos 0 ++#define reg_host_a7_pds_len 3 ++#define reg_host_a7_pds_lsb 0 ++#define p_reg_host_a8_pds 0xD875 ++#define reg_host_a8_pds_pos 0 ++#define reg_host_a8_pds_len 3 ++#define reg_host_a8_pds_lsb 0 ++#define p_reg_host_a9_pds 0xD876 ++#define reg_host_a9_pds_pos 0 ++#define reg_host_a9_pds_len 3 ++#define reg_host_a9_pds_lsb 0 ++#define p_reg_host_a10_pds 0xD877 ++#define reg_host_a10_pds_pos 0 ++#define reg_host_a10_pds_len 3 ++#define reg_host_a10_pds_lsb 0 ++#define p_reg_host_a11_pds 0xD878 ++#define reg_host_a11_pds_pos 0 ++#define reg_host_a11_pds_len 3 ++#define reg_host_a11_pds_lsb 0 ++#define p_reg_bondu0_pds 0xD879 ++#define reg_bondu0_pds_pos 0 ++#define reg_bondu0_pds_len 3 ++#define reg_bondu0_pds_lsb 0 ++#define p_reg_host_b0_pds 0xD87A ++#define reg_host_b0_pds_pos 0 ++#define reg_host_b0_pds_len 3 ++#define reg_host_b0_pds_lsb 0 ++#define p_reg_host_b1_pds 0xD87B ++#define reg_host_b1_pds_pos 0 ++#define reg_host_b1_pds_len 3 ++#define reg_host_b1_pds_lsb 0 ++#define p_reg_host_b2_pds 0xD87C ++#define reg_host_b2_pds_pos 0 ++#define reg_host_b2_pds_len 3 ++#define reg_host_b2_pds_lsb 0 ++#define p_reg_host_b3_pds 0xD87D ++#define reg_host_b3_pds_pos 0 ++#define reg_host_b3_pds_len 3 ++#define reg_host_b3_pds_lsb 0 ++#define p_reg_host_b4_pds 0xD87E ++#define reg_host_b4_pds_pos 0 ++#define reg_host_b4_pds_len 3 ++#define reg_host_b4_pds_lsb 0 ++#define p_reg_host_b5_pds 0xD87F ++#define reg_host_b5_pds_pos 0 ++#define reg_host_b5_pds_len 3 ++#define reg_host_b5_pds_lsb 0 ++#define p_reg_host_b6_pds 0xD880 ++#define reg_host_b6_pds_pos 0 ++#define reg_host_b6_pds_len 3 ++#define reg_host_b6_pds_lsb 0 ++#define p_reg_host_b7_pds 0xD881 ++#define reg_host_b7_pds_pos 0 ++#define reg_host_b7_pds_len 3 ++#define reg_host_b7_pds_lsb 0 ++#define p_reg_afe_f12_pds 0xD882 ++#define reg_afe_f12_pds_pos 0 ++#define reg_afe_f12_pds_len 3 ++#define reg_afe_f12_pds_lsb 0 ++#define p_reg_host_b8_pds 0xD883 ++#define reg_host_b8_pds_pos 0 ++#define reg_host_b8_pds_len 3 ++#define reg_host_b8_pds_lsb 0 ++#define p_reg_host_b9_pds 0xD884 ++#define reg_host_b9_pds_pos 0 ++#define reg_host_b9_pds_len 3 ++#define reg_host_b9_pds_lsb 0 ++#define p_reg_host_b10_pds 0xD885 ++#define reg_host_b10_pds_pos 0 ++#define reg_host_b10_pds_len 3 ++#define reg_host_b10_pds_lsb 0 ++#define p_reg_host_b11_pds 0xD886 ++#define reg_host_b11_pds_pos 0 ++#define reg_host_b11_pds_len 3 ++#define reg_host_b11_pds_lsb 0 ++#define p_reg_debug16_pds 0xD887 ++#define reg_debug16_pds_pos 0 ++#define reg_debug16_pds_len 3 ++#define reg_debug16_pds_lsb 0 ++#define p_reg_debug15_pds 0xD888 ++#define reg_debug15_pds_pos 0 ++#define reg_debug15_pds_len 3 ++#define reg_debug15_pds_lsb 0 ++#define p_reg_debug14_pds 0xD889 ++#define reg_debug14_pds_pos 0 ++#define reg_debug14_pds_len 3 ++#define reg_debug14_pds_lsb 0 ++#define p_reg_debug13_pds 0xD88A ++#define reg_debug13_pds_pos 0 ++#define reg_debug13_pds_len 3 ++#define reg_debug13_pds_lsb 0 ++#define p_reg_debug12_pds 0xD88B ++#define reg_debug12_pds_pos 0 ++#define reg_debug12_pds_len 3 ++#define reg_debug12_pds_lsb 0 ++#define p_reg_debug11_pds 0xD88C ++#define reg_debug11_pds_pos 0 ++#define reg_debug11_pds_len 3 ++#define reg_debug11_pds_lsb 0 ++#define p_reg_debug10_pds 0xD88D ++#define reg_debug10_pds_pos 0 ++#define reg_debug10_pds_len 3 ++#define reg_debug10_pds_lsb 0 ++#define p_reg_debug9_pds 0xD88E ++#define reg_debug9_pds_pos 0 ++#define reg_debug9_pds_len 3 ++#define reg_debug9_pds_lsb 0 ++#define p_reg_debug8_pds 0xD88F ++#define reg_debug8_pds_pos 0 ++#define reg_debug8_pds_len 3 ++#define reg_debug8_pds_lsb 0 ++#define p_reg_debug7_pds 0xD890 ++#define reg_debug7_pds_pos 0 ++#define reg_debug7_pds_len 3 ++#define reg_debug7_pds_lsb 0 ++#define p_reg_debug6_pds 0xD891 ++#define reg_debug6_pds_pos 0 ++#define reg_debug6_pds_len 3 ++#define reg_debug6_pds_lsb 0 ++#define p_reg_debug5_pds 0xD892 ++#define reg_debug5_pds_pos 0 ++#define reg_debug5_pds_len 3 ++#define reg_debug5_pds_lsb 0 ++#define p_reg_debug4_pds 0xD893 ++#define reg_debug4_pds_pos 0 ++#define reg_debug4_pds_len 3 ++#define reg_debug4_pds_lsb 0 ++#define p_reg_clko_pds 0xD894 ++#define reg_clko_pds_pos 0 ++#define reg_clko_pds_len 3 ++#define reg_clko_pds_lsb 0 ++#define p_reg_gpioh6_pds 0xD895 ++#define reg_gpioh6_pds_pos 0 ++#define reg_gpioh6_pds_len 3 ++#define reg_gpioh6_pds_lsb 0 ++#define p_reg_gpioh7_pds 0xD896 ++#define reg_gpioh7_pds_pos 0 ++#define reg_gpioh7_pds_len 3 ++#define reg_gpioh7_pds_lsb 0 ++#define p_reg_gpioh8_pds 0xD897 ++#define reg_gpioh8_pds_pos 0 ++#define reg_gpioh8_pds_len 3 ++#define reg_gpioh8_pds_lsb 0 ++#define p_reg_gpioh9_pds 0xD898 ++#define reg_gpioh9_pds_pos 0 ++#define reg_gpioh9_pds_len 3 ++#define reg_gpioh9_pds_lsb 0 ++#define p_reg_gpioh10_pds 0xD899 ++#define reg_gpioh10_pds_pos 0 ++#define reg_gpioh10_pds_len 3 ++#define reg_gpioh10_pds_lsb 0 ++#define p_reg_debug3_pds 0xD89A ++#define reg_debug3_pds_pos 0 ++#define reg_debug3_pds_len 3 ++#define reg_debug3_pds_lsb 0 ++#define p_reg_debug2_pds 0xD89B ++#define reg_debug2_pds_pos 0 ++#define reg_debug2_pds_len 3 ++#define reg_debug2_pds_lsb 0 ++#define p_reg_debug1_pds 0xD89C ++#define reg_debug1_pds_pos 0 ++#define reg_debug1_pds_len 3 ++#define reg_debug1_pds_lsb 0 ++#define p_reg_debug0_pds 0xD89D ++#define reg_debug0_pds_pos 0 ++#define reg_debug0_pds_len 3 ++#define reg_debug0_pds_lsb 0 ++#define p_reg_gpiot1_pds 0xD89E ++#define reg_gpiot1_pds_pos 0 ++#define reg_gpiot1_pds_len 3 ++#define reg_gpiot1_pds_lsb 0 ++#define p_reg_gpiot2_pds 0xD89F ++#define reg_gpiot2_pds_pos 0 ++#define reg_gpiot2_pds_len 3 ++#define reg_gpiot2_pds_lsb 0 ++#define p_reg_rfagc_pds 0xD8A0 ++#define reg_rfagc_pds_pos 0 ++#define reg_rfagc_pds_len 3 ++#define reg_rfagc_pds_lsb 0 ++#define p_reg_ifagc_pds 0xD8A1 ++#define reg_ifagc_pds_pos 0 ++#define reg_ifagc_pds_len 3 ++#define reg_ifagc_pds_lsb 0 ++#define p_reg_gpiot3_pds 0xD8A2 ++#define reg_gpiot3_pds_pos 0 ++#define reg_gpiot3_pds_len 3 ++#define reg_gpiot3_pds_lsb 0 ++#define p_reg_i2caddr3_pds 0xD8A3 ++#define reg_i2caddr3_pds_pos 0 ++#define reg_i2caddr3_pds_len 3 ++#define reg_i2caddr3_pds_lsb 0 ++#define p_reg_i2caddr2_pds 0xD8A4 ++#define reg_i2caddr2_pds_pos 0 ++#define reg_i2caddr2_pds_len 3 ++#define reg_i2caddr2_pds_lsb 0 ++#define p_reg_i2caddr1_pds 0xD8A5 ++#define reg_i2caddr1_pds_pos 0 ++#define reg_i2caddr1_pds_len 3 ++#define reg_i2caddr1_pds_lsb 0 ++#define p_reg_afe_sel33_pds 0xD8A6 ++#define reg_afe_sel33_pds_pos 0 ++#define reg_afe_sel33_pds_len 3 ++#define reg_afe_sel33_pds_lsb 0 ++#define p_reg_iotunscl_pds 0xD8A7 ++#define reg_iotunscl_pds_pos 0 ++#define reg_iotunscl_pds_len 3 ++#define reg_iotunscl_pds_lsb 0 ++#define p_reg_iotunsda_pds 0xD8A8 ++#define reg_iotunsda_pds_pos 0 ++#define reg_iotunsda_pds_len 3 ++#define reg_iotunsda_pds_lsb 0 ++#define p_reg_rxdofsm_pds 0xD8A9 ++#define reg_rxdofsm_pds_pos 0 ++#define reg_rxdofsm_pds_len 3 ++#define reg_rxdofsm_pds_lsb 0 ++#define p_reg_txdofsm_pds 0xD8AA ++#define reg_txdofsm_pds_pos 0 ++#define reg_txdofsm_pds_len 3 ++#define reg_txdofsm_pds_lsb 0 ++#define p_reg_rxdlink_pds 0xD8AB ++#define reg_rxdlink_pds_pos 0 ++#define reg_rxdlink_pds_len 3 ++#define reg_rxdlink_pds_lsb 0 ++#define p_reg_txdlink_pds 0xD8AC ++#define reg_txdlink_pds_pos 0 ++#define reg_txdlink_pds_len 3 ++#define reg_txdlink_pds_lsb 0 ++#define p_reg_ck_test_pds 0xD8AD ++#define reg_ck_test_pds_pos 0 ++#define reg_ck_test_pds_len 3 ++#define reg_ck_test_pds_lsb 0 ++#define r_reg_top_gpioh1_i 0xD8AE ++#define reg_top_gpioh1_i_pos 0 ++#define reg_top_gpioh1_i_len 1 ++#define reg_top_gpioh1_i_lsb 0 ++#define p_reg_top_gpioh1_o 0xD8AF ++#define reg_top_gpioh1_o_pos 0 ++#define reg_top_gpioh1_o_len 1 ++#define reg_top_gpioh1_o_lsb 0 ++#define p_reg_top_gpioh1_en 0xD8B0 ++#define reg_top_gpioh1_en_pos 0 ++#define reg_top_gpioh1_en_len 1 ++#define reg_top_gpioh1_en_lsb 0 ++#define p_reg_top_gpioh1_on 0xD8B1 ++#define reg_top_gpioh1_on_pos 0 ++#define reg_top_gpioh1_on_len 1 ++#define reg_top_gpioh1_on_lsb 0 ++#define r_reg_top_gpioh3_i 0xD8B2 ++#define reg_top_gpioh3_i_pos 0 ++#define reg_top_gpioh3_i_len 1 ++#define reg_top_gpioh3_i_lsb 0 ++#define p_reg_top_gpioh3_o 0xD8B3 ++#define reg_top_gpioh3_o_pos 0 ++#define reg_top_gpioh3_o_len 1 ++#define reg_top_gpioh3_o_lsb 0 ++#define p_reg_top_gpioh3_en 0xD8B4 ++#define reg_top_gpioh3_en_pos 0 ++#define reg_top_gpioh3_en_len 1 ++#define reg_top_gpioh3_en_lsb 0 ++#define p_reg_top_gpioh3_on 0xD8B5 ++#define reg_top_gpioh3_on_pos 0 ++#define reg_top_gpioh3_on_len 1 ++#define reg_top_gpioh3_on_lsb 0 ++#define r_reg_top_gpioh2_i 0xD8B6 ++#define reg_top_gpioh2_i_pos 0 ++#define reg_top_gpioh2_i_len 1 ++#define reg_top_gpioh2_i_lsb 0 ++#define p_reg_top_gpioh2_o 0xD8B7 ++#define reg_top_gpioh2_o_pos 0 ++#define reg_top_gpioh2_o_len 1 ++#define reg_top_gpioh2_o_lsb 0 ++#define p_reg_top_gpioh2_en 0xD8B8 ++#define reg_top_gpioh2_en_pos 0 ++#define reg_top_gpioh2_en_len 1 ++#define reg_top_gpioh2_en_lsb 0 ++#define p_reg_top_gpioh2_on 0xD8B9 ++#define reg_top_gpioh2_on_pos 0 ++#define reg_top_gpioh2_on_len 1 ++#define reg_top_gpioh2_on_lsb 0 ++#define r_reg_top_gpioh5_i 0xD8BA ++#define reg_top_gpioh5_i_pos 0 ++#define reg_top_gpioh5_i_len 1 ++#define reg_top_gpioh5_i_lsb 0 ++#define p_reg_top_gpioh5_o 0xD8BB ++#define reg_top_gpioh5_o_pos 0 ++#define reg_top_gpioh5_o_len 1 ++#define reg_top_gpioh5_o_lsb 0 ++#define p_reg_top_gpioh5_en 0xD8BC ++#define reg_top_gpioh5_en_pos 0 ++#define reg_top_gpioh5_en_len 1 ++#define reg_top_gpioh5_en_lsb 0 ++#define p_reg_top_gpioh5_on 0xD8BD ++#define reg_top_gpioh5_on_pos 0 ++#define reg_top_gpioh5_on_len 1 ++#define reg_top_gpioh5_on_lsb 0 ++#define r_reg_top_gpioh4_i 0xD8BE ++#define reg_top_gpioh4_i_pos 0 ++#define reg_top_gpioh4_i_len 1 ++#define reg_top_gpioh4_i_lsb 0 ++#define p_reg_top_gpioh4_o 0xD8BF ++#define reg_top_gpioh4_o_pos 0 ++#define reg_top_gpioh4_o_len 1 ++#define reg_top_gpioh4_o_lsb 0 ++#define p_reg_top_gpioh4_en 0xD8C0 ++#define reg_top_gpioh4_en_pos 0 ++#define reg_top_gpioh4_en_len 1 ++#define reg_top_gpioh4_en_lsb 0 ++#define p_reg_top_gpioh4_on 0xD8C1 ++#define reg_top_gpioh4_on_pos 0 ++#define reg_top_gpioh4_on_len 1 ++#define reg_top_gpioh4_on_lsb 0 ++#define r_reg_top_gpioh7_i 0xD8C2 ++#define reg_top_gpioh7_i_pos 0 ++#define reg_top_gpioh7_i_len 1 ++#define reg_top_gpioh7_i_lsb 0 ++#define p_reg_top_gpioh7_o 0xD8C3 ++#define reg_top_gpioh7_o_pos 0 ++#define reg_top_gpioh7_o_len 1 ++#define reg_top_gpioh7_o_lsb 0 ++#define p_reg_top_gpioh7_en 0xD8C4 ++#define reg_top_gpioh7_en_pos 0 ++#define reg_top_gpioh7_en_len 1 ++#define reg_top_gpioh7_en_lsb 0 ++#define p_reg_top_gpioh7_on 0xD8C5 ++#define reg_top_gpioh7_on_pos 0 ++#define reg_top_gpioh7_on_len 1 ++#define reg_top_gpioh7_on_lsb 0 ++#define r_reg_top_gpioh6_i 0xD8C6 ++#define reg_top_gpioh6_i_pos 0 ++#define reg_top_gpioh6_i_len 1 ++#define reg_top_gpioh6_i_lsb 0 ++#define p_reg_top_gpioh6_o 0xD8C7 ++#define reg_top_gpioh6_o_pos 0 ++#define reg_top_gpioh6_o_len 1 ++#define reg_top_gpioh6_o_lsb 0 ++#define p_reg_top_gpioh6_en 0xD8C8 ++#define reg_top_gpioh6_en_pos 0 ++#define reg_top_gpioh6_en_len 1 ++#define reg_top_gpioh6_en_lsb 0 ++#define p_reg_top_gpioh6_on 0xD8C9 ++#define reg_top_gpioh6_on_pos 0 ++#define reg_top_gpioh6_on_len 1 ++#define reg_top_gpioh6_on_lsb 0 ++#define r_reg_top_gpioh9_i 0xD8CA ++#define reg_top_gpioh9_i_pos 0 ++#define reg_top_gpioh9_i_len 1 ++#define reg_top_gpioh9_i_lsb 0 ++#define p_reg_top_gpioh9_o 0xD8CB ++#define reg_top_gpioh9_o_pos 0 ++#define reg_top_gpioh9_o_len 1 ++#define reg_top_gpioh9_o_lsb 0 ++#define p_reg_top_gpioh9_en 0xD8CC ++#define reg_top_gpioh9_en_pos 0 ++#define reg_top_gpioh9_en_len 1 ++#define reg_top_gpioh9_en_lsb 0 ++#define p_reg_top_gpioh9_on 0xD8CD ++#define reg_top_gpioh9_on_pos 0 ++#define reg_top_gpioh9_on_len 1 ++#define reg_top_gpioh9_on_lsb 0 ++#define r_reg_top_gpioh8_i 0xD8CE ++#define reg_top_gpioh8_i_pos 0 ++#define reg_top_gpioh8_i_len 1 ++#define reg_top_gpioh8_i_lsb 0 ++#define p_reg_top_gpioh8_o 0xD8CF ++#define reg_top_gpioh8_o_pos 0 ++#define reg_top_gpioh8_o_len 1 ++#define reg_top_gpioh8_o_lsb 0 ++#define p_reg_top_gpioh8_en 0xD8D0 ++#define reg_top_gpioh8_en_pos 0 ++#define reg_top_gpioh8_en_len 1 ++#define reg_top_gpioh8_en_lsb 0 ++#define p_reg_top_gpioh8_on 0xD8D1 ++#define reg_top_gpioh8_on_pos 0 ++#define reg_top_gpioh8_on_len 1 ++#define reg_top_gpioh8_on_lsb 0 ++#define r_reg_top_gpioh11_i 0xD8D2 ++#define reg_top_gpioh11_i_pos 0 ++#define reg_top_gpioh11_i_len 1 ++#define reg_top_gpioh11_i_lsb 0 ++#define p_reg_top_gpioh11_o 0xD8D3 ++#define reg_top_gpioh11_o_pos 0 ++#define reg_top_gpioh11_o_len 1 ++#define reg_top_gpioh11_o_lsb 0 ++#define p_reg_top_gpioh11_en 0xD8D4 ++#define reg_top_gpioh11_en_pos 0 ++#define reg_top_gpioh11_en_len 1 ++#define reg_top_gpioh11_en_lsb 0 ++#define p_reg_top_gpioh11_on 0xD8D5 ++#define reg_top_gpioh11_on_pos 0 ++#define reg_top_gpioh11_on_len 1 ++#define reg_top_gpioh11_on_lsb 0 ++#define r_reg_top_gpioh10_i 0xD8D6 ++#define reg_top_gpioh10_i_pos 0 ++#define reg_top_gpioh10_i_len 1 ++#define reg_top_gpioh10_i_lsb 0 ++#define p_reg_top_gpioh10_o 0xD8D7 ++#define reg_top_gpioh10_o_pos 0 ++#define reg_top_gpioh10_o_len 1 ++#define reg_top_gpioh10_o_lsb 0 ++#define p_reg_top_gpioh10_en 0xD8D8 ++#define reg_top_gpioh10_en_pos 0 ++#define reg_top_gpioh10_en_len 1 ++#define reg_top_gpioh10_en_lsb 0 ++#define p_reg_top_gpioh10_on 0xD8D9 ++#define reg_top_gpioh10_on_pos 0 ++#define reg_top_gpioh10_on_len 1 ++#define reg_top_gpioh10_on_lsb 0 ++#define r_reg_top_gpioh13_i 0xD8DA ++#define reg_top_gpioh13_i_pos 0 ++#define reg_top_gpioh13_i_len 1 ++#define reg_top_gpioh13_i_lsb 0 ++#define p_reg_top_gpioh13_o 0xD8DB ++#define reg_top_gpioh13_o_pos 0 ++#define reg_top_gpioh13_o_len 1 ++#define reg_top_gpioh13_o_lsb 0 ++#define p_reg_top_gpioh13_en 0xD8DC ++#define reg_top_gpioh13_en_pos 0 ++#define reg_top_gpioh13_en_len 1 ++#define reg_top_gpioh13_en_lsb 0 ++#define p_reg_top_gpioh13_on 0xD8DD ++#define reg_top_gpioh13_on_pos 0 ++#define reg_top_gpioh13_on_len 1 ++#define reg_top_gpioh13_on_lsb 0 ++#define r_reg_top_gpioh12_i 0xD8DE ++#define reg_top_gpioh12_i_pos 0 ++#define reg_top_gpioh12_i_len 1 ++#define reg_top_gpioh12_i_lsb 0 ++#define p_reg_top_gpioh12_o 0xD8DF ++#define reg_top_gpioh12_o_pos 0 ++#define reg_top_gpioh12_o_len 1 ++#define reg_top_gpioh12_o_lsb 0 ++#define p_reg_top_gpioh12_en 0xD8E0 ++#define reg_top_gpioh12_en_pos 0 ++#define reg_top_gpioh12_en_len 1 ++#define reg_top_gpioh12_en_lsb 0 ++#define p_reg_top_gpioh12_on 0xD8E1 ++#define reg_top_gpioh12_on_pos 0 ++#define reg_top_gpioh12_on_len 1 ++#define reg_top_gpioh12_on_lsb 0 ++#define r_reg_top_gpiot1_i 0xD8E2 ++#define reg_top_gpiot1_i_pos 0 ++#define reg_top_gpiot1_i_len 1 ++#define reg_top_gpiot1_i_lsb 0 ++#define p_reg_top_gpiot1_o 0xD8E3 ++#define reg_top_gpiot1_o_pos 0 ++#define reg_top_gpiot1_o_len 1 ++#define reg_top_gpiot1_o_lsb 0 ++#define p_reg_top_gpiot1_en 0xD8E4 ++#define reg_top_gpiot1_en_pos 0 ++#define reg_top_gpiot1_en_len 1 ++#define reg_top_gpiot1_en_lsb 0 ++#define p_reg_top_gpiot1_on 0xD8E5 ++#define reg_top_gpiot1_on_pos 0 ++#define reg_top_gpiot1_on_len 1 ++#define reg_top_gpiot1_on_lsb 0 ++#define r_reg_top_gpiot3_i 0xD8E6 ++#define reg_top_gpiot3_i_pos 0 ++#define reg_top_gpiot3_i_len 1 ++#define reg_top_gpiot3_i_lsb 0 ++#define p_reg_top_gpiot3_o 0xD8E7 ++#define reg_top_gpiot3_o_pos 0 ++#define reg_top_gpiot3_o_len 1 ++#define reg_top_gpiot3_o_lsb 0 ++#define p_reg_top_gpiot3_en 0xD8E8 ++#define reg_top_gpiot3_en_pos 0 ++#define reg_top_gpiot3_en_len 1 ++#define reg_top_gpiot3_en_lsb 0 ++#define p_reg_top_gpiot3_on 0xD8E9 ++#define reg_top_gpiot3_on_pos 0 ++#define reg_top_gpiot3_on_len 1 ++#define reg_top_gpiot3_on_lsb 0 ++#define r_reg_top_gpiot2_i 0xD8EA ++#define reg_top_gpiot2_i_pos 0 ++#define reg_top_gpiot2_i_len 1 ++#define reg_top_gpiot2_i_lsb 0 ++#define p_reg_top_gpiot2_o 0xD8EB ++#define reg_top_gpiot2_o_pos 0 ++#define reg_top_gpiot2_o_len 1 ++#define reg_top_gpiot2_o_lsb 0 ++#define p_reg_top_gpiot2_en 0xD8EC ++#define reg_top_gpiot2_en_pos 0 ++#define reg_top_gpiot2_en_len 1 ++#define reg_top_gpiot2_en_lsb 0 ++#define p_reg_top_gpiot2_on 0xD8ED ++#define reg_top_gpiot2_on_pos 0 ++#define reg_top_gpiot2_on_len 1 ++#define reg_top_gpiot2_on_lsb 0 ++#define p_reg_top_lock2_out 0xD8EE ++#define reg_top_lock2_out_pos 0 ++#define reg_top_lock2_out_len 1 ++#define reg_top_lock2_out_lsb 0 ++#define p_reg_top_lock2_tpsd 0xD8EF ++#define reg_top_lock2_tpsd_pos 0 ++#define reg_top_lock2_tpsd_len 1 ++#define reg_top_lock2_tpsd_lsb 0 ++#define p_reg_top_lock2_o 0xD8F0 ++#define reg_top_lock2_o_pos 0 ++#define reg_top_lock2_o_len 1 ++#define reg_top_lock2_o_lsb 0 ++#define p_reg_top_lock2_en 0xD8F1 ++#define reg_top_lock2_en_pos 0 ++#define reg_top_lock2_en_len 1 ++#define reg_top_lock2_en_lsb 0 ++#define p_reg_top_lock2_on 0xD8F2 ++#define reg_top_lock2_on_pos 0 ++#define reg_top_lock2_on_len 1 ++#define reg_top_lock2_on_lsb 0 ++#define p_reg_top_lock1_out 0xD8F3 ++#define reg_top_lock1_out_pos 0 ++#define reg_top_lock1_out_len 1 ++#define reg_top_lock1_out_lsb 0 ++#define p_reg_top_lock1_tpsd 0xD8F4 ++#define reg_top_lock1_tpsd_pos 0 ++#define reg_top_lock1_tpsd_len 1 ++#define reg_top_lock1_tpsd_lsb 0 ++#define p_reg_top_lock1_o 0xD8F5 ++#define reg_top_lock1_o_pos 0 ++#define reg_top_lock1_o_len 1 ++#define reg_top_lock1_o_lsb 0 ++#define p_reg_top_lock1_en 0xD8F6 ++#define reg_top_lock1_en_pos 0 ++#define reg_top_lock1_en_len 1 ++#define reg_top_lock1_en_lsb 0 ++#define p_reg_top_lock1_on 0xD8F7 ++#define reg_top_lock1_on_pos 0 ++#define reg_top_lock1_on_len 1 ++#define reg_top_lock1_on_lsb 0 ++#define p_reg_top_lock4_out 0xD8F8 ++#define reg_top_lock4_out_pos 0 ++#define reg_top_lock4_out_len 1 ++#define reg_top_lock4_out_lsb 0 ++#define p_reg_top_lock4_tpsd 0xD8F9 ++#define reg_top_lock4_tpsd_pos 0 ++#define reg_top_lock4_tpsd_len 1 ++#define reg_top_lock4_tpsd_lsb 0 ++#define p_reg_top_lock4_o 0xD8FA ++#define reg_top_lock4_o_pos 0 ++#define reg_top_lock4_o_len 1 ++#define reg_top_lock4_o_lsb 0 ++#define p_reg_top_lock4_en 0xD8FB ++#define reg_top_lock4_en_pos 0 ++#define reg_top_lock4_en_len 1 ++#define reg_top_lock4_en_lsb 0 ++#define p_reg_top_lock4_on 0xD8FC ++#define reg_top_lock4_on_pos 0 ++#define reg_top_lock4_on_len 1 ++#define reg_top_lock4_on_lsb 0 ++#define p_reg_top_lock3_out 0xD8FD ++#define reg_top_lock3_out_pos 0 ++#define reg_top_lock3_out_len 1 ++#define reg_top_lock3_out_lsb 0 ++#define p_reg_top_lock3_tpsd 0xD8FE ++#define reg_top_lock3_tpsd_pos 0 ++#define reg_top_lock3_tpsd_len 1 ++#define reg_top_lock3_tpsd_lsb 0 ++#define p_reg_top_lock3_o 0xD8FF ++#define reg_top_lock3_o_pos 0 ++#define reg_top_lock3_o_len 1 ++#define reg_top_lock3_o_lsb 0 ++#define p_reg_top_lock3_en 0xD900 ++#define reg_top_lock3_en_pos 0 ++#define reg_top_lock3_en_len 1 ++#define reg_top_lock3_en_lsb 0 ++#define p_reg_top_lock3_on 0xD901 ++#define reg_top_lock3_on_pos 0 ++#define reg_top_lock3_on_len 1 ++#define reg_top_lock3_on_lsb 0 ++#define p_reg_top_pwm0_en 0xD902 ++#define reg_top_pwm0_en_pos 0 ++#define reg_top_pwm0_en_len 1 ++#define reg_top_pwm0_en_lsb 0 ++#define p_reg_top_pwm1_en 0xD903 ++#define reg_top_pwm1_en_pos 0 ++#define reg_top_pwm1_en_len 1 ++#define reg_top_pwm1_en_lsb 0 ++#define p_reg_top_pwm2_en 0xD904 ++#define reg_top_pwm2_en_pos 0 ++#define reg_top_pwm2_en_len 1 ++#define reg_top_pwm2_en_lsb 0 ++#define p_reg_top_pwm3_en 0xD905 ++#define reg_top_pwm3_en_pos 0 ++#define reg_top_pwm3_en_len 1 ++#define reg_top_pwm3_en_lsb 0 ++#define p_reg_top_pwm0_gpio 0xD906 ++#define reg_top_pwm0_gpio_pos 0 ++#define reg_top_pwm0_gpio_len 1 ++#define reg_top_pwm0_gpio_lsb 0 ++#define p_reg_top_pwm0_pos 0xD907 ++#define reg_top_pwm0_pos_pos 0 ++#define reg_top_pwm0_pos_len 3 ++#define reg_top_pwm0_pos_lsb 0 ++#define p_reg_top_pwm0_width 0xD908 ++#define reg_top_pwm0_width_pos 0 ++#define reg_top_pwm0_width_len 2 ++#define reg_top_pwm0_width_lsb 0 ++#define p_reg_top_pwm0_duration 0xD909 ++#define reg_top_pwm0_duration_pos 0 ++#define reg_top_pwm0_duration_len 8 ++#define reg_top_pwm0_duration_lsb 0 ++#define p_reg_top_pwm1_gpio 0xD90A ++#define reg_top_pwm1_gpio_pos 0 ++#define reg_top_pwm1_gpio_len 1 ++#define reg_top_pwm1_gpio_lsb 0 ++#define p_reg_top_pwm1_pos 0xD90B ++#define reg_top_pwm1_pos_pos 0 ++#define reg_top_pwm1_pos_len 3 ++#define reg_top_pwm1_pos_lsb 0 ++#define p_reg_top_pwm1_width 0xD90C ++#define reg_top_pwm1_width_pos 0 ++#define reg_top_pwm1_width_len 2 ++#define reg_top_pwm1_width_lsb 0 ++#define p_reg_top_pwm1_duration 0xD90D ++#define reg_top_pwm1_duration_pos 0 ++#define reg_top_pwm1_duration_len 8 ++#define reg_top_pwm1_duration_lsb 0 ++#define p_reg_top_pwm2_gpio 0xD90E ++#define reg_top_pwm2_gpio_pos 0 ++#define reg_top_pwm2_gpio_len 1 ++#define reg_top_pwm2_gpio_lsb 0 ++#define p_reg_top_pwm2_pos 0xD90F ++#define reg_top_pwm2_pos_pos 0 ++#define reg_top_pwm2_pos_len 3 ++#define reg_top_pwm2_pos_lsb 0 ++#define p_reg_top_pwm2_width 0xD910 ++#define reg_top_pwm2_width_pos 0 ++#define reg_top_pwm2_width_len 2 ++#define reg_top_pwm2_width_lsb 0 ++#define p_reg_top_pwm2_duration 0xD911 ++#define reg_top_pwm2_duration_pos 0 ++#define reg_top_pwm2_duration_len 8 ++#define reg_top_pwm2_duration_lsb 0 ++#define p_reg_top_pwm3_gpio 0xD912 ++#define reg_top_pwm3_gpio_pos 0 ++#define reg_top_pwm3_gpio_len 1 ++#define reg_top_pwm3_gpio_lsb 0 ++#define p_reg_top_pwm3_pos 0xD913 ++#define reg_top_pwm3_pos_pos 0 ++#define reg_top_pwm3_pos_len 3 ++#define reg_top_pwm3_pos_lsb 0 ++#define p_reg_top_pwm3_width 0xD914 ++#define reg_top_pwm3_width_pos 0 ++#define reg_top_pwm3_width_len 2 ++#define reg_top_pwm3_width_lsb 0 ++#define p_reg_top_pwm3_duration 0xD915 ++#define reg_top_pwm3_duration_pos 0 ++#define reg_top_pwm3_duration_len 8 ++#define reg_top_pwm3_duration_lsb 0 ++#define p_reg_top_hosta_mpeg_par_mode 0xD916 ++#define reg_top_hosta_mpeg_par_mode_pos 0 ++#define reg_top_hosta_mpeg_par_mode_len 1 ++#define reg_top_hosta_mpeg_par_mode_lsb 0 ++#define p_reg_top_hosta_mpeg_ser_mode 0xD917 ++#define reg_top_hosta_mpeg_ser_mode_pos 0 ++#define reg_top_hosta_mpeg_ser_mode_len 1 ++#define reg_top_hosta_mpeg_ser_mode_lsb 0 ++#define p_reg_top_hosta_mpeg_ser_do7 0xD918 ++#define reg_top_hosta_mpeg_ser_do7_pos 0 ++#define reg_top_hosta_mpeg_ser_do7_len 1 ++#define reg_top_hosta_mpeg_ser_do7_lsb 0 ++#define p_reg_top_hosta_dca_upper 0xD919 ++#define reg_top_hosta_dca_upper_pos 0 ++#define reg_top_hosta_dca_upper_len 1 ++#define reg_top_hosta_dca_upper_lsb 0 ++#define p_reg_top_hosta_dca_lower 0xD91A ++#define reg_top_hosta_dca_lower_pos 0 ++#define reg_top_hosta_dca_lower_len 1 ++#define reg_top_hosta_dca_lower_lsb 0 ++#define p_reg_top_hostb_mpeg_par_mode 0xD91B ++#define reg_top_hostb_mpeg_par_mode_pos 0 ++#define reg_top_hostb_mpeg_par_mode_len 1 ++#define reg_top_hostb_mpeg_par_mode_lsb 0 ++#define p_reg_top_hostb_mpeg_ser_mode 0xD91C ++#define reg_top_hostb_mpeg_ser_mode_pos 0 ++#define reg_top_hostb_mpeg_ser_mode_len 1 ++#define reg_top_hostb_mpeg_ser_mode_lsb 0 ++#define p_reg_top_hostb_mpeg_ser_do7 0xD91D ++#define reg_top_hostb_mpeg_ser_do7_pos 0 ++#define reg_top_hostb_mpeg_ser_do7_len 1 ++#define reg_top_hostb_mpeg_ser_do7_lsb 0 ++#define p_reg_top_hostb_dca_upper 0xD91E ++#define reg_top_hostb_dca_upper_pos 0 ++#define reg_top_hostb_dca_upper_len 1 ++#define reg_top_hostb_dca_upper_lsb 0 ++#define p_reg_top_hostb_dca_lower 0xD91F ++#define reg_top_hostb_dca_lower_pos 0 ++#define reg_top_hostb_dca_lower_len 1 ++#define reg_top_hostb_dca_lower_lsb 0 ++#define p_reg_top_host_reverse 0xD920 ++#define reg_top_host_reverse_pos 0 ++#define reg_top_host_reverse_len 1 ++#define reg_top_host_reverse_lsb 0 ++#define p_reg_top_hosta_ccir 0xD921 ++#define reg_top_hosta_ccir_pos 0 ++#define reg_top_hosta_ccir_len 1 ++#define reg_top_hosta_ccir_lsb 0 ++#define p_reg_top_hostb_ccir 0xD922 ++#define reg_top_hostb_ccir_pos 0 ++#define reg_top_hostb_ccir_len 1 ++#define reg_top_hostb_ccir_lsb 0 ++#define p_reg_top_i2s_master_mode 0xD923 ++#define reg_top_i2s_master_mode_pos 0 ++#define reg_top_i2s_master_mode_len 1 ++#define reg_top_i2s_master_mode_lsb 0 ++#define p_reg_usb_cfg_speed 0xDD00 ++#define reg_usb_cfg_speed_pos 0 ++#define reg_usb_cfg_speed_len 1 ++#define reg_usb_cfg_speed_lsb 0 ++#define p_reg_usb_cfg_utmi16 0xDD00 ++#define reg_usb_cfg_utmi16_pos 1 ++#define reg_usb_cfg_utmi16_len 1 ++#define reg_usb_cfg_utmi16_lsb 0 ++#define p_reg_usb_cfg_test 0xDD00 ++#define reg_usb_cfg_test_pos 3 ++#define reg_usb_cfg_test_len 3 ++#define reg_usb_cfg_test_lsb 0 ++#define p_reg_usb_port_sim_reset 0xDD00 ++#define reg_usb_port_sim_reset_pos 6 ++#define reg_usb_port_sim_reset_len 1 ++#define reg_usb_port_sim_reset_lsb 0 ++#define p_reg_usb_port_run 0xDD00 ++#define reg_usb_port_run_pos 7 ++#define reg_usb_port_run_len 1 ++#define reg_usb_port_run_lsb 0 ++#define r_usb_line_state_0 0xDD01 ++#define usb_line_state_0_pos 0 ++#define usb_line_state_0_len 1 ++#define usb_line_state_0_lsb 0 ++#define r_usb_line_state_1 0xDD01 ++#define usb_line_state_1_pos 1 ++#define usb_line_state_1_len 1 ++#define usb_line_state_1_lsb 0 ++#define r_reg_usb_status_speed 0xDD01 ++#define reg_usb_status_speed_pos 2 ++#define reg_usb_status_speed_len 1 ++#define reg_usb_status_speed_lsb 0 ++#define r_reg_usb_status_connect 0xDD01 ++#define reg_usb_status_connect_pos 3 ++#define reg_usb_status_connect_len 1 ++#define reg_usb_status_connect_lsb 0 ++#define r_reg_usb_rx_buf 0xDD01 ++#define reg_usb_rx_buf_pos 4 ++#define reg_usb_rx_buf_len 1 ++#define reg_usb_rx_buf_lsb 0 ++#define r_reg_usb_port_reset 0xDD01 ++#define reg_usb_port_reset_pos 5 ++#define reg_usb_port_reset_len 1 ++#define reg_usb_port_reset_lsb 0 ++#define r_reg_usb_port_suspend 0xDD01 ++#define reg_usb_port_suspend_pos 6 ++#define reg_usb_port_suspend_len 1 ++#define reg_usb_port_suspend_lsb 0 ++#define p_reg_ep1_tx_type 0xDD07 ++#define reg_ep1_tx_type_pos 2 ++#define reg_ep1_tx_type_len 1 ++#define reg_ep1_tx_type_lsb 0 ++#define p_reg_ep2_rx_type 0xDD07 ++#define reg_ep2_rx_type_pos 3 ++#define reg_ep2_rx_type_len 1 ++#define reg_ep2_rx_type_lsb 0 ++#define p_reg_ep3_tx_type 0xDD07 ++#define reg_ep3_tx_type_pos 4 ++#define reg_ep3_tx_type_len 1 ++#define reg_ep3_tx_type_lsb 0 ++#define p_reg_ep4_tx_type 0xDD07 ++#define reg_ep4_tx_type_pos 5 ++#define reg_ep4_tx_type_len 1 ++#define reg_ep4_tx_type_lsb 0 ++#define p_reg_ep5_tx_type 0xDD07 ++#define reg_ep5_tx_type_pos 6 ++#define reg_ep5_tx_type_len 1 ++#define reg_ep5_tx_type_lsb 0 ++#define p_reg_ep6_tx_type 0xDD07 ++#define reg_ep6_tx_type_pos 7 ++#define reg_ep6_tx_type_len 1 ++#define reg_ep6_tx_type_lsb 0 ++#define p_reg_ep0_max_pkt 0xDD08 ++#define reg_ep0_max_pkt_pos 0 ++#define reg_ep0_max_pkt_len 8 ++#define reg_ep0_max_pkt_lsb 0 ++#define p_reg_ep2_max_pkt 0xDD0A ++#define reg_ep2_max_pkt_pos 0 ++#define reg_ep2_max_pkt_len 8 ++#define reg_ep2_max_pkt_lsb 0 ++#define p_reg_ep4_max_pkt 0xDD0C ++#define reg_ep4_max_pkt_pos 0 ++#define reg_ep4_max_pkt_len 8 ++#define reg_ep4_max_pkt_lsb 0 ++#define p_reg_ep5_max_pkt 0xDD0D ++#define reg_ep5_max_pkt_pos 0 ++#define reg_ep5_max_pkt_len 8 ++#define reg_ep5_max_pkt_lsb 0 ++#define p_reg_ep6_max_pkt_7_0 0xDD0E ++#define reg_ep6_max_pkt_7_0_pos 0 ++#define reg_ep6_max_pkt_7_0_len 8 ++#define reg_ep6_max_pkt_7_0_lsb 0 ++#define p_reg_ep6_max_pkt_15_8 0xDD0F ++#define reg_ep6_max_pkt_15_8_pos 0 ++#define reg_ep6_max_pkt_15_8_len 8 ++#define reg_ep6_max_pkt_15_8_lsb 8 ++#define p_reg_usb_addr 0xDD10 ++#define reg_usb_addr_pos 0 ++#define reg_usb_addr_len 7 ++#define reg_usb_addr_lsb 0 ++#define p_reg_usb_addr_now 0xDD10 ++#define reg_usb_addr_now_pos 7 ++#define reg_usb_addr_now_len 1 ++#define reg_usb_addr_now_lsb 0 ++#define p_reg_ep0_tx_en 0xDD11 ++#define reg_ep0_tx_en_pos 0 ++#define reg_ep0_tx_en_len 1 ++#define reg_ep0_tx_en_lsb 0 ++#define p_reg_ep0_rx_en 0xDD11 ++#define reg_ep0_rx_en_pos 1 ++#define reg_ep0_rx_en_len 1 ++#define reg_ep0_rx_en_lsb 0 ++#define p_reg_ep1_tx_en 0xDD11 ++#define reg_ep1_tx_en_pos 2 ++#define reg_ep1_tx_en_len 1 ++#define reg_ep1_tx_en_lsb 0 ++#define p_reg_ep2_rx_en 0xDD11 ++#define reg_ep2_rx_en_pos 3 ++#define reg_ep2_rx_en_len 1 ++#define reg_ep2_rx_en_lsb 0 ++#define p_reg_ep3_tx_en 0xDD11 ++#define reg_ep3_tx_en_pos 4 ++#define reg_ep3_tx_en_len 1 ++#define reg_ep3_tx_en_lsb 0 ++#define p_reg_ep4_tx_en 0xDD11 ++#define reg_ep4_tx_en_pos 5 ++#define reg_ep4_tx_en_len 1 ++#define reg_ep4_tx_en_lsb 0 ++#define p_reg_ep5_tx_en 0xDD11 ++#define reg_ep5_tx_en_pos 6 ++#define reg_ep5_tx_en_len 1 ++#define reg_ep5_tx_en_lsb 0 ++#define p_reg_ep6_tx_en 0xDD11 ++#define reg_ep6_tx_en_pos 7 ++#define reg_ep6_tx_en_len 1 ++#define reg_ep6_tx_en_lsb 0 ++#define p_reg_ep0_tx_stall 0xDD12 ++#define reg_ep0_tx_stall_pos 0 ++#define reg_ep0_tx_stall_len 1 ++#define reg_ep0_tx_stall_lsb 0 ++#define p_reg_ep0_rx_stall 0xDD12 ++#define reg_ep0_rx_stall_pos 1 ++#define reg_ep0_rx_stall_len 1 ++#define reg_ep0_rx_stall_lsb 0 ++#define p_reg_ep1_tx_stall 0xDD12 ++#define reg_ep1_tx_stall_pos 2 ++#define reg_ep1_tx_stall_len 1 ++#define reg_ep1_tx_stall_lsb 0 ++#define p_reg_ep2_rx_stall 0xDD12 ++#define reg_ep2_rx_stall_pos 3 ++#define reg_ep2_rx_stall_len 1 ++#define reg_ep2_rx_stall_lsb 0 ++#define p_reg_ep3_tx_stall 0xDD12 ++#define reg_ep3_tx_stall_pos 4 ++#define reg_ep3_tx_stall_len 1 ++#define reg_ep3_tx_stall_lsb 0 ++#define p_reg_ep4_tx_stall 0xDD12 ++#define reg_ep4_tx_stall_pos 5 ++#define reg_ep4_tx_stall_len 1 ++#define reg_ep4_tx_stall_lsb 0 ++#define p_reg_ep5_tx_stall 0xDD12 ++#define reg_ep5_tx_stall_pos 6 ++#define reg_ep5_tx_stall_len 1 ++#define reg_ep5_tx_stall_lsb 0 ++#define p_reg_ep6_tx_stall 0xDD12 ++#define reg_ep6_tx_stall_pos 7 ++#define reg_ep6_tx_stall_len 1 ++#define reg_ep6_tx_stall_lsb 0 ++#define p_reg_ep0_tx_nak 0xDD13 ++#define reg_ep0_tx_nak_pos 0 ++#define reg_ep0_tx_nak_len 1 ++#define reg_ep0_tx_nak_lsb 0 ++#define p_reg_ep0_rx_nak 0xDD13 ++#define reg_ep0_rx_nak_pos 1 ++#define reg_ep0_rx_nak_len 1 ++#define reg_ep0_rx_nak_lsb 0 ++#define p_reg_ep1_tx_nak 0xDD13 ++#define reg_ep1_tx_nak_pos 2 ++#define reg_ep1_tx_nak_len 1 ++#define reg_ep1_tx_nak_lsb 0 ++#define p_reg_ep2_rx_nak 0xDD13 ++#define reg_ep2_rx_nak_pos 3 ++#define reg_ep2_rx_nak_len 1 ++#define reg_ep2_rx_nak_lsb 0 ++#define p_reg_ep3_tx_nak 0xDD13 ++#define reg_ep3_tx_nak_pos 4 ++#define reg_ep3_tx_nak_len 1 ++#define reg_ep3_tx_nak_lsb 0 ++#define p_reg_ep4_tx_nak 0xDD13 ++#define reg_ep4_tx_nak_pos 5 ++#define reg_ep4_tx_nak_len 1 ++#define reg_ep4_tx_nak_lsb 0 ++#define p_reg_ep5_tx_nak 0xDD13 ++#define reg_ep5_tx_nak_pos 6 ++#define reg_ep5_tx_nak_len 1 ++#define reg_ep5_tx_nak_lsb 0 ++#define p_reg_ep6_tx_nak 0xDD13 ++#define reg_ep6_tx_nak_pos 7 ++#define reg_ep6_tx_nak_len 1 ++#define reg_ep6_tx_nak_lsb 0 ++#define p_reg_ep0_tx_nak_int_en 0xDD14 ++#define reg_ep0_tx_nak_int_en_pos 0 ++#define reg_ep0_tx_nak_int_en_len 1 ++#define reg_ep0_tx_nak_int_en_lsb 0 ++#define p_reg_ep0_rx_nak_int_en 0xDD14 ++#define reg_ep0_rx_nak_int_en_pos 1 ++#define reg_ep0_rx_nak_int_en_len 1 ++#define reg_ep0_rx_nak_int_en_lsb 0 ++#define p_reg_ep1_tx_nak_int_en 0xDD14 ++#define reg_ep1_tx_nak_int_en_pos 2 ++#define reg_ep1_tx_nak_int_en_len 1 ++#define reg_ep1_tx_nak_int_en_lsb 0 ++#define p_reg_ep2_rx_nak_int_en 0xDD14 ++#define reg_ep2_rx_nak_int_en_pos 3 ++#define reg_ep2_rx_nak_int_en_len 1 ++#define reg_ep2_rx_nak_int_en_lsb 0 ++#define p_reg_ep3_tx_nak_int_en 0xDD14 ++#define reg_ep3_tx_nak_int_en_pos 4 ++#define reg_ep3_tx_nak_int_en_len 1 ++#define reg_ep3_tx_nak_int_en_lsb 0 ++#define p_reg_ep4_tx_nak_int_en 0xDD14 ++#define reg_ep4_tx_nak_int_en_pos 5 ++#define reg_ep4_tx_nak_int_en_len 1 ++#define reg_ep4_tx_nak_int_en_lsb 0 ++#define p_reg_ep5_tx_nak_int_en 0xDD14 ++#define reg_ep5_tx_nak_int_en_pos 6 ++#define reg_ep5_tx_nak_int_en_len 1 ++#define reg_ep5_tx_nak_int_en_lsb 0 ++#define p_reg_ep6_tx_nak_int_en 0xDD14 ++#define reg_ep6_tx_nak_int_en_pos 7 ++#define reg_ep6_tx_nak_int_en_len 1 ++#define reg_ep6_tx_nak_int_en_lsb 0 ++#define p_reg_ep0_tx_done_int_en 0xDD15 ++#define reg_ep0_tx_done_int_en_pos 0 ++#define reg_ep0_tx_done_int_en_len 1 ++#define reg_ep0_tx_done_int_en_lsb 0 ++#define p_reg_ep0_rx_done_int_en 0xDD15 ++#define reg_ep0_rx_done_int_en_pos 1 ++#define reg_ep0_rx_done_int_en_len 1 ++#define reg_ep0_rx_done_int_en_lsb 0 ++#define p_reg_ep1_tx_done_int_en 0xDD15 ++#define reg_ep1_tx_done_int_en_pos 2 ++#define reg_ep1_tx_done_int_en_len 1 ++#define reg_ep1_tx_done_int_en_lsb 0 ++#define p_reg_ep2_rx_done_int_en 0xDD15 ++#define reg_ep2_rx_done_int_en_pos 3 ++#define reg_ep2_rx_done_int_en_len 1 ++#define reg_ep2_rx_done_int_en_lsb 0 ++#define p_reg_ep3_tx_done_int_en 0xDD15 ++#define reg_ep3_tx_done_int_en_pos 4 ++#define reg_ep3_tx_done_int_en_len 1 ++#define reg_ep3_tx_done_int_en_lsb 0 ++#define p_reg_ep4_tx_done_int_en 0xDD15 ++#define reg_ep4_tx_done_int_en_pos 5 ++#define reg_ep4_tx_done_int_en_len 1 ++#define reg_ep4_tx_done_int_en_lsb 0 ++#define p_reg_ep5_tx_done_int_en 0xDD15 ++#define reg_ep5_tx_done_int_en_pos 6 ++#define reg_ep5_tx_done_int_en_len 1 ++#define reg_ep5_tx_done_int_en_lsb 0 ++#define p_reg_ep6_tx_done_int_en 0xDD15 ++#define reg_ep6_tx_done_int_en_pos 7 ++#define reg_ep6_tx_done_int_en_len 1 ++#define reg_ep6_tx_done_int_en_lsb 0 ++#define p_reg_ep0_tx_fail_int_en 0xDD16 ++#define reg_ep0_tx_fail_int_en_pos 0 ++#define reg_ep0_tx_fail_int_en_len 1 ++#define reg_ep0_tx_fail_int_en_lsb 0 ++#define p_reg_ep0_rx_fail_int_en 0xDD16 ++#define reg_ep0_rx_fail_int_en_pos 1 ++#define reg_ep0_rx_fail_int_en_len 1 ++#define reg_ep0_rx_fail_int_en_lsb 0 ++#define p_reg_ep1_tx_fail_int_en 0xDD16 ++#define reg_ep1_tx_fail_int_en_pos 2 ++#define reg_ep1_tx_fail_int_en_len 1 ++#define reg_ep1_tx_fail_int_en_lsb 0 ++#define p_reg_ep2_rx_fail_int_en 0xDD16 ++#define reg_ep2_rx_fail_int_en_pos 3 ++#define reg_ep2_rx_fail_int_en_len 1 ++#define reg_ep2_rx_fail_int_en_lsb 0 ++#define p_reg_ep3_tx_fail_int_en 0xDD16 ++#define reg_ep3_tx_fail_int_en_pos 4 ++#define reg_ep3_tx_fail_int_en_len 1 ++#define reg_ep3_tx_fail_int_en_lsb 0 ++#define p_reg_ep4_tx_fail_int_en 0xDD16 ++#define reg_ep4_tx_fail_int_en_pos 5 ++#define reg_ep4_tx_fail_int_en_len 1 ++#define reg_ep4_tx_fail_int_en_lsb 0 ++#define p_reg_ep5_tx_fail_int_en 0xDD16 ++#define reg_ep5_tx_fail_int_en_pos 6 ++#define reg_ep5_tx_fail_int_en_len 1 ++#define reg_ep5_tx_fail_int_en_lsb 0 ++#define p_reg_ep6_tx_fail_int_en 0xDD16 ++#define reg_ep6_tx_fail_int_en_pos 7 ++#define reg_ep6_tx_fail_int_en_len 1 ++#define reg_ep6_tx_fail_int_en_lsb 0 ++#define p_reg_suspend_int_en 0xDD17 ++#define reg_suspend_int_en_pos 0 ++#define reg_suspend_int_en_len 1 ++#define reg_suspend_int_en_lsb 0 ++#define p_reg_bus_reset_int_en 0xDD17 ++#define reg_bus_reset_int_en_pos 1 ++#define reg_bus_reset_int_en_len 1 ++#define reg_bus_reset_int_en_lsb 0 ++#define p_reg_ep0_setup_int_en 0xDD17 ++#define reg_ep0_setup_int_en_pos 2 ++#define reg_ep0_setup_int_en_len 1 ++#define reg_ep0_setup_int_en_lsb 0 ++#define p_reg_ep0_tx_nak_int 0xDD18 ++#define reg_ep0_tx_nak_int_pos 0 ++#define reg_ep0_tx_nak_int_len 1 ++#define reg_ep0_tx_nak_int_lsb 0 ++#define p_reg_ep0_rx_nak_int 0xDD18 ++#define reg_ep0_rx_nak_int_pos 1 ++#define reg_ep0_rx_nak_int_len 1 ++#define reg_ep0_rx_nak_int_lsb 0 ++#define p_reg_ep1_tx_nak_int 0xDD18 ++#define reg_ep1_tx_nak_int_pos 2 ++#define reg_ep1_tx_nak_int_len 1 ++#define reg_ep1_tx_nak_int_lsb 0 ++#define p_reg_ep2_rx_nak_int 0xDD18 ++#define reg_ep2_rx_nak_int_pos 3 ++#define reg_ep2_rx_nak_int_len 1 ++#define reg_ep2_rx_nak_int_lsb 0 ++#define p_reg_ep3_tx_nak_int 0xDD18 ++#define reg_ep3_tx_nak_int_pos 4 ++#define reg_ep3_tx_nak_int_len 1 ++#define reg_ep3_tx_nak_int_lsb 0 ++#define p_reg_ep4_tx_nak_int 0xDD18 ++#define reg_ep4_tx_nak_int_pos 5 ++#define reg_ep4_tx_nak_int_len 1 ++#define reg_ep4_tx_nak_int_lsb 0 ++#define p_reg_ep5_tx_nak_int 0xDD18 ++#define reg_ep5_tx_nak_int_pos 6 ++#define reg_ep5_tx_nak_int_len 1 ++#define reg_ep5_tx_nak_int_lsb 0 ++#define p_reg_ep6_tx_nak_int 0xDD18 ++#define reg_ep6_tx_nak_int_pos 7 ++#define reg_ep6_tx_nak_int_len 1 ++#define reg_ep6_tx_nak_int_lsb 0 ++#define p_reg_ep0_tx_done_int 0xDD19 ++#define reg_ep0_tx_done_int_pos 0 ++#define reg_ep0_tx_done_int_len 1 ++#define reg_ep0_tx_done_int_lsb 0 ++#define p_reg_ep0_rx_done_int 0xDD19 ++#define reg_ep0_rx_done_int_pos 1 ++#define reg_ep0_rx_done_int_len 1 ++#define reg_ep0_rx_done_int_lsb 0 ++#define p_reg_ep1_tx_done_int 0xDD19 ++#define reg_ep1_tx_done_int_pos 2 ++#define reg_ep1_tx_done_int_len 1 ++#define reg_ep1_tx_done_int_lsb 0 ++#define p_reg_ep2_rx_done_int 0xDD19 ++#define reg_ep2_rx_done_int_pos 3 ++#define reg_ep2_rx_done_int_len 1 ++#define reg_ep2_rx_done_int_lsb 0 ++#define p_reg_ep3_tx_done_int 0xDD19 ++#define reg_ep3_tx_done_int_pos 4 ++#define reg_ep3_tx_done_int_len 1 ++#define reg_ep3_tx_done_int_lsb 0 ++#define p_reg_ep4_tx_done_int 0xDD19 ++#define reg_ep4_tx_done_int_pos 5 ++#define reg_ep4_tx_done_int_len 1 ++#define reg_ep4_tx_done_int_lsb 0 ++#define p_reg_ep5_tx_done_int 0xDD19 ++#define reg_ep5_tx_done_int_pos 6 ++#define reg_ep5_tx_done_int_len 1 ++#define reg_ep5_tx_done_int_lsb 0 ++#define p_reg_ep6_tx_done_int 0xDD19 ++#define reg_ep6_tx_done_int_pos 7 ++#define reg_ep6_tx_done_int_len 1 ++#define reg_ep6_tx_done_int_lsb 0 ++#define p_reg_ep0_tx_fail_int 0xDD1A ++#define reg_ep0_tx_fail_int_pos 0 ++#define reg_ep0_tx_fail_int_len 1 ++#define reg_ep0_tx_fail_int_lsb 0 ++#define p_reg_ep0_rx_fail_int 0xDD1A ++#define reg_ep0_rx_fail_int_pos 1 ++#define reg_ep0_rx_fail_int_len 1 ++#define reg_ep0_rx_fail_int_lsb 0 ++#define p_reg_ep1_tx_fail_int 0xDD1A ++#define reg_ep1_tx_fail_int_pos 2 ++#define reg_ep1_tx_fail_int_len 1 ++#define reg_ep1_tx_fail_int_lsb 0 ++#define p_reg_ep2_rx_fail_int 0xDD1A ++#define reg_ep2_rx_fail_int_pos 3 ++#define reg_ep2_rx_fail_int_len 1 ++#define reg_ep2_rx_fail_int_lsb 0 ++#define p_reg_ep3_tx_fail_int 0xDD1A ++#define reg_ep3_tx_fail_int_pos 4 ++#define reg_ep3_tx_fail_int_len 1 ++#define reg_ep3_tx_fail_int_lsb 0 ++#define p_reg_ep4_tx_fail_int 0xDD1A ++#define reg_ep4_tx_fail_int_pos 5 ++#define reg_ep4_tx_fail_int_len 1 ++#define reg_ep4_tx_fail_int_lsb 0 ++#define p_reg_ep5_tx_fail_int 0xDD1A ++#define reg_ep5_tx_fail_int_pos 6 ++#define reg_ep5_tx_fail_int_len 1 ++#define reg_ep5_tx_fail_int_lsb 0 ++#define p_reg_ep6_tx_fail_int 0xDD1A ++#define reg_ep6_tx_fail_int_pos 7 ++#define reg_ep6_tx_fail_int_len 1 ++#define reg_ep6_tx_fail_int_lsb 0 ++#define p_reg_suspend_int 0xDD1B ++#define reg_suspend_int_pos 0 ++#define reg_suspend_int_len 1 ++#define reg_suspend_int_lsb 0 ++#define p_reg_bus_reset_int 0xDD1B ++#define reg_bus_reset_int_pos 1 ++#define reg_bus_reset_int_len 1 ++#define reg_bus_reset_int_lsb 0 ++#define p_reg_ep0_setup_int 0xDD1B ++#define reg_ep0_setup_int_pos 2 ++#define reg_ep0_setup_int_len 1 ++#define reg_ep0_setup_int_lsb 0 ++#define r_usbc_int 0xDD1B ++#define usbc_int_pos 3 ++#define usbc_int_len 1 ++#define usbc_int_lsb 0 ++#define r_usb_ir_int 0xDD1B ++#define usb_ir_int_pos 4 ++#define usb_ir_int_len 1 ++#define usb_ir_int_lsb 0 ++#define p_reg_ep0_tx_rst 0xDD1D ++#define reg_ep0_tx_rst_pos 0 ++#define reg_ep0_tx_rst_len 1 ++#define reg_ep0_tx_rst_lsb 0 ++#define p_reg_ep0_rx_rst 0xDD1D ++#define reg_ep0_rx_rst_pos 1 ++#define reg_ep0_rx_rst_len 1 ++#define reg_ep0_rx_rst_lsb 0 ++#define p_reg_ep1_tx_rst 0xDD1D ++#define reg_ep1_tx_rst_pos 2 ++#define reg_ep1_tx_rst_len 1 ++#define reg_ep1_tx_rst_lsb 0 ++#define p_reg_ep2_rx_rst 0xDD1D ++#define reg_ep2_rx_rst_pos 3 ++#define reg_ep2_rx_rst_len 1 ++#define reg_ep2_rx_rst_lsb 0 ++#define p_reg_ep3_tx_rst 0xDD1D ++#define reg_ep3_tx_rst_pos 4 ++#define reg_ep3_tx_rst_len 1 ++#define reg_ep3_tx_rst_lsb 0 ++#define p_reg_ep4_tx_rst 0xDD1D ++#define reg_ep4_tx_rst_pos 5 ++#define reg_ep4_tx_rst_len 1 ++#define reg_ep4_tx_rst_lsb 0 ++#define p_reg_ep5_tx_rst 0xDD1D ++#define reg_ep5_tx_rst_pos 6 ++#define reg_ep5_tx_rst_len 1 ++#define reg_ep5_tx_rst_lsb 0 ++#define p_reg_ep6_tx_rst 0xDD1D ++#define reg_ep6_tx_rst_pos 7 ++#define reg_ep6_tx_rst_len 1 ++#define reg_ep6_tx_rst_lsb 0 ++#define r_reg_ep0_tx_active 0xDD1E ++#define reg_ep0_tx_active_pos 0 ++#define reg_ep0_tx_active_len 1 ++#define reg_ep0_tx_active_lsb 0 ++#define r_reg_ep0_rx_active 0xDD1E ++#define reg_ep0_rx_active_pos 1 ++#define reg_ep0_rx_active_len 1 ++#define reg_ep0_rx_active_lsb 0 ++#define r_reg_ep1_tx_active 0xDD1E ++#define reg_ep1_tx_active_pos 2 ++#define reg_ep1_tx_active_len 1 ++#define reg_ep1_tx_active_lsb 0 ++#define r_reg_ep2_rx_active 0xDD1E ++#define reg_ep2_rx_active_pos 3 ++#define reg_ep2_rx_active_len 1 ++#define reg_ep2_rx_active_lsb 0 ++#define r_reg_ep3_tx_active 0xDD1E ++#define reg_ep3_tx_active_pos 4 ++#define reg_ep3_tx_active_len 1 ++#define reg_ep3_tx_active_lsb 0 ++#define r_reg_ep4_tx_active 0xDD1E ++#define reg_ep4_tx_active_pos 5 ++#define reg_ep4_tx_active_len 1 ++#define reg_ep4_tx_active_lsb 0 ++#define r_reg_ep5_tx_active 0xDD1E ++#define reg_ep5_tx_active_pos 6 ++#define reg_ep5_tx_active_len 1 ++#define reg_ep5_tx_active_lsb 0 ++#define r_reg_ep6_tx_active 0xDD1E ++#define reg_ep6_tx_active_pos 7 ++#define reg_ep6_tx_active_len 1 ++#define reg_ep6_tx_active_lsb 0 ++#define p_reg_usb_setup_reset 0xDD1F ++#define reg_usb_setup_reset_pos 0 ++#define reg_usb_setup_reset_len 1 ++#define reg_usb_setup_reset_lsb 0 ++#define p_reg_usb_ep4_retry_new 0xDD1F ++#define reg_usb_ep4_retry_new_pos 1 ++#define reg_usb_ep4_retry_new_len 1 ++#define reg_usb_ep4_retry_new_lsb 0 ++#define p_reg_usb_ep5_retry_new 0xDD1F ++#define reg_usb_ep5_retry_new_pos 2 ++#define reg_usb_ep5_retry_new_len 1 ++#define reg_usb_ep5_retry_new_lsb 0 ++#define p_reg_usb_ep6_retry_new 0xDD1F ++#define reg_usb_ep6_retry_new_pos 3 ++#define reg_usb_ep6_retry_new_len 1 ++#define reg_usb_ep6_retry_new_lsb 0 ++#define p_reg_usb_iso_mult_cnt 0xDD20 ++#define reg_usb_iso_mult_cnt_pos 0 ++#define reg_usb_iso_mult_cnt_len 2 ++#define reg_usb_iso_mult_cnt_lsb 0 ++#define p_reg_p_iso_fix_en 0xDD21 ++#define reg_p_iso_fix_en_pos 0 ++#define reg_p_iso_fix_en_len 1 ++#define reg_p_iso_fix_en_lsb 0 ++#define p_reg_p_iso_fix_rst 0xDD22 ++#define reg_p_iso_fix_rst_pos 0 ++#define reg_p_iso_fix_rst_len 1 ++#define reg_p_iso_fix_rst_lsb 0 ++#define p_reg_p_read_point_7_0 0xDD23 ++#define reg_p_read_point_7_0_pos 0 ++#define reg_p_read_point_7_0_len 8 ++#define reg_p_read_point_7_0_lsb 0 ++#define p_reg_p_read_point_11_8 0xDD24 ++#define reg_p_read_point_11_8_pos 0 ++#define reg_p_read_point_11_8_len 4 ++#define reg_p_read_point_11_8_lsb 8 ++#define p_reg_p_dbg_ctrl 0xDD25 ++#define reg_p_dbg_ctrl_pos 0 ++#define reg_p_dbg_ctrl_len 3 ++#define reg_p_dbg_ctrl_lsb 0 ++#define p_reg_p_data_swap 0xDD26 ++#define reg_p_data_swap_pos 0 ++#define reg_p_data_swap_len 2 ++#define reg_p_data_swap_lsb 0 ++#define p_reg_ep_rx_addr 0xDD80 ++#define reg_ep_rx_addr_pos 2 ++#define reg_ep_rx_addr_len 6 ++#define reg_ep_rx_addr_lsb 0 ++#define p_reg_ep0_tx_addr 0xDD81 ++#define reg_ep0_tx_addr_pos 2 ++#define reg_ep0_tx_addr_len 6 ++#define reg_ep0_tx_addr_lsb 0 ++#define p_reg_ep1_tx_addr 0xDD82 ++#define reg_ep1_tx_addr_pos 2 ++#define reg_ep1_tx_addr_len 6 ++#define reg_ep1_tx_addr_lsb 0 ++#define p_reg_ep3_tx_addr 0xDD83 ++#define reg_ep3_tx_addr_pos 2 ++#define reg_ep3_tx_addr_len 6 ++#define reg_ep3_tx_addr_lsb 0 ++#define p_reg_ep_rx_len 0xDD84 ++#define reg_ep_rx_len_pos 0 ++#define reg_ep_rx_len_len 8 ++#define reg_ep_rx_len_lsb 0 ++#define p_reg_ep0_tx_len 0xDD85 ++#define reg_ep0_tx_len_pos 0 ++#define reg_ep0_tx_len_len 8 ++#define reg_ep0_tx_len_lsb 0 ++#define p_reg_ep1_tx_len 0xDD86 ++#define reg_ep1_tx_len_pos 0 ++#define reg_ep1_tx_len_len 8 ++#define reg_ep1_tx_len_lsb 0 ++#define p_reg_ep3_tx_len 0xDD87 ++#define reg_ep3_tx_len_pos 0 ++#define reg_ep3_tx_len_len 8 ++#define reg_ep3_tx_len_lsb 0 ++#define p_reg_ep4_tx_len_7_0 0xDD88 ++#define reg_ep4_tx_len_7_0_pos 0 ++#define reg_ep4_tx_len_7_0_len 8 ++#define reg_ep4_tx_len_7_0_lsb 0 ++#define p_reg_ep4_tx_len_15_8 0xDD89 ++#define reg_ep4_tx_len_15_8_pos 0 ++#define reg_ep4_tx_len_15_8_len 8 ++#define reg_ep4_tx_len_15_8_lsb 8 ++#define p_reg_ep5_tx_len_7_0 0xDD8A ++#define reg_ep5_tx_len_7_0_pos 0 ++#define reg_ep5_tx_len_7_0_len 8 ++#define reg_ep5_tx_len_7_0_lsb 0 ++#define p_reg_ep5_tx_len_15_8 0xDD8B ++#define reg_ep5_tx_len_15_8_pos 0 ++#define reg_ep5_tx_len_15_8_len 8 ++#define reg_ep5_tx_len_15_8_lsb 8 ++#define p_reg_usb_reset_addr 0xDD8C ++#define reg_usb_reset_addr_pos 0 ++#define reg_usb_reset_addr_len 7 ++#define reg_usb_reset_addr_lsb 0 ++#define p_reg_usb_reset 0xDD8C ++#define reg_usb_reset_pos 7 ++#define reg_usb_reset_len 1 ++#define reg_usb_reset_lsb 0 ++#define p_reg_usb_sync_in 0xDD8D ++#define reg_usb_sync_in_pos 0 ++#define reg_usb_sync_in_len 1 ++#define reg_usb_sync_in_lsb 0 ++#define p_reg_usb_sync_txready 0xDD8D ++#define reg_usb_sync_txready_pos 1 ++#define reg_usb_sync_txready_len 1 ++#define reg_usb_sync_txready_lsb 0 ++#define p_reg_utmi_phy_suspend 0xDD8D ++#define reg_utmi_phy_suspend_pos 2 ++#define reg_utmi_phy_suspend_len 1 ++#define reg_utmi_phy_suspend_lsb 0 ++#define p_reg_usb_min_len 0xDD8D ++#define reg_usb_min_len_pos 3 ++#define reg_usb_min_len_len 1 ++#define reg_usb_min_len_lsb 0 ++#define p_reg_usb_phy_clksel 0xDD8D ++#define reg_usb_phy_clksel_pos 4 ++#define reg_usb_phy_clksel_len 1 ++#define reg_usb_phy_clksel_lsb 0 ++#define p_reg_ep6_tx_len_7_0 0xDD8E ++#define reg_ep6_tx_len_7_0_pos 0 ++#define reg_ep6_tx_len_7_0_len 8 ++#define reg_ep6_tx_len_7_0_lsb 0 ++#define p_reg_ep6_tx_len_15_8 0xDD8F ++#define reg_ep6_tx_len_15_8_pos 0 ++#define reg_ep6_tx_len_15_8_len 8 ++#define reg_ep6_tx_len_15_8_lsb 8 ++#define p_reg_usb_clk_phase 0xDD93 ++#define reg_usb_clk_phase_pos 0 ++#define reg_usb_clk_phase_len 2 ++#define reg_usb_clk_phase_lsb 0 ++#define p_reg_usb_clk_sel 0xDD93 ++#define reg_usb_clk_sel_pos 4 ++#define reg_usb_clk_sel_len 4 ++#define reg_usb_clk_sel_lsb 0 ++#define p_reg_usb_fifo_ptr 0xDD94 ++#define reg_usb_fifo_ptr_pos 0 ++#define reg_usb_fifo_ptr_len 3 ++#define reg_usb_fifo_ptr_lsb 0 ++#define p_reg_usb_fifo_byte 0xDD94 ++#define reg_usb_fifo_byte_pos 3 ++#define reg_usb_fifo_byte_len 2 ++#define reg_usb_fifo_byte_lsb 0 ++#define p_reg_usb_fifo_sys 0xDD94 ++#define reg_usb_fifo_sys_pos 5 ++#define reg_usb_fifo_sys_len 1 ++#define reg_usb_fifo_sys_lsb 0 ++#define p_usbdma_utmi_d_ctl_7_0 0xDD9E ++#define usbdma_utmi_d_ctl_7_0_pos 0 ++#define usbdma_utmi_d_ctl_7_0_len 8 ++#define usbdma_utmi_d_ctl_7_0_lsb 0 ++#define p_usbdma_utmi_d_ctl_13_8 0xDD9F ++#define usbdma_utmi_d_ctl_13_8_pos 0 ++#define usbdma_utmi_d_ctl_13_8_len 6 ++#define usbdma_utmi_d_ctl_13_8_lsb 8 ++#define p_usbdma_utmi_a_ctl_7_0 0xDDA0 ++#define usbdma_utmi_a_ctl_7_0_pos 0 ++#define usbdma_utmi_a_ctl_7_0_len 8 ++#define usbdma_utmi_a_ctl_7_0_lsb 0 ++#define p_usbdma_utmi_a_ctl_15_8 0xDDA1 ++#define usbdma_utmi_a_ctl_15_8_pos 0 ++#define usbdma_utmi_a_ctl_15_8_len 8 ++#define usbdma_utmi_a_ctl_15_8_lsb 8 ++#define p_usbdma_utmi_a_ctl_23_16 0xDDA2 ++#define usbdma_utmi_a_ctl_23_16_pos 0 ++#define usbdma_utmi_a_ctl_23_16_len 8 ++#define usbdma_utmi_a_ctl_23_16_lsb 16 ++#define p_usbdma_utmi_a_ctl_31_24 0xDDA3 ++#define usbdma_utmi_a_ctl_31_24_pos 0 ++#define usbdma_utmi_a_ctl_31_24_len 8 ++#define usbdma_utmi_a_ctl_31_24_lsb 24 ++#define p_usbdma_utmi_a_ctl_39_32 0xDDA4 ++#define usbdma_utmi_a_ctl_39_32_pos 0 ++#define usbdma_utmi_a_ctl_39_32_len 8 ++#define usbdma_utmi_a_ctl_39_32_lsb 32 ++#define p_usbdma_utmi_a_ctl_47_40 0xDDA5 ++#define usbdma_utmi_a_ctl_47_40_pos 0 ++#define usbdma_utmi_a_ctl_47_40_len 8 ++#define usbdma_utmi_a_ctl_47_40_lsb 40 ++#define p_usbdma_utmi_pwrmode 0xDDA6 ++#define usbdma_utmi_pwrmode_pos 3 ++#define usbdma_utmi_pwrmode_len 1 ++#define usbdma_utmi_pwrmode_lsb 0 ++#define p_usbdma_utmi_test_out 0xDDA6 ++#define usbdma_utmi_test_out_pos 4 ++#define usbdma_utmi_test_out_len 1 ++#define usbdma_utmi_test_out_lsb 0 ++#define p_usbdma_utmi_vbus_int_en 0xDDA7 ++#define usbdma_utmi_vbus_int_en_pos 0 ++#define usbdma_utmi_vbus_int_en_len 1 ++#define usbdma_utmi_vbus_int_en_lsb 0 ++#define p_usbdma_utmi_vbus_int_pol 0xDDA7 ++#define usbdma_utmi_vbus_int_pol_pos 1 ++#define usbdma_utmi_vbus_int_pol_len 1 ++#define usbdma_utmi_vbus_int_pol_lsb 0 ++#define r_usbdma_utmi_vbus_int 0xDDA8 ++#define usbdma_utmi_vbus_int_pos 0 ++#define usbdma_utmi_vbus_int_len 1 ++#define usbdma_utmi_vbus_int_lsb 0 ++#define r_usbdma_utmi_vbus_status 0xDDA8 ++#define usbdma_utmi_vbus_status_pos 1 ++#define usbdma_utmi_vbus_status_len 1 ++#define usbdma_utmi_vbus_status_lsb 0 ++#define r_usbdma_utmi_clkrdy 0xDDA8 ++#define usbdma_utmi_clkrdy_pos 2 ++#define usbdma_utmi_clkrdy_len 1 ++#define usbdma_utmi_clkrdy_lsb 0 ++#define p_reg_p_usb_iso_ccir_rst 0xDDA9 ++#define reg_p_usb_iso_ccir_rst_pos 0 ++#define reg_p_usb_iso_ccir_rst_len 1 ++#define reg_p_usb_iso_ccir_rst_lsb 0 ++#define p_reg_p_usb_iso_ccir 0xDDA9 ++#define reg_p_usb_iso_ccir_pos 1 ++#define reg_p_usb_iso_ccir_len 1 ++#define reg_p_usb_iso_ccir_lsb 0 ++#define p_reg_p_ccir_fix_en 0xDDAA ++#define reg_p_ccir_fix_en_pos 0 ++#define reg_p_ccir_fix_en_len 1 ++#define reg_p_ccir_fix_en_lsb 0 ++#define p_ir_sys_clk 0xDF80 ++#define ir_sys_clk_pos 0 ++#define ir_sys_clk_len 8 ++#define ir_sys_clk_lsb 0 ++#define p_ir_sample_clk 0xDF81 ++#define ir_sample_clk_pos 0 ++#define ir_sample_clk_len 2 ++#define ir_sample_clk_lsb 0 ++#define p_ir_idle_polarity 0xDF81 ++#define ir_idle_polarity_pos 2 ++#define ir_idle_polarity_len 1 ++#define ir_idle_polarity_lsb 0 ++#define p_ir_fifo_ovfl 0xDF82 ++#define ir_fifo_ovfl_pos 0 ++#define ir_fifo_ovfl_len 1 ++#define ir_fifo_ovfl_lsb 0 ++#define r_ir_fifo_empty 0xDF82 ++#define ir_fifo_empty_pos 1 ++#define ir_fifo_empty_len 1 ++#define ir_fifo_empty_lsb 0 ++#define r_ir_fifo_cnt 0xDF82 ++#define ir_fifo_cnt_pos 2 ++#define ir_fifo_cnt_len 3 ++#define ir_fifo_cnt_lsb 0 ++#define p_ir_fifo_rst 0xDF82 ++#define ir_fifo_rst_pos 5 ++#define ir_fifo_rst_len 1 ++#define ir_fifo_rst_lsb 0 ++#define p_reg_ir_out_th0_7_0 0xDF84 ++#define reg_ir_out_th0_7_0_pos 0 ++#define reg_ir_out_th0_7_0_len 8 ++#define reg_ir_out_th0_7_0_lsb 0 ++#define p_reg_ir_out_th0_14_8 0xDF85 ++#define reg_ir_out_th0_14_8_pos 0 ++#define reg_ir_out_th0_14_8_len 7 ++#define reg_ir_out_th0_14_8_lsb 8 ++#define p_reg_ir_out_th1_7_0 0xDF86 ++#define reg_ir_out_th1_7_0_pos 0 ++#define reg_ir_out_th1_7_0_len 8 ++#define reg_ir_out_th1_7_0_lsb 0 ++#define p_reg_ir_out_th1_14_8 0xDF87 ++#define reg_ir_out_th1_14_8_pos 0 ++#define reg_ir_out_th1_14_8_len 7 ++#define reg_ir_out_th1_14_8_lsb 8 ++#define p_reg_ir_out_th2_7_0 0xDF88 ++#define reg_ir_out_th2_7_0_pos 0 ++#define reg_ir_out_th2_7_0_len 8 ++#define reg_ir_out_th2_7_0_lsb 0 ++#define p_reg_ir_out_th2_14_8 0xDF89 ++#define reg_ir_out_th2_14_8_pos 0 ++#define reg_ir_out_th2_14_8_len 7 ++#define reg_ir_out_th2_14_8_lsb 8 ++#define p_reg_ir_out_th3_7_0 0xDF8A ++#define reg_ir_out_th3_7_0_pos 0 ++#define reg_ir_out_th3_7_0_len 8 ++#define reg_ir_out_th3_7_0_lsb 0 ++#define p_reg_ir_out_th3_14_8 0xDF8B ++#define reg_ir_out_th3_14_8_pos 0 ++#define reg_ir_out_th3_14_8_len 7 ++#define reg_ir_out_th3_14_8_lsb 8 ++#define p_reg_ir_out_th4_7_0 0xDF8C ++#define reg_ir_out_th4_7_0_pos 0 ++#define reg_ir_out_th4_7_0_len 8 ++#define reg_ir_out_th4_7_0_lsb 0 ++#define p_reg_ir_out_th4_14_8 0xDF8D ++#define reg_ir_out_th4_14_8_pos 0 ++#define reg_ir_out_th4_14_8_len 7 ++#define reg_ir_out_th4_14_8_lsb 8 ++#define p_reg_ir_out_th5_7_0 0xDF8E ++#define reg_ir_out_th5_7_0_pos 0 ++#define reg_ir_out_th5_7_0_len 8 ++#define reg_ir_out_th5_7_0_lsb 0 ++#define p_reg_ir_out_th5_14_8 0xDF8F ++#define reg_ir_out_th5_14_8_pos 0 ++#define reg_ir_out_th5_14_8_len 7 ++#define reg_ir_out_th5_14_8_lsb 8 ++#define p_reg_ir_out_th6_7_0 0xDF90 ++#define reg_ir_out_th6_7_0_pos 0 ++#define reg_ir_out_th6_7_0_len 8 ++#define reg_ir_out_th6_7_0_lsb 0 ++#define p_reg_ir_out_th6_14_8 0xDF91 ++#define reg_ir_out_th6_14_8_pos 0 ++#define reg_ir_out_th6_14_8_len 7 ++#define reg_ir_out_th6_14_8_lsb 8 ++#define p_reg_ir_out_th7_7_0 0xDF92 ++#define reg_ir_out_th7_7_0_pos 0 ++#define reg_ir_out_th7_7_0_len 8 ++#define reg_ir_out_th7_7_0_lsb 0 ++#define p_reg_ir_out_th7_14_8 0xDF93 ++#define reg_ir_out_th7_14_8_pos 0 ++#define reg_ir_out_th7_14_8_len 7 ++#define reg_ir_out_th7_14_8_lsb 8 ++#define p_reg_ir_out_th8_7_0 0xDF94 ++#define reg_ir_out_th8_7_0_pos 0 ++#define reg_ir_out_th8_7_0_len 8 ++#define reg_ir_out_th8_7_0_lsb 0 ++#define p_reg_ir_out_th8_14_8 0xDF95 ++#define reg_ir_out_th8_14_8_pos 0 ++#define reg_ir_out_th8_14_8_len 7 ++#define reg_ir_out_th8_14_8_lsb 8 ++#define p_reg_ir_out_th9_7_0 0xDF96 ++#define reg_ir_out_th9_7_0_pos 0 ++#define reg_ir_out_th9_7_0_len 8 ++#define reg_ir_out_th9_7_0_lsb 0 ++#define p_reg_ir_out_th9_14_8 0xDF97 ++#define reg_ir_out_th9_14_8_pos 0 ++#define reg_ir_out_th9_14_8_len 7 ++#define reg_ir_out_th9_14_8_lsb 8 ++#define p_reg_ir_out_th10_7_0 0xDF98 ++#define reg_ir_out_th10_7_0_pos 0 ++#define reg_ir_out_th10_7_0_len 8 ++#define reg_ir_out_th10_7_0_lsb 0 ++#define p_reg_ir_out_th10_14_8 0xDF99 ++#define reg_ir_out_th10_14_8_pos 0 ++#define reg_ir_out_th10_14_8_len 7 ++#define reg_ir_out_th10_14_8_lsb 8 ++#define p_reg_ir_out_th11_7_0 0xDF9A ++#define reg_ir_out_th11_7_0_pos 0 ++#define reg_ir_out_th11_7_0_len 8 ++#define reg_ir_out_th11_7_0_lsb 0 ++#define p_reg_ir_out_th11_14_8 0xDF9B ++#define reg_ir_out_th11_14_8_pos 0 ++#define reg_ir_out_th11_14_8_len 7 ++#define reg_ir_out_th11_14_8_lsb 8 ++#define p_reg_ir_out_th12_7_0 0xDF9C ++#define reg_ir_out_th12_7_0_pos 0 ++#define reg_ir_out_th12_7_0_len 8 ++#define reg_ir_out_th12_7_0_lsb 0 ++#define p_reg_ir_out_th12_14_8 0xDF9D ++#define reg_ir_out_th12_14_8_pos 0 ++#define reg_ir_out_th12_14_8_len 7 ++#define reg_ir_out_th12_14_8_lsb 8 ++#define p_reg_ir_out_th13_7_0 0xDF9E ++#define reg_ir_out_th13_7_0_pos 0 ++#define reg_ir_out_th13_7_0_len 8 ++#define reg_ir_out_th13_7_0_lsb 0 ++#define p_reg_ir_out_th13_14_8 0xDF9F ++#define reg_ir_out_th13_14_8_pos 0 ++#define reg_ir_out_th13_14_8_len 7 ++#define reg_ir_out_th13_14_8_lsb 8 ++#define p_reg_ir_out_th14_7_0 0xDFA0 ++#define reg_ir_out_th14_7_0_pos 0 ++#define reg_ir_out_th14_7_0_len 8 ++#define reg_ir_out_th14_7_0_lsb 0 ++#define p_reg_ir_out_th14_14_8 0xDFA1 ++#define reg_ir_out_th14_14_8_pos 0 ++#define reg_ir_out_th14_14_8_len 7 ++#define reg_ir_out_th14_14_8_lsb 8 ++#define p_reg_tuner_data_7_0 0xF000 ++#define reg_tuner_data_7_0_pos 0 ++#define reg_tuner_data_7_0_len 8 ++#define reg_tuner_data_7_0_lsb 0 ++#define p_reg_tuner_data_15_8 0xF001 ++#define reg_tuner_data_15_8_pos 0 ++#define reg_tuner_data_15_8_len 8 ++#define reg_tuner_data_15_8_lsb 8 ++#define p_reg_tuner_data_23_16 0xF002 ++#define reg_tuner_data_23_16_pos 0 ++#define reg_tuner_data_23_16_len 8 ++#define reg_tuner_data_23_16_lsb 16 ++#define p_reg_tuner_data_31_24 0xF003 ++#define reg_tuner_data_31_24_pos 0 ++#define reg_tuner_data_31_24_len 8 ++#define reg_tuner_data_31_24_lsb 24 ++#define p_reg_tuner_data_39_32 0xF004 ++#define reg_tuner_data_39_32_pos 0 ++#define reg_tuner_data_39_32_len 8 ++#define reg_tuner_data_39_32_lsb 32 ++#define p_reg_tuner_data_47_40 0xF005 ++#define reg_tuner_data_47_40_pos 0 ++#define reg_tuner_data_47_40_len 8 ++#define reg_tuner_data_47_40_lsb 40 ++#define p_reg_tuner_data_55_48 0xF006 ++#define reg_tuner_data_55_48_pos 0 ++#define reg_tuner_data_55_48_len 8 ++#define reg_tuner_data_55_48_lsb 48 ++#define p_reg_tuner_data_63_56 0xF007 ++#define reg_tuner_data_63_56_pos 0 ++#define reg_tuner_data_63_56_len 8 ++#define reg_tuner_data_63_56_lsb 56 ++#define p_reg_tuner_data_71_64 0xF008 ++#define reg_tuner_data_71_64_pos 0 ++#define reg_tuner_data_71_64_len 8 ++#define reg_tuner_data_71_64_lsb 64 ++#define p_reg_tuner_data_79_72 0xF009 ++#define reg_tuner_data_79_72_pos 0 ++#define reg_tuner_data_79_72_len 8 ++#define reg_tuner_data_79_72_lsb 72 ++#define p_reg_tuner_data_87_80 0xF00A ++#define reg_tuner_data_87_80_pos 0 ++#define reg_tuner_data_87_80_len 8 ++#define reg_tuner_data_87_80_lsb 80 ++#define p_reg_tuner_data_95_88 0xF00B ++#define reg_tuner_data_95_88_pos 0 ++#define reg_tuner_data_95_88_len 8 ++#define reg_tuner_data_95_88_lsb 88 ++#define p_reg_tuner_data_103_96 0xF00C ++#define reg_tuner_data_103_96_pos 0 ++#define reg_tuner_data_103_96_len 8 ++#define reg_tuner_data_103_96_lsb 96 ++#define p_reg_tuner_data_111_104 0xF00D ++#define reg_tuner_data_111_104_pos 0 ++#define reg_tuner_data_111_104_len 8 ++#define reg_tuner_data_111_104_lsb 104 ++#define p_reg_tuner_data_119_112 0xF00E ++#define reg_tuner_data_119_112_pos 0 ++#define reg_tuner_data_119_112_len 8 ++#define reg_tuner_data_119_112_lsb 112 ++#define p_reg_tuner_data_127_120 0xF00F ++#define reg_tuner_data_127_120_pos 0 ++#define reg_tuner_data_127_120_len 8 ++#define reg_tuner_data_127_120_lsb 120 ++#define p_reg_tuner_data_135_128 0xF010 ++#define reg_tuner_data_135_128_pos 0 ++#define reg_tuner_data_135_128_len 8 ++#define reg_tuner_data_135_128_lsb 128 ++#define p_reg_tuner_data_143_136 0xF011 ++#define reg_tuner_data_143_136_pos 0 ++#define reg_tuner_data_143_136_len 8 ++#define reg_tuner_data_143_136_lsb 136 ++#define p_reg_tuner_data_151_144 0xF012 ++#define reg_tuner_data_151_144_pos 0 ++#define reg_tuner_data_151_144_len 8 ++#define reg_tuner_data_151_144_lsb 144 ++#define p_reg_tuner_data_159_152 0xF013 ++#define reg_tuner_data_159_152_pos 0 ++#define reg_tuner_data_159_152_len 8 ++#define reg_tuner_data_159_152_lsb 152 ++#define p_reg_tuner_data_167_160 0xF014 ++#define reg_tuner_data_167_160_pos 0 ++#define reg_tuner_data_167_160_len 8 ++#define reg_tuner_data_167_160_lsb 160 ++#define p_reg_tuner_data_175_168 0xF015 ++#define reg_tuner_data_175_168_pos 0 ++#define reg_tuner_data_175_168_len 8 ++#define reg_tuner_data_175_168_lsb 168 ++#define p_reg_tuner_data_183_176 0xF016 ++#define reg_tuner_data_183_176_pos 0 ++#define reg_tuner_data_183_176_len 8 ++#define reg_tuner_data_183_176_lsb 176 ++#define p_reg_tuner_data_191_184 0xF017 ++#define reg_tuner_data_191_184_pos 0 ++#define reg_tuner_data_191_184_len 8 ++#define reg_tuner_data_191_184_lsb 184 ++#define p_reg_tuner_data_199_192 0xF018 ++#define reg_tuner_data_199_192_pos 0 ++#define reg_tuner_data_199_192_len 8 ++#define reg_tuner_data_199_192_lsb 192 ++#define p_reg_tuner_data_207_200 0xF019 ++#define reg_tuner_data_207_200_pos 0 ++#define reg_tuner_data_207_200_len 8 ++#define reg_tuner_data_207_200_lsb 200 ++#define p_reg_tuner_data_215_208 0xF01A ++#define reg_tuner_data_215_208_pos 0 ++#define reg_tuner_data_215_208_len 8 ++#define reg_tuner_data_215_208_lsb 208 ++#define p_reg_tuner_data_223_216 0xF01B ++#define reg_tuner_data_223_216_pos 0 ++#define reg_tuner_data_223_216_len 8 ++#define reg_tuner_data_223_216_lsb 216 ++#define p_reg_tuner_data_231_224 0xF01C ++#define reg_tuner_data_231_224_pos 0 ++#define reg_tuner_data_231_224_len 8 ++#define reg_tuner_data_231_224_lsb 224 ++#define p_reg_tuner_data_239_232 0xF01D ++#define reg_tuner_data_239_232_pos 0 ++#define reg_tuner_data_239_232_len 8 ++#define reg_tuner_data_239_232_lsb 232 ++#define p_reg_tuner_data_247_240 0xF01E ++#define reg_tuner_data_247_240_pos 0 ++#define reg_tuner_data_247_240_len 8 ++#define reg_tuner_data_247_240_lsb 240 ++#define p_reg_tuner_data_255_248 0xF01F ++#define reg_tuner_data_255_248_pos 0 ++#define reg_tuner_data_255_248_len 8 ++#define reg_tuner_data_255_248_lsb 248 ++#define p_reg_tuner_data_263_256 0xF020 ++#define reg_tuner_data_263_256_pos 0 ++#define reg_tuner_data_263_256_len 8 ++#define reg_tuner_data_263_256_lsb 256 ++#define p_reg_tuner_data_271_264 0xF021 ++#define reg_tuner_data_271_264_pos 0 ++#define reg_tuner_data_271_264_len 8 ++#define reg_tuner_data_271_264_lsb 264 ++#define p_reg_tuner_data_279_272 0xF022 ++#define reg_tuner_data_279_272_pos 0 ++#define reg_tuner_data_279_272_len 8 ++#define reg_tuner_data_279_272_lsb 272 ++#define p_reg_tuner_data_287_280 0xF023 ++#define reg_tuner_data_287_280_pos 0 ++#define reg_tuner_data_287_280_len 8 ++#define reg_tuner_data_287_280_lsb 280 ++#define p_reg_tuner_data_295_288 0xF024 ++#define reg_tuner_data_295_288_pos 0 ++#define reg_tuner_data_295_288_len 8 ++#define reg_tuner_data_295_288_lsb 288 ++#define p_reg_tuner_data_303_296 0xF025 ++#define reg_tuner_data_303_296_pos 0 ++#define reg_tuner_data_303_296_len 8 ++#define reg_tuner_data_303_296_lsb 296 ++#define p_reg_tuner_data_311_304 0xF026 ++#define reg_tuner_data_311_304_pos 0 ++#define reg_tuner_data_311_304_len 8 ++#define reg_tuner_data_311_304_lsb 304 ++#define p_reg_tuner_data_319_312 0xF027 ++#define reg_tuner_data_319_312_pos 0 ++#define reg_tuner_data_319_312_len 8 ++#define reg_tuner_data_319_312_lsb 312 ++#define p_reg_tuner_data_327_320 0xF028 ++#define reg_tuner_data_327_320_pos 0 ++#define reg_tuner_data_327_320_len 8 ++#define reg_tuner_data_327_320_lsb 320 ++#define p_reg_tuner_data_335_328 0xF029 ++#define reg_tuner_data_335_328_pos 0 ++#define reg_tuner_data_335_328_len 8 ++#define reg_tuner_data_335_328_lsb 328 ++#define p_reg_tuner_data_343_336 0xF02A ++#define reg_tuner_data_343_336_pos 0 ++#define reg_tuner_data_343_336_len 8 ++#define reg_tuner_data_343_336_lsb 336 ++#define p_reg_tuner_data_351_344 0xF02B ++#define reg_tuner_data_351_344_pos 0 ++#define reg_tuner_data_351_344_len 8 ++#define reg_tuner_data_351_344_lsb 344 ++#define p_reg_tuner_data_359_352 0xF02C ++#define reg_tuner_data_359_352_pos 0 ++#define reg_tuner_data_359_352_len 8 ++#define reg_tuner_data_359_352_lsb 352 ++#define p_reg_tuner_data_367_360 0xF02D ++#define reg_tuner_data_367_360_pos 0 ++#define reg_tuner_data_367_360_len 8 ++#define reg_tuner_data_367_360_lsb 360 ++#define p_reg_tuner_data_375_368 0xF02E ++#define reg_tuner_data_375_368_pos 0 ++#define reg_tuner_data_375_368_len 8 ++#define reg_tuner_data_375_368_lsb 368 ++#define p_reg_tuner_data_383_376 0xF02F ++#define reg_tuner_data_383_376_pos 0 ++#define reg_tuner_data_383_376_len 8 ++#define reg_tuner_data_383_376_lsb 376 ++#define p_reg_tuner_data_391_384 0xF030 ++#define reg_tuner_data_391_384_pos 0 ++#define reg_tuner_data_391_384_len 8 ++#define reg_tuner_data_391_384_lsb 384 ++#define p_reg_tuner_data_399_392 0xF031 ++#define reg_tuner_data_399_392_pos 0 ++#define reg_tuner_data_399_392_len 8 ++#define reg_tuner_data_399_392_lsb 392 ++#define p_reg_tuner_data_407_400 0xF032 ++#define reg_tuner_data_407_400_pos 0 ++#define reg_tuner_data_407_400_len 8 ++#define reg_tuner_data_407_400_lsb 400 ++#define p_reg_tuner_data_415_408 0xF033 ++#define reg_tuner_data_415_408_pos 0 ++#define reg_tuner_data_415_408_len 8 ++#define reg_tuner_data_415_408_lsb 408 ++#define p_reg_tuner_data_423_416 0xF034 ++#define reg_tuner_data_423_416_pos 0 ++#define reg_tuner_data_423_416_len 8 ++#define reg_tuner_data_423_416_lsb 416 ++#define p_reg_tuner_data_431_424 0xF035 ++#define reg_tuner_data_431_424_pos 0 ++#define reg_tuner_data_431_424_len 8 ++#define reg_tuner_data_431_424_lsb 424 ++#define p_reg_tuner_data_439_432 0xF036 ++#define reg_tuner_data_439_432_pos 0 ++#define reg_tuner_data_439_432_len 8 ++#define reg_tuner_data_439_432_lsb 432 ++#define p_reg_tuner_data_447_440 0xF037 ++#define reg_tuner_data_447_440_pos 0 ++#define reg_tuner_data_447_440_len 8 ++#define reg_tuner_data_447_440_lsb 440 ++#define p_reg_tuner_data_455_448 0xF038 ++#define reg_tuner_data_455_448_pos 0 ++#define reg_tuner_data_455_448_len 8 ++#define reg_tuner_data_455_448_lsb 448 ++#define p_reg_tuner_data_463_456 0xF039 ++#define reg_tuner_data_463_456_pos 0 ++#define reg_tuner_data_463_456_len 8 ++#define reg_tuner_data_463_456_lsb 456 ++#define p_reg_tuner_data_471_464 0xF03A ++#define reg_tuner_data_471_464_pos 0 ++#define reg_tuner_data_471_464_len 8 ++#define reg_tuner_data_471_464_lsb 464 ++#define p_reg_tuner_data_479_472 0xF03B ++#define reg_tuner_data_479_472_pos 0 ++#define reg_tuner_data_479_472_len 8 ++#define reg_tuner_data_479_472_lsb 472 ++#define p_reg_tuner_data_487_480 0xF03C ++#define reg_tuner_data_487_480_pos 0 ++#define reg_tuner_data_487_480_len 8 ++#define reg_tuner_data_487_480_lsb 480 ++#define p_reg_tuner_data_495_488 0xF03D ++#define reg_tuner_data_495_488_pos 0 ++#define reg_tuner_data_495_488_len 8 ++#define reg_tuner_data_495_488_lsb 488 ++#define p_reg_tuner_data_503_496 0xF03E ++#define reg_tuner_data_503_496_pos 0 ++#define reg_tuner_data_503_496_len 8 ++#define reg_tuner_data_503_496_lsb 496 ++#define p_reg_tuner_data_511_504 0xF03F ++#define reg_tuner_data_511_504_pos 0 ++#define reg_tuner_data_511_504_len 8 ++#define reg_tuner_data_511_504_lsb 504 ++#define p_reg_tuner_data_519_512 0xF040 ++#define reg_tuner_data_519_512_pos 0 ++#define reg_tuner_data_519_512_len 8 ++#define reg_tuner_data_519_512_lsb 512 ++#define p_reg_tuner_data_527_520 0xF041 ++#define reg_tuner_data_527_520_pos 0 ++#define reg_tuner_data_527_520_len 8 ++#define reg_tuner_data_527_520_lsb 520 ++#define p_reg_tuner_data_535_528 0xF042 ++#define reg_tuner_data_535_528_pos 0 ++#define reg_tuner_data_535_528_len 8 ++#define reg_tuner_data_535_528_lsb 528 ++#define p_reg_tuner_data_543_536 0xF043 ++#define reg_tuner_data_543_536_pos 0 ++#define reg_tuner_data_543_536_len 8 ++#define reg_tuner_data_543_536_lsb 536 ++#define p_reg_tuner_data_551_544 0xF044 ++#define reg_tuner_data_551_544_pos 0 ++#define reg_tuner_data_551_544_len 8 ++#define reg_tuner_data_551_544_lsb 544 ++#define p_reg_tuner_data_559_552 0xF045 ++#define reg_tuner_data_559_552_pos 0 ++#define reg_tuner_data_559_552_len 8 ++#define reg_tuner_data_559_552_lsb 552 ++#define p_reg_tuner_data_567_560 0xF046 ++#define reg_tuner_data_567_560_pos 0 ++#define reg_tuner_data_567_560_len 8 ++#define reg_tuner_data_567_560_lsb 560 ++#define p_reg_tuner_data_575_568 0xF047 ++#define reg_tuner_data_575_568_pos 0 ++#define reg_tuner_data_575_568_len 8 ++#define reg_tuner_data_575_568_lsb 568 ++#define p_reg_tuner_data_583_576 0xF048 ++#define reg_tuner_data_583_576_pos 0 ++#define reg_tuner_data_583_576_len 8 ++#define reg_tuner_data_583_576_lsb 576 ++#define p_reg_tuner_data_591_584 0xF049 ++#define reg_tuner_data_591_584_pos 0 ++#define reg_tuner_data_591_584_len 8 ++#define reg_tuner_data_591_584_lsb 584 ++#define p_reg_tuner_data_599_592 0xF04A ++#define reg_tuner_data_599_592_pos 0 ++#define reg_tuner_data_599_592_len 8 ++#define reg_tuner_data_599_592_lsb 592 ++#define p_reg_tuner_data_607_600 0xF04B ++#define reg_tuner_data_607_600_pos 0 ++#define reg_tuner_data_607_600_len 8 ++#define reg_tuner_data_607_600_lsb 600 ++#define p_reg_tuner_data_615_608 0xF04C ++#define reg_tuner_data_615_608_pos 0 ++#define reg_tuner_data_615_608_len 8 ++#define reg_tuner_data_615_608_lsb 608 ++#define p_reg_tuner_data_623_616 0xF04D ++#define reg_tuner_data_623_616_pos 0 ++#define reg_tuner_data_623_616_len 8 ++#define reg_tuner_data_623_616_lsb 616 ++#define p_reg_tuner_data_631_624 0xF04E ++#define reg_tuner_data_631_624_pos 0 ++#define reg_tuner_data_631_624_len 8 ++#define reg_tuner_data_631_624_lsb 624 ++#define p_reg_tuner_data_639_632 0xF04F ++#define reg_tuner_data_639_632_pos 0 ++#define reg_tuner_data_639_632_len 8 ++#define reg_tuner_data_639_632_lsb 632 ++#define p_reg_tuner_data_647_640 0xF050 ++#define reg_tuner_data_647_640_pos 0 ++#define reg_tuner_data_647_640_len 8 ++#define reg_tuner_data_647_640_lsb 640 ++#define p_reg_tuner_data_655_648 0xF051 ++#define reg_tuner_data_655_648_pos 0 ++#define reg_tuner_data_655_648_len 8 ++#define reg_tuner_data_655_648_lsb 648 ++#define p_reg_tuner_data_663_656 0xF052 ++#define reg_tuner_data_663_656_pos 0 ++#define reg_tuner_data_663_656_len 8 ++#define reg_tuner_data_663_656_lsb 656 ++#define p_reg_tuner_data_671_664 0xF053 ++#define reg_tuner_data_671_664_pos 0 ++#define reg_tuner_data_671_664_len 8 ++#define reg_tuner_data_671_664_lsb 664 ++#define p_reg_tuner_data_679_672 0xF054 ++#define reg_tuner_data_679_672_pos 0 ++#define reg_tuner_data_679_672_len 8 ++#define reg_tuner_data_679_672_lsb 672 ++#define p_reg_tuner_data_687_680 0xF055 ++#define reg_tuner_data_687_680_pos 0 ++#define reg_tuner_data_687_680_len 8 ++#define reg_tuner_data_687_680_lsb 680 ++#define p_reg_tuner_data_695_688 0xF056 ++#define reg_tuner_data_695_688_pos 0 ++#define reg_tuner_data_695_688_len 8 ++#define reg_tuner_data_695_688_lsb 688 ++#define p_reg_tuner_data_703_696 0xF057 ++#define reg_tuner_data_703_696_pos 0 ++#define reg_tuner_data_703_696_len 8 ++#define reg_tuner_data_703_696_lsb 696 ++#define p_reg_tuner_data_711_704 0xF058 ++#define reg_tuner_data_711_704_pos 0 ++#define reg_tuner_data_711_704_len 8 ++#define reg_tuner_data_711_704_lsb 704 ++#define p_reg_tuner_data_719_712 0xF059 ++#define reg_tuner_data_719_712_pos 0 ++#define reg_tuner_data_719_712_len 8 ++#define reg_tuner_data_719_712_lsb 712 ++#define p_reg_tuner_data_727_720 0xF05A ++#define reg_tuner_data_727_720_pos 0 ++#define reg_tuner_data_727_720_len 8 ++#define reg_tuner_data_727_720_lsb 720 ++#define p_reg_tuner_data_735_728 0xF05B ++#define reg_tuner_data_735_728_pos 0 ++#define reg_tuner_data_735_728_len 8 ++#define reg_tuner_data_735_728_lsb 728 ++#define p_reg_tuner_data_743_736 0xF05C ++#define reg_tuner_data_743_736_pos 0 ++#define reg_tuner_data_743_736_len 8 ++#define reg_tuner_data_743_736_lsb 736 ++#define p_reg_tuner_data_751_744 0xF05D ++#define reg_tuner_data_751_744_pos 0 ++#define reg_tuner_data_751_744_len 8 ++#define reg_tuner_data_751_744_lsb 744 ++#define p_reg_tuner_data_759_752 0xF05E ++#define reg_tuner_data_759_752_pos 0 ++#define reg_tuner_data_759_752_len 8 ++#define reg_tuner_data_759_752_lsb 752 ++#define p_reg_tuner_data_767_760 0xF05F ++#define reg_tuner_data_767_760_pos 0 ++#define reg_tuner_data_767_760_len 8 ++#define reg_tuner_data_767_760_lsb 760 ++#define p_reg_tuner_data_775_768 0xF060 ++#define reg_tuner_data_775_768_pos 0 ++#define reg_tuner_data_775_768_len 8 ++#define reg_tuner_data_775_768_lsb 768 ++#define p_reg_tuner_data_783_776 0xF061 ++#define reg_tuner_data_783_776_pos 0 ++#define reg_tuner_data_783_776_len 8 ++#define reg_tuner_data_783_776_lsb 776 ++#define p_reg_tuner_data_791_784 0xF062 ++#define reg_tuner_data_791_784_pos 0 ++#define reg_tuner_data_791_784_len 8 ++#define reg_tuner_data_791_784_lsb 784 ++#define p_reg_tuner_data_799_792 0xF063 ++#define reg_tuner_data_799_792_pos 0 ++#define reg_tuner_data_799_792_len 8 ++#define reg_tuner_data_799_792_lsb 792 ++#define p_reg_tuner_data_807_800 0xF064 ++#define reg_tuner_data_807_800_pos 0 ++#define reg_tuner_data_807_800_len 8 ++#define reg_tuner_data_807_800_lsb 800 ++#define p_reg_tuner_data_815_808 0xF065 ++#define reg_tuner_data_815_808_pos 0 ++#define reg_tuner_data_815_808_len 8 ++#define reg_tuner_data_815_808_lsb 808 ++#define p_reg_tuner_data_823_816 0xF066 ++#define reg_tuner_data_823_816_pos 0 ++#define reg_tuner_data_823_816_len 8 ++#define reg_tuner_data_823_816_lsb 816 ++#define p_reg_tuner_data_831_824 0xF067 ++#define reg_tuner_data_831_824_pos 0 ++#define reg_tuner_data_831_824_len 8 ++#define reg_tuner_data_831_824_lsb 824 ++#define p_reg_tuner_data_839_832 0xF068 ++#define reg_tuner_data_839_832_pos 0 ++#define reg_tuner_data_839_832_len 8 ++#define reg_tuner_data_839_832_lsb 832 ++#define p_reg_tuner_data_847_840 0xF069 ++#define reg_tuner_data_847_840_pos 0 ++#define reg_tuner_data_847_840_len 8 ++#define reg_tuner_data_847_840_lsb 840 ++#define p_reg_tuner_data_855_848 0xF06A ++#define reg_tuner_data_855_848_pos 0 ++#define reg_tuner_data_855_848_len 8 ++#define reg_tuner_data_855_848_lsb 848 ++#define p_reg_tuner_data_863_856 0xF06B ++#define reg_tuner_data_863_856_pos 0 ++#define reg_tuner_data_863_856_len 8 ++#define reg_tuner_data_863_856_lsb 856 ++#define p_reg_tuner_data_871_864 0xF06C ++#define reg_tuner_data_871_864_pos 0 ++#define reg_tuner_data_871_864_len 8 ++#define reg_tuner_data_871_864_lsb 864 ++#define p_reg_tuner_data_879_872 0xF06D ++#define reg_tuner_data_879_872_pos 0 ++#define reg_tuner_data_879_872_len 8 ++#define reg_tuner_data_879_872_lsb 872 ++#define p_reg_tuner_data_887_880 0xF06E ++#define reg_tuner_data_887_880_pos 0 ++#define reg_tuner_data_887_880_len 8 ++#define reg_tuner_data_887_880_lsb 880 ++#define p_reg_tuner_data_895_888 0xF06F ++#define reg_tuner_data_895_888_pos 0 ++#define reg_tuner_data_895_888_len 8 ++#define reg_tuner_data_895_888_lsb 888 ++#define p_reg_tuner_data_903_896 0xF070 ++#define reg_tuner_data_903_896_pos 0 ++#define reg_tuner_data_903_896_len 8 ++#define reg_tuner_data_903_896_lsb 896 ++#define p_reg_tuner_data_911_904 0xF071 ++#define reg_tuner_data_911_904_pos 0 ++#define reg_tuner_data_911_904_len 8 ++#define reg_tuner_data_911_904_lsb 904 ++#define p_reg_tuner_data_919_912 0xF072 ++#define reg_tuner_data_919_912_pos 0 ++#define reg_tuner_data_919_912_len 8 ++#define reg_tuner_data_919_912_lsb 912 ++#define p_reg_tuner_data_927_920 0xF073 ++#define reg_tuner_data_927_920_pos 0 ++#define reg_tuner_data_927_920_len 8 ++#define reg_tuner_data_927_920_lsb 920 ++#define p_reg_tuner_data_935_928 0xF074 ++#define reg_tuner_data_935_928_pos 0 ++#define reg_tuner_data_935_928_len 8 ++#define reg_tuner_data_935_928_lsb 928 ++#define p_reg_tuner_data_943_936 0xF075 ++#define reg_tuner_data_943_936_pos 0 ++#define reg_tuner_data_943_936_len 8 ++#define reg_tuner_data_943_936_lsb 936 ++#define p_reg_tuner_data_951_944 0xF076 ++#define reg_tuner_data_951_944_pos 0 ++#define reg_tuner_data_951_944_len 8 ++#define reg_tuner_data_951_944_lsb 944 ++#define p_reg_tuner_data_959_952 0xF077 ++#define reg_tuner_data_959_952_pos 0 ++#define reg_tuner_data_959_952_len 8 ++#define reg_tuner_data_959_952_lsb 952 ++#define p_reg_tuner_data_967_960 0xF078 ++#define reg_tuner_data_967_960_pos 0 ++#define reg_tuner_data_967_960_len 8 ++#define reg_tuner_data_967_960_lsb 960 ++#define p_reg_tuner_data_975_968 0xF079 ++#define reg_tuner_data_975_968_pos 0 ++#define reg_tuner_data_975_968_len 8 ++#define reg_tuner_data_975_968_lsb 968 ++#define p_reg_tuner_data_983_976 0xF07A ++#define reg_tuner_data_983_976_pos 0 ++#define reg_tuner_data_983_976_len 8 ++#define reg_tuner_data_983_976_lsb 976 ++#define p_reg_tuner_data_991_984 0xF07B ++#define reg_tuner_data_991_984_pos 0 ++#define reg_tuner_data_991_984_len 8 ++#define reg_tuner_data_991_984_lsb 984 ++#define p_reg_tuner_data_999_992 0xF07C ++#define reg_tuner_data_999_992_pos 0 ++#define reg_tuner_data_999_992_len 8 ++#define reg_tuner_data_999_992_lsb 992 ++#define p_reg_tuner_data_1007_1000 0xF07D ++#define reg_tuner_data_1007_1000_pos 0 ++#define reg_tuner_data_1007_1000_len 8 ++#define reg_tuner_data_1007_1000_lsb 1000 ++#define p_reg_tuner_data_1015_1008 0xF07E ++#define reg_tuner_data_1015_1008_pos 0 ++#define reg_tuner_data_1015_1008_len 8 ++#define reg_tuner_data_1015_1008_lsb 1008 ++#define p_reg_tuner_data_1023_1016 0xF07F ++#define reg_tuner_data_1023_1016_pos 0 ++#define reg_tuner_data_1023_1016_len 8 ++#define reg_tuner_data_1023_1016_lsb 1016 ++#define p_reg_tuner_data_1031_1024 0xF080 ++#define reg_tuner_data_1031_1024_pos 0 ++#define reg_tuner_data_1031_1024_len 8 ++#define reg_tuner_data_1031_1024_lsb 1024 ++#define p_reg_tuner_data_1039_1032 0xF081 ++#define reg_tuner_data_1039_1032_pos 0 ++#define reg_tuner_data_1039_1032_len 8 ++#define reg_tuner_data_1039_1032_lsb 1032 ++#define p_reg_tuner_data_1047_1040 0xF082 ++#define reg_tuner_data_1047_1040_pos 0 ++#define reg_tuner_data_1047_1040_len 8 ++#define reg_tuner_data_1047_1040_lsb 1040 ++#define p_reg_tuner_data_1055_1048 0xF083 ++#define reg_tuner_data_1055_1048_pos 0 ++#define reg_tuner_data_1055_1048_len 8 ++#define reg_tuner_data_1055_1048_lsb 1048 ++#define p_reg_tuner_data_1063_1056 0xF084 ++#define reg_tuner_data_1063_1056_pos 0 ++#define reg_tuner_data_1063_1056_len 8 ++#define reg_tuner_data_1063_1056_lsb 1056 ++#define p_reg_tuner_data_1071_1064 0xF085 ++#define reg_tuner_data_1071_1064_pos 0 ++#define reg_tuner_data_1071_1064_len 8 ++#define reg_tuner_data_1071_1064_lsb 1064 ++#define p_reg_tuner_data_1079_1072 0xF086 ++#define reg_tuner_data_1079_1072_pos 0 ++#define reg_tuner_data_1079_1072_len 8 ++#define reg_tuner_data_1079_1072_lsb 1072 ++#define p_reg_tuner_data_1087_1080 0xF087 ++#define reg_tuner_data_1087_1080_pos 0 ++#define reg_tuner_data_1087_1080_len 8 ++#define reg_tuner_data_1087_1080_lsb 1080 ++#define p_reg_tuner_data_1095_1088 0xF088 ++#define reg_tuner_data_1095_1088_pos 0 ++#define reg_tuner_data_1095_1088_len 8 ++#define reg_tuner_data_1095_1088_lsb 1088 ++#define p_reg_tuner_data_1103_1096 0xF089 ++#define reg_tuner_data_1103_1096_pos 0 ++#define reg_tuner_data_1103_1096_len 8 ++#define reg_tuner_data_1103_1096_lsb 1096 ++#define p_reg_tuner_data_1111_1104 0xF08A ++#define reg_tuner_data_1111_1104_pos 0 ++#define reg_tuner_data_1111_1104_len 8 ++#define reg_tuner_data_1111_1104_lsb 1104 ++#define p_reg_tuner_data_1119_1112 0xF08B ++#define reg_tuner_data_1119_1112_pos 0 ++#define reg_tuner_data_1119_1112_len 8 ++#define reg_tuner_data_1119_1112_lsb 1112 ++#define p_reg_tuner_data_1127_1120 0xF08C ++#define reg_tuner_data_1127_1120_pos 0 ++#define reg_tuner_data_1127_1120_len 8 ++#define reg_tuner_data_1127_1120_lsb 1120 ++#define p_reg_tuner_data_1135_1128 0xF08D ++#define reg_tuner_data_1135_1128_pos 0 ++#define reg_tuner_data_1135_1128_len 8 ++#define reg_tuner_data_1135_1128_lsb 1128 ++#define p_reg_tuner_data_1143_1136 0xF08E ++#define reg_tuner_data_1143_1136_pos 0 ++#define reg_tuner_data_1143_1136_len 8 ++#define reg_tuner_data_1143_1136_lsb 1136 ++#define p_reg_tuner_data_1151_1144 0xF08F ++#define reg_tuner_data_1151_1144_pos 0 ++#define reg_tuner_data_1151_1144_len 8 ++#define reg_tuner_data_1151_1144_lsb 1144 ++#define p_reg_tuner_data_1159_1152 0xF090 ++#define reg_tuner_data_1159_1152_pos 0 ++#define reg_tuner_data_1159_1152_len 8 ++#define reg_tuner_data_1159_1152_lsb 1152 ++#define p_reg_tuner_data_1167_1160 0xF091 ++#define reg_tuner_data_1167_1160_pos 0 ++#define reg_tuner_data_1167_1160_len 8 ++#define reg_tuner_data_1167_1160_lsb 1160 ++#define p_reg_tuner_data_1175_1168 0xF092 ++#define reg_tuner_data_1175_1168_pos 0 ++#define reg_tuner_data_1175_1168_len 8 ++#define reg_tuner_data_1175_1168_lsb 1168 ++#define p_reg_tuner_data_1183_1176 0xF093 ++#define reg_tuner_data_1183_1176_pos 0 ++#define reg_tuner_data_1183_1176_len 8 ++#define reg_tuner_data_1183_1176_lsb 1176 ++#define p_reg_tuner_data_1191_1184 0xF094 ++#define reg_tuner_data_1191_1184_pos 0 ++#define reg_tuner_data_1191_1184_len 8 ++#define reg_tuner_data_1191_1184_lsb 1184 ++#define p_reg_tuner_data_1199_1192 0xF095 ++#define reg_tuner_data_1199_1192_pos 0 ++#define reg_tuner_data_1199_1192_len 8 ++#define reg_tuner_data_1199_1192_lsb 1192 ++#define p_reg_tuner_data_1207_1200 0xF096 ++#define reg_tuner_data_1207_1200_pos 0 ++#define reg_tuner_data_1207_1200_len 8 ++#define reg_tuner_data_1207_1200_lsb 1200 ++#define p_reg_tuner_data_1215_1208 0xF097 ++#define reg_tuner_data_1215_1208_pos 0 ++#define reg_tuner_data_1215_1208_len 8 ++#define reg_tuner_data_1215_1208_lsb 1208 ++#define p_reg_tuner_data_1223_1216 0xF098 ++#define reg_tuner_data_1223_1216_pos 0 ++#define reg_tuner_data_1223_1216_len 8 ++#define reg_tuner_data_1223_1216_lsb 1216 ++#define p_reg_tuner_data_1231_1224 0xF099 ++#define reg_tuner_data_1231_1224_pos 0 ++#define reg_tuner_data_1231_1224_len 8 ++#define reg_tuner_data_1231_1224_lsb 1224 ++#define p_reg_tuner_data_1239_1232 0xF09A ++#define reg_tuner_data_1239_1232_pos 0 ++#define reg_tuner_data_1239_1232_len 8 ++#define reg_tuner_data_1239_1232_lsb 1232 ++#define p_reg_tuner_data_1247_1240 0xF09B ++#define reg_tuner_data_1247_1240_pos 0 ++#define reg_tuner_data_1247_1240_len 8 ++#define reg_tuner_data_1247_1240_lsb 1240 ++#define p_reg_tuner_data_1255_1248 0xF09C ++#define reg_tuner_data_1255_1248_pos 0 ++#define reg_tuner_data_1255_1248_len 8 ++#define reg_tuner_data_1255_1248_lsb 1248 ++#define p_reg_tuner_data_1263_1256 0xF09D ++#define reg_tuner_data_1263_1256_pos 0 ++#define reg_tuner_data_1263_1256_len 8 ++#define reg_tuner_data_1263_1256_lsb 1256 ++#define p_reg_tuner_data_1271_1264 0xF09E ++#define reg_tuner_data_1271_1264_pos 0 ++#define reg_tuner_data_1271_1264_len 8 ++#define reg_tuner_data_1271_1264_lsb 1264 ++#define p_reg_tuner_data_1279_1272 0xF09F ++#define reg_tuner_data_1279_1272_pos 0 ++#define reg_tuner_data_1279_1272_len 8 ++#define reg_tuner_data_1279_1272_lsb 1272 ++#define p_reg_tuner_data_1287_1280 0xF0A0 ++#define reg_tuner_data_1287_1280_pos 0 ++#define reg_tuner_data_1287_1280_len 8 ++#define reg_tuner_data_1287_1280_lsb 1280 ++#define p_reg_tuner_data_1295_1288 0xF0A1 ++#define reg_tuner_data_1295_1288_pos 0 ++#define reg_tuner_data_1295_1288_len 8 ++#define reg_tuner_data_1295_1288_lsb 1288 ++#define p_reg_tuner_data_1303_1296 0xF0A2 ++#define reg_tuner_data_1303_1296_pos 0 ++#define reg_tuner_data_1303_1296_len 8 ++#define reg_tuner_data_1303_1296_lsb 1296 ++#define p_reg_tuner_data_1311_1304 0xF0A3 ++#define reg_tuner_data_1311_1304_pos 0 ++#define reg_tuner_data_1311_1304_len 8 ++#define reg_tuner_data_1311_1304_lsb 1304 ++#define p_reg_tuner_data_1319_1312 0xF0A4 ++#define reg_tuner_data_1319_1312_pos 0 ++#define reg_tuner_data_1319_1312_len 8 ++#define reg_tuner_data_1319_1312_lsb 1312 ++#define p_reg_tuner_data_1327_1320 0xF0A5 ++#define reg_tuner_data_1327_1320_pos 0 ++#define reg_tuner_data_1327_1320_len 8 ++#define reg_tuner_data_1327_1320_lsb 1320 ++#define p_reg_tuner_data_1335_1328 0xF0A6 ++#define reg_tuner_data_1335_1328_pos 0 ++#define reg_tuner_data_1335_1328_len 8 ++#define reg_tuner_data_1335_1328_lsb 1328 ++#define p_reg_tuner_data_1343_1336 0xF0A7 ++#define reg_tuner_data_1343_1336_pos 0 ++#define reg_tuner_data_1343_1336_len 8 ++#define reg_tuner_data_1343_1336_lsb 1336 ++#define p_reg_tuner_data_1351_1344 0xF0A8 ++#define reg_tuner_data_1351_1344_pos 0 ++#define reg_tuner_data_1351_1344_len 8 ++#define reg_tuner_data_1351_1344_lsb 1344 ++#define p_reg_tuner_data_1359_1352 0xF0A9 ++#define reg_tuner_data_1359_1352_pos 0 ++#define reg_tuner_data_1359_1352_len 8 ++#define reg_tuner_data_1359_1352_lsb 1352 ++#define p_reg_tuner_data_1367_1360 0xF0AA ++#define reg_tuner_data_1367_1360_pos 0 ++#define reg_tuner_data_1367_1360_len 8 ++#define reg_tuner_data_1367_1360_lsb 1360 ++#define p_reg_tuner_data_1375_1368 0xF0AB ++#define reg_tuner_data_1375_1368_pos 0 ++#define reg_tuner_data_1375_1368_len 8 ++#define reg_tuner_data_1375_1368_lsb 1368 ++#define p_reg_tuner_data_1383_1376 0xF0AC ++#define reg_tuner_data_1383_1376_pos 0 ++#define reg_tuner_data_1383_1376_len 8 ++#define reg_tuner_data_1383_1376_lsb 1376 ++#define p_reg_tuner_data_1391_1384 0xF0AD ++#define reg_tuner_data_1391_1384_pos 0 ++#define reg_tuner_data_1391_1384_len 8 ++#define reg_tuner_data_1391_1384_lsb 1384 ++#define p_reg_tuner_data_1399_1392 0xF0AE ++#define reg_tuner_data_1399_1392_pos 0 ++#define reg_tuner_data_1399_1392_len 8 ++#define reg_tuner_data_1399_1392_lsb 1392 ++#define p_reg_tuner_data_1407_1400 0xF0AF ++#define reg_tuner_data_1407_1400_pos 0 ++#define reg_tuner_data_1407_1400_len 8 ++#define reg_tuner_data_1407_1400_lsb 1400 ++#define p_reg_tuner_data_1415_1408 0xF0B0 ++#define reg_tuner_data_1415_1408_pos 0 ++#define reg_tuner_data_1415_1408_len 8 ++#define reg_tuner_data_1415_1408_lsb 1408 ++#define p_reg_tuner_data_1423_1416 0xF0B1 ++#define reg_tuner_data_1423_1416_pos 0 ++#define reg_tuner_data_1423_1416_len 8 ++#define reg_tuner_data_1423_1416_lsb 1416 ++#define p_reg_tuner_data_1431_1424 0xF0B2 ++#define reg_tuner_data_1431_1424_pos 0 ++#define reg_tuner_data_1431_1424_len 8 ++#define reg_tuner_data_1431_1424_lsb 1424 ++#define p_reg_tuner_data_1439_1432 0xF0B3 ++#define reg_tuner_data_1439_1432_pos 0 ++#define reg_tuner_data_1439_1432_len 8 ++#define reg_tuner_data_1439_1432_lsb 1432 ++#define p_reg_tuner_data_1447_1440 0xF0B4 ++#define reg_tuner_data_1447_1440_pos 0 ++#define reg_tuner_data_1447_1440_len 8 ++#define reg_tuner_data_1447_1440_lsb 1440 ++#define p_reg_tuner_data_1455_1448 0xF0B5 ++#define reg_tuner_data_1455_1448_pos 0 ++#define reg_tuner_data_1455_1448_len 8 ++#define reg_tuner_data_1455_1448_lsb 1448 ++#define p_reg_tuner_data_1463_1456 0xF0B6 ++#define reg_tuner_data_1463_1456_pos 0 ++#define reg_tuner_data_1463_1456_len 8 ++#define reg_tuner_data_1463_1456_lsb 1456 ++#define p_reg_tuner_data_1471_1464 0xF0B7 ++#define reg_tuner_data_1471_1464_pos 0 ++#define reg_tuner_data_1471_1464_len 8 ++#define reg_tuner_data_1471_1464_lsb 1464 ++#define p_reg_tuner_data_1479_1472 0xF0B8 ++#define reg_tuner_data_1479_1472_pos 0 ++#define reg_tuner_data_1479_1472_len 8 ++#define reg_tuner_data_1479_1472_lsb 1472 ++#define p_reg_tuner_data_1487_1480 0xF0B9 ++#define reg_tuner_data_1487_1480_pos 0 ++#define reg_tuner_data_1487_1480_len 8 ++#define reg_tuner_data_1487_1480_lsb 1480 ++#define p_reg_tuner_data_1495_1488 0xF0BA ++#define reg_tuner_data_1495_1488_pos 0 ++#define reg_tuner_data_1495_1488_len 8 ++#define reg_tuner_data_1495_1488_lsb 1488 ++#define p_reg_tuner_data_1503_1496 0xF0BB ++#define reg_tuner_data_1503_1496_pos 0 ++#define reg_tuner_data_1503_1496_len 8 ++#define reg_tuner_data_1503_1496_lsb 1496 ++#define p_reg_tuner_data_1511_1504 0xF0BC ++#define reg_tuner_data_1511_1504_pos 0 ++#define reg_tuner_data_1511_1504_len 8 ++#define reg_tuner_data_1511_1504_lsb 1504 ++#define p_reg_tuner_data_1519_1512 0xF0BD ++#define reg_tuner_data_1519_1512_pos 0 ++#define reg_tuner_data_1519_1512_len 8 ++#define reg_tuner_data_1519_1512_lsb 1512 ++#define p_reg_tuner_data_1527_1520 0xF0BE ++#define reg_tuner_data_1527_1520_pos 0 ++#define reg_tuner_data_1527_1520_len 8 ++#define reg_tuner_data_1527_1520_lsb 1520 ++#define p_reg_tuner_data_1535_1528 0xF0BF ++#define reg_tuner_data_1535_1528_pos 0 ++#define reg_tuner_data_1535_1528_len 8 ++#define reg_tuner_data_1535_1528_lsb 1528 ++#define p_reg_tuner_data_1543_1536 0xF0C0 ++#define reg_tuner_data_1543_1536_pos 0 ++#define reg_tuner_data_1543_1536_len 8 ++#define reg_tuner_data_1543_1536_lsb 1536 ++#define p_reg_tuner_data_1551_1544 0xF0C1 ++#define reg_tuner_data_1551_1544_pos 0 ++#define reg_tuner_data_1551_1544_len 8 ++#define reg_tuner_data_1551_1544_lsb 1544 ++#define p_reg_tuner_data_1559_1552 0xF0C2 ++#define reg_tuner_data_1559_1552_pos 0 ++#define reg_tuner_data_1559_1552_len 8 ++#define reg_tuner_data_1559_1552_lsb 1552 ++#define p_reg_tuner_data_1567_1560 0xF0C3 ++#define reg_tuner_data_1567_1560_pos 0 ++#define reg_tuner_data_1567_1560_len 8 ++#define reg_tuner_data_1567_1560_lsb 1560 ++#define p_reg_tuner_data_1575_1568 0xF0C4 ++#define reg_tuner_data_1575_1568_pos 0 ++#define reg_tuner_data_1575_1568_len 8 ++#define reg_tuner_data_1575_1568_lsb 1568 ++#define p_reg_tuner_data_1583_1576 0xF0C5 ++#define reg_tuner_data_1583_1576_pos 0 ++#define reg_tuner_data_1583_1576_len 8 ++#define reg_tuner_data_1583_1576_lsb 1576 ++#define p_reg_tuner_data_1591_1584 0xF0C6 ++#define reg_tuner_data_1591_1584_pos 0 ++#define reg_tuner_data_1591_1584_len 8 ++#define reg_tuner_data_1591_1584_lsb 1584 ++#define p_reg_tuner_data_1599_1592 0xF0C7 ++#define reg_tuner_data_1599_1592_pos 0 ++#define reg_tuner_data_1599_1592_len 8 ++#define reg_tuner_data_1599_1592_lsb 1592 ++#define p_reg_tuner_data_1607_1600 0xF0C8 ++#define reg_tuner_data_1607_1600_pos 0 ++#define reg_tuner_data_1607_1600_len 8 ++#define reg_tuner_data_1607_1600_lsb 1600 ++#define p_reg_tuner_data_1615_1608 0xF0C9 ++#define reg_tuner_data_1615_1608_pos 0 ++#define reg_tuner_data_1615_1608_len 8 ++#define reg_tuner_data_1615_1608_lsb 1608 ++#define p_reg_tuner_data_1623_1616 0xF0CA ++#define reg_tuner_data_1623_1616_pos 0 ++#define reg_tuner_data_1623_1616_len 8 ++#define reg_tuner_data_1623_1616_lsb 1616 ++#define p_reg_tuner_data_1631_1624 0xF0CB ++#define reg_tuner_data_1631_1624_pos 0 ++#define reg_tuner_data_1631_1624_len 8 ++#define reg_tuner_data_1631_1624_lsb 1624 ++#define p_reg_tuner_data_1639_1632 0xF0CC ++#define reg_tuner_data_1639_1632_pos 0 ++#define reg_tuner_data_1639_1632_len 8 ++#define reg_tuner_data_1639_1632_lsb 1632 ++#define p_reg_tuner_data_1647_1640 0xF0CD ++#define reg_tuner_data_1647_1640_pos 0 ++#define reg_tuner_data_1647_1640_len 8 ++#define reg_tuner_data_1647_1640_lsb 1640 ++#define p_reg_tuner_data_1655_1648 0xF0CE ++#define reg_tuner_data_1655_1648_pos 0 ++#define reg_tuner_data_1655_1648_len 8 ++#define reg_tuner_data_1655_1648_lsb 1648 ++#define p_reg_tuner_data_1663_1656 0xF0CF ++#define reg_tuner_data_1663_1656_pos 0 ++#define reg_tuner_data_1663_1656_len 8 ++#define reg_tuner_data_1663_1656_lsb 1656 ++#define p_reg_tuner_data_1671_1664 0xF0D0 ++#define reg_tuner_data_1671_1664_pos 0 ++#define reg_tuner_data_1671_1664_len 8 ++#define reg_tuner_data_1671_1664_lsb 1664 ++#define p_reg_tuner_data_1679_1672 0xF0D1 ++#define reg_tuner_data_1679_1672_pos 0 ++#define reg_tuner_data_1679_1672_len 8 ++#define reg_tuner_data_1679_1672_lsb 1672 ++#define p_reg_tuner_data_1687_1680 0xF0D2 ++#define reg_tuner_data_1687_1680_pos 0 ++#define reg_tuner_data_1687_1680_len 8 ++#define reg_tuner_data_1687_1680_lsb 1680 ++#define p_reg_tuner_data_1695_1688 0xF0D3 ++#define reg_tuner_data_1695_1688_pos 0 ++#define reg_tuner_data_1695_1688_len 8 ++#define reg_tuner_data_1695_1688_lsb 1688 ++#define p_reg_tuner_data_1703_1696 0xF0D4 ++#define reg_tuner_data_1703_1696_pos 0 ++#define reg_tuner_data_1703_1696_len 8 ++#define reg_tuner_data_1703_1696_lsb 1696 ++#define p_reg_tuner_data_1711_1704 0xF0D5 ++#define reg_tuner_data_1711_1704_pos 0 ++#define reg_tuner_data_1711_1704_len 8 ++#define reg_tuner_data_1711_1704_lsb 1704 ++#define p_reg_tuner_data_1719_1712 0xF0D6 ++#define reg_tuner_data_1719_1712_pos 0 ++#define reg_tuner_data_1719_1712_len 8 ++#define reg_tuner_data_1719_1712_lsb 1712 ++#define p_reg_tuner_data_1727_1720 0xF0D7 ++#define reg_tuner_data_1727_1720_pos 0 ++#define reg_tuner_data_1727_1720_len 8 ++#define reg_tuner_data_1727_1720_lsb 1720 ++#define p_reg_tuner_data_1735_1728 0xF0D8 ++#define reg_tuner_data_1735_1728_pos 0 ++#define reg_tuner_data_1735_1728_len 8 ++#define reg_tuner_data_1735_1728_lsb 1728 ++#define p_reg_tuner_data_1743_1736 0xF0D9 ++#define reg_tuner_data_1743_1736_pos 0 ++#define reg_tuner_data_1743_1736_len 8 ++#define reg_tuner_data_1743_1736_lsb 1736 ++#define p_reg_tuner_data_1751_1744 0xF0DA ++#define reg_tuner_data_1751_1744_pos 0 ++#define reg_tuner_data_1751_1744_len 8 ++#define reg_tuner_data_1751_1744_lsb 1744 ++#define p_reg_tuner_data_1759_1752 0xF0DB ++#define reg_tuner_data_1759_1752_pos 0 ++#define reg_tuner_data_1759_1752_len 8 ++#define reg_tuner_data_1759_1752_lsb 1752 ++#define p_reg_tuner_data_1767_1760 0xF0DC ++#define reg_tuner_data_1767_1760_pos 0 ++#define reg_tuner_data_1767_1760_len 8 ++#define reg_tuner_data_1767_1760_lsb 1760 ++#define p_reg_tuner_data_1775_1768 0xF0DD ++#define reg_tuner_data_1775_1768_pos 0 ++#define reg_tuner_data_1775_1768_len 8 ++#define reg_tuner_data_1775_1768_lsb 1768 ++#define p_reg_tuner_data_1783_1776 0xF0DE ++#define reg_tuner_data_1783_1776_pos 0 ++#define reg_tuner_data_1783_1776_len 8 ++#define reg_tuner_data_1783_1776_lsb 1776 ++#define p_reg_tuner_data_1791_1784 0xF0DF ++#define reg_tuner_data_1791_1784_pos 0 ++#define reg_tuner_data_1791_1784_len 8 ++#define reg_tuner_data_1791_1784_lsb 1784 ++#define p_reg_tuner_data_1799_1792 0xF0E0 ++#define reg_tuner_data_1799_1792_pos 0 ++#define reg_tuner_data_1799_1792_len 8 ++#define reg_tuner_data_1799_1792_lsb 1792 ++#define p_reg_tuner_data_1807_1800 0xF0E1 ++#define reg_tuner_data_1807_1800_pos 0 ++#define reg_tuner_data_1807_1800_len 8 ++#define reg_tuner_data_1807_1800_lsb 1800 ++#define p_reg_tuner_data_1815_1808 0xF0E2 ++#define reg_tuner_data_1815_1808_pos 0 ++#define reg_tuner_data_1815_1808_len 8 ++#define reg_tuner_data_1815_1808_lsb 1808 ++#define p_reg_tuner_data_1823_1816 0xF0E3 ++#define reg_tuner_data_1823_1816_pos 0 ++#define reg_tuner_data_1823_1816_len 8 ++#define reg_tuner_data_1823_1816_lsb 1816 ++#define p_reg_tuner_data_1831_1824 0xF0E4 ++#define reg_tuner_data_1831_1824_pos 0 ++#define reg_tuner_data_1831_1824_len 8 ++#define reg_tuner_data_1831_1824_lsb 1824 ++#define p_reg_tuner_data_1839_1832 0xF0E5 ++#define reg_tuner_data_1839_1832_pos 0 ++#define reg_tuner_data_1839_1832_len 8 ++#define reg_tuner_data_1839_1832_lsb 1832 ++#define p_reg_tuner_data_1847_1840 0xF0E6 ++#define reg_tuner_data_1847_1840_pos 0 ++#define reg_tuner_data_1847_1840_len 8 ++#define reg_tuner_data_1847_1840_lsb 1840 ++#define p_reg_tuner_data_1855_1848 0xF0E7 ++#define reg_tuner_data_1855_1848_pos 0 ++#define reg_tuner_data_1855_1848_len 8 ++#define reg_tuner_data_1855_1848_lsb 1848 ++#define p_reg_tuner_data_1863_1856 0xF0E8 ++#define reg_tuner_data_1863_1856_pos 0 ++#define reg_tuner_data_1863_1856_len 8 ++#define reg_tuner_data_1863_1856_lsb 1856 ++#define p_reg_tuner_data_1871_1864 0xF0E9 ++#define reg_tuner_data_1871_1864_pos 0 ++#define reg_tuner_data_1871_1864_len 8 ++#define reg_tuner_data_1871_1864_lsb 1864 ++#define p_reg_tuner_data_1879_1872 0xF0EA ++#define reg_tuner_data_1879_1872_pos 0 ++#define reg_tuner_data_1879_1872_len 8 ++#define reg_tuner_data_1879_1872_lsb 1872 ++#define p_reg_tuner_data_1887_1880 0xF0EB ++#define reg_tuner_data_1887_1880_pos 0 ++#define reg_tuner_data_1887_1880_len 8 ++#define reg_tuner_data_1887_1880_lsb 1880 ++#define p_reg_tuner_data_1895_1888 0xF0EC ++#define reg_tuner_data_1895_1888_pos 0 ++#define reg_tuner_data_1895_1888_len 8 ++#define reg_tuner_data_1895_1888_lsb 1888 ++#define p_reg_tuner_data_1903_1896 0xF0ED ++#define reg_tuner_data_1903_1896_pos 0 ++#define reg_tuner_data_1903_1896_len 8 ++#define reg_tuner_data_1903_1896_lsb 1896 ++#define p_reg_tuner_data_1911_1904 0xF0EE ++#define reg_tuner_data_1911_1904_pos 0 ++#define reg_tuner_data_1911_1904_len 8 ++#define reg_tuner_data_1911_1904_lsb 1904 ++#define p_reg_tuner_data_1919_1912 0xF0EF ++#define reg_tuner_data_1919_1912_pos 0 ++#define reg_tuner_data_1919_1912_len 8 ++#define reg_tuner_data_1919_1912_lsb 1912 ++#define p_reg_tuner_data_1927_1920 0xF0F0 ++#define reg_tuner_data_1927_1920_pos 0 ++#define reg_tuner_data_1927_1920_len 8 ++#define reg_tuner_data_1927_1920_lsb 1920 ++#define p_reg_tuner_data_1935_1928 0xF0F1 ++#define reg_tuner_data_1935_1928_pos 0 ++#define reg_tuner_data_1935_1928_len 8 ++#define reg_tuner_data_1935_1928_lsb 1928 ++#define p_reg_tuner_data_1943_1936 0xF0F2 ++#define reg_tuner_data_1943_1936_pos 0 ++#define reg_tuner_data_1943_1936_len 8 ++#define reg_tuner_data_1943_1936_lsb 1936 ++#define p_reg_tuner_data_1951_1944 0xF0F3 ++#define reg_tuner_data_1951_1944_pos 0 ++#define reg_tuner_data_1951_1944_len 8 ++#define reg_tuner_data_1951_1944_lsb 1944 ++#define p_reg_tuner_data_1959_1952 0xF0F4 ++#define reg_tuner_data_1959_1952_pos 0 ++#define reg_tuner_data_1959_1952_len 8 ++#define reg_tuner_data_1959_1952_lsb 1952 ++#define p_reg_tuner_data_1967_1960 0xF0F5 ++#define reg_tuner_data_1967_1960_pos 0 ++#define reg_tuner_data_1967_1960_len 8 ++#define reg_tuner_data_1967_1960_lsb 1960 ++#define p_reg_tuner_data_1975_1968 0xF0F6 ++#define reg_tuner_data_1975_1968_pos 0 ++#define reg_tuner_data_1975_1968_len 8 ++#define reg_tuner_data_1975_1968_lsb 1968 ++#define p_reg_tuner_data_1983_1976 0xF0F7 ++#define reg_tuner_data_1983_1976_pos 0 ++#define reg_tuner_data_1983_1976_len 8 ++#define reg_tuner_data_1983_1976_lsb 1976 ++#define p_reg_tuner_data_1991_1984 0xF0F8 ++#define reg_tuner_data_1991_1984_pos 0 ++#define reg_tuner_data_1991_1984_len 8 ++#define reg_tuner_data_1991_1984_lsb 1984 ++#define p_reg_tuner_data_1999_1992 0xF0F9 ++#define reg_tuner_data_1999_1992_pos 0 ++#define reg_tuner_data_1999_1992_len 8 ++#define reg_tuner_data_1999_1992_lsb 1992 ++#define p_reg_tuner_data_2007_2000 0xF0FA ++#define reg_tuner_data_2007_2000_pos 0 ++#define reg_tuner_data_2007_2000_len 8 ++#define reg_tuner_data_2007_2000_lsb 2000 ++#define p_reg_tuner_data_2015_2008 0xF0FB ++#define reg_tuner_data_2015_2008_pos 0 ++#define reg_tuner_data_2015_2008_len 8 ++#define reg_tuner_data_2015_2008_lsb 2008 ++#define p_reg_tuner_data_2023_2016 0xF0FC ++#define reg_tuner_data_2023_2016_pos 0 ++#define reg_tuner_data_2023_2016_len 8 ++#define reg_tuner_data_2023_2016_lsb 2016 ++#define p_reg_tuner_data_2031_2024 0xF0FD ++#define reg_tuner_data_2031_2024_pos 0 ++#define reg_tuner_data_2031_2024_len 8 ++#define reg_tuner_data_2031_2024_lsb 2024 ++#define p_reg_tuner_data_2039_2032 0xF0FE ++#define reg_tuner_data_2039_2032_pos 0 ++#define reg_tuner_data_2039_2032_len 8 ++#define reg_tuner_data_2039_2032_lsb 2032 ++#define p_reg_tuner_data_2047_2040 0xF0FF ++#define reg_tuner_data_2047_2040_pos 0 ++#define reg_tuner_data_2047_2040_len 8 ++#define reg_tuner_data_2047_2040_lsb 2040 ++#define p_reg_tuner_master_rd_wr 0xF100 ++#define reg_tuner_master_rd_wr_pos 0 ++#define reg_tuner_master_rd_wr_len 1 ++#define reg_tuner_master_rd_wr_lsb 0 ++#define p_reg_tuner_master_length 0xF101 ++#define reg_tuner_master_length_pos 0 ++#define reg_tuner_master_length_len 8 ++#define reg_tuner_master_length_lsb 0 ++#define p_reg_tuner_cmd_exe 0xF102 ++#define reg_tuner_cmd_exe_pos 0 ++#define reg_tuner_cmd_exe_len 1 ++#define reg_tuner_cmd_exe_lsb 0 ++#define p_reg_tuner_wdat_done 0xF102 ++#define reg_tuner_wdat_done_pos 1 ++#define reg_tuner_wdat_done_len 1 ++#define reg_tuner_wdat_done_lsb 0 ++#define p_reg_tuner_wdat_fail 0xF102 ++#define reg_tuner_wdat_fail_pos 2 ++#define reg_tuner_wdat_fail_len 1 ++#define reg_tuner_wdat_fail_lsb 0 ++#define p_reg_tuner_ofsm_i2cm_rdat_rdy 0xF102 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_pos 3 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_len 1 ++#define reg_tuner_ofsm_i2cm_rdat_rdy_lsb 0 ++#define p_reg_tuner_current_state 0xF102 ++#define reg_tuner_current_state_pos 4 ++#define reg_tuner_current_state_len 3 ++#define reg_tuner_current_state_lsb 0 ++#define p_reg_one_cycle_counter_tuner 0xF103 ++#define reg_one_cycle_counter_tuner_pos 0 ++#define reg_one_cycle_counter_tuner_len 8 ++#define reg_one_cycle_counter_tuner_lsb 0 ++#define p_reg_msb_lsb 0xF104 ++#define reg_msb_lsb_pos 0 ++#define reg_msb_lsb_len 1 ++#define reg_msb_lsb_lsb 0 ++#define p_reg_ofdm_rst 0xF104 ++#define p_reg_sel_thirdi2c 0xF104 ++#define reg_sel_thirdi2c_pos 2 ++#define reg_sel_thirdi2c_len 1 ++#define reg_sel_thirdi2c_lsb 0 ++#define p_reg_sel_tuner 0xF104 ++#define p_reg_ofdm_rst_en 0xF104 ++#define p_reg_sdio_cccr_v 0xF140 ++#define reg_sdio_cccr_v_pos 0 ++#define reg_sdio_cccr_v_len 4 ++#define reg_sdio_cccr_v_lsb 0 ++#define p_reg_sdio_sdio_v 0xF140 ++#define reg_sdio_sdio_v_pos 4 ++#define reg_sdio_sdio_v_len 4 ++#define reg_sdio_sdio_v_lsb 0 ++#define p_reg_sdioc_sd_v 0xF141 ++#define reg_sdioc_sd_v_pos 0 ++#define reg_sdioc_sd_v_len 4 ++#define reg_sdioc_sd_v_lsb 0 ++#define p_reg_sdioc_ior1 0xF143 ++#define reg_sdioc_ior1_pos 1 ++#define reg_sdioc_ior1_len 1 ++#define reg_sdioc_ior1_lsb 0 ++#define p_reg_sdioc_int1 0xF145 ++#define reg_sdioc_int1_pos 1 ++#define reg_sdioc_int1_len 1 ++#define reg_sdioc_int1_lsb 0 ++#define p_reg_sdioc_scsi 0xF147 ++#define reg_sdioc_scsi_pos 6 ++#define reg_sdioc_scsi_len 1 ++#define reg_sdioc_scsi_lsb 0 ++#define p_reg_sdioc_sdc 0xF148 ++#define reg_sdioc_sdc_pos 0 ++#define reg_sdioc_sdc_len 1 ++#define reg_sdioc_sdc_lsb 0 ++#define p_reg_sdioc_smb 0xF148 ++#define reg_sdioc_smb_pos 1 ++#define reg_sdioc_smb_len 1 ++#define reg_sdioc_smb_lsb 0 ++#define p_reg_sdioc_srw 0xF148 ++#define reg_sdioc_srw_pos 2 ++#define reg_sdioc_srw_len 1 ++#define reg_sdioc_srw_lsb 0 ++#define p_reg_sdioc_sbs 0xF148 ++#define reg_sdioc_sbs_pos 3 ++#define reg_sdioc_sbs_len 1 ++#define reg_sdioc_sbs_lsb 0 ++#define p_reg_sdioc_s4mi 0xF148 ++#define reg_sdioc_s4mi_pos 4 ++#define reg_sdioc_s4mi_len 1 ++#define reg_sdioc_s4mi_lsb 0 ++#define p_reg_sdioc_lsc 0xF148 ++#define reg_sdioc_lsc_pos 6 ++#define reg_sdioc_lsc_len 1 ++#define reg_sdioc_lsc_lsb 0 ++#define p_reg_sdioc_4bls 0xF148 ++#define reg_sdioc_4bls_pos 7 ++#define reg_sdioc_4bls_len 1 ++#define reg_sdioc_4bls_lsb 0 ++#define p_reg_sdioc_cis_7_0 0xF149 ++#define reg_sdioc_cis_7_0_pos 0 ++#define reg_sdioc_cis_7_0_len 8 ++#define reg_sdioc_cis_7_0_lsb 0 ++#define p_reg_sdioc_cis_15_8 0xF14A ++#define reg_sdioc_cis_15_8_pos 0 ++#define reg_sdioc_cis_15_8_len 8 ++#define reg_sdioc_cis_15_8_lsb 8 ++#define p_reg_sdioc_cis_23_16 0xF14B ++#define reg_sdioc_cis_23_16_pos 0 ++#define reg_sdioc_cis_23_16_len 8 ++#define reg_sdioc_cis_23_16_lsb 16 ++#define p_reg_sdioc_fs 0xF14D ++#define reg_sdioc_fs_pos 0 ++#define reg_sdioc_fs_len 4 ++#define reg_sdioc_fs_lsb 0 ++#define p_reg_sdioc_df 0xF14D ++#define reg_sdioc_df_pos 7 ++#define reg_sdioc_df_len 1 ++#define reg_sdioc_df_lsb 0 ++#define p_reg_sdioc_ex1 0xF14E ++#define reg_sdioc_ex1_pos 1 ++#define reg_sdioc_ex1_len 1 ++#define reg_sdioc_ex1_lsb 0 ++#define p_reg_sdioc_rf1 0xF14F ++#define reg_sdioc_rf1_pos 1 ++#define reg_sdioc_rf1_len 1 ++#define reg_sdioc_rf1_lsb 0 ++#define p_reg_sdioc_smpc 0xF152 ++#define reg_sdioc_smpc_pos 0 ++#define reg_sdioc_smpc_len 1 ++#define reg_sdioc_smpc_lsb 0 ++#define p_reg_sdioc_f1_code 0xF160 ++#define reg_sdioc_f1_code_pos 0 ++#define reg_sdioc_f1_code_len 4 ++#define reg_sdioc_f1_code_lsb 0 ++#define p_reg_sdioc_scsa 0xF160 ++#define reg_sdioc_scsa_pos 6 ++#define reg_sdioc_scsa_len 1 ++#define reg_sdioc_scsa_lsb 0 ++#define p_reg_sdioc_csa_en 0xF160 ++#define reg_sdioc_csa_en_pos 7 ++#define reg_sdioc_csa_en_len 1 ++#define reg_sdioc_csa_en_lsb 0 ++#define p_reg_sdioc_f1_ext_code 0xF161 ++#define reg_sdioc_f1_ext_code_pos 0 ++#define reg_sdioc_f1_ext_code_len 8 ++#define reg_sdioc_f1_ext_code_lsb 0 ++#define p_reg_sdioc_sps 0xF162 ++#define reg_sdioc_sps_pos 0 ++#define reg_sdioc_sps_len 1 ++#define reg_sdioc_sps_lsb 0 ++#define p_reg_sdioc_func1_cis_ptr_7_0 0xF169 ++#define reg_sdioc_func1_cis_ptr_7_0_pos 0 ++#define reg_sdioc_func1_cis_ptr_7_0_len 8 ++#define reg_sdioc_func1_cis_ptr_7_0_lsb 0 ++#define p_reg_sdioc_func1_cis_ptr_15_8 0xF16A ++#define reg_sdioc_func1_cis_ptr_15_8_pos 0 ++#define reg_sdioc_func1_cis_ptr_15_8_len 8 ++#define reg_sdioc_func1_cis_ptr_15_8_lsb 8 ++#define p_reg_sdioc_func1_cis_ptr_23_16 0xF16B ++#define reg_sdioc_func1_cis_ptr_23_16_pos 0 ++#define reg_sdioc_func1_cis_ptr_23_16_len 8 ++#define reg_sdioc_func1_cis_ptr_23_16_lsb 16 ++#define p_reg_sdio_FUNCID0_0 0xF180 ++#define reg_sdio_FUNCID0_0_pos 0 ++#define reg_sdio_FUNCID0_0_len 8 ++#define reg_sdio_FUNCID0_0_lsb 0 ++#define p_reg_sdio_FUNCID0_1 0xF181 ++#define reg_sdio_FUNCID0_1_pos 0 ++#define reg_sdio_FUNCID0_1_len 8 ++#define reg_sdio_FUNCID0_1_lsb 0 ++#define p_reg_sdio_FUNCID0_2 0xF182 ++#define reg_sdio_FUNCID0_2_pos 0 ++#define reg_sdio_FUNCID0_2_len 8 ++#define reg_sdio_FUNCID0_2_lsb 0 ++#define p_reg_sdio_FUNCID0_3 0xF183 ++#define reg_sdio_FUNCID0_3_pos 0 ++#define reg_sdio_FUNCID0_3_len 8 ++#define reg_sdio_FUNCID0_3_lsb 0 ++#define p_reg_sdio_MANFID0_0 0xF184 ++#define reg_sdio_MANFID0_0_pos 0 ++#define reg_sdio_MANFID0_0_len 8 ++#define reg_sdio_MANFID0_0_lsb 0 ++#define p_reg_sdio_MANFID0_1 0xF185 ++#define reg_sdio_MANFID0_1_pos 0 ++#define reg_sdio_MANFID0_1_len 8 ++#define reg_sdio_MANFID0_1_lsb 0 ++#define p_reg_sdio_MANFID0_2_7_0 0xF186 ++#define reg_sdio_MANFID0_2_7_0_pos 0 ++#define reg_sdio_MANFID0_2_7_0_len 8 ++#define reg_sdio_MANFID0_2_7_0_lsb 0 ++#define p_reg_sdio_MANFID0_2_15_8 0xF187 ++#define reg_sdio_MANFID0_2_15_8_pos 0 ++#define reg_sdio_MANFID0_2_15_8_len 8 ++#define reg_sdio_MANFID0_2_15_8_lsb 8 ++#define p_reg_sdio_MANFID0_4_7_0 0xF188 ++#define reg_sdio_MANFID0_4_7_0_pos 0 ++#define reg_sdio_MANFID0_4_7_0_len 8 ++#define reg_sdio_MANFID0_4_7_0_lsb 0 ++#define p_reg_sdio_MANFID0_4_15_8 0xF189 ++#define reg_sdio_MANFID0_4_15_8_pos 0 ++#define reg_sdio_MANFID0_4_15_8_len 8 ++#define reg_sdio_MANFID0_4_15_8_lsb 8 ++#define p_reg_sdio_FUNCE0_0 0xF18A ++#define reg_sdio_FUNCE0_0_pos 0 ++#define reg_sdio_FUNCE0_0_len 8 ++#define reg_sdio_FUNCE0_0_lsb 0 ++#define p_reg_sdio_FUNCE0_1 0xF18B ++#define reg_sdio_FUNCE0_1_pos 0 ++#define reg_sdio_FUNCE0_1_len 8 ++#define reg_sdio_FUNCE0_1_lsb 0 ++#define p_reg_sdio_FUNCE0_2 0xF18C ++#define reg_sdio_FUNCE0_2_pos 0 ++#define reg_sdio_FUNCE0_2_len 8 ++#define reg_sdio_FUNCE0_2_lsb 0 ++#define p_reg_sdio_FUNCE0_3_7_0 0xF18D ++#define reg_sdio_FUNCE0_3_7_0_pos 0 ++#define reg_sdio_FUNCE0_3_7_0_len 8 ++#define reg_sdio_FUNCE0_3_7_0_lsb 0 ++#define p_reg_sdio_FUNCE0_3_15_8 0xF18E ++#define reg_sdio_FUNCE0_3_15_8_pos 0 ++#define reg_sdio_FUNCE0_3_15_8_len 8 ++#define reg_sdio_FUNCE0_3_15_8_lsb 8 ++#define p_reg_sdio_FUNCE0_5 0xF18F ++#define reg_sdio_FUNCE0_5_pos 0 ++#define reg_sdio_FUNCE0_5_len 8 ++#define reg_sdio_FUNCE0_5_lsb 0 ++#define p_reg_sdio_VERS_10_0 0xF190 ++#define reg_sdio_VERS_10_0_pos 0 ++#define reg_sdio_VERS_10_0_len 8 ++#define reg_sdio_VERS_10_0_lsb 0 ++#define p_reg_sdio_VERS_10_1 0xF191 ++#define reg_sdio_VERS_10_1_pos 0 ++#define reg_sdio_VERS_10_1_len 8 ++#define reg_sdio_VERS_10_1_lsb 0 ++#define p_reg_sdio_VERS_10_2 0xF192 ++#define reg_sdio_VERS_10_2_pos 0 ++#define reg_sdio_VERS_10_2_len 8 ++#define reg_sdio_VERS_10_2_lsb 0 ++#define p_reg_sdio_VERS_10_3 0xF193 ++#define reg_sdio_VERS_10_3_pos 0 ++#define reg_sdio_VERS_10_3_len 8 ++#define reg_sdio_VERS_10_3_lsb 0 ++#define p_reg_sdio_VERS_10_4 0xF194 ++#define reg_sdio_VERS_10_4_pos 0 ++#define reg_sdio_VERS_10_4_len 8 ++#define reg_sdio_VERS_10_4_lsb 0 ++#define p_reg_sdio_VERS_10_5 0xF195 ++#define reg_sdio_VERS_10_5_pos 0 ++#define reg_sdio_VERS_10_5_len 8 ++#define reg_sdio_VERS_10_5_lsb 0 ++#define p_reg_sdio_VERS_10_6 0xF196 ++#define reg_sdio_VERS_10_6_pos 0 ++#define reg_sdio_VERS_10_6_len 8 ++#define reg_sdio_VERS_10_6_lsb 0 ++#define p_reg_sdio_VERS_10_7 0xF197 ++#define reg_sdio_VERS_10_7_pos 0 ++#define reg_sdio_VERS_10_7_len 8 ++#define reg_sdio_VERS_10_7_lsb 0 ++#define p_reg_sdio_VERS_10_8 0xF198 ++#define reg_sdio_VERS_10_8_pos 0 ++#define reg_sdio_VERS_10_8_len 8 ++#define reg_sdio_VERS_10_8_lsb 0 ++#define p_reg_sdio_VERS_10_9 0xF199 ++#define reg_sdio_VERS_10_9_pos 0 ++#define reg_sdio_VERS_10_9_len 8 ++#define reg_sdio_VERS_10_9_lsb 0 ++#define p_reg_sdio_VERS_10_A 0xF19A ++#define reg_sdio_VERS_10_A_pos 0 ++#define reg_sdio_VERS_10_A_len 8 ++#define reg_sdio_VERS_10_A_lsb 0 ++#define p_reg_sdio_VERS_10_B 0xF19B ++#define reg_sdio_VERS_10_B_pos 0 ++#define reg_sdio_VERS_10_B_len 8 ++#define reg_sdio_VERS_10_B_lsb 0 ++#define p_reg_sdio_VERS_10_C 0xF19C ++#define reg_sdio_VERS_10_C_pos 0 ++#define reg_sdio_VERS_10_C_len 8 ++#define reg_sdio_VERS_10_C_lsb 0 ++#define p_reg_sdio_VERS_10_D 0xF19D ++#define reg_sdio_VERS_10_D_pos 0 ++#define reg_sdio_VERS_10_D_len 8 ++#define reg_sdio_VERS_10_D_lsb 0 ++#define p_reg_sdio_VERS_10_E 0xF19E ++#define reg_sdio_VERS_10_E_pos 0 ++#define reg_sdio_VERS_10_E_len 8 ++#define reg_sdio_VERS_10_E_lsb 0 ++#define p_reg_sdio_VERS_10_F 0xF19F ++#define reg_sdio_VERS_10_F_pos 0 ++#define reg_sdio_VERS_10_F_len 8 ++#define reg_sdio_VERS_10_F_lsb 0 ++#define p_reg_sdio_VERS_10_10 0xF1A0 ++#define reg_sdio_VERS_10_10_pos 0 ++#define reg_sdio_VERS_10_10_len 8 ++#define reg_sdio_VERS_10_10_lsb 0 ++#define p_reg_sdio_VERS_10_11 0xF1A1 ++#define reg_sdio_VERS_10_11_pos 0 ++#define reg_sdio_VERS_10_11_len 8 ++#define reg_sdio_VERS_10_11_lsb 0 ++#define p_reg_sdio_VERS_10_12 0xF1A2 ++#define reg_sdio_VERS_10_12_pos 0 ++#define reg_sdio_VERS_10_12_len 8 ++#define reg_sdio_VERS_10_12_lsb 0 ++#define p_reg_sdio_VERS_10_13 0xF1A3 ++#define reg_sdio_VERS_10_13_pos 0 ++#define reg_sdio_VERS_10_13_len 8 ++#define reg_sdio_VERS_10_13_lsb 0 ++#define p_reg_sdio_VERS_10_14 0xF1A4 ++#define reg_sdio_VERS_10_14_pos 0 ++#define reg_sdio_VERS_10_14_len 8 ++#define reg_sdio_VERS_10_14_lsb 0 ++#define p_reg_sdio_VERS_10_15 0xF1A5 ++#define reg_sdio_VERS_10_15_pos 0 ++#define reg_sdio_VERS_10_15_len 8 ++#define reg_sdio_VERS_10_15_lsb 0 ++#define p_reg_sdio_VERS_10_16 0xF1A6 ++#define reg_sdio_VERS_10_16_pos 0 ++#define reg_sdio_VERS_10_16_len 8 ++#define reg_sdio_VERS_10_16_lsb 0 ++#define p_reg_sdio_VERS_10_17 0xF1A7 ++#define reg_sdio_VERS_10_17_pos 0 ++#define reg_sdio_VERS_10_17_len 8 ++#define reg_sdio_VERS_10_17_lsb 0 ++#define p_reg_sdio_VERS_10_18 0xF1A8 ++#define reg_sdio_VERS_10_18_pos 0 ++#define reg_sdio_VERS_10_18_len 8 ++#define reg_sdio_VERS_10_18_lsb 0 ++#define p_reg_sdio_VERS_10_19 0xF1A9 ++#define reg_sdio_VERS_10_19_pos 0 ++#define reg_sdio_VERS_10_19_len 8 ++#define reg_sdio_VERS_10_19_lsb 0 ++#define p_reg_sdio_VERS_10_1A 0xF1AA ++#define reg_sdio_VERS_10_1A_pos 0 ++#define reg_sdio_VERS_10_1A_len 8 ++#define reg_sdio_VERS_10_1A_lsb 0 ++#define p_reg_sdio_VERS_10_1B 0xF1AB ++#define reg_sdio_VERS_10_1B_pos 0 ++#define reg_sdio_VERS_10_1B_len 8 ++#define reg_sdio_VERS_10_1B_lsb 0 ++#define p_reg_sdio_VERS_10_1C 0xF1AC ++#define reg_sdio_VERS_10_1C_pos 0 ++#define reg_sdio_VERS_10_1C_len 8 ++#define reg_sdio_VERS_10_1C_lsb 0 ++#define p_reg_sdio_VERS_10_1D 0xF1AD ++#define reg_sdio_VERS_10_1D_pos 0 ++#define reg_sdio_VERS_10_1D_len 8 ++#define reg_sdio_VERS_10_1D_lsb 0 ++#define p_reg_sdio_VERS_10_1E 0xF1AE ++#define reg_sdio_VERS_10_1E_pos 0 ++#define reg_sdio_VERS_10_1E_len 8 ++#define reg_sdio_VERS_10_1E_lsb 0 ++#define p_reg_sdio_VERS_10_1F 0xF1AF ++#define reg_sdio_VERS_10_1F_pos 0 ++#define reg_sdio_VERS_10_1F_len 8 ++#define reg_sdio_VERS_10_1F_lsb 0 ++#define p_reg_sdio_VERS_10_20 0xF1B0 ++#define reg_sdio_VERS_10_20_pos 0 ++#define reg_sdio_VERS_10_20_len 8 ++#define reg_sdio_VERS_10_20_lsb 0 ++#define p_reg_sdio_VERS_10_21 0xF1B1 ++#define reg_sdio_VERS_10_21_pos 0 ++#define reg_sdio_VERS_10_21_len 8 ++#define reg_sdio_VERS_10_21_lsb 0 ++#define p_reg_sdio_VERS_10_22 0xF1B2 ++#define reg_sdio_VERS_10_22_pos 0 ++#define reg_sdio_VERS_10_22_len 8 ++#define reg_sdio_VERS_10_22_lsb 0 ++#define p_reg_sdio_VERS_10_23 0xF1B3 ++#define reg_sdio_VERS_10_23_pos 0 ++#define reg_sdio_VERS_10_23_len 8 ++#define reg_sdio_VERS_10_23_lsb 0 ++#define p_reg_sdio_VERS_10_24 0xF1B4 ++#define reg_sdio_VERS_10_24_pos 0 ++#define reg_sdio_VERS_10_24_len 8 ++#define reg_sdio_VERS_10_24_lsb 0 ++#define p_reg_sdio_VERS_10_25 0xF1B5 ++#define reg_sdio_VERS_10_25_pos 0 ++#define reg_sdio_VERS_10_25_len 8 ++#define reg_sdio_VERS_10_25_lsb 0 ++#define p_reg_sdio_VERS_10_26 0xF1B6 ++#define reg_sdio_VERS_10_26_pos 0 ++#define reg_sdio_VERS_10_26_len 8 ++#define reg_sdio_VERS_10_26_lsb 0 ++#define p_reg_sdio_VERS_10_27 0xF1B7 ++#define reg_sdio_VERS_10_27_pos 0 ++#define reg_sdio_VERS_10_27_len 8 ++#define reg_sdio_VERS_10_27_lsb 0 ++#define p_reg_sdio_END0 0xF1B8 ++#define reg_sdio_END0_pos 0 ++#define reg_sdio_END0_len 8 ++#define reg_sdio_END0_lsb 0 ++#define p_reg_sdio_FUNCID1_0 0xF1C0 ++#define reg_sdio_FUNCID1_0_pos 0 ++#define reg_sdio_FUNCID1_0_len 8 ++#define reg_sdio_FUNCID1_0_lsb 0 ++#define p_reg_sdio_FUNCID1_1 0xF1C1 ++#define reg_sdio_FUNCID1_1_pos 0 ++#define reg_sdio_FUNCID1_1_len 8 ++#define reg_sdio_FUNCID1_1_lsb 0 ++#define p_reg_sdio_FUNCID1_2 0xF1C2 ++#define reg_sdio_FUNCID1_2_pos 0 ++#define reg_sdio_FUNCID1_2_len 8 ++#define reg_sdio_FUNCID1_2_lsb 0 ++#define p_reg_sdio_FUNCID1_3 0xF1C3 ++#define reg_sdio_FUNCID1_3_pos 0 ++#define reg_sdio_FUNCID1_3_len 8 ++#define reg_sdio_FUNCID1_3_lsb 0 ++#define p_reg_sdio_FUNCE1_0 0xF1C4 ++#define reg_sdio_FUNCE1_0_pos 0 ++#define reg_sdio_FUNCE1_0_len 8 ++#define reg_sdio_FUNCE1_0_lsb 0 ++#define p_reg_sdio_FUNCE1_1 0xF1C5 ++#define reg_sdio_FUNCE1_1_pos 0 ++#define reg_sdio_FUNCE1_1_len 8 ++#define reg_sdio_FUNCE1_1_lsb 0 ++#define p_reg_sdio_FUNCE1_2 0xF1C6 ++#define reg_sdio_FUNCE1_2_pos 0 ++#define reg_sdio_FUNCE1_2_len 8 ++#define reg_sdio_FUNCE1_2_lsb 0 ++#define p_reg_sdio_FUNCE1_3 0xF1C7 ++#define reg_sdio_FUNCE1_3_pos 0 ++#define reg_sdio_FUNCE1_3_len 8 ++#define reg_sdio_FUNCE1_3_lsb 0 ++#define p_reg_sdio_FUNCE1_4 0xF1C8 ++#define reg_sdio_FUNCE1_4_pos 0 ++#define reg_sdio_FUNCE1_4_len 8 ++#define reg_sdio_FUNCE1_4_lsb 0 ++#define p_reg_sdio_FUNCE1_5_7_0 0xF1C9 ++#define reg_sdio_FUNCE1_5_7_0_pos 0 ++#define reg_sdio_FUNCE1_5_7_0_len 8 ++#define reg_sdio_FUNCE1_5_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_5_15_8 0xF1CA ++#define reg_sdio_FUNCE1_5_15_8_pos 0 ++#define reg_sdio_FUNCE1_5_15_8_len 8 ++#define reg_sdio_FUNCE1_5_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_5_23_16 0xF1CB ++#define reg_sdio_FUNCE1_5_23_16_pos 0 ++#define reg_sdio_FUNCE1_5_23_16_len 8 ++#define reg_sdio_FUNCE1_5_23_16_lsb 16 ++#define p_reg_sdio_FUNCE1_5_31_24 0xF1CC ++#define reg_sdio_FUNCE1_5_31_24_pos 0 ++#define reg_sdio_FUNCE1_5_31_24_len 8 ++#define reg_sdio_FUNCE1_5_31_24_lsb 24 ++#define p_reg_sdio_FUNCE1_9_7_0 0xF1CD ++#define reg_sdio_FUNCE1_9_7_0_pos 0 ++#define reg_sdio_FUNCE1_9_7_0_len 8 ++#define reg_sdio_FUNCE1_9_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_9_15_8 0xF1CE ++#define reg_sdio_FUNCE1_9_15_8_pos 0 ++#define reg_sdio_FUNCE1_9_15_8_len 8 ++#define reg_sdio_FUNCE1_9_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_9_23_16 0xF1CF ++#define reg_sdio_FUNCE1_9_23_16_pos 0 ++#define reg_sdio_FUNCE1_9_23_16_len 8 ++#define reg_sdio_FUNCE1_9_23_16_lsb 16 ++#define p_reg_sdio_FUNCE1_9_31_24 0xF1D0 ++#define reg_sdio_FUNCE1_9_31_24_pos 0 ++#define reg_sdio_FUNCE1_9_31_24_len 8 ++#define reg_sdio_FUNCE1_9_31_24_lsb 24 ++#define p_reg_sdio_FUNCE1_D 0xF1D1 ++#define reg_sdio_FUNCE1_D_pos 0 ++#define reg_sdio_FUNCE1_D_len 8 ++#define reg_sdio_FUNCE1_D_lsb 0 ++#define p_reg_sdio_FUNCE1_E_7_0 0xF1D2 ++#define reg_sdio_FUNCE1_E_7_0_pos 0 ++#define reg_sdio_FUNCE1_E_7_0_len 8 ++#define reg_sdio_FUNCE1_E_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_E_15_8 0xF1D3 ++#define reg_sdio_FUNCE1_E_15_8_pos 0 ++#define reg_sdio_FUNCE1_E_15_8_len 8 ++#define reg_sdio_FUNCE1_E_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_10_7_0 0xF1D4 ++#define reg_sdio_FUNCE1_10_7_0_pos 0 ++#define reg_sdio_FUNCE1_10_7_0_len 8 ++#define reg_sdio_FUNCE1_10_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_10_15_8 0xF1D5 ++#define reg_sdio_FUNCE1_10_15_8_pos 0 ++#define reg_sdio_FUNCE1_10_15_8_len 8 ++#define reg_sdio_FUNCE1_10_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_10_23_16 0xF1D6 ++#define reg_sdio_FUNCE1_10_23_16_pos 0 ++#define reg_sdio_FUNCE1_10_23_16_len 8 ++#define reg_sdio_FUNCE1_10_23_16_lsb 16 ++#define p_reg_sdio_FUNCE1_10_31_24 0xF1D7 ++#define reg_sdio_FUNCE1_10_31_24_pos 0 ++#define reg_sdio_FUNCE1_10_31_24_len 8 ++#define reg_sdio_FUNCE1_10_31_24_lsb 24 ++#define p_reg_sdio_FUNCE1_14 0xF1D8 ++#define reg_sdio_FUNCE1_14_pos 0 ++#define reg_sdio_FUNCE1_14_len 8 ++#define reg_sdio_FUNCE1_14_lsb 0 ++#define p_reg_sdio_FUNCE1_15 0xF1D9 ++#define reg_sdio_FUNCE1_15_pos 0 ++#define reg_sdio_FUNCE1_15_len 8 ++#define reg_sdio_FUNCE1_15_lsb 0 ++#define p_reg_sdio_FUNCE1_16 0xF1DA ++#define reg_sdio_FUNCE1_16_pos 0 ++#define reg_sdio_FUNCE1_16_len 8 ++#define reg_sdio_FUNCE1_16_lsb 0 ++#define p_reg_sdio_FUNCE1_17 0xF1DB ++#define reg_sdio_FUNCE1_17_pos 0 ++#define reg_sdio_FUNCE1_17_len 8 ++#define reg_sdio_FUNCE1_17_lsb 0 ++#define p_reg_sdio_FUNCE1_18 0xF1DC ++#define reg_sdio_FUNCE1_18_pos 0 ++#define reg_sdio_FUNCE1_18_len 8 ++#define reg_sdio_FUNCE1_18_lsb 0 ++#define p_reg_sdio_FUNCE1_19 0xF1DD ++#define reg_sdio_FUNCE1_19_pos 0 ++#define reg_sdio_FUNCE1_19_len 8 ++#define reg_sdio_FUNCE1_19_lsb 0 ++#define p_reg_sdio_FUNCE1_1A_7_0 0xF1DE ++#define reg_sdio_FUNCE1_1A_7_0_pos 0 ++#define reg_sdio_FUNCE1_1A_7_0_len 8 ++#define reg_sdio_FUNCE1_1A_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_1A_15_8 0xF1DF ++#define reg_sdio_FUNCE1_1A_15_8_pos 0 ++#define reg_sdio_FUNCE1_1A_15_8_len 8 ++#define reg_sdio_FUNCE1_1A_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_1C_7_0 0xF1E0 ++#define reg_sdio_FUNCE1_1C_7_0_pos 0 ++#define reg_sdio_FUNCE1_1C_7_0_len 8 ++#define reg_sdio_FUNCE1_1C_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_1C_15_8 0xF1E1 ++#define reg_sdio_FUNCE1_1C_15_8_pos 0 ++#define reg_sdio_FUNCE1_1C_15_8_len 8 ++#define reg_sdio_FUNCE1_1C_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_1E_7_0 0xF1E2 ++#define reg_sdio_FUNCE1_1E_7_0_pos 0 ++#define reg_sdio_FUNCE1_1E_7_0_len 8 ++#define reg_sdio_FUNCE1_1E_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_1E_15_8 0xF1E3 ++#define reg_sdio_FUNCE1_1E_15_8_pos 0 ++#define reg_sdio_FUNCE1_1E_15_8_len 8 ++#define reg_sdio_FUNCE1_1E_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_20_7_0 0xF1E4 ++#define reg_sdio_FUNCE1_20_7_0_pos 0 ++#define reg_sdio_FUNCE1_20_7_0_len 8 ++#define reg_sdio_FUNCE1_20_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_20_15_8 0xF1E5 ++#define reg_sdio_FUNCE1_20_15_8_pos 0 ++#define reg_sdio_FUNCE1_20_15_8_len 8 ++#define reg_sdio_FUNCE1_20_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_22_7_0 0xF1E6 ++#define reg_sdio_FUNCE1_22_7_0_pos 0 ++#define reg_sdio_FUNCE1_22_7_0_len 8 ++#define reg_sdio_FUNCE1_22_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_22_15_8 0xF1E7 ++#define reg_sdio_FUNCE1_22_15_8_pos 0 ++#define reg_sdio_FUNCE1_22_15_8_len 8 ++#define reg_sdio_FUNCE1_22_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_24_7_0 0xF1E8 ++#define reg_sdio_FUNCE1_24_7_0_pos 0 ++#define reg_sdio_FUNCE1_24_7_0_len 8 ++#define reg_sdio_FUNCE1_24_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_24_15_8 0xF1E9 ++#define reg_sdio_FUNCE1_24_15_8_pos 0 ++#define reg_sdio_FUNCE1_24_15_8_len 8 ++#define reg_sdio_FUNCE1_24_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_26_7_0 0xF1EA ++#define reg_sdio_FUNCE1_26_7_0_pos 0 ++#define reg_sdio_FUNCE1_26_7_0_len 8 ++#define reg_sdio_FUNCE1_26_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_26_15_8 0xF1EB ++#define reg_sdio_FUNCE1_26_15_8_pos 0 ++#define reg_sdio_FUNCE1_26_15_8_len 8 ++#define reg_sdio_FUNCE1_26_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_28_7_0 0xF1EC ++#define reg_sdio_FUNCE1_28_7_0_pos 0 ++#define reg_sdio_FUNCE1_28_7_0_len 8 ++#define reg_sdio_FUNCE1_28_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_28_15_8 0xF1ED ++#define reg_sdio_FUNCE1_28_15_8_pos 0 ++#define reg_sdio_FUNCE1_28_15_8_len 8 ++#define reg_sdio_FUNCE1_28_15_8_lsb 8 ++#define p_reg_sdio_FUNCE1_2A_7_0 0xF1EE ++#define reg_sdio_FUNCE1_2A_7_0_pos 0 ++#define reg_sdio_FUNCE1_2A_7_0_len 8 ++#define reg_sdio_FUNCE1_2A_7_0_lsb 0 ++#define p_reg_sdio_FUNCE1_2A_15_8 0xF1EF ++#define reg_sdio_FUNCE1_2A_15_8_pos 0 ++#define reg_sdio_FUNCE1_2A_15_8_len 8 ++#define reg_sdio_FUNCE1_2A_15_8_lsb 8 ++#define p_reg_sdio_END1 0xF1F0 ++#define reg_sdio_END1_pos 0 ++#define reg_sdio_END1_len 8 ++#define reg_sdio_END1_lsb 0 ++#define r_sdioc_tx_fifo_empty 0xF210 ++#define sdioc_tx_fifo_empty_pos 0 ++#define sdioc_tx_fifo_empty_len 1 ++#define sdioc_tx_fifo_empty_lsb 0 ++#define p_reg_sdio_53ra 0xF210 ++#define reg_sdio_53ra_pos 1 ++#define reg_sdio_53ra_len 1 ++#define reg_sdio_53ra_lsb 0 ++#define p_reg_sdioc_rd_wait_dly 0xF210 ++#define reg_sdioc_rd_wait_dly_pos 4 ++#define reg_sdioc_rd_wait_dly_len 2 ++#define reg_sdioc_rd_wait_dly_lsb 0 ++#define p_reg_write_mbx_complete 0xF211 ++#define reg_write_mbx_complete_pos 0 ++#define reg_write_mbx_complete_len 1 ++#define reg_write_mbx_complete_lsb 0 ++#define p_reg_sdioc_sw_err 0xF211 ++#define reg_sdioc_sw_err_pos 1 ++#define reg_sdioc_sw_err_len 1 ++#define reg_sdioc_sw_err_lsb 0 ++#define p_reg_sdioc_tran_dat_dly 0xF211 ++#define reg_sdioc_tran_dat_dly_pos 4 ++#define reg_sdioc_tran_dat_dly_len 3 ++#define reg_sdioc_tran_dat_dly_lsb 0 ++#define p_reg_sdioc_external_int_en 0xF212 ++#define reg_sdioc_external_int_en_pos 1 ++#define reg_sdioc_external_int_en_len 1 ++#define reg_sdioc_external_int_en_lsb 0 ++#define r_reg_sdioc_external_int 0xF212 ++#define reg_sdioc_external_int_pos 2 ++#define reg_sdioc_external_int_len 1 ++#define reg_sdioc_external_int_lsb 0 ++#define p_reg_auto_clrWB_en 0xF213 ++#define reg_auto_clrWB_en_pos 0 ++#define reg_auto_clrWB_en_len 1 ++#define reg_auto_clrWB_en_lsb 0 ++#define p_reg_sdioc_crc_s_dly 0xF213 ++#define reg_sdioc_crc_s_dly_pos 1 ++#define reg_sdioc_crc_s_dly_len 1 ++#define reg_sdioc_crc_s_dly_lsb 0 ++#define p_reg_sdioc_neg_out_sel 0xF213 ++#define reg_sdioc_neg_out_sel_pos 2 ++#define reg_sdioc_neg_out_sel_len 1 ++#define reg_sdioc_neg_out_sel_lsb 0 ++#define p_reg_sdioc_tx_fifo_rst 0xF213 ++#define reg_sdioc_tx_fifo_rst_pos 4 ++#define reg_sdioc_tx_fifo_rst_len 1 ++#define reg_sdioc_tx_fifo_rst_lsb 0 ++#define p_reg_sdioc_rx_fifo_rst 0xF213 ++#define reg_sdioc_rx_fifo_rst_pos 5 ++#define reg_sdioc_rx_fifo_rst_len 1 ++#define reg_sdioc_rx_fifo_rst_lsb 0 ++#define p_reg_sdioc_auto_rst_sm_en 0xF213 ++#define reg_sdioc_auto_rst_sm_en_pos 6 ++#define reg_sdioc_auto_rst_sm_en_len 1 ++#define reg_sdioc_auto_rst_sm_en_lsb 0 ++#define p_sdio_link_clr_Wbusy_en 0xF214 ++#define sdio_link_clr_Wbusy_en_pos 0 ++#define sdio_link_clr_Wbusy_en_len 1 ++#define sdio_link_clr_Wbusy_en_lsb 0 ++#define p_sdio_link_clr_Wbusy 0xF214 ++#define sdio_link_clr_Wbusy_pos 1 ++#define sdio_link_clr_Wbusy_len 1 ++#define sdio_link_clr_Wbusy_lsb 0 ++#define p_reg_sdioc_dbg_sel 0xF214 ++#define reg_sdioc_dbg_sel_pos 4 ++#define reg_sdioc_dbg_sel_len 4 ++#define reg_sdioc_dbg_sel_lsb 0 ++#define p_reg_sdioc_skip_ocr 0xF215 ++#define reg_sdioc_skip_ocr_pos 0 ++#define reg_sdioc_skip_ocr_len 1 ++#define reg_sdioc_skip_ocr_lsb 0 ++#define p_reg_sdioc_spi_ns 0xF215 ++#define reg_sdioc_spi_ns_pos 1 ++#define reg_sdioc_spi_ns_len 1 ++#define reg_sdioc_spi_ns_lsb 0 ++#define r_sdio_spi_mode 0xF215 ++#define sdio_spi_mode_pos 7 ++#define sdio_spi_mode_len 1 ++#define sdio_spi_mode_lsb 0 ++#define r_link_ofsm_mailbox_int 0xF402 ++#define link_ofsm_mailbox_int_pos 4 ++#define link_ofsm_mailbox_int_len 1 ++#define link_ofsm_mailbox_int_lsb 0 ++#define r_link_ofsm_dvbt_int 0xF403 ++#define link_ofsm_dvbt_int_pos 2 ++#define link_ofsm_dvbt_int_len 1 ++#define link_ofsm_dvbt_int_lsb 0 ++#define p_reg_dvbt_intsts 0xF404 ++#define reg_dvbt_intsts_pos 2 ++#define reg_dvbt_intsts_len 1 ++#define reg_dvbt_intsts_lsb 0 ++#define p_reg_link_mailbox_int 0xF405 ++#define reg_link_mailbox_int_pos 5 ++#define reg_link_mailbox_int_len 1 ++#define reg_link_mailbox_int_lsb 0 ++#define p_reg_mailbox_wptr_rst 0xF408 ++#define reg_mailbox_wptr_rst_pos 0 ++#define reg_mailbox_wptr_rst_len 1 ++#define reg_mailbox_wptr_rst_lsb 0 ++#define p_reg_link_mailbox_wptr 0xF409 ++#define reg_link_mailbox_wptr_pos 0 ++#define reg_link_mailbox_wptr_len 8 ++#define reg_link_mailbox_wptr_lsb 0 ++#define p_reg_link_mailbox_wend 0xF410 ++#define reg_link_mailbox_wend_pos 0 ++#define reg_link_mailbox_wend_len 1 ++#define reg_link_mailbox_wend_lsb 0 ++#define p_reg_rd_data_sel 0xF411 ++#define reg_rd_data_sel_pos 0 ++#define reg_rd_data_sel_len 2 ++#define reg_rd_data_sel_lsb 0 ++#define p_reg_fifo_rd_length_7_0 0xF412 ++#define reg_fifo_rd_length_7_0_pos 0 ++#define reg_fifo_rd_length_7_0_len 8 ++#define reg_fifo_rd_length_7_0_lsb 0 ++#define p_reg_fifo_rd_length_15_8 0xF413 ++#define reg_fifo_rd_length_15_8_pos 0 ++#define reg_fifo_rd_length_15_8_len 8 ++#define reg_fifo_rd_length_15_8_lsb 8 ++#define p_reg_fifo_rd_length_17_16 0xF414 ++#define reg_fifo_rd_length_17_16_pos 0 ++#define reg_fifo_rd_length_17_16_len 2 ++#define reg_fifo_rd_length_17_16_lsb 16 ++#define p_reg_rst_fifo_rptr 0xF414 ++#define reg_rst_fifo_rptr_pos 6 ++#define reg_rst_fifo_rptr_len 1 ++#define reg_rst_fifo_rptr_lsb 0 ++#define p_reg_force_sel 0xF414 ++#define reg_force_sel_pos 7 ++#define reg_force_sel_len 1 ++#define reg_force_sel_lsb 0 ++#define p_reg_fifo_rptr_7_0 0xF415 ++#define reg_fifo_rptr_7_0_pos 0 ++#define reg_fifo_rptr_7_0_len 8 ++#define reg_fifo_rptr_7_0_lsb 0 ++#define p_reg_fifo_rptr_15_8 0xF416 ++#define reg_fifo_rptr_15_8_pos 0 ++#define reg_fifo_rptr_15_8_len 8 ++#define reg_fifo_rptr_15_8_lsb 8 ++#define p_reg_fifo_rptr_17_16 0xF417 ++#define reg_fifo_rptr_17_16_pos 0 ++#define reg_fifo_rptr_17_16_len 2 ++#define reg_fifo_rptr_17_16_lsb 16 ++#define p_reg_max_package_size_7_0 0xF418 ++#define reg_max_package_size_7_0_pos 0 ++#define reg_max_package_size_7_0_len 8 ++#define reg_max_package_size_7_0_lsb 0 ++#define p_reg_max_package_size_11_8 0xF419 ++#define reg_max_package_size_11_8_pos 0 ++#define reg_max_package_size_11_8_len 4 ++#define reg_max_package_size_11_8_lsb 8 ++#define p_reg_dvbt_en 0xF41A ++#define reg_dvbt_en_pos 0 ++#define reg_dvbt_en_len 1 ++#define reg_dvbt_en_lsb 0 ++#define p_reg_dvbt_bufsize 0xF41A ++#define reg_dvbt_bufsize_pos 1 ++#define reg_dvbt_bufsize_len 1 ++#define reg_dvbt_bufsize_lsb 0 ++#define p_reg_dvbt_path 0xF41A ++#define reg_dvbt_path_pos 2 ++#define reg_dvbt_path_len 1 ++#define reg_dvbt_path_lsb 0 ++#define p_reg_dvbt_r5 0xF41A ++#define reg_dvbt_r5_pos 3 ++#define reg_dvbt_r5_len 1 ++#define reg_dvbt_r5_lsb 0 ++#define p_reg_mailbox_inten 0xF41E ++#define reg_mailbox_inten_pos 4 ++#define reg_mailbox_inten_len 1 ++#define reg_mailbox_inten_lsb 0 ++#define p_reg_dvbt_inten 0xF41F ++#define reg_dvbt_inten_pos 2 ++#define reg_dvbt_inten_len 1 ++#define reg_dvbt_inten_lsb 0 ++#define r_link_ofsm_ip_length_7_0 0xF447 ++#define link_ofsm_ip_length_7_0_pos 0 ++#define link_ofsm_ip_length_7_0_len 8 ++#define link_ofsm_ip_length_7_0_lsb 0 ++#define r_link_ofsm_ip_length_11_8 0xF448 ++#define link_ofsm_ip_length_11_8_pos 0 ++#define link_ofsm_ip_length_11_8_len 4 ++#define link_ofsm_ip_length_11_8_lsb 8 ++#define r_link_ofsm_ip_valid 0xF448 ++#define link_ofsm_ip_valid_pos 7 ++#define link_ofsm_ip_valid_len 1 ++#define link_ofsm_ip_valid_lsb 0 ++#define p_reg_spi_master 0xF600 ++#define reg_spi_master_pos 0 ++#define reg_spi_master_len 1 ++#define reg_spi_master_lsb 0 ++#define p_reg_spi_bit 0xF601 ++#define reg_spi_bit_pos 0 ++#define reg_spi_bit_len 2 ++#define reg_spi_bit_lsb 0 ++#define p_reg_spi_cs 0xF602 ++#define reg_spi_cs_pos 0 ++#define reg_spi_cs_len 1 ++#define reg_spi_cs_lsb 0 ++#define p_reg_spi_polarity 0xF602 ++#define reg_spi_polarity_pos 1 ++#define reg_spi_polarity_len 1 ++#define reg_spi_polarity_lsb 0 ++#define p_reg_spi_phase 0xF602 ++#define reg_spi_phase_pos 2 ++#define reg_spi_phase_len 1 ++#define reg_spi_phase_lsb 0 ++#define p_reg_spi_1st_byte 0xF603 ++#define reg_spi_1st_byte_pos 0 ++#define reg_spi_1st_byte_len 4 ++#define reg_spi_1st_byte_lsb 0 ++#define p_reg_spi_clk_div 0xF603 ++#define reg_spi_clk_div_pos 4 ++#define reg_spi_clk_div_len 4 ++#define reg_spi_clk_div_lsb 0 ++#define p_reg_spi_rst 0xF604 ++#define reg_spi_rst_pos 0 ++#define reg_spi_rst_len 1 ++#define reg_spi_rst_lsb 0 ++#define r_reg_spi_tx_done 0xF604 ++#define reg_spi_tx_done_pos 1 ++#define reg_spi_tx_done_len 1 ++#define reg_spi_tx_done_lsb 0 ++#define r_reg_spi_rx_done 0xF604 ++#define reg_spi_rx_done_pos 2 ++#define reg_spi_rx_done_len 1 ++#define reg_spi_rx_done_lsb 0 ++#define p_reg_spi_dbg_sel 0xF604 ++#define reg_spi_dbg_sel_pos 3 ++#define reg_spi_dbg_sel_len 1 ++#define reg_spi_dbg_sel_lsb 0 ++#define r_reg_spi_crc_err 0xF604 ++#define reg_spi_crc_err_pos 4 ++#define reg_spi_crc_err_len 4 ++#define reg_spi_crc_err_lsb 0 ++#define r_link_ofsm_usb20_mode 0xF613 ++#define link_ofsm_usb20_mode_pos 0 ++#define link_ofsm_usb20_mode_len 1 ++#define link_ofsm_usb20_mode_lsb 0 ++#define r_link_ofsm_strap_usb20_mode 0xF613 ++#define link_ofsm_strap_usb20_mode_pos 1 ++#define link_ofsm_strap_usb20_mode_len 1 ++#define link_ofsm_strap_usb20_mode_lsb 0 ++#define p_reg_link_stick_mem_end_7_0 0xF618 ++#define reg_link_stick_mem_end_7_0_pos 0 ++#define reg_link_stick_mem_end_7_0_len 8 ++#define reg_link_stick_mem_end_7_0_lsb 0 ++#define p_reg_link_stick_mem_end_15_8 0xF619 ++#define reg_link_stick_mem_end_15_8_pos 0 ++#define reg_link_stick_mem_end_15_8_len 8 ++#define reg_link_stick_mem_end_15_8_lsb 8 ++#define p_reg_ofdm_auto_write_addr_l 0xF61A ++#define reg_ofdm_auto_write_addr_l_pos 0 ++#define reg_ofdm_auto_write_addr_l_len 8 ++#define reg_ofdm_auto_write_addr_l_lsb 0 ++#define p_reg_ofdm_auto_write_addr_h 0xF61B ++#define reg_ofdm_auto_write_addr_h_pos 0 ++#define reg_ofdm_auto_write_addr_h_len 8 ++#define reg_ofdm_auto_write_addr_h_lsb 0 ++#define p_reg_link_auto_write_addr_l 0xF61C ++#define reg_link_auto_write_addr_l_pos 0 ++#define reg_link_auto_write_addr_l_len 8 ++#define reg_link_auto_write_addr_l_lsb 0 ++#define p_reg_link_auto_write_addr_h 0xF61D ++#define reg_link_auto_write_addr_h_pos 0 ++#define reg_link_auto_write_addr_h_len 8 ++#define reg_link_auto_write_addr_h_lsb 0 ++#define p_reg_mailbox_auto_write_addr 0xF61E ++#define reg_mailbox_auto_write_addr_pos 0 ++#define reg_mailbox_auto_write_addr_len 8 ++#define reg_mailbox_auto_write_addr_lsb 0 ++#define p_reg_usbmem_auto_write_addr 0xF61F ++#define reg_usbmem_auto_write_addr_pos 0 ++#define reg_usbmem_auto_write_addr_len 8 ++#define reg_usbmem_auto_write_addr_lsb 0 ++#define p_reg_mailbox_auto_read_addr 0xF620 ++#define reg_mailbox_auto_read_addr_pos 0 ++#define reg_mailbox_auto_read_addr_len 8 ++#define reg_mailbox_auto_read_addr_lsb 0 ++#define p_reg_usbmem_auto_read_addr 0xF621 ++#define reg_usbmem_auto_read_addr_pos 0 ++#define reg_usbmem_auto_read_addr_len 8 ++#define reg_usbmem_auto_read_addr_lsb 0 ++#define p_reg_auto_write_ofdm 0xF622 ++#define reg_auto_write_ofdm_pos 0 ++#define reg_auto_write_ofdm_len 1 ++#define reg_auto_write_ofdm_lsb 0 ++#define p_reg_auto_write_link 0xF622 ++#define reg_auto_write_link_pos 1 ++#define reg_auto_write_link_len 1 ++#define reg_auto_write_link_lsb 0 ++#define p_reg_auto_write_mailbox 0xF622 ++#define reg_auto_write_mailbox_pos 2 ++#define reg_auto_write_mailbox_len 1 ++#define reg_auto_write_mailbox_lsb 0 ++#define p_reg_auto_write_usbmem 0xF622 ++#define reg_auto_write_usbmem_pos 3 ++#define reg_auto_write_usbmem_len 1 ++#define reg_auto_write_usbmem_lsb 0 ++#define p_reg_auto_write_i2cm 0xF622 ++#define reg_auto_write_i2cm_pos 4 ++#define reg_auto_write_i2cm_len 1 ++#define reg_auto_write_i2cm_lsb 0 ++#define p_reg_auto_read_mailbox 0xF623 ++#define reg_auto_read_mailbox_pos 0 ++#define reg_auto_read_mailbox_len 1 ++#define reg_auto_read_mailbox_lsb 0 ++#define p_reg_auto_read_rom 0xF623 ++#define reg_auto_read_rom_pos 1 ++#define reg_auto_read_rom_len 1 ++#define reg_auto_read_rom_lsb 0 ++#define p_reg_auto_sum_l 0xF624 ++#define reg_auto_sum_l_pos 0 ++#define reg_auto_sum_l_len 8 ++#define reg_auto_sum_l_lsb 0 ++#define p_reg_auto_sum_h 0xF625 ++#define reg_auto_sum_h_pos 0 ++#define reg_auto_sum_h_len 8 ++#define reg_auto_sum_h_lsb 0 ++#define p_reg_auto_sum_to_h 0xF626 ++#define reg_auto_sum_to_h_pos 0 ++#define reg_auto_sum_to_h_len 1 ++#define reg_auto_sum_to_h_lsb 0 ++#define p_reg_auto_sum_en 0xF627 ++#define reg_auto_sum_en_pos 0 ++#define reg_auto_sum_en_len 1 ++#define reg_auto_sum_en_lsb 0 ++#define p_reg_rom_remap_begin_7_0 0xF628 ++#define reg_rom_remap_begin_7_0_pos 0 ++#define reg_rom_remap_begin_7_0_len 8 ++#define reg_rom_remap_begin_7_0_lsb 0 ++#define p_reg_rom_remap_begin_15_8 0xF629 ++#define reg_rom_remap_begin_15_8_pos 0 ++#define reg_rom_remap_begin_15_8_len 8 ++#define reg_rom_remap_begin_15_8_lsb 8 ++#define p_reg_rom_remap_end_7_0 0xF62A ++#define reg_rom_remap_end_7_0_pos 0 ++#define reg_rom_remap_end_7_0_len 8 ++#define reg_rom_remap_end_7_0_lsb 0 ++#define p_reg_rom_remap_end_15_8 0xF62B ++#define reg_rom_remap_end_15_8_pos 0 ++#define reg_rom_remap_end_15_8_len 8 ++#define reg_rom_remap_end_15_8_lsb 8 ++#define p_reg_rom_remap_delta_7_0 0xF62C ++#define reg_rom_remap_delta_7_0_pos 0 ++#define reg_rom_remap_delta_7_0_len 8 ++#define reg_rom_remap_delta_7_0_lsb 0 ++#define p_reg_rom_remap_delta_15_8 0xF62D ++#define reg_rom_remap_delta_15_8_pos 0 ++#define reg_rom_remap_delta_15_8_len 8 ++#define reg_rom_remap_delta_15_8_lsb 8 ++#define p_reg_rom_remap_en 0xF62E ++#define reg_rom_remap_en_pos 0 ++#define reg_rom_remap_en_len 1 ++#define reg_rom_remap_en_lsb 0 ++#define p_reg_rom_remap_ofdm 0xF62E ++#define reg_rom_remap_ofdm_pos 1 ++#define reg_rom_remap_ofdm_len 1 ++#define reg_rom_remap_ofdm_lsb 0 ++#define p_reg_link_cpu_reset 0xF62F ++#define reg_link_cpu_reset_pos 0 ++#define reg_link_cpu_reset_len 1 ++#define reg_link_cpu_reset_lsb 0 ++#define p_reg_i2cm_auto_write_addr 0xF630 ++#define reg_i2cm_auto_write_addr_pos 0 ++#define reg_i2cm_auto_write_addr_len 8 ++#define reg_i2cm_auto_write_addr_lsb 0 ++#define p_reg_link_bank_float_en 0xF631 ++#define reg_link_bank_float_en_pos 0 ++#define reg_link_bank_float_en_len 1 ++#define reg_link_bank_float_en_lsb 0 ++#define p_reg_link_bank_float_start 0xF632 ++#define reg_link_bank_float_start_pos 0 ++#define reg_link_bank_float_start_len 8 ++#define reg_link_bank_float_start_lsb 0 ++#define p_reg_link_bank_float_stop 0xF633 ++#define reg_link_bank_float_stop_pos 0 ++#define reg_link_bank_float_stop_len 8 ++#define reg_link_bank_float_stop_lsb 0 ++#define p_reg_rom_auto_read_addr_7_0 0xF638 ++#define reg_rom_auto_read_addr_7_0_pos 0 ++#define reg_rom_auto_read_addr_7_0_len 8 ++#define reg_rom_auto_read_addr_7_0_lsb 0 ++#define p_reg_rom_auto_read_addr_15_8 0xF639 ++#define reg_rom_auto_read_addr_15_8_pos 0 ++#define reg_rom_auto_read_addr_15_8_len 8 ++#define reg_rom_auto_read_addr_15_8_lsb 8 ++#define p_reg_link_ofsm_dummy_7_0 0xF640 ++#define reg_link_ofsm_dummy_7_0_pos 0 ++#define reg_link_ofsm_dummy_7_0_len 8 ++#define reg_link_ofsm_dummy_7_0_lsb 0 ++#define p_reg_link_ofsm_dummy_15_8 0xF641 ++#define reg_link_ofsm_dummy_15_8_pos 0 ++#define reg_link_ofsm_dummy_15_8_len 8 ++#define reg_link_ofsm_dummy_15_8_lsb 8 ++#define p_reg_link_ofsm_dummy_23_16 0xF642 ++#define reg_link_ofsm_dummy_23_16_pos 0 ++#define reg_link_ofsm_dummy_23_16_len 8 ++#define reg_link_ofsm_dummy_23_16_lsb 16 ++#define p_reg_link_ofsm_dummy_31_24 0xF643 ++#define reg_link_ofsm_dummy_31_24_pos 0 ++#define reg_link_ofsm_dummy_31_24_len 8 ++#define reg_link_ofsm_dummy_31_24_lsb 24 ++#define p_reg_link_ofsm_dummy_39_32 0xF644 ++#define reg_link_ofsm_dummy_39_32_pos 0 ++#define reg_link_ofsm_dummy_39_32_len 8 ++#define reg_link_ofsm_dummy_39_32_lsb 32 ++#define p_reg_link_ofsm_dummy_47_40 0xF645 ++#define reg_link_ofsm_dummy_47_40_pos 0 ++#define reg_link_ofsm_dummy_47_40_len 8 ++#define reg_link_ofsm_dummy_47_40_lsb 40 ++#define p_reg_link_ofsm_dummy_55_48 0xF646 ++#define reg_link_ofsm_dummy_55_48_pos 0 ++#define reg_link_ofsm_dummy_55_48_len 8 ++#define reg_link_ofsm_dummy_55_48_lsb 48 ++#define p_reg_link_ofsm_dummy_63_56 0xF647 ++#define reg_link_ofsm_dummy_63_56_pos 0 ++#define reg_link_ofsm_dummy_63_56_len 8 ++#define reg_link_ofsm_dummy_63_56_lsb 56 ++#define p_reg_link_ofsm_dummy_71_64 0xF648 ++#define reg_link_ofsm_dummy_71_64_pos 0 ++#define reg_link_ofsm_dummy_71_64_len 8 ++#define reg_link_ofsm_dummy_71_64_lsb 64 ++#define p_reg_link_ofsm_dummy_79_72 0xF649 ++#define reg_link_ofsm_dummy_79_72_pos 0 ++#define reg_link_ofsm_dummy_79_72_len 8 ++#define reg_link_ofsm_dummy_79_72_lsb 72 ++#define p_reg_sdio_mode 0xF66F ++#define reg_sdio_mode_pos 0 ++#define reg_sdio_mode_len 1 ++#define reg_sdio_mode_lsb 0 ++#define p_reg_lnk2ofdm_data_7_0 0xF6A0 ++#define reg_lnk2ofdm_data_7_0_pos 0 ++#define reg_lnk2ofdm_data_7_0_len 8 ++#define reg_lnk2ofdm_data_7_0_lsb 0 ++#define p_reg_lnk2ofdm_data_15_8 0xF6A1 ++#define reg_lnk2ofdm_data_15_8_pos 0 ++#define reg_lnk2ofdm_data_15_8_len 8 ++#define reg_lnk2ofdm_data_15_8_lsb 8 ++#define p_reg_lnk2ofdm_data_23_16 0xF6A2 ++#define reg_lnk2ofdm_data_23_16_pos 0 ++#define reg_lnk2ofdm_data_23_16_len 8 ++#define reg_lnk2ofdm_data_23_16_lsb 16 ++#define p_reg_lnk2ofdm_data_31_24 0xF6A3 ++#define reg_lnk2ofdm_data_31_24_pos 0 ++#define reg_lnk2ofdm_data_31_24_len 8 ++#define reg_lnk2ofdm_data_31_24_lsb 24 ++#define p_reg_lnk2ofdm_data_39_32 0xF6A4 ++#define reg_lnk2ofdm_data_39_32_pos 0 ++#define reg_lnk2ofdm_data_39_32_len 8 ++#define reg_lnk2ofdm_data_39_32_lsb 32 ++#define p_reg_lnk2ofdm_data_47_40 0xF6A5 ++#define reg_lnk2ofdm_data_47_40_pos 0 ++#define reg_lnk2ofdm_data_47_40_len 8 ++#define reg_lnk2ofdm_data_47_40_lsb 40 ++#define p_reg_lnk2ofdm_data_55_48 0xF6A6 ++#define reg_lnk2ofdm_data_55_48_pos 0 ++#define reg_lnk2ofdm_data_55_48_len 8 ++#define reg_lnk2ofdm_data_55_48_lsb 48 ++#define p_reg_lnk2ofdm_data_63_56 0xF6A7 ++#define reg_lnk2ofdm_data_63_56_pos 0 ++#define reg_lnk2ofdm_data_63_56_len 8 ++#define reg_lnk2ofdm_data_63_56_lsb 56 ++#define p_reg_ofdmtolnk_data_7_0 0xF6A8 ++#define reg_ofdmtolnk_data_7_0_pos 0 ++#define reg_ofdmtolnk_data_7_0_len 8 ++#define reg_ofdmtolnk_data_7_0_lsb 0 ++#define p_reg_ofdmtolnk_data_15_8 0xF6A9 ++#define reg_ofdmtolnk_data_15_8_pos 0 ++#define reg_ofdmtolnk_data_15_8_len 8 ++#define reg_ofdmtolnk_data_15_8_lsb 8 ++#define p_reg_ofdmtolnk_data_23_16 0xF6AA ++#define reg_ofdmtolnk_data_23_16_pos 0 ++#define reg_ofdmtolnk_data_23_16_len 8 ++#define reg_ofdmtolnk_data_23_16_lsb 16 ++#define p_reg_ofdmtolnk_data_31_24 0xF6AB ++#define reg_ofdmtolnk_data_31_24_pos 0 ++#define reg_ofdmtolnk_data_31_24_len 8 ++#define reg_ofdmtolnk_data_31_24_lsb 24 ++#define p_reg_ofdmtolnk_data_39_32 0xF6AC ++#define reg_ofdmtolnk_data_39_32_pos 0 ++#define reg_ofdmtolnk_data_39_32_len 8 ++#define reg_ofdmtolnk_data_39_32_lsb 32 ++#define p_reg_ofdmtolnk_data_47_40 0xF6AD ++#define reg_ofdmtolnk_data_47_40_pos 0 ++#define reg_ofdmtolnk_data_47_40_len 8 ++#define reg_ofdmtolnk_data_47_40_lsb 40 ++#define p_reg_ofdmtolnk_data_55_48 0xF6AE ++#define reg_ofdmtolnk_data_55_48_pos 0 ++#define reg_ofdmtolnk_data_55_48_len 8 ++#define reg_ofdmtolnk_data_55_48_lsb 48 ++#define p_reg_ofdmtolnk_data_63_56 0xF6AF ++#define reg_ofdmtolnk_data_63_56_pos 0 ++#define reg_ofdmtolnk_data_63_56_len 8 ++#define reg_ofdmtolnk_data_63_56_lsb 56 ++#define p_reg_mon51_flag 0xF6B0 ++#define reg_mon51_flag_pos 0 ++#define reg_mon51_flag_len 1 ++#define reg_mon51_flag_lsb 0 ++#define p_reg_force_mon51 0xF6B1 ++#define reg_force_mon51_pos 0 ++#define reg_force_mon51_len 1 ++#define reg_force_mon51_lsb 0 ++#define p_reg_which_cpu 0xF6B2 ++#define reg_which_cpu_pos 0 ++#define reg_which_cpu_len 1 ++#define reg_which_cpu_lsb 0 ++#define p_reg_program_ofdm_code_ready 0xF6B3 ++#define reg_program_ofdm_code_ready_pos 0 ++#define reg_program_ofdm_code_ready_len 1 ++#define reg_program_ofdm_code_ready_lsb 0 ++#define p_reg_link_wr_ofdm_en 0xF6B3 ++#define reg_link_wr_ofdm_en_pos 1 ++#define reg_link_wr_ofdm_en_len 1 ++#define reg_link_wr_ofdm_en_lsb 0 ++#define p_reg_i2c_mode 0xF6B4 ++#define reg_i2c_mode_pos 0 ++#define reg_i2c_mode_len 1 ++#define reg_i2c_mode_lsb 0 ++#define p_reg_sw_reset_sdio 0xF6B4 ++#define reg_sw_reset_sdio_pos 1 ++#define reg_sw_reset_sdio_len 1 ++#define reg_sw_reset_sdio_lsb 0 ++#define p_reg_debug_mpefec_sel 0xF6B4 ++#define reg_debug_mpefec_sel_pos 2 ++#define reg_debug_mpefec_sel_len 1 ++#define reg_debug_mpefec_sel_lsb 0 ++#define p_reg_lnk_dynamic_clk 0xF6B4 ++#define reg_lnk_dynamic_clk_pos 3 ++#define reg_lnk_dynamic_clk_len 1 ++#define reg_lnk_dynamic_clk_lsb 0 ++#define p_reg_lnk_free_clk 0xF6B4 ++#define reg_lnk_free_clk_pos 4 ++#define reg_lnk_free_clk_len 1 ++#define reg_lnk_free_clk_lsb 0 ++#define p_reg_i2c_sample_rate_up_en 0xF6B4 ++#define reg_i2c_sample_rate_up_en_pos 5 ++#define reg_i2c_sample_rate_up_en_len 1 ++#define reg_i2c_sample_rate_up_en_lsb 0 ++#define p_reg_i2c_start_patch 0xF6B4 ++#define reg_i2c_start_patch_pos 6 ++#define reg_i2c_start_patch_len 1 ++#define reg_i2c_start_patch_lsb 0 ++#define p_reg_link_i2cs_msb 0xF6B5 ++#define reg_link_i2cs_msb_pos 1 ++#define reg_link_i2cs_msb_len 1 ++#define reg_link_i2cs_msb_lsb 0 ++#define p_reg_link_ofsm_dbg_en 0xF6B5 ++#define reg_link_ofsm_dbg_en_pos 4 ++#define reg_link_ofsm_dbg_en_len 1 ++#define reg_link_ofsm_dbg_en_lsb 0 ++#define p_reg_link_i2c_dbg_sel 0xF6B5 ++#define reg_link_i2c_dbg_sel_pos 5 ++#define reg_link_i2c_dbg_sel_len 1 ++#define reg_link_i2c_dbg_sel_lsb 0 ++#define p_reg_fast_slow_train 0xF6DD ++#define p_reg_lnk2ofdm_int 0xF6DE ++#define reg_lnk2ofdm_int_pos 0 ++#define reg_lnk2ofdm_int_len 1 ++#define reg_lnk2ofdm_int_lsb 0 ++#define p_reg_ofdm2lnk_int 0xF6DF ++#define reg_ofdm2lnk_int_pos 0 ++#define reg_ofdm2lnk_int_len 1 ++#define reg_ofdm2lnk_int_lsb 0 ++#define p_reg_load_ofdm_reg 0xF6E4 ++#define p_link_ofsm_cmd_reg 0xF6EA ++#define link_ofsm_cmd_reg_pos 0 ++#define link_ofsm_cmd_reg_len 8 ++#define link_ofsm_cmd_reg_lsb 0 ++#define p_link_ofsm_addr_reg_h 0xF6EB ++#define link_ofsm_addr_reg_h_pos 0 ++#define link_ofsm_addr_reg_h_len 8 ++#define link_ofsm_addr_reg_h_lsb 0 ++#define p_link_ofsm_addr_reg_l 0xF6EC ++#define link_ofsm_addr_reg_l_pos 0 ++#define link_ofsm_addr_reg_l_len 8 ++#define link_ofsm_addr_reg_l_lsb 0 ++#define p_link_ofsm_data_reg_0 0xF6ED ++#define link_ofsm_data_reg_0_pos 0 ++#define link_ofsm_data_reg_0_len 8 ++#define link_ofsm_data_reg_0_lsb 0 ++#define p_link_ofsm_data_reg_1 0xF6EE ++#define link_ofsm_data_reg_1_pos 0 ++#define link_ofsm_data_reg_1_len 8 ++#define link_ofsm_data_reg_1_lsb 0 ++#define p_link_ofsm_data_reg_2 0xF6EF ++#define link_ofsm_data_reg_2_pos 0 ++#define link_ofsm_data_reg_2_len 8 ++#define link_ofsm_data_reg_2_lsb 0 ++#define p_link_ofsm_data_reg_3 0xF6F0 ++#define link_ofsm_data_reg_3_pos 0 ++#define link_ofsm_data_reg_3_len 8 ++#define link_ofsm_data_reg_3_lsb 0 ++#define p_link_ofsm_data_reg_4 0xF6F1 ++#define link_ofsm_data_reg_4_pos 0 ++#define link_ofsm_data_reg_4_len 8 ++#define link_ofsm_data_reg_4_lsb 0 ++#define p_link_ofsm_data_reg_5 0xF6F2 ++#define link_ofsm_data_reg_5_pos 0 ++#define link_ofsm_data_reg_5_len 8 ++#define link_ofsm_data_reg_5_lsb 0 ++#define p_link_ofsm_data_reg_6 0xF6F3 ++#define link_ofsm_data_reg_6_pos 0 ++#define link_ofsm_data_reg_6_len 8 ++#define link_ofsm_data_reg_6_lsb 0 ++#define p_link_ofsm_data_reg_7 0xF6F4 ++#define link_ofsm_data_reg_7_pos 0 ++#define link_ofsm_data_reg_7_len 8 ++#define link_ofsm_data_reg_7_lsb 0 ++#define p_link_ofsm_data_reg_8 0xF6F5 ++#define link_ofsm_data_reg_8_pos 0 ++#define link_ofsm_data_reg_8_len 8 ++#define link_ofsm_data_reg_8_lsb 0 ++#define p_link_ofsm_data_reg_9 0xF6F6 ++#define link_ofsm_data_reg_9_pos 0 ++#define link_ofsm_data_reg_9_len 8 ++#define link_ofsm_data_reg_9_lsb 0 ++#define p_link_ofsm_data_reg_10 0xF6F7 ++#define link_ofsm_data_reg_10_pos 0 ++#define link_ofsm_data_reg_10_len 8 ++#define link_ofsm_data_reg_10_lsb 0 ++#define p_link_ofsm_data_reg_11 0xF6F8 ++#define link_ofsm_data_reg_11_pos 0 ++#define link_ofsm_data_reg_11_len 8 ++#define link_ofsm_data_reg_11_lsb 0 ++#define p_link_ofsm_data_reg_12 0xF6F9 ++#define link_ofsm_data_reg_12_pos 0 ++#define link_ofsm_data_reg_12_len 8 ++#define link_ofsm_data_reg_12_lsb 0 ++#define p_link_ofsm_data_reg_13 0xF6FA ++#define link_ofsm_data_reg_13_pos 0 ++#define link_ofsm_data_reg_13_len 8 ++#define link_ofsm_data_reg_13_lsb 0 ++#define p_link_ofsm_data_reg_14 0xF6FB ++#define link_ofsm_data_reg_14_pos 0 ++#define link_ofsm_data_reg_14_len 8 ++#define link_ofsm_data_reg_14_lsb 0 ++#define p_link_ofsm_data_reg_15 0xF6FC ++#define link_ofsm_data_reg_15_pos 0 ++#define link_ofsm_data_reg_15_len 8 ++#define link_ofsm_data_reg_15_lsb 0 ++#define p_reg_debug_mux 0xF6FE ++#define reg_debug_mux_pos 3 ++#define reg_debug_mux_len 1 ++#define reg_debug_mux_lsb 0 ++#define p_reg_top_gpioon0 0xF6FF ++#define reg_top_gpioon0_pos 0 ++#define reg_top_gpioon0_len 1 ++#define reg_top_gpioon0_lsb 0 ++#define p_reg_p_dmb_phy_is_dvb 0xDC31 ++#define reg_p_dmb_phy_is_dvb_pos 0 ++#define reg_p_dmb_phy_is_dvb_len 1 ++#define reg_p_dmb_phy_is_dvb_lsb 0 ++#define p_reg_p_dmb_xt_reset 0xDC32 ++#define reg_p_dmb_xt_reset_pos 0 ++#define reg_p_dmb_xt_reset_len 1 ++#define reg_p_dmb_xt_reset_lsb 0 ++#define p_reg_p_dmb_sw_reset 0xDC33 ++#define reg_p_dmb_sw_reset_pos 0 ++#define reg_p_dmb_sw_reset_len 1 ++#define reg_p_dmb_sw_reset_lsb 0 ++ ++#endif +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-rtl2832.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-rtl2832.patch new file mode 100644 index 0000000000..ee015ccad4 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/dvb-usb-rtl2832.patch @@ -0,0 +1,101202 @@ +driver for RTL28XX devices; +supports several demodulators (RTL2832, RTL2836, RTL2840) +and 10 different tuners; + +many thanks to Ambrosa who got the driver from Realtek and +ported it on kernels 3.0.x and 3.1.x; + +thanks to Hans-Frieder Vogt for the patch to support the 3.2 kernel; + +added define to manage refactored RC code on recent v4l +versions together with old kernels (2.6.x); +modified frontend driver to work directly with the DVBv5 +data structure, as required in new kernels >= 3.3 as well as the +current media_build tree; + +in the end, this patch will apply directly on all kernels >= 3.0.0 +and can be applied also to the current media_build tree so it will +work on all kernels >= 2.6.31 (some little manual editing of the +dvb-usb Makefile and Kconfig files may be required to apply the patch); + +fixed GetSignalStrength function so that the signal strength is not +capped anymore to about 39%; + +added definition of a new Leadteck USB stick: +- Leadtek WinFast DTV Dongle Mini [ID 0413:6a03] +(thanks to djnice); + +added definition of 3 new Terratec USB sticks: +- TERRATEC Cinergy T Stick RC (Rev.3) [ID 0ccd:00d3] +- TERRATEC Cinergy T Stick BLACK (Rev.2) [ID 0ccd:00d4] +- TERRATEC NOXON DAB Stick (Rev.2) [ID 0ccd:00e0] +(thanks to CyBoardR); + +From: Gianluca Gennari +--- + drivers/media/dvb/dvb-usb/Kconfig | 7 + + drivers/media/dvb/dvb-usb/Makefile | 12 + + drivers/media/dvb/dvb-usb/demod_rtl2832.c | 2871 +++ + drivers/media/dvb/dvb-usb/demod_rtl2832.h | 466 + + drivers/media/dvb/dvb-usb/demod_rtl2836.c | 2049 ++ + drivers/media/dvb/dvb-usb/demod_rtl2836.h | 376 + + drivers/media/dvb/dvb-usb/demod_rtl2840.c | 2437 +++ + drivers/media/dvb/dvb-usb/demod_rtl2840.h | 386 + + drivers/media/dvb/dvb-usb/dtmb_demod_base.c | 1566 ++ + drivers/media/dvb/dvb-usb/dtmb_demod_base.h | 2501 +++ + drivers/media/dvb/dvb-usb/dtmb_nim_base.c | 545 + + drivers/media/dvb/dvb-usb/dtmb_nim_base.h | 951 + + drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 + + drivers/media/dvb/dvb-usb/dvbt_demod_base.c | 816 + + drivers/media/dvb/dvb-usb/dvbt_demod_base.h | 2722 +++ + drivers/media/dvb/dvb-usb/dvbt_nim_base.c | 531 + + drivers/media/dvb/dvb-usb/dvbt_nim_base.h | 934 + + drivers/media/dvb/dvb-usb/foundation.c | 352 + + drivers/media/dvb/dvb-usb/foundation.h | 1001 + + drivers/media/dvb/dvb-usb/i2c_bridge.h | 122 + + drivers/media/dvb/dvb-usb/math_mpi.c | 1054 ++ + drivers/media/dvb/dvb-usb/math_mpi.h | 201 + + drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.c | 798 + + drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.h | 213 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.c | 627 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.h | 155 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.c | 816 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.h | 155 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.c | 343 + + drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.h | 141 + + drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.c | 346 + + drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.h | 145 + + drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.c | 360 + + drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.h | 160 + + drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.c | 1082 ++ + drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.h | 264 + + drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.c | 355 + + drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.h | 151 + + drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.c | 408 + + drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.h | 148 + + drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.c | 340 + + drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.h | 137 + + drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.c | 308 + + drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.h | 140 + + drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.c | 319 + + drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.h | 150 + + drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.c | 341 + + drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.h | 146 + + drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.c | 307 + + drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.h | 163 + + drivers/media/dvb/dvb-usb/qam_demod_base.c | 1289 ++ + drivers/media/dvb/dvb-usb/qam_demod_base.h | 2827 +++ + drivers/media/dvb/dvb-usb/qam_nim_base.c | 496 + + drivers/media/dvb/dvb-usb/qam_nim_base.h | 864 + + drivers/media/dvb/dvb-usb/rtl2832u.c | 1825 ++ + drivers/media/dvb/dvb-usb/rtl2832u.h | 275 + + drivers/media/dvb/dvb-usb/rtl2832u_fe.c | 4009 ++++ + drivers/media/dvb/dvb-usb/rtl2832u_fe.h | 312 + + drivers/media/dvb/dvb-usb/rtl2832u_io.c | 912 + + drivers/media/dvb/dvb-usb/rtl2832u_io.h | 287 + + drivers/media/dvb/dvb-usb/rtl2832u_ioctl.c | 521 + + drivers/media/dvb/dvb-usb/rtl2832u_ioctl.h | 60 + + drivers/media/dvb/dvb-usb/tuner_base.h | 1723 ++ + drivers/media/dvb/dvb-usb/tuner_e4000.c | 2482 +++ + drivers/media/dvb/dvb-usb/tuner_e4000.h | 295 + + drivers/media/dvb/dvb-usb/tuner_fc0012.c | 1056 ++ + drivers/media/dvb/dvb-usb/tuner_fc0012.h | 292 + + drivers/media/dvb/dvb-usb/tuner_fc0013.c | 1261 ++ + drivers/media/dvb/dvb-usb/tuner_fc0013.h | 307 + + drivers/media/dvb/dvb-usb/tuner_fc2580.c | 932 + + drivers/media/dvb/dvb-usb/tuner_fc2580.h | 461 + + drivers/media/dvb/dvb-usb/tuner_max3543.c | 1441 ++ + drivers/media/dvb/dvb-usb/tuner_max3543.h | 572 + + drivers/media/dvb/dvb-usb/tuner_mt2063.c | 5267 ++++++ + drivers/media/dvb/dvb-usb/tuner_mt2063.h | 2207 +++ + drivers/media/dvb/dvb-usb/tuner_mt2266.c | 3278 ++++ + drivers/media/dvb/dvb-usb/tuner_mt2266.h | 1534 ++ + drivers/media/dvb/dvb-usb/tuner_mxl5007t.c | 1267 ++ + drivers/media/dvb/dvb-usb/tuner_mxl5007t.h | 784 + + drivers/media/dvb/dvb-usb/tuner_tda18272.c |21631 ++++++++++++++++++++++ + drivers/media/dvb/dvb-usb/tuner_tda18272.h | 7362 ++++++++ + drivers/media/dvb/dvb-usb/tuner_tua9001.c | 1245 ++ + drivers/media/dvb/dvb-usb/tuner_tua9001.h | 493 + + 83 files changed, 100486 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2832.c + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2832.h + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2836.c + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2836.h + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2840.c + create mode 100644 drivers/media/dvb/dvb-usb/demod_rtl2840.h + create mode 100644 drivers/media/dvb/dvb-usb/dtmb_demod_base.c + create mode 100644 drivers/media/dvb/dvb-usb/dtmb_demod_base.h + create mode 100644 drivers/media/dvb/dvb-usb/dtmb_nim_base.c + create mode 100644 drivers/media/dvb/dvb-usb/dtmb_nim_base.h + create mode 100644 drivers/media/dvb/dvb-usb/dvbt_demod_base.c + create mode 100644 drivers/media/dvb/dvb-usb/dvbt_demod_base.h + create mode 100644 drivers/media/dvb/dvb-usb/dvbt_nim_base.c + create mode 100644 drivers/media/dvb/dvb-usb/dvbt_nim_base.h + create mode 100644 drivers/media/dvb/dvb-usb/foundation.c + create mode 100644 drivers/media/dvb/dvb-usb/foundation.h + create mode 100644 drivers/media/dvb/dvb-usb/i2c_bridge.h + create mode 100644 drivers/media/dvb/dvb-usb/math_mpi.c + create mode 100644 drivers/media/dvb/dvb-usb/math_mpi.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.h + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.c + create mode 100644 drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.h + create mode 100644 drivers/media/dvb/dvb-usb/qam_demod_base.c + create mode 100644 drivers/media/dvb/dvb-usb/qam_demod_base.h + create mode 100644 drivers/media/dvb/dvb-usb/qam_nim_base.c + create mode 100644 drivers/media/dvb/dvb-usb/qam_nim_base.h + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u.c + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u.h + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_fe.c + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_fe.h + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_io.c + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_io.h + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_ioctl.c + create mode 100644 drivers/media/dvb/dvb-usb/rtl2832u_ioctl.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_base.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_e4000.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_e4000.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc0012.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc0012.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc0013.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc0013.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc2580.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_fc2580.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_max3543.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_max3543.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mt2063.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mt2063.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mt2266.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mt2266.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mxl5007t.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_mxl5007t.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_tda18272.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_tda18272.h + create mode 100644 drivers/media/dvb/dvb-usb/tuner_tua9001.c + create mode 100644 drivers/media/dvb/dvb-usb/tuner_tua9001.h + +diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig +index 787ffab..cbb591f 100644 +--- a/drivers/media/dvb/dvb-usb/Kconfig ++++ b/drivers/media/dvb/dvb-usb/Kconfig +@@ -351,6 +351,13 @@ config DVB_USB_AF9035 + help + Say Y here to support the Afatech AF9035 based DVB-T USB2.0 receiver + ++config DVB_USB_RTL2832 ++ tristate "Realtek RTL2832 DVB-T USB2.0 support" ++ depends on DVB_USB ++ default m ++ help ++ Say Y or M to support the Realtek RTL2832 DVB-T receiver ++ + config DVB_USB_CE6230 + tristate "Intel CE6230 DVB-T USB2.0 support" + depends on DVB_USB +diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile +index 4745905..834c2b2 100644 +--- a/drivers/media/dvb/dvb-usb/Makefile ++++ b/drivers/media/dvb/dvb-usb/Makefile +@@ -115,6 +115,18 @@ dvb-usb-a867-objs := a867_af903x-core.o a867_af903x-devices.o a867_af903x-drv.o + a867_user.o a867_mxl5007t.o a867_Maxlinear_MXL5007.o a867_Afa_AF9007.o + obj-$(CONFIG_DVB_USB_A867) += dvb-usb-a867.o + ++dvb-usb-rtl2832-objs := demod_rtl2832.o dvbt_demod_base.o dvbt_nim_base.o foundation.o \ ++ math_mpi.o nim_rtl2832_mxl5007t.o nim_rtl2832_fc2580.o nim_rtl2832_mt2266.o \ ++ rtl2832u.o rtl2832u_fe.o rtl2832u_io.o tuner_mxl5007t.o tuner_fc2580.o \ ++ tuner_mt2266.o tuner_tua9001.o nim_rtl2832_tua9001.o tuner_fc0012.o \ ++ nim_rtl2832_fc0012.o demod_rtl2836.o dtmb_demod_base.o dtmb_nim_base.o \ ++ nim_rtl2836_fc2580.o nim_rtl2836_mxl5007t.o tuner_e4000.o nim_rtl2832_e4000.o \ ++ tuner_mt2063.o demod_rtl2840.o tuner_max3543.o nim_rtl2832_mt2063.o \ ++ nim_rtl2832_max3543.o nim_rtl2840_mt2063.o nim_rtl2840_max3543.o \ ++ qam_demod_base.o qam_nim_base.o tuner_tda18272.o nim_rtl2832_tda18272.o \ ++ rtl2832u_ioctl.o nim_rtl2832_fc0013.o tuner_fc0013.o ++obj-$(CONFIG_DVB_USB_RTL2832) += dvb-usb-rtl2832.o ++ + ccflags-y += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ + # due to tuner-xc3028 + ccflags-y += -Idrivers/media/common/tuners +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2832.c b/drivers/media/dvb/dvb-usb/demod_rtl2832.c +new file mode 100644 +index 0000000..f367f7f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2832.c +@@ -0,0 +1,2871 @@ ++/** ++ ++@file ++ ++@brief RTL2832 demod module definition ++ ++One can manipulate RTL2832 demod through RTL2832 module. ++RTL2832 module is derived from DVB-T demod module. ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 demod module builder ++ ++Use BuildRtl2832Module() to build RTL2832 module, set all module function pointers with the corresponding ++functions, and initialize module private variables. ++ ++ ++@param [in] ppDemod Pointer to RTL2832 demod module pointer ++@param [in] pDvbtDemodModuleMemory Pointer to an allocated DVB-T demod module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr RTL2832 I2C device address ++@param [in] CrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] TsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] AppMode RTL2832 application mode for setting ++@param [in] UpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] IsFunc1Enabled RTL2832 Function 1 enabling status for setting ++ ++ ++@note ++ -# One should call BuildRtl2832Module() to build RTL2832 module before using it. ++ ++*/ ++void ++BuildRtl2832Module( ++ DVBT_DEMOD_MODULE **ppDemod, ++ DVBT_DEMOD_MODULE *pDvbtDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ int AppMode, ++ unsigned long UpdateFuncRefPeriodMs, ++ int IsFunc1Enabled ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set demod module pointer, ++ *ppDemod = pDvbtDemodModuleMemory; ++ ++ // Get demod module. ++ pDemod = *ppDemod; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pDemod->pBaseInterface = pBaseInterfaceModuleMemory; ++ pDemod->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Set demod type. ++ pDemod->DemodType = DVBT_DEMOD_TYPE_RTL2832; ++ ++ // Set demod I2C device address. ++ pDemod->DeviceAddr = DeviceAddr; ++ ++ // Set demod crystal frequency in Hz. ++ pDemod->CrystalFreqHz = CrystalFreqHz; ++ ++ // Set demod TS interface mode. ++ pDemod->TsInterfaceMode = TsInterfaceMode; ++ ++ ++ // Initialize demod parameter setting status ++ pDemod->IsBandwidthModeSet = NO; ++ pDemod->IsIfFreqHzSet = NO; ++ pDemod->IsSpectrumModeSet = NO; ++ ++ ++ // Initialize demod register table. ++ rtl2832_InitRegTable(pDemod); ++ ++ ++ // Build I2C birdge module. ++ rtl2832_BuildI2cBridgeModule(pDemod); ++ ++ ++ // Set demod module I2C function pointers with default functions. ++ pDemod->SetRegPage = dvbt_demod_default_SetRegPage; ++ pDemod->SetRegBytes = dvbt_demod_default_SetRegBytes; ++ pDemod->GetRegBytes = dvbt_demod_default_GetRegBytes; ++ pDemod->SetRegMaskBits = dvbt_demod_default_SetRegMaskBits; ++ pDemod->GetRegMaskBits = dvbt_demod_default_GetRegMaskBits; ++ pDemod->SetRegBits = dvbt_demod_default_SetRegBits; ++ pDemod->GetRegBits = dvbt_demod_default_GetRegBits; ++ pDemod->SetRegBitsWithPage = dvbt_demod_default_SetRegBitsWithPage; ++ pDemod->GetRegBitsWithPage = dvbt_demod_default_GetRegBitsWithPage; ++ ++ ++ // Set demod module manipulating function pointers with default functions. ++ pDemod->GetDemodType = dvbt_demod_default_GetDemodType; ++ pDemod->GetDeviceAddr = dvbt_demod_default_GetDeviceAddr; ++ pDemod->GetCrystalFreqHz = dvbt_demod_default_GetCrystalFreqHz; ++ ++ pDemod->GetBandwidthMode = dvbt_demod_default_GetBandwidthMode; ++ pDemod->GetIfFreqHz = dvbt_demod_default_GetIfFreqHz; ++ pDemod->GetSpectrumMode = dvbt_demod_default_GetSpectrumMode; ++ ++ ++ // Set demod module manipulating function pointers with particular functions. ++ pDemod->IsConnectedToI2c = rtl2832_IsConnectedToI2c; ++ pDemod->SoftwareReset = rtl2832_SoftwareReset; ++ pDemod->Initialize = rtl2832_Initialize; ++ pDemod->SetBandwidthMode = rtl2832_SetBandwidthMode; ++ pDemod->SetIfFreqHz = rtl2832_SetIfFreqHz; ++ pDemod->SetSpectrumMode = rtl2832_SetSpectrumMode; ++ ++ pDemod->IsTpsLocked = rtl2832_IsTpsLocked; ++ pDemod->IsSignalLocked = rtl2832_IsSignalLocked; ++ ++ pDemod->GetSignalStrength = rtl2832_GetSignalStrength; ++ pDemod->GetSignalQuality = rtl2832_GetSignalQuality; ++ ++ pDemod->GetBer = rtl2832_GetBer; ++ pDemod->GetSnrDb = rtl2832_GetSnrDb; ++ ++ pDemod->GetRfAgc = rtl2832_GetRfAgc; ++ pDemod->GetIfAgc = rtl2832_GetIfAgc; ++ pDemod->GetDiAgc = rtl2832_GetDiAgc; ++ ++ pDemod->GetTrOffsetPpm = rtl2832_GetTrOffsetPpm; ++ pDemod->GetCrOffsetHz = rtl2832_GetCrOffsetHz; ++ ++ pDemod->GetConstellation = rtl2832_GetConstellation; ++ pDemod->GetHierarchy = rtl2832_GetHierarchy; ++ pDemod->GetCodeRateLp = rtl2832_GetCodeRateLp; ++ pDemod->GetCodeRateHp = rtl2832_GetCodeRateHp; ++ pDemod->GetGuardInterval = rtl2832_GetGuardInterval; ++ pDemod->GetFftMode = rtl2832_GetFftMode; ++ ++ pDemod->UpdateFunction = rtl2832_UpdateFunction; ++ pDemod->ResetFunction = rtl2832_ResetFunction; ++ ++ ++ // Initialize demod extra module variables. ++ pExtra->AppMode = AppMode; ++ ++ ++ // Initialize demod Function 1 variables. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_NORMAL; ++ ++ pExtra->IsFunc1Enabled = IsFunc1Enabled; ++ ++ pExtra->Func1WaitTimeMax = DivideWithCeiling(RTL2832_FUNC1_WAIT_TIME_MS, UpdateFuncRefPeriodMs); ++ pExtra->Func1GettingTimeMax = DivideWithCeiling(RTL2832_FUNC1_GETTING_TIME_MS, UpdateFuncRefPeriodMs); ++ pExtra->Func1GettingNumEachTime = DivideWithCeiling(RTL2832_FUNC1_GETTING_NUM_MIN, pExtra->Func1GettingTimeMax + 1); ++ ++ pExtra->Func1QamBak = 0xff; ++ pExtra->Func1HierBak = 0xff; ++ pExtra->Func1LpCrBak = 0xff; ++ pExtra->Func1HpCrBak = 0xff; ++ pExtra->Func1GiBak = 0xff; ++ pExtra->Func1FftBak = 0xff; ++ ++ ++ // Set demod extra module function pointers. ++ pExtra->GetAppMode = rtl2832_GetAppMode; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_IS_CONNECTED_TO_I2C ++ ++*/ ++void ++rtl2832_IsConnectedToI2c( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char Nothing; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Send read command. ++ // Note: The number of reading bytes must be greater than 0. ++ if(pBaseInterface->I2cRead(pBaseInterface, pDemod->DeviceAddr, &Nothing, LEN_1_BYTE) == FUNCTION_ERROR) ++ goto error_status_i2c_read; ++ ++ ++ // Set I2cConnectionStatus with YES. ++ *pAnswer = YES; ++ ++ ++ return; ++ ++ ++error_status_i2c_read: ++ ++ // Set I2cConnectionStatus with NO. ++ *pAnswer = NO; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SOFTWARE_RESET ++ ++*/ ++int ++rtl2832_SoftwareReset( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Set SOFT_RST with 1. Then, set SOFT_RST with 0. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_SOFT_RST, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_SOFT_RST, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_Initialize( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Initializing table entry only used in Initialize() ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long WritingValue; ++ } ++ INIT_TABLE_ENTRY; ++ ++ // TS interface initializing table entry only used in Initialize() ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long WritingValue[TS_INTERFACE_MODE_NUM]; ++ } ++ TS_INTERFACE_INIT_TABLE_ENTRY; ++ ++ // Application initializing table entry only used in Initialize() ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long WritingValue[RTL2832_APPLICATION_MODE_NUM]; ++ } ++ APP_INIT_TABLE_ENTRY; ++ ++ ++ ++ static const INIT_TABLE_ENTRY InitTable[RTL2832_INIT_TABLE_LEN] = ++ { ++ // RegBitName, WritingValue ++ {DVBT_AD_EN_REG, 0x1 }, ++ {DVBT_AD_EN_REG1, 0x1 }, ++ {DVBT_RSD_BER_FAIL_VAL, 0x2800 }, ++ {DVBT_MGD_THD0, 0x10 }, ++ {DVBT_MGD_THD1, 0x20 }, ++ {DVBT_MGD_THD2, 0x20 }, ++ {DVBT_MGD_THD3, 0x40 }, ++ {DVBT_MGD_THD4, 0x22 }, ++ {DVBT_MGD_THD5, 0x32 }, ++ {DVBT_MGD_THD6, 0x37 }, ++ {DVBT_MGD_THD7, 0x39 }, ++ {DVBT_EN_BK_TRK, 0x0 }, ++ {DVBT_EN_CACQ_NOTCH, 0x0 }, ++ {DVBT_AD_AV_REF, 0x2a }, ++ {DVBT_REG_PI, 0x6 }, ++ {DVBT_PIP_ON, 0x0 }, ++ {DVBT_CDIV_PH0, 0x8 }, ++ {DVBT_CDIV_PH1, 0x8 }, ++ {DVBT_SCALE1_B92, 0x4 }, ++ {DVBT_SCALE1_B93, 0xb0 }, ++ {DVBT_SCALE1_BA7, 0x78 }, ++ {DVBT_SCALE1_BA9, 0x28 }, ++ {DVBT_SCALE1_BAA, 0x59 }, ++ {DVBT_SCALE1_BAB, 0x83 }, ++ {DVBT_SCALE1_BAC, 0xd4 }, ++ {DVBT_SCALE1_BB0, 0x65 }, ++ {DVBT_SCALE1_BB1, 0x43 }, ++ {DVBT_KB_P1, 0x1 }, ++ {DVBT_KB_P2, 0x4 }, ++ {DVBT_KB_P3, 0x7 }, ++ {DVBT_K1_CR_STEP12, 0xa }, ++ {DVBT_REG_GPE, 0x1 }, ++ }; ++ ++ static const TS_INTERFACE_INIT_TABLE_ENTRY TsInterfaceInitTable[RTL2832_TS_INTERFACE_INIT_TABLE_LEN] = ++ { ++ // RegBitName, WritingValue for {Parallel, Serial} ++ {DVBT_SERIAL, {0x0, 0x1}}, ++ {DVBT_CDIV_PH0, {0x9, 0x1}}, ++ {DVBT_CDIV_PH1, {0x9, 0x2}}, ++ {DVBT_MPEG_IO_OPT_2_2, {0x0, 0x0}}, ++ {DVBT_MPEG_IO_OPT_1_0, {0x0, 0x1}}, ++ }; ++ ++ static const APP_INIT_TABLE_ENTRY AppInitTable[RTL2832_APP_INIT_TABLE_LEN] = ++ { ++ // RegBitName, WritingValue for {Dongle, STB} ++ {DVBT_TRK_KS_P2, {0x4, 0x4}}, ++ {DVBT_TRK_KS_I2, {0x7, 0x7}}, ++ {DVBT_TR_THD_SET2, {0x6, 0x6}}, ++ {DVBT_TRK_KC_I2, {0x5, 0x6}}, ++ {DVBT_CR_THD_SET2, {0x1, 0x1}}, ++ }; ++ ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ int i; ++ ++ int TsInterfaceMode; ++ int AppMode; ++ ++ ++ ++ // Get base interface and demod extra module. ++ pBaseInterface = pDemod->pBaseInterface; ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ // Get TS interface mode. ++ TsInterfaceMode = pDemod->TsInterfaceMode; ++ ++ // Get application mode. ++ pExtra->GetAppMode(pDemod, &AppMode); ++ ++ ++ // Initialize demod registers according to the initializing table. ++ for(i = 0; i < RTL2832_INIT_TABLE_LEN; i++) ++ { ++ if(pDemod->SetRegBitsWithPage(pDemod, InitTable[i].RegBitName, InitTable[i].WritingValue) ++ != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ // Initialize demod registers according to the TS interface initializing table. ++ for(i = 0; i < RTL2832_TS_INTERFACE_INIT_TABLE_LEN; i++) ++ { ++ if(pDemod->SetRegBitsWithPage(pDemod, TsInterfaceInitTable[i].RegBitName, ++ TsInterfaceInitTable[i].WritingValue[TsInterfaceMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ // Initialize demod registers according to the application initializing table. ++ for(i = 0; i < RTL2832_APP_INIT_TABLE_LEN; i++) ++ { ++ if(pDemod->SetRegBitsWithPage(pDemod, AppInitTable[i].RegBitName, ++ AppInitTable[i].WritingValue[AppMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_BANDWIDTH_MODE ++ ++*/ ++int ++rtl2832_SetBandwidthMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int BandwidthMode ++ ) ++{ ++ static const unsigned char HlpfxTable[DVBT_BANDWIDTH_MODE_NUM][RTL2832_H_LPF_X_LEN] = ++ { ++ // H_LPF_X writing value for 6 MHz bandwidth ++ { ++ 0xf5, 0xff, 0x15, 0x38, 0x5d, 0x6d, 0x52, 0x07, 0xfa, 0x2f, ++ 0x53, 0xf5, 0x3f, 0xca, 0x0b, 0x91, 0xea, 0x30, 0x63, 0xb2, ++ 0x13, 0xda, 0x0b, 0xc4, 0x18, 0x7e, 0x16, 0x66, 0x08, 0x67, ++ 0x19, 0xe0, ++ }, ++ ++ // H_LPF_X writing value for 7 MHz bandwidth ++ { ++ 0xe7, 0xcc, 0xb5, 0xba, 0xe8, 0x2f, 0x67, 0x61, 0x00, 0xaf, ++ 0x86, 0xf2, 0xbf, 0x59, 0x04, 0x11, 0xb6, 0x33, 0xa4, 0x30, ++ 0x15, 0x10, 0x0a, 0x42, 0x18, 0xf8, 0x17, 0xd9, 0x07, 0x22, ++ 0x19, 0x10, ++ }, ++ ++ // H_LPF_X writing value for 8 MHz bandwidth ++ { ++ 0x09, 0xf6, 0xd2, 0xa7, 0x9a, 0xc9, 0x27, 0x77, 0x06, 0xbf, ++ 0xec, 0xf4, 0x4f, 0x0b, 0xfc, 0x01, 0x63, 0x35, 0x54, 0xa7, ++ 0x16, 0x66, 0x08, 0xb4, 0x19, 0x6e, 0x19, 0x65, 0x05, 0xc8, ++ 0x19, 0xe0, ++ }, ++ }; ++ ++ ++ unsigned long CrystalFreqHz; ++ ++ long ConstWithBandwidthMode; ++ ++ MPI MpiCrystalFreqHz; ++ MPI MpiConst, MpiVar0, MpiVar1, MpiNone; ++ ++ unsigned long RsampRatio; ++ ++ long CfreqOffRatioInt; ++ unsigned long CfreqOffRatioBinary; ++ ++ ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Set H_LPF_X registers with HlpfxTable according to BandwidthMode. ++ if(pDemod->SetRegPage(pDemod, RTL2832_H_LPF_X_PAGE) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegBytes(pDemod, RTL2832_H_LPF_X_ADDR, HlpfxTable[BandwidthMode], RTL2832_H_LPF_X_LEN) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Determine constant value with bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: ConstWithBandwidthMode = 48000000; break; ++ case DVBT_BANDWIDTH_7MHZ: ConstWithBandwidthMode = 56000000; break; ++ case DVBT_BANDWIDTH_8MHZ: ConstWithBandwidthMode = 64000000; break; ++ } ++ ++ ++ // Calculate RSAMP_RATIO value. ++ // Note: RSAMP_RATIO = floor(CrystalFreqHz * 7 * pow(2, 22) / ConstWithBandwidthMode) ++ MpiSetValue(&MpiCrystalFreqHz, CrystalFreqHz); ++ MpiSetValue(&MpiVar1, ConstWithBandwidthMode); ++ MpiSetValue(&MpiConst, 7); ++ ++ MpiMul(&MpiVar0, MpiCrystalFreqHz, MpiConst); ++ MpiLeftShift(&MpiVar0, MpiVar0, 22); ++ MpiDiv(&MpiVar0, &MpiNone, MpiVar0, MpiVar1); ++ ++ MpiGetValue(MpiVar0, (long *)&RsampRatio); ++ ++ ++ // Set RSAMP_RATIO with calculated value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_RSAMP_RATIO, RsampRatio) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Calculate CFREQ_OFF_RATIO value. ++ // Note: CFREQ_OFF_RATIO = - floor(ConstWithBandwidthMode * pow(2, 20) / (CrystalFreqHz * 7)) ++ MpiSetValue(&MpiCrystalFreqHz, CrystalFreqHz); ++ MpiSetValue(&MpiVar0, ConstWithBandwidthMode); ++ MpiSetValue(&MpiConst, 7); ++ ++ MpiLeftShift(&MpiVar0, MpiVar0, 20); ++ MpiMul(&MpiVar1, MpiCrystalFreqHz, MpiConst); ++ MpiDiv(&MpiVar0, &MpiNone, MpiVar0, MpiVar1); ++ ++ MpiGetValue(MpiVar0, &CfreqOffRatioInt); ++ CfreqOffRatioInt = - CfreqOffRatioInt; ++ ++ CfreqOffRatioBinary = SignedIntToBin(CfreqOffRatioInt, RTL2832_CFREQ_OFF_RATIO_BIT_NUM); ++ ++ ++ // Set CFREQ_OFF_RATIO with calculated value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_CFREQ_OFF_RATIO, CfreqOffRatioBinary) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ ++ // Set demod bandwidth mode parameter. ++ pDemod->BandwidthMode = BandwidthMode; ++ pDemod->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_IF_FREQ_HZ ++ ++*/ ++int ++rtl2832_SetIfFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ) ++{ ++ unsigned long CrystalFreqHz; ++ ++ unsigned long EnBbin; ++ ++ MPI MpiCrystalFreqHz, MpiVar, MpiNone; ++ ++ long PsetIffreqInt; ++ unsigned long PsetIffreqBinary; ++ ++ ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Determine and set EN_BBIN value. ++ EnBbin = (IfFreqHz == IF_FREQ_0HZ) ? 0x1 : 0x0; ++ ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_EN_BBIN, EnBbin) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Calculate PSET_IFFREQ value. ++ // Note: PSET_IFFREQ = - floor((IfFreqHz % CrystalFreqHz) * pow(2, 22) / CrystalFreqHz) ++ MpiSetValue(&MpiCrystalFreqHz, CrystalFreqHz); ++ ++ MpiSetValue(&MpiVar, (IfFreqHz % CrystalFreqHz)); ++ MpiLeftShift(&MpiVar, MpiVar, RTL2832_PSET_IFFREQ_BIT_NUM); ++ MpiDiv(&MpiVar, &MpiNone, MpiVar, MpiCrystalFreqHz); ++ ++ MpiGetValue(MpiVar, &PsetIffreqInt); ++ PsetIffreqInt = - PsetIffreqInt; ++ ++ PsetIffreqBinary = SignedIntToBin(PsetIffreqInt, RTL2832_PSET_IFFREQ_BIT_NUM); ++ ++ ++ // Set PSET_IFFREQ with calculated value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_PSET_IFFREQ, PsetIffreqBinary) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod IF frequnecy parameter. ++ pDemod->IfFreqHz = IfFreqHz; ++ pDemod->IsIfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_SPECTRUM_MODE ++ ++*/ ++int ++rtl2832_SetSpectrumMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ) ++{ ++ unsigned long SpecInv; ++ ++ ++ ++ // Determine SpecInv according to spectrum mode. ++ switch(SpectrumMode) ++ { ++ default: ++ case SPECTRUM_NORMAL: SpecInv = 0; break; ++ case SPECTRUM_INVERSE: SpecInv = 1; break; ++ } ++ ++ ++ // Set SPEC_INV with SpecInv. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_SPEC_INV, SpecInv) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod spectrum mode parameter. ++ pDemod->SpectrumMode = SpectrumMode; ++ pDemod->IsSpectrumModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_IS_TPS_LOCKED ++ ++*/ ++int ++rtl2832_IsTpsLocked( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long FsmStage; ++ ++ ++ ++ // Get FSM stage from FSM_STAGE. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine answer according to FSM stage. ++ if(FsmStage > 9) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_IS_SIGNAL_LOCKED ++ ++*/ ++int ++rtl2832_IsSignalLocked( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long FsmStage; ++ ++ ++ ++ // Get FSM stage from FSM_STAGE. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine answer according to FSM stage. ++ if(FsmStage == 11) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++rtl2832_GetSignalStrength( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ) ++{ ++ unsigned long FsmStage; ++ long IfAgc; ++ ++ ++ ++ // Get FSM stage and IF AGC value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetIfAgc(pDemod, &IfAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine signal strength according to FSM stage and IF AGC value. ++ if(FsmStage < 10) ++ *pSignalStrength = 0; ++ else ++ *pSignalStrength = 55 - IfAgc / 182; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++rtl2832_GetSignalQuality( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ) ++{ ++ unsigned long FsmStage, RsdBerEst; ++ ++ MPI MpiVar; ++ long Var; ++ ++ ++ ++ // Get FSM_STAGE and RSD_BER_EST. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSD_BER_EST, &RsdBerEst) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // If demod is not signal-locked, set signal quality with zero. ++ if(FsmStage < 10) ++ { ++ *pSignalQuality = 0; ++ goto success_status_non_signal_lock; ++ } ++ ++ // Determine signal quality according to RSD_BER_EST. ++ // Note: Map RSD_BER_EST value 8192 ~ 128 to 10 ~ 100 ++ // Original formula: SignalQuality = 205 - 15 * log2(RSD_BER_EST) ++ // Adjusted formula: SignalQuality = ((205 << 5) - 15 * (log2(RSD_BER_EST) << 5)) >> 5 ++ // If RSD_BER_EST > 8192, signal quality is 10. ++ // If RSD_BER_EST < 128, signal quality is 100. ++ if(RsdBerEst > 8192) ++ { ++ *pSignalQuality = 10; ++ } ++ else if(RsdBerEst < 128) ++ { ++ *pSignalQuality = 100; ++ } ++ else ++ { ++ MpiSetValue(&MpiVar, RsdBerEst); ++ MpiLog2(&MpiVar, MpiVar, RTL2832_SQ_FRAC_BIT_NUM); ++ MpiGetValue(MpiVar, &Var); ++ ++ *pSignalQuality = ((205 << RTL2832_SQ_FRAC_BIT_NUM) - 15 * Var) >> RTL2832_SQ_FRAC_BIT_NUM; ++ } ++ ++ ++success_status_non_signal_lock: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_BER ++ ++*/ ++int ++rtl2832_GetBer( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ) ++{ ++ unsigned long RsdBerEst; ++ ++ ++ ++ // Get RSD_BER_EST. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSD_BER_EST, &RsdBerEst) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set BER numerator according to RSD_BER_EST. ++ *pBerNum = RsdBerEst; ++ ++ // Set BER denominator. ++ *pBerDen = RTL2832_BER_DEN_VALUE; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_SNR_DB ++ ++*/ ++int ++rtl2832_GetSnrDb( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ unsigned long FsmStage; ++ unsigned long CeEstEvm; ++ int Constellation, Hierarchy; ++ ++ static const long SnrDbNumConst[DVBT_CONSTELLATION_NUM][DVBT_HIERARCHY_NUM] = ++ { ++ {122880, 122880, 122880, 122880, }, ++ {146657, 146657, 156897, 171013, }, ++ {167857, 167857, 173127, 181810, }, ++ }; ++ ++ long Var; ++ MPI MpiCeEstEvm, MpiVar; ++ ++ ++ ++ // Get FSM stage, CE_EST_EVM, constellation, and hierarchy. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_CE_EST_EVM, &CeEstEvm) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetConstellation(pDemod, &Constellation) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetHierarchy(pDemod, &Hierarchy) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ ++ // SNR dB formula ++ // Original formula: SNR_dB = 10 * log10(Norm * pow(2, 11) / CeEstEvm) ++ // Adjusted formula: SNR_dB = (SNR_DB_NUM_CONST - 10 * log2(CeEstEvm) * pow(2, SNR_FRAC_BIT_NUM)) / SNR_DB_DEN ++ // SNR_DB_NUM_CONST = 10 * log2(Norm * pow(2, 11)) * pow(2, SNR_FRAC_BIT_NUM) ++ // SNR_DB_DEN = log2(10) * pow(2, SNR_FRAC_BIT_NUM) ++ // Norm: ++ // None Alpha=1 Alpha=2 Alpha=4 ++ // 4-QAM 2 2 2 2 ++ // 16-QAM 10 10 20 52 ++ // 64-QAM 42 42 60 108 ++ ++ ++ // If FSM stage < 10, set CE_EST_EVM with max value. ++ if(FsmStage < 10) ++ CeEstEvm = RTL2832_CE_EST_EVM_MAX_VALUE; ++ ++ ++ // Calculate SNR dB numerator. ++ MpiSetValue(&MpiCeEstEvm, CeEstEvm); ++ ++ MpiLog2(&MpiVar, MpiCeEstEvm, RTL2832_SNR_FRAC_BIT_NUM); ++ ++ MpiGetValue(MpiVar, &Var); ++ ++ *pSnrDbNum = SnrDbNumConst[Constellation][Hierarchy] - 10 * Var; ++ ++ ++ // Set SNR dB denominator. ++ *pSnrDbDen = RTL2832_SNR_DB_DEN; ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_RF_AGC ++ ++*/ ++int ++rtl2832_GetRfAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ) ++{ ++ unsigned long Value; ++ ++ ++ ++ // Get RF_AGC_VAL to Value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RF_AGC_VAL, &Value) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Convert Value to signed integer and store the signed integer to RfAgc. ++ *pRfAgc = (int)BinToSignedInt(Value, RTL2832_RF_AGC_REG_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_IF_AGC ++ ++*/ ++int ++rtl2832_GetIfAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ) ++{ ++ unsigned long Value; ++ ++ ++ ++ // Get IF_AGC_VAL to Value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_IF_AGC_VAL, &Value) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Convert Value to signed integer and store the signed integer to IfAgc. ++ *pIfAgc = (int)BinToSignedInt(Value, RTL2832_IF_AGC_REG_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_DI_AGC ++ ++*/ ++int ++rtl2832_GetDiAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDiAgc ++ ) ++{ ++ unsigned long Value; ++ ++ ++ ++ // Get DAGC_VAL to DiAgc. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_DAGC_VAL, &Value) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ *pDiAgc = (unsigned char)Value; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++rtl2832_GetTrOffsetPpm( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ) ++{ ++ unsigned long SfreqOffBinary; ++ long SfreqOffInt; ++ ++ MPI MpiSfreqOffInt; ++ MPI MpiConst, MpiVar; ++ ++ ++ // Get SfreqOff binary value from SFREQ_OFF register bits. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_SFREQ_OFF, &SfreqOffBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // Convert SfreqOff binary value to signed integer. ++ SfreqOffInt = BinToSignedInt(SfreqOffBinary, RTL2832_SFREQ_OFF_BIT_NUM); ++ ++ ++ // Get TR offset in ppm. ++ // Note: Original formula: TrOffsetPpm = (SfreqOffInt * 1000000) / pow(2, 24) ++ // Adjusted formula: TrOffsetPpm = (SfreqOffInt * 1000000) >> 24 ++ MpiSetValue(&MpiSfreqOffInt, SfreqOffInt); ++ MpiSetValue(&MpiConst, 1000000); ++ ++ MpiMul(&MpiVar, MpiSfreqOffInt, MpiConst); ++ MpiRightShift(&MpiVar, MpiVar, 24); ++ ++ MpiGetValue(MpiVar, pTrOffsetPpm); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++rtl2832_GetCrOffsetHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ) ++{ ++ int BandwidthMode; ++ int FftMode; ++ ++ unsigned long CfreqOffBinary; ++ long CfreqOffInt; ++ ++ long ConstWithBandwidthMode, ConstWithFftMode; ++ ++ MPI MpiCfreqOffInt; ++ MPI MpiConstWithBandwidthMode, MpiConstWithFftMode; ++ MPI MpiConst, MpiVar0, MpiVar1, MpiNone; ++ ++ ++ ++ // Get demod bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, &BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_bandwidth_mode; ++ ++ ++ // Get demod FFT mode. ++ if(pDemod->GetFftMode(pDemod, &FftMode) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Get CfreqOff binary value from CFREQ_OFF register bits. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_CFREQ_OFF, &CfreqOffBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // Convert CfreqOff binary value to signed integer. ++ CfreqOffInt = BinToSignedInt(CfreqOffBinary, RTL2832_CFREQ_OFF_BIT_NUM); ++ ++ ++ // Determine constant value with bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: ConstWithBandwidthMode = 48000000; break; ++ case DVBT_BANDWIDTH_7MHZ: ConstWithBandwidthMode = 56000000; break; ++ case DVBT_BANDWIDTH_8MHZ: ConstWithBandwidthMode = 64000000; break; ++ } ++ ++ ++ // Determine constant value with FFT mode. ++ switch(FftMode) ++ { ++ default: ++ case DVBT_FFT_MODE_2K: ConstWithFftMode = 2048; break; ++ case DVBT_FFT_MODE_8K: ConstWithFftMode = 8192; break; ++ } ++ ++ ++ // Get Cr offset in Hz. ++ // Note: Original formula: CrOffsetHz = (CfreqOffInt * ConstWithBandwidthMode) / (ConstWithFftMode * 7 * 128) ++ // Adjusted formula: CrOffsetHz = (CfreqOffInt * ConstWithBandwidthMode) / ((ConstWithFftMode * 7) << 7) ++ MpiSetValue(&MpiCfreqOffInt, CfreqOffInt); ++ MpiSetValue(&MpiConstWithBandwidthMode, ConstWithBandwidthMode); ++ MpiSetValue(&MpiConstWithFftMode, ConstWithFftMode); ++ MpiSetValue(&MpiConst, 7); ++ ++ MpiMul(&MpiVar0, MpiCfreqOffInt, MpiConstWithBandwidthMode); ++ MpiMul(&MpiVar1, MpiConstWithFftMode, MpiConst); ++ MpiLeftShift(&MpiVar1, MpiVar1, 7); ++ MpiDiv(&MpiVar0, &MpiNone, MpiVar0, MpiVar1); ++ ++ MpiGetValue(MpiVar0, pCrOffsetHz); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_get_demod_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_CONSTELLATION ++ ++*/ ++int ++rtl2832_GetConstellation( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pConstellation ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS constellation information from RX_CONSTEL. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RX_CONSTEL, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pConstellation = DVBT_CONSTELLATION_QPSK; break; ++ case 1: *pConstellation = DVBT_CONSTELLATION_16QAM; break; ++ case 2: *pConstellation = DVBT_CONSTELLATION_64QAM; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_HIERARCHY ++ ++*/ ++int ++rtl2832_GetHierarchy( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pHierarchy ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS hierarchy infromation from RX_HIER. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RX_HIER, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pHierarchy = DVBT_HIERARCHY_NONE; break; ++ case 1: *pHierarchy = DVBT_HIERARCHY_ALPHA_1; break; ++ case 2: *pHierarchy = DVBT_HIERARCHY_ALPHA_2; break; ++ case 3: *pHierarchy = DVBT_HIERARCHY_ALPHA_4; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_CODE_RATE_LP ++ ++*/ ++int ++rtl2832_GetCodeRateLp( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateLp ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS low-priority code rate infromation from RX_C_RATE_LP. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RX_C_RATE_LP, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pCodeRateLp = DVBT_CODE_RATE_1_OVER_2; break; ++ case 1: *pCodeRateLp = DVBT_CODE_RATE_2_OVER_3; break; ++ case 2: *pCodeRateLp = DVBT_CODE_RATE_3_OVER_4; break; ++ case 3: *pCodeRateLp = DVBT_CODE_RATE_5_OVER_6; break; ++ case 4: *pCodeRateLp = DVBT_CODE_RATE_7_OVER_8; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_CODE_RATE_HP ++ ++*/ ++int ++rtl2832_GetCodeRateHp( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateHp ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS high-priority code rate infromation from RX_C_RATE_HP. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RX_C_RATE_HP, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pCodeRateHp = DVBT_CODE_RATE_1_OVER_2; break; ++ case 1: *pCodeRateHp = DVBT_CODE_RATE_2_OVER_3; break; ++ case 2: *pCodeRateHp = DVBT_CODE_RATE_3_OVER_4; break; ++ case 3: *pCodeRateHp = DVBT_CODE_RATE_5_OVER_6; break; ++ case 4: *pCodeRateHp = DVBT_CODE_RATE_7_OVER_8; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_GUARD_INTERVAL ++ ++*/ ++int ++rtl2832_GetGuardInterval( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pGuardInterval ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS guard interval infromation from GI_IDX. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_GI_IDX, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pGuardInterval = DVBT_GUARD_INTERVAL_1_OVER_32; break; ++ case 1: *pGuardInterval = DVBT_GUARD_INTERVAL_1_OVER_16; break; ++ case 2: *pGuardInterval = DVBT_GUARD_INTERVAL_1_OVER_8; break; ++ case 3: *pGuardInterval = DVBT_GUARD_INTERVAL_1_OVER_4; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_FFT_MODE ++ ++*/ ++int ++rtl2832_GetFftMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pFftMode ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ // Get TPS FFT mode infromation from FFT_MODE_IDX. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FFT_MODE_IDX, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(ReadingValue) ++ { ++ default: ++ case 0: *pFftMode = DVBT_FFT_MODE_2K; break; ++ case 1: *pFftMode = DVBT_FFT_MODE_8K; break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2832_UpdateFunction( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Execute Function 1 according to Function 1 enabling status ++ if(pExtra->IsFunc1Enabled == YES) ++ { ++ if(rtl2832_func1_Update(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_RESET_FUNCTION ++ ++*/ ++int ++rtl2832_ResetFunction( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Reset Function 1 settings according to Function 1 enabling status. ++ if(pExtra->IsFunc1Enabled == YES) ++ { ++ if(rtl2832_func1_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD ++ ++*/ ++int ++rtl2832_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Send I2C reading command. ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_reading_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_reading_command: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD ++ ++*/ ++int ++rtl2832_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Send I2C writing command. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, pWritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_writing_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_writing_command: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Initialize RTL2832 register table. ++ ++Use rtl2832_InitRegTable() to initialize RTL2832 register table. ++ ++ ++@param [in] pDemod RTL2832 demod module pointer ++ ++ ++@note ++ -# The rtl2832_InitRegTable() function will be called by BuildRtl2832Module(). ++ ++*/ ++void ++rtl2832_InitRegTable( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ static const DVBT_PRIMARY_REG_ENTRY PrimaryRegTable[RTL2832_REG_TABLE_LEN] = ++ { ++ // Software reset register ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_SOFT_RST, 0x1, 0x1, 2, 2}, ++ ++ // Tuner I2C forwording register ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_IIC_REPEAT, 0x1, 0x1, 3, 3}, ++ ++ // Registers for initialization ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_TR_WAIT_MIN_8K, 0x1, 0x88, 11, 2}, ++ {DVBT_RSD_BER_FAIL_VAL, 0x1, 0x8f, 15, 0}, ++ {DVBT_EN_BK_TRK, 0x1, 0xa6, 7, 7}, ++ {DVBT_AD_EN_REG, 0x0, 0x8, 7, 7}, ++ {DVBT_AD_EN_REG1, 0x0, 0x8, 6, 6}, ++ {DVBT_EN_BBIN, 0x1, 0xb1, 0, 0}, ++ {DVBT_MGD_THD0, 0x1, 0x95, 7, 0}, ++ {DVBT_MGD_THD1, 0x1, 0x96, 7, 0}, ++ {DVBT_MGD_THD2, 0x1, 0x97, 7, 0}, ++ {DVBT_MGD_THD3, 0x1, 0x98, 7, 0}, ++ {DVBT_MGD_THD4, 0x1, 0x99, 7, 0}, ++ {DVBT_MGD_THD5, 0x1, 0x9a, 7, 0}, ++ {DVBT_MGD_THD6, 0x1, 0x9b, 7, 0}, ++ {DVBT_MGD_THD7, 0x1, 0x9c, 7, 0}, ++ {DVBT_EN_CACQ_NOTCH, 0x1, 0x61, 4, 4}, ++ {DVBT_AD_AV_REF, 0x0, 0x9, 6, 0}, ++ {DVBT_REG_PI, 0x0, 0xa, 2, 0}, ++ {DVBT_PIP_ON, 0x0, 0x21, 3, 3}, ++ {DVBT_SCALE1_B92, 0x2, 0x92, 7, 0}, ++ {DVBT_SCALE1_B93, 0x2, 0x93, 7, 0}, ++ {DVBT_SCALE1_BA7, 0x2, 0xa7, 7, 0}, ++ {DVBT_SCALE1_BA9, 0x2, 0xa9, 7, 0}, ++ {DVBT_SCALE1_BAA, 0x2, 0xaa, 7, 0}, ++ {DVBT_SCALE1_BAB, 0x2, 0xab, 7, 0}, ++ {DVBT_SCALE1_BAC, 0x2, 0xac, 7, 0}, ++ {DVBT_SCALE1_BB0, 0x2, 0xb0, 7, 0}, ++ {DVBT_SCALE1_BB1, 0x2, 0xb1, 7, 0}, ++ {DVBT_KB_P1, 0x1, 0x64, 3, 1}, ++ {DVBT_KB_P2, 0x1, 0x64, 6, 4}, ++ {DVBT_KB_P3, 0x1, 0x65, 2, 0}, ++ {DVBT_OPT_ADC_IQ, 0x0, 0x6, 5, 4}, ++ {DVBT_AD_AVI, 0x0, 0x9, 1, 0}, ++ {DVBT_AD_AVQ, 0x0, 0x9, 3, 2}, ++ {DVBT_K1_CR_STEP12, 0x2, 0xad, 9, 4}, ++ ++ // Registers for initialization according to mode ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_TRK_KS_P2, 0x1, 0x6f, 2, 0}, ++ {DVBT_TRK_KS_I2, 0x1, 0x70, 5, 3}, ++ {DVBT_TR_THD_SET2, 0x1, 0x72, 3, 0}, ++ {DVBT_TRK_KC_P2, 0x1, 0x73, 5, 3}, ++ {DVBT_TRK_KC_I2, 0x1, 0x75, 2, 0}, ++ {DVBT_CR_THD_SET2, 0x1, 0x76, 7, 6}, ++ ++ // Registers for IF setting ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_PSET_IFFREQ, 0x1, 0x19, 21, 0}, ++ {DVBT_SPEC_INV, 0x1, 0x15, 0, 0}, ++ ++ // Registers for bandwidth programming ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_RSAMP_RATIO, 0x1, 0x9f, 27, 2}, ++ {DVBT_CFREQ_OFF_RATIO, 0x1, 0x9d, 23, 4}, ++ ++ // FSM stage register ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_FSM_STAGE, 0x3, 0x51, 6, 3}, ++ ++ // TPS content registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_RX_CONSTEL, 0x3, 0x3c, 3, 2}, ++ {DVBT_RX_HIER, 0x3, 0x3c, 6, 4}, ++ {DVBT_RX_C_RATE_LP, 0x3, 0x3d, 2, 0}, ++ {DVBT_RX_C_RATE_HP, 0x3, 0x3d, 5, 3}, ++ {DVBT_GI_IDX, 0x3, 0x51, 1, 0}, ++ {DVBT_FFT_MODE_IDX, 0x3, 0x51, 2, 2}, ++ ++ // Performance measurement registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_RSD_BER_EST, 0x3, 0x4e, 15, 0}, ++ {DVBT_CE_EST_EVM, 0x4, 0xc, 15, 0}, ++ ++ // AGC registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_RF_AGC_VAL, 0x3, 0x5b, 13, 0}, ++ {DVBT_IF_AGC_VAL, 0x3, 0x59, 13, 0}, ++ {DVBT_DAGC_VAL, 0x3, 0x5, 7, 0}, ++ ++ // TR offset and CR offset registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_SFREQ_OFF, 0x3, 0x18, 13, 0}, ++ {DVBT_CFREQ_OFF, 0x3, 0x5f, 17, 0}, ++ ++ // AGC relative registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_POLAR_RF_AGC, 0x0, 0xe, 1, 1}, ++ {DVBT_POLAR_IF_AGC, 0x0, 0xe, 0, 0}, ++ {DVBT_AAGC_HOLD, 0x1, 0x4, 5, 5}, ++ {DVBT_EN_RF_AGC, 0x1, 0x4, 6, 6}, ++ {DVBT_EN_IF_AGC, 0x1, 0x4, 7, 7}, ++ {DVBT_IF_AGC_MIN, 0x1, 0x8, 7, 0}, ++ {DVBT_IF_AGC_MAX, 0x1, 0x9, 7, 0}, ++ {DVBT_RF_AGC_MIN, 0x1, 0xa, 7, 0}, ++ {DVBT_RF_AGC_MAX, 0x1, 0xb, 7, 0}, ++ {DVBT_IF_AGC_MAN, 0x1, 0xc, 6, 6}, ++ {DVBT_IF_AGC_MAN_VAL, 0x1, 0xc, 13, 0}, ++ {DVBT_RF_AGC_MAN, 0x1, 0xe, 6, 6}, ++ {DVBT_RF_AGC_MAN_VAL, 0x1, 0xe, 13, 0}, ++ {DVBT_DAGC_TRG_VAL, 0x1, 0x12, 7, 0}, ++ {DVBT_AGC_TARG_VAL_0, 0x1, 0x2, 0, 0}, ++ {DVBT_AGC_TARG_VAL_8_1, 0x1, 0x3, 7, 0}, ++ {DVBT_AAGC_LOOP_GAIN, 0x1, 0xc7, 5, 1}, ++ {DVBT_LOOP_GAIN2_3_0, 0x1, 0x4, 4, 1}, ++ {DVBT_LOOP_GAIN2_4, 0x1, 0x5, 7, 7}, ++ {DVBT_LOOP_GAIN3, 0x1, 0xc8, 4, 0}, ++ {DVBT_VTOP1, 0x1, 0x6, 5, 0}, ++ {DVBT_VTOP2, 0x1, 0xc9, 5, 0}, ++ {DVBT_VTOP3, 0x1, 0xca, 5, 0}, ++ {DVBT_KRF1, 0x1, 0xcb, 7, 0}, ++ {DVBT_KRF2, 0x1, 0x7, 7, 0}, ++ {DVBT_KRF3, 0x1, 0xcd, 7, 0}, ++ {DVBT_KRF4, 0x1, 0xce, 7, 0}, ++ {DVBT_EN_GI_PGA, 0x1, 0xe5, 0, 0}, ++ {DVBT_THD_LOCK_UP, 0x1, 0xd9, 8, 0}, ++ {DVBT_THD_LOCK_DW, 0x1, 0xdb, 8, 0}, ++ {DVBT_THD_UP1, 0x1, 0xdd, 7, 0}, ++ {DVBT_THD_DW1, 0x1, 0xde, 7, 0}, ++ {DVBT_INTER_CNT_LEN, 0x1, 0xd8, 3, 0}, ++ {DVBT_GI_PGA_STATE, 0x1, 0xe6, 3, 3}, ++ {DVBT_EN_AGC_PGA, 0x1, 0xd7, 0, 0}, ++ ++ // TS interface registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_CKOUTPAR, 0x1, 0x7b, 5, 5}, ++ {DVBT_CKOUT_PWR, 0x1, 0x7b, 6, 6}, ++ {DVBT_SYNC_DUR, 0x1, 0x7b, 7, 7}, ++ {DVBT_ERR_DUR, 0x1, 0x7c, 0, 0}, ++ {DVBT_SYNC_LVL, 0x1, 0x7c, 1, 1}, ++ {DVBT_ERR_LVL, 0x1, 0x7c, 2, 2}, ++ {DVBT_VAL_LVL, 0x1, 0x7c, 3, 3}, ++ {DVBT_SERIAL, 0x1, 0x7c, 4, 4}, ++ {DVBT_SER_LSB, 0x1, 0x7c, 5, 5}, ++ {DVBT_CDIV_PH0, 0x1, 0x7d, 3, 0}, ++ {DVBT_CDIV_PH1, 0x1, 0x7d, 7, 4}, ++ {DVBT_MPEG_IO_OPT_2_2, 0x0, 0x6, 7, 7}, ++ {DVBT_MPEG_IO_OPT_1_0, 0x0, 0x7, 7, 6}, ++ {DVBT_CKOUTPAR_PIP, 0x0, 0xb7, 4, 4}, ++ {DVBT_CKOUT_PWR_PIP, 0x0, 0xb7, 3, 3}, ++ {DVBT_SYNC_LVL_PIP, 0x0, 0xb7, 2, 2}, ++ {DVBT_ERR_LVL_PIP, 0x0, 0xb7, 1, 1}, ++ {DVBT_VAL_LVL_PIP, 0x0, 0xb7, 0, 0}, ++ {DVBT_CKOUTPAR_PID, 0x0, 0xb9, 4, 4}, ++ {DVBT_CKOUT_PWR_PID, 0x0, 0xb9, 3, 3}, ++ {DVBT_SYNC_LVL_PID, 0x0, 0xb9, 2, 2}, ++ {DVBT_ERR_LVL_PID, 0x0, 0xb9, 1, 1}, ++ {DVBT_VAL_LVL_PID, 0x0, 0xb9, 0, 0}, ++ ++ // FSM state-holding register ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_SM_PASS, 0x1, 0x93, 11, 0}, ++ ++ // AD7 registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_AD7_SETTING, 0x0, 0x11, 15, 0}, ++ {DVBT_RSSI_R, 0x3, 0x1, 6, 0}, ++ ++ // ACI detection registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_ACI_DET_IND, 0x3, 0x12, 0, 0}, ++ ++ // Clock output registers ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DVBT_REG_MON, 0x0, 0xd, 1, 0}, ++ {DVBT_REG_MONSEL, 0x0, 0xd, 2, 2}, ++ {DVBT_REG_GPE, 0x0, 0xd, 7, 7}, ++ {DVBT_REG_GPO, 0x0, 0x10, 0, 0}, ++ {DVBT_REG_4MSEL, 0x0, 0x13, 0, 0}, ++ }; ++ ++ ++ int i; ++ int RegBitName; ++ ++ ++ ++ // Initialize register table according to primary register table. ++ // Note: 1. Register table rows are sorted by register bit name key. ++ // 2. The default value of the IsAvailable variable is "NO". ++ for(i = 0; i < DVBT_REG_TABLE_LEN_MAX; i++) ++ pDemod->RegTable[i].IsAvailable = NO; ++ ++ for(i = 0; i < RTL2832_REG_TABLE_LEN; i++) ++ { ++ RegBitName = PrimaryRegTable[i].RegBitName; ++ ++ pDemod->RegTable[RegBitName].IsAvailable = YES; ++ pDemod->RegTable[RegBitName].PageNo = PrimaryRegTable[i].PageNo; ++ pDemod->RegTable[RegBitName].RegStartAddr = PrimaryRegTable[i].RegStartAddr; ++ pDemod->RegTable[RegBitName].Msb = PrimaryRegTable[i].Msb; ++ pDemod->RegTable[RegBitName].Lsb = PrimaryRegTable[i].Lsb; ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set I2C bridge module demod arguments. ++ ++RTL2832 builder will use rtl2832_BuildI2cBridgeModule() to set I2C bridge module demod arguments. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@see BuildRtl2832Module() ++ ++*/ ++void ++rtl2832_BuildI2cBridgeModule( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ ++ // Get I2C bridge module. ++ pI2cBridge = pDemod->pI2cBridge; ++ ++ // Set I2C bridge module demod arguments. ++ pI2cBridge->pPrivateData = (void *)pDemod; ++ pI2cBridge->ForwardI2cReadingCmd = rtl2832_ForwardI2cReadingCmd; ++ pI2cBridge->ForwardI2cWritingCmd = rtl2832_ForwardI2cWritingCmd; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/* ++ ++@see RTL2832_FP_GET_APP_MODE ++ ++*/ ++void ++rtl2832_GetAppMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAppMode ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Get demod type from demod module. ++ *pAppMode = pExtra->AppMode; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Reset Function 1 variables and registers. ++ ++One can use rtl2832_func1_Reset() to reset Function 1 variables and registers. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset Function 1 variables and registers successfully. ++@retval FUNCTION_ERROR Reset Function 1 variables and registers unsuccessfully. ++ ++ ++@note ++ -# Need to execute Function 1 reset function when change tuner RF frequency or demod parameters. ++ -# Function 1 update flow also employs Function 1 reset function. ++ ++*/ ++int ++rtl2832_func1_Reset( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ // Reset demod Function 1 variables. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_NORMAL; ++ pExtra->Func1WaitTime = 0; ++ pExtra->Func1GettingTime = 0; ++ pExtra->Func1RsdBerEstSumNormal = 0; ++ pExtra->Func1RsdBerEstSumConfig1 = 0; ++ pExtra->Func1RsdBerEstSumConfig2 = 0; ++ pExtra->Func1RsdBerEstSumConfig3 = 0; ++ ++ ++ // Reset demod Function 1 registers. ++ if(rtl2832_func1_ResetReg(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update demod registers with Function 1. ++ ++One can use rtl2832_func1_Update() to update demod registers with Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod registers with Function 1 successfully. ++@retval FUNCTION_ERROR Update demod registers with Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_Update( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ int Answer; ++ int MinWeightedBerConfigMode; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Run FSM. ++ switch(pExtra->Func1State) ++ { ++ case RTL2832_FUNC1_STATE_NORMAL: ++ ++ // Ask if criterion is matched. ++ if(rtl2832_func1_IsCriterionMatched(pDemod, &Answer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(Answer == YES) ++ { ++ // Accumulate RSD_BER_EST for normal case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumNormal) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset getting time counter. ++ pExtra->Func1GettingTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_NORMAL_GET_BER state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_NORMAL_GET_BER; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_NORMAL_GET_BER: ++ ++ // Accumulate RSD_BER_EST for normal case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumNormal) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Use getting time counter to hold RTL2832_FUNC1_STATE_NORMAL_GET_BER state several times. ++ pExtra->Func1GettingTime += 1; ++ ++ if(pExtra->Func1GettingTime >= pExtra->Func1GettingTimeMax) ++ { ++ // Set common registers for configuration 1, 2, and 3 case. ++ if(rtl2832_func1_SetCommonReg(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set registers with FFT mode for configuration 1, 2, and 3 case. ++ if(rtl2832_func1_SetRegWithFftMode(pDemod, pExtra->Func1FftBak) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set registers for configuration 1 case. ++ if(rtl2832_func1_SetRegWithConfigMode(pDemod, RTL2832_FUNC1_CONFIG_1) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset wait time counter. ++ pExtra->Func1WaitTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_1_WAIT state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_1_WAIT; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_1_WAIT: ++ ++ // Use wait time counter to hold RTL2832_FUNC1_STATE_CONFIG_1_WAIT state several times. ++ pExtra->Func1WaitTime += 1; ++ ++ if(pExtra->Func1WaitTime >= pExtra->Func1WaitTimeMax) ++ { ++ // Accumulate RSD_BER_EST for configuration 1 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig1) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset getting time counter. ++ pExtra->Func1GettingTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_1_GET_BER state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_1_GET_BER; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_1_GET_BER: ++ ++ // Accumulate RSD_BER_EST for configuration 1 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig1) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Use getting time counter to hold RTL2832_FUNC1_STATE_CONFIG_1_GET_BER state several times. ++ pExtra->Func1GettingTime += 1; ++ ++ if(pExtra->Func1GettingTime >= pExtra->Func1GettingTimeMax) ++ { ++ // Set registers for configuration 2 case. ++ if(rtl2832_func1_SetRegWithConfigMode(pDemod, RTL2832_FUNC1_CONFIG_2) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset wait time counter. ++ pExtra->Func1WaitTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_2_WAIT state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_2_WAIT; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_2_WAIT: ++ ++ // Use wait time counter to hold RTL2832_FUNC1_STATE_CONFIG_2_WAIT state several times. ++ pExtra->Func1WaitTime += 1; ++ ++ if(pExtra->Func1WaitTime >= pExtra->Func1WaitTimeMax) ++ { ++ // Accumulate RSD_BER_EST for configuration 2 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig2) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset getting time counter. ++ pExtra->Func1GettingTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_2_GET_BER state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_2_GET_BER; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_2_GET_BER: ++ ++ // Accumulate RSD_BER_EST for configuration 2 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig2) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Use getting time counter to hold RTL2832_FUNC1_STATE_CONFIG_2_GET_BER state several times. ++ pExtra->Func1GettingTime += 1; ++ ++ if(pExtra->Func1GettingTime >= pExtra->Func1GettingTimeMax) ++ { ++ // Set registers for configuration 3 case. ++ if(rtl2832_func1_SetRegWithConfigMode(pDemod, RTL2832_FUNC1_CONFIG_3) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset wait time counter. ++ pExtra->Func1WaitTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_3_WAIT state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_3_WAIT; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_3_WAIT: ++ ++ // Use wait time counter to hold RTL2832_FUNC1_STATE_CONFIG_3_WAIT state several times. ++ pExtra->Func1WaitTime += 1; ++ ++ if(pExtra->Func1WaitTime >= pExtra->Func1WaitTimeMax) ++ { ++ // Accumulate RSD_BER_EST for configuration 3 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig3) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset getting time counter. ++ pExtra->Func1GettingTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_CONFIG_3_GET_BER state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_CONFIG_3_GET_BER; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_CONFIG_3_GET_BER: ++ ++ // Accumulate RSD_BER_EST for configuration 3 case. ++ if(rtl2832_func1_AccumulateRsdBerEst(pDemod, &pExtra->Func1RsdBerEstSumConfig3) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Use getting time counter to hold RTL2832_FUNC1_STATE_CONFIG_3_GET_BER state several times. ++ pExtra->Func1GettingTime += 1; ++ ++ if(pExtra->Func1GettingTime >= pExtra->Func1GettingTimeMax) ++ { ++ // Determine minimum-weighted-BER configuration mode. ++ rtl2832_func1_GetMinWeightedBerConfigMode(pDemod, &MinWeightedBerConfigMode); ++ ++ // Set registers with minimum-weighted-BER configuration mode. ++ switch(MinWeightedBerConfigMode) ++ { ++ case RTL2832_FUNC1_CONFIG_NORMAL: ++ ++ // Reset registers for normal configuration. ++ if(rtl2832_func1_ResetReg(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_CONFIG_1: ++ case RTL2832_FUNC1_CONFIG_2: ++ case RTL2832_FUNC1_CONFIG_3: ++ ++ // Set registers for minimum-weighted-BER configuration. ++ if(rtl2832_func1_SetRegWithConfigMode(pDemod, MinWeightedBerConfigMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ ++ ++ default: ++ ++ // Get error configuration mode, reset registers. ++ if(rtl2832_func1_ResetReg(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset wait time counter. ++ pExtra->Func1WaitTime = 0; ++ ++ // Go to RTL2832_FUNC1_STATE_DETERMINED_WAIT state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_DETERMINED_WAIT; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_DETERMINED_WAIT: ++ ++ // Use wait time counter to hold RTL2832_FUNC1_STATE_CONFIG_3_WAIT state several times. ++ pExtra->Func1WaitTime += 1; ++ ++ if(pExtra->Func1WaitTime >= pExtra->Func1WaitTimeMax) ++ { ++ // Go to RTL2832_FUNC1_STATE_DETERMINED state. ++ pExtra->Func1State = RTL2832_FUNC1_STATE_DETERMINED; ++ } ++ ++ break; ++ ++ ++ case RTL2832_FUNC1_STATE_DETERMINED: ++ ++ // Ask if criterion is matched. ++ if(rtl2832_func1_IsCriterionMatched(pDemod, &Answer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(Answer == NO) ++ { ++ // Reset FSM. ++ // Note: rtl2832_func1_Reset() will set FSM state with RTL2832_FUNC1_STATE_NORMAL. ++ if(rtl2832_func1_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ break; ++ ++ ++ default: ++ ++ // Get error state, reset FSM. ++ // Note: rtl2832_func1_Reset() will set FSM state with RTL2832_FUNC1_STATE_NORMAL. ++ if(rtl2832_func1_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Ask if criterion is matched for Function 1. ++ ++One can use rtl2832_func1_IsCriterionMatched() to ask if criterion is matched for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Ask if criterion is matched for Function 1 successfully. ++@retval FUNCTION_ERROR Ask if criterion is matched for Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_IsCriterionMatched( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ unsigned long FsmStage; ++ ++ int Qam; ++ int Hier; ++ int LpCr; ++ int HpCr; ++ int Gi; ++ int Fft; ++ ++ unsigned long Reg0, Reg1; ++ ++ int BandwidthMode; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Get FSM_STAGE. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Get QAM. ++ if(pDemod->GetConstellation(pDemod, &Qam) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get hierarchy. ++ if(pDemod->GetHierarchy(pDemod, &Hier) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get low-priority code rate. ++ if(pDemod->GetCodeRateLp(pDemod, &LpCr) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get high-priority code rate. ++ if(pDemod->GetCodeRateHp(pDemod, &HpCr) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get guard interval. ++ if(pDemod->GetGuardInterval(pDemod, &Gi) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get FFT mode. ++ if(pDemod->GetFftMode(pDemod, &Fft) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Get REG_0 and REG_1. ++ if(pDemod->SetRegPage(pDemod, 0x3) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->GetRegMaskBits(pDemod, 0x22, 0, 0, &Reg0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->GetRegMaskBits(pDemod, 0x1a, 15, 3, &Reg1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Get bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, &BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Determine criterion answer. ++ *pAnswer = ++ (FsmStage == 11) && ++ ++ (Qam == pExtra->Func1QamBak) && ++ (Hier == pExtra->Func1HierBak) && ++ (LpCr == pExtra->Func1LpCrBak) && ++ (HpCr == pExtra->Func1HpCrBak) && ++ (Gi == pExtra->Func1GiBak) && ++ (Fft == pExtra->Func1FftBak) && ++ ++ (Reg0 == 0x1) && ++ ++ ((BandwidthMode == DVBT_BANDWIDTH_8MHZ) && ++ ( ((Fft == DVBT_FFT_MODE_2K) && (Reg1 > 1424) && (Reg1 < 1440)) || ++ ((Fft == DVBT_FFT_MODE_8K) && (Reg1 > 5696) && (Reg1 < 5760)) ) ); ++ ++ ++ // Backup TPS information. ++ pExtra->Func1QamBak = Qam; ++ pExtra->Func1HierBak = Hier; ++ pExtra->Func1LpCrBak = LpCr; ++ pExtra->Func1HpCrBak = HpCr; ++ pExtra->Func1GiBak = Gi; ++ pExtra->Func1FftBak = Fft; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Accumulate RSD_BER_EST value for Function 1. ++ ++One can use rtl2832_func1_AccumulateRsdBerEst() to accumulate RSD_BER_EST for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] pAccumulativeValue Accumulative RSD_BER_EST value ++ ++ ++@retval FUNCTION_SUCCESS Accumulate RSD_BER_EST for Function 1 successfully. ++@retval FUNCTION_ERROR Accumulate RSD_BER_EST for Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_AccumulateRsdBerEst( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pAccumulativeValue ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ int i; ++ unsigned long RsdBerEst; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Get RSD_BER_EST with assigned times. ++ for(i = 0; i < pExtra->Func1GettingNumEachTime; i++) ++ { ++ // Get RSD_BER_EST. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSD_BER_EST, &RsdBerEst) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Accumulate RSD_BER_EST to accumulative value. ++ *pAccumulativeValue += RsdBerEst; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Reset registers for Function 1. ++ ++One can use rtl2832_func1_ResetReg() to reset registers for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset registers for Function 1 successfully. ++@retval FUNCTION_ERROR Reset registers for Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_ResetReg( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Reset Function 1 registers. ++ if(pDemod->SetRegPage(pDemod, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x65, 2, 0, 0x7) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x68, 5, 4, 0x3) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5b, 2, 0, 0x5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5b, 5, 3, 0x5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5c, 2, 0, 0x5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5c, 5, 3, 0x5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd0, 3, 2, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd1, 14, 0, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd3, 14, 0, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd5, 14, 0, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x1, 0, 0, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xb4, 7, 6, 0x3) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd2, 1, 1, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xb5, 7, 7, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set common registers for Function 1. ++ ++One can use rtl2832_func1_SetCommonReg() to set common registers for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Set common registers for Function 1 successfully. ++@retval FUNCTION_ERROR Set common registers for Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_SetCommonReg( ++ DVBT_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Set common registers for Function 1. ++ if(pDemod->SetRegPage(pDemod, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x65, 2, 0, 0x5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x68, 5, 4, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd2, 1, 1, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xb5, 7, 7, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set registers with FFT mode for Function 1. ++ ++One can use rtl2832_func1_SetRegWithConfigMode() to set registers with FFT mode for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] FftMode FFT mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set registers with FFT mode for Function 1 successfully. ++@retval FUNCTION_ERROR Set registers with FFT mode for Function 1 unsuccessfully. ++ ++*/ ++int ++rtl2832_func1_SetRegWithFftMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int FftMode ++ ) ++{ ++ typedef struct ++ { ++ unsigned long Reg0[DVBT_FFT_MODE_NUM]; ++ unsigned long Reg1[DVBT_FFT_MODE_NUM]; ++ } ++ FFT_REF_ENTRY; ++ ++ ++ ++ static const FFT_REF_ENTRY FftRefTable = ++ { ++ // 2K mode, 8K mode ++ {0x0, 0x1 }, ++ {0x3, 0x0 }, ++ }; ++ ++ ++ ++ // Set registers with FFT mode for Function 1. ++ if(pDemod->SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x1, 0, 0, FftRefTable.Reg0[FftMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xb4, 7, 6, FftRefTable.Reg1[FftMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set registers with configuration mode for Function 1. ++ ++One can use rtl2832_func1_SetRegWithConfigMode() to set registers with configuration mode for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] ConfigMode Configuration mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set registers with configuration mode for Function 1 successfully. ++@retval FUNCTION_ERROR Set registers with configuration mode for Function 1 unsuccessfully. ++ ++ ++@note ++ -# This function can not set RTL2832_FUNC1_CONFIG_NORMAL configuration mode. ++ ++*/ ++int ++rtl2832_func1_SetRegWithConfigMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int ConfigMode ++ ) ++{ ++ typedef struct ++ { ++ unsigned long Reg0[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg1[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg2[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg3[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg4[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ ++ unsigned long Reg5Ref[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg6Ref[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ unsigned long Reg7Ref[RTL2832_FUNC1_CONFIG_MODE_NUM]; ++ } ++ CONFIG_REF_ENTRY; ++ ++ ++ ++ static const CONFIG_REF_ENTRY ConfigRefTable = ++ { ++ // Config 1, Config 2, Config 3 ++ {0x5, 0x4, 0x5 }, ++ {0x5, 0x4, 0x7 }, ++ {0x5, 0x4, 0x7 }, ++ {0x7, 0x6, 0x5 }, ++ {0x3, 0x3, 0x2 }, ++ ++ {4437, 4437, 4325 }, ++ {6000, 5500, 6500 }, ++ {6552, 5800, 5850 }, ++ }; ++ ++ int BandwidthMode; ++ ++ static const unsigned long Const[DVBT_BANDWIDTH_MODE_NUM] = ++ { ++ // 6Mhz, 7Mhz, 8Mhz ++ 48, 56, 64, ++ }; ++ ++ unsigned long Reg5, Reg6, Reg7; ++ ++ ++ ++ // Get bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, &BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Calculate REG_5, REG_6, and REG_7 with bandwidth mode and configuration mode. ++ Reg5 = (ConfigRefTable.Reg5Ref[ConfigMode] * 7 * 2048 * 8) / (1000 * Const[BandwidthMode]); ++ Reg6 = (ConfigRefTable.Reg6Ref[ConfigMode] * 7 * 2048 * 8) / (1000 * Const[BandwidthMode]); ++ Reg7 = (ConfigRefTable.Reg7Ref[ConfigMode] * 7 * 2048 * 8) / (1000 * Const[BandwidthMode]); ++ ++ ++ // Set registers with bandwidth mode and configuration mode. ++ if(pDemod->SetRegPage(pDemod, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5b, 2, 0, ConfigRefTable.Reg0[ConfigMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5b, 5, 3, ConfigRefTable.Reg1[ConfigMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5c, 2, 0, ConfigRefTable.Reg2[ConfigMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0x5c, 5, 3, ConfigRefTable.Reg3[ConfigMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd0, 3, 2, ConfigRefTable.Reg4[ConfigMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd1, 14, 0, Reg5) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd3, 14, 0, Reg6) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->SetRegMaskBits(pDemod, 0xd5, 14, 0, Reg7) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get minimum-weighted-BER configuration mode for Function 1. ++ ++One can use rtl2832_func1_GetMinWeightedBerConfigMode() to get minimum-weighted-BER configuration mode for Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pConfigMode Pointer to an allocated memory for storing configuration mode answer ++ ++ ++@retval FUNCTION_SUCCESS Get minimum-weighted-BER configuration mode for Function 1 successfully. ++@retval FUNCTION_ERROR Get minimum-weighted-BER configuration mode for Function 1 unsuccessfully. ++ ++*/ ++void ++rtl2832_func1_GetMinWeightedBerConfigMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pConfigMode ++ ) ++{ ++ RTL2832_EXTRA_MODULE *pExtra; ++ ++ unsigned long WeightedBerNormal; ++ unsigned long WeightedBerConfig1; ++ unsigned long WeightedBerConfig2; ++ unsigned long WeightedBerConfig3; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2832); ++ ++ ++ // Calculate weighted BER for all configuration mode ++ WeightedBerNormal = pExtra->Func1RsdBerEstSumNormal * 2; ++ WeightedBerConfig1 = pExtra->Func1RsdBerEstSumConfig1; ++ WeightedBerConfig2 = pExtra->Func1RsdBerEstSumConfig2; ++ WeightedBerConfig3 = pExtra->Func1RsdBerEstSumConfig3; ++ ++ ++ // Determine minimum-weighted-BER configuration mode. ++ if(WeightedBerNormal <= WeightedBerConfig1 && ++ WeightedBerNormal <= WeightedBerConfig2 && ++ WeightedBerNormal <= WeightedBerConfig3) ++ { ++ *pConfigMode = RTL2832_FUNC1_CONFIG_NORMAL; ++ } ++ else if(WeightedBerConfig1 <= WeightedBerNormal && ++ WeightedBerConfig1 <= WeightedBerConfig2 && ++ WeightedBerConfig1 <= WeightedBerConfig3) ++ { ++ *pConfigMode = RTL2832_FUNC1_CONFIG_1; ++ } ++ else if(WeightedBerConfig2 <= WeightedBerNormal && ++ WeightedBerConfig2 <= WeightedBerConfig1 && ++ WeightedBerConfig2 <= WeightedBerConfig3) ++ { ++ *pConfigMode = RTL2832_FUNC1_CONFIG_2; ++ } ++ else if(WeightedBerConfig3 <= WeightedBerNormal && ++ WeightedBerConfig3 <= WeightedBerConfig1 && ++ WeightedBerConfig3 <= WeightedBerConfig2) ++ { ++ *pConfigMode = RTL2832_FUNC1_CONFIG_3; ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2832.h b/drivers/media/dvb/dvb-usb/demod_rtl2832.h +new file mode 100644 +index 0000000..0c3674a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2832.h +@@ -0,0 +1,466 @@ ++#ifndef __DEMOD_RTL2832_H ++#define __DEMOD_RTL2832_H ++ ++/** ++ ++@file ++ ++@brief RTL2832 demod module declaration ++ ++One can manipulate RTL2832 demod through RTL2832 module. ++RTL2832 module is derived from DVB-T demod module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the DVB-T demod example in dvbt_demod_base.h except the listed lines. ++ ++ ++ ++#include "demod_rtl2832.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ ++ ... ++ ++ ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pDemod, ++ &DvbtDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x20, // I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // Crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // Application mode is STB. ++ 200, // Update function reference period is 200 millisecond ++ YES // Function 1 enabling status is YES. ++ ); ++ ++ ++ ++ // See the example for other DVB-T demod functions in dvbt_demod_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "dvbt_demod_base.h" ++ ++ ++extern int dvb_usb_rtl2832u_snrdb; ++ ++ ++// Definitions ++ ++// Initializing ++#define RTL2832_INIT_TABLE_LEN 32 ++#define RTL2832_TS_INTERFACE_INIT_TABLE_LEN 5 ++#define RTL2832_APP_INIT_TABLE_LEN 5 ++ ++ ++// Bandwidth setting ++#define RTL2832_H_LPF_X_PAGE 1 ++#define RTL2832_H_LPF_X_ADDR 0x1c ++#define RTL2832_H_LPF_X_LEN 32 ++#define RTL2832_RATIO_PAGE 1 ++#define RTL2832_RATIO_ADDR 0x9d ++#define RTL2832_RATIO_LEN 6 ++ ++ ++// Bandwidth setting ++#define RTL2832_CFREQ_OFF_RATIO_BIT_NUM 20 ++ ++ ++// IF frequency setting ++#define RTL2832_PSET_IFFREQ_BIT_NUM 22 ++ ++ ++// Signal quality ++#define RTL2832_SQ_FRAC_BIT_NUM 5 ++ ++ ++// BER ++#define RTL2832_BER_DEN_VALUE 1000000 ++ ++ ++// SNR ++#define RTL2832_CE_EST_EVM_MAX_VALUE 65535 ++#define RTL2832_SNR_FRAC_BIT_NUM 10 ++#define RTL2832_SNR_DB_DEN 3402 ++ ++ ++// AGC ++#define RTL2832_RF_AGC_REG_BIT_NUM 14 ++#define RTL2832_IF_AGC_REG_BIT_NUM 14 ++ ++ ++// TR offset and CR offset ++#define RTL2832_SFREQ_OFF_BIT_NUM 14 ++#define RTL2832_CFREQ_OFF_BIT_NUM 18 ++ ++ ++// Register table length ++#define RTL2832_REG_TABLE_LEN 127 ++ ++ ++// Function 1 ++#define RTL2832_FUNC1_WAIT_TIME_MS 500 ++#define RTL2832_FUNC1_GETTING_TIME_MS 200 ++#define RTL2832_FUNC1_GETTING_NUM_MIN 20 ++ ++ ++ ++/// Demod application modes ++enum RTL2832_APPLICATION_MODE ++{ ++ RTL2832_APPLICATION_DONGLE, ++ RTL2832_APPLICATION_STB, ++}; ++#define RTL2832_APPLICATION_MODE_NUM 2 ++ ++ ++// Function 1 ++enum RTL2832_FUNC1_CONFIG_MODE ++{ ++ RTL2832_FUNC1_CONFIG_1, ++ RTL2832_FUNC1_CONFIG_2, ++ RTL2832_FUNC1_CONFIG_3, ++}; ++#define RTL2832_FUNC1_CONFIG_MODE_NUM 3 ++#define RTL2832_FUNC1_CONFIG_NORMAL -1 ++ ++ ++enum RTL2832_FUNC1_STATE ++{ ++ RTL2832_FUNC1_STATE_NORMAL, ++ RTL2832_FUNC1_STATE_NORMAL_GET_BER, ++ RTL2832_FUNC1_STATE_CONFIG_1_WAIT, ++ RTL2832_FUNC1_STATE_CONFIG_1_GET_BER, ++ RTL2832_FUNC1_STATE_CONFIG_2_WAIT, ++ RTL2832_FUNC1_STATE_CONFIG_2_GET_BER, ++ RTL2832_FUNC1_STATE_CONFIG_3_WAIT, ++ RTL2832_FUNC1_STATE_CONFIG_3_GET_BER, ++ RTL2832_FUNC1_STATE_DETERMINED_WAIT, ++ RTL2832_FUNC1_STATE_DETERMINED, ++}; ++ ++ ++ ++ ++ ++// Demod module builder ++void ++BuildRtl2832Module( ++ DVBT_DEMOD_MODULE **ppDemod, ++ DVBT_DEMOD_MODULE *pDvbtDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ int AppMode, ++ unsigned long UpdateFuncRefPeriodMs, ++ int IsFunc1Enabled ++ ); ++ ++ ++ ++ ++ ++// Manipulating functions ++void ++rtl2832_IsConnectedToI2c( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++); ++ ++int ++rtl2832_SoftwareReset( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_Initialize( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_SetBandwidthMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_SetIfFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++int ++rtl2832_SetSpectrumMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++int ++rtl2832_IsTpsLocked( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2832_IsSignalLocked( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2832_GetSignalStrength( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++rtl2832_GetSignalQuality( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++rtl2832_GetBer( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++int ++rtl2832_GetSnrDb( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++rtl2832_GetRfAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++int ++rtl2832_GetIfAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++int ++rtl2832_GetDiAgc( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDiAgc ++ ); ++ ++int ++rtl2832_GetTrOffsetPpm( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++int ++rtl2832_GetCrOffsetHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++int ++rtl2832_GetConstellation( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pConstellation ++ ); ++ ++int ++rtl2832_GetHierarchy( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pHierarchy ++ ); ++ ++int ++rtl2832_GetCodeRateLp( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateLp ++ ); ++ ++int ++rtl2832_GetCodeRateHp( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateHp ++ ); ++ ++int ++rtl2832_GetGuardInterval( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pGuardInterval ++ ); ++ ++int ++rtl2832_GetFftMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pFftMode ++ ); ++ ++int ++rtl2832_UpdateFunction( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_ResetFunction( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// I2C command forwarding functions ++int ++rtl2832_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++rtl2832_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++// Register table initializing ++void ++rtl2832_InitRegTable( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// I2C birdge module builder ++void ++rtl2832_BuildI2cBridgeModule( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// RTL2832 extra functions ++void ++rtl2832_GetAppMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAppMode ++ ); ++ ++ ++ ++ ++ ++// RTL2832 dependence ++int ++rtl2832_func1_Reset( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_func1_Update( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_func1_IsCriterionMatched( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2832_func1_AccumulateRsdBerEst( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pAccumulativeValue ++ ); ++ ++int ++rtl2832_func1_ResetReg( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_func1_SetCommonReg( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2832_func1_SetRegWithFftMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int FftMode ++ ); ++ ++int ++rtl2832_func1_SetRegWithConfigMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int ConfigMode ++ ); ++ ++void ++rtl2832_func1_GetMinWeightedBerConfigMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pConfigMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2836.c b/drivers/media/dvb/dvb-usb/demod_rtl2836.c +new file mode 100644 +index 0000000..90fae89 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2836.c +@@ -0,0 +1,2049 @@ ++/** ++ ++@file ++ ++@brief RTL2836 demod module definition ++ ++One can manipulate RTL2836 demod through RTL2836 module. ++RTL2836 module is derived from DTMB demod module. ++ ++*/ ++ ++ ++#include "demod_rtl2836.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2836 demod module builder ++ ++Use BuildRtl2836Module() to build RTL2836 module, set all module function pointers with the corresponding ++functions, and initialize module private variables. ++ ++ ++@param [in] ppDemod Pointer to RTL2836 demod module pointer ++@param [in] pDtmbDemodModuleMemory Pointer to an allocated DTMB demod module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr RTL2836 I2C device address ++@param [in] CrystalFreqHz RTL2836 crystal frequency in Hz ++@param [in] TsInterfaceMode RTL2836 TS interface mode for setting ++@param [in] UpdateFuncRefPeriodMs RTL2836 update function reference period in millisecond ++@param [in] IsFunc1Enabled RTL2836 Function 1 enabling status for setting ++@param [in] IsFunc2Enabled RTL2836 Function 2 enabling status for setting ++ ++ ++@note ++ -# One should call BuildRtl2836Module() to build RTL2836 module before using it. ++ ++*/ ++void ++BuildRtl2836Module( ++ DTMB_DEMOD_MODULE **ppDemod, ++ DTMB_DEMOD_MODULE *pDtmbDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ unsigned long UpdateFuncRefPeriodMs, ++ int IsFunc1Enabled, ++ int IsFunc2Enabled ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set demod module pointer, ++ *ppDemod = pDtmbDemodModuleMemory; ++ ++ // Get demod module. ++ pDemod = *ppDemod; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pDemod->pBaseInterface = pBaseInterfaceModuleMemory; ++ pDemod->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ ++ // Set demod type. ++ pDemod->DemodType = DTMB_DEMOD_TYPE_RTL2836; ++ ++ // Set demod I2C device address. ++ pDemod->DeviceAddr = DeviceAddr; ++ ++ // Set demod crystal frequency in Hz. ++ pDemod->CrystalFreqHz = CrystalFreqHz; ++ ++ // Set demod TS interface mode. ++ pDemod->TsInterfaceMode = TsInterfaceMode; ++ ++ ++ // Initialize demod parameter setting status ++ pDemod->IsIfFreqHzSet = NO; ++ pDemod->IsSpectrumModeSet = NO; ++ ++ ++ // Initialize demod register table. ++ rtl2836_InitRegTable(pDemod); ++ ++ ++ // Build I2C birdge module. ++ rtl2836_BuildI2cBridgeModule(pDemod); ++ ++ ++ // Set demod module I2C function pointers with 8-bit address default functions. ++ pDemod->RegAccess.Addr8Bit.SetRegPage = dtmb_demod_addr_8bit_default_SetRegPage; ++ pDemod->RegAccess.Addr8Bit.SetRegBytes = dtmb_demod_addr_8bit_default_SetRegBytes; ++ pDemod->RegAccess.Addr8Bit.GetRegBytes = dtmb_demod_addr_8bit_default_GetRegBytes; ++ pDemod->RegAccess.Addr8Bit.SetRegMaskBits = dtmb_demod_addr_8bit_default_SetRegMaskBits; ++ pDemod->RegAccess.Addr8Bit.GetRegMaskBits = dtmb_demod_addr_8bit_default_GetRegMaskBits; ++ pDemod->RegAccess.Addr8Bit.SetRegBits = dtmb_demod_addr_8bit_default_SetRegBits; ++ pDemod->RegAccess.Addr8Bit.GetRegBits = dtmb_demod_addr_8bit_default_GetRegBits; ++ pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage = dtmb_demod_addr_8bit_default_SetRegBitsWithPage; ++ pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage = dtmb_demod_addr_8bit_default_GetRegBitsWithPage; ++ ++ ++ // Set demod module manipulating function pointers with default functions. ++ pDemod->GetDemodType = dtmb_demod_default_GetDemodType; ++ pDemod->GetDeviceAddr = dtmb_demod_default_GetDeviceAddr; ++ pDemod->GetCrystalFreqHz = dtmb_demod_default_GetCrystalFreqHz; ++ ++ pDemod->GetIfFreqHz = dtmb_demod_default_GetIfFreqHz; ++ pDemod->GetSpectrumMode = dtmb_demod_default_GetSpectrumMode; ++ ++ ++ // Set demod module manipulating function pointers with particular functions. ++ pDemod->IsConnectedToI2c = rtl2836_IsConnectedToI2c; ++ pDemod->SoftwareReset = rtl2836_SoftwareReset; ++ pDemod->Initialize = rtl2836_Initialize; ++ pDemod->SetIfFreqHz = rtl2836_SetIfFreqHz; ++ pDemod->SetSpectrumMode = rtl2836_SetSpectrumMode; ++ ++ pDemod->IsSignalLocked = rtl2836_IsSignalLocked; ++ ++ pDemod->GetSignalStrength = rtl2836_GetSignalStrength; ++ pDemod->GetSignalQuality = rtl2836_GetSignalQuality; ++ ++ pDemod->GetBer = rtl2836_GetBer; ++ pDemod->GetPer = rtl2836_GetPer; ++ pDemod->GetSnrDb = rtl2836_GetSnrDb; ++ ++ pDemod->GetRfAgc = rtl2836_GetRfAgc; ++ pDemod->GetIfAgc = rtl2836_GetIfAgc; ++ pDemod->GetDiAgc = rtl2836_GetDiAgc; ++ ++ pDemod->GetTrOffsetPpm = rtl2836_GetTrOffsetPpm; ++ pDemod->GetCrOffsetHz = rtl2836_GetCrOffsetHz; ++ ++ pDemod->GetCarrierMode = rtl2836_GetCarrierMode; ++ pDemod->GetPnMode = rtl2836_GetPnMode; ++ pDemod->GetQamMode = rtl2836_GetQamMode; ++ pDemod->GetCodeRateMode = rtl2836_GetCodeRateMode; ++ pDemod->GetTimeInterleaverMode = rtl2836_GetTimeInterleaverMode; ++ ++ pDemod->UpdateFunction = rtl2836_UpdateFunction; ++ pDemod->ResetFunction = rtl2836_ResetFunction; ++ ++ ++ // Initialize demod Function 1 variables. ++ pExtra->IsFunc1Enabled = IsFunc1Enabled; ++ pExtra->Func1CntThd = DivideWithCeiling(RTL2836_FUNC1_CHECK_TIME_MS, UpdateFuncRefPeriodMs); ++ pExtra->Func1Cnt = 0; ++ ++ // Initialize demod Function 2 variables. ++ pExtra->IsFunc2Enabled = IsFunc2Enabled; ++ pExtra->Func2SignalModePrevious = RTL2836_FUNC2_SIGNAL_NORMAL; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_IS_CONNECTED_TO_I2C ++ ++*/ ++void ++rtl2836_IsConnectedToI2c( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long ChipId; ++ ++ ++ ++ // Get CHIP_ID. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_CHIP_ID, &ChipId) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Check chip ID value. ++ if(ChipId != RTL2836_CHIP_ID_VALUE) ++ goto error_status_check_value; ++ ++ ++ // Set I2cConnectionStatus with YES. ++ *pAnswer = YES; ++ ++ ++ return; ++ ++ ++error_status_check_value: ++error_status_get_registers: ++ ++ // Set I2cConnectionStatus with NO. ++ *pAnswer = NO; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SOFTWARE_RESET ++ ++*/ ++int ++rtl2836_SoftwareReset( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Set SOFT_RST with 0x0. Then, set SOFT_RST with 0x1. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_SOFT_RST_N, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_SOFT_RST_N, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_INITIALIZE ++ ++*/ ++int ++rtl2836_Initialize( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Initializing table entry only used in Initialize() ++ typedef struct ++ { ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ } ++ INIT_TABLE_ENTRY; ++ ++ // TS interface initializing table entry only used in Initialize() ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long WritingValue[TS_INTERFACE_MODE_NUM]; ++ } ++ TS_INTERFACE_INIT_TABLE_ENTRY; ++ ++ ++ ++ static const INIT_TABLE_ENTRY InitRegTable[RTL2836_INIT_REG_TABLE_LEN] = ++ { ++ // PageNo, RegStartAddr, Msb, Lsb, WritingValue ++ {0x0, 0x1, 0, 0, 0x1 }, ++ {0x0, 0x2, 4, 4, 0x0 }, ++ {0x0, 0x3, 2, 0, 0x0 }, ++ {0x0, 0xe, 5, 5, 0x1 }, ++ {0x0, 0x11, 3, 3, 0x0 }, ++ {0x0, 0x12, 1, 0, 0x1 }, ++ {0x0, 0x16, 2, 0, 0x3 }, ++ {0x0, 0x19, 7, 0, 0x19 }, ++ {0x0, 0x1b, 7, 0, 0xcc }, ++ {0x0, 0x1f, 7, 0, 0x5 }, ++ {0x0, 0x20, 2, 2, 0x1 }, ++ {0x0, 0x20, 3, 3, 0x0 }, ++ {0x1, 0x3, 7, 0, 0x38 }, ++ {0x1, 0x31, 1, 1, 0x0 }, ++ {0x1, 0x67, 7, 0, 0x30 }, ++ {0x1, 0x68, 7, 0, 0x10 }, ++ {0x1, 0x7f, 3, 2, 0x1 }, ++ {0x1, 0xda, 7, 7, 0x1 }, ++ {0x1, 0xdb, 7, 0, 0x5 }, ++ {0x2, 0x9, 7, 0, 0xa }, ++ {0x2, 0x10, 7, 0, 0x31 }, ++ {0x2, 0x11, 7, 0, 0x31 }, ++ {0x2, 0x1b, 7, 0, 0x1e }, ++ {0x2, 0x1e, 7, 0, 0x3a }, ++ {0x2, 0x1f, 5, 3, 0x3 }, ++ {0x2, 0x21, 7, 0, 0x3f }, ++ {0x2, 0x24, 6, 5, 0x0 }, ++ {0x2, 0x27, 7, 0, 0x17 }, ++ {0x2, 0x31, 7, 0, 0x35 }, ++ {0x2, 0x32, 7, 0, 0x3f }, ++ {0x2, 0x4f, 3, 2, 0x2 }, ++ {0x2, 0x5a, 7, 0, 0x5 }, ++ {0x2, 0x5b, 7, 0, 0x8 }, ++ {0x2, 0x5c, 7, 0, 0x8 }, ++ {0x2, 0x5e, 7, 5, 0x5 }, ++ {0x2, 0x70, 0, 0, 0x0 }, ++ {0x2, 0x77, 0, 0, 0x1 }, ++ {0x2, 0x7a, 7, 0, 0x2f }, ++ {0x2, 0x81, 3, 2, 0x2 }, ++ {0x2, 0x8d, 7, 0, 0x77 }, ++ {0x2, 0x8e, 7, 4, 0x8 }, ++ {0x2, 0x93, 7, 0, 0xff }, ++ {0x2, 0x94, 7, 0, 0x3 }, ++ {0x2, 0x9d, 7, 0, 0xff }, ++ {0x2, 0x9e, 7, 0, 0x3 }, ++ {0x2, 0xa8, 7, 0, 0xff }, ++ {0x2, 0xa9, 7, 0, 0x3 }, ++ {0x2, 0xa3, 2, 2, 0x1 }, ++ {0x3, 0x1, 7, 0, 0x0 }, ++ {0x3, 0x4, 7, 0, 0x20 }, ++ {0x3, 0x9, 7, 0, 0x10 }, ++ {0x3, 0x14, 7, 0, 0xe4 }, ++ {0x3, 0x15, 7, 0, 0x62 }, ++ {0x3, 0x16, 7, 0, 0x8c }, ++ {0x3, 0x17, 7, 0, 0x11 }, ++ {0x3, 0x1b, 7, 0, 0x40 }, ++ {0x3, 0x1c, 7, 0, 0x14 }, ++ {0x3, 0x23, 7, 0, 0x40 }, ++ {0x3, 0x24, 7, 0, 0xd6 }, ++ {0x3, 0x2b, 7, 0, 0x60 }, ++ {0x3, 0x2c, 7, 0, 0x16 }, ++ {0x3, 0x33, 7, 0, 0x40 }, ++ {0x3, 0x3b, 7, 0, 0x44 }, ++ {0x3, 0x43, 7, 0, 0x41 }, ++ {0x3, 0x4b, 7, 0, 0x40 }, ++ {0x3, 0x53, 7, 0, 0x4a }, ++ {0x3, 0x58, 7, 0, 0x1c }, ++ {0x3, 0x5b, 7, 0, 0x5a }, ++ {0x3, 0x5f, 7, 0, 0xe0 }, ++ {0x4, 0x2, 7, 0, 0x7 }, ++ {0x4, 0x3, 5, 0, 0x9 }, ++ {0x4, 0x4, 5, 0, 0xb }, ++ {0x4, 0x5, 5, 0, 0xd }, ++ {0x4, 0x7, 2, 1, 0x3 }, ++ {0x4, 0x7, 4, 3, 0x3 }, ++ {0x4, 0xe, 4, 0, 0x18 }, ++ {0x4, 0x10, 4, 0, 0x1c }, ++ {0x4, 0x12, 4, 0, 0x1c }, ++ {0x4, 0x2f, 7, 0, 0x0 }, ++ {0x4, 0x30, 7, 0, 0x20 }, ++ {0x4, 0x31, 7, 0, 0x40 }, ++ {0x4, 0x3e, 0, 0, 0x0 }, ++ {0x4, 0x3e, 1, 1, 0x1 }, ++ {0x4, 0x3e, 5, 2, 0x0 }, ++ {0x4, 0x3f, 5, 0, 0x10 }, ++ {0x4, 0x4a, 0, 0, 0x1 }, ++ }; ++ ++ static const TS_INTERFACE_INIT_TABLE_ENTRY TsInterfaceInitTable[RTL2836_TS_INTERFACE_INIT_TABLE_LEN] = ++ { ++ // RegBitName, WritingValue for {Parallel, Serial} ++ {DTMB_SERIAL, {0x0, 0x1}}, ++ {DTMB_CDIV_PH0, {0xf, 0x1}}, ++ {DTMB_CDIV_PH1, {0xf, 0x1}}, ++ }; ++ ++ int i; ++ ++ int TsInterfaceMode; ++ ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ ++ ++ ++ // Get TS interface mode. ++ TsInterfaceMode = pDemod->TsInterfaceMode; ++ ++ // Initialize demod registers according to the initializing table. ++ for(i = 0; i < RTL2836_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get all information from each register initializing entry. ++ PageNo = InitRegTable[i].PageNo; ++ RegStartAddr = InitRegTable[i].RegStartAddr; ++ Msb = InitRegTable[i].Msb; ++ Lsb = InitRegTable[i].Lsb; ++ WritingValue = InitRegTable[i].WritingValue; ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ // Initialize demod registers according to the TS interface initializing table. ++ for(i = 0; i < RTL2836_TS_INTERFACE_INIT_TABLE_LEN; i++) ++ { ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, TsInterfaceInitTable[i].RegBitName, ++ TsInterfaceInitTable[i].WritingValue[TsInterfaceMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_IF_FREQ_HZ ++ ++*/ ++int ++rtl2836_SetIfFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ) ++{ ++ ++ unsigned long BbinEn, EnDcr; ++ ++ unsigned long IfFreqHzAdj; ++ ++ MPI MpiVar, MpiNone, MpiConst; ++ ++ long IffreqInt; ++ unsigned long IffreqBinary; ++ ++ ++ ++ // Determine and set BBIN_EN and EN_DCR value. ++ BbinEn = (IfFreqHz == IF_FREQ_0HZ) ? 0x1 : 0x0; ++ EnDcr = (IfFreqHz == IF_FREQ_0HZ) ? 0x1 : 0x0; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_BBIN_EN, BbinEn) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_EN_DCR, EnDcr) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Calculate IFFREQ value. ++ // Note: Case 1: IfFreqHz < 24000000, IfFreqHzAdj = IfFreqHz; ++ // Case 2: IfFreqHz >= 24000000, IfFreqHzAdj = 48000000 - IfFreqHz; ++ // IFFREQ = - round( IfFreqHzAdj * pow(2, 10) / 48000000 ) ++ // = - floor( (IfFreqHzAdj * pow(2, 10) + 24000000) / 48000000 ) ++ // RTL2836_ADC_FREQ_HZ = 48 MHz ++ // IFFREQ_BIT_NUM = 10 ++ IfFreqHzAdj = (IfFreqHz < (RTL2836_ADC_FREQ_HZ / 2)) ? IfFreqHz : (RTL2836_ADC_FREQ_HZ - IfFreqHz); ++ ++ MpiSetValue(&MpiVar, IfFreqHzAdj); ++ MpiLeftShift(&MpiVar, MpiVar, RTL2836_IFFREQ_BIT_NUM); ++ ++ MpiSetValue(&MpiConst, (RTL2836_ADC_FREQ_HZ / 2)); ++ MpiAdd(&MpiVar, MpiVar, MpiConst); ++ ++ MpiSetValue(&MpiConst, RTL2836_ADC_FREQ_HZ); ++ MpiDiv(&MpiVar, &MpiNone, MpiVar, MpiConst); ++ ++ MpiGetValue(MpiVar, &IffreqInt); ++ IffreqInt = - IffreqInt; ++ ++ IffreqBinary = SignedIntToBin(IffreqInt, RTL2836_IFFREQ_BIT_NUM); ++ ++ ++ // Set IFFREQ with calculated value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_IFFREQ, IffreqBinary) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod IF frequnecy parameter. ++ pDemod->IfFreqHz = IfFreqHz; ++ pDemod->IsIfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_SPECTRUM_MODE ++ ++*/ ++int ++rtl2836_SetSpectrumMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ) ++{ ++ unsigned long EnSpInv; ++ ++ ++ ++ // Determine SpecInv according to spectrum mode. ++ switch(SpectrumMode) ++ { ++ case SPECTRUM_NORMAL: EnSpInv = 0; break; ++ case SPECTRUM_INVERSE: EnSpInv = 1; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ // Set SPEC_INV with SpecInv. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_EN_SP_INV, EnSpInv) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod spectrum mode parameter. ++ pDemod->SpectrumMode = SpectrumMode; ++ pDemod->IsSpectrumModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_IS_SIGNAL_LOCKED ++ ++*/ ++int ++rtl2836_IsSignalLocked( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ long SnrDbNum; ++ long SnrDbDen; ++ long SnrDbInt; ++ ++ unsigned long PerNum; ++ unsigned long PerDen; ++ ++ ++ ++ // Get SNR integer part. ++ if(pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ SnrDbInt = SnrDbNum / SnrDbDen; ++ ++ ++ // Get PER. ++ if(pDemod->GetPer(pDemod, &PerNum, &PerDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Determine answer according to SNR and PER. ++ // Note: The criterion is "(0 < SNR_in_Db < 40) && (PER < 1)" ++ if((SnrDbInt > 0) && (SnrDbInt < 40) && (PerNum < PerDen)) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++rtl2836_GetSignalStrength( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ) ++{ ++ int SignalLockStatus; ++ long IfAgc; ++ ++ ++ ++ // Get signal lock status. ++ if(pDemod->IsSignalLocked(pDemod, &SignalLockStatus) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Get IF AGC value. ++ if(pDemod->GetIfAgc(pDemod, &IfAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // If demod is not signal-locked, set signal strength with zero. ++ if(SignalLockStatus != YES) ++ { ++ *pSignalStrength = 0; ++ goto success_status_signal_is_not_locked; ++ } ++ ++ // Determine signal strength according to signal lock status and IF AGC value. ++ // Note: Map IfAgc value 8191 ~ -8192 to 10 ~ 99 ++ // Formula: SignalStrength = 54 - IfAgc / 183 ++ *pSignalStrength = 54 - IfAgc / 183; ++ ++ ++success_status_signal_is_not_locked: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++rtl2836_GetSignalQuality( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ) ++{ ++ int SignalLockStatus; ++ long SnrDbNum, SnrDbDen; ++ ++ ++ ++ // Get signal lock status. ++ if(pDemod->IsSignalLocked(pDemod, &SignalLockStatus) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // If demod is not signal-locked, set signal quality with zero. ++ if(SignalLockStatus != YES) ++ { ++ *pSignalQuality = 0; ++ goto success_status_signal_is_not_locked; ++ } ++ ++ // Determine signal quality according to SnrDbNum. ++ // Note: Map SnrDbNum value 12 ~ 100 to 12 ~ 100 ++ // Formula: SignalQuality = SnrDbNum ++ // If SnrDbNum < 12, signal quality is 10. ++ // If SnrDbNum > 100, signal quality is 100. ++ if(SnrDbNum < 12) ++ { ++ *pSignalQuality = 10; ++ } ++ else if(SnrDbNum > 100) ++ { ++ *pSignalQuality = 100; ++ } ++ else ++ { ++ *pSignalQuality = SnrDbNum; ++ } ++ ++ ++success_status_signal_is_not_locked: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_BER ++ ++*/ ++int ++rtl2836_GetBer( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ) ++{ ++/* ++ unsigned long RsdBerEst; ++ ++ ++ ++ // Get RSD_BER_EST. ++ if(pDemod->GetRegBitsWithPage(pDemod, DTMB_RSD_BER_EST, &RsdBerEst) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set BER numerator according to RSD_BER_EST. ++ *pBerNum = RsdBerEst; ++ ++ // Set BER denominator. ++ *pBerDen = RTL2836_BER_DEN_VALUE; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++*/ ++ return FUNCTION_SUCCESS; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_PER ++ ++*/ ++int ++rtl2836_GetPer( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ) ++{ ++ unsigned long RoPktErrRate; ++ ++ ++ ++ // Get RO_PKT_ERR_RATE. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_RO_PKT_ERR_RATE, &RoPktErrRate) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set PER numerator according to RO_PKT_ERR_RATE. ++ *pPerNum = RoPktErrRate; ++ ++ // Set PER denominator. ++ *pPerDen = RTL2836_PER_DEN_VALUE; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_SNR_DB ++ ++*/ ++int ++rtl2836_GetSnrDb( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ unsigned long EstSnr; ++ ++ ++ ++ // Get EST_SNR. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_EST_SNR, &EstSnr) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set SNR dB numerator according to EST_SNR. ++ *pSnrDbNum = BinToSignedInt(EstSnr, RTL2836_EST_SNR_BIT_NUM); ++ ++ // Set SNR dB denominator. ++ *pSnrDbDen = RTL2836_SNR_DB_DEN_VALUE; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_RF_AGC ++ ++*/ ++int ++rtl2836_GetRfAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ) ++{ ++ unsigned long RfAgcVal; ++ ++ ++ ++ // Get RF AGC binary value from RF_AGC_VAL. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_RF_AGC_VAL, &RfAgcVal) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Convert RF AGC binary value to signed integer. ++ *pRfAgc = (long)BinToSignedInt(RfAgcVal, RTL2836_RF_AGC_REG_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_IF_AGC ++ ++*/ ++int ++rtl2836_GetIfAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ) ++{ ++ unsigned long IfAgcVal; ++ ++ ++ ++ // Get IF AGC binary value from IF_AGC_VAL. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_IF_AGC_VAL, &IfAgcVal) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Convert IF AGC binary value to signed integer. ++ *pIfAgc = (long)BinToSignedInt(IfAgcVal, RTL2836_IF_AGC_REG_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_DI_AGC ++ ++*/ ++int ++rtl2836_GetDiAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ) ++{ ++ unsigned long GainOutR; ++ ++ ++ ++ // Get GAIN_OUT_R to DiAgc. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_GAIN_OUT_R, &GainOutR) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ *pDiAgc = GainOutR; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++rtl2836_GetTrOffsetPpm( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ) ++{ ++ unsigned long TrOutRBinary; ++ long TrOutRInt; ++ unsigned long SfoaqOutRBinary; ++ long SfoaqOutRInt; ++ ++ MPI MpiVar, MpiNone, MpiConst; ++ ++ ++ // Get TR_OUT_R and SFOAQ_OUT_R binary value. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_TR_OUT_R, &TrOutRBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_SFOAQ_OUT_R, &SfoaqOutRBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Convert TR_OUT_R and SFOAQ_OUT_R binary value to signed integer. ++ TrOutRInt = BinToSignedInt(TrOutRBinary, RTL2836_TR_OUT_R_BIT_NUM); ++ SfoaqOutRInt = BinToSignedInt(SfoaqOutRBinary, RTL2836_SFOAQ_OUT_R_BIT_NUM); ++ ++ ++ // Get TR offset in ppm. ++ // Note: Original formula: TrOffsetPpm = ((TrOutRInt + SfoaqOutRInt * 8) * 15.12 * pow(10, 6)) / (48 * pow(2, 23)) ++ // Adjusted formula: TrOffsetPpm = ((TrOutRInt + SfoaqOutRInt * 8) * 15120000) / 402653184 ++ MpiSetValue(&MpiVar, (TrOutRInt + SfoaqOutRInt * 8)); ++ ++ MpiSetValue(&MpiConst, 15120000); ++ MpiMul(&MpiVar, MpiVar, MpiConst); ++ ++ MpiSetValue(&MpiConst, 402653184); ++ MpiDiv(&MpiVar, &MpiNone, MpiVar, MpiConst); ++ ++ MpiGetValue(MpiVar, pTrOffsetPpm); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++rtl2836_GetCrOffsetHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ) ++{ ++ unsigned long CfoEstRBinary; ++ long CfoEstRInt; ++ ++ MPI MpiVar, MpiConst; ++ ++ ++ // Get CFO_EST_R binary value. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_CFO_EST_R, &CfoEstRBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // Convert CFO_EST_R binary value to signed integer. ++ CfoEstRInt = BinToSignedInt(CfoEstRBinary, RTL2836_CFO_EST_R_BIT_NUM); ++ ++ ++ // Get CR offset in Hz. ++ // Note: Original formula: CrOffsetHz = (CfoEstRInt * 15.12 * pow(10, 6)) / pow(2, 26) ++ // Adjusted formula: CrOffsetHz = (CfoEstRInt * 15120000) >> 26 ++ MpiSetValue(&MpiVar, CfoEstRInt); ++ ++ MpiSetValue(&MpiConst, 15120000); ++ MpiMul(&MpiVar, MpiVar, MpiConst); ++ ++ MpiRightShift(&MpiVar, MpiVar, 26); ++ ++ MpiGetValue(MpiVar, pCrOffsetHz); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_CARRIER_MODE ++ ++*/ ++int ++rtl2836_GetCarrierMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCarrierMode ++ ) ++{ ++ unsigned long EstCarrier; ++ ++ ++ // Get carrier mode from EST_CARRIER. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_EST_CARRIER, &EstCarrier) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(EstCarrier) ++ { ++ case 0: *pCarrierMode = DTMB_CARRIER_SINGLE; break; ++ case 1: *pCarrierMode = DTMB_CARRIER_MULTI; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_PN_MODE ++ ++*/ ++int ++rtl2836_GetPnMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pPnMode ++ ) ++{ ++ unsigned long RxModeR; ++ ++ ++ // Get PN mode from RX_MODE_R. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_RX_MODE_R, &RxModeR) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(RxModeR) ++ { ++ case 0: *pPnMode = DTMB_PN_420; break; ++ case 1: *pPnMode = DTMB_PN_595; break; ++ case 2: *pPnMode = DTMB_PN_945; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_QAM_MODE ++ ++*/ ++int ++rtl2836_GetQamMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ) ++{ ++ unsigned long UseTps; ++ ++ ++ // Get QAM mode from USE_TPS. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_USE_TPS, &UseTps) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(UseTps) ++ { ++ case 0: *pQamMode = DTMB_QAM_UNKNOWN; break; ++ ++ case 2: ++ case 3: *pQamMode = DTMB_QAM_4QAM_NR; break; ++ ++ case 4: ++ case 5: ++ case 6: ++ case 7: ++ case 8: ++ case 9: *pQamMode = DTMB_QAM_4QAM; break; ++ ++ case 10: ++ case 11: ++ case 12: ++ case 13: ++ case 14: ++ case 15: *pQamMode = DTMB_QAM_16QAM; break; ++ ++ case 16: ++ case 17: *pQamMode = DTMB_QAM_32QAM; break; ++ ++ case 18: ++ case 19: ++ case 20: ++ case 21: ++ case 22: ++ case 23: *pQamMode = DTMB_QAM_64QAM; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_CODE_RATE_MODE ++ ++*/ ++int ++rtl2836_GetCodeRateMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCodeRateMode ++ ) ++{ ++ unsigned long UseTps; ++ ++ ++ // Get QAM mode from USE_TPS. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_USE_TPS, &UseTps) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(UseTps) ++ { ++ case 0: *pCodeRateMode = DTMB_CODE_RATE_UNKNOWN; break; ++ ++ case 4: ++ case 5: ++ case 10: ++ case 11: ++ case 18: ++ case 19: *pCodeRateMode = DTMB_CODE_RATE_0P4; break; ++ ++ case 6: ++ case 7: ++ case 12: ++ case 13: ++ case 20: ++ case 21: *pCodeRateMode = DTMB_CODE_RATE_0P6; break; ++ ++ case 2: ++ case 3: ++ case 8: ++ case 9: ++ case 14: ++ case 15: ++ case 16: ++ case 17: ++ case 22: ++ case 23: *pCodeRateMode = DTMB_CODE_RATE_0P8; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_TIME_INTERLEAVER_MODE ++ ++*/ ++int ++rtl2836_GetTimeInterleaverMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pTimeInterleaverMode ++ ) ++{ ++ unsigned long UseTps; ++ ++ ++ // Get QAM mode from USE_TPS. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_USE_TPS, &UseTps) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ switch(UseTps) ++ { ++ case 0: *pTimeInterleaverMode = DTMB_TIME_INTERLEAVER_UNKNOWN; break; ++ ++ case 2: ++ case 4: ++ case 6: ++ case 8: ++ case 10: ++ case 12: ++ case 14: ++ case 16: ++ case 18: ++ case 20: ++ case 22: *pTimeInterleaverMode = DTMB_TIME_INTERLEAVER_240; break; ++ ++ case 3: ++ case 5: ++ case 7: ++ case 9: ++ case 11: ++ case 13: ++ case 15: ++ case 17: ++ case 19: ++ case 21: ++ case 23: *pTimeInterleaverMode = DTMB_TIME_INTERLEAVER_720; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2836_UpdateFunction( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ ++ // Execute Function 1 according to Function 1 enabling status ++ if(pExtra->IsFunc1Enabled == YES) ++ { ++ if(rtl2836_func1_Update(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ // Execute Function 2 according to Function 2 enabling status ++ if(pExtra->IsFunc2Enabled == YES) ++ { ++ if(rtl2836_func2_Update(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_RESET_FUNCTION ++ ++*/ ++int ++rtl2836_ResetFunction( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ ++ // Reset Function 1 settings according to Function 1 enabling status. ++ if(pExtra->IsFunc1Enabled == YES) ++ { ++ if(rtl2836_func1_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ // Reset Function 2 settings according to Function 2 enabling status. ++ if(pExtra->IsFunc2Enabled == YES) ++ { ++ if(rtl2836_func2_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD ++ ++*/ ++int ++rtl2836_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module. ++ pDemod = (DTMB_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Send I2C reading command. ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_reading_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_reading_command: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD ++ ++*/ ++int ++rtl2836_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module. ++ pDemod = (DTMB_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Send I2C writing command. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, pWritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_writing_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_writing_command: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Initialize RTL2836 register table. ++ ++Use rtl2836_InitRegTable() to initialize RTL2836 register table. ++ ++ ++@param [in] pDemod RTL2836 demod module pointer ++ ++ ++@note ++ -# The rtl2836_InitRegTable() function will be called by BuildRtl2836Module(). ++ ++*/ ++void ++rtl2836_InitRegTable( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ static const DTMB_PRIMARY_REG_ENTRY_ADDR_8BIT PrimaryRegTable[RTL2836_REG_TABLE_LEN] = ++ { ++ // Software reset ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_SOFT_RST_N, 0x0, 0x4, 0, 0 }, ++ ++ // Tuner I2C forwording ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_I2CT_EN_CTRL, 0x0, 0x6, 0, 0 }, ++ ++ // Chip ID ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_CHIP_ID, 0x5, 0x10, 15, 0 }, ++ ++ // IF setting ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_EN_SP_INV, 0x1, 0x31, 1, 1 }, ++ {DTMB_EN_DCR, 0x1, 0x31, 0, 0 }, ++ {DTMB_BBIN_EN, 0x1, 0x6a, 0, 0 }, ++ {DTMB_IFFREQ, 0x1, 0x32, 9, 0 }, ++ ++ // AGC setting ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_TARGET_VAL, 0x1, 0x3, 7, 0 }, ++ ++ // IF setting ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_SERIAL, 0x4, 0x50, 7, 7 }, ++ {DTMB_CDIV_PH0, 0x4, 0x51, 4, 0 }, ++ {DTMB_CDIV_PH1, 0x4, 0x52, 4, 0 }, ++ ++ // Signal lock status ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_TPS_LOCK, 0x8, 0x2a, 6, 6 }, ++ {DTMB_PN_PEAK_EXIST, 0x6, 0x53, 0, 0 }, ++ ++ // FSM ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_FSM_STATE_R, 0x6, 0xc0, 4, 0 }, ++ ++ // Performance measurement ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_RO_PKT_ERR_RATE, 0x9, 0x2d, 15, 0 }, ++ {DTMB_EST_SNR, 0x8, 0x3e, 8, 0 }, ++ ++ // AGC ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_GAIN_OUT_R, 0x6, 0xb4, 12, 1 }, ++ {DTMB_RF_AGC_VAL, 0x6, 0x16, 13, 0 }, ++ {DTMB_IF_AGC_VAL, 0x6, 0x14, 13, 0 }, ++ ++ // TR and CR ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_TR_OUT_R, 0x7, 0x7c, 16, 0 }, ++ {DTMB_SFOAQ_OUT_R, 0x7, 0x21, 13, 0 }, ++ {DTMB_CFO_EST_R, 0x6, 0x94, 22, 0 }, ++ ++ // Signal information ++ // RegBitName, PageNo, RegStartAddr, MSB, LSB ++ {DTMB_EST_CARRIER, 0x8, 0x2a, 0, 0 }, ++ {DTMB_RX_MODE_R, 0x7, 0x17, 1, 0 }, ++ {DTMB_USE_TPS, 0x8, 0x2a, 5, 1 }, ++ }; ++ ++ ++ int i; ++ int RegBitName; ++ ++ ++ ++ // Initialize register table according to primary register table. ++ // Note: 1. Register table rows are sorted by register bit name key. ++ // 2. The default value of the IsAvailable variable is "NO". ++ for(i = 0; i < DTMB_REG_TABLE_LEN_MAX; i++) ++ pDemod->RegTable.Addr8Bit[i].IsAvailable = NO; ++ ++ for(i = 0; i < RTL2836_REG_TABLE_LEN; i++) ++ { ++ RegBitName = PrimaryRegTable[i].RegBitName; ++ ++ pDemod->RegTable.Addr8Bit[RegBitName].IsAvailable = YES; ++ pDemod->RegTable.Addr8Bit[RegBitName].PageNo = PrimaryRegTable[i].PageNo; ++ pDemod->RegTable.Addr8Bit[RegBitName].RegStartAddr = PrimaryRegTable[i].RegStartAddr; ++ pDemod->RegTable.Addr8Bit[RegBitName].Msb = PrimaryRegTable[i].Msb; ++ pDemod->RegTable.Addr8Bit[RegBitName].Lsb = PrimaryRegTable[i].Lsb; ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set I2C bridge module demod arguments. ++ ++RTL2836 builder will use rtl2836_BuildI2cBridgeModule() to set I2C bridge module demod arguments. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@see BuildRtl2836Module() ++ ++*/ ++void ++rtl2836_BuildI2cBridgeModule( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ ++ // Get I2C bridge module. ++ pI2cBridge = pDemod->pI2cBridge; ++ ++ // Set I2C bridge module demod arguments. ++ pI2cBridge->pPrivateData = (void *)pDemod; ++ pI2cBridge->ForwardI2cReadingCmd = rtl2836_ForwardI2cReadingCmd; ++ pI2cBridge->ForwardI2cWritingCmd = rtl2836_ForwardI2cWritingCmd; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Reset Function 1 variables and registers. ++ ++One can use rtl2836_func1_Reset() to reset Function 1 variables and registers. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset Function 1 variables and registers successfully. ++@retval FUNCTION_ERROR Reset Function 1 variables and registers unsuccessfully. ++ ++ ++@note ++ -# Need to execute Function 1 reset function when change tuner RF frequency or demod parameters. ++ -# Function 1 update flow also employs Function 1 reset function. ++ ++*/ ++int ++rtl2836_func1_Reset( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ // Reset demod Function 1 variables. ++ pExtra->Func1Cnt = 0; ++ ++ ++ return FUNCTION_SUCCESS; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update demod registers with Function 1. ++ ++One can use rtl2836_func1_Update() to update demod registers with Function 1. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod registers with Function 1 successfully. ++@retval FUNCTION_ERROR Update demod registers with Function 1 unsuccessfully. ++ ++ ++@note ++ -# Recommended update period is 50 ~ 200 ms for Function 1. ++ -# Need to execute Function 1 reset function when change tuner RF frequency or demod parameters. ++ -# Function 1 update flow also employs Function 1 reset function. ++ ++*/ ++int ++rtl2836_func1_Update( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ unsigned long Reg0; ++ unsigned long Reg1; ++ unsigned long PnPeakExist; ++ unsigned long FsmStateR; ++ unsigned long TpsLock; ++ ++ long SnrDbNum; ++ long SnrDbDen; ++ long SnrDbInt; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ ++ // Update Function 1 counter. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x9) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegMaskBits(pDemod, 0x1e, 9, 0, &Reg0) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if((Reg0 & 0x3fb) == 0) ++ { ++ pExtra->Func1Cnt += 1; ++ } ++ else ++ { ++ pExtra->Func1Cnt = 0; ++ } ++ ++ ++ // Get PN_PEAK_EXIST and FSM_STATE_R value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x6) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, DTMB_PN_PEAK_EXIST, &PnPeakExist) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, DTMB_FSM_STATE_R, &FsmStateR) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Get Reg1 and TPS_LOCK value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x8) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegMaskBits(pDemod, 0x28, 3, 0, &Reg1) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, DTMB_TPS_LOCK, &TpsLock) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Get SNR integer part. ++ if(pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ SnrDbInt = SnrDbNum / SnrDbDen; ++ ++ ++ // Determine if reset demod by software reset. ++ // Note: Need to reset Function 2 when reset demod. ++ if((pExtra->Func1Cnt > pExtra->Func1CntThd) || ((PnPeakExist == 0) && (FsmStateR > 9)) || ++ ((Reg1 >= 6) && (TpsLock == 0)) || (SnrDbInt == -64)) ++ { ++ pExtra->Func1Cnt = 0; ++ ++ if(pExtra->IsFunc2Enabled == ON) ++ { ++ if(rtl2836_func2_Reset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ } ++ ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_get_registers: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Reset Function 2 variables and registers. ++ ++One can use rtl2836_func2_Reset() to reset Function 1 variables and registers. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset Function 2 variables and registers successfully. ++@retval FUNCTION_ERROR Reset Function 2 variables and registers unsuccessfully. ++ ++ ++@note ++ -# Need to execute Function 2 reset function when change tuner RF frequency or demod parameters. ++ -# Function 2 update flow also employs Function 2 reset function. ++ ++*/ ++int ++rtl2836_func2_Reset( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get demod extra module. ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ // Reset demod Function 2 variables and registers to signal normal mode. ++ pExtra->Func2SignalModePrevious = RTL2836_FUNC2_SIGNAL_NORMAL; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x15, 7, 0, 0xf) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1e, 6, 0, 0x3a) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1f, 5, 0, 0x19) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x23, 4, 0, 0x1e) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update demod registers with Function 2. ++ ++One can use rtl2836_func2_Update() to update demod registers with Function 2. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod registers with Function 2 successfully. ++@retval FUNCTION_ERROR Update demod registers with Function 2 unsuccessfully. ++ ++ ++@note ++ -# Recommended update period is 50 ~ 200 ms for Function 2. ++ -# Need to execute Function 2 reset function when change tuner RF frequency or demod parameters. ++ -# Function 2 update flow also employs Function 2 reset function. ++ ++*/ ++int ++rtl2836_func2_Update( ++ DTMB_DEMOD_MODULE *pDemod ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ RTL2836_EXTRA_MODULE *pExtra; ++ ++ int i; ++ ++ unsigned long TpsLock; ++ unsigned long PnPeakExist; ++ ++ int PnMode; ++ int QamMode; ++ int CodeRateMode; ++ ++ int SignalLockStatus; ++ ++ int SignalMode; ++ ++ ++ ++ // Get base interface and demod extra module. ++ pBaseInterface = pDemod->pBaseInterface; ++ pExtra = &(pDemod->Extra.Rtl2836); ++ ++ ++ // Get TPS_LOCK value. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_TPS_LOCK, &TpsLock) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Get PN_PEAK_EXIST value. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, DTMB_PN_PEAK_EXIST, &PnPeakExist) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Get PN mode. ++ if(pDemod->GetPnMode(pDemod, &PnMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get QAM mode. ++ if(pDemod->GetQamMode(pDemod, &QamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get code rate mode. ++ if(pDemod->GetCodeRateMode(pDemod, &CodeRateMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // If TPS is not locked or PN peak doesn't exist, do nothing. ++ if((TpsLock != 0x1) || (PnPeakExist != 0x1)) ++ goto success_status_tps_is_not_locked; ++ ++ // Determine signal mode. ++ if((PnMode == DTMB_PN_945) && (QamMode == DTMB_QAM_64QAM) && (CodeRateMode == DTMB_CODE_RATE_0P6)) ++ { ++ SignalMode = RTL2836_FUNC2_SIGNAL_PARTICULAR; ++ } ++ else ++ { ++ SignalMode = RTL2836_FUNC2_SIGNAL_NORMAL; ++ } ++ ++ // If signal mode is the same as previous one, do nothing. ++ if(SignalMode == pExtra->Func2SignalModePrevious) ++ goto success_status_signal_mode_is_the_same; ++ ++ ++ // Set demod registers according to signal mode ++ switch(SignalMode) ++ { ++ default: ++ case RTL2836_FUNC2_SIGNAL_NORMAL: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x15, 7, 0, 0xf) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1e, 6, 0, 0x3a) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1f, 5, 0, 0x19) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x23, 4, 0, 0x1e) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ ++ ++ case RTL2836_FUNC2_SIGNAL_PARTICULAR: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0x2) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x15, 7, 0, 0x4) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1e, 6, 0, 0xa) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x1f, 5, 0, 0x3f) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, 0x23, 4, 0, 0x1f) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Wait 1000 ms for signal lock check. ++ for(i = 0; i < 10; i++) ++ { ++ // Wait 100 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 100); ++ ++ // Check signal lock status on demod. ++ // Note: If signal is locked, stop signal lock check. ++ if(pDemod->IsSignalLocked(pDemod, &SignalLockStatus) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(SignalLockStatus == YES) ++ break; ++ } ++ ++ ++ // Update previous signal mode. ++ pExtra->Func2SignalModePrevious = SignalMode; ++ ++ ++success_status_signal_mode_is_the_same: ++success_status_tps_is_not_locked: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2836.h b/drivers/media/dvb/dvb-usb/demod_rtl2836.h +new file mode 100644 +index 0000000..af3c79e +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2836.h +@@ -0,0 +1,376 @@ ++#ifndef __DEMOD_RTL2836_H ++#define __DEMOD_RTL2836_H ++ ++/** ++ ++@file ++ ++@brief RTL2836 demod module declaration ++ ++One can manipulate RTL2836 demod through RTL2836 module. ++RTL2836 module is derived from DTMB demod module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the DTMB demod example in dtmb_demod_base.h except the listed lines. ++ ++ ++ ++#include "demod_rtl2836.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ ++ ... ++ ++ ++ ++ // Build RTL2836 demod module. ++ BuildRtl2836Module( ++ &pDemod, ++ &DtmbDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x3e, // I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // Crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // TS interface mode is serial. ++ 50, // Update function reference period is 50 millisecond ++ YES, // Function 1 enabling status is on. ++ YES // Function 2 enabling status is on. ++ ); ++ ++ ++ ++ // See the example for other DTMB demod functions in dtmb_demod_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "dtmb_demod_base.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// Initializing ++#define RTL2836_INIT_REG_TABLE_LEN 86 ++#define RTL2836_TS_INTERFACE_INIT_TABLE_LEN 3 ++ ++ ++// Chip ID ++#define RTL2836_CHIP_ID_VALUE 0x4 ++ ++ ++// IF frequency setting ++#define RTL2836_ADC_FREQ_HZ 48000000 ++#define RTL2836_IFFREQ_BIT_NUM 10 ++ ++ ++// BER ++#define RTL2836_BER_DEN_VALUE 1000000 ++ ++ ++// PER ++#define RTL2836_PER_DEN_VALUE 32768 ++ ++ ++// SNR ++#define RTL2836_EST_SNR_BIT_NUM 9 ++#define RTL2836_SNR_DB_DEN_VALUE 4 ++ ++ ++// AGC ++#define RTL2836_RF_AGC_REG_BIT_NUM 14 ++#define RTL2836_IF_AGC_REG_BIT_NUM 14 ++ ++ ++// TR offset and CR offset ++#define RTL2836_TR_OUT_R_BIT_NUM 17 ++#define RTL2836_SFOAQ_OUT_R_BIT_NUM 14 ++#define RTL2836_CFO_EST_R_BIT_NUM 23 ++ ++ ++// Register table length ++#define RTL2836_REG_TABLE_LEN 25 ++ ++ ++// Function 1 ++#define RTL2836_FUNC1_CHECK_TIME_MS 500 ++ ++ ++// Function 2 ++enum RTL2836_FUNC2_SIGNAL_MODE ++{ ++ RTL2836_FUNC2_SIGNAL_NORMAL, ++ RTL2836_FUNC2_SIGNAL_PARTICULAR, ++}; ++ ++ ++ ++ ++ ++// Demod module builder ++void ++BuildRtl2836Module( ++ DTMB_DEMOD_MODULE **ppDemod, ++ DTMB_DEMOD_MODULE *pDtmbDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ unsigned long UpdateFuncRefPeriodMs, ++ int IsFunc1Enabled, ++ int IsFunc2Enabled ++ ); ++ ++ ++ ++ ++ ++// Manipulating functions ++void ++rtl2836_IsConnectedToI2c( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++); ++ ++int ++rtl2836_SoftwareReset( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_Initialize( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_SetIfFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++int ++rtl2836_SetSpectrumMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++int ++rtl2836_IsSignalLocked( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2836_GetSignalStrength( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++rtl2836_GetSignalQuality( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++rtl2836_GetBer( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++int ++rtl2836_GetPer( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++int ++rtl2836_GetSnrDb( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++rtl2836_GetRfAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++int ++rtl2836_GetIfAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++int ++rtl2836_GetDiAgc( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ); ++ ++int ++rtl2836_GetTrOffsetPpm( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++int ++rtl2836_GetCrOffsetHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++int ++rtl2836_GetCarrierMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCarrierMode ++ ); ++ ++int ++rtl2836_GetPnMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pPnMode ++ ); ++ ++int ++rtl2836_GetQamMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ); ++ ++int ++rtl2836_GetCodeRateMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCodeRateMode ++ ); ++ ++int ++rtl2836_GetTimeInterleaverMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pTimeInterleaverMode ++ ); ++ ++int ++rtl2836_UpdateFunction( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_ResetFunction( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// I2C command forwarding functions ++int ++rtl2836_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++rtl2836_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++// Register table initializing ++void ++rtl2836_InitRegTable( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// I2C birdge module builder ++void ++rtl2836_BuildI2cBridgeModule( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// RTL2836 dependence ++int ++rtl2836_func1_Reset( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_func1_Update( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_func2_Reset( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2836_func2_Update( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2840.c b/drivers/media/dvb/dvb-usb/demod_rtl2840.c +new file mode 100644 +index 0000000..226caf9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2840.c +@@ -0,0 +1,2437 @@ ++/** ++ ++@file ++ ++@brief RTL2840 QAM demod module definition ++ ++One can manipulate RTL2840 QAM demod through RTL2840 module. ++RTL2840 module is derived from QAM demod module. ++ ++*/ ++ ++ ++#include "demod_rtl2840.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2840 demod module builder ++ ++Use BuildRtl2840Module() to build RTL2840 module, set all module function pointers with the corresponding functions, and ++initialize module private variables. ++ ++ ++@param [in] ppDemod Pointer to RTL2840 demod module pointer ++@param [in] pQamDemodModuleMemory Pointer to an allocated QAM demod module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr RTL2840 I2C device address ++@param [in] CrystalFreqHz RTL2840 crystal frequency in Hz ++@param [in] TsInterfaceMode RTL2840 TS interface mode for setting ++@param [in] EnhancementMode RTL2840 enhancement mode for setting ++ ++ ++@note ++ -# One should call BuildRtl2840Module() to build RTL2840 module before using it. ++ ++*/ ++void ++BuildRtl2840Module( ++ QAM_DEMOD_MODULE **ppDemod, ++ QAM_DEMOD_MODULE *pQamDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ int EnhancementMode ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ ++ // Set demod module pointer. ++ *ppDemod = pQamDemodModuleMemory; ++ ++ // Get demod module. ++ pDemod = *ppDemod; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pDemod->pBaseInterface = pBaseInterfaceModuleMemory; ++ pDemod->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ ++ // Set demod type. ++ pDemod->DemodType = QAM_DEMOD_TYPE_RTL2840; ++ ++ // Set demod I2C device address. ++ pDemod->DeviceAddr = DeviceAddr; ++ ++ // Set demod crystal frequency in Hz. ++ pDemod->CrystalFreqHz = CrystalFreqHz; ++ ++ // Set demod TS interface mode. ++ pDemod->TsInterfaceMode = TsInterfaceMode; ++ ++ ++ // Initialize demod parameter setting status ++ pDemod->IsQamModeSet = NO; ++ pDemod->IsSymbolRateHzSet = NO; ++ pDemod->IsAlphaModeSet = NO; ++ pDemod->IsIfFreqHzSet = NO; ++ pDemod->IsSpectrumModeSet = NO; ++ ++ ++ // Initialize register tables in demod extra module. ++ rtl2840_InitBaseRegTable(pDemod); ++ rtl2840_InitMonitorRegTable(pDemod); ++ ++ ++ // Build I2C birdge module. ++ rtl2840_BuildI2cBridgeModule(pDemod); ++ ++ ++ // Set demod module I2C function pointers with default functions. ++ pDemod->RegAccess.Addr8Bit.SetRegPage = qam_demod_addr_8bit_default_SetRegPage; ++ pDemod->RegAccess.Addr8Bit.SetRegBytes = qam_demod_addr_8bit_default_SetRegBytes; ++ pDemod->RegAccess.Addr8Bit.GetRegBytes = qam_demod_addr_8bit_default_GetRegBytes; ++ pDemod->RegAccess.Addr8Bit.SetRegMaskBits = qam_demod_addr_8bit_default_SetRegMaskBits; ++ pDemod->RegAccess.Addr8Bit.GetRegMaskBits = qam_demod_addr_8bit_default_GetRegMaskBits; ++ pDemod->RegAccess.Addr8Bit.SetRegBits = qam_demod_addr_8bit_default_SetRegBits; ++ pDemod->RegAccess.Addr8Bit.GetRegBits = qam_demod_addr_8bit_default_GetRegBits; ++ pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage = qam_demod_addr_8bit_default_SetRegBitsWithPage; ++ pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage = qam_demod_addr_8bit_default_GetRegBitsWithPage; ++ ++ ++ // Set demod module manipulating function pointers with default functions. ++ pDemod->GetDemodType = qam_demod_default_GetDemodType; ++ pDemod->GetDeviceAddr = qam_demod_default_GetDeviceAddr; ++ pDemod->GetCrystalFreqHz = qam_demod_default_GetCrystalFreqHz; ++ ++ pDemod->GetQamMode = qam_demod_default_GetQamMode; ++ pDemod->GetSymbolRateHz = qam_demod_default_GetSymbolRateHz; ++ pDemod->GetAlphaMode = qam_demod_default_GetAlphaMode; ++ pDemod->GetIfFreqHz = qam_demod_default_GetIfFreqHz; ++ pDemod->GetSpectrumMode = qam_demod_default_GetSpectrumMode; ++ ++ ++ // Set demod module manipulating function pointers with particular functions. ++ // Note: Need to assign manipulating function pointers according to enhancement mode. ++ pDemod->IsConnectedToI2c = rtl2840_IsConnectedToI2c; ++ pDemod->SoftwareReset = rtl2840_SoftwareReset; ++ ++ pDemod->Initialize = rtl2840_Initialize; ++ pDemod->SetSymbolRateHz = rtl2840_SetSymbolRateHz; ++ pDemod->SetAlphaMode = rtl2840_SetAlphaMode; ++ pDemod->SetIfFreqHz = rtl2840_SetIfFreqHz; ++ pDemod->SetSpectrumMode = rtl2840_SetSpectrumMode; ++ ++ pDemod->GetRfAgc = rtl2840_GetRfAgc; ++ pDemod->GetIfAgc = rtl2840_GetIfAgc; ++ pDemod->GetDiAgc = rtl2840_GetDiAgc; ++ pDemod->GetTrOffsetPpm = rtl2840_GetTrOffsetPpm; ++ pDemod->GetCrOffsetHz = rtl2840_GetCrOffsetHz; ++ ++ pDemod->IsAagcLocked = rtl2840_IsAagcLocked; ++ pDemod->IsEqLocked = rtl2840_IsEqLocked; ++ pDemod->IsFrameLocked = rtl2840_IsFrameLocked; ++ ++ pDemod->GetErrorRate = rtl2840_GetErrorRate; ++ pDemod->GetSnrDb = rtl2840_GetSnrDb; ++ ++ pDemod->GetSignalStrength = rtl2840_GetSignalStrength; ++ pDemod->GetSignalQuality = rtl2840_GetSignalQuality; ++ ++ pDemod->UpdateFunction = rtl2840_UpdateFunction; ++ pDemod->ResetFunction = rtl2840_ResetFunction; ++ ++ switch(EnhancementMode) ++ { ++ case QAM_DEMOD_EN_NONE: ++ pDemod->SetQamMode = rtl2840_SetQamMode; ++ break; ++ ++ case QAM_DEMOD_EN_AM_HUM: ++ pDemod->SetQamMode = rtl2840_am_hum_en_SetQamMode; ++ break; ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_IS_CONNECTED_TO_I2C ++ ++*/ ++void ++rtl2840_IsConnectedToI2c( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long ReadingValue; ++ ++ ++ ++ // Set reading value to zero, and get SYS_VERSION value. ++ // Note: Use GetRegBitsWithPage() to get register bits with page setting. ++ ReadingValue = 0; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_SYS_VERSION, &ReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Compare SYS_VERSION value with RTL2840_SYS_VERSION_VALUE. ++ if(ReadingValue == RTL2840_SYS_VERSION_VALUE) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return; ++ ++ ++error_status_get_demod_registers: ++ ++ *pAnswer = NO; ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SOFTWARE_RESET ++ ++*/ ++int ++rtl2840_SoftwareReset( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ // Set register page number with system page number for software resetting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 0) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set and clear SOFT_RESET register bit. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SOFT_RESET, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SOFT_RESET, OFF) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_INITIALIZE ++ ++*/ ++int ++rtl2840_Initialize( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ typedef struct ++ { ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ } ++ INIT_REG_ENTRY; ++ ++ ++ typedef struct ++ { ++ unsigned char SpecReg0Sel; ++ unsigned char SpecReg0ValueTable[RTL2840_SPEC_REG_0_VALUE_TABLE_LEN]; ++ } ++ INIT_SPEC_REG_0_ENTRY; ++ ++ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long WritingValue[TS_INTERFACE_MODE_NUM]; ++ } ++ TS_INTERFACE_INIT_TABLE_ENTRY; ++ ++ ++ ++ static const INIT_REG_ENTRY InitRegTable[RTL2840_INIT_REG_TABLE_LEN] = ++ { ++ // PageNo, RegStartAddr, Msb, Lsb, WritingValue ++ {0, 0x04, 2, 0, 0x5 }, ++ {0, 0x04, 4, 3, 0x0 }, ++ {0, 0x04, 5, 5, 0x1 }, ++ {0, 0x06, 0, 0, 0x0 }, ++ {0, 0x07, 2, 2, 0x0 }, ++ {1, 0x04, 0, 0, 0x0 }, ++ {1, 0x04, 1, 1, 0x0 }, ++ {1, 0x04, 2, 2, 0x0 }, ++ {1, 0x04, 3, 3, 0x0 }, ++ {1, 0x0c, 2, 0, 0x7 }, ++ {1, 0x19, 5, 5, 0x0 }, ++ {1, 0x19, 6, 6, 0x1 }, ++ {1, 0x19, 7, 7, 0x1 }, ++ {1, 0x1a, 0, 0, 0x0 }, ++ {1, 0x1a, 1, 1, 0x1 }, ++ {1, 0x1a, 2, 2, 0x0 }, ++ {1, 0x1a, 3, 3, 0x1 }, ++ {1, 0x1a, 4, 4, 0x0 }, ++ {1, 0x1a, 5, 5, 0x1 }, ++ {1, 0x1a, 6, 6, 0x1 }, ++ {1, 0x1b, 3, 0, 0x7 }, ++ {1, 0x1b, 7, 4, 0xc }, ++ {1, 0x1c, 2, 0, 0x4 }, ++ {1, 0x1c, 5, 3, 0x3 }, ++ {1, 0x1d, 5, 0, 0x7 }, ++ {1, 0x27, 9, 0, 0x6d }, ++ {1, 0x2b, 7, 0, 0x26 }, ++ {1, 0x2c, 7, 0, 0x1e }, ++ {1, 0x2e, 7, 6, 0x3 }, ++ {1, 0x32, 2, 0, 0x7 }, ++ {1, 0x32, 5, 3, 0x0 }, ++ {1, 0x32, 6, 6, 0x1 }, ++ {1, 0x32, 7, 7, 0x0 }, ++ {1, 0x33, 6, 0, 0xf }, ++ {1, 0x33, 7, 7, 0x1 }, ++ {1, 0x39, 7, 0, 0x88 }, ++ {1, 0x3a, 7, 0, 0x36 }, ++ {1, 0x3e, 7, 0, 0x26 }, ++ {1, 0x3f, 7, 0, 0x15 }, ++ {1, 0x4b, 8, 0, 0x166 }, ++ {1, 0x4d, 8, 0, 0x166 }, ++ {2, 0x11, 0, 0, 0x0 }, ++ {2, 0x02, 7, 0, 0x7e }, ++ {2, 0x12, 3, 0, 0x7 }, ++ {2, 0x12, 7, 4, 0x7 }, ++ }; ++ ++ ++ static const INIT_SPEC_REG_0_ENTRY InitSpecReg0Table[RTL2840_INIT_SPEC_REG_0_TABLE_LEN] = ++ { ++ // SpecReg0Sel, {SpecReg0ValueTable } ++ {0, {0x00, 0xd0, 0x49, 0x8e, 0xf2, 0x01, 0x00, 0xc0, 0x62, 0x62, 0x00} }, ++ {1, {0x11, 0x21, 0x89, 0x8e, 0xf2, 0x01, 0x80, 0x8b, 0x62, 0xe2, 0x00} }, ++ {2, {0x22, 0x32, 0x89, 0x8e, 0x72, 0x00, 0xc0, 0x86, 0xe2, 0xe3, 0x00} }, ++ {3, {0x43, 0x44, 0x8b, 0x0e, 0xf2, 0xdd, 0xb5, 0x84, 0xe2, 0xcb, 0x00} }, ++ {4, {0x54, 0x55, 0xcb, 0x1e, 0xf3, 0x4d, 0xb5, 0x84, 0xe2, 0xcb, 0x00} }, ++ {5, {0x65, 0x66, 0xcb, 0x1e, 0xf5, 0x4b, 0xb4, 0x84, 0xe2, 0xcb, 0x00} }, ++ {6, {0x76, 0x77, 0xcb, 0x9e, 0xf7, 0xc7, 0x73, 0x80, 0xe2, 0xcb, 0x00} }, ++ {7, {0x87, 0x88, 0xcb, 0x2e, 0x48, 0x41, 0x72, 0x80, 0xe2, 0xcb, 0x00} }, ++ {8, {0x98, 0x99, 0xcc, 0x3e, 0x48, 0x21, 0x71, 0x80, 0xea, 0xcb, 0x00} }, ++ {11, {0xbb, 0xc8, 0xcb, 0x6e, 0x24, 0x18, 0x73, 0xa0, 0xfa, 0xcf, 0x01} }, ++ {13, {0x1d, 0x1e, 0x4f, 0x8e, 0xf2, 0x01, 0x00, 0x80, 0x62, 0x62, 0x00} }, ++ {14, {0x1e, 0x1f, 0x4f, 0x8e, 0xf2, 0x01, 0x00, 0x80, 0x62, 0x62, 0x00} }, ++ {15, {0x1f, 0x11, 0x4f, 0x8e, 0xf2, 0x01, 0x00, 0x80, 0x62, 0x62, 0x00} }, ++ }; ++ ++ ++ static const TS_INTERFACE_INIT_TABLE_ENTRY TsInterfaceInitTable[RTL2840_TS_INTERFACE_INIT_TABLE_LEN] = ++ { ++ // RegBitName, WritingValue for {Parallel, Serial} ++ {QAM_SERIAL, {0x0, 0x1}}, ++ {QAM_CDIV_PH0, {0x7, 0x0}}, ++ {QAM_CDIV_PH1, {0x7, 0x0}}, ++ }; ++ ++ ++ int i; ++ ++ int TsInterfaceMode; ++ ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ ++ unsigned char SpecReg0Sel; ++ const unsigned char *pSpecReg0ValueTable; ++ ++ unsigned long QamSpecInitA2Backup; ++ unsigned long RegValue, RegValueComparison; ++ int AreAllValueEqual; ++ ++ ++ ++ // Get TS interface mode. ++ TsInterfaceMode = pDemod->TsInterfaceMode; ++ ++ // Initialize demod with register initializing table. ++ for(i = 0; i < RTL2840_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get all information from each register initializing entry. ++ PageNo = InitRegTable[i].PageNo; ++ RegStartAddr = InitRegTable[i].RegStartAddr; ++ Msb = InitRegTable[i].Msb; ++ Lsb = InitRegTable[i].Lsb; ++ WritingValue = InitRegTable[i].WritingValue; ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set register page number with inner page number for specific register 0 initializing. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Initialize demod with specific register 0 initializing table. ++ for(i = 0; i < RTL2840_INIT_SPEC_REG_0_TABLE_LEN; i++) ++ { ++ // Get all information from each specific register 0 initializing entry. ++ SpecReg0Sel = InitSpecReg0Table[i].SpecReg0Sel; ++ pSpecReg0ValueTable = InitSpecReg0Table[i].SpecReg0ValueTable; ++ ++ // Set specific register 0 selection. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_SEL, SpecReg0Sel) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 values. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, RTL2840_SPEC_REG_0_VAL_START_ADDR, pSpecReg0ValueTable, LEN_11_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Initialize demod registers according to the TS interface initializing table. ++ for(i = 0; i < RTL2840_TS_INTERFACE_INIT_TABLE_LEN; i++) ++ { ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, TsInterfaceInitTable[i].RegBitName, ++ TsInterfaceInitTable[i].WritingValue[TsInterfaceMode]) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Backup SPEC_INIT_A2 value. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_SPEC_INIT_A2, &QamSpecInitA2Backup)!= FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // Set SPEC_INIT_A2 with 0. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_SPEC_INIT_A2, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Get SPEC_MONITER_INIT_0 several times. ++ // If all SPEC_MONITER_INIT_0 getting values are the same, set SPEC_INIT_A1 with 0. ++ // Note: 1. Need to set SPEC_INIT_A2 with 0 when get SPEC_MONITER_INIT_0. ++ // 2. The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_SPEC_MONITER_INIT_0, &RegValueComparison) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ for(i = 0, AreAllValueEqual = YES; i < RTL2840_SPEC_MONITOR_INIT_0_COMPARISON_TIMES; i++) ++ { ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_SPEC_MONITER_INIT_0, &RegValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ if(RegValue != RegValueComparison) ++ { ++ AreAllValueEqual = NO; ++ ++ break; ++ } ++ } ++ ++ if(AreAllValueEqual == YES) ++ { ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_SPEC_INIT_A1, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ // Restore SPEC_INIT_A2 value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_SPEC_INIT_A2, QamSpecInitA2Backup) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_QAM_MODE ++ ++*/ ++int ++rtl2840_SetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int QamMode ++ ) ++{ ++ typedef struct ++ { ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue[QAM_QAM_MODE_NUM]; ++ } ++ QAM_MODE_REG_ENTRY; ++ ++ ++ typedef struct ++ { ++ unsigned char SpecReg0Sel; ++ unsigned char SpecReg0ValueTable[QAM_QAM_MODE_NUM][RTL2840_SPEC_REG_0_VALUE_TABLE_LEN]; ++ } ++ QAM_MODE_SPEC_REG_0_ENTRY; ++ ++ ++ ++ static const QAM_MODE_REG_ENTRY QamModeRegTable[RTL2840_QAM_MODE_REG_TABLE_LEN] = ++ { ++ // Reg, WritingValue according to QAM mode ++ // PageNo, StartAddr, Msb, Lsb, {4-Q, 16-Q, 32-Q, 64-Q, 128-Q, 256-Q, 512-Q, 1024-Q} ++ {1, 0x02, 2, 0, {0x7, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 }}, ++ {1, 0x05, 7, 0, {0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b }}, ++ {1, 0x2f, 15, 5, {0x37, 0x82, 0xb9, 0x10e, 0x177, 0x21c, 0x2ee, 0x451 }}, ++ {1, 0x31, 5, 0, {0x1, 0x3, 0x4, 0x5, 0x8, 0xa, 0xf, 0x14 }}, ++ {1, 0x2e, 5, 0, {0x2, 0x4, 0x6, 0x8, 0xc, 0x10, 0x18, 0x20 }}, ++ {1, 0x18, 7, 0, {0x0, 0xdb, 0x79, 0x0, 0x8a, 0x0, 0x8c, 0x0 }}, ++ {1, 0x19, 4, 0, {0x14, 0x14, 0xf, 0x14, 0xf, 0x14, 0xf, 0x14 }}, ++ {1, 0x3b, 2, 0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3b, 5, 3, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3c, 2, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3c, 4, 3, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3c, 6, 5, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 1, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 3, 2, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3d, 5, 4, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 7, 6, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x40, 2, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x40, 5, 3, {0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x3, 0x3 }}, ++ {1, 0x41, 2, 0, {0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x4 }}, ++ {1, 0x41, 4, 3, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }}, ++ {1, 0x41, 6, 5, {0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }}, ++ {1, 0x42, 1, 0, {0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }}, ++ {1, 0x42, 3, 2, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }}, ++ {1, 0x42, 5, 4, {0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }}, ++ {1, 0x42, 7, 6, {0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }}, ++ }; ++ ++ ++ static const QAM_MODE_SPEC_REG_0_ENTRY QamModeSpecReg0Table[RTL2840_QAM_MODE_SPEC_REG_0_TABLE_LEN] = ++ { ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {9, { {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 4-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 16-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 32-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 64-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 128-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 256-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 512-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, } // 1024-QAM ++ }, ++ ++ ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {10, { {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 4-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 16-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 32-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 64-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 128-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 256-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 512-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, } // 1024-QAM ++ }, ++ ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {12, { {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 4-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 16-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 32-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 64-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 128-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 256-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 512-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, } // 1024-QAM ++ }, ++ }; ++ ++ ++ int i; ++ ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ ++ unsigned char SpecReg0Sel; ++ const unsigned char *pSpecReg0ValueTable; ++ ++ ++ ++ // Set demod QAM mode with QAM mode register setting table. ++ for(i = 0; i < RTL2840_QAM_MODE_REG_TABLE_LEN; i++) ++ { ++ // Get all information from each register setting entry according to QAM mode. ++ PageNo = QamModeRegTable[i].PageNo; ++ RegStartAddr = QamModeRegTable[i].RegStartAddr; ++ Msb = QamModeRegTable[i].Msb; ++ Lsb = QamModeRegTable[i].Lsb; ++ WritingValue = QamModeRegTable[i].WritingValue[QamMode]; ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set register page number with inner page number for QAM mode specific register 0 setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set demod QAM mode with QAM mode specific register 0 setting table. ++ for(i = 0; i < RTL2840_QAM_MODE_SPEC_REG_0_TABLE_LEN; i++) ++ { ++ // Get all information from each specific register 0 setting entry according to QAM mode. ++ SpecReg0Sel = QamModeSpecReg0Table[i].SpecReg0Sel; ++ pSpecReg0ValueTable = QamModeSpecReg0Table[i].SpecReg0ValueTable[QamMode]; ++ ++ // Set specific register 0 selection. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_SEL, SpecReg0Sel) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 values. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, RTL2840_SPEC_REG_0_VAL_START_ADDR, pSpecReg0ValueTable, LEN_11_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set demod QAM mode parameter. ++ pDemod->QamMode = QamMode; ++ pDemod->IsQamModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_SYMBOL_RATE_HZ ++ ++*/ ++int ++rtl2840_SetSymbolRateHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long SymbolRateHz ++ ) ++{ ++ typedef struct ++ { ++ unsigned long TrDeciRatioRangeMin; ++ unsigned char SymbolRateReg0; ++ unsigned long SymbolRateValue[RTL2840_SYMBOL_RATE_VALUE_TABLE_LEN]; ++ } ++ SYMBOL_RATE_ENTRY; ++ ++ ++ ++ static const SYMBOL_RATE_ENTRY SymbolRateTable[RTL2840_SYMBOL_RATE_TABLE_LEN] = ++ { ++ // TrDeciRatioRangeMin, SymbolRateReg0, {SymbolRateValue } ++ {0x1a0000, 0x4, {10, 14, 1, 988, 955, 977, 68, 257, 438} }, ++ {0x160000, 0x5, {2, 15, 19, 1017, 967, 950, 12, 208, 420} }, ++ {0x0, 0x6, {1019, 1017, 9, 29, 3, 957, 956, 105, 377} }, ++ }; ++ ++ ++ int i; ++ ++ unsigned long CrystalFreqHz; ++ const SYMBOL_RATE_ENTRY *pSymbolRateEntry; ++ ++ MPI MpiCrystalFreqHz, MpiSymbolRateHz, MpiConst, MpiVar, MpiNone; ++ ++ unsigned long TrDeciRatio; ++ unsigned char SymbolRateReg0; ++ unsigned long SymbolRateValue; ++ ++ ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Calculate TR_DECI_RATIO value. ++ // Note: Original formula: TR_DECI_RATIO = round( (CrystalFreqHz * pow(2, 18)) / SymbolRateHz ) ++ // Adjusted formula: TR_DECI_RATIO = floor( ((CrystalFreqHz << 19) / SymbolRateHz + 1) >> 1 ) ++ MpiSetValue(&MpiCrystalFreqHz, CrystalFreqHz); ++ MpiSetValue(&MpiSymbolRateHz, SymbolRateHz); ++ MpiSetValue(&MpiConst, 1); ++ ++ MpiLeftShift(&MpiVar, MpiCrystalFreqHz, 19); ++ MpiDiv(&MpiVar, &MpiNone, MpiVar, MpiSymbolRateHz); ++ MpiAdd(&MpiVar, MpiVar, MpiConst); ++ MpiRightShift(&MpiVar, MpiVar, 1); ++ ++ MpiGetValue(MpiVar, (long *)&TrDeciRatio); ++ ++ ++ // Determine symbol rate entry according to TR_DECI_RATIO value and minimum of TR_DECI_RATIO range. ++ for(i = 0; i < RTL2840_SYMBOL_RATE_TABLE_LEN; i++) ++ { ++ if(TrDeciRatio >= SymbolRateTable[i].TrDeciRatioRangeMin) ++ { ++ pSymbolRateEntry = &SymbolRateTable[i]; ++ ++ break; ++ } ++ } ++ ++ ++ // Set register page number with inner page number for symbol rate setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set TR_DECI_RATIO with calculated value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_TR_DECI_RATIO, TrDeciRatio) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set SPEC_SYMBOL_RATE_REG_0 value with determined symbol rate entry. ++ SymbolRateReg0 = pSymbolRateEntry->SymbolRateReg0; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_SYMBOL_RATE_REG_0, SymbolRateReg0) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set symbol rate value with determined symbol rate entry. ++ for(i = 0; i < RTL2840_SYMBOL_RATE_VALUE_TABLE_LEN; i++) ++ { ++ // Get symbol rate value. ++ SymbolRateValue = pSymbolRateEntry->SymbolRateValue[i]; ++ ++ // Set symbol rate register selection. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_SYMBOL_RATE_SEL, i) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set symbol rate register value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_SYMBOL_RATE_VAL, SymbolRateValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set symbol rate register strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_SYMBOL_RATE_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set demod symbol rate parameter. ++ pDemod->SymbolRateHz = SymbolRateHz; ++ pDemod->IsSymbolRateHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_ALPHA_MODE ++ ++*/ ++int ++rtl2840_SetAlphaMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int AlphaMode ++ ) ++{ ++ static const unsigned long AlphaValueTable[QAM_ALPHA_MODE_NUM][RTL2840_ALPHA_VALUE_TABLE_LEN] = ++ { ++ {258, 94, 156, 517, 6, 1015, 1016, 17, 11, 994, 1011, 51, 15, 926, 1008, 313}, // alpha = 0.12 ++ {258, 31, 28, 3, 6, 1016, 1016, 16, 11, 996, 1010, 50, 16, 927, 1007, 312}, // alpha = 0.13 ++ {131, 257, 27, 2, 8, 1017, 1013, 16, 14, 996, 1008, 50, 18, 927, 1004, 310}, // alpha = 0.15 ++ {0, 195, 30, 30, 6, 1022, 1014, 10, 14, 1002, 1006, 45, 21, 931, 1001, 307}, // alpha = 0.18 ++ {415, 68, 31, 29, 4, 1, 1016, 6, 13, 1006, 1006, 41, 23, 934, 998, 304}, // alpha = 0.20 ++ }; ++ ++ ++ int i; ++ unsigned long AlphaValue; ++ ++ ++ ++ // Set register page number with inner page number for alpha value setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set demod alpha mode with alpha value table. ++ for(i = 0; i < RTL2840_ALPHA_VALUE_TABLE_LEN; i++) ++ { ++ // Get alpha value from alpha value entry according to alpha mode. ++ AlphaValue = AlphaValueTable[AlphaMode][i]; ++ ++ // Set alpha register selection. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_ALPHA_SEL, i) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set alpha register value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_ALPHA_VAL, AlphaValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set alpha register strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_ALPHA_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set demod alpha mode parameter. ++ pDemod->AlphaMode = AlphaMode; ++ pDemod->IsAlphaModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_IF_FREQ_HZ ++ ++*/ ++int ++rtl2840_SetIfFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ) ++{ ++ unsigned long CrystalFreqHz; ++ unsigned long DdcFreq; ++ ++ MPI MpiIfFreqHz, MpiCrystalFreqHz, MpiConst, MpiVar, MpiNone; ++ ++ ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Calculate DDC_FREQ value. ++ // Note: Original formula: DDC_FREQ = round( (CrystalFreqHz - (IfFreqHz % CrystalFreqHz)) * pow(2, 15) / ++ // CrystalFreqHz ) ++ // Adjusted formula: DDC_FREQ = floor( ( ((CrystalFreqHz - (IfFreqHz % CrystalFreqHz)) << 16) / ++ // CrystalFreqHz + 1 ) >> 1) ++ MpiSetValue(&MpiIfFreqHz, IfFreqHz); ++ MpiSetValue(&MpiCrystalFreqHz, CrystalFreqHz); ++ MpiSetValue(&MpiConst, 1); ++ ++ MpiSetValue(&MpiVar, CrystalFreqHz - (IfFreqHz % CrystalFreqHz)); ++ MpiLeftShift(&MpiVar, MpiVar, 16); ++ MpiDiv(&MpiVar, &MpiNone, MpiVar, MpiCrystalFreqHz); ++ MpiAdd(&MpiVar, MpiVar, MpiConst); ++ MpiRightShift(&MpiVar, MpiVar, 1); ++ ++ MpiGetValue(MpiVar, (long *)&DdcFreq); ++ ++ ++ // Set DDC_FREQ with calculated value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_DDC_FREQ, DdcFreq) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set demod IF frequnecy parameter. ++ pDemod->IfFreqHz = IfFreqHz; ++ pDemod->IsIfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_SPECTRUM_MODE ++ ++*/ ++int ++rtl2840_SetSpectrumMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ) ++{ ++ static const char SpecInvValueTable[SPECTRUM_MODE_NUM] = ++ { ++ // SpecInv ++ 0, // Normal spectrum ++ 1, // Inverse spectrum ++ }; ++ ++ ++ unsigned long SpecInv; ++ ++ ++ ++ // Get SPEC_INV value from spectrum inverse value table according to spectrum mode. ++ SpecInv = SpecInvValueTable[SpectrumMode]; ++ ++ ++ // Set SPEC_INV with gotten value. ++ // Note: Use SetRegBitsWithPage() to set register bits with page setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_SPEC_INV, SpecInv) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set demod spectrum mode parameter. ++ pDemod->SpectrumMode = SpectrumMode; ++ pDemod->IsSpectrumModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_RF_AGC ++ ++*/ ++int ++rtl2840_GetRfAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ) ++{ ++ unsigned long RfAgcBinary; ++ ++ ++ // Get RF AGC binary value from RF_AGC_VALUE monitor register bits. ++ // Note: The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_RF_AGC_VALUE, &RfAgcBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Convert RF AGC binary value to signed integer. ++ *pRfAgc = BinToSignedInt(RfAgcBinary, RTL2840_RF_AGC_VALUE_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_IF_AGC ++ ++*/ ++int ++rtl2840_GetIfAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ) ++{ ++ unsigned long IfAgcBinary; ++ ++ ++ // Get IF AGC binary value from IF_AGC_VALUE monitor register bits. ++ // Note: The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_IF_AGC_VALUE, &IfAgcBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Convert IF AGC binary value to signed integer. ++ *pIfAgc = BinToSignedInt(IfAgcBinary, RTL2840_IF_AGC_VALUE_BIT_NUM); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_DI_AGC ++ ++*/ ++int ++rtl2840_GetDiAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ) ++{ ++ // Get digital AGC value from DAGC_VALUE monitor register bits. ++ // Note: The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_DAGC_VALUE, pDiAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++rtl2840_GetTrOffsetPpm( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ) ++{ ++ unsigned long SymbolRateHz; ++ unsigned long CrystalFreqHz; ++ ++ unsigned long TrOffsetBinary; ++ long TrOffsetInt; ++ ++ MPI MpiTrOffsetInt, MpiSymbolRateHz, MpiCrystalFreqHz, MpiVar0, MpiVar1; ++ ++ ++ ++ // Get demod symbol rate in Hz. ++ if(pDemod->GetSymbolRateHz(pDemod, &SymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_symbol_rate; ++ ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Get TR offset binary value from TR_OFFSET monitor register bits. ++ // Note: The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_TR_OFFSET, &TrOffsetBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Convert TR offset binary value to signed integer. ++ TrOffsetInt = BinToSignedInt(TrOffsetBinary, RTL2840_TR_OFFSET_BIT_NUM); ++ ++ ++ // Get TR offset in ppm. ++ // Note: (TR offset in ppm) = ((TR offset integer) * (symbol rate in Hz) * 1000000) / ++ // ((pow(2, 35) * (crystal frequency in Hz)) ++ // TR offset integer is 31 bit value. ++ MpiSetValue(&MpiTrOffsetInt, TrOffsetInt); ++ MpiSetValue(&MpiSymbolRateHz, (long)SymbolRateHz); ++ MpiSetValue(&MpiCrystalFreqHz, (long)CrystalFreqHz); ++ MpiSetValue(&MpiVar0, 1000000); ++ ++ MpiMul(&MpiVar0, MpiVar0, MpiTrOffsetInt); ++ MpiMul(&MpiVar0, MpiVar0, MpiSymbolRateHz); ++ MpiLeftShift(&MpiVar1, MpiCrystalFreqHz, 35); ++ MpiDiv(&MpiVar0, &MpiVar1, MpiVar0, MpiVar1); ++ ++ MpiGetValue(MpiVar0, pTrOffsetPpm); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_get_demod_symbol_rate: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++rtl2840_GetCrOffsetHz( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ) ++{ ++ unsigned long SymbolRateHz; ++ ++ unsigned long CrOffsetBinary; ++ long CrOffsetInt; ++ ++ MPI MpiCrOffsetInt, MpiSymbolRateHz, MpiMiddleResult; ++ ++ ++ ++ // Get demod symbol rate in Hz. ++ if(pDemod->GetSymbolRateHz(pDemod, &SymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_symbol_rate; ++ ++ ++ // Get CR offset binary value from CR_OFFSET monitor register bits. ++ // Note: The function rtl2840_GetMonitorRegBits() will set register page automatically. ++ if(rtl2840_GetMonitorRegBits(pDemod, QAM_CR_OFFSET, &CrOffsetBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Convert CR offset binary value to signed integer. ++ CrOffsetInt = BinToSignedInt(CrOffsetBinary, RTL2840_CR_OFFSET_BIT_NUM); ++ ++ ++ // Get CR offset in Hz. ++ // Note: (CR offset in Hz) = (CR offset integer) * (symbol rate in Hz) / pow(2, 34) ++ // CR offset integer is 32 bit value. ++ MpiSetValue(&MpiCrOffsetInt, CrOffsetInt); ++ MpiSetValue(&MpiSymbolRateHz, (long)SymbolRateHz); ++ ++ MpiMul(&MpiMiddleResult, MpiCrOffsetInt, MpiSymbolRateHz); ++ MpiRightShift(&MpiMiddleResult, MpiMiddleResult, 34); ++ ++ MpiGetValue(MpiMiddleResult, pCrOffsetHz); ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_get_demod_symbol_rate: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_IS_AAGC_LOCKED ++ ++*/ ++int ++rtl2840_IsAagcLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long LockStatus; ++ ++ ++ ++ // Get AAGC lock status from AAGC_LD inner strobe register bits. ++ // Note: The function rtl2840_GetInnerStrobeRegBits() will set register page automatically. ++ if(rtl2840_GetInnerStrobeRegBits(pDemod, QAM_AAGC_LD, &LockStatus) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Determine answer according to AAGC lock status. ++ if(LockStatus == LOCKED) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_IS_EQ_LOCKED ++ ++*/ ++int ++rtl2840_IsEqLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long LockStatus; ++ ++ ++ ++ // Get EQ lock status from EQ_LD inner strobe register bits. ++ // Note: The function rtl2840_GetInnerStrobeRegBits() will set register page automatically. ++ if(rtl2840_GetInnerStrobeRegBits(pDemod, QAM_EQ_LD, &LockStatus) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Determine answer according to EQ lock status. ++ if(LockStatus == LOCKED) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_IS_FRAME_LOCKED ++ ++*/ ++int ++rtl2840_IsFrameLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ) ++{ ++ unsigned long LossStatus; ++ ++ ++ ++ // Get frame loss status from SYNCLOST register bits. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_SYNCLOST, &LossStatus) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Determine answer according to frame loss status. ++ if(LossStatus == NOT_LOST) ++ *pAnswer = YES; ++ else ++ *pAnswer = NO; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_ERROR_RATE ++ ++*/ ++int ++rtl2840_GetErrorRate( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i; ++ unsigned long TestPacketNum; ++ unsigned int WaitCnt; ++ int FrameLock; ++ unsigned long BerReg2, BerReg2Msb, BerReg2Lsb; ++ unsigned long BerReg0, BerReg1; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Calculate test packet number and wait counter value. ++ TestPacketNum = 0x1 << (TestVolume * 2 + 4); ++ WaitCnt = WaitTimeMsMax / RTL2840_BER_WAIT_TIME_MS; ++ ++ ++ // Set TEST_VOLUME with test volume. ++ // Note: The function SetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_TEST_VOLUME, TestVolume) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Clear and enable error counter. ++ // Note: The function SetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_BERT_EN, OFF) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_BERT_EN, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Check if error test is finished. ++ for(i = 0; i < WaitCnt; i++) ++ { ++ // Check if demod is frame-locked. ++ if(pDemod->IsFrameLocked(pDemod, &FrameLock) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ if(FrameLock == NO) ++ goto error_status_frame_lock; ++ ++ ++ // Wait a minute. ++ // Note: The input unit of WaitMs() is ms. ++ pBaseInterface->WaitMs(pBaseInterface, RTL2840_BER_WAIT_TIME_MS); ++ ++ ++ // Set error counter strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ // The function SetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_BER_RD_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Check if error test is finished. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_BER_REG2_15_0, &BerReg2Lsb) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_BER_REG2_18_16, &BerReg2Msb) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ BerReg2 = (BerReg2Msb << RTL2840_BER_REG2_MSB_SHIFT) | BerReg2Lsb; ++ ++ if(BerReg2 == TestPacketNum) ++ break; ++ } ++ ++ ++ // Check time-out status. ++ if(i == WaitCnt) ++ goto error_status_time_out; ++ ++ ++ // Get BER register 0 from BER_REG0. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_BER_REG0, &BerReg0) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Get BER register 1 from BER_REG1. ++ // Note: The function GetRegBitsWithPage() will set register page automatically. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBitsWithPage(pDemod, QAM_BER_REG1, &BerReg1) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Set BER numerator and denominator. ++ *pBerNum = 27 * BerReg0 + BerReg1; ++ *pBerDen = 1632 * TestPacketNum; ++ ++ ++ // Set PER numerator and denominator. ++ *pPerNum = BerReg0; ++ *pPerDen = TestPacketNum; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++error_status_frame_lock: ++error_status_time_out: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_SNR_DB ++ ++*/ ++int ++rtl2840_GetSnrDb( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ static const unsigned long SnrConstTable[QAM_QAM_MODE_NUM] = ++ { ++ 26880, // for 4-QAM mode ++ 29852, // for 16-QAM mode ++ 31132, // for 32-QAM mode ++ 32502, // for 64-QAM mode ++ 33738, // for 128-QAM mode ++ 35084, // for 256-QAM mode ++ 36298, // for 512-QAM mode ++ 37649, // for 1024-QAM mode ++ }; ++ ++ int QamMode; ++ ++ unsigned long Mse; ++ long MiddleResult; ++ MPI MpiMse, MpiResult; ++ ++ ++ ++ // Get demod QAM mode. ++ if(pDemod->GetQamMode(pDemod, &QamMode) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_qam_mode; ++ ++ ++ // Get mean-square error from MSE. ++ // Note: The function rtl2840_GetInnerStrobeRegBits() will set register page automatically. ++ if(rtl2840_GetInnerStrobeRegBits(pDemod, QAM_MSE, &Mse) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Calculate SNR dB numerator. ++ MpiSetValue(&MpiMse, Mse); ++ MpiLog2(&MpiResult, MpiMse, RTL2840_SNR_FRAC_BIT_NUM); ++ MpiGetValue(MpiResult, &MiddleResult); ++ ++ *pSnrDbNum = SnrConstTable[QamMode] - 10 * MiddleResult; ++ ++ ++ // Set SNR dB denominator. ++ *pSnrDbDen = RTL2840_SNR_DB_DEN; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_get_demod_qam_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++rtl2840_GetSignalStrength( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ) ++{ ++ int FrameLock; ++ long IfAgcValue; ++ ++ ++ ++ // Get demod frame lock status. ++ if(pDemod->IsFrameLocked(pDemod, &FrameLock) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // If demod is not frame-locked, set signal strength with zero. ++ if(FrameLock == NO) ++ { ++ *pSignalStrength = 0; ++ goto success_status_non_frame_lock; ++ } ++ ++ ++ // Get IF AGC value. ++ if(pDemod->GetIfAgc(pDemod, &IfAgcValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Determine signal strength according to IF AGC value. ++ // Note: Map IF AGC value (1023 ~ -1024) to signal strength (0 ~ 100). ++ *pSignalStrength = (102300 - IfAgcValue * 100) / 2047; ++ ++ ++success_status_non_frame_lock: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++rtl2840_GetSignalQuality( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ) ++{ ++ int FrameLock; ++ ++ unsigned long Mse; ++ long MiddleResult; ++ MPI MpiMse, MpiResult; ++ ++ ++ ++ // Get demod frame lock status. ++ if(pDemod->IsFrameLocked(pDemod, &FrameLock) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // If demod is not frame-locked, set signal quality with zero. ++ if(FrameLock == NO) ++ { ++ *pSignalQuality = 0; ++ goto success_status_non_frame_lock; ++ } ++ ++ ++ // Get mean-square error from MSE. ++ // Note: The function rtl2840_GetInnerStrobeRegBits() will set register page automatically. ++ if(rtl2840_GetInnerStrobeRegBits(pDemod, QAM_MSE, &Mse) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Determine signal quality according to MSE value. ++ // Note: Map MSE value (pow(2, 19) ~ pow(2, 17)) to signal quality (0 ~ 100). ++ // If MSE value < pow(2, 17), signal quality is 100. ++ // If MSE value > pow(2, 19), signal quality is 0. ++ if(Mse > 524288) ++ { ++ *pSignalQuality = 0; ++ } ++ else if(Mse < 131072) ++ { ++ *pSignalQuality = 100; ++ } ++ else ++ { ++ MpiSetValue(&MpiMse, Mse); ++ MpiLog2(&MpiResult, MpiMse, RTL2840_SIGNAL_QUALITY_FRAC_BIT_NUM); ++ MpiGetValue(MpiResult, &MiddleResult); ++ ++ *pSignalQuality = (243200 - MiddleResult * 100) / 256; ++ } ++ ++ ++success_status_non_frame_lock: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2840_UpdateFunction( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ // RTL2840 does not use UpdateFunction(), so we just return FUNCTION_SUCCESS. ++ return FUNCTION_SUCCESS; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_RESET_FUNCTION ++ ++*/ ++int ++rtl2840_ResetFunction( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ // RTL2840 does not use UpdateFunction(), so we just return FUNCTION_SUCCESS. ++ return FUNCTION_SUCCESS; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_QAM_MODE ++ ++*/ ++int ++rtl2840_am_hum_en_SetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int QamMode ++ ) ++{ ++ typedef struct ++ { ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue[QAM_QAM_MODE_NUM]; ++ } ++ QAM_MODE_REG_ENTRY; ++ ++ ++ typedef struct ++ { ++ unsigned char SpecReg0Sel; ++ unsigned char SpecReg0ValueTable[QAM_QAM_MODE_NUM][RTL2840_SPEC_REG_0_VALUE_TABLE_LEN]; ++ } ++ QAM_MODE_SPEC_REG_0_ENTRY; ++ ++ ++ ++ static const QAM_MODE_REG_ENTRY QamModeRegTable[RTL2840_QAM_MODE_REG_TABLE_LEN] = ++ { ++ // Reg, WritingValue according to QAM mode ++ // PageNo, StartAddr, Msb, Lsb, {4-Q, 16-Q, 32-Q, 64-Q, 128-Q, 256-Q, 512-Q, 1024-Q} ++ {1, 0x02, 2, 0, {0x7, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 }}, ++ {1, 0x2f, 15, 5, {0x37, 0x82, 0xb9, 0x10e, 0x177, 0x21c, 0x2ee, 0x451 }}, ++ {1, 0x31, 5, 0, {0x1, 0x3, 0x4, 0x5, 0x8, 0xa, 0xf, 0x14 }}, ++ {1, 0x2e, 5, 0, {0x2, 0x4, 0x6, 0x8, 0xc, 0x10, 0x18, 0x20 }}, ++ {1, 0x18, 7, 0, {0x0, 0xdb, 0x79, 0x0, 0x8a, 0x0, 0x8c, 0x0 }}, ++ {1, 0x19, 4, 0, {0x14, 0x14, 0xf, 0x14, 0xf, 0x14, 0xf, 0x14 }}, ++ {1, 0x3b, 2, 0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3b, 5, 3, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3c, 2, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3c, 4, 3, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3c, 6, 5, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 1, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 3, 2, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1 }}, ++ {1, 0x3d, 5, 4, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x3d, 7, 6, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x41, 4, 3, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }}, ++ {1, 0x41, 6, 5, {0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }}, ++ {1, 0x42, 1, 0, {0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }}, ++ {1, 0x42, 3, 2, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }}, ++ {1, 0x42, 5, 4, {0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }}, ++ {1, 0x42, 7, 6, {0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }}, ++ ++ ++ // For AM-hum enhancement ++ // Reg, WritingValue according to QAM mode ++ // PageNo, StartAddr, Msb, Lsb, {4-Q, 16-Q, 32-Q, 64-Q, 128-Q, 256-Q, 512-Q, 1024-Q} ++ {1, 0x05, 7, 0, {0x64, 0x64, 0x64, 0x64, 0x6b, 0x6b, 0x6b, 0x6b }}, ++ {1, 0x40, 2, 0, {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2 }}, ++ {1, 0x40, 5, 3, {0x1, 0x1, 0x1, 0x1, 0x2, 0x2, 0x3, 0x3 }}, ++ {1, 0x41, 2, 0, {0x0, 0x0, 0x0, 0x0, 0x3, 0x3, 0x4, 0x4 }}, ++ }; ++ ++ ++ static const QAM_MODE_SPEC_REG_0_ENTRY QamModeSpecReg0Table[RTL2840_QAM_MODE_SPEC_REG_0_TABLE_LEN] = ++ { ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {9, { {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 4-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 16-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 32-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 64-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 128-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, // 256-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x10, 0x70, 0x80, 0xfa, 0xcb, 0x00}, // 512-QAM ++ {0x99, 0xa9, 0xc9, 0x4e, 0x48, 0x20, 0x71, 0x80, 0xfa, 0xcb, 0x00}, } // 1024-QAM ++ }, ++ ++ ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {10, { {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 4-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 16-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 32-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 64-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 128-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x20, 0x71, 0xa0, 0xfa, 0xcb, 0x00}, // 256-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, // 512-QAM ++ {0xaa, 0xbb, 0xee, 0x5e, 0x48, 0x10, 0x70, 0xa0, 0xfa, 0xcb, 0x00}, } // 1024-QAM ++ }, ++ ++ ++ ++ // For AM-hum enhancement ++ // SpecReg0Sel, {SpecReg0ValueTable } QAM mode ++ {12, { {0xc8, 0xcc, 0x40, 0x7e, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 4-QAM ++ {0xc8, 0xcc, 0x40, 0x7e, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 16-QAM ++ {0xc8, 0xcc, 0x40, 0x7e, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 32-QAM ++ {0xc8, 0xcc, 0x40, 0x7e, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 64-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 128-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 256-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, // 512-QAM ++ {0xc8, 0xcc, 0x00, 0x7f, 0x28, 0xda, 0x4b, 0xa0, 0xfe, 0xcd, 0x01}, } // 1024-QAM ++ }, ++ }; ++ ++ ++ int i; ++ ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ unsigned long WritingValue; ++ ++ unsigned char SpecReg0Sel; ++ const unsigned char *pSpecReg0ValueTable; ++ ++ ++ ++ // Set demod QAM mode with QAM mode register setting table. ++ for(i = 0; i < RTL2840_QAM_MODE_REG_TABLE_LEN; i++) ++ { ++ // Get all information from each register setting entry according to QAM mode. ++ PageNo = QamModeRegTable[i].PageNo; ++ RegStartAddr = QamModeRegTable[i].RegStartAddr; ++ Msb = QamModeRegTable[i].Msb; ++ Lsb = QamModeRegTable[i].Lsb; ++ WritingValue = QamModeRegTable[i].WritingValue[QamMode]; ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set register page number with inner page number for QAM mode specific register 0 setting. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set demod QAM mode with QAM mode specific register 0 setting table. ++ for(i = 0; i < RTL2840_QAM_MODE_SPEC_REG_0_TABLE_LEN; i++) ++ { ++ // Get all information from each specific register 0 setting entry according to QAM mode. ++ SpecReg0Sel = QamModeSpecReg0Table[i].SpecReg0Sel; ++ pSpecReg0ValueTable = QamModeSpecReg0Table[i].SpecReg0ValueTable[QamMode]; ++ ++ // Set specific register 0 selection. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_SEL, SpecReg0Sel) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 values. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, RTL2840_SPEC_REG_0_VAL_START_ADDR, pSpecReg0ValueTable, LEN_11_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // Set specific register 0 strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_SPEC_REG_0_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set demod QAM mode parameter. ++ pDemod->QamMode = QamMode; ++ pDemod->IsQamModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD ++ ++*/ ++int ++rtl2840_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module and tuner device address. ++ pDemod = (QAM_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Enable demod I2C relay. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_OPT_I2C_RELAY, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Send I2C reading command. ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_reading_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_reading_command: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD ++ ++*/ ++int ++rtl2840_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get demod module and tuner device address. ++ pDemod = (QAM_DEMOD_MODULE *)pI2cBridge->pPrivateData; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Enable demod I2C relay. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_OPT_I2C_RELAY, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Send I2C writing command. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, pWritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_send_i2c_writing_command; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_send_i2c_writing_command: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Initialize base register table ++ ++RTL2840 builder will use rtl2840_InitBaseRegTable() to initialize base register table. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@see BuildRtl2840Module() ++ ++*/ ++void ++rtl2840_InitBaseRegTable( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ static const QAM_PRIMARY_BASE_REG_ENTRY_ADDR_8BIT PrimaryBaseRegTable[RTL2840_BASE_REG_TABLE_LEN] = ++ { ++ // Generality ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_SYS_VERSION, 0, 0x01, 7, 0 }, ++ {QAM_OPT_I2C_RELAY, 0, 0x03, 5, 5 }, ++ {QAM_SOFT_RESET, 0, 0x09, 0, 0 }, ++ ++ // Miscellany ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_OPT_I2C_DRIVE_CURRENT, 0, 0x07, 7, 7 }, ++ {QAM_GPIO2_OEN, 0, 0x05, 6, 6 }, ++ {QAM_GPIO3_OEN, 0, 0x05, 7, 7 }, ++ {QAM_GPIO2_O, 0, 0x0a, 2, 2 }, ++ {QAM_GPIO3_O, 0, 0x0a, 3, 3 }, ++ {QAM_GPIO2_I, 0, 0x0a, 6, 6 }, ++ {QAM_GPIO3_I, 0, 0x0a, 7, 7 }, ++ {QAM_INNER_DATA_STROBE, 1, 0x69, 0, 0 }, ++ {QAM_INNER_DATA_SEL1, 1, 0x48, 7, 0 }, ++ {QAM_INNER_DATA_SEL2, 1, 0x49, 7, 0 }, ++ {QAM_INNER_DATA1, 1, 0x6a, 15, 0 }, ++ {QAM_INNER_DATA2, 1, 0x6c, 15, 0 }, ++ ++ // QAM mode ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_QAM_MODE, 1, 0x02, 2, 0 }, ++ ++ // AD ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_AD_AV, 0, 0x0b, 2, 0 }, ++ ++ // AAGC ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_OPT_RF_AAGC_DRIVE_CURRENT, 0, 0x07, 0, 0 }, ++ {QAM_OPT_IF_AAGC_DRIVE_CURRENT, 0, 0x07, 1, 1 }, ++ {QAM_OPT_RF_AAGC_DRIVE, 0, 0x04, 3, 3 }, ++ {QAM_OPT_IF_AAGC_DRIVE, 0, 0x04, 4, 4 }, ++ {QAM_OPT_RF_AAGC_OEN, 0, 0x04, 6, 6 }, ++ {QAM_OPT_IF_AAGC_OEN, 0, 0x04, 7, 7 }, ++ {QAM_PAR_RF_SD_IB, 0, 0x03, 0, 0 }, ++ {QAM_PAR_IF_SD_IB, 0, 0x03, 1, 1 }, ++ {QAM_AAGC_FZ_OPTION, 1, 0x04, 5, 4 }, ++ {QAM_AAGC_TARGET, 1, 0x05, 7, 0 }, ++ {QAM_RF_AAGC_MAX, 1, 0x06, 7, 0 }, ++ {QAM_RF_AAGC_MIN, 1, 0x07, 7, 0 }, ++ {QAM_IF_AAGC_MAX, 1, 0x08, 7, 0 }, ++ {QAM_IF_AAGC_MIN, 1, 0x09, 7, 0 }, ++ {QAM_VTOP, 1, 0x0b, 7, 0 }, ++ {QAM_KRF_MSB, 1, 0x0c, 6, 3 }, ++ {QAM_KRF_LSB, 1, 0x04, 7, 6 }, ++ {QAM_AAGC_MODE_SEL, 1, 0x0c, 7, 7 }, ++ {QAM_AAGC_LD, 1, 0x72, 0, 0 }, ++ {QAM_AAGC_INIT_LEVEL, 1, 0x0a, 7, 0 }, ++ ++ // DDC ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_DDC_FREQ, 1, 0x0d, 14, 0 }, ++ {QAM_SPEC_INV, 1, 0x0e, 7, 7 }, ++ ++ // Timing recovery ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_TR_DECI_RATIO, 1, 0x1f, 23, 0 }, ++ ++ // Carrier recovery ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_CR_LD, 1, 0x74, 5, 0 }, ++ ++ // Equalizer ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_EQ_LD, 1, 0x72, 1, 1 }, ++ {QAM_MSE, 1, 0x76, 21, 0 }, ++ ++ // Frame sync. indicator ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_SYNCLOST, 2, 0x02, 7, 7 }, ++ ++ // BER ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_BER_RD_STROBE, 2, 0x05, 7, 7 }, ++ {QAM_BERT_EN, 2, 0x06, 0, 0 }, ++ {QAM_BERT_HOLD, 2, 0x06, 1, 1 }, ++ {QAM_DIS_AUTO_MODE, 2, 0x06, 2, 2 }, ++ {QAM_TEST_VOLUME, 2, 0x06, 5, 3 }, ++ {QAM_BER_REG0, 2, 0x0e, 15, 0 }, ++ {QAM_BER_REG1, 2, 0x07, 20, 0 }, ++ {QAM_BER_REG2_15_0, 2, 0x0a, 15, 0 }, ++ {QAM_BER_REG2_18_16, 2, 0x09, 7, 5 }, ++ ++ // MPEG TS output interface ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_CKOUTPAR, 2, 0x11, 0, 0 }, ++ {QAM_CKOUT_PWR, 2, 0x11, 1, 1 }, ++ {QAM_CDIV_PH0, 2, 0x12, 3, 0 }, ++ {QAM_CDIV_PH1, 2, 0x12, 7, 4 }, ++ {QAM_MPEG_OUT_EN, 0, 0x04, 5, 5 }, ++ {QAM_OPT_MPEG_DRIVE_CURRENT, 0, 0x07, 2, 2 }, ++ {QAM_NO_REINVERT, 2, 0x10, 2, 2 }, ++ {QAM_FIX_TEI, 2, 0x10, 3, 3 }, ++ {QAM_SERIAL, 2, 0x11, 2, 2 }, ++ ++ // Monitor ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_ADC_CLIP_CNT_REC, 1, 0x6a, 15, 4 }, ++ {QAM_DAGC_LEVEL_26_11, 1, 0x6a, 15, 0 }, ++ {QAM_DAGC_LEVEL_10_0, 1, 0x6c, 15, 5 }, ++ {QAM_RF_AAGC_SD_IN, 1, 0x6a, 15, 5 }, ++ {QAM_IF_AAGC_SD_IN, 1, 0x6c, 15, 5 }, ++ {QAM_KI_TR_OUT_30_15, 1, 0x6a, 15, 0 }, ++ {QAM_KI_TR_OUT_14_0, 1, 0x6c, 15, 1 }, ++ {QAM_KI_CR_OUT_15_0, 1, 0x6a, 15, 0 }, ++ {QAM_KI_CR_OUT_31_16, 1, 0x6c, 15, 0 }, ++ ++ // Specific register ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_SPEC_SIGNAL_INDICATOR, 1, 0x73, 5, 3 }, ++ {QAM_SPEC_ALPHA_STROBE, 1, 0x57, 0, 0 }, ++ {QAM_SPEC_ALPHA_SEL, 1, 0x57, 4, 1 }, ++ {QAM_SPEC_ALPHA_VAL, 1, 0x57, 14, 5 }, ++ {QAM_SPEC_SYMBOL_RATE_REG_0, 1, 0x0f, 2, 0 }, ++ {QAM_SPEC_SYMBOL_RATE_STROBE, 1, 0x5b, 0, 0 }, ++ {QAM_SPEC_SYMBOL_RATE_SEL, 1, 0x5b, 4, 1 }, ++ {QAM_SPEC_SYMBOL_RATE_VAL, 1, 0x5b, 14, 5 }, ++ {QAM_SPEC_REG_0_STROBE, 1, 0x5d, 0, 0 }, ++ {QAM_SPEC_REG_0_SEL, 1, 0x5d, 4, 1 }, ++ ++ // Specific register for initialization ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_SPEC_INIT_A0, 1, 0x6a, 15, 6 }, ++ {QAM_SPEC_INIT_A1, 0, 0x0f, 0, 0 }, ++ {QAM_SPEC_INIT_A2, 1, 0x2b, 1, 1 }, ++ ++ // Pseudo register for test only ++ // RegBitName, PageNo, RegStartAddr, Msb, Lsb ++ {QAM_TEST_REG_0, 1, 0x17, 6, 2 }, ++ {QAM_TEST_REG_1, 1, 0x17, 14, 1 }, ++ {QAM_TEST_REG_2, 1, 0x17, 21, 3 }, ++ {QAM_TEST_REG_3, 1, 0x17, 30, 2 }, ++ }; ++ ++ ++ int i; ++ int RegBitName; ++ ++ ++ ++ // Initialize base register table according to primary base register table. ++ // Note: 1. Base register table rows are sorted by register bit name key. ++ // 2. The default value of the IsAvailable variable is "NO". ++ for(i = 0; i < QAM_BASE_REG_TABLE_LEN_MAX; i++) ++ pDemod->BaseRegTable.Addr8Bit[i].IsAvailable = NO; ++ ++ for(i = 0; i < RTL2840_BASE_REG_TABLE_LEN; i++) ++ { ++ RegBitName = PrimaryBaseRegTable[i].RegBitName; ++ ++ pDemod->BaseRegTable.Addr8Bit[RegBitName].IsAvailable = YES; ++ pDemod->BaseRegTable.Addr8Bit[RegBitName].PageNo = PrimaryBaseRegTable[i].PageNo; ++ pDemod->BaseRegTable.Addr8Bit[RegBitName].RegStartAddr = PrimaryBaseRegTable[i].RegStartAddr; ++ pDemod->BaseRegTable.Addr8Bit[RegBitName].Msb = PrimaryBaseRegTable[i].Msb; ++ pDemod->BaseRegTable.Addr8Bit[RegBitName].Lsb = PrimaryBaseRegTable[i].Lsb; ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Initialize monitor register table ++ ++RTL2840 builder will use rtl2840_InitMonitorRegTable() to initialize monitor register table. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@see BuildRtl2840Module() ++ ++*/ ++void ++rtl2840_InitMonitorRegTable( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ static const QAM_PRIMARY_MONITOR_REG_ENTRY_ADDR_8BIT PrimaryMonitorRegTable[RTL2840_MONITOR_REG_TABLE_LEN] = ++ { ++ // Generality ++ // MonitorRegBitName, InfoNum, {SelRegAddr, SelValue, RegBitName, Shift } ++ {QAM_ADC_CLIP_CNT, 1, { {0x48, 0x01, QAM_ADC_CLIP_CNT_REC, 0 }, ++ {NO_USE, NO_USE, NO_USE, NO_USE }, }}, ++ ++ {QAM_DAGC_VALUE, 2, { {0x48, 0x20, QAM_DAGC_LEVEL_26_11, 11 }, ++ {0x49, 0x20, QAM_DAGC_LEVEL_10_0, 0 }, }}, ++ ++ {QAM_RF_AGC_VALUE, 1, { {0x48, 0x80, QAM_RF_AAGC_SD_IN, 0 }, ++ {NO_USE, NO_USE, NO_USE, NO_USE }, }}, ++ ++ {QAM_IF_AGC_VALUE, 1, { {0x49, 0x80, QAM_IF_AAGC_SD_IN, 0 }, ++ {NO_USE, NO_USE, NO_USE, NO_USE }, }}, ++ ++ {QAM_TR_OFFSET, 2, { {0x48, 0xc2, QAM_KI_TR_OUT_30_15, 15 }, ++ {0x49, 0xc2, QAM_KI_TR_OUT_14_0, 0 }, }}, ++ ++ {QAM_CR_OFFSET, 2, { {0x48, 0xc3, QAM_KI_CR_OUT_15_0, 0 }, ++ {0x49, 0xc3, QAM_KI_CR_OUT_31_16, 16 }, }}, ++ ++ // Specific monitor register for initialization ++ // MonitorRegBitName, InfoNum, {SelRegAddr, SelValue, RegBitName, Shift } ++ {QAM_SPEC_MONITER_INIT_0, 1, { {0x48, 0x00, QAM_SPEC_INIT_A0, 0 }, ++ {NO_USE, NO_USE, NO_USE, NO_USE }, }}, ++ }; ++ ++ ++ int i, j; ++ int MonitorRegBitName; ++ ++ ++ ++ // Initialize monitor register table according to primary monitor register table. ++ // Note: 1. Monitor register table rows are sorted by monitor register name key. ++ // 2. The default value of the IsAvailable variable is "NO". ++ for(i = 0; i < QAM_MONITOR_REG_TABLE_LEN_MAX; i++) ++ pDemod->MonitorRegTable.Addr8Bit[i].IsAvailable = NO; ++ ++ for(i = 0; i < RTL2840_MONITOR_REG_TABLE_LEN; i++) ++ { ++ MonitorRegBitName = PrimaryMonitorRegTable[i].MonitorRegBitName; ++ ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].IsAvailable = YES; ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoNum = PrimaryMonitorRegTable[i].InfoNum; ++ ++ for(j = 0; j < QAM_MONITOR_REG_INFO_TABLE_LEN; j++) ++ { ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[j].SelRegAddr = ++ PrimaryMonitorRegTable[i].InfoTable[j].SelRegAddr; ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[j].SelValue = ++ PrimaryMonitorRegTable[i].InfoTable[j].SelValue; ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[j].RegBitName = ++ PrimaryMonitorRegTable[i].InfoTable[j].RegBitName; ++ pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[j].Shift = ++ PrimaryMonitorRegTable[i].InfoTable[j].Shift; ++ } ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get inner strobe register bits. ++ ++RTL2840 upper level functions will use rtl2840_GetInnerStrobeRegBits() to get register bits with inner strobe. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name and inner strobe. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Don't need to set register page before using rtl2840_GetInnerStrobeRegBits(). ++ ++*/ ++int ++rtl2840_GetInnerStrobeRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ // Set register page number with inner page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set inner data strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_INNER_DATA_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get the inner strobe register bits. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, RegBitName, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get monitor register bits. ++ ++RTL2840 upper level functions will use rtl2840_GetMonitorRegBits() to get monitor register bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] MonitorRegBitName Pre-defined demod monitor register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod monitor register bits successfully with monitor bit name. ++@retval FUNCTION_ERROR Get demod monitor register bits unsuccessfully. ++ ++ ++@note ++ -# Don't need to set register page before using rtl2840_GetMonitorRegBits(). ++ ++*/ ++int ++rtl2840_GetMonitorRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int MonitorRegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char InfoNum; ++ unsigned char SelRegAddr; ++ unsigned char SelValue; ++ int RegBitName; ++ unsigned char Shift; ++ ++ unsigned long Buffer[QAM_MONITOR_REG_INFO_TABLE_LEN]; ++ ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].IsAvailable == NO) ++ goto error_status_monitor_register_bit_name; ++ ++ ++ // Get information entry number from monitor register table by monitor register name key. ++ InfoNum = pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoNum; ++ ++ ++ // Set register page number with inner page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, 1) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set selection register with selection value for each information entry. ++ for(i = 0; i < InfoNum; i++) ++ { ++ // Get selection register address and value from information entry by monitor register name key. ++ SelRegAddr = pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[i].SelRegAddr; ++ SelValue = pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[i].SelValue; ++ ++ // Set selection register with selection value. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, SelRegAddr, &SelValue, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ // Set inner data strobe. ++ // Note: RTL2840 hardware will clear strobe automatically. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, QAM_INNER_DATA_STROBE, ON) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get register bits to buffer according to register bit names for each information entry. ++ for(i = 0; i < InfoNum; i++) ++ { ++ // Get register bit name from information entry by monitor register name key. ++ RegBitName = pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[i].RegBitName; ++ ++ // Get register bits and store it to buffer. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, RegBitName, &Buffer[i]) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ // Combine the buffer values into reading value. ++ *pReadingValue = 0; ++ ++ for(i = 0; i < InfoNum; i++) ++ { ++ // Get shift from information entry by monitor register name key. ++ Shift = pDemod->MonitorRegTable.Addr8Bit[MonitorRegBitName].InfoTable[i].Shift; ++ ++ // Combine the buffer values into reading value with shift. ++ *pReadingValue |= Buffer[i] << Shift; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++error_status_monitor_register_bit_name: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set I2C bridge module demod arguments. ++ ++RTL2840 builder will use rtl2840_BuildI2cBridgeModule() to set I2C bridge module demod arguments. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@see BuildRtl2840Module() ++ ++*/ ++void ++rtl2840_BuildI2cBridgeModule( ++ QAM_DEMOD_MODULE *pDemod ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ ++ // Get I2C bridge module. ++ pI2cBridge = pDemod->pI2cBridge; ++ ++ // Set I2C bridge module demod arguments. ++ pI2cBridge->pPrivateData = (void *)pDemod; ++ pI2cBridge->ForwardI2cReadingCmd = rtl2840_ForwardI2cReadingCmd; ++ pI2cBridge->ForwardI2cWritingCmd = rtl2840_ForwardI2cWritingCmd; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/demod_rtl2840.h b/drivers/media/dvb/dvb-usb/demod_rtl2840.h +new file mode 100644 +index 0000000..16f4723 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/demod_rtl2840.h +@@ -0,0 +1,386 @@ ++#ifndef __DEMOD_RTL2840_H ++#define __DEMOD_RTL2840_H ++ ++/** ++ ++@file ++ ++@brief RTL2840 QAM demod module declaration ++ ++One can manipulate RTL2840 QAM demod through RTL2840 module. ++RTL2840 module is derived from QAM demod module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the QAM demod example in qam_demod_base.h except the listed lines. ++ ++ ++ ++#include "demod_rtl2840.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ QAM_DEMOD_MODULE QamDemodModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ ++ ... ++ ++ ++ ++ // Build RTL2840 demod module. ++ BuildRtl2840Module( ++ &pDemod, ++ &QamDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x44, // I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // Crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // TS interface mode is serial. ++ QAM_DEMOD_EN_AM_HUM // Enhancement mode is AM-hum. ++ ); ++ ++ ++ ++ // See the example for other QAM demod functions in qam_demod_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "qam_demod_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2840_BASE_REG_TABLE_LEN 88 ++#define RTL2840_MONITOR_REG_TABLE_LEN 7 ++ ++#define RTL2840_PAGE_REG_ADDR 0x0 ++#define RTL2840_SYS_VERSION_VALUE 0xa3 ++ ++ ++ ++// Specific register ++#define RTL2840_SPEC_REG_0_VAL_START_ADDR 0x5e ++ ++ ++ ++// Initialization ++#define RTL2840_SPEC_MONITOR_INIT_0_COMPARISON_TIMES 30 ++ ++// RF_AGC_VALUE register ++#define RTL2840_RF_AGC_VALUE_BIT_NUM 11 ++ ++// IF_AGC_VALUE register ++#define RTL2840_IF_AGC_VALUE_BIT_NUM 11 ++ ++// CR_OFFSET register ++#define RTL2840_CR_OFFSET_BIT_NUM 32 ++ ++// TR_OFFSET register ++#define RTL2840_TR_OFFSET_BIT_NUM 31 ++ ++ ++ ++// BER and UPER ++#define RTL2840_BER_WAIT_TIME_MS 10 ++#define RTL2840_BER_REG2_MSB_SHIFT 16 ++ ++// SNR ++// Note: RTL2840_SNR_DB_DEN = round(log2(10) * pow(2, RTL2840_SNR_FRAC_BIT_NUM)) ++#define RTL2840_SNR_FRAC_BIT_NUM 7 ++#define RTL2840_SNR_DB_DEN 425 ++ ++ ++ ++// Singal strength and signal quality ++#define RTL2840_SIGNAL_QUALITY_FRAC_BIT_NUM 7 ++ ++ ++ ++ ++ ++// Table length ++#define RTL2840_SPEC_REG_0_VALUE_TABLE_LEN 11 ++#define RTL2840_SYMBOL_RATE_VALUE_TABLE_LEN 9 ++ ++#define RTL2840_INIT_REG_TABLE_LEN 45 ++#define RTL2840_INIT_SPEC_REG_0_TABLE_LEN 13 ++#define RTL2840_TS_INTERFACE_INIT_TABLE_LEN 3 ++ ++#define RTL2840_QAM_MODE_REG_TABLE_LEN 25 ++#define RTL2840_QAM_MODE_SPEC_REG_0_TABLE_LEN 3 ++ ++#define RTL2840_ALPHA_VALUE_TABLE_LEN 16 ++ ++#define RTL2840_SYMBOL_RATE_TABLE_LEN 3 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2840Module( ++ QAM_DEMOD_MODULE **ppDemod, ++ QAM_DEMOD_MODULE *pQamDemodModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int TsInterfaceMode, ++ int EnhancementMode ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++rtl2840_IsConnectedToI2c( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2840_SoftwareReset( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2840_Initialize( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2840_SetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int QamMode ++ ); ++ ++int ++rtl2840_SetSymbolRateHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long SymbolRateHz ++ ); ++ ++int ++rtl2840_SetAlphaMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int AlphaMode ++ ); ++ ++int ++rtl2840_SetIfFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++int ++rtl2840_SetSpectrumMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++int ++rtl2840_GetRfAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++int ++rtl2840_GetIfAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++int ++rtl2840_GetDiAgc( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ); ++ ++int ++rtl2840_GetTrOffsetPpm( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++int ++rtl2840_GetCrOffsetHz( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++int ++rtl2840_IsAagcLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2840_IsEqLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2840_IsFrameLocked( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++int ++rtl2840_GetErrorRate( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++int ++rtl2840_GetSnrDb( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++rtl2840_GetSignalStrength( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++rtl2840_GetSignalQuality( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++rtl2840_UpdateFunction( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++int ++rtl2840_ResetFunction( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// Demod AM-hum enhancement functions ++int ++rtl2840_am_hum_en_SetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int QamMode ++ ); ++ ++ ++ ++ ++ ++// I2C command forwarding functions ++int ++rtl2840_ForwardI2cReadingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++rtl2840_ForwardI2cWritingCmd( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++// Register table initialization ++void ++rtl2840_InitBaseRegTable( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++void ++rtl2840_InitMonitorRegTable( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++// Register getting methods ++int ++rtl2840_GetInnerStrobeRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++int ++rtl2840_GetMonitorRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int MonitorRegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// I2C birdge module builder ++void ++rtl2840_BuildI2cBridgeModule( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/dtmb_demod_base.c b/drivers/media/dvb/dvb-usb/dtmb_demod_base.c +new file mode 100644 +index 0000000..b0de54a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dtmb_demod_base.c +@@ -0,0 +1,1566 @@ ++/** ++ ++@file ++ ++@brief DTMB demod default function definition ++ ++DTMB demod default functions. ++ ++*/ ++#include "rtl2832u_io.h" ++#include "dtmb_demod_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_SetRegPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBytes[LEN_2_BYTE]; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Set demod register page with page number. ++ // Note: The I2C format of demod register page setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + DTMB_DEMOD_PAGE_REG_ADDR + PageNo + stop_bit ++ WritingBytes[0] = DTMB_DEMOD_PAGE_REG_ADDR; ++ WritingBytes[1] = (unsigned char)PageNo; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBytes, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ // temp, because page register is write-only. ++ pDemod->CurrentPageNo = PageNo; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Set register bytes separately. ++int ++internal_dtmb_demod_addr_8bit_SetRegBytesSeparately( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes one by one. ++ for(i = 0; i < ByteNum; i++) ++ { ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = (unsigned char)(RegStartAddr + i); ++ WritingBuffer[1] = pWritingBytes[i]; ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ struct dvb_usb_device *d; ++ unsigned int i; ++ unsigned char DeviceAddr; ++ //unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ unsigned long PageNo = pDemod->CurrentPageNo; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get user defined data pointer of base interface structure for context. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes one by one. ++ for(i = 0; i < ByteNum; i++) ++ { ++ ++ // Set demod register bytes with writing buffer. ++ if(write_demod_register(d, DeviceAddr, PageNo, RegStartAddr+i, (unsigned char*)pWritingBytes+i, LEN_1_BYTE)) ++ goto error_status_set_demod_registers; ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Set register bytes continuously. ++int ++internal_dtmb_demod_addr_8bit_SetRegBytesContinuously( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = (unsigned char)(RegStartAddr + i); ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, WritingByteNum + LEN_1_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_BYTES ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_SetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ unsigned long CurrentPageNo; // temp, because page register is write-only. ++ ++ ++ ++ // Get page register number. ++ CurrentPageNo = pDemod->CurrentPageNo; // temp, because page register is write-only. ++ ++ ++ // Set register bytes according to page register number. ++ switch(CurrentPageNo) ++ { ++ case 0: ++ case 1: ++ case 2: ++ case 3: ++ case 4: ++ ++ if(internal_dtmb_demod_addr_8bit_SetRegBytesSeparately(pDemod, RegStartAddr, pWritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ break; ++ ++ ++ default: ++ ++ goto error_status_set_demod_registers; ++ ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Get register bytes separately. ++int ++internal_dtmb_demod_addr_8bit_GetRegBytesSeparately( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ ++ unsigned char DeviceAddr; ++ unsigned char RegAddr; ++ unsigned char RegByte; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes one by one. ++ for(i = 0; i < ByteNum; i++) ++ { ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ RegAddr = (unsigned char)(RegStartAddr + i); ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, &RegAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &RegByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ // Copy register byte to reading bytes. ++ pReadingBytes[i] = RegByte; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ struct dvb_usb_device *d; ++ unsigned int i; ++ ++ unsigned char DeviceAddr; ++ ++ unsigned long PageNo = pDemod->CurrentPageNo; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get user defined data pointer of base interface structure for context. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes one by one. ++ for(i = 0; i < ByteNum; i++) ++ { ++ ++ // Get demod register bytes. ++ if(read_demod_register(d, DeviceAddr, PageNo, RegStartAddr+i, pReadingBytes+i, LEN_1_BYTE)) ++ goto error_status_get_demod_registers; ++ ++ ++ ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++//error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Get register bytes continuously. ++int ++internal_dtmb_demod_addr_8bit_GetRegBytesContinuously( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ unsigned char DeviceAddr; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = (unsigned char)(RegStartAddr + i); ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, &RegReadingAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ struct dvb_usb_device *d; ++ ++ unsigned char DeviceAddr; ++ ++ unsigned long PageNo = pDemod->CurrentPageNo; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get user defined data pointer of base interface structure for context. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ ++ // Get demod register bytes. ++ if(read_demod_register(d, DeviceAddr, PageNo, RegStartAddr, pReadingBytes, ByteNum)) ++ goto error_status_get_demod_registers; ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_BYTES ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_GetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ unsigned long CurrentPageNo; // temp, because page register is write-only. ++ ++ ++ ++ // Get page register number. ++ CurrentPageNo = pDemod->CurrentPageNo; // temp, because page register is write-only. ++ ++ ++ // Get register bytes according to page register number. ++ switch(CurrentPageNo) ++ { ++ case 0: ++ case 1: ++ case 2: ++ case 3: ++ case 4: ++ ++ if(internal_dtmb_demod_addr_8bit_GetRegBytesSeparately(pDemod, RegStartAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ break; ++ ++ ++ case 5: ++ case 6: ++ case 7: ++ case 8: ++ case 9: ++ ++ if(internal_dtmb_demod_addr_8bit_GetRegBytesContinuously(pDemod, RegStartAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ break; ++ ++ ++ default: ++ ++ goto error_status_get_demod_registers; ++ ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_MASK_BITS ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_SetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ unsigned char WritingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Reserve unsigned integer value unmask bit with mask and inlay writing value into it. ++ Value &= ~Mask; ++ Value |= (WritingValue << Shift) & Mask; ++ ++ ++ // Separate unsigned integer value into writing bytes. ++ // Note: Pick up lower address byte from value LSB. ++ // Pick up upper address byte from value MSB. ++ for(i = 0; i < ByteNum; i++) ++ WritingBytes[i] = (unsigned char)((Value >> (BYTE_SHIFT * i)) & BYTE_MASK); ++ ++ ++ // Write demod register bytes with writing bytes. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, RegStartAddr, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_MASK_BITS ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_GetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Get register bits from unsigned integaer value with mask and shift ++ *pReadingValue = (Value & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_BITS ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_SetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable.Addr8Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable.Addr8Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable.Addr8Bit[RegBitName].Msb; ++ Lsb = pDemod->RegTable.Addr8Bit[RegBitName].Lsb; ++ ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_BITS ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_GetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable.Addr8Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable.Addr8Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable.Addr8Bit[RegBitName].Msb; ++ Lsb = pDemod->RegTable.Addr8Bit[RegBitName].Lsb; ++ ++ ++ // Get register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.GetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_SetRegBitsWithPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned long PageNo; ++ ++ ++ // Get register page number from register table with register bit name key. ++ PageNo = pDemod->RegTable.Addr8Bit[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set register mask bits with register bit name key. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, RegBitName, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++dtmb_demod_addr_8bit_default_GetRegBitsWithPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned long PageNo; ++ ++ ++ // Get register page number from register table with register bit name key. ++ PageNo = pDemod->RegTable.Addr8Bit[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get register mask bits with register bit name key. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, RegBitName, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_BYTES ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_SetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned short RegWritingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_2_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = (unsigned short)(RegStartAddr + i); ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddrMsb + RegWritingAddrLsb + ++ // writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = (RegWritingAddr >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = RegWritingAddr & BYTE_MASK; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_2_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, WritingByteNum + LEN_2_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Get register bytes normally. ++int ++internal_dtmb_demod_addr_16bit_GetRegBytesNormally( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ unsigned char DeviceAddr; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned short RegReadingAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = (unsigned short)(RegStartAddr + i); ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddrMsb + RegReadingAddrLsb + stop_bit ++ WritingBuffer[0] = (RegReadingAddr >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = RegReadingAddr & BYTE_MASK; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Internal function: ++// Get register bytes with freeze. ++ ++#define DTMB_I2C_REG_DEBUG_PAGE_ADDR 0xc708 ++#define DTMB_I2C_REG_DEBUG_ADDR_ADDR 0xc709 ++#define DTMB_I2C_REG_DEBUG_FREEZE_ADDR 0xc70a ++#define DTMB_I2C_REG_DEBUG_BYTE_ADDR 0xc70b ++ ++int ++internal_dtmb_demod_addr_16bit_GetRegBytesWithFreeze( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ unsigned char DeviceAddr; ++ ++ unsigned char WritingBuffer[LEN_4_BYTE]; ++ unsigned char ReadingBuffer[LEN_4_BYTE]; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddrMsb + RegWritingAddrLsb + writing_bytes (WritingByteNum bytes) + stop_bit ++ ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ ++ // Set I2C_REG_DEBUG_PAGE and I2C_REG_DEBUG_ADDR with register start address. ++ // Note: 1. Set I2C_REG_DEBUG_PAGE with register start address [11:8]. ++ // 2. Set I2C_REG_DEBUG_ADDR with register start address [7:0]. ++ WritingBuffer[0] = (DTMB_I2C_REG_DEBUG_PAGE_ADDR >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = DTMB_I2C_REG_DEBUG_PAGE_ADDR & BYTE_MASK; ++ WritingBuffer[2] = (RegStartAddr >> BYTE_SHIFT) & HEX_DIGIT_MASK; ++ WritingBuffer[3] = RegStartAddr & BYTE_MASK; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, LEN_4_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set I2C_REG_DEBUG_FREEZE with 0x1. ++ WritingBuffer[0] = (DTMB_I2C_REG_DEBUG_FREEZE_ADDR >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = DTMB_I2C_REG_DEBUG_FREEZE_ADDR & BYTE_MASK; ++ WritingBuffer[2] = 0x1; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, LEN_3_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get I2C_REG_DEBUG_BYTE 4 bytes. ++ if(internal_dtmb_demod_addr_16bit_GetRegBytesNormally(pDemod, DTMB_I2C_REG_DEBUG_BYTE_ADDR, ReadingBuffer, LEN_4_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Arrange reading bytes from big-endian to little-endian. ++ // Note: 1. The bytes format reading from I2C_REG_DEBUG_BYTE is big-endian. ++ // 2. The bytes format we needs is little-endian. ++ for(i = 0; i < ByteNum; i++) ++ { ++ // Set reading bytes. ++ pReadingBytes[i] = ReadingBuffer[LEN_3_BYTE - i]; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_BYTES ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_GetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ unsigned char RegStartAddrMsb; ++ ++ ++ ++ // Get regiser start address MSB. ++ RegStartAddrMsb = (RegStartAddr >> BYTE_SHIFT) & BYTE_MASK; ++ ++ ++ // Get register bytes according to page register number. ++ switch(RegStartAddrMsb) ++ { ++ case 0xc0: ++ case 0xc1: ++ case 0xc2: ++ case 0xc3: ++ case 0xc4: ++ case 0xc5: ++ case 0xc6: ++ case 0xc7: ++ case 0xe0: ++ case 0xe1: ++ case 0xe2: ++ case 0xe3: ++ case 0xe4: ++ case 0xf0: ++ ++ if(internal_dtmb_demod_addr_16bit_GetRegBytesNormally(pDemod, RegStartAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ break; ++ ++ ++ case 0xc8: ++ case 0xc9: ++ case 0xca: ++ case 0xcb: ++ case 0xcc: ++ case 0xcd: ++ ++ if(internal_dtmb_demod_addr_16bit_GetRegBytesWithFreeze(pDemod, RegStartAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ break; ++ ++ ++ default: ++ ++ goto error_status_get_demod_registers; ++ ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_MASK_BITS ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_SetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ unsigned char WritingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr16Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Reserve unsigned integer value unmask bit with mask and inlay writing value into it. ++ Value &= ~Mask; ++ Value |= (WritingValue << Shift) & Mask; ++ ++ ++ // Separate unsigned integer value into writing bytes. ++ // Note: Pick up lower address byte from value LSB. ++ // Pick up upper address byte from value MSB. ++ for(i = 0; i < ByteNum; i++) ++ WritingBytes[i] = (unsigned char)((Value >> (BYTE_SHIFT * i)) & BYTE_MASK); ++ ++ ++ // Write demod register bytes with writing bytes. ++ if(pDemod->RegAccess.Addr16Bit.SetRegBytes(pDemod, RegStartAddr, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_MASK_BITS ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_GetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr16Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Get register bits from unsigned integaer value with mask and shift ++ *pReadingValue = (Value & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_SET_REG_BITS ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_SetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable.Addr16Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable.Addr16Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable.Addr16Bit[RegBitName].Msb; ++ Lsb = pDemod->RegTable.Addr16Bit[RegBitName].Lsb; ++ ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr16Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_REG_BITS ++ ++*/ ++int ++dtmb_demod_addr_16bit_default_GetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable.Addr16Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable.Addr16Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable.Addr16Bit[RegBitName].Msb; ++ Lsb = pDemod->RegTable.Addr16Bit[RegBitName].Lsb; ++ ++ ++ // Get register mask bits. ++ if(pDemod->RegAccess.Addr16Bit.GetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_DEMOD_TYPE ++ ++*/ ++void ++dtmb_demod_default_GetDemodType( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ) ++{ ++ // Get demod type from demod module. ++ *pDemodType = pDemod->DemodType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++dtmb_demod_default_GetDeviceAddr( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get demod I2C device address from demod module. ++ *pDeviceAddr = pDemod->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_CRYSTAL_FREQ_HZ ++ ++*/ ++void ++dtmb_demod_default_GetCrystalFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ) ++{ ++ // Get demod crystal frequency in Hz from demod module. ++ *pCrystalFreqHz = pDemod->CrystalFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_IF_FREQ_HZ ++ ++*/ ++int ++dtmb_demod_default_GetIfFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ) ++{ ++ // Get demod IF frequency in Hz from demod module. ++ if(pDemod->IsIfFreqHzSet != YES) ++ goto error_status_get_demod_if_frequency; ++ ++ *pIfFreqHz = pDemod->IfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_if_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_DEMOD_FP_GET_SPECTRUM_MODE ++ ++*/ ++int ++dtmb_demod_default_GetSpectrumMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ) ++{ ++ // Get demod spectrum mode from demod module. ++ if(pDemod->IsSpectrumModeSet != YES) ++ goto error_status_get_demod_spectrum_mode; ++ ++ *pSpectrumMode = pDemod->SpectrumMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_spectrum_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/dtmb_demod_base.h b/drivers/media/dvb/dvb-usb/dtmb_demod_base.h +new file mode 100644 +index 0000000..38e8ed9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dtmb_demod_base.h +@@ -0,0 +1,2501 @@ ++#ifndef __DTMB_DEMOD_BASE_H ++#define __DTMB_DEMOD_BASE_H ++ ++/** ++ ++@file ++ ++@brief DTMB demod base module definition ++ ++DTMB demod base module definitions contains demod module structure, demod funciton pointers, and demod definitions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_xxx.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ ++ long RfAgc, IfAgc; ++ unsigned long DiAgc; ++ ++ int Answer; ++ long TrOffsetPpm, CrOffsetHz; ++ unsigned long BerNum, BerDen; ++ double Ber; ++ unsigned long PerNum, PerDen; ++ double Per; ++ long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ unsigned long SignalStrength, SignalQuality; ++ ++ int CarrierMode; ++ int PnMode; ++ int QamMode; ++ int CodeRateMode; ++ int TimeInterleaverMode; ++ ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pBaseInterface, ++ &BaseInterfaceModuleMemory, ++ 9, // Set maximum I2C reading byte number with 9. ++ 8, // Set maximum I2C writing byte number with 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs // Employ CustomWaitMs() as basic waiting function. ++ ); ++ ++ ++ // Build DTMB demod XXX module. ++ BuildXxxModule( ++ &pDemod, ++ &DtmbDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x3e, // Demod I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // Demod crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // Demod TS interface mode is serial. ++ DIVERSITY_PIP_OFF // Demod diversity and PIP both are disabled. ++ ... // Other arguments by each demod module ++ ); ++ ++ ++ ++ ++ ++ // ==== Initialize DTMB demod and set its parameters ===== ++ ++ // Initialize demod. ++ pDemod->Initialize(pDemod); ++ ++ ++ // Set demod parameters. (IF frequency and spectrum mode) ++ // Note: In the example: ++ // 1. IF frequency is 36.125 MHz. ++ // 2. Spectrum mode is SPECTRUM_INVERSE. ++ IfFreqHz = IF_FREQ_36125000HZ; ++ SpectrumMode = SPECTRUM_INVERSE; ++ ++ pDemod->SetIfFreqHz(pDemod, IfFreqHz); ++ pDemod->SetSpectrumMode(pDemod, SpectrumMode); ++ ++ ++ // Need to set tuner before demod software reset. ++ // The order to set demod and tuner is not important. ++ // Note: One can use "pDemod->SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x1);" ++ // for tuner I2C command forwarding. ++ ++ ++ // Reset demod by software reset. ++ pDemod->SoftwareReset(pDemod); ++ ++ ++ // Wait maximum 1000 ms for demod converge. ++ for(i = 0; i < 25; i++) ++ { ++ // Wait 40 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 40); ++ ++ // Check signal lock status. ++ // Note: If Answer is YES, signal is locked. ++ // If Answer is NO, signal is not locked. ++ pDemod->IsSignalLocked(pDemod, &Answer); ++ ++ if(Answer == YES) ++ { ++ // Signal is locked. ++ break; ++ } ++ } ++ ++ ++ ++ ++ ++ // ==== Get DTMB demod information ===== ++ ++ // Get demod type. ++ // Note: One can find demod type in MODULE_TYPE enumeration. ++ pDemod->GetDemodType(pDemod, &DemodType); ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Ask demod if it is connected to I2C bus. ++ // Note: If Answer is YES, demod is connected to I2C bus. ++ // If Answer is NO, demod is not connected to I2C bus. ++ pDemod->IsConnectedToI2c(pDemod, &Answer); ++ ++ ++ // Get demod parameters. (IF frequency and spectrum mode) ++ pDemod->GetIfFreqHz(pDemod, &IfFreqHz); ++ pDemod->GetSpectrumMode(pDemod, &SpectrumMode); ++ ++ ++ // Get demod AGC value. ++ // Note: The range of RF AGC and IF AGC value is -8192 ~ 8191. ++ // The range of digital AGC value is 0 ~ 255. ++ pDemod->GetRfAgc(pDemod, &RfAgc); ++ pDemod->GetIfAgc(pDemod, &IfAgc); ++ pDemod->GetDiAgc(pDemod, &DiAgc); ++ ++ ++ // Get demod lock status. ++ // Note: If Answer is YES, it is locked. ++ // If Answer is NO, it is not locked. ++ pDemod->IsSignalLocked(pDemod, &Answer); ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pDemod->GetTrOffsetPpm(pDemod, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pDemod->GetCrOffsetHz(pDemod, &CrOffsetHz); ++ ++ ++ // Get BER. ++ pDemod->GetBer(pDemod, &BerNum, &BerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ ++ // Get PER. ++ pDemod->GetPer(pDemod, &PerNum, &PerDen); ++ Per = (double)PerNum / (double)PerDen; ++ ++ // Get SNR in dB. ++ pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pDemod->GetSignalStrength(pDemod, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pDemod->GetSignalQuality(pDemod, &SignalQuality); ++ ++ ++ // Get signal information. ++ // Note: One can find signal information definitions in the enumerations as follows: ++ // 1. DTMB_CARRIER_MODE ++ // 2. DTMB_PN_MODE ++ // 3. DTMB_QAM_MODE ++ // 4. DTMB_CODE_RATE_MODE ++ // 5. DTMB_TIME_INTERLEAVER_MODE ++ pDemod->GetCarrierMode(pDemod, &CarrierMode); ++ pDemod->GetPnMode(pDemod, &PnMode); ++ pDemod->GetQamMode(pDemod, &QamMode); ++ pDemod->GetCodeRateMode(pDemod, &CodeRateMode); ++ pDemod->GetTimeInterleaverMode(pDemod, &TimeInterleaverMode); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// Page register address ++#define DTMB_DEMOD_PAGE_REG_ADDR 0x0 ++ ++ ++// Carrier mode ++enum DTMB_CARRIER_MODE ++{ ++ DTMB_CARRIER_SINGLE, ++ DTMB_CARRIER_MULTI, ++}; ++ ++ ++// PN mode ++enum DTMB_PN_MODE ++{ ++ DTMB_PN_420, ++ DTMB_PN_595, ++ DTMB_PN_945, ++}; ++ ++ ++// QAM mode ++enum DTMB_QAM_MODE ++{ ++ DTMB_QAM_4QAM_NR, ++ DTMB_QAM_4QAM, ++ DTMB_QAM_16QAM, ++ DTMB_QAM_32QAM, ++ DTMB_QAM_64QAM, ++}; ++#define DTMB_QAM_UNKNOWN -1 ++ ++ ++// Code rate mode ++enum DTMB_CODE_RATE_MODE ++{ ++ DTMB_CODE_RATE_0P4, ++ DTMB_CODE_RATE_0P6, ++ DTMB_CODE_RATE_0P8, ++}; ++#define DTMB_CODE_RATE_UNKNOWN -1 ++ ++ ++// Time interleaver mode ++enum DTMB_TIME_INTERLEAVER_MODE ++{ ++ DTMB_TIME_INTERLEAVER_240, ++ DTMB_TIME_INTERLEAVER_720, ++}; ++#define DTMB_TIME_INTERLEAVER_UNKNOWN -1 ++ ++ ++ ++ ++ ++// Register entry definitions ++ ++// Register entry for 8-bit address ++typedef struct ++{ ++ int IsAvailable; ++ unsigned long PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DTMB_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Primary register entry for 8-bit address ++typedef struct ++{ ++ int RegBitName; ++ unsigned long PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DTMB_PRIMARY_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Register entry for 16-bit address ++typedef struct ++{ ++ int IsAvailable; ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DTMB_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++// Primary register entry for 16-bit address ++typedef struct ++{ ++ int RegBitName; ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DTMB_PRIMARY_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++ ++ ++// Register table dependence ++ ++// Demod register bit names ++enum DTMB_REG_BIT_NAME ++{ ++ // Software reset ++ DTMB_SOFT_RST_N, ++ ++ // Tuner I2C forwording ++ DTMB_I2CT_EN_CTRL, ++ ++ // Chip ID ++ DTMB_CHIP_ID, ++ ++ ++ // IF setting ++ DTMB_EN_SP_INV, ++ DTMB_EN_DCR, ++ DTMB_BBIN_EN, ++ DTMB_IFFREQ, ++ ++ // AGC setting ++ DTMB_AGC_DRIVE_LV, // for RTL2836B DTMB only ++ DTMB_Z_AGC, // for RTL2836B DTMB only ++ DTMB_EN_PGA_MODE, // for RTL2836B DTMB only ++ DTMB_TARGET_VAL, ++ DTMB_AAGC_LOOPGAIN1, // for RTL2836B DTMB only ++ DTMB_POLAR_IFAGC, // for RTL2836B DTMB only ++ DTMB_POLAR_RFAGC, // for RTL2836B DTMB only ++ DTMB_INTEGRAL_CNT_LEN, // for RTL2836B DTMB only ++ DTMB_AAGC_LOCK_PGA_HIT_LEN, // for RTL2836B DTMB only ++ DTMB_THD_LOCK_UP, // for RTL2836B DTMB only ++ DTMB_THD_LOCK_DW, // for RTL2836B DTMB only ++ DTMB_THD_UP1, // for RTL2836B DTMB only ++ DTMB_THD_DW1, // for RTL2836B DTMB only ++ DTMB_THD_UP2, // for RTL2836B DTMB only ++ DTMB_THD_DW2, // for RTL2836B DTMB only ++ DTMB_GAIN_PULSE_SPACE_LEN, // for RTL2836B DTMB only ++ DTMB_GAIN_PULSE_HOLD_LEN, // for RTL2836B DTMB only ++ DTMB_GAIN_STEP_SUM_UP_THD, // for RTL2836B DTMB only ++ DTMB_GAIN_STEP_SUM_DW_THD, // for RTL2836B DTMB only ++ ++ ++ // TS interface ++ DTMB_SERIAL, ++ DTMB_CDIV_PH0, ++ DTMB_CDIV_PH1, ++ DTMB_SER_LSB, ++ DTMB_SYNC_DUR, ++ DTMB_ERR_DUR, ++ DTMB_FIX_TEI, ++ ++ // Signal lock status ++ DTMB_TPS_LOCK, ++ DTMB_PN_PEAK_EXIST, ++ ++ // FSM ++ DTMB_FSM_STATE_R, ++ ++ // Performance measurement ++ DTMB_RO_PKT_ERR_RATE, ++ DTMB_EST_SNR, ++ DTMB_RO_LDPC_BER, ++ ++ // AGC ++ DTMB_GAIN_OUT_R, ++ DTMB_RF_AGC_VAL, ++ DTMB_IF_AGC_VAL, ++ ++ // TR and CR ++ DTMB_TR_OUT_R, ++ DTMB_SFOAQ_OUT_R, ++ DTMB_CFO_EST_R, ++ ++ // Signal information ++ DTMB_EST_CARRIER, ++ DTMB_RX_MODE_R, ++ DTMB_USE_TPS, ++ ++ // GPIO ++ DTMB_DMBT_GPIOA_OE, // For RTL2836B only ++ DTMB_DMBT_GPIOB_OE, // For RTL2836B only ++ DTMB_DMBT_OPT_GPIOA_SEL, // For RTL2836B only ++ DTMB_DMBT_OPT_GPIOB_SEL, // For RTL2836B only ++ DTMB_GPIOA_SEL, // For RTL2836B only ++ DTMB_GPIOB_SEL, // For RTL2836B only ++ ++ // AD7 ++ DTMB_RSSI_R, // For RTL2836B only ++ DTMB_AV_SET7, // For RTL2836B only ++ DTMB_IBX, // For RTL2836B only ++ DTMB_POW_AD7, // For RTL2836B only ++ DTMB_VICM_SET, // For RTL2836B only ++ DTMB_VRC, // For RTL2836B only ++ DTMB_ATT_AD7, // For RTL2836B only ++ ++ // Diversity ++ DTMB_DIV_EN, // For RTL2836B DTMB only ++ DTMB_DIV_MODE, // For RTL2836B DTMB only ++ DTMB_DIV_RX_CLK_XOR, // For RTL2836B DTMB only ++ DTMB_DIV_THD_ERR_CMP0, // For RTL2836B DTMB only ++ DTMB_FSM_10L_MSB_3Byte, // For RTL2836B DTMB only ++ ++ // Item terminator ++ DTMB_REG_BIT_NAME_ITEM_TERMINATOR, ++}; ++ ++ ++ ++// Register table length definitions ++#define DTMB_REG_TABLE_LEN_MAX DTMB_REG_BIT_NAME_ITEM_TERMINATOR ++ ++ ++ ++ ++ ++// DTMB demod module pre-definition ++typedef struct DTMB_DEMOD_MODULE_TAG DTMB_DEMOD_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register page setting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_SET_REG_PAGE() to set demod register page. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] PageNo Page number ++ ++ ++@retval FUNCTION_SUCCESS Set register page successfully with page number. ++@retval FUNCTION_ERROR Set register page unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_REG_PAGE() with the corresponding function. ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register page with page number 2. ++ pDemod->SetRegPage(pDemod, 2); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_PAGE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register byte setting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_SET_REG_BYTES() to set demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] pWritingBytes Pointer to writing bytes ++@param [in] ByteNum Writing byte number ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bytes successfully with writing bytes. ++@retval FUNCTION_ERROR Set demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by DTMB_DEMOD_FP_SET_REG_PAGE() before using DTMB_DEMOD_FP_SET_REG_BYTES(). ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_GET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char WritingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bytes (page 1, address 0x17 ~ 0x1b) with 5 writing bytes. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBytes(pDemod, 0x17, WritingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BYTES)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_BYTES)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register byte getting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_GET_REG_BYTES() to get demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [out] pReadingBytes Pointer to an allocated memory for storing reading bytes ++@param [in] ByteNum Reading byte number ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bytes successfully with reading byte number. ++@retval FUNCTION_ERROR Get demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by DTMB_DEMOD_FP_SET_REG_PAGE() before using DTMB_DEMOD_FP_GET_REG_BYTES(). ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_SET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char ReadingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bytes (page 1, address 0x17 ~ 0x1b) with reading byte number 5. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBytes(pDemod, 0x17, ReadingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BYTES)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_BYTES)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register mask bits setting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_SET_REG_MASK_BITS() to set demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register mask bits successfully with writing value. ++@retval FUNCTION_ERROR Set demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by DTMB_DEMOD_FP_SET_REG_PAGE() before using DTMB_DEMOD_FP_SET_REG_MASK_BITS(). ++ -# The constraints of DTMB_DEMOD_FP_SET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_GET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits (page 1, address {0x18, 0x17} [12:5]) with writing value 0x1d. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegMaskBits(pDemod, 0x17, 12, 5, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x17 0x18 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_MASK_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_MASK_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register mask bits getting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_GET_REG_MASK_BITS() to get demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register mask bits successfully. ++@retval FUNCTION_ERROR Get demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by DTMB_DEMOD_FP_SET_REG_PAGE() before using DTMB_DEMOD_FP_GET_REG_MASK_BITS(). ++ -# The constraints of DTMB_DEMOD_FP_GET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_SET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits (page 1, address {0x18, 0x17} [12:5]). ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegMaskBits(pDemod, 0x17, 12, 5, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_MASK_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_MASK_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register bits setting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_SET_REG_BITS() to set demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using DTMB_DEMOD_FP_SET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_GET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBits(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register bits getting function pointer ++ ++Demod upper level functions will use DTMB_DEMOD_FP_GET_REG_BITS() to get demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using DTMB_DEMOD_FP_GET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_PAGE, DTMB_DEMOD_FP_SET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBits(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_BITS)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register bits setting function pointer (with page setting) ++ ++Demod upper level functions will use DTMB_DEMOD_FP_SET_REG_BITS_WITH_PAGE() to set demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name, page setting, and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using DTMB_DEMOD_FP_SET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DTMB_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BITS_WITH_PAGE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod register bits getting function pointer (with page setting) ++ ++Demod upper level functions will use DTMB_DEMOD_FPT_GET_REG_BITS_WITH_PAGE() to get demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name and page setting. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using DTMB_DEMOD_FP_GET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DTMB_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->GetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BITS_WITH_PAGE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// Demod register access for 8-bit address ++typedef struct ++{ ++ DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_PAGE SetRegPage; ++ DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BYTES SetRegBytes; ++ DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BYTES GetRegBytes; ++ DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_MASK_BITS SetRegMaskBits; ++ DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_MASK_BITS GetRegMaskBits; ++ DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BITS SetRegBits; ++ DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BITS GetRegBits; ++ DTMB_DEMOD_FP_ADDR_8BIT_SET_REG_BITS_WITH_PAGE SetRegBitsWithPage; ++ DTMB_DEMOD_FP_ADDR_8BIT_GET_REG_BITS_WITH_PAGE GetRegBitsWithPage; ++} ++DTMB_DEMOD_REG_ACCESS_ADDR_8BIT; ++ ++ ++ ++ ++ ++// Demod register access for 16-bit address ++typedef struct ++{ ++ DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_BYTES SetRegBytes; ++ DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_BYTES GetRegBytes; ++ DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_MASK_BITS SetRegMaskBits; ++ DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_MASK_BITS GetRegMaskBits; ++ DTMB_DEMOD_FP_ADDR_16BIT_SET_REG_BITS SetRegBits; ++ DTMB_DEMOD_FP_ADDR_16BIT_GET_REG_BITS GetRegBits; ++} ++DTMB_DEMOD_REG_ACCESS_ADDR_16BIT; ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod type getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_DEMOD_TYPE() to get DTMB demod type. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDemodType Pointer to an allocated memory for storing demod type ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_DEMOD_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*DTMB_DEMOD_FP_GET_DEMOD_TYPE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod I2C device address getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_DEVICE_ADDR() to get DTMB demod I2C device address. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDeviceAddr Pointer to an allocated memory for storing demod I2C device address ++ ++ ++@retval FUNCTION_SUCCESS Get demod device address successfully. ++@retval FUNCTION_ERROR Get demod device address unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_DEVICE_ADDR() with the corresponding function. ++ ++*/ ++typedef void ++(*DTMB_DEMOD_FP_GET_DEVICE_ADDR)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod crystal frequency getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() to get DTMB demod crystal frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrystalFreqHz Pointer to an allocated memory for storing demod crystal frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod crystal frequency successfully. ++@retval FUNCTION_ERROR Get demod crystal frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() with the corresponding function. ++ ++*/ ++typedef void ++(*DTMB_DEMOD_FP_GET_CRYSTAL_FREQ_HZ)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod I2C bus connection asking function pointer ++ ++One can use DTMB_DEMOD_FP_IS_CONNECTED_TO_I2C() to ask DTMB demod if it is connected to I2C bus. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_IS_CONNECTED_TO_I2C() with the corresponding function. ++ ++*/ ++typedef void ++(*DTMB_DEMOD_FP_IS_CONNECTED_TO_I2C)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod software resetting function pointer ++ ++One can use DTMB_DEMOD_FP_SOFTWARE_RESET() to reset DTMB demod by software reset. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod by software reset successfully. ++@retval FUNCTION_ERROR Reset demod by software reset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SOFTWARE_RESET() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_SOFTWARE_RESET)( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod initializing function pointer ++ ++One can use DTMB_DEMOD_FP_INITIALIZE() to initialie DTMB demod. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize demod successfully. ++@retval FUNCTION_ERROR Initialize demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_INITIALIZE)( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod IF frequency setting function pointer ++ ++One can use DTMB_DEMOD_FP_SET_IF_FREQ_HZ() to set DTMB demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] IfFreqHz IF frequency in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod IF frequency successfully. ++@retval FUNCTION_ERROR Set demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_SET_IF_FREQ_HZ)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod spectrum mode setting function pointer ++ ++One can use DTMB_DEMOD_FP_SET_SPECTRUM_MODE() to set DTMB demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] SpectrumMode Spectrum mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod spectrum mode successfully. ++@retval FUNCTION_ERROR Set demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_SET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_SET_SPECTRUM_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod IF frequency getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_IF_FREQ_HZ() to get DTMB demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfFreqHz Pointer to an allocated memory for storing demod IF frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF frequency successfully. ++@retval FUNCTION_ERROR Get demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_IF_FREQ_HZ)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod spectrum mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_SPECTRUM_MODE() to get DTMB demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSpectrumMode Pointer to an allocated memory for storing demod spectrum mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod spectrum mode successfully. ++@retval FUNCTION_ERROR Get demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_SPECTRUM_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod signal lock asking function pointer ++ ++One can use DTMB_DEMOD_FP_IS_SIGNAL_LOCKED() to ask DTMB demod if it is signal-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform signal lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_IS_SIGNAL_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_IS_SIGNAL_LOCKED)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod signal strength getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal strength successfully. ++@retval FUNCTION_ERROR Get demod signal strength unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_SIGNAL_STRENGTH)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod signal quality getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal quality successfully. ++@retval FUNCTION_ERROR Get demod signal quality unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_SIGNAL_QUALITY)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod BER getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_BER() to get BER. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod error rate value successfully. ++@retval FUNCTION_ERROR Get demod error rate value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_BER() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_BER)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod PER getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_PER() to get PER. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pPerNum Pointer to an allocated memory for storing PER numerator ++@param [out] pPerDen Pointer to an allocated memory for storing PER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod error rate value successfully. ++@retval FUNCTION_ERROR Get demod error rate value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_PER() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_PER)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod SNR getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod SNR successfully. ++@retval FUNCTION_ERROR Get demod SNR unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_SNR_DB)( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod RF AGC getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_RF_AGC() to get DTMB demod RF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pRfAgc Pointer to an allocated memory for storing RF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod RF AGC value successfully. ++@retval FUNCTION_ERROR Get demod RF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_RF_AGC() with the corresponding function. ++ -# The range of RF AGC value is 0 ~ (pow(2, 14) - 1). ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_RF_AGC)( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod IF AGC getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_IF_AGC() to get DTMB demod IF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfAgc Pointer to an allocated memory for storing IF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF AGC value successfully. ++@retval FUNCTION_ERROR Get demod IF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_IF_AGC() with the corresponding function. ++ -# The range of IF AGC value is 0 ~ (pow(2, 14) - 1). ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_IF_AGC)( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod digital AGC getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_DI_AGC() to get DTMB demod digital AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDiAgc Pointer to an allocated memory for storing digital AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod digital AGC value successfully. ++@retval FUNCTION_ERROR Get demod digital AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_DI_AGC() with the corresponding function. ++ -# The range of digital AGC value is 0 ~ (pow(2, 12) - 1). ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_DI_AGC)( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod TR offset getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get demod TR offset successfully. ++@retval FUNCTION_ERROR Get demod TR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_TR_OFFSET_PPM)( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod CR offset getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod CR offset successfully. ++@retval FUNCTION_ERROR Get demod CR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_CR_OFFSET_HZ)( ++ DTMB_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod carrier mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_CARRIER_MODE() to get DTMB demod carrier mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCarrierMode Pointer to an allocated memory for storing demod carrier mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod carrier mode successfully. ++@retval FUNCTION_ERROR Get demod carrier mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_CARRIER_MODE() with the corresponding function. ++ ++ ++@see DTMB_CARRIER_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_CARRIER_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCarrierMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod PN mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_PN_MODE() to get DTMB demod PN mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pPnMode Pointer to an allocated memory for storing demod PN mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod PN mode successfully. ++@retval FUNCTION_ERROR Get demod PN mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_PN_MODE() with the corresponding function. ++ ++ ++@see DTMB_PN_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_PN_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pPnMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod QAM mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_QAM_MODE() to get DTMB demod QAM mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pQamMode Pointer to an allocated memory for storing demod QAM mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod QAM mode successfully. ++@retval FUNCTION_ERROR Get demod QAM mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_QAM_MODE() with the corresponding function. ++ ++ ++@see DTMB_QAM_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_QAM_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod code rate mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_CODE_RATE_MODE() to get DTMB demod code rate mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCodeRateMode Pointer to an allocated memory for storing demod code rate mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod code rate mode successfully. ++@retval FUNCTION_ERROR Get demod code rate mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_CODE_RATE_MODE() with the corresponding function. ++ ++ ++@see DTMB_CODE_RATE_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_CODE_RATE_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pCodeRateMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod time interleaver mode getting function pointer ++ ++One can use DTMB_DEMOD_FP_GET_TIME_INTERLEAVER_MODE() to get DTMB demod time interleaver mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pTimeInterleaverMode Pointer to an allocated memory for storing demod time interleaver mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod time interleaver mode successfully. ++@retval FUNCTION_ERROR Get demod time interleaver mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_GET_TIME_INTERLEAVER_MODE() with the corresponding function. ++ ++ ++@see DTMB_TIME_INTERLEAVER_MODE ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_GET_TIME_INTERLEAVER_MODE)( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pTimeInterleaverMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod updating function pointer ++ ++One can use DTMB_DEMOD_FP_UPDATE_FUNCTION() to update demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod setting successfully. ++@retval FUNCTION_ERROR Update demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_UPDATE_FUNCTION)( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod reseting function pointer ++ ++One can use DTMB_DEMOD_FP_RESET_FUNCTION() to reset demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod setting successfully. ++@retval FUNCTION_ERROR Reset demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DTMB_DEMOD_FP_RESET_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DtmbDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_DEMOD_FP_RESET_FUNCTION)( ++ DTMB_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/// RTL2836 extra module ++typedef struct RTL2836_EXTRA_MODULE_TAG RTL2836_EXTRA_MODULE; ++struct RTL2836_EXTRA_MODULE_TAG ++{ ++ // RTL2836 update procedure enabling status ++ int IsFunc1Enabled; ++ int IsFunc2Enabled; ++ ++ // RTL2836 update Function 1 variables ++ int Func1CntThd; ++ int Func1Cnt; ++ ++ // RTL2836 update Function 2 variables ++ int Func2SignalModePrevious; ++}; ++ ++ ++ ++ ++ ++/// DTMB demod module structure ++struct DTMB_DEMOD_MODULE_TAG ++{ ++ // Private variables ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ int TsInterfaceMode; ++ int DiversityPipMode; ++ ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int IsIfFreqHzSet; ++ int IsSpectrumModeSet; ++ ++ unsigned long CurrentPageNo; // temp, because page register is write-only. ++ ++ union ///< Demod extra module used by driving module ++ { ++ RTL2836_EXTRA_MODULE Rtl2836; ++ } ++ Extra; ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ // Demod register table ++ union ++ { ++ DTMB_REG_ENTRY_ADDR_8BIT Addr8Bit[DTMB_REG_TABLE_LEN_MAX]; ++ DTMB_REG_ENTRY_ADDR_16BIT Addr16Bit[DTMB_REG_TABLE_LEN_MAX]; ++ } ++ RegTable; ++ ++ ++ // Demod I2C function pointers ++ union ++ { ++ DTMB_DEMOD_REG_ACCESS_ADDR_8BIT Addr8Bit; ++ DTMB_DEMOD_REG_ACCESS_ADDR_16BIT Addr16Bit; ++ } ++ RegAccess; ++ ++ ++ // Demod manipulating function pointers ++ DTMB_DEMOD_FP_GET_DEMOD_TYPE GetDemodType; ++ DTMB_DEMOD_FP_GET_DEVICE_ADDR GetDeviceAddr; ++ DTMB_DEMOD_FP_GET_CRYSTAL_FREQ_HZ GetCrystalFreqHz; ++ ++ DTMB_DEMOD_FP_IS_CONNECTED_TO_I2C IsConnectedToI2c; ++ ++ DTMB_DEMOD_FP_SOFTWARE_RESET SoftwareReset; ++ ++ DTMB_DEMOD_FP_INITIALIZE Initialize; ++ DTMB_DEMOD_FP_SET_IF_FREQ_HZ SetIfFreqHz; ++ DTMB_DEMOD_FP_SET_SPECTRUM_MODE SetSpectrumMode; ++ DTMB_DEMOD_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++ DTMB_DEMOD_FP_GET_SPECTRUM_MODE GetSpectrumMode; ++ ++ DTMB_DEMOD_FP_IS_SIGNAL_LOCKED IsSignalLocked; ++ ++ DTMB_DEMOD_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ DTMB_DEMOD_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ ++ DTMB_DEMOD_FP_GET_BER GetBer; ++ DTMB_DEMOD_FP_GET_PER GetPer; ++ DTMB_DEMOD_FP_GET_SNR_DB GetSnrDb; ++ ++ DTMB_DEMOD_FP_GET_RF_AGC GetRfAgc; ++ DTMB_DEMOD_FP_GET_IF_AGC GetIfAgc; ++ DTMB_DEMOD_FP_GET_DI_AGC GetDiAgc; ++ ++ DTMB_DEMOD_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ DTMB_DEMOD_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ ++ DTMB_DEMOD_FP_GET_CARRIER_MODE GetCarrierMode; ++ DTMB_DEMOD_FP_GET_PN_MODE GetPnMode; ++ DTMB_DEMOD_FP_GET_QAM_MODE GetQamMode; ++ DTMB_DEMOD_FP_GET_CODE_RATE_MODE GetCodeRateMode; ++ DTMB_DEMOD_FP_GET_TIME_INTERLEAVER_MODE GetTimeInterleaverMode; ++ ++ DTMB_DEMOD_FP_UPDATE_FUNCTION UpdateFunction; ++ DTMB_DEMOD_FP_RESET_FUNCTION ResetFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// DTMB demod default I2C functions for 8-bit address ++int ++dtmb_demod_addr_8bit_default_SetRegPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_SetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_GetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_SetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_GetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_SetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_GetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_SetRegBitsWithPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++dtmb_demod_addr_8bit_default_GetRegBitsWithPage( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// DTMB demod default I2C functions for 16-bit address ++int ++dtmb_demod_addr_16bit_default_SetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++dtmb_demod_addr_16bit_default_GetRegBytes( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++dtmb_demod_addr_16bit_default_SetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++int ++dtmb_demod_addr_16bit_default_GetRegMaskBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++int ++dtmb_demod_addr_16bit_default_SetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++dtmb_demod_addr_16bit_default_GetRegBits( ++ DTMB_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// DTMB demod default manipulating functions ++void ++dtmb_demod_default_GetDemodType( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++void ++dtmb_demod_default_GetDeviceAddr( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++void ++dtmb_demod_default_GetCrystalFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++int ++dtmb_demod_default_GetBandwidthMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pBandwidthMode ++ ); ++ ++int ++dtmb_demod_default_GetIfFreqHz( ++ DTMB_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++int ++dtmb_demod_default_GetSpectrumMode( ++ DTMB_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/dtmb_nim_base.c b/drivers/media/dvb/dvb-usb/dtmb_nim_base.c +new file mode 100644 +index 0000000..541bd48 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dtmb_nim_base.c +@@ -0,0 +1,545 @@ ++/** ++ ++@file ++ ++@brief DTMB NIM base module definition ++ ++DTMB NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++*/ ++ ++ ++#include "dtmb_nim_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_NIM_TYPE ++ ++*/ ++void ++dtmb_nim_default_GetNimType( ++ DTMB_NIM_MODULE *pNim, ++ int *pNimType ++ ) ++{ ++ // Get NIM type from NIM module. ++ *pNimType = pNim->NimType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++dtmb_nim_default_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_PARAMETERS ++ ++*/ ++int ++dtmb_nim_default_GetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ ++ ++ // Get tuner module. ++ pTuner = pNim->pTuner; ++ ++ ++ // Get tuner RF frequency in Hz. ++ if(pTuner->GetRfFreqHz(pTuner, pRfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_IS_SIGNAL_PRESENT ++ ++*/ ++int ++dtmb_nim_default_IsSignalPresent( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ DTMB_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait for signal present check. ++ for(i = 0; i < DTMB_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX_DEFAULT; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check signal lock status on demod. ++ // Note: If signal is locked, stop signal lock check. ++ if(pDemod->IsSignalLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_IS_SIGNAL_LOCKED ++ ++*/ ++int ++dtmb_nim_default_IsSignalLocked( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ DTMB_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait for signal lock check. ++ for(i = 0; i < DTMB_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check signal lock status on demod. ++ // Note: If signal is locked, stop signal lock check. ++ if(pDemod->IsSignalLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++dtmb_nim_default_GetSignalStrength( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal strength from demod. ++ if(pDemod->GetSignalStrength(pDemod, pSignalStrength) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++dtmb_nim_default_GetSignalQuality( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal quality from demod. ++ if(pDemod->GetSignalQuality(pDemod, pSignalQuality) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_BER ++ ++*/ ++int ++dtmb_nim_default_GetBer( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get BER from demod. ++ if(pDemod->GetBer(pDemod, pBerNum, pBerDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_PER ++ ++*/ ++int ++dtmb_nim_default_GetPer( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get PER from demod. ++ if(pDemod->GetPer(pDemod, pPerNum, pPerDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_SNR_DB ++ ++*/ ++int ++dtmb_nim_default_GetSnrDb( ++ DTMB_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get SNR in dB from demod. ++ if(pDemod->GetSnrDb(pDemod, pSnrDbNum, pSnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++dtmb_nim_default_GetTrOffsetPpm( ++ DTMB_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get TR offset in ppm from demod. ++ if(pDemod->GetTrOffsetPpm(pDemod, pTrOffsetPpm) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++dtmb_nim_default_GetCrOffsetHz( ++ DTMB_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get CR offset in Hz from demod. ++ if(pDemod->GetCrOffsetHz(pDemod, pCrOffsetHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_GET_SIGNAL_INFO ++ ++*/ ++int ++dtmb_nim_default_GetSignalInfo( ++ DTMB_NIM_MODULE *pNim, ++ int *pCarrierMode, ++ int *pPnMode, ++ int *pQamMode, ++ int *pCodeRateMode, ++ int *pTimeInterleaverMode ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal information from demod. ++ if(pDemod->GetCarrierMode(pDemod, pCarrierMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(pDemod->GetPnMode(pDemod, pPnMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(pDemod->GetQamMode(pDemod, pQamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(pDemod->GetCodeRateMode(pDemod, pCodeRateMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(pDemod->GetTimeInterleaverMode(pDemod, pTimeInterleaverMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++dtmb_nim_default_UpdateFunction( ++ DTMB_NIM_MODULE *pNim ++ ) ++{ ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/dtmb_nim_base.h b/drivers/media/dvb/dvb-usb/dtmb_nim_base.h +new file mode 100644 +index 0000000..fcbe3c1 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dtmb_nim_base.h +@@ -0,0 +1,951 @@ ++#ifndef __DTMB_NIM_BASE_H ++#define __DTMB_NIM_BASE_H ++ ++/** ++ ++@file ++ ++@brief DTMB NIM base module definition ++ ++DTMB NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ DTMB_NIM_MODULE *pNim; ++ DTMB_NIM_MODULE DtmbNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ unsigned long RfFreqHz; ++ ++ int Answer; ++ unsigned long SignalStrength, SignalQuality; ++ unsigned long BerNum, BerDen; ++ double Ber; ++ unsigned long PerNum, PerDen; ++ double Per; ++ unsigned long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ long TrOffsetPpm, CrOffsetHz; ++ ++ int CarrierMode; ++ int PnMode; ++ int QamMode; ++ int CodeRateMode; ++ int TimeInterleaverMode; ++ ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ &pNim, ++ &DtmbNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs // Employ CustomWaitMs() as basic waiting function. ++ ++ &DemodxExtraModuleMemory, // Employ Demod-X extra module. ++ 0x3e, // The Demod-X I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // The Demod-X crystal frequency is 27.0 MHz. ++ ... // Other arguments for Demod-X ++ ++ &TunerxExtraModuleMemory, // Employ Tuner-Y extra module. ++ 0xc0, // The Tuner-Y I2C device address is 0xc0 in 8-bit format. ++ ... // Other arguments for Tuner-Y ++ ); ++ ++ ++ ++ // Get NIM type. ++ // Note: NIM types are defined in the MODULE_TYPE enumeration. ++ pNim->GetNimType(pNim, &NimType); ++ ++ ++ ++ ++ ++ ++ ++ // ==== Initialize NIM and set its parameters ===== ++ ++ // Initialize NIM. ++ pNim->Initialize(pNim); ++ ++ // Set NIM parameters. (RF frequency) ++ // Note: In the example: RF frequency is 666 MHz. ++ RfFreqHz = 666000000; ++ pNim->SetParameters(pNim, RfFreqHz); ++ ++ ++ ++ // Wait 1 second for demod convergence. ++ ++ ++ ++ ++ ++ // ==== Get NIM information ===== ++ ++ // Get NIM parameters. (RF frequency) ++ pNim->GetParameters(pNim, &RfFreqHz); ++ ++ ++ // Get signal present status. ++ // Note: 1. The argument Answer is YES when the NIM module has found DTMB signal in the RF channel. ++ // 2. The argument Answer is NO when the NIM module does not find DTMB signal in the RF channel. ++ // Recommendation: Use the IsSignalPresent() function for channel scan. ++ pNim->IsSignalPresent(pNim, &Answer); ++ ++ // Get signal lock status. ++ // Note: 1. The argument Answer is YES when the NIM module has locked DTMB signal in the RF channel. ++ // At the same time, the NIM module sends TS packets through TS interface hardware pins. ++ // 2. The argument Answer is NO when the NIM module does not lock DTMB signal in the RF channel. ++ // Recommendation: Use the IsSignalLocked() function for signal lock check. ++ pNim->IsSignalLocked(pNim, &Answer); ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pNim->GetSignalStrength(pNim, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pNim->GetSignalQuality(pNim, &SignalQuality); ++ ++ ++ // Get BER. ++ pNim->GetBer(pNim, &BerNum, &BerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ ++ // Get PER. ++ pNim->GetPer(pNim, &PerNum, &PerDen); ++ Per = (double)PerNum / (double)PerDen; ++ ++ // Get SNR in dB. ++ pNim->GetSnrDb(pNim, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pNim->GetTrOffsetPpm(pNim, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pNim->GetCrOffsetHz(pNim, &CrOffsetHz); ++ ++ ++ // Get signal information. ++ // Note: One can find signal information definitions in the enumerations as follows: ++ // 1. DTMB_CARRIER_MODE ++ // 2. DTMB_PN_MODE ++ // 3. DTMB_QAM_MODE ++ // 4. DTMB_CODE_RATE_MODE ++ // 5. DTMB_TIME_INTERLEAVER_MODE ++ pNim->GetSignalInfo(pNim, &CarrierMode, &PnMode, &QamMode, &CodeRateMode, &TimeInterleaverMode); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++#include "tuner_base.h" ++#include "dtmb_demod_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define DTMB_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX_DEFAULT 1 ++#define DTMB_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT 1 ++ ++ ++ ++ ++ ++/// DTMB NIM module pre-definition ++typedef struct DTMB_NIM_MODULE_TAG DTMB_NIM_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB demod type getting function pointer ++ ++One can use DTMB_NIM_FP_GET_NIM_TYPE() to get DTMB NIM type. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pNimType Pointer to an allocated memory for storing NIM type ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_NIM_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*DTMB_NIM_FP_GET_NIM_TYPE)( ++ DTMB_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM initializing function pointer ++ ++One can use DTMB_NIM_FP_INITIALIZE() to initialie DTMB NIM. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize NIM successfully. ++@retval FUNCTION_ERROR Initialize NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_INITIALIZE)( ++ DTMB_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM parameter setting function pointer ++ ++One can use DTMB_NIM_FP_SET_PARAMETERS() to set DTMB NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [in] RfFreqHz RF frequency in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set NIM parameters successfully. ++@retval FUNCTION_ERROR Set NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_SET_PARAMETERS() with the corresponding function. ++ ++ ++@see DTMB_BANDWIDTH_MODE ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_SET_PARAMETERS)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM parameter getting function pointer ++ ++One can use DTMB_NIM_FP_GET_PARAMETERS() to get DTMB NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pRfFreqHz Pointer to an allocated memory for storing NIM RF frequency in Hz ++@param [out] pBandwidthMode Pointer to an allocated memory for storing NIM bandwidth mode ++ ++ ++@retval FUNCTION_SUCCESS Get NIM parameters successfully. ++@retval FUNCTION_ERROR Get NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_PARAMETERS() with the corresponding function. ++ ++ ++@see DTMB_BANDWIDTH_MODE ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_PARAMETERS)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM signal present asking function pointer ++ ++One can use DTMB_NIM_FP_IS_SIGNAL_PRESENT() to ask DTMB NIM if signal is present. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal present asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal present asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_IS_SIGNAL_PRESENT() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_IS_SIGNAL_PRESENT)( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM signal lock asking function pointer ++ ++One can use DTMB_NIM_FP_IS_SIGNAL_LOCKED() to ask DTMB NIM if signal is locked. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal lock asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal lock asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_IS_SIGNAL_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_IS_SIGNAL_LOCKED)( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM signal strength getting function pointer ++ ++One can use DTMB_NIM_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal strength successfully. ++@retval FUNCTION_ERROR Get NIM signal strength unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_SIGNAL_STRENGTH)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM signal quality getting function pointer ++ ++One can use DTMB_NIM_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal quality successfully. ++@retval FUNCTION_ERROR Get NIM signal quality unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_SIGNAL_QUALITY)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM BER value getting function pointer ++ ++One can use DTMB_NIM_FP_GET_BER() to get BER. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM BER value successfully. ++@retval FUNCTION_ERROR Get NIM BER value unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_BER() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_BER)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM PER value getting function pointer ++ ++One can use DTMB_NIM_FP_GET_PER() to get PER. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pPerNum Pointer to an allocated memory for storing PER numerator ++@param [out] pPerDen Pointer to an allocated memory for storing PER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM PER value successfully. ++@retval FUNCTION_ERROR Get NIM PER value unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_PER() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_PER)( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM SNR getting function pointer ++ ++One can use DTMB_NIM_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM SNR successfully. ++@retval FUNCTION_ERROR Get NIM SNR unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_SNR_DB)( ++ DTMB_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM TR offset getting function pointer ++ ++One can use DTMB_NIM_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get NIM TR offset successfully. ++@retval FUNCTION_ERROR Get NIM TR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_TR_OFFSET_PPM)( ++ DTMB_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM CR offset getting function pointer ++ ++One can use DTMB_NIM_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get NIM CR offset successfully. ++@retval FUNCTION_ERROR Get NIM CR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_CR_OFFSET_HZ)( ++ DTMB_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM signal information getting function pointer ++ ++One can use DTMB_NIM_FP_GET_SIGNAL_INFO() to get signal information. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pCarrierMode Pointer to an allocated memory for storing demod carrier mode ++@param [out] pPnMode Pointer to an allocated memory for storing demod PN mode ++@param [out] pQamMode Pointer to an allocated memory for storing demod QAM mode ++@param [out] pCodeRateMode Pointer to an allocated memory for storing demod code rate mode ++@param [out] pTimeInterleaverMode Pointer to an allocated memory for storing demod time interleaver mode ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal information successfully. ++@retval FUNCTION_ERROR Get NIM signal information unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_GET_SIGNAL_INFO() with the corresponding function. ++ ++ ++@see DTMB_CARRIER_MODE, DTMB_PN_MODE, DTMB_QAM_MODE, DTMB_CODE_RATE_MODE, DTMB_TIME_INTERLEAVER_MODE ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_GET_SIGNAL_INFO)( ++ DTMB_NIM_MODULE *pNim, ++ int *pCarrierMode, ++ int *pPnMode, ++ int *pQamMode, ++ int *pCodeRateMode, ++ int *pTimeInterleaverMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DTMB NIM updating function pointer ++ ++One can use DTMB_NIM_FP_UPDATE_FUNCTION() to update NIM register setting. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update NIM setting successfully. ++@retval FUNCTION_ERROR Update NIM setting unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DTMB_NIM_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++int main(void) ++{ ++ DTMB_NIM_MODULE *pNim; ++ DTMB_NIM_MODULE DtmbNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ ... ++ ); ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pNim->UpdateFunction(pNim); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DTMB_NIM_FP_UPDATE_FUNCTION)( ++ DTMB_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++// RTL2836 E4000 extra module ++typedef struct RTL2836_E4000_EXTRA_MODULE_TAG RTL2836_E4000_EXTRA_MODULE; ++struct RTL2836_E4000_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long TunerModeUpdateWaitTimeMax; ++ unsigned long TunerModeUpdateWaitTime; ++ unsigned char TunerGainMode; ++}; ++ ++ ++ ++ ++ ++// RTL2836B DTMB E4000 extra module ++typedef struct RTL2836B_DTMB_E4000_EXTRA_MODULE_TAG RTL2836B_DTMB_E4000_EXTRA_MODULE; ++struct RTL2836B_DTMB_E4000_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long TunerModeUpdateWaitTimeMax; ++ unsigned long TunerModeUpdateWaitTime; ++ unsigned char TunerGainMode; ++}; ++ ++ ++ ++ ++ ++// RTL2836B DTMB FC0012 extra module ++typedef struct RTL2836B_DTMB_FC0012_EXTRA_MODULE_TAG RTL2836B_DTMB_FC0012_EXTRA_MODULE; ++struct RTL2836B_DTMB_FC0012_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long LnaUpdateWaitTimeMax; ++ unsigned long LnaUpdateWaitTime; ++ unsigned long RssiRCalOn; ++}; ++ ++ ++ ++ ++ ++// RTL2836B DTMB FC0013B extra module ++typedef struct RTL2836B_DTMB_FC0013B_EXTRA_MODULE_TAG RTL2836B_DTMB_FC0013B_EXTRA_MODULE; ++struct RTL2836B_DTMB_FC0013B_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long LnaUpdateWaitTimeMax; ++ unsigned long LnaUpdateWaitTime; ++ unsigned long RssiRCalOn; ++}; ++ ++ ++ ++ ++ ++/// DTMB NIM module structure ++struct DTMB_NIM_MODULE_TAG ++{ ++ // Private variables ++ int NimType; ++ ++ union ///< NIM extra module used by driving module ++ { ++ RTL2836_E4000_EXTRA_MODULE Rtl2836E4000; ++ RTL2836B_DTMB_E4000_EXTRA_MODULE Rtl2836bDtmbE4000; ++ RTL2836B_DTMB_FC0012_EXTRA_MODULE Rtl2836bDtmbFc0012; ++ RTL2836B_DTMB_FC0013B_EXTRA_MODULE Rtl2836bDtmbFc0013b; ++ } ++ Extra; ++ ++ ++ // Modules ++ BASE_INTERFACE_MODULE *pBaseInterface; ///< Base interface module pointer ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ///< Base interface module memory ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ///< I2C bridge module pointer ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ///< I2C bridge module memory ++ ++ TUNER_MODULE *pTuner; ///< Tuner module pointer ++ TUNER_MODULE TunerModuleMemory; ///< Tuner module memory ++ ++ DTMB_DEMOD_MODULE *pDemod; ///< DTMB demod module pointer ++ DTMB_DEMOD_MODULE DtmbDemodModuleMemory; ///< DTMB demod module memory ++ ++ ++ // NIM manipulating functions ++ DTMB_NIM_FP_GET_NIM_TYPE GetNimType; ++ DTMB_NIM_FP_INITIALIZE Initialize; ++ DTMB_NIM_FP_SET_PARAMETERS SetParameters; ++ DTMB_NIM_FP_GET_PARAMETERS GetParameters; ++ DTMB_NIM_FP_IS_SIGNAL_PRESENT IsSignalPresent; ++ DTMB_NIM_FP_IS_SIGNAL_LOCKED IsSignalLocked; ++ DTMB_NIM_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ DTMB_NIM_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ DTMB_NIM_FP_GET_BER GetBer; ++ DTMB_NIM_FP_GET_PER GetPer; ++ DTMB_NIM_FP_GET_SNR_DB GetSnrDb; ++ DTMB_NIM_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ DTMB_NIM_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ DTMB_NIM_FP_GET_SIGNAL_INFO GetSignalInfo; ++ DTMB_NIM_FP_UPDATE_FUNCTION UpdateFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// DTMB NIM default manipulaing functions ++void ++dtmb_nim_default_GetNimType( ++ DTMB_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++int ++dtmb_nim_default_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ); ++ ++int ++dtmb_nim_default_GetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz ++ ); ++ ++int ++dtmb_nim_default_IsSignalPresent( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++dtmb_nim_default_IsSignalLocked( ++ DTMB_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++dtmb_nim_default_GetSignalStrength( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++dtmb_nim_default_GetSignalQuality( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++dtmb_nim_default_GetBer( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++int ++dtmb_nim_default_GetPer( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++int ++dtmb_nim_default_GetSnrDb( ++ DTMB_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++dtmb_nim_default_GetTrOffsetPpm( ++ DTMB_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++int ++dtmb_nim_default_GetCrOffsetHz( ++ DTMB_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++int ++dtmb_nim_default_GetSignalInfo( ++ DTMB_NIM_MODULE *pNim, ++ int *pCarrierMode, ++ int *pPnMode, ++ int *pQamMode, ++ int *pCodeRateMode, ++ int *pTimeInterleaverMode ++ ); ++ ++int ++dtmb_nim_default_UpdateFunction( ++ DTMB_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +index 9df8f28..442f15c 100644 +--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h ++++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +@@ -305,6 +305,7 @@ + #define USB_PID_WINFAST_DTV_DONGLE_H 0x60f6 + #define USB_PID_WINFAST_DTV_DONGLE_STK7700P_2 0x6f01 + #define USB_PID_WINFAST_DTV_DONGLE_GOLD 0x6029 ++#define USB_PID_WINFAST_DTV_DONGLE_MINI 0x6a03 + #define USB_PID_GENPIX_8PSK_REV_1_COLD 0x0200 + #define USB_PID_GENPIX_8PSK_REV_1_WARM 0x0201 + #define USB_PID_GENPIX_8PSK_REV_2 0x0202 +diff --git a/drivers/media/dvb/dvb-usb/dvbt_demod_base.c b/drivers/media/dvb/dvb-usb/dvbt_demod_base.c +new file mode 100644 +index 0000000..ef4a787 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dvbt_demod_base.c +@@ -0,0 +1,816 @@ ++/** ++ ++@file ++ ++@brief DVB-T demod default function definition ++ ++DVB-T demod default functions. ++ ++*/ ++ ++#include "dvbt_demod_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE ++ ++*/ ++int ++dvbt_demod_default_SetRegPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBytes[LEN_2_BYTE]; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Set demod register page with page number. ++ // Note: The I2C format of demod register page setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + DVBT_DEMOD_PAGE_REG_ADDR + PageNo + stop_bit ++ WritingBytes[0] = DVBT_DEMOD_PAGE_REG_ADDR; ++ WritingBytes[1] = (unsigned char)PageNo; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBytes, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ if( mutex_lock_interruptible(&d->usb_mutex) ) goto error; ++ ++ pDemod->CurrentPageNo = PageNo; ++ ++ mutex_unlock(&d->usb_mutex); ++ ++ return FUNCTION_SUCCESS; ++ ++error: ++ return FUNCTION_ERROR; ++ ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_REG_BYTES ++ ++*/ ++int ++dvbt_demod_default_SetRegBytes( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned char ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = RegStartAddr + i; ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, WritingByteNum + LEN_1_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned char WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = RegStartAddr + i; ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[j] = pWritingBytes[i + j]; ++ ++ // Set demod register bytes with writing buffer. ++ if(write_demod_register( d, DeviceAddr, pDemod->CurrentPageNo, RegWritingAddr, WritingBuffer, WritingByteNum )) goto error; ++ ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++error: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_REG_BYTES ++ ++*/ ++int ++dvbt_demod_default_GetRegBytes( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i; ++ unsigned char DeviceAddr; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = RegStartAddr + i; ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, &RegReadingAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i; ++ unsigned char DeviceAddr; ++ unsigned char ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = RegStartAddr + i; ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Get demod register bytes. ++ if(read_demod_register(d, DeviceAddr, pDemod->CurrentPageNo, RegReadingAddr, &pReadingBytes[i], ReadingByteNum)) goto error; ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++error: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_REG_MASK_BITS ++ ++*/ ++int ++dvbt_demod_default_SetRegMaskBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ unsigned char WritingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value MSB. ++ // Put upper address byte on value LSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * (ByteNum - i -1)); ++ ++ ++ // Reserve unsigned integer value unmask bit with mask and inlay writing value into it. ++ Value &= ~Mask; ++ Value |= (WritingValue << Shift) & Mask; ++ ++ ++ // Separate unsigned integer value into writing bytes. ++ // Note: Pick up lower address byte from value MSB. ++ // Pick up upper address byte from value LSB. ++ for(i = 0; i < ByteNum; i++) ++ WritingBytes[i] = (unsigned char)((Value >> (BYTE_SHIFT * (ByteNum - i -1))) & BYTE_MASK); ++ ++ ++ // Write demod register bytes with writing bytes. ++ if(pDemod->SetRegBytes(pDemod, RegStartAddr, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_REG_MASK_BITS ++ ++*/ ++int ++dvbt_demod_default_GetRegMaskBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value MSB. ++ // Put upper address byte on value LSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * (ByteNum - i -1)); ++ ++ ++ // Get register bits from unsigned integaer value with mask and shift ++ *pReadingValue = (Value & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_REG_BITS ++ ++*/ ++int ++dvbt_demod_default_SetRegBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable[RegBitName].Msb; ++ Lsb = pDemod->RegTable[RegBitName].Lsb; ++ ++ ++ // Set register mask bits. ++ if(pDemod->SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_REG_BITS ++ ++*/ ++int ++dvbt_demod_default_GetRegBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->RegTable[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from register table with register bit name key. ++ RegStartAddr = pDemod->RegTable[RegBitName].RegStartAddr; ++ Msb = pDemod->RegTable[RegBitName].Msb; ++ Lsb = pDemod->RegTable[RegBitName].Lsb; ++ ++ ++ // Get register mask bits. ++ if(pDemod->GetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++dvbt_demod_default_SetRegBitsWithPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned long PageNo; ++ ++ ++ // Get register page number from register table with register bit name key. ++ PageNo = pDemod->RegTable[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set register mask bits with register bit name key. ++ if(pDemod->SetRegBits(pDemod, RegBitName, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++dvbt_demod_default_GetRegBitsWithPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned long PageNo; ++ ++ ++ // Get register page number from register table with register bit name key. ++ PageNo = pDemod->RegTable[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get register mask bits with register bit name key. ++ if(pDemod->GetRegBits(pDemod, RegBitName, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_DEMOD_TYPE ++ ++*/ ++void ++dvbt_demod_default_GetDemodType( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ) ++{ ++ // Get demod type from demod module. ++ *pDemodType = pDemod->DemodType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++dvbt_demod_default_GetDeviceAddr( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get demod I2C device address from demod module. ++ *pDeviceAddr = pDemod->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_CRYSTAL_FREQ_HZ ++ ++*/ ++void ++dvbt_demod_default_GetCrystalFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ) ++{ ++ // Get demod crystal frequency in Hz from demod module. ++ *pCrystalFreqHz = pDemod->CrystalFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_BANDWIDTH_MODE ++ ++*/ ++int ++dvbt_demod_default_GetBandwidthMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pBandwidthMode ++ ) ++{ ++ // Get demod bandwidth mode from demod module. ++ if(pDemod->IsBandwidthModeSet != YES) ++ goto error_status_get_demod_bandwidth_mode; ++ ++ *pBandwidthMode = pDemod->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_IF_FREQ_HZ ++ ++*/ ++int ++dvbt_demod_default_GetIfFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ) ++{ ++ // Get demod IF frequency in Hz from demod module. ++ if(pDemod->IsIfFreqHzSet != YES) ++ goto error_status_get_demod_if_frequency; ++ ++ *pIfFreqHz = pDemod->IfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_if_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_DEMOD_FP_GET_SPECTRUM_MODE ++ ++*/ ++int ++dvbt_demod_default_GetSpectrumMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ) ++{ ++ // Get demod spectrum mode from demod module. ++ if(pDemod->IsSpectrumModeSet != YES) ++ goto error_status_get_demod_spectrum_mode; ++ ++ *pSpectrumMode = pDemod->SpectrumMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_spectrum_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/dvbt_demod_base.h b/drivers/media/dvb/dvb-usb/dvbt_demod_base.h +new file mode 100644 +index 0000000..edf7f19 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dvbt_demod_base.h +@@ -0,0 +1,2722 @@ ++#ifndef __DVBT_DEMOD_BASE_H ++#define __DVBT_DEMOD_BASE_H ++ ++/** ++ ++@file ++ ++@brief DVB-T demod base module definition ++ ++DVB-T demod base module definitions contains demod module structure, demod funciton pointers, and demod definitions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_xxx.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ int BandwidthMode; ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ ++ long RfAgc, IfAgc; ++ unsigned char DiAgc; ++ ++ int Answer; ++ long TrOffsetPpm, CrOffsetHz; ++ unsigned long BerNum, BerDen; ++ double Ber; ++ long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ unsigned long SignalStrength, SignalQuality; ++ ++ int Constellation; ++ int Hierarchy; ++ int CodeRateLp; ++ int CodeRateHp; ++ int GuardInterval; ++ int FftMode; ++ ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pBaseInterface, ++ &BaseInterfaceModuleMemory, ++ 9, // Set maximum I2C reading byte number with 9. ++ 8, // Set maximum I2C writing byte number with 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs // Employ CustomWaitMs() as basic waiting function. ++ ); ++ ++ ++ // Build DVB-T demod XXX module. ++ BuildXxxModule( ++ &pDemod, ++ &DvbtDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x20, // Demod I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // Demod crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // Demod TS interface mode is serial. ++ ... // Other arguments by each demod module ++ ); ++ ++ ++ ++ ++ ++ // ==== Initialize DVB-T demod and set its parameters ===== ++ ++ // Initialize demod. ++ pDemod->Initialize(pDemod); ++ ++ ++ // Set demod parameters. (bandwidth mode, IF frequency, spectrum mode) ++ // Note: In the example: ++ // 1. Bandwidth mode is 8 MHz. ++ // 2. IF frequency is 36.125 MHz. ++ // 3. Spectrum mode is SPECTRUM_INVERSE. ++ BandwidthMode = DVBT_BANDWIDTH_8MHZ; ++ IfFreqHz = IF_FREQ_36125000HZ; ++ SpectrumMode = SPECTRUM_INVERSE; ++ ++ pDemod->SetBandwidthMode(pDemod, BandwidthMode); ++ pDemod->SetIfFreqHz(pDemod, IfFreqHz); ++ pDemod->SetSpectrumMode(pDemod, SpectrumMode); ++ ++ ++ // Need to set tuner before demod software reset. ++ // The order to set demod and tuner is not important. ++ // Note: One can use "pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1);" ++ // for tuner I2C command forwarding. ++ ++ ++ // Reset demod by software reset. ++ pDemod->SoftwareReset(pDemod); ++ ++ ++ // Wait maximum 1000 ms for demod converge. ++ for(i = 0; i < 25; i++) ++ { ++ // Wait 40 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 40); ++ ++ // Check signal lock status. ++ // Note: If Answer is YES, signal is locked. ++ // If Answer is NO, signal is not locked. ++ pDemod->IsSignalLocked(pDemod, &Answer); ++ ++ if(Answer == YES) ++ { ++ // Signal is locked. ++ break; ++ } ++ } ++ ++ ++ ++ ++ ++ // ==== Get DVB-T demod information ===== ++ ++ // Get demod type. ++ // Note: One can find demod type in MODULE_TYPE enumeration. ++ pDemod->GetDemodType(pDemod, &DemodType); ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Ask demod if it is connected to I2C bus. ++ // Note: If Answer is YES, demod is connected to I2C bus. ++ // If Answer is NO, demod is not connected to I2C bus. ++ pDemod->IsConnectedToI2c(pDemod, &Answer); ++ ++ ++ // Get demod parameters. (bandwidth mode, IF frequency, spectrum mode) ++ pDemod->GetBandwidthMode(pDemod, &BandwidthMode); ++ pDemod->GetIfFreqHz(pDemod, &IfFreqHz); ++ pDemod->GetSpectrumMode(pDemod, &SpectrumMode); ++ ++ ++ // Get demod AGC value. ++ // Note: The range of RF AGC and IF AGC value is -8192 ~ 8191. ++ // The range of digital AGC value is 0 ~ 255. ++ pDemod->GetRfAgc(pDemod, &RfAgc); ++ pDemod->GetIfAgc(pDemod, &IfAgc); ++ pDemod->GetDiAgc(pDemod, &DiAgc); ++ ++ ++ // Get demod lock status. ++ // Note: If Answer is YES, it is locked. ++ // If Answer is NO, it is not locked. ++ pDemod->IsTpsLocked(pDemod, &Answer); ++ pDemod->IsSignalLocked(pDemod, &Answer); ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pDemod->GetTrOffsetPpm(pDemod, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pDemod->GetCrOffsetHz(pDemod, &CrOffsetHz); ++ ++ ++ // Get BER. ++ pDemod->GetBer(pDemod, &BerNum, &BerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ ++ // Get SNR in dB. ++ pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pDemod->GetSignalStrength(pDemod, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pDemod->GetSignalQuality(pDemod, &SignalQuality); ++ ++ ++ // Get TPS information. ++ // Note: One can find TPS information definitions in the enumerations as follows: ++ // 1. DVBT_CONSTELLATION_MODE ++ // 2. DVBT_HIERARCHY_MODE ++ // 3. DVBT_CODE_RATE_MODE (for low-priority and high-priority code rate) ++ // 4. DVBT_GUARD_INTERVAL_MODE ++ // 5. DVBT_FFT_MODE_MODE ++ pDemod->GetConstellation(pDemod, &Constellation); ++ pDemod->GetHierarchy(pDemod, &Hierarchy); ++ pDemod->GetCodeRateLp(pDemod, &CodeRateLp); ++ pDemod->GetCodeRateHp(pDemod, &CodeRateHp); ++ pDemod->GetGuardInterval(pDemod, &GuardInterval); ++ pDemod->GetFftMode(pDemod, &FftMode); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// Page register address ++#define DVBT_DEMOD_PAGE_REG_ADDR 0x00 ++ ++ ++// Bandwidth modes ++#define DVBT_BANDWIDTH_NONE -1 ++enum DVBT_BANDWIDTH_MODE ++{ ++ DVBT_BANDWIDTH_6MHZ, ++ DVBT_BANDWIDTH_7MHZ, ++ DVBT_BANDWIDTH_8MHZ, ++}; ++#define DVBT_BANDWIDTH_MODE_NUM 3 ++ ++ ++// Constellation ++enum DVBT_CONSTELLATION_MODE ++{ ++ DVBT_CONSTELLATION_QPSK, ++ DVBT_CONSTELLATION_16QAM, ++ DVBT_CONSTELLATION_64QAM, ++}; ++#define DVBT_CONSTELLATION_NUM 3 ++ ++ ++// Hierarchy ++enum DVBT_HIERARCHY_MODE ++{ ++ DVBT_HIERARCHY_NONE, ++ DVBT_HIERARCHY_ALPHA_1, ++ DVBT_HIERARCHY_ALPHA_2, ++ DVBT_HIERARCHY_ALPHA_4, ++}; ++#define DVBT_HIERARCHY_NUM 4 ++ ++ ++// Code rate ++enum DVBT_CODE_RATE_MODE ++{ ++ DVBT_CODE_RATE_1_OVER_2, ++ DVBT_CODE_RATE_2_OVER_3, ++ DVBT_CODE_RATE_3_OVER_4, ++ DVBT_CODE_RATE_5_OVER_6, ++ DVBT_CODE_RATE_7_OVER_8, ++}; ++#define DVBT_CODE_RATE_NUM 5 ++ ++ ++// Guard interval ++enum DVBT_GUARD_INTERVAL_MODE ++{ ++ DVBT_GUARD_INTERVAL_1_OVER_32, ++ DVBT_GUARD_INTERVAL_1_OVER_16, ++ DVBT_GUARD_INTERVAL_1_OVER_8, ++ DVBT_GUARD_INTERVAL_1_OVER_4, ++}; ++#define DVBT_GUARD_INTERVAL_NUM 4 ++ ++ ++// FFT mode ++enum DVBT_FFT_MODE_MODE ++{ ++ DVBT_FFT_MODE_2K, ++ DVBT_FFT_MODE_8K, ++}; ++#define DVBT_FFT_MODE_NUM 2 ++ ++ ++ ++ ++ ++// Register entry definitions ++ ++// Register entry ++typedef struct ++{ ++ int IsAvailable; ++ unsigned long PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DVBT_REG_ENTRY; ++ ++ ++ ++// Primary register entry ++typedef struct ++{ ++ int RegBitName; ++ unsigned long PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++DVBT_PRIMARY_REG_ENTRY; ++ ++ ++ ++ ++ ++// Register table dependence ++ ++// Demod register bit names ++enum DVBT_REG_BIT_NAME ++{ ++ // Software reset register ++ DVBT_SOFT_RST, ++ ++ // Tuner I2C forwording register ++ DVBT_IIC_REPEAT, ++ ++ ++ // Registers for initializing ++ DVBT_TR_WAIT_MIN_8K, ++ DVBT_RSD_BER_FAIL_VAL, ++ DVBT_EN_BK_TRK, ++ DVBT_REG_PI, ++ ++ DVBT_REG_PFREQ_1_0, // For RTL2830 only ++ DVBT_PD_DA8, // For RTL2830 only ++ DVBT_LOCK_TH, // For RTL2830 only ++ DVBT_BER_PASS_SCAL, // For RTL2830 only ++ DVBT_CE_FFSM_BYPASS, // For RTL2830 only ++ DVBT_ALPHAIIR_N, // For RTL2830 only ++ DVBT_ALPHAIIR_DIF, // For RTL2830 only ++ DVBT_EN_TRK_SPAN, // For RTL2830 only ++ DVBT_LOCK_TH_LEN, // For RTL2830 only ++ DVBT_CCI_THRE, // For RTL2830 only ++ DVBT_CCI_MON_SCAL, // For RTL2830 only ++ DVBT_CCI_M0, // For RTL2830 only ++ DVBT_CCI_M1, // For RTL2830 only ++ DVBT_CCI_M2, // For RTL2830 only ++ DVBT_CCI_M3, // For RTL2830 only ++ DVBT_SPEC_INIT_0, // For RTL2830 only ++ DVBT_SPEC_INIT_1, // For RTL2830 only ++ DVBT_SPEC_INIT_2, // For RTL2830 only ++ ++ DVBT_AD_EN_REG, // For RTL2832 only ++ DVBT_AD_EN_REG1, // For RTL2832 only ++ DVBT_EN_BBIN, // For RTL2832 only ++ DVBT_MGD_THD0, // For RTL2832 only ++ DVBT_MGD_THD1, // For RTL2832 only ++ DVBT_MGD_THD2, // For RTL2832 only ++ DVBT_MGD_THD3, // For RTL2832 only ++ DVBT_MGD_THD4, // For RTL2832 only ++ DVBT_MGD_THD5, // For RTL2832 only ++ DVBT_MGD_THD6, // For RTL2832 only ++ DVBT_MGD_THD7, // For RTL2832 only ++ DVBT_EN_CACQ_NOTCH, // For RTL2832 only ++ DVBT_AD_AV_REF, // For RTL2832 only ++ DVBT_PIP_ON, // For RTL2832 only ++ DVBT_SCALE1_B92, // For RTL2832 only ++ DVBT_SCALE1_B93, // For RTL2832 only ++ DVBT_SCALE1_BA7, // For RTL2832 only ++ DVBT_SCALE1_BA9, // For RTL2832 only ++ DVBT_SCALE1_BAA, // For RTL2832 only ++ DVBT_SCALE1_BAB, // For RTL2832 only ++ DVBT_SCALE1_BAC, // For RTL2832 only ++ DVBT_SCALE1_BB0, // For RTL2832 only ++ DVBT_SCALE1_BB1, // For RTL2832 only ++ DVBT_KB_P1, // For RTL2832 only ++ DVBT_KB_P2, // For RTL2832 only ++ DVBT_KB_P3, // For RTL2832 only ++ DVBT_OPT_ADC_IQ, // For RTL2832 only ++ DVBT_AD_AVI, // For RTL2832 only ++ DVBT_AD_AVQ, // For RTL2832 only ++ DVBT_K1_CR_STEP12, // For RTL2832 only ++ ++ // Registers for initializing according to mode ++ DVBT_TRK_KS_P2, ++ DVBT_TRK_KS_I2, ++ DVBT_TR_THD_SET2, ++ DVBT_TRK_KC_P2, ++ DVBT_TRK_KC_I2, ++ DVBT_CR_THD_SET2, ++ ++ // Registers for IF setting ++ DVBT_PSET_IFFREQ, ++ DVBT_SPEC_INV, ++ ++ ++ // Registers for bandwidth programming ++ DVBT_BW_INDEX, // For RTL2830 only ++ ++ DVBT_RSAMP_RATIO, // For RTL2832 only ++ DVBT_CFREQ_OFF_RATIO, // For RTL2832 only ++ ++ ++ // FSM stage register ++ DVBT_FSM_STAGE, ++ ++ // TPS content registers ++ DVBT_RX_CONSTEL, ++ DVBT_RX_HIER, ++ DVBT_RX_C_RATE_LP, ++ DVBT_RX_C_RATE_HP, ++ DVBT_GI_IDX, ++ DVBT_FFT_MODE_IDX, ++ ++ // Performance measurement registers ++ DVBT_RSD_BER_EST, ++ DVBT_CE_EST_EVM, ++ ++ // AGC registers ++ DVBT_RF_AGC_VAL, ++ DVBT_IF_AGC_VAL, ++ DVBT_DAGC_VAL, ++ ++ // TR offset and CR offset registers ++ DVBT_SFREQ_OFF, ++ DVBT_CFREQ_OFF, ++ ++ ++ // AGC relative registers ++ DVBT_POLAR_RF_AGC, ++ DVBT_POLAR_IF_AGC, ++ DVBT_AAGC_HOLD, ++ DVBT_EN_RF_AGC, ++ DVBT_EN_IF_AGC, ++ DVBT_IF_AGC_MIN, ++ DVBT_IF_AGC_MAX, ++ DVBT_RF_AGC_MIN, ++ DVBT_RF_AGC_MAX, ++ DVBT_IF_AGC_MAN, ++ DVBT_IF_AGC_MAN_VAL, ++ DVBT_RF_AGC_MAN, ++ DVBT_RF_AGC_MAN_VAL, ++ DVBT_DAGC_TRG_VAL, ++ ++ DVBT_AGC_TARG_VAL, // For RTL2830 only ++ DVBT_LOOP_GAIN_3_0, // For RTL2830 only ++ DVBT_LOOP_GAIN_4, // For RTL2830 only ++ DVBT_VTOP, // For RTL2830 only ++ DVBT_KRF, // For RTL2830 only ++ ++ DVBT_AGC_TARG_VAL_0, // For RTL2832 only ++ DVBT_AGC_TARG_VAL_8_1, // For RTL2832 only ++ DVBT_AAGC_LOOP_GAIN, // For RTL2832 only ++ DVBT_LOOP_GAIN2_3_0, // For RTL2832 only ++ DVBT_LOOP_GAIN2_4, // For RTL2832 only ++ DVBT_LOOP_GAIN3, // For RTL2832 only ++ DVBT_VTOP1, // For RTL2832 only ++ DVBT_VTOP2, // For RTL2832 only ++ DVBT_VTOP3, // For RTL2832 only ++ DVBT_KRF1, // For RTL2832 only ++ DVBT_KRF2, // For RTL2832 only ++ DVBT_KRF3, // For RTL2832 only ++ DVBT_KRF4, // For RTL2832 only ++ DVBT_EN_GI_PGA, // For RTL2832 only ++ DVBT_THD_LOCK_UP, // For RTL2832 only ++ DVBT_THD_LOCK_DW, // For RTL2832 only ++ DVBT_THD_UP1, // For RTL2832 only ++ DVBT_THD_DW1, // For RTL2832 only ++ DVBT_INTER_CNT_LEN, // For RTL2832 only ++ DVBT_GI_PGA_STATE, // For RTL2832 only ++ DVBT_EN_AGC_PGA, // For RTL2832 only ++ ++ ++ // TS interface registers ++ DVBT_CKOUTPAR, ++ DVBT_CKOUT_PWR, ++ DVBT_SYNC_DUR, ++ DVBT_ERR_DUR, ++ DVBT_SYNC_LVL, ++ DVBT_ERR_LVL, ++ DVBT_VAL_LVL, ++ DVBT_SERIAL, ++ DVBT_SER_LSB, ++ DVBT_CDIV_PH0, ++ DVBT_CDIV_PH1, ++ ++ DVBT_MPEG_IO_OPT_2_2, // For RTL2832 only ++ DVBT_MPEG_IO_OPT_1_0, // For RTL2832 only ++ DVBT_CKOUTPAR_PIP, // For RTL2832 only ++ DVBT_CKOUT_PWR_PIP, // For RTL2832 only ++ DVBT_SYNC_LVL_PIP, // For RTL2832 only ++ DVBT_ERR_LVL_PIP, // For RTL2832 only ++ DVBT_VAL_LVL_PIP, // For RTL2832 only ++ DVBT_CKOUTPAR_PID, // For RTL2832 only ++ DVBT_CKOUT_PWR_PID, // For RTL2832 only ++ DVBT_SYNC_LVL_PID, // For RTL2832 only ++ DVBT_ERR_LVL_PID, // For RTL2832 only ++ DVBT_VAL_LVL_PID, // For RTL2832 only ++ ++ ++ // FSM state-holding register ++ DVBT_SM_PASS, ++ ++ // Registers for function 2 (for RTL2830 only) ++ DVBT_UPDATE_REG_2, ++ ++ // Registers for function 3 (for RTL2830 only) ++ DVBT_BTHD_P3, ++ DVBT_BTHD_D3, ++ ++ // Registers for function 4 (for RTL2830 only) ++ DVBT_FUNC4_REG0, ++ DVBT_FUNC4_REG1, ++ DVBT_FUNC4_REG2, ++ DVBT_FUNC4_REG3, ++ DVBT_FUNC4_REG4, ++ DVBT_FUNC4_REG5, ++ DVBT_FUNC4_REG6, ++ DVBT_FUNC4_REG7, ++ DVBT_FUNC4_REG8, ++ DVBT_FUNC4_REG9, ++ DVBT_FUNC4_REG10, ++ ++ // Registers for functin 5 (for RTL2830 only) ++ DVBT_FUNC5_REG0, ++ DVBT_FUNC5_REG1, ++ DVBT_FUNC5_REG2, ++ DVBT_FUNC5_REG3, ++ DVBT_FUNC5_REG4, ++ DVBT_FUNC5_REG5, ++ DVBT_FUNC5_REG6, ++ DVBT_FUNC5_REG7, ++ DVBT_FUNC5_REG8, ++ DVBT_FUNC5_REG9, ++ DVBT_FUNC5_REG10, ++ DVBT_FUNC5_REG11, ++ DVBT_FUNC5_REG12, ++ DVBT_FUNC5_REG13, ++ DVBT_FUNC5_REG14, ++ DVBT_FUNC5_REG15, ++ DVBT_FUNC5_REG16, ++ DVBT_FUNC5_REG17, ++ DVBT_FUNC5_REG18, ++ ++ ++ // AD7 registers (for RTL2832 only) ++ DVBT_AD7_SETTING, ++ DVBT_RSSI_R, ++ ++ // ACI detection registers (for RTL2832 only) ++ DVBT_ACI_DET_IND, ++ ++ // Clock output registers (for RTL2832 only) ++ DVBT_REG_MON, ++ DVBT_REG_MONSEL, ++ DVBT_REG_GPE, ++ DVBT_REG_GPO, ++ DVBT_REG_4MSEL, ++ ++ ++ // Test registers for test only ++ DVBT_TEST_REG_1, ++ DVBT_TEST_REG_2, ++ DVBT_TEST_REG_3, ++ DVBT_TEST_REG_4, ++ ++ // Item terminator ++ DVBT_REG_BIT_NAME_ITEM_TERMINATOR, ++}; ++ ++ ++ ++// Register table length definitions ++#define DVBT_REG_TABLE_LEN_MAX DVBT_REG_BIT_NAME_ITEM_TERMINATOR ++ ++ ++ ++ ++ ++// DVB-T demod module pre-definition ++typedef struct DVBT_DEMOD_MODULE_TAG DVBT_DEMOD_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register page setting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_SET_REG_PAGE() to set demod register page. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] PageNo Page number ++ ++ ++@retval FUNCTION_SUCCESS Set register page successfully with page number. ++@retval FUNCTION_ERROR Set register page unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_REG_PAGE() with the corresponding function. ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register page with page number 2. ++ pDemod->SetRegPage(pDemod, 2); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_REG_PAGE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register byte setting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_SET_REG_BYTES() to set demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] pWritingBytes Pointer to writing bytes ++@param [in] ByteNum Writing byte number ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bytes successfully with writing bytes. ++@retval FUNCTION_ERROR Set demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by DVBT_DEMOD_FP_SET_REG_PAGE() before using DVBT_DEMOD_FP_SET_REG_BYTES(). ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_GET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char WritingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bytes (page 1, address 0x17 ~ 0x1b) with 5 writing bytes. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBytes(pDemod, 0x17, WritingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_REG_BYTES)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned char ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register byte getting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_GET_REG_BYTES() to get demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [out] pReadingBytes Pointer to an allocated memory for storing reading bytes ++@param [in] ByteNum Reading byte number ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bytes successfully with reading byte number. ++@retval FUNCTION_ERROR Get demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by DVBT_DEMOD_FP_SET_REG_PAGE() before using DVBT_DEMOD_FP_GET_REG_BYTES(). ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_SET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char ReadingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bytes (page 1, address 0x17 ~ 0x1b) with reading byte number 5. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBytes(pDemod, 0x17, ReadingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_REG_BYTES)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register mask bits setting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_SET_REG_MASK_BITS() to set demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register mask bits successfully with writing value. ++@retval FUNCTION_ERROR Set demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by DVBT_DEMOD_FP_SET_REG_PAGE() before using DVBT_DEMOD_FP_SET_REG_MASK_BITS(). ++ -# The constraints of DVBT_DEMOD_FP_SET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_GET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits (page 1, address {0x18, 0x17} [12:5]) with writing value 0x1d. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegMaskBits(pDemod, 0x17, 12, 5, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x17 0x18 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_REG_MASK_BITS)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register mask bits getting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_GET_REG_MASK_BITS() to get demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register mask bits successfully. ++@retval FUNCTION_ERROR Get demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by DVBT_DEMOD_FP_SET_REG_PAGE() before using DVBT_DEMOD_FP_GET_REG_MASK_BITS(). ++ -# The constraints of DVBT_DEMOD_FP_GET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_SET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits (page 1, address {0x18, 0x17} [12:5]). ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegMaskBits(pDemod, 0x17, 12, 5, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_REG_MASK_BITS)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register bits setting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_SET_REG_BITS() to set demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using DVBT_DEMOD_FP_SET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_GET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBits(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_REG_BITS)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register bits getting function pointer ++ ++Demod upper level functions will use DVBT_DEMOD_FP_GET_REG_BITS() to get demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using DVBT_DEMOD_FP_GET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_PAGE, DVBT_DEMOD_FP_SET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBits(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_REG_BITS)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register bits setting function pointer (with page setting) ++ ++Demod upper level functions will use DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE() to set demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name, page setting, and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod register bits getting function pointer (with page setting) ++ ++Demod upper level functions will use DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE() to get demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name and page setting. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->GetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod type getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_DEMOD_TYPE() to get DVB-T demod type. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDemodType Pointer to an allocated memory for storing demod type ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_DEMOD_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*DVBT_DEMOD_FP_GET_DEMOD_TYPE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod I2C device address getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_DEVICE_ADDR() to get DVB-T demod I2C device address. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDeviceAddr Pointer to an allocated memory for storing demod I2C device address ++ ++ ++@retval FUNCTION_SUCCESS Get demod device address successfully. ++@retval FUNCTION_ERROR Get demod device address unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_DEVICE_ADDR() with the corresponding function. ++ ++*/ ++typedef void ++(*DVBT_DEMOD_FP_GET_DEVICE_ADDR)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod crystal frequency getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() to get DVB-T demod crystal frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrystalFreqHz Pointer to an allocated memory for storing demod crystal frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod crystal frequency successfully. ++@retval FUNCTION_ERROR Get demod crystal frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() with the corresponding function. ++ ++*/ ++typedef void ++(*DVBT_DEMOD_FP_GET_CRYSTAL_FREQ_HZ)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod I2C bus connection asking function pointer ++ ++One can use DVBT_DEMOD_FP_IS_CONNECTED_TO_I2C() to ask DVB-T demod if it is connected to I2C bus. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_IS_CONNECTED_TO_I2C() with the corresponding function. ++ ++*/ ++typedef void ++(*DVBT_DEMOD_FP_IS_CONNECTED_TO_I2C)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod software resetting function pointer ++ ++One can use DVBT_DEMOD_FP_SOFTWARE_RESET() to reset DVB-T demod by software reset. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod by software reset successfully. ++@retval FUNCTION_ERROR Reset demod by software reset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SOFTWARE_RESET() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SOFTWARE_RESET)( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod initializing function pointer ++ ++One can use DVBT_DEMOD_FP_INITIALIZE() to initialie DVB-T demod. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize demod successfully. ++@retval FUNCTION_ERROR Initialize demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_INITIALIZE)( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod bandwidth mode setting function pointer ++ ++One can use DVBT_DEMOD_FP_SET_DVBT_MODE() to set DVB-T demod bandwidth mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] BandwidthMode Bandwidth mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod bandwidth mode successfully. ++@retval FUNCTION_ERROR Set demod bandwidth mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_DVBT_MODE() with the corresponding function. ++ ++ ++@see DVBT_BANDWIDTH_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_BANDWIDTH_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod IF frequency setting function pointer ++ ++One can use DVBT_DEMOD_FP_SET_IF_FREQ_HZ() to set DVB-T demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] IfFreqHz IF frequency in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod IF frequency successfully. ++@retval FUNCTION_ERROR Set demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_IF_FREQ_HZ)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod spectrum mode setting function pointer ++ ++One can use DVBT_DEMOD_FP_SET_SPECTRUM_MODE() to set DVB-T demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] SpectrumMode Spectrum mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod spectrum mode successfully. ++@retval FUNCTION_ERROR Set demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_SET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_SET_SPECTRUM_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod bandwidth mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_DVBT_MODE() to get DVB-T demod bandwidth mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pBandwidthMode Pointer to an allocated memory for storing demod bandwidth mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod bandwidth mode successfully. ++@retval FUNCTION_ERROR Get demod bandwidth mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_DVBT_MODE() with the corresponding function. ++ ++ ++@see DVBT_DVBT_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_BANDWIDTH_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod IF frequency getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_IF_FREQ_HZ() to get DVB-T demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfFreqHz Pointer to an allocated memory for storing demod IF frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF frequency successfully. ++@retval FUNCTION_ERROR Get demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_IF_FREQ_HZ)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod spectrum mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_SPECTRUM_MODE() to get DVB-T demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSpectrumMode Pointer to an allocated memory for storing demod spectrum mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod spectrum mode successfully. ++@retval FUNCTION_ERROR Get demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_SPECTRUM_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod TPS lock asking function pointer ++ ++One can use DVBT_DEMOD_FP_IS_TPS_LOCKED() to ask DVB-T demod if it is TPS-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform TPS lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform TPS lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_IS_TPS_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_IS_TPS_LOCKED)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod signal lock asking function pointer ++ ++One can use DVBT_DEMOD_FP_IS_SIGNAL_LOCKED() to ask DVB-T demod if it is signal-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform signal lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_IS_SIGNAL_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_IS_SIGNAL_LOCKED)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod signal strength getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal strength successfully. ++@retval FUNCTION_ERROR Get demod signal strength unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_SIGNAL_STRENGTH)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod signal quality getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal quality successfully. ++@retval FUNCTION_ERROR Get demod signal quality unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_SIGNAL_QUALITY)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod BER getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_BER() to get BER. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod error rate value successfully. ++@retval FUNCTION_ERROR Get demod error rate value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_BER() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_BER)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod SNR getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod SNR successfully. ++@retval FUNCTION_ERROR Get demod SNR unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_SNR_DB)( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod RF AGC getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_RF_AGC() to get DVB-T demod RF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pRfAgc Pointer to an allocated memory for storing RF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod RF AGC value successfully. ++@retval FUNCTION_ERROR Get demod RF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_RF_AGC() with the corresponding function. ++ -# The range of RF AGC value is (-pow(2, 13)) ~ (pow(2, 13) - 1). ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_RF_AGC)( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod IF AGC getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_IF_AGC() to get DVB-T demod IF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfAgc Pointer to an allocated memory for storing IF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF AGC value successfully. ++@retval FUNCTION_ERROR Get demod IF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_IF_AGC() with the corresponding function. ++ -# The range of IF AGC value is (-pow(2, 13)) ~ (pow(2, 13) - 1). ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_IF_AGC)( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod digital AGC getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_DI_AGC() to get DVB-T demod digital AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDiAgc Pointer to an allocated memory for storing digital AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod digital AGC value successfully. ++@retval FUNCTION_ERROR Get demod digital AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_DI_AGC() with the corresponding function. ++ -# The range of digital AGC value is 0 ~ (pow(2, 8) - 1). ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_DI_AGC)( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDiAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod TR offset getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get demod TR offset successfully. ++@retval FUNCTION_ERROR Get demod TR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_TR_OFFSET_PPM)( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod CR offset getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod CR offset successfully. ++@retval FUNCTION_ERROR Get demod CR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_CR_OFFSET_HZ)( ++ DVBT_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod constellation mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_CONSTELLATION() to get DVB-T demod constellation mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pConstellation Pointer to an allocated memory for storing demod constellation mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod constellation mode successfully. ++@retval FUNCTION_ERROR Get demod constellation mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_CONSTELLATION() with the corresponding function. ++ ++ ++@see DVBT_CONSTELLATION_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_CONSTELLATION)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pConstellation ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod hierarchy mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_HIERARCHY() to get DVB-T demod hierarchy mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pHierarchy Pointer to an allocated memory for storing demod hierarchy mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod hierarchy mode successfully. ++@retval FUNCTION_ERROR Get demod hierarchy mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_HIERARCHY() with the corresponding function. ++ ++ ++@see DVBT_HIERARCHY_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_HIERARCHY)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pHierarchy ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod low-priority code rate mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_CODE_RATE_LP() to get DVB-T demod low-priority code rate mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCodeRateLp Pointer to an allocated memory for storing demod low-priority code rate mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod low-priority code rate mode successfully. ++@retval FUNCTION_ERROR Get demod low-priority code rate mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_CODE_RATE_LP() with the corresponding function. ++ ++ ++@see DVBT_CODE_RATE_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_CODE_RATE_LP)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateLp ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod high-priority code rate mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_CODE_RATE_HP() to get DVB-T demod high-priority code rate mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCodeRateHp Pointer to an allocated memory for storing demod high-priority code rate mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod high-priority code rate mode successfully. ++@retval FUNCTION_ERROR Get demod high-priority code rate mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_CODE_RATE_HP() with the corresponding function. ++ ++ ++@see DVBT_CODE_RATE_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_CODE_RATE_HP)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pCodeRateHp ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod guard interval mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_GUARD_INTERVAL() to get DVB-T demod guard interval mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pGuardInterval Pointer to an allocated memory for storing demod guard interval mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod guard interval mode successfully. ++@retval FUNCTION_ERROR Get demod guard interval mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_GUARD_INTERVAL() with the corresponding function. ++ ++ ++@see DVBT_GUARD_INTERVAL_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_GUARD_INTERVAL)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pGuardInterval ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod FFT mode getting function pointer ++ ++One can use DVBT_DEMOD_FP_GET_FFT_MODE() to get DVB-T demod FFT mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pFftMode Pointer to an allocated memory for storing demod FFT mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod FFT mode successfully. ++@retval FUNCTION_ERROR Get demod FFT mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_GET_FFT_MODE() with the corresponding function. ++ ++ ++@see DVBT_FFT_MODE_MODE ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_GET_FFT_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pFftMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod updating function pointer ++ ++One can use DVBT_DEMOD_FP_UPDATE_FUNCTION() to update demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod setting successfully. ++@retval FUNCTION_ERROR Update demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_UPDATE_FUNCTION)( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod reseting function pointer ++ ++One can use DVBT_DEMOD_FP_RESET_FUNCTION() to reset demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod setting successfully. ++@retval FUNCTION_ERROR Reset demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set DVBT_DEMOD_FP_RESET_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbtDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_DEMOD_FP_RESET_FUNCTION)( ++ DVBT_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/// RTL2830 extra module ++ ++// Definitions for Function 4 ++#define DVBT_FUNC4_REG_VALUE_NUM 5 ++ ++typedef struct RTL2830_EXTRA_MODULE_TAG RTL2830_EXTRA_MODULE; ++ ++/* ++ ++@brief RTL2830 application mode getting function pointer ++ ++One can use RTL2830_FP_GET_APP_MODE() to get RTL2830 application mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAppMode Pointer to an allocated memory for storing demod application mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod application mode successfully. ++@retval FUNCTION_ERROR Get demod application mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set RTL2830_FP_GET_APP_MODE() with the corresponding function. ++ ++ ++@see RTL2830_APPLICATION_MODE ++ ++*/ ++typedef void ++(*RTL2830_FP_GET_APP_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAppMode ++ ); ++ ++struct RTL2830_EXTRA_MODULE_TAG ++{ ++ // RTL2830 variables ++ int AppMode; ++ ++ // RTL2830 update procedure enabling status ++ int IsFunction2Enabled; ++ int IsFunction3Enabled; ++ int IsFunction4Enabled; ++ int IsFunction5Enabled; ++ ++ // RTL2830 update procedure variables ++ unsigned char Func2Executing; ++ unsigned char Func3State; ++ unsigned char Func3Executing; ++ unsigned char Func4State; ++ unsigned long Func4DelayCnt; ++ unsigned long Func4DelayCntMax; ++ unsigned char Func4ParamSetting; ++ unsigned long Func4RegValue[DVBT_FUNC4_REG_VALUE_NUM]; ++ unsigned char Func5State; ++ unsigned char Func5QamBak; ++ unsigned char Func5HierBak; ++ unsigned char Func5LpCrBak; ++ unsigned char Func5HpCrBak; ++ unsigned char Func5GiBak; ++ unsigned char Func5FftBak; ++ ++ // RTL2830 extra function pointers ++ RTL2830_FP_GET_APP_MODE GetAppMode; ++}; ++ ++ ++ ++ ++ ++/// RTL2832 extra module ++typedef struct RTL2832_EXTRA_MODULE_TAG RTL2832_EXTRA_MODULE; ++ ++/* ++ ++@brief RTL2832 application mode getting function pointer ++ ++One can use RTL2832_FP_GET_APP_MODE() to get RTL2832 application mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAppMode Pointer to an allocated memory for storing demod application mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod application mode successfully. ++@retval FUNCTION_ERROR Get demod application mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set RTL2832_FP_GET_APP_MODE() with the corresponding function. ++ ++ ++@see RTL2832_APPLICATION_MODE ++ ++*/ ++typedef void ++(*RTL2832_FP_GET_APP_MODE)( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pAppMode ++ ); ++ ++struct RTL2832_EXTRA_MODULE_TAG ++{ ++ // RTL2832 extra variables ++ int AppMode; ++ ++ // RTL2832 update procedure enabling status ++ int IsFunc1Enabled; ++ ++ // RTL2832 update Function 1 variables ++ int Func1State; ++ ++ int Func1WaitTimeMax; ++ int Func1GettingTimeMax; ++ int Func1GettingNumEachTime; ++ ++ int Func1WaitTime; ++ int Func1GettingTime; ++ ++ unsigned long Func1RsdBerEstSumNormal; ++ unsigned long Func1RsdBerEstSumConfig1; ++ unsigned long Func1RsdBerEstSumConfig2; ++ unsigned long Func1RsdBerEstSumConfig3; ++ ++ int Func1QamBak; ++ int Func1HierBak; ++ int Func1LpCrBak; ++ int Func1HpCrBak; ++ int Func1GiBak; ++ int Func1FftBak; ++ ++ // RTL2832 extra function pointers ++ RTL2832_FP_GET_APP_MODE GetAppMode; ++}; ++ ++ ++ ++ ++ ++/// DVB-T demod module structure ++struct DVBT_DEMOD_MODULE_TAG ++{ ++ unsigned long CurrentPageNo; ++ // Private variables ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ int TsInterfaceMode; ++ ++ int BandwidthMode; ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int IsBandwidthModeSet; ++ int IsIfFreqHzSet; ++ int IsSpectrumModeSet; ++ ++ union ///< Demod extra module used by driving module ++ { ++ RTL2830_EXTRA_MODULE Rtl2830; ++ RTL2832_EXTRA_MODULE Rtl2832; ++ } ++ Extra; ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ // Demod register table ++ DVBT_REG_ENTRY RegTable[DVBT_REG_TABLE_LEN_MAX]; ++ ++ ++ // Demod I2C function pointers ++ DVBT_DEMOD_FP_SET_REG_PAGE SetRegPage; ++ DVBT_DEMOD_FP_SET_REG_BYTES SetRegBytes; ++ DVBT_DEMOD_FP_GET_REG_BYTES GetRegBytes; ++ DVBT_DEMOD_FP_SET_REG_MASK_BITS SetRegMaskBits; ++ DVBT_DEMOD_FP_GET_REG_MASK_BITS GetRegMaskBits; ++ DVBT_DEMOD_FP_SET_REG_BITS SetRegBits; ++ DVBT_DEMOD_FP_GET_REG_BITS GetRegBits; ++ DVBT_DEMOD_FP_SET_REG_BITS_WITH_PAGE SetRegBitsWithPage; ++ DVBT_DEMOD_FP_GET_REG_BITS_WITH_PAGE GetRegBitsWithPage; ++ ++ ++ // Demod manipulating function pointers ++ DVBT_DEMOD_FP_GET_DEMOD_TYPE GetDemodType; ++ DVBT_DEMOD_FP_GET_DEVICE_ADDR GetDeviceAddr; ++ DVBT_DEMOD_FP_GET_CRYSTAL_FREQ_HZ GetCrystalFreqHz; ++ ++ DVBT_DEMOD_FP_IS_CONNECTED_TO_I2C IsConnectedToI2c; ++ ++ DVBT_DEMOD_FP_SOFTWARE_RESET SoftwareReset; ++ ++ DVBT_DEMOD_FP_INITIALIZE Initialize; ++ DVBT_DEMOD_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ DVBT_DEMOD_FP_SET_IF_FREQ_HZ SetIfFreqHz; ++ DVBT_DEMOD_FP_SET_SPECTRUM_MODE SetSpectrumMode; ++ DVBT_DEMOD_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++ DVBT_DEMOD_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++ DVBT_DEMOD_FP_GET_SPECTRUM_MODE GetSpectrumMode; ++ ++ DVBT_DEMOD_FP_IS_TPS_LOCKED IsTpsLocked; ++ DVBT_DEMOD_FP_IS_SIGNAL_LOCKED IsSignalLocked; ++ ++ DVBT_DEMOD_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ DVBT_DEMOD_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ ++ DVBT_DEMOD_FP_GET_BER GetBer; ++ DVBT_DEMOD_FP_GET_SNR_DB GetSnrDb; ++ ++ DVBT_DEMOD_FP_GET_RF_AGC GetRfAgc; ++ DVBT_DEMOD_FP_GET_IF_AGC GetIfAgc; ++ DVBT_DEMOD_FP_GET_DI_AGC GetDiAgc; ++ ++ DVBT_DEMOD_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ DVBT_DEMOD_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ ++ DVBT_DEMOD_FP_GET_CONSTELLATION GetConstellation; ++ DVBT_DEMOD_FP_GET_HIERARCHY GetHierarchy; ++ DVBT_DEMOD_FP_GET_CODE_RATE_LP GetCodeRateLp; ++ DVBT_DEMOD_FP_GET_CODE_RATE_HP GetCodeRateHp; ++ DVBT_DEMOD_FP_GET_GUARD_INTERVAL GetGuardInterval; ++ DVBT_DEMOD_FP_GET_FFT_MODE GetFftMode; ++ ++ DVBT_DEMOD_FP_UPDATE_FUNCTION UpdateFunction; ++ DVBT_DEMOD_FP_RESET_FUNCTION ResetFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// DVB-T demod default I2C functions ++int ++dvbt_demod_default_SetRegPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++int ++dvbt_demod_default_SetRegBytes( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned char ByteNum ++ ); ++ ++int ++dvbt_demod_default_GetRegBytes( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ); ++ ++int ++dvbt_demod_default_SetRegMaskBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++int ++dvbt_demod_default_GetRegMaskBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++int ++dvbt_demod_default_SetRegBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++dvbt_demod_default_GetRegBits( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++int ++dvbt_demod_default_SetRegBitsWithPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++dvbt_demod_default_GetRegBitsWithPage( ++ DVBT_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// DVB-T demod default manipulating functions ++void ++dvbt_demod_default_GetDemodType( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++void ++dvbt_demod_default_GetDeviceAddr( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++void ++dvbt_demod_default_GetCrystalFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++int ++dvbt_demod_default_GetBandwidthMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pBandwidthMode ++ ); ++ ++int ++dvbt_demod_default_GetIfFreqHz( ++ DVBT_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++int ++dvbt_demod_default_GetSpectrumMode( ++ DVBT_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/dvbt_nim_base.c b/drivers/media/dvb/dvb-usb/dvbt_nim_base.c +new file mode 100644 +index 0000000..76a5e94 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dvbt_nim_base.c +@@ -0,0 +1,531 @@ ++/** ++ ++@file ++ ++@brief DVB-T NIM base module definition ++ ++DVB-T NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++*/ ++ ++ ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_NIM_TYPE ++ ++*/ ++void ++dvbt_nim_default_GetNimType( ++ DVBT_NIM_MODULE *pNim, ++ int *pNimType ++ ) ++{ ++ // Get NIM type from NIM module. ++ *pNimType = pNim->NimType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++dvbt_nim_default_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_PARAMETERS ++ ++*/ ++int ++dvbt_nim_default_GetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pBandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Get tuner RF frequency in Hz. ++ if(pTuner->GetRfFreqHz(pTuner, pRfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get demod bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, pBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_IS_SIGNAL_PRESENT ++ ++*/ ++int ++dvbt_nim_default_IsSignalPresent( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ DVBT_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait for signal present check. ++ for(i = 0; i < DVBT_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX_DEFAULT; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check TPS present status on demod. ++ // Note: If TPS is locked, stop signal present check. ++ if(pDemod->IsTpsLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_IS_SIGNAL_LOCKED ++ ++*/ ++int ++dvbt_nim_default_IsSignalLocked( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ DVBT_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait for signal lock check. ++ for(i = 0; i < DVBT_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check signal lock status on demod. ++ // Note: If signal is locked, stop signal lock check. ++ if(pDemod->IsSignalLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++dvbt_nim_default_GetSignalStrength( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal strength from demod. ++ if(pDemod->GetSignalStrength(pDemod, pSignalStrength) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++dvbt_nim_default_GetSignalQuality( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal quality from demod. ++ if(pDemod->GetSignalQuality(pDemod, pSignalQuality) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_BER ++ ++*/ ++int ++dvbt_nim_default_GetBer( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get BER from demod. ++ if(pDemod->GetBer(pDemod, pBerNum, pBerDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_SNR_DB ++ ++*/ ++int ++dvbt_nim_default_GetSnrDb( ++ DVBT_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get SNR in dB from demod. ++ if(pDemod->GetSnrDb(pDemod, pSnrDbNum, pSnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++dvbt_nim_default_GetTrOffsetPpm( ++ DVBT_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get TR offset in ppm from demod. ++ if(pDemod->GetTrOffsetPpm(pDemod, pTrOffsetPpm) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++dvbt_nim_default_GetCrOffsetHz( ++ DVBT_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get CR offset in Hz from demod. ++ if(pDemod->GetCrOffsetHz(pDemod, pCrOffsetHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_TPS_INFO ++ ++*/ ++int ++dvbt_nim_default_GetTpsInfo( ++ DVBT_NIM_MODULE *pNim, ++ int *pConstellation, ++ int *pHierarchy, ++ int *pCodeRateLp, ++ int *pCodeRateHp, ++ int *pGuardInterval, ++ int *pFftMode ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get TPS constellation information from demod. ++ if(pDemod->GetConstellation(pDemod, pConstellation) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get TPS hierarchy information from demod. ++ if(pDemod->GetHierarchy(pDemod, pHierarchy) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get TPS low-priority code rate information from demod. ++ if(pDemod->GetCodeRateLp(pDemod, pCodeRateLp) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get TPS high-priority code rate information from demod. ++ if(pDemod->GetCodeRateHp(pDemod, pCodeRateHp) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get TPS guard interval information from demod. ++ if(pDemod->GetGuardInterval(pDemod, pGuardInterval) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get TPS FFT mode information from demod. ++ if(pDemod->GetFftMode(pDemod, pFftMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++dvbt_nim_default_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/dvbt_nim_base.h b/drivers/media/dvb/dvb-usb/dvbt_nim_base.h +new file mode 100644 +index 0000000..0842254 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/dvbt_nim_base.h +@@ -0,0 +1,934 @@ ++#ifndef __DVBT_NIM_BASE_H ++#define __DVBT_NIM_BASE_H ++ ++/** ++ ++@file ++ ++@brief DVB-T NIM base module definition ++ ++DVB-T NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ unsigned long RfFreqHz; ++ int BandwidthMode; ++ ++ int Answer; ++ unsigned long SignalStrength, SignalQuality; ++ unsigned long BerNum, BerDen, PerNum, PerDen; ++ double Ber, Per; ++ unsigned long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ long TrOffsetPpm, CrOffsetHz; ++ ++ int Constellation; ++ int Hierarchy; ++ int CodeRateLp; ++ int CodeRateHp; ++ int GuardInterval; ++ int FftMode; ++ ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ &DemodxExtraModuleMemory, // Employ Demod-X extra module. ++ 0x20, // The Demod-X I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The Demod-X crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The Demod-X TS interface mode is serial. ++ ... // Other arguments for Demod-X ++ ++ &TunerxExtraModuleMemory, // Employ Tuner-Y extra module. ++ 0xc0, // The Tuner-Y I2C device address is 0xc0 in 8-bit format. ++ ... // Other arguments for Tuner-Y ++ ); ++ ++ ++ ++ // Get NIM type. ++ // Note: NIM types are defined in the MODULE_TYPE enumeration. ++ pNim->GetNimType(pNim, &NimType); ++ ++ ++ ++ ++ ++ ++ ++ // ==== Initialize NIM and set its parameters ===== ++ ++ // Initialize NIM. ++ pNim->Initialize(pNim); ++ ++ // Set NIM parameters. (RF frequency, bandwdith mode) ++ // Note: In the example: ++ // 1. RF frequency is 666 MHz. ++ // 2. Bandwidth mode is 8 MHz. ++ RfFreqHz = 666000000; ++ BandwidthMode = DVBT_BANDWIDTH_8MHZ; ++ pNim->SetParameters(pNim, RfFreqHz, BandwidthMode); ++ ++ ++ ++ // Wait 1 second for demod convergence. ++ ++ ++ ++ ++ ++ // ==== Get NIM information ===== ++ ++ // Get NIM parameters. (RF frequency, bandwdith mode) ++ pNim->GetParameters(pNim, &RfFreqHz, &BandwidthMode); ++ ++ ++ // Get signal present status. ++ // Note: 1. The argument Answer is YES when the NIM module has found DVB-T signal in the RF channel. ++ // 2. The argument Answer is NO when the NIM module does not find DVB-T signal in the RF channel. ++ // Recommendation: Use the IsSignalPresent() function for channel scan. ++ pNim->IsSignalPresent(pNim, &Answer); ++ ++ // Get signal lock status. ++ // Note: 1. The argument Answer is YES when the NIM module has locked DVB-T signal in the RF channel. ++ // At the same time, the NIM module sends TS packets through TS interface hardware pins. ++ // 2. The argument Answer is NO when the NIM module does not lock DVB-T signal in the RF channel. ++ // Recommendation: Use the IsSignalLocked() function for signal lock check. ++ pNim->IsSignalLocked(pNim, &Answer); ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pNim->GetSignalStrength(pNim, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pNim->GetSignalQuality(pNim, &SignalQuality); ++ ++ ++ // Get BER. ++ pNim->GetBer(pNim, &BerNum, &BerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ ++ // Get SNR in dB. ++ pNim->GetSnrDb(pNim, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pNim->GetTrOffsetPpm(pNim, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pNim->GetCrOffsetHz(pNim, &CrOffsetHz); ++ ++ ++ // Get TPS information. ++ // Note: One can find TPS information definitions in the enumerations as follows: ++ // 1. DVBT_CONSTELLATION_MODE. ++ // 2. DVBT_HIERARCHY_MODE. ++ // 3. DVBT_CODE_RATE_MODE. (for low-priority and high-priority code rate) ++ // 4. DVBT_GUARD_INTERVAL_MODE. ++ // 5. DVBT_FFT_MODE_MODE ++ pNim->GetTpsInfo(pNim, &Constellation, &Hierarchy, &CodeRateLp, &CodeRateHp, &GuardInterval, &FftMode); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++#include "tuner_base.h" ++#include "dvbt_demod_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define DVBT_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX_DEFAULT 1 ++#define DVBT_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT 1 ++ ++ ++ ++ ++ ++/// DVB-T NIM module pre-definition ++typedef struct DVBT_NIM_MODULE_TAG DVBT_NIM_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T demod type getting function pointer ++ ++One can use DVBT_NIM_FP_GET_NIM_TYPE() to get DVB-T NIM type. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pNimType Pointer to an allocated memory for storing NIM type ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_NIM_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*DVBT_NIM_FP_GET_NIM_TYPE)( ++ DVBT_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM initializing function pointer ++ ++One can use DVBT_NIM_FP_INITIALIZE() to initialie DVB-T NIM. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize NIM successfully. ++@retval FUNCTION_ERROR Initialize NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_INITIALIZE)( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM parameter setting function pointer ++ ++One can use DVBT_NIM_FP_SET_PARAMETERS() to set DVB-T NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [in] RfFreqHz RF frequency in Hz for setting ++@param [in] BandwidthMode Bandwidth mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set NIM parameters successfully. ++@retval FUNCTION_ERROR Set NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_SET_PARAMETERS() with the corresponding function. ++ ++ ++@see DVBT_BANDWIDTH_MODE ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_SET_PARAMETERS)( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM parameter getting function pointer ++ ++One can use DVBT_NIM_FP_GET_PARAMETERS() to get DVB-T NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pRfFreqHz Pointer to an allocated memory for storing NIM RF frequency in Hz ++@param [out] pBandwidthMode Pointer to an allocated memory for storing NIM bandwidth mode ++ ++ ++@retval FUNCTION_SUCCESS Get NIM parameters successfully. ++@retval FUNCTION_ERROR Get NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_PARAMETERS() with the corresponding function. ++ ++ ++@see DVBT_BANDWIDTH_MODE ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_PARAMETERS)( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM signal present asking function pointer ++ ++One can use DVBT_NIM_FP_IS_SIGNAL_PRESENT() to ask DVB-T NIM if signal is present. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal present asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal present asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_IS_SIGNAL_PRESENT() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_IS_SIGNAL_PRESENT)( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM signal lock asking function pointer ++ ++One can use DVBT_NIM_FP_IS_SIGNAL_LOCKED() to ask DVB-T NIM if signal is locked. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal lock asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal lock asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_IS_SIGNAL_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_IS_SIGNAL_LOCKED)( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM signal strength getting function pointer ++ ++One can use DVBT_NIM_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal strength successfully. ++@retval FUNCTION_ERROR Get NIM signal strength unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_SIGNAL_STRENGTH)( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM signal quality getting function pointer ++ ++One can use DVBT_NIM_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal quality successfully. ++@retval FUNCTION_ERROR Get NIM signal quality unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_SIGNAL_QUALITY)( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM BER value getting function pointer ++ ++One can use DVBT_NIM_FP_GET_BER() to get BER. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM BER value successfully. ++@retval FUNCTION_ERROR Get NIM BER value unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_BER() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_BER)( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM SNR getting function pointer ++ ++One can use DVBT_NIM_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM SNR successfully. ++@retval FUNCTION_ERROR Get NIM SNR unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_SNR_DB)( ++ DVBT_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM TR offset getting function pointer ++ ++One can use DVBT_NIM_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get NIM TR offset successfully. ++@retval FUNCTION_ERROR Get NIM TR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_TR_OFFSET_PPM)( ++ DVBT_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM CR offset getting function pointer ++ ++One can use DVBT_NIM_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get NIM CR offset successfully. ++@retval FUNCTION_ERROR Get NIM CR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_CR_OFFSET_HZ)( ++ DVBT_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM TPS information getting function pointer ++ ++One can use DVBT_NIM_FP_GET_TPS_INFO() to get TPS information. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pConstellation Pointer to an allocated memory for storing demod constellation mode ++@param [out] pHierarchy Pointer to an allocated memory for storing demod hierarchy mode ++@param [out] pCodeRateLp Pointer to an allocated memory for storing demod low-priority code rate mode ++@param [out] pCodeRateHp Pointer to an allocated memory for storing demod high-priority code rate mode ++@param [out] pGuardInterval Pointer to an allocated memory for storing demod guard interval mode ++@param [out] pFftMode Pointer to an allocated memory for storing demod FFT mode ++ ++ ++@retval FUNCTION_SUCCESS Get NIM TPS information successfully. ++@retval FUNCTION_ERROR Get NIM TPS information unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_GET_TPS_INFO() with the corresponding function. ++ ++ ++@see DVBT_CONSTELLATION_MODE, DVBT_HIERARCHY_MODE, DVBT_CODE_RATE_MODE, DVBT_GUARD_INTERVAL_MODE, DVBT_FFT_MODE_MODE ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_GET_TPS_INFO)( ++ DVBT_NIM_MODULE *pNim, ++ int *pConstellation, ++ int *pHierarchy, ++ int *pCodeRateLp, ++ int *pCodeRateHp, ++ int *pGuardInterval, ++ int *pFftMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief DVB-T NIM updating function pointer ++ ++One can use DVBT_NIM_FP_UPDATE_FUNCTION() to update NIM register setting. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update NIM setting successfully. ++@retval FUNCTION_ERROR Update NIM setting unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set DVBT_NIM_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ ... ++ ); ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pNim->UpdateFunction(pNim); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*DVBT_NIM_FP_UPDATE_FUNCTION)( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++// RTL2832 MT2266 extra module ++typedef struct RTL2832_MT2266_EXTRA_MODULE_TAG RTL2832_MT2266_EXTRA_MODULE; ++struct RTL2832_MT2266_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned char LnaConfig; ++ unsigned char UhfSens; ++ unsigned char AgcCurrentState; ++ unsigned long LnaGainOld; ++}; ++ ++ ++ ++ ++ ++// RTL2832 E4000 extra module ++typedef struct RTL2832_E4000_EXTRA_MODULE_TAG RTL2832_E4000_EXTRA_MODULE; ++struct RTL2832_E4000_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long TunerModeUpdateWaitTimeMax; ++ unsigned long TunerModeUpdateWaitTime; ++ unsigned char TunerGainMode; ++}; ++ ++ ++ ++ ++ ++// RTL2832 MT2063 extra module ++typedef struct RTL2832_MT2063_EXTRA_MODULE_TAG RTL2832_MT2063_EXTRA_MODULE; ++struct RTL2832_MT2063_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long IfFreqHz; ++}; ++ ++ ++ ++ ++ ++// RTL2832 FC0012 extra module ++typedef struct RTL2832_FC0012_EXTRA_MODULE_TAG RTL2832_FC0012_EXTRA_MODULE; ++struct RTL2832_FC0012_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long LnaUpdateWaitTimeMax; ++ unsigned long LnaUpdateWaitTime; ++ unsigned long RssiRCalOn; ++}; ++ ++ ++ ++ ++ ++// RTL2832 FC0013 extra module ++typedef struct RTL2832_FC0013_EXTRA_MODULE_TAG RTL2832_FC0013_EXTRA_MODULE; ++struct RTL2832_FC0013_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long LnaUpdateWaitTimeMax; ++ unsigned long LnaUpdateWaitTime; ++ unsigned long RssiRCalOn; ++}; ++ ++ ++ ++ ++ ++/// DVB-T NIM module structure ++struct DVBT_NIM_MODULE_TAG ++{ ++ // Private variables ++ int NimType; ++ ++ union ///< NIM extra module used by driving module ++ { ++ RTL2832_MT2266_EXTRA_MODULE Rtl2832Mt2266; ++ RTL2832_E4000_EXTRA_MODULE Rtl2832E4000; ++ RTL2832_MT2063_EXTRA_MODULE Rtl2832Mt2063; ++ RTL2832_FC0012_EXTRA_MODULE Rtl2832Fc0012; ++ RTL2832_FC0013_EXTRA_MODULE Rtl2832Fc0013; ++ } ++ Extra; ++ ++ ++ // Modules ++ BASE_INTERFACE_MODULE *pBaseInterface; ///< Base interface module pointer ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ///< Base interface module memory ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ///< I2C bridge module pointer ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ///< I2C bridge module memory ++ ++ TUNER_MODULE *pTuner; ///< Tuner module pointer ++ TUNER_MODULE TunerModuleMemory; ///< Tuner module memory ++ ++ DVBT_DEMOD_MODULE *pDemod; ///< DVB-T demod module pointer ++ DVBT_DEMOD_MODULE DvbtDemodModuleMemory; ///< DVB-T demod module memory ++ ++ ++ // NIM manipulating functions ++ DVBT_NIM_FP_GET_NIM_TYPE GetNimType; ++ DVBT_NIM_FP_INITIALIZE Initialize; ++ DVBT_NIM_FP_SET_PARAMETERS SetParameters; ++ DVBT_NIM_FP_GET_PARAMETERS GetParameters; ++ DVBT_NIM_FP_IS_SIGNAL_PRESENT IsSignalPresent; ++ DVBT_NIM_FP_IS_SIGNAL_LOCKED IsSignalLocked; ++ DVBT_NIM_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ DVBT_NIM_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ DVBT_NIM_FP_GET_BER GetBer; ++ DVBT_NIM_FP_GET_SNR_DB GetSnrDb; ++ DVBT_NIM_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ DVBT_NIM_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ DVBT_NIM_FP_GET_TPS_INFO GetTpsInfo; ++ DVBT_NIM_FP_UPDATE_FUNCTION UpdateFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// DVB-T NIM default manipulaing functions ++void ++dvbt_nim_default_GetNimType( ++ DVBT_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++int ++dvbt_nim_default_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++dvbt_nim_default_GetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pBandwidthMode ++ ); ++ ++int ++dvbt_nim_default_IsSignalPresent( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++dvbt_nim_default_IsSignalLocked( ++ DVBT_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++dvbt_nim_default_GetSignalStrength( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++dvbt_nim_default_GetSignalQuality( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++dvbt_nim_default_GetBer( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen ++ ); ++ ++int ++dvbt_nim_default_GetSnrDb( ++ DVBT_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++dvbt_nim_default_GetTrOffsetPpm( ++ DVBT_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++int ++dvbt_nim_default_GetCrOffsetHz( ++ DVBT_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++int ++dvbt_nim_default_GetTpsInfo( ++ DVBT_NIM_MODULE *pNim, ++ int *pConstellation, ++ int *pHierarchy, ++ int *pCodeRateLp, ++ int *pCodeRateHp, ++ int *pGuardInterval, ++ int *pFftMode ++ ); ++ ++int ++dvbt_nim_default_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/foundation.c b/drivers/media/dvb/dvb-usb/foundation.c +new file mode 100644 +index 0000000..c5e8e52 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/foundation.c +@@ -0,0 +1,352 @@ ++/** ++ ++@file ++ ++@brief Fundamental interface definition ++ ++Fundamental interface contains base function pointers and some mathematics tools. ++ ++*/ ++ ++ ++#include "foundation.h" ++ ++ ++ ++ ++ ++// Base interface builder ++void ++BuildBaseInterface( ++ BASE_INTERFACE_MODULE **ppBaseInterface, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ unsigned long I2cReadingByteNumMax, ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs ++ ) ++{ ++ // Set base interface module pointer. ++ *ppBaseInterface = pBaseInterfaceModuleMemory; ++ ++ ++ // Set all base interface function pointers and arguments. ++ (*ppBaseInterface)->I2cReadingByteNumMax = I2cReadingByteNumMax; ++ (*ppBaseInterface)->I2cWritingByteNumMax = I2cWritingByteNumMax; ++ (*ppBaseInterface)->I2cRead = I2cRead; ++ (*ppBaseInterface)->I2cWrite = I2cWrite; ++ (*ppBaseInterface)->WaitMs = WaitMs; ++ (*ppBaseInterface)->SetUserDefinedDataPointer = base_interface_SetUserDefinedDataPointer; ++ (*ppBaseInterface)->GetUserDefinedDataPointer = base_interface_GetUserDefinedDataPointer; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set user defined data pointer of base interface structure for custom basic function implementation. ++ ++@note ++ -# Base interface builder will set BASE_FP_SET_USER_DEFINED_DATA_POINTER() function pointer with ++ base_interface_SetUserDefinedDataPointer(). ++ ++@see BASE_FP_SET_USER_DEFINED_DATA_POINTER ++ ++*/ ++void ++base_interface_SetUserDefinedDataPointer( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void *pUserDefinedData ++ ) ++{ ++ // Set user defined data pointer of base interface structure with user defined data pointer argument. ++ pBaseInterface->pUserDefinedData = pUserDefinedData; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get user defined data pointer of base interface structure for custom basic function implementation. ++ ++@note ++ -# Base interface builder will set BASE_FP_GET_USER_DEFINED_DATA_POINTER() function pointer with ++ base_interface_GetUserDefinedDataPointer(). ++ ++@see BASE_FP_GET_USER_DEFINED_DATA_POINTER ++ ++*/ ++void ++base_interface_GetUserDefinedDataPointer( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void **ppUserDefinedData ++ ) ++{ ++ // Get user defined data pointer from base interface structure to the caller user defined data pointer. ++ *ppUserDefinedData = pBaseInterface->pUserDefinedData; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Convert signed integer to binary. ++ ++Convert 2's complement signed integer to binary with bit number. ++ ++ ++@param [in] Value the converting value in 2's complement format ++@param [in] BitNum the bit number of the converting value ++ ++ ++@return Converted binary ++ ++ ++@note ++ The converting value must be -pow(2, BitNum - 1) ~ (pow(2, BitNum - 1) -1). ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++int main(void) ++{ ++ long Value = -345; ++ unsigned long Binary; ++ ++ ++ // Convert 2's complement integer to binary with 10 bit number. ++ Binary = SignedIntToBin(Value, 10); ++ ++ ++ // Result in base 2: ++ // Value = 1111 1111 1111 1111 1111 1110 1010 0111 b = -345 (in 32-bit 2's complement format) ++ // Binary = 0000 0000 0000 0000 0000 0010 1010 0111 b = 679 (in 10-bit binary format) ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++unsigned long ++SignedIntToBin( ++ long Value, ++ unsigned char BitNum ++ ) ++{ ++ unsigned int i; ++ unsigned long Mask, Binary; ++ ++ ++ ++ // Generate Mask according to BitNum. ++ Mask = 0; ++ for(i = 0; i < BitNum; i++) ++ Mask |= 0x1 << i; ++ ++ ++ // Convert signed integer to binary with Mask. ++ Binary = Value & Mask; ++ ++ ++ return Binary; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Convert binary to signed integer. ++ ++Convert binary to 2's complement signed integer with bit number. ++ ++ ++@param [in] Binary the converting binary ++@param [in] BitNum the bit number of the converting binary ++ ++ ++@return Converted 2's complement signed integer ++ ++ ++@note ++ The converting binary must be 0 ~ (pow(2, BitNum) - 1). ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++int main(void) ++{ ++ unsigned long Binary = 679; ++ long Value; ++ ++ ++ // Convert binary to 2's complement integer with 10 bit number. ++ Value = BinToSignedInt(Binary, 10); ++ ++ ++ // Result in base 2: ++ // Binary = 0000 0000 0000 0000 0000 0010 1010 0111 b = 679 (in 10-bit binary format) ++ // Value = 1111 1111 1111 1111 1111 1110 1010 0111 b = -345 (in 32-bit 2's complement format) ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++long ++BinToSignedInt( ++ unsigned long Binary, ++ unsigned char BitNum ++ ) ++{ ++ int i; ++ ++ unsigned char SignedBit; ++ unsigned long SignedBitExtension; ++ ++ long Value; ++ ++ ++ ++ // Get signed bit. ++ SignedBit = (unsigned char)((Binary >> (BitNum - 1)) & BIT_0_MASK); ++ ++ ++ // Generate signed bit extension. ++ SignedBitExtension = 0; ++ ++ for(i = BitNum; i < LONG_BIT_NUM; i++) ++ SignedBitExtension |= SignedBit << i; ++ ++ ++ // Combine binary value and signed bit extension to signed integer value. ++ Value = (long)(Binary | SignedBitExtension); ++ ++ ++ return Value; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get devision reult with ceiling. ++ ++Get unsigned devision reult with ceiling. ++ ++ ++@param [in] Dividend the dividend ++@param [in] Divisor the divisor ++ ++ ++@return Result with ceiling ++ ++ ++@note ++ The dividend and divisor must be unsigned integer. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++int main(void) ++{ ++ long Value; ++ ++ ++ // Get ceil(100 / 20) reult. ++ Value = DivideWithCeiling(100, 20); ++ ++ // Result: Value = 5 ++ ++ ++ // Get ceil(100 / 30) reult. ++ Value = DivideWithCeiling(100, 30); ++ ++ // Result: Value = 4 ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++unsigned long ++DivideWithCeiling( ++ unsigned long Dividend, ++ unsigned long Divisor ++ ) ++{ ++ unsigned long Result; ++ ++ ++ // Get primitive division result. ++ Result = Dividend / Divisor; ++ ++ // Adjust primitive result with ceiling. ++ if(Dividend % Divisor > 0) ++ Result += 1; ++ ++ ++ return Result; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/foundation.h b/drivers/media/dvb/dvb-usb/foundation.h +new file mode 100644 +index 0000000..a24d78e +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/foundation.h +@@ -0,0 +1,1001 @@ ++#ifndef __FOUNDATION_H ++#define __FOUNDATION_H ++ ++/** ++ ++@file ++ ++@brief Fundamental interface declaration ++ ++Fundamental interface contains base function pointers and some mathematics tools. ++ ++*/ ++ ++ ++#include "i2c_bridge.h" ++#include "math_mpi.h" ++ ++ ++#include "dvb-usb.h" ++#include "rtl2832u_io.h" ++ ++ ++ ++// Definitions ++ ++// API version ++#define REALTEK_NIM_API_VERSION "Realtek NIM API 2011.06.01" ++ ++ ++ ++// Constants ++#define INVALID_POINTER_VALUE 0 ++#define NO_USE 0 ++ ++#define LEN_1_BYTE 1 ++#define LEN_2_BYTE 2 ++#define LEN_3_BYTE 3 ++#define LEN_4_BYTE 4 ++#define LEN_5_BYTE 5 ++#define LEN_6_BYTE 6 ++#define LEN_11_BYTE 11 ++ ++#define LEN_1_BIT 1 ++ ++#define BYTE_MASK 0xff ++#define BYTE_SHIFT 8 ++#define HEX_DIGIT_MASK 0xf ++#define BYTE_BIT_NUM 8 ++#define LONG_BIT_NUM 32 ++ ++#define BIT_0_MASK 0x1 ++#define BIT_1_MASK 0x2 ++#define BIT_2_MASK 0x4 ++#define BIT_3_MASK 0x8 ++ ++#define BIT_4_MASK 0x10 ++#define BIT_5_MASK 0x20 ++#define BIT_6_MASK 0x40 ++#define BIT_7_MASK 0x80 ++ ++ ++#define BIT_8_MASK 0x100 ++#define BIT_7_SHIFT 7 ++#define BIT_8_SHIFT 8 ++ ++ ++ ++// I2C buffer length ++// Note: I2C_BUFFER_LEN must be greater than I2cReadingByteNumMax and I2cWritingByteNumMax in BASE_INTERFACE_MODULE. ++#define I2C_BUFFER_LEN 128 ++ ++ ++ ++ ++ ++/// Module types ++enum MODULE_TYPE ++{ ++ // DVB-T demod ++ DVBT_DEMOD_TYPE_RTL2830, ///< RTL2830 DVB-T demod ++ DVBT_DEMOD_TYPE_RTL2832, ///< RTL2832 DVB-T demod ++ ++ // QAM demod ++ QAM_DEMOD_TYPE_RTL2840, ///< RTL2840 DVB-C demod ++ QAM_DEMOD_TYPE_RTL2810_OC, ///< RTL2810 OpenCable demod ++ QAM_DEMOD_TYPE_RTL2820_OC, ///< RTL2820 OpenCable demod ++ QAM_DEMOD_TYPE_RTD2885_QAM, ///< RTD2885 QAM demod ++ QAM_DEMOD_TYPE_RTD2932_QAM, ///< RTD2932 QAM demod ++ QAM_DEMOD_TYPE_RTL2836B_DVBC, ///< RTL2836 DVB-C demod ++ QAM_DEMOD_TYPE_RTL2810B_QAM, ///< RTL2810B QAM demod ++ QAM_DEMOD_TYPE_RTD2840B_QAM, ///< RTD2840B QAM demod ++ ++ // OOB demod ++ OOB_DEMOD_TYPE_RTL2820_OOB, ///< RTL2820 OOB demod ++ ++ // ATSC demod ++ ATSC_DEMOD_TYPE_RTL2820_ATSC, ///< RTL2820 ATSC demod ++ ATSC_DEMOD_TYPE_RTD2885_ATSC, ///< RTD2885 ATSC demod ++ ATSC_DEMOD_TYPE_RTD2932_ATSC, ///< RTD2932 ATSC demod ++ ATSC_DEMOD_TYPE_RTL2810B_ATSC, ///< RTL2810B ATSC demod ++ ++ // DTMB demod ++ DTMB_DEMOD_TYPE_RTL2836, ///< RTL2836 DTMB demod ++ DTMB_DEMOD_TYPE_RTL2836B_DTMB, ///< RTL2836B DTMB demod ++ DTMB_DEMOD_TYPE_RTD2974_DTMB, ///< RTD2974 DTMB demod ++ ++ // Tuner ++ TUNER_TYPE_TDCGG052D, ///< TDCG-G052D tuner (QAM) ++ TUNER_TYPE_TDCHG001D, ///< TDCH-G001D tuner (QAM) ++ TUNER_TYPE_TDQE3003A, ///< TDQE3-003A tuner (QAM) ++ TUNER_TYPE_DCT7045, ///< DCT-7045 tuner (QAM) ++ TUNER_TYPE_MT2062, ///< MT2062 tuner (QAM) ++ TUNER_TYPE_MXL5005S, ///< MxL5005S tuner (DVB-T, ATSC) ++ TUNER_TYPE_TDVMH715P, ///< TDVM-H751P tuner (QAM, OOB, ATSC) ++ TUNER_TYPE_UBA00AL, ///< UBA00AL tuner (QAM, ATSC) ++ TUNER_TYPE_MT2266, ///< MT2266 tuner (DVB-T) ++ TUNER_TYPE_FC2580, ///< FC2580 tuner (DVB-T, DTMB) ++ TUNER_TYPE_TUA9001, ///< TUA9001 tuner (DVB-T) ++ TUNER_TYPE_DTT75300, ///< DTT-75300 tuner (DVB-T) ++ TUNER_TYPE_MXL5007T, ///< MxL5007T tuner (DVB-T, ATSC) ++ TUNER_TYPE_VA1T1ED6093, ///< VA1T1ED6093 tuner (DTMB) ++ TUNER_TYPE_TUA8010, ///< TUA8010 tuner (DVB-T) ++ TUNER_TYPE_E4000, ///< E4000 tuner (DVB-T) ++ TUNER_TYPE_DCT70704, ///< DCT-70704 tuner (QAM) ++ TUNER_TYPE_MT2063, ///< MT2063 tuner (DVB-T, QAM) ++ TUNER_TYPE_FC0012, ///< FC0012 tuner (DVB-T, DTMB) ++ TUNER_TYPE_TDAG, ///< TDAG tuner (DTMB) ++ TUNER_TYPE_ADMTV804, ///< ADMTV804 tuner (DVB-T, DTMB) ++ TUNER_TYPE_MAX3543, ///< MAX3543 tuner (DVB-T) ++ TUNER_TYPE_TDA18272, ///< TDA18272 tuner (DVB-T, QAM, DTMB) ++ TUNER_TYPE_FC0013, ///< FC0013 tuner (DVB-T, DTMB) ++ TUNER_TYPE_FC0013B, ///< FC0013B tuner (DVB-T, DTMB) ++ TUNER_TYPE_VA1E1ED2403, ///< VA1E1ED2403 tuner (DTMB) ++ TUNER_TYPE_AVALON, ///< AVALON tuner (DTMB) ++ TUNER_TYPE_SUTRE201, ///< SUTRE201 tuner (DTMB) ++ TUNER_TYPE_MR1300, ///< MR1300 tuner (ISDB-T 1-Seg) ++ TUNER_TYPE_TDAC7, ///< TDAC7 tuner (DTMB, QAM) ++ TUNER_TYPE_VA1T1ER2094, ///< VA1T1ER2094 tuner (DTMB) ++ TUNER_TYPE_TDAC3, ///< TDAC3 tuner (DTMB) ++ TUNER_TYPE_RT910, ///< RT910 tuner (DVB-T) ++ TUNER_TYPE_DTM4C20, ///< DTM4C20 tuner (DTMB) ++ TUNER_TYPE_GTFD32, ///< GTFD32 tuner (DTMB) ++ TUNER_TYPE_GTLP10, ///< GTLP10 tuner (DTMB) ++ TUNER_TYPE_JSS66T, ///< JSS66T tuner (DTMB) ++ TUNER_TYPE_NONE, ///< NONE tuner (DTMB) ++ ++ // DVB-T NIM ++ DVBT_NIM_USER_DEFINITION, ///< DVB-T NIM: User definition ++ DVBT_NIM_RTL2832_MT2266, ///< DVB-T NIM: RTL2832 + MT2266 ++ DVBT_NIM_RTL2832_FC2580, ///< DVB-T NIM: RTL2832 + FC2580 ++ DVBT_NIM_RTL2832_TUA9001, ///< DVB-T NIM: RTL2832 + TUA9001 ++ DVBT_NIM_RTL2832_MXL5005S, ///< DVB-T NIM: RTL2832 + MxL5005S ++ DVBT_NIM_RTL2832_DTT75300, ///< DVB-T NIM: RTL2832 + DTT-75300 ++ DVBT_NIM_RTL2832_MXL5007T, ///< DVB-T NIM: RTL2832 + MxL5007T ++ DVBT_NIM_RTL2832_TUA8010, ///< DVB-T NIM: RTL2832 + TUA8010 ++ DVBT_NIM_RTL2832_E4000, ///< DVB-T NIM: RTL2832 + E4000 ++ DVBT_NIM_RTL2832_MT2063, ///< DVB-T NIM: RTL2832 + MT2063 ++ DVBT_NIM_RTL2832_FC0012, ///< DVB-T NIM: RTL2832 + FC0012 ++ DVBT_NIM_RTL2832_ADMTV804, ///< DVB-T NIM: RTL2832 + ADMTV804 ++ DVBT_NIM_RTL2832_MAX3543, ///< DVB-T NIM: RTL2832 + MAX3543 ++ DVBT_NIM_RTL2832_TDA18272, ///< DVB-T NIM: RTL2832 + TDA18272 ++ DVBT_NIM_RTL2832_FC0013, ///< DVB-T NIM: RTL2832 + FC0013 ++ DVBT_NIM_RTL2832_RT910, ///< DVB-T NIM: RTL2832 + RT910 ++ ++ // QAM NIM ++ QAM_NIM_USER_DEFINITION, ///< QAM NIM: User definition ++ QAM_NIM_RTL2840_TDQE3003A, ///< QAM NIM: RTL2840 + TDQE3-003A ++ QAM_NIM_RTL2840_DCT7045, ///< QAM NIM: RTL2840 + DCT-7045 ++ QAM_NIM_RTL2840_DCT7046, ///< QAM NIM: RTL2840 + DCT-7046 ++ QAM_NIM_RTL2840_MT2062, ///< QAM NIM: RTL2840 + MT2062 ++ QAM_NIM_RTL2840_DCT70704, ///< QAM NIM: RTL2840 + DCT-70704 ++ QAM_NIM_RTL2840_MT2063, ///< QAM NIM: RTL2840 + MT2063 ++ QAM_NIM_RTL2840_MAX3543, ///< QAM NIM: RTL2840 + MAX3543 ++ QAM_NIM_RTL2836B_DVBC_VA1T1ED6093, ///< QAM NIM: RTL2836B DVB-C + VA1T1ED6093 ++ QAM_NIM_RTD2885_QAM_TDA18272, ///< QAM NIM: RTD2885 QAM + TDA18272 ++ QAM_NIM_RTL2836B_DVBC_VA1E1ED2403, ///< QAM NIM: RTL2836B DVB-C + VA1E1ED2403 ++ QAM_NIM_RTD2840B_QAM_MT2062, ///< QAM NIM: RTD2840B QAM + MT2062 ++ ++ // DCR NIM ++ DCR_NIM_RTL2820_TDVMH715P, ///< DCR NIM: RTL2820 + TDVM-H751P ++ DCR_NIM_RTD2885_UBA00AL, ///< DCR NIM: RTD2885 + UBA00AL ++ ++ // ATSC NIM ++ ATSC_NIM_RTD2885_ATSC_TDA18272, ///< ATSC NIM: RTD2885 ATSC + TDA18272 ++ ++ // DTMB NIM ++ DTMB_NIM_RTL2836_FC2580, ///< DTMB NIM: RTL2836 + FC2580 ++ DTMB_NIM_RTL2836_VA1T1ED6093, ///< DTMB NIM: RTL2836 + VA1T1ED6093 ++ DTMB_NIM_RTL2836_TDAG, ///< DTMB NIM: RTL2836 + TDAG ++ DTMB_NIM_RTL2836_MXL5007T, ///< DTMB NIM: RTL2836 + MxL5007T ++ DTMB_NIM_RTL2836_E4000, ///< DTMB NIM: RTL2836 + E4000 ++ DTMB_NIM_RTL2836_TDA18272, ///< DTMB NIM: RTL2836 + TDA18272 ++ DTMB_NIM_RTL2836B_DTMB_VA1T1ED6093, ///< DTMB NIM: RTL2836B DTMB + VA1T1ED6093 ++ DTMB_NIM_RTL2836B_DTMB_ADMTV804, ///< DTMB NIM: RTL2836B DTMB + ADMTV804 ++ DTMB_NIM_RTL2836B_DTMB_E4000, ///< DTMB NIM: RTL2836B DTMB + E4000 ++ DTMB_NIM_RTL2836B_DTMB_FC0012, ///< DTMB NIM: RTL2836B DTMB + FC0012 ++ DTMB_NIM_RTL2836B_DTMB_VA1E1ED2403, ///< DTMB NIM: RTL2836B DTMB + VA1E1ED2403 ++ DTMB_NIM_RTL2836B_DTMB_TDA18272, ///< DTMB NIM: RTL2836B DTMB + TDA18272 ++ DTMB_NIM_RTL2836B_DTMB_AVALON, ///< DTMB NIM: RTL2836B DTMB + AVALON ++ DTMB_NIM_RTL2836B_DTMB_SUTRE201, ///< DTMB NIM: RTL2836B DTMB + SUTRE201 ++ DTMB_NIM_RTL2836B_DTMB_TDAC7, ///< DTMB NIM: RTL2836B DTMB + ALPS TDAC7 ++ DTMB_NIM_RTL2836B_DTMB_FC0013B, ///< DTMB NIM: RTL2836B DTMB + FC0013B ++ DTMB_NIM_RTL2836B_DTMB_VA1T1ER2094, ///< DTMB NIM: RTL2836B DTMB + VA1T1ER2094 ++ DTMB_NIM_RTL2836B_DTMB_TDAC3, ///< DTMB NIM: RTL2836B DTMB + ALPS TDAC3 ++ DTMB_NIM_RTL2836B_DTMB_DTM4C20, ///< DTMB NIM: RTL2836B DTMB + DTM4C20 ++ DTMB_NIM_RTL2836B_DTMB_GTFD32, ///< DTMB NIM: RTL2836B DTMB + GTFD32 ++ DTMB_NIM_RTL2836B_DTMB_GTLP10, ///< DTMB NIM: RTL2836B DTMB + GTFD32 ++ DTMB_NIM_RTL2836B_DTMB_JSS66T, ///< DTMB NIM: RTL2836B DTMB + JSS66T ++ DTMB_NIM_RTL2836B_DTMB_NONE, ///< DTMB NIM: RTL2836B DTMB + NONE TUNER ++ DTMB_NIM_RTD2974_DTMB_VA1E1ED2403, ///< DTMB NIM: RTD2974 DTMB + VA1E1ED2403 ++}; ++ ++ ++ ++ ++ ++/// On/off status ++enum ON_OFF_STATUS ++{ ++ OFF, ///< Off ++ ON, ///< On ++}; ++ ++ ++/// Yes/no status ++enum YES_NO_STATUS ++{ ++ NO, ///< No ++ YES, ///< Yes ++}; ++ ++ ++/// Lock status ++enum LOCK_STATUS ++{ ++ NOT_LOCKED, ///< Not locked ++ LOCKED, ///< Locked ++}; ++ ++ ++/// Loss status ++enum LOSS_STATUS ++{ ++ NOT_LOST, ///< Not lost ++ LOST, ///< Lost ++}; ++ ++ ++/// Function return status ++enum FUNCTION_RETURN_STATUS ++{ ++ FUNCTION_SUCCESS, ///< Execute function successfully. ++ FUNCTION_ERROR, ///< Execute function unsuccessfully. ++}; ++ ++ ++/// Crystal frequency ++enum CRYSTAL_FREQ_HZ ++{ ++ CRYSTAL_FREQ_4000000HZ = 4000000, ///< Crystal frequency = 4.0 MHz ++ CRYSTAL_FREQ_16000000HZ = 16000000, ///< Crystal frequency = 16.0 MHz ++ CRYSTAL_FREQ_16384000HZ = 16384000, ///< Crystal frequency = 16.384 MHz ++ CRYSTAL_FREQ_16457143HZ = 16457143, ///< Crystal frequency = 16.457 MHz ++ CRYSTAL_FREQ_20000000HZ = 20000000, ///< Crystal frequency = 20.0 MHz ++ CRYSTAL_FREQ_20250000HZ = 20250000, ///< Crystal frequency = 20.25 MHz ++ CRYSTAL_FREQ_20480000HZ = 20480000, ///< Crystal frequency = 20.48 MHz ++ CRYSTAL_FREQ_24000000HZ = 24000000, ///< Crystal frequency = 24.0 MHz ++ CRYSTAL_FREQ_25000000HZ = 25000000, ///< Crystal frequency = 25.0 MHz ++ CRYSTAL_FREQ_25200000HZ = 25200000, ///< Crystal frequency = 25.2 MHz ++ CRYSTAL_FREQ_26000000HZ = 26000000, ///< Crystal frequency = 26.0 MHz ++ CRYSTAL_FREQ_26690000HZ = 26690000, ///< Crystal frequency = 26.69 MHz ++ CRYSTAL_FREQ_27000000HZ = 27000000, ///< Crystal frequency = 27.0 MHz ++ CRYSTAL_FREQ_28800000HZ = 28800000, ///< Crystal frequency = 28.8 MHz ++ CRYSTAL_FREQ_32000000HZ = 32000000, ///< Crystal frequency = 32.0 MHz ++ CRYSTAL_FREQ_36000000HZ = 36000000, ///< Crystal frequency = 36.0 MHz ++}; ++ ++ ++/// IF frequency ++enum IF_FREQ_HZ ++{ ++ IF_FREQ_0HZ = 0, ///< IF frequency = 0 MHz ++ IF_FREQ_4000000HZ = 4000000, ///< IF frequency = 4.0 MHz ++ IF_FREQ_4570000HZ = 4570000, ///< IF frequency = 4.57 MHz ++ IF_FREQ_4571429HZ = 4571429, ///< IF frequency = 4.571 MHz ++ IF_FREQ_5000000HZ = 5000000, ///< IF frequency = 5.0 MHz ++ IF_FREQ_36000000HZ = 36000000, ///< IF frequency = 36.0 MHz ++ IF_FREQ_36125000HZ = 36125000, ///< IF frequency = 36.125 MHz ++ IF_FREQ_36150000HZ = 36150000, ///< IF frequency = 36.15 MHz ++ IF_FREQ_36166667HZ = 36166667, ///< IF frequency = 36.167 MHz ++ IF_FREQ_36170000HZ = 36170000, ///< IF frequency = 36.17 MHz ++ IF_FREQ_43750000HZ = 43750000, ///< IF frequency = 43.75 MHz ++ IF_FREQ_44000000HZ = 44000000, ///< IF frequency = 44.0 MHz ++}; ++ ++ ++/// Spectrum mode ++enum SPECTRUM_MODE ++{ ++ SPECTRUM_NORMAL, ///< Normal spectrum ++ SPECTRUM_INVERSE, ///< Inverse spectrum ++}; ++#define SPECTRUM_MODE_NUM 2 ++ ++ ++/// TS interface mode ++enum TS_INTERFACE_MODE ++{ ++ TS_INTERFACE_PARALLEL, ///< Parallel TS interface ++ TS_INTERFACE_SERIAL, ///< Serial TS interface ++}; ++#define TS_INTERFACE_MODE_NUM 2 ++ ++ ++/// Diversity mode ++enum DIVERSITY_PIP_MODE ++{ ++ DIVERSITY_PIP_OFF, ///< Diversity disable and PIP disable ++ DIVERSITY_ON_MASTER, ///< Diversity enable for Master Demod ++ DIVERSITY_ON_SLAVE, ///< Diversity enable for Slave Demod ++ PIP_ON_MASTER, ///< PIP enable for Master Demod ++ PIP_ON_SLAVE, ///< PIP enable for Slave Demod ++}; ++#define DIVERSITY_PIP_MODE_NUM 5 ++ ++ ++ ++ ++ ++/// Base interface module alias ++typedef struct BASE_INTERFACE_MODULE_TAG BASE_INTERFACE_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief Basic I2C reading function pointer ++ ++Upper layer functions will use BASE_FP_I2C_READ() to read ByteNum bytes from I2C device to pReadingBytes buffer. ++ ++ ++@param [in] pBaseInterface The base interface module pointer ++@param [in] DeviceAddr I2C device address in 8-bit format ++@param [out] pReadingBytes Buffer pointer to an allocated memory for storing reading bytes ++@param [in] ByteNum Reading byte number ++ ++ ++@retval FUNCTION_SUCCESS Read bytes from I2C device with reading byte number successfully. ++@retval FUNCTION_ERROR Read bytes from I2C device unsuccessfully. ++ ++ ++@note ++ The requirements of BASE_FP_I2C_READ() function are described as follows: ++ -# Follow the I2C format for BASE_FP_I2C_READ(). \n ++ start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ -# Don't allocate memory on pReadingBytes. ++ -# Upper layer functions should allocate memory on pReadingBytes before using BASE_FP_I2C_READ(). ++ -# Need to assign I2C reading funtion to BASE_FP_I2C_READ() for upper layer functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement I2C reading funciton for BASE_FP_I2C_READ function pointer. ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ unsigned char ReadingBytes[100]; ++ ++ ++ // Assign implemented I2C reading funciton to BASE_FP_I2C_READ in base interface module. ++ BuildBaseInterface(&pBaseInterface, &BaseInterfaceModuleMemory, ..., ..., CustomI2cRead, ..., ...); ++ ++ ... ++ ++ // Use I2cRead() to read 33 bytes from I2C device and store reading bytes to ReadingBytes. ++ pBaseInterface->I2cRead(pBaseInterface, 0x20, ReadingBytes, 33); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*BASE_FP_I2C_READ)( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Basic I2C writing function pointer ++ ++Upper layer functions will use BASE_FP_I2C_WRITE() to write ByteNum bytes from pWritingBytes buffer to I2C device. ++ ++ ++@param [in] pBaseInterface The base interface module pointer ++@param [in] DeviceAddr I2C device address in 8-bit format ++@param [in] pWritingBytes Buffer pointer to writing bytes ++@param [in] ByteNum Writing byte number ++ ++ ++@retval FUNCTION_SUCCESS Write bytes to I2C device with writing bytes successfully. ++@retval FUNCTION_ERROR Write bytes to I2C device unsuccessfully. ++ ++ ++@note ++ The requirements of BASE_FP_I2C_WRITE() function are described as follows: ++ -# Follow the I2C format for BASE_FP_I2C_WRITE(). \n ++ start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ -# Need to assign I2C writing funtion to BASE_FP_I2C_WRITE() for upper layer functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement I2C writing funciton for BASE_FP_I2C_WRITE function pointer. ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ unsigned char WritingBytes[100]; ++ ++ ++ // Assign implemented I2C writing funciton to BASE_FP_I2C_WRITE in base interface module. ++ BuildBaseInterface(&pBaseInterface, &BaseInterfaceModuleMemory, ..., ..., ..., CustomI2cWrite, ...); ++ ++ ... ++ ++ // Use I2cWrite() to write 33 bytes from WritingBytes to I2C device. ++ pBaseInterface->I2cWrite(pBaseInterface, 0x20, WritingBytes, 33); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*BASE_FP_I2C_WRITE)( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Basic waiting function pointer ++ ++Upper layer functions will use BASE_FP_WAIT_MS() to wait WaitTimeMs milliseconds. ++ ++ ++@param [in] pBaseInterface The base interface module pointer ++@param [in] WaitTimeMs Waiting time in millisecond ++ ++ ++@note ++ The requirements of BASE_FP_WAIT_MS() function are described as follows: ++ -# Need to assign a waiting function to BASE_FP_WAIT_MS() for upper layer functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement waiting funciton for BASE_FP_WAIT_MS function pointer. ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ ... ++ ++ return; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ ++ // Assign implemented waiting funciton to BASE_FP_WAIT_MS in base interface module. ++ BuildBaseInterface(&pBaseInterface, &BaseInterfaceModuleMemory, ..., ..., ..., ..., CustomWaitMs); ++ ++ ... ++ ++ // Use WaitMs() to wait 30 millisecond. ++ pBaseInterface->WaitMs(pBaseInterface, 30); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef void ++(*BASE_FP_WAIT_MS)( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief User defined data pointer setting function pointer ++ ++One can use BASE_FP_SET_USER_DEFINED_DATA_POINTER() to set user defined data pointer of base interface structure for ++custom basic function implementation. ++ ++ ++@param [in] pBaseInterface The base interface module pointer ++@param [in] pUserDefinedData Pointer to user defined data ++ ++ ++@note ++ One can use BASE_FP_GET_USER_DEFINED_DATA_POINTER() to get user defined data pointer of base interface structure for ++ custom basic function implementation. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement I2C reading funciton for BASE_FP_I2C_READ function pointer. ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ CUSTOM_USER_DEFINED_DATA *pUserDefinedData; ++ ++ ++ // Get user defined data pointer of base interface structure for custom I2C reading function. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&pUserDefinedData); ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ unsigned char ReadingBytes[100]; ++ ++ CUSTOM_USER_DEFINED_DATA UserDefinedData; ++ ++ ++ // Assign implemented I2C reading funciton to BASE_FP_I2C_READ in base interface module. ++ BuildBaseInterface(&pBaseInterface, &BaseInterfaceModuleMemory, ..., ..., CustomI2cRead, ..., ...); ++ ++ ... ++ ++ // Set user defined data pointer of base interface structure for custom basic functions. ++ pBaseInterface->SetUserDefinedDataPointer(pBaseInterface, &UserDefinedData); ++ ++ // Use I2cRead() to read 33 bytes from I2C device and store reading bytes to ReadingBytes. ++ pBaseInterface->I2cRead(pBaseInterface, 0x20, ReadingBytes, 33); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef void ++(*BASE_FP_SET_USER_DEFINED_DATA_POINTER)( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void *pUserDefinedData ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief User defined data pointer getting function pointer ++ ++One can use BASE_FP_GET_USER_DEFINED_DATA_POINTER() to get user defined data pointer of base interface structure for ++custom basic function implementation. ++ ++ ++@param [in] pBaseInterface The base interface module pointer ++@param [in] ppUserDefinedData Pointer to user defined data pointer ++ ++ ++@note ++ One can use BASE_FP_SET_USER_DEFINED_DATA_POINTER() to set user defined data pointer of base interface structure for ++ custom basic function implementation. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement I2C reading funciton for BASE_FP_I2C_READ function pointer. ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ CUSTOM_USER_DEFINED_DATA *pUserDefinedData; ++ ++ ++ // Get user defined data pointer of base interface structure for custom I2C reading function. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&pUserDefinedData); ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ unsigned char ReadingBytes[100]; ++ ++ CUSTOM_USER_DEFINED_DATA UserDefinedData; ++ ++ ++ // Assign implemented I2C reading funciton to BASE_FP_I2C_READ in base interface module. ++ BuildBaseInterface(&pBaseInterface, &BaseInterfaceModuleMemory, ..., ..., CustomI2cRead, ..., ...); ++ ++ ... ++ ++ // Set user defined data pointer of base interface structure for custom basic functions. ++ pBaseInterface->SetUserDefinedDataPointer(pBaseInterface, &UserDefinedData); ++ ++ // Use I2cRead() to read 33 bytes from I2C device and store reading bytes to ReadingBytes. ++ pBaseInterface->I2cRead(pBaseInterface, 0x20, ReadingBytes, 33); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef void ++(*BASE_FP_GET_USER_DEFINED_DATA_POINTER)( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void **ppUserDefinedData ++ ); ++ ++ ++ ++ ++ ++/// Base interface module structure ++struct BASE_INTERFACE_MODULE_TAG ++{ ++ // Variables and function pointers ++ unsigned long I2cReadingByteNumMax; ++ unsigned long I2cWritingByteNumMax; ++ ++ BASE_FP_I2C_READ I2cRead; ++ BASE_FP_I2C_WRITE I2cWrite; ++ BASE_FP_WAIT_MS WaitMs; ++ ++ BASE_FP_SET_USER_DEFINED_DATA_POINTER SetUserDefinedDataPointer; ++ BASE_FP_GET_USER_DEFINED_DATA_POINTER GetUserDefinedDataPointer; ++ ++ ++ // User defined data ++ void *pUserDefinedData; ++}; ++ ++ ++ ++ ++ ++/** ++ ++@brief Base interface builder ++ ++Use BuildBaseInterface() to build base interface for module functions to access basic functions. ++ ++ ++@param [in] ppBaseInterface Pointer to base interface module pointer ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++ ++ ++@note ++ -# One should build base interface before using module functions. ++ -# The I2C reading format is described as follows: ++ start_bit + (device_addr | reading_bit) + reading_byte * byte_num + stop_bit ++ -# The I2cReadingByteNumMax is the maximum byte_num of the I2C reading format. ++ -# The I2C writing format is described as follows: ++ start_bit + (device_addr | writing_bit) + writing_byte * byte_num + stop_bit ++ -# The I2cWritingByteNumMax is the maximum byte_num of the I2C writing format. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "foundation.h" ++ ++ ++// Implement I2C reading funciton for BASE_FP_I2C_READ function pointer. ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++// Implement I2C writing funciton for BASE_FP_I2C_WRITE function pointer. ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ ++ return FUNCTION_ERROR; ++} ++ ++ ++// Implement waiting funciton for BASE_FP_WAIT_MS function pointer. ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ ... ++ ++ return; ++} ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ ++ // Build base interface with the following settings. ++ // ++ // 1. Assign 9 to maximum I2C reading byte number. ++ // 2. Assign 8 to maximum I2C writing byte number. ++ // 3. Assign CustomI2cRead() to basic I2C reading function pointer. ++ // 4. Assign CustomI2cWrite() to basic I2C writing function pointer. ++ // 5. Assign CustomWaitMs() to basic waiting function pointer. ++ // ++ BuildBaseInterface( ++ &pBaseInterface, ++ &BaseInterfaceModuleMemory, ++ 9, ++ 8, ++ CustomI2cRead, ++ CustomI2cWrite, ++ CustomWaitMs ++ ); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++void ++BuildBaseInterface( ++ BASE_INTERFACE_MODULE **ppBaseInterface, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ unsigned long I2cReadingByteNumMax, ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs ++ ); ++ ++ ++ ++ ++ ++// User data pointer of base interface structure setting and getting functions ++void ++base_interface_SetUserDefinedDataPointer( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void *pUserDefinedData ++ ); ++ ++void ++base_interface_GetUserDefinedDataPointer( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ void **ppUserDefinedData ++ ); ++ ++ ++ ++ ++ ++// Math functions ++ ++// Binary and signed integer converter ++unsigned long ++SignedIntToBin( ++ long Value, ++ unsigned char BitNum ++ ); ++ ++long ++BinToSignedInt( ++ unsigned long Binary, ++ unsigned char BitNum ++ ); ++ ++ ++ ++// Arithmetic ++unsigned long ++DivideWithCeiling( ++ unsigned long Dividend, ++ unsigned long Divisor ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/** ++ ++@mainpage Realtek demod Source Code Manual ++ ++@note ++ -# The Realtek demod API source code is designed for demod IC driver porting. ++ -# The API source code is written in C language without floating-point arithmetic. ++ -# One can use the API to manipulate Realtek demod IC. ++ -# The API will call custom underlayer functions through API base interface module. ++ ++ ++@par Important: ++ -# Please assign API base interface module with custom underlayer functions instead of modifying API source code. ++ -# Please see the example code to understand the relation bewteen API and custom system. ++ ++*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/i2c_bridge.h b/drivers/media/dvb/dvb-usb/i2c_bridge.h +new file mode 100644 +index 0000000..ce67e8b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/i2c_bridge.h +@@ -0,0 +1,122 @@ ++#ifndef __I2C_BRIDGE_H ++#define __I2C_BRIDGE_H ++ ++/** ++ ++@file ++ ++@brief I2C bridge module ++ ++I2C bridge module contains I2C forwarding function pointers. ++ ++*/ ++ ++ ++ ++ ++ ++/// I2C bridge module pre-definition ++typedef struct I2C_BRIDGE_MODULE_TAG I2C_BRIDGE_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief I2C reading command forwarding function pointer ++ ++Tuner upper level functions will use I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD() to send tuner I2C reading command through ++demod. ++ ++ ++@param [in] pI2cBridge The I2C bridge module pointer ++@param [in] DeviceAddr I2C device address in 8-bit format ++@param [out] pReadingBytes Pointer to an allocated memory for storing reading bytes ++@param [in] ByteNum Reading byte number ++ ++ ++@retval FUNCTION_SUCCESS Forwarding I2C reading command successfully. ++@retval FUNCTION_ERROR Forwarding I2C reading command unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD() with the corresponding function. ++ ++*/ ++typedef int ++(*I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD)( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief I2C writing command forwarding function pointer ++ ++Tuner upper level functions will use I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD() to send tuner I2C writing command through ++demod. ++ ++ ++@param [in] pI2cBridge The I2C bridge module pointer ++@param [in] DeviceAddr I2C device address in 8-bit format ++@param [out] pWritingBytes Pointer to writing bytes ++@param [in] ByteNum Writing byte number ++ ++ ++@retval FUNCTION_SUCCESS Forwarding I2C writing command successfully. ++@retval FUNCTION_ERROR Forwarding I2C writing command unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD() with the corresponding function. ++ ++*/ ++typedef int ++(*I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD)( ++ I2C_BRIDGE_MODULE *pI2cBridge, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/// I2C bridge module structure ++struct I2C_BRIDGE_MODULE_TAG ++{ ++ // Private variables ++ void *pPrivateData; ++ ++ ++ // I2C bridge function pointers ++ I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD ForwardI2cReadingCmd; ///< I2C reading command forwading function pointer ++ I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD ForwardI2cWritingCmd; ///< I2C writing command forwading function pointer ++ ++}; ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/math_mpi.c b/drivers/media/dvb/dvb-usb/math_mpi.c +new file mode 100644 +index 0000000..d3a2c7c +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/math_mpi.c +@@ -0,0 +1,1054 @@ ++/** ++ ++@file ++ ++@brief Mutliple precision integer (MPI) arithmetic definition ++ ++One can use to mutliple precision arithmetic to manipulate large signed integers. ++ ++*/ ++ ++ ++#include "math_mpi.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief Set multiple precision signed integer value. ++ ++Use MpiSetValue() to set multiple precision signed integer MPI value. ++ ++ ++@param [in] pMpiVar Pointer to an MPI variable ++@param [in] Value Value for setting ++ ++ ++@note ++ The MPI bit number will be minimized in MpiSetValue(). ++ ++*/ ++void ++MpiSetValue( ++ MPI *pMpiVar, ++ long Value ++ ) ++{ ++ int i; ++ unsigned char SignedBit; ++ unsigned char ExtensionByte; ++ ++ ++ ++ // Set MPI value according to ansigned value. ++ for(i = 0; i < MPI_LONG_BYTE_NUM; i++) ++ pMpiVar->Value[i] = (unsigned char)((Value >> (MPI_BYTE_SHIFT * i)) & MPI_BYTE_MASK); ++ ++ ++ // Get extension byte according to signed bit. ++ SignedBit = (unsigned char)((Value >> (MPI_LONG_BIT_NUM - 1)) & MPI_BIT_0_MASK); ++ ExtensionByte = (SignedBit == 0x0) ? 0x00 : 0xff; ++ ++ ++ // Extend MPI signed bit with extension byte stuff. ++ for(i = MPI_LONG_BYTE_NUM; i < MPI_VALUE_BYTE_NUM_MAX; i++) ++ pMpiVar->Value[i] = ExtensionByte; ++ ++ ++ // Minimize MPI bit number. ++ MpiMinimizeBitNum(pMpiVar); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get multiple precision signed integer value. ++ ++Use MpiGetValue() to get multiple precision unsigned integer MPI value. ++ ++ ++@param [in] MpiVar Pointer to an MPI variable ++@param [out] pValue Pointer to an allocated memory for getting MPI value ++ ++ ++@note ++ The necessary bit number of MPI value must be less than or equal to 32 bits. ++ ++*/ ++void ++MpiGetValue( ++ MPI MpiVar, ++ long *pValue ++ ) ++{ ++ int i; ++ unsigned long Value; ++ ++ ++ ++ // Set value with zero. ++ Value = 0x0; ++ ++ ++ // Combine MPI value bytes into value. ++ for(i = 0; i < MPI_LONG_BYTE_NUM; i++) ++ Value |= MpiVar.Value[i] << (MPI_BYTE_SHIFT * i); ++ ++ ++ // Assigned value to value pointer. ++ *pValue = (long)Value; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set multiple precision signed integer bit value. ++ ++Use MpiSetBit() to set multiple precision signed integer MPI bit value. ++ ++ ++@param [in] pMpiVar Pointer to an MPI variable ++@param [in] BitPosition Bit position with zero-based index ++@param [in] BitValue Bit value for setting ++ ++ ++@note ++ Bit position must be 0 ~ (MPI bit number). ++ ++*/ ++void ++MpiSetBit( ++ MPI *pMpiVar, ++ unsigned long BitPosition, ++ unsigned char BitValue ++ ) ++{ ++ unsigned long TargetBytePos, TargetBitPos; ++ ++ ++ ++ // Calculate target byte and bit position. ++ TargetBytePos = BitPosition / MPI_BYTE_BIT_NUM; ++ TargetBitPos = BitPosition % MPI_BYTE_BIT_NUM; ++ ++ ++ // Set MPI bit value according to calculated target byte and bit position. ++ pMpiVar->Value[TargetBytePos] &= (unsigned char)(~(0x1 << TargetBitPos)); ++ pMpiVar->Value[TargetBytePos] |= (BitValue & MPI_BIT_0_MASK) << TargetBitPos; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++/** ++ ++@brief Get multiple precision signed integer bit value. ++ ++Use MpiGetBit() to get multiple precision unsigned integer MPI bit value. ++ ++ ++@param [in] MpiVar Pointer to an MPI variable ++@param [in] BitPosition Bit position with zero-based index ++@param [out] pBitValue Pointer to an allocated memory for getting MPI bit value ++ ++ ++@note ++ Bit position must be 0 ~ (MPI bit number). ++ ++*/ ++void ++MpiGetBit( ++ MPI MpiVar, ++ unsigned long BitPosition, ++ unsigned char *pBitValue ++ ) ++{ ++ unsigned long TargetBytePos, TargetBitPos; ++ ++ ++ ++ // Calculate target byte and bit position. ++ TargetBytePos = BitPosition / MPI_BYTE_BIT_NUM; ++ TargetBitPos = BitPosition % MPI_BYTE_BIT_NUM; ++ ++ ++ // Get MPI bit value according to calculated target byte and bit position. ++ *pBitValue = (MpiVar.Value[TargetBytePos] >> TargetBitPos) & MPI_BIT_0_MASK; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get multiple precision signed integer signed bit value. ++ ++Use MpiGetBit() to get multiple precision unsigned integer MPI signed bit value. ++ ++ ++@param [in] MpiVar Pointer to an MPI variable ++@param [out] pSignedBitValue Pointer to an allocated memory for getting MPI signed bit value ++ ++*/ ++void ++MpiGetSignedBit( ++ MPI MpiVar, ++ unsigned char *pSignedBitValue ++ ) ++{ ++ // Get MPI variable signed bit. ++ MpiGetBit(MpiVar, MPI_VALUE_BIT_NUM_MAX - 1, pSignedBitValue); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Assign multiple precision signed integer with another one. ++ ++Use MpiAssign() to assign multiple precision signed integer with another one. ++ ++ ++@param [out] pResult Pointer to an allocated memory for storing result ++@param [in] Operand Operand ++ ++ ++@note ++ The result bit number will be minimized in MpiAssign(). ++ ++*/ ++void ++MpiAssign( ++ MPI *pResult, ++ MPI Operand ++ ) ++{ ++ unsigned int i; ++ ++ ++ ++ // Copy value bytes from operand to result. ++ for(i = 0; i < MPI_VALUE_BYTE_NUM_MAX; i++) ++ pResult->Value[i] = Operand.Value[i]; ++ ++ ++ // Minimize result bit nubmer. ++ MpiMinimizeBitNum(pResult); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Minus unary multiple precision signed integer. ++ ++Use MpiUnaryMinus() to minus unary multiple precision signed integer. ++ ++ ++@param [out] pResult Pointer to an allocated memory for storing result ++@param [in] Operand Operand ++ ++ ++@note ++ The result bit number will be minimized in MpiUnaryMinus(). ++ ++*/ ++void ++MpiUnaryMinus( ++ MPI *pResult, ++ MPI Operand ++ ) ++{ ++ unsigned int i; ++ MPI Const; ++ ++ ++ ++ // Set result value byte with operand bitwise complement value byte. ++ for(i = 0; i < MPI_VALUE_BYTE_NUM_MAX; i++) ++ pResult->Value[i] = ~Operand.Value[i]; ++ ++ ++ // Add result with 0x1. ++ // Note: MpiAdd() will minimize result bit number. ++ MpiSetValue(&Const, 0x1); ++ MpiAdd(pResult, *pResult, Const); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Add multiple precision signed integers. ++ ++Use MpiAdd() to add multiple precision signed integers. ++ ++ ++@param [out] pSum Pointer to an allocated memory for storing sum ++@param [in] Augend Augend ++@param [in] Addend Addend ++ ++ ++@note ++ The sum bit number will be minimized in MpiAdd(). ++ ++*/ ++void ++MpiAdd( ++ MPI *pSum, ++ MPI Augend, ++ MPI Addend ++ ) ++{ ++ unsigned int i; ++ unsigned long MiddleResult; ++ unsigned char Carry; ++ ++ ++ // Add augend and addend to sum form value LSB byte to value MSB byte. ++ Carry = 0; ++ ++ for(i = 0; i < MPI_VALUE_BYTE_NUM_MAX; i++) ++ { ++ // Set current sum value byte and determine carry. ++ MiddleResult = Augend.Value[i] + Addend.Value[i] + Carry; ++ pSum->Value[i] = (unsigned char)(MiddleResult & MPI_BYTE_MASK); ++ Carry = (unsigned char)((MiddleResult >> MPI_BYTE_SHIFT) & MPI_BYTE_MASK); ++ } ++ ++ ++ // Minimize sum bit nubmer. ++ MpiMinimizeBitNum(pSum); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief subtract multiple precision signed integers. ++ ++Use MpiSub() to subtract multiple precision signed integers. ++ ++ ++@param [out] pDifference Pointer to an allocated memory for storing difference ++@param [in] Minuend Minuend ++@param [in] Subtrahend Subtrahend ++ ++ ++@note ++ The difference bit number will be minimized in MpiSub(). ++ ++*/ ++void ++MpiSub( ++ MPI *pDifference, ++ MPI Minuend, ++ MPI Subtrahend ++ ) ++{ ++ MPI MiddleResult; ++ ++ ++ ++ // Take subtrahend unary minus value. ++ MpiUnaryMinus(&MiddleResult, Subtrahend); ++ ++ ++ // Add minuend and subtrahend unary minus value to difference. ++ // Note: MpiAdd() will minimize result bit number. ++ MpiAdd(pDifference, Minuend, MiddleResult); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Multiply arbitrary precision signed integers. ++ ++Use MpiMul() to multiply arbitrary precision signed integers. ++ ++ ++@param [out] pProduct Pointer to an allocated memory for storing product ++@param [in] Multiplicand Multiplicand ++@param [in] Multiplicator Multiplicator ++ ++ ++@note ++ -# The sum of multiplicand and multiplicator bit number must be less MPI_VALUE_BIT_NUM_MAX. ++ -# The product bit number will be minimized in MpiMul(). ++ ++*/ ++void ++MpiMul( ++ MPI *pProduct, ++ MPI Multiplicand, ++ MPI Multiplicator ++ ) ++{ ++ int i; ++ ++ unsigned char MultiplicandSignedBit, MultiplicatorSignedBit; ++ MPI MultiplicandAbs, MultiplicatorAbs; ++ ++ unsigned char CurrentBit; ++ ++ ++ ++ // Get multiplicand signed bit. ++ MpiGetSignedBit(Multiplicand, &MultiplicandSignedBit); ++ ++ // Take absolute value of multiplicand. ++ if(MultiplicandSignedBit == 0x0) ++ MpiAssign(&MultiplicandAbs, Multiplicand); ++ else ++ MpiUnaryMinus(&MultiplicandAbs, Multiplicand); ++ ++ ++ // Get multiplicator signed bit. ++ MpiGetSignedBit(Multiplicator, &MultiplicatorSignedBit); ++ ++ // Take absolute value of multiplicator. ++ if(MultiplicatorSignedBit == 0x0) ++ MpiAssign(&MultiplicatorAbs, Multiplicator); ++ else ++ MpiUnaryMinus(&MultiplicatorAbs, Multiplicator); ++ ++ ++ // Multiply multiplicand and multiplicator from LSB bit to MSB bit. ++ MpiSetValue(pProduct, 0x0); ++ ++ for(i = MPI_VALUE_BIT_NUM_MAX - 1; i > -1; i--) ++ { ++ // Shift product toward left with one bit. ++ MpiLeftShift(pProduct, *pProduct, 1); ++ ++ // Get current absolute multiplicator bit value. ++ MpiGetBit(MultiplicatorAbs, i, &CurrentBit); ++ ++ // If current multiplicator bit is 0x1, add absolute multiplicand value to product. ++ // Note: MpiAdd() will minimize result bit number. ++ if(CurrentBit == 0x1) ++ MpiAdd(pProduct, *pProduct, MultiplicandAbs); ++ } ++ ++ ++ // Determine the signed bit of product according to signed bits of multiplicand and multiplicator. ++ // Note: MpiUnaryMinus() will minimize result bit number. ++ if(MultiplicandSignedBit != MultiplicatorSignedBit) ++ MpiUnaryMinus(pProduct, *pProduct); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Divide arbitrary precision signed integers. ++ ++Use MpiDiv() to divide arbitrary precision signed integers. ++ ++ ++@param [out] pQuotient Pointer to an allocated memory for storing quotient ++@param [out] pRemainder Pointer to an allocated memory for storing remainder ++@param [in] Dividend Dividend ++@param [in] Divisor Divisor ++ ++ ++@note ++ -# The dividend bit number must be minimized. ++ -# The divisor must be not equal to zero. ++ -# The product bit number will be minimized in MpiDiv(). ++ ++*/ ++void ++MpiDiv( ++ MPI *pQuotient, ++ MPI *pRemainder, ++ MPI Dividend, ++ MPI Divisor ++ ) ++{ ++ unsigned int i; ++ ++ unsigned char DividendSignedBit, DivisorSignedBit; ++ MPI DividendAbs, DivisorAbs; ++ ++ unsigned long PrimaryDividendBitNum; ++ unsigned char ShiftBit; ++ ++ MPI Const; ++ MPI MiddleResult; ++ ++ ++ ++ // Get dividend signed bit. ++ MpiGetSignedBit(Dividend, &DividendSignedBit); ++ ++ // Take absolute value of dividend. ++ if(DividendSignedBit == 0x0) ++ MpiAssign(&DividendAbs, Dividend); ++ else ++ MpiUnaryMinus(&DividendAbs, Dividend); ++ ++ ++ // Get divisor signed bit. ++ MpiGetSignedBit(Divisor, &DivisorSignedBit); ++ ++ // Take absolute value of divisor. ++ if(DivisorSignedBit == 0x0) ++ MpiAssign(&DivisorAbs, Divisor); ++ else ++ MpiUnaryMinus(&DivisorAbs, Divisor); ++ ++ ++ // Get primary absolute dividend bit number. ++ PrimaryDividendBitNum = DividendAbs.BitNum; ++ ++ ++ // Get quotient and remainder by division algorithm. ++ MpiSetValue(pQuotient, 0x0); ++ MpiSetValue(pRemainder, 0x0); ++ ++ for(i = 0; i < PrimaryDividendBitNum; i++) ++ { ++ // Shift quotient toward left with one bit. ++ // Note: MpiLeftShift() will minimize result bit number. ++ MpiLeftShift(pQuotient, *pQuotient, 1); ++ ++ // Shift remainder toward left with one bit. ++ MpiLeftShift(pRemainder, *pRemainder, 1); ++ ++ // Shift absolute dividend toward left with one bit. ++ MpiLeftShift(&DividendAbs, DividendAbs, 1); ++ ++ // Set remainder LSB according to absolute dividend. ++ MpiGetBit(DividendAbs, PrimaryDividendBitNum, &ShiftBit); ++ MpiSetBit(pRemainder, 0, ShiftBit); ++ ++ // If remainder is greater than or equal to absolute divisor, ++ // substract absolute divisor from remainder and set quotient LSB with one. ++ if(MpiGreaterThan(*pRemainder, DivisorAbs) || MpiEqualTo(*pRemainder, DivisorAbs)) ++ { ++ MpiSub(pRemainder, *pRemainder, DivisorAbs); ++ MpiSetBit(pQuotient, 0, 0x1); ++ } ++ } ++ ++ ++ // Modify quotient according to dividend signed bit, divisor signed bit, and remainder. ++ ++ // Determine the signed bit of quotient. ++ if(DividendSignedBit != DivisorSignedBit) ++ { ++ // Take unary minus quotient. ++ // Note: MpiUnaryMinus() will minimize result bit number. ++ MpiUnaryMinus(pQuotient, *pQuotient); ++ ++ // If remainder is greater than zero, subtract 1 from quotient. ++ // Note: MpiSub() will minimize result bit number. ++ MpiSetValue(&Const, 0x0); ++ ++ if(MpiGreaterThan(*pRemainder, Const)) ++ { ++ MpiSetValue(&Const, 0x1); ++ MpiSub(pQuotient, *pQuotient, Const); ++ } ++ } ++ ++ ++ // Modify remainder according to dividend, divisor, and quotient. ++ ++ // Remainder = dividend - divisor * quotient; ++ // Note: MpiSub() will minimize result bit number. ++ MpiMul(&MiddleResult, Divisor, *pQuotient); ++ MpiSub(pRemainder, Dividend, MiddleResult); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Shift multiple precision signed integer toward right. ++ ++Use MpiRightShift() to shift arbitrary precision signed integer toward right with assigned bit number. ++ ++ ++@param [out] pResult Pointer to an allocated memory for storing result ++@param [in] Operand Operand ++@param [in] ShiftBitNum Shift bit number ++ ++ ++@note ++ -# The result MSB bits will be stuffed with signed bit ++ -# The result bit number will be minimized in MpiRightShift(). ++ ++*/ ++void ++MpiRightShift( ++ MPI *pResult, ++ MPI Operand, ++ unsigned long ShiftBitNum ++ ) ++{ ++ unsigned int i; ++ unsigned long StuffBitNum; ++ unsigned char CurrentBit; ++ unsigned char SignedBit; ++ ++ ++ ++ // Determine stuff bit number according to shift bit nubmer. ++ StuffBitNum = (ShiftBitNum < MPI_VALUE_BIT_NUM_MAX) ? ShiftBitNum : MPI_VALUE_BIT_NUM_MAX; ++ ++ ++ // Copy operand bits to result with stuff bit number. ++ for(i = 0; i < (MPI_VALUE_BIT_NUM_MAX - StuffBitNum); i++) ++ { ++ MpiGetBit(Operand, i + StuffBitNum, &CurrentBit); ++ MpiSetBit(pResult, i, CurrentBit); ++ } ++ ++ ++ // Get operand signed bit. ++ MpiGetSignedBit(Operand, &SignedBit); ++ ++ ++ // Stuff result MSB bits with signed bit. ++ for(i = (MPI_VALUE_BIT_NUM_MAX - StuffBitNum); i < MPI_VALUE_BIT_NUM_MAX; i++) ++ MpiSetBit(pResult, i, SignedBit); ++ ++ ++ // Minimize result bit number. ++ MpiMinimizeBitNum(pResult); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Shift multiple precision signed integer toward left. ++ ++Use MpiLeftShift() to shift arbitrary precision signed integer toward left with assigned bit number. ++ ++ ++@param [out] pResult Pointer to an allocated memory for storing result ++@param [in] Operand Operand ++@param [in] ShiftBitNum Shift bit number ++ ++ ++@note ++ The result bit number will be minimized in MpiLeftShift(). ++ ++*/ ++void ++MpiLeftShift( ++ MPI *pResult, ++ MPI Operand, ++ unsigned long ShiftBitNum ++ ) ++{ ++ unsigned int i; ++ unsigned long StuffBitNum; ++ unsigned char CurrentBit; ++ ++ ++ // Determine stuff bit number according to shift bit nubmer. ++ StuffBitNum = (ShiftBitNum < MPI_VALUE_BIT_NUM_MAX) ? ShiftBitNum : MPI_VALUE_BIT_NUM_MAX; ++ ++ ++ // Stuff result LSB bits with zeros ++ for(i = 0; i < StuffBitNum; i++) ++ MpiSetBit(pResult, i, 0x0); ++ ++ ++ // Copy operand bits to result with stuff bit number. ++ for(i = StuffBitNum; i < MPI_VALUE_BIT_NUM_MAX; i++) ++ { ++ MpiGetBit(Operand, i - StuffBitNum, &CurrentBit); ++ MpiSetBit(pResult, i, CurrentBit); ++ } ++ ++ ++ // Minimize result bit number. ++ MpiMinimizeBitNum(pResult); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Compare multiple precision signed integes with equal-to criterion. ++ ++Use MpiEqualTo() to compare multiple precision signed integes with equal-to criterion. ++ ++ ++@param [in] MpiLeft Left MPI ++@param [in] MpiRight Right MPI ++ ++ ++@retval MPI_NO "Left MPI == Right MPI" is false. ++@retval MPI_YES "Left MPI == Right MPI" is true. ++ ++ ++@note ++ The constants MPI_YES and MPI_NO are defined in MPI_YES_NO_STATUS enumeration. ++ ++*/ ++int ++MpiEqualTo( ++ MPI MpiLeft, ++ MPI MpiRight ++ ) ++{ ++ unsigned int i; ++ ++ ++ ++ // Check not-equal-to condition. ++ for(i = 0; i < MPI_VALUE_BYTE_NUM_MAX; i++) ++ { ++ if(MpiLeft.Value[i] != MpiRight.Value[i]) ++ goto condition_others; ++ } ++ ++ ++ // Right MPI is greater than left MPI. ++ return MPI_YES; ++ ++ ++condition_others: ++ ++ ++ // Other conditions. ++ return MPI_NO; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Compare multiple precision signed integes with greater-than criterion. ++ ++Use MpiGreaterThan() to compare multiple precision signed integes with greater-than criterion. ++ ++ ++@param [in] MpiLeft Left MPI ++@param [in] MpiRight Right MPI ++ ++ ++@retval MPI_NO "Left MPI > Right MPI" is false. ++@retval MPI_YES "Left MPI > Right MPI" is true. ++ ++ ++@note ++ The constants MPI_YES and MPI_NO are defined in MPI_YES_NO_STATUS enumeration. ++ ++*/ ++int ++MpiGreaterThan( ++ MPI MpiLeft, ++ MPI MpiRight ++ ) ++{ ++ MPI MiddleResult; ++ unsigned char SignedBit; ++ ++ ++ ++ // Check equal-to condition. ++ if(MpiEqualTo(MpiLeft, MpiRight) == MPI_YES) ++ goto condition_others; ++ ++ ++ // Subtract right MPI form left MPI. ++ MpiSub(&MiddleResult, MpiLeft, MpiRight); ++ ++ ++ // Check less-than condition. ++ MpiGetSignedBit(MiddleResult, &SignedBit); ++ ++ if(SignedBit == 0x1) ++ goto condition_others; ++ ++ ++ // Right MPI is greater than left MPI. ++ return MPI_YES; ++ ++ ++condition_others: ++ ++ ++ // Other conditions. ++ return MPI_NO; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Compare multiple precision signed integes with less-than criterion. ++ ++Use MpiLessThan() to compare multiple precision signed integes with less-than criterion. ++ ++ ++@param [in] MpiLeft Left MPI ++@param [in] MpiRight Right MPI ++ ++ ++@retval MPI_NO "Left MPI < Right MPI" is false. ++@retval MPI_YES "Left MPI < Right MPI" is true. ++ ++ ++@note ++ The constants MPI_YES and MPI_NO are defined in MPI_YES_NO_STATUS enumeration. ++ ++*/ ++int ++MpiLessThan( ++ MPI MpiLeft, ++ MPI MpiRight ++ ) ++{ ++ MPI MiddleResult; ++ unsigned char SignedBit; ++ ++ ++ ++ // Check equal-to condition. ++ if(MpiEqualTo(MpiLeft, MpiRight) == MPI_YES) ++ goto condition_others; ++ ++ ++ // Subtract right MPI form left MPI. ++ MpiSub(&MiddleResult, MpiLeft, MpiRight); ++ ++ ++ // Check greater-than condition. ++ MpiGetSignedBit(MiddleResult, &SignedBit); ++ ++ if(SignedBit == 0x0) ++ goto condition_others; ++ ++ ++ // Right MPI is less than left MPI. ++ return MPI_YES; ++ ++ ++condition_others: ++ ++ ++ // Other conditions. ++ return MPI_NO; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Minimize multiple precision signed integer bit number. ++ ++Use MpiMinimizeBitNum() to minimize multiple precision signed integer MPI bit number. ++ ++ ++@param [in] pMpiVar Pointer to an allocated memory for storing result ++ ++*/ ++void ++MpiMinimizeBitNum( ++ MPI *pMpiVar ++ ) ++{ ++ int i; ++ unsigned char SignedBit; ++ unsigned char BitValue; ++ ++ ++ ++ // Get signed bit form MPI; ++ MpiGetSignedBit(*pMpiVar, &SignedBit); ++ ++ ++ // Find MPI MSB position. ++ // Note: The MSB of signed integer is the rightest signed bit. ++ for(i = (MPI_VALUE_BIT_NUM_MAX - 2); i > -1; i--) ++ { ++ // Get current bit value. ++ MpiGetBit(*pMpiVar, i, &BitValue); ++ ++ // Compare current bit with signed bit. ++ if(BitValue != SignedBit) ++ break; ++ } ++ ++ ++ // Set MPI bit number. ++ // Note: MPI bit number must be greater than one. ++ pMpiVar->BitNum = (i == -1) ? 2 : (i + 2); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++/** ++ ++@brief Calculate multiple precision signed integer logarithm with base 2. ++ ++Use MpiMinimizeBitNum() to calculate multiple precision signed integer logarithm with base 2. ++ ++ ++@param [out] pResult Pointer to an allocated memory for storing result (unit: pow(2, - ResultFracBitNum)) ++@param [in] MpiVar MPI variable for calculating ++@param [in] ResultFracBitNum Result fraction bit number ++ ++ ++@note ++ -# MPI variable bit number must be minimized. ++ -# MPI variable bit number must be less than (MPI_VALUE_BIT_NUM_MAX / 2 + 1). ++ -# MPI variable must be greater than zero. ++ -# If MPI variable is zero, the result is zero in MpiLog2(). ++ -# The result bit number will be minimized in MpiLog2(). ++ ++*/ ++void ++MpiLog2( ++ MPI *pResult, ++ MPI MpiVar, ++ unsigned long ResultFracBitNum ++ ) ++{ ++ unsigned int i; ++ MPI MiddleResult; ++ unsigned char BitValue; ++ ++ ++ ++ // Get integer part of MPI logarithm result with base 2. ++ MpiSetValue(pResult, (long)(MpiVar.BitNum - 2)); ++ ++ ++ // Get fraction part of MPI logarithm result with base 2 by logarithm algorithm. ++ // Note: Take middle result format as follows: ++ // x x . x x ~ x ++ // (integer part 2 bits) . (fraction part MPI_LOG_MIDDLE_RESULT_FRAC_BIT_NUM bits) ++ ++ // Set middle result with initial value. ++ MpiLeftShift(&MiddleResult, MpiVar, (MPI_LOG_MIDDLE_RESULT_FRAC_BIT_NUM - MpiVar.BitNum + 2)); ++ ++ // Calculate result fraction bits. ++ for(i = 0; i < ResultFracBitNum; i++) ++ { ++ // Shift result toward left with one bit. ++ // Note: MpiLeftShift() will minimize result bit number. ++ MpiLeftShift(pResult, *pResult, 1); ++ ++ // Square middle result. ++ MpiMul(&MiddleResult, MiddleResult, MiddleResult); ++ ++ // Shift middle result toward right with fraction bit num. ++ MpiRightShift(&MiddleResult, MiddleResult, MPI_LOG_MIDDLE_RESULT_FRAC_BIT_NUM); ++ ++ // Get middle result integer part bit 1. ++ MpiGetBit(MiddleResult, MPI_LOG_MIDDLE_RESULT_FRAC_BIT_NUM + 1, &BitValue); ++ ++ // If middle result integer part bit 1 is equal to 0x1, ++ // shift middle result with one bit toward right and set result LSB with one. ++ if(BitValue == 0x1) ++ { ++ MpiRightShift(&MiddleResult, MiddleResult, 1); ++ MpiSetBit(pResult, 0, 0x1); ++ } ++ } ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/math_mpi.h b/drivers/media/dvb/dvb-usb/math_mpi.h +new file mode 100644 +index 0000000..73a7d1d +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/math_mpi.h +@@ -0,0 +1,201 @@ ++#ifndef __MATH_MPI_H ++#define __MATH_MPI_H ++ ++/** ++ ++@file ++ ++@brief Mutliple precision integer (MPI) arithmetic declaration ++ ++One can use to mutliple precision arithmetic to manipulate large signed integers. ++ ++*/ ++ ++ ++ ++ ++ ++// Constant ++#define MPI_BYTE_BIT_NUM 8 ++#define MPI_LONG_BYTE_NUM 4 ++#define MPI_LONG_BIT_NUM 32 ++ ++ ++ ++// Mask and shift ++#define MPI_BYTE_MASK 0xff ++#define MPI_BYTE_SHIFT 8 ++ ++#define MPI_BIT_0_MASK 0x1 ++#define MPI_BIT_7_SHIFT 7 ++ ++ ++ ++// Multiple precision integer definition ++#define MPI_VALUE_BYTE_NUM_MAX 10 ///< Maximum MPI value byte number ++#define MPI_VALUE_BIT_NUM_MAX (MPI_VALUE_BYTE_NUM_MAX * MPI_BYTE_BIT_NUM) ///< Maximum MPI value bit number ++ ++/// Multiple precision integer structure ++typedef struct ++{ ++ unsigned long BitNum; ++ unsigned char Value[MPI_VALUE_BYTE_NUM_MAX]; ++} ++MPI; ++ ++ ++ ++/// MPI yes/no status ++enum MPI_YES_NO_STATUS ++{ ++ MPI_NO, ///< No ++ MPI_YES, ///< Yes ++}; ++ ++ ++ ++// Logarithm with base 2 ++#define MPI_LOG_MIDDLE_RESULT_FRAC_BIT_NUM (MPI_VALUE_BIT_NUM_MAX / 2 - 2) ++ ++ ++ ++ ++ ++// MPI access ++void ++MpiSetValue( ++ MPI *pMpiVar, ++ long Value ++ ); ++ ++void ++MpiGetValue( ++ MPI MpiVar, ++ long *pValue ++ ); ++ ++void ++MpiSetBit( ++ MPI *pMpiVar, ++ unsigned long BitPosition, ++ unsigned char BitValue ++ ); ++ ++void ++MpiGetBit( ++ MPI MpiVar, ++ unsigned long BitPosition, ++ unsigned char *pBitValue ++ ); ++ ++void ++MpiGetSignedBit( ++ MPI MpiVar, ++ unsigned char *pSignedBit ++ ); ++ ++ ++ ++// MPI operator ++void ++MpiAssign( ++ MPI *pResult, ++ MPI Operand ++ ); ++ ++void ++MpiUnaryMinus( ++ MPI *pResult, ++ MPI Operand ++ ); ++ ++void ++MpiAdd( ++ MPI *pSum, ++ MPI Augend, ++ MPI Addend ++ ); ++ ++void ++MpiSub( ++ MPI *pDifference, ++ MPI Minuend, ++ MPI Subtrahend ++ ); ++ ++void ++MpiMul( ++ MPI *pProduct, ++ MPI Multiplicand, ++ MPI Multiplicator ++ ); ++ ++void ++MpiDiv( ++ MPI *pQuotient, ++ MPI *pRemainder, ++ MPI Dividend, ++ MPI Divisor ++ ); ++ ++void ++MpiRightShift( ++ MPI *pResult, ++ MPI Operand, ++ unsigned long ShiftBitNum ++ ); ++ ++void ++MpiLeftShift( ++ MPI *pResult, ++ MPI Operand, ++ unsigned long ShiftBitNum ++ ); ++ ++int ++MpiEqualTo( ++ MPI MpiLeft, ++ MPI MpiRight ++ ); ++ ++int ++MpiGreaterThan( ++ MPI MpiLeft, ++ MPI MpiRight ++ ); ++ ++int ++MpiLessThan( ++ MPI MpiLeft, ++ MPI MpiRight ++ ); ++ ++void ++MpiMinimizeBitNum( ++ MPI *pMpiVar ++ ); ++ ++ ++ ++// MPI special function ++void ++MpiLog2( ++ MPI *pResult, ++ MPI MpiVar, ++ unsigned long ResultFracBitNum ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.c +new file mode 100644 +index 0000000..697e16c +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.c +@@ -0,0 +1,798 @@ ++/** ++ ++@file ++ ++@brief RTL2832 E4000 NIM module definition ++ ++One can manipulate RTL2832 E4000 NIM through RTL2832 E4000 NIM module. ++RTL2832 E4000 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_e4000.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 E4000 NIM module builder ++ ++Use BuildRtl2832E4000Module() to build RTL2832 E4000 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 E4000 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr E4000 I2C device address ++@param [in] TunerCrystalFreqHz E4000 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildRtl2832E4000Module() to build RTL2832 E4000 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832E4000Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ RTL2832_E4000_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832E4000); ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_E4000; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build E4000 tuner module. ++ BuildE4000Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_e4000_Initialize; ++ pNim->SetParameters = rtl2832_e4000_SetParameters; ++ pNim->UpdateFunction = rtl2832_e4000_UpdateFunction; ++ ++ ++ // Initialize NIM extra module variables. ++ pNimExtra->TunerModeUpdateWaitTimeMax = ++ DivideWithCeiling(RTL2832_E4000_TUNER_MODE_UPDATE_WAIT_TIME_MS, DemodUpdateFuncRefPeriodMs); ++ pNimExtra->TunerModeUpdateWaitTime = 0; ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_NORMAL; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_e4000_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_E4000_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x5a }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x18 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x8 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x18 }, ++ ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9d4 }, ++ {DVBT_EN_GI_PGA, 0x0 }, ++ {DVBT_THD_LOCK_UP, 0x0 }, ++ {DVBT_THD_LOCK_DW, 0x0 }, ++ {DVBT_THD_UP1, 0x14 }, ++ {DVBT_THD_DW1, 0xec }, ++ ++ {DVBT_INTER_CNT_LEN, 0xc }, ++ {DVBT_GI_PGA_STATE, 0x0 }, ++ {DVBT_EN_AGC_PGA, 0x1 }, ++ ++ {DVBT_REG_GPE, 0x1 }, ++ {DVBT_REG_GPO, 0x1 }, ++ {DVBT_REG_MONSEL, 0x1 }, ++ {DVBT_REG_MON, 0x1 }, ++ {DVBT_REG_4MSEL, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_E4000_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_e4000_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ E4000_EXTRA_MODULE *pTunerExtra; ++ RTL2832_E4000_EXTRA_MODULE *pNimExtra; ++ ++ unsigned long TunerBandwidthHz; ++ ++ int RfFreqKhz; ++ int BandwidthKhz; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.E4000); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832E4000); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthHz according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthHz = E4000_BANDWIDTH_6000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthHz = E4000_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthHz = E4000_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth Hz with TunerBandwidthHz. ++ if(pTunerExtra->SetBandwidthHz(pTuner, TunerBandwidthHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner gain mode with normal condition for update procedure. ++ RfFreqKhz = (int)((RfFreqHz + 500) / 1000); ++ BandwidthKhz = (int)((TunerBandwidthHz + 500) / 1000); ++ ++// if(E4000_nominal(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++ if(E4000_sensitivity(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++// if(E4000_linearity(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_NORMAL; ++ ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2832_e4000_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ RTL2832_E4000_EXTRA_MODULE *pNimExtra; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832E4000); ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Increase tuner mode update waiting time. ++ pNimExtra->TunerModeUpdateWaitTime += 1; ++ ++ ++ // Check if need to update tuner mode according to update waiting time. ++ if(pNimExtra->TunerModeUpdateWaitTime == pNimExtra->TunerModeUpdateWaitTimeMax) ++ { ++ // Reset update waiting time. ++ pNimExtra->TunerModeUpdateWaitTime = 0; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Update tuner mode. ++ if(rtl2832_e4000_UpdateTunerMode(pNim) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update tuner mode. ++ ++One can use rtl2832_e4000_UpdateTunerMode() to update tuner mode. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update tuner mode successfully. ++@retval FUNCTION_ERROR Update tuner mode unsuccessfully. ++ ++*/ ++int ++rtl2832_e4000_UpdateTunerMode( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ static const long LnaGainTable[RTL2832_E4000_LNA_GAIN_TABLE_LEN][RTL2832_E4000_LNA_GAIN_BAND_NUM] = ++ { ++ // VHF Gain, UHF Gain, ReadingByte ++ {-50, -50 }, // 0x0 ++ {-25, -25 }, // 0x1 ++ {-50, -50 }, // 0x2 ++ {-25, -25 }, // 0x3 ++ {0, 0 }, // 0x4 ++ {25, 25 }, // 0x5 ++ {50, 50 }, // 0x6 ++ {75, 75 }, // 0x7 ++ {100, 100 }, // 0x8 ++ {125, 125 }, // 0x9 ++ {150, 150 }, // 0xa ++ {175, 175 }, // 0xb ++ {200, 200 }, // 0xc ++ {225, 250 }, // 0xd ++ {250, 280 }, // 0xe ++ {250, 280 }, // 0xf ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long LnaGainAddTable[RTL2832_E4000_LNA_GAIN_ADD_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ NO_USE, // 0x0 ++ NO_USE, // 0x1 ++ NO_USE, // 0x2 ++ 0, // 0x3 ++ NO_USE, // 0x4 ++ 20, // 0x5 ++ NO_USE, // 0x6 ++ 70, // 0x7 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long MixerGainTable[RTL2832_E4000_MIXER_GAIN_TABLE_LEN][RTL2832_E4000_MIXER_GAIN_BAND_NUM] = ++ { ++ // VHF Gain, UHF Gain, ReadingByte ++ {90, 40 }, // 0x0 ++ {170, 120 }, // 0x1 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage1GainTable[RTL2832_E4000_IF_STAGE_1_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ -30, // 0x0 ++ 60, // 0x1 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage2GainTable[RTL2832_E4000_IF_STAGE_2_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ 0, // 0x0 ++ 30, // 0x1 ++ 60, // 0x2 ++ 90, // 0x3 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage3GainTable[RTL2832_E4000_IF_STAGE_3_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ 0, // 0x0 ++ 30, // 0x1 ++ 60, // 0x2 ++ 90, // 0x3 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage4GainTable[RTL2832_E4000_IF_STAGE_4_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ 0, // 0x0 ++ 10, // 0x1 ++ 20, // 0x2 ++ 20, // 0x3 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage5GainTable[RTL2832_E4000_IF_STAGE_5_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ 0, // 0x0 ++ 30, // 0x1 ++ 60, // 0x2 ++ 90, // 0x3 ++ 120, // 0x4 ++ 120, // 0x5 ++ 120, // 0x6 ++ 120, // 0x7 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ static const long IfStage6GainTable[RTL2832_E4000_IF_STAGE_6_GAIN_TABLE_LEN] = ++ { ++ // Gain, ReadingByte ++ 0, // 0x0 ++ 30, // 0x1 ++ 60, // 0x2 ++ 90, // 0x3 ++ 120, // 0x4 ++ 120, // 0x5 ++ 120, // 0x6 ++ 120, // 0x7 ++ ++ // Note: The gain unit is 0.1 dB. ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ E4000_EXTRA_MODULE *pTunerExtra; ++ RTL2832_E4000_EXTRA_MODULE *pNimExtra; ++ ++ unsigned long RfFreqHz; ++ int RfFreqKhz; ++ unsigned long BandwidthHz; ++ int BandwidthKhz; ++ ++ unsigned char ReadingByte; ++ int BandIndex; ++ ++ unsigned char TunerBitsLna, TunerBitsLnaAdd, TunerBitsMixer; ++ unsigned char TunerBitsIfStage1, TunerBitsIfStage2, TunerBitsIfStage3, TunerBitsIfStage4; ++ unsigned char TunerBitsIfStage5, TunerBitsIfStage6; ++ ++ long TunerGainLna, TunerGainLnaAdd, TunerGainMixer; ++ long TunerGainIfStage1, TunerGainIfStage2, TunerGainIfStage3, TunerGainIfStage4; ++ long TunerGainIfStage5, TunerGainIfStage6; ++ ++ long TunerGainTotal; ++ long TunerInputPower; ++ ++ ++ // Get tuner module. ++ pTuner = pNim->pTuner; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.E4000); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832E4000); ++ ++ ++ // Get tuner RF frequency in KHz. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ if(pTuner->GetRfFreqHz(pTuner, &RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ RfFreqKhz = (int)((RfFreqHz + 500) / 1000); ++ ++ // Get tuner bandwidth in KHz. ++ // Note: BandwidthKhz = round(BandwidthHz / 1000) ++ if(pTunerExtra->GetBandwidthHz(pTuner, &BandwidthHz) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ BandwidthKhz = (int)((BandwidthHz + 500) / 1000); ++ ++ ++ // Determine band index. ++ BandIndex = (RfFreqHz < RTL2832_E4000_RF_BAND_BOUNDARY_HZ) ? 0 : 1; ++ ++ ++ // Get tuner LNA gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_LNA_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsLna = (ReadingByte & RTL2832_E4000_LNA_GAIN_MASK) >> RTL2832_E4000_LNA_GAIN_SHIFT; ++ TunerGainLna = LnaGainTable[TunerBitsLna][BandIndex]; ++ ++ ++ // Get tuner LNA additional gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_LNA_GAIN_ADD_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsLnaAdd = (ReadingByte & RTL2832_E4000_LNA_GAIN_ADD_MASK) >> RTL2832_E4000_LNA_GAIN_ADD_SHIFT; ++ TunerGainLnaAdd = LnaGainAddTable[TunerBitsLnaAdd]; ++ ++ ++ // Get tuner mixer gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_MIXER_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsMixer = (ReadingByte & RTL2832_E4000_MIXER_GAIN_MASK) >> RTL2832_E4000_LNA_GAIN_ADD_SHIFT; ++ TunerGainMixer = MixerGainTable[TunerBitsMixer][BandIndex]; ++ ++ ++ // Get tuner IF stage 1 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_1_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage1 = (ReadingByte & RTL2832_E4000_IF_STAGE_1_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_1_GAIN_SHIFT; ++ TunerGainIfStage1 = IfStage1GainTable[TunerBitsIfStage1]; ++ ++ ++ // Get tuner IF stage 2 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_2_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage2 = (ReadingByte & RTL2832_E4000_IF_STAGE_2_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_2_GAIN_SHIFT; ++ TunerGainIfStage2 = IfStage2GainTable[TunerBitsIfStage2]; ++ ++ ++ // Get tuner IF stage 3 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_3_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage3 = (ReadingByte & RTL2832_E4000_IF_STAGE_3_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_3_GAIN_SHIFT; ++ TunerGainIfStage3 = IfStage3GainTable[TunerBitsIfStage3]; ++ ++ ++ // Get tuner IF stage 4 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_4_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage4 = (ReadingByte & RTL2832_E4000_IF_STAGE_4_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_4_GAIN_SHIFT; ++ TunerGainIfStage4 = IfStage4GainTable[TunerBitsIfStage4]; ++ ++ ++ // Get tuner IF stage 5 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_5_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage5 = (ReadingByte & RTL2832_E4000_IF_STAGE_5_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_5_GAIN_SHIFT; ++ TunerGainIfStage5 = IfStage5GainTable[TunerBitsIfStage5]; ++ ++ ++ // Get tuner IF stage 6 gain according to reading byte and table. ++ if(pTunerExtra->GetRegByte(pTuner, RTL2832_E4000_IF_STAGE_6_GAIN_ADDR, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ TunerBitsIfStage6 = (ReadingByte & RTL2832_E4000_IF_STAGE_6_GAIN_MASK) >> RTL2832_E4000_IF_STAGE_6_GAIN_SHIFT; ++ TunerGainIfStage6 = IfStage6GainTable[TunerBitsIfStage6]; ++ ++ ++ // Calculate tuner total gain. ++ // Note: The unit of tuner total gain is 0.1 dB. ++ TunerGainTotal = TunerGainLna + TunerGainLnaAdd + TunerGainMixer + ++ TunerGainIfStage1 + TunerGainIfStage2 + TunerGainIfStage3 + TunerGainIfStage4 + ++ TunerGainIfStage5 + TunerGainIfStage6; ++ ++ // Calculate tuner input power. ++ // Note: The unit of tuner input power is 0.1 dBm ++ TunerInputPower = RTL2832_E4000_TUNER_OUTPUT_POWER_UNIT_0P1_DBM - TunerGainTotal; ++ ++ ++ // Determine tuner gain mode according to tuner input power. ++ // Note: The unit of tuner input power is 0.1 dBm ++ switch(pNimExtra->TunerGainMode) ++ { ++ default: ++ case RTL2832_E4000_TUNER_GAIN_SENSITIVE: ++ ++ if(TunerInputPower > -650) ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_NORMAL; ++ ++ break; ++ ++ ++ case RTL2832_E4000_TUNER_GAIN_NORMAL: ++ ++ if(TunerInputPower < -750) ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_SENSITIVE; ++ ++ if(TunerInputPower > -400) ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_LINEAR; ++ ++ break; ++ ++ ++ case RTL2832_E4000_TUNER_GAIN_LINEAR: ++ ++ if(TunerInputPower < -500) ++ pNimExtra->TunerGainMode = RTL2832_E4000_TUNER_GAIN_NORMAL; ++ ++ break; ++ } ++ ++ ++ // Set tuner gain mode. ++ switch(pNimExtra->TunerGainMode) ++ { ++ default: ++ case RTL2832_E4000_TUNER_GAIN_SENSITIVE: ++ ++ if(E4000_sensitivity(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ ++ ++ case RTL2832_E4000_TUNER_GAIN_NORMAL: ++ ++ if(E4000_nominal(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ ++ ++ case RTL2832_E4000_TUNER_GAIN_LINEAR: ++ ++ if(E4000_linearity(pTuner, RfFreqKhz, BandwidthKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_get_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.h +new file mode 100644 +index 0000000..6278ef3 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_e4000.h +@@ -0,0 +1,213 @@ ++#ifndef __NIM_RTL2832_E4000 ++#define __NIM_RTL2832_E4000 ++ ++/** ++ ++@file ++ ++@brief RTL2832 E4000 NIM module declaration ++ ++One can manipulate RTL2832 E4000 NIM through RTL2832 E4000 NIM module. ++RTL2832 E4000 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_e4000.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 E4000 NIM module. ++ BuildRtl2832E4000Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc8, // The E4000 I2C device address is 0xc8 in 8-bit format. ++ CRYSTAL_FREQ_26000000HZ // The E4000 crystal frequency is 26 MHz. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_e4000.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_E4000_ADDITIONAL_INIT_REG_TABLE_LEN 34 ++ ++#define RTL2832_E4000_LNA_GAIN_TABLE_LEN 16 ++#define RTL2832_E4000_LNA_GAIN_ADD_TABLE_LEN 8 ++#define RTL2832_E4000_MIXER_GAIN_TABLE_LEN 2 ++#define RTL2832_E4000_IF_STAGE_1_GAIN_TABLE_LEN 2 ++#define RTL2832_E4000_IF_STAGE_2_GAIN_TABLE_LEN 4 ++#define RTL2832_E4000_IF_STAGE_3_GAIN_TABLE_LEN 4 ++#define RTL2832_E4000_IF_STAGE_4_GAIN_TABLE_LEN 4 ++#define RTL2832_E4000_IF_STAGE_5_GAIN_TABLE_LEN 8 ++#define RTL2832_E4000_IF_STAGE_6_GAIN_TABLE_LEN 8 ++ ++#define RTL2832_E4000_LNA_GAIN_BAND_NUM 2 ++#define RTL2832_E4000_MIXER_GAIN_BAND_NUM 2 ++ ++#define RTL2832_E4000_RF_BAND_BOUNDARY_HZ 300000000 ++ ++#define RTL2832_E4000_LNA_GAIN_ADDR 0x14 ++#define RTL2832_E4000_LNA_GAIN_MASK 0xf ++#define RTL2832_E4000_LNA_GAIN_SHIFT 0 ++ ++#define RTL2832_E4000_LNA_GAIN_ADD_ADDR 0x24 ++#define RTL2832_E4000_LNA_GAIN_ADD_MASK 0x7 ++#define RTL2832_E4000_LNA_GAIN_ADD_SHIFT 0 ++ ++#define RTL2832_E4000_MIXER_GAIN_ADDR 0x15 ++#define RTL2832_E4000_MIXER_GAIN_MASK 0x1 ++#define RTL2832_E4000_MIXER_GAIN_SHIFT 0 ++ ++#define RTL2832_E4000_IF_STAGE_1_GAIN_ADDR 0x16 ++#define RTL2832_E4000_IF_STAGE_1_GAIN_MASK 0x1 ++#define RTL2832_E4000_IF_STAGE_1_GAIN_SHIFT 0 ++ ++#define RTL2832_E4000_IF_STAGE_2_GAIN_ADDR 0x16 ++#define RTL2832_E4000_IF_STAGE_2_GAIN_MASK 0x6 ++#define RTL2832_E4000_IF_STAGE_2_GAIN_SHIFT 1 ++ ++#define RTL2832_E4000_IF_STAGE_3_GAIN_ADDR 0x16 ++#define RTL2832_E4000_IF_STAGE_3_GAIN_MASK 0x18 ++#define RTL2832_E4000_IF_STAGE_3_GAIN_SHIFT 3 ++ ++#define RTL2832_E4000_IF_STAGE_4_GAIN_ADDR 0x16 ++#define RTL2832_E4000_IF_STAGE_4_GAIN_MASK 0x60 ++#define RTL2832_E4000_IF_STAGE_4_GAIN_SHIFT 5 ++ ++#define RTL2832_E4000_IF_STAGE_5_GAIN_ADDR 0x17 ++#define RTL2832_E4000_IF_STAGE_5_GAIN_MASK 0x7 ++#define RTL2832_E4000_IF_STAGE_5_GAIN_SHIFT 0 ++ ++#define RTL2832_E4000_IF_STAGE_6_GAIN_ADDR 0x17 ++#define RTL2832_E4000_IF_STAGE_6_GAIN_MASK 0x38 ++#define RTL2832_E4000_IF_STAGE_6_GAIN_SHIFT 3 ++ ++#define RTL2832_E4000_TUNER_OUTPUT_POWER_UNIT_0P1_DBM -100 ++ ++#define RTL2832_E4000_TUNER_MODE_UPDATE_WAIT_TIME_MS 1000 ++ ++ ++// Tuner gain mode ++enum RTL2832_E4000_TUNER_GAIN_MODE ++{ ++ RTL2832_E4000_TUNER_GAIN_SENSITIVE, ++ RTL2832_E4000_TUNER_GAIN_NORMAL, ++ RTL2832_E4000_TUNER_GAIN_LINEAR, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832E4000Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// RTL2832 E4000 NIM manipulaing functions ++int ++rtl2832_e4000_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_e4000_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_e4000_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_e4000_UpdateTunerMode( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.c +new file mode 100644 +index 0000000..30afd03 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.c +@@ -0,0 +1,627 @@ ++/** ++ ++@file ++ ++@brief RTL2832 FC0012 NIM module definition ++ ++One can manipulate RTL2832 FC0012 NIM through RTL2832 FC0012 NIM module. ++RTL2832 FC0012 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_fc0012.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 FC0012 NIM module builder ++ ++Use BuildRtl2832Fc0012Module() to build RTL2832 FC0012 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 FC0012 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr FC0012 I2C device address ++@param [in] TunerCrystalFreqHz FC0012 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildRtl2832Fc0012Module() to build RTL2832 FC0012 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Fc0012Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ RTL2832_FC0012_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0012); ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_FC0012; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build FC0012 tuner module. ++ BuildFc0012Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_fc0012_Initialize; ++ pNim->SetParameters = rtl2832_fc0012_SetParameters; ++ pNim->UpdateFunction = rtl2832_fc0012_UpdateFunction; ++ ++ ++ // Initialize NIM extra module variables. ++ pNimExtra->LnaUpdateWaitTimeMax = DivideWithCeiling(RTL2832_FC0012_LNA_UPDATE_WAIT_TIME_MS, DemodUpdateFuncRefPeriodMs); ++ pNimExtra->LnaUpdateWaitTime = 0; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_fc0012_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_FC0012_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x5a }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9bf }, ++ {DVBT_EN_GI_PGA, 0x0 }, ++ {DVBT_THD_LOCK_UP, 0x0 }, ++ {DVBT_THD_LOCK_DW, 0x0 }, ++ {DVBT_THD_UP1, 0x11 }, ++ {DVBT_THD_DW1, 0xef }, ++ {DVBT_INTER_CNT_LEN, 0xc }, ++ {DVBT_GI_PGA_STATE, 0x0 }, ++ {DVBT_EN_AGC_PGA, 0x1 }, ++// {DVBT_REG_GPE, 0x1 }, ++// {DVBT_REG_GPO, 0x0 }, ++// {DVBT_REG_MONSEL, 0x0 }, ++// {DVBT_REG_MON, 0x3 }, ++// {DVBT_REG_4MSEL, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner registers. ++ if(fc0012_SetRegMaskBits(pTuner, 0xd, 7, 0, 0x2) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner registers. ++ if(fc0012_SetRegMaskBits(pTuner, 0x11, 7, 0, 0x0) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner registers. ++ if(fc0012_SetRegMaskBits(pTuner, 0x15, 7, 0, 0x4) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_FC0012_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Get tuner RSSI value when calibration is on. ++ // Note: Need to execute rtl2832_fc0012_GetTunerRssiCalOn() after demod AD7 is on. ++ if(rtl2832_fc0012_GetTunerRssiCalOn(pNim) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_fc0012_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ FC0012_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = FC0012_BANDWIDTH_6000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = FC0012_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = FC0012_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2832_fc0012_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ RTL2832_FC0012_EXTRA_MODULE *pNimExtra; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0012); ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Increase tuner LNA_GAIN update waiting time. ++ pNimExtra->LnaUpdateWaitTime += 1; ++ ++ ++ // Check if need to update tuner LNA_GAIN according to update waiting time. ++ if(pNimExtra->LnaUpdateWaitTime == pNimExtra->LnaUpdateWaitTimeMax) ++ { ++ // Reset update waiting time. ++ pNimExtra->LnaUpdateWaitTime = 0; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Update tuner LNA gain with RSSI. ++ if(rtl2832_fc0012_UpdateTunerLnaGainWithRssi(pNim) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get tuner RSSI value when calibration is on. ++ ++One can use rtl2832_fc0012_GetTunerRssiCalOn() to get tuner calibration-on RSSI value. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Get tuner calibration-on RSSI value successfully. ++@retval FUNCTION_ERROR Get tuner calibration-on RSSI value unsuccessfully. ++ ++*/ ++int ++rtl2832_fc0012_GetTunerRssiCalOn( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ FC0012_EXTRA_MODULE *pTunerExtra; ++ RTL2832_FC0012_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0012); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0012); ++ ++ ++ // Set tuner EN_CAL_RSSI to 0x1. ++ if(fc0012_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x1) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner LNA_POWER_DOWN to 0x1. ++ if(fc0012_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x1) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Get demod RSSI_R when tuner RSSI calibration is on. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &(pNimExtra->RssiRCalOn)) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set tuner EN_CAL_RSSI to 0x0. ++ if(fc0012_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x0) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner LNA_POWER_DOWN to 0x0. ++ if(fc0012_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x0) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update tuner LNA_GAIN with RSSI. ++ ++One can use rtl2832_fc0012_UpdateTunerLnaGainWithRssi() to update tuner LNA_GAIN with RSSI. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update tuner LNA_GAIN with RSSI successfully. ++@retval FUNCTION_ERROR Update tuner LNA_GAIN with RSSI unsuccessfully. ++ ++*/ ++int ++rtl2832_fc0012_UpdateTunerLnaGainWithRssi( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ FC0012_EXTRA_MODULE *pTunerExtra; ++ RTL2832_FC0012_EXTRA_MODULE *pNimExtra; ++ ++ unsigned long RssiRCalOff; ++ long RssiRDiff; ++ unsigned char LnaGain; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0012); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0012); ++ ++ ++ // Get demod RSSI_R when tuner RSSI calibration in off. ++ // Note: Tuner EN_CAL_RSSI and LNA_POWER_DOWN are set to 0x0 after rtl2832_fc0012_GetTunerRssiCalOn() executing. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &RssiRCalOff) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Calculate RSSI_R difference. ++ RssiRDiff = RssiRCalOff - pNimExtra->RssiRCalOn; ++ ++ // Get tuner LNA_GAIN. ++ if(fc0012_GetRegMaskBits(pTuner, 0x13, 4, 3, &LnaGain) != FC0012_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine next LNA_GAIN according to RSSI_R difference and current LNA_GAIN. ++ switch(LnaGain) ++ { ++ default: ++ case FC0012_LNA_GAIN_LOW: ++ ++ if(RssiRDiff <= 0) ++ LnaGain = FC0012_LNA_GAIN_MIDDLE; ++ ++ break; ++ ++ ++ case FC0012_LNA_GAIN_MIDDLE: ++ ++ if(RssiRDiff >= 34) ++ LnaGain = FC0012_LNA_GAIN_LOW; ++ ++ if(RssiRDiff <= 0) ++ LnaGain = FC0012_LNA_GAIN_HIGH; ++ ++ break; ++ ++ ++ case FC0012_LNA_GAIN_HIGH: ++ ++ if(RssiRDiff >= 8) ++ LnaGain = FC0012_LNA_GAIN_MIDDLE; ++ ++ break; ++ } ++ ++ ++ // Set tuner LNA_GAIN. ++ if(fc0012_SetRegMaskBits(pTuner, 0x13, 4, 3, LnaGain) != FC0012_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.h +new file mode 100644 +index 0000000..6c8d387 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0012.h +@@ -0,0 +1,155 @@ ++#ifndef __NIM_RTL2832_FC0012 ++#define __NIM_RTL2832_FC0012 ++ ++/** ++ ++@file ++ ++@brief RTL2832 FC0012 NIM module declaration ++ ++One can manipulate RTL2832 FC0012 NIM through RTL2832 FC0012 NIM module. ++RTL2832 FC0012 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_fc0012.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 FC0012 NIM module. ++ BuildRtl2832Fc0012Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc6, // The FC0012 I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_36000000HZ // The FC0012 crystal frequency is 36.0 MHz. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_fc0012.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_FC0012_ADDITIONAL_INIT_REG_TABLE_LEN 29 ++#define RTL2832_FC0012_LNA_UPDATE_WAIT_TIME_MS 1000 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Fc0012Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// RTL2832 FC0012 NIM manipulaing functions ++int ++rtl2832_fc0012_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0012_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_fc0012_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0012_GetTunerRssiCalOn( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0012_UpdateTunerLnaGainWithRssi( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.c +new file mode 100644 +index 0000000..6fb400a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.c +@@ -0,0 +1,816 @@ ++/** ++ ++@file ++ ++@brief RTL2832 FC0013 NIM module definition ++ ++One can manipulate RTL2832 FC0013 NIM through RTL2832 FC0013 NIM module. ++RTL2832 FC0013 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_fc0013.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 FC0013 NIM module builder ++ ++Use BuildRtl2832Fc0013Module() to build RTL2832 FC0013 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 FC0013 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr FC0013 I2C device address ++@param [in] TunerCrystalFreqHz FC0013 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildRtl2832Fc0013Module() to build RTL2832 FC0013 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Fc0013Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ RTL2832_FC0013_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0013); ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_FC0013; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build FC0013 tuner module. ++ BuildFc0013Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_fc0013_Initialize; ++ pNim->SetParameters = rtl2832_fc0013_SetParameters; ++ pNim->UpdateFunction = rtl2832_fc0013_UpdateFunction; ++ ++ ++ // Initialize NIM extra module variables. ++ pNimExtra->LnaUpdateWaitTimeMax = DivideWithCeiling(RTL2832_FC0013_LNA_UPDATE_WAIT_TIME_MS, DemodUpdateFuncRefPeriodMs); ++ pNimExtra->LnaUpdateWaitTime = 0; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_fc0013_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_FC0013_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x5a }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9bf }, ++ {DVBT_EN_GI_PGA, 0x0 }, ++ {DVBT_THD_LOCK_UP, 0x0 }, ++ {DVBT_THD_LOCK_DW, 0x0 }, ++ {DVBT_THD_UP1, 0x11 }, ++ {DVBT_THD_DW1, 0xef }, ++ {DVBT_INTER_CNT_LEN, 0xc }, ++ {DVBT_GI_PGA_STATE, 0x0 }, ++ {DVBT_EN_AGC_PGA, 0x1 }, ++// {DVBT_REG_GPE, 0x1 }, ++// {DVBT_REG_GPO, 0x0 }, ++// {DVBT_REG_MONSEL, 0x0 }, ++// {DVBT_REG_MON, 0x3 }, ++// {DVBT_REG_4MSEL, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set FC0013 up-dowm AGC. ++ //(0xFE for master of dual). ++ //(0xFC for slave of dual, and for 2832 mini dongle). ++ if(fc0013_SetRegMaskBits(pTuner, 0x0c, 7, 0, 0xFC) != FC0013_I2C_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_FC0013_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Get tuner RSSI value when calibration is on. ++ // Note: Need to execute rtl2832_fc0013_GetTunerRssiCalOn() after demod AD7 is on. ++ if(rtl2832_fc0013_GetTunerRssiCalOn(pNim) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++error_status_set_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_fc0013_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ FC0013_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = FC0013_BANDWIDTH_6000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = FC0013_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = FC0013_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset tuner IQ LPF BW. ++ if(pTunerExtra->RcCalReset(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner IQ LPF BW, val=-2 for D-book ACI test. ++ if(pTunerExtra->RcCalAdd(pTuner, -2) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2832_fc0013_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ RTL2832_FC0013_EXTRA_MODULE *pNimExtra; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0013); ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Increase tuner LNA_GAIN update waiting time. ++ pNimExtra->LnaUpdateWaitTime += 1; ++ ++ ++ // Check if need to update tuner LNA_GAIN according to update waiting time. ++ if(pNimExtra->LnaUpdateWaitTime == pNimExtra->LnaUpdateWaitTimeMax) ++ { ++ // Reset update waiting time. ++ pNimExtra->LnaUpdateWaitTime = 0; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Update tuner LNA gain with RSSI. ++ if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(pNim) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get tuner RSSI value when calibration is on. ++ ++One can use rtl2832_fc0013_GetTunerRssiCalOn() to get tuner calibration-on RSSI value. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Get tuner calibration-on RSSI value successfully. ++@retval FUNCTION_ERROR Get tuner calibration-on RSSI value unsuccessfully. ++ ++*/ ++int ++rtl2832_fc0013_GetTunerRssiCalOn( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ FC0013_EXTRA_MODULE *pTunerExtra; ++ RTL2832_FC0013_EXTRA_MODULE *pNimExtra; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0013); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0013); ++ ++ // Get NIM base interface. ++ pBaseInterface = pNim->pBaseInterface; ++ ++ ++ // Set tuner EN_CAL_RSSI to 0x1. ++ if(fc0013_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x1) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner LNA_POWER_DOWN to 0x1. ++ if(fc0013_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x1) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Wait 100 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 100); ++ ++ // Get demod RSSI_R when tuner RSSI calibration is on. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &(pNimExtra->RssiRCalOn)) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Set tuner EN_CAL_RSSI to 0x0. ++ if(fc0013_SetRegMaskBits(pTuner, 0x9, 4, 4, 0x0) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner LNA_POWER_DOWN to 0x0. ++ if(fc0013_SetRegMaskBits(pTuner, 0x6, 0, 0, 0x0) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Update tuner LNA_GAIN with RSSI. ++ ++One can use rtl2832_fc0013_UpdateTunerLnaGainWithRssi() to update tuner LNA_GAIN with RSSI. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update tuner LNA_GAIN with RSSI successfully. ++@retval FUNCTION_ERROR Update tuner LNA_GAIN with RSSI unsuccessfully. ++ ++*/ ++int ++rtl2832_fc0013_UpdateTunerLnaGainWithRssi( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ FC0013_EXTRA_MODULE *pTunerExtra; ++ RTL2832_FC0013_EXTRA_MODULE *pNimExtra; ++ ++ unsigned long RssiRCalOff; ++ long RssiRDiff; ++ unsigned char LnaGain; ++ unsigned char ReadValue; ++ ++ // added from Fitipower, 2011-2-23, v0.8 ++ int boolVhfFlag; // 0:false, 1:true ++ int boolEnInChgFlag; // 0:false, 1:true ++ int intGainShift; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0013); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Fc0013); ++ ++ ++ // Get demod RSSI_R when tuner RSSI calibration in off. ++ // Note: Tuner EN_CAL_RSSI and LNA_POWER_DOWN are set to 0x0 after rtl2832_fc0013_GetTunerRssiCalOn() executing. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &RssiRCalOff) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // To avoid the wrong rssi calibration value in the environment with strong RF pulse signal. ++ if(RssiRCalOff < pNimExtra->RssiRCalOn) ++ pNimExtra->RssiRCalOn = RssiRCalOff; ++ ++ ++ // Calculate RSSI_R difference. ++ RssiRDiff = RssiRCalOff - pNimExtra->RssiRCalOn; ++ ++ // Get tuner LNA_GAIN. ++ if(fc0013_GetRegMaskBits(pTuner, 0x14, 4, 0, &LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine next LNA_GAIN according to RSSI_R difference and current LNA_GAIN. ++ switch(LnaGain) ++ { ++ default: ++ ++ boolVhfFlag = 0; ++ boolEnInChgFlag = 1; ++ intGainShift = 10; ++ LnaGain = FC0013_LNA_GAIN_HIGH_19; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ ++ ++ case FC0013_LNA_GAIN_HIGH_19: ++ ++ if(RssiRDiff >= 10) ++ { ++ boolVhfFlag = 1; ++ boolEnInChgFlag = 0; ++ intGainShift = 10; ++ LnaGain = FC0013_LNA_GAIN_HIGH_17; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ else ++ { ++ goto success_status_Lna_Gain_No_Change; ++ } ++ ++ ++ case FC0013_LNA_GAIN_HIGH_17: ++ ++ if(RssiRDiff <= 2) ++ { ++ boolVhfFlag = 0; ++ boolEnInChgFlag = 1; ++ intGainShift = 10; ++ LnaGain = FC0013_LNA_GAIN_HIGH_19; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ else if(RssiRDiff >= 24) ++ { ++ boolVhfFlag = 0; ++ boolEnInChgFlag = 0; ++ intGainShift = 7; ++ LnaGain = FC0013_LNA_GAIN_MIDDLE; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ else ++ { ++ goto success_status_Lna_Gain_No_Change; ++ } ++ ++ ++ case FC0013_LNA_GAIN_MIDDLE: ++ ++ if(RssiRDiff >= 38) ++ { ++ boolVhfFlag = 0; ++ boolEnInChgFlag = 0; ++ intGainShift = 7; ++ LnaGain = FC0013_LNA_GAIN_LOW; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ else if(RssiRDiff <= 5) ++ { ++ boolVhfFlag = 1; ++ boolEnInChgFlag = 0; ++ intGainShift = 10; ++ LnaGain = FC0013_LNA_GAIN_HIGH_17; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ else ++ { ++ goto success_status_Lna_Gain_No_Change; ++ } ++ ++ ++ case FC0013_LNA_GAIN_LOW: ++ ++ if(RssiRDiff <= 2) ++ { ++ boolVhfFlag = 0; ++ boolEnInChgFlag = 0; ++ intGainShift = 7; ++ LnaGain = FC0013_LNA_GAIN_MIDDLE; ++ ++ // Set tuner LNA_GAIN. ++ if(fc0013_SetRegMaskBits(pTuner, 0x14, 4, 0, LnaGain) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ ++ break; ++ } ++ ++ else ++ { ++ goto success_status_Lna_Gain_No_Change; ++ } ++ } ++ ++ ++ if(fc0013_GetRegMaskBits(pTuner, 0x14, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if( (ReadValue & 0x60) == 0 ) // disable UHF & GPS ==> lock VHF frequency ++ { ++ boolVhfFlag = 1; ++ } ++ ++ ++ if( boolVhfFlag == 1 ) ++ { ++ //FC0013_Write(0x07, (FC0013_Read(0x07) | 0x10)); // VHF = 1 ++ if(fc0013_GetRegMaskBits(pTuner, 0x07, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x07, 7, 0, ReadValue | 0x10) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ else ++ { ++ //FC0013_Write(0x07, (FC0013_Read(0x07) & 0xEF)); // VHF = 0 ++ if(fc0013_GetRegMaskBits(pTuner, 0x07, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x07, 7, 0, ReadValue & 0xEF) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ if( boolEnInChgFlag == 1 ) ++ { ++ //FC0013_Write(0x0A, (FC0013_Read(0x0A) | 0x20)); // EN_IN_CHG = 1 ++ if(fc0013_GetRegMaskBits(pTuner, 0x0A, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x0A, 7, 0, ReadValue | 0x20) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ else ++ { ++ //FC0013_Write(0x0A, (FC0013_Read(0x0A) & 0xDF)); // EN_IN_CHG = 0 ++ if(fc0013_GetRegMaskBits(pTuner, 0x0A, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x0A, 7, 0, ReadValue & 0xDF) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ if( intGainShift == 10 ) ++ { ++ //FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x0A); // GS = 10 ++ if(fc0013_GetRegMaskBits(pTuner, 0x07, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x07, 7, 0, (ReadValue & 0xF0) | 0x0A) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ else ++ { ++ //FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x07); // GS = 7 ++ if(fc0013_GetRegMaskBits(pTuner, 0x07, 7, 0, &ReadValue) != FC0013_I2C_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(fc0013_SetRegMaskBits(pTuner, 0x07, 7, 0, (ReadValue & 0xF0) | 0x07) != FC0013_I2C_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++success_status_Lna_Gain_No_Change: ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.h +new file mode 100644 +index 0000000..d8af754 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc0013.h +@@ -0,0 +1,155 @@ ++#ifndef __NIM_RTL2832_FC0013 ++#define __NIM_RTL2832_FC0013 ++ ++/** ++ ++@file ++ ++@brief RTL2832 FC0013 NIM module declaration ++ ++One can manipulate RTL2832 FC0013 NIM through RTL2832 FC0013 NIM module. ++RTL2832 FC0013 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_fc0013.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 FC0013 NIM module. ++ BuildRtl2832Fc0013Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc6, // The FC0013 I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ // The FC0013 crystal frequency is 28.8 MHz. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_fc0013.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_FC0013_ADDITIONAL_INIT_REG_TABLE_LEN 29 ++#define RTL2832_FC0013_LNA_UPDATE_WAIT_TIME_MS 1000 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Fc0013Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// RTL2832 FC0013 NIM manipulaing functions ++int ++rtl2832_fc0013_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0013_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_fc0013_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0013_GetTunerRssiCalOn( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc0013_UpdateTunerLnaGainWithRssi( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.c +new file mode 100644 +index 0000000..0903602 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.c +@@ -0,0 +1,343 @@ ++/** ++ ++@file ++ ++@brief RTL2832 FC2580 NIM module definition ++ ++One can manipulate RTL2832 FC2580 NIM through RTL2832 FC2580 NIM module. ++RTL2832 FC2580 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_fc2580.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 FC2580 NIM module builder ++ ++Use BuildRtl2832Fc2580Module() to build RTL2832 FC2580 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 FC2580 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr FC2580 I2C device address ++@param [in] TunerCrystalFreqHz FC2580 crystal frequency in Hz ++@param [in] TunerAgcMode FC2580 AGC mode ++ ++ ++@note ++ -# One should call BuildRtl2832Fc2580Module() to build RTL2832 FC2580 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Fc2580Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerAgcMode ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_FC2580; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build FC2580 tuner module. ++ BuildFc2580Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ TunerAgcMode ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_fc2580_Initialize; ++ pNim->SetParameters = rtl2832_fc2580_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_fc2580_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x9c }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9f4 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_fc2580_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ FC2580_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_6000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = FC2580_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.h +new file mode 100644 +index 0000000..7636d36 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_fc2580.h +@@ -0,0 +1,141 @@ ++#ifndef __NIM_RTL2832_FC2580 ++#define __NIM_RTL2832_FC2580 ++ ++/** ++ ++@file ++ ++@brief RTL2832 FC2580 NIM module declaration ++ ++One can manipulate RTL2832 FC2580 NIM through RTL2832 FC2580 NIM module. ++RTL2832 FC2580 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_fc2580.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 FC2580 NIM module. ++ BuildRtl2832Fc2580Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xac, // The FC2580 I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // The FC2580 crystal frequency is 16.384 MHz. ++ FC2580_AGC_EXTERNAL // The FC2580 AGC mode is external AGC mode. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_fc2580.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN 21 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Fc2580Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerAgcMode ++ ); ++ ++ ++ ++ ++ ++// RTL2832 FC2580 NIM manipulaing functions ++int ++rtl2832_fc2580_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_fc2580_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.c +new file mode 100644 +index 0000000..6398437 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.c +@@ -0,0 +1,346 @@ ++/** ++ ++@file ++ ++@brief RTL2832 MAX3543 NIM module definition ++ ++One can manipulate RTL2832 MAX3543 NIM through RTL2832 MAX3543 NIM module. ++RTL2832 MAX3543 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_max3543.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 MAX3543 NIM module builder ++ ++Use BuildRtl2832Max3543Module() to build RTL2832 MAX3543 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 MAX3543 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr MAX3543 I2C device address ++@param [in] TunerCrystalFreqHz MAX3543 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildRtl2832Max3543Module() to build RTL2832 MAX3543 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Max3543Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_MAX3543; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build MAX3543 tuner module. ++ BuildMax3543Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ RTL2832_MAX3543_STANDARD_MODE_DEFAULT, ++ RTL2832_MAX3543_IF_FREQ_HZ_DEFAULT, ++ RTL2832_MAX3543_SAW_INPUT_TYPE_DEFAULT ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_max3543_Initialize; ++ pNim->SetParameters = rtl2832_max3543_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_max3543_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x4b }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9d4 }, ++ {DVBT_AD_EN_REG1, 0x0 }, ++ {DVBT_CKOUT_PWR_PID, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with NIM default. ++ if(pDemod->SetIfFreqHz(pDemod, RTL2832_MAX3543_IF_FREQ_HZ_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with NIM default. ++ if(pDemod->SetSpectrumMode(pDemod, RTL2832_MAX3543_SPECTRUM_MODE_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_max3543_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ MAX3543_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Max3543); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ // Note: MAX3543 tuner only has 7 MHz and 8 MHz settings. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = MAX3543_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = MAX3543_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = MAX3543_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.h +new file mode 100644 +index 0000000..b2b61fc +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_max3543.h +@@ -0,0 +1,145 @@ ++#ifndef __NIM_RTL2832_MAX3543 ++#define __NIM_RTL2832_MAX3543 ++ ++/** ++ ++@file ++ ++@brief RTL2832 MAX3543 NIM module declaration ++ ++One can manipulate RTL2832 MAX3543 NIM through RTL2832 MAX3543 NIM module. ++RTL2832 MAX3543 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_max3543.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 MAX3543 NIM module. ++ BuildRtl2832Max3543Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0, // The MAX3543 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ // The MAX3543 Crystal frequency is 16.0 MHz. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_max3543.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN 23 ++ ++// Default ++#define RTL2832_MAX3543_STANDARD_MODE_DEFAULT MAX3543_STANDARD_DVBT ++#define RTL2832_MAX3543_IF_FREQ_HZ_DEFAULT IF_FREQ_36170000HZ ++#define RTL2832_MAX3543_SPECTRUM_MODE_DEFAULT SPECTRUM_INVERSE ++#define RTL2832_MAX3543_SAW_INPUT_TYPE_DEFAULT MAX3543_SAW_INPUT_SE ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Max3543Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// RTL2832 MAX3543 NIM manipulaing functions ++int ++rtl2832_max3543_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_max3543_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.c +new file mode 100644 +index 0000000..3c475f9 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.c +@@ -0,0 +1,360 @@ ++/** ++ ++@file ++ ++@brief RTL2832 MT2063 NIM module definition ++ ++One can manipulate RTL2832 MT2063 NIM through RTL2832 MT2063 NIM module. ++RTL2832 MT2063 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_mt2063.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 MT2063 NIM module builder ++ ++Use BuildRtl2832Mt2063Module() to build RTL2832 MT2063 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 MT2063 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr MT2063 I2C device address ++@param [in] TunerAgcMode MT2063 AGC mode ++ ++ ++@note ++ -# One should call BuildRtl2832Mt2063Module() to build RTL2832 MT2063 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Mt2063Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ unsigned long NimIfFreqHz, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ RTL2832_MT2063_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Mt2063); ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_MT2063; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build MT2063 tuner module. ++ BuildMt2063Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ MT2063_STANDARD_DVBT, ++ MT2063_VGAGC_0X3 ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_mt2063_Initialize; ++ pNim->SetParameters = rtl2832_mt2063_SetParameters; ++ ++ ++ // Set NIM extra module variables. ++ pNimExtra->IfFreqHz = NimIfFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_mt2063_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++// {DVBT_AGC_TARG_VAL_8_1, 0x32 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x19 }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9d4 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ RTL2832_MT2063_EXTRA_MODULE *pNimExtra; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ pTunerExtra = &(pTuner->Extra.Mt2063); ++ pNimExtra = &(pNim->Extra.Rtl2832Mt2063); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner IF frequency in Hz. ++ if(pTunerExtra->SetIfFreqHz(pTuner, pNimExtra->IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency in Hz. ++ if(pDemod->SetIfFreqHz(pDemod, pNimExtra->IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_INVERSE. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_INVERSE) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_mt2063_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ unsigned long BandwidthHz; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Mt2063); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Determine BandwidthHz according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: BandwidthHz = MT2063_BANDWIDTH_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: BandwidthHz = MT2063_BANDWIDTH_7MHZ; break; ++ case DVBT_BANDWIDTH_8MHZ: BandwidthHz = MT2063_BANDWIDTH_8MHZ; break; ++ } ++ ++ // Set tuner bandwidth in Hz with BandwidthHz. ++ // Note: Need to execute SetBandwidthHz() before SetRfFreqHz() for MT2063, ++ // because MT2063 bandwidth setting API only sets software variables. ++ if(pTunerExtra->SetBandwidthHz(pTuner, BandwidthHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.h +new file mode 100644 +index 0000000..464d0c6 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2063.h +@@ -0,0 +1,160 @@ ++#ifndef __NIM_RTL2832_MT2063 ++#define __NIM_RTL2832_MT2063 ++ ++/** ++ ++@file ++ ++@brief RTL2832 MT2063 NIM module declaration ++ ++One can manipulate RTL2832 MT2063 NIM through RTL2832 MT2063 NIM module. ++RTL2832 MT2063 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_mt2063.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 MT2063 NIM module. ++ BuildRtl2832Mt2063Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ IF_FREQ_36125000HZ, // The RTL2832 and MT2063 IF frequency is 36.125 MHz. ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0 // The MT2063 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get MT2063 tuner extra module. ++ pTuner = pNim->pTuner; ++ pTunerExtra = &(pTuner->Extra.Mt2063); ++ ++ // Open MT2063 handle. ++ pTunerExtra->OpenHandle(pTuner); ++ ++ ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ ++ ++ ++ // Close MT2063 handle. ++ pTunerExtra->CloseHandle(pTuner); ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_mt2063.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN 21 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Mt2063Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ unsigned long NimIfFreqHz, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ); ++ ++ ++ ++ ++ ++// RTL2832 MT2063 NIM manipulaing functions ++int ++rtl2832_mt2063_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_mt2063_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.c +new file mode 100644 +index 0000000..cac01e3 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.c +@@ -0,0 +1,1082 @@ ++/** ++ ++@file ++ ++@brief RTL2832 MT2266 NIM module definition ++ ++One can manipulate RTL2832 MT2266 NIM through RTL2832 MT2266 NIM module. ++RTL2832 MT2266 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_mt2266.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 MT2266 NIM module builder ++ ++Use BuildRtl2832Mt2266Module() to build RTL2832 MT2266 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 MT2266 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr MT2266 I2C device address ++ ++ ++@note ++ -# One should call BuildRtl2832Mt2266Module() to build RTL2832 MT2266 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Mt2266Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ RTL2832_MT2266_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Mt2266); ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_MT2266; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build MT2266 tuner module. ++ BuildMt2266Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_mt2266_Initialize; ++ pNim->SetParameters = rtl2832_mt2266_SetParameters; ++ pNim->UpdateFunction = rtl2832_mt2266_UpdateFunction; ++ ++ ++ // Initialize NIM extra module variables. ++ pNimExtra->LnaConfig = 0xff; ++ pNimExtra->UhfSens = 0xff; ++ pNimExtra->AgcCurrentState = 0xff; ++ pNimExtra->LnaGainOld = 0xffffffff; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_mt2266_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_MT2266_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0xc0 }, // Note: The IF_AGC_MIN value will be set again by demod_pdcontrol_reset(). ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x9c }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x1 }, ++ {DVBT_POLAR_IF_AGC, 0x1 }, ++ {DVBT_AD7_SETTING, 0xe9f4 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_MT2266_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_mt2266_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ MT2266_EXTRA_MODULE *pTunerExtra; ++ Handle_t Mt2266Handle; ++ unsigned long BandwidthHz; ++ ++ RTL2832_MT2266_EXTRA_MODULE *pNimExtra; ++ ++ UData_t Status; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ Mt2266Handle = pTunerExtra->DeviceHandle; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Mt2266); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine BandwidthHz according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: BandwidthHz = MT2266_BANDWIDTH_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: BandwidthHz = MT2266_BANDWIDTH_7MHZ; break; ++ case DVBT_BANDWIDTH_8MHZ: BandwidthHz = MT2266_BANDWIDTH_8MHZ; break; ++ } ++ ++ // Set tuner bandwidth in Hz with BandwidthHz. ++ if(pTunerExtra->SetBandwidthHz(pTuner, BandwidthHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Reset MT2266 update procedure. ++ Status = demod_pdcontrol_reset(pDemod, Mt2266Handle, &pNimExtra->AgcCurrentState); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++rtl2832_mt2266_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ MT2266_EXTRA_MODULE *pTunerExtra; ++ RTL2832_MT2266_EXTRA_MODULE *pNimExtra; ++ ++ Handle_t Mt2266Handle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module and tuner handle. ++ pTunerExtra = &(pTuner->Extra.Mt2266); ++ pTunerExtra->GetHandle(pTuner, &Mt2266Handle); ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2832Mt2266); ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Update demod and tuner register setting. ++ Status = demod_pdcontrol( ++ pDemod, ++ Mt2266Handle, ++ &pNimExtra->LnaConfig, ++ &pNimExtra->UhfSens, ++ &pNimExtra->AgcCurrentState, ++ &pNimExtra->LnaGainOld ++ ); ++ ++/* ++ handle_t demod_handle, ++ handle_t tuner_handle, ++ unsigned char* lna_config, ++ unsigned char* uhf_sens, ++ unsigned char *agc_current_state, ++ unsigned long *lna_gain_old ++ ++ unsigned char LnaConfig; ++ unsigned char UhfSens; ++ unsigned char AgcCurrentState; ++ unsigned long LnaGainOld; ++ ++*/ ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Additional definition for mt_control.c ++UData_t ++demod_get_pd( ++ handle_t demod_handle, ++ unsigned short *pd_value ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ unsigned long RssiR; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Get RSSI_R value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_RSSI_R, &RssiR) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Set pd_value according to RSSI_R. ++ *pd_value = (unsigned short)RssiR; ++ ++ ++ return MT_OK; ++ ++ ++error_status_get_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++UData_t ++demod_get_agc( ++ handle_t demod_handle, ++ unsigned short *rf_level, ++ unsigned short *bb_level ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ unsigned long RfAgc; ++ unsigned long IfAgc; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Get RF and IF AGC value. ++ if(pDemod->GetRfAgc(pDemod, &RfAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetIfAgc(pDemod, &IfAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Convert RF and IF AGC value to proper format. ++ *rf_level = (unsigned short)((RfAgc + (1 << (RTL2832_RF_AGC_REG_BIT_NUM - 1))) * ++ (1 << (MT2266_DEMOD_ASSUMED_AGC_REG_BIT_NUM - RTL2832_RF_AGC_REG_BIT_NUM))); ++ ++ *bb_level = (unsigned short)((IfAgc + (1 << (RTL2832_IF_AGC_REG_BIT_NUM - 1))) * ++ (1 << (MT2266_DEMOD_ASSUMED_AGC_REG_BIT_NUM - RTL2832_IF_AGC_REG_BIT_NUM))); ++ ++ ++ return MT_OK; ++ ++ ++error_status_get_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++UData_t ++demod_set_bbagclim( ++ handle_t demod_handle, ++ int on_off_status ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ unsigned long IfAgcMinBinary; ++ long IfAgcMinInt; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Get IF_AGC_MIN binary value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, &IfAgcMinBinary) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Convert IF_AGC_MIN binary value to integer. ++ IfAgcMinInt = BinToSignedInt(IfAgcMinBinary, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM); ++ ++ // Modify IF_AGC_MIN integer according to on_off_status. ++ switch(on_off_status) ++ { ++ case 1: ++ ++ IfAgcMinInt += RTL2832_MT2266_IF_AGC_MIN_INT_STEP; ++ ++ if(IfAgcMinInt > RTL2832_MT2266_IF_AGC_MIN_INT_MAX) ++ IfAgcMinInt = RTL2832_MT2266_IF_AGC_MIN_INT_MAX; ++ ++ break; ++ ++ default: ++ case 0: ++ ++ IfAgcMinInt -= RTL2832_MT2266_IF_AGC_MIN_INT_STEP; ++ ++ if(IfAgcMinInt < RTL2832_MT2266_IF_AGC_MIN_INT_MIN) ++ IfAgcMinInt = RTL2832_MT2266_IF_AGC_MIN_INT_MIN; ++ ++ break; ++ } ++ ++ // Convert modified IF_AGC_MIN integer to binary value. ++ IfAgcMinBinary = SignedIntToBin(IfAgcMinInt, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM); ++ ++ // Set IF_AGC_MIN with modified binary value. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, IfAgcMinBinary) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_registers: ++error_status_get_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++ ++ ++UData_t ++tuner_set_bw_normal( ++ handle_t tuner_handle, ++ handle_t demod_handle ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int DemodBandwidthMode; ++ unsigned int TunerBandwidthHz; ++ unsigned int TargetTunerBandwidthHz; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Get demod bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, &DemodBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine tuner target bandwidth. ++ switch(DemodBandwidthMode) ++ { ++ case DVBT_BANDWIDTH_6MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_7MHZ; break; ++ default: ++ case DVBT_BANDWIDTH_8MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_8MHZ; break; ++ } ++ ++ // Get tuner bandwidth. ++ if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_OUTPUT_BW, &TunerBandwidthHz))) ++ goto error_status_get_tuner_bandwidth; ++ ++ // Set tuner bandwidth with normal setting according to demod bandwidth mode. ++ if(TunerBandwidthHz != TargetTunerBandwidthHz) ++ { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle, MT2266_OUTPUT_BW, TargetTunerBandwidthHz))) ++ goto error_status_set_tuner_bandwidth; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_tuner_bandwidth: ++error_status_get_tuner_bandwidth: ++error_status_execute_function: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++ ++ ++UData_t ++tuner_set_bw_narrow( ++ handle_t tuner_handle, ++ handle_t demod_handle ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int DemodBandwidthMode; ++ unsigned long AciDetInd; ++ unsigned int TunerBandwidthHz; ++ unsigned int TargetTunerBandwidthHz; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Get demod bandwidth mode. ++ if(pDemod->GetBandwidthMode(pDemod, &DemodBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get demod ACI_DET_IND. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_ACI_DET_IND, &AciDetInd) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ // Determine tuner target bandwidth according to ACI_DET_IND. ++ if(AciDetInd == 0x1) ++ { ++ // Choose narrow target bandwidth. ++ switch(DemodBandwidthMode) ++ { ++ case DVBT_BANDWIDTH_6MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_5MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_6MHZ; break; ++ default: ++ case DVBT_BANDWIDTH_8MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_7MHZ; break; ++ } ++ } ++ else ++ { ++ // Choose normal target bandwidth. ++ switch(DemodBandwidthMode) ++ { ++ case DVBT_BANDWIDTH_6MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_7MHZ; break; ++ default: ++ case DVBT_BANDWIDTH_8MHZ: TargetTunerBandwidthHz = MT2266_BANDWIDTH_8MHZ; break; ++ } ++ } ++ ++ // Get tuner bandwidth. ++ if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_OUTPUT_BW, &TunerBandwidthHz))) ++ goto error_status_get_tuner_bandwidth; ++ ++ // Set tuner bandwidth with normal setting according to demod bandwidth mode. ++ if(TunerBandwidthHz != TargetTunerBandwidthHz) ++ { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle, MT2266_OUTPUT_BW, TargetTunerBandwidthHz))) ++ goto error_status_set_tuner_bandwidth; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_tuner_bandwidth: ++error_status_get_tuner_bandwidth: ++error_status_get_registers: ++error_status_execute_function: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++ ++ ++// Microtune source code - mt_control.c ++ ++ ++ ++UData_t demod_pdcontrol_reset(handle_t demod_handle, handle_t tuner_handle, unsigned char *agc_current_state) { ++ ++ DVBT_DEMOD_MODULE *pDemod; ++ unsigned long BinaryValue; ++ ++ ++ // Get demod module. ++ pDemod = (DVBT_DEMOD_MODULE *)demod_handle; ++ ++ // Reset AGC current state. ++ *agc_current_state = AGC_STATE_START; ++ ++ // Calculate RTL2832_MT2266_IF_AGC_MIN_INT_MIN binary value. ++ BinaryValue = SignedIntToBin(RTL2832_MT2266_IF_AGC_MIN_INT_MIN, RTL2832_MT2266_IF_AGC_MIN_BIT_NUM); ++ ++ // Set IF_AGC_MIN with binary value. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IF_AGC_MIN, BinaryValue) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner bandwidth with normal setting. ++ if(MT_IS_ERROR(tuner_set_bw_normal(tuner_handle, demod_handle))) ++ goto error_status_set_tuner_bandwidth; ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_tuner_bandwidth: ++error_status_set_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++ ++UData_t demod_pdcontrol(handle_t demod_handle, handle_t tuner_handle, unsigned char* lna_config, unsigned char* uhf_sens, ++ unsigned char *agc_current_state, unsigned long *lna_gain_old) { ++ ++ unsigned short pd_value; ++ unsigned short rf_level, bb_level; ++ unsigned long lna_gain; ++ unsigned char zin=0; ++ unsigned int tmp_freq=0,tmp_lna_gain=0; ++ ++// unsigned char temp[2]; ++// unsigned char agc_bb_min; ++// demod_data_t* local_data; ++ ++ ++ unsigned char band=1; /* band=0: vhf, band=1: uhf low, band=2: uhf high */ ++ unsigned long freq; ++ ++ // AGC threshold values ++ unsigned short sens_on[] = {11479, 11479, 32763}; ++ unsigned short sens_off[] = {36867, 36867, 44767}; ++ unsigned short lin_off[] = {23619, 23619, 23619}; ++ unsigned short lin_on[] = {38355, 38355, 38355}; ++ unsigned short pd_upper[] = {85, 85, 85}; ++ unsigned short pd_lower[] = {74, 74, 74}; ++ unsigned char next_state; ++ ++ // demod_data_t* local_data = (demod_data_t*)demod_handle; ++ ++ if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_INPUT_FREQ, &tmp_freq))) goto error_status; ++ if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_LNA_GAIN, &tmp_lna_gain))) goto error_status; ++ if(MT_IS_ERROR(MT2266_GetReg(tuner_handle,0x1e,&zin))) goto error_status; ++ ++ freq=(unsigned long)(tmp_freq); ++ lna_gain=(unsigned long)(tmp_lna_gain); ++ ++ if (freq <= 250000000) band=0; ++ else if (freq < 660000000) band=1; ++ else band=2; ++ ++ if(MT_IS_ERROR(demod_get_pd(demod_handle, &pd_value))) goto error_status; ++ if(MT_IS_ERROR(demod_get_agc(demod_handle, &rf_level, &bb_level))) goto error_status; ++ ++ rf_level=0xffff-rf_level; ++ bb_level=0xffff-bb_level; ++ ++/* ++#ifndef _HOST_DLL ++ uart_write_nr("St:"); ++ uart_writedez(agc_current_state[num]); ++ ++ uart_write_nr(" PD: "); ++ uart_writehex16(pd_value); ++ ++ uart_write_nr(" AGC: "); ++ uart_writehex16(rf_level); ++ uart_writehex16(bb_level); ++#endif ++*/ ++ ++ next_state = *agc_current_state; ++ ++ switch (*agc_current_state) { ++ ++ case AGC_STATE_START : { ++ if ((int)lna_gain < LNAGAIN_MIN) ++ next_state=AGC_STATE_LNAGAIN_BELOW_MIN; ++ else if (lna_gain > LNAGAIN_MAX) ++ next_state=AGC_STATE_LNAGAIN_ABOVE_MAX; ++ else ++ next_state=AGC_STATE_NORMAL; ++ break; ++ } ++ ++ case AGC_STATE_LNAGAIN_BELOW_MIN : { ++ if ((int)lna_gain < LNAGAIN_MIN ) ++ next_state=AGC_STATE_LNAGAIN_BELOW_MIN; ++ else next_state=AGC_STATE_NORMAL; ++ ++ break; ++ } ++ ++ case AGC_STATE_LNAGAIN_ABOVE_MAX : { ++ if (lna_gain > LNAGAIN_MAX ) ++ next_state=AGC_STATE_LNAGAIN_ABOVE_MAX; ++ else next_state=AGC_STATE_NORMAL; ++ break; ++ } ++ ++ case AGC_STATE_NORMAL : { ++ if (rf_level > lin_on[band] ) { ++ *lna_gain_old = lna_gain; ++ next_state = AGC_STATE_MAS_GRANDE_SIGNAL; ++ } ++ else if (pd_value > pd_upper[band]) { ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ } ++ else if ( (pd_value < pd_lower[band]) && (lna_gain < LNAGAIN_MAX) ) { ++ next_state = AGC_STATE_NO_INTERFERER; ++ } ++ else if ( bb_level < sens_on[band]) { ++ next_state = AGC_STATE_SMALL_SIGNAL; ++ } ++ break; ++ } ++ ++ case AGC_STATE_NO_INTERFERER : { ++ if (pd_value > pd_lower[band] ) ++ next_state = AGC_STATE_MEDIUM_INTERFERER; ++ else if (pd_value < pd_lower[band] ) ++ next_state = AGC_STATE_NORMAL; ++ else if ( lna_gain == LNAGAIN_MAX ) ++ next_state = AGC_STATE_NORMAL; ++ break; ++ } ++ ++ case AGC_STATE_MEDIUM_INTERFERER : { ++ if (pd_value > pd_upper[band] ) ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ else if (pd_value < pd_lower[band] ) ++ next_state = AGC_STATE_NO_INTERFERER; ++ break; ++ } ++ ++ ++ case AGC_STATE_GRANDE_INTERFERER : { ++ if (pd_value < pd_upper[band] ) ++ next_state = AGC_STATE_MEDIUM_INTERFERER; ++ break; ++ } ++ ++ case AGC_STATE_MAS_GRANDE_SIGNAL : { ++ if (rf_level < lin_on[band]) ++ next_state = AGC_STATE_GRANDE_SIGNAL; ++ else if (pd_value > pd_upper[band]) { ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ } ++ break; ++ } ++ ++ case AGC_STATE_MEDIUM_SIGNAL : { ++ if (rf_level > lin_off[band]) ++ next_state = AGC_STATE_GRANDE_SIGNAL; ++ else if (lna_gain >= *lna_gain_old) ++ next_state = AGC_STATE_NORMAL; ++ else if (pd_value > pd_upper[band]) ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ break; ++ } ++ ++ case AGC_STATE_GRANDE_SIGNAL : { ++ if (rf_level > lin_on[band]) ++ next_state = AGC_STATE_MAS_GRANDE_SIGNAL; ++ else if (rf_level < lin_off[band]) ++ next_state = AGC_STATE_MEDIUM_SIGNAL; ++ else if (pd_value > pd_upper[band]) ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ break; ++ } ++ ++ case AGC_STATE_SMALL_SIGNAL : { ++ if (pd_value > pd_upper[band] ) ++ next_state = AGC_STATE_GRANDE_INTERFERER; ++ else if (bb_level > sens_off[band]) ++ next_state = AGC_STATE_NORMAL; ++ else if ( (bb_level < sens_on[band]) && (lna_gain == LNAGAIN_MAX) ) ++ next_state = AGC_STATE_MAX_SENSITIVITY; ++ break; ++ } ++ ++ case AGC_STATE_MAX_SENSITIVITY : { ++ if (bb_level > sens_off[band]) ++ next_state = AGC_STATE_SMALL_SIGNAL; ++ break; ++ } ++ ++ } ++ ++ *agc_current_state = next_state; ++ ++ ++ switch (*agc_current_state) { ++ ++ case AGC_STATE_LNAGAIN_BELOW_MIN : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_INCR, LNAGAIN_MAX))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_LNAGAIN_ABOVE_MAX : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_DECR, LNAGAIN_MIN))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_NORMAL : { ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ break; ++ } ++ ++ case AGC_STATE_NO_INTERFERER : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_INCR, LNAGAIN_MAX))) goto error_status; ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_MEDIUM_INTERFERER : { ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ ++ // Additional setting ++ // Set tuner with normal bandwidth. ++ if(MT_IS_ERROR(tuner_set_bw_normal(tuner_handle, demod_handle))) goto error_status; ++ ++ break; ++ } ++ ++ case AGC_STATE_GRANDE_INTERFERER : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_DECR, LNAGAIN_MIN))) goto error_status; ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,1))) goto error_status; ++ ++ // Additional setting ++ // Set tuner with narrow bandwidth. ++ if(MT_IS_ERROR(tuner_set_bw_narrow(tuner_handle, demod_handle))) goto error_status; ++ ++ break; ++ } ++ ++ case AGC_STATE_MEDIUM_SIGNAL : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_INCR, LNAGAIN_MAX))) goto error_status; ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_GRANDE_SIGNAL : { ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_MAS_GRANDE_SIGNAL : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_DECR, LNAGAIN_MIN))) goto error_status; ++ if (lna_gain==0) { ++ if (zin <= 64) { ++ zin += 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ } ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ break; ++ } ++ ++ case AGC_STATE_SMALL_SIGNAL : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_LNA_GAIN_INCR, LNAGAIN_MAX))) goto error_status; ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_UHF_NORMAL,1))) goto error_status; ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ *uhf_sens=0; ++ break; ++ } ++ ++ case AGC_STATE_MAX_SENSITIVITY : { ++ if(MT_IS_ERROR(MT2266_SetParam(tuner_handle,MT2266_UHF_MAXSENS,1))) goto error_status; ++ if (zin >= 2) { ++ zin -= 2; ++ if(MT_IS_ERROR(MT2266_SetReg(tuner_handle,0x1e,zin))) goto error_status; ++ } ++ if(MT_IS_ERROR(demod_set_bbagclim(demod_handle,0))) goto error_status; ++ *uhf_sens=1; ++ break; ++ } ++ } ++ ++ if(MT_IS_ERROR(MT2266_GetParam(tuner_handle, MT2266_LNA_GAIN,&tmp_lna_gain))) goto error_status; ++ lna_gain=(unsigned long)(tmp_lna_gain); ++ ++ *lna_config=(unsigned char)lna_gain; ++ ++/* ++#ifndef _HOST_DLL ++ uart_write_nr(" LNA "); ++ uart_writedez(lna_gain); ++ uart_write_nr(" SENS "); ++ uart_writedez(*uhf_sens); ++ uart_write_nr(" Z "); ++ uart_writedez(zin); ++ uart_write(" "); ++#endif ++*/ ++ ++ ++ ++ return MT_OK; ++ ++ ++error_status: ++ return MT_COMM_ERR; ++} ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.h +new file mode 100644 +index 0000000..2047220 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mt2266.h +@@ -0,0 +1,264 @@ ++#ifndef __NIM_RTL2832_MT2266 ++#define __NIM_RTL2832_MT2266 ++ ++/** ++ ++@file ++ ++@brief RTL2832 MT2266 NIM module declaration ++ ++One can manipulate RTL2832 MT2266 NIM through RTL2832 MT2266 NIM module. ++RTL2832 MT2266 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_mt2266.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ TUNER_MODULE *pTuner; ++ MT2266_EXTRA_MODULE *pTunerExtra; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 MT2266 NIM module. ++ BuildRtl2832Mt2266Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 50, // The RTL2832 update function reference period is 50 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0 // The MT2266 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get MT2266 tuner extra module. ++ pTuner = pNim->pTuner; ++ pTunerExtra = &(pTuner->Extra.Mt2266); ++ ++ // Open MT2266 handle. ++ pTunerExtra->OpenHandle(pTuner); ++ ++ ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ ++ ++ ++ // Close MT2266 handle. ++ pTunerExtra->CloseHandle(pTuner); ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_mt2266.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_MT2266_ADDITIONAL_INIT_REG_TABLE_LEN 21 ++ ++#define RTL2832_MT2266_IF_AGC_MIN_BIT_NUM 8 ++#define RTL2832_MT2266_IF_AGC_MIN_INT_MAX 36 ++#define RTL2832_MT2266_IF_AGC_MIN_INT_MIN -64 ++#define RTL2832_MT2266_IF_AGC_MIN_INT_STEP 0 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Mt2266Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ); ++ ++ ++ ++ ++ ++// RTL2832 MT2266 NIM manipulaing functions ++int ++rtl2832_mt2266_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_mt2266_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_mt2266_UpdateFunction( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Additional definition for mt_control.c ++typedef void * handle_t; ++ ++#define MT2266_DEMOD_ASSUMED_AGC_REG_BIT_NUM 16 ++ ++ ++ ++// Microtune source code - mt_control.c ++ ++ ++ ++/* $Id: mt_control.c,v 1.6 2008/01/02 12:04:39 tune\tpinz Exp $ */ ++/*! ++ * \file mt_control.c ++ * \author Thomas Pinz, Microtune GmbH&Co KG ++ * \author Marie-Curie-Str. 1, 85055 Ingolstadt ++ * \author E-Mail: thomas.pinz@microtune.com ++ */ ++ ++ ++#define LNAGAIN_MIN 0 ++#define LNAGAIN_MAX 14 ++ ++#define AGC_STATE_START 0 ++#define AGC_STATE_LNAGAIN_BELOW_MIN 1 ++#define AGC_STATE_LNAGAIN_ABOVE_MAX 2 ++#define AGC_STATE_NORMAL 3 ++#define AGC_STATE_NO_INTERFERER 4 ++#define AGC_STATE_MEDIUM_INTERFERER 5 ++#define AGC_STATE_GRANDE_INTERFERER 6 ++#define AGC_STATE_MEDIUM_SIGNAL 7 ++#define AGC_STATE_GRANDE_SIGNAL 8 ++#define AGC_STATE_MAS_GRANDE_SIGNAL 9 ++#define AGC_STATE_MAX_SENSITIVITY 10 ++#define AGC_STATE_SMALL_SIGNAL 11 ++ ++ ++UData_t ++demod_get_pd( ++ handle_t demod_handle, ++ unsigned short *pd_value ++ ); ++ ++UData_t ++demod_get_agc( ++ handle_t demod_handle, ++ unsigned short *rf_level, ++ unsigned short *bb_level ++ ); ++ ++UData_t ++demod_set_bbagclim( ++ handle_t demod_handle, ++ int on_off_status ++ ); ++ ++UData_t ++tuner_set_bw_normal( ++ handle_t tuner_handle, ++ handle_t demod_handle ++ ); ++ ++UData_t ++tuner_set_bw_narrow( ++ handle_t tuner_handle, ++ handle_t demod_handle ++ ); ++ ++UData_t ++demod_pdcontrol_reset( ++ handle_t demod_handle, ++ handle_t tuner_handle, ++ unsigned char *agc_current_state ++ ); ++ ++UData_t ++demod_pdcontrol( ++ handle_t demod_handle, ++ handle_t tuner_handle, ++ unsigned char* lna_config, ++ unsigned char* uhf_sens, ++ unsigned char *agc_current_state, ++ unsigned long *lna_gain_old ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.c +new file mode 100644 +index 0000000..b384cba +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.c +@@ -0,0 +1,355 @@ ++/** ++ ++@file ++ ++@brief RTL2832 MxL5007T NIM module definition ++ ++One can manipulate RTL2832 MxL5007T NIM through RTL2832 MxL5007T NIM module. ++RTL2832 MxL5007T NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_mxl5007t.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 MxL5007T NIM module builder ++ ++Use BuildRtl2832Mxl5007tModule() to build RTL2832 MxL5007T NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 MxL5007T NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr MxL5007T I2C device address ++@param [in] TunerCrystalFreqHz MxL5007T crystal frequency in Hz ++@param [in] TunerLoopThroughMode MxL5007T loop-through mode ++@param [in] TunerClkOutMode MxL5007T clock output mode ++@param [in] TunerClkOutAmpMode MxL5007T clock output amplitude mode ++ ++ ++@note ++ -# One should call BuildRtl2832Mxl5007tModule() to build RTL2832 MxL5007T NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Mxl5007tModule( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerLoopThroughMode, ++ int TunerClkOutMode, ++ int TunerClkOutAmpMode ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_MXL5007T; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build Mxl5007T tuner module. ++ BuildMxl5007tModule( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ RTL2832_MXL5007T_STANDARD_MODE_DEFAULT, ++ RTL2832_MXL5007T_IF_FREQ_HZ_DEFAULT, ++ RTL2832_MXL5007T_SPECTRUM_MODE_DEFAULT, ++ TunerLoopThroughMode, ++ TunerClkOutMode, ++ TunerClkOutAmpMode, ++ RTL2832_MXL5007T_QAM_IF_DIFF_OUT_LEVEL_DEFAULT ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_mxl5007t_Initialize; ++ pNim->SetParameters = rtl2832_mxl5007t_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_mxl5007t_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x4b }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9d4 }, ++ {DVBT_AD_EN_REG1, 0x0 }, ++ {DVBT_CKOUT_PWR_PID, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with NIM default. ++ if(pDemod->SetIfFreqHz(pDemod, RTL2832_MXL5007T_IF_FREQ_HZ_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with NIM default. ++ if(pDemod->SetSpectrumMode(pDemod, RTL2832_MXL5007T_SPECTRUM_MODE_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_mxl5007t_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ MXL5007T_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Mxl5007t); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = MXL5007T_BANDWIDTH_6000000HZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = MXL5007T_BANDWIDTH_7000000HZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = MXL5007T_BANDWIDTH_8000000HZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.h +new file mode 100644 +index 0000000..08429a4 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_mxl5007t.h +@@ -0,0 +1,151 @@ ++#ifndef __NIM_RTL2832_MXL5007T ++#define __NIM_RTL2832_MXL5007T ++ ++/** ++ ++@file ++ ++@brief RTL2832 MxL5007T NIM module declaration ++ ++One can manipulate RTL2832 MxL5007T NIM through RTL2832 MxL5007T NIM module. ++RTL2832 MxL5007T NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_mxl5007t.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 MxL5007T NIM module. ++ BuildRtl2832Mxl5007tModule( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0, // The MxL5007T I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The MxL5007T Crystal frequency is 16.0 MHz. ++ MXL5007T_LOOP_THROUGH_DISABLE, // The MxL5007T loop-through mode is disabled. ++ MXL5007T_CLK_OUT_DISABLE, // The MxL5007T clock output mode is disabled. ++ MXL5007T_CLK_OUT_AMP_0 // The MxL5007T clock output amplitude is 0. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_mxl5007t.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN 23 ++ ++// Default ++#define RTL2832_MXL5007T_STANDARD_MODE_DEFAULT MXL5007T_STANDARD_DVBT ++#define RTL2832_MXL5007T_IF_FREQ_HZ_DEFAULT IF_FREQ_4570000HZ ++#define RTL2832_MXL5007T_SPECTRUM_MODE_DEFAULT SPECTRUM_NORMAL ++#define RTL2832_MXL5007T_QAM_IF_DIFF_OUT_LEVEL_DEFAULT 0 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Mxl5007tModule( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerLoopThroughMode, ++ int TunerClkOutMode, ++ int TunerClkOutAmpMode ++ ); ++ ++ ++ ++ ++ ++// RTL2832 MxL5007T NIM manipulaing functions ++int ++rtl2832_mxl5007t_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_mxl5007t_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.c +new file mode 100644 +index 0000000..364ea45 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.c +@@ -0,0 +1,408 @@ ++/** ++ ++@file ++ ++@brief RTL2832 TDA18272 NIM module definition ++ ++One can manipulate RTL2832 TDA18272 NIM through RTL2832 TDA18272 NIM module. ++RTL2832 TDA18272 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_tda18272.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 TDA18272 NIM module builder ++ ++Use BuildRtl2832Tda18272Module() to build RTL2832 TDA18272 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 TDA18272 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr TDA18272 I2C device address ++@param [in] TunerCrystalFreqHz TDA18272 crystal frequency in Hz ++@param [in] TunerUnitNo TDA18272 unit number ++@param [in] TunerIfOutputVppMode TDA18272 IF output Vp-p mode ++ ++ ++@note ++ -# One should call BuildRtl2832Tda18272Module() to build RTL2832 TDA18272 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Tda18272Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerUnitNo, ++ int TunerIfOutputVppMode ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_TDA18272; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build TDA18272 tuner module. ++ BuildTda18272Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ TunerUnitNo, ++ TunerIfOutputVppMode ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_tda18272_Initialize; ++ pNim->SetParameters = rtl2832_tda18272_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_tda18272_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_TDA18272_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x40 }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x8 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x18 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x80 }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9f4 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ // Note: TDA18272 tuner uses dynamic IF frequency, so we will set demod IF frequency in SetParameters(). ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_INVERSE. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_INVERSE) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_TDA18272_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_tda18272_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ TDA18272_EXTRA_MODULE *pTunerExtra; ++ int TunerStandardBandwidthMode; ++ unsigned long IfFreqHz; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Tda18272); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_7MHZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerStandardBandwidthMode = TDA18272_STANDARD_BANDWIDTH_DVBT_8MHZ; break; ++ } ++ ++ // Set tuner standard and bandwidth mode with TunerStandardBandwidthMode. ++ if(pTunerExtra->SetStandardBandwidthMode(pTuner, TunerStandardBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner RF frequency in Hz. ++ // Note: Must run SetRfFreqHz() after SetStandardBandwidthMode(), because SetRfFreqHz() needs some ++ // SetStandardBandwidthMode() information. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get tuner IF frequency in Hz. ++ // Note: 1. Must run GetIfFreqHz() after SetRfFreqHz(), because GetIfFreqHz() needs some SetRfFreqHz() information. ++ // 2. TDA18272 tuner uses dynamic IF frequency. ++ if(pTunerExtra->GetIfFreqHz(pTuner, &IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod IF frequency according to IfFreqHz. ++ // Note: TDA18272 tuner uses dynamic IF frequency. ++ if(pDemod->SetIfFreqHz(pDemod, IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_GET_RF_POWER_LEVEL_DBM ++ ++*/ ++int ++rtl2832_tda18272_GetRfPowerLevelDbm( ++ DVBT_NIM_MODULE *pNim, ++ long *pRfPowerLevelDbm ++ ) ++{ ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ unsigned long FsmStage; ++ long IfAgc; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get FSM stage and IF AGC value. ++ if(pDemod->GetRegBitsWithPage(pDemod, DVBT_FSM_STAGE, &FsmStage) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ if(pDemod->GetIfAgc(pDemod, &IfAgc) != FUNCTION_SUCCESS) ++ goto error_status_get_registers; ++ ++ ++ // Determine signal strength according to FSM stage and IF AGC value. ++ if(FsmStage < 10) ++ *pRfPowerLevelDbm = -120; ++ else ++ { ++ if(IfAgc > -1250) ++ *pRfPowerLevelDbm = -71 - (IfAgc / 165); ++ else ++ *pRfPowerLevelDbm = -60; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.h +new file mode 100644 +index 0000000..25c8ef1 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_tda18272.h +@@ -0,0 +1,148 @@ ++#ifndef __NIM_RTL2832_TDA18272 ++#define __NIM_RTL2832_TDA18272 ++ ++/** ++ ++@file ++ ++@brief RTL2832 TDA18272 NIM module declaration ++ ++One can manipulate RTL2832 TDA18272 NIM through RTL2832 TDA18272 NIM module. ++RTL2832 TDA18272 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_tda18272.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 TDA18272 NIM module. ++ BuildRtl2832Tda18272Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0, // The TDA18272 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The TDA18272 crystal frequency is 16.0 MHz. ++ TDA18272_UNIT_0, // The TDA18272 unit number is 0. ++ TDA18272_IF_OUTPUT_VPP_0P7V // The TDA18272 IF output Vp-p is 0.7 V. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_tda18272.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_TDA18272_ADDITIONAL_INIT_REG_TABLE_LEN 21 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Tda18272Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerUnitNo, ++ int TunerIfOutputVppMode ++ ); ++ ++ ++ ++ ++ ++// RTL2832 TDA18272 NIM manipulaing functions ++int ++rtl2832_tda18272_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_tda18272_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++int ++rtl2832_tda18272_GetRfPowerLevelDbm( ++ DVBT_NIM_MODULE *pNim, ++ long *pRfPowerLevelDbm ++ ); ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.c b/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.c +new file mode 100644 +index 0000000..92f2f5f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.c +@@ -0,0 +1,340 @@ ++/** ++ ++@file ++ ++@brief RTL2832 TUA9001 NIM module definition ++ ++One can manipulate RTL2832 TUA9001 NIM through RTL2832 TUA9001 NIM module. ++RTL2832 TUA9001 NIM module is derived from DVB-T NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2832_tua9001.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2832 TUA9001 NIM module builder ++ ++Use BuildRtl2832Tua9001Module() to build RTL2832 TUA9001 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2832 TUA9001 NIM module pointer ++@param [in] pDvbtNimModuleMemory Pointer to an allocated DVB-T NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2832 I2C device address ++@param [in] DemodCrystalFreqHz RTL2832 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2832 TS interface mode for setting ++@param [in] DemodAppMode RTL2832 application mode for setting ++@param [in] DemodUpdateFuncRefPeriodMs RTL2832 update function reference period in millisecond for setting ++@param [in] DemodIsFunc1Enabled RTL2832 Function 1 enabling status for setting ++@param [in] TunerDeviceAddr TUA9001 I2C device address ++ ++ ++@note ++ -# One should call BuildRtl2832Tua9001Module() to build RTL2832 TUA9001 NIM module before using it. ++ ++*/ ++void ++BuildRtl2832Tua9001Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ) ++{ ++ DVBT_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDvbtNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DVBT_NIM_RTL2832_TUA9001; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2832 demod module. ++ BuildRtl2832Module( ++ &pNim->pDemod, ++ &pNim->DvbtDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodAppMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled ++ ); ++ ++ // Build TUA9001 tuner module. ++ BuildTua9001Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dvbt_nim_default_GetNimType; ++ pNim->GetParameters = dvbt_nim_default_GetParameters; ++ pNim->IsSignalPresent = dvbt_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dvbt_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dvbt_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dvbt_nim_default_GetSignalQuality; ++ pNim->GetBer = dvbt_nim_default_GetBer; ++ pNim->GetSnrDb = dvbt_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dvbt_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dvbt_nim_default_GetCrOffsetHz; ++ pNim->GetTpsInfo = dvbt_nim_default_GetTpsInfo; ++ pNim->UpdateFunction = dvbt_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2832_tua9001_Initialize; ++ pNim->SetParameters = rtl2832_tua9001_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2832_tua9001_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2832_TUA9001_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DVBT_DAGC_TRG_VAL, 0x39 }, ++ {DVBT_AGC_TARG_VAL_0, 0x0 }, ++ {DVBT_AGC_TARG_VAL_8_1, 0x5a }, ++ {DVBT_AAGC_LOOP_GAIN, 0x16 }, ++ {DVBT_LOOP_GAIN2_3_0, 0x6 }, ++ {DVBT_LOOP_GAIN2_4, 0x1 }, ++ {DVBT_LOOP_GAIN3, 0x16 }, ++ {DVBT_VTOP1, 0x35 }, ++ {DVBT_VTOP2, 0x21 }, ++ {DVBT_VTOP3, 0x21 }, ++ {DVBT_KRF1, 0x0 }, ++ {DVBT_KRF2, 0x40 }, ++ {DVBT_KRF3, 0x10 }, ++ {DVBT_KRF4, 0x10 }, ++ {DVBT_IF_AGC_MIN, 0x80 }, ++ {DVBT_IF_AGC_MAX, 0x7f }, ++ {DVBT_RF_AGC_MIN, 0x9c }, ++ {DVBT_RF_AGC_MAX, 0x7f }, ++ {DVBT_POLAR_RF_AGC, 0x0 }, ++ {DVBT_POLAR_IF_AGC, 0x0 }, ++ {DVBT_AD7_SETTING, 0xe9f4 }, ++ {DVBT_OPT_ADC_IQ, 0x1 }, ++ {DVBT_AD_AVI, 0x0 }, ++ {DVBT_AD_AVQ, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2832_TUA9001_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DVBT_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2832_tua9001_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ TUA9001_EXTRA_MODULE *pTunerExtra; ++ int TunerBandwidthMode; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Tua9001); ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Determine TunerBandwidthMode according to bandwidth mode. ++ switch(BandwidthMode) ++ { ++ default: ++ case DVBT_BANDWIDTH_6MHZ: TunerBandwidthMode = TUA9001_BANDWIDTH_6MHZ; break; ++ case DVBT_BANDWIDTH_7MHZ: TunerBandwidthMode = TUA9001_BANDWIDTH_7MHZ; break; ++ case DVBT_BANDWIDTH_8MHZ: TunerBandwidthMode = TUA9001_BANDWIDTH_8MHZ; break; ++ } ++ ++ // Set tuner bandwidth mode with TunerBandwidthMode. ++ if(pTunerExtra->SetBandwidthMode(pTuner, TunerBandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Set demod bandwidth mode. ++ if(pDemod->SetBandwidthMode(pDemod, BandwidthMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.h b/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.h +new file mode 100644 +index 0000000..5eded7d +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2832_tua9001.h +@@ -0,0 +1,137 @@ ++#ifndef __NIM_RTL2832_TUA9001 ++#define __NIM_RTL2832_TUA9001 ++ ++/** ++ ++@file ++ ++@brief RTL2832 TUA9001 NIM module declaration ++ ++One can manipulate RTL2832 TUA9001 NIM through RTL2832 TUA9001 NIM module. ++RTL2832 TUA9001 NIM module is derived from DVB-T NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dvbt_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2832_tua9001.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2832 TUA9001 NIM module. ++ BuildRtl2832Tua9001Module( ++ &pNim, ++ &DvbtNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x20, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_STB, // The RTL2832 application mode is STB mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ 0xc0 // The TUA9001 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dvbt_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2832.h" ++#include "tuner_tua9001.h" ++#include "dvbt_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2832_TUA9001_ADDITIONAL_INIT_REG_TABLE_LEN 24 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2832Tua9001Module( ++ DVBT_NIM_MODULE **ppNim, // DVB-T NIM dependence ++ DVBT_NIM_MODULE *pDvbtNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodAppMode, ++ unsigned long UpdateFuncRefPeriodMs, ++ int IsFunc1Enabled, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ); ++ ++ ++ ++ ++ ++// RTL2832 TUA9001 NIM manipulaing functions ++int ++rtl2832_tua9001_Initialize( ++ DVBT_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2832_tua9001_SetParameters( ++ DVBT_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int BandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.c b/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.c +new file mode 100644 +index 0000000..f501e6e +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.c +@@ -0,0 +1,308 @@ ++/** ++ ++@file ++ ++@brief RTL2836 FC2580 NIM module definition ++ ++One can manipulate RTL2836 FC2580 NIM through RTL2836 FC2580 NIM module. ++RTL2836 FC2580 NIM module is derived from DTMB NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2836_fc2580.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2836 FC2580 NIM module builder ++ ++Use BuildRtl2836Fc2580Module() to build RTL2836 FC2580 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2836 FC2580 NIM module pointer ++@param [in] pDtmbNimModuleMemory Pointer to an allocated DTMB NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2836 I2C device address ++@param [in] DemodCrystalFreqHz RTL2836 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2836 TS interface mode ++@param [in] DemodUpdateFuncRefPeriodMs RTL2836 update function reference period in millisecond ++@param [in] DemodIsFunc1Enabled RTL2836 Function 1 enabling status for setting ++@param [in] DemodIsFunc2Enabled RTL2836 Function 2 enabling status for setting ++@param [in] TunerDeviceAddr FC2580 I2C device address ++@param [in] TunerCrystalFreqHz FC2580 crystal frequency in Hz ++@param [in] TunerAgcMode FC2580 AGC mode ++ ++ ++@note ++ -# One should call BuildRtl2836Fc2580Module() to build RTL2836 FC2580 NIM module before using it. ++ ++*/ ++void ++BuildRtl2836Fc2580Module( ++ DTMB_NIM_MODULE **ppNim, // DTMB NIM dependence ++ DTMB_NIM_MODULE *pDtmbNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ int DemodIsFunc2Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerAgcMode ++ ) ++{ ++ DTMB_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDtmbNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DTMB_NIM_RTL2836_FC2580; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2836 demod module. ++ BuildRtl2836Module( ++ &pNim->pDemod, ++ &pNim->DtmbDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled, ++ DemodIsFunc2Enabled ++ ); ++ ++ // Build FC2580 tuner module. ++ BuildFc2580Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ TunerAgcMode ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dtmb_nim_default_GetNimType; ++ pNim->GetParameters = dtmb_nim_default_GetParameters; ++ pNim->IsSignalPresent = dtmb_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dtmb_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dtmb_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dtmb_nim_default_GetSignalQuality; ++ pNim->GetBer = dtmb_nim_default_GetBer; ++ pNim->GetPer = dtmb_nim_default_GetPer; ++ pNim->GetSnrDb = dtmb_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dtmb_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dtmb_nim_default_GetCrOffsetHz; ++ pNim->GetSignalInfo = dtmb_nim_default_GetSignalInfo; ++ pNim->UpdateFunction = dtmb_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2836_fc2580_Initialize; ++ pNim->SetParameters = rtl2836_fc2580_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2836_fc2580_Initialize( ++ DTMB_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2836_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DTMB_TARGET_VAL, 0x38 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DTMB_DEMOD_MODULE *pDemod; ++ FC2580_EXTRA_MODULE *pTunerExtra; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Enable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner bandwidth mode with 8 MHz. ++ if(pTunerExtra->SetBandwidthMode(pTuner, FC2580_BANDWIDTH_8000000HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with 0 Hz. ++ if(pDemod->SetIfFreqHz(pDemod, IF_FREQ_0HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_NORMAL. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_NORMAL) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2836_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2836_fc2580_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.h b/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.h +new file mode 100644 +index 0000000..cc827ec +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2836_fc2580.h +@@ -0,0 +1,140 @@ ++#ifndef __NIM_RTL2836_FC2580 ++#define __NIM_RTL2836_FC2580 ++ ++/** ++ ++@file ++ ++@brief RTL2836 FC2580 NIM module declaration ++ ++One can manipulate RTL2836 FC2580 NIM through RTL2836 FC2580 NIM module. ++RTL2836 FC2580 NIM module is derived from DTMB NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dtmb_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2836_fc2580.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DTMB_NIM_MODULE *pNim; ++ DTMB_NIM_MODULE DtmbNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2836 FC2580 NIM module. ++ BuildRtl2836Fc2580Module( ++ &pNim, ++ &DtmbNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x3e, // The RTL2836 I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // The RTL2836 crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2836 TS interface mode is serial. ++ 50, // The RTL2836 update function reference period is 50 millisecond ++ YES, // The RTL2836 Function 1 enabling status is YES. ++ YES, // The RTL2836 Function 2 enabling status is YES. ++ ++ 0xac, // The FC2580 I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // The FC2580 crystal frequency is 16.384 MHz. ++ FC2580_AGC_INTERNAL // The FC2580 AGC mode is internal AGC mode. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dtmb_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2836.h" ++#include "tuner_fc2580.h" ++#include "dtmb_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2836_FC2580_ADDITIONAL_INIT_REG_TABLE_LEN 1 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2836Fc2580Module( ++ DTMB_NIM_MODULE **ppNim, // DTMB NIM dependence ++ DTMB_NIM_MODULE *pDtmbNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ int DemodIsFunc2Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerAgcMode ++ ); ++ ++ ++ ++ ++ ++// RTL2836 FC2580 NIM manipulaing functions ++int ++rtl2836_fc2580_Initialize( ++ DTMB_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2836_fc2580_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.c b/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.c +new file mode 100644 +index 0000000..8eaec8b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.c +@@ -0,0 +1,319 @@ ++/** ++ ++@file ++ ++@brief RTL2836 MxL5007T NIM module definition ++ ++One can manipulate RTL2836 MxL5007T NIM through RTL2836 MxL5007T NIM module. ++RTL2836 MxL5007T NIM module is derived from DTMB NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2836_mxl5007t.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2836 MxL5007T NIM module builder ++ ++Use BuildRtl2836Mxl5007tModule() to build RTL2836 MxL5007T NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2836 MxL5007T NIM module pointer ++@param [in] pDtmbNimModuleMemory Pointer to an allocated DTMB NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2836 I2C device address ++@param [in] DemodCrystalFreqHz RTL2836 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2836 TS interface mode ++@param [in] DemodUpdateFuncRefPeriodMs RTL2836 update function reference period in millisecond ++@param [in] DemodIsFunc1Enabled RTL2836 Function 1 enabling status for setting ++@param [in] DemodIsFunc2Enabled RTL2836 Function 2 enabling status for setting ++@param [in] TunerDeviceAddr MxL5007T I2C device address ++@param [in] TunerCrystalFreqHz MxL5007T crystal frequency in Hz ++@param [in] TunerLoopThroughMode MxL5007T loop-through mode ++@param [in] TunerClkOutMode MxL5007T clock output mode ++@param [in] TunerClkOutAmpMode MxL5007T clock output amplitude mode ++ ++ ++@note ++ -# One should call BuildRtl2836Mxl5007tModule() to build RTL2836 MxL5007T NIM module before using it. ++ ++*/ ++void ++BuildRtl2836Mxl5007tModule( ++ DTMB_NIM_MODULE **ppNim, // DTMB NIM dependence ++ DTMB_NIM_MODULE *pDtmbNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ int DemodIsFunc2Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerLoopThroughMode, ++ int TunerClkOutMode, ++ int TunerClkOutAmpMode ++ ) ++{ ++ DTMB_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pDtmbNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ ++ // Set NIM type. ++ pNim->NimType = DTMB_NIM_RTL2836_MXL5007T; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2836 demod module. ++ BuildRtl2836Module( ++ &pNim->pDemod, ++ &pNim->DtmbDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodUpdateFuncRefPeriodMs, ++ DemodIsFunc1Enabled, ++ DemodIsFunc2Enabled ++ ); ++ ++ // Build MxL5007T tuner module. ++ BuildMxl5007tModule( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ RTL2836_MXL5007T_STANDARD_MODE_DEFAULT, ++ RTL2836_MXL5007T_IF_FREQ_HZ_DEFAULT, ++ RTL2836_MXL5007T_SPECTRUM_MODE_DEFAULT, ++ TunerLoopThroughMode, ++ TunerClkOutMode, ++ TunerClkOutAmpMode, ++ RTL2836_MXL5007T_QAM_IF_DIFF_OUT_LEVEL_DEFAULT ++ ); ++ ++ ++ // Set NIM module function pointers with default functions. ++ pNim->GetNimType = dtmb_nim_default_GetNimType; ++ pNim->GetParameters = dtmb_nim_default_GetParameters; ++ pNim->IsSignalPresent = dtmb_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = dtmb_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = dtmb_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = dtmb_nim_default_GetSignalQuality; ++ pNim->GetBer = dtmb_nim_default_GetBer; ++ pNim->GetPer = dtmb_nim_default_GetPer; ++ pNim->GetSnrDb = dtmb_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = dtmb_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = dtmb_nim_default_GetCrOffsetHz; ++ pNim->GetSignalInfo = dtmb_nim_default_GetSignalInfo; ++ pNim->UpdateFunction = dtmb_nim_default_UpdateFunction; ++ ++ // Set NIM module function pointers with particular functions. ++ pNim->Initialize = rtl2836_mxl5007t_Initialize; ++ pNim->SetParameters = rtl2836_mxl5007t_SetParameters; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2836_mxl5007t_Initialize( ++ DTMB_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2836_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {DTMB_TARGET_VAL, 0x38 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ MXL5007T_EXTRA_MODULE *pTunerExtra; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ // Get tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Mxl5007t); ++ ++ ++ // Enable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner bandwidth mode with 8 MHz. ++ if(pTunerExtra->SetBandwidthMode(pTuner, MXL5007T_BANDWIDTH_8000000HZ) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency with NIM default. ++ if(pDemod->SetIfFreqHz(pDemod, RTL2836_MXL5007T_IF_FREQ_HZ_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with NIM default. ++ if(pDemod->SetSpectrumMode(pDemod, RTL2836_MXL5007T_SPECTRUM_MODE_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod registers. ++ for(i = 0; i < RTL2836_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see DTMB_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2836_mxl5007t_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ DTMB_DEMOD_MODULE *pDemod; ++ ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Enable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x1) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Disable demod DTMB_I2CT_EN_CTRL. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, DTMB_I2CT_EN_CTRL, 0x0) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++error_status_set_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.h b/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.h +new file mode 100644 +index 0000000..41e874f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2836_mxl5007t.h +@@ -0,0 +1,150 @@ ++#ifndef __NIM_RTL2836_MXL5007T ++#define __NIM_RTL2836_MXL5007T ++ ++/** ++ ++@file ++ ++@brief RTL2836 MxL5007T NIM module declaration ++ ++One can manipulate RTL2836 MxL5007T NIM through RTL2836 MxL5007T NIM module. ++RTL2836 MxL5007T NIM module is derived from DTMB NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in dtmb_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2836_mxl5007t.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ DTMB_NIM_MODULE *pNim; ++ DTMB_NIM_MODULE DtmbNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2836 MxL5007T NIM module. ++ BuildRtl2836Mxl5007tModule( ++ &pNim, ++ &DtmbNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x3e, // The RTL2836 I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // The RTL2836 crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2836 TS interface mode is serial. ++ 50, // The RTL2836 update function reference period is 50 millisecond ++ YES, // The RTL2836 Function 1 enabling status is YES. ++ YES, // The RTL2836 Function 2 enabling status is YES. ++ ++ 0xc0, // The MxL5007T I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The MxL5007T Crystal frequency is 16.0 MHz. ++ MXL5007T_LOOP_THROUGH_DISABLE, // The MxL5007T loop-through mode is disabled. ++ MXL5007T_CLK_OUT_DISABLE, // The MxL5007T clock output mode is disabled. ++ MXL5007T_CLK_OUT_AMP_0 // The MxL5007T clock output amplitude is 0. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in dtmb_nim_base.h ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2836.h" ++#include "tuner_mxl5007t.h" ++#include "dtmb_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2836_MXL5007T_ADDITIONAL_INIT_REG_TABLE_LEN 1 ++ ++// Default ++#define RTL2836_MXL5007T_STANDARD_MODE_DEFAULT MXL5007T_STANDARD_DVBT ++#define RTL2836_MXL5007T_IF_FREQ_HZ_DEFAULT IF_FREQ_4570000HZ ++#define RTL2836_MXL5007T_SPECTRUM_MODE_DEFAULT SPECTRUM_NORMAL ++#define RTL2836_MXL5007T_QAM_IF_DIFF_OUT_LEVEL_DEFAULT 0 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2836Mxl5007tModule( ++ DTMB_NIM_MODULE **ppNim, // DTMB NIM dependence ++ DTMB_NIM_MODULE *pDtmbNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ unsigned long DemodUpdateFuncRefPeriodMs, ++ int DemodIsFunc1Enabled, ++ int DemodIsFunc2Enabled, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz, ++ int TunerLoopThroughMode, ++ int TunerClkOutMode, ++ int TunerClkOutAmpMode ++ ); ++ ++ ++ ++ ++ ++// RTL2836 MxL5007T NIM manipulaing functions ++int ++rtl2836_mxl5007t_Initialize( ++ DTMB_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2836_mxl5007t_SetParameters( ++ DTMB_NIM_MODULE *pNim, ++ unsigned long RfFreqHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.c b/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.c +new file mode 100644 +index 0000000..25daa3f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.c +@@ -0,0 +1,341 @@ ++/** ++ ++@file ++ ++@brief RTL2840 MAX3543 NIM module definition ++ ++One can manipulate RTL2840 MAX3543 NIM through RTL2840 MAX3543 NIM module. ++RTL2840 MAX3543 NIM module is derived from QAM NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2840_max3543.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2840 MAX3543 NIM module builder ++ ++Use BuildRtl2840Max3543Module() to build RTL2840 MAX3543 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2840 MAX3543 NIM module pointer ++@param [in] pQamNimModuleMemory Pointer to an allocated QAM NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2840 I2C device address ++@param [in] DemodCrystalFreqHz RTL2840 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2840 TS interface mode for setting ++@param [in] DemodEnhancementMode RTL2840 enhancement mode for setting ++@param [in] TunerDeviceAddr MAX3543 I2C device address ++@param [in] TunerCrystalFreqHz MAX3543 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildRtl2840Max3543Module() to build RTL2840 MAX3543 NIM module before using it. ++ ++*/ ++void ++BuildRtl2840Max3543Module( ++ QAM_NIM_MODULE **ppNim, // QAM NIM dependence ++ QAM_NIM_MODULE *pQamNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodEnhancementMode, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ) ++{ ++ QAM_NIM_MODULE *pNim; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pQamNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Set enhancement mode in NIM module. ++ pNim->EnhancementMode = DemodEnhancementMode; ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2840 QAM demod module. ++ BuildRtl2840Module( ++ &pNim->pDemod, ++ &pNim->QamDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodEnhancementMode ++ ); ++ ++ // Build MAX3543 tuner module. ++ BuildMax3543Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++ TunerCrystalFreqHz, ++ RTL2840_MAX3543_STANDARD_MODE_DEFAULT, ++ RTL2840_MAX3543_IF_FREQ_HZ_DEFAULT, ++ RTL2840_MAX3543_SAW_INPUT_TYPE_DEFAULT ++ ); ++ ++ ++ // Set NIM module manipulating function pointers. ++ pNim->Initialize = rtl2840_max3543_Initialize; ++ pNim->SetParameters = rtl2840_max3543_SetParameters; ++ ++ // Set NIM module manipulating function pointers with default. ++ pNim->GetNimType = qam_nim_default_GetNimType; ++ pNim->GetParameters = qam_nim_default_GetParameters; ++ pNim->IsSignalPresent = qam_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = qam_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = qam_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = qam_nim_default_GetSignalQuality; ++ pNim->GetErrorRate = qam_nim_default_GetErrorRate; ++ pNim->GetSnrDb = qam_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = qam_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = qam_nim_default_GetCrOffsetHz; ++ pNim->UpdateFunction = qam_nim_default_UpdateFunction; ++ ++ ++ // Set NIM type. ++ pNim->NimType = QAM_NIM_RTL2840_MAX3543; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2840_max3543_Initialize( ++ QAM_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2840_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {QAM_OPT_RF_AAGC_DRIVE, 0x1 }, ++ {QAM_OPT_IF_AAGC_DRIVE, 0x1 }, ++ {QAM_OPT_RF_AAGC_OEN, 0x1 }, ++ {QAM_OPT_IF_AAGC_OEN, 0x1 }, ++ {QAM_RF_AAGC_MAX, 0xff }, ++ {QAM_RF_AAGC_MIN, 0x0 }, ++ {QAM_IF_AAGC_MAX, 0xff }, ++ {QAM_IF_AAGC_MIN, 0x0 }, ++ {QAM_AAGC_MODE_SEL, 0x0 }, ++ }; ++ ++ ++ QAM_DEMOD_MODULE *pDemod; ++ TUNER_MODULE *pTuner; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ // Get demod module and tuner module. ++ pDemod = pNim->pDemod; ++ pTuner = pNim->pTuner; ++ ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency in Hz with NIM default. ++ if(pDemod->SetIfFreqHz(pDemod, RTL2840_MAX3543_IF_FREQ_HZ_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with NIM default. ++ if(pDemod->SetSpectrumMode(pDemod, RTL2840_MAX3543_SPECTRUM_MODE_DEFAULT) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod AAGC registers. ++ // Note: SetParameters() will set QAM_AAGC_TARGET and QAM_VTOP according to parameters. ++ for(i = 0; i < RTL2840_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2840_max3543_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ TUNER_MODULE *pTuner; ++ ++ ++ // Get demod module and tuner module. ++ pDemod = pNim->pDemod; ++ pTuner = pNim->pTuner; ++ ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod QAM mode. ++ if(pDemod->SetQamMode(pDemod, QamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod symbol rate in Hz. ++ if(pDemod->SetSymbolRateHz(pDemod, SymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod alpha mode. ++ if(pDemod->SetAlphaMode(pDemod, AlphaMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set demod QAM_AAGC_TARGET and QAM_VTOP according to QAM mode and enhancement mode. ++ switch(QamMode) ++ { ++ default: ++ case QAM_QAM_4: ++ case QAM_QAM_16: ++ case QAM_QAM_32: ++ case QAM_QAM_64: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_VTOP, 0x3f) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ switch(pNim->EnhancementMode) ++ { ++ case QAM_DEMOD_EN_NONE: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_AAGC_TARGET, 0x6b) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ ++ default: ++ case QAM_DEMOD_EN_AM_HUM: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_AAGC_TARGET, 0x64) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ break; ++ ++ case QAM_QAM_128: ++ case QAM_QAM_256: ++ case QAM_QAM_512: ++ case QAM_QAM_1024: ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_VTOP, 0x38) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, QAM_AAGC_TARGET, 0x6b) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.h b/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.h +new file mode 100644 +index 0000000..ff4ec2f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2840_max3543.h +@@ -0,0 +1,146 @@ ++#ifndef __NIM_RTL2840_MAX3543_H ++#define __NIM_RTL2840_MAX3543_H ++ ++/** ++ ++@file ++ ++@brief RTL2840 MAX3543 NIM module definition ++ ++One can manipulate RTL2840 MAX3543 NIM through RTL2840 MAX3543 NIM module. ++RTL2840 MAX3543 NIM module is derived from QAM NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in qam_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2840_max3543.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ QAM_NIM_MODULE *pNim; ++ QAM_NIM_MODULE QamNimModuleMemory; ++ ++ ... ++ ++ ++ ++ // Build RTL2840 MAX3543 NIM module. ++ BuildRtl2840Max3543Module( ++ &pNim, ++ &QamNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x44, // The RTL2840 I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2840 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2840 TS interface mode is serial. ++ QAM_DEMOD_EN_AM_HUM, // Use AM-hum enhancement mode. ++ ++ 0xc0, // The MAX3543 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ // The MAX3543 Crystal frequency is 16.0 MHz. ++ ); ++ ++ ++ ++ // See the example for other NIM functions in qam_nim_base.h ++ ... ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2840.h" ++#include "tuner_max3543.h" ++#include "qam_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2840_MAX3543_ADDITIONAL_INIT_REG_TABLE_LEN 9 ++ ++// Default ++#define RTL2840_MAX3543_STANDARD_MODE_DEFAULT MAX3543_STANDARD_QAM ++#define RTL2840_MAX3543_IF_FREQ_HZ_DEFAULT IF_FREQ_36170000HZ ++#define RTL2840_MAX3543_SPECTRUM_MODE_DEFAULT SPECTRUM_INVERSE ++#define RTL2840_MAX3543_SAW_INPUT_TYPE_DEFAULT MAX3543_SAW_INPUT_SE ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2840Max3543Module( ++ QAM_NIM_MODULE **ppNim, // QAM NIM dependence ++ QAM_NIM_MODULE *pQamNimModuleMemory, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodEnhancementMode, ++ ++ unsigned char TunerDeviceAddr, // Tuner dependence ++ unsigned long TunerCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// RTL2840 MAX3543 NIM manipulaing functions ++int ++rtl2840_max3543_Initialize( ++ QAM_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2840_max3543_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.c b/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.c +new file mode 100644 +index 0000000..3df31e6 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.c +@@ -0,0 +1,307 @@ ++/** ++ ++@file ++ ++@brief RTL2840 MT2063 NIM module definition ++ ++One can manipulate RTL2840 MT2063 NIM through RTL2840 MT2063 NIM module. ++RTL2840 MT2063 NIM module is derived from QAM NIM module. ++ ++*/ ++ ++ ++#include "nim_rtl2840_mt2063.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief RTL2840 MT2063 NIM module builder ++ ++Use BuildRtl2840Mt2063Module() to build RTL2840 MT2063 NIM module, set all module function pointers with the ++corresponding functions, and initialize module private variables. ++ ++ ++@param [in] ppNim Pointer to RTL2840 MT2063 NIM module pointer ++@param [in] pQamNimModuleMemory Pointer to an allocated QAM NIM module memory ++@param [in] I2cReadingByteNumMax Maximum I2C reading byte number for basic I2C reading function ++@param [in] I2cWritingByteNumMax Maximum I2C writing byte number for basic I2C writing function ++@param [in] I2cRead Basic I2C reading function pointer ++@param [in] I2cWrite Basic I2C writing function pointer ++@param [in] WaitMs Basic waiting function pointer ++@param [in] DemodDeviceAddr RTL2840 I2C device address ++@param [in] DemodCrystalFreqHz RTL2840 crystal frequency in Hz ++@param [in] DemodTsInterfaceMode RTL2840 TS interface mode for setting ++@param [in] DemodEnhancementMode RTL2840 enhancement mode for setting ++@param [in] TunerDeviceAddr MT2063 I2C device address ++ ++ ++@note ++ -# One should call BuildRtl2840Mt2063Module() to build RTL2840 MT2063 NIM module before using it. ++ ++*/ ++void ++BuildRtl2840Mt2063Module( ++ QAM_NIM_MODULE **ppNim, // QAM NIM dependence ++ QAM_NIM_MODULE *pQamNimModuleMemory, ++ unsigned long NimIfFreqHz, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodEnhancementMode, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ) ++{ ++ QAM_NIM_MODULE *pNim; ++ RTL2840_MT2063_EXTRA_MODULE *pNimExtra; ++ ++ ++ ++ // Set NIM module pointer with NIM module memory. ++ *ppNim = pQamNimModuleMemory; ++ ++ // Get NIM module. ++ pNim = *ppNim; ++ ++ // Set I2C bridge module pointer with I2C bridge module memory. ++ pNim->pI2cBridge = &pNim->I2cBridgeModuleMemory; ++ ++ // Get NIM extra module. ++ pNimExtra = &(pNim->Extra.Rtl2840Mt2063); ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pNim->pBaseInterface, ++ &pNim->BaseInterfaceModuleMemory, ++ I2cReadingByteNumMax, ++ I2cWritingByteNumMax, ++ I2cRead, ++ I2cWrite, ++ WaitMs ++ ); ++ ++ // Build RTL2840 QAM demod module. ++ BuildRtl2840Module( ++ &pNim->pDemod, ++ &pNim->QamDemodModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ DemodDeviceAddr, ++ DemodCrystalFreqHz, ++ DemodTsInterfaceMode, ++ DemodEnhancementMode ++ ); ++ ++ // Build MT2063 tuner module. ++ BuildMt2063Module( ++ &pNim->pTuner, ++ &pNim->TunerModuleMemory, ++ &pNim->BaseInterfaceModuleMemory, ++ &pNim->I2cBridgeModuleMemory, ++ TunerDeviceAddr, ++// MT2063_STANDARD_QAM, ++ MT2063_STANDARD_DVBT, ++ MT2063_VGAGC_0X1 ++ ); ++ ++ ++ // Set NIM module manipulating function pointers. ++ pNim->Initialize = rtl2840_mt2063_Initialize; ++ pNim->SetParameters = rtl2840_mt2063_SetParameters; ++ ++ // Set NIM module manipulating function pointers with default. ++ pNim->GetNimType = qam_nim_default_GetNimType; ++ pNim->GetParameters = qam_nim_default_GetParameters; ++ pNim->IsSignalPresent = qam_nim_default_IsSignalPresent; ++ pNim->IsSignalLocked = qam_nim_default_IsSignalLocked; ++ pNim->GetSignalStrength = qam_nim_default_GetSignalStrength; ++ pNim->GetSignalQuality = qam_nim_default_GetSignalQuality; ++ pNim->GetErrorRate = qam_nim_default_GetErrorRate; ++ pNim->GetSnrDb = qam_nim_default_GetSnrDb; ++ pNim->GetTrOffsetPpm = qam_nim_default_GetTrOffsetPpm; ++ pNim->GetCrOffsetHz = qam_nim_default_GetCrOffsetHz; ++ pNim->UpdateFunction = qam_nim_default_UpdateFunction; ++ ++ ++ // Set NIM type. ++ pNim->NimType = QAM_NIM_RTL2840_MT2063; ++ ++ // Set enhancement mode in NIM module. ++ pNim->EnhancementMode = DemodEnhancementMode; ++ ++ // Set IF frequency variable in NIM extra module. ++ pNimExtra->IfFreqHz = NimIfFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_INITIALIZE ++ ++*/ ++int ++rtl2840_mt2063_Initialize( ++ QAM_NIM_MODULE *pNim ++ ) ++{ ++ typedef struct ++ { ++ int RegBitName; ++ unsigned long Value; ++ } ++ REG_VALUE_ENTRY; ++ ++ ++ static const REG_VALUE_ENTRY AdditionalInitRegValueTable[RTL2840_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN] = ++ { ++ // RegBitName, Value ++ {QAM_OPT_RF_AAGC_DRIVE, 0x1 }, ++ {QAM_OPT_IF_AAGC_DRIVE, 0x1 }, ++ {QAM_OPT_RF_AAGC_OEN, 0x1 }, ++ {QAM_OPT_IF_AAGC_OEN, 0x1 }, ++ {QAM_RF_AAGC_MAX, 0x80 }, ++ {QAM_RF_AAGC_MIN, 0x80 }, ++ {QAM_IF_AAGC_MAX, 0xff }, ++ {QAM_IF_AAGC_MIN, 0x0 }, ++ {QAM_AAGC_MODE_SEL, 0x0 }, ++ }; ++ ++ ++ TUNER_MODULE *pTuner; ++ QAM_DEMOD_MODULE *pDemod; ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ RTL2840_MT2063_EXTRA_MODULE *pNimExtra; ++ ++ int i; ++ ++ int RegBitName; ++ unsigned long Value; ++ ++ ++ // Get modules. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ pTunerExtra = &(pTuner->Extra.Mt2063); ++ pNimExtra = &(pNim->Extra.Rtl2840Mt2063); ++ ++ ++ // Initialize tuner. ++ if(pTuner->Initialize(pTuner) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner IF frequency in Hz. ++ if(pTunerExtra->SetIfFreqHz(pTuner, pNimExtra->IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Initialize demod. ++ if(pDemod->Initialize(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod IF frequency in Hz. ++ if(pDemod->SetIfFreqHz(pDemod, pNimExtra->IfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod spectrum mode with SPECTRUM_INVERSE. ++ if(pDemod->SetSpectrumMode(pDemod, SPECTRUM_INVERSE) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod AAGC registers. ++ // Note: SetParameters() will set QAM_AAGC_TARGET and QAM_VTOP according to parameters. ++ for(i = 0; i < RTL2840_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN; i++) ++ { ++ // Get register bit name and its value. ++ RegBitName = AdditionalInitRegValueTable[i].RegBitName; ++ Value = AdditionalInitRegValueTable[i].Value; ++ ++ // Set demod registers ++ if(pDemod->RegAccess.Addr8Bit.SetRegBitsWithPage(pDemod, RegBitName, Value) != FUNCTION_SUCCESS) ++ goto error_status_set_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_registers: ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++rtl2840_mt2063_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module and tuner module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod QAM mode. ++ if(pDemod->SetQamMode(pDemod, QamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod symbol rate in Hz. ++ if(pDemod->SetSymbolRateHz(pDemod, SymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod alpha mode. ++ if(pDemod->SetAlphaMode(pDemod, AlphaMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.h b/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.h +new file mode 100644 +index 0000000..0e4e673 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/nim_rtl2840_mt2063.h +@@ -0,0 +1,163 @@ ++#ifndef __NIM_RTL2840_MT2063_H ++#define __NIM_RTL2840_MT2063_H ++ ++/** ++ ++@file ++ ++@brief RTL2840 MT2063 NIM module definition ++ ++One can manipulate RTL2840 MT2063 NIM through RTL2840 MT2063 NIM module. ++RTL2840 MT2063 NIM module is derived from QAM NIM module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the NIM example in qam_nim_base.h except the listed lines. ++ ++ ++ ++#include "nim_rtl2840_mt2063.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ QAM_NIM_MODULE *pNim; ++ QAM_NIM_MODULE QamNimModuleMemory; ++ TUNER_MODULE *pTuner; ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ ++ ... ++ ++ ++ ++ // Build RTL2840 MT2063 NIM module. ++ BuildRtl2840Mt2063Module( ++ &pNim, ++ &QamNimModuleMemory, ++ IF_FREQ_36125000HZ, // The RTL2840 and MT2063 IF frequency is 36.125 MHz. ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ 0x44, // The RTL2840 I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2840 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2840 TS interface mode is serial. ++ QAM_DEMOD_EN_AM_HUM, // Use AM-hum enhancement mode. ++ ++ 0xc0 // The MT2063 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get MT2063 tuner extra module. ++ pTuner = pNim->pTuner; ++ pTunerExtra = &(pTuner->Extra.Mt2063); ++ ++ // Open MT2063 handle. ++ pTunerExtra->OpenHandle(pTuner); ++ ++ ++ ++ ++ ++ // See the example for other NIM functions in qam_nim_base.h ++ ... ++ ++ ++ ++ ++ ++ // Close MT2063 handle. ++ pTunerExtra->CloseHandle(pTuner); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "demod_rtl2840.h" ++#include "tuner_mt2063.h" ++#include "qam_nim_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define RTL2840_MT2063_ADDITIONAL_INIT_REG_TABLE_LEN 9 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildRtl2840Mt2063Module( ++ QAM_NIM_MODULE **ppNim, // QAM NIM dependence ++ QAM_NIM_MODULE *pQamNimModuleMemory, ++ unsigned long NimIfFreqHz, ++ ++ unsigned long I2cReadingByteNumMax, // Base interface dependence ++ unsigned long I2cWritingByteNumMax, ++ BASE_FP_I2C_READ I2cRead, ++ BASE_FP_I2C_WRITE I2cWrite, ++ BASE_FP_WAIT_MS WaitMs, ++ ++ unsigned char DemodDeviceAddr, // Demod dependence ++ unsigned long DemodCrystalFreqHz, ++ int DemodTsInterfaceMode, ++ int DemodEnhancementMode, ++ ++ unsigned char TunerDeviceAddr // Tuner dependence ++ ); ++ ++ ++ ++ ++ ++// RTL2840 MT2063 NIM manipulaing functions ++int ++rtl2840_mt2063_Initialize( ++ QAM_NIM_MODULE *pNim ++ ); ++ ++int ++rtl2840_mt2063_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/qam_demod_base.c b/drivers/media/dvb/dvb-usb/qam_demod_base.c +new file mode 100644 +index 0000000..8843ab5 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/qam_demod_base.c +@@ -0,0 +1,1289 @@ ++/** ++ ++@file ++ ++@brief QAM demod default function definition ++ ++QAM demod default functions. ++ ++*/ ++ ++#include "qam_demod_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE ++ ++*/ ++int ++qam_demod_addr_8bit_default_SetRegPage( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBytes[LEN_2_BYTE]; ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Set demod register page with page number. ++ // Note: The I2C format of demod register page setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + QAM_DEMOD_PAGE_REG_ADDR + PageNo + stop_bit ++ WritingBytes[0] = QAM_DEMOD_PAGE_REG_ADDR; ++ WritingBytes[1] = (unsigned char)PageNo; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBytes, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ if( mutex_lock_interruptible(&d->usb_mutex) ) goto error; ++ ++ pDemod->CurrentPageNo = PageNo; ++ ++ mutex_unlock(&d->usb_mutex); ++ ++ return FUNCTION_SUCCESS; ++ ++error: ++ ++ return FUNCTION_ERROR; ++ ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_BYTES ++ ++*/ ++int ++qam_demod_addr_8bit_default_SetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = (unsigned char)(RegStartAddr + i); ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + ++ // stop_bit ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, WritingByteNum + LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned char WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ unsigned long PageNo=0; ++ ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ PageNo=pDemod->CurrentPageNo; ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = RegStartAddr + i; ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(write_demod_register(d, DeviceAddr, PageNo, WritingBuffer[0], WritingBuffer+1, WritingByteNum)) ++ goto error_status_set_demod_registers; ++ ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_BYTES ++ ++*/ ++int ++qam_demod_addr_8bit_default_GetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ unsigned char DeviceAddr; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = (unsigned char)(RegStartAddr + i); ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, &RegReadingAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned int i; ++ unsigned char DeviceAddr; ++ unsigned char ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ unsigned long PageNo; ++ ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); //add by chialing ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ PageNo=pDemod->CurrentPageNo; ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = RegStartAddr + i; ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ // Get demod register bytes. ++ if(read_demod_register(d, DeviceAddr, PageNo, RegReadingAddr, pReadingBytes, ReadingByteNum)) ++ goto error_status_get_demod_registers; ++ ++ ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++//error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_MASK_BITS ++ ++*/ ++int ++qam_demod_addr_8bit_default_SetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ unsigned char WritingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Reserve unsigned integer value unmask bit with mask and inlay writing value into it. ++ Value &= ~Mask; ++ Value |= (WritingValue << Shift) & Mask; ++ ++ ++ // Separate unsigned integer value into writing bytes. ++ // Note: Pick up lower address byte from value LSB. ++ // Pick up upper address byte from value MSB. ++ for(i = 0; i < ByteNum; i++) ++ WritingBytes[i] = (unsigned char)((Value >> (BYTE_SHIFT * i)) & BYTE_MASK); ++ ++ ++ // Write demod register bytes with writing bytes. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBytes(pDemod, RegStartAddr, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_MASK_BITS ++ ++*/ ++int ++qam_demod_addr_8bit_default_GetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Get register bits from unsigned integaer value with mask and shift ++ *pReadingValue = (Value & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_BITS ++ ++*/ ++int ++qam_demod_addr_8bit_default_SetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->BaseRegTable.Addr8Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from base register table with register bit name key. ++ RegStartAddr = pDemod->BaseRegTable.Addr8Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->BaseRegTable.Addr8Bit[RegBitName].Msb; ++ Lsb = pDemod->BaseRegTable.Addr8Bit[RegBitName].Lsb; ++ ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_BITS ++ ++*/ ++int ++qam_demod_addr_8bit_default_GetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->BaseRegTable.Addr8Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from base register table with register bit name key. ++ RegStartAddr = pDemod->BaseRegTable.Addr8Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->BaseRegTable.Addr8Bit[RegBitName].Msb; ++ Lsb = pDemod->BaseRegTable.Addr8Bit[RegBitName].Lsb; ++ ++ ++ // Get register mask bits. ++ if(pDemod->RegAccess.Addr8Bit.GetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++qam_demod_addr_8bit_default_SetRegBitsWithPage( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned char PageNo; ++ ++ ++ // Get register page number from base register table with register bit name key. ++ PageNo = pDemod->BaseRegTable.Addr8Bit[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Set register mask bits with register bit name key. ++ if(pDemod->RegAccess.Addr8Bit.SetRegBits(pDemod, RegBitName, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++*/ ++int ++qam_demod_addr_8bit_default_GetRegBitsWithPage( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned char PageNo; ++ ++ ++ // Get register page number from base register table with register bit name key. ++ PageNo = pDemod->BaseRegTable.Addr8Bit[RegBitName].PageNo; ++ ++ ++ // Set register page number. ++ if(pDemod->RegAccess.Addr8Bit.SetRegPage(pDemod, PageNo) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ // Get register mask bits with register bit name key. ++ if(pDemod->RegAccess.Addr8Bit.GetRegBits(pDemod, RegBitName, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_BYTES ++ ++*/ ++int ++qam_demod_addr_16bit_default_SetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i, j; ++ ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned short RegWritingAddr; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set demod register bytes with writing bytes. ++ // Note: Set demod register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = (unsigned short)(RegStartAddr + i); ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddrMsb + RegWritingAddrLsb + ++ // writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = (RegWritingAddr >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = RegWritingAddr & BYTE_MASK; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_2_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set demod register bytes with writing buffer. ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, WritingByteNum + LEN_2_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_BYTES ++ ++*/ ++int ++qam_demod_addr_16bit_default_GetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned long i; ++ unsigned char DeviceAddr; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned short RegReadingAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ ++ // Get base interface. ++ pBaseInterface = pDemod->pBaseInterface; ++ ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get demod register bytes. ++ // Note: Get demod register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = (unsigned short)(RegStartAddr + i); ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set demod register reading address. ++ // Note: The I2C format of demod register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddrMsb + RegReadingAddrLsb + stop_bit ++ WritingBuffer[0] = (RegReadingAddr >> BYTE_SHIFT) & BYTE_MASK; ++ WritingBuffer[1] = RegReadingAddr & BYTE_MASK; ++ ++ if(pBaseInterface->I2cWrite(pBaseInterface, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_register_reading_address; ++ ++ // Get demod register bytes. ++ // Note: The I2C format of demod register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pBaseInterface->I2cRead(pBaseInterface, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_register_reading_address: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_MASK_BITS ++ ++*/ ++int ++qam_demod_addr_16bit_default_SetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ unsigned char WritingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr16Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Reserve unsigned integer value unmask bit with mask and inlay writing value into it. ++ Value &= ~Mask; ++ Value |= (WritingValue << Shift) & Mask; ++ ++ ++ // Separate unsigned integer value into writing bytes. ++ // Note: Pick up lower address byte from value LSB. ++ // Pick up upper address byte from value MSB. ++ for(i = 0; i < ByteNum; i++) ++ WritingBytes[i] = (unsigned char)((Value >> (BYTE_SHIFT * i)) & BYTE_MASK); ++ ++ ++ // Write demod register bytes with writing bytes. ++ if(pDemod->RegAccess.Addr16Bit.SetRegBytes(pDemod, RegStartAddr, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_MASK_BITS ++ ++*/ ++int ++qam_demod_addr_16bit_default_GetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingBytes[LEN_4_BYTE]; ++ ++ unsigned char ByteNum; ++ unsigned long Mask; ++ unsigned char Shift; ++ ++ unsigned long Value; ++ ++ ++ // Calculate writing byte number according to MSB. ++ ByteNum = Msb / BYTE_BIT_NUM + LEN_1_BYTE; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (unsigned char)(Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get demod register bytes according to register start adddress and byte number. ++ if(pDemod->RegAccess.Addr16Bit.GetRegBytes(pDemod, RegStartAddr, ReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ // Combine reading bytes into an unsigned integer value. ++ // Note: Put lower address byte on value LSB. ++ // Put upper address byte on value MSB. ++ Value = 0; ++ ++ for(i = 0; i < ByteNum; i++) ++ Value |= (unsigned long)ReadingBytes[i] << (BYTE_SHIFT * i); ++ ++ ++ // Get register bits from unsigned integaer value with mask and shift ++ *pReadingValue = (Value & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_SET_REG_BITS ++ ++*/ ++int ++qam_demod_addr_16bit_default_SetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ) ++{ ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->BaseRegTable.Addr16Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from base register table with register bit name key. ++ RegStartAddr = pDemod->BaseRegTable.Addr16Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->BaseRegTable.Addr16Bit[RegBitName].Msb; ++ Lsb = pDemod->BaseRegTable.Addr16Bit[RegBitName].Lsb; ++ ++ ++ // Set register mask bits. ++ if(pDemod->RegAccess.Addr16Bit.SetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, WritingValue) != FUNCTION_SUCCESS) ++ goto error_status_set_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_set_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_REG_BITS ++ ++*/ ++int ++qam_demod_addr_16bit_default_GetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ) ++{ ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++ ++ ++ // Check if register bit name is available. ++ if(pDemod->BaseRegTable.Addr16Bit[RegBitName].IsAvailable == NO) ++ goto error_status_register_bit_name; ++ ++ ++ // Get register start address, MSB, and LSB from base register table with register bit name key. ++ RegStartAddr = pDemod->BaseRegTable.Addr16Bit[RegBitName].RegStartAddr; ++ Msb = pDemod->BaseRegTable.Addr16Bit[RegBitName].Msb; ++ Lsb = pDemod->BaseRegTable.Addr16Bit[RegBitName].Lsb; ++ ++ ++ // Get register mask bits. ++ if(pDemod->RegAccess.Addr16Bit.GetRegMaskBits(pDemod, RegStartAddr, Msb, Lsb, pReadingValue) != FUNCTION_SUCCESS) ++ goto error_status_get_demod_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_register_bit_name: ++error_status_get_demod_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_DEMOD_TYPE ++ ++*/ ++void ++qam_demod_default_GetDemodType( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ) ++{ ++ // Get demod type from demod module. ++ *pDemodType = pDemod->DemodType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++qam_demod_default_GetDeviceAddr( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get demod I2C device address from demod module. ++ *pDeviceAddr = pDemod->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_CRYSTAL_FREQ_HZ ++ ++*/ ++void ++qam_demod_default_GetCrystalFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ) ++{ ++ // Get demod crystal frequency in Hz from demod module. ++ *pCrystalFreqHz = pDemod->CrystalFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_QAM_MODE ++ ++*/ ++int ++qam_demod_default_GetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ) ++{ ++ // Get demod QAM mode from demod module. ++ if(pDemod->IsQamModeSet != YES) ++ goto error_status_get_demod_qam_mode; ++ ++ *pQamMode = pDemod->QamMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_qam_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_SYMBOL_RATE_HZ ++ ++*/ ++int ++qam_demod_default_GetSymbolRateHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSymbolRateHz ++ ) ++{ ++ // Get demod symbol rate in Hz from demod module. ++ if(pDemod->IsSymbolRateHzSet != YES) ++ goto error_status_get_demod_symbol_rate; ++ ++ *pSymbolRateHz = pDemod->SymbolRateHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_symbol_rate: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_ALPHA_MODE ++ ++*/ ++int ++qam_demod_default_GetAlphaMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAlphaMode ++ ) ++{ ++ // Get demod alpha mode from demod module. ++ if(pDemod->IsAlphaModeSet != YES) ++ goto error_status_get_demod_alpha_mode; ++ ++ *pAlphaMode = pDemod->AlphaMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_alpha_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_IF_FREQ_HZ ++ ++*/ ++int ++qam_demod_default_GetIfFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ) ++{ ++ // Get demod IF frequency in Hz from demod module. ++ if(pDemod->IsIfFreqHzSet != YES) ++ goto error_status_get_demod_if_frequency; ++ ++ *pIfFreqHz = pDemod->IfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_if_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_DEMOD_FP_GET_SPECTRUM_MODE ++ ++*/ ++int ++qam_demod_default_GetSpectrumMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ) ++{ ++ // Get demod spectrum mode from demod module. ++ if(pDemod->IsSpectrumModeSet != YES) ++ goto error_status_get_demod_spectrum_mode; ++ ++ *pSpectrumMode = pDemod->SpectrumMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_spectrum_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/qam_demod_base.h b/drivers/media/dvb/dvb-usb/qam_demod_base.h +new file mode 100644 +index 0000000..0eba936 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/qam_demod_base.h +@@ -0,0 +1,2827 @@ ++#ifndef __QAM_DEMOD_BASE_H ++#define __QAM_DEMOD_BASE_H ++ ++/** ++ ++@file ++ ++@brief QAM demod base module definition ++ ++QAM demod base module definitions contains demod module structure, demod funciton pointers, and demod definitions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_xxx.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE QamDemodModuleMemory; ++ ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ int QamMode; ++ unsigned long SymbolRateHz; ++ int AlphaMode; ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ ++ long RfAgc, IfAgc; ++ unsigned long DiAgc; ++ ++ int Answer; ++ long TrOffsetPpm, CrOffsetHz; ++ unsigned long BerNum, BerDen, PerNum, PerDen; ++ double Ber, Per; ++ long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ unsigned long SignalStrength, SignalQuality; ++ ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pBaseInterface, ++ &BaseInterfaceModuleMemory, ++ 9, // Set maximum I2C reading byte number with 9. ++ 8, // Set maximum I2C writing byte number with 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs // Employ CustomWaitMs() as basic waiting function. ++ ); ++ ++ ++ // Build QAM demod XXX module. ++ BuildXxxModule( ++ &pDemod, ++ &QamDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0x44, // Demod I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // Demod crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // Demod TS interface mode is serial. ++ ... // Other arguments by each demod module ++ ); ++ ++ ++ ++ ++ ++ // ==== Initialize QAM demod and set its parameters ===== ++ ++ // Initialize demod. ++ pDemod->Initialize(pDemod); ++ ++ ++ // Set demod parameters. (QAM mode, symbol rate, alpha mode, IF frequency, spectrum mode) ++ // Note: In the example: ++ // 1. QAM is 64. ++ // 2. Symbol rate is 6.952 MHz. ++ // 3. Alpha is 0.15. ++ // 4. IF frequency is 36 MHz. ++ // 5. Spectrum mode is SPECTRUM_INVERSE. ++ QamMode = QAM_QAM_64; ++ SymbolRateHz = 6952000; ++ AlphaMode = QAM_ALPHA_0P15; ++ IfFreqHz = IF_FREQ_36000000HZ; ++ SpectrumMode = SPECTRUM_INVERSE; ++ ++ pDemod->SetQamMode(pDemod, QamMode); ++ pDemod->SetSymbolRateHz(pDemod, SymbolRateHz); ++ pDemod->SetAlphaMode(pDemod, AlphaMode); ++ pDemod->SetIfFreqHz(pDemod, IfFreqHz); ++ pDemod->SetSpectrumMode(pDemod, SpectrumMode); ++ ++ ++ // Need to set tuner before demod software reset. ++ // The order to set demod and tuner is not important. ++ // Note: One can use "pDemod->SetRegBitsWithPage(pDemod, QAM_OPT_I2C_RELAY, 0x1);" ++ // for tuner I2C command forwarding. ++ ++ ++ // Reset demod by software reset. ++ pDemod->SoftwareReset(pDemod); ++ ++ ++ // Wait maximum 1000 ms for demod converge. ++ for(i = 0; i < 25; i++) ++ { ++ // Wait 40 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 40); ++ ++ // Check signal lock status through frame lock. ++ // Note: If Answer is YES, frame is locked. ++ // If Answer is NO, frame is not locked. ++ pDemod->IsFrameLocked(pDemod, &Answer); ++ ++ if(Answer == YES) ++ { ++ // Signal is locked. ++ break; ++ } ++ } ++ ++ ++ ++ ++ ++ // ==== Get QAM demod information ===== ++ ++ // Get demod type. ++ // Note: One can find demod type in MODULE_TYPE enumeration. ++ pDemod->GetDemodType(pDemod, &DemodType); ++ ++ // Get demod I2C device address. ++ pDemod->GetDeviceAddr(pDemod, &DeviceAddr); ++ ++ // Get demod crystal frequency in Hz. ++ pDemod->GetCrystalFreqHz(pDemod, &CrystalFreqHz); ++ ++ ++ // Ask demod if it is connected to I2C bus. ++ // Note: If Answer is YES, demod is connected to I2C bus. ++ // If Answer is NO, demod is not connected to I2C bus. ++ pDemod->IsConnectedToI2c(pDemod, &Answer); ++ ++ ++ // Get demod parameters. (QAM mode, symbol rate, alpha mode, IF frequency, spectrum mode) ++ pDemod->GetQamMode(pDemod, &QamMode); ++ pDemod->GetSymbolRateHz(pDemod, &SymbolRateHz); ++ pDemod->GetAlphaMode(pDemod, &AlphaMode); ++ pDemod->GetIfFreqHz(pDemod, &IfFreqHz); ++ pDemod->GetSpectrumMode(pDemod, &SpectrumMode); ++ ++ ++ // Get demod AGC value. ++ // Note: The range of RF AGC and IF AGC value is -1024 ~ 1023. ++ // The range of digital AGC value is 0 ~ 134217727. ++ pDemod->GetRfAgc(pDemod, &RfAgc); ++ pDemod->GetIfAgc(pDemod, &IfAgc); ++ pDemod->GetDiAgc(pDemod, &DiAgc); ++ ++ ++ // Get demod lock status. ++ // Note: If Answer is YES, it is locked. ++ // If Answer is NO, it is not locked. ++ pDemod->IsAagcLocked(pDemod, &Answer); ++ pDemod->IsEqLocked(pDemod, &Answer); ++ pDemod->IsFrameLocked(pDemod, &Answer); ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pDemod->GetTrOffsetPpm(pDemod, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pDemod->GetCrOffsetHz(pDemod, &CrOffsetHz); ++ ++ ++ // Get BER and PER. ++ // Note: Test packet number = pow(2, (2 * 5 + 4)) = 16384 ++ // Maximum wait time = 1000 ms = 1 second ++ pDemod->GetErrorRate(pDemod, 5, 1000, &BerNum, &BerDen, &PerNum, &PerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ Per = (double)PerNum / (double)PerDen; ++ ++ // Get SNR in dB. ++ pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pDemod->GetSignalStrength(pDemod, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pDemod->GetSignalQuality(pDemod, &SignalQuality); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// Page register address ++#define QAM_DEMOD_PAGE_REG_ADDR 0x0 ++ ++ ++/// QAM QAM modes ++enum QAM_QAM_MODE ++{ ++ QAM_QAM_4, ///< QPSK ++ QAM_QAM_16, ///< 16 QAM ++ QAM_QAM_32, ///< 32 QAM ++ QAM_QAM_64, ///< 64 QAM ++ QAM_QAM_128, ///< 128 QAM ++ QAM_QAM_256, ///< 256 QAM ++ QAM_QAM_512, ///< 512 QAM ++ QAM_QAM_1024, ///< 1024 QAM ++}; ++#define QAM_QAM_MODE_NUM 8 ++ ++ ++/// QAM alpha modes ++enum QAM_ALPHA_MODE ++{ ++ QAM_ALPHA_0P12, ///< Alpha = 0.12 ++ QAM_ALPHA_0P13, ///< Alpha = 0.13 ++ QAM_ALPHA_0P15, ///< Alpha = 0.15 ++ QAM_ALPHA_0P18, ///< Alpha = 0.18 ++ QAM_ALPHA_0P20, ///< Alpha = 0.20 ++}; ++#define QAM_ALPHA_MODE_NUM 5 ++ ++ ++/// QAM demod enhancement modes ++enum QAM_DEMOD_EN_MODE ++{ ++ QAM_DEMOD_EN_NONE, ///< None demod enhancement ++ QAM_DEMOD_EN_AM_HUM, ///< AM-hum demod enhancement ++}; ++#define QAM_DEMOD_EN_MODE_NUM 2 ++ ++ ++/// QAM demod configuration mode ++enum QAM_DEMOD_CONFIG_MODE ++{ ++ QAM_DEMOD_CONFIG_OC, ///< OpenCable demod configuration ++ QAM_DEMOD_CONFIG_DVBC, ///< DVB-C demod configuration ++}; ++#define QAM_DEMOD_CONFIG_MODE_NUM 2 ++ ++ ++ ++ ++ ++// Register entry definitions ++ ++// Base register entry for 8-bit address ++typedef struct ++{ ++ int IsAvailable; ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++QAM_BASE_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Primary base register entry for 8-bit address ++typedef struct ++{ ++ int RegBitName; ++ unsigned char PageNo; ++ unsigned char RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++QAM_PRIMARY_BASE_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Monitor register entry for 8-bit address ++#define QAM_MONITOR_REG_INFO_TABLE_LEN 2 ++typedef struct ++{ ++ int IsAvailable; ++ unsigned char InfoNum; ++ ++ struct ++ { ++ unsigned char SelRegAddr; ++ unsigned char SelValue; ++ int RegBitName; ++ unsigned char Shift; ++ } ++ InfoTable[QAM_MONITOR_REG_INFO_TABLE_LEN]; ++} ++QAM_MONITOR_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Primary monitor register entry for 8-bit address ++typedef struct ++{ ++ int MonitorRegBitName; ++ unsigned char InfoNum; ++ ++ struct ++ { ++ unsigned char SelRegAddr; ++ unsigned char SelValue; ++ int RegBitName; ++ unsigned char Shift; ++ } ++ InfoTable[QAM_MONITOR_REG_INFO_TABLE_LEN]; ++} ++QAM_PRIMARY_MONITOR_REG_ENTRY_ADDR_8BIT; ++ ++ ++ ++// Base register entry for 16-bit address ++typedef struct ++{ ++ int IsAvailable; ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++QAM_BASE_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++// Primary base register entry for 16-bit address ++typedef struct ++{ ++ int RegBitName; ++ unsigned short RegStartAddr; ++ unsigned char Msb; ++ unsigned char Lsb; ++} ++QAM_PRIMARY_BASE_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++// Monitor register entry for 16-bit address ++#define QAM_MONITOR_REG_INFO_TABLE_LEN 2 ++typedef struct ++{ ++ int IsAvailable; ++ unsigned char InfoNum; ++ ++ struct ++ { ++ unsigned short SelRegAddr; ++ unsigned char SelValue; ++ int RegBitName; ++ unsigned char Shift; ++ } ++ InfoTable[QAM_MONITOR_REG_INFO_TABLE_LEN]; ++} ++QAM_MONITOR_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++// Primary monitor register entry for 16-bit address ++typedef struct ++{ ++ int MonitorRegBitName; ++ unsigned char InfoNum; ++ ++ struct ++ { ++ unsigned short SelRegAddr; ++ unsigned char SelValue; ++ int RegBitName; ++ unsigned char Shift; ++ } ++ InfoTable[QAM_MONITOR_REG_INFO_TABLE_LEN]; ++} ++QAM_PRIMARY_MONITOR_REG_ENTRY_ADDR_16BIT; ++ ++ ++ ++ ++ ++// Register bit name definitions ++ ++/// Base register bit name ++enum QAM_REG_BIT_NAME ++{ ++ // Generality ++ QAM_SYS_VERSION, ++ QAM_OPT_I2C_RELAY, ++ QAM_I2CT_EN_CTRL, // for RTL2836B DVB-C only ++ QAM_SOFT_RESET, ++ QAM_SOFT_RESET_FF, ++ ++ // Miscellany ++ QAM_OPT_I2C_DRIVE_CURRENT, ++ QAM_GPIO2_OEN, ++ QAM_GPIO3_OEN, ++ QAM_GPIO2_O, ++ QAM_GPIO3_O, ++ QAM_GPIO2_I, ++ QAM_GPIO3_I, ++ QAM_INNER_DATA_STROBE, ++ QAM_INNER_DATA_SEL1, ++ QAM_INNER_DATA_SEL2, ++ QAM_INNER_DATA1, ++ QAM_INNER_DATA2, ++ ++ // QAM mode ++ QAM_QAM_MODE, ++ ++ // AD ++ QAM_AD_AV, // for RTL2840 only ++ ++ // AAGC ++ QAM_OPT_RF_AAGC_DRIVE_CURRENT, // for RTL2840, RTD2885 QAM only ++ QAM_OPT_IF_AAGC_DRIVE_CURRENT, // for RTL2840, RTD2885 QAM only ++ QAM_AGC_DRIVE_LV, // for RTL2836B DVB-C only ++ QAM_OPT_RF_AAGC_DRIVE, ++ QAM_OPT_IF_AAGC_DRIVE, ++ QAM_OPT_RF_AAGC_OEN, // for RTL2840 only ++ QAM_OPT_IF_AAGC_OEN, // for RTL2840 only ++ QAM_PAR_RF_SD_IB, ++ QAM_PAR_IF_SD_IB, ++ QAM_AAGC_FZ_OPTION, ++ QAM_AAGC_TARGET, ++ QAM_RF_AAGC_MAX, ++ QAM_RF_AAGC_MIN, ++ QAM_IF_AAGC_MAX, ++ QAM_IF_AAGC_MIN, ++ QAM_VTOP, ++ QAM_KRF, // for RTD2885 QAM only ++ QAM_KRF_MSB, ++ QAM_KRF_LSB, ++ QAM_AAGC_MODE_SEL, ++ QAM_AAGC_LD, ++ QAM_OPT_RF_AAGC_OE, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_OPT_IF_AAGC_OE, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_IF_AGC_DRIVING, // for RTL2820 OpenCable only ++ QAM_RF_AGC_DRIVING, // for RTL2820 OpenCable only ++ QAM_AAGC_INIT_LEVEL, ++ ++ // DDC ++ QAM_DDC_FREQ, ++ QAM_SPEC_INV, ++ ++ // Timing recovery ++ QAM_TR_DECI_RATIO, ++ ++ // Carrier recovery ++ QAM_CR_LD, ++ ++ // Equalizer ++ QAM_EQ_LD, ++ QAM_MSE, ++ ++ // Frame sync. indicator ++ QAM_SYNCLOST, // for RTL2840, RTD2885 QAM only ++ QAM_FS_SYNC_STROBE, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_FS_SYNC_LOST, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_OC_MPEG_SYNC_MODE, ++ ++ ++ // BER ++ QAM_BER_RD_STROBE, ++ QAM_BERT_EN, ++ QAM_BERT_HOLD, ++ QAM_DIS_AUTO_MODE, ++ QAM_TEST_VOLUME, ++ QAM_BER_REG0, ++ QAM_BER_REG1, ++ QAM_BER_REG2_15_0, ++ QAM_BER_REG2_18_16, ++ ++ QAM_OC_BER_RD_STROBE, // for RTD2885 QAM only ++ QAM_OC_BERT_EN, // for RTD2885 QAM only ++ QAM_OC_BERT_HOLD, // for RTD2885 QAM only ++ QAM_OC_DIS_AUTO_MODE, // for RTD2885 QAM only ++ QAM_OC_TEST_VOLUME, // for RTD2885 QAM only ++ QAM_OC_BER_REG0, // for RTD2885 QAM only ++ QAM_OC_BER_REG1, // for RTD2885 QAM only ++ QAM_OC_BER_REG2_15_0, // for RTD2885 QAM only ++ QAM_OC_BER_REG2_18_16, // for RTD2885 QAM only ++ ++ QAM_DVBC_BER_RD_STROBE, // for RTD2885 QAM only ++ QAM_DVBC_BERT_EN, // for RTD2885 QAM only ++ QAM_DVBC_BERT_HOLD, // for RTD2885 QAM only ++ QAM_DVBC_DIS_AUTO_MODE, // for RTD2885 QAM only ++ QAM_DVBC_TEST_VOLUME, // for RTD2885 QAM only ++ QAM_DVBC_BER_REG0, // for RTD2885 QAM only ++ QAM_DVBC_BER_REG1, // for RTD2885 QAM only ++ QAM_DVBC_BER_REG2_15_0, // for RTD2885 QAM only ++ QAM_DVBC_BER_REG2_18_16, // for RTD2885 QAM only ++ ++ ++ // MPEG TS output interface ++ QAM_CKOUTPAR, ++ QAM_CKOUT_PWR, ++ QAM_CDIV_PH0, ++ QAM_CDIV_PH1, ++ QAM_MPEG_OUT_EN, // for RTL2840 only ++ QAM_OPT_MPEG_DRIVE_CURRENT, // for RTL2840 only ++ QAM_NO_REINVERT, // for RTL2840 only ++ QAM_FIX_TEI, // for RTL2840 only ++ QAM_SERIAL, // for RTL2840 only ++ QAM_OPT_MPEG_IO, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_OPT_M_OEN, // for RTL2820 OpenCable, RTD2885 QAM only ++ QAM_REPLA_SD_EN, // for RTL2820 OpenCable only ++ QAM_TEI_SD_ERR_EN, // for RTL2820 OpenCable only ++ QAM_TEI_RS_ERR_EN, // for RTL2820 OpenCable only ++ QAM_SET_MPEG_ERR, // for RTL2820 OpenCable only ++ ++ QAM_OC_CKOUTPAR, // for RTD2885 QAM only ++ QAM_OC_CKOUT_PWR, // for RTD2885 QAM only ++ QAM_OC_CDIV_PH0, // for RTD2885 QAM only ++ QAM_OC_CDIV_PH1, // for RTD2885 QAM only ++ QAM_OC_SERIAL, // for RTD2885 QAM only ++ ++ QAM_DVBC_CKOUTPAR, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_CKOUT_PWR, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_CDIV_PH0, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_CDIV_PH1, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_NO_REINVERT, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_FIX_TEI, // for RTD2885 QAM, RTL2836B DVB-C only ++ QAM_DVBC_SERIAL, // for RTD2885 QAM, RTL2836B DVB-C only ++ ++ ++ // Monitor ++ QAM_ADC_CLIP_CNT_REC, ++ QAM_DAGC_LEVEL_26_11, ++ QAM_DAGC_LEVEL_10_0, ++ QAM_RF_AAGC_SD_IN, ++ QAM_IF_AAGC_SD_IN, ++ QAM_KI_TR_OUT_30_15, ++ QAM_KI_TR_OUT_14_0, ++ QAM_KI_CR_OUT_15_0, ++ QAM_KI_CR_OUT_31_16, ++ ++ // Specific register ++ QAM_SPEC_SIGNAL_INDICATOR, ++ QAM_SPEC_ALPHA_STROBE, ++ QAM_SPEC_ALPHA_SEL, ++ QAM_SPEC_ALPHA_VAL, ++ QAM_SPEC_SYMBOL_RATE_REG_0, ++ QAM_SPEC_SYMBOL_RATE_STROBE, ++ QAM_SPEC_SYMBOL_RATE_SEL, ++ QAM_SPEC_SYMBOL_RATE_VAL, ++ QAM_SPEC_REG_0_STROBE, ++ QAM_SPEC_REG_0_SEL, ++ QAM_SPEC_INIT_A0, // for RTL2840 only ++ QAM_SPEC_INIT_A1, // for RTL2840 only ++ QAM_SPEC_INIT_A2, // for RTL2840 only ++ QAM_SPEC_INIT_B0, // for RTL2820 OpenCable only ++ QAM_SPEC_INIT_C1, // for RTL2820 OpenCable only ++ QAM_SPEC_INIT_C2, // for RTL2820 OpenCable only ++ QAM_SPEC_INIT_C3, // for RTL2820 OpenCable only ++ ++ // GPIO ++ QAM_OPT_GPIOA_OE, // for RTL2836B DVB-C only ++ ++ // Pseudo register for test only ++ QAM_TEST_REG_0, ++ QAM_TEST_REG_1, ++ QAM_TEST_REG_2, ++ QAM_TEST_REG_3, ++ ++ ++ // Item terminator ++ QAM_REG_BIT_NAME_ITEM_TERMINATOR, ++}; ++ ++ ++/// Monitor register bit name ++enum QAM_MONITOR_REG_BIT_NAME ++{ ++ // Generality ++ QAM_ADC_CLIP_CNT, ++ QAM_DAGC_VALUE, ++ QAM_RF_AGC_VALUE, ++ QAM_IF_AGC_VALUE, ++ QAM_TR_OFFSET, ++ QAM_CR_OFFSET, ++ ++ // Specific monitor register ++ QAM_SPEC_MONITER_INIT_0, ++ ++ // Item terminator ++ QAM_MONITOR_REG_BIT_NAME_ITEM_TERMINATOR, ++}; ++ ++ ++ ++// Register table length definitions ++#define QAM_BASE_REG_TABLE_LEN_MAX QAM_REG_BIT_NAME_ITEM_TERMINATOR ++#define QAM_MONITOR_REG_TABLE_LEN_MAX QAM_MONITOR_REG_BIT_NAME_ITEM_TERMINATOR ++ ++ ++ ++ ++ ++/// QAM demod module pre-definition ++typedef struct QAM_DEMOD_MODULE_TAG QAM_DEMOD_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register page setting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_SET_REG_PAGE() to set demod register page. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] PageNo Page number ++ ++ ++@retval FUNCTION_SUCCESS Set register page successfully with page number. ++@retval FUNCTION_ERROR Set register page unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_REG_PAGE() with the corresponding function. ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register page with page number 2. ++ pDemod->SetRegPage(pDemod, 2); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_SET_REG_PAGE)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register byte setting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_SET_REG_BYTES() to set demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] pWritingBytes Pointer to writing bytes ++@param [in] ByteNum Writing byte number ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bytes successfully with writing bytes. ++@retval FUNCTION_ERROR Set demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by QAM_DEMOD_FP_SET_REG_PAGE() before using QAM_DEMOD_FP_SET_REG_BYTES(). ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_GET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char WritingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bytes (page 1, address 0x17 ~ 0x1b) with 5 writing bytes. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBytes(pDemod, 0x17, WritingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BYTES)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_SET_REG_BYTES)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register byte getting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_GET_REG_BYTES() to get demod register bytes. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [out] pReadingBytes Pointer to an allocated memory for storing reading bytes ++@param [in] ByteNum Reading byte number ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bytes successfully with reading byte number. ++@retval FUNCTION_ERROR Get demod register bytes unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_REG_BYTES() with the corresponding function. ++ -# Need to set register page by QAM_DEMOD_FP_SET_REG_PAGE() before using QAM_DEMOD_FP_GET_REG_BYTES(). ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_SET_REG_BYTES ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned char ReadingBytes[10]; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bytes (page 1, address 0x17 ~ 0x1b) with reading byte number 5. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBytes(pDemod, 0x17, ReadingBytes, 5); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BYTES)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_GET_REG_BYTES)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register mask bits setting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_SET_REG_MASK_BITS() to set demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register mask bits successfully with writing value. ++@retval FUNCTION_ERROR Set demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by QAM_DEMOD_FP_SET_REG_PAGE() before using QAM_DEMOD_FP_SET_REG_MASK_BITS(). ++ -# The constraints of QAM_DEMOD_FP_SET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_GET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits (page 1, address {0x18, 0x17} [12:5]) with writing value 0x1d. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegMaskBits(pDemod, 0x17, 12, 5, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_SET_REG_MASK_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_SET_REG_MASK_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register mask bits getting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_GET_REG_MASK_BITS() to get demod register mask bits. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegStartAddr Demod register start address ++@param [in] Msb Mask MSB with 0-based index ++@param [in] Lsb Mask LSB with 0-based index ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register mask bits successfully. ++@retval FUNCTION_ERROR Get demod register mask bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_REG_MASK_BITS() with the corresponding function. ++ -# Need to set register page by QAM_DEMOD_FP_SET_REG_PAGE() before using QAM_DEMOD_FP_GET_REG_MASK_BITS(). ++ -# The constraints of QAM_DEMOD_FP_GET_REG_MASK_BITS() function usage are described as follows: ++ -# The mask MSB and LSB must be 0~31. ++ -# The mask MSB must be greater than or equal to LSB. ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_SET_REG_MASK_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits (page 1, address {0x18, 0x17} [12:5]). ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegMaskBits(pDemod, 0x17, 12, 5, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_GET_REG_MASK_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_GET_REG_MASK_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register bits setting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_SET_REG_BITS() to set demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using QAM_DEMOD_FP_SET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_GET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->SetRegBits(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_SET_REG_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register bits getting function pointer ++ ++Demod upper level functions will use QAM_DEMOD_FP_GET_REG_BITS() to get demod register bits with bit name. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_REG_BITS() with the corresponding function. ++ -# Need to set register page before using QAM_DEMOD_FP_GET_REG_BITS(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see QAM_DEMOD_FP_SET_REG_PAGE, QAM_DEMOD_FP_SET_REG_BITS ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegPage(pDemod, 1); ++ pDemod->GetRegBits(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++typedef int ++(*QAM_DEMOD_FP_ADDR_16BIT_GET_REG_BITS)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register bits setting function pointer (with page setting) ++ ++Demod upper level functions will use QAM_DEMOD_FP_SET_REG_BITS_WITH_PAGE() to set demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [in] WritingValue The mask bits writing value ++ ++ ++@retval FUNCTION_SUCCESS Set demod register bits successfully with bit name, page setting, and writing value. ++@retval FUNCTION_ERROR Set demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using QAM_DEMOD_FP_SET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see QAM_DEMOD_FP_GET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Set demod register bits with bit name PSEUDO_REG_BIT_NAME and writing value 0x1d. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->SetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, 0x1d); ++ ++ ++ // Result: ++ // ++ // Writing value = 0x1d = 0001 1101 b ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BITS_WITH_PAGE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod register bits getting function pointer (with page setting) ++ ++Demod upper level functions will use QAM_DEMOD_FP_GET_REG_BITS_WITH_PAGE() to get demod register bits with bit name and ++page setting. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] RegBitName Pre-defined demod register bit name ++@param [out] pReadingValue Pointer to an allocated memory for storing reading value ++ ++ ++@retval FUNCTION_SUCCESS Get demod register bits successfully with bit name and page setting. ++@retval FUNCTION_ERROR Get demod register bits unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_REG_BITS_WITH_PAGE() with the corresponding function. ++ -# Don't need to set register page before using QAM_DEMOD_FP_GET_REG_BITS_WITH_PAGE(). ++ -# Register bit names are pre-defined keys for bit access, and one can find these in demod header file. ++ ++ ++@see QAM_DEMOD_FP_SET_REG_BITS_WITH_PAGE ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE DvbcDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ unsigned long ReadingValue; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &DvbcDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Get demod register bits with bit name PSEUDO_REG_BIT_NAME. ++ // The corresponding information of PSEUDO_REG_BIT_NAME is address {0x18, 0x17} [12:5] on page 1. ++ pDemod->GetRegBitsWithPage(pDemod, PSEUDO_REG_BIT_NAME, &ReadingValue); ++ ++ ++ // Result: ++ // ++ // Page 1 ++ // Register address 0x18 0x17 ++ // Register value xxx0 0011 b 101x xxxx b ++ // ++ // Reading value = 0001 1101 b = 0x1d ++ ++ ... ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BITS_WITH_PAGE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// Demod register access for 8-bit address ++typedef struct ++{ ++ QAM_DEMOD_FP_ADDR_8BIT_SET_REG_PAGE SetRegPage; ++ QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BYTES SetRegBytes; ++ QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BYTES GetRegBytes; ++ QAM_DEMOD_FP_ADDR_8BIT_SET_REG_MASK_BITS SetRegMaskBits; ++ QAM_DEMOD_FP_ADDR_8BIT_GET_REG_MASK_BITS GetRegMaskBits; ++ QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BITS SetRegBits; ++ QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BITS GetRegBits; ++ QAM_DEMOD_FP_ADDR_8BIT_SET_REG_BITS_WITH_PAGE SetRegBitsWithPage; ++ QAM_DEMOD_FP_ADDR_8BIT_GET_REG_BITS_WITH_PAGE GetRegBitsWithPage; ++} ++QAM_DEMOD_REG_ACCESS_ADDR_8BIT; ++ ++ ++ ++ ++ ++// Demod register access for 16-bit address ++typedef struct ++{ ++ QAM_DEMOD_FP_ADDR_16BIT_SET_REG_BYTES SetRegBytes; ++ QAM_DEMOD_FP_ADDR_16BIT_GET_REG_BYTES GetRegBytes; ++ QAM_DEMOD_FP_ADDR_16BIT_SET_REG_MASK_BITS SetRegMaskBits; ++ QAM_DEMOD_FP_ADDR_16BIT_GET_REG_MASK_BITS GetRegMaskBits; ++ QAM_DEMOD_FP_ADDR_16BIT_SET_REG_BITS SetRegBits; ++ QAM_DEMOD_FP_ADDR_16BIT_GET_REG_BITS GetRegBits; ++} ++QAM_DEMOD_REG_ACCESS_ADDR_16BIT; ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod type getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_DEMOD_TYPE() to get QAM demod type. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDemodType Pointer to an allocated memory for storing demod type ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_DEMOD_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*QAM_DEMOD_FP_GET_DEMOD_TYPE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod I2C device address getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_DEVICE_ADDR() to get QAM demod I2C device address. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDeviceAddr Pointer to an allocated memory for storing demod I2C device address ++ ++ ++@retval FUNCTION_SUCCESS Get demod device address successfully. ++@retval FUNCTION_ERROR Get demod device address unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_DEVICE_ADDR() with the corresponding function. ++ ++*/ ++typedef void ++(*QAM_DEMOD_FP_GET_DEVICE_ADDR)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod crystal frequency getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() to get QAM demod crystal frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrystalFreqHz Pointer to an allocated memory for storing demod crystal frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod crystal frequency successfully. ++@retval FUNCTION_ERROR Get demod crystal frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_CRYSTAL_FREQ_HZ() with the corresponding function. ++ ++*/ ++typedef void ++(*QAM_DEMOD_FP_GET_CRYSTAL_FREQ_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod I2C bus connection asking function pointer ++ ++One can use QAM_DEMOD_FP_IS_CONNECTED_TO_I2C() to ask QAM demod if it is connected to I2C bus. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_IS_CONNECTED_TO_I2C() with the corresponding function. ++ ++*/ ++typedef void ++(*QAM_DEMOD_FP_IS_CONNECTED_TO_I2C)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod software resetting function pointer ++ ++One can use QAM_DEMOD_FP_SOFTWARE_RESET() to reset QAM demod by software reset. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod by software reset successfully. ++@retval FUNCTION_ERROR Reset demod by software reset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SOFTWARE_RESET() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SOFTWARE_RESET)( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod initializing function pointer ++ ++One can use QAM_DEMOD_FP_INITIALIZE() to initialie QAM demod. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize demod successfully. ++@retval FUNCTION_ERROR Initialize demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_INITIALIZE)( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod QAM mode setting function pointer ++ ++One can use QAM_DEMOD_FP_SET_QAM_MODE() to set QAM demod QAM mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] QamMode QAM mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod QAM mode successfully. ++@retval FUNCTION_ERROR Set demod QAM mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_QAM_MODE() with the corresponding function. ++ ++ ++@see QAM_QAM_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SET_QAM_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int QamMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod symbol rate setting function pointer ++ ++One can use QAM_DEMOD_FP_SET_SYMBOL_RATE_HZ() to set QAM demod symbol rate in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] SymbolRateHz Symbol rate in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod symbol rate successfully. ++@retval FUNCTION_ERROR Set demod symbol rate unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_SYMBOL_RATE_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SET_SYMBOL_RATE_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long SymbolRateHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod alpha mode setting function pointer ++ ++One can use QAM_DEMOD_FP_SET_ALPHA_MODE() to set QAM demod alpha mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] AlphaMode Alpha mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod alpha mode successfully. ++@retval FUNCTION_ERROR Set demod alpha mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_ALPHA_MODE() with the corresponding function. ++ ++ ++@see QAM_ALPHA_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SET_ALPHA_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int AlphaMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod IF frequency setting function pointer ++ ++One can use QAM_DEMOD_FP_SET_IF_FREQ_HZ() to set QAM demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] IfFreqHz IF frequency in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod IF frequency successfully. ++@retval FUNCTION_ERROR Set demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SET_IF_FREQ_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long IfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod spectrum mode setting function pointer ++ ++One can use QAM_DEMOD_FP_SET_SPECTRUM_MODE() to set QAM demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] SpectrumMode Spectrum mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set demod spectrum mode successfully. ++@retval FUNCTION_ERROR Set demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_SET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_SET_SPECTRUM_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int SpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod QAM mode getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_QAM_MODE() to get QAM demod QAM mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pQamMode Pointer to an allocated memory for storing demod QAM mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod QAM mode successfully. ++@retval FUNCTION_ERROR Get demod QAM mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_QAM_MODE() with the corresponding function. ++ ++ ++@see QAM_QAM_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_QAM_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod symbol rate getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_SYMBOL_RATE_HZ() to get QAM demod symbol rate in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSymbolRateHz Pointer to an allocated memory for storing demod symbol rate in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod symbol rate successfully. ++@retval FUNCTION_ERROR Get demod symbol rate unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_SYMBOL_RATE_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_SYMBOL_RATE_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSymbolRateHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod alpha mode getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_ALPHA_MODE() to get QAM demod alpha mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAlphaMode Pointer to an allocated memory for storing demod alpha mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod alpha mode successfully. ++@retval FUNCTION_ERROR Get demod alpha mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_ALPHA_MODE() with the corresponding function. ++ ++ ++@see QAM_ALPHA_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_ALPHA_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAlphaMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod IF frequency getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_IF_FREQ_HZ() to get QAM demod IF frequency in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfFreqHz Pointer to an allocated memory for storing demod IF frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF frequency successfully. ++@retval FUNCTION_ERROR Get demod IF frequency unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_IF_FREQ_HZ() with the corresponding function. ++ ++ ++@see IF_FREQ_HZ ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_IF_FREQ_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod spectrum mode getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_SPECTRUM_MODE() to get QAM demod spectrum mode. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSpectrumMode Pointer to an allocated memory for storing demod spectrum mode ++ ++ ++@retval FUNCTION_SUCCESS Get demod spectrum mode successfully. ++@retval FUNCTION_ERROR Get demod spectrum mode unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_SPECTRUM_MODE() with the corresponding function. ++ ++ ++@see SPECTRUM_MODE ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_SPECTRUM_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod RF AGC getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_RF_AGC() to get QAM demod RF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pRfAgc Pointer to an allocated memory for storing RF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod RF AGC value successfully. ++@retval FUNCTION_ERROR Get demod RF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_RF_AGC() with the corresponding function. ++ -# The range of RF AGC value is (-pow(2, 10)) ~ (pow(2, 10) - 1). ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_RF_AGC)( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pRfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod IF AGC getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_IF_AGC() to get QAM demod IF AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pIfAgc Pointer to an allocated memory for storing IF AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod IF AGC value successfully. ++@retval FUNCTION_ERROR Get demod IF AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_IF_AGC() with the corresponding function. ++ -# The range of IF AGC value is (-pow(2, 10)) ~ (pow(2, 10) - 1). ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_IF_AGC)( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pIfAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod digital AGC getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_DI_AGC() to get QAM demod digital AGC value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pDiAgc Pointer to an allocated memory for storing digital AGC value ++ ++ ++@retval FUNCTION_SUCCESS Get demod digital AGC value successfully. ++@retval FUNCTION_ERROR Get demod digital AGC value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_DI_AGC() with the corresponding function. ++ -# The range of digital AGC value is 0 ~ (pow(2, 27) - 1). ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_DI_AGC)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pDiAgc ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod TR offset getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get demod TR offset successfully. ++@retval FUNCTION_ERROR Get demod TR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_TR_OFFSET_PPM)( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod CR offset getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get demod CR offset successfully. ++@retval FUNCTION_ERROR Get demod CR offset unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_CR_OFFSET_HZ)( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod AAGC lock asking function pointer ++ ++One can use QAM_DEMOD_FP_IS_AAGC_LOCKED() to ask QAM demod if it is AAGC-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform AAGC lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform AAGC lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_IS_AAGC_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_IS_AAGC_LOCKED)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod EQ lock asking function pointer ++ ++One can use QAM_DEMOD_FP_IS_EQ_LOCKED() to ask QAM demod if it is EQ-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform EQ lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform EQ lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_IS_EQ_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_IS_EQ_LOCKED)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod frame lock asking function pointer ++ ++One can use QAM_DEMOD_FP_IS_FRAME_LOCKED() to ask QAM demod if it is frame-locked. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform frame lock asking to demod successfully. ++@retval FUNCTION_ERROR Perform frame lock asking to demod unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_IS_FRAME_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_IS_FRAME_LOCKED)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod error rate value getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_ERROR_RATE() to get error rate value. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [in] TestVolume Test volume for setting ++@param [in] WaitTimeMsMax Maximum waiting time in ms ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++@param [out] pPerNum Pointer to an allocated memory for storing PER numerator ++@param [out] pPerDen Pointer to an allocated memory for storing PER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod error rate value successfully. ++@retval FUNCTION_ERROR Get demod error rate value unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_ERROR_RATE() with the corresponding function. ++ -# The error test packet number is pow(2, (2 * TestVolume + 4)). ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_ERROR_RATE)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod SNR getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get demod SNR successfully. ++@retval FUNCTION_ERROR Get demod SNR unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_SNR_DB)( ++ QAM_DEMOD_MODULE *pDemod, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod signal strength getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal strength successfully. ++@retval FUNCTION_ERROR Get demod signal strength unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_SIGNAL_STRENGTH)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod signal quality getting function pointer ++ ++One can use QAM_DEMOD_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pDemod The demod module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get demod signal quality successfully. ++@retval FUNCTION_ERROR Get demod signal quality unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_GET_SIGNAL_QUALITY)( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod updating function pointer ++ ++One can use QAM_DEMOD_FP_UPDATE_FUNCTION() to update demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update demod setting successfully. ++@retval FUNCTION_ERROR Update demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE QamDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &QamDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_UPDATE_FUNCTION)( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod reseting function pointer ++ ++One can use QAM_DEMOD_FP_RESET_FUNCTION() to reset demod register setting. ++ ++ ++@param [in] pDemod The demod module pointer ++ ++ ++@retval FUNCTION_SUCCESS Reset demod setting successfully. ++@retval FUNCTION_ERROR Reset demod setting unsuccessfully. ++ ++ ++@note ++ -# Demod building function will set QAM_DEMOD_FP_RESET_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_pseudo.h" ++ ++ ++int main(void) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ QAM_DEMOD_MODULE QamDemodModuleMemory; ++ PSEUDO_EXTRA_MODULE PseudoExtraModuleMemory; ++ ++ ++ // Build pseudo demod module. ++ BuildPseudoDemodModule(&pDemod, &QamDemodModuleMemory, &PseudoExtraModuleMemory); ++ ++ ... ++ ++ // Execute ResetFunction() before demod software reset. ++ pDemod->ResetFunction(pDemod); ++ ++ // Reset demod by software. ++ pDemod->SoftwareReset(pDemod); ++ ++ ... ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pDemod->UpdateFunction(pDemod); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_DEMOD_FP_RESET_FUNCTION)( ++ QAM_DEMOD_MODULE *pDemod ++ ); ++ ++ ++ ++ ++ ++/// RTD2885 QAM extra module ++typedef struct RTD2885_QAM_EXTRA_MODULE_TAG RTD2885_QAM_EXTRA_MODULE; ++ ++// RTD2885 QAM extra manipulaing functions ++typedef void ++(*RTD2885_QAM_FP_GET_CONFIG_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pConfigMode ++ ); ++ ++// RTD2885 QAM extra module ++struct RTD2885_QAM_EXTRA_MODULE_TAG ++{ ++ // Variables ++ int ConfigMode; ++ unsigned char Func1TickNum; ++ ++ // Functions ++ RTD2885_QAM_FP_GET_CONFIG_MODE GetConfigMode; ++}; ++ ++ ++ ++ ++ ++/// RTD2840B QAM extra module ++typedef struct RTD2840B_QAM_EXTRA_MODULE_TAG RTD2840B_QAM_EXTRA_MODULE; ++ ++// RTD2840B QAM extra manipulaing functions ++typedef void ++(*RTD2840B_QAM_FP_GET_CONFIG_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pConfigMode ++ ); ++ ++// RTD2840B QAM extra module ++struct RTD2840B_QAM_EXTRA_MODULE_TAG ++{ ++ // Variables ++ int ConfigMode; ++ unsigned char Func1TickNum; ++ ++ // Functions ++ RTD2840B_QAM_FP_GET_CONFIG_MODE GetConfigMode; ++}; ++ ++ ++ ++ ++ ++/// RTD2932 QAM extra module alias ++typedef struct RTD2932_QAM_EXTRA_MODULE_TAG RTD2932_QAM_EXTRA_MODULE; ++ ++// RTD2932 QAM extra manipulaing functions ++typedef void ++(*RTD2932_QAM_FP_GET_CONFIG_MODE)( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pConfigMode ++ ); ++ ++// RTD2932 QAM extra module ++struct RTD2932_QAM_EXTRA_MODULE_TAG ++{ ++ // Variables ++ int ConfigMode; ++ unsigned char Func1TickNum; ++ ++ // Functions ++ RTD2932_QAM_FP_GET_CONFIG_MODE GetConfigMode; ++}; ++ ++ ++ ++ ++ ++/// RTL2820 OpenCable extra module alias ++typedef struct RTL2820_OC_EXTRA_MODULE_TAG RTL2820_OC_EXTRA_MODULE; ++ ++// RTL2820 OpenCable extra module ++struct RTL2820_OC_EXTRA_MODULE_TAG ++{ ++ // Variables ++ unsigned char Func1TickNum; ++}; ++ ++ ++ ++ ++ ++/// QAM demod module structure ++struct QAM_DEMOD_MODULE_TAG ++{ ++ unsigned long CurrentPageNo; ++ // Private variables ++ int DemodType; ++ unsigned char DeviceAddr; ++ unsigned long CrystalFreqHz; ++ int TsInterfaceMode; ++ ++ int QamMode; ++ unsigned long SymbolRateHz; ++ int AlphaMode; ++ unsigned long IfFreqHz; ++ int SpectrumMode; ++ ++ int IsQamModeSet; ++ int IsSymbolRateHzSet; ++ int IsAlphaModeSet; ++ int IsIfFreqHzSet; ++ int IsSpectrumModeSet; ++ ++ union ///< Demod extra module used by driving module ++ { ++ RTD2885_QAM_EXTRA_MODULE Rtd2885Qam; ++ RTD2840B_QAM_EXTRA_MODULE Rtd2840bQam; ++ RTD2932_QAM_EXTRA_MODULE Rtd2932Qam; ++ RTL2820_OC_EXTRA_MODULE Rtl2820Oc; ++ } ++ Extra; ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ ++ // Register tables ++ union ++ { ++ QAM_BASE_REG_ENTRY_ADDR_8BIT Addr8Bit[QAM_BASE_REG_TABLE_LEN_MAX]; ++ QAM_BASE_REG_ENTRY_ADDR_16BIT Addr16Bit[QAM_BASE_REG_TABLE_LEN_MAX]; ++ } ++ BaseRegTable; ++ ++ union ++ { ++ QAM_MONITOR_REG_ENTRY_ADDR_8BIT Addr8Bit[QAM_MONITOR_REG_TABLE_LEN_MAX]; ++ QAM_MONITOR_REG_ENTRY_ADDR_16BIT Addr16Bit[QAM_MONITOR_REG_TABLE_LEN_MAX]; ++ } ++ MonitorRegTable; ++ ++ ++ // Demod I2C function pointers ++ union ++ { ++ QAM_DEMOD_REG_ACCESS_ADDR_8BIT Addr8Bit; ++ QAM_DEMOD_REG_ACCESS_ADDR_16BIT Addr16Bit; ++ } ++ RegAccess; ++ ++ ++ // Demod manipulating function pointers ++ QAM_DEMOD_FP_GET_DEMOD_TYPE GetDemodType; ++ QAM_DEMOD_FP_GET_DEVICE_ADDR GetDeviceAddr; ++ QAM_DEMOD_FP_GET_CRYSTAL_FREQ_HZ GetCrystalFreqHz; ++ ++ QAM_DEMOD_FP_IS_CONNECTED_TO_I2C IsConnectedToI2c; ++ QAM_DEMOD_FP_SOFTWARE_RESET SoftwareReset; ++ ++ QAM_DEMOD_FP_INITIALIZE Initialize; ++ QAM_DEMOD_FP_SET_QAM_MODE SetQamMode; ++ QAM_DEMOD_FP_SET_SYMBOL_RATE_HZ SetSymbolRateHz; ++ QAM_DEMOD_FP_SET_ALPHA_MODE SetAlphaMode; ++ QAM_DEMOD_FP_SET_IF_FREQ_HZ SetIfFreqHz; ++ QAM_DEMOD_FP_SET_SPECTRUM_MODE SetSpectrumMode; ++ QAM_DEMOD_FP_GET_QAM_MODE GetQamMode; ++ QAM_DEMOD_FP_GET_SYMBOL_RATE_HZ GetSymbolRateHz; ++ QAM_DEMOD_FP_GET_ALPHA_MODE GetAlphaMode; ++ QAM_DEMOD_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++ QAM_DEMOD_FP_GET_SPECTRUM_MODE GetSpectrumMode; ++ ++ QAM_DEMOD_FP_GET_RF_AGC GetRfAgc; ++ QAM_DEMOD_FP_GET_IF_AGC GetIfAgc; ++ QAM_DEMOD_FP_GET_DI_AGC GetDiAgc; ++ QAM_DEMOD_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ QAM_DEMOD_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ ++ QAM_DEMOD_FP_IS_AAGC_LOCKED IsAagcLocked; ++ QAM_DEMOD_FP_IS_EQ_LOCKED IsEqLocked; ++ QAM_DEMOD_FP_IS_FRAME_LOCKED IsFrameLocked; ++ ++ QAM_DEMOD_FP_GET_ERROR_RATE GetErrorRate; ++ QAM_DEMOD_FP_GET_SNR_DB GetSnrDb; ++ ++ QAM_DEMOD_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ QAM_DEMOD_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ ++ QAM_DEMOD_FP_UPDATE_FUNCTION UpdateFunction; ++ QAM_DEMOD_FP_RESET_FUNCTION ResetFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// QAM demod default I2C functions for 8-bit address ++int ++qam_demod_addr_8bit_default_SetRegPage( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long PageNo ++ ); ++ ++int ++qam_demod_addr_8bit_default_SetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++qam_demod_addr_8bit_default_GetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++qam_demod_addr_8bit_default_SetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++int ++qam_demod_addr_8bit_default_GetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++int ++qam_demod_addr_8bit_default_SetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++qam_demod_addr_8bit_default_GetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++int ++qam_demod_addr_8bit_default_SetRegBitsWithPage( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++qam_demod_addr_8bit_default_GetRegBitsWithPage( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// QAM demod default I2C functions for 16-bit address ++int ++qam_demod_addr_16bit_default_SetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++qam_demod_addr_16bit_default_GetRegBytes( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ); ++ ++int ++qam_demod_addr_16bit_default_SetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned long WritingValue ++ ); ++ ++int ++qam_demod_addr_16bit_default_GetRegMaskBits( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned short RegStartAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned long *pReadingValue ++ ); ++ ++int ++qam_demod_addr_16bit_default_SetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ const unsigned long WritingValue ++ ); ++ ++int ++qam_demod_addr_16bit_default_GetRegBits( ++ QAM_DEMOD_MODULE *pDemod, ++ int RegBitName, ++ unsigned long *pReadingValue ++ ); ++ ++ ++ ++ ++ ++// QAM demod default manipulating functions ++void ++qam_demod_default_GetDemodType( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pDemodType ++ ); ++ ++void ++qam_demod_default_GetDeviceAddr( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned char *pDeviceAddr ++ ); ++ ++void ++qam_demod_default_GetCrystalFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pCrystalFreqHz ++ ); ++ ++int ++qam_demod_default_GetQamMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pQamMode ++ ); ++ ++int ++qam_demod_default_GetSymbolRateHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pSymbolRateHz ++ ); ++ ++int ++qam_demod_default_GetAlphaMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pAlphaMode ++ ); ++ ++int ++qam_demod_default_GetIfFreqHz( ++ QAM_DEMOD_MODULE *pDemod, ++ unsigned long *pIfFreqHz ++ ); ++ ++int ++qam_demod_default_GetSpectrumMode( ++ QAM_DEMOD_MODULE *pDemod, ++ int *pSpectrumMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/qam_nim_base.c b/drivers/media/dvb/dvb-usb/qam_nim_base.c +new file mode 100644 +index 0000000..726eab4 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/qam_nim_base.c +@@ -0,0 +1,496 @@ ++/** ++ ++@file ++ ++@brief QAM NIM base module definition ++ ++QAM NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++*/ ++ ++ ++#include "qam_nim_base.h" ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_NIM_TYPE ++ ++*/ ++void ++qam_nim_default_GetNimType( ++ QAM_NIM_MODULE *pNim, ++ int *pNimType ++ ) ++{ ++ // Get NIM type from NIM module. ++ *pNimType = pNim->NimType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_SET_PARAMETERS ++ ++*/ ++int ++qam_nim_default_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Set tuner RF frequency in Hz. ++ if(pTuner->SetRfFreqHz(pTuner, RfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod QAM mode. ++ if(pDemod->SetQamMode(pDemod, QamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod symbol rate in Hz. ++ if(pDemod->SetSymbolRateHz(pDemod, SymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set demod alpha mode. ++ if(pDemod->SetAlphaMode(pDemod, AlphaMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod particular registers. ++ if(pDemod->ResetFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Reset demod by software reset. ++ if(pDemod->SoftwareReset(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_PARAMETERS ++ ++*/ ++int ++qam_nim_default_GetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pQamMode, ++ unsigned long *pSymbolRateHz, ++ int *pAlphaMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get tuner module and demod module. ++ pTuner = pNim->pTuner; ++ pDemod = pNim->pDemod; ++ ++ ++ // Get tuner RF frequency in Hz. ++ if(pTuner->GetRfFreqHz(pTuner, pRfFreqHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get demod QAM mode. ++ if(pDemod->GetQamMode(pDemod, pQamMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get demod symbol rate in Hz. ++ if(pDemod->GetSymbolRateHz(pDemod, pSymbolRateHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Get demod alpha mode. ++ if(pDemod->GetAlphaMode(pDemod, pAlphaMode) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_IS_SIGNAL_PRESENT ++ ++*/ ++int ++qam_nim_default_IsSignalPresent( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ QAM_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait maximum 1000 ms for signal present check. ++ for(i = 0; i < DEFAULT_QAM_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check signal present status on demod. ++ // Note: If frame is locked, stop signal present check. ++ if(pDemod->IsFrameLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_IS_SIGNAL_LOCKED ++ ++*/ ++int ++qam_nim_default_IsSignalLocked( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ QAM_DEMOD_MODULE *pDemod; ++ int i; ++ ++ ++ // Get base interface and demod module. ++ pBaseInterface = pNim->pBaseInterface; ++ pDemod = pNim->pDemod; ++ ++ ++ // Wait maximum 1000 ms for signal lock check. ++ for(i = 0; i < DEFAULT_QAM_NIM_SINGAL_LOCK_CHECK_TIMES_MAX; i++) ++ { ++ // Wait 20 ms. ++ pBaseInterface->WaitMs(pBaseInterface, 20); ++ ++ // Check frame lock status on demod. ++ // Note: If frame is locked, stop signal lock check. ++ if(pDemod->IsFrameLocked(pDemod, pAnswer) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(*pAnswer == YES) ++ break; ++ } ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_SIGNAL_STRENGTH ++ ++*/ ++int ++qam_nim_default_GetSignalStrength( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal strength from demod. ++ if(pDemod->GetSignalStrength(pDemod, pSignalStrength) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_SIGNAL_QUALITY ++ ++*/ ++int ++qam_nim_default_GetSignalQuality( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get signal quality from demod. ++ if(pDemod->GetSignalQuality(pDemod, pSignalQuality) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_ERROR_RATE ++ ++*/ ++int ++qam_nim_default_GetErrorRate( ++ QAM_NIM_MODULE *pNim, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get error rate from demod. ++ if(pDemod->GetErrorRate(pDemod, TestVolume, WaitTimeMsMax, pBerNum, pBerDen, pPerNum, pPerDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_SNR_DB ++ ++*/ ++int ++qam_nim_default_GetSnrDb( ++ QAM_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get SNR in dB from demod. ++ if(pDemod->GetSnrDb(pDemod, pSnrDbNum, pSnrDbDen) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_TR_OFFSET_PPM ++ ++*/ ++int ++qam_nim_default_GetTrOffsetPpm( ++ QAM_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get TR offset in ppm from demod. ++ if(pDemod->GetTrOffsetPpm(pDemod, pTrOffsetPpm) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_GET_CR_OFFSET_HZ ++ ++*/ ++int ++qam_nim_default_GetCrOffsetHz( ++ QAM_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Get CR offset in Hz from demod. ++ if(pDemod->GetCrOffsetHz(pDemod, pCrOffsetHz) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see QAM_NIM_FP_UPDATE_FUNCTION ++ ++*/ ++int ++qam_nim_default_UpdateFunction( ++ QAM_NIM_MODULE *pNim ++ ) ++{ ++ QAM_DEMOD_MODULE *pDemod; ++ ++ ++ // Get demod module. ++ pDemod = pNim->pDemod; ++ ++ ++ // Update demod particular registers. ++ if(pDemod->UpdateFunction(pDemod) != FUNCTION_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/qam_nim_base.h b/drivers/media/dvb/dvb-usb/qam_nim_base.h +new file mode 100644 +index 0000000..abeea77 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/qam_nim_base.h +@@ -0,0 +1,864 @@ ++#ifndef __QAM_NIM_BASE_H ++#define __QAM_NIM_BASE_H ++ ++/** ++ ++@file ++ ++@brief QAM NIM base module definition ++ ++QAM NIM base module definitions contains NIM module structure, NIM funciton pointers, NIM definitions, and NIM default ++functions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ QAM_NIM_MODULE *pNim; ++ QAM_NIM_MODULE QamNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ unsigned long RfFreqHz; ++ int QamMode; ++ unsigned long SymbolRateHz; ++ int AlphaMode; ++ ++ int Answer; ++ unsigned long SignalStrength, SignalQuality; ++ unsigned long BerNum, BerDen, PerNum, PerDen; ++ double Ber, Per; ++ unsigned long SnrDbNum, SnrDbDen; ++ double SnrDb; ++ long TrOffsetPpm, CrOffsetHz; ++ ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ &pNim, ++ &QamNimModuleMemory, ++ ++ 9, // Maximum I2C reading byte number is 9. ++ 8, // Maximum I2C writing byte number is 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs, // Employ CustomWaitMs() as basic waiting function. ++ ++ &DemodxExtraModuleMemory, // Employ Demod-X extra module. ++ 0x44, // The Demod-X I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The Demod-X crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The Demod-X TS interface mode is serial. ++ ... // Other arguments for Demod-X ++ ++ &TunerxExtraModuleMemory, // Employ Tuner-Y extra module. ++ 0xc0, // The Tuner-Y I2C device address is 0xc0 in 8-bit format. ++ ... // Other arguments for Tuner-Y ++ ); ++ ++ ++ ++ // Get NIM type. ++ // Note: NIM types are defined in the MODULE_TYPE enumeration. ++ pNim->GetNimType(pNim, &NimType); ++ ++ ++ ++ ++ ++ ++ ++ // ==== Initialize NIM and set its parameters ===== ++ ++ // Initialize NIM. ++ pNim->Initialize(pNim); ++ ++ // Set NIM parameters. (RF frequency, QAM mode, symbol rate, alpha mode) ++ // Note: In the example: ++ // 1. RF frequency is 738 MHz. ++ // 2. QAM is 64. ++ // 3. Symbol rate is 6.952 MHz. ++ // 4. Alpha is 0.15. ++ RfFreqHz = 738000000; ++ QamMode = QAM_QAM_64; ++ SymbolRateHz = 6952000; ++ AlphaMode = QAM_ALPHA_0P15; ++ pNim->SetParameters(pNim, RfFreqHz, QamMode, SymbolRateHz, AlphaMode); ++ ++ ++ ++ // Wait 1 second for demod convergence. ++ ++ ++ ++ ++ ++ // ==== Get NIM information ===== ++ ++ // Get NIM parameters. (RF frequency, QAM mode, symbol rate, alpha mode) ++ pNim->GetParameters(pNim, &RfFreqHz, &QamMode, &SymbolRateHz, &AlphaMode); ++ ++ ++ // Get signal present status. ++ // Note: 1. The argument Answer is YES when the NIM module has found QAM signal in the RF channel. ++ // 2. The argument Answer is NO when the NIM module does not find QAM signal in the RF channel. ++ // Recommendation: Use the IsSignalPresent() function for channel scan. ++ pNim->IsSignalPresent(pNim, &Answer); ++ ++ // Get signal lock status. ++ // Note: 1. The argument Answer is YES when the NIM module has locked QAM signal in the RF channel. ++ // At the same time, the NIM module sends TS packets through TS interface hardware pins. ++ // 2. The argument Answer is NO when the NIM module does not lock QAM signal in the RF channel. ++ // Recommendation: Use the IsSignalLocked() function for signal lock check. ++ pNim->IsSignalLocked(pNim, &Answer); ++ ++ ++ // Get signal strength. ++ // Note: 1. The range of SignalStrength is 0~100. ++ // 2. Need to map SignalStrength value to UI signal strength bar manually. ++ pNim->GetSignalStrength(pNim, &SignalStrength); ++ ++ // Get signal quality. ++ // Note: 1. The range of SignalQuality is 0~100. ++ // 2. Need to map SignalQuality value to UI signal quality bar manually. ++ pNim->GetSignalQuality(pNim, &SignalQuality); ++ ++ ++ // Get BER and PER. ++ // Note: Test packet number = pow(2, (2 * 4 + 4)) = 4096 ++ // Maximum wait time = 1000 ms = 1 second ++ pNim->GetErrorRate(pNim, 4, 1000, &BerNum, &BerDen, &PerNum, &PerDen); ++ Ber = (double)BerNum / (double)BerDen; ++ Per = (double)PerNum / (double)PerDen; ++ ++ // Get SNR in dB. ++ pNim->GetSnrDb(pNim, &SnrDbNum, &SnrDbDen); ++ SnrDb = (double)SnrDbNum / (double)SnrDbDen; ++ ++ ++ // Get TR offset (symbol timing offset) in ppm. ++ pNim->GetTrOffsetPpm(pNim, &TrOffsetPpm); ++ ++ // Get CR offset (RF frequency offset) in Hz. ++ pNim->GetCrOffsetHz(pNim, &CrOffsetHz); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++#include "tuner_base.h" ++#include "qam_demod_base.h" ++ ++ ++ ++ ++ ++// Definitions ++#define DEFAULT_QAM_NIM_SINGAL_PRESENT_CHECK_TIMES_MAX 1 ++#define DEFAULT_QAM_NIM_SINGAL_LOCK_CHECK_TIMES_MAX 1 ++ ++ ++ ++ ++ ++/// QAM NIM module pre-definition ++typedef struct QAM_NIM_MODULE_TAG QAM_NIM_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM demod type getting function pointer ++ ++One can use QAM_NIM_FP_GET_NIM_TYPE() to get QAM NIM type. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pNimType Pointer to an allocated memory for storing NIM type ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_NIM_TYPE() with the corresponding function. ++ ++ ++@see MODULE_TYPE ++ ++*/ ++typedef void ++(*QAM_NIM_FP_GET_NIM_TYPE)( ++ QAM_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM initializing function pointer ++ ++One can use QAM_NIM_FP_INITIALIZE() to initialie QAM NIM. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize NIM successfully. ++@retval FUNCTION_ERROR Initialize NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_INITIALIZE)( ++ QAM_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM parameter setting function pointer ++ ++One can use QAM_NIM_FP_SET_PARAMETERS() to set QAM NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [in] RfFreqHz RF frequency in Hz for setting ++@param [in] QamMode QAM mode for setting ++@param [in] SymbolRateHz Symbol rate in Hz for setting ++@param [in] AlphaMode Alpha mode for setting ++ ++ ++@retval FUNCTION_SUCCESS Set NIM parameters successfully. ++@retval FUNCTION_ERROR Set NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_SET_PARAMETERS() with the corresponding function. ++ ++ ++@see QAM_QAM_MODE, QAM_ALPHA_MODE ++ ++*/ ++typedef int ++(*QAM_NIM_FP_SET_PARAMETERS)( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM parameter getting function pointer ++ ++One can use QAM_NIM_FP_GET_PARAMETERS() to get QAM NIM parameters. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pRfFreqHz Pointer to an allocated memory for storing NIM RF frequency in Hz ++@param [out] pQamMode Pointer to an allocated memory for storing NIM QAM mode ++@param [out] pSymbolRateHz Pointer to an allocated memory for storing NIM symbol rate in Hz ++@param [out] pAlphaMode Pointer to an allocated memory for storing NIM alpha mode ++ ++ ++@retval FUNCTION_SUCCESS Get NIM parameters successfully. ++@retval FUNCTION_ERROR Get NIM parameters unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_PARAMETERS() with the corresponding function. ++ ++ ++@see QAM_QAM_MODE, QAM_ALPHA_MODE ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_PARAMETERS)( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pQamMode, ++ unsigned long *pSymbolRateHz, ++ int *pAlphaMode ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM signal present asking function pointer ++ ++One can use QAM_NIM_FP_IS_SIGNAL_PRESENT() to ask QAM NIM if signal is present. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal present asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal present asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_IS_SIGNAL_PRESENT() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_IS_SIGNAL_PRESENT)( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM signal lock asking function pointer ++ ++One can use QAM_NIM_FP_IS_SIGNAL_LOCKED() to ask QAM NIM if signal is locked. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pAnswer Pointer to an allocated memory for storing answer ++ ++ ++@retval FUNCTION_SUCCESS Perform signal lock asking to NIM successfully. ++@retval FUNCTION_ERROR Perform signal lock asking to NIM unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_IS_SIGNAL_LOCKED() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_IS_SIGNAL_LOCKED)( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM signal strength getting function pointer ++ ++One can use QAM_NIM_FP_GET_SIGNAL_STRENGTH() to get signal strength. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalStrength Pointer to an allocated memory for storing signal strength (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal strength successfully. ++@retval FUNCTION_ERROR Get NIM signal strength unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_SIGNAL_STRENGTH() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_SIGNAL_STRENGTH)( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM signal quality getting function pointer ++ ++One can use QAM_NIM_FP_GET_SIGNAL_QUALITY() to get signal quality. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSignalQuality Pointer to an allocated memory for storing signal quality (value = 0 ~ 100) ++ ++ ++@retval FUNCTION_SUCCESS Get NIM signal quality successfully. ++@retval FUNCTION_ERROR Get NIM signal quality unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_SIGNAL_QUALITY() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_SIGNAL_QUALITY)( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM error rate value getting function pointer ++ ++One can use QAM_NIM_FP_GET_ERROR_RATE() to get error rate value. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [in] TestVolume Test volume for setting ++@param [in] WaitTimeMsMax Maximum waiting time in ms ++@param [out] pBerNum Pointer to an allocated memory for storing BER numerator ++@param [out] pBerDen Pointer to an allocated memory for storing BER denominator ++@param [out] pPerNum Pointer to an allocated memory for storing PER numerator ++@param [out] pPerDen Pointer to an allocated memory for storing PER denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM error rate value successfully. ++@retval FUNCTION_ERROR Get NIM error rate value unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_ERROR_RATE() with the corresponding function. ++ -# The error test packet number is pow(2, (2 * TestVolume + 4)). ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_ERROR_RATE)( ++ QAM_NIM_MODULE *pNim, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM SNR getting function pointer ++ ++One can use QAM_NIM_FP_GET_SNR_DB() to get SNR in dB. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pSnrDbNum Pointer to an allocated memory for storing SNR dB numerator ++@param [out] pSnrDbDen Pointer to an allocated memory for storing SNR dB denominator ++ ++ ++@retval FUNCTION_SUCCESS Get NIM SNR successfully. ++@retval FUNCTION_ERROR Get NIM SNR unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_SNR_DB() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_SNR_DB)( ++ QAM_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM TR offset getting function pointer ++ ++One can use QAM_NIM_FP_GET_TR_OFFSET_PPM() to get TR offset in ppm. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pTrOffsetPpm Pointer to an allocated memory for storing TR offset in ppm ++ ++ ++@retval FUNCTION_SUCCESS Get NIM TR offset successfully. ++@retval FUNCTION_ERROR Get NIM TR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_TR_OFFSET_PPM() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_TR_OFFSET_PPM)( ++ QAM_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM CR offset getting function pointer ++ ++One can use QAM_NIM_FP_GET_CR_OFFSET_HZ() to get CR offset in Hz. ++ ++ ++@param [in] pNim The NIM module pointer ++@param [out] pCrOffsetHz Pointer to an allocated memory for storing CR offset in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get NIM CR offset successfully. ++@retval FUNCTION_ERROR Get NIM CR offset unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_GET_CR_OFFSET_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*QAM_NIM_FP_GET_CR_OFFSET_HZ)( ++ QAM_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief QAM NIM updating function pointer ++ ++One can use QAM_NIM_FP_UPDATE_FUNCTION() to update NIM register setting. ++ ++ ++@param [in] pNim The NIM module pointer ++ ++ ++@retval FUNCTION_SUCCESS Update NIM setting successfully. ++@retval FUNCTION_ERROR Update NIM setting unsuccessfully. ++ ++ ++@note ++ -# NIM building function will set QAM_NIM_FP_UPDATE_FUNCTION() with the corresponding function. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "nim_demodx_tunery.h" ++ ++ ++int main(void) ++{ ++ QAM_NIM_MODULE *pNim; ++ QAM_NIM_MODULE QamNimModuleMemory; ++ DEMODX_EXTRA_MODULE DemodxExtraModuleMemory; ++ TUNERY_EXTRA_MODULE TuneryExtraModuleMemory; ++ ++ ++ // Build Demod-X Tuner-Y NIM module. ++ BuildDemodxTuneryModule( ++ ... ++ ); ++ ++ ... ++ ++ ++ return 0; ++} ++ ++ ++void PeriodicallyExecutingFunction ++{ ++ // Executing UpdateFunction() periodically. ++ pNim->UpdateFunction(pNim); ++} ++ ++ ++@endcode ++ ++*/ ++typedef int ++(*QAM_NIM_FP_UPDATE_FUNCTION)( ++ QAM_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++// RTL2840 MT2062 extra module ++typedef struct RTL2840_MT2062_EXTRA_MODULE_TAG RTL2840_MT2062_EXTRA_MODULE; ++struct RTL2840_MT2062_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long IfFreqHz; ++}; ++ ++ ++ ++ ++ ++// RTL2840 MT2063 extra module ++typedef struct RTL2840_MT2063_EXTRA_MODULE_TAG RTL2840_MT2063_EXTRA_MODULE; ++struct RTL2840_MT2063_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long IfFreqHz; ++}; ++ ++ ++ ++ ++ ++// RTD2840B QAM MT2062 extra module ++typedef struct RTD2840B_QAM_MT2062_EXTRA_MODULE_TAG RTD2840B_QAM_MT2062_EXTRA_MODULE; ++struct RTD2840B_QAM_MT2062_EXTRA_MODULE_TAG ++{ ++ // Extra variables ++ unsigned long IfFreqHz; ++}; ++ ++ ++ ++ ++ ++/// QAM NIM module structure ++struct QAM_NIM_MODULE_TAG ++{ ++ // Private variables ++ int NimType; ++ int EnhancementMode; ++ int ConfigMode; ++ ++ union ///< NIM extra module used by driving module ++ { ++ RTL2840_MT2062_EXTRA_MODULE Rtl2840Mt2062; ++ RTL2840_MT2063_EXTRA_MODULE Rtl2840Mt2063; ++ RTD2840B_QAM_MT2062_EXTRA_MODULE Rtd2840bQamMt2062; ++ } ++ Extra; ++ ++ ++ // Modules ++ BASE_INTERFACE_MODULE *pBaseInterface; ///< Base interface module pointer ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ///< Base interface module memory ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ///< I2C bridge module pointer ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ///< I2C bridge module memory ++ ++ TUNER_MODULE *pTuner; ///< Tuner module pointer ++ TUNER_MODULE TunerModuleMemory; ///< Tuner module memory ++ ++ QAM_DEMOD_MODULE *pDemod; ///< QAM demod module pointer ++ QAM_DEMOD_MODULE QamDemodModuleMemory; ///< QAM demod module memory ++ ++ ++ // NIM manipulating functions ++ QAM_NIM_FP_GET_NIM_TYPE GetNimType; ++ QAM_NIM_FP_INITIALIZE Initialize; ++ QAM_NIM_FP_SET_PARAMETERS SetParameters; ++ QAM_NIM_FP_GET_PARAMETERS GetParameters; ++ QAM_NIM_FP_IS_SIGNAL_PRESENT IsSignalPresent; ++ QAM_NIM_FP_IS_SIGNAL_LOCKED IsSignalLocked; ++ QAM_NIM_FP_GET_SIGNAL_STRENGTH GetSignalStrength; ++ QAM_NIM_FP_GET_SIGNAL_QUALITY GetSignalQuality; ++ QAM_NIM_FP_GET_ERROR_RATE GetErrorRate; ++ QAM_NIM_FP_GET_SNR_DB GetSnrDb; ++ QAM_NIM_FP_GET_TR_OFFSET_PPM GetTrOffsetPpm; ++ QAM_NIM_FP_GET_CR_OFFSET_HZ GetCrOffsetHz; ++ QAM_NIM_FP_UPDATE_FUNCTION UpdateFunction; ++}; ++ ++ ++ ++ ++ ++ ++ ++// QAM NIM default manipulaing functions ++void ++qam_nim_default_GetNimType( ++ QAM_NIM_MODULE *pNim, ++ int *pNimType ++ ); ++ ++int ++qam_nim_default_SetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long RfFreqHz, ++ int QamMode, ++ unsigned long SymbolRateHz, ++ int AlphaMode ++ ); ++ ++int ++qam_nim_default_GetParameters( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pRfFreqHz, ++ int *pQamMode, ++ unsigned long *pSymbolRateHz, ++ int *pAlphaMode ++ ); ++ ++int ++qam_nim_default_IsSignalPresent( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++qam_nim_default_IsSignalLocked( ++ QAM_NIM_MODULE *pNim, ++ int *pAnswer ++ ); ++ ++int ++qam_nim_default_GetSignalStrength( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalStrength ++ ); ++ ++int ++qam_nim_default_GetSignalQuality( ++ QAM_NIM_MODULE *pNim, ++ unsigned long *pSignalQuality ++ ); ++ ++int ++qam_nim_default_GetErrorRate( ++ QAM_NIM_MODULE *pNim, ++ unsigned long TestVolume, ++ unsigned int WaitTimeMsMax, ++ unsigned long *pBerNum, ++ unsigned long *pBerDen, ++ unsigned long *pPerNum, ++ unsigned long *pPerDen ++ ); ++ ++int ++qam_nim_default_GetSnrDb( ++ QAM_NIM_MODULE *pNim, ++ long *pSnrDbNum, ++ long *pSnrDbDen ++ ); ++ ++int ++qam_nim_default_GetTrOffsetPpm( ++ QAM_NIM_MODULE *pNim, ++ long *pTrOffsetPpm ++ ); ++ ++int ++qam_nim_default_GetCrOffsetHz( ++ QAM_NIM_MODULE *pNim, ++ long *pCrOffsetHz ++ ); ++ ++int ++qam_nim_default_UpdateFunction( ++ QAM_NIM_MODULE *pNim ++ ); ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u.c b/drivers/media/dvb/dvb-usb/rtl2832u.c +new file mode 100644 +index 0000000..9d09727 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u.c +@@ -0,0 +1,1825 @@ ++ ++#include ++#include ++ ++#include "rtl2832u.h" ++#include "rtl2832u_io.h" ++#include "rtl2832u_ioctl.h" ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 196608)) ++#define V4L2_REFACTORED_MFE_CODE ++#endif ++ ++/* FIXME: I do not know the exact V4L2_VERSION that introduced the refactored rc_map_table struct */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 196608)) ++#define V4L2_REFACTORED_RC_CODE ++#endif ++ ++int dvb_usb_rtl2832u_debug=0; ++module_param_named(debug,dvb_usb_rtl2832u_debug, int, 0644); ++MODULE_PARM_DESC(debug, "Set debugging level (0=disable, 1=info, 2=xfer, 4=rc (or-able)), default=0"); ++ ++int demod_default_type=0; ++module_param_named(demod, demod_default_type, int, 0644); ++MODULE_PARM_DESC(demod, "Set default demod type (0=dvb-t, 1=dtmb, 2=dvb-c), default=0"); ++ ++int dtmb_error_packet_discard=0; ++module_param_named(dtmb_err_discard, dtmb_error_packet_discard, int, 0644); ++MODULE_PARM_DESC(dtmb_err_discard, "Set error packet discard type (0=not discard, 1=discard), default=0"); ++ ++int dvb_use_rtl2832u_rc_mode=3; ++module_param_named(rtl2832u_rc_mode, dvb_use_rtl2832u_rc_mode, int, 0644); ++MODULE_PARM_DESC(rtl2832u_rc_mode, "Set default rtl2832u_rc_mode (0=rc6, 1=rc5, 2=nec, 3=disable rc), default=3"); ++ ++int dvb_use_rtl2832u_card_type=0; ++module_param_named(rtl2832u_card_type, dvb_use_rtl2832u_card_type, int, 0644); ++MODULE_PARM_DESC(rtl2832u_card_type, "Set default rtl2832u_card_type type (0=dongle, 1=mini card), default=0"); ++ ++int dvb_usb_rtl2832u_snrdb=0; ++module_param_named(snrdb,dvb_usb_rtl2832u_snrdb, int, 0644); ++MODULE_PARM_DESC(snrdb, "SNR type output (0=16bit, 1=dB decibel), default=0"); ++ ++ ++ ++ ++//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) ++DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); ++//#endif ++ ++////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ++ ++#define RT_RC_POLLING_INTERVAL_TIME_MS 287 ++#define MAX_RC_PROTOCOL_NUM 3 ++ ++/* original realtek remote control key map */ ++/* ++static struct rc_map_table rtl2832u_rc_keys_map_table[] = { ++ { 0x0400, KEY_0 }, // 0 ++ { 0x0401, KEY_1 }, // 1 ++ { 0x0402, KEY_2 }, // 2 ++ { 0x0403, KEY_3 }, // 3 ++ { 0x0404, KEY_4 }, // 4 ++ { 0x0405, KEY_5 }, // 5 ++ { 0x0406, KEY_6 }, // 6 ++ { 0x0407, KEY_7 }, // 7 ++ { 0x0408, KEY_8 }, // 8 ++ { 0x0409, KEY_9 }, // 9 ++ { 0x040c, KEY_POWER }, // POWER ++ { 0x040e, KEY_MUTE }, // MUTE ++ { 0x0410, KEY_VOLUMEUP }, // VOL UP ++ { 0x0411, KEY_VOLUMEDOWN }, // VOL DOWN ++ { 0x0412, KEY_CHANNELUP }, // CH UP ++ { 0x0413, KEY_CHANNELDOWN }, // CH DOWN ++ { 0x0416, KEY_PLAY }, // PLAY ++ { 0x0417, KEY_RECORD }, // RECORD ++ { 0x0418, KEY_PLAYPAUSE }, // PAUSE ++ { 0x0419, KEY_STOP }, // STOP ++ { 0x041e, KEY_UP}, // UP ++ { 0x041f, KEY_DOWN}, // DOWN ++ { 0x0420, KEY_LEFT }, // LEFT ++ { 0x0421, KEY_RIGHT }, // RIGHT ++ { 0x0422, KEY_ZOOM }, // FULL SCREEN -->OK ++ { 0x0447, KEY_AUDIO }, // MY AUDIO ++ { 0x045b, KEY_MENU}, // RED ++ { 0x045c, KEY_EPG }, // GREEN ++ { 0x045d, KEY_FIRST }, // YELLOW ++ { 0x045e, KEY_LAST }, // BLUE ++ { 0x045a, KEY_TEXT }, // TEXT TV ++ { 0x0423, KEY_BACK }, // <- BACK ++ { 0x0414, KEY_FORWARD } // >> ++ }; ++*/ ++ ++/* Xgazza remote control Ubuntu 11.10 key map */ ++static struct rc_map_table rtl2832u_rc_keys_map_table[] = { ++ { 0x40bf, KEY_POWER2 }, // TV POWER ++ { 0x08f7, KEY_POWER }, // PC POWER ++ { 0x58a7, KEY_REWIND }, // REWIND ++ { 0xd827, KEY_PLAY }, // PLAY ++ { 0x22dd, KEY_FASTFORWARD }, // FAST FORWARD ++ { 0x02fd, KEY_STOP }, // STOP ++ { 0x5aa5, KEY_PREVIOUS }, // SKIP BACK ++ { 0x42bd, KEY_PLAYPAUSE }, // PAUSE ++ { 0xa25d, KEY_NEXT }, // SKIP FOWARD ++ { 0x12ed, KEY_RECORD }, // RECORD ++ { 0x28d7, KEY_BACK }, // BACK ++ { 0xa857, KEY_INFO }, // MORE ++// { 0x28d7, BTN_LEFT }, // MOUSE LEFT BUTTON ++// { 0xa857, BTN_RIGHT }, // MOUSE RIGHT BUTTON ++ { 0x6897, KEY_UP}, // UP ++ { 0x48b7, KEY_DOWN}, // DOWN ++ { 0xe817, KEY_LEFT }, // LEFT ++ { 0x30cf, KEY_RIGHT }, // RIGHT ++ { 0x18e7, KEY_OK }, // OK ++ { 0xc23d, KEY_ZOOM }, // ASPECT ++// { 0xea15, KEY_??? }, // MOUSE ++ { 0x708f, KEY_RED }, // RED ++ { 0xc837, KEY_GREEN }, // GREEN ++ { 0x8877, KEY_YELLOW }, // YELLOW ++ { 0x9867, KEY_BLUE }, // BLUE ++ { 0x807f, KEY_VOLUMEUP }, // VOL UP ++ { 0x7887, KEY_VOLUMEDOWN }, // VOL DOWN ++ { 0xb04f, KEY_HOME }, // HOME ++ { 0x00ff, KEY_MUTE }, // MUTE ++ { 0xd22d, KEY_CHANNELUP }, // CH UP ++ { 0xf20d, KEY_CHANNELDOWN }, // CH DOWN ++ { 0x50af, KEY_0 }, // 0 ++ { 0xf807, KEY_1 }, // 1 ++ { 0xc03f, KEY_2 }, // 2 ++ { 0x20df, KEY_3 }, // 3 ++ { 0xa05f, KEY_4 }, // 4 ++ { 0x38c7, KEY_5 }, // 5 ++ { 0x609f, KEY_6 }, // 6 ++ { 0xe01f, KEY_7 }, // 7 ++ { 0x10ef, KEY_8 }, // 8 ++ { 0xb847, KEY_9 }, // 9 ++ { 0x906f, KEY_NUMERIC_STAR }, // * ++ { 0xd02f, KEY_NUMERIC_POUND }, // # ++ { 0x52ad, KEY_EPG }, // GUIDE ++ { 0x926d, KEY_VIDEO }, // RTV ++ { 0x32cd, KEY_HELP }, // HELP ++ { 0xca35, KEY_CYCLEWINDOWS }, // PIP(?) ++ { 0xb24d, KEY_RADIO }, // RADIO ++ { 0x0af5, KEY_DVD }, // DVD ++ { 0x8a75, KEY_AUDIO }, // AUDIO ++ { 0x4ab5, KEY_TITLE } // TITLE ++}; ++ ++//////////////////////////////////////////////////////////////////////////////////////////////////////// ++enum rc_status_define{ ++ RC_FUNCTION_SUCCESS =0, ++ RC_FUNCTION_UNSUCCESS ++}; ++ ++int rtl2832u_remote_control_state=0; ++static int SampleNum2TNum[] = ++{ ++ 0,0,0,0,0, ++ 1,1,1,1,1,1,1,1,1, ++ 2,2,2,2,2,2,2,2,2, ++ 3,3,3,3,3,3,3,3,3, ++ 4,4,4,4,4,4,4,4,4, ++ 5,5,5,5,5,5,5,5, ++ 6,6,6,6,6,6,6,6,6, ++ 7,7,7,7,7,7,7,7,7, ++ 8,8,8,8,8,8,8,8,8, ++ 9,9,9,9,9,9,9,9,9, ++ 10,10,10,10,10,10,10,10,10, ++ 11,11,11,11,11,11,11,11,11, ++ 12,12,12,12,12,12,12,12,12, ++ 13,13,13,13,13,13,13,13,13, ++ 14,14,14,14,14,14,14 ++}; ++//IRRC register table ++static const RT_rc_set_reg_struct p_rtl2832u_rc_initial_table[]= ++{ ++ {RTD2832U_SYS,RC_USE_DEMOD_CTL1 ,0x00,OP_AND,0xfb}, ++ {RTD2832U_SYS,RC_USE_DEMOD_CTL1 ,0x00,OP_AND,0xf7}, ++ {RTD2832U_USB,USB_CTRL ,0x00,OP_OR ,0x20}, ++ {RTD2832U_SYS,SYS_GPD ,0x00,OP_AND,0xf7}, ++ {RTD2832U_SYS,SYS_GPOE ,0x00,OP_OR ,0x08}, ++ {RTD2832U_SYS,SYS_GPO ,0x00,OP_OR ,0x08}, ++ {RTD2832U_RC,IR_RX_CTRL ,0x20,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_BUFFER_CTRL ,0x80,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_IF ,0xff,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_IE ,0xff,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_MAX_DURATION0 ,0xd0,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_MAX_DURATION1 ,0x07,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_IDLE_LEN0 ,0xc0,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_IDLE_LEN1 ,0x00,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_GLITCH_LEN ,0x03,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_CLK ,0x09,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_CONFIG ,0x1c,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_MAX_H_Tolerance_LEN ,0x1e,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_MAX_L_Tolerance_LEN ,0x1e,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_CTRL ,0x80,OP_NO ,0xff} ++ ++}; ++ ++int rtl2832u_remoto_control_initial_setting(struct dvb_usb_device *d) ++{ ++ ++ ++ ++ //begin setting ++ int ret = RC_FUNCTION_SUCCESS; ++ u8 data=0,i=0,NumberOfRcInitialTable=0; ++ ++ ++ deb_rc("+rc_%s\n", __FUNCTION__); ++ ++ NumberOfRcInitialTable = sizeof(p_rtl2832u_rc_initial_table)/sizeof(RT_rc_set_reg_struct); ++ ++ ++ for (i=0;i 0) ++ { ++ ++ highestBit = (*pCode)&0x80; ++ lowBits = (*pCode) & 0x7f; ++ TNum=SampleNum2TNum[lowBits]; ++ ++ if(highestBit != 0) TNum = -TNum; ++ ++ pCode++; ++ byte_num--; ++ ++ if(TNum <= -6) state = WAITING_6T; ++ ++ if(WAITING_6T == state) ++ { ++ if(TNum <= -6) state = WAITING_2T_AFTER_6T; ++ } ++ else if(WAITING_2T_AFTER_6T == state) ++ { ++ if(2 == TNum) ++ { ++ state = WAITING_NORMAL_BITS; ++ LastTNum = 0; ++ CurrentBit = 0; ++ } ++ else state = WAITING_6T; ++ } ++ else if(WAITING_NORMAL_BITS == state) ++ { ++ if(0 == LastTNum) LastTNum = TNum; ++ else { ++ if(LastTNum < 0) ucBits[CurrentBit]=1; ++ else ucBits[CurrentBit]=0; ++ ++ CurrentBit++; ++ ++ if(CurrentBit >= frt0_bits_num) { ++ deb_rc("Bad frame received, bits num is error\n"); ++ CurrentBit = frt0_bits_num -1 ; ++ ++ } ++ if(TNum > 3) { ++ for(i=0;i>24) & frt0_BITS_mask0); ++ p_uccode[1]=(u8)((scancode>>16) & frt0_BITS_mask1); ++ p_uccode[2]=(u8)((scancode>>8) & frt0_BITS_mask2); ++ p_uccode[3]=(u8)((scancode>>0) & frt0_BITS_mask3); ++ ++ deb_rc("-rc_%s 3::rc6:%x %x %x %x \n", __FUNCTION__,p_uccode[0],p_uccode[1],p_uccode[2],p_uccode[3]); ++ ret= RC_FUNCTION_SUCCESS; ++error: ++ ++ return ret; ++} ++ ++ ++static int frt1(u8* rt_uccode,u8 byte_num,u8 *p_uccode) ++{ ++ u8 *pCode = rt_uccode; ++ u8 ucBits[frt1_bits_num]; ++ u8 i=0,CurrentBit=0,index=0; ++ u32 scancode=0; ++ int ret= RC_FUNCTION_SUCCESS; ++ ++ deb_rc("+rc_%s \n", __FUNCTION__); ++ if(byte_num < frt1_para1) { ++ deb_rc("Bad rt uc code received, byte_num = %d is error\n",byte_num); ++ ret = RC_FUNCTION_UNSUCCESS; ++ goto error; ++ } ++ ++ memset(ucBits,0,frt1_bits_num); ++ ++ for(i = 0; i < byte_num; i++) { ++ if ((pCode[i] & frt1_para2)< frt1_para3) index=frt1_para5 ; ++ else index=frt1_para6 ; ++ ++ ucBits[i]= (pCode[i] & 0x80) + index; ++ } ++ if(ucBits[0] !=frt1_para_uc_1 && ucBits[0] !=frt1_para_uc_2 ) {ret= RC_FUNCTION_UNSUCCESS; goto error;} ++ ++ if(ucBits[1] !=frt1_para5 && ucBits[1] !=frt1_para6) {ret= RC_FUNCTION_UNSUCCESS;goto error;} ++ ++ if(ucBits[2] >= frt1_para_uc_1) ucBits[2] -= 0x01; ++ else {ret= RC_FUNCTION_UNSUCCESS;goto error;} ++ ++ ++ i = 0x02; ++ CurrentBit = 0x00; ++ ++ while(i < byte_num-1) ++ { ++ if(CurrentBit >= 32) { ++ break; ++ } ++ ++ if((ucBits[i] & 0x0f) == 0x0) { ++ i++; ++ continue; ++ } ++ if(ucBits[i++] == 0x81) { ++ if(ucBits[i] >=0x01) { ++ scancode |= 0x00 << (31 - CurrentBit++); ++ } ++ } ++ else { ++ if(ucBits[i] >=0x81) { ++ scancode |= 0x01 << (31 - CurrentBit++); ++ } ++ } ++ ++ ucBits[i] -= 0x01; ++ continue; ++ } ++ p_uccode[3]=(u8)((scancode>>16) & frt1_bits_mask3); ++ p_uccode[2]=(u8)((scancode>>24) & frt1_bits_mask2); ++ p_uccode[1]=(u8)((scancode>>8) & frt1_bits_mask1); ++ p_uccode[0]=(u8)((scancode>>0) & frt1_bits_mask0); ++ ++ ++ deb_rc("-rc_%s rc5:%x %x %x %x -->scancode =%x\n", __FUNCTION__,p_uccode[0],p_uccode[1],p_uccode[2],p_uccode[3],scancode); ++ ret= RC_FUNCTION_SUCCESS; ++error: ++ return ret; ++} ++ ++static int frt2(u8* rt_uccode,u8 byte_num,u8 *p_uccode) ++{ ++ u8 *pCode = rt_uccode; ++ u8 i=0; ++ u32 scancode=0; ++ u8 out_io=0; ++ ++ int ret= RC_FUNCTION_SUCCESS; ++ ++ deb_rc("+rc_%s \n", __FUNCTION__); ++ ++ if(byte_num < frt2_para1) goto error; ++ if(pCode[0] != frt2_para2) goto error; ++ if((pCode[1] frt2_para4)) goto error; ++ ++ ++ if( (pCode[2] frt2_para6) ) ++ { ++ ++ if( (pCode[3] frt2_para8 ) &&(pCode[4]==frt2_para9 )) scancode=0xffff; ++ else goto error; ++ ++ } ++ else if( (pCode[2] frt2_para11 ) ) ++ { ++ ++ for (i = 3; i <68; i++) ++ { ++ if ((i% 2)==1) ++ { ++ if( (pCode[i]>frt2_para7 ) || (pCode[i] >24) & frt2_bits_mask0); ++ p_uccode[1]=(u8)((scancode>>16) & frt2_bits_mask1); ++ p_uccode[2]=(u8)((scancode>>8) & frt2_bits_mask2); ++ p_uccode[3]=(u8)((scancode>>0) & frt2_bits_mask3); ++ ret= RC_FUNCTION_SUCCESS; ++error: ++ ++ return ret; ++} ++#define receiveMaskFlag1 0x80 ++#define receiveMaskFlag2 0x03 ++#define flush_step_Number 0x05 ++#define rt_code_len 0x80 ++ ++static int rtl2832u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) ++{ ++ ++ static const RT_rc_set_reg_struct p_flush_table1[]={ ++ {RTD2832U_RC,IR_RX_CTRL ,0x20,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_BUFFER_CTRL ,0x80,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_IF ,0xff,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_IE ,0xff,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_CTRL ,0x80,OP_NO ,0xff} ++ ++ }; ++ static const RT_rc_set_reg_struct p_flush_table2[]={ ++ {RTD2832U_RC,IR_RX_IF ,0x03,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_BUFFER_CTRL ,0x80,OP_NO ,0xff}, ++ {RTD2832U_RC,IR_RX_CTRL ,0x80,OP_NO ,0xff} ++ ++ }; ++ ++ ++ u8 data=0,i=0,byte_count=0,tableSize; ++ int ret=0; ++ u8 rt_u8_code[rt_code_len]; ++ u8 ucode[4]; ++ u16 scancode=0; ++ ++ deb_rc("+%s \n", __FUNCTION__); ++ if (dvb_use_rtl2832u_rc_mode >= MAX_RC_PROTOCOL_NUM) ++ { ++ ++ deb_rc("%s : dvb_use_rtl2832u_rc_mode=%d \n", __FUNCTION__,dvb_use_rtl2832u_rc_mode); ++ return 0; ++ } ++ ++ if(rtl2832u_remote_control_state == RC_NO_SETTING) ++ { ++ deb_rc("%s : IrDA Initial Setting rtl2832u_remote_control_state=%d\n", __FUNCTION__,rtl2832u_remote_control_state); ++ ret=rtl2832u_remoto_control_initial_setting(d); ++ ++ } ++ if ( read_rc_char_bytes( d ,RTD2832U_RC, IR_RX_IF,&data ,LEN_1) ) ++ { ++ ret=-1; ++ deb_rc("%s : Read IrDA IF is failed\n", __FUNCTION__); ++ goto error; ++ } ++ /* debug */ ++ if (data != 0) ++ { ++ deb_rc("%s : IR_RX_IF= 0x%x\n", __FUNCTION__,data); ++ } ++ ++ ++ if (!(data & receiveMaskFlag1)) ++ { ++ ret =0 ; ++ goto error; ++ } ++ ++ if (data & receiveMaskFlag2) ++ { ++ /* delay */ ++ msleep(287); ++ ++ if ( read_rc_char_bytes( d ,RTD2832U_RC,IR_RX_BC,&byte_count ,LEN_1) ) ++ { ++ deb_rc("%s : rc -ir register read error! \n", __FUNCTION__); ++ ret=-1; ++ goto error; ++ } ++ if (byte_count == 0 ) ++ { ++ //ret=0; ++ goto error; ++ } ++ ++ if ((byte_count%LEN_2) == 1) byte_count+=LEN_1; ++ if (byte_count > rt_code_len) byte_count=rt_code_len; ++ ++ memset(rt_u8_code,0,rt_code_len); ++ deb_rc("%s : byte_count= %d type = %d \n", __FUNCTION__,byte_count,dvb_use_rtl2832u_rc_mode); ++ if ( read_rc_char_bytes( d ,RTD2832U_RC,IR_RX_BUF,rt_u8_code ,0x80) ) ++ { ++ deb_rc("%s : rc -ir register read error! \n", __FUNCTION__); ++ ret=-1; ++ goto error; ++ } ++ ++ memset(ucode,0,4); ++ ++ ++ ret=0; ++ if (dvb_use_rtl2832u_rc_mode == 0) ret =frt0(rt_u8_code,byte_count,ucode); ++ else if (dvb_use_rtl2832u_rc_mode == 1) ret =frt1(rt_u8_code,byte_count,ucode); ++ else if (dvb_use_rtl2832u_rc_mode== 2) ret =frt2(rt_u8_code,byte_count,ucode); ++ else ++ { ++ deb_rc("%s : rc - unknow rc protocol set ! \n", __FUNCTION__); ++ ret=-1; ++ goto error; ++ } ++ ++ if((ret != RC_FUNCTION_SUCCESS) || (ucode[0] ==0 && ucode[1] ==0 && ucode[2] ==0 && ucode[3] ==0)) ++ { ++ deb_rc("%s : rc-rc is error scan code ! %x %x %x %x \n", __FUNCTION__,ucode[0],ucode[1],ucode[2],ucode[3]); ++ ret=-1; ++ goto error; ++ } ++ scancode=(ucode[2]<<8) | ucode[3] ; ++ deb_info("-%s scan code %x %x %x %x,(0x%x) -- len=%d\n", __FUNCTION__,ucode[0],ucode[1],ucode[2],ucode[3],scancode,byte_count); ++ ////////// map///////////////////////////////////////////////////////////////////////////////////////////////////// ++ tableSize = ARRAY_SIZE(rtl2832u_rc_keys_map_table); ++ for (i = 0; i < tableSize; i++) { ++ if(rtl2832u_rc_keys_map_table[i].scancode == scancode ){ ++#ifdef V4L2_REFACTORED_RC_CODE ++ *event = rtl2832u_rc_keys_map_table[i].keycode; ++#else ++ *event = rtl2832u_rc_keys_map_table[i].event; ++#endif ++ ++ *state = REMOTE_KEY_PRESSED; ++ deb_rc("%s : map number = %d \n", __FUNCTION__,i); ++ break; ++ } ++ ++ } ++ if (i == tableSize) ++ deb_rc("%s : rc - scancode 0x%x NOT found!\n", __FUNCTION__, scancode); ++ ++ ++ memset(rt_u8_code,0,rt_code_len); ++ byte_count=0; ++ for (i=0;i<3;i++){ ++ data= p_flush_table2[i].data; ++ if ( write_rc_char_bytes( d ,RTD2832U_RC, p_flush_table2[i].address,&data,LEN_1) ) { ++ deb_rc("+%s : rc -ir register write error! \n", __FUNCTION__); ++ ret=-1; ++ goto error; ++ } ++ ++ } ++ ++ ret =0; ++ return ret; ++ } ++error: ++ memset(rt_u8_code,0,rt_code_len); ++ byte_count=0; ++ for (i=0;idev , RTD2832U_USB , USB_EPA_CTL , data , 2) ) goto error; ++ } ++ else ++ { ++ data[0] = 0x10; //3stall epa, set bit 4 to 1 ++ data[1] = 0x02; //3reset epa, set bit 9 to 1 ++ if ( write_usb_sys_char_bytes( adap->dev , RTD2832U_USB , USB_EPA_CTL , data , 2) ) goto error; ++ } ++ ++ return 0; ++error: ++ return -1; ++} ++ ++ ++static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) ++{ ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ adap->fe_adap[0].fe = rtl2832u_fe_attach(adap->dev); ++#else ++ adap->fe = rtl2832u_fe_attach(adap->dev); ++#endif ++ ++ return 0; ++} ++ ++ ++static void rtl2832u_usb_disconnect(struct usb_interface *intf) ++{ ++ try_module_get(THIS_MODULE); ++ dvb_usb_device_exit(intf); ++} ++ ++ ++static struct dvb_usb_device_properties rtl2832u_1st_properties; ++static struct dvb_usb_device_properties rtl2832u_2nd_properties; ++static struct dvb_usb_device_properties rtl2832u_3th_properties; ++static struct dvb_usb_device_properties rtl2832u_4th_properties; ++static struct dvb_usb_device_properties rtl2832u_5th_properties; ++static struct dvb_usb_device_properties rtl2832u_6th_properties; ++static struct dvb_usb_device_properties rtl2832u_7th_properties; ++static struct dvb_usb_device_properties rtl2832u_8th_properties; ++static struct dvb_usb_device_properties rtl2832u_9th_properties; ++ ++ ++//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) ++static int rtl2832u_usb_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ /* Thats avoids bugs with 2 instances of driver that operate same hardware */ ++ /* https://gitorious.org/rtl2832/rtl2832/commit/5495b3fda9e2c3bf4feef5d5751f6f2343380ea9 */ ++ if (!intf->altsetting->desc.bNumEndpoints) ++ return -ENODEV; ++ ++ if ( ( 0== dvb_usb_device_init(intf,&rtl2832u_1st_properties,THIS_MODULE,NULL,adapter_nr) )|| ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_2nd_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_3th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_4th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_5th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_6th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_7th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_8th_properties,THIS_MODULE,NULL,adapter_nr) ) || ++ ( 0== dvb_usb_device_init(intf,&rtl2832u_9th_properties,THIS_MODULE,NULL,adapter_nr) ) ) ++ return 0; ++ ++ return -ENODEV; ++} ++ ++static struct usb_device_id rtl2832u_usb_table [] = { ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2832_WARM) }, // 0 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2838_WARM) }, // 1 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2836_WARM) }, // 2 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2839_WARM) }, // 3 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2840_WARM) }, // 4 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2841_WARM) }, // 5 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2834_WARM) }, // 6 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2837_WARM) }, // 7 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2820_WARM) }, // 8 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2821_WARM) }, // 9 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2822_WARM) }, // 10 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2823_WARM) }, // 11 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2810_WARM) }, // 12 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2811_WARM) }, // 13 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2824_WARM) }, // 14 ++ { USB_DEVICE(USB_VID_REALTEK, USB_PID_RTL2825_WARM) }, // 15 ++ ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1101) }, // 16 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1102) }, // 17 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1103) }, // 18 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1104) }, // 19 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1105) }, // 20 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1106) }, // 21 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1107) }, // 22 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_1108) }, // 23 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_2101) }, // 24 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_8202) }, // 25 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_9201) }, // 26 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_3103) }, // 27 ++ { USB_DEVICE(USB_VID_DEXATEK, USB_PID_DEXATEK_9202) }, // 28 ++ ++ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00A9)}, // 29 ++ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00B3)}, // 30 ++ ++ { USB_DEVICE(USB_VID_AZUREWAVE_2, USB_PID_AZUREWAVE_3234) }, // 31 ++ { USB_DEVICE(USB_VID_AZUREWAVE_2, USB_PID_AZUREWAVE_3274) }, // 32 ++ { USB_DEVICE(USB_VID_AZUREWAVE_2, USB_PID_AZUREWAVE_3282) }, // 33 ++ ++ { USB_DEVICE(USB_VID_THP, USB_PID_THP_5013)}, // 34 ++ { USB_DEVICE(USB_VID_THP, USB_PID_THP_5020)}, // 35 ++ { USB_DEVICE(USB_VID_THP, USB_PID_THP_5026)}, // 36 ++ ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D393) }, // 37 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D394) }, // 38 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D395) }, // 39 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D396) }, // 40 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D397) }, // 41 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D398) }, // 42 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D39A) }, // 43 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D39B) }, // 44 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D39C) }, // 45 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D39E) }, // 46 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_E77B) }, // 47 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D3A1) }, // 48 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_D3A4) }, // 49 ++ { USB_DEVICE(USB_VID_KWORLD_1ST, USB_PID_KWORLD_E41D) }, // 50 ++ ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_0837)}, // 51 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_A803)}, // 52 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_B803)}, // 53 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_C803)}, // 54 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_D803)}, // 55 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_C280)}, // 56 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_D286)}, // 57 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_0139)}, // 58 ++ { USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK_WARM_A683)}, // 59 ++ ++ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_LEADTEK_WARM_1)}, // 60 ++ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_LEADTEK_WARM_2)}, // 61 ++ ++ { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_WARM)}, //62 ++ { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_WARM80)}, //63 ++ { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_WARM84)}, //64 ++ ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_0620)}, // 65 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_0630)}, // 66 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_0640)}, // 67 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_0650)}, // 68 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_0680)}, // 69 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_9580)}, // 70 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_9550)}, // 71 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_9540)}, // 72 ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_9530)}, // 73 71 //------rtl2832u_6th_properties(6) ++ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_WARM_9520)}, // 74 ++ ++ { USB_DEVICE(USB_VID_GOLDENBRIDGE, USB_PID_GOLDENBRIDGE_WARM)}, //75 ++ ++ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_MINI)}, // 76 ++ ++ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00D3)}, // 77 ++ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00D4)}, // 78 ++ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_00E0)}, // 79 ++ ++ { 0 }, ++}; ++ ++ ++MODULE_DEVICE_TABLE(usb, rtl2832u_usb_table); ++ ++static struct dvb_usb_device_properties rtl2832u_1st_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[0], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[1], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[2], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[3], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[4], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[5], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[6], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[7], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[8], NULL }, ++ }, ++ { NULL }, ++ } ++}; ++ ++ ++static struct dvb_usb_device_properties rtl2832u_2nd_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[9], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[10], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[11], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[12], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[13], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[14], NULL }, ++ }, ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[15], NULL }, ++ }, ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[16], NULL }, ++ }, ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[17], NULL }, ++ }, ++ { NULL }, ++ } ++}; ++ ++ ++ ++static struct dvb_usb_device_properties rtl2832u_3th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[18], NULL }, ++ }, ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[19], NULL }, ++ }, ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[20], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[21], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[22], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[23], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[24], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[25], NULL }, ++ }, ++ { ++ .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[26], NULL }, ++ } ++ } ++}; ++ ++ ++static struct dvb_usb_device_properties rtl2832u_4th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 12, ++ .devices = { ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[27], NULL }, ++ }, ++ { .name = "DK DONGLE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[28], NULL }, ++ }, ++ { .name = "Terratec Cinergy T Stick Black", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[29], NULL }, ++ }, ++ { ++ .name = "Terratec Cinergy T Stick Black", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[30], NULL }, ++ }, ++ { ++ .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[31], NULL }, ++ }, ++ { ++ .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[32], NULL }, ++ }, ++ ++ { ++ .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[33], NULL }, ++ }, ++ ++ { ++ .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[34], NULL }, ++ }, ++ ++ { ++ .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[35], NULL }, ++ }, ++ ++ { ++ .name = "Terratec Cinergy T Stick RC (Rev.3)", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[77], NULL }, ++ }, ++ ++ { ++ .name = "Terratec Cinergy T Stick BLACK (Rev.2)", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[78], NULL }, ++ }, ++ ++ { ++ .name = "Terratec Noxon DAB Stick (Rev.2)", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[79], NULL }, ++ }, ++ ++ } ++}; ++ ++static struct dvb_usb_device_properties rtl2832u_5th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "RTL2832U DVB-T USB DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[36], NULL }, ++ }, ++ { .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[37], NULL }, ++ }, ++ { .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[38], NULL }, ++ }, ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[39], NULL }, ++ }, ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[40], NULL }, ++ }, ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[41], NULL }, ++ }, ++ ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[42], NULL }, ++ }, ++ ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[43], NULL }, ++ }, ++ ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[44], NULL }, ++ }, ++ ++ ++ } ++}; ++ ++static struct dvb_usb_device_properties rtl2832u_6th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ /*remote control*/ ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[45], NULL }, ++ }, ++ { .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[46], NULL }, ++ }, ++ { .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[47], NULL }, ++ }, ++ { ++ .name ="USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[48], NULL }, ++ }, ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[49], NULL }, ++ }, ++ { ++ .name = "USB DVB-T DEVICE", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[50], NULL }, ++ }, ++ { ++ .name ="DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[51], NULL }, ++ }, ++ { ++ .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[52], NULL }, ++ }, ++ { ++ .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[53], NULL }, ++ }, ++ ++ { NULL }, ++ ++ ++ } ++}; ++ ++static struct dvb_usb_device_properties rtl2832u_7th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 10, ++ .devices = { ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[54], NULL }, ++ }, ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[55], NULL }, ++ }, ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[56], NULL }, ++ }, ++ { ++ .name ="DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[57], NULL }, ++ }, ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[58], NULL }, ++ }, ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[59], NULL }, ++ }, ++ { .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[60], NULL }, ++ }, ++ { ++ .name ="USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[61], NULL }, ++ }, ++ { ++ .name ="USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[62], NULL }, ++ }, ++ { .name = "Leadtek WinFast DTV Dongle Mini", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[76], NULL }, ++ }, ++ ++ { NULL }, ++ } ++}; ++ ++static struct dvb_usb_device_properties rtl2832u_8th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 9, ++ .devices = { ++ { .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[63], NULL }, ++ }, ++ { .name = "USB DVB-T Device", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[64], NULL }, ++ }, ++ { .name = "VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[65], NULL }, ++ }, ++ { ++ .name ="VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[66], NULL }, ++ }, ++ { .name = "VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[67], NULL }, ++ }, ++ { .name = "VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[68], NULL }, ++ }, ++ { .name = "VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[69], NULL }, ++ }, ++ { ++ .name ="VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[70], NULL }, ++ }, ++ { ++ .name ="VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[71], NULL }, ++ }, ++ ++ { NULL }, ++ } ++}; ++ ++static struct dvb_usb_device_properties rtl2832u_9th_properties = { ++ ++ .num_adapters = 1, ++ .adapter = ++ { ++ { ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++ .num_frontends = 1, ++ .fe = {{ ++#endif ++ ++ .streaming_ctrl = rtl2832u_streaming_ctrl, ++ .frontend_attach = rtl2832u_frontend_attach, ++ ++#ifndef V4L2_REFACTORED_MFE_CODE ++ .fe_ioctl_override = rtl2832u_ioctl_override, ++#endif ++ ++ //parameter for the MPEG2-data transfer ++ .stream = ++ { ++ .type = USB_BULK, ++ .count = RTD2831_URB_NUMBER, ++ .endpoint = 0x01, //data pipe ++ .u = ++ { ++ .bulk = ++ { ++ .buffersize = RTD2831_URB_SIZE, ++ } ++ } ++ }, ++ ++#ifdef V4L2_REFACTORED_MFE_CODE ++ }}, ++#endif ++ ++ } ++ }, ++ ++ //remote control ++ .rc.legacy = { ++#ifdef V4L2_REFACTORED_RC_CODE ++ .rc_map_table = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#else ++ .rc_key_map = rtl2832u_rc_keys_map_table, //user define key map ++ .rc_key_map_size = ARRAY_SIZE(rtl2832u_rc_keys_map_table), //user define key map size ++#endif ++ .rc_query = rtl2832u_rc_query, //use define quary function ++ .rc_interval = RT_RC_POLLING_INTERVAL_TIME_MS, ++ }, ++ ++ .num_device_descs = 4, ++ .devices = { ++ { ++ .name ="VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[72], NULL }, ++ }, ++ { ++ .name ="VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[73], NULL }, ++ }, ++ { .name = "VideoMate DTV", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[74], NULL }, ++ }, ++ { .name = "DVB-T TV Stick", ++ .cold_ids = { NULL, NULL }, ++ .warm_ids = { &rtl2832u_usb_table[75], NULL }, ++ }, ++ { NULL }, ++ } ++}; ++ ++ ++ ++ ++static struct usb_driver rtl2832u_usb_driver = { ++ .name = "dvb_usb_rtl2832u", ++ .probe = rtl2832u_usb_probe, ++ .disconnect = rtl2832u_usb_disconnect, ++ .id_table = rtl2832u_usb_table, ++}; ++ ++ ++static int __init rtl2832u_usb_module_init(void) ++{ ++ int result =0 ; ++ ++ deb_info("+info debug open_%s\n", __FUNCTION__); ++ if ((result = usb_register(&rtl2832u_usb_driver))) { ++ err("usb_register failed. (%d)",result); ++ return result; ++ } ++ ++ return 0; ++} ++ ++static void __exit rtl2832u_usb_module_exit(void) ++{ ++ usb_deregister(&rtl2832u_usb_driver); ++ ++ return ; ++} ++ ++ ++ ++module_init(rtl2832u_usb_module_init); ++module_exit(rtl2832u_usb_module_exit); ++ ++ ++MODULE_AUTHOR("Realtek"); ++MODULE_AUTHOR("Chialing Lu "); ++MODULE_AUTHOR("Dean Chung"); ++MODULE_DESCRIPTION("Driver for the RTL2832U DVB-T / RTL2836 DTMB USB2.0 device"); ++MODULE_VERSION("2.2.2"); ++MODULE_LICENSE("GPL"); ++ +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u.h b/drivers/media/dvb/dvb-usb/rtl2832u.h +new file mode 100644 +index 0000000..41bd7c5 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u.h +@@ -0,0 +1,275 @@ ++ ++#ifndef _RTL2832U_H_ ++#define _RTL2832U_H_ ++ ++ ++ ++#include "dvb-usb.h" ++ ++#ifndef USB_VID_REALTEK ++ #define USB_VID_REALTEK 0x0BDA ++#endif ++#define USB_PID_RTL2832_WARM 0x2832 ++#define USB_PID_RTL2838_WARM 0x2838 ++#define USB_PID_RTL2836_WARM 0x2836 ++#define USB_PID_RTL2839_WARM 0x2839 ++#define USB_PID_RTL2840_WARM 0x2840 ++#define USB_PID_RTL2841_WARM 0x2841 ++#define USB_PID_RTL2834_WARM 0x2834 ++#define USB_PID_RTL2837_WARM 0x2837 ++#define USB_PID_RTL2820_WARM 0x2820 ++#define USB_PID_RTL2821_WARM 0x2821 ++#define USB_PID_RTL2822_WARM 0x2822 ++#define USB_PID_RTL2823_WARM 0x2823 ++#define USB_PID_RTL2810_WARM 0x2810 ++#define USB_PID_RTL2811_WARM 0x2811 ++#define USB_PID_RTL2824_WARM 0x2824 ++#define USB_PID_RTL2825_WARM 0x2825 ++ ++#ifndef USB_VID_DEXATEK ++ #define USB_VID_DEXATEK 0x1D19 ++#endif ++#define USB_PID_DEXATEK_1101 0x1101 ++#define USB_PID_DEXATEK_1102 0x1102 ++#define USB_PID_DEXATEK_1103 0x1103 ++#define USB_PID_DEXATEK_1104 0x1104 ++#define USB_PID_DEXATEK_1105 0x1105 ++#define USB_PID_DEXATEK_1106 0x1106 ++#define USB_PID_DEXATEK_1107 0x1107 ++#define USB_PID_DEXATEK_1108 0x1108 ++#define USB_PID_DEXATEK_2101 0x2101 ++#define USB_PID_DEXATEK_8202 0x8202 ++#define USB_PID_DEXATEK_9201 0x9201 ++#define USB_PID_DEXATEK_3103 0x3103 ++#define USB_PID_DEXATEK_9202 0x9202 ++ ++#ifndef USB_VID_TERRATEC ++ #define USB_VID_TERRATEC 0x0CCD ++#endif ++#define USB_PID_TERRATEC_00A9 0x00A9 ++#define USB_PID_TERRATEC_00B3 0x00B3 ++#define USB_PID_TERRATEC_00D3 0x00D3 ++#define USB_PID_TERRATEC_00D4 0x00D4 ++#define USB_PID_TERRATEC_00E0 0x00E0 ++ ++#ifndef USB_VID_AZUREWAVE_2 ++ #define USB_VID_AZUREWAVE_2 0x13D3 ++#endif ++ #define USB_PID_AZUREWAVE_3234 0x3234 ++ #define USB_PID_AZUREWAVE_3274 0x3274 ++ #define USB_PID_AZUREWAVE_3282 0x3282 ++ ++ ++#ifndef USB_VID_THP ++ #define USB_VID_THP 0x1554 ++#endif ++#define USB_PID_THP_5013 0x5013 ++#define USB_PID_THP_5020 0x5020 ++#define USB_PID_THP_5026 0x5026 ++ ++#ifndef USB_VID_KWORLD_1ST ++ #define USB_VID_KWORLD_1ST 0x1B80 ++#endif ++#define USB_PID_KWORLD_D393 0xD393 ++#define USB_PID_KWORLD_D394 0xD394 ++#define USB_PID_KWORLD_D395 0xD395 ++#define USB_PID_KWORLD_D396 0xD396 ++#define USB_PID_KWORLD_D397 0xD397 ++#define USB_PID_KWORLD_D398 0xD398 ++#define USB_PID_KWORLD_D39A 0xD39A ++#define USB_PID_KWORLD_D39B 0xD39B ++#define USB_PID_KWORLD_D39C 0xD39C ++#define USB_PID_KWORLD_D39E 0xD39E ++#define USB_PID_KWORLD_E77B 0xE77B ++#define USB_PID_KWORLD_D3A1 0xD3A1 ++#define USB_PID_KWORLD_D3A4 0xD3A4 ++#define USB_PID_KWORLD_E41D 0xE41D ++ ++#ifndef USB_VID_GOLDENBRIDGE ++ #define USB_VID_GOLDENBRIDGE 0x1680 ++#endif ++#define USB_PID_GOLDENBRIDGE_WARM 0xA332 ++ ++#ifndef USB_VID_YUAN ++ #define USB_VID_YUAN 0x1164 ++#endif ++#define USB_PID_YUAN_WARM 0x6601 ++#define USB_PID_YUAN_WARM80 0x3280 ++#define USB_PID_YUAN_WARM84 0x3284 ++ ++#ifndef USB_PID_GTEK_WARM_0837 ++ #define USB_PID_GTEK_WARM_0837 0x0837 ++#endif ++#define USB_PID_GTEK_WARM_A803 0xA803 ++#define USB_PID_GTEK_WARM_B803 0xB803 ++#define USB_PID_GTEK_WARM_C803 0xC803 ++#define USB_PID_GTEK_WARM_D803 0xD803 ++#define USB_PID_GTEK_WARM_C280 0xC280 ++#define USB_PID_GTEK_WARM_D286 0xD286 ++#define USB_PID_GTEK_WARM_0139 0x0139 ++#define USB_PID_GTEK_WARM_A683 0xA683 ++ ++#ifndef USB_VID_LEADTEK ++ #define USB_VID_LEADTEK 0x0413 ++#endif ++#define USB_PID_LEADTEK_WARM_1 0x6680 ++#define USB_PID_LEADTEK_WARM_2 0x6F11 ++#ifndef USB_VID_COMPRO ++ #define USB_VID_COMPRO 0x185B ++#endif ++#define USB_PID_COMPRO_WARM_0620 0x0620 ++#define USB_PID_COMPRO_WARM_0630 0x0630 ++#define USB_PID_COMPRO_WARM_0640 0x0640 ++#define USB_PID_COMPRO_WARM_0650 0x0650 ++#define USB_PID_COMPRO_WARM_0680 0x0680 ++#define USB_PID_COMPRO_WARM_9580 0x9580 ++#define USB_PID_COMPRO_WARM_9550 0x9550 ++#define USB_PID_COMPRO_WARM_9540 0x9540 ++#define USB_PID_COMPRO_WARM_9530 0x9530 ++#define USB_PID_COMPRO_WARM_9520 0x9520 ++ ++ ++#define RTD2831_URB_SIZE 4096// 39480 ++#define RTD2831_URB_NUMBER 10 // 4 ++ ++/////////////////////////////////////////////////////////////////////////////////////////////////////// ++// remote control ++/////////////////////////////////////////////////////////////////////////////////////////////////////// ++ ++ ++//define rtl283u rc register address ++#define IR_RX_BUF 0xFC00 ++#define IR_RX_IE 0xFD00 ++#define IR_RX_IF 0xFD01 ++#define IR_RX_CTRL 0xFD02 ++#define IR_RX_CONFIG 0xFD03 ++#define IR_MAX_DURATION0 0xFD04 ++#define IR_MAX_DURATION1 0xFD05 ++#define IR_IDLE_LEN0 0xFD06 ++#define IR_IDLE_LEN1 0xFD07 ++#define IR_GLITCH_LEN 0xFD08 ++#define IR_RX_BUFFER_CTRL 0xFD09 ++#define IR_RX_BUFFER_DATA 0xFD0A ++#define IR_RX_BC 0xFD0B ++#define IR_RX_CLK 0xFD0C ++#define IR_RX_C_COUNT_L 0xFD0D ++#define IR_RX_C_COUNT_H 0xFD0E ++ ++#define IR_SUSPEND_CTRL 0xFD10 ++#define IR_Err_Tolerance_CTRL 0xFD11 ++#define IR_UNIT_LEN 0xFD12 ++#define IR_Err_Tolerance_LEN 0xFD13 ++#define IR_MAX_H_Tolerance_LEN 0xFD14 ++#define IR_MAX_L_Tolerance_LEN 0xFD15 ++#define IR_MASK_CTRL 0xFD16 ++#define IR_MASK_DATA 0xFD17 ++#define IR_RESUME_MASK_ADDR 0xFD18 ++#define IR_RESUME_MASK_T_LEN 0xFD19 ++ ++#define USB_CTRL 0x0010 ++#define SYS_GPD 0x0004 ++#define SYS_GPOE 0x0003 ++#define SYS_GPO 0x0001 ++#define RC_USE_DEMOD_CTL1 0x000B ++ ++//define use len ++#define LEN_1 0x01 ++#define LEN_2 0x02 ++#define LEN_3 0x03 ++#define LEN_4 0x04 ++ ++ ++ ++//function ++int rtl2832u_remoto_control_initial_setting(struct dvb_usb_device *d); ++#define USB_EPA_CTL 0x0148 ++ ++/////////////////////////////////////////////////////////////////////////////////////////////////////// ++//decode control para define ++#define frt0_para1 0x3c ++#define frt0_para2 0x20 ++#define frt0_para3 0x7f ++#define frt0_para4 0x05 ++#define frt0_bits_num 0x80 ++#define frt0_BITS_mask 0x01 ++#define frt0_BITS_mask0 0x00 ++#define frt0_BITS_mask1 0x00 ++#define frt0_BITS_mask2 0x0f ++#define frt0_BITS_mask3 0xff ++ ++#define frt1_para1 0x12 ++#define frt1_para3 0x1a ++#define frt1_para2 0x7f ++#define frt1_para4 0x80 ++#define frt1_para5 0x01 ++#define frt1_para6 0x02 ++#define frt1_bits_num 0x80 ++#define frt1_para_uc_1 0x81 ++#define frt1_para_uc_2 0x82 ++#define frt1_bits_mask0 0x00 ++#define frt1_bits_mask1 0x00 ++#define frt1_bits_mask2 0x7f ++#define frt1_bits_mask3 0xff ++ ++#define frt2_para1 0x0a ++#define frt2_para2 0xFF ++#define frt2_para3 0xb0 ++#define frt2_para4 0xc6 ++#define frt2_para5 0x30 ++#define frt2_para6 0x1b ++#define frt2_para7 0x8f ++#define frt2_para8 0x89 ++#define frt2_para9 0x7f ++#define frt2_para10 0x60 ++#define frt2_para11 0x38 ++#define frt2_para12 0x15 ++#define frt2_bits_num 0x80 ++#define frt2_bits_mask0 0x00 ++#define frt2_bits_mask1 0x00 ++#define frt2_bits_mask2 0xff ++#define frt2_bits_mask3 0xff ++/////////////////////////////////////////////////////////////////////////////////////////////////////// ++// remote control ++/////////////////////////////////////////////////////////////////////////////////////////////////////// ++enum protocol_type_for_RT{ ++ RT_RC6=0, ++ RT_RC5, ++ RT_NEC, ++ RT_TEST ++}; ++// op define ++enum OP{ ++ OP_NO =0, ++ OP_AND , ++ OP_OR ++}; ++ ++typedef enum RT_UC_CODE_STATE{ ++ WAITING_6T, ++ WAITING_2T_AFTER_6T, ++ WAITING_NORMAL_BITS ++}RT_UC_CODE_STATE; ++ ++//struct define ++typedef struct RT_rc_set_reg_struct{ ++ u8 type; ++ u16 address; ++ u8 data; ++ u8 op; ++ u8 op_mask; ++}RT_rc_set_reg_struct; ++ ++enum RTL2832U_RC_STATE{ ++ RC_NO_SETTING=0, ++ RC_INSTALL_OK, ++ RC__POLLING_OK, ++ RC_STOP_OK ++}; ++//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ++ ++extern struct dvb_frontend * rtl2832u_fe_attach(struct dvb_usb_device *d); ++ ++#endif ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u_fe.c b/drivers/media/dvb/dvb-usb/rtl2832u_fe.c +new file mode 100644 +index 0000000..fab851f +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u_fe.c +@@ -0,0 +1,4009 @@ ++#include ++#include "rtl2832u_fe.h" ++#include "rtl2832u_io.h" ++#include "rtl2832u.h" ++#include "rtl2832u_ioctl.h" ++ ++extern int demod_default_type; ++extern int dtmb_error_packet_discard; ++extern int dvb_use_rtl2832u_card_type; ++extern int dvb_use_rtl2832u_rc_mode; ++extern int rtl2832u_remote_control_state; ++ ++static struct rtl2832_reg_addr rtl2832_reg_map[]= { ++ /* RTD2831_RMAP_INDEX_USB_CTRL_BIT5*/ { RTD2832U_USB, USB_CTRL, 5, 5 }, ++ /* RTD2831_RMAP_INDEX_USB_STAT*/ { RTD2832U_USB, USB_STAT, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_USB_EPA_CTL*/ { RTD2832U_USB, USB_EPA_CTL, 0, 31 }, ++ /* RTD2831_RMAP_INDEX_USB_SYSCTL*/ { RTD2832U_USB, USB_SYSCTL, 0, 31 }, ++ /* RTD2831_RMAP_INDEX_USB_EPA_CFG*/ { RTD2832U_USB, USB_EPA_CFG, 0, 31 }, ++ /* RTD2831_RMAP_INDEX_USB_EPA_MAXPKT*/ { RTD2832U_USB, USB_EPA_MAXPKT, 0, 31}, ++ /* RTD2831_RMAP_INDEX_USB_EPA_FIFO_CFG*/ { RTD2832U_USB, USB_EPA_FIFO_CFG, 0, 31}, ++ ++ /* RTD2831_RMAP_INDEX_SYS_DEMOD_CTL*/ { RTD2832U_SYS, DEMOD_CTL, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL*/ { RTD2832U_SYS, GPIO_OUTPUT_VAL, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT3*/{ RTD2832U_SYS, GPIO_OUTPUT_EN, 3, 3 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT3*/ { RTD2832U_SYS, GPIO_DIR, 3, 3 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_CFG0_BIT67*/ { RTD2832U_SYS, GPIO_CFG0, 6, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1*/ { RTD2832U_SYS, DEMOD_CTL1, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT1*/{ RTD2832U_SYS, GPIO_OUTPUT_EN, 1, 1 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT1*/ { RTD2832U_SYS, GPIO_DIR, 1, 1 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT6*/{ RTD2832U_SYS, GPIO_OUTPUT_EN, 6, 6 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT6*/ { RTD2832U_SYS, GPIO_DIR, 6, 6 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT5*/{ RTD2832U_SYS, GPIO_OUTPUT_EN, 5, 5}, ++ /* RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT5*/ { RTD2832U_SYS, GPIO_DIR, 5, 5}, ++ ++#if 0 ++ /* RTD2831_RMAP_INDEX_SYS_GPD*/ { RTD2832U_SYS, GPD, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPOE*/ { RTD2832U_SYS, GPOE, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_GPO*/ { RTD2832U_SYS, GPO, 0, 7 }, ++ /* RTD2831_RMAP_INDEX_SYS_SYS_0*/ { RTD2832U_SYS, SYS_0, 0, 7 }, ++#endif ++ ++ /* DTMB related */ ++ ++ ++}; ++ ++static int rtl2832_reg_mask[32]= { ++ 0x00000001, ++ 0x00000003, ++ 0x00000007, ++ 0x0000000f, ++ 0x0000001f, ++ 0x0000003f, ++ 0x0000007f, ++ 0x000000ff, ++ 0x000001ff, ++ 0x000003ff, ++ 0x000007ff, ++ 0x00000fff, ++ 0x00001fff, ++ 0x00003fff, ++ 0x00007fff, ++ 0x0000ffff, ++ 0x0001ffff, ++ 0x0003ffff, ++ 0x0007ffff, ++ 0x000fffff, ++ 0x001fffff, ++ 0x003fffff, ++ 0x007fffff, ++ 0x00ffffff, ++ 0x01ffffff, ++ 0x03ffffff, ++ 0x07ffffff, ++ 0x0fffffff, ++ 0x1fffffff, ++ 0x3fffffff, ++ 0x7fffffff, ++ 0xffffffff ++}; ++ ++typedef struct FC0012_LNA_REG_MAP ++{ ++ unsigned char Lna_regValue; ++ long LnaGain; ++}FC0012_LNA_REG_MAP; ++ ++FC0012_LNA_REG_MAP FC0012_LNA_GAIN_TABLE[]= { ++ {0x00 , -63},{0x01 , -58},{0x02 , -99},{0x03 , -73},{0x04 , -63},{0x05 , -65} ++ ,{0x06 , -54},{0x07 , -60},{0x08 , 71 },{0x09 , 70 },{0x0a , 68 },{0x0b , 67 } ++ ,{0x0c , 65 },{0x0d , 63 },{0x0e , 61 },{0x0f , 58 },{0x10 , 197},{0x11 , 191} ++ ,{0x12 , 188},{0x13 , 186},{0x14 , 184},{0x15 , 182},{0x16 , 181},{0x17 , 179} ++}; ++ ++static int check_dtmb_support(struct rtl2832_state* p_state); ++ ++static int check_dvbc_support(struct rtl2832_state* p_state); ++ ++static int ++set_demod_2836_power( ++ struct rtl2832_state* p_state, ++ int onoff); ++ ++static int ++rtl2840_on_hwreset( ++ struct rtl2832_state* p_state); ++ ++ ++static int ++set_demod_2840_power( ++ struct rtl2832_state* p_state, ++ int onoff); ++ ++ ++static int ++demod_init_setting( ++ struct rtl2832_state * p_state); ++ ++static int ++build_nim_module( ++ struct rtl2832_state* p_state); ++ ++static int ++rtl2836_scan_procedure( ++ struct rtl2832_state * p_state); ++static int ++fc0012_get_signal_strength( ++ struct rtl2832_state *p_state, ++ unsigned long *strength); ++static int ++rtl2832_sleep_mode(struct rtl2832_state* p_state); ++ ++static void ++custom_wait_ms( ++ BASE_INTERFACE_MODULE* pBaseInterface, ++ unsigned long WaitTimeMs) ++{ ++ platform_wait(WaitTimeMs); ++ return; ++} ++ ++ ++static int ++custom_i2c_read( ++ BASE_INTERFACE_MODULE* pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char* pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ struct dvb_usb_device *d; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ if ( read_rtl2832_stdi2c( d, DeviceAddr , pReadingBytes , ByteNum ) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++ ++static int ++custom_i2c_write( ++ BASE_INTERFACE_MODULE* pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char* pWritingBytes, ++ unsigned long ByteNum) ++{ ++ struct dvb_usb_device *d; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ if ( write_rtl2832_stdi2c( d, DeviceAddr , (unsigned char*)pWritingBytes , ByteNum ) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++ ++static int ++read_usb_sys_register( ++ struct rtl2832_state* p_state, ++ rtl2832_reg_map_index reg_map_index, ++ int* p_val) ++{ ++ RegType reg_type= rtl2832_reg_map[reg_map_index].reg_type; ++ unsigned short reg_addr= rtl2832_reg_map[reg_map_index].reg_addr; ++ int bit_low= rtl2832_reg_map[reg_map_index].bit_low; ++ int bit_high= rtl2832_reg_map[reg_map_index].bit_high; ++ ++ int n_byte_read=(bit_high>> 3)+ 1; ++ ++ *p_val= 0; ++ if (read_usb_sys_int_bytes(p_state->d, reg_type, reg_addr, n_byte_read, p_val)) goto error; ++ ++ *p_val= ((*p_val>> bit_low) & rtl2832_reg_mask[bit_high- bit_low]); ++ ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++ ++static int ++write_usb_sys_register( ++ struct rtl2832_state* p_state, ++ rtl2832_reg_map_index reg_map_index, ++ int val_write) ++{ ++ RegType reg_type= rtl2832_reg_map[reg_map_index].reg_type; ++ unsigned short reg_addr= rtl2832_reg_map[reg_map_index].reg_addr; ++ int bit_low= rtl2832_reg_map[reg_map_index].bit_low; ++ int bit_high= rtl2832_reg_map[reg_map_index].bit_high; ++ ++ int n_byte_write= (bit_high>> 3)+ 1; ++ int val_read= 0; ++ int new_val_write; ++ ++ if (read_usb_sys_int_bytes(p_state->d, reg_type, reg_addr, n_byte_write, &val_read)) goto error; ++ ++ new_val_write= (val_read & (~(rtl2832_reg_mask[bit_high- bit_low]<< bit_low))) | (val_write<< bit_low); ++ ++ if (write_usb_sys_int_bytes(p_state->d, reg_type, reg_addr, n_byte_write, new_val_write)) goto error; ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++ ++static int ++max3543_set_power( ++ struct rtl2832_state* p_state, ++ unsigned char onoff ++ ) ++{ ++ unsigned char data; ++ unsigned char i2c_repeater; ++ ++ ++ if( p_state->tuner_type != RTL2832_TUNER_TYPE_MAX3543) return 0; ++ ++ deb_info(" %s : onoff =%d\n", __FUNCTION__, onoff); ++ ++ read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ i2c_repeater |= BIT3; ++ write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ ++ if(onoff) ++ { ++ //turn on BIT7=0 ++ read_rtl2832_tuner_register(p_state->d, MAX3543_TUNER_ADDR, MAX3543_SHUTDOWN_OFFSET, &data, LEN_1_BYTE); ++ data &=(~BIT_7_MASK); ++ write_rtl2832_tuner_register(p_state->d, MAX3543_TUNER_ADDR, MAX3543_SHUTDOWN_OFFSET, &data, LEN_1_BYTE); ++ } ++ else ++ { ++ //turn off BIT7=1 ++ read_rtl2832_tuner_register(p_state->d, MAX3543_TUNER_ADDR, MAX3543_SHUTDOWN_OFFSET, &data, LEN_1_BYTE); ++ data |=BIT_7_MASK; ++ write_rtl2832_tuner_register(p_state->d, MAX3543_TUNER_ADDR, MAX3543_SHUTDOWN_OFFSET, &data, LEN_1_BYTE); ++ } ++ ++ read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ i2c_repeater &= (~BIT3); ++ write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ ++ ++ return 0; ++ ++} ++ ++ ++static int ++set_tuner_power( ++ struct rtl2832_state* p_state, ++ unsigned char b_gpio4, ++ unsigned char onoff) ++{ ++ ++ int data; ++ ++ if(onoff==0) max3543_set_power(p_state, onoff); ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ ++ if(b_gpio4) ++ { ++ if(onoff) data &= ~(BIT4); //set bit4 to 0 ++ else data |= BIT4; //set bit4 to 1 ++ ++ } ++ else ++ { ++ if(onoff) data &= ~(BIT3); //set bit3 to 0 ++ else data |= BIT3; //set bit3 to 1 ++ } ++ ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL,data) ) goto error; ++ ++ ++ if(onoff==1) max3543_set_power(p_state, onoff); ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++static int ++set_demod_power( ++ struct rtl2832_state* p_state, ++ unsigned char onoff) ++{ ++ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ if(onoff) data &= ~(BIT0); //set bit0 to 0 low ++ else data |= BIT0; //set bit0 to 1 high ++ ++ //data &= ~(BIT0); //3 Demod Power always ON => hw issue. ++ ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL,data) ) goto error; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ return 0; ++error: ++ return 1; ++} ++ ++ ++//3//////// Set GPIO3 "OUT" => Turn ON/OFF Tuner Power ++//3//////// Set GPIO3 "IN" => Button Wake UP (USB IF) , NO implement in rtl2832u linux driver ++ ++static int ++gpio3_out_setting( ++ struct rtl2832_state* p_state) ++{ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ // GPIO3_PAD Pull-HIGH, BIT76 ++ data = 2; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_CFG0_BIT67,data) ) goto error; ++ ++ // GPO_GPIO3 = 1, GPIO3 output value = 1 ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ data |= BIT3; //set bit3 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL,data) ) goto error; ++ ++ // GPD_GPIO3=0, GPIO3 output direction ++ data = 0; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT3,data) ) goto error; ++ ++ // GPOE_GPIO3=1, GPIO3 output enable ++ data = 1; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT3,data) ) goto error; ++ ++ //BTN_WAKEUP_DIS = 1 ++ data = 1; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_CTRL_BIT5,data) ) goto error; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++ ++ ++ ++ ++static int ++usb_epa_fifo_reset( ++ struct rtl2832_state* p_state) ++{ ++ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ //3 reset epa fifo: ++ //3[9] Reset EPA FIFO ++ //3 [5] FIFO Flush,Write 1 to flush the oldest TS packet (a 188 bytes block) ++ ++ data = 0x0210; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_CTL,data) ) goto error; ++ ++ data = 0xffff; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_CTL,&data) ) goto error; ++ ++ if( (data & 0xffff) != 0x0210) ++ { ++ deb_info("Write error RTD2831_RMAP_INDEX_USB_EPA_CTL = 0x%x\n",data); ++ goto error; ++ } ++ ++ data=0x0000; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_CTL,data) ) goto error; ++ ++ data = 0xffff; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_CTL,&data) ) goto error; ++ ++ if( ( data & 0xffff) != 0x0000) ++ { ++ deb_info("Write error RTD2831_RMAP_INDEX_USB_EPA_CTL = 0x%x\n",data); ++ goto error; ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ return 1; ++ ++} ++ ++ ++ ++static int ++usb_init_bulk_setting( ++ struct rtl2832_state* p_state) ++{ ++ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ //3 1.FULL packer mode(for bulk) ++ //3 2.DMA enable. ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_SYSCTL, &data) ) goto error; ++ ++ data &=0xffffff00; ++ data |= 0x09; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_SYSCTL, data) ) goto error; ++ ++ data=0; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_SYSCTL, &data) ) goto error; ++ ++ if((data&0xff)!=0x09) ++ { ++ deb_info("Open bulk FULL packet mode error!!\n"); ++ goto error; ++ } ++ ++ //3check epa config, ++ //3[9-8]:00, 1 transaction per microframe ++ //3[7]:1, epa enable ++ //3[6-5]:10, bulk mode ++ //3[4]:1, device to host ++ //3[3:0]:0001, endpoint number ++ data = 0; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_CFG, &data) ) goto error; ++ if((data&0x0300)!=0x0000 || (data&0xff)!=0xd1) ++ { ++ deb_info("Open bulk EPA config error! data=0x%x \n" , data); ++ goto error; ++ } ++ ++ //3 EPA maxsize packet ++ //3 512:highspeedbulk, 64:fullspeedbulk. ++ //3 940:highspeediso, 940:fullspeediso. ++ ++ //3 get info :HIGH_SPEED or FULL_SPEED ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_STAT, &data) ) goto error; ++ if(data&0x01) ++ { ++ data = 0x00000200; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_MAXPKT, data) ) goto error; ++ ++ data=0; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_MAXPKT, &data) ) goto error; ++ ++ if((data&0xffff)!=0x0200) ++ { ++ deb_info("Open bulk EPA max packet size error!\n"); ++ goto error; ++ } ++ ++ deb_force("RTL2832U %s : USB2.0 HIGH SPEED (480Mb/s)\n", __FUNCTION__); ++ } ++ else ++ { ++ data = 0x00000040; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_MAXPKT, data) ) goto error; ++ ++ data=0; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_MAXPKT, &data) ) goto error; ++ ++ if((data&0xffff)!=0x0200) ++ { ++ deb_info("Open bulk EPA max packet size error!\n"); ++ goto error; ++ } ++ ++ deb_force("RTL2832U %s : USB1.1 FULL SPEED (12Mb/s)\n", __FUNCTION__); ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++static int ++usb_init_setting( ++ struct rtl2832_state* p_state) ++{ ++ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if ( usb_init_bulk_setting(p_state) ) goto error; ++ ++ //3 change fifo length of EPA ++ data = 0x00000014; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_FIFO_CFG, data) ) goto error; ++ data = 0xcccccccc; ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_USB_EPA_FIFO_CFG, &data) ) goto error; ++ if( (data & 0xff) != 0x14) ++ { ++ deb_info("Write error RTD2831_RMAP_INDEX_USB_EPA_FIFO_CFG =0x%x\n",data); ++ goto error; ++ } ++ ++ if ( usb_epa_fifo_reset(p_state) ) goto error; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++static int ++suspend_latch_setting( ++ struct rtl2832_state* p_state, ++ unsigned char resume) ++{ ++ ++ int data; ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if (resume) ++ { ++ //3 Suspend_latch_en = 0 => Set BIT4 = 0 ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data &= (~BIT4); //set bit4 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ } ++ else ++ { ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data |= BIT4; //set bit4 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++error: ++ return 1; ++ ++} ++ ++ ++ ++ ++ ++//3////// DEMOD_CTL1 => IR Setting , IR wakeup from suspend mode ++//3////// if resume =1, resume ++//3////// if resume = 0, suspend ++ ++ ++static int ++demod_ctl1_setting( ++ struct rtl2832_state* p_state, ++ unsigned char resume) ++{ ++ ++ int data; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if(resume) ++ { ++ // IR_suspend ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data &= (~BIT2); //set bit2 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ ++ //Clk_400k ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data &= (~BIT3); //set bit3 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ } ++ else ++ { ++ //Clk_400k ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data |= BIT3; //set bit3 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ ++ // IR_suspend ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, &data) ) goto error; ++ data |= BIT2; //set bit2 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1,data) ) goto error; ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++error: ++ return 1; ++ ++} ++ ++ ++ ++ ++static int ++demod_ctl_setting( ++ struct rtl2832_state* p_state, ++ unsigned char resume, ++ unsigned char on) ++{ ++ ++ int data; ++ unsigned char tmp; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if(resume) ++ { ++ // PLL setting ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data |= BIT7; //set bit7 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ ++ ++ ++ ++ //2 + Begin LOCK ++ // Demod H/W Reset ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT5); //set bit5 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data |= BIT5; //set bit5 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ //3 reset page chache to 0 ++ if ( read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 0, 1, &tmp, 1 ) ) goto error; ++ //2 -End LOCK ++ ++ // delay 5ms ++ platform_wait(5); ++ ++ ++ if(on) ++ { ++ // ADC_Q setting on ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data |= BIT3; //set bit3 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ // ADC_I setting on ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data |= BIT6; //set bit3 to 1 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ } ++ else ++ { ++ // ADC_I setting off ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT6); //set bit3 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ // ADC_Q setting off ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT3); //set bit3 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ } ++ } ++ else ++ { ++ ++ // ADC_I setting ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT6); //set bit3 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ // ADC_Q setting ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT3); //set bit3 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ // PLL setting ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, &data) ) goto error; ++ data &= (~BIT7); //set bit7 to 0 ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_DEMOD_CTL,data) ) goto error; ++ ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++error: ++ return 1; ++ ++} ++ ++ ++static int ++read_tuner_id_register( ++ struct rtl2832_state* p_state, ++ unsigned char tuner_addr, ++ unsigned char tuner_offset, ++ unsigned char* id_data, ++ unsigned char length) ++{ ++ unsigned char i2c_repeater; ++ struct dvb_usb_device* d = p_state->d; ++ ++ //2 + Begin LOCK ++ if(read_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ i2c_repeater |= BIT3; ++ if(write_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ ++ if(read_rtl2832_tuner_register(d, tuner_addr, tuner_offset, id_data, length)) goto error; ++ ++ if(read_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ i2c_repeater &= (~BIT3); ++ if(write_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ //2 - End LOCK ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++static int ++check_mxl5007t_chip_version( ++ struct rtl2832_state* p_state, ++ unsigned char *chipversion) ++{ ++ ++ unsigned char Buffer[LEN_2_BYTE]; ++ unsigned char i2c_repeater; ++ ++ struct dvb_usb_device* d = p_state->d; ++ ++ ++ Buffer[0] = (unsigned char)MXL5007T_I2C_READING_CONST; ++ Buffer[1] = (unsigned char)MXL5007T_CHECK_ADDRESS; ++ ++ ++ if(read_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ i2c_repeater |= BIT3; ++ if(write_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ ++ ++ write_rtl2832_stdi2c(d, MXL5007T_BASE_ADDRESS , Buffer, LEN_2_BYTE); ++ ++ read_rtl2832_stdi2c(d, MXL5007T_BASE_ADDRESS, Buffer, LEN_1_BYTE); ++ ++ if(read_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ i2c_repeater &= (~BIT3); ++ if(write_demod_register(d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 )) goto error; ++ ++ ++ ++ switch(Buffer[0]) ++ { ++ case MXL5007T_CHECK_VALUE: ++ *chipversion = MxL_5007T_V4; ++ break; ++ default: ++ *chipversion = MxL_UNKNOWN_ID; ++ break; ++ } ++ ++ return 0; ++ ++error: ++ ++ return 1; ++ ++} ++ ++ ++ ++ ++ ++ ++static int ++check_tuner_type( ++ struct rtl2832_state *p_state) ++{ ++ ++ unsigned char tuner_id_data[2]; ++ unsigned char chip_version; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ if ((!read_tuner_id_register(p_state, MT2266_TUNER_ADDR, MT2266_OFFSET, tuner_id_data, LEN_1_BYTE)) && ++ ( tuner_id_data[0] == MT2266_CHECK_VAL )) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_MT2266; ++ ++ deb_force("RTL2832U %s : MT2266 tuner on board...\n", __FUNCTION__); ++ } ++ else if ((!read_tuner_id_register(p_state, FC2580_TUNER_ADDR, FC2580_OFFSET, tuner_id_data, LEN_1_BYTE)) && ++ ((tuner_id_data[0]&(~BIT7)) == FC2580_CHECK_VAL )) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_FC2580; ++ ++ deb_force("RTL2832U %s : FC2580 tuner on board...\n", __FUNCTION__); ++ } ++ else if(( !read_tuner_id_register(p_state, MT2063_TUNER_ADDR, MT2063_CHECK_OFFSET, tuner_id_data, LEN_1_BYTE)) && ++ ( tuner_id_data[0]==MT2063_CHECK_VALUE || tuner_id_data[0]==MT2063_CHECK_VALUE_2)) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_MT2063; ++ ++ deb_force("RTL2832U %s : MT2063 tuner on board...\n", __FUNCTION__); ++ ++ } ++ else if(( !read_tuner_id_register(p_state, MAX3543_TUNER_ADDR, MAX3543_CHECK_OFFSET, tuner_id_data, LEN_1_BYTE)) && ++ ( tuner_id_data[0]==MAX3543_CHECK_VALUE)) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_MAX3543; ++ ++ deb_force("RTL2832U %s : MAX3543 tuner on board...\n", __FUNCTION__); ++ ++ } ++ else if ((!read_tuner_id_register(p_state, TUA9001_TUNER_ADDR, TUA9001_OFFSET, tuner_id_data, LEN_2_BYTE)) && ++ (((tuner_id_data[0]<<8)|tuner_id_data[1]) == TUA9001_CHECK_VAL )) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_TUA9001; ++ ++ deb_force("RTL2832U %s : TUA9001 tuner on board...\n", __FUNCTION__); ++ } ++ else if ((!check_mxl5007t_chip_version(p_state, &chip_version)) && ++ (chip_version == MXL5007T_CHECK_VALUE) ) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_MXL5007T; ++ ++ deb_force("RTL2832U %s : MXL5007T tuner on board...\n", __FUNCTION__); ++ } ++ else if ((!read_tuner_id_register(p_state, FC0012_BASE_ADDRESS , FC0012_CHECK_ADDRESS, tuner_id_data, LEN_1_BYTE)) && ++ (tuner_id_data[0] == FC0012_CHECK_VALUE)) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_FC0012; ++ ++ deb_force("RTL2832U %s : FC0012 tuner on board...\n", __FUNCTION__); ++ } ++ else if((!read_tuner_id_register(p_state, E4000_BASE_ADDRESS, E4000_CHECK_ADDRESS, tuner_id_data, LEN_1_BYTE)) && ++ (tuner_id_data[0] == E4000_CHECK_VALUE)) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_E4000; ++ deb_force("RTL2832U %s : E4000 tuner on board...\n", __FUNCTION__); ++ } ++ else if(( !read_tuner_id_register(p_state, TDA18272_TUNER_ADDR, TDA18272_CHECK_OFFSET, tuner_id_data, LEN_2_BYTE)) && ++ ( (tuner_id_data[0]==TDA18272_CHECK_VALUE1) && (tuner_id_data[1]==TDA18272_CHECK_VALUE2))) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_TDA18272; ++ ++ deb_force("RTL2832U %s : Tda18272 tuner on board...\n", __FUNCTION__); ++ ++ } ++ else if ((!read_tuner_id_register(p_state, FC0013_BASE_ADDRESS , FC0013_CHECK_ADDRESS, tuner_id_data, LEN_1_BYTE)) && ++ (tuner_id_data[0] == FC0013_CHECK_VALUE)) ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_FC0013; ++ ++ deb_force("RTL2832U %s : FC0013 tuner on board...\n", __FUNCTION__); ++ } ++ else ++ { ++ p_state->tuner_type = RTL2832_TUNER_TYPE_UNKNOWN; ++ ++ deb_force("RTL2832U %s : ERROR Unknown tuner on board...\n", __FUNCTION__); ++ goto error; ++ } ++ ++ return 0; ++error: ++ return -1; ++} ++ ++static int ++gpio1_output_enable_direction( ++ struct rtl2832_state* p_state) ++{ ++ int data; ++ // GPD_GPIO1=0, GPIO1 output direction ++ data = 0; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT1,data) ) goto error; ++ ++ // GPOE_GPIO1=1, GPIO1 output enable ++ data = 1; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT1,data) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++static int ++gpio6_output_enable_direction( ++ struct rtl2832_state* p_state) ++{ ++ int data; ++ // GPD_GPIO6=0, GPIO6 output direction ++ data = 0; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT6,data) ) goto error; ++ ++ // GPOE_GPIO6=1, GPIO6 output enable ++ data = 1; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT6,data) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++static int ++gpio5_output_enable_direction( ++ struct rtl2832_state* p_state) ++{ ++ int data; ++ // GPD_GPIO5=0, GPIO5 output direction ++ data = 0; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT5,data) ) goto error; ++ ++ // GPOE_GPIO5=1, GPIO5 output enable ++ data = 1; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT5,data) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++static int ++check_dvbt_reset_parameters( ++ ++ struct rtl2832_state* p_state, ++ unsigned long frequency, ++#ifdef V4L2_ONLY_DVB_V5 ++ unsigned long bandwidth_hz, ++#else ++ enum fe_bandwidth bandwidth, ++#endif ++ int* reset_needed) ++{ ++ ++ int is_lock; ++ unsigned int diff_ms; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ *reset_needed = 1; //3initialize "reset_needed" ++ ++#ifdef V4L2_ONLY_DVB_V5 ++ if( (p_state->current_frequency == frequency) && (p_state->current_bandwidth_hz == bandwidth_hz) ) ++#else ++ if( (p_state->current_frequency == frequency) && (p_state->current_bandwidth == bandwidth) ) ++#endif ++ { ++ if( p_state->pNim->IsSignalLocked(p_state->pNim, &is_lock) ) goto error; ++ diff_ms = 0; ++ ++ while( !(is_lock == LOCKED || diff_ms > 200) ) ++ { ++ platform_wait(40); ++ diff_ms += 40; ++ if( p_state->pNim->IsSignalLocked(p_state->pNim, &is_lock) ) goto error; ++ } ++ ++ if (is_lock==YES) ++ { ++ *reset_needed = 0; //3 set "reset_needed" = 0 ++ deb_info("%s : The same frequency = %d setting\n", __FUNCTION__, (int)frequency); ++ } ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ ++ *reset_needed = 1; //3 set "reset_needed" = 1 ++ return 1; ++} ++ ++ ++#if UPDATE_FUNC_ENABLE_2832 ++void ++rtl2832_update_functions(struct work_struct *work) ++{ ++ struct rtl2832_state* p_state = container_of( work, struct rtl2832_state, update2832_procedure_work.work); ++ //unsigned long ber_num, ber_dem; ++ //long snr_num = 0; ++ //long snr_dem = 0; ++ //long _snr= 0; ++ ++ if(p_state->pNim == NULL) ++ { ++ //deb_info("%s error\n", __FUNCTION__); ++ goto mutex_error; ++ } ++ ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if(!p_state->is_frequency_valid) ++ { ++ //deb_info(" %s no need \n", __FUNCTION__); ++ goto advance_exit; ++ } ++ ++ // Update tuner mode ++ deb_info(" +%s run update\n", __FUNCTION__); ++ if( p_state->pNim->UpdateFunction(p_state->pNim)){ ++ deb_info(" --->%s run update fail\n", __FUNCTION__); ++ goto advance_exit; ++ } ++ ++ /* p_state->pNim->UpdateFunction(p_state->pNim); ++ p_state->pNim->GetBer( p_state->pNim , &ber_num , &ber_dem); ++ p_state->pNim->GetSnrDb(p_state->pNim, &snr_num, &snr_dem) ; ++ ++ _snr = snr_num / snr_dem; ++ if( _snr < 0 ) _snr = 0; ++ ++ deb_info("%s : ber = %lu, snr = %lu\n", __FUNCTION__,ber_num,_snr); ++ */ ++ ++advance_exit: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ schedule_delayed_work(&p_state->update2832_procedure_work, UPDATE_PROCEDURE_PERIOD_2832); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ ++ return; ++ ++mutex_error: ++ return; ++ ++} ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2836 ++void ++rtl2836_update_function(struct work_struct *work) ++{ ++ struct rtl2832_state* p_state; ++ unsigned long Per1, Per2; ++ long Data1,Data2; ++ unsigned char data; ++ DTMB_DEMOD_MODULE * pDtmbDemod; ++ ++ p_state = container_of(work , struct rtl2832_state , update2836_procedure_work.work); ++ if(p_state->pNim2836 == NULL) ++ { ++ deb_info("%s error\n", __FUNCTION__); ++ goto mutex_error; ++ } ++ pDtmbDemod = p_state->pNim2836->pDemod; ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ if(!p_state->is_frequency_valid) ++ { ++ deb_info(" %s no need \n", __FUNCTION__); ++ goto advance_exit; ++ } ++ ++ if(pDtmbDemod->UpdateFunction(pDtmbDemod)) ++ { ++ deb_info("%s -- UpdateFunction failed\n", __FUNCTION__); ++ } ++ ++ pDtmbDemod->GetPer(pDtmbDemod,&Per1,&Per2); ++ deb_info("%s -- ***GetPer= %d***\n", __FUNCTION__, (int)Per1); ++ ++ pDtmbDemod->GetSnrDb(pDtmbDemod,&Data1,&Data2); ++ deb_info("%s -- ***SNR = %d***\n",__FUNCTION__, (int)(Data1>>2)); ++ ++ read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_6, 0xc0, &data, LEN_1_BYTE); ++ deb_info("%s --***FSM = %d***\n", __FUNCTION__, (data&0x1f)); ++ ++advance_exit: ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ schedule_delayed_work(&p_state->update2836_procedure_work, UPDATE_PROCEDURE_PERIOD_2836); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return; ++ ++mutex_error: ++ return; ++ ++} ++#endif ++ ++static int ++rtl2832_init( ++ struct dvb_frontend* fe) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ //usb_reset_device(p_state->d->udev); ++ ++ if( usb_init_setting(p_state) ) goto error; ++ ++ if( gpio3_out_setting(p_state) ) goto error; //3Set GPIO3 OUT ++ ++ if( demod_ctl1_setting(p_state , 1) ) goto error; //3 DEMOD_CTL1, resume = 1 ++ ++ if (dvb_use_rtl2832u_card_type) ++ { ++ if( set_demod_power(p_state , 1) ) goto error; //3 turn ON demod power ++ } ++ ++ if( suspend_latch_setting(p_state , 1) ) goto error; //3 suspend_latch_en = 0, resume = 1 ++ ++ if( demod_ctl_setting(p_state , 1, 1) ) goto error; //3 DEMOD_CTL, resume =1; ADC on ++ ++ if( set_tuner_power(p_state, 1, 1) ) goto error; //3 turn ON tuner power ++ ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_TUA9001) ++ { ++ if( gpio1_output_enable_direction(p_state) ) goto error; ++ } ++ else if( p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ //3 MXL5007T : Set GPIO6 OUTPUT_EN & OUTPUT_DIR & OUTPUT_VAL for YUAN ++ int data; ++ if( gpio6_output_enable_direction(p_state) ) goto error; ++ ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ data |= BIT6; ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL,data) ) goto error; ++ ++ } ++ else if( p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012) ++ { ++ int data; ++ if( gpio5_output_enable_direction(p_state)) goto error; ++ ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ data |= BIT5; // set GPIO5 high ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data) ) goto error; ++ data &= ~(BIT5); // set GPIO5 low ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data) ) goto error; ++ } ++ ++ switch(p_state->demod_type) ++ { ++ case RTL2836: ++ { ++ if ( set_demod_2836_power(p_state, 1)) goto error;//32836 on ++ ++ // RTL2832 ADC_I& ADC_Q OFF ++ if( demod_ctl_setting(p_state, 1, 0)) goto error;// ADC off ++ ++ } ++ break; ++ ++ case RTL2840: ++ { ++ if ( set_demod_2840_power(p_state, 1)) goto error;//2840 on ++ ++ // RTL2832 ADC_I& ADC_Q OFF ++ if( demod_ctl_setting(p_state, 1, 0)) goto error;//ADC off ++ } ++ break; ++ } ++ ++ //3 Nim initial ++ switch(p_state->demod_type) ++ { ++ case RTL2832: ++ { ++ // Nim initialize for 2832 ++ if ( p_state->pNim->Initialize(p_state->pNim) ) goto error; ++ } ++ break; ++ ++ case RTL2836: ++ { ++ // Enable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ // Nim initialize for 2836 ++ if ( p_state->pNim2836->Initialize(p_state->pNim2836)) goto error; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0)) goto error; ++ ++ if(dtmb_error_packet_discard) ++ { ++ unsigned char val=0; ++ if(read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x21, &val, LEN_1_BYTE)) goto error; ++ val &= ~(BIT5); ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x21, &val, LEN_1_BYTE)) goto error; ++ ++ if(read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_4, 0x26, &val, LEN_1_BYTE)) goto error; ++ val &= ~(BIT0); ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_4, 0x26, &val, LEN_1_BYTE)) goto error; ++ ++ deb_info(" dtmb discard error packets\n"); ++ } ++ else ++ { ++ deb_info(" dtmb NOT discard error packets\n"); ++ } ++ } ++ break; ++ ++ case RTL2840: ++ { ++ // Enable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ // Nim initialize for 2840 ++ if ( p_state->pNim2840->Initialize(p_state->pNim2840)) goto error; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0)) goto error; ++ } ++ break; ++ } ++ ++ //3 RTL2832U AGC Setting, Serial Mode Switch Setting, PIP Setting based on demod_type ++ if(demod_init_setting(p_state)) goto error; ++ ++ p_state->is_initial = 1; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++#if UPDATE_FUNC_ENABLE_2840 ++ if(p_state->demod_type == RTL2840) ++ schedule_delayed_work(&(p_state->update2840_procedure_work), 0);//3 Initialize update function ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2836 ++ if(p_state->demod_type == RTL2836) ++ schedule_delayed_work(&(p_state->update2836_procedure_work), 0); ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2832 ++ if(p_state->demod_type == RTL2832) ++ schedule_delayed_work(&(p_state->update2832_procedure_work), 0);//3 Initialize update function ++#endif ++ ++ return 0; ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s error end\n", __FUNCTION__); ++ ++ return -1; ++} ++ ++ ++static void ++rtl2832_release( ++ struct dvb_frontend* fe) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ MT2266_EXTRA_MODULE* p_mt2266_extra=NULL; ++ MT2063_EXTRA_MODULE* p_mt2063_extra=NULL; ++ ++ TUNER_MODULE* pTuner=NULL; ++ ++ ++ if( p_state->pNim==NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return; ++ } ++ ++ if( (p_state->is_mt2266_nim_module_built) && (p_state->demod_type==RTL2832) ) ++ { ++ pTuner = p_state->pNim->pTuner; ++ p_mt2266_extra = &(pTuner->Extra.Mt2266); ++ p_mt2266_extra->CloseHandle(pTuner); ++ p_state->is_mt2266_nim_module_built = 0; ++ } ++ ++ if( p_state->is_mt2063_nim_module_built) ++ { ++ ++ switch(p_state->demod_type) ++ { ++ case RTL2832: ++ pTuner=p_state->pNim->pTuner; ++ break; ++ ++ case RTL2840: ++ pTuner=p_state->pNim2840->pTuner; ++ break; ++ ++ } ++ p_mt2063_extra=&(pTuner->Extra.Mt2063); ++ p_mt2063_extra->CloseHandle(pTuner); ++ p_state->is_mt2063_nim_module_built = 0; ++ ++ } ++ ++ if(p_state->is_initial) ++ { ++#if UPDATE_FUNC_ENABLE_2840 ++ if(p_state->demod_type == RTL2840) ++ { ++ cancel_delayed_work( &(p_state->update2840_procedure_work) );//cancel_rearming_delayed_work ++ flush_scheduled_work(); ++ } ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2836 ++ if(p_state->demod_type == RTL2836) ++ { ++ cancel_delayed_work( &(p_state->update2836_procedure_work)); ++ flush_scheduled_work(); ++ } ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2832 ++ if(p_state->demod_type == RTL2832) ++ { ++ cancel_delayed_work( &(p_state->update2832_procedure_work) );//cancel_rearming_delayed_work ++ flush_scheduled_work(); ++ } ++#endif ++ p_state->is_initial = 0; ++ } ++ p_state->is_frequency_valid = 0; ++ //IrDA ++ rtl2832u_remote_control_state = RC_NO_SETTING; ++ ++ kfree(p_state); ++ ++ deb_info(" %s \n", __FUNCTION__); ++ ++ return; ++} ++static int ++rtl2832_sleep_mode(struct rtl2832_state* p_state) ++{ ++ int data=0; ++ ++ ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_MAX3543) ++ { ++ //+set MAX3543_CHECK_VALUE to Default value ++ unsigned char i2c_repeater; ++ unsigned char data = MAX3543_CHECK_VALUE; ++ ++ read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ i2c_repeater |= BIT3; ++ write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ ++ write_rtl2832_tuner_register(p_state->d, MAX3543_TUNER_ADDR, MAX3543_CHECK_OFFSET, &data, LEN_1_BYTE); ++ ++ read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ i2c_repeater &= (~BIT3); ++ write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, 1, 1, &i2c_repeater, 1 ); ++ //-set MAX3543_CHECK_VALUE to Default value ++ } ++ ++ ++ if( p_state->is_initial ) ++ { ++ ++#if UPDATE_FUNC_ENABLE_2840 ++ if(p_state->demod_type == RTL2840) ++ { ++ cancel_delayed_work( &(p_state->update2840_procedure_work)); ++ flush_scheduled_work(); ++ } ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2836 ++ if(p_state->demod_type == RTL2836) ++ { ++ cancel_delayed_work( &(p_state->update2836_procedure_work)); ++ flush_scheduled_work(); ++ } ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2832 ++ if(p_state->demod_type == RTL2832) ++ { ++ cancel_delayed_work( &(p_state->update2832_procedure_work));// cancel_rearming_delayed_work ++ flush_scheduled_work(); ++ } ++#endif ++ p_state->is_initial = 0; ++ } ++ p_state->is_frequency_valid = 0; ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ //3 MXL5007T : Set GPIO6 OUTPUT_VAL OFF for YUAN ++ if ( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ data &= (~BIT6); ++ if ( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL,data) ) goto error; ++ ++ } ++ ++ ++ if( demod_ctl1_setting(p_state , 0) ) goto error; //3 DEMOD_CTL1, resume = 0 ++ ++ if( set_tuner_power(p_state, 1, 0) ) goto error; //3 turn OFF tuner power ++ ++ if( demod_ctl_setting(p_state , 0, 0) ) goto error; //3 DEMOD_CTL, resume =0 ++ ++ if (p_state->demod_type != RTL2832){ ++ set_demod_2836_power(p_state, 0); //3 RTL2836 power OFF ++ deb_info(" ->%s::RTL2836 power OFF\n", __FUNCTION__); ++ set_demod_2840_power(p_state, 0); //3 RTL2840 power OFF ++ deb_info(" ->%s ::RTL2840 power OFF\n", __FUNCTION__); ++ } ++ //2 for H/W reason ++ //if( suspend_latch_setting(p_state , 0) ) goto error; //3 suspend_latch_en = 1, resume = 0 ++ if (dvb_use_rtl2832u_card_type) ++ { ++ deb_info(" -%s ::mini card mode gpio0 set high ,demod power off\n", __FUNCTION__); ++ if( set_demod_power(p_state , 0) ) goto error; //3 turn OFF demod power ++ } ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s fail\n", __FUNCTION__); ++ return 1; ++ ++ ++} ++static int ++rtl2832_sleep( ++ struct dvb_frontend* fe) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ ++ return rtl2832_sleep_mode(p_state); ++} ++ ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int ++rtl2840_set_parameters( ++ struct dvb_frontend* fe) ++{ ++ struct dtv_frontend_properties *param = &fe->dtv_property_cache; ++ struct rtl2832_state *p_state = fe->demodulator_priv; ++ unsigned long frequency = param->frequency; ++ ++ DVBT_DEMOD_MODULE *pDemod2832; ++ int QamMode; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if(p_state->demod_type == RTL2840 && p_state->pNim2840 == NULL ) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ ++ return -1; ++ } ++ ++ ++ deb_info(" +%s Freq=%lu , Symbol rate=%u, QAM=%u\n", __FUNCTION__, frequency, param->symbol_rate, param->modulation); ++ ++ pDemod2832 = p_state->pNim->pDemod; ++ ++ switch(param->modulation) ++ { ++ case QPSK : QamMode = QAM_QAM_4; break; ++ case QAM_16 : QamMode = QAM_QAM_16; break; ++ case QAM_32 : QamMode = QAM_QAM_32; break; ++ case QAM_64 : QamMode = QAM_QAM_64; break; ++ case QAM_128 : QamMode = QAM_QAM_128; break; ++ case QAM_256 : QamMode = QAM_QAM_256; break; ++ ++ case QAM_AUTO : ++ default: ++ deb_info(" XXX %s : unknown QAM \n", __FUNCTION__); ++ goto mutex_error; ++ break; ++ ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ p_state->pNim2840->SetParameters(p_state->pNim2840, frequency, QamMode, param->symbol_rate, QAM_ALPHA_0P15); ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x0)) goto error; ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ ++ deb_info(" -XXX %s \n", __FUNCTION__); ++ ++ return 1; ++ ++} ++#else ++static int ++rtl2840_set_parameters( ++ struct dvb_frontend* fe, ++ struct dvb_frontend_parameters* param) ++{ ++ ++ struct rtl2832_state *p_state = fe->demodulator_priv; ++ struct dvb_qam_parameters *p_qam_param= ¶m->u.qam; ++ unsigned long frequency = param->frequency; ++ ++ DVBT_DEMOD_MODULE *pDemod2832; ++ int QamMode; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ if(p_state->demod_type == RTL2840 && p_state->pNim2840 == NULL ) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ ++ return -1; ++ } ++ ++ ++ deb_info(" +%s Freq=%lu , Symbol rate=%u, QAM=%u\n", __FUNCTION__, frequency, p_qam_param->symbol_rate, p_qam_param->modulation); ++ ++ pDemod2832 = p_state->pNim->pDemod; ++ ++ switch(p_qam_param->modulation) ++ { ++ case QPSK : QamMode = QAM_QAM_4; break; ++ case QAM_16 : QamMode = QAM_QAM_16; break; ++ case QAM_32 : QamMode = QAM_QAM_32; break; ++ case QAM_64 : QamMode = QAM_QAM_64; break; ++ case QAM_128 : QamMode = QAM_QAM_128; break; ++ case QAM_256 : QamMode = QAM_QAM_256; break; ++ ++ case QAM_AUTO : ++ default: ++ deb_info(" XXX %s : unknown QAM \n", __FUNCTION__); ++ goto mutex_error; ++ break; ++ ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ p_state->pNim2840->SetParameters(p_state->pNim2840, frequency, QamMode, p_qam_param->symbol_rate, QAM_ALPHA_0P15); ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x0)) goto error; ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ ++ deb_info(" -XXX %s \n", __FUNCTION__); ++ ++ return 1; ++ ++} ++#endif ++ ++ ++#ifdef V4L2_ONLY_DVB_V5 ++static int ++rtl2832_set_parameters( ++ struct dvb_frontend* fe) ++{ ++ struct dtv_frontend_properties *param = &fe->dtv_property_cache; ++ struct rtl2832_state *p_state = fe->demodulator_priv; ++ ++ unsigned long frequency = param->frequency; ++ int bandwidth_mode; ++ int is_signal_present; ++ int reset_needed; ++ unsigned char data; ++ int int_data; ++ ++ ++ DTMB_DEMOD_MODULE * pDemod2836; ++ DVBT_DEMOD_MODULE * pDemod2832; ++ ++ ++ ++ if( p_state->pNim == NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if(p_state->demod_type == RTL2836 && p_state->pNim2836 == NULL ) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s frequency = %lu , bandwidth = %u\n", __FUNCTION__, frequency , param->bandwidth_hz); ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ if ( check_dvbt_reset_parameters( p_state , frequency , param->bandwidth_hz, &reset_needed) ) goto error; ++ ++ if( reset_needed == 0 ) ++ { ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ return 0; ++ } ++ ++ switch (param->bandwidth_hz) ++ { ++ case 6000000: ++ bandwidth_mode = DVBT_BANDWIDTH_6MHZ; ++ break; ++ ++ case 7000000: ++ bandwidth_mode = DVBT_BANDWIDTH_7MHZ; ++ break; ++ ++ case 8000000: ++ default: ++ bandwidth_mode = DVBT_BANDWIDTH_8MHZ; ++ break; ++ } ++ ++ //add by Dean ++ if (p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012 ) ++ { ++ ++ if( gpio6_output_enable_direction(p_state) ) goto error; ++ ++ ++ if (frequency > 300000000) ++ { ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &int_data); ++ int_data |= BIT6; // set GPIO6 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, int_data); ++ deb_info(" %s : Tuner :FC0012 V-band (GPIO6 high)\n", __FUNCTION__); ++ } ++ else ++ { ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &int_data); ++ int_data &= (~BIT6); // set GPIO6 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, int_data); ++ deb_info(" %s : Tuner :FC0012 U-band (GPIO6 low)\n", __FUNCTION__); ++ ++ } ++ } ++ ++ ++ ++ ++ ++ if ( p_state->pNim->SetParameters( p_state->pNim, frequency , bandwidth_mode ) ) goto error; ++ ++ if ( p_state->pNim->IsSignalPresent( p_state->pNim, &is_signal_present) ) goto error; ++ deb_info(" %s : ****** Signal Present = %d ******\n", __FUNCTION__, is_signal_present); ++ ++ ++ ++ ++ p_state->is_frequency_valid = 1; ++ ++ ++ } ++ else if(p_state->demod_type == RTL2836) ++ { ++ pDemod2836 = p_state->pNim2836->pDemod; ++ pDemod2832 = p_state->pNim->pDemod; ++ ++ //if ( check_dtmb_reset_parameters( p_state , frequency , &reset_needed) ) goto error; ++ //if( reset_needed == 0 ) ++ //{ ++ // mutex_unlock(&p_state->i2c_repeater_mutex); ++ // return 0; ++ //} ++ ++ deb_info("%s: RTL2836 Hold Stage=9\n",__FUNCTION__); ++ if(read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &data, LEN_1_BYTE)) goto error; ++ data &=(~BIT_0_MASK); //reset Reg_present ++ data &=(~BIT_1_MASK); //reset Reg_lock ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &data, LEN_1_BYTE)) goto error; ++ ++ //3 + RTL2836 Hold Stage=9 ++ data = 0x29; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4d, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0xA5; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4e, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x94; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4f, &data, LEN_1_BYTE)) goto error; ++ //3 -RTL2836 Hold Stage=9 ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ if ( p_state->pNim2836->SetParameters( p_state->pNim2836, frequency)) goto error; //no bandwidth setting ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x0)) goto error; ++ ++ if(pDemod2832->SoftwareReset(pDemod2832))//2832 swreset ++ goto error; ++ ++ p_state->is_frequency_valid = 1; ++ if( rtl2836_scan_procedure(p_state)) goto error; ++ } ++ ++ ++//#if(UPDATE_FUNC_ENABLE_2832 == 0) ++ //3 FC0012/E4000 update begin -- ++ if(p_state->demod_type == RTL2832 && (p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012 ++ || p_state->tuner_type == RTL2832_TUNER_TYPE_E4000 ++ || p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013)) ++ { ++ // Enable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error; ++ ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012)//fc0012 ++ { ++ if(rtl2832_fc0012_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_E4000)//e4000 ++ { ++ if(rtl2832_e4000_UpdateTunerMode(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013) //fc0013 ++ { ++ if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error; ++ ++ ++ deb_info("%s : fc0012/e4000 update first\n", __FUNCTION__); ++ ++ msleep(50); ++ ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error; ++ ++ // Update tuner LNA gain with RSSI. ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012)//fc0012 ++ { ++ if(rtl2832_fc0012_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if (p_state->tuner_type == RTL2832_TUNER_TYPE_E4000)//e4000 ++ { ++ if(rtl2832_e4000_UpdateTunerMode(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013) //fc0013 ++ { ++ if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error; ++ ++ deb_info("%s : fc0012/e4000 update 2nd\n", __FUNCTION__); ++ } ++ //3 FC0012/E4000 update end -- ++ ++//#endif ++ ++ p_state->current_frequency = frequency; ++ p_state->current_bandwidth_hz = param->bandwidth_hz; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ p_state->current_frequency = 0; ++ p_state->current_bandwidth_hz = 0; ++ p_state->is_frequency_valid = 0; ++ deb_info(" -%s error end\n", __FUNCTION__); ++ ++ return -1; ++ ++} ++ ++ ++ ++static int ++rtl2832_get_parameters( ++ struct dvb_frontend* fe) ++{ ++ //struct rtl2832_state* p_state = fe->demodulator_priv; ++ return 0; ++} ++ ++#else ++ ++static int ++rtl2832_set_parameters( ++ struct dvb_frontend* fe, ++ struct dvb_frontend_parameters* param) ++{ ++ struct rtl2832_state *p_state = fe->demodulator_priv; ++ struct dvb_ofdm_parameters *p_ofdm_param= ¶m->u.ofdm; ++ ++ unsigned long frequency = param->frequency; ++ int bandwidth_mode; ++ int is_signal_present; ++ int reset_needed; ++ unsigned char data; ++ int int_data; ++ ++ ++ DTMB_DEMOD_MODULE * pDemod2836; ++ DVBT_DEMOD_MODULE * pDemod2832; ++ ++ ++ ++ if( p_state->pNim == NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if(p_state->demod_type == RTL2836 && p_state->pNim2836 == NULL ) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ deb_info(" +%s frequency = %lu , bandwidth = %u\n", __FUNCTION__, frequency ,p_ofdm_param->bandwidth); ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ if ( check_dvbt_reset_parameters( p_state , frequency , p_ofdm_param->bandwidth, &reset_needed) ) goto error; ++ ++ if( reset_needed == 0 ) ++ { ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ return 0; ++ } ++ ++ switch (p_ofdm_param->bandwidth) ++ { ++ case BANDWIDTH_6_MHZ: ++ bandwidth_mode = DVBT_BANDWIDTH_6MHZ; ++ break; ++ ++ case BANDWIDTH_7_MHZ: ++ bandwidth_mode = DVBT_BANDWIDTH_7MHZ; ++ break; ++ ++ case BANDWIDTH_8_MHZ: ++ default: ++ bandwidth_mode = DVBT_BANDWIDTH_8MHZ; ++ break; ++ } ++ ++ //add by Dean ++ if (p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012 ) ++ { ++ ++ if( gpio6_output_enable_direction(p_state) ) goto error; ++ ++ ++ if (frequency > 300000000) ++ { ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &int_data); ++ int_data |= BIT6; // set GPIO6 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, int_data); ++ deb_info(" %s : Tuner :FC0012 V-band (GPIO6 high)\n", __FUNCTION__); ++ } ++ else ++ { ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &int_data); ++ int_data &= (~BIT6); // set GPIO6 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, int_data); ++ deb_info(" %s : Tuner :FC0012 U-band (GPIO6 low)\n", __FUNCTION__); ++ ++ } ++ } ++ ++ ++ ++ ++ ++ if ( p_state->pNim->SetParameters( p_state->pNim, frequency , bandwidth_mode ) ) goto error; ++ ++ if ( p_state->pNim->IsSignalPresent( p_state->pNim, &is_signal_present) ) goto error; ++ deb_info(" %s : ****** Signal Present = %d ******\n", __FUNCTION__, is_signal_present); ++ ++ ++ ++ ++ p_state->is_frequency_valid = 1; ++ ++ ++ } ++ else if(p_state->demod_type == RTL2836) ++ { ++ pDemod2836 = p_state->pNim2836->pDemod; ++ pDemod2832 = p_state->pNim->pDemod; ++ ++ //if ( check_dtmb_reset_parameters( p_state , frequency , &reset_needed) ) goto error; ++ //if( reset_needed == 0 ) ++ //{ ++ // mutex_unlock(&p_state->i2c_repeater_mutex); ++ // return 0; ++ //} ++ ++ deb_info("%s: RTL2836 Hold Stage=9\n",__FUNCTION__); ++ if(read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &data, LEN_1_BYTE)) goto error; ++ data &=(~BIT_0_MASK); //reset Reg_present ++ data &=(~BIT_1_MASK); //reset Reg_lock ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &data, LEN_1_BYTE)) goto error; ++ ++ //3 + RTL2836 Hold Stage=9 ++ data = 0x29; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4d, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0xA5; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4e, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x94; ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0x4f, &data, LEN_1_BYTE)) goto error; ++ //3 -RTL2836 Hold Stage=9 ++ ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x1) ) goto error; ++ ++ if ( p_state->pNim2836->SetParameters( p_state->pNim2836, frequency)) goto error; //no bandwidth setting ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod2832->SetRegBitsWithPage(pDemod2832, DVBT_IIC_REPEAT, 0x0)) goto error; ++ ++ if(pDemod2832->SoftwareReset(pDemod2832))//2832 swreset ++ goto error; ++ ++ p_state->is_frequency_valid = 1; ++ if( rtl2836_scan_procedure(p_state)) goto error; ++ } ++ ++ ++//#if(UPDATE_FUNC_ENABLE_2832 == 0) ++ //3 FC0012/E4000 update begin -- ++ if(p_state->demod_type == RTL2832 && (p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012 ++ || p_state->tuner_type == RTL2832_TUNER_TYPE_E4000 ++ || p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013)) ++ { ++ // Enable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error; ++ ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012)//fc0012 ++ { ++ if(rtl2832_fc0012_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_E4000)//e4000 ++ { ++ if(rtl2832_e4000_UpdateTunerMode(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013) //fc0013 ++ { ++ if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error; ++ ++ ++ deb_info("%s : fc0012/e4000 update first\n", __FUNCTION__); ++ ++ msleep(50); ++ ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error; ++ ++ // Update tuner LNA gain with RSSI. ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012)//fc0012 ++ { ++ if(rtl2832_fc0012_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if (p_state->tuner_type == RTL2832_TUNER_TYPE_E4000)//e4000 ++ { ++ if(rtl2832_e4000_UpdateTunerMode(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013) //fc0013 ++ { ++ if(rtl2832_fc0013_UpdateTunerLnaGainWithRssi(p_state->pNim) != FUNCTION_SUCCESS) ++ goto error; ++ } ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(p_state->pNim->pDemod->SetRegBitsWithPage(p_state->pNim->pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error; ++ ++ deb_info("%s : fc0012/e4000 update 2nd\n", __FUNCTION__); ++ } ++ //3 FC0012/E4000 update end -- ++ ++//#endif ++ ++ p_state->current_frequency = frequency; ++ p_state->current_bandwidth = p_ofdm_param->bandwidth; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ p_state->current_frequency = 0; ++ p_state->current_bandwidth = -1; ++ p_state->is_frequency_valid = 0; ++ deb_info(" -%s error end\n", __FUNCTION__); ++ ++ return -1; ++ ++} ++ ++ ++ ++static int ++rtl2832_get_parameters( ++ struct dvb_frontend* fe, ++ struct dvb_frontend_parameters* param) ++{ ++ //struct rtl2832_state* p_state = fe->demodulator_priv; ++ return 0; ++} ++#endif ++ ++ ++ ++static int ++rtl2832_read_status( ++ struct dvb_frontend* fe, ++ fe_status_t* status) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ int is_lock; ++ unsigned long ber_num, ber_dem; ++ long snr_num, snr_dem, snr; ++ ++ ++ if( p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ *status = 0; //3initialize "status" ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ ++ if( p_state->pNim->GetBer( p_state->pNim , &ber_num , &ber_dem) ) goto error; ++ ++ if (p_state->pNim->GetSnrDb(p_state->pNim, &snr_num, &snr_dem) ) goto error; ++ ++ if( p_state->pNim->IsSignalLocked(p_state->pNim, &is_lock) ) goto error; ++ ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ ++ snr = snr_num/snr_dem; ++ ++ deb_info("%s :******RTL2832 Signal Lock=%d******\n", __FUNCTION__, is_lock); ++ deb_info("%s : ber_num = %d\n", __FUNCTION__, (unsigned int)ber_num); ++ deb_info("%s : snr = %d \n", __FUNCTION__, (int)snr); ++ } ++ else if(p_state->demod_type == RTL2836)//3Need Change ? ++ { ++ unsigned char val; ++ ++ if( p_state->pNim2836 == NULL) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) ++ goto error; ++ ++ if(val & BIT_1_MASK) is_lock = YES; ++ else is_lock = NO; ++ ++ //if(p_state->pNim2836->pDemod->IsSignalLocked(p_state->pNim2836->pDemod, &is_lock)) ++ // goto error; ++ ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ ++ deb_info("%s :******RTL2836 Signal Lock=%d******\n", __FUNCTION__, is_lock); ++ } ++ else if(p_state->demod_type == RTL2840) ++ { ++ ++ if( p_state->pNim2840 == NULL) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(p_state->pNim2840->IsSignalLocked(p_state->pNim2840, &is_lock) != FUNCTION_SUCCESS) goto error; ++ ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ ++ deb_info("%s :******RTL2840 Signal Lock=%d******\n", __FUNCTION__, is_lock); ++ ++ } ++ ++ ++#if(UPDATE_FUNC_ENABLE_2832 == 0) ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012 || ++ p_state->tuner_type == RTL2832_TUNER_TYPE_E4000 || ++ p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013 ) ++ { ++ // Update tuner LNA gain with RSSI. ++ if( p_state->pNim->UpdateFunction(p_state->pNim)) ++ goto error; ++ }//3 ++ } ++#endif ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ return -1; ++} ++ ++ ++static int ++rtl2832_read_ber( ++ struct dvb_frontend* fe, ++ u32* ber) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ unsigned long ber_num, ber_dem; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if( p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ ++ if( p_state->pNim->GetBer( p_state->pNim , &ber_num , &ber_dem) ) ++ { ++ *ber = 19616; ++ goto error; ++ } ++ *ber = ber_num; ++ deb_info(" %s : ber = 0x%x \n", __FUNCTION__, *ber); ++ } ++ else if(p_state->demod_type == RTL2836)//read PER ++ { ++ unsigned long per1, per2; ++ if( p_state->pNim2836 == NULL) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if( p_state->pNim2836->pDemod->GetPer(p_state->pNim2836->pDemod, &per1, &per2)) ++ { ++ *ber = 19616; ++ goto error; ++ } ++ *ber = per1; ++ deb_info(" %s : RTL2836 per = 0x%x \n", __FUNCTION__, *ber); ++ } ++ else if (p_state->demod_type == RTL2840) ++ { ++ unsigned long per1, per2, ber1, ber2; ++ ++ if( p_state->pNim2840 == NULL) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ if( p_state->pNim2840->GetErrorRate(p_state->pNim2840, 5, 1000, &ber1, &ber2, &per1, &per2)) ++ { ++ *ber = 19616; ++ goto error; ++ } ++ ++ *ber = ber1; ++ deb_info(" %s : RTL2840 ber = 0x%x \n", __FUNCTION__, *ber); ++ } ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s ERROR\n", __FUNCTION__); ++ return -1; ++} ++static int fc0012_get_signal_strength(struct rtl2832_state *p_state,unsigned long *strength) ++{ ++ int intTemp=0; ++ int Power=0; ++ int intTotalAGCGain=0; ++ int intLNA=0; ++ unsigned char ReadingByte=0; ++ int LnaGain_reg=0; ++ int NumberOfLnaGainTable=0; ++ int i=0; ++ int Index=0; ++ TUNER_MODULE *pTuner=NULL; ++ DVBT_DEMOD_MODULE *pDemod = NULL; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if(p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ pDemod = p_state->pNim->pDemod; ++ pTuner = p_state->pNim->pTuner; ++ ++ // Enable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x1) != FUNCTION_SUCCESS) ++ goto error; ++ ++ if(FC0012_Write(pTuner, 0x12, 0x00) != FUNCTION_SUCCESS) ++ goto error; ++ ++ if(FC0012_Read(pTuner, 0x12, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error; ++ intTemp=(int)ReadingByte; ++ ++ if(FC0012_Read(pTuner, 0x13, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error; ++ LnaGain_reg=(int)ReadingByte&0x7f; ++ ++ // Disable demod DVBT_IIC_REPEAT. ++ if(pDemod->SetRegBitsWithPage(pDemod, DVBT_IIC_REPEAT, 0x0) != FUNCTION_SUCCESS) ++ goto error; ++ ++ NumberOfLnaGainTable=sizeof(FC0012_LNA_GAIN_TABLE)/sizeof(FC0012_LNA_REG_MAP); ++ Index=-1; ++ for (i=0;i> 5) - 7) -2) * 2 + (intTemp & 0x1F) * 2); ++ ++ Power= INPUT_ADC_LEVEL - intTotalAGCGain - (intLNA/10); ++ ++ deb_info(" %s power=%d form fc0012(%x,%x,%x)\n", __FUNCTION__,Power,intTemp,LnaGain_reg,intLNA); ++ ++ //Signal Strength : map power to 0~100 ++ ++ ++ if(Power >=-45) ++ { ++ *strength=100; ++ ++ } ++ else if(Power <-95) ++ *strength=0; ++ else ++ *strength = ((Power+45)*100)/50+100; ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++error: ++ deb_info(" -%s ERROR\n", __FUNCTION__); ++ return -1; ++} ++int ++rtl2832_read_signal_strength( ++ struct dvb_frontend* fe, ++ u16* strength) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ unsigned long _strength; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if( p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ ++ if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012) ++ { ++ if (fc0012_get_signal_strength(p_state,&_strength)) ++ { ++ *strength = 0; ++ goto error; ++ } ++ ++#if 0 ++ /* this is wrong, as _strength is in the range [0,100] */ ++ *strength = (_strength<<8) | _strength; ++#else ++ /* scale *strength in the proper range [0,0xffff] */ ++ *strength = (_strength * 0xffff) / 100; ++#endif ++ deb_info(" %s : use FC0012 strength = 0x%x(%d) \n", __FUNCTION__, *strength,*strength); ++ } ++ else if(p_state->demod_type == RTL2832) ++ { ++ ++ if( p_state->pNim->GetSignalStrength( p_state->pNim , &_strength) ) ++ { ++ *strength = 0; ++ goto error; ++ } ++ ++#if 0 ++ /* this is wrong, as _strength is in the range [0,100] */ ++ *strength = (_strength<<8) | _strength; ++#else ++ /* scale *strength in the proper range [0,0xffff] */ ++ *strength = (_strength * 0xffff) / 100; ++#endif ++ ++ deb_info(" %s : RTL2832 strength = 0x%x \n", __FUNCTION__, *strength); ++ } ++ else if(p_state->demod_type == RTL2836) ++ { ++ if(p_state->pNim2836 == NULL) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(p_state->pNim2836->pDemod->GetSignalStrength( p_state->pNim2836->pDemod , &_strength))// if(p_state->pNim2836->GetSignalStrength( p_state->pNim2836 , &_strength) ) ++ { ++ *strength = 0; ++ goto error; ++ } ++ ++#if 0 ++ /* this is wrong, as _strength is in the range [0,100] */ ++ *strength = (_strength<<8) | _strength; ++#else ++ /* scale *strength in the proper range [0,0xffff] */ ++ *strength = (_strength * 0xffff) / 100; ++#endif ++ ++ deb_info(" %s : RTL2836 strength = 0x%x \n", __FUNCTION__, *strength); ++ } ++ else if(p_state->demod_type == RTL2840) ++ { ++ if(p_state->pNim2840 == NULL) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(p_state->pNim2840->pDemod->GetSignalStrength( p_state->pNim2840->pDemod , &_strength))// if(p_state->pNim2836->GetSignalStrength( p_state->pNim2836 , &_strength) ) ++ { ++ *strength = 0; ++ goto error; ++ } ++ ++#if 0 ++ /* this is wrong, as _strength is in the range [0,100] */ ++ *strength = (_strength<<8) | _strength; ++#else ++ /* scale *strength in the proper range [0,0xffff] */ ++ *strength = (_strength * 0xffff) / 100; ++#endif ++ ++ deb_info(" %s : RTL2840 strength = 0x%x \n", __FUNCTION__, *strength); ++ } ++ ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s ERROR\n", __FUNCTION__); ++ return -1; ++} ++ ++ ++int ++rtl2832_read_signal_quality( ++ struct dvb_frontend* fe, ++ u32* quality) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ unsigned long _quality; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ if( p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ if ( p_state->pNim->GetSignalQuality( p_state->pNim , &_quality) ) ++ { ++ *quality = 0; ++ goto error; ++ } ++ } ++ else if(p_state->demod_type == RTL2836) ++ { ++ if( p_state->pNim2836 == NULL) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if ( p_state->pNim2836->pDemod->GetSignalQuality( p_state->pNim2836->pDemod , &_quality) )//if ( p_state->pNim->GetSignalQuality( p_state->pNim , &_quality) ) ++ { ++ *quality = 0; ++ goto error; ++ } ++ } ++ else if(p_state->demod_type == RTL2840) ++ { ++ if( p_state->pNim2840 == NULL) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if ( p_state->pNim2840->pDemod->GetSignalQuality( p_state->pNim2840->pDemod , &_quality) )//if ( p_state->pNim->GetSignalQuality( p_state->pNim , &_quality) ) ++ { ++ *quality = 0; ++ goto error; ++ } ++ } ++ ++ *quality = _quality; ++ ++ deb_info(" %s : quality = 0x%x \n", __FUNCTION__, *quality); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s ERROR\n", __FUNCTION__); ++ return -1; ++} ++ ++ ++ ++static int ++rtl2832_read_snr( ++ struct dvb_frontend* fe, ++ u16* snr) ++{ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ long snr_num = 0; ++ long snr_dem = 0; ++ long _snr= 0; ++ int pConstellation; ++ int pHierarchy; ++ int pCodeRateLp; ++ int pCodeRateHp; ++ int pGuardInterval; ++ int pFftMode; ++ ++ // max dB for each constellation ++ static const int snrMaxDb[DVBT_CONSTELLATION_NUM] = { 23, 26, 29, }; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ if( p_state->pNim== NULL) ++ { ++ deb_info(" %s pNim = NULL \n", __FUNCTION__); ++ return -1; ++ } ++ ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; ++ ++ if(p_state->demod_type == RTL2832) ++ { ++ if (p_state->pNim->GetSnrDb(p_state->pNim, &snr_num, &snr_dem) ) ++ { ++ *snr = 0; ++ goto error; ++ } ++ ++ if (dvb_usb_rtl2832u_snrdb == 0) ++ { ++ p_state->pNim->GetTpsInfo(p_state->pNim, &pConstellation, &pHierarchy, &pCodeRateLp, &pCodeRateHp, &pGuardInterval, &pFftMode); ++ _snr = ((snr_num / snr_dem) * 0xffff) / snrMaxDb[pConstellation]; ++ if ( _snr > 0xffff ) _snr = 0xffff; ++ if ( _snr < 0 ) _snr = 0; ++ } ++ else ++ { ++ _snr = snr_num / snr_dem; ++ if( _snr < 0 ) _snr = 0; ++ } ++ ++ *snr = _snr; ++ ++ deb_info(" %s SNR_NUM=%lu SNR_DEM=%lu SNR=%u Costellation=%u\n", __FUNCTION__,snr_num,snr_dem,*snr,pConstellation); ++ } ++ ++ else if(p_state->demod_type == RTL2836) ++ { ++ if( p_state->pNim2836 == NULL) ++ { ++ deb_info(" %s pNim2836 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(p_state->pNim2836->pDemod->GetSnrDb(p_state->pNim2836->pDemod, &snr_num, &snr_dem)) ++ { ++ *snr = 0; ++ goto error; ++ } ++ *snr = snr_num>>2; ++ } ++ else if(p_state->demod_type == RTL2840) ++ { ++ if( p_state->pNim2840 == NULL) ++ { ++ deb_info(" %s pNim2840 = NULL \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if(p_state->pNim2840->pDemod->GetSnrDb(p_state->pNim2840->pDemod, &snr_num, &snr_dem)) ++ { ++ *snr = 0; ++ goto error; ++ } ++ *snr = snr_num/snr_dem; ++ } ++ ++ ++ deb_info(" %s : snr = %d \n", __FUNCTION__, *snr); ++ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++ return 0; ++ ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ ++mutex_error: ++ deb_info(" -%s ERROR\n", __FUNCTION__); ++ return -1; ++} ++ ++ ++ ++static int ++rtl2832_get_tune_settings( ++ struct dvb_frontend* fe, ++ struct dvb_frontend_tune_settings* fe_tune_settings) ++{ ++ deb_info(" %s : Do Nothing\n", __FUNCTION__); ++ fe_tune_settings->min_delay_ms = 1000; ++ return 0; ++} ++ ++ ++static int ++rtl2832_ts_bus_ctrl( ++ struct dvb_frontend* fe, ++ int acquire) ++{ ++ deb_info(" %s : Do Nothing\n", __FUNCTION__); ++ return 0; ++} ++ ++ ++ ++ ++static struct dvb_frontend_ops rtl2832_dvbt_ops; ++static struct dvb_frontend_ops rtl2840_dvbc_ops; ++static struct dvb_frontend_ops rtl2836_dtmb_ops; ++ ++ ++struct dvb_frontend* rtl2832u_fe_attach(struct dvb_usb_device *d) ++{ ++ ++ struct rtl2832_state *p_state= NULL; ++ //char tmp_set_tuner_power_gpio4; ++ ++ deb_info("+%s : chialing 0409-1\n", __FUNCTION__); ++ ++ //3 linux fe_attach necessary setting ++ /*allocate memory for the internal state */ ++ p_state = kzalloc(sizeof(struct rtl2832_state), GFP_KERNEL); ++ if (p_state == NULL) goto error; ++ memset(p_state,0,sizeof(*p_state)); ++ ++ p_state->is_mt2266_nim_module_built = 0; //initialize is_mt2266_nim_module_built ++ p_state->is_mt2063_nim_module_built = 0; //initialize is_mt2063_nim_module_built ++ ++ p_state->is_initial = 0; //initialize is_initial ++ p_state->is_frequency_valid = 0; ++ p_state->d = d; ++ ++ p_state->b_rtl2840_power_onoff_once = 0; ++ ++ if( usb_init_setting(p_state) ) goto error; ++ ++ if( gpio3_out_setting(p_state) ) goto error; //3Set GPIO3 OUT ++ ++ if( demod_ctl1_setting(p_state , 1) ) goto error; //3 DEMOD_CTL1, resume = 1 ++ if (dvb_use_rtl2832u_card_type) ++ { ++ if( set_demod_power(p_state , 1) ) goto error; ++ } ++ ++ if( suspend_latch_setting(p_state , 1) ) goto error; //3 suspend_latch_en = 0, resume = 1 ++ ++ if( demod_ctl_setting(p_state , 1, 1) ) goto error; //3 DEMOD_CTL, resume =1; ADC on ++ ++ //3 Auto detect Tuner Power Pin (GPIO3 or GPIO4) ++ if( set_tuner_power(p_state , 1 , 1) ) goto error; //3 turn ON tuner power, 1st try GPIO4 ++ ++ if( check_tuner_type(p_state) ) goto error; ++ ++ //3 Check if support RTL2836 DTMB. ++ p_state->demod_support_type = 0; ++ check_dtmb_support(p_state); //2836 is off in the end of check_dtmb_support() ++ check_dvbc_support(p_state); ++ ++ //3Set demod_type. ++ p_state->demod_ask_type = demod_default_type; ++ if((p_state->demod_ask_type == RTL2836) && (p_state->demod_support_type & SUPPORT_DTMB_MODE)) ++ { ++ p_state->demod_type = RTL2836; ++ } ++ else if((p_state->demod_ask_type == RTL2840) && (p_state->demod_support_type & SUPPORT_DVBC_MODE)) ++ { ++ p_state->demod_type = RTL2840; ++ } ++ else ++ { ++ p_state->demod_type = RTL2832; ++ } ++ deb_info("demod_type is %d\n", p_state->demod_type); ++ ++ //3 Build Nim Module ++ build_nim_module(p_state); ++ ++ /* setup the state */ ++ switch(p_state->demod_type) ++ { ++ case RTL2832: ++ memcpy(&p_state->frontend.ops, &rtl2832_dvbt_ops, sizeof(struct dvb_frontend_ops)); ++#ifndef V4L2_ONLY_DVB_V5 ++ memset(&p_state->fep, 0, sizeof(struct dvb_frontend_parameters)); ++#endif ++ break; ++ case RTL2836: ++ memcpy(&p_state->frontend.ops, &rtl2836_dtmb_ops, sizeof(struct dvb_frontend_ops)); ++#ifndef V4L2_ONLY_DVB_V5 ++ memset(&p_state->fep, 0, sizeof(struct dvb_frontend_parameters)); ++#endif ++ break; ++ ++ case RTL2840: ++ memcpy(&p_state->frontend.ops, &rtl2840_dvbc_ops, sizeof(struct dvb_frontend_ops)); ++#ifndef V4L2_ONLY_DVB_V5 ++ memset(&p_state->fep, 0, sizeof(struct dvb_frontend_parameters)); ++#endif ++ break; ++ } ++ ++ ++ /* create dvb_frontend */ ++ p_state->frontend.demodulator_priv = p_state; ++ ++#if UPDATE_FUNC_ENABLE_2836 ++ INIT_DELAYED_WORK(&(p_state->update2836_procedure_work), rtl2836_update_function); ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2832 ++ INIT_DELAYED_WORK(&(p_state->update2832_procedure_work), rtl2832_update_functions); ++#endif ++ mutex_init(&p_state->i2c_repeater_mutex); ++ if (dvb_use_rtl2832u_rc_mode<3){ ++ deb_info(">>%s go to sleep mode(low power mode)\n", __FUNCTION__); ++ if (rtl2832_sleep_mode(p_state)){ ++ deb_info("sleep mode is fail \n"); ++ } ++ } ++ deb_info("-%s\n", __FUNCTION__); ++ return &p_state->frontend; ++ ++error: ++ return NULL; ++ ++ ++} ++ ++ ++ ++static struct dvb_frontend_ops rtl2840_dvbc_ops = { ++#ifdef V4L2_ONLY_DVB_V5 ++ /* TODO: check if rtl2840 supports also SYS_DVBC_ANNEX_C */ ++ .delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C }, ++#endif ++ .info = { ++ .name = "Realtek DVB-C RTL2840 ", ++#ifndef V4L2_ONLY_DVB_V5 ++ .type = FE_QAM, ++#endif ++ .frequency_min = 50000000, ++ .frequency_max = 862000000, ++ .frequency_stepsize = 166667, ++ .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | ++ FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | ++ FE_CAN_FEC_AUTO | ++ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | ++ FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | ++ FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER | ++ FE_CAN_MUTE_TS ++ }, ++ ++ .init = rtl2832_init, ++ .release = rtl2832_release, ++ ++ .sleep = rtl2832_sleep, ++ ++ .set_frontend = rtl2840_set_parameters, ++ .get_frontend = rtl2832_get_parameters, ++ .get_tune_settings = rtl2832_get_tune_settings, ++ ++ .read_status = rtl2832_read_status, ++ .read_ber = rtl2832_read_ber, ++ .read_signal_strength = rtl2832_read_signal_strength, ++ .read_snr = rtl2832_read_snr, ++ .read_ucblocks = rtl2832_read_signal_quality, ++ .ts_bus_ctrl = rtl2832_ts_bus_ctrl, ++}; ++ ++ ++ ++ ++static struct dvb_frontend_ops rtl2832_dvbt_ops = { ++#ifdef V4L2_ONLY_DVB_V5 ++ .delsys = { SYS_DVBT }, ++#endif ++ .info = { ++ .name = "Realtek DVB-T RTL2832", ++#ifndef V4L2_ONLY_DVB_V5 ++ .type = FE_OFDM, ++#endif ++ .frequency_min = 50000000, ++ .frequency_max = 862000000, ++ .frequency_stepsize = 166667, ++ .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | ++ FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | ++ FE_CAN_FEC_AUTO | ++ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | ++ FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | ++ FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER | ++ FE_CAN_MUTE_TS ++ }, ++ ++ .init = rtl2832_init, ++ .release = rtl2832_release, ++ ++ .sleep = rtl2832_sleep, ++ ++ .set_frontend = rtl2832_set_parameters, ++ .get_frontend = rtl2832_get_parameters, ++ .get_tune_settings = rtl2832_get_tune_settings, ++ ++ .read_status = rtl2832_read_status, ++ .read_ber = rtl2832_read_ber, ++ .read_signal_strength = rtl2832_read_signal_strength, ++ .read_snr = rtl2832_read_snr, ++ .read_ucblocks = rtl2832_read_signal_quality, ++ .ts_bus_ctrl = rtl2832_ts_bus_ctrl, ++}; ++ ++static struct dvb_frontend_ops rtl2836_dtmb_ops = { ++#ifdef V4L2_ONLY_DVB_V5 ++ .delsys = { SYS_DMBTH }, ++#endif ++ .info = { ++ .name = "Realtek DTMB RTL2836", ++#ifndef V4L2_ONLY_DVB_V5 ++ .type = FE_OFDM, ++#endif ++ .frequency_min = 50000000, ++ .frequency_max = 862000000, ++ .frequency_stepsize = 166667, ++ .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | ++ FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | ++ FE_CAN_FEC_AUTO | ++ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | ++ FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | ++ FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER | ++ FE_CAN_MUTE_TS ++ }, ++ ++ .init = rtl2832_init, ++ .release = rtl2832_release, ++ ++ .sleep = rtl2832_sleep, ++ ++ .set_frontend = rtl2832_set_parameters, ++ .get_frontend = rtl2832_get_parameters, ++ .get_tune_settings = rtl2832_get_tune_settings, ++ ++ .read_status = rtl2832_read_status, ++ .read_ber = rtl2832_read_ber, ++ .read_signal_strength = rtl2832_read_signal_strength, ++ .read_snr = rtl2832_read_snr, ++ .read_ucblocks = rtl2832_read_signal_quality, ++ .ts_bus_ctrl = rtl2832_ts_bus_ctrl, ++}; ++ ++ ++ ++/* DTMB related */ ++ ++static int ++check_dtmb_support( ++ struct rtl2832_state* p_state) ++{ ++ ++ int status; ++ unsigned char buf[LEN_2_BYTE]; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ set_demod_2836_power(p_state, 1); //on ++ ++ status = read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_5, 0x10, buf, LEN_2_BYTE); ++ ++ if(!status && ( buf[0]==0x04 ) && ( buf[1]==0x00 )) ++ { ++ p_state->demod_support_type |= SUPPORT_DTMB_MODE; ++ deb_info(" -%s RTL2836 on broad.....\n", __FUNCTION__); ++ } ++ else ++ { ++ p_state->demod_support_type &= (~SUPPORT_DTMB_MODE); ++ deb_info(" -%s RTL2836 NOT FOUND.....\n", __FUNCTION__); ++ } ++ ++ set_demod_2836_power(p_state, 0); //off ++ ++ //3 Always support DVBT ++ p_state->demod_support_type |= SUPPORT_DVBT_MODE; ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++} ++ ++ ++ ++/* DVB-C related */ ++ ++static int ++check_dvbc_support( ++ struct rtl2832_state* p_state) ++{ ++ ++ int status; ++ unsigned char buf; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ set_demod_2840_power(p_state, 1); ++ ++ status = read_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x04, &buf, LEN_1_BYTE); ++ ++ if(!status) ++ { ++ p_state->demod_support_type |= SUPPORT_DVBC_MODE; ++ deb_info(" -%s RTL2840 on broad.....\n", __FUNCTION__); ++ } ++ else ++ { ++ p_state->demod_support_type &= (~SUPPORT_DVBC_MODE); ++ deb_info(" -%s RTL2840 NOT FOUND.....\n", __FUNCTION__); ++ } ++ ++ set_demod_2840_power(p_state, 0); ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++} ++ ++ ++ ++static int ++set_demod_2836_power( ++ struct rtl2832_state* p_state, ++ int onoff) ++{ ++ ++ int data; ++ unsigned char datachar; ++ ++ deb_info(" +%s onoff = %d\n", __FUNCTION__, onoff); ++ ++ //2 First RTL2836 Power ON ++ ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ //3 a. Set GPIO 0 LOW ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data)) goto error; ++ data &= ~(BIT0); // set GPIO0 low ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data)) goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC2580) ++ { ++ ++ //3 b. Set GPIO 5 LOW ++ if( gpio5_output_enable_direction(p_state)) goto error; ++ ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data) ) goto error; ++ data &= ~(BIT5); // set GPIO5 low ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data) ) goto error; ++ } ++ ++ if(onoff) ++ { ++ //3 2. RTL2836 AGC = 1 ++ if ( read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_0, 0x01, &datachar, LEN_1_BYTE)) goto error; ++ datachar |=BIT_2_MASK; ++ datachar &=(~BIT_3_MASK); ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_0, 0x01, &datachar, LEN_1_BYTE)) goto error; ++ } ++ else ++ { ++ ++ //3 2. RTL2836 AGC = 0 ++ ++ if ( read_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_0, 0x01, &datachar, LEN_1_BYTE)) goto error; ++ datachar &=(~BIT_2_MASK); ++ datachar &=(~BIT_3_MASK); ++ if(write_rtl2836_demod_register(p_state->d, RTL2836_DEMOD_ADDR, PAGE_0, 0x01, &datachar, LEN_1_BYTE)) goto error; ++ ++ ++ //3 3. RTL2836 Power OFF ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ //3 4.a. Set GPIO 0 HIGH ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data)) goto error; ++ data |= BIT0; // set GPIO0 high ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data)) goto error; ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC2580) ++ { ++ ++ //3 4.b. Set GPIO 5 HIGH ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data)) goto error; ++ data |= BIT5; // set GPIO5 high ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data)) goto error; ++ } ++ } ++ ++ ++ deb_info(" -%s onoff = %d\n", __FUNCTION__, onoff); ++ return 0; ++ ++error: ++ deb_info(" -%s onoff = %d fail\n", __FUNCTION__, onoff); ++ return 1; ++ ++} ++ ++ ++ ++ ++ ++ ++static int ++rtl2840_on_hwreset( ++ struct rtl2832_state* p_state) ++{ ++ unsigned char buf; ++ int data; ++ int time = 0; ++ ++ deb_info(" +%s \n", __FUNCTION__); ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data |= BIT0; // set GPIO0 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data |= BIT6; // set GPIO6 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ ++ platform_wait(25); //wait 25ms ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data &= (~BIT6); // set GPIO6 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ ++ platform_wait(25); //wait 25ms ++ ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data &= (~BIT0); // set GPIO0 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ ++ platform_wait(25); //wait 25ms ++ ++ read_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x01, &buf, LEN_1_BYTE); ++ ++ while( (buf!=0xa3) && (time<2) ) ++ { ++ ++ // Set GPIO 6 HIGH ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data |= BIT6; // set GPIO6 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ platform_wait(25); //wait 25ms ++ ++ // Set GPIO 0 HIGH ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data |= BIT0; // set GPIO0 high ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ platform_wait(25); //wait 25ms ++ ++ // Set GPIO 6 LOW ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data &= (~BIT6); // set GPIO6 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ platform_wait(25); //wait 25ms ++ ++ // Set GPIO 0 LOW ++ read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data); ++ data &= (~BIT0); // set GPIO0 low ++ write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data); ++ platform_wait(25); //wait 25ms ++ ++ read_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x01, &buf, LEN_1_BYTE); ++ deb_info(" +%s Page 0, addr 0x01 = 0x%x\n", __FUNCTION__, buf); ++ time++; ++ } ++ ++ deb_info(" -%s \n", __FUNCTION__); ++ ++ return 0; ++ ++} ++ ++ ++ ++static int ++set_demod_2840_power( ++ struct rtl2832_state* p_state, ++ int onoff) ++{ ++ unsigned char buf; ++ int data; ++ ++ deb_info(" +%s onoff = %d\n", __FUNCTION__, onoff); ++ ++ //3 1.a RTL2840 Power ON Set GPIO 0 LOW ++ if(p_state->b_rtl2840_power_onoff_once) ++ { ++ //3 a. Set GPIO 0 LOW ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data)) goto error; ++ data &= ~(BIT0); // set GPIO0 low ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data)) goto error; ++ ++ platform_wait(50); //wait 50ms ++ } ++ else ++ { ++ rtl2840_on_hwreset(p_state); ++ p_state->b_rtl2840_power_onoff_once = 1; ++ } ++ ++ if(onoff) ++ { ++ //3 2.a RTL2840 AGC = 1 ++ read_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x04, &buf, LEN_1_BYTE); ++ buf &= (~BIT_6_MASK); ++ buf |= BIT_7_MASK; ++ write_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x04, &buf, LEN_1_BYTE); ++ } ++ else ++ { ++ ++ //3 2.b RTL2840 AGC = 0 ++ read_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x04, &buf, LEN_1_BYTE); ++ buf &= (~BIT_6_MASK); ++ buf &= (~BIT_7_MASK); ++ write_demod_register(p_state->d, RTL2840_DEMOD_ADDR, PAGE_0, 0x04, &buf, LEN_1_BYTE); ++ ++ //3 3.a RTL2840 Power OFF Set GPIO 0 HIGH ++ if( read_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, &data)) goto error; ++ data |=BIT0; // set GPIO0 HIGH ++ if( write_usb_sys_register(p_state, RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, data)) goto error; ++ } ++ ++ deb_info(" -%s onoff = %d\n", __FUNCTION__, onoff); ++ ++ return 0; ++error: ++ deb_info(" - XXX %s onoff = %d\n", __FUNCTION__, onoff); ++ return 1; ++} ++ ++ ++ ++static int ++demod_init_setting( ++ struct rtl2832_state * p_state ++ ) ++{ ++ ++ unsigned char data; ++ unsigned char buf[LEN_2_BYTE]; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ switch(p_state->demod_type) ++ { ++ case RTL2832: ++ { ++ deb_info("%s for RTL2832\n", __FUNCTION__); ++ //3 1. Set IF_AGC Internal IF_AGC_MAN 0x0c ++ if(read_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x0c, &data, LEN_1_BYTE)) goto error; ++ data &= (~BIT6); ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x0c, &data, LEN_1_BYTE)) goto error; ++ ++ ++ /*if(!context->DAB_AP_running) ++ { ++ //3 2. Set PID filter to reject null packet(pid = 0x1fff) ++ context->pid_filter_mode = REJECT_MODE; ++ ULONG reject_pid[1] = {0x1fff}; ++ Status = PidFilterToRejectMode(context, reject_pid, 1); ++ if(!NT_SUCCESS(Status)) goto error; ++ }*/ ++ ++ } ++ break; ++ ++ case RTL2836: ++ case RTL2840: ++ { ++ ++ deb_info("%s RTL2832P for RTL2836 and RTL2840 \n", __FUNCTION__); ++ //3 1. Set IF_AGC Manual and Set IF_AGC MAX VAL ++ buf[0]=0x5F; ++ buf[1]=0xFF; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x0c, buf, LEN_2_BYTE)) goto error; ++ ++ //3 2. PIP Setting ++ data = 0xe8; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x21, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x60; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x61, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x18; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0xbc, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x00; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x62, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x00; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x63, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x00; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x64, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x00; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x65, &data, LEN_1_BYTE)) goto error; ++ ++ //3 +PIP filter Reject = 0x1FFF ++ data = 0x01; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x22, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0x1f; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x26, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0xff; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_0, 0x27, &data, LEN_1_BYTE)) goto error; ++ //3 -PIP filter Reject = 0x1FFF ++ ++ data = 0x7f; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x92, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0xf7; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x93, &data, LEN_1_BYTE)) goto error; ++ ++ data = 0xff; ++ if(write_demod_register(p_state->d, RTL2832_DEMOD_ADDR, PAGE_1, 0x94, &data, LEN_1_BYTE)) goto error; ++ } ++ break; ++ } ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++ ++error: ++ deb_info(" -%s error \n", __FUNCTION__); ++ return 1; ++ ++} ++ ++ ++static int ++rtl2836_scan_procedure( ++ struct rtl2832_state * p_state) ++{ ++ unsigned char val; ++ int wait_num = 0; ++ unsigned long Per1, Per2; ++ long Data1,Data2,Snr; ++ DTMB_DEMOD_MODULE *pDtmbDemod; ++ struct dvb_usb_device* dev; ++ ++ ++ pDtmbDemod = p_state->pNim2836->pDemod; ++ dev = p_state->d; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ //3 Check signal present ++ wait_num = 0; ++ msleep(50); // Wait 0.05s ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_6, 0x53, &val, LEN_1_BYTE)) goto error; ++ deb_info("%s Signel Present = 0x %x\n", __FUNCTION__, val); ++ while((wait_num<3)&& (!(val&BIT_0_MASK))) ++ { ++ msleep(50); // Wait 0.05s ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_6, 0x53, &val, LEN_1_BYTE)) goto error; ++ deb_info("%s Signel Present = 0x %x\n", __FUNCTION__, val); ++ wait_num++; ++ } ++ ++ if(val&BIT_0_MASK) ++ { ++ //3 Write signal present ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ val |= BIT_0_MASK; //set Reg_present ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ ++ //3+ RTL2836 Release Stage=9 ++ val = 0x49; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4d, &val, LEN_1_BYTE)) goto error; ++ val = 0x29; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4e, &val, LEN_1_BYTE)) goto error; ++ val = 0x95; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4f, &val, LEN_1_BYTE)) goto error; ++ //3 -RTL2836 Release Stage=9 ++ deb_info("%s RTL2836 Release Stage 9\n", __FUNCTION__); ++ ++ ++ //3 Check signal lock ++ pDtmbDemod->GetPer(pDtmbDemod, &Per1, &Per2); ++ deb_info("%s --***GetPer = %d***\n", __FUNCTION__, (int)Per1); ++ ++ pDtmbDemod->GetSnrDb(pDtmbDemod, &Data1, &Data2); ++ Snr = Data1>>2; ++ deb_info("%s --***SNR= %d***\n", __FUNCTION__, (int)Snr); ++ ++ wait_num = 0; ++ while(wait_num<30 ) ++ { ++ if((Per1<1) && (Snr>0) && (Snr<40) ) ++ { ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ val |= BIT_1_MASK; //set Reg_signal ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ ++ deb_info("%s Signal Lock................\n", __FUNCTION__); ++ break; ++ } ++ ++ msleep(100); // Wait 0.1s ++ pDtmbDemod->GetPer(pDtmbDemod,&Per1,&Per2); ++ deb_info("%s --***GetPer = %d***\n", __FUNCTION__, (int)Per1); ++ ++ pDtmbDemod->GetSnrDb(pDtmbDemod,&Data1,&Data2); ++ Snr = Data1>>2; ++ deb_info("%s --***SNR= %d***\n", __FUNCTION__, (int)Snr); ++ wait_num++; ++ } ++ ++ if(! ((Per1<1) && (Snr>0) && (Snr<40))) ++ { ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ val &=(~BIT_1_MASK); //reset Reg_lock ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ } ++ } ++ else ++ { ++ if(read_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ val &=(~BIT_0_MASK); //reset Reg_present ++ val &=(~BIT_1_MASK); //reset Reg_lock ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0xf8, &val, LEN_1_BYTE)) goto error; ++ ++ //3 + RTL2836 Release Stage=9 ++ val = 0x49; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4d, &val, LEN_1_BYTE)) goto error; ++ val = 0x29; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4e, &val, LEN_1_BYTE)) goto error; ++ val = 0x95; ++ if(write_rtl2836_demod_register(dev, RTL2836_DEMOD_ADDR, PAGE_3, 0x4f, &val, LEN_1_BYTE)) goto error; ++ //3 -RTL2836 Release Stage=9 ++ ++ deb_info("%s RTL2836 Release Stage 9\n", __FUNCTION__); ++ } ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++error: ++ ++ deb_info(" +%s error\n", __FUNCTION__); ++ return -1; ++} ++ ++ ++static int ++build_2832_nim_module( ++ struct rtl2832_state* p_state) ++{ ++ ++ MT2266_EXTRA_MODULE *p_mt2266_extra; ++ MT2063_EXTRA_MODULE *p_mt2063_extra; ++ TUNER_MODULE *pTuner; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ //3 Buile 2832 nim module ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_MT2266) ++ { ++ //3 Build RTL2832 MT2266 NIM module. ++ ++ BuildRtl2832Mt2266Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2 ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ MT2266_TUNER_ADDR // The MT2266 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ // Get MT2266 tuner extra module. ++ pTuner = p_state->pNim->pTuner; ++ p_mt2266_extra = &(pTuner->Extra.Mt2266); ++ ++ // Open MT2266 handle. ++ if(p_mt2266_extra->OpenHandle(pTuner)) ++ deb_info("%s : MT2266 Open Handle Failed....\n", __FUNCTION__); ++ ++ p_state->is_mt2266_nim_module_built = 1; ++ ++ deb_info(" %s BuildRtl2832Mt2266Module\n", __FUNCTION__); ++ ++ } ++ else if( p_state->tuner_type == RTL2832_TUNER_TYPE_FC2580) ++ { ++ ++ //3Build RTL2832 FC2580 NIM module. ++ BuildRtl2832Fc2580Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 9. ++ 2, // Maximum I2C writing byte number is 8. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ FC2580_TUNER_ADDR, // The FC2580 I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // The FC2580 crystal frequency is 16.384 MHz. ++ FC2580_AGC_INTERNAL // The FC2580 AGC mode is external AGC mode. ++ ); ++ deb_info(" %s BuildRtl2832Fc2580Module\n", __FUNCTION__); ++ ++ } ++ else if( p_state->tuner_type == RTL2832_TUNER_TYPE_TUA9001) ++ { ++ ++ //3Build RTL2832 TUA9001 NIM module. ++ BuildRtl2832Tua9001Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ NULL, // Employ CustomI2cRead() as basic I2C reading function. ++ NULL, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 50 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ TUA9001_TUNER_ADDR // The TUA9001 I2C device address is 0xc0 in 8-bit format. ++ ); ++ deb_info(" %s BuildRtl2832Tua9001Module\n", __FUNCTION__); ++ ++ } ++ else if( p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ ++ //3Build RTL2832 MXL5007 NIM module. ++ BuildRtl2832Mxl5007tModule( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function.. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ MXL5007T_BASE_ADDRESS, // The MxL5007T I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The MxL5007T Crystal frequency is 16.0 MHz. ++ MXL5007T_LOOP_THROUGH_DISABLE, // The MxL5007T loop-through mode is disabled. ++ MXL5007T_CLK_OUT_DISABLE, // The MxL5007T clock output mode is disabled. ++ MXL5007T_CLK_OUT_AMP_0 // The MxL5007T clock output amplitude is 0. ++ ); ++ deb_info(" %s BuildRtl2832Mxl5007tModule\n", __FUNCTION__); ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0012) ++ { ++ //3Build RTL2832 FC0012 NIM module. ++ BuildRtl2832Fc0012Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ FC0012_BASE_ADDRESS, // The FC0012 I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ // The FC0012 crystal frequency is 36.0 MHz. ++ ); ++ deb_info(" %s BuildRtl2832Fc0012Module\n", __FUNCTION__); ++ ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_E4000) ++ { ++ //3 Build RTL2832 E4000 NIM module ++ BuildRtl2832E4000Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 50 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ E4000_BASE_ADDRESS, // The E4000 I2C device address is 0xc8 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ // The E4000 crystal frequency is 28.8 MHz. ++ ); ++ deb_info(" %s BuildRtl2832E4000Module\n", __FUNCTION__); ++ ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_MT2063) ++ { ++ ++ // Build RTL2832 MT2063 NIM module. ++ BuildRtl2832Mt2063Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ IF_FREQ_36125000HZ, // The RTL2832 and MT2063 IF frequency is 36.125 MHz. ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARRLLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 50, // The RTL2832 update function reference period is 50 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ MT2063_TUNER_ADDR // The MT2063 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ // Get MT2063 tuner extra module. ++ pTuner = p_state->pNim->pTuner; ++ p_mt2063_extra = &(pTuner->Extra.Mt2063); ++ ++ // Open MT2063 handle. ++ if(p_mt2063_extra->OpenHandle(pTuner)) ++ deb_info("%s : MT2063 Open Handle Failed....\n", __FUNCTION__); ++ ++ p_state->is_mt2063_nim_module_built = 1; ++ ++ deb_info(" %s BuildRtl2832Mt2063Module\n", __FUNCTION__); ++ ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_MAX3543) ++ { ++ ++ // Build RTL2832 MAX3543 NIM module. ++ BuildRtl2832Max3543Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 50, // The RTL2832 update function reference period is 50 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ MAX3543_TUNER_ADDR, // The MAX3543 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ // The MAX3543 Crystal frequency is 16.0 MHz. ++ ); ++ ++ deb_info(" %s BuildRtl2832Max3543Module\n", __FUNCTION__); ++ ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_TDA18272) ++ { ++ ++ // Build RTL2832 TDA18272 NIM module. ++ BuildRtl2832Tda18272Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is serial. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is STB mode. ++ 50, // The RTL2832 update function reference period is 50 millisecond ++ YES, // The RTL2832 Function 1 enabling status is YES. ++ ++ TDA18272_TUNER_ADDR, // The TDA18272 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The TDA18272 crystal frequency is 16.0 MHz. ++ TDA18272_UNIT_0, // The TDA18272 unit number is 0. ++ TDA18272_IF_OUTPUT_VPP_0P7V // The TDA18272 IF output Vp-p is 0.7 V. ++ ); ++ ++ deb_info(" %s BuildRtl2832Tda18272Module\n", __FUNCTION__); ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_FC0013) ++ { ++ //3Build RTL2832 FC0012 NIM module. ++ BuildRtl2832Fc0013Module( ++ &p_state->pNim, ++ &p_state->DvbtNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2832_DEMOD_ADDR, // The RTL2832 I2C device address is 0x20 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2832 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_PARALLEL, // The RTL2832 TS interface mode is PARALLEL. ++ RTL2832_APPLICATION_DONGLE, // The RTL2832 application mode is DONGLE mode. ++ 200, // The RTL2832 update function reference period is 200 millisecond ++ OFF, // The RTL2832 Function 1 enabling status is YES. ++ ++ FC0013_BASE_ADDRESS, // The FC0012 I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ // The FC0012 crystal frequency is 36.0 MHz. ++ ); ++ deb_info(" %s BuildRtl2832Fc0013Module\n", __FUNCTION__); ++ ++ } ++ else ++ { ++ deb_info(" -%s : RTL 2832 Unknown tuner on board...\n", __FUNCTION__); ++ goto error; ++ } ++ //Set user defined data pointer of base interface structure for custom basic functions. ++ p_state->pNim->pBaseInterface->SetUserDefinedDataPointer(p_state->pNim->pBaseInterface, p_state->d ); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ return 1; ++ ++} ++ ++ ++ ++static int ++build_2836_nim_module( ++ struct rtl2832_state* p_state) ++{ ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_FC2580) ++ { ++ //3Build RTL2836 FC2580 NIM module. ++ BuildRtl2836Fc2580Module( ++ &p_state->pNim2836, ++ &p_state->DtmbNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2836_DEMOD_ADDR, // The RTL2836 I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // The RTL2836 crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2836 TS interface mode is serial. ++ 50, // The RTL2836 update function reference period is 50 millisecond ++ YES, // The RTL2836 Function 1 enabling status is YES. ++ YES, // The RTL2836 Function 2 enabling status is YES. ++ ++ FC2580_TUNER_ADDR, // The FC2580 I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // The FC2580 crystal frequency is 16.384 MHz. ++ FC2580_AGC_INTERNAL // The FC2580 AGC mode is internal AGC mode. ++ ); ++ } ++ else if(p_state->tuner_type == RTL2832_TUNER_TYPE_MXL5007T) ++ { ++ //3 Build RTL2836 MXL5007T NIM module ++ BuildRtl2836Mxl5007tModule( ++ &p_state->pNim2836, ++ &p_state->DtmbNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2836_DEMOD_ADDR, // The RTL2836 I2C device address is 0x3e in 8-bit format. ++ CRYSTAL_FREQ_27000000HZ, // The RTL2836 crystal frequency is 27.0 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2836 TS interface mode is serial. ++ 50, // The RTL2836 update function reference period is 50 millisecond ++ YES, // The RTL2836 Function 1 enabling status is YES. ++ YES, // The RTL2836 Function 2 enabling status is YES. ++ ++ MXL5007T_BASE_ADDRESS, // The MxL5007T I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // The MxL5007T Crystal frequency is 16.0 MHz. ++ MXL5007T_LOOP_THROUGH_DISABLE, // The MxL5007T loop-through mode is disabled. ++ MXL5007T_CLK_OUT_DISABLE, // The MxL5007T clock output mode is disabled. ++ MXL5007T_CLK_OUT_AMP_0 // The MxL5007T clock output amplitude is 0. ++ ); ++ } ++ else ++ { ++ deb_info(" -%s : RTL2836 Unknown tuner on board...\n", __FUNCTION__); ++ goto error; ++ } ++ ++ //Set user defined data pointer of base interface structure for custom basic functions. ++ p_state->pNim2836->pBaseInterface->SetUserDefinedDataPointer(p_state->pNim2836->pBaseInterface, p_state->d ); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ ++ return 0; ++ ++error: ++ return 1; ++ ++} ++ ++ ++static int ++build_2840_nim_module( ++ struct rtl2832_state* p_state) ++{ ++ ++ MT2063_EXTRA_MODULE *p_mt2063_extra; ++ TUNER_MODULE *pTuner; ++ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ if( p_state->tuner_type == RTL2832_TUNER_TYPE_MT2063) ++ { ++ ++ BuildRtl2840Mt2063Module( ++ &p_state->pNim2840, ++ &p_state->QamNimModuleMemory, ++ IF_FREQ_36125000HZ, // The RTL2840 and MT2063 IF frequency is 36.125 MHz. ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2840_DEMOD_ADDR, // The RTL2840 I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2840 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2840 TS interface mode is serial. ++ QAM_DEMOD_EN_AM_HUM, // Use AM-hum enhancement mode. ++ ++ MT2063_TUNER_ADDR // The MT2063 I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ // Get MT2063 tuner extra module. ++ pTuner = p_state->pNim2840->pTuner; ++ p_mt2063_extra = &(pTuner->Extra.Mt2063); ++ ++ if(p_mt2063_extra->OpenHandle(pTuner)) ++ deb_info("%s : MT2063 Open Handle Failed....\n", __FUNCTION__); ++ ++ p_state->is_mt2063_nim_module_built = 1; ++ ++ deb_info(" %s BuildRtl2840Mt2063Module\n", __FUNCTION__); ++ } ++ else if ( p_state->tuner_type == RTL2832_TUNER_TYPE_MAX3543) ++ { ++ // Build RTL2840 MAX3543 NIM module. ++ BuildRtl2840Max3543Module( ++ &p_state->pNim2840, ++ &p_state->QamNimModuleMemory, ++ ++ 2, // Maximum I2C reading byte number is 2. ++ 2, // Maximum I2C writing byte number is 2. ++ custom_i2c_read, // Employ CustomI2cRead() as basic I2C reading function. ++ custom_i2c_write, // Employ CustomI2cWrite() as basic I2C writing function. ++ custom_wait_ms, // Employ CustomWaitMs() as basic waiting function. ++ ++ RTL2840_DEMOD_ADDR, // The RTL2840 I2C device address is 0x44 in 8-bit format. ++ CRYSTAL_FREQ_28800000HZ, // The RTL2840 crystal frequency is 28.8 MHz. ++ TS_INTERFACE_SERIAL, // The RTL2840 TS interface mode is serial. ++ QAM_DEMOD_EN_AM_HUM, // Use AM-hum enhancement mode. ++ ++ MAX3543_TUNER_ADDR, // The MAX3543 I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ // The MAX3543 Crystal frequency is 16.0 MHz. ++ ); ++ deb_info(" %s BuildRtl2840Max3543Module\n", __FUNCTION__); ++ } ++ else ++ { ++ deb_info(" -%s : RTL2840 Unknown tuner on board...\n", __FUNCTION__); ++ goto error; ++ } ++ ++ //Set user defined data pointer of base interface structure for custom basic functions. ++ p_state->pNim2840->pBaseInterface->SetUserDefinedDataPointer(p_state->pNim2840->pBaseInterface, p_state->d ); ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++ ++static int ++build_nim_module( ++ struct rtl2832_state* p_state) ++{ ++ deb_info(" +%s\n", __FUNCTION__); ++ ++ switch(p_state->demod_type) ++ { ++ case RTL2832: ++ // Build 2832 nim module ++ build_2832_nim_module(p_state); ++ break; ++ ++ case RTL2836: ++ // Build 2836 nim module ++ build_2832_nim_module(p_state); ++ build_2836_nim_module(p_state); ++ break; ++ ++ case RTL2840: ++ //Build 2840 nim module ++ build_2832_nim_module(p_state); ++ build_2840_nim_module(p_state); ++ break; ++ } ++ ++ deb_info(" -%s\n", __FUNCTION__); ++ return 0; ++} ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u_fe.h b/drivers/media/dvb/dvb-usb/rtl2832u_fe.h +new file mode 100644 +index 0000000..270e376 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u_fe.h +@@ -0,0 +1,312 @@ ++ ++#ifndef __RTL2832U_FE_H__ ++#define __RTL2832U_FE_H__ ++ ++#include "nim_rtl2832_tua9001.h" ++#include "nim_rtl2832_mt2266.h" ++#include "nim_rtl2832_fc2580.h" ++#include "nim_rtl2832_mxl5007t.h" ++#include "nim_rtl2832_fc0012.h" ++#include "nim_rtl2832_e4000.h" ++#include "nim_rtl2832_mt2063.h" ++#include "nim_rtl2832_max3543.h" ++#include "nim_rtl2832_tda18272.h" ++#include "nim_rtl2832_fc0013.h" ++ ++#include "nim_rtl2836_fc2580.h" ++#include "nim_rtl2836_mxl5007t.h" ++ ++#include "nim_rtl2840_mt2063.h" ++#include "nim_rtl2840_max3543.h" ++ ++#include "rtl2832u_io.h" ++#include ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) || ((defined V4L2_VERSION) && (V4L2_VERSION >= 197120)) ++/* all DVB frontend drivers now work directly with the DVBv5 ++ * structure. This warrants that all drivers will be ++ * getting/setting frontend parameters on a consistent way, in ++ * order to avoid copying data from/to the DVBv3 structs ++ * without need. ++ */ ++#define V4L2_ONLY_DVB_V5 ++#endif ++ ++#define UPDATE_FUNC_ENABLE_2840 0 ++#define UPDATE_FUNC_ENABLE_2836 1 ++#define UPDATE_FUNC_ENABLE_2832 1 ++ ++#define UPDATE_PROCEDURE_PERIOD_2836 (HZ/5) //200ms = jiffies*1000/HZ ++#define UPDATE_PROCEDURE_PERIOD_2832 (HZ/5) //200ms ++ ++typedef enum{ ++ RTL2832_TUNER_TYPE_MT2266 = 0, ++ RTL2832_TUNER_TYPE_FC2580, ++ RTL2832_TUNER_TYPE_TUA9001, ++ RTL2832_TUNER_TYPE_MXL5007T, ++ RTL2832_TUNER_TYPE_FC0012, ++ RTL2832_TUNER_TYPE_E4000, ++ RTL2832_TUNER_TYPE_MT2063, ++ RTL2832_TUNER_TYPE_MAX3543, ++ RTL2832_TUNER_TYPE_TDA18272, ++ RTL2832_TUNER_TYPE_FC0013, ++ RTL2832_TUNER_TYPE_UNKNOWN, ++}RTL2832_TUNER_TYPE; ++ ++ ++//3 state of total device ++struct rtl2832_state { ++ struct dvb_frontend frontend; ++#ifndef V4L2_ONLY_DVB_V5 ++ struct dvb_frontend_parameters fep; ++#endif ++ struct dvb_usb_device* d; ++ ++ struct mutex i2c_repeater_mutex; ++ ++ unsigned long current_frequency; ++#ifdef V4L2_ONLY_DVB_V5 ++ unsigned long current_bandwidth_hz; ++#else ++ enum fe_bandwidth current_bandwidth; ++#endif ++ ++ RTL2832_TUNER_TYPE tuner_type; ++ unsigned char is_mt2266_nim_module_built; //3 For close MT handle ++ unsigned char is_mt2063_nim_module_built; //3 For close MT handle ++ ++ ++ //3 DTMB related begin --- ++ unsigned int demod_support_type; ++ unsigned int demod_type; ++ unsigned int demod_ask_type; ++ //3 DTMB related end end --- ++ ++ ++ //3 DVBC related begin --- ++ unsigned char b_rtl2840_power_onoff_once; ++ ++ //3 DVBC related end end --- ++ ++ ++ //3if init() is called, is_initial is true ->check it to see if need to flush work queue ++ unsigned short is_initial; ++ unsigned char is_frequency_valid; ++ ++#if UPDATE_FUNC_ENABLE_2840 ++ struct delayed_work update2840_procedure_work; ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2836 ++ struct delayed_work update2836_procedure_work; ++#endif ++ ++#if UPDATE_FUNC_ENABLE_2832 ++ struct delayed_work update2832_procedure_work; ++#endif ++ ++ DVBT_NIM_MODULE* pNim;//Nim of 2832 ++ DVBT_NIM_MODULE DvbtNimModuleMemory; ++ ++ //3 DTMB related begin --- ++ DTMB_NIM_MODULE* pNim2836;//Nim of 2836 ++ DTMB_NIM_MODULE DtmbNimModuleMemory; ++ //3DTMB related end --- ++ ++ //3 DVBC related begin --- ++ QAM_NIM_MODULE* pNim2840;//Nim of 2840 ++ QAM_NIM_MODULE QamNimModuleMemory; ++ //3DVBC related end --- ++ ++}; ++ ++ ++ ++ ++#define MT2266_TUNER_ADDR 0xc0 ++#define FC2580_TUNER_ADDR 0xac ++#define TUA9001_TUNER_ADDR 0xc0 ++ ++#define MT2266_OFFSET 0x00 ++#define MT2266_CHECK_VAL 0x85 ++ ++#define FC2580_OFFSET 0x01 ++#define FC2580_CHECK_VAL 0x56 ++ ++#define TUA9001_OFFSET 0x7e ++#define TUA9001_CHECK_VAL 0x2328 ++ ++#define MXL5007T_BASE_ADDRESS 0xc0 ++#define MXL5007T_CHECK_ADDRESS 0xD9 ++#define MXL5007T_CHECK_VALUE 0x14 ++ ++#define FC0012_BASE_ADDRESS 0xc6 ++#define FC0012_CHECK_ADDRESS 0x00 ++#define FC0012_CHECK_VALUE 0xa1 ++ ++#define E4000_BASE_ADDRESS 0xc8 ++#define E4000_CHECK_ADDRESS 0x02 ++#define E4000_CHECK_VALUE 0x40 ++ ++ ++#define MT2063_TUNER_ADDR 0xc0 ++#define MT2063_CHECK_OFFSET 0x00 ++#define MT2063_CHECK_VALUE 0x9e ++#define MT2063_CHECK_VALUE_2 0x9c ++ ++ ++#define MAX3543_TUNER_ADDR 0xc0 ++#define MAX3543_CHECK_OFFSET 0x00 ++#define MAX3543_CHECK_VALUE 0x38 ++#define MAX3543_SHUTDOWN_OFFSET 0x08 ++ ++ ++#define TDA18272_TUNER_ADDR 0xc0 ++#define TDA18272_CHECK_OFFSET 0x00 ++#define TDA18272_CHECK_VALUE1 0xc7 ++#define TDA18272_CHECK_VALUE2 0x60 ++ ++ ++#define FC0013_BASE_ADDRESS 0xc6 ++#define FC0013_CHECK_ADDRESS 0x00 ++#define FC0013_CHECK_VALUE 0xa3 ++#define FC0013_STANDBY_ADDRESS 0x06 ++ ++ ++ ++ ++struct rtl2832_reg_addr{ ++ RegType reg_type; ++ unsigned short reg_addr; ++ int bit_low; ++ int bit_high; ++}; ++ ++ ++ ++typedef enum{ ++ RTD2831_RMAP_INDEX_USB_CTRL_BIT5 =0, ++ RTD2831_RMAP_INDEX_USB_STAT, ++ RTD2831_RMAP_INDEX_USB_EPA_CTL, ++ RTD2831_RMAP_INDEX_USB_SYSCTL, ++ RTD2831_RMAP_INDEX_USB_EPA_CFG, ++ RTD2831_RMAP_INDEX_USB_EPA_MAXPKT, ++ RTD2831_RMAP_INDEX_USB_EPA_FIFO_CFG, ++ ++ RTD2831_RMAP_INDEX_SYS_DEMOD_CTL, ++ RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_VAL, ++ RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT3, ++ RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT3, ++ RTD2831_RMAP_INDEX_SYS_GPIO_CFG0_BIT67, ++ RTD2831_RMAP_INDEX_SYS_DEMOD_CTL1, ++ RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT1, ++ RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT1, ++ RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT6, ++ RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT6, ++ RTD2831_RMAP_INDEX_SYS_GPIO_OUTPUT_EN_BIT5, ++ RTD2831_RMAP_INDEX_SYS_GPIO_DIR_BIT5, ++#if 0 ++ RTD2831_RMAP_INDEX_SYS_GPD, ++ RTD2831_RMAP_INDEX_SYS_GPOE, ++ RTD2831_RMAP_INDEX_SYS_GPO, ++ RTD2831_RMAP_INDEX_SYS_SYS_0, ++#endif ++ ++} rtl2832_reg_map_index; ++ ++ ++ ++#define USB_SYSCTL 0x0000 ++#define USB_CTRL 0x0010 ++#define USB_STAT 0x0014 ++#define USB_EPA_CTL 0x0148 ++#define USB_EPA_CFG 0x0144 ++#define USB_EPA_MAXPKT 0x0158 ++#define USB_EPA_FIFO_CFG 0x0160 ++ ++#define DEMOD_CTL 0x0000 ++#define GPIO_OUTPUT_VAL 0x0001 ++#define GPIO_OUTPUT_EN 0x0003 ++#define GPIO_DIR 0x0004 ++#define GPIO_CFG0 0x0007 ++#define GPIO_CFG1 0x0008 ++#define DEMOD_CTL1 0x000b ++ ++ ++ ++ ++ ++ ++#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 ++ ++ ++/* DTMB related ++ ++typedef enum { ++ PAGE_0 = 0, ++ PAGE_1 = 1, ++ PAGE_2 = 2, ++ PAGE_3 = 3, ++ PAGE_4 = 4, ++ PAGE_5 = 5, ++ PAGE_6 = 6, ++ PAGE_7 = 7, ++ PAGE_8 = 8, ++ PAGE_9 = 9, ++};*/ ++ ++ ++#define SUPPORT_DVBT_MODE 0x01 ++#define SUPPORT_DTMB_MODE 0x02 ++#define SUPPORT_DVBC_MODE 0x04 ++ ++#define INPUT_ADC_LEVEL -8 ++typedef enum { ++ RTL2832 = 0, ++ RTL2836, ++ RTL2840 ++}DEMOD_TYPE; ++ ++ ++ ++int rtl2832_read_signal_quality( ++ struct dvb_frontend* fe, ++ u32* quality); ++int ++rtl2832_read_signal_strength( ++ struct dvb_frontend* fe, ++ u16* strength); ++#endif // __RTD2830_PRIV_H__ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u_io.c b/drivers/media/dvb/dvb-usb/rtl2832u_io.c +new file mode 100644 +index 0000000..8408ffd +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u_io.c +@@ -0,0 +1,912 @@ ++ ++ ++#include "rtl2832u_io.h" ++#include ++ ++#define ERROR_TRY_MAX_NUM 4 ++ ++ ++#define DUMMY_PAGE 0x0a ++#define DUMMY_ADDR 0x01 ++ ++ ++ ++void ++platform_wait( ++ unsigned long nMinDelayTime) ++{ ++ // The unit of Sleep() waiting time is millisecond. ++ unsigned long usec; ++ do { ++ usec = (nMinDelayTime > 8000) ? 8000 : nMinDelayTime; ++ msleep(usec); ++ nMinDelayTime -= usec; ++ } while (nMinDelayTime > 0); ++ ++ return; ++ ++} ++////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ++// remote control ++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ++static int ++read_rc_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ offset, /* USB message value */ ++ 0x0201, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info(" error try rc read register %s: offset=0x%x, error code=0x%x !\n", __FUNCTION__, offset, ret); ++ return 1; ++ } ++ ++ return 0; ++} ++ ++ ++ ++static int ++write_rc_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ unsigned char try_num; ++ ++ try_num = 0; ++error_write_again: ++ try_num++; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ offset, /* USB message value */ ++ 0x0211, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try rc write register = %d, %s: offset=0x%x, error code=0x%x !\n",try_num ,__FUNCTION__, offset, ret); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ return 0; ++error: ++ return 1; ++ } ++ ++ ++int ++read_rc_char_bytes( ++ struct dvb_usb_device* dib, ++ RegType type, ++ unsigned short byte_addr, ++ unsigned char* buf, ++ unsigned short byte_num) ++{ ++ int ret = 1; ++ ++ if( byte_num != 1 && byte_num !=2 && byte_num !=4 && byte_num != 0x80) ++ { ++ deb_info("error!! %s: length = %d \n", __FUNCTION__, byte_num); ++ return 1; ++ } ++ ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) return 1; ++ ++ if (type == RTD2832U_RC ) ++ ret = read_rc_register( dib , byte_addr , buf , byte_num); ++ else ++ { ++ deb_info("error!! %s: erroe register type \n", __FUNCTION__); ++ return 1; ++ } ++ mutex_unlock(&dib->usb_mutex); ++ ++ return ret; ++ ++} ++ ++ ++ ++int ++write_rc_char_bytes( ++ struct dvb_usb_device* dib, ++ RegType type, ++ unsigned short byte_addr, ++ unsigned char* buf, ++ unsigned short byte_num) ++{ ++ int ret = 1; ++ ++ if( byte_num != 1 && byte_num !=2 && byte_num !=4 && byte_num !=0x80) ++ { ++ deb_info("error!! %s: length = %d \n", __FUNCTION__, byte_num); ++ return 1; ++ } ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) return 1; ++ ++ if (type == RTD2832U_RC ) ++ ret = write_rc_register( dib , byte_addr , buf , byte_num); ++ else ++ { ++ deb_info("error!! %s: erroe register type \n", __FUNCTION__); ++ ret=1; ++ } ++ mutex_unlock(&dib->usb_mutex); ++ ++ return ret; ++ ++} ++ ++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ++static int ++read_usb_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ (USB_BASE_ADDRESS<<8) + offset, /* USB message value */ ++ 0x0100, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info(" %s: offset=0x%x, error code=0x%x !\n", __FUNCTION__, offset, ret); ++ return 1; ++ } ++ ++ return 0; ++} ++ ++ ++ ++static int ++write_usb_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ unsigned char try_num; ++ ++ try_num = 0; ++error_write_again: ++ try_num++; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ (USB_BASE_ADDRESS<<8) + offset, /* USB message value */ ++ 0x0110, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try = %d, %s: offset=0x%x, error code=0x%x !\n",try_num ,__FUNCTION__, offset, ret); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ return 0; ++error: ++ return 1; ++ } ++ ++ ++ ++ ++static int ++read_sys_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ (SYS_BASE_ADDRESS<<8) + offset, /* USB message value */ ++ 0x0200, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info(" %s: offset=0x%x, error code=0x%x !\n", __FUNCTION__, offset, ret); ++ return 1; ++ } ++ ++ return 0; ++ ++ } ++ ++ ++static int ++write_sys_register( ++ struct dvb_usb_device* dib, ++ unsigned short offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ unsigned char try_num; ++ ++ try_num = 0; ++error_write_again: ++ try_num++; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ (SYS_BASE_ADDRESS<<8) + offset, /* USB message value */ ++ 0x0210, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ if (ret != bytelength) ++ { ++ deb_info(" error try= %d, %s: offset=0x%x, error code=0x%x !\n",try_num, __FUNCTION__, offset, ret); ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ return 0; ++error: ++ return 1; ++ } ++ ++ ++ ++ ++int ++read_demod_register( ++ struct dvb_usb_device*dib, ++ unsigned char demod_device_addr, ++ unsigned char page, ++ unsigned char offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ int i; ++ unsigned char tmp; ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ demod_device_addr + (offset<<8), /* USB message value */ ++ (0x0000 + page), /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ ++ usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ RTL2832_DEMOD_ADDR + (DUMMY_ADDR<<8), /* USB message value */ ++ (0x0000 + DUMMY_PAGE), /* USB message index value */ ++ &tmp, /* pointer to the receive buffer */ ++ LEN_1_BYTE, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ ++ // deb_info("%s[1345]: ret=%d, DA=0x%x, len=%d, page=%d, offset=0x%x, data=(", __FUNCTION__, ret, demod_device_addr, bytelength,page, offset); ++ // for(i = 0; i < bytelength; i++) ++ // deb_info("0x%x,", data[i]); ++ // deb_info(")\n"); ++ ++ if (ret != bytelength) ++ { ++ deb_info("error!! %s: ret=%d, DA=0x%x, len=%d, page=%d, offset=0x%x, data=(", __FUNCTION__, ret, demod_device_addr, bytelength,page, offset); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data[i]); ++ deb_info(")\n"); ++ ++ goto error; ++ } ++ ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++ ++int ++write_demod_register( ++ struct dvb_usb_device*dib, ++ unsigned char demod_device_addr, ++ unsigned char page, ++ unsigned char offset, ++ unsigned char *data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ unsigned char i, try_num; ++ unsigned char tmp; ++ ++ try_num = 0; ++error_write_again: ++ try_num++; ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ demod_device_addr + (offset<<8), /* USB message value */ ++ (0x0010 + page), /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ ++ usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ RTL2832_DEMOD_ADDR + (DUMMY_ADDR<<8), /* USB message value */ ++ (0x0000 + DUMMY_PAGE), /* USB message index value */ ++ &tmp, /* pointer to the receive buffer */ ++ LEN_1_BYTE, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ // deb_info("%s: ret=%d, DA=0x%x, len=%d, page=%d, offset=0x%x, data=(", __FUNCTION__, ret, demod_device_addr, bytelength, page,offset); ++ // for(i = 0; i < bytelength; i++) ++ // deb_info("0x%x,", data[i]); ++ // deb_info(")\n"); ++ ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try = %d!! %s: ret=%d, DA=0x%x, len=%d, page=%d, offset=0x%x, data=(",try_num , __FUNCTION__, ret, demod_device_addr, bytelength,page,offset); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data[i]); ++ deb_info(")\n"); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ return 0; ++ ++error: ++ return 1; ++ } ++ ++ ++ ++ ++ ++ ++int ++read_rtl2832_tuner_register( ++ struct dvb_usb_device *dib, ++ unsigned char device_address, ++ unsigned char offset, ++ unsigned char *data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ int i; ++ unsigned char data_tmp[128]; ++ ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ device_address+(offset<<8), /* USB message value */ ++ 0x0300, /* USB message index value */ ++ data_tmp, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++// deb_info("%s: ret=%d, DA=0x%x, len=%d, offset=0x%x, data=(", __FUNCTION__, ret, device_address, bytelength,offset); ++// for(i = 0; i < bytelength; i++) ++// deb_info("0x%x,", data_tmp[i]); ++// deb_info(")\n"); ++ ++ if (ret != bytelength) ++ { ++ deb_info("error!! %s: ret=%d, DA=0x%x, len=%d, offset=0x%x, data=(", __FUNCTION__, ret, device_address, bytelength,offset); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data_tmp[i]); ++ deb_info(")\n"); ++ ++ goto error; ++ } ++ ++ memcpy(data,data_tmp,bytelength); ++ ++ return 0; ++ ++error: ++ return 1; ++ ++ ++} ++ ++int write_rtl2832_tuner_register( ++ struct dvb_usb_device *dib, ++ unsigned char device_address, ++ unsigned char offset, ++ unsigned char *data, ++ unsigned short bytelength) ++{ ++ int ret = -ENOMEM; ++ unsigned char i, try_num; ++ ++ try_num = 0; ++error_write_again: ++ try_num++; ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ device_address+(offset<<8), /* USB message value */ ++ 0x0310, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++// deb_info("%s: ret=%d, DA=0x%x, len=%d, offset=0x%x, data=(", __FUNCTION__, ret, device_address, bytelength, offset); ++// for(i = 0; i < bytelength; i++) ++// deb_info("0x%x,", data[i]); ++// deb_info(")\n"); ++ ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try= %d!! %s: ret=%d, DA=0x%x, len=%d, offset=0x%x, data=(",try_num, __FUNCTION__, ret, device_address, bytelength, offset); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data[i]); ++ deb_info(")\n"); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ return 0; ++ ++error: ++ return 1; ++ } ++ ++ ++ ++ ++int ++read_rtl2832_stdi2c( ++ struct dvb_usb_device* dib, ++ unsigned short dev_i2c_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int i; ++ int ret = -ENOMEM; ++ unsigned char try_num; ++ unsigned char data_tmp[128]; ++ ++ try_num = 0; ++error_write_again: ++ try_num ++; ++ ++ ++ if(bytelength >= 128) ++ { ++ deb_info("%s error bytelength >=128 \n", __FUNCTION__); ++ goto error; ++ } ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_rcvctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_IN, /* USB message request type value */ ++ dev_i2c_addr, /* USB message value */ ++ 0x0600, /* USB message index value */ ++ data_tmp, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try= %d!! %s: ret=%d, DA=0x%x, len=%d, data=(",try_num, __FUNCTION__, ret, dev_i2c_addr, bytelength); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data_tmp[i]); ++ deb_info(")\n"); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ } ++ ++ memcpy(data,data_tmp,bytelength); ++ ++ return 0; ++error: ++ return 1; ++ ++} ++ ++ ++ ++int ++write_rtl2832_stdi2c( ++ struct dvb_usb_device* dib, ++ unsigned short dev_i2c_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int i; ++ int ret = -ENOMEM; ++ unsigned char try_num; ++ ++ try_num = 0; ++error_write_again: ++ try_num ++; ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) goto error; ++ ++ ret = usb_control_msg(dib->udev, /* pointer to device */ ++ usb_sndctrlpipe( dib->udev,RTL2832_CTRL_ENDPOINT), /* pipe to control endpoint */ ++ 0, /* USB message request value */ ++ SKEL_VENDOR_OUT, /* USB message request type value */ ++ dev_i2c_addr, /* USB message value */ ++ 0x0610, /* USB message index value */ ++ data, /* pointer to the receive buffer */ ++ bytelength, /* length of the buffer */ ++ DIBUSB_I2C_TIMEOUT); /* time to wait for the message to complete before timing out */ ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ if (ret != bytelength) ++ { ++ deb_info("error try= %d!! %s: ret=%d, DA=0x%x, len=%d, data=(",try_num, __FUNCTION__, ret, dev_i2c_addr, bytelength); ++ for(i = 0; i < bytelength; i++) ++ deb_info("0x%x,", data[i]); ++ deb_info(")\n"); ++ ++ if( try_num > ERROR_TRY_MAX_NUM ) goto error; ++ else goto error_write_again; ++ ++ } ++ ++ return 0; ++ ++error: ++ return 1; ++ ++} ++ ++ ++ ++ ++ ++ ++//3for return PUCHAR value ++ ++int ++read_usb_sys_char_bytes( ++ struct dvb_usb_device* dib, ++ RegType type, ++ unsigned short byte_addr, ++ unsigned char* buf, ++ unsigned short byte_num) ++{ ++ int ret = 1; ++ ++ if( byte_num != 1 && byte_num !=2 && byte_num !=4) ++ { ++ deb_info("error!! %s: length = %d \n", __FUNCTION__, byte_num); ++ return 1; ++ } ++ ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) return 1; ++ ++ if( type == RTD2832U_USB ) ++ { ++ ret = read_usb_register( dib , byte_addr , buf , byte_num); ++ } ++ else if ( type == RTD2832U_SYS ) ++ { ++ ret = read_sys_register( dib , byte_addr , buf , byte_num); ++ } ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ return ret; ++ ++} ++ ++ ++ ++int ++write_usb_sys_char_bytes( ++ struct dvb_usb_device* dib, ++ RegType type, ++ unsigned short byte_addr, ++ unsigned char* buf, ++ unsigned short byte_num) ++{ ++ int ret = 1; ++ ++ if( byte_num != 1 && byte_num !=2 && byte_num !=4) ++ { ++ deb_info("error!! %s: length = %d \n", __FUNCTION__, byte_num); ++ return 1; ++ } ++ ++ if( mutex_lock_interruptible(&dib->usb_mutex) ) return 1; ++ ++ if( type == RTD2832U_USB ) ++ { ++ ret = write_usb_register( dib , byte_addr , buf , byte_num); ++ } ++ else if ( type == RTD2832U_SYS ) ++ { ++ ret = write_sys_register( dib , byte_addr , buf , byte_num); ++ } ++ ++ mutex_unlock(&dib->usb_mutex); ++ ++ return ret; ++ ++} ++ ++ ++//3for return INT value ++int ++read_usb_sys_int_bytes( ++ struct dvb_usb_device* dib, ++ RegType type, ++ unsigned short byte_addr, ++ unsigned short n_bytes, ++ int* p_val) ++{ ++ int i; ++ u8 val[LEN_4_BYTE]; ++ int nbit_shift; ++ ++ *p_val= 0; ++ ++ if (read_usb_sys_char_bytes( dib, type, byte_addr, val , n_bytes)) goto error; ++ ++ for (i= 0; i< n_bytes; i++) ++ { ++ nbit_shift = i<<3 ; ++ *p_val = *p_val + (val[i]<= 0; i--) ++ { ++ nbit_shift= i << 3; ++ u8_val[i] = (val>> nbit_shift) & 0xff; ++ } ++ ++ if( write_usb_sys_char_bytes( dib , type , byte_addr, u8_val , n_bytes) ) goto error; ++ ++ return 0; ++error: ++ return 1; ++} ++ ++ ++ ++int ++write_rtl2836_demod_register( ++ struct dvb_usb_device* dib, ++ unsigned char demod_device_addr, ++ unsigned char page, ++ unsigned char offset, ++ unsigned char *data, ++ unsigned short bytelength) ++{ ++ int i; ++ unsigned char datatmp; ++ int try_num; ++ switch(page) ++ { ++ //3 R/W regitser Once R/W "ONE BYTE" ++ case PAGE_0: ++ case PAGE_1: ++ case PAGE_2: ++ case PAGE_3: ++ case PAGE_4: ++ for(i=0; i= 4) ++ goto error; ++ ++ if(read_demod_register(dib, demod_device_addr, page, offset+i, &datatmp, LEN_1_BYTE)) ++ { ++ try_num++; ++ deb_info("%s fail read\n", __FUNCTION__); ++ goto label_read; ++ } ++ ++ if(datatmp != data[i]) ++ { ++ try_num++; ++ deb_info("%s read != write\n", __FUNCTION__); ++ goto label_write; ++ } ++ } ++ break; ++ ++ default: ++ goto error; ++ break; ++ } ++ ++ return 0; ++ ++error: ++ return 1; ++} ++ ++ ++ ++int ++read_rtl2836_demod_register( ++ struct dvb_usb_device*dib, ++ unsigned char demod_device_addr, ++ unsigned char page, ++ unsigned char offset, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ ++ int i; ++ unsigned char tmp; ++ ++ switch(page) ++ { ++ //3 R/W regitser Once R/W "ONE BYTE" ++ case PAGE_0: ++ case PAGE_1: ++ case PAGE_2: ++ case PAGE_3: ++ case PAGE_4: ++ for(i=0; icmd_num; ++ ++ deb_info("+%s : ioctl -std rw cmd = %d \n", __FUNCTION__,rw_cmd); ++ ++ ++ switch(rw_cmd) ++ { ++ case FE_RW_STD_WR: ++ ret=set_rtl2832_ioctrl_8bit_stdi2c( fe, ++ rw_ctrl->dev_i2c_addr, ++ rw_ctrl->reg_addr, ++ rw_ctrl->data, ++ rw_ctrl->bytelength); ++ ++ break; ++ case FE_RW_STD_RD: ++ ++ ret=get_rtl2832_ioctrl_8bit_stdi2c( fe, ++ rw_ctrl->dev_i2c_addr, ++ rw_ctrl->reg_addr, ++ rw_ctrl->data, ++ rw_ctrl->bytelength); ++ ++ ++ break; ++ case FE_RW_DEMOD_WR: ++ ++ ret=set_rtl2832_ioctrl_8bit_demodbytes( fe, ++ rw_ctrl->page, ++ rw_ctrl->reg_addr, ++ rw_ctrl->data, ++ rw_ctrl->bytelength); ++ break; ++ case FE_RW_DEMOD_RD: ++ ++ ret=get_rtl2832_ioctrl_8bit_demodbytes( fe, ++ rw_ctrl->page, ++ rw_ctrl->reg_addr, ++ rw_ctrl->data, ++ rw_ctrl->bytelength); ++ break; ++ case FE_RW_STD_P_TEST: ++ ret=1; ++ break; ++ case FE_RW_STD_M_TEST: ++ ret=100; ++ break; ++ default: ++ deb_info("ERROR::rtl2832u ioctl - std rw cmd ret= unknow rw commond. \n" ); ++ ret=-1; ++ break; ++ } ++ ++ deb_info("-%s ioctl - std rw cmd ret= %d \n", __FUNCTION__,ret); ++ ++ return ret; ++ ++} ++static int fe_demod_info_ioctrl(struct dvb_frontend *fe, void *parg) ++{ ++ ++ struct rtl2832u_ioctl_info_struct* info_ctrl = (struct rtl2832u_ioctl_info_struct*)parg; ++ int ret =-1; ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ DVBT_NIM_MODULE *pNim; ++ DVBT_DEMOD_MODULE *pDemod; ++ u16 strength=0; ++ u32 quality=0; ++ int answer=0; ++ unsigned long BerNum=0,BerDen=1; ++ long SnrDbNum=0, SnrDbDen=1; ++ long tr_ppm=0,cr_hz=0; ++ unsigned long data_length=info_ctrl->data_length; ++ int info_cmd = info_ctrl->cmd_num; ++ deb_info("+%s : ioctl -demod info cmd = %d ,data length= %d (must > %d )\n", __FUNCTION__,info_cmd,(int)data_length,INFO_DEMOD_DATA_LEN); ++ if (p_state->demod_type != RTL2832){ ++ deb_info("ERROR::demod type not rtl2832u...\n"); ++ return -1; ++ } ++ if (data_length < INFO_DEMOD_DATA_LEN){ ++ deb_info("ERROR::data length is too short...,must be greater than %d \n",INFO_DEMOD_DATA_LEN); ++ return -1; ++ } ++ pNim = p_state->pNim; ++ if (pNim == NULL){ ++ deb_info("ERROR::nim is null...\n"); ++ return -1; ++ } ++ ++ pDemod=pNim->pDemod; ++ ++ ++ if ((info_cmd != FE_GET_SIGN_STRENGTH) && (info_cmd != FE_GET_SIGN_QUALITY)) ++ { ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) { ++ return -10; ++ } ++ } ++ info_ctrl->data[INFO_DATA_VALUE]=0x00000000; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ switch(info_cmd) ++ { ++ case FE_GET_SIGN_STRENGTH: ++ if (rtl2832_read_signal_strength(fe,&strength) != 0) ++ { ++ ret=-10; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=(unsigned long)strength; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++// deb_info("rtl2832u ioctl (FE_GET_SIGN_STRENGTH)- strength = %x (%x). \n",strength,info_ctrl->data[INFO_DATA_VALUE] ); ++ ++ } ++ ++ ++ break; ++ case FE_GET_SIGN_QUALITY: ++ if (rtl2832_read_signal_quality(fe,&quality) != 0) ++ { ++ ret=-10; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=(unsigned long)quality; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++// deb_info("rtl2832u ioctl (FE_GET_SIGN_QUALITY)- quality = %x (%x). \n",quality,info_ctrl->data[INFO_DATA_VALUE] ); ++ } ++ ++ break; ++ case FE_GET_SIGN_LOCK: ++ ++ answer=NO; ++ if (pDemod->IsSignalLocked(pDemod, &answer) != FUNCTION_SUCCESS) ++ { ++ ret=-10; ++ } ++ else ++ { ++ if (answer == YES){ ++ info_ctrl->data[INFO_DATA_VALUE]=1; ++ } ++ else info_ctrl->data[INFO_DATA_VALUE]=0; ++ ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ ret=10; ++ } ++ ++ ++ break; ++ case FE_GET_DEMOD_BER: ++ ++ if(pDemod->GetBer(pDemod, &BerNum, &BerDen) != FUNCTION_SUCCESS) ++ { ++ ret=-10; ++ info_ctrl->data[INFO_DATA_VALUE]=19616; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=BerNum; ++ info_ctrl->data[INFO_DATA_DEN]=BerDen; ++ } ++ ++ break; ++ case FE_GET_DEMOD_SNR_DB: ++ if(pDemod->GetSnrDb(pDemod, &SnrDbNum, &SnrDbDen) != FUNCTION_SUCCESS) ++ { ++ ret=-10; ++ info_ctrl->data[INFO_DATA_VALUE]=0; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=SnrDbNum; ++ info_ctrl->data[INFO_DATA_DEN]=SnrDbDen; ++ } ++ break; ++ case FE_GET_DEMOD_TR_PPM: ++ if(pDemod->GetTrOffsetPpm(pDemod, &tr_ppm) != FUNCTION_SUCCESS) ++ { ++ ret=-10; ++ info_ctrl->data[INFO_DATA_VALUE]=0; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=tr_ppm; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ break; ++ case FE_GET_DEMOD_CR_HZ: ++ if(pDemod->GetCrOffsetHz(pDemod, &cr_hz) != FUNCTION_SUCCESS) ++ { ++ ret=-10; ++ info_ctrl->data[INFO_DATA_VALUE]=0; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ else ++ { ++ ret=10; ++ info_ctrl->data[INFO_DATA_VALUE]=cr_hz; ++ info_ctrl->data[INFO_DATA_DEN]=1; ++ } ++ break; ++ default: ++ deb_info("ERROR::rtl2832u ioctl - std info cmd ret= unknow info commond. \n" ); ++ ret=-1; ++ break; ++ } ++ ++ ++ if ((info_cmd != FE_GET_SIGN_STRENGTH) && (info_cmd != FE_GET_SIGN_QUALITY)){ ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ } ++ ++// deb_info("-%s :ioctl - std info cmd ret= %x,data=%x,den=%x\n", __FUNCTION__,ret,(int)info_ctrl->data[INFO_DATA_VALUE],info_ctrl->data[INFO_DATA_DEN]); ++ ++ return ret; ++ ++} ++int rtl2832u_ioctl_override(struct dvb_frontend *fe,unsigned int cmd, void *parg,unsigned int stage) ++{ ++ int ret = 0; ++ deb_info("+%s[20101201_1828] ioctl \n", __FUNCTION__); ++ if(stage == DVB_FE_IOCTL_PRE) ++ { ++ switch(cmd) ++ { ++ case FE_RW_SID_CMD: ++ ++ ret = fe_rw_std_cmd_ioctrl(fe, parg); ++ if (ret < 0){ ++ ret=-10;} ++ else{ ++ ret=10;} ++ ++ break; ++ case FE_RW_DEMOD_INFO: ++ ret = fe_demod_info_ioctrl(fe, parg); ++ if (ret < 0) ++ {ret=-10;} ++ else{ ++ ret=10;} ++ break; ++ ++ } ++ ++ } ++ ++ deb_info("-%s ioctl - ret= %d stage=%d \n", __FUNCTION__,ret,stage); ++ return ret; ++ ++} ++ ++int ++set_rtl2832_ioctrl_8bit_stdi2c( ++ struct dvb_frontend *fe, ++ unsigned short dev_i2c_addr, ++ unsigned char reg_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int i=0; ++ int ret = -1; ++ unsigned char data_temp[MAX_STD_I2C_BUF_NUM]; ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ struct dvb_usb_device* d = p_state->d; ++ deb_info("+%s dev_i2c_addr = 0x%x reg_addr=0x%x bytelength=%d \n", __FUNCTION__,dev_i2c_addr, reg_addr,bytelength); ++ ++ if (bytelength > 128 ){ ++ deb_info("ERROR::bytelength > 128\n"); ++ return -1; ++ } ++ data_temp[0]=reg_addr; ++ for (i=0;ii2c_repeater_mutex) ) ++ return -1; ++ ++ ++ ++ ret=0; ++error: ++ mutex_unlock(&p_state->i2c_repeater_mutex); ++ deb_info("-%s: dev_i2c_addr = 0x%x reg_addr=0x%x bytelength=%d \n", __FUNCTION__,dev_i2c_addr, reg_addr,bytelength); ++ return ret; ++ ++ ++} ++int ++get_rtl2832_ioctrl_8bit_stdi2c( ++ struct dvb_frontend *fe, ++ unsigned short dev_i2c_addr, ++ unsigned char reg_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ int ret =-1; ++ int i; ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ struct dvb_usb_device* d = p_state->d; ++ if (bytelength > 128 ){ ++ deb_info("ERROR::bytelength > 128\n"); ++ return -1; ++ } ++ deb_info("+%s[1347]: dev_i2c_addr = 0x%x reg_addr=0x%x bytelength=%d \n", __FUNCTION__,dev_i2c_addr, reg_addr,bytelength); ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) ++ return -1; ++ ++ if ( write_rtl2832_stdi2c( d, dev_i2c_addr , ®_addr , LEN_1_BYTE ) ) ++ { ++ ret=-1; ++ goto error; ++ } ++ if ( read_rtl2832_stdi2c( d, dev_i2c_addr , data , bytelength ) ) ++ { ++ ret=-1; ++ goto error; ++ } ++ ++ deb_info("read data[]=["); ++ for(i=0;ii2c_repeater_mutex); ++ deb_info("-%s: dev_i2c_addr = 0x%x reg_addr=0x%x bytelength=%d \n", __FUNCTION__,dev_i2c_addr, reg_addr,bytelength); ++ return ret; ++ ++} ++int ++set_rtl2832_ioctrl_8bit_demodbytes( ++ struct dvb_frontend *fe, ++ unsigned char page, ++ unsigned char reg_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ ++ int ret = -1; ++ int i=0; ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ unsigned char data_temp[128]; ++ DVBT_NIM_MODULE *pNim; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ deb_info("+%s[1546]: page= %d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength); ++ ++ if (bytelength > 128 ){ ++ deb_info("ERROR::bytelength > 128\n"); ++ return -1; ++ } ++ ++ if (p_state->demod_type != RTL2832){ ++ deb_info("ERROR::demod type not rtl2832u...\n"); ++ return -1; ++ } ++ pNim = p_state->pNim; ++ if (pNim == NULL){ ++ return -1; ++ } ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ){ ++ return -1; ++ } ++ pDemod=pNim->pDemod; ++ ++ if(pDemod->SetRegPage(pDemod, page) != FUNCTION_SUCCESS){ ++ ret=-1; ++ goto error; ++ } ++ for(i=0;iSetRegBytes(pDemod, reg_addr, data_temp, bytelength) != FUNCTION_SUCCESS) { ++ ret=-1; ++ goto error; ++ } ++ deb_info("-%s: data[%d,%x]= \n", __FUNCTION__,page, reg_addr); ++ for (i=0;ii2c_repeater_mutex); ++ deb_info("-%s: page=%d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength); ++ return ret; ++ ++ ++} ++int ++get_rtl2832_ioctrl_8bit_demodbytes( ++ struct dvb_frontend *fe, ++ unsigned char page, ++ unsigned char reg_addr, ++ unsigned char* data, ++ unsigned short bytelength) ++{ ++ ++ int ret = -1; ++ int i=0; ++ ++ struct rtl2832_state* p_state = fe->demodulator_priv; ++ unsigned char data_temp[128]; ++ ++ DVBT_NIM_MODULE *pNim; ++ DVBT_DEMOD_MODULE *pDemod; ++ ++ deb_info("+%s: page= %d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength); ++ ++ if (bytelength > 128 ){ ++ deb_info("ERROR::bytelength > 128\n"); ++ return -1; ++ } ++ ++ if (p_state->demod_type != RTL2832){ ++ deb_info("ERROR::demod type not rtl2832u...\n"); ++ return -1; ++ } ++ pNim = p_state->pNim; ++ if (pNim == NULL){ ++ return -1; ++ } ++ if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ){ ++ return -1; ++ } ++ pDemod=pNim->pDemod; ++ ++ if(pDemod->SetRegPage(pDemod, page) != FUNCTION_SUCCESS){ ++ ret=-1; ++ goto error; ++ } ++ if(pDemod->GetRegBytes(pDemod, reg_addr, data_temp, bytelength) != FUNCTION_SUCCESS) { ++ ret=-1; ++ goto error; ++ } ++ deb_info("->%s: data[%d,%x]= \n", __FUNCTION__,page, reg_addr); ++ for (i=0;ii2c_repeater_mutex); ++ deb_info("-%s: page=%d reg_addr=0x%x bytelength=%d \n", __FUNCTION__,page, reg_addr,bytelength); ++ return ret; ++ ++} +diff --git a/drivers/media/dvb/dvb-usb/rtl2832u_ioctl.h b/drivers/media/dvb/dvb-usb/rtl2832u_ioctl.h +new file mode 100644 +index 0000000..4954d3c +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/rtl2832u_ioctl.h +@@ -0,0 +1,60 @@ ++#ifndef __RTL2832U_IOCTL_H__ ++#define __RTL2832U_IOCTL_H__ ++ ++#include ++#include "rtl2832u_fe.h" ++#include "rtl2832u_io.h" ++ ++#include "dvbdev.h" ++ ++ ++struct rtl2832u_ioctl_rwcmd_struct ++{ ++ int cmd_num; ++ unsigned char page; ++ unsigned char dev_i2c_addr; ++ unsigned long reg_addr; ++ unsigned char *data; ++ unsigned int bytelength; ++ ++}; ++struct rtl2832u_ioctl_info_struct ++{ ++ int cmd_num; ++ unsigned long *data; ++ unsigned int data_length; ++}; ++ ++enum FE_RW_DEMOD_DATA_TAG{ ++ INFO_DATA_VALUE=0, ++ INFO_DATA_DEN=1, ++ INFO_DEMOD_DATA_LEN=2 ++}; ++#define FE_RW_SID_CMD _IOWR('o', 81, struct rtl2832u_ioctl_rwcmd_struct) ++#define FE_RW_DEMOD_INFO _IOWR('o', 82, struct rtl2832u_ioctl_info_struct) ++ ++#define MAX_STD_I2C_BUF_NUM 131 ++ ++enum FE_STD_RW_CMD_TAG{ ++ FE_RW_STD_WR=0, ++ FE_RW_STD_RD=1, ++ FE_RW_DEMOD_WR=2, ++ FE_RW_DEMOD_RD=3, ++ FE_RW_STD_P_TEST=4, ++ FE_RW_STD_M_TEST=5, ++ FE_RW_STD_NUM ++}; ++ ++enum FE_RW_DEMOD_INFO_TAG{ ++ FE_GET_SIGN_STRENGTH=0, ++ FE_GET_SIGN_QUALITY=1, ++ FE_GET_SIGN_LOCK=2, ++ FE_GET_DEMOD_BER=3, ++ FE_GET_DEMOD_SNR_DB=4, ++ FE_GET_DEMOD_TR_PPM=5, ++ FE_GET_DEMOD_CR_HZ=6, ++ FE_DEMOD_INFO_NUM ++}; ++int rtl2832u_ioctl_override(struct dvb_frontend *fe,unsigned int cmd, void *parg,unsigned int stage); ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_base.h b/drivers/media/dvb/dvb-usb/tuner_base.h +new file mode 100644 +index 0000000..17eb68b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_base.h +@@ -0,0 +1,1723 @@ ++#ifndef __TUNER_BASE_H ++#define __TUNER_BASE_H ++ ++/** ++ ++@file ++ ++@brief Tuner base module definition ++ ++Tuner base module definitions contains tuner module structure, tuner funciton pointers, and tuner definitions. ++ ++ ++ ++@par Example: ++@code ++ ++ ++#include "demod_xxx.h" ++#include "tuner_xxx.h" ++ ++ ++ ++int ++CustomI2cRead( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C reading format: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++int ++CustomI2cWrite( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned char DeviceAddr, ++ const unsigned char *pWritingBytes, ++ unsigned long ByteNum ++ ) ++{ ++ // I2C writing format: ++ // start_bit + (DeviceAddr | writing_bit) + writing_byte * ByteNum + stop_bit ++ ++ ... ++ ++ return FUNCTION_SUCCESS; ++ ++error_status: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++void ++CustomWaitMs( ++ BASE_INTERFACE_MODULE *pBaseInterface, ++ unsigned long WaitTimeMs ++ ) ++{ ++ // Wait WaitTimeMs milliseconds. ++ ++ ... ++ ++ return; ++} ++ ++ ++ ++int main(void) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ ++ XXX_DEMOD_MODULE *pDemod; ++ XXX_DEMOD_MODULE XxxDemodModuleMemory; ++ ++ TUNER_MODULE *pTuner; ++ TUNER_MODULE TunerModuleMemory; ++ ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long RfFreqHz; ++ ++ int TunerType; ++ unsigned char DeviceAddr; ++ ++ ++ ++ // Build base interface module. ++ BuildBaseInterface( ++ &pBaseInterface, ++ &BaseInterfaceModuleMemory, ++ 9, // Set maximum I2C reading byte number with 9. ++ 8, // Set maximum I2C writing byte number with 8. ++ CustomI2cRead, // Employ CustomI2cRead() as basic I2C reading function. ++ CustomI2cWrite, // Employ CustomI2cWrite() as basic I2C writing function. ++ CustomWaitMs // Employ CustomWaitMs() as basic waiting function. ++ ); ++ ++ ++ // Build dmeod XXX module. ++ // Note: Demod module builder will set I2cBridgeModuleMemory for tuner I2C command forwarding. ++ // Must execute demod builder to set I2cBridgeModuleMemory before use tuner functions. ++ BuildDemodXxxModule( ++ &pDemod, ++ &XxxDemodModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ ... // Other arguments by each demod module ++ ) ++ ++ ++ // Build tuner XXX module. ++ BuildTunerXxxModule( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0, // Tuner I2C device address is 0xc0 in 8-bit format. ++ ... // Other arguments by each demod module ++ ); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ // Initialize tuner. ++ pTuner->Initialize(pTuner); ++ ++ ++ // Set tuner parameters. (RF frequency) ++ // Note: In the example, RF frequency is 474 MHz. ++ RfFreqHz = 474000000; ++ ++ pTuner->SetIfFreqHz(pTuner, RfFreqHz); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ // Get tuenr type. ++ // Note: One can find tuner type in MODULE_TYPE enumeration. ++ pTuner->GetTunerType(pTuner, &TunerType); ++ ++ // Get tuner I2C device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Get tuner parameters. (RF frequency) ++ pTuner->GetRfFreqHz(pTuner, &RfFreqHz); ++ ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "foundation.h" ++ ++ ++ ++ ++ ++/// tuner module pre-definition ++typedef struct TUNER_MODULE_TAG TUNER_MODULE; ++ ++ ++ ++ ++ ++/** ++ ++@brief Tuner type getting function pointer ++ ++One can use TUNER_FP_GET_TUNER_TYPE() to get tuner type. ++ ++ ++@param [in] pTuner The tuner module pointer ++@param [out] pTunerType Pointer to an allocated memory for storing tuner type ++ ++ ++@note ++ -# Tuner building function will set TUNER_FP_GET_TUNER_TYPE() with the corresponding function. ++ ++ ++@see TUNER_TYPE ++ ++*/ ++typedef void ++(*TUNER_FP_GET_TUNER_TYPE)( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Tuner I2C device address getting function pointer ++ ++One can use TUNER_FP_GET_DEVICE_ADDR() to get tuner I2C device address. ++ ++ ++@param [in] pTuner The tuner module pointer ++@param [out] pDeviceAddr Pointer to an allocated memory for storing tuner I2C device address ++ ++ ++@retval FUNCTION_SUCCESS Get tuner device address successfully. ++@retval FUNCTION_ERROR Get tuner device address unsuccessfully. ++ ++ ++@note ++ -# Tuner building function will set TUNER_FP_GET_DEVICE_ADDR() with the corresponding function. ++ ++*/ ++typedef void ++(*TUNER_FP_GET_DEVICE_ADDR)( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Tuner initializing function pointer ++ ++One can use TUNER_FP_INITIALIZE() to initialie tuner. ++ ++ ++@param [in] pTuner The tuner module pointer ++ ++ ++@retval FUNCTION_SUCCESS Initialize tuner successfully. ++@retval FUNCTION_ERROR Initialize tuner unsuccessfully. ++ ++ ++@note ++ -# Tuner building function will set TUNER_FP_INITIALIZE() with the corresponding function. ++ ++*/ ++typedef int ++(*TUNER_FP_INITIALIZE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Tuner RF frequency setting function pointer ++ ++One can use TUNER_FP_SET_RF_FREQ_HZ() to set tuner RF frequency in Hz. ++ ++ ++@param [in] pTuner The tuner module pointer ++@param [in] RfFreqHz RF frequency in Hz for setting ++ ++ ++@retval FUNCTION_SUCCESS Set tuner RF frequency successfully. ++@retval FUNCTION_ERROR Set tuner RF frequency unsuccessfully. ++ ++ ++@note ++ -# Tuner building function will set TUNER_FP_SET_RF_FREQ_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*TUNER_FP_SET_RF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++ ++ ++ ++ ++/** ++ ++@brief Tuner RF frequency getting function pointer ++ ++One can use TUNER_FP_GET_RF_FREQ_HZ() to get tuner RF frequency in Hz. ++ ++ ++@param [in] pTuner The tuner module pointer ++@param [in] pRfFreqHz Pointer to an allocated memory for storing demod RF frequency in Hz ++ ++ ++@retval FUNCTION_SUCCESS Get tuner RF frequency successfully. ++@retval FUNCTION_ERROR Get tuner RF frequency unsuccessfully. ++ ++ ++@note ++ -# Tuner building function will set TUNER_FP_GET_RF_FREQ_HZ() with the corresponding function. ++ ++*/ ++typedef int ++(*TUNER_FP_GET_RF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// TDCG-G052D extra module ++typedef struct TDCGG052D_EXTRA_MODULE_TAG TDCGG052D_EXTRA_MODULE; ++struct TDCGG052D_EXTRA_MODULE_TAG ++{ ++ // TDCG-G052D extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control; ++ unsigned char BandSwitch; ++ unsigned char Auxiliary; ++}; ++ ++ ++ ++ ++ ++// TDCH-G001D extra module ++typedef struct TDCHG001D_EXTRA_MODULE_TAG TDCHG001D_EXTRA_MODULE; ++struct TDCHG001D_EXTRA_MODULE_TAG ++{ ++ // TDCH-G001D extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control; ++ unsigned char BandSwitch; ++ unsigned char Auxiliary; ++}; ++ ++ ++ ++ ++ ++// TDQE3-003A extra module ++#define TDQE3003A_CONTROL_BYTE_NUM 3 ++ ++typedef struct TDQE3003A_EXTRA_MODULE_TAG TDQE3003A_EXTRA_MODULE; ++struct TDQE3003A_EXTRA_MODULE_TAG ++{ ++ // TDQE3-003A extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control[TDQE3003A_CONTROL_BYTE_NUM]; ++}; ++ ++ ++ ++ ++ ++// DCT-7045 extra module ++typedef struct DCT7045_EXTRA_MODULE_TAG DCT7045_EXTRA_MODULE; ++struct DCT7045_EXTRA_MODULE_TAG ++{ ++ // DCT-7045 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control; ++}; ++ ++ ++ ++ ++ ++/// MT2062 extra module ++typedef struct MT2062_EXTRA_MODULE_TAG MT2062_EXTRA_MODULE; ++ ++// MT2062 handle openning function pointer ++typedef int ++(*MT2062_FP_OPEN_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2062 handle closing function pointer ++typedef int ++(*MT2062_FP_CLOSE_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2062 handle getting function pointer ++typedef void ++(*MT2062_FP_GET_HANDLE)( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ); ++ ++// MT2062 IF frequency setting function pointer ++typedef int ++(*MT2062_FP_SET_IF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long IfFreqHz ++ ); ++ ++// MT2062 IF frequency getting function pointer ++typedef int ++(*MT2062_FP_GET_IF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ); ++ ++// MT2062 extra module ++struct MT2062_EXTRA_MODULE_TAG ++{ ++ // MT2062 extra variables ++ void *DeviceHandle; ++ int LoopThroughMode; ++ ++ unsigned long IfFreqHz; ++ ++ int IsIfFreqHzSet; ++ ++ // MT2062 extra function pointers ++ MT2062_FP_OPEN_HANDLE OpenHandle; ++ MT2062_FP_CLOSE_HANDLE CloseHandle; ++ MT2062_FP_GET_HANDLE GetHandle; ++ MT2062_FP_SET_IF_FREQ_HZ SetIfFreqHz; ++ MT2062_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++}; ++ ++ ++ ++ ++ ++/// MxL5005S extra module ++#define INITCTRL_NUM 40 ++#define CHCTRL_NUM 36 ++#define MXLCTRL_NUM 189 ++#define TUNER_REGS_NUM 104 ++ ++typedef struct MXL5005S_EXTRA_MODULE_TAG MXL5005S_EXTRA_MODULE; ++ ++// MXL5005 Tuner Register Struct ++typedef struct _TunerReg_struct ++{ ++ unsigned short Reg_Num ; // Tuner Register Address ++ unsigned short Reg_Val ; // Current sofware programmed value waiting to be writen ++} TunerReg_struct ; ++ ++// MXL5005 Tuner Control Struct ++typedef struct _TunerControl_struct { ++ unsigned short Ctrl_Num ; // Control Number ++ unsigned short size ; // Number of bits to represent Value ++ unsigned short addr[25] ; // Array of Tuner Register Address for each bit position ++ unsigned short bit[25] ; // Array of bit position in Register Address for each bit position ++ unsigned short val[25] ; // Binary representation of Value ++} TunerControl_struct ; ++ ++// MXL5005 Tuner Struct ++typedef struct _Tuner_struct ++{ ++ unsigned char Mode ; // 0: Analog Mode ; 1: Digital Mode ++ unsigned char IF_Mode ; // for Analog Mode, 0: zero IF; 1: low IF ++ unsigned long Chan_Bandwidth ; // filter channel bandwidth (6, 7, 8) ++ unsigned long IF_OUT ; // Desired IF Out Frequency ++ unsigned short IF_OUT_LOAD ; // IF Out Load Resistor (200/300 Ohms) ++ unsigned long RF_IN ; // RF Input Frequency ++ unsigned long Fxtal ; // XTAL Frequency ++ unsigned char AGC_Mode ; // AGC Mode 0: Dual AGC; 1: Single AGC ++ unsigned short TOP ; // Value: take over point ++ unsigned char CLOCK_OUT ; // 0: turn off clock out; 1: turn on clock out ++ unsigned char DIV_OUT ; // 4MHz or 16MHz ++ unsigned char CAPSELECT ; // 0: disable On-Chip pulling cap; 1: enable ++ unsigned char EN_RSSI ; // 0: disable RSSI; 1: enable RSSI ++ unsigned char Mod_Type ; // Modulation Type; ++ // 0 - Default; 1 - DVB-T; 2 - ATSC; 3 - QAM; 4 - Analog Cable ++ unsigned char TF_Type ; // Tracking Filter Type ++ // 0 - Default; 1 - Off; 2 - Type C; 3 - Type C-H ++ ++ // Calculated Settings ++ unsigned long RF_LO ; // Synth RF LO Frequency ++ unsigned long IF_LO ; // Synth IF LO Frequency ++ unsigned long TG_LO ; // Synth TG_LO Frequency ++ ++ // Pointers to ControlName Arrays ++ unsigned short Init_Ctrl_Num ; // Number of INIT Control Names ++ TunerControl_struct Init_Ctrl[INITCTRL_NUM] ; // INIT Control Names Array Pointer ++ unsigned short CH_Ctrl_Num ; // Number of CH Control Names ++ TunerControl_struct CH_Ctrl[CHCTRL_NUM] ; // CH Control Name Array Pointer ++ unsigned short MXL_Ctrl_Num ; // Number of MXL Control Names ++ TunerControl_struct MXL_Ctrl[MXLCTRL_NUM] ; // MXL Control Name Array Pointer ++ ++ // Pointer to Tuner Register Array ++ unsigned short TunerRegs_Num ; // Number of Tuner Registers ++ TunerReg_struct TunerRegs[TUNER_REGS_NUM] ; // Tuner Register Array Pointer ++} Tuner_struct ; ++ ++// MxL5005S register setting function pointer ++typedef int ++(*MXL5005S_FP_SET_REGS_WITH_TABLE)( ++ TUNER_MODULE *pTuner, ++ unsigned char *pAddrTable, ++ unsigned char *pByteTable, ++ int TableLen ++ ); ++ ++// MxL5005S register mask bits setting function pointer ++typedef int ++(*MXL5005S_FP_SET_REG_MASK_BITS)( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned char WritingValue ++ ); ++ ++// MxL5005S spectrum mode setting function pointer ++typedef int ++(*MXL5005S_FP_SET_SPECTRUM_MODE)( ++ TUNER_MODULE *pTuner, ++ int SpectrumMode ++ ); ++ ++// MxL5005S bandwidth setting function pointer ++typedef int ++(*MXL5005S_FP_SET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++// MxL5005S extra module ++struct MXL5005S_EXTRA_MODULE_TAG ++{ ++ // MxL5005S function pointers ++ MXL5005S_FP_SET_REGS_WITH_TABLE SetRegsWithTable; ++ MXL5005S_FP_SET_REG_MASK_BITS SetRegMaskBits; ++ MXL5005S_FP_SET_SPECTRUM_MODE SetSpectrumMode; ++ MXL5005S_FP_SET_BANDWIDTH_HZ SetBandwidthHz; ++ ++ ++ // MxL5005S extra data ++ unsigned char AgcMasterByte; // Variable name in MaxLinear source code: AGC_MASTER_BYTE ++ ++ // MaxLinear defined struct ++ Tuner_struct MxlDefinedTunerStructure; ++}; ++ ++ ++ ++ ++ ++// TDVM-H715P extra module ++typedef struct TDVMH715P_EXTRA_MODULE_TAG TDVMH751P_EXTRA_MODULE; ++struct TDVMH715P_EXTRA_MODULE_TAG ++{ ++ // TDVM-H715P extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control; ++ unsigned char BandSwitch; ++ unsigned char Auxiliary; ++}; ++ ++ ++ ++ ++ ++// UBA00AL extra module ++typedef struct UBA00AL_EXTRA_MODULE_TAG UBA00AL_EXTRA_MODULE; ++struct UBA00AL_EXTRA_MODULE_TAG ++{ ++ // UBA00AL extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char BandSwitch; ++ unsigned char Control2; ++}; ++ ++ ++ ++ ++ ++/// MT2266 extra module ++typedef struct MT2266_EXTRA_MODULE_TAG MT2266_EXTRA_MODULE; ++ ++// MT2266 handle openning function pointer ++typedef int ++(*MT2266_FP_OPEN_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2266 handle closing function pointer ++typedef int ++(*MT2266_FP_CLOSE_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2266 handle getting function pointer ++typedef void ++(*MT2266_FP_GET_HANDLE)( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ); ++ ++// MT2266 bandwidth setting function pointer ++typedef int ++(*MT2266_FP_SET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++// MT2266 bandwidth getting function pointer ++typedef int ++(*MT2266_FP_GET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++// MT2266 extra module ++struct MT2266_EXTRA_MODULE_TAG ++{ ++ // MT2266 extra variables ++ void *DeviceHandle; ++ unsigned long BandwidthHz; ++ int IsBandwidthHzSet; ++ ++ // MT2266 extra function pointers ++ MT2266_FP_OPEN_HANDLE OpenHandle; ++ MT2266_FP_CLOSE_HANDLE CloseHandle; ++ MT2266_FP_GET_HANDLE GetHandle; ++ MT2266_FP_SET_BANDWIDTH_HZ SetBandwidthHz; ++ MT2266_FP_GET_BANDWIDTH_HZ GetBandwidthHz; ++}; ++ ++ ++ ++ ++ ++// FC2580 extra module ++typedef struct FC2580_EXTRA_MODULE_TAG FC2580_EXTRA_MODULE; ++ ++// FC2580 bandwidth mode setting function pointer ++typedef int ++(*FC2580_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// FC2580 bandwidth mode getting function pointer ++typedef int ++(*FC2580_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// FC2580 extra module ++struct FC2580_EXTRA_MODULE_TAG ++{ ++ // FC2580 extra variables ++ unsigned long CrystalFreqHz; ++ int AgcMode; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // FC2580 extra function pointers ++ FC2580_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ FC2580_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++}; ++ ++ ++ ++ ++ ++/// TUA9001 extra module ++typedef struct TUA9001_EXTRA_MODULE_TAG TUA9001_EXTRA_MODULE; ++ ++// Extra manipulaing function ++typedef int ++(*TUA9001_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++typedef int ++(*TUA9001_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++typedef int ++(*TUA9001_FP_GET_REG_BYTES_WITH_REG_ADDR)( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte, ++ unsigned char ByteNum ++ ); ++ ++typedef int ++(*TUA9001_FP_SET_SYS_REG_BYTE)( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char WritingByte ++ ); ++ ++typedef int ++(*TUA9001_FP_GET_SYS_REG_BYTE)( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char *pReadingByte ++ ); ++ ++// TUA9001 extra module ++struct TUA9001_EXTRA_MODULE_TAG ++{ ++ // TUA9001 extra variables ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // TUA9001 extra function pointers ++ TUA9001_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ TUA9001_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++ TUA9001_FP_GET_REG_BYTES_WITH_REG_ADDR GetRegBytesWithRegAddr; ++ TUA9001_FP_SET_SYS_REG_BYTE SetSysRegByte; ++ TUA9001_FP_GET_SYS_REG_BYTE GetSysRegByte; ++}; ++ ++ ++ ++ ++ ++// DTT-75300 extra module ++typedef struct DTT75300_EXTRA_MODULE_TAG DTT75300_EXTRA_MODULE; ++struct DTT75300_EXTRA_MODULE_TAG ++{ ++ // DTT-75300 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++ unsigned char Control4; ++}; ++ ++ ++ ++ ++ ++// MxL5007T extra module ++typedef struct MXL5007T_EXTRA_MODULE_TAG MXL5007T_EXTRA_MODULE; ++ ++// MxL5007 TunerConfig Struct ++typedef struct _MxL5007_TunerConfigS ++{ ++ int I2C_Addr; ++ int Mode; ++ int IF_Diff_Out_Level; ++ int Xtal_Freq; ++ int IF_Freq; ++ int IF_Spectrum; ++ int ClkOut_Setting; ++ int ClkOut_Amp; ++ int BW_MHz; ++ unsigned int RF_Freq_Hz; ++ ++ // Additional definition ++ TUNER_MODULE *pTuner; ++ ++} MxL5007_TunerConfigS; ++ ++// MxL5007T bandwidth mode setting function pointer ++typedef int ++(*MXL5007T_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// MxL5007T bandwidth mode getting function pointer ++typedef int ++(*MXL5007T_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// MxL5007T extra module ++struct MXL5007T_EXTRA_MODULE_TAG ++{ ++ // MxL5007T extra variables ++ int LoopThroughMode; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // MxL5007T MaxLinear-defined structure ++ MxL5007_TunerConfigS *pTunerConfigS; ++ MxL5007_TunerConfigS TunerConfigSMemory; ++ ++ // MxL5007T extra function pointers ++ MXL5007T_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ MXL5007T_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++}; ++ ++ ++ ++ ++ ++// VA1T1ED6093 extra module ++typedef struct VA1T1ED6093_EXTRA_MODULE_TAG VA1T1ED6093_EXTRA_MODULE; ++struct VA1T1ED6093_EXTRA_MODULE_TAG ++{ ++ // VA1T1ED6093 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++/// TUA8010 extra module ++typedef struct TUA8010_EXTRA_MODULE_TAG TUA8010_EXTRA_MODULE; ++ ++// Extra manipulaing function ++typedef int ++(*TUA8010_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++typedef int ++(*TUA8010_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++typedef int ++(*TUA8010_FP_GET_REG_BYTES_WITH_REG_ADDR)( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte, ++ unsigned char ByteNum ++ ); ++ ++// TUA8010 extra module ++struct TUA8010_EXTRA_MODULE_TAG ++{ ++ // TUA8010 extra variables ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // TUA8010 extra function pointers ++ TUA8010_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ TUA8010_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++ TUA8010_FP_GET_REG_BYTES_WITH_REG_ADDR GetRegBytesWithRegAddr; ++}; ++ ++ ++ ++ ++ ++// E4000 extra module ++typedef struct E4000_EXTRA_MODULE_TAG E4000_EXTRA_MODULE; ++ ++// E4000 register byte getting function pointer ++typedef int ++(*E4000_FP_GET_REG_BYTE)( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte ++ ); ++ ++// E4000 bandwidth Hz setting function pointer ++typedef int ++(*E4000_FP_SET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++// E4000 bandwidth Hz getting function pointer ++typedef int ++(*E4000_FP_GET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++// E4000 extra module ++struct E4000_EXTRA_MODULE_TAG ++{ ++ // E4000 extra variables ++ unsigned long CrystalFreqHz; ++ int BandwidthHz; ++ int IsBandwidthHzSet; ++ ++ // E4000 extra function pointers ++ E4000_FP_GET_REG_BYTE GetRegByte; ++ E4000_FP_SET_BANDWIDTH_HZ SetBandwidthHz; ++ E4000_FP_GET_BANDWIDTH_HZ GetBandwidthHz; ++}; ++ ++ ++ ++ ++ ++// DCT-70704 extra module ++typedef struct DCT70704_EXTRA_MODULE_TAG DCT70704_EXTRA_MODULE; ++struct DCT70704_EXTRA_MODULE_TAG ++{ ++ // DCT-70704 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char BandSwitch; ++ unsigned char Control2; ++}; ++ ++ ++ ++ ++ ++/// MT2063 extra module ++typedef struct MT2063_EXTRA_MODULE_TAG MT2063_EXTRA_MODULE; ++ ++// MT2063 handle openning function pointer ++typedef int ++(*MT2063_FP_OPEN_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2063 handle closing function pointer ++typedef int ++(*MT2063_FP_CLOSE_HANDLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// MT2063 handle getting function pointer ++typedef void ++(*MT2063_FP_GET_HANDLE)( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ); ++ ++// MT2063 IF frequency setting function pointer ++typedef int ++(*MT2063_FP_SET_IF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long IfFreqHz ++ ); ++ ++// MT2063 IF frequency getting function pointer ++typedef int ++(*MT2063_FP_GET_IF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ); ++ ++// MT2063 bandwidth setting function pointer ++typedef int ++(*MT2063_FP_SET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++// MT2063 bandwidth getting function pointer ++typedef int ++(*MT2063_FP_GET_BANDWIDTH_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++// MT2063 extra module ++struct MT2063_EXTRA_MODULE_TAG ++{ ++ // MT2063 extra variables ++ void *DeviceHandle; ++ int StandardMode; ++ unsigned long VgaGc; ++ ++ unsigned long IfFreqHz; ++ unsigned long BandwidthHz; ++ ++ int IsIfFreqHzSet; ++ int IsBandwidthHzSet; ++ ++ // MT2063 extra function pointers ++ MT2063_FP_OPEN_HANDLE OpenHandle; ++ MT2063_FP_CLOSE_HANDLE CloseHandle; ++ MT2063_FP_GET_HANDLE GetHandle; ++ MT2063_FP_SET_IF_FREQ_HZ SetIfFreqHz; ++ MT2063_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++ MT2063_FP_SET_BANDWIDTH_HZ SetBandwidthHz; ++ MT2063_FP_GET_BANDWIDTH_HZ GetBandwidthHz; ++}; ++ ++ ++ ++ ++ ++// FC0012 extra module ++typedef struct FC0012_EXTRA_MODULE_TAG FC0012_EXTRA_MODULE; ++ ++// FC0012 bandwidth mode setting function pointer ++typedef int ++(*FC0012_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// FC0012 bandwidth mode getting function pointer ++typedef int ++(*FC0012_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// FC0012 extra module ++struct FC0012_EXTRA_MODULE_TAG ++{ ++ // FC0012 extra variables ++ unsigned long CrystalFreqHz; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // FC0012 extra function pointers ++ FC0012_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ FC0012_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++}; ++ ++ ++ ++ ++ ++// TDAG extra module ++typedef struct TDAG_EXTRA_MODULE_TAG TDAG_EXTRA_MODULE; ++struct TDAG_EXTRA_MODULE_TAG ++{ ++ // TDAG extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// ADMTV804 extra module ++typedef struct ADMTV804_EXTRA_MODULE_TAG ADMTV804_EXTRA_MODULE; ++ ++// ADMTV804 standard bandwidth mode setting function pointer ++typedef int ++(*ADMTV804_FP_SET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// ADMTV804 standard bandwidth mode getting function pointer ++typedef int ++(*ADMTV804_FP_GET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// ADMTV804 RF power level getting function pointer ++typedef int ++(*ADMTV804_FP_GET_RF_POWER_LEVEL)( ++ TUNER_MODULE *pTuner, ++ long *pRfPowerLevel ++ ); ++ ++// ADMTV804 extra module ++struct ADMTV804_EXTRA_MODULE_TAG ++{ ++ // ADMTV804 extra variables (from ADMTV804 source code) ++ unsigned char REV_INFO; ++ unsigned char g_curBand; ++ unsigned char pddiv3; ++ unsigned char REG24; ++ unsigned char REG2B; ++ unsigned char REG2E; ++ unsigned char REG30; ++ unsigned char REG31; ++ unsigned char REG5A; ++ unsigned char REG61; // V1.6 added ++ ++ // ADMTV804 extra variables ++ unsigned long CrystalFreqHz; ++ int StandardBandwidthMode; ++ int IsStandardBandwidthModeSet; ++ long RfPowerLevel; ++ ++ // ADMTV804 extra function pointers ++ ADMTV804_FP_SET_STANDARD_BANDWIDTH_MODE SetStandardBandwidthMode; ++ ADMTV804_FP_GET_STANDARD_BANDWIDTH_MODE GetStandardBandwidthMode; ++ ADMTV804_FP_GET_RF_POWER_LEVEL GetRfPowerLevel; ++}; ++ ++ ++ ++ ++ ++// MAX3543 extra module ++typedef struct MAX3543_EXTRA_MODULE_TAG MAX3543_EXTRA_MODULE; ++ ++// MAX3543 bandwidth mode setting function pointer ++typedef int ++(*MAX3543_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// MAX3543 bandwidth mode getting function pointer ++typedef int ++(*MAX3543_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// MAX3543 extra module ++struct MAX3543_EXTRA_MODULE_TAG ++{ ++ // MAX3543 extra variables (from MAX3543 source code) ++ unsigned short TFRomCoefs[3][4]; ++ unsigned short denominator; ++ unsigned long fracscale ; ++ unsigned short regs[22]; ++ unsigned short IF_Frequency; ++ ++ int broadcast_standard; ++ int XTALSCALE; ++ int XTALREF; ++ int LOSCALE; ++ ++ ++ // MAX3543 extra variables ++ unsigned long CrystalFreqHz; ++ int StandardMode; ++ unsigned long IfFreqHz; ++ int OutputMode; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // MAX3543 extra function pointers ++ MAX3543_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ MAX3543_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++}; ++ ++ ++ ++ ++ ++// TDA18272 extra module ++typedef struct TDA18272_EXTRA_MODULE_TAG TDA18272_EXTRA_MODULE; ++ ++// TDA18272 standard bandwidth mode setting function pointer ++typedef int ++(*TDA18272_FP_SET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int StandardBandwidthMode ++ ); ++ ++// TDA18272 standard bandwidth mode getting function pointer ++typedef int ++(*TDA18272_FP_GET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pStandardBandwidthMode ++ ); ++ ++// TDA18272 power mode setting function pointer ++typedef int ++(*TDA18272_FP_SET_POWER_MODE)( ++ TUNER_MODULE *pTuner, ++ int PowerMode ++ ); ++ ++// TDA18272 power mode getting function pointer ++typedef int ++(*TDA18272_FP_GET_POWER_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pPowerMode ++ ); ++ ++// TDA18272 IF frequency getting function pointer ++typedef int ++(*TDA18272_FP_GET_IF_FREQ_HZ)( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ); ++ ++// TDA18272 extra module ++struct TDA18272_EXTRA_MODULE_TAG ++{ ++ // TDA18272 extra variables ++ unsigned long CrystalFreqHz; ++ int UnitNo; ++ int IfOutputVppMode; ++ int StandardBandwidthMode; ++ int IsStandardBandwidthModeSet; ++ int PowerMode; ++ int IsPowerModeSet; ++ ++ // TDA18272 extra function pointers ++ TDA18272_FP_SET_STANDARD_BANDWIDTH_MODE SetStandardBandwidthMode; ++ TDA18272_FP_GET_STANDARD_BANDWIDTH_MODE GetStandardBandwidthMode; ++ TDA18272_FP_SET_POWER_MODE SetPowerMode; ++ TDA18272_FP_GET_POWER_MODE GetPowerMode; ++ TDA18272_FP_GET_IF_FREQ_HZ GetIfFreqHz; ++}; ++ ++ ++ ++ ++ ++// FC0013 extra module ++typedef struct FC0013_EXTRA_MODULE_TAG FC0013_EXTRA_MODULE; ++ ++// FC0013 bandwidth mode setting function pointer ++typedef int ++(*FC0013_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// FC0013 bandwidth mode getting function pointer ++typedef int ++(*FC0013_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// FC0013 reset IQ LPF BW ++typedef int ++(*FC0013_FP_RC_CAL_RESET)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// FC0013 increase IQ LPF BW ++typedef int ++(*FC0013_FP_RC_CAL_ADD)( ++ TUNER_MODULE *pTuner, ++ int RcValue ++ ); ++ ++// FC0013 extra module ++struct FC0013_EXTRA_MODULE_TAG ++{ ++ // FC0013 extra variables ++ unsigned long CrystalFreqHz; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // FC0013 extra function pointers ++ FC0013_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ FC0013_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++ FC0013_FP_RC_CAL_RESET RcCalReset; ++ FC0013_FP_RC_CAL_ADD RcCalAdd; ++}; ++ ++ ++ ++ ++ ++// VA1E1ED2403 extra module ++typedef struct VA1E1ED2403_EXTRA_MODULE_TAG VA1E1ED2403_EXTRA_MODULE; ++struct VA1E1ED2403_EXTRA_MODULE_TAG ++{ ++ // VA1E1ED2403 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// Avalon extra module ++#define AVALON_RF_REG_MAX_ADDR 0x60 ++#define AVALON_BB_REG_MAX_ADDR 0x4f ++ ++typedef struct _AVALON_CONFIG_STRUCT { ++ double RFChannelMHz; ++ double dIfFrequencyMHz; ++ double f_dac_MHz; ++ int TVStandard; ++} AVALON_CONFIG_STRUCT, *PAVALON_CONFIG_STRUCT; ++ ++typedef struct AVALON_EXTRA_MODULE_TAG AVALON_EXTRA_MODULE; ++ ++// AVALON standard bandwidth mode setting function pointer ++typedef int ++(*AVALON_FP_SET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int StandardBandwidthMode ++ ); ++ ++// AVALON standard bandwidth mode getting function pointer ++typedef int ++(*AVALON_FP_GET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pStandardBandwidthMode ++ ); ++ ++// AVALON extra module ++struct AVALON_EXTRA_MODULE_TAG ++{ ++ // AVALON extra variables (from AVALON source code) ++ unsigned char g_avalon_rf_reg_work_table[AVALON_RF_REG_MAX_ADDR+1]; ++ unsigned char g_avalon_bb_reg_work_table[AVALON_BB_REG_MAX_ADDR+1]; ++ ++ int ++ (*g_avalon_i2c_read_handler)( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char *pReadingBuffer, ++ unsigned short *pByteNum ++ ); ++ ++ int ++ (*g_avalon_i2c_write_handler)( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char *pWritingBuffer, ++ unsigned short *pByteNum ++ ); ++ ++ AVALON_CONFIG_STRUCT AvalonConfig; ++ ++ ++ // AVALON extra variables ++ unsigned char AtvDemodDeviceAddr; ++ unsigned long CrystalFreqHz; ++ unsigned long IfFreqHz; ++ int StandardBandwidthMode; ++ int IsStandardBandwidthModeSet; ++ ++ // AVALON extra function pointers ++ AVALON_FP_SET_STANDARD_BANDWIDTH_MODE SetStandardBandwidthMode; ++ AVALON_FP_GET_STANDARD_BANDWIDTH_MODE GetStandardBandwidthMode; ++}; ++ ++ ++ ++ ++ ++// SutRx201 extra module ++typedef struct SUTRE201_EXTRA_MODULE_TAG SUTRE201_EXTRA_MODULE; ++ ++// SUTRE201 standard bandwidth mode setting function pointer ++typedef int ++(*SUTRE201_FP_SET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int StandardBandwidthMode ++ ); ++ ++// SUTRE201 standard bandwidth mode getting function pointer ++typedef int ++(*SUTRE201_FP_GET_STANDARD_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pStandardBandwidthMode ++ ); ++ ++// SUTRE201 tuner enabling function pointer ++typedef int ++(*SUTRE201_FP_ENABLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// SUTRE201 tuner disabling function pointer ++typedef int ++(*SUTRE201_FP_DISABLE)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// SUTRE201 tuner IF port mode setting function pointer ++typedef int ++(*SUTRE201_FP_SET_IF_PORT_MODE)( ++ TUNER_MODULE *pTuner, ++ int IfPortMode ++ ); ++ ++// SUTRE201 extra module ++struct SUTRE201_EXTRA_MODULE_TAG ++{ ++ // SUTRE201 extra variables ++ unsigned long CrystalFreqHz; ++ unsigned long IfFreqHz; ++ int IfPortMode; ++ int CountryMode; ++ int StandardBandwidthMode; ++ int IsStandardBandwidthModeSet; ++ ++ // SUTRE201 extra function pointers ++ SUTRE201_FP_SET_STANDARD_BANDWIDTH_MODE SetStandardBandwidthMode; ++ SUTRE201_FP_GET_STANDARD_BANDWIDTH_MODE GetStandardBandwidthMode; ++ SUTRE201_FP_ENABLE Enable; ++ SUTRE201_FP_DISABLE Disable; ++ SUTRE201_FP_SET_IF_PORT_MODE SetIfPortMode; ++}; ++ ++ ++ ++ ++ ++// MR1300 extra module ++typedef struct MR1300_EXTRA_MODULE_TAG MR1300_EXTRA_MODULE; ++struct MR1300_EXTRA_MODULE_TAG ++{ ++ // MR1300 extra data ++ unsigned long CrystalFreqHz; ++}; ++ ++ ++ ++ ++ ++// TDAC7 extra module ++typedef struct TDAC7_EXTRA_MODULE_TAG TDAC7_EXTRA_MODULE; ++struct TDAC7_EXTRA_MODULE_TAG ++{ ++ // TDAC7 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// VA1T1ER2094 extra module ++typedef struct VA1T1ER2094_EXTRA_MODULE_TAG VA1T1ER2094_EXTRA_MODULE; ++struct VA1T1ER2094_EXTRA_MODULE_TAG ++{ ++ // VA1T1ER2094 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// TDAC3 extra module ++typedef struct TDAC3_EXTRA_MODULE_TAG TDAC3_EXTRA_MODULE; ++struct TDAC3_EXTRA_MODULE_TAG ++{ ++ // TDAC3 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// RT910 extra module ++#define RT910_INITIAL_TABLE_LENGTH 25 ++typedef struct RT910_EXTRA_MODULE_TAG RT910_EXTRA_MODULE; ++ ++// RT910 bandwidth mode setting function pointer ++typedef int ++(*RT910_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// RT910 bandwidth mode getting function pointer ++typedef int ++(*RT910_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// RT910 extra module ++struct RT910_EXTRA_MODULE_TAG ++{ ++ // RT910 extra variables ++ unsigned long CrystalFreqHz; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ unsigned char RT910RegsMap[RT910_INITIAL_TABLE_LENGTH]; ++ unsigned char RT910BW8MCalib[RT910_INITIAL_TABLE_LENGTH]; // 80MHz for C.F. cali. ++ ++ ++ // RT910 extra function pointers ++ RT910_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ RT910_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++}; ++ ++ ++ ++ ++ ++// DTM4C20 extra module ++typedef struct DTM4C20_EXTRA_MODULE_TAG DTM4C20_EXTRA_MODULE; ++struct DTM4C20_EXTRA_MODULE_TAG ++{ ++ // DTM4C20 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// GTFD32 extra module ++typedef struct GTFD32_EXTRA_MODULE_TAG GTFD32_EXTRA_MODULE; ++struct GTFD32_EXTRA_MODULE_TAG ++{ ++ // GTFD32 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// GTLP10 extra module ++typedef struct GTLP10_EXTRA_MODULE_TAG GTLP10_EXTRA_MODULE; ++struct GTLP10_EXTRA_MODULE_TAG ++{ ++ // GTLP10 extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// JSS66T extra module ++typedef struct JSS66T_EXTRA_MODULE_TAG JSS66T_EXTRA_MODULE; ++struct JSS66T_EXTRA_MODULE_TAG ++{ ++ // JSS66T extra data ++ unsigned char DividerMsb; ++ unsigned char DividerLsb; ++ unsigned char Control1; ++ unsigned char Control2; ++ unsigned char Control3; ++}; ++ ++ ++ ++ ++ ++// FC0013B extra module ++typedef struct FC0013B_EXTRA_MODULE_TAG FC0013B_EXTRA_MODULE; ++ ++// FC0013B bandwidth mode setting function pointer ++typedef int ++(*FC0013B_FP_SET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++// FC0013B bandwidth mode getting function pointer ++typedef int ++(*FC0013B_FP_GET_BANDWIDTH_MODE)( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++// FC0013B reset IQ LPF BW ++typedef int ++(*FC0013B_FP_RC_CAL_RESET)( ++ TUNER_MODULE *pTuner ++ ); ++ ++// FC0013B increase IQ LPF BW ++typedef int ++(*FC0013B_FP_RC_CAL_ADD)( ++ TUNER_MODULE *pTuner, ++ int RcValue ++ ); ++ ++// FC0013B extra module ++struct FC0013B_EXTRA_MODULE_TAG ++{ ++ // FC0013B extra variables ++ unsigned long CrystalFreqHz; ++ int BandwidthMode; ++ int IsBandwidthModeSet; ++ ++ // FC0013B extra function pointers ++ FC0013B_FP_SET_BANDWIDTH_MODE SetBandwidthMode; ++ FC0013B_FP_GET_BANDWIDTH_MODE GetBandwidthMode; ++ FC0013B_FP_RC_CAL_RESET RcCalReset; ++ FC0013B_FP_RC_CAL_ADD RcCalAdd; ++}; ++ ++ ++ ++ ++ ++/// Tuner module structure ++struct TUNER_MODULE_TAG ++{ ++ // Private variables ++ int TunerType; ///< Tuner type ++ unsigned char DeviceAddr; ///< Tuner I2C device address ++ unsigned long RfFreqHz; ///< Tuner RF frequency in Hz ++ ++ int IsRfFreqHzSet; ///< Tuner RF frequency in Hz (setting status) ++ ++ union ///< Tuner extra module used by driving module ++ { ++ TDCGG052D_EXTRA_MODULE Tdcgg052d; ++ TDCHG001D_EXTRA_MODULE Tdchg001d; ++ TDQE3003A_EXTRA_MODULE Tdqe3003a; ++ DCT7045_EXTRA_MODULE Dct7045; ++ MT2062_EXTRA_MODULE Mt2062; ++ MXL5005S_EXTRA_MODULE Mxl5005s; ++ TDVMH751P_EXTRA_MODULE Tdvmh751p; ++ UBA00AL_EXTRA_MODULE Uba00al; ++ MT2266_EXTRA_MODULE Mt2266; ++ FC2580_EXTRA_MODULE Fc2580; ++ TUA9001_EXTRA_MODULE Tua9001; ++ DTT75300_EXTRA_MODULE Dtt75300; ++ MXL5007T_EXTRA_MODULE Mxl5007t; ++ VA1T1ED6093_EXTRA_MODULE Va1t1ed6093; ++ TUA8010_EXTRA_MODULE Tua8010; ++ E4000_EXTRA_MODULE E4000; ++ DCT70704_EXTRA_MODULE Dct70704; ++ MT2063_EXTRA_MODULE Mt2063; ++ FC0012_EXTRA_MODULE Fc0012; ++ TDAG_EXTRA_MODULE Tdag; ++ ADMTV804_EXTRA_MODULE Admtv804; ++ MAX3543_EXTRA_MODULE Max3543; ++ TDA18272_EXTRA_MODULE Tda18272; ++ FC0013_EXTRA_MODULE Fc0013; ++ VA1E1ED2403_EXTRA_MODULE Va1e1ed2403; ++ AVALON_EXTRA_MODULE Avalon; ++ SUTRE201_EXTRA_MODULE Sutre201; ++ MR1300_EXTRA_MODULE Mr1300; ++ TDAC7_EXTRA_MODULE Tdac7; ++ VA1T1ER2094_EXTRA_MODULE Va1t1er2094; ++ TDAC3_EXTRA_MODULE Tdac3; ++ RT910_EXTRA_MODULE Rt910; ++ DTM4C20_EXTRA_MODULE Dtm4c20; ++ GTFD32_EXTRA_MODULE Gtfd32; ++ GTLP10_EXTRA_MODULE Gtlp10; ++ JSS66T_EXTRA_MODULE Jss66t; ++ FC0013B_EXTRA_MODULE Fc0013b; ++ } ++ Extra; ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ///< Base interface module ++ I2C_BRIDGE_MODULE *pI2cBridge; ///< I2C bridge module ++ ++ ++ // Tuner manipulating functions ++ TUNER_FP_GET_TUNER_TYPE GetTunerType; ///< Tuner type getting function pointer ++ TUNER_FP_GET_DEVICE_ADDR GetDeviceAddr; ///< Tuner I2C device address getting function pointer ++ ++ TUNER_FP_INITIALIZE Initialize; ///< Tuner initializing function pointer ++ TUNER_FP_SET_RF_FREQ_HZ SetRfFreqHz; ///< Tuner RF frequency setting function pointer ++ TUNER_FP_GET_RF_FREQ_HZ GetRfFreqHz; ///< Tuner RF frequency getting function pointer ++}; ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_e4000.c b/drivers/media/dvb/dvb-usb/tuner_e4000.c +new file mode 100644 +index 0000000..417af04 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_e4000.c +@@ -0,0 +1,2482 @@ ++/** ++ ++@file ++ ++@brief E4000 tuner module definition ++ ++One can manipulate E4000 tuner through E4000 module. ++E4000 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_e4000.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief E4000 tuner module builder ++ ++Use BuildE4000Module() to build E4000 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to E4000 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr E4000 I2C device address ++@param [in] CrystalFreqHz E4000 crystal frequency in Hz ++@param [in] AgcMode E4000 AGC mode ++ ++ ++@note ++ -# One should call BuildE4000Module() to build E4000 module before using it. ++ ++*/ ++void ++BuildE4000Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ E4000_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.E4000); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_E4000; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = e4000_GetTunerType; ++ pTuner->GetDeviceAddr = e4000_GetDeviceAddr; ++ ++ pTuner->Initialize = e4000_Initialize; ++ pTuner->SetRfFreqHz = e4000_SetRfFreqHz; ++ pTuner->GetRfFreqHz = e4000_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->IsBandwidthHzSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->GetRegByte = e4000_GetRegByte; ++ pExtra->SetBandwidthHz = e4000_SetBandwidthHz; ++ pExtra->GetBandwidthHz = e4000_GetBandwidthHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++e4000_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++e4000_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++e4000_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ E4000_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.E4000); ++ ++ ++ // Initialize tuner. ++ // Note: Call E4000 source code functions. ++ if(tunerreset(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(Tunerclock(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(Qpeak(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(DCoffloop(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(GainControlinit(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++e4000_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ E4000_EXTRA_MODULE *pExtra; ++ ++ int RfFreqKhz; ++ int CrystalFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.E4000); ++ ++ ++ // Set tuner RF frequency in KHz. ++ // Note: 1. RfFreqKhz = round(RfFreqHz / 1000) ++ // CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ // 2. Call E4000 source code functions. ++ RfFreqKhz = (int)((RfFreqHz + 500) / 1000); ++ CrystalFreqKhz = (int)((pExtra->CrystalFreqHz + 500) / 1000); ++ ++ if(Gainmanual(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(E4000_gain_freq(pTuner, RfFreqKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(PLL(pTuner, CrystalFreqKhz, RfFreqKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(LNAfilter(pTuner, RfFreqKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(freqband(pTuner, RfFreqKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(DCoffLUT(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ if(GainControlauto(pTuner) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++e4000_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get E4000 register byte. ++ ++*/ ++int ++e4000_GetRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte ++ ) ++{ ++ // Call I2CReadByte() to read tuner register. ++ if(I2CReadByte(pTuner, NO_USE, RegAddr, pReadingByte) != E4000_I2C_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set E4000 tuner bandwidth. ++ ++*/ ++int ++e4000_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ) ++{ ++ E4000_EXTRA_MODULE *pExtra; ++ ++ int BandwidthKhz; ++ int CrystalFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.E4000); ++ ++ ++ // Set tuner bandwidth Hz. ++ // Note: 1. BandwidthKhz = round(BandwidthHz / 1000) ++ // CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ // 2. Call E4000 source code functions. ++ BandwidthKhz = (int)((BandwidthHz + 500) / 1000); ++ CrystalFreqKhz = (int)((pExtra->CrystalFreqHz + 500) / 1000); ++ ++ if(IFfilter(pTuner, BandwidthKhz, CrystalFreqKhz) != E4000_1_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner bandwidth Hz parameter. ++ pExtra->BandwidthHz = BandwidthHz; ++ pExtra->IsBandwidthHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get E4000 tuner bandwidth. ++ ++*/ ++int ++e4000_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ) ++{ ++ E4000_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.E4000); ++ ++ ++ // Get tuner bandwidth Hz from tuner module. ++ if(pExtra->IsBandwidthHzSet != YES) ++ goto error_status_get_tuner_bandwidth_hz; ++ ++ *pBandwidthHz = pExtra->BandwidthHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_hz: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Function (implemeted for E4000) ++int ++I2CReadByte( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, pReadingByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ return E4000_I2C_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return E4000_I2C_FAIL; ++} ++ ++ ++ ++ ++ ++int ++I2CWriteByte( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegAddr, ++ unsigned char WritingByte ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + data + stop_bit ++ WritingBuffer[0] = RegAddr; ++ WritingBuffer[1] = WritingByte; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return E4000_I2C_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return E4000_I2C_FAIL; ++} ++ ++ ++ ++ ++ ++int ++I2CWriteArray( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegStartAddr, ++ unsigned char ByteNum, ++ unsigned char *pWritingBytes ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned int i; ++ ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of demod register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + stop_bit ++ WritingBuffer[0] = RegStartAddr; ++ ++ for(i = 0; i < ByteNum; i++) ++ WritingBuffer[LEN_1_BYTE + i] = pWritingBytes[i]; ++ ++ ++ /// Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, ByteNum + LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return E4000_I2C_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return E4000_I2C_FAIL; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by Elonics. ++ ++ ++ ++ ++ ++// Elonics source code - E4000_API_rev2_04_realtek.cpp ++ ++ ++//****************************************************************************/ ++// ++// Filename E4000_initialisation.c ++// Revision 2.04 ++// ++// Description: ++// Initialisation script for the Elonics E4000 revC tuner ++// ++// Copyright (c) Elonics Ltd ++// ++// Any software supplied free of charge for use with elonics ++// evaluation kits is supplied without warranty and for ++// evaluation purposes only. Incorporation of any of this ++// code into products for open sale is permitted but only at ++// the user's own risk. Elonics accepts no liability for the ++// integrity of this software whatsoever. ++// ++// ++//****************************************************************************/ ++//#include ++//#include ++// ++// User defined variable definitions ++// ++/* ++int Ref_clk = 26000; // Reference clock frequency(kHz). ++int Freq = 590000; // RF Frequency (kHz) ++int bandwidth = 8000; //RF channel bandwith (kHz) ++*/ ++// ++// API defined variable definitions ++//int VCO_freq; ++//unsigned char writearray[5]; ++//unsigned char read1[1]; ++//int status; ++// ++// ++// function definitions ++// ++/* ++int tunerreset (); ++int Tunerclock(); ++int filtercal(); ++int Qpeak(); ++int PLL(int Ref_clk, int Freq); ++int LNAfilter(int Freq); ++int IFfilter(int bandwidth, int Ref_clk); ++int freqband(int Freq); ++int DCoffLUT(); ++int DCoffloop(); ++int commonmode(); ++int GainControlinit(); ++*/ ++// ++//**************************************************************************** ++// --- Public functions ------------------------------------------------------ ++/****************************************************************************\ ++* Function: tunerreset ++* ++* Detailed Description: ++* The function resets the E4000 tuner. (Register 0x00). ++* ++\****************************************************************************/ ++ ++int tunerreset(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ writearray[0] = 64; ++ // For dummy I2C command, don't check executing status. ++ status=I2CWriteByte (pTuner, 200,2,writearray[0]); ++ status=I2CWriteByte (pTuner, 200,2,writearray[0]); ++ //printf("\nRegister 0=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteByte (pTuner, 200,9,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteByte (pTuner, 200,5,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 7; ++ status=I2CWriteByte (pTuner, 200,0,writearray[0]); ++ //printf("\nRegister 0=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: Tunerclock ++* ++* Detailed Description: ++* The function configures the E4000 clock. (Register 0x06, 0x7a). ++* Function disables the clock - values can be modified to enable if required. ++\****************************************************************************/ ++ ++int Tunerclock(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ writearray[0] = 0; ++ status=I2CWriteByte(pTuner, 200,6,writearray[0]); ++ //printf("\nRegister 6=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 150; ++ status=I2CWriteByte(pTuner, 200,122,writearray[0]); ++ //printf("\nRegister 7a=%d", writearray[0]); ++ //**Modify commands above with value required if output clock is required, ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: filtercal ++* ++* Detailed Description: ++* Instructs RC filter calibration. (Register 0x7b). ++* ++\****************************************************************************/ ++/* ++int filtercal(TUNER_MODULE *pTuner) ++{ ++ //writearray[0] = 1; ++ //I2CWriteByte (pTuner, 200,123,writearray[0]); ++ //printf("\nRegister 7b=%d", writearray[0]); ++ //return; ++ return E4000_1_SUCCESS; ++} ++*/ ++/****************************************************************************\ ++* Function: Qpeak() ++* ++* Detailed Description: ++* The function configures the E4000 gains. ++* Also sigma delta controller. (Register 0x82). ++* ++\****************************************************************************/ ++ ++int Qpeak(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ writearray[0] = 1; ++ writearray[1] = 254; ++ status=I2CWriteArray(pTuner, 200,126,2,writearray); ++ //printf("\nRegister 7e=%d", writearray[0]); ++ //printf("\nRegister 7f=%d", writearray[1]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CWriteByte (pTuner, 200,130,0); ++ //printf("\nRegister 82=0"); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CWriteByte (pTuner, 200,36,5); ++ //printf("\nRegister 24=5"); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 32; ++ writearray[1] = 1; ++ status=I2CWriteArray(pTuner, 200,135,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ //printf("\nRegister 87=%d", writearray[0]); ++ //printf("\nRegister 88=%d", writearray[1]); ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: E4000_gain_freq() ++* ++* Detailed Description: ++* The function configures the E4000 gains vs. freq ++* 0xa3 to 0xa7. Also 0x24. ++* ++\****************************************************************************/ ++int E4000_gain_freq(TUNER_MODULE *pTuner, int Freq) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ if (Freq<=350000) ++ { ++ writearray[0] = 0x10; ++ writearray[1] = 0x42; ++ writearray[2] = 0x09; ++ writearray[3] = 0x21; ++ writearray[4] = 0x94; ++ } ++ else if(Freq>=1000000) ++ { ++ writearray[0] = 0x10; ++ writearray[1] = 0x42; ++ writearray[2] = 0x09; ++ writearray[3] = 0x21; ++ writearray[4] = 0x94; ++ } ++ else ++ { ++ writearray[0] = 0x10; ++ writearray[1] = 0x42; ++ writearray[2] = 0x09; ++ writearray[3] = 0x21; ++ writearray[4] = 0x94; ++ } ++ status=I2CWriteArray(pTuner, 200,163,5,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if (Freq<=350000) ++ { ++ writearray[0] = 94; ++ writearray[1] = 6; ++ status=I2CWriteArray(pTuner, 200,159,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteArray(pTuner, 200,136,1,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ else ++ { ++ writearray[0] = 127; ++ writearray[1] = 7; ++ status=I2CWriteArray(pTuner, 200,159,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 1; ++ status=I2CWriteArray(pTuner, 200,136,1,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ ++ //printf("\nRegister 9f=%d", writearray[0]); ++ //printf("\nRegister a0=%d", writearray[1]); ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: DCoffloop ++* ++* Detailed Description: ++* Populates DC offset LUT. (Registers 0x2d, 0x70, 0x71). ++* Turns on DC offset LUT and time varying DC offset. ++\****************************************************************************/ ++int DCoffloop(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ //writearray[0]=0; ++ //I2CWriteByte(pTuner, 200,115,writearray[0]); ++ //printf("\nRegister 73=%d", writearray[0]); ++ writearray[0] = 31; ++ status=I2CWriteByte(pTuner, 200,45,writearray[0]); ++ //printf("\nRegister 2d=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 1; ++ writearray[1] = 1; ++ status=I2CWriteArray(pTuner, 200,112,2,writearray); ++ //printf("\nRegister 70=%d", writearray[0]); ++ //printf("\nRegister 71=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: commonmode ++* ++* Detailed Description: ++* Configures common mode voltage. (Registers 0x2f). ++* ++\****************************************************************************/ ++/* ++int commonmode(TUNER_MODULE *pTuner) ++{ ++ //writearray[0] = 0; ++ //I2CWriteByte(Device_address,47,writearray[0]); ++ //printf("\nRegister 0x2fh = %d", writearray[0]); ++ // Sets 550mV. Modify if alternative is desired. ++ return E4000_1_SUCCESS; ++} ++*/ ++/****************************************************************************\ ++* Function: GainControlinit ++* ++* Detailed Description: ++* Configures gain control mode. (Registers 0x1d, 0x1e, 0x1f, 0x20, 0x21, ++* 0x1a, 0x74h, 0x75h). ++* User may wish to modify values depending on usage scenario. ++* Routine configures LNA: autonomous gain control ++* IF PWM gain control. ++* PWM thresholds = default ++* Mixer: switches when LNA gain =7.5dB ++* Sensitivity / Linearity mode: manual switch ++* ++\****************************************************************************/ ++int GainControlinit(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ unsigned char read1[1]; ++ int status; ++ ++ unsigned char sum=255; ++ ++ writearray[0] = 23; ++ status=I2CWriteByte(pTuner, 200,26,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ //printf("\nRegister 1a=%d", writearray[0]); ++ ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 16; ++ writearray[1] = 4; ++ writearray[2] = 26; ++ writearray[3] = 15; ++ writearray[4] = 167; ++ status=I2CWriteArray(pTuner, 200,29,5,writearray); ++ //printf("\nRegister 1d=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 81; ++ status=I2CWriteByte(pTuner, 200,134,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ //printf("\nRegister 86=%d", writearray[0]); ++ ++ //For Realtek - gain control logic ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if(read1[0]<=sum) ++ { ++ sum=read1[0]; ++ } ++ ++ status=I2CWriteByte(pTuner, 200,31,writearray[2]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if(read1[0] <= sum) ++ { ++ sum=read1[0]; ++ } ++ ++ status=I2CWriteByte(pTuner, 200,31,writearray[2]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if(read1[0] <= sum) ++ { ++ sum=read1[0]; ++ } ++ ++ status=I2CWriteByte(pTuner, 200,31,writearray[2]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if(read1[0] <= sum) ++ { ++ sum=read1[0]; ++ } ++ ++ status=I2CWriteByte(pTuner, 200,31,writearray[2]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CReadByte(pTuner, 201,27,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if (read1[0]<=sum) ++ { ++ sum=read1[0]; ++ } ++ ++ writearray[0]=sum; ++ status=I2CWriteByte(pTuner, 200,27,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ //printf("\nRegister 1b=%d", writearray[0]); ++ //printf("\nRegister 1e=%d", writearray[1]); ++ //printf("\nRegister 1f=%d", writearray[2]); ++ //printf("\nRegister 20=%d", writearray[3]); ++ //printf("\nRegister 21=%d", writearray[4]); ++ //writearray[0] = 3; ++ //writearray[1] = 252; ++ //writearray[2] = 3; ++ //writearray[3] = 252; ++ //I2CWriteArray(pTuner, 200,116,4,writearray); ++ //printf("\nRegister 74=%d", writearray[0]); ++ //printf("\nRegister 75=%d", writearray[1]); ++ //printf("\nRegister 76=%d", writearray[2]); ++ //printf("\nRegister 77=%d", writearray[3]); ++ ++ return E4000_1_SUCCESS; ++} ++ ++/****************************************************************************\ ++* Main program ++* ++* ++* ++\****************************************************************************/ ++/* ++int main() ++{ ++ tunerreset (); ++ Tunerclock(); ++ //filtercal(); ++ Qpeak(); ++ //PLL(Ref_clk, Freq); ++ //LNAfilter(Freq); ++ //IFfilter(bandwidth, Ref_clk); ++ //freqband(Freq); ++ //DCoffLUT(); ++ DCoffloop(); ++ //commonmode(); ++ GainControlinit(); ++// system("PAUSE"); ++ return(0); ++} ++*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Elonics source code - frequency_change_rev2.04_realtek.c ++ ++ ++//****************************************************************************/ ++// ++// Filename E4000_freqchangerev2.04.c ++// Revision 2.04 ++// ++// Description: ++// Frequency change script for the Elonics E4000 revB tuner ++// ++// Copyright (c) Elonics Ltd ++// ++// Any software supplied free of charge for use with elonics ++// evaluation kits is supplied without warranty and for ++// evaluation purposes only. Incorporation of any of this ++// code into products for open sale is permitted but only at ++// the user's own risk. Elonics accepts no liability for the ++// integrity of this software whatsoever. ++// ++// ++//****************************************************************************/ ++//#include ++//#include ++// ++// User defined variable definitions ++// ++/* ++int Ref_clk = 20000; // Reference clock frequency(kHz). ++int Freq = 590000; // RF Frequency (kHz) ++int bandwidth = 8; //RF channel bandwith (MHz) ++*/ ++// ++// API defined variable definitions ++//int VCO_freq; ++//unsigned char writearray[5]; ++//unsigned char read1[1]; ++//int E4000_1_SUCCESS; ++//int E4000_1_FAIL; ++//int E4000_I2C_SUCCESS; ++//int status; ++// ++// ++// function definitions ++// ++/* ++int Gainmanual(); ++int PLL(int Ref_clk, int Freq); ++int LNAfilter(int Freq); ++int IFfilter(int bandwidth, int Ref_clk); ++int freqband(int Freq); ++int DCoffLUT(); ++int GainControlauto(); ++*/ ++// ++//**************************************************************************** ++// --- Public functions ------------------------------------------------------ ++/****************************************************************************\ ++//****************************************************************************\ ++* Function: Gainmanual ++* ++* Detailed Description: ++* Sets Gain control to serial interface control. ++* ++\****************************************************************************/ ++int Gainmanual(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ writearray[0]=0; ++ status=I2CWriteByte(pTuner, 200,26,writearray[0]); ++ //printf("\nRegister 1a=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteByte (pTuner, 200,9,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteByte (pTuner, 200,5,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++ ++/****************************************************************************\ ++* Function: PLL ++* ++* Detailed Description: ++* Configures E4000 PLL divider & sigma delta. 0x0d,0x09, 0x0a, 0x0b). ++* ++\****************************************************************************/ ++int PLL(TUNER_MODULE *pTuner, int Ref_clk, int Freq) ++{ ++ int VCO_freq; ++ unsigned char writearray[5]; ++ int status; ++ ++ unsigned char divider; ++ int intVCOfreq; ++ int SigDel; ++ int SigDel2; ++ int SigDel3; ++// int harmonic_freq; ++// int offset; ++ ++ if (Freq<=72400) ++ { ++ writearray[4] = 15; ++ VCO_freq=Freq*48; ++ } ++ else if (Freq<=81200) ++ { ++ writearray[4] = 14; ++ VCO_freq=Freq*40; ++ } ++ else if (Freq<=108300) ++ { ++ writearray[4]=13; ++ VCO_freq=Freq*32; ++ } ++ else if (Freq<=162500) ++ { ++ writearray[4]=12; ++ VCO_freq=Freq*24; ++ } ++ else if (Freq<=216600) ++ { ++ writearray[4]=11; ++ VCO_freq=Freq*16; ++ } ++ else if (Freq<=325000) ++ { ++ writearray[4]=10; ++ VCO_freq=Freq*12; ++ } ++ else if (Freq<=350000) ++ { ++ writearray[4]=9; ++ VCO_freq=Freq*8; ++ } ++ else if (Freq<=432000) ++ { ++ writearray[4]=3; ++ VCO_freq=Freq*8; ++ } ++ else if (Freq<=667000) ++ { ++ writearray[4]=2; ++ VCO_freq=Freq*6; ++ } ++ else if (Freq<=1200000) ++ { ++ writearray[4]=1; ++ VCO_freq=Freq*4; ++ } ++ else ++ { ++ writearray[4]=0; ++ VCO_freq=Freq*2; ++ } ++ ++ //printf("\nVCOfreq=%d", VCO_freq); ++// divider = VCO_freq * 1000 / Ref_clk; ++ divider = VCO_freq / Ref_clk; ++ //printf("\ndivider=%d", divider); ++ writearray[0]= divider; ++// intVCOfreq = divider * Ref_clk /1000; ++ intVCOfreq = divider * Ref_clk; ++ //printf("\ninteger VCO freq=%d", intVCOfreq); ++// SigDel=65536 * 1000 * (VCO_freq - intVCOfreq) / Ref_clk; ++ SigDel=65536 * (VCO_freq - intVCOfreq) / Ref_clk; ++ //printf("\nSigma delta=%d", SigDel); ++ if (SigDel<=1024) ++ { ++ SigDel = 1024; ++ } ++ else if (SigDel>=64512) ++ { ++ SigDel=64512; ++ } ++ SigDel2 = SigDel / 256; ++ //printf("\nSigdel2=%d", SigDel2); ++ writearray[2] = (unsigned char)SigDel2; ++ SigDel3 = SigDel - (256 * SigDel2); ++ //printf("\nSig del3=%d", SigDel3); ++ writearray[1]= (unsigned char)SigDel3; ++ writearray[3]=(unsigned char)0; ++ status=I2CWriteArray(pTuner, 200,9,5,writearray); ++ //printf("\nRegister 9=%d", writearray[0]); ++ //printf("\nRegister a=%d", writearray[1]); ++ //printf("\nRegister b=%d", writearray[2]); ++ //printf("\nRegister d=%d", writearray[4]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ if (Freq<=82900) ++ { ++ writearray[0]=0; ++ writearray[2]=1; ++ } ++ else if (Freq<=89900) ++ { ++ writearray[0]=3; ++ writearray[2]=9; ++ } ++ else if (Freq<=111700) ++ { ++ writearray[0]=0; ++ writearray[2]=1; ++ } ++ else if (Freq<=118700) ++ { ++ writearray[0]=3; ++ writearray[2]=1; ++ } ++ else if (Freq<=140500) ++ { ++ writearray[0]=0; ++ writearray[2]=3; ++ } ++ else if (Freq<=147500) ++ { ++ writearray[0]=3; ++ writearray[2]=11; ++ } ++ else if (Freq<=169300) ++ { ++ writearray[0]=0; ++ writearray[2]=3; ++ } ++ else if (Freq<=176300) ++ { ++ writearray[0]=3; ++ writearray[2]=11; ++ } ++ else if (Freq<=198100) ++ { ++ writearray[0]=0; ++ writearray[2]=3; ++ } ++ else if (Freq<=205100) ++ { ++ writearray[0]=3; ++ writearray[2]=19; ++ } ++ else if (Freq<=226900) ++ { ++ writearray[0]=0; ++ writearray[2]=3; ++ } ++ else if (Freq<=233900) ++ { ++ writearray[0]=3; ++ writearray[2]=3; ++ } ++ else if (Freq<=350000) ++ { ++ writearray[0]=0; ++ writearray[2]=3; ++ } ++ else if (Freq<=485600) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=493600) ++ { ++ writearray[0]=3; ++ writearray[2]=5; ++ } ++ else if (Freq<=514400) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=522400) ++ { ++ writearray[0]=3; ++ writearray[2]=5; ++ } ++ else if (Freq<=543200) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=551200) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=572000) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=580000) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=600800) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=608800) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=629600) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=637600) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=658400) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=666400) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=687200) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=695200) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=716000) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=724000) ++ { ++ writearray[0]=3; ++ writearray[2]=13; ++ } ++ else if (Freq<=744800) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=752800) ++ { ++ writearray[0]=3; ++ writearray[2]=21; ++ } ++ else if (Freq<=773600) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=781600) ++ { ++ writearray[0]=3; ++ writearray[2]=21; ++ } ++ else if (Freq<=802400) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=810400) ++ { ++ writearray[0]=3; ++ writearray[2]=21; ++ } ++ else if (Freq<=831200) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=839200) ++ { ++ writearray[0]=3; ++ writearray[2]=21; ++ } ++ else if (Freq<=860000) ++ { ++ writearray[0]=0; ++ writearray[2]=5; ++ } ++ else if (Freq<=868000) ++ { ++ writearray[0]=3; ++ writearray[2]=21; ++ } ++ else ++ { ++ writearray[0]=0; ++ writearray[2]=7; ++ } ++ ++ status=I2CWriteByte (pTuner, 200,7,writearray[2]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ status=I2CWriteByte (pTuner, 200,5,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++ ++/****************************************************************************\ ++* Function: LNAfilter ++* ++* Detailed Description: ++* The function configures the E4000 LNA filter. (Register 0x10). ++* ++\****************************************************************************/ ++ ++int LNAfilter(TUNER_MODULE *pTuner, int Freq) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ if(Freq<=370000) ++ { ++ writearray[0]=0; ++ } ++ else if(Freq<=392500) ++ { ++ writearray[0]=1; ++ } ++ else if(Freq<=415000) ++ { ++ writearray[0] =2; ++ } ++ else if(Freq<=437500) ++ { ++ writearray[0]=3; ++ } ++ else if(Freq<=462500) ++ { ++ writearray[0]=4; ++ } ++ else if(Freq<=490000) ++ { ++ writearray[0]=5; ++ } ++ else if(Freq<=522500) ++ { ++ writearray[0]=6; ++ } ++ else if(Freq<=557500) ++ { ++ writearray[0]=7; ++ } ++ else if(Freq<=595000) ++ { ++ writearray[0]=8; ++ } ++ else if(Freq<=642500) ++ { ++ writearray[0]=9; ++ } ++ else if(Freq<=695000) ++ { ++ writearray[0]=10; ++ } ++ else if(Freq<=740000) ++ { ++ writearray[0]=11; ++ } ++ else if(Freq<=800000) ++ { ++ writearray[0]=12; ++ } ++ else if(Freq<=865000) ++ { ++ writearray[0] =13; ++ } ++ else if(Freq<=930000) ++ { ++ writearray[0]=14; ++ } ++ else if(Freq<=1000000) ++ { ++ writearray[0]=15; ++ } ++ else if(Freq<=1310000) ++ { ++ writearray[0]=0; ++ } ++ else if(Freq<=1340000) ++ { ++ writearray[0]=1; ++ } ++ else if(Freq<=1385000) ++ { ++ writearray[0]=2; ++ } ++ else if(Freq<=1427500) ++ { ++ writearray[0]=3; ++ } ++ else if(Freq<=1452500) ++ { ++ writearray[0]=4; ++ } ++ else if(Freq<=1475000) ++ { ++ writearray[0]=5; ++ } ++ else if(Freq<=1510000) ++ { ++ writearray[0]=6; ++ } ++ else if(Freq<=1545000) ++ { ++ writearray[0]=7; ++ } ++ else if(Freq<=1575000) ++ { ++ writearray[0] =8; ++ } ++ else if(Freq<=1615000) ++ { ++ writearray[0]=9; ++ } ++ else if(Freq<=1650000) ++ { ++ writearray[0] =10; ++ } ++ else if(Freq<=1670000) ++ { ++ writearray[0]=11; ++ } ++ else if(Freq<=1690000) ++ { ++ writearray[0]=12; ++ } ++ else if(Freq<=1710000) ++ { ++ writearray[0]=13; ++ } ++ else if(Freq<=1735000) ++ { ++ writearray[0]=14; ++ } ++ else ++ { ++ writearray[0]=15; ++ } ++ status=I2CWriteByte (pTuner, 200,16,writearray[0]); ++ //printf("\nRegister 10=%d", writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: IFfilter ++* ++* Detailed Description: ++* The function configures the E4000 IF filter. (Register 0x11,0x12). ++* ++\****************************************************************************/ ++int IFfilter(TUNER_MODULE *pTuner, int bandwidth, int Ref_clk) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ int IF_BW; ++ ++ IF_BW = bandwidth / 2; ++ if(IF_BW<=2150) ++ { ++ writearray[0]=253; ++ writearray[1]=31; ++ } ++ else if(IF_BW<=2200) ++ { ++ writearray[0]=253; ++ writearray[1]=30; ++ } ++ else if(IF_BW<=2240) ++ { ++ writearray[0]=252; ++ writearray[1]=29; ++ } ++ else if(IF_BW<=2280) ++ { ++ writearray[0]=252; ++ writearray[1]=28; ++ } ++ else if(IF_BW<=2300) ++ { ++ writearray[0]=252; ++ writearray[1]=27; ++ } ++ else if(IF_BW<=2400) ++ { ++ writearray[0]=252; ++ writearray[1]=26; ++ } ++ else if(IF_BW<=2450) ++ { ++ writearray[0]=252; ++ writearray[1]=25; ++ } ++ else if(IF_BW<=2500) ++ { ++ writearray[0]=252; ++ writearray[1]=24; ++ } ++ else if(IF_BW<=2550) ++ { ++ writearray[0]=252; ++ writearray[1]=23; ++ } ++ else if(IF_BW<=2600) ++ { ++ writearray[0]=252; ++ writearray[1]=22; ++ } ++ else if(IF_BW<=2700) ++ { ++ writearray[0]=252; ++ writearray[1]=21; ++ } ++ else if(IF_BW<=2750) ++ { ++ writearray[0]=252; ++ writearray[1]=20; ++ } ++ else if(IF_BW<=2800) ++ { ++ writearray[0]=252; ++ writearray[1]=19; ++ } ++ else if(IF_BW<=2900) ++ { ++ writearray[0]=251; ++ writearray[1]=18; ++ } ++ else if(IF_BW<=2950) ++ { ++ writearray[0]=251; ++ writearray[1]=17; ++ } ++ else if(IF_BW<=3000) ++ { ++ writearray[0]=251; ++ writearray[1]=16; ++ } ++ else if(IF_BW<=3100) ++ { ++ writearray[0]=251; ++ writearray[1]=15; ++ } ++ else if(IF_BW<=3200) ++ { ++ writearray[0]=250; ++ writearray[1]=14; ++ } ++ else if(IF_BW<=3300) ++ { ++ writearray[0]=250; ++ writearray[1]=13; ++ } ++ else if(IF_BW<=3400) ++ { ++ writearray[0]=249; ++ writearray[1]=12; ++ } ++ else if(IF_BW<=3600) ++ { ++ writearray[0]=249; ++ writearray[1]=11; ++ } ++ else if(IF_BW<=3700) ++ { ++ writearray[0]=249; ++ writearray[1]=10; ++ } ++ else if(IF_BW<=3800) ++ { ++ writearray[0]=248; ++ writearray[1]=9; ++ } ++ else if(IF_BW<=3900) ++ { ++ writearray[0]=248; ++ writearray[1]=8; ++ } ++ else if(IF_BW<=4100) ++ { ++ writearray[0]=248; ++ writearray[1]=7; ++ } ++ else if(IF_BW<=4300) ++ { ++ writearray[0]=247; ++ writearray[1]=6; ++ } ++ else if(IF_BW<=4400) ++ { ++ writearray[0]=247; ++ writearray[1]=5; ++ } ++ else if(IF_BW<=4600) ++ { ++ writearray[0]=247; ++ writearray[1]=4; ++ } ++ else if(IF_BW<=4800) ++ { ++ writearray[0]=246; ++ writearray[1]=3; ++ } ++ else if(IF_BW<=5000) ++ { ++ writearray[0]=246; ++ writearray[1]=2; ++ } ++ else if(IF_BW<=5300) ++ { ++ writearray[0]=245; ++ writearray[1]=1; ++ } ++ else if(IF_BW<=5500) ++ { ++ writearray[0]=245; ++ writearray[1]=0; ++ } ++ else ++ { ++ writearray[0]=0; ++ writearray[1]=32; ++ } ++ status=I2CWriteArray(pTuner, 200,17,2,writearray); ++ //printf("\nRegister 11=%d", writearray[0]); ++ //printf("\nRegister 12=%d", writearray[1]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: freqband ++* ++* Detailed Description: ++* Configures the E4000 frequency band. (Registers 0x07, 0x78). ++* ++\****************************************************************************/ ++int freqband(TUNER_MODULE *pTuner, int Freq) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ if (Freq<=140000) ++ { ++ writearray[0] = 3; ++ status=I2CWriteByte(pTuner, 200,120,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ else if (Freq<=350000) ++ { ++ writearray[0] = 3; ++ status=I2CWriteByte(pTuner, 200,120,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ else if (Freq<=1000000) ++ { ++ writearray[0] = 3; ++ status=I2CWriteByte(pTuner, 200,120,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ else ++ { ++ writearray[0] = 7; ++ status=I2CWriteByte(pTuner, 200,7,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = 0; ++ status=I2CWriteByte(pTuner, 200,120,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: DCoffLUT ++* ++* Detailed Description: ++* Populates DC offset LUT. (Registers 0x50 - 0x53, 0x60 - 0x63). ++* ++\****************************************************************************/ ++int DCoffLUT(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ unsigned char read1[1]; ++ unsigned char IOFF; ++ unsigned char QOFF; ++ unsigned char RANGE1; ++// unsigned char RANGE2; ++ unsigned char QRANGE; ++ unsigned char IRANGE; ++ writearray[0] = 0; ++ writearray[1] = 126; ++ writearray[2] = 36; ++ status=I2CWriteArray(pTuner, 200,21,3,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Sets mixer & IF stage 1 gain = 00 and IF stg 2+ to max gain. ++ writearray[0] = 1; ++ status=I2CWriteByte(pTuner, 200,41,writearray[0]); ++ // Instructs a DC offset calibration. ++ status=I2CReadByte(pTuner, 201,42,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,43,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ QOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,44,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ RANGE1=read1[0]; ++ //reads DC offset values back ++ if(RANGE1>=32) ++ { ++ RANGE1 = RANGE1 -32; ++ } ++ if(RANGE1>=16) ++ { ++ RANGE1 = RANGE1 - 16; ++ } ++ IRANGE=RANGE1; ++ QRANGE = (read1[0] - RANGE1) / 16; ++ ++ writearray[0] = (IRANGE * 64) + IOFF; ++ status=I2CWriteByte(pTuner, 200,96,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = (QRANGE * 64) + QOFF; ++ status=I2CWriteByte(pTuner, 200,80,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Populate DC offset LUT ++ writearray[0] = 0; ++ writearray[1] = 127; ++ status=I2CWriteArray(pTuner, 200,21,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Sets mixer & IF stage 1 gain = 01 leaving IF stg 2+ at max gain. ++ writearray[0]= 1; ++ status=I2CWriteByte(pTuner, 200,41,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Instructs a DC offset calibration. ++ status=I2CReadByte(pTuner, 201,42,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,43,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ QOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,44,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ RANGE1=read1[0]; ++ // Read DC offset values ++ if(RANGE1>=32) ++ { ++ RANGE1 = RANGE1 -32; ++ } ++ if(RANGE1>=16) ++ { ++ RANGE1 = RANGE1 - 16; ++ } ++ IRANGE = RANGE1; ++ QRANGE = (read1[0] - RANGE1) / 16; ++ ++ writearray[0] = (IRANGE * 64) + IOFF; ++ status=I2CWriteByte(pTuner, 200,97,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = (QRANGE * 64) + QOFF; ++ status=I2CWriteByte(pTuner, 200,81,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Populate DC offset LUT ++ writearray[0] = 1; ++ status=I2CWriteByte(pTuner, 200,21,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Sets mixer & IF stage 1 gain = 11 leaving IF stg 2+ at max gain. ++ writearray[0] = 1; ++ status=I2CWriteByte(pTuner, 200,41,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Instructs a DC offset calibration. ++ status=I2CReadByte(pTuner, 201,42,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,43,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ QOFF=read1[0]; ++ status=I2CReadByte(pTuner, 201,44,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ RANGE1 = read1[0]; ++ // Read DC offset values ++ if(RANGE1>=32) ++ { ++ RANGE1 = RANGE1 -32; ++ } ++ if(RANGE1>=16) ++ { ++ RANGE1 = RANGE1 - 16; ++ } ++ IRANGE = RANGE1; ++ QRANGE = (read1[0] - RANGE1) / 16; ++ writearray[0] = (IRANGE * 64) + IOFF; ++ status=I2CWriteByte(pTuner, 200,99,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = (QRANGE * 64) + QOFF; ++ status=I2CWriteByte(pTuner, 200,83,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Populate DC offset LUT ++ writearray[0] = 126; ++ status=I2CWriteByte(pTuner, 200,22,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Sets mixer & IF stage 1 gain = 11 leaving IF stg 2+ at max gain. ++ writearray[0] = 1; ++ status=I2CWriteByte(pTuner, 200,41,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ // Instructs a DC offset calibration. ++ status=I2CReadByte(pTuner, 201,42,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ IOFF=read1[0]; ++ ++ status=I2CReadByte(pTuner, 201,43,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ QOFF=read1[0]; ++ ++ status=I2CReadByte(pTuner, 201,44,read1); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ RANGE1=read1[0]; ++ ++ // Read DC offset values ++ if(RANGE1>=32) ++ { ++ RANGE1 = RANGE1 -32; ++ } ++ if(RANGE1>=16) ++ { ++ RANGE1 = RANGE1 - 16; ++ } ++ IRANGE = RANGE1; ++ QRANGE = (read1[0] - RANGE1) / 16; ++ ++ writearray[0]=(IRANGE * 64) + IOFF; ++ status=I2CWriteByte(pTuner, 200,98,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ writearray[0] = (QRANGE * 64) + QOFF; ++ status=I2CWriteByte(pTuner, 200,82,writearray[0]); ++ // Populate DC offset LUT ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: GainControlinit ++* ++* Detailed Description: ++* Configures gain control mode. (Registers 0x1a) ++* ++\****************************************************************************/ ++int GainControlauto(TUNER_MODULE *pTuner) ++{ ++ unsigned char writearray[5]; ++ int status; ++ ++ writearray[0] = 23; ++ status=I2CWriteByte(pTuner, 200,26,writearray[0]); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Main program ++* ++* ++* ++\****************************************************************************/ ++/* ++int main() ++{ ++ Gainmanual(); ++ PLL(Ref_clk, Freq); ++ LNAfilter(Freq); ++ IFfilter(bandwidth, Ref_clk); ++ freqband(Freq); ++ DCoffLUT(); ++ GainControlauto(); ++ return(0); ++} ++*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Elonics source code - RT2832_SW_optimisation_rev2.c ++ ++ ++ ++/****************************************************************************\ ++* Function: E4000_sensitivity ++* ++* Detailed Description: ++* The function configures the E4000 for sensitivity mode. ++* ++\****************************************************************************/ ++ ++int E4000_sensitivity(TUNER_MODULE *pTuner, int Freq, int bandwidth) ++{ ++ unsigned char writearray[2]; ++ int status; ++ int IF_BW; ++ ++ if(Freq<=700000) ++ { ++ writearray[0] = 0x07; ++ } ++ else ++ { ++ writearray[0] = 0x05; ++ } ++ status = I2CWriteArray(pTuner,200,36,1,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IF_BW = bandwidth / 2; ++ if(IF_BW<=2500) ++ { ++ writearray[0]=0xfc; ++ writearray[1]=0x17; ++ } ++ else if(IF_BW<=3000) ++ { ++ writearray[0]=0xfb; ++ writearray[1]=0x0f; ++ } ++ else if(IF_BW<=3500) ++ { ++ writearray[0]=0xf9; ++ writearray[1]=0x0b; ++ } ++ else if(IF_BW<=4000) ++ { ++ writearray[0]=0xf8; ++ writearray[1]=0x07; ++ } ++ status = I2CWriteArray(pTuner,200,17,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: E4000_linearity ++* ++* Detailed Description: ++* The function configures the E4000 for linearity mode. ++* ++\****************************************************************************/ ++int E4000_linearity(TUNER_MODULE *pTuner, int Freq, int bandwidth) ++{ ++ ++ unsigned char writearray[2]; ++ int status; ++ int IF_BW; ++ ++ if(Freq<=700000) ++ { ++ writearray[0] = 0x03; ++ } ++ else ++ { ++ writearray[0] = 0x01; ++ } ++ status = I2CWriteArray(pTuner,200,36,1,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IF_BW = bandwidth / 2; ++ if(IF_BW<=2500) ++ { ++ writearray[0]=0xfe; ++ writearray[1]=0x19; ++ } ++ else if(IF_BW<=3000) ++ { ++ writearray[0]=0xfd; ++ writearray[1]=0x11; ++ } ++ else if(IF_BW<=3500) ++ { ++ writearray[0]=0xfb; ++ writearray[1]=0x0d; ++ } ++ else if(IF_BW<=4000) ++ { ++ writearray[0]=0xfa; ++ writearray[1]=0x0a; ++ } ++ status = I2CWriteArray(pTuner,200,17,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++/****************************************************************************\ ++* Function: E4000_nominal ++* ++* Detailed Description: ++* The function configures the E4000 for nominal ++* ++\****************************************************************************/ ++int E4000_nominal(TUNER_MODULE *pTuner, int Freq, int bandwidth) ++{ ++ unsigned char writearray[2]; ++ int status; ++ int IF_BW; ++ ++ if(Freq<=700000) ++ { ++ writearray[0] = 0x03; ++ } ++ else ++ { ++ writearray[0] = 0x01; ++ } ++ status = I2CWriteArray(pTuner,200,36,1,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ IF_BW = bandwidth / 2; ++ if(IF_BW<=2500) ++ { ++ writearray[0]=0xfc; ++ writearray[1]=0x17; ++ } ++ else if(IF_BW<=3000) ++ { ++ writearray[0]=0xfb; ++ writearray[1]=0x0f; ++ } ++ else if(IF_BW<=3500) ++ { ++ writearray[0]=0xf9; ++ writearray[1]=0x0b; ++ } ++ else if(IF_BW<=4000) ++ { ++ writearray[0]=0xf8; ++ writearray[1]=0x07; ++ } ++ status = I2CWriteArray(pTuner,200,17,2,writearray); ++ if(status != E4000_I2C_SUCCESS) ++ { ++ return E4000_1_FAIL; ++ } ++ ++ return E4000_1_SUCCESS; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_e4000.h b/drivers/media/dvb/dvb-usb/tuner_e4000.h +new file mode 100644 +index 0000000..3d6c29c +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_e4000.h +@@ -0,0 +1,295 @@ ++#ifndef __TUNER_E4000_H ++#define __TUNER_E4000_H ++ ++/** ++ ++@file ++ ++@brief E4000 tuner module declaration ++ ++One can manipulate E4000 tuner through E4000 module. ++E4000 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_e4000.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ E4000_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build E4000 tuner module. ++ BuildE4000Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xac, // I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // Crystal frequency is 16.384 MHz. ++ E4000_AGC_INTERNAL // The E4000 AGC mode is internal AGC mode. ++ ); ++ ++ ++ ++ ++ ++ // Get E4000 tuner extra module. ++ pTunerExtra = (T2266_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set E4000 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, E4000_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get E4000 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is implemented for E4000 source code. ++ ++ ++// Definition (implemeted for E4000) ++#define E4000_1_SUCCESS 1 ++#define E4000_1_FAIL 0 ++#define E4000_I2C_SUCCESS 1 ++#define E4000_I2C_FAIL 0 ++ ++ ++ ++// Function (implemeted for E4000) ++int ++I2CReadByte( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte ++ ); ++ ++int ++I2CWriteByte( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegAddr, ++ unsigned char WritingByte ++ ); ++ ++int ++I2CWriteArray( ++ TUNER_MODULE *pTuner, ++ unsigned char NoUse, ++ unsigned char RegStartAddr, ++ unsigned char ByteNum, ++ unsigned char *pWritingBytes ++ ); ++ ++ ++ ++// Functions (from E4000 source code) ++int tunerreset (TUNER_MODULE *pTuner); ++int Tunerclock(TUNER_MODULE *pTuner); ++int Qpeak(TUNER_MODULE *pTuner); ++int DCoffloop(TUNER_MODULE *pTuner); ++int GainControlinit(TUNER_MODULE *pTuner); ++ ++int Gainmanual(TUNER_MODULE *pTuner); ++int E4000_gain_freq(TUNER_MODULE *pTuner, int frequency); ++int PLL(TUNER_MODULE *pTuner, int Ref_clk, int Freq); ++int LNAfilter(TUNER_MODULE *pTuner, int Freq); ++int IFfilter(TUNER_MODULE *pTuner, int bandwidth, int Ref_clk); ++int freqband(TUNER_MODULE *pTuner, int Freq); ++int DCoffLUT(TUNER_MODULE *pTuner); ++int GainControlauto(TUNER_MODULE *pTuner); ++ ++int E4000_sensitivity(TUNER_MODULE *pTuner, int Freq, int bandwidth); ++int E4000_linearity(TUNER_MODULE *pTuner, int Freq, int bandwidth); ++int E4000_high_linearity(TUNER_MODULE *pTuner); ++int E4000_nominal(TUNER_MODULE *pTuner, int Freq, int bandwidth); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is E4000 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Bandwidth in Hz ++enum E4000_BANDWIDTH_HZ ++{ ++ E4000_BANDWIDTH_6000000HZ = 6000000, ++ E4000_BANDWIDTH_7000000HZ = 7000000, ++ E4000_BANDWIDTH_8000000HZ = 8000000, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildE4000Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++e4000_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++e4000_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++e4000_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++e4000_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++e4000_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++e4000_GetRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char *pReadingByte ++ ); ++ ++int ++e4000_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++int ++e4000_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc0012.c b/drivers/media/dvb/dvb-usb/tuner_fc0012.c +new file mode 100644 +index 0000000..9c81e20 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc0012.c +@@ -0,0 +1,1056 @@ ++/** ++ ++@file ++ ++@brief FC0012 tuner module definition ++ ++One can manipulate FC0012 tuner through FC0012 module. ++FC0012 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_fc0012.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief FC0012 tuner module builder ++ ++Use BuildFc0012Module() to build FC0012 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to FC0012 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr FC0012 I2C device address ++@param [in] CrystalFreqHz FC0012 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildFc0012Module() to build FC0012 module before using it. ++ ++*/ ++void ++BuildFc0012Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ FC0012_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_FC0012; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = fc0012_GetTunerType; ++ pTuner->GetDeviceAddr = fc0012_GetDeviceAddr; ++ ++ pTuner->Initialize = fc0012_Initialize; ++ pTuner->SetRfFreqHz = fc0012_SetRfFreqHz; ++ pTuner->GetRfFreqHz = fc0012_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = fc0012_SetBandwidthMode; ++ pExtra->GetBandwidthMode = fc0012_GetBandwidthMode; ++ ++ ++ // Set tuner RF frequency and tuner bandwidth mode. ++ // Note: Need to give default tuner RF frequency and tuner bandwidth mode, ++ // because FC0012 API use one funnction to set RF frequency and bandwidth mode. ++ pTuner->RfFreqHz = FC0012_RF_FREQ_HZ_DEFAULT; ++ pExtra->BandwidthMode = FC0012_BANDWIDTH_MODE_DEFAULT; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++fc0012_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++fc0012_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++fc0012_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ FC0012_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Initialize tuner. ++ if(FC0012_Open(pTuner) != FC0012_FUNCTION_SUCCESS) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++fc0012_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ FC0012_EXTRA_MODULE *pExtra; ++ unsigned long RfFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Set tuner RF frequency in KHz. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ RfFreqKhz = (RfFreqHz + 500) / 1000; ++ ++ if(FC0011_SetFrequency(pTuner, RfFreqKhz, (unsigned short)(pExtra->BandwidthMode)) != FC0012_FUNCTION_SUCCESS) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++fc0012_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set FC0012 tuner bandwidth mode. ++ ++*/ ++int ++fc0012_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ FC0012_EXTRA_MODULE *pExtra; ++ unsigned long RfFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Set tuner bandwidth mode. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ RfFreqKhz = (pTuner->RfFreqHz + 500) / 1000; ++ ++ if(FC0011_SetFrequency(pTuner, RfFreqKhz, (unsigned short)BandwidthMode) != FC0012_FUNCTION_SUCCESS) ++ goto error_status_set_tuner_bandwidth_mode; ++ ++ ++ // Set tuner bandwidth mode parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get FC0012 tuner bandwidth mode. ++ ++*/ ++int ++fc0012_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ FC0012_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Get tuner bandwidth mode from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth_mode; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is implemented for FC0012 source code. ++ ++ ++// Read FC0012 register. ++int FC0012_Read(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char *pByte) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, pByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ return FC0012_I2C_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return FC0012_I2C_ERROR; ++} ++ ++ ++ ++ ++ ++// Write FC0012 register. ++int FC0012_Write(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char Byte) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + data + stop_bit ++ WritingBuffer[0] = RegAddr; ++ WritingBuffer[1] = Byte; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return FC0012_I2C_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return FC0012_I2C_ERROR; ++} ++ ++ ++ ++ ++ ++// Set FC0012 register mask bits. ++int ++fc0012_SetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned char WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingByte; ++ unsigned char WritingByte; ++ ++ unsigned char Mask; ++ unsigned char Shift; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get tuner register byte according to register adddress. ++ if(FC0012_Read(pTuner, RegAddr, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ // Reserve byte unmask bit with mask and inlay writing value into it. ++ WritingByte = ReadingByte & (~Mask); ++ WritingByte |= (WritingValue << Shift) & Mask; ++ ++ ++ // Write tuner register byte with writing byte. ++ if(FC0012_Write(pTuner, RegAddr, WritingByte) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Get FC0012 register mask bits. ++int ++fc0012_GetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned char *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingByte; ++ ++ unsigned char Mask; ++ unsigned char Shift; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get tuner register byte according to register adddress. ++ if(FC0012_Read(pTuner, RegAddr, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ // Get register bits from reading byte with mask and shift ++ *pReadingValue = (ReadingByte & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by fitipower. ++ ++ ++ ++ ++ ++// fitipower source code - FC0012_Tuner_Code.cpp ++ ++ ++//=========================================================== ++// Fitipower Integrated Technology Inc. ++// ++// FC0012 Tuner Code ++// ++// Version 1.2e ++// ++// Date: 2009/09/15 ++// ++// Copyright 2008, All rights reversed. ++// ++// Compile in Visual Studio 2005 C++ Win32 Console ++// ++//--------------------------------------------------------------------- ++// Modify History: ++// 2009-05-11: Change to recieve 28.8 MHz clock ++// 2009-05-14: fix frequency lock problem on 111MHz~148MHz ++// 2009-05-15: remove the limitation of Xin range ++// 2009-07-30: Add VHF filter control ++// Add VHF frequency offset ++// Add reference RSSI function ++// Change register[0x07] to 0x20 ++// 2009-09-15: update VCO re-calibration function ++//--------------------------------------------------------------------- ++//===================================================================== ++ ++// Data Format: ++// BYTE: unsigned char, 1 byte, 8 bits ++// WORD: unsighed short, 2 bytes, 16 bits ++// DWORD: unsigned int, 4 bytes, 32 bits ++ ++// include header, just for testing. ++//#include "stdafx.h" ++//#include "stdlib.h" ++//#include ++ ++//void FC0012_Write(unsigned char address, unsigned char data); ++//unsigned char FC0012_Read(unsigned char address); ++//void FC0012_Open(); ++//void FC0012_Close(); ++//void FC0012_SetFrequency(unsigned int Frequency, unsigned short Bandwidth); ++ ++/* ++// Console main function, just for testing ++int main(int argc, const char* argv[]) ++{ ++ printf("\n"); ++ ++ if ( argc > 1 ) ++ { ++ for( int i = 1; i < argc; i++ ) ++ { ++ FC0012_SetFrequency( atoi(argv[i]), 6); ++ } ++ } ++ ++ return 0; ++} ++ ++// FC0012 I2C Write Function ++void FC0012_Write(unsigned char address, unsigned char data) ++{ ++ // depend on driver function in demodulator vendor. ++} ++ ++// FC0012 I2C Read Function ++unsigned char FC0012_Read(unsigned char address) ++{ ++ // depend on driver function in demodulator vendor. ++ unsigned char value = 0; ++ // value = ........ ++ return value; ++} ++*/ ++ ++// FC0012 Open Function, includes enable/reset pin control and registers initialization. ++int FC0012_Open(TUNER_MODULE *pTuner) ++{ ++ FC0012_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ // Enable FC0012 Power ++// (...) ++ // FC0012 Enable = High ++// (...) ++ // FC0012 Reset = High -> Low ++// (...) ++ ++ //================================ Initial FC0012 Tuner Register ++ if(FC0012_Write(pTuner, 0x01, 0x05) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x02, 0x10) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x03, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x04, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ ++ //===================================== Arios Modify - 2009-10-23 ++ // modify for Realtek CNR test ++ if(FC0012_Write(pTuner, 0x05, 0x0F) != FC0012_I2C_SUCCESS) goto error_status; ++ //===================================== Arios Modify - 2009-10-23 ++ ++ ++ if(FC0012_Write(pTuner, 0x06, 0x00) != FC0012_I2C_SUCCESS) goto error_status; // divider 2, VCO slow. ++ ++ switch(pExtra->CrystalFreqHz) // Gain Shift: 15 // Set bit 5 to 1 for 28.8 MHz clock input (2009/05/12) ++ { ++ default: ++ case CRYSTAL_FREQ_28800000HZ: ++ ++ if(FC0012_Write(pTuner, 0x07, 0x20) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ break; ++ ++ ++ case CRYSTAL_FREQ_27000000HZ: ++ ++ if(FC0012_Write(pTuner, 0x07, 0x20) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ break; ++ ++ ++ case CRYSTAL_FREQ_36000000HZ: ++ ++ if(FC0012_Write(pTuner, 0x07, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ break; ++ } ++ ++ if(FC0012_Write(pTuner, 0x08, 0xFF) != FC0012_I2C_SUCCESS) goto error_status; // AGC Clock divide by 256, AGC gain 1/256, Loop Bw 1/8 ++ if(FC0012_Write(pTuner, 0x09, 0x6E) != FC0012_I2C_SUCCESS) goto error_status; // Disable LoopThrough ++ if(FC0012_Write(pTuner, 0x0A, 0xB8) != FC0012_I2C_SUCCESS) goto error_status; // Disable LO Test Buffer ++ if(FC0012_Write(pTuner, 0x0B, 0x82) != FC0012_I2C_SUCCESS) goto error_status; // Output Clock is same as clock frequency ++ ++ //-------------------------------------------------------------------------- ++ // reg[12] need to be changed if the system is in AGC Up-Down mode ++ //-------------------------------------------------------------------------- ++// if(FC0012_Write(pTuner, 0x0C, 0xF8) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ // Modified for up-dowm AGC by Realtek. ++ if(FC0012_Write(pTuner, 0x0C, 0xFC) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ // 0x0D, val=0x2 for DVBT ++ if(FC0012_Write(pTuner, 0x0D, 0x02) != FC0012_I2C_SUCCESS) goto error_status; // AGC Not Forcing & LNA Forcing ++ ++ // Modified for 2836B DTMB by Realtek. ++// if(FC0012_Write(pTuner, 0x0D, 0x06) != FC0012_I2C_SUCCESS) goto error_status; // AGC Not Forcing & LNA Forcing ++ ++ if(FC0012_Write(pTuner, 0x0E, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x0F, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x10, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x11, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x12, 0x1F) != FC0012_I2C_SUCCESS) goto error_status; // Set to maximum gain ++ ++ ++ //===================================== Arios Modify - 2009-10-23 ++ // modify for Realtek CNR test ++// if(FC0012_Write(pTuner, 0x13, 0x10) != FC0012_I2C_SUCCESS) goto error_status; // Enable IX2, Set to High Gain ++ if(FC0012_Write(pTuner, 0x13, 0x08) != FC0012_I2C_SUCCESS) goto error_status; // Enable IX2, Set to Middle Gain ++// if(FC0012_Write(pTuner, 0x13, 0x00) != FC0012_I2C_SUCCESS) goto error_status; // Enable IX2, Set to Low Gain ++ //===================================== Arios Modify - 2009-10-23 ++ ++ if(FC0012_Write(pTuner, 0x14, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x15, 0x04) != FC0012_I2C_SUCCESS) goto error_status; // Enable LNA COMPS ++ ++ return FC0012_FUNCTION_SUCCESS; ++ ++error_status: ++ return FC0012_FUNCTION_ERROR; ++} ++ ++ ++/* ++// FC0012 Close Function, control enable/reset and power. ++void FC0012_Close() ++{ ++ // FC0012 Enable = Low ++ // (...) ++ // FC0012 Reset = Low -> High ++ // (...) ++ // Disable FC0012 Power ++ // (...) ++} ++ ++void Delay(unsigned int) ++{ ++ // delay function ++} ++ ++ ++//===================================== RSSI & LNA Control 2009/07/30 ++// better ACI Performance for D-Book & field-test ++void FC0012_RSSI() ++{ ++ unsigned char Input_Power; ++ ++ Delay(200); // Delay 200 ms ++ ++ ++ switch( FC0012_Read(0x13) ) // Read FC0012 LNA gain setting ++ { ++ case 0x10: // High gain 19.7 dB ++ if( Input_Power > -40 ) // if intput power level is bigger than -40 dBm ++ FC0012_Write(0x13, 0x17); // Switch to 17.9 dB ++ break; ++ ++ case 0x17: // High gain 17.9 dB ++ if( Input_Power > -15 ) // if intput power level is bigger than -15 dBm ++ FC0012_Write(0x13, 0x08); // Switch to 7.1 dB ++ else if( Input_Power < -45 ) // if intput power level is smaller than -45 dBm ++ FC0012_Write(0x13, 0x10); // Switch to 19.7 dB ++ break; ++ ++ case 0x08: // Middle gain 7.1 dB ++ if( Input_Power > -5 ) // if intput power level is bigger than -5 dBm ++ FC0012_Write(0x13, 0x02); // Switch to -9.9 dB ++ else if( Input_Power < -20 ) // if intput power level is smaller than -20 dBm ++ FC0012_Write(0x13, 0x17); // Switch to 17.9 dB ++ break; ++ ++ case 0x02: // Low gain -9.9 dB ++ if( Input_Power < -12 ) // if intput power level is smaller than -12 dBm ++ FC0012_Write(0x13, 0x08); // Switch to 7.1 dB ++ break; ++ } ++ ++} ++ ++ ++ ++ ++//===================================== Frequency Control 2009/07/30 ++// Frequency unit: KHz, bandwidth unit: MHz ++void FC0012_Frequency_Control(unsigned int Frequency, unsigned short Bandwidth) ++{ ++ if( Frequency < 260000 && Frequency > 150000 ) ++ { ++ // set GPIO6 = low ++ ++ // 1. Set tuner frequency ++ // 2. if the program quality is not good enough, switch to frequency + 500kHz ++ // 3. if the program quality is still no good, switch to frequency - 500kHz ++ } ++ else ++ { ++ // set GPIO6 = high ++ ++ // set tuner frequency ++ } ++} ++*/ ++ ++ ++ ++// FC0012 frequency/bandwidth setting function. ++// Frequency unit: KHz, bandwidth unit: MHz ++int FC0011_SetFrequency(TUNER_MODULE *pTuner, unsigned long Frequency, unsigned short Bandwidth) ++{ ++// bool VCO1 = false; ++// unsigned int doubleVCO; ++// unsigned short xin, xdiv; ++// unsigned char reg[21], am, pm, multi; ++ int VCO1 = FC0012_FALSE; ++ unsigned long doubleVCO; ++ unsigned short xin, xdiv; ++ unsigned char reg[21], am, pm, multi; ++ unsigned char read_byte; ++ ++ FC0012_EXTRA_MODULE *pExtra; ++ unsigned long CrystalFreqKhz; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0012); ++ ++ // Get tuner crystal frequency in KHz. ++ // Note: CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ CrystalFreqKhz = (pExtra->CrystalFreqHz + 500) / 1000; ++ ++ ++ //===================================== Select frequency divider and the frequency of VCO ++ if (Frequency * 96 < 3560000) ++ { ++ multi = 96; ++ reg[5] = 0x82; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 64 < 3560000) ++ { ++ multi = 64; ++ reg[5] = 0x82; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 48 < 3560000) ++ { ++ multi = 48; ++ reg[5] = 0x42; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 32 < 3560000) ++ { ++ multi = 32; ++ reg[5] = 0x42; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 24 < 3560000) ++ { ++ multi = 24; ++ reg[5] = 0x22; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 16 < 3560000) ++ { ++ multi = 16; ++ reg[5] = 0x22; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 12 < 3560000) ++ { ++ multi = 12; ++ reg[5] = 0x12; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 8 < 3560000) ++ { ++ multi = 8; ++ reg[5] = 0x12; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 6 < 3560000) ++ { ++ multi = 6; ++ reg[5] = 0x0A; ++ reg[6] = 0x00; ++ } ++ else ++ { ++ multi = 4; ++ reg[5] = 0x0A; ++ reg[6] = 0x02; ++ } ++ ++ doubleVCO = Frequency * multi; ++ ++ ++ ++ //===================================== Arios Modify - 2009-10-23 ++ // modify for Realtek CNR test ++ reg[6] = reg[6] | 0x08; ++// VCO1 = true; ++ VCO1 = FC0012_TRUE; ++ /* ++ if (doubleVCO >= 3060000) ++ { ++ reg[6] = reg[6] | 0x08; ++// VCO1 = true; ++ VCO1 = FC0012_TRUE; ++ } ++ */ ++ //===================================== Arios Modify - 2009-10-23 ++ ++ //===================================== From divided value (XDIV) determined the FA and FP value ++// xdiv = (unsigned short)(doubleVCO / 14400); // implement round function, 2009-05-01 by Arios ++// if( (doubleVCO - xdiv * 14400) >= 7200 ) ++ xdiv = (unsigned short)(doubleVCO / (CrystalFreqKhz / 2)); // implement round function, 2009-05-01 by Arios ++ if( (doubleVCO - xdiv * (CrystalFreqKhz / 2)) >= (CrystalFreqKhz / 4) ) ++ xdiv = xdiv + 1; ++ ++ pm = (unsigned char)( xdiv / 8 ); ++ am = (unsigned char)( xdiv - (8 * pm)); ++ ++ if (am < 2) ++ { ++ reg[1] = am + 8; ++ reg[2] = pm - 1; ++ } ++ else ++ { ++ reg[1] = am; ++ reg[2] = pm; ++ } ++ ++ //===================================== From VCO frequency determines the XIN ( fractional part of Delta Sigma PLL) and divided value (XDIV). ++// xin = (unsigned short)(doubleVCO - ((unsigned short)(doubleVCO / 14400)) * 14400); ++// xin = ((xin << 15)/14400); ++ xin = (unsigned short)(doubleVCO - ((unsigned short)(doubleVCO / (CrystalFreqKhz / 2))) * (CrystalFreqKhz / 2)); ++ xin = ((xin << 15)/(unsigned short)(CrystalFreqKhz / 2)); ++ ++// if( xin >= (unsigned short) pow( (double)2, (double)14) ) ++// xin = xin + (unsigned short) pow( (double)2, (double)15); ++ if( xin >= (unsigned short) 16384 ) ++ xin = xin + (unsigned short) 32768; ++ ++ reg[3] = (unsigned char)(xin >> 8); ++ reg[4] = (unsigned char)(xin & 0x00FF); ++ ++ ++ //===================================== Only for testing, 2009-05-01 by Arios ++// printf("Frequency: %d, Fa: %d, Fp: %d, Xin:%d \n", Frequency, am, pm, xin); ++ ++ //===================================== Set Bandwidth ++ switch(Bandwidth) ++ { ++ case 6: ++ reg[6] = 0x80 | reg[6]; ++ break; ++ case 7: ++ reg[6] = ~0x80 & reg[6]; ++ reg[6] = 0x40 | reg[6]; ++ break; ++ case 8: ++ default: ++ reg[6] = ~0xC0 & reg[6]; ++ break; ++ } ++ ++ //===================================== Write registers ++ if(FC0012_Write(pTuner, 0x01, reg[1]) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x02, reg[2]) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x03, reg[3]) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x04, reg[4]) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ //===================================== Arios Modify - 2009-10-23 ++ // modify for Realtek CNR Test ++ reg[5] = reg[5] | 0x07; ++ if(FC0012_Write(pTuner, 0x05, reg[5]) != FC0012_I2C_SUCCESS) goto error_status; ++ //===================================== Arios Modify - 2009-10-23 ++ ++ if(FC0012_Write(pTuner, 0x06, reg[6]) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ //===================================== VCO Calibration ++ if(FC0012_Write(pTuner, 0x0E, 0x80) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x0E, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ //===================================== VCO Re-Calibration if needed ++ if(FC0012_Write(pTuner, 0x0E, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++// reg[14] = 0x3F & FC0012_Read(0x0E); ++ if(FC0012_Read(pTuner, 0x0E, &read_byte) != FC0012_I2C_SUCCESS) goto error_status; ++ reg[14] = 0x3F & read_byte; ++ ++ if (VCO1) ++ { ++ if (reg[14] > 0x3C) // modify 2009-09-15 ++ { ++ reg[6] = ~0x08 & reg[6]; ++ ++ if(FC0012_Write(pTuner, 0x06, reg[6]) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ if(FC0012_Write(pTuner, 0x0E, 0x80) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x0E, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ } ++ } ++ else ++ { ++ if (reg[14] < 0x02) // modify 2009-09-15 ++ { ++ reg[6] = 0x08 | reg[6]; ++ ++ if(FC0012_Write(pTuner, 0x06, reg[6]) != FC0012_I2C_SUCCESS) goto error_status; ++ ++ if(FC0012_Write(pTuner, 0x0E, 0x80) != FC0012_I2C_SUCCESS) goto error_status; ++ if(FC0012_Write(pTuner, 0x0E, 0x00) != FC0012_I2C_SUCCESS) goto error_status; ++ } ++ } ++ ++ return FC0012_FUNCTION_SUCCESS; ++ ++error_status: ++ return FC0012_FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc0012.h b/drivers/media/dvb/dvb-usb/tuner_fc0012.h +new file mode 100644 +index 0000000..82e6bb2 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc0012.h +@@ -0,0 +1,292 @@ ++#ifndef __TUNER_FC0012_H ++#define __TUNER_FC0012_H ++ ++/** ++ ++@file ++ ++@brief FC0012 tuner module declaration ++ ++One can manipulate FC0012 tuner through FC0012 module. ++FC0012 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_fc0012.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ FC0012_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build FC0012 tuner module. ++ BuildFc0012Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc6, // I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_36000000HZ // Crystal frequency is 36.0 MHz. ++ ); ++ ++ ++ ++ ++ ++ // Get FC0012 tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0012); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set FC0012 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, FC0012_BANDWIDTH_6000000HZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get FC0012 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is implemented for FC0012 source code. ++ ++ ++// Definitions ++enum FC0012_TRUE_FALSE_STATUS ++{ ++ FC0012_FALSE, ++ FC0012_TRUE, ++}; ++ ++ ++enum FC0012_I2C_STATUS ++{ ++ FC0012_I2C_SUCCESS, ++ FC0012_I2C_ERROR, ++}; ++ ++ ++enum FC0012_FUNCTION_STATUS ++{ ++ FC0012_FUNCTION_SUCCESS, ++ FC0012_FUNCTION_ERROR, ++}; ++ ++ ++ ++// Functions ++int FC0012_Read(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char *pByte); ++int FC0012_Write(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char Byte); ++ ++int ++fc0012_SetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned char WritingValue ++ ); ++ ++int ++fc0012_GetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned char *pReadingValue ++ ); ++ ++int FC0012_Open(TUNER_MODULE *pTuner); ++int FC0011_SetFrequency(TUNER_MODULE *pTuner, unsigned long Frequency, unsigned short Bandwidth); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is FC0012 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Bandwidth mode ++enum FC0012_BANDWIDTH_MODE ++{ ++ FC0012_BANDWIDTH_6000000HZ = 6, ++ FC0012_BANDWIDTH_7000000HZ = 7, ++ FC0012_BANDWIDTH_8000000HZ = 8, ++}; ++ ++ ++// Default for initialing ++#define FC0012_RF_FREQ_HZ_DEFAULT 50000000 ++#define FC0012_BANDWIDTH_MODE_DEFAULT FC0012_BANDWIDTH_6000000HZ ++ ++ ++// Tuner LNA ++enum FC0012_LNA_GAIN_VALUE ++{ ++ FC0012_LNA_GAIN_LOW = 0x0, ++ FC0012_LNA_GAIN_MIDDLE = 0x1, ++ FC0012_LNA_GAIN_HIGH = 0x2, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildFc0012Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++fc0012_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++fc0012_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++fc0012_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++fc0012_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++fc0012_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++fc0012_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++fc0012_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc0013.c b/drivers/media/dvb/dvb-usb/tuner_fc0013.c +new file mode 100644 +index 0000000..63a6850 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc0013.c +@@ -0,0 +1,1261 @@ ++/** ++ ++@file ++ ++@brief FC0013 tuner module definition ++ ++One can manipulate FC0013 tuner through FC0013 module. ++FC0013 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_fc0013.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief FC0013 tuner module builder ++ ++Use BuildFc0013Module() to build FC0013 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to FC0013 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr FC0013 I2C device address ++@param [in] CrystalFreqHz FC0013 crystal frequency in Hz ++ ++ ++@note ++ -# One should call BuildFc0013Module() to build FC0013 module before using it. ++ ++*/ ++void ++BuildFc0013Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ FC0013_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_FC0013; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = fc0013_GetTunerType; ++ pTuner->GetDeviceAddr = fc0013_GetDeviceAddr; ++ ++ pTuner->Initialize = fc0013_Initialize; ++ pTuner->SetRfFreqHz = fc0013_SetRfFreqHz; ++ pTuner->GetRfFreqHz = fc0013_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = fc0013_SetBandwidthMode; ++ pExtra->GetBandwidthMode = fc0013_GetBandwidthMode; ++ pExtra->RcCalReset = fc0013_RcCalReset; ++ pExtra->RcCalAdd = fc0013_RcCalAdd; ++ ++ ++ // Set tuner RF frequency and tuner bandwidth mode. ++ // Note: Need to give default tuner RF frequency and tuner bandwidth mode, ++ // because FC0013 API use one funnction to set RF frequency and bandwidth mode. ++ pTuner->RfFreqHz = FC0013_RF_FREQ_HZ_DEFAULT; ++ pExtra->BandwidthMode = FC0013_BANDWIDTH_MODE_DEFAULT; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++fc0013_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++fc0013_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++fc0013_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ FC0013_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Initialize tuner. ++ if(FC0013_Open(pTuner) != FC0013_FUNCTION_SUCCESS) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++fc0013_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ FC0013_EXTRA_MODULE *pExtra; ++ unsigned long RfFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Set tuner RF frequency in KHz. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ RfFreqKhz = (RfFreqHz + 500) / 1000; ++ ++ if(FC0013_SetFrequency(pTuner, RfFreqKhz, (unsigned short)(pExtra->BandwidthMode)) != FC0013_FUNCTION_SUCCESS) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++fc0013_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set FC0013 tuner bandwidth mode. ++ ++*/ ++int ++fc0013_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ FC0013_EXTRA_MODULE *pExtra; ++ unsigned long RfFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Set tuner bandwidth mode. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ RfFreqKhz = (pTuner->RfFreqHz + 500) / 1000; ++ ++ if(FC0013_SetFrequency(pTuner, RfFreqKhz, (unsigned short)BandwidthMode) != FC0013_FUNCTION_SUCCESS) ++ goto error_status_set_tuner_bandwidth_mode; ++ ++ ++ // Set tuner bandwidth mode parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get FC0013 tuner bandwidth mode. ++ ++*/ ++int ++fc0013_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ FC0013_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Get tuner bandwidth mode from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth_mode; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is implemented for FC0013 source code. ++ ++ ++// Read FC0013 register. ++int FC0013_Read(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char *pByte) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, pByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ return FC0013_I2C_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return FC0013_I2C_ERROR; ++} ++ ++ ++ ++ ++ ++// Write FC0013 register. ++int FC0013_Write(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char Byte) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + data + stop_bit ++ WritingBuffer[0] = RegAddr; ++ WritingBuffer[1] = Byte; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return FC0013_I2C_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return FC0013_I2C_ERROR; ++} ++ ++ ++ ++ ++ ++// Set FC0013 register mask bits. ++int ++fc0013_SetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned char WritingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingByte; ++ unsigned char WritingByte; ++ ++ unsigned char Mask; ++ unsigned char Shift; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get tuner register byte according to register adddress. ++ if(FC0013_Read(pTuner, RegAddr, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ // Reserve byte unmask bit with mask and inlay writing value into it. ++ WritingByte = ReadingByte & (~Mask); ++ WritingByte |= (WritingValue << Shift) & Mask; ++ ++ ++ // Write tuner register byte with writing byte. ++ if(FC0013_Write(pTuner, RegAddr, WritingByte) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Get FC0013 register mask bits. ++int ++fc0013_GetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned char *pReadingValue ++ ) ++{ ++ int i; ++ ++ unsigned char ReadingByte; ++ ++ unsigned char Mask; ++ unsigned char Shift; ++ ++ ++ // Generate mask and shift according to MSB and LSB. ++ Mask = 0; ++ ++ for(i = Lsb; i < (Msb + 1); i++) ++ Mask |= 0x1 << i; ++ ++ Shift = Lsb; ++ ++ ++ // Get tuner register byte according to register adddress. ++ if(FC0013_Read(pTuner, RegAddr, &ReadingByte) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ // Get register bits from reading byte with mask and shift ++ *pReadingValue = (ReadingByte & Mask) >> Shift; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by fitipower. ++ ++ ++ ++ ++ ++// fitipower source code - FC0013_Tuner_Code.cpp ++ ++ ++//===================================================================== ++// Fitipower Integrated Technology Inc. ++// ++// FC0013 Tuner Code ++// ++// Version 0.7 ++// ++// Date: 2010/12/23 ++// ++// Copyright 2010, All rights reversed. ++// ++// Compile in Visual Studio 2005 C++ Win32 Console ++//===================================================================== ++ ++// Data Format: ++// BYTE: unsigned char, 1 byte, 8 bits ++// WORD: unsighed short, 2 bytes, 16 bits ++// DWORD: unsigned int, 4 bytes, 32 bits ++ ++// include header, just for testing. ++//#include "stdafx.h" ++//#include "stdlib.h" ++//#include ++//#include ++//#include ++//#include ++//#include "I2C.h" ++ ++//#define Crystal_Frequency 28800 // FC0013 Crystal Clock (kHz) ++ ++ ++//void FC0013_Write(unsigned char address, unsigned char data); ++//unsigned char FC0013_Read(unsigned char address); ++//void FC0013_Open(); ++//void FC0013_Close(); ++//void FC0013_RSSI(); ++//void FC0013_Band_Selection(bool Band_Selection_DVBT); ++//void FC0013_SetFrequency(unsigned int Frequency, unsigned short Bandwidth); ++ ++//unsigned char FC0013_RSSI_Calibration_Value; ++/* ++// Console main function, just for testing ++int main(int argc, const char* argv[]) ++{ ++ printf("\n"); ++ ++ if ( argc > 1 ) ++ { ++ for( int i = 1; i < argc; i++ ) ++ { ++ FC0013_SetFrequency( atoi(argv[i]), 8 ); ++ } ++ } ++ ++ return 0; ++} ++ ++void Delay(unsigned int) ++{ ++ // delay function ++} ++ ++// FC0013 I2C Write Function ++void FC0013_Write(unsigned char address, unsigned char data) ++{ ++ // depend on driver function in demodulator vendor. ++ I2C_Write(address, data); ++} ++ ++// FC0013 I2C Read Function ++unsigned char FC0013_Read(unsigned char address) ++{ ++ // depend on driver function in demodulator vendor. ++ return return I2C_Read(address); ++} ++*/ ++// FC0013 Open Function, includes enable/reset pin control and registers initialization. ++//void FC0013_Open() ++int FC0013_Open(TUNER_MODULE *pTuner) ++{ ++ // Enable FC0013 Power ++ // (...) ++ // FC0013 Enable = High ++ // (...) ++ // FC0013 Reset = High -> Low ++ // (...) ++ ++ //================================ update base on new FC0013 register bank ++ if(FC0013_Write(pTuner, 0x01, 0x09) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x02, 0x16) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x03, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x04, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x05, 0x17) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x06, 0x02) != FC0013_I2C_SUCCESS) goto error_status; ++// if(FC0013_Write(pTuner, 0x07, 0x27) != FC0013_I2C_SUCCESS) goto error_status; // 28.8MHz, GainShift: 15 ++ if(FC0013_Write(pTuner, 0x07, 0x2A) != FC0013_I2C_SUCCESS) goto error_status; // 28.8MHz, modified by Realtek ++ if(FC0013_Write(pTuner, 0x08, 0xFF) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x09, 0x6F) != FC0013_I2C_SUCCESS) goto error_status; // Enable Loop Through ++ if(FC0013_Write(pTuner, 0x0A, 0xB8) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0B, 0x82) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if(FC0013_Write(pTuner, 0x0C, 0xFE) != FC0013_I2C_SUCCESS) goto error_status; // Modified for up-dowm AGC by Realtek(for master, and for 2836BU dongle). ++// if(FC0013_Write(pTuner, 0x0C, 0xFC) != FC0013_I2C_SUCCESS) goto error_status; // Modified for up-dowm AGC by Realtek(for slave, and for 2832 mini dongle). ++ ++// if(FC0013_Write(pTuner, 0x0D, 0x09) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0D, 0x01) != FC0013_I2C_SUCCESS) goto error_status; // Modified for AGC non-forcing by Realtek. ++ ++ if(FC0013_Write(pTuner, 0x0E, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0F, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x10, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x11, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x12, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x13, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if(FC0013_Write(pTuner, 0x14, 0x50) != FC0013_I2C_SUCCESS) goto error_status; // DVB-T, High Gain ++// if(FC0013_Write(pTuner, 0x14, 0x48) != FC0013_I2C_SUCCESS) goto error_status; // DVB-T, Middle Gain ++// if(FC0013_Write(pTuner, 0x14, 0x40) != FC0013_I2C_SUCCESS) goto error_status; // DVB-T, Low Gain ++ ++ if(FC0013_Write(pTuner, 0x15, 0x01) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ ++ return FC0013_FUNCTION_SUCCESS; ++ ++error_status: ++ return FC0013_FUNCTION_ERROR; ++} ++ ++/* ++// FC0013 Close Function, control enable/reset and power. ++void FC0013_Close() ++{ ++ // FC0013 Enable = Low ++ // (...) ++ // FC0013 Reset = Low -> High ++ // (...) ++ // Disable FC0013 Power ++ // (...) ++} ++ ++ ++void FC0013_Band_Selection(bool Band_Selection_DVBT) ++{ ++ if( Band_Selection_DVBT == true ) ++ { ++ FC0013_Write(0x14, (FC0013_Read(0x14) & 0x9F) | 0x40); ++ } ++ else ++ { ++ FC0013_Write(0x14, (FC0013_Read(0x14) & 0x9F) | 0x20); ++ } ++} ++ ++ ++// Get RSSI ADC value ++unsigned char Get_RSSI_Value() ++{ ++ return 0x00; // return RSSI value ++} ++ ++ ++// RSSI Calibration Function ++void FC0013_RSSI_Calibration() ++{ ++ FC0013_Write(0x09, ( FC0013_Read(0x09) | 0x10 ) ); // set the register 9 bit4 EN_CAL_RSSI as 1 ++ FC0013_Write(0x06, ( FC0013_Read(0x06) | 0x01 ) ); // set the register 6 bit 0 LNA_POWER_DOWN as 1 ++ ++ Delay(100); // delay 100ms ++ ++ FC0013_RSSI_Calibration_Value = Get_RSSI_Value(); // read DC value from RSSI pin as rssi_calibration ++ ++ FC0013_Write(0x09, ( FC0013_Read(0x09) & 0xEF ) ); // set the register 9 bit4 EN_CAL_RSSI as 0 ++ FC0013_Write(0x06, ( FC0013_Read(0x06) & 0xFE ) ); // set the register 6 bit 0 LNA_POWER_DOWN as 0 ++} ++ ++ ++// RSSI & LNA Control, call this function if FC0013 is in the External RSSI ADC mode. ++void FC0013_RSSI() ++{ ++ unsigned char Input_Power = 0; // Get Input power information from RSSI ++ // it should be the difference between RSSI ADC value and RSSI calibration value ++ unsigned char LNA_value; ++ unsigned char RSSI_Value, RSSI_Difference; ++ ++ Delay(500); // Delay 500 ms ++ ++ RSSI_Value = Get_RSSI_Value(); // Get RSSI Value from demodulator ADC ++ ++ if( RSSI_Value < FC0013_RSSI_Calibration_Value ) // adjust RSSI Calibration Value ++ FC0013_RSSI_Calibration_Value = RSSI_Value; ++ ++ RSSI_Difference = RSSI_Value - FC0013_RSSI_Calibration_Value; // Calculate voltage difference of RSSI ++ ++ LNA_value = FC0013_Read(0x14); ++ ++ //------------------------------------------------ arios modify 2010-12-24 ++ // " | 0x07" ==> " | 0x27" (make sure reg[0x07] bit5 = 1) ++ // " | 0x0F" ==> " | 0x2F" (make sure reg[0x07] bit5 = 1) ++ // add default in switch case ++ switch( (LNA_value & 0x1F) ) ++ { ++ case 0x10: ++ if( RSSI_Difference > 6 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x17); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x27); ++ } ++ break; ++ ++ case 0x17: ++ if( RSSI_Difference > 40 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x08); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x27); ++ } ++ else if( RSSI_Difference < 3 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x10); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x2F); ++ } ++ break; ++ ++ case 0x08: ++ if( RSSI_Difference > 40 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x02); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x27); ++ } ++ else if( RSSI_Difference < 7 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x17); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x27); ++ } ++ break; ++ ++ case 0x02: ++ if( RSSI_Difference < 2 ) ++ { ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x08); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x27); ++ } ++ break; ++ ++ default: ++ FC0013_Write(0x14, (LNA_value & 0xE0) | 0x10); ++ FC0013_Write(0x07, (FC0013_Read(0x07) & 0xF0) | 0x2F); ++ break; ++ } ++} ++*/ ++ ++ ++// Set VHF Track depends on input frequency ++// Frequency Unit: KHz ++int FC0013_SetVhfTrack(TUNER_MODULE *pTuner, unsigned long FrequencyKHz) ++{ ++ unsigned char read_byte; ++ ++ if (FrequencyKHz <= 177500) // VHF Track: 7 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x1C) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 184500) // VHF Track: 6 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x18) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 191500) // VHF Track: 5 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x14) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 198500) // VHF Track: 4 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x10) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 205500) // VHF Track: 3 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x0C) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 212500) // VHF Track: 2 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x08) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 219500) // VHF Track: 2 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x08) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ else if (FrequencyKHz <= 226500) // VHF Track: 1 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x04) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else // VHF Track: 1 ++ { ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x04) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ } ++ ++ //------------------------------------------------ arios modify 2010-12-24 ++ // " | 0x10" ==> " | 0x30" (make sure reg[0x07] bit5 = 1) ++ ++ // Enable VHF filter. ++ if(FC0013_Read(pTuner, 0x07, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x07, read_byte | 0x10) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // Disable UHF & GPS. ++ if(FC0013_Read(pTuner, 0x14, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x14, read_byte & 0x1F) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ ++ return FC0013_FUNCTION_SUCCESS; ++ ++error_status: ++ return FC0013_FUNCTION_ERROR; ++} ++ ++ ++ ++// FC0013 frequency/bandwidth setting function. ++// Frequency unit: KHz, bandwidth unit: MHz ++//void FC0013_SetFrequency(unsigned int Frequency, unsigned short Bandwidth) ++int FC0013_SetFrequency(TUNER_MODULE *pTuner, unsigned long Frequency, unsigned short Bandwidth) ++{ ++// bool VCO1 = false; ++// unsigned int doubleVCO; ++// unsigned short xin, xdiv; ++// unsigned char reg[21], am, pm, multi; ++ int VCO1 = FC0013_FALSE; ++ unsigned long doubleVCO; ++ unsigned short xin, xdiv; ++ unsigned char reg[21], am, pm, multi; ++ ++ unsigned char read_byte; ++ ++ FC0013_EXTRA_MODULE *pExtra; ++ unsigned long CrystalFreqKhz; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ // Get tuner crystal frequency in KHz. ++ // Note: CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ CrystalFreqKhz = (pExtra->CrystalFreqHz + 500) / 1000; ++ ++ // modified 2011-02-09: for D-Book test ++ // set VHF_Track = 7 ++ if(FC0013_Read(pTuner, 0x1D, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // VHF Track: 7 ++ if(FC0013_Write(pTuner, 0x1D, (read_byte & 0xE3) | 0x1C) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ ++ if( Frequency < 300000 ) ++ { ++ // Set VHF Track. ++ if(FC0013_SetVhfTrack(pTuner, Frequency) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // Enable VHF filter. ++ if(FC0013_Read(pTuner, 0x07, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x07, read_byte | 0x10) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // Disable UHF & disable GPS. ++ if(FC0013_Read(pTuner, 0x14, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x14, read_byte & 0x1F) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else if ( (Frequency >= 300000) && (Frequency <= 862000) ) ++ { ++ // Disable VHF filter. ++ if(FC0013_Read(pTuner, 0x07, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x07, read_byte & 0xEF) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // enable UHF & disable GPS. ++ if(FC0013_Read(pTuner, 0x14, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x14, (read_byte & 0x1F) | 0x40) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else if (Frequency > 862000) ++ { ++ // Disable VHF filter ++ if(FC0013_Read(pTuner, 0x07, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x07, read_byte & 0xEF) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // Disable UHF & enable GPS ++ if(FC0013_Read(pTuner, 0x14, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x14, (read_byte & 0x1F) | 0x20) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ ++ if (Frequency * 96 < 3560000) ++ { ++ multi = 96; ++ reg[5] = 0x82; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 64 < 3560000) ++ { ++ multi = 64; ++ reg[5] = 0x02; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 48 < 3560000) ++ { ++ multi = 48; ++ reg[5] = 0x42; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 32 < 3560000) ++ { ++ multi = 32; ++ reg[5] = 0x82; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 24 < 3560000) ++ { ++ multi = 24; ++ reg[5] = 0x22; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 16 < 3560000) ++ { ++ multi = 16; ++ reg[5] = 0x42; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 12 < 3560000) ++ { ++ multi = 12; ++ reg[5] = 0x12; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 8 < 3560000) ++ { ++ multi = 8; ++ reg[5] = 0x22; ++ reg[6] = 0x02; ++ } ++ else if (Frequency * 6 < 3560000) ++ { ++ multi = 6; ++ reg[5] = 0x0A; ++ reg[6] = 0x00; ++ } ++ else if (Frequency * 4 < 3800000) ++ { ++ multi = 4; ++ reg[5] = 0x12; ++ reg[6] = 0x02; ++ } ++ else ++ { ++ Frequency = Frequency / 2; ++ multi = 4; ++ reg[5] = 0x0A; ++ reg[6] = 0x02; ++ } ++ ++ doubleVCO = Frequency * multi; ++ ++ reg[6] = reg[6] | 0x08; ++// VCO1 = true; ++ VCO1 = FC0013_TRUE; ++ ++ // Calculate VCO parameters: ap & pm & xin. ++// xdiv = (unsigned short)(doubleVCO / (Crystal_Frequency/2)); ++ xdiv = (unsigned short)(doubleVCO / (CrystalFreqKhz/2)); ++// if( (doubleVCO - xdiv * (Crystal_Frequency/2)) >= (Crystal_Frequency/4) ) ++ if( (doubleVCO - xdiv * (CrystalFreqKhz/2)) >= (CrystalFreqKhz/4) ) ++ { ++ xdiv = xdiv + 1; ++ } ++ ++ pm = (unsigned char)( xdiv / 8 ); ++ am = (unsigned char)( xdiv - (8 * pm)); ++ ++ if (am < 2) ++ { ++ reg[1] = am + 8; ++ reg[2] = pm - 1; ++ } ++ else ++ { ++ reg[1] = am; ++ reg[2] = pm; ++ } ++ ++// xin = (unsigned short)(doubleVCO - ((unsigned short)(doubleVCO / (Crystal_Frequency/2))) * (Crystal_Frequency/2)); ++ xin = (unsigned short)(doubleVCO - ((unsigned short)(doubleVCO / (CrystalFreqKhz/2))) * (CrystalFreqKhz/2)); ++// xin = ((xin << 15)/(Crystal_Frequency/2)); ++ xin = (unsigned short)((xin << 15)/(CrystalFreqKhz/2)); ++ ++// if( xin >= (unsigned short) pow( (double)2, (double)14) ) ++// { ++// xin = xin + (unsigned short) pow( (double)2, (double)15); ++// } ++ if( xin >= (unsigned short) 16384 ) ++ xin = xin + (unsigned short) 32768; ++ ++ reg[3] = (unsigned char)(xin >> 8); ++ reg[4] = (unsigned char)(xin & 0x00FF); ++ ++ ++ //===================================== Only for testing ++// printf("Frequency: %d, Fa: %d, Fp: %d, Xin:%d \n", Frequency, am, pm, xin); ++ ++ ++ // Set Low-Pass Filter Bandwidth. ++ switch(Bandwidth) ++ { ++ case 6: ++ reg[6] = 0x80 | reg[6]; ++ break; ++ case 7: ++ reg[6] = ~0x80 & reg[6]; ++ reg[6] = 0x40 | reg[6]; ++ break; ++ case 8: ++ default: ++ reg[6] = ~0xC0 & reg[6]; ++ break; ++ } ++ ++ reg[5] = reg[5] | 0x07; ++ ++ if(FC0013_Write(pTuner, 0x01, reg[1]) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x02, reg[2]) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x03, reg[3]) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x04, reg[4]) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x05, reg[5]) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x06, reg[6]) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if (multi == 64) ++ { ++// FC0013_Write(0x11, FC0013_Read(0x11) | 0x04); ++ if(FC0013_Read(pTuner, 0x11, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x11, read_byte | 0x04) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else ++ { ++// FC0013_Write(0x11, FC0013_Read(0x11) & 0xFB); ++ if(FC0013_Read(pTuner, 0x11, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x11, read_byte & 0xFB) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ ++ if(FC0013_Write(pTuner, 0x0E, 0x80) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0E, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if(FC0013_Write(pTuner, 0x0E, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++// reg[14] = 0x3F & FC0013_Read(0x0E); ++ if(FC0013_Read(pTuner, 0x0E, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ reg[14] = 0x3F & read_byte; ++ ++ if (VCO1) ++ { ++ if (reg[14] > 0x3C) ++ { ++ reg[6] = ~0x08 & reg[6]; ++ ++ if(FC0013_Write(pTuner, 0x06, reg[6]) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if(FC0013_Write(pTuner, 0x0E, 0x80) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0E, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ } ++ else ++ { ++ if (reg[14] < 0x02) ++ { ++ reg[6] = 0x08 | reg[6]; ++ ++ if(FC0013_Write(pTuner, 0x06, reg[6]) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ if(FC0013_Write(pTuner, 0x0E, 0x80) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x0E, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ } ++ ++ ++ return FC0013_FUNCTION_SUCCESS; ++ ++error_status: ++ return FC0013_FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Reset IQ LPF Bandwidth ++int ++fc0013_RcCalReset( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ // not forcing RC_cal and ADC_Ext enable ++ if(FC0013_Write(pTuner, 0x0D, 0x01) != FC0013_I2C_SUCCESS) goto error_status; ++ if(FC0013_Write(pTuner, 0x10, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ ++ return FC0013_FUNCTION_SUCCESS; ++ ++ ++error_status: ++ return FC0013_FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// Increase IQ LPF bandwidth ++int ++fc0013_RcCalAdd( ++ TUNER_MODULE *pTuner, ++ int RcValue ++ ) ++{ ++ unsigned char read_byte; ++ unsigned char rc_cal; ++ int WriteValue; ++ ++ FC0013_EXTRA_MODULE *pExtra; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ // Push RC_cal value Get RC_cal value ++ if(FC0013_Write(pTuner, 0x10, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ //Get RC_cal value ++ if(FC0013_Read(pTuner, 0x10, &read_byte) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ rc_cal = read_byte & 0x0F; ++ ++ WriteValue = (int)rc_cal + RcValue; ++ ++ ++ // Forcing RC_cal ++ if(FC0013_Write(pTuner, 0x0D, 0x11) != FC0013_I2C_SUCCESS) goto error_status; ++ ++ // Modify RC_cal value ++ if( WriteValue > 15 ) ++ { ++ if(FC0013_Write(pTuner, 0x10, 0x0F) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else if( WriteValue < 0 ) ++ { ++ if(FC0013_Write(pTuner, 0x10, 0x00) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ else ++ { ++ if(FC0013_Write(pTuner, 0x10, (unsigned char)WriteValue) != FC0013_I2C_SUCCESS) goto error_status; ++ } ++ ++ ++ return FC0013_FUNCTION_SUCCESS; ++ ++ ++error_status: ++ return FC0013_FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc0013.h b/drivers/media/dvb/dvb-usb/tuner_fc0013.h +new file mode 100644 +index 0000000..f9f0801 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc0013.h +@@ -0,0 +1,307 @@ ++#ifndef __TUNER_FC0013_H ++#define __TUNER_FC0013_H ++ ++/** ++ ++@file ++ ++@brief FC0013 tuner module declaration ++ ++One can manipulate FC0013 tuner through FC0013 module. ++FC0013 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_fc0013.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ FC0013_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build FC0013 tuner module. ++ BuildFc0013Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc6, // I2C device address is 0xc6 in 8-bit format. ++ CRYSTAL_FREQ_36000000HZ // Crystal frequency is 36.0 MHz. ++ ); ++ ++ ++ ++ ++ ++ // Get FC0013 tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Fc0013); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set FC0013 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, FC0013_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get FC0013 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is implemented for FC0013 source code. ++ ++ ++// Definitions ++enum FC0013_TRUE_FALSE_STATUS ++{ ++ FC0013_FALSE, ++ FC0013_TRUE, ++}; ++ ++ ++enum FC0013_I2C_STATUS ++{ ++ FC0013_I2C_SUCCESS, ++ FC0013_I2C_ERROR, ++}; ++ ++ ++enum FC0013_FUNCTION_STATUS ++{ ++ FC0013_FUNCTION_SUCCESS, ++ FC0013_FUNCTION_ERROR, ++}; ++ ++ ++ ++// Functions ++int FC0013_Read(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char *pByte); ++int FC0013_Write(TUNER_MODULE *pTuner, unsigned char RegAddr, unsigned char Byte); ++ ++int ++fc0013_SetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ const unsigned char WritingValue ++ ); ++ ++int ++fc0013_GetRegMaskBits( ++ TUNER_MODULE *pTuner, ++ unsigned char RegAddr, ++ unsigned char Msb, ++ unsigned char Lsb, ++ unsigned char *pReadingValue ++ ); ++ ++int FC0013_Open(TUNER_MODULE *pTuner); ++int FC0013_SetFrequency(TUNER_MODULE *pTuner, unsigned long Frequency, unsigned short Bandwidth); ++ ++// Set VHF Track depends on input frequency ++int FC0013_SetVhfTrack(TUNER_MODULE *pTuner, unsigned long Frequency); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is FC0013 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Bandwidth mode ++enum FC0013_BANDWIDTH_MODE ++{ ++ FC0013_BANDWIDTH_6000000HZ = 6, ++ FC0013_BANDWIDTH_7000000HZ = 7, ++ FC0013_BANDWIDTH_8000000HZ = 8, ++}; ++ ++ ++// Default for initialing ++#define FC0013_RF_FREQ_HZ_DEFAULT 50000000 ++#define FC0013_BANDWIDTH_MODE_DEFAULT FC0013_BANDWIDTH_8000000HZ ++ ++ ++// Tuner LNA ++enum FC0013_LNA_GAIN_VALUE ++{ ++ FC0013_LNA_GAIN_LOW = 0x00, // -6.3dB ++ FC0013_LNA_GAIN_MIDDLE = 0x08, // 7.1dB ++ FC0013_LNA_GAIN_HIGH_17 = 0x11, // 19.1dB ++ FC0013_LNA_GAIN_HIGH_19 = 0x10, // 19.7dB ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildFc0013Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++fc0013_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++fc0013_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++fc0013_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++fc0013_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++fc0013_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++fc0013_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++fc0013_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++int ++fc0013_RcCalReset( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++fc0013_RcCalAdd( ++ TUNER_MODULE *pTuner, ++ int RcValue ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc2580.c b/drivers/media/dvb/dvb-usb/tuner_fc2580.c +new file mode 100644 +index 0000000..47b6a75 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc2580.c +@@ -0,0 +1,932 @@ ++/** ++ ++@file ++ ++@brief FC2580 tuner module definition ++ ++One can manipulate FC2580 tuner through FC2580 module. ++FC2580 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_fc2580.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief FC2580 tuner module builder ++ ++Use BuildFc2580Module() to build FC2580 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to FC2580 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr FC2580 I2C device address ++@param [in] CrystalFreqHz FC2580 crystal frequency in Hz ++@param [in] AgcMode FC2580 AGC mode ++ ++ ++@note ++ -# One should call BuildFc2580Module() to build FC2580 module before using it. ++ ++*/ ++void ++BuildFc2580Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int AgcMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ FC2580_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_FC2580; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = fc2580_GetTunerType; ++ pTuner->GetDeviceAddr = fc2580_GetDeviceAddr; ++ ++ pTuner->Initialize = fc2580_Initialize; ++ pTuner->SetRfFreqHz = fc2580_SetRfFreqHz; ++ pTuner->GetRfFreqHz = fc2580_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->AgcMode = AgcMode; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = fc2580_SetBandwidthMode; ++ pExtra->GetBandwidthMode = fc2580_GetBandwidthMode; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++fc2580_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++fc2580_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++fc2580_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ FC2580_EXTRA_MODULE *pExtra; ++ int AgcMode; ++ unsigned int CrystalFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Get AGC mode. ++ AgcMode = pExtra->AgcMode; ++ ++ // Initialize tuner with AGC mode. ++ // Note: CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ CrystalFreqKhz = (unsigned int)((pExtra->CrystalFreqHz + 500) / 1000); ++ ++ if(fc2580_set_init(pTuner, AgcMode, CrystalFreqKhz) != FC2580_FCI_SUCCESS) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++fc2580_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ FC2580_EXTRA_MODULE *pExtra; ++ unsigned int RfFreqKhz; ++ unsigned int CrystalFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Set tuner RF frequency in KHz. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ // CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ RfFreqKhz = (unsigned int)((RfFreqHz + 500) / 1000); ++ CrystalFreqKhz = (unsigned int)((pExtra->CrystalFreqHz + 500) / 1000); ++ ++ if(fc2580_set_freq(pTuner, RfFreqKhz, CrystalFreqKhz) != FC2580_FCI_SUCCESS) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++fc2580_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set FC2580 tuner bandwidth mode. ++ ++*/ ++int ++fc2580_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ FC2580_EXTRA_MODULE *pExtra; ++ unsigned int CrystalFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Set tuner bandwidth mode. ++ // Note: CrystalFreqKhz = round(CrystalFreqHz / 1000) ++ CrystalFreqKhz = (unsigned int)((pExtra->CrystalFreqHz + 500) / 1000); ++ ++ if(fc2580_set_filter(pTuner, (unsigned char)BandwidthMode, CrystalFreqKhz) != FC2580_FCI_SUCCESS) ++ goto error_status_set_tuner_bandwidth_mode; ++ ++ ++ // Set tuner bandwidth mode parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get FC2580 tuner bandwidth mode. ++ ++*/ ++int ++fc2580_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ FC2580_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Fc2580); ++ ++ ++ // Get tuner bandwidth mode from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth_mode; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by FCI. ++ ++ ++ ++ ++ ++// FCI source code - fc2580_driver_v14011_r.c ++ ++ ++/*============================================================================== ++ FILE NAME : FC2580_driver_v1400_r.c ++ ++ VERSION : 1.400_r ++ ++ UPDATE : September 22. 2008 ++ ++==============================================================================*/ ++ ++/*============================================================================== ++ ++ Chip ID of FC2580 is 0x56 or 0xAC(including I2C write bit) ++ ++==============================================================================*/ ++ ++//#include "fc2580_driver_v1400_r.h" ++ ++//fc2580_band_type curr_band = FC2580_NO_BAND; ++//unsigned int freq_xtal = 16384; ++ ++ ++/*============================================================================== ++ milisecond delay function EXTERNAL FUNCTION ++ ++ This function is a generic function which write a byte into fc2580's ++ specific address. ++ ++ ++ ++ a ++ length of wanted delay in milisecond unit ++ ++==============================================================================*/ ++void fc2580_wait_msec(TUNER_MODULE *pTuner, int a) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ // Get base interface. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ ++ // Wait time in millisecond. ++ pBaseInterface->WaitMs(pBaseInterface, (unsigned long)a); ++ ++ ++ return; ++} ++ ++/*============================================================================== ++ ++ fc2580 i2c write ++ ++ This function is a generic function which write a byte into fc2580's ++ specific address. ++ ++ ++ ++ addr ++ fc2580's memory address\ ++ type : byte ++ ++ data ++ target data ++ type : byte ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_i2c_write( TUNER_MODULE *pTuner, unsigned char addr, unsigned char data ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBytes[LEN_2_BYTE]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + data + stop_bit ++ WritingBytes[0] = addr; ++ WritingBytes[1] = data; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBytes, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return FC2580_FCI_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return FC2580_FCI_FAIL; ++}; ++ ++/*============================================================================== ++ ++ fc2580 i2c read ++ ++ This function is a generic function which gets called to read data from ++ fc2580's target memory address. ++ ++ ++ ++ addr ++ fc2580's memory address ++ type : byte ++ ++ ++ ++ data ++ a byte of data read out of target address 'addr' ++ type : byte ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_i2c_read( TUNER_MODULE *pTuner, unsigned char addr, unsigned char *read_data ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &addr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, read_data, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ return FC2580_FCI_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return FC2580_FCI_FAIL; ++}; ++ ++ ++ ++/*============================================================================== ++ fc2580 I2C Test ++ ++ This function is a generic function which tests I2C interface's availability ++ ++ by reading out it's I2C id data from reg. address '0x01'. ++ ++ ++ ++ None ++ ++ ++ int ++ 1 : success - communication is avilable ++ 0 : fail - communication is unavailable ++ ++ ++==============================================================================*/ ++//int fc2580_i2c_test( void ) ++//{ ++// return ( fc2580_i2c_read( 0x01 ) == 0x56 )? 0x01 : 0x00; ++//} ++ ++ ++ ++ ++/*============================================================================== ++ fc2580 initial setting ++ ++ This function is a generic function which gets called to initialize ++ ++ fc2580 in DVB-H mode or L-Band TDMB mode ++ ++ ++ ++ ifagc_mode ++ type : integer ++ 1 : Internal AGC ++ 2 : Voltage Control Mode ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_init( TUNER_MODULE *pTuner, int ifagc_mode, unsigned int freq_xtal ) ++{ ++ fc2580_fci_result_type result = FC2580_FCI_SUCCESS; ++ ++ result &= fc2580_i2c_write(pTuner, 0x00, 0x00); /*** Confidential ***/ ++ result &= fc2580_i2c_write(pTuner, 0x12, 0x86); ++ result &= fc2580_i2c_write(pTuner, 0x14, 0x5C); ++ result &= fc2580_i2c_write(pTuner, 0x16, 0x3C); ++ result &= fc2580_i2c_write(pTuner, 0x1F, 0xD2); ++ result &= fc2580_i2c_write(pTuner, 0x09, 0xD7); ++ result &= fc2580_i2c_write(pTuner, 0x0B, 0xD5); ++ result &= fc2580_i2c_write(pTuner, 0x0C, 0x32); ++ result &= fc2580_i2c_write(pTuner, 0x0E, 0x43); ++ result &= fc2580_i2c_write(pTuner, 0x21, 0x0A); ++ result &= fc2580_i2c_write(pTuner, 0x22, 0x82); ++ if( ifagc_mode == 1 ) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x45, 0x10); //internal AGC ++ result &= fc2580_i2c_write(pTuner, 0x4C, 0x00); //HOLD_AGC polarity ++ } ++ else if( ifagc_mode == 2 ) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x45, 0x20); //Voltage Control Mode ++ result &= fc2580_i2c_write(pTuner, 0x4C, 0x02); //HOLD_AGC polarity ++ } ++ result &= fc2580_i2c_write(pTuner, 0x3F, 0x88); ++ result &= fc2580_i2c_write(pTuner, 0x02, 0x0E); ++ result &= fc2580_i2c_write(pTuner, 0x58, 0x14); ++ result &= fc2580_set_filter(pTuner, 8, freq_xtal); //BW = 7.8MHz ++ ++ return result; ++} ++ ++ ++/*============================================================================== ++ fc2580 frequency setting ++ ++ This function is a generic function which gets called to change LO Frequency ++ ++ of fc2580 in DVB-H mode or L-Band TDMB mode ++ ++ ++ freq_xtal: kHz ++ ++ f_lo ++ Value of target LO Frequency in 'kHz' unit ++ ex) 2.6GHz = 2600000 ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_freq( TUNER_MODULE *pTuner, unsigned int f_lo, unsigned int freq_xtal ) ++{ ++ unsigned int f_diff, f_diff_shifted, n_val, k_val; ++ unsigned int f_vco, r_val, f_comp; ++ unsigned char pre_shift_bits = 4;// number of preshift to prevent overflow in shifting f_diff to f_diff_shifted ++ unsigned char data_0x18; ++ unsigned char data_0x02 = (USE_EXT_CLK<<5)|0x0E; ++ ++ fc2580_band_type band = ( f_lo > 1000000 )? FC2580_L_BAND : ( f_lo > 400000 )? FC2580_UHF_BAND : FC2580_VHF_BAND; ++ ++ fc2580_fci_result_type result = FC2580_FCI_SUCCESS; ++ ++ f_vco = ( band == FC2580_UHF_BAND )? f_lo * 4 : (( band == FC2580_L_BAND )? f_lo * 2 : f_lo * 12); ++ r_val = ( f_vco >= 2*76*freq_xtal )? 1 : ( f_vco >= 76*freq_xtal )? 2 : 4; ++ f_comp = freq_xtal/r_val; ++ n_val = ( f_vco / 2 ) / f_comp; ++ ++ f_diff = f_vco - 2* f_comp * n_val; ++ f_diff_shifted = f_diff << ( 20 - pre_shift_bits ); ++ k_val = f_diff_shifted / ( ( 2* f_comp ) >> pre_shift_bits ); ++ ++ if( f_diff_shifted - k_val * ( ( 2* f_comp ) >> pre_shift_bits ) >= ( f_comp >> pre_shift_bits ) ) ++ k_val = k_val + 1; ++ ++ if( f_vco >= BORDER_FREQ ) //Select VCO Band ++ data_0x02 = data_0x02 | 0x08; //0x02[3] = 1; ++ else ++ data_0x02 = data_0x02 & 0xF7; //0x02[3] = 0; ++ ++// if( band != curr_band ) { ++ switch(band) ++ { ++ case FC2580_UHF_BAND: ++ data_0x02 = (data_0x02 & 0x3F); ++ ++ result &= fc2580_i2c_write(pTuner, 0x25, 0xF0); ++ result &= fc2580_i2c_write(pTuner, 0x27, 0x77); ++ result &= fc2580_i2c_write(pTuner, 0x28, 0x53); ++ result &= fc2580_i2c_write(pTuner, 0x29, 0x60); ++ result &= fc2580_i2c_write(pTuner, 0x30, 0x09); ++ result &= fc2580_i2c_write(pTuner, 0x50, 0x8C); ++ result &= fc2580_i2c_write(pTuner, 0x53, 0x50); ++ ++ if( f_lo < 538000 ) ++ result &= fc2580_i2c_write(pTuner, 0x5F, 0x13); ++ else ++ result &= fc2580_i2c_write(pTuner, 0x5F, 0x15); ++ ++ if( f_lo < 538000 ) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x61, 0x07); ++ result &= fc2580_i2c_write(pTuner, 0x62, 0x06); ++ result &= fc2580_i2c_write(pTuner, 0x67, 0x06); ++ result &= fc2580_i2c_write(pTuner, 0x68, 0x08); ++ result &= fc2580_i2c_write(pTuner, 0x69, 0x10); ++ result &= fc2580_i2c_write(pTuner, 0x6A, 0x12); ++ } ++ else if( f_lo < 794000 ) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x61, 0x03); ++ result &= fc2580_i2c_write(pTuner, 0x62, 0x03); ++ result &= fc2580_i2c_write(pTuner, 0x67, 0x03); //ACI improve ++ result &= fc2580_i2c_write(pTuner, 0x68, 0x05); //ACI improve ++ result &= fc2580_i2c_write(pTuner, 0x69, 0x0C); ++ result &= fc2580_i2c_write(pTuner, 0x6A, 0x0E); ++ } ++ else ++ { ++ result &= fc2580_i2c_write(pTuner, 0x61, 0x07); ++ result &= fc2580_i2c_write(pTuner, 0x62, 0x06); ++ result &= fc2580_i2c_write(pTuner, 0x67, 0x07); ++ result &= fc2580_i2c_write(pTuner, 0x68, 0x09); ++ result &= fc2580_i2c_write(pTuner, 0x69, 0x10); ++ result &= fc2580_i2c_write(pTuner, 0x6A, 0x12); ++ } ++ ++ result &= fc2580_i2c_write(pTuner, 0x63, 0x15); ++ ++ result &= fc2580_i2c_write(pTuner, 0x6B, 0x0B); ++ result &= fc2580_i2c_write(pTuner, 0x6C, 0x0C); ++ result &= fc2580_i2c_write(pTuner, 0x6D, 0x78); ++ result &= fc2580_i2c_write(pTuner, 0x6E, 0x32); ++ result &= fc2580_i2c_write(pTuner, 0x6F, 0x14); ++ result &= fc2580_set_filter(pTuner, 8, freq_xtal); //BW = 7.8MHz ++ break; ++ case FC2580_VHF_BAND: ++ data_0x02 = (data_0x02 & 0x3F) | 0x80; ++ result &= fc2580_i2c_write(pTuner, 0x27, 0x77); ++ result &= fc2580_i2c_write(pTuner, 0x28, 0x33); ++ result &= fc2580_i2c_write(pTuner, 0x29, 0x40); ++ result &= fc2580_i2c_write(pTuner, 0x30, 0x09); ++ result &= fc2580_i2c_write(pTuner, 0x50, 0x8C); ++ result &= fc2580_i2c_write(pTuner, 0x53, 0x50); ++ result &= fc2580_i2c_write(pTuner, 0x5F, 0x0F); ++ result &= fc2580_i2c_write(pTuner, 0x61, 0x07); ++ result &= fc2580_i2c_write(pTuner, 0x62, 0x00); ++ result &= fc2580_i2c_write(pTuner, 0x63, 0x15); ++ result &= fc2580_i2c_write(pTuner, 0x67, 0x03); ++ result &= fc2580_i2c_write(pTuner, 0x68, 0x05); ++ result &= fc2580_i2c_write(pTuner, 0x69, 0x10); ++ result &= fc2580_i2c_write(pTuner, 0x6A, 0x12); ++ result &= fc2580_i2c_write(pTuner, 0x6B, 0x08); ++ result &= fc2580_i2c_write(pTuner, 0x6C, 0x0A); ++ result &= fc2580_i2c_write(pTuner, 0x6D, 0x78); ++ result &= fc2580_i2c_write(pTuner, 0x6E, 0x32); ++ result &= fc2580_i2c_write(pTuner, 0x6F, 0x54); ++ result &= fc2580_set_filter(pTuner, 7, freq_xtal); //BW = 6.8MHz ++ break; ++ case FC2580_L_BAND: ++ data_0x02 = (data_0x02 & 0x3F) | 0x40; ++ result &= fc2580_i2c_write(pTuner, 0x2B, 0x70); ++ result &= fc2580_i2c_write(pTuner, 0x2C, 0x37); ++ result &= fc2580_i2c_write(pTuner, 0x2D, 0xE7); ++ result &= fc2580_i2c_write(pTuner, 0x30, 0x09); ++ result &= fc2580_i2c_write(pTuner, 0x44, 0x20); ++ result &= fc2580_i2c_write(pTuner, 0x50, 0x8C); ++ result &= fc2580_i2c_write(pTuner, 0x53, 0x50); ++ result &= fc2580_i2c_write(pTuner, 0x5F, 0x0F); ++ result &= fc2580_i2c_write(pTuner, 0x61, 0x0F); ++ result &= fc2580_i2c_write(pTuner, 0x62, 0x00); ++ result &= fc2580_i2c_write(pTuner, 0x63, 0x13); ++ result &= fc2580_i2c_write(pTuner, 0x67, 0x00); ++ result &= fc2580_i2c_write(pTuner, 0x68, 0x02); ++ result &= fc2580_i2c_write(pTuner, 0x69, 0x0C); ++ result &= fc2580_i2c_write(pTuner, 0x6A, 0x0E); ++ result &= fc2580_i2c_write(pTuner, 0x6B, 0x08); ++ result &= fc2580_i2c_write(pTuner, 0x6C, 0x0A); ++ result &= fc2580_i2c_write(pTuner, 0x6D, 0xA0); ++ result &= fc2580_i2c_write(pTuner, 0x6E, 0x50); ++ result &= fc2580_i2c_write(pTuner, 0x6F, 0x14); ++ result &= fc2580_set_filter(pTuner, 1, freq_xtal); //BW = 1.53MHz ++ break; ++ default: ++ break; ++ } ++// curr_band = band; ++// } ++ ++ //A command about AGC clock's pre-divide ratio ++ if( freq_xtal >= 28000 ) ++ result &= fc2580_i2c_write(pTuner, 0x4B, 0x22 ); ++ ++ //Commands about VCO Band and PLL setting. ++ result &= fc2580_i2c_write(pTuner, 0x02, data_0x02); ++ data_0x18 = ( ( r_val == 1 )? 0x00 : ( ( r_val == 2 )? 0x10 : 0x20 ) ) + (unsigned char)(k_val >> 16); ++ result &= fc2580_i2c_write(pTuner, 0x18, data_0x18); //Load 'R' value and high part of 'K' values ++ result &= fc2580_i2c_write(pTuner, 0x1A, (unsigned char)( k_val >> 8 ) ); //Load middle part of 'K' value ++ result &= fc2580_i2c_write(pTuner, 0x1B, (unsigned char)( k_val ) ); //Load lower part of 'K' value ++ result &= fc2580_i2c_write(pTuner, 0x1C, (unsigned char)( n_val ) ); //Load 'N' value ++ ++ //A command about UHF LNA Load Cap ++ if( band == FC2580_UHF_BAND ) ++ result &= fc2580_i2c_write(pTuner, 0x2D, ( f_lo <= (unsigned int)794000 )? 0x9F : 0x8F ); //LNA_OUT_CAP ++ ++ ++ return result; ++} ++ ++ ++/*============================================================================== ++ fc2580 filter BW setting ++ ++ This function is a generic function which gets called to change Bandwidth ++ ++ frequency of fc2580's channel selection filter ++ ++ ++ freq_xtal: kHz ++ ++ filter_bw ++ 1 : 1.53MHz(TDMB) ++ 6 : 6MHz (Bandwidth 6MHz) ++ 7 : 6.8MHz (Bandwidth 7MHz) ++ 8 : 7.8MHz (Bandwidth 8MHz) ++ ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_filter( TUNER_MODULE *pTuner, unsigned char filter_bw, unsigned int freq_xtal ) ++{ ++ unsigned char cal_mon, i; ++ fc2580_fci_result_type result = FC2580_FCI_SUCCESS; ++ ++ if(filter_bw == 1) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x36, 0x1C); ++ result &= fc2580_i2c_write(pTuner, 0x37, (unsigned char)(4151*freq_xtal/1000000) ); ++ result &= fc2580_i2c_write(pTuner, 0x39, 0x00); ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x09); ++ } ++ if(filter_bw == 6) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x36, 0x18); ++ result &= fc2580_i2c_write(pTuner, 0x37, (unsigned char)(4400*freq_xtal/1000000) ); ++ result &= fc2580_i2c_write(pTuner, 0x39, 0x00); ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x09); ++ } ++ else if(filter_bw == 7) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x36, 0x18); ++ result &= fc2580_i2c_write(pTuner, 0x37, (unsigned char)(3910*freq_xtal/1000000) ); ++ result &= fc2580_i2c_write(pTuner, 0x39, 0x80); ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x09); ++ } ++ else if(filter_bw == 8) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x36, 0x18); ++ result &= fc2580_i2c_write(pTuner, 0x37, (unsigned char)(3300*freq_xtal/1000000) ); ++ result &= fc2580_i2c_write(pTuner, 0x39, 0x80); ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x09); ++ } ++ ++ ++ for(i=0; i<5; i++) ++ { ++ fc2580_wait_msec(pTuner, 5);//wait 5ms ++ result &= fc2580_i2c_read(pTuner, 0x2F, &cal_mon); ++ if( (cal_mon & 0xC0) != 0xC0) ++ { ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x01); ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x09); ++ } ++ else ++ break; ++ } ++ ++ result &= fc2580_i2c_write(pTuner, 0x2E, 0x01); ++ ++ return result; ++} ++ ++/*============================================================================== ++ fc2580 RSSI function ++ ++ This function is a generic function which returns fc2580's ++ ++ current RSSI value. ++ ++ ++ none ++ ++ ++ int ++ rssi : estimated input power. ++ ++==============================================================================*/ ++//int fc2580_get_rssi(void) { ++// ++// unsigned char s_lna, s_rfvga, s_cfs, s_ifvga; ++// int ofs_lna, ofs_rfvga, ofs_csf, ofs_ifvga, rssi; ++// ++// fc2580_i2c_read(0x71, &s_lna ); ++// fc2580_i2c_read(0x72, &s_rfvga ); ++// fc2580_i2c_read(0x73, &s_cfs ); ++// fc2580_i2c_read(0x74, &s_ifvga ); ++// ++// ++// ofs_lna = ++// (curr_band==FC2580_UHF_BAND)? ++// (s_lna==0)? 0 : ++// (s_lna==1)? -6 : ++// (s_lna==2)? -17 : ++// (s_lna==3)? -22 : -30 : ++// (curr_band==FC2580_VHF_BAND)? ++// (s_lna==0)? 0 : ++// (s_lna==1)? -6 : ++// (s_lna==2)? -19 : ++// (s_lna==3)? -24 : -32 : ++// (curr_band==FC2580_L_BAND)? ++// (s_lna==0)? 0 : ++// (s_lna==1)? -6 : ++// (s_lna==2)? -11 : ++// (s_lna==3)? -16 : -34 : ++// 0;//FC2580_NO_BAND ++// ofs_rfvga = -s_rfvga+((s_rfvga>=11)? 1 : 0) + ((s_rfvga>=18)? 1 : 0); ++// ofs_csf = -6*s_cfs; ++// ofs_ifvga = s_ifvga/4; ++// ++// return rssi = ofs_lna+ofs_rfvga+ofs_csf+ofs_ifvga+OFS_RSSI; ++// ++//} ++ ++/*============================================================================== ++ fc2580 Xtal frequency Setting ++ ++ This function is a generic function which sets ++ ++ the frequency of xtal. ++ ++ ++ ++ frequency ++ frequency value of internal(external) Xtal(clock) in kHz unit. ++ ++==============================================================================*/ ++//void fc2580_set_freq_xtal(unsigned int frequency) { ++// ++// freq_xtal = frequency; ++// ++//} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_fc2580.h b/drivers/media/dvb/dvb-usb/tuner_fc2580.h +new file mode 100644 +index 0000000..906357d +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_fc2580.h +@@ -0,0 +1,461 @@ ++#ifndef __TUNER_FC2580_H ++#define __TUNER_FC2580_H ++ ++/** ++ ++@file ++ ++@brief FC2580 tuner module declaration ++ ++One can manipulate FC2580 tuner through FC2580 module. ++FC2580 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_fc2580.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ FC2580_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build FC2580 tuner module. ++ BuildFc2580Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xac, // I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16384000HZ, // Crystal frequency is 16.384 MHz. ++ FC2580_AGC_INTERNAL // The FC2580 AGC mode is internal AGC mode. ++ ); ++ ++ ++ ++ ++ ++ // Get FC2580 tuner extra module. ++ pTunerExtra = (T2266_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set FC2580 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, FC2580_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get FC2580 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is source code provided by FCI. ++ ++ ++ ++ ++ ++// FCI source code - fc2580_driver_v1400_r.h ++ ++ ++/*============================================================================== ++ FILE NAME : FC2580_driver_v1400_r.h ++ ++ VERSION : 1.400_r ++ ++ UPDATE : September 22. 2008 ++ ++==============================================================================*/ ++ ++/*============================================================================== ++ ++ Chip ID of FC2580 is 0x56 or 0xAC(including I2C write bit) ++ ++==============================================================================*/ ++ ++ ++#define BORDER_FREQ 2600000 //2.6GHz : The border frequency which determines whether Low VCO or High VCO is used ++#define USE_EXT_CLK 0 //0 : Use internal XTAL Oscillator / 1 : Use External Clock input ++#define OFS_RSSI 57 ++ ++typedef enum { ++ FC2580_UHF_BAND, ++ FC2580_L_BAND, ++ FC2580_VHF_BAND, ++ FC2580_NO_BAND ++} fc2580_band_type; ++ ++typedef enum { ++ FC2580_FCI_FAIL, ++ FC2580_FCI_SUCCESS ++} fc2580_fci_result_type; ++ ++/*============================================================================== ++ i2c command write EXTERNAL FUNCTION ++ ++ This function is a generic function which write a byte into fc2580's ++ specific address. ++ ++ ++ ++ slave_id ++ i2c id of slave chip ++ type : byte ++ ++ addr ++ memory address of slave chip ++ type : byte ++ ++ data ++ target data ++ type : byte ++ ++==============================================================================*/ ++//extern fc2580_fci_result_type i2c_write( unsigned char slave_id, unsigned char addr, unsigned char *data, unsigned char n ); ++ ++/*============================================================================== ++ i2c command write EXTERNAL FUNCTION ++ ++ This function is a generic function which gets called to read data from ++ slave chip's target memory address. ++ ++ ++ ++ slave_id ++ i2c id of slave chip ++ type : byte ++ ++ addr ++ memory address of slave chip ++ type : byte ++ ++ ++ data ++ a byte of data read out of target address 'addr' of slave chip ++ type : byte ++ ++==============================================================================*/ ++//extern fc2580_fci_result_type i2c_read( unsigned char slave_id, unsigned char addr, unsigned char *read_data, unsigned char n ); ++ ++/*============================================================================== ++ milisecond delay function EXTERNAL FUNCTION ++ ++ This function is a generic function which write a byte into fc2580's ++ specific address. ++ ++ ++ ++ a ++ length of wanted delay in milisecond unit ++ ++==============================================================================*/ ++extern void fc2580_wait_msec(TUNER_MODULE *pTuner, int a); ++ ++ ++ ++/*============================================================================== ++ fc2580 i2c command write ++ ++ This function is a generic function which write a byte into fc2580's ++ specific address. ++ ++ ++ ++ addr ++ fc2580's memory address ++ type : byte ++ ++ data ++ target data ++ type : byte ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_i2c_write( TUNER_MODULE *pTuner, unsigned char addr, unsigned char data ); ++ ++/*============================================================================== ++ fc2580 i2c data read ++ ++ This function is a generic function which gets called to read data from ++ fc2580's target memory address. ++ ++ ++ ++ addr ++ fc2580's memory address ++ type : byte ++ ++ ++ ++ data ++ a byte of data read out of target address 'addr' ++ type : byte ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_i2c_read( TUNER_MODULE *pTuner, unsigned char addr, unsigned char *read_data ); ++ ++/*============================================================================== ++ fc2580 initial setting ++ ++ This function is a generic function which gets called to initialize ++ ++ fc2580 in DVB-H mode or L-Band TDMB mode ++ ++ ++ ++ ifagc_mode ++ type : integer ++ 1 : Internal AGC ++ 2 : Voltage Control Mode ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_init( TUNER_MODULE *pTuner, int ifagc_mode, unsigned int freq_xtal ); ++ ++/*============================================================================== ++ fc2580 frequency setting ++ ++ This function is a generic function which gets called to change LO Frequency ++ ++ of fc2580 in DVB-H mode or L-Band TDMB mode ++ ++ ++ ++ f_lo ++ Value of target LO Frequency in 'kHz' unit ++ ex) 2.6GHz = 2600000 ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_freq( TUNER_MODULE *pTuner, unsigned int f_lo, unsigned int freq_xtal ); ++ ++ ++/*============================================================================== ++ fc2580 filter BW setting ++ ++ This function is a generic function which gets called to change Bandwidth ++ ++ frequency of fc2580's channel selection filter ++ ++ ++ ++ filter_bw ++ 1 : 1.53MHz(TDMB) ++ 6 : 6MHz ++ 7 : 7MHz ++ 8 : 7.8MHz ++ ++ ++==============================================================================*/ ++fc2580_fci_result_type fc2580_set_filter( TUNER_MODULE *pTuner, unsigned char filter_bw, unsigned int freq_xtal ); ++ ++/*============================================================================== ++ fc2580 RSSI function ++ ++ This function is a generic function which returns fc2580's ++ ++ current RSSI value. ++ ++ ++ ++ ++==============================================================================*/ ++//int fc2580_get_rssi(void); ++ ++/*============================================================================== ++ fc2580 Xtal frequency Setting ++ ++ This function is a generic function which sets ++ ++ the frequency of xtal. ++ ++ ++ ++ frequency ++ frequency value of internal(external) Xtal(clock) in kHz unit. ++ ++==============================================================================*/ ++//void fc2580_set_freq_xtal(unsigned int frequency); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is FC2580 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// AGC mode ++enum FC2580_AGC_MODE ++{ ++ FC2580_AGC_INTERNAL = 1, ++ FC2580_AGC_EXTERNAL = 2, ++}; ++ ++ ++// Bandwidth mode ++enum FC2580_BANDWIDTH_MODE ++{ ++ FC2580_BANDWIDTH_1530000HZ = 1, ++ FC2580_BANDWIDTH_6000000HZ = 6, ++ FC2580_BANDWIDTH_7000000HZ = 7, ++ FC2580_BANDWIDTH_8000000HZ = 8, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildFc2580Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int AgcMode ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++fc2580_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++fc2580_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++fc2580_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++fc2580_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++fc2580_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++fc2580_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++fc2580_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_max3543.c b/drivers/media/dvb/dvb-usb/tuner_max3543.c +new file mode 100644 +index 0000000..6158ee3 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_max3543.c +@@ -0,0 +1,1441 @@ ++/** ++ ++@file ++ ++@brief MAX3543 tuner module definition ++ ++One can manipulate MAX3543 tuner through MAX3543 module. ++MAX3543 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_max3543.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief MAX3543 tuner module builder ++ ++Use BuildMax3543Module() to build MAX3543 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to MAX3543 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr MAX3543 I2C device address ++@param [in] CrystalFreqHz MAX3543 crystal frequency in Hz ++@param [in] StandardMode MAX3543 standard mode ++@param [in] IfFreqHz MAX3543 IF frequency in Hz ++@param [in] OutputMode MAX3543 output mode ++ ++ ++@note ++ -# One should call BuildMax3543Module() to build MAX3543 module before using it. ++ ++*/ ++void ++BuildMax3543Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int StandardMode, ++ unsigned long IfFreqHz, ++ int OutputMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_MAX3543; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->RfFreqHz = MAX3543_RF_FREQ_HZ_DEFAULT; ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = max3543_GetTunerType; ++ pTuner->GetDeviceAddr = max3543_GetDeviceAddr; ++ ++ pTuner->Initialize = max3543_Initialize; ++ pTuner->SetRfFreqHz = max3543_SetRfFreqHz; ++ pTuner->GetRfFreqHz = max3543_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->StandardMode = StandardMode; ++ pExtra->IfFreqHz = IfFreqHz; ++ pExtra->OutputMode = OutputMode; ++ pExtra->BandwidthMode = MAX3543_BANDWIDTH_MODE_DEFAULT; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ pExtra->broadcast_standard = StandardMode; ++ ++ switch(CrystalFreqHz) ++ { ++ default: ++ case CRYSTAL_FREQ_16000000HZ: ++ ++ switch(IfFreqHz) ++ { ++ default: ++ case IF_FREQ_36170000HZ: ++ ++ pExtra->XTALSCALE = 8; ++ pExtra->XTALREF = 128; ++ pExtra->LOSCALE = 65; ++ ++ break; ++ } ++ } ++ ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = max3543_SetBandwidthMode; ++ pExtra->GetBandwidthMode = max3543_GetBandwidthMode; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++max3543_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++max3543_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++max3543_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ // Initializing tuner. ++ // Note: Call MAX3543 source code function. ++ if(MAX3543_Init(pTuner) != MAX3543_SUCCESS) ++ goto error_status_execute_function; ++ ++ // Set tuner standard mode and output mode. ++ // Note: Call MAX3543 source code function. ++ if(MAX3543_Standard(pTuner, pExtra->StandardMode, pExtra->OutputMode) != MAX3543_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++max3543_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ unsigned long FreqUnit; ++ unsigned short CalculatedValue; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ // Calculate frequency unit. ++ FreqUnit = MAX3543_CONST_1_MHZ / pExtra->LOSCALE; ++ ++ // Set tuner RF frequency in KHz. ++ // Note: 1. CalculatedValue = round(RfFreqHz / FreqUnit) ++ // 2. Call MAX3543 source code function. ++ CalculatedValue = (unsigned short)((RfFreqHz + (FreqUnit / 2)) / FreqUnit); ++ ++ if(MAX3543_SetFrequency(pTuner, CalculatedValue) != MAX3543_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++max3543_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set MAX3543 tuner bandwidth mode. ++ ++*/ ++int ++max3543_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ unsigned short BandwidthModeUshort; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ // Set tuner bandwidth mode. ++ // Note: Call MAX3543 source code function. ++ BandwidthModeUshort = (unsigned short)BandwidthMode; ++ ++ if(MAX3543_ChannelBW(pTuner, BandwidthModeUshort) != MAX3543_SUCCESS) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner bandwidth Hz parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MAX3543 tuner bandwidth mode. ++ ++*/ ++int ++max3543_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ // Get tuner bandwidth Hz from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth_mode; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Function (implemeted for MAX3543) ++int ++Max3543_Read( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned short *pData ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingByte; ++ unsigned char ReadingByte; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + stop_bit ++ WritingByte = (unsigned char)RegAddr; ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &WritingByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, &ReadingByte, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ *pData = (unsigned short)ReadingByte; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++ ++ ++int ++Max3543_Write( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned short Data ++ ) ++{ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[LEN_2_BYTE]; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr + data + stop_bit ++ WritingBuffer[0] = (unsigned char)RegAddr; ++ WritingBuffer[1] = (unsigned char)Data; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_set_tuner_registers: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by MAXIM. ++ ++ ++ ++ ++ ++// MAXIM source code - Max3543_Driver.c ++ ++ ++/* ++------------------------------------------------------------------------- ++| MAX3543 Tuner Driver ++| Author: Paul Nichol ++| ++| Version: 1.0.3 ++| Date: 12/09/09 ++| ++| ++| Copyright (C) 2009 Maxim Integrated Products. ++| PLEASE READ THE ATTACHED LICENSE CAREFULLY BEFORE USING THIS SOFTWARE. ++| BY USING THE SOFTWARE OF MAXIM INTEGRATED PRODUCTS, INC, YOU ARE AGREEING ++| TO BE BOUND BY THE TERMS OF THE ATTACHED LICENSE, WHICH INCLUDES THE SOFTWARE ++| LICENSE AND SOFTWARE WARRANTY DISCLAIMER, EVEN WITHOUT YOUR SIGNATURE. ++| IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THIS SOFTWARE. ++| ++| IMPORTANT: This code is operate the Max3543 Multi-Band Terrestrial ++| Hybrid Tuner. Routines include: initializing, tuning, reading the ++| ROM table, reading the lock detect status and tuning the tracking ++| filter. Only integer math is used in this program and no floating point ++| variables are used. Your MCU must be capable of processing unsigned 32 bit integer ++| math to use this routine. (That is: two 16 bit numbers multiplied resulting in a ++| 32 bit result, or a 32 bit number divided by a 16 bit number). ++| ++-------------------------------------------------------------------------- ++*/ ++ ++ ++//#include ++//#include ++///#include ++//#include "mxmdef.h" ++//#include "Max3543_Driver.h" ++ ++/* ++double debugreg[10]; ++UINT_16 TFRomCoefs[3][4]; ++UINT_16 denominator; ++UINT_32 fracscale ; ++UINT_16 regs[22]; ++UINT_16 IF_Frequency; ++*/ ++ ++/* table of fixed coefficients for the tracking filter equations. */ ++ ++const ++static UINT_16 co[6][5]={{ 26, 6, 68, 20, 45 }, /* VHF LO TFS */ ++ { 16, 8, 88, 40, 0 }, /* VHF LO TFP */ ++ { 27, 10, 54, 30,20 }, /* VHF HI TFS */ ++ { 18, 10, 41, 20, 0 }, /* VHF HI TFP */ ++ { 32, 10, 34, 8, 10 }, /* UHF TFS */ ++ { 13, 15, 21, 16, 0 }}; /* UHF TFP */ ++ ++ ++ ++//int MAX3543_Init(TUNER_MODULE *pTuner, UINT_16 RfFreq) ++int MAX3543_Init(TUNER_MODULE *pTuner) ++{ ++ /* ++ Initialize every register. Don't rely on MAX3543 power on reset. ++ Call before using the other routines in this file. ++ */ ++ UINT_16 RegNumber; ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ unsigned long FreqUnit; ++ unsigned short CalculatedValue; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ /*Initialize the registers in the MAX3543:*/ ++ ++ ++ ++ pExtra->regs[REG3543_VCO] = 0x4c; ++ pExtra->regs[REG3543_NDIV] = 0x2B; ++ pExtra->regs[REG3543_FRAC2] = 0x8E; ++ pExtra->regs[REG3543_FRAC1] = 0x26; ++ pExtra->regs[REG3543_FRAC0] = 0x66; ++ pExtra->regs[REG3543_MODE] = 0xd8; ++ pExtra->regs[REG3543_TFS] = 0x00; ++ pExtra->regs[REG3543_TFP] = 0x00; ++ pExtra->regs[REG3543_SHDN] = 0x00; ++ pExtra->regs[REG3543_REF] = 0x0a; ++ pExtra->regs[REG3543_VAS] = 0x17; ++ pExtra->regs[REG3543_PD_CFG1] = 0x43; ++ pExtra->regs[REG3543_PD_CFG2] = 0x01; ++ pExtra->regs[REG3543_FILT_CF] = 0x25; ++ pExtra->regs[REG3543_ROM_ADDR] = 0x00; ++ pExtra->regs[REG3543_IRHR] = 0x80; ++ pExtra->regs[REG3543_BIAS_ADJ] = 0x57; ++ pExtra->regs[REG3543_TEST1] = 0x40; ++ pExtra->regs[REG3543_ROM_WRITE] = 0x00; ++ ++ ++ ++ /* Write each register out to the MAX3543: */ ++ for (RegNumber=0;RegNumber<=MAX3543_NUMREGS;RegNumber++) ++ { ++// Max3543_Write(RegNumber, regs[RegNumber]); ++ if(Max3543_Write(pTuner, RegNumber, pExtra->regs[RegNumber]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ } ++ ++ /* First read calibration constants from MAX3543 and store in global ++ variables for use when setting RF tracking filter */ ++// MAX3543_ReadROM(); ++ if(MAX3543_ReadROM(pTuner) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* Define the IF frequency used. ++ If using non-floating point math, enter the IF Frequency multiplied ++ by the factor LOSCALE here as an integer. ++ i.e. IF_Frequency = 1445; ++ If using floating point math, use the scalefrq macro: ++ i.e. IF_Frequency = scalefrq(36.125); ++ */ ++// IF_Frequency = scalefrq(36.125); ++ ++ ++ // Calculate frequency unit. ++ FreqUnit = MAX3543_CONST_1_MHZ / pExtra->LOSCALE; ++ ++ // Set tuner RF frequency in KHz. ++ // Note: 1. CalculatedValue = round(RfFreqHz / FreqUnit) ++ // 2. Call MAX3543 source code function. ++ CalculatedValue = (unsigned short)((pExtra->IfFreqHz + (FreqUnit / 2)) / FreqUnit); ++ pExtra->IF_Frequency = CalculatedValue; ++ ++ ++ /* Calculate the denominator just once since it is dependant on the xtal freq only. ++ The denominator is used to calculate the N+FractionalN ratio. ++ */ ++ pExtra->denominator = pExtra->XTALREF * 4 * pExtra->LOSCALE; ++ ++ /* The fracscale is used to calculate the fractional remainder of the N+FractionalN ratio. */ ++ pExtra->fracscale = 2147483648U/pExtra->denominator; ++ ++ ++// Note: Set standard mode, channel bandwith, and RF frequency in other functions. ++ ++// MAX3543_Standard(DVB_T, IFOUT1_DIFF_DTVOUT); ++ ++// MAX3543_ChannelBW(BW8MHZ); ++ // Note: Set bandwidth with 8 MHz for QAM. ++ MAX3543_ChannelBW(pTuner, MAX3543_BANDWIDTH_MODE_DEFAULT); ++ ++// MAX3543_SetFrequency(RfFreq); ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++/* Set the channel bandwidth. Call with arguments: BW7MHZ or BW8MHZ */ ++int MAX3543_ChannelBW(TUNER_MODULE *pTuner, UINT_16 bw) ++{ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ pExtra->regs[REG3543_MODE] = (pExtra->regs[REG3543_MODE] & 0xef) | (bw<<4); ++// Max3543_Write(REG3543_MODE, regs[REG3543_MODE]); ++ if(Max3543_Write(pTuner, REG3543_MODE, pExtra->regs[REG3543_MODE]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++/* ++ Set the broadcast standared and RF signal path. ++ This routine must be called prior to tuning (Set_Frequency() ) ++ such as in MAX3543_Init() or when necessary to change modes. ++ ++ This sub routine has 2 input/function ++ 1. bcstd:it set MAX3543 to optimized power detector/bias setting for each standard (dvb-t,pal?, currently it has 4 choice: ++ 1.1 bcstd=DVBT, optimized for DVB-T ++ 1.2 bcstd=DVBC, optimized for DVB-C ++ 1.3 bcstd=ATV1, optimized for PAL/SECAM - B/G/D/K/I ++ 1.4 bcstd=ATV2, optimized for SECAM-L ++ 2. outputmode: this setting has to match you hardware signal path, it has 3 choice: ++ 2.1 outputmode=IFOUT1_DIFF_IFOUT_DIFF ++ signal path: IFOUT1 (pin6/7) driving a diff input IF filter (ie LC filter or 6966 SAW), ++ then go back to IFVGA input (pin 10/11) and IF output of MAX3543 is pin 15/16. ++ this is common seting for all DTV_only demod and hybrid demod ++ 2.2 outputmode=IFOUT1_SE_IFOUT_DIFF ++ signal path: IFOUT1 (pin6) driving a single-ended input IF filter (ie 7251 SAW) ++ then go back to IFVGA input (pin 10/11) and IF output of MAX3543 is pin 15/16. ++ this is common seting for all DTV_only demod and hybrid demod ++ 2.3 outputmode=IFOUT2 ++ signal path: IFOUT2 (pin14) is MAX3543 IF output, normally it drives a ATV demod. ++ The IFVGA is shutoff ++ this is common setting for separate ATV demod app ++*/ ++ ++int MAX3543_Standard(TUNER_MODULE *pTuner, standard bcstd, outputmode outmd) ++{ ++ char IFSEL; ++ char LNA2G; ++ char SDIVG; ++ char WPDA; ++ char NPDA; ++ char RFIFD; ++ char MIXGM; ++ char LNA2B; ++ char MIXB; ++ ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ pExtra->broadcast_standard = bcstd; /* used later in tuning */ ++ ++ ++ switch ( bcstd ) ++ { ++ case DVB_T: ++ LNA2G = 1; ++ WPDA = 4; ++ NPDA = 3; ++ RFIFD = 1; ++ MIXGM = 1; ++ LNA2B = 1; ++ MIXB = 1; ++ break; ++ case DVB_C: ++ LNA2G = 1; ++ WPDA = 3; ++ NPDA = 3; ++ RFIFD = 1; ++ MIXGM = 1; ++ LNA2B = 1; ++ MIXB = 1; ++ break; ++ case ATV: ++ LNA2G = 0; ++ WPDA = 3; ++ NPDA = 5; ++ RFIFD = 2; ++ MIXGM = 0; ++ LNA2B = 3; ++ MIXB = 3; ++ break; ++ case ATV_SECAM_L: ++ LNA2G = 0; ++ WPDA = 3; ++ NPDA = 3; ++ RFIFD = 2; ++ MIXGM = 0; ++ LNA2B = 3; ++ MIXB = 3; ++ break; ++ default: ++ return MAX3543_ERROR; ++ } ++ ++ /* the outmd must be set after the standard mode bits are set. ++ Please do not change order. */ ++ switch ( outmd ) ++ { ++ case IFOUT1_DIFF_DTVOUT: ++ IFSEL = 0; ++ SDIVG = 0; ++ break; ++ case IFOUT1_SE_DTVOUT: ++ IFSEL = 1; ++ SDIVG = 0; ++ break; ++ case IFOUT2: ++ IFSEL = 2; ++ SDIVG = 1; ++ NPDA = 3; ++ LNA2G = 1; /* overrites value chosen above for this case */ ++ RFIFD = 3; /* overrites value chosen above for this case */ ++ break; ++ default: ++ return MAX3543_ERROR; ++ } ++ ++ ++ /* Mask in each set of bits into the register variables */ ++ pExtra->regs[REG3543_MODE] = (pExtra->regs[REG3543_MODE] & 0x7c) | IFSEL | (LNA2G<<7); ++ pExtra->regs[REG3543_SHDN] = (pExtra->regs[REG3543_SHDN] & 0xf7) | (SDIVG<<3); ++ pExtra->regs[REG3543_PD_CFG1] = (pExtra->regs[REG3543_PD_CFG1] & 0x88) | (WPDA<<4) | NPDA; ++ pExtra->regs[REG3543_PD_CFG2] = (pExtra->regs[REG3543_PD_CFG2] & 0xfc) | RFIFD; ++ pExtra->regs[REG3543_BIAS_ADJ] = (pExtra->regs[REG3543_BIAS_ADJ] & 0x13) | (MIXGM<<6) | (LNA2B<<4) | (MIXB<<2); ++ ++ /* Send each register variable: */ ++// Max3543_Write(REG3543_MODE, regs[REG3543_MODE]); ++ if(Max3543_Write(pTuner, REG3543_MODE, pExtra->regs[REG3543_MODE]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_SHDN, regs[REG3543_SHDN]); ++ if(Max3543_Write(pTuner, REG3543_SHDN, pExtra->regs[REG3543_SHDN]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_PD_CFG1, regs[REG3543_PD_CFG1]); ++ if(Max3543_Write(pTuner, REG3543_PD_CFG1, pExtra->regs[REG3543_PD_CFG1]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_PD_CFG2, regs[REG3543_PD_CFG2]); ++ if(Max3543_Write(pTuner, REG3543_PD_CFG2, pExtra->regs[REG3543_PD_CFG2]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_BIAS_ADJ, regs[REG3543_BIAS_ADJ]); ++ if(Max3543_Write(pTuner, REG3543_BIAS_ADJ, pExtra->regs[REG3543_BIAS_ADJ]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++ ++/*This will set the LO Frequency and all other tuning related register bits. ++ ++ NOTE!!!! The frequency passed to this routine must be scaled by th factor ++ LOSCALE. For example if the frequency was 105.25 MHz you multiply ++ this by LOSCALE which results in a whole number frequency. ++ For example if LOSCALE = 20, then 105.25 * 20 = 2105. ++ You would then call: MAX3543_SetFrequency(2105); ++*/ ++int MAX3543_SetFrequency(TUNER_MODULE *pTuner, UINT_16 RF_Frequency) ++{ ++ UINT_16 RDiv, NewR, NDiv, Vdiv; ++ UINT_32 Num; ++ UINT_16 LO_Frequency; ++ UINT_16 Rem; ++ UINT_32 FracN; ++ ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ LO_Frequency = RF_Frequency + pExtra->IF_Frequency ; ++ ++ /* Determine VCO Divider */ ++ if (LO_Frequency < scalefrq(138)) /* 138MHz scaled UHF band */ ++ { ++ Vdiv = 3; /* divide by 32 */ ++ } ++ else if ( LO_Frequency < scalefrq(275)) /* VHF Band */ ++ { ++ Vdiv = 2; /* divide by 16 */ ++ } ++ else if (LO_Frequency < scalefrq(550)) ++ { ++ Vdiv = 1; /* divide by 8 */ ++ } ++ else ++ { ++ Vdiv = 0; /* divide by 4 */ ++ } ++ ++ ++ /* calculate the r-divider from the RDIV bits: ++ RDIV bits RDIV ++ 00 1 ++ 01 2 ++ 10 4 ++ 11 8 ++ */ ++ RDiv = 1<<((pExtra->regs[REG3543_FRAC2] & 0x30) >> 4); ++ ++ /* Set the R-Divider based on the frequency if in DVB mode. ++ Otherwise set the R-Divider to 2. ++ Only send RDivider if it needs to change from the current state. ++ */ ++ NewR = 0; ++ if ((pExtra->broadcast_standard == DVB_T || pExtra->broadcast_standard == DVB_C) ) ++ { ++ if ((LO_Frequency <= scalefrq(275)) && (RDiv == 1)) ++ NewR = 2; ++ else if ((LO_Frequency > scalefrq(275)) && (RDiv == 2)) ++ NewR = 1; ++ } ++ else if (RDiv == 1) ++ NewR = 2; ++ ++ if (NewR != 0){ ++ RDiv = NewR; ++ pExtra->regs[REG3543_FRAC2] = (pExtra->regs[REG3543_FRAC2] & 0xcf) | ((NewR-1) <<4); ++// Max3543_Write(REG3543_FRAC2, regs[REG3543_FRAC2]); ++ if(Max3543_Write(pTuner, REG3543_FRAC2, pExtra->regs[REG3543_FRAC2]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ } ++ ++ /* Update the VDIV bits in the VCO variable. ++ we will write this variable out to the VCO register during the MAX3543_SeedVCO routine. ++ We can write over all the other bits (D<7:2>) in that register variable because they ++ will be filled in: MAX3543_SeedVCO later. ++ */ ++ pExtra->regs[REG3543_VCO] = Vdiv; ++ ++ /* now convert the Vdiv bits into the multiplier for use in the equation: ++ Vdiv Mult ++ 0 4 ++ 1 8 ++ 2 16 ++ 3 32 ++ */ ++ Vdiv = 1<<(Vdiv+2); ++ ++ ++ //#ifdef HAVE_32BIT_MATH ++ ++ /* Calculate Numerator and Denominator for N+FN calculation */ ++ Num = LO_Frequency * RDiv * Vdiv * pExtra->XTALSCALE; ++ ++ ++ NDiv = (UINT_16) (Num/(UINT_32)pExtra->denominator); /* Note: this is an integer division, returns 16 bit value. */ ++ ++// Max3543_Write(REG3543_NDIV,NDiv); ++ if(Max3543_Write(pTuner, REG3543_NDIV,NDiv) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* Calculate whole number remainder from division of Num by denom: ++ Returns 16 bit value. */ ++ Rem = (UINT_16)(Num - (UINT_32) NDiv * (UINT_32) pExtra->denominator); ++ ++ /* FracN = Rem * 2^20/Denom, Scale 2^20/Denom 2048 X larger for more accuracy. */ ++ /* fracscale = 2^31/denom. 2048 = 2^31/2^20 */ ++ FracN =(Rem*pExtra->fracscale)/2048; ++ ++ ++ ++ /* Optional - Seed the VCO to cause it to tune faster. ++ (LO_Frequency/LOSCALE) * Vdiv = the unscaled VCO Frequency. ++ It is unscaled to prevent overflow when it is multiplied by vdiv. ++ */ ++// MAX3543_SeedVCO((LO_Frequency/LOSCALE) * Vdiv); ++ if(MAX3543_SeedVCO(pTuner, (LO_Frequency/pExtra->LOSCALE) * Vdiv) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ ++ pExtra->regs[REG3543_FRAC2] = (pExtra->regs[REG3543_FRAC2] & 0xf0) | ((UINT_16)(FracN >> 16) & 0xf); ++// Max3543_Write(REG3543_FRAC2, regs[REG3543_FRAC2]); ++ if(Max3543_Write(pTuner, REG3543_FRAC2, pExtra->regs[REG3543_FRAC2]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_FRAC1,(UINT_16)(FracN >> 8) & 0xff); ++ if(Max3543_Write(pTuner, REG3543_FRAC1,(UINT_16)(FracN >> 8) & 0xff) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_FRAC0, (UINT_16) FracN & 0xff); ++ if(Max3543_Write(pTuner, REG3543_FRAC0, (UINT_16) FracN & 0xff) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* Program tracking filters and other frequency dependent registers */ ++// MAX3543_SetTrackingFilter(RF_Frequency); ++ if(MAX3543_SetTrackingFilter(pTuner, RF_Frequency) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++/*As you tune in frequency, the tracking filter needs ++to be set as a function of frequency. Stored in the ROM on the ++IC are two end points for the VHFL, VHFH, and UHF frequency bands. ++This routine performs the necessary function to calculate the ++needed series and parallel capacitor values from these two end ++points for the current frequency. Once the value is calculated, ++it is loaded into the Tracking Filter Caps register and the ++internal capacitors are switched in tuning the tracking ++filter. ++*/ ++int MAX3543_SetTrackingFilter(TUNER_MODULE *pTuner, UINT_16 RF_Frequency) ++{ ++ /* Calculate the series and parallel capacitor values for the given frequency */ ++ /* band. These values are then written to the registers. This causes the */ ++ /* MAX3543's internal series and parallel capacitors to change thus tuning the */ ++ /* tracking filter to the proper frequency. */ ++ ++ UINT_16 TFB, tfs, tfp, RFin, HRF; ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ /* Set the TFB Bits (Tracking Filter Band) for the given frequency. */ ++ if (RF_Frequency < scalefrq(196)) /* VHF Low Band */ ++ { ++ TFB = VHF_L; ++ } ++ else if (RF_Frequency < scalefrq(440)) /* VHF High 196-440 MHz */ ++ { ++ TFB = VHF_H; ++ } ++ else{ /* UHF */ ++ TFB = UHF; ++ } ++ ++ /* Set the RFIN bit. RFIN selects a input low pass filter */ ++ if (RF_Frequency < scalefrq(345)){ /* 345 MHz is the change over point. */ ++ RFin = 0; ++ } ++ else{ ++ RFin = 1; ++ } ++ ++ if (RF_Frequency < scalefrq(110)){ /* 110 MHz is the change over point. */ ++ HRF = 1; ++ } ++ else{ ++ HRF = 0; ++ } ++ ++ /* Write the TFB<1:0> Bits and the RFIN bit into the IFOVLD register */ ++ /* TFB sets the tracking filter band in the chip, RFIN selects the RF input */ ++ pExtra->regs[REG3543_MODE] = (pExtra->regs[REG3543_MODE] & 0x93 ) | (TFB << 2) | (RFin << 6) | (HRF<<5); ++// Max3543_Write(REG3543_MODE,(regs[REG3543_MODE])) ; ++ if(Max3543_Write(pTuner, REG3543_MODE,(pExtra->regs[REG3543_MODE])) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ tfs = tfs_i(pExtra->TFRomCoefs[TFB][SER0], pExtra->TFRomCoefs[TFB][SER1], RF_Frequency/pExtra->LOSCALE, co[TFB*2]); ++ tfp = tfs_i(pExtra->TFRomCoefs[TFB][PAR0], pExtra->TFRomCoefs[TFB][PAR1], RF_Frequency/pExtra->LOSCALE, co[(TFB*2)+1]); ++ ++ /* Write the TFS Bits into the Tracking Filter Series Capacitor register */ ++ if (tfs > 255) /* 255 = 8 bits of TFS */ ++ tfs = 255; ++ if (tfs < 0) ++ tfs = 0; ++ pExtra->regs[REG3543_TFS] = tfs; ++ ++ /* Write the TFP Bits into the Tracking Filter Parallel Capacitor register */ ++ if (tfp > 63) /* 63 = 6 bits of TFP */ ++ tfp = 63; ++ if (tfp < 0) ++ tfp = 0; ++ pExtra->regs[REG3543_TFP] = (pExtra->regs[REG3543_TFP] & 0xc0 ) | tfp; ++ ++ /* Send registers that have been changed */ ++ /* Maxim evkit I2c communication... Replace by microprocessor specific code */ ++// Max3543_Write(REG3543_TFS,(regs[REG3543_TFS])) ; ++ if(Max3543_Write(pTuner, REG3543_TFS,(pExtra->regs[REG3543_TFS])) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++// Max3543_Write(REG3543_TFP,(regs[REG3543_TFP])) ; ++ if(Max3543_Write(pTuner, REG3543_TFP,(pExtra->regs[REG3543_TFP])) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++ ++ ++/* calculate aproximation for Max3540 tracking filter useing integer math only */ ++ ++UINT_16 tfs_i(UINT_16 S0, UINT_16 S1, UINT_16 FreqRF, const UINT_16 c[5]) ++{ UINT_16 i,y,y1,y2,y3,y4,y5,y6,y7,add; ++ UINT_32 res; ++ ++/* y=4*((64*c[0])+c[1]*S0)-((64*c[2]-(S1*c[3]))*(FreqRF))/250; */ ++ y1=64*c[0]; ++ y2=c[1]*S0; ++ y3=4*(y1+y2); ++ y4=S1*c[3]; ++ y5=64*c[2]; ++ y6=y5-y4; ++ y7=(y6*(FreqRF))/250; ++ if (y7((UINT_32)100*c[4])) res=(res+50*1)/100-c[4]; ++ else res=0; ++ ++ if (res<255) return (UINT_16) res; else return 255; ++} ++ ++/* ++ As soon as you program the Frac0 register, a state machine is started to find the ++ correct VCO for the N and Fractional-N values entered. ++ If the VASS bit is set, the search routine will start from the band and ++ sub-band that is currently programmed into the VCO register (VCO and VSUB bits = seed). ++ If you seed the register with bands close to where the auto routine will ++ finally select, the search routine will finish much faster. ++ This routine determines the best seed to use for the VCO and VSUB values. ++ If VASS is cleared, the search will start as the lowest VCO and search up. ++ This takes much longer. Make sure VASS is set before using this routine. ++ For the seed value to be read in the VCO register, it must be there prior to ++ setting the Frac0 register. So call this just before setting the Fractional-N ++ registers. The VASS bit is bit 5 of register 10 (or REG3543_VAS). ++*/ ++int MAX3543_SeedVCO(TUNER_MODULE *pTuner, UINT_16 Fvco){ ++ /* Fvco is the VCO frequency in MHz and is not scaled by LOSCALE */ ++ UINT_16 VCO; ++ UINT_16 VSUB; ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ if (Fvco <= 2750) ++ { ++ /* The VCO seed: */ ++ ++ VCO = 0; ++ /* Determine the VCO sub-band (VSUB) seed: */ ++ if (Fvco < 2068) ++ VSUB = 0; ++ else if (Fvco < 2101) ++ VSUB = 1; ++ else if (Fvco < 2137) ++ VSUB = 2; ++ else if (Fvco < 2174) ++ VSUB = 3; ++ else if (Fvco < 2215) ++ VSUB = 4; ++ else if (Fvco < 2256) ++ VSUB = 5; ++ else if (Fvco < 2300) ++ VSUB = 6; ++ else if (Fvco < 2347) ++ VSUB = 7; ++ else if (Fvco < 2400) ++ VSUB = 8; ++ else if (Fvco < 2453) ++ VSUB = 9; ++ else if (Fvco < 2510) ++ VSUB = 10; ++ else if (Fvco < 2571) ++ VSUB = 11; ++ else if (Fvco < 2639) ++ VSUB = 12; ++ else if (Fvco < 2709) ++ VSUB = 13; ++ else if (Fvco < 2787) ++ VSUB = 14; ++ } ++ else if (Fvco <= 3650) ++ { ++ /* The VCO seed: */ ++ VCO = 1; ++ /* Determine the VCO sub-band (VSUB) seed: */ ++ if (Fvco <= 2792) ++ VSUB = 1; ++ else if (Fvco <= 2839) ++ VSUB = 2; ++ else if (Fvco <= 2890) ++ VSUB = 3; ++ else if (Fvco <= 2944) ++ VSUB = 4; ++ else if (Fvco <= 3000) ++ VSUB = 5; ++ else if (Fvco <= 3059) ++ VSUB = 6; ++ else if (Fvco <= 3122) ++ VSUB = 7; ++ else if (Fvco <= 3194) ++ VSUB = 8; ++ else if (Fvco <= 3266) ++ VSUB = 9; ++ else if (Fvco <= 3342) ++ VSUB = 10; ++ else if (Fvco <= 3425) ++ VSUB = 11; ++ else if (Fvco <= 3516) ++ VSUB = 12; ++ else if (Fvco <= 3612) ++ VSUB = 13; ++ else if (Fvco <= 3715) ++ VSUB = 14; ++ } ++ else ++ { ++ /* The VCO seed: */ ++ VCO = 2; ++ /* Determine the VCO sub-band (VSUB) seed: */ ++ if (Fvco <= 3658) ++ VSUB = 0; ++ else if (Fvco <= 3716) ++ VSUB = 2; ++ else if (Fvco <= 3776) ++ VSUB = 2; ++ else if (Fvco <= 3840) ++ VSUB = 3; ++ else if (Fvco <= 3909) ++ VSUB = 4; ++ else if (Fvco <= 3980) ++ VSUB = 5; ++ else if (Fvco <= 4054) ++ VSUB = 6; ++ else if (Fvco <= 4134) ++ VSUB = 7; ++ else if (Fvco <= 4226) ++ VSUB = 8; ++ else if (Fvco <= 4318) ++ VSUB = 9; ++ else if (Fvco <= 4416) ++ VSUB = 10; ++ else if (Fvco <= 4520) ++ VSUB = 11; ++ else if (Fvco <= 4633) ++ VSUB = 12; ++ else if (Fvco <= 4751) ++ VSUB = 13; ++ else if (Fvco <= 4876) ++ VSUB = 14; ++ else ++ VSUB = 15; ++ } ++ /* VCO = D<7:6>, VSUB = D<5:2> */ ++ pExtra->regs[REG3543_VCO] = (pExtra->regs[REG3543_VCO] & 3) | (VSUB<<2) | (VCO<<6); ++ /* Program the VCO register with the seed: */ ++// Max3543_Write(REG3543_VCO, regs[REG3543_VCO]); ++ if(Max3543_Write(pTuner, REG3543_VCO, pExtra->regs[REG3543_VCO]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++/* Returns the lock detect status. This is accomplished by ++ examining the ADC value read from the MAX3543. The ADC ++ value is the tune voltage digitized. If it is too close to ++ ground or Vcc, the part is unlocked. The ADC ranges from 0-7. ++ Values 1 to 6 are considered locked. 0 or 7 is unlocked. ++ Returns True for locked, fase for unlocked. ++*/ ++int MAX3543_LockDetect(TUNER_MODULE *pTuner, int *pAnswer) ++{ ++// BOOL vcoselected; ++ int vcoselected; ++ UINT_16 tries = 65535; ++ char adc; ++ unsigned short Data; ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ /* The ADC will not be stable until the VCO is selected. ++ usually the selection process will take 25ms or less but ++ it could theoretically take 100ms. Set tries to some number ++ of your processor clocks corresponding to 100ms. ++ You have to take into account all instructions processed ++ in determining this time. I am picking a value out of the air ++ for now. ++ */ ++ vcoselected = MAX_FALSE; ++ while ((--tries > 0) && (vcoselected == MAX_FALSE)) ++ { ++// if ((Max3543_Read(REG3543_VAS_STATUS) & 1) == 1) ++ if(Max3543_Read(pTuner, REG3543_VAS_STATUS, &Data) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ if ((Data & 1) == 1) ++ vcoselected = MAX_TRUE; ++ } ++ /* open the ADC latch: ADL=0, ADE=1 */ ++ pExtra->regs[REG3543_VAS] = (pExtra->regs[REG3543_VAS] & 0xf3) | 4; ++// Max3543_Write(REG3543_VAS, regs[REG3543_VAS]); ++ if(Max3543_Write(pTuner, REG3543_VAS, pExtra->regs[REG3543_VAS]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* ADC = 3 LSBs of Gen Status Register: */ ++// adc = Max3543_Read(REG3543_GEN_STATUS) & 0x7; ++ if(Max3543_Read(pTuner, REG3543_GEN_STATUS, &Data) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ adc = Data & 0x7; ++ ++ ++ ++ ++ /* locked if ADC within range of 1-6: */ ++ if ((adc<1 ) || (adc>6)) ++ return MAX_FALSE; ++ else ++ return MAX_TRUE; ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++} ++ ++ ++ ++int MAX3543_ReadROM(TUNER_MODULE *pTuner) ++{ ++ unsigned short Data; ++ ++ /* Read the ROM table, extract tracking filter ROM coefficients, ++ IRHR and CFSET constants. ++ This is to be called after the Max3543 powers up. ++ */ ++ UINT_16 rom_data[12]; ++ UINT_16 i; ++ ++ MAX3543_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Max3543); ++ ++ ++ for (i=0; i <= 10; i++) ++ { ++// Max3543_Write(REG3543_ROM_ADDR,i); /*Select ROM Row by setting address register */ ++ if(Max3543_Write(pTuner, REG3543_ROM_ADDR,i) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; /*Select ROM Row by setting address register */ ++ ++// rom_data[i] = Max3543_Read(REG3543_ROM_READ); /* Read from ROMR Register */ ++ if(Max3543_Read(pTuner, REG3543_ROM_READ, &Data) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ rom_data[i] = Data; /* Read from ROMR Register */ ++ } ++ ++ ++ /* The ROM address must be returned to 0 for normal operation or the part will not be biased properly. */ ++// Max3543_Write(REG3543_ROM_ADDR,0); ++ if(Max3543_Write(pTuner, REG3543_ROM_ADDR,0) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* Copy all of ROM Row 10 to Filt_CF register. */ ++// Max3543_Write(REG3543_FILT_CF,rom_data[10]); ++ if(Max3543_Write(pTuner, REG3543_FILT_CF,rom_data[10]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ /* Copy the IRHR ROM value to the IRHR register: */ ++// Max3543_Write(REG3543_IRHR, rom_data[0xb]); ++ if(Max3543_Write(pTuner, REG3543_IRHR, rom_data[0xb]) != MAX3543_SUCCESS) ++ goto error_status_access_tuner; ++ ++ ++ /* assemble the broken up word pairs from the ROM table into complete ROM coefficients: */ ++ pExtra->TFRomCoefs[VHF_L][SER0] = (rom_data[1] & 0xFC) >> 2; /*'LS0 )*/ ++ pExtra->TFRomCoefs[VHF_L][SER1] = ((rom_data[1] & 0x3 ) << 4) + ((rom_data[2] & 0xf0) >> 4); /* 'LS1*/ ++ pExtra->TFRomCoefs[VHF_L][PAR0] = ((rom_data[2] & 0xf) << 2) + ((rom_data[3] & 0xc0) >> 6); /*'LP0*/ ++ pExtra->TFRomCoefs[VHF_L][PAR1] = rom_data[3] & 0x3f; /*LP1 */ ++ ++ pExtra->TFRomCoefs[VHF_H][SER0] = ((rom_data[4] & 0xfc) >> 2); /*'HS0 */ ++ pExtra->TFRomCoefs[VHF_H][SER1] = ((rom_data[4] & 0x3) << 4) + ((rom_data[5] & 0xF0) >> 4); /*'HS1 */ ++ pExtra->TFRomCoefs[VHF_H][PAR0] = ((rom_data[5] & 0xf) << 2) + ((rom_data[6] & 0xc0) >> 6); /*'HP0 */ ++ pExtra->TFRomCoefs[VHF_H][PAR1] = rom_data[6] & 0x3F; /*'HP1 */ ++ ++ pExtra->TFRomCoefs[UHF][SER0] = ((rom_data[7] & 0xFC) >> 2); /*'US0 */ ++ pExtra->TFRomCoefs[UHF][SER1] = ((rom_data[7] & 0x3) << 4) + ((rom_data[8] & 0xf0) >> 4 ); /*'US1 */ ++ pExtra->TFRomCoefs[UHF][PAR0] = ((rom_data[8] & 0xF) << 2) + ((rom_data[9] & 0xc0) >> 6); /*'UP0 */ ++ pExtra->TFRomCoefs[UHF][PAR1] = rom_data[9] & 0x3f; /*'UP1 */ ++ ++ ++ return MAX3543_SUCCESS; ++ ++ ++error_status_access_tuner: ++ return MAX3543_ERROR; ++ } ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_max3543.h b/drivers/media/dvb/dvb-usb/tuner_max3543.h +new file mode 100644 +index 0000000..3793813 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_max3543.h +@@ -0,0 +1,572 @@ ++#ifndef __TUNER_MAX3543_H ++#define __TUNER_MAX3543_H ++ ++/** ++ ++@file ++ ++@brief MAX3543 tuner module declaration ++ ++One can manipulate MAX3543 tuner through MAX3543 module. ++MAX3543 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_max3543.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ MAX3543_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build MAX3543 tuner module. ++ BuildMax3543Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0, // I2C device address is 0xac in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // Crystal frequency is 16.0 MHz. ++ MAX3543_STANDARD_DVBT, // The MAX3543 standard mode is DVB-T. ++ IF_FREQ_36170000HZ, // The MAX3543 IF frequency is 36.17 MHz. ++ MAX3543_SAW_INPUT_SE // The MAX3543 SAW input type is single-ended. ++ ); ++ ++ ++ ++ ++ ++ // Get MAX3543 tuner extra module. ++ pTunerExtra = (MAX3543_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set MAX3543 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, MAX3543_BANDWIDTH_7MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get MAX3543 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is implemented for MAX3543 source code. ++ ++ ++// Definition (implemeted for MAX3543) ++ ++// Function return status ++#define MAX3543_SUCCESS 1 ++#define MAX3543_ERROR 0 ++ ++ ++ ++// Function (implemeted for MAX3543) ++int ++Max3543_Read( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned short *pData ++ ); ++ ++int ++Max3543_Write( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned short Data ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by Analog Devices. ++ ++ ++ ++ ++ ++// MAXIM source code - mxmdef.h ++ ++ ++ ++//#ifndef MXMDEF_H ++//#define MXMDEF_H ++ ++#define MAX_PATH 260 ++/* ++#ifndef NULL ++#ifdef __cplusplus ++#define NULL 0 ++#else ++#define NULL ((void *)0) ++#endif ++#endif ++ ++#ifndef FALSE ++#define FALSE 0 ++#endif ++ ++#ifndef TRUE ++#define TRUE 1 ++#endif ++*/ ++ ++#define MAX_FALSE 0 ++#define MAX_TRUE 1 ++ ++ ++typedef unsigned long DWORD; ++ ++//#endif /* _WINDEF_ */ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// MAXIM source code - Max3543_Driver.h ++ ++ ++ ++ /* ++------------------------------------------------------ ++| Max3543_Driver.h, v 1.0.3, 12/9/2009, Paul Nichol ++| Description: Max3543 Driver Includes. ++| ++| Copyright (C) 2009 Maxim Integrated Products ++| ++------------------------------------------------------ ++*/ ++ ++ ++ ++ ++//#ifndef Max3543_Driver_H ++ ++/* integer only mode = 1, floating point mode = 0 */ ++//#define intmode 0 ++ ++ ++//#define Max3543_Driver_H ++ ++ ++#define MAX3543_ADDR 0xc0 ++ ++#define MAX3543_NUMREGS 0x15 ++ ++ ++/* Register Address offsets. Used when sending or indexing registers. */ ++#define REG3543_VCO 0 ++#define REG3543_NDIV 0x1 ++#define REG3543_FRAC2 0x2 ++#define REG3543_FRAC1 0x3 ++#define REG3543_FRAC0 0x4 ++#define REG3543_MODE 0x5 ++#define REG3543_TFS 0x6 ++#define REG3543_TFP 0x7 ++#define REG3543_SHDN 0x8 ++#define REG3543_REF 0x9 ++#define REG3543_VAS 0xa ++#define REG3543_PD_CFG1 0xb ++#define REG3543_PD_CFG2 0xc ++#define REG3543_FILT_CF 0xd ++#define REG3543_ROM_ADDR 0xe ++#define REG3543_IRHR 0xf ++#define REG3543_ROM_READ 0x10 ++#define REG3543_VAS_STATUS 0x11 ++#define REG3543_GEN_STATUS 0x12 ++#define REG3543_BIAS_ADJ 0x13 ++#define REG3543_TEST1 0x14 ++#define REG3543_ROM_WRITE 0x15 ++ ++/* Band constants: */ ++#define VHF_L 0 ++#define VHF_H 1 ++#define UHF 2 ++ ++/* Channel Bandwidth: */ ++#define BW7MHZ 0 ++#define BW8MHZ 1 ++ ++#define SER0 0 ++#define SER1 1 ++#define PAR0 2 ++#define PAR1 3 ++ ++ ++ ++ ++typedef enum {IFOUT1_DIFF_DTVOUT, IFOUT1_SE_DTVOUT,IFOUT2} outputmode; ++ ++typedef enum {DVB_T, DVB_C, ATV, ATV_SECAM_L} standard; ++ ++//standard broadcast_standard; ++ ++ ++ ++/* Note: ++ The SetFrequency() routine must make it's calculations without ++ overflowing 32 bit accumulators. This is a difficult balance of LO, IF and Xtal frequencies. ++ Scaling factors are applied to these frequencies to keep the numbers below the 32 bit result during ++ caltculations. The calculations have been checked for only the following combinations of frequencies ++ and settings: Xtal freqencies of 16.0MHz, 20.25 MHz, 20.48 MHz; IF Frequencies of 30.0 MHz and 30.15MHz; ++ R-Dividers /1 and /2. Any combination of the above numbers may be used. ++ If other combinations or frequencies are needed, the scaling factors: LOSCALE and XTALSCALE must be ++ recalculated. This has been done in a spreadsheet calc.xls. Without checking these ++ scale factors carefully, there could be overflow and tuning errors or amplitude losses due to an ++ incorrect tracking filter setting. ++*/ ++ ++/* Scaling factor for the IF and RF freqencies. ++ Freqencies passed to functions must be multiplied by this factor. ++ (See Note above). ++*/ ++//#define LOSCALE 40 ++ ++/* Scaling factor for Xtal frequency. ++ Use 32 for 16.0MHz, 25 for 20.48 and 4 for 20.25MHz. ++ (See Note above). ++*/ ++//#define XTALSCALE 4 ++ ++//#if intmode ++ /* Macros used for scaling frequency constants. */ ++ /* Use this form if using floating point math. */ ++ ++#define scalefrq(x) ( (UINT_32) ( ( (UINT_16) x) * (UINT_16) pExtra->LOSCALE ) ) ++// #define scalextal(x) ( (UINT_32) ( ( (UINT_16) x ) * (UINT_16) XTALSCALE ) ) ++ ++ ++ /* Note, this is a scaling factor for the Xtal Reference applied to the MAX3543 Xtal Pin. ++ The only valid frequencies are 16.0, 20.25 or 20.48MHz and only with the following conditions: ++ RDiv = /1 or RDiv = /2, IF = 36.0MHz, IF = 36.15 MHz. ++ (See Note above). ++ */ ++// #define XTALREF 81 ++ /* 20.25 * XTALSCALE = 81, where XTALSCALE=4 ++ Use this form if NOT using floating point math. ++ */ ++//#else ++ /* Macros used for scaling frequency constants. */ ++ /* Use this form if NOT using floating point math. */ ++// #define scalefrq(x) ( (unsigned short) ( ( (float) x ) * (float) LOSCALE ) ) ++// #define scalextal(x) ( (unsigned short) ( ( (float) x ) * (float) XTALSCALE ) ) ++ ++ /* Note, this is a scaling factor for the Xtal Reference applied to the MAX3543 Xtal Pin. ++ The only valid frequencies are 16.0, 20.25 or 20.48MHz and only with the following conditions: ++ RDiv = /1 or RDiv = /2, IF = 36.0MHz, IF = 36.15 MHz. ++ (See Note above). ++ */ ++// #define XTALREF scalextal(20.25) ++ /* Use this form if NOT using floating point math. */ ++ /* #define XTALREF 81 */ ++ /* (XTALSCALE * Reference frequency 20.24 * 4 = 81) */ ++//#endif ++ ++ ++ ++ ++#define ATV_SINGLE 2 ++ ++typedef short INT_16; /* compiler type for 16 bit integer */ ++typedef unsigned short UINT_16; /* compiler type for 16 bit unsigned integer */ ++typedef unsigned long UINT_32; /* compiler type for 32 bit unsigned integer */ ++ ++typedef enum {IFOUT_1,IFOUT_2} outmd; ++ ++//int MAX3543_Init(TUNER_MODULE *pTuner, UINT_16 RfFreq); ++int MAX3543_Init(TUNER_MODULE *pTuner); ++int MAX3543_SetFrequency(TUNER_MODULE *pTuner, UINT_16 RF_Frequency); ++//unsigned short MAX3543_Read(UINT_16 reg); ++//void MAX3543_Write(UINT_16 reg, UINT_16 value); ++int MAX3543_LockDetect(TUNER_MODULE *pTuner, int *pAnswer); ++int MAX3543_Standard(TUNER_MODULE *pTuner, standard bcstd, outputmode outmd); ++int MAX3543_ChannelBW(TUNER_MODULE *pTuner, UINT_16 bw); ++int MAX3543_SetTrackingFilter(TUNER_MODULE *pTuner, UINT_16 RF_Frequency); ++int MAX3543_ReadROM(TUNER_MODULE *pTuner); ++UINT_16 tfs_i(UINT_16 S0, UINT_16 S1, UINT_16 FreqRF, const UINT_16 c[5]); ++int MAX3543_SeedVCO(TUNER_MODULE *pTuner, UINT_16 Fvco); ++ ++ ++/******* External functions called by Max3543 code *******/ ++ ++ ++ /* The implementation of these functions is left for the end user. */ ++ /* This is because of the many different microcontrollers and serial */ ++ /* I/O methods that can be used. */ ++ ++// void Max3543_Write(unsigned short RegAddr, unsigned short data); ++ ++ /* This function sends out a byte of data using the following format. */ ++ /* Start, IC_address, ACK, Register Address, Ack, Data, Ack, Stop */ ++ ++ /* IC_address is 0xC0 or 0xC4 depending on JP8 of the Max3543 evkit board. */ ++ /* 0xC0 if the ADDR pin of the Max3543 is low, x0C4 if the pin is high. */ ++ /* The register address is the Index into the register */ ++ /* you wish to fill.*/ ++ ++// unsigned short Max3543_Read(unsigned short reg); ++ ++ /* This reads and returns a byte from the Max3543. */ ++ /* The read sequence is: */ ++ /* Start, IC_address, ACK, Register Address, ack, Start, DeviceReadAddress, ack, */ ++ /* Data, NAck, Stop */ ++ /* Note that there is a IC_Address (0xC0 or 0xC4 as above) and a Device Read */ ++ /* Address which is the IC_Address + 1 (0xC1 or 0xC5). */ ++ /* There are also two start conditions in the read back sequence. */ ++ /* The Register Address is an index into the register you */ ++ /* wish to read back. */ ++ ++ ++//#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is MAX3543 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Standard mode ++enum MAX3543_STANDARD_MODE ++{ ++ MAX3543_STANDARD_DVBT = DVB_T, ++ MAX3543_STANDARD_QAM = DVB_C, ++}; ++ ++ ++// Bandwidth mode ++enum MAX3543_BANDWIDTH_MODE ++{ ++ MAX3543_BANDWIDTH_7000000HZ = BW7MHZ, ++ MAX3543_BANDWIDTH_8000000HZ = BW8MHZ, ++}; ++ ++ ++// SAW input type ++enum MAX3543_SAW_INPUT_TYPE ++{ ++ MAX3543_SAW_INPUT_DIFF = IFOUT1_DIFF_DTVOUT, ++ MAX3543_SAW_INPUT_SE = IFOUT1_SE_DTVOUT, ++}; ++ ++ ++ ++// Default for initialing ++#define MAX3543_RF_FREQ_HZ_DEFAULT 474000000 ++#define MAX3543_BANDWIDTH_MODE_DEFAULT MAX3543_BANDWIDTH_8000000HZ ++ ++ ++// Definition for RF frequency setting. ++#define MAX3543_CONST_1_MHZ 1000000 ++ ++ ++ ++ ++ ++// Builder ++void ++BuildMax3543Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int StandardMode, ++ unsigned long IfFreqHz, ++ int OutputMode ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++max3543_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++max3543_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++max3543_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++max3543_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++max3543_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++max3543_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++max3543_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_mt2063.c b/drivers/media/dvb/dvb-usb/tuner_mt2063.c +new file mode 100644 +index 0000000..505eba5 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mt2063.c +@@ -0,0 +1,5267 @@ ++/** ++ ++@file ++ ++@brief MT2063 tuner module definition ++ ++One can manipulate MT2063 tuner through MT2063 module. ++MT2063 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_mt2063.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief MT2063 tuner module builder ++ ++Use BuildMt2063Module() to build MT2063 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to MT2063 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr MT2063 I2C device address ++@param [in] IfFreqHz MT2063 output IF frequency in Hz ++@param [in] StandardMode Standard mode ++@param [in] IfVgaGainControl IF VGA gain control ++ ++ ++@note ++ -# One should call BuildMt2063Module() to build MT2063 module before using it. ++ ++*/ ++void ++BuildMt2063Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ int StandardMode, ++ unsigned long VgaGc ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_MT2063; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = mt2063_GetTunerType; ++ pTuner->GetDeviceAddr = mt2063_GetDeviceAddr; ++ ++ pTuner->Initialize = mt2063_Initialize; ++ pTuner->SetRfFreqHz = mt2063_SetRfFreqHz; ++ pTuner->GetRfFreqHz = mt2063_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->StandardMode = StandardMode; ++ pExtra->VgaGc = VgaGc; ++ pExtra->IsIfFreqHzSet = NO; ++ pExtra->IsBandwidthHzSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->OpenHandle = mt2063_OpenHandle; ++ pExtra->CloseHandle = mt2063_CloseHandle; ++ pExtra->GetHandle = mt2063_GetHandle; ++ pExtra->SetIfFreqHz = mt2063_SetIfFreqHz; ++ pExtra->GetIfFreqHz = mt2063_GetIfFreqHz; ++ pExtra->SetBandwidthHz = mt2063_SetBandwidthHz; ++ pExtra->GetBandwidthHz = mt2063_GetBandwidthHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++mt2063_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++mt2063_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++mt2063_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Re-initialize tuner. ++ Status = MT2063_ReInit(DeviceHandle); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner output bandwidth. ++// Status = MT2063_SetParam(DeviceHandle, MT2063_OUTPUT_BW, MT2063_BANDWIDTH_6MHZ); ++ ++// if(MT_IS_ERROR(Status)) ++// goto error_status_execute_function; ++ ++ ++ // Set tuner parameters according to standard mode. ++ switch(pExtra->StandardMode) ++ { ++ default: ++ case MT2063_STANDARD_DVBT: ++ ++ Status = MT2063_SetParam(DeviceHandle, MT2063_RCVR_MODE, MT2063_OFFAIR_COFDM); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ break; ++ ++ ++ case MT2063_STANDARD_QAM: ++ ++ Status = MT2063_SetParam(DeviceHandle, MT2063_RCVR_MODE, MT2063_CABLE_QAM); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ break; ++ } ++ ++ ++ // Set tuner VGAGC with IF AGC gain control setting value. ++ Status = MT2063_SetParam(DeviceHandle, MT2063_VGAGC, (UData_t)(pExtra->VgaGc)); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++mt2063_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Set tuner RF frequency in Hz. ++ Status = MT2063_Tune(DeviceHandle, RfFreqHz); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++mt2063_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Open MT2063 tuner handle. ++ ++*/ ++int ++mt2063_OpenHandle( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ unsigned char DeviceAddr; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner I2C device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Open MT2063 handle. ++ // Note: 1. Must take tuner extra module DeviceHandle as handle input argument. ++ // 2. Take pTuner as user-defined data input argument. ++ Status = MT2063_Open(DeviceAddr, &pExtra->DeviceHandle, pTuner); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_open_mt2063_handle; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_open_mt2063_handle: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Close MT2063 tuner handle. ++ ++*/ ++int ++mt2063_CloseHandle( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Close MT2063 handle. ++ Status = MT2063_Close(DeviceHandle); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_open_mt2063_handle; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_open_mt2063_handle: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MT2063 tuner handle. ++ ++*/ ++void ++mt2063_GetHandle( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ *pDeviceHandle = pExtra->DeviceHandle; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set MT2063 tuner IF frequency in Hz. ++ ++*/ ++int ++mt2063_SetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long IfFreqHz ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ unsigned int IfFreqHzUint; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Set tuner output IF frequency. ++ IfFreqHzUint = (unsigned int)IfFreqHz; ++ Status = MT2063_SetParam(DeviceHandle, MT2063_OUTPUT_FREQ, IfFreqHzUint); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_execute_function; ++ ++ ++ // Set tuner IF frequnecy parameter in tuner extra module. ++ pExtra->IfFreqHz = IfFreqHz; ++ pExtra->IsIfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_execute_function: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MT2063 tuner IF frequency in Hz. ++ ++*/ ++int ++mt2063_GetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ ++ // Get tuner IF frequency in Hz from tuner extra module. ++ if(pExtra->IsIfFreqHzSet != YES) ++ goto error_status_get_demod_if_frequency; ++ ++ *pIfFreqHz = pExtra->IfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_demod_if_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set MT2063 tuner bandwidth in Hz. ++ ++*/ ++// Note: The function MT2063_SetParam() only sets software bandwidth variables, ++// so execute MT2063_Tune() after this function. ++int ++mt2063_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++// unsigned long BandwidthHzWithShift; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Set tuner bandwidth in Hz with shift. ++// BandwidthHzWithShift = BandwidthHz - MT2063_BANDWIDTH_SHIFT_HZ; ++// Status = MT2063_SetParam(DeviceHandle, MT2063_OUTPUT_BW, BandwidthHzWithShift); ++ Status = MT2063_SetParam(DeviceHandle, MT2063_OUTPUT_BW, BandwidthHz); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_set_tuner_bandwidth; ++ ++ ++ // Set tuner bandwidth parameter. ++ pExtra->BandwidthHz = BandwidthHz; ++ pExtra->IsBandwidthHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MT2063 tuner bandwidth in Hz. ++ ++*/ ++int ++mt2063_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ) ++{ ++ MT2063_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2063); ++ ++ ++ // Get tuner bandwidth in Hz from tuner module. ++ if(pExtra->IsBandwidthHzSet != YES) ++ goto error_status_get_tuner_bandwidth; ++ ++ *pBandwidthHz = pExtra->BandwidthHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Microtune source code - mt_userdef.c ++ ++ ++/***************************************************************************** ++** ++** Name: mt_userdef.c ++** ++** Description: User-defined MicroTuner software interface ++** ++** Functions ++** Requiring ++** Implementation: MT_WriteSub ++** MT_ReadSub ++** MT_Sleep ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_userdef.c,v 1.2 2008/11/05 13:46:20 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt_userdef.c,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++//#include "mt_userdef.h" ++ ++ ++/***************************************************************************** ++** ++** Name: MT_WriteSub ++** ++** Description: Write values to device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to write data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2063_WriteSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt) ++{ ++// UData_t status = MT_OK; /* Status to be returned */ ++ /* ++ ** ToDo: Add code here to implement a serial-bus write ++ ** operation to the MTxxxx tuner. If successful, ++ ** return MT_OK. ++ */ ++/* return status; */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned int i, j; ++ ++ unsigned char RegStartAddr; ++ unsigned char *pWritingBytes; ++ unsigned long ByteNum; ++ ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ ++ ++ // Get tuner module, base interface, and I2C bridge. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Get regiser start address, writing bytes, and byte number. ++ RegStartAddr = subAddress; ++ pWritingBytes = pData; ++ ByteNum = (unsigned long)cnt; ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set tuner register bytes with writing bytes. ++ // Note: Set tuner register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = RegStartAddr + i; ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + ++ // stop_bit ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, WritingByteNum + LEN_1_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_tuner_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_ReadSub ++** ++** Description: Read values from device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to read data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2063_ReadSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt) ++{ ++// UData_t status = MT_OK; /* Status to be returned */ ++ ++ /* ++ ** ToDo: Add code here to implement a serial-bus read ++ ** operation to the MTxxxx tuner. If successful, ++ ** return MT_OK. ++ */ ++/* return status; */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned int i; ++ ++ unsigned char RegStartAddr; ++ unsigned char *pReadingBytes; ++ unsigned long ByteNum; ++ ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ ++ // Get tuner module, base interface, and I2C bridge. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Get regiser start address, writing bytes, and byte number. ++ RegStartAddr = subAddress; ++ pReadingBytes = pData; ++ ByteNum = (unsigned long)cnt; ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get tuner register bytes. ++ // Note: Get tuner register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = RegStartAddr + i; ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegReadingAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register bytes. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return MT_COMM_ERR; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_Sleep ++** ++** Description: Delay execution for "nMinDelayTime" milliseconds ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** nMinDelayTime - Delay time in milliseconds ++** ++** Returns: None. ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code that ++** blocks execution for the specified period of time. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++void MT2063_Sleep(Handle_t hUserData, ++ UData_t nMinDelayTime) ++{ ++ /* ++ ** ToDo: Add code here to implement a OS blocking ++ ** for a period of "nMinDelayTime" milliseconds. ++ */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get tuner module, base interface. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ ++ // Wait nMinDelayTime milliseconds. ++ pBaseInterface->WaitMs(pBaseInterface, nMinDelayTime); ++ ++ ++ return; ++} ++ ++ ++#if defined(MT2060_CNT) ++#if MT2060_CNT > 0 ++/***************************************************************************** ++** ++** Name: MT_TunerGain (MT2060 only) ++** ++** Description: Measure the relative tuner gain using the demodulator ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** pMeas - Tuner gain (1/100 of dB scale). ++** ie. 1234 = 12.34 (dB) ++** ++** Returns: status: ++** MT_OK - No errors ++** user-defined errors could be set ++** ++** Notes: This is a callback function that is called from the ++** the 1st IF location routine. You MUST provide ++** code that measures the relative tuner gain in a dB ++** (not linear) scale. The return value is an integer ++** value scaled to 1/100 of a dB. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 06-16-2004 DAD Original ++** N/A 11-30-2004 DAD Renamed from MT_DemodInputPower. This name ++** better describes what this function does. ++** ++*****************************************************************************/ ++UData_t MT_TunerGain(Handle_t hUserData, ++ SData_t* pMeas) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ ++ /* ++ ** ToDo: Add code here to return the gain / power level measured ++ ** at the input to the demodulator. ++ */ ++ ++ ++ ++ return (status); ++} ++#endif ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt_2063.c ++ ++ ++/***************************************************************************** ++** ++** Name: mt2063.c ++** ++** Copyright 2007-2008 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt2063.c ++** ++** Description: Microtune MT2063 B0, B1 & B3 Tuner software interface ++** Supports tuners with Part/Rev code: 0x9B - 0x9E. ++** ++** Functions ++** Implemented: UData_t MT2063_Open ++** UData_t MT2063_Close ++** UData_t MT2063_ClearPowerMaskBits ++** UData_t MT2063_GetGPIO ++** UData_t MT2063_GetLocked ++** UData_t MT2063_GetParam ++** UData_t MT2063_GetPowerMaskBits ++** UData_t MT2063_GetReg ++** UData_t MT2063_GetTemp ++** UData_t MT2063_GetUserData ++** UData_t MT2063_ReInit ++** UData_t MT2063_SetGPIO ++** UData_t MT2063_SetParam ++** UData_t MT2063_SetPowerMaskBits ++** UData_t MT2063_SetReg ++** UData_t MT2063_Tune ++** ++** References: AN-00189: MT2063 Programming Procedures Application Note ++** MicroTune, Inc. ++** AN-00010: MicroTuner Serial Interface Application Note ++** MicroTune, Inc. ++** ++** Exports: None ++** ++** Dependencies: MT_ReadSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Read byte(s) of data from the two-wire bus. ++** ++** MT_WriteSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Write byte(s) of data to the two-wire bus. ++** ++** MT_Sleep(hUserData, nMinDelayTime); ++** - Delay execution for nMinDelayTime milliseconds ++** ++** CVS ID: $Id: mt2063.c,v 1.6 2009/04/29 09:58:14 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt2063.c,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** N/A 08-01-2007 PINZ Ver 1.01: Changed Analog &DVB-T settings and added ++** SAW-less receiver mode. ++** 148 09-04-2007 RSK Ver 1.02: Corrected logic of Reg 3B Reference ++** 153 09-07-2007 RSK Ver 1.03: Lock Time improvements ++** 150 09-10-2007 RSK Ver 1.04: Added GetParam/SetParam support for ++** LO1 and LO2 freq for PHY-21 cal. ++** 154 09-13-2007 RSK Ver 1.05: Get/SetParam changes for LOx_FREQ ++** 155 10-01-2007 DAD Ver 1.06: Add receiver mode for SECAM positive ++** modulation ++** (MT2063_ANALOG_TV_POS_NO_RFAGC_MODE) ++** N/A 10-22-2007 PINZ Ver 1.07: Changed some Registers at init to have ++** the same settings as with MT Launcher ++** N/A 10-30-2007 PINZ Add SetParam VGAGC & VGAOI ++** Add SetParam DNC_OUTPUT_ENABLE ++** Removed VGAGC from receiver mode, ++** default now 3 ++** N/A 10-31-2007 PINZ Ver 1.08: Add SetParam TAGC, removed from rcvr-mode ++** Add SetParam AMPGC, removed from rcvr-mode ++** Corrected names of GCU values ++** reorganized receiver modes, removed, ++** (MT2063_ANALOG_TV_POS_NO_RFAGC_MODE) ++** Actualized Receiver-Mode values ++** N/A 11-12-2007 PINZ Ver 1.09: Actualized Receiver-Mode values ++** N/A 11-27-2007 PINZ Improved buffered writing ++** 01-03-2008 PINZ Ver 1.10: Added a trigger of BYPATNUP for ++** correct wakeup of the LNA after shutdown ++** Set AFCsd = 1 as default ++** Changed CAP1sel default ++** 01-14-2008 PINZ Ver 1.11: Updated gain settings, default for VGAGC 3 ++** 173 M 01-23-2008 RSK Ver 1.12: Read LO1C and LO2C registers from HW ++** in GetParam. ++** 03-18-2008 PINZ Ver 1.13: Added Support for MT2063 B3 ++** 04-10-2008 PINZ Ver 1.14: Use software-controlled ClearTune ++** cross-over frequency values. ++** Documentation Updates ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 189 S 05-13-2008 PINZ Ver 1.16: Correct location for ExtSRO control. ++** Add control to avoid DECT freqs. ++** Updated Receivermodes for MT2063 B3 ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 07-10-2008 PINZ Ver 1.19: Documentation Updates, Add a GetParam ++** for each SetParam (LNA_RIN, TGTs) ++** 08-05-2008 PINZ Ver 1.20: Disable SDEXT pin while MT2063_ReInit ++** with MT2063B3 ++** 09-18-2008 PINZ Ver 1.22: Updated values for CTFILT_SW ++** 205 M 10-01-2008 JWS Ver 1.23: Use DMAX when LO2 FracN is near 4096 ++** M 10-24-2008 JWS Ver 1.25: Use DMAX when LO1 FracN is 32 ++** 11-05-2008 PINZ Ver 1.26: Minor code fixes ++** 01-07-2009 PINZ Ver 1.27: Changed value of MT2063_ALL_SD in .h ++** 01-20-2009 PINZ Ver 1.28: Fixed a compare to avoid compiler warning ++** 02-16-2009 PINZ Ver 1.29: Several fixes to improve compiler behavior ++** N/A I 02-26-2009 PINZ Ver 1.30: RCVRmode 2: acfifmax 29->0, pd2tgt 33->34 ++** RCVRmode 4: acfifmax 29->0, pd2tgt 30->34 ++** N/A I 03-02-2009 PINZ Ver 1.31: new default Fout 43.75 -> 36.125MHz ++** new default Output-BW 6 -> 8MHz ++** new default Stepsize 50 -> 62.5kHz ++** new default Fin 651 -> 666 MHz ++** Changed order of receiver-mode init ++** N/A I 03-19-2009 PINZ Ver 1.32: Add GetParam VERSION (of API) ++** Add GetParam IC_REV ++** N/A I 04-22-2009 PINZ Ver 1.33: Small fix in GetParam PD1/PD2 ++** N/A I 04-29-2009 PINZ Ver 1.34: Optimized ReInit function ++** ++*****************************************************************************/ ++//#include "mt2063.h" ++//#include "mt_spuravoid.h" ++//#include /* for NULL */ ++#define MT_NULL 0 ++ ++/* Version of this module */ ++#define MT2063_VERSION 10304 /* Version 01.34 */ ++ ++ ++/* ++** The expected version of MT_AvoidSpursData_t ++** If the version is different, an updated file is needed from Microtune ++*/ ++/* Expecting version 1.21 of the Spur Avoidance API */ ++#define EXPECTED_MT_AVOID_SPURS_INFO_VERSION 010201 ++ ++#if MT2063_AVOID_SPURS_INFO_VERSION < EXPECTED_MT_AVOID_SPURS_INFO_VERSION ++#error Contact Microtune for a newer version of MT_SpurAvoid.c ++#elif MT2063_AVOID_SPURS_INFO_VERSION > EXPECTED_MT_AVOID_SPURS_INFO_VERSION ++#error Contact Microtune for a newer version of mt2063.c ++#endif ++ ++#ifndef MT2063_CNT ++#error You must define MT2063_CNT in the "mt_userdef.h" file ++#endif ++ ++ ++/* ++** Two-wire serial bus subaddresses of the tuner registers. ++** Also known as the tuner's register addresses. ++*/ ++enum MT2063_Register_Offsets ++{ ++ PART_REV = 0, /* 0x00: Part/Rev Code */ ++ LO1CQ_1, /* 0x01: LO1C Queued Byte 1 */ ++ LO1CQ_2, /* 0x02: LO1C Queued Byte 2 */ ++ LO2CQ_1, /* 0x03: LO2C Queued Byte 1 */ ++ LO2CQ_2, /* 0x04: LO2C Queued Byte 2 */ ++ LO2CQ_3, /* 0x05: LO2C Queued Byte 3 */ ++ RSVD_06, /* 0x06: Reserved */ ++ LO_STATUS, /* 0x07: LO Status */ ++ FIFFC, /* 0x08: FIFF Center */ ++ CLEARTUNE, /* 0x09: ClearTune Filter */ ++ ADC_OUT, /* 0x0A: ADC_OUT */ ++ LO1C_1, /* 0x0B: LO1C Byte 1 */ ++ LO1C_2, /* 0x0C: LO1C Byte 2 */ ++ LO2C_1, /* 0x0D: LO2C Byte 1 */ ++ LO2C_2, /* 0x0E: LO2C Byte 2 */ ++ LO2C_3, /* 0x0F: LO2C Byte 3 */ ++ RSVD_10, /* 0x10: Reserved */ ++ PWR_1, /* 0x11: PWR Byte 1 */ ++ PWR_2, /* 0x12: PWR Byte 2 */ ++ TEMP_STATUS, /* 0x13: Temp Status */ ++ XO_STATUS, /* 0x14: Crystal Status */ ++ RF_STATUS, /* 0x15: RF Attn Status */ ++ FIF_STATUS, /* 0x16: FIF Attn Status */ ++ LNA_OV, /* 0x17: LNA Attn Override */ ++ RF_OV, /* 0x18: RF Attn Override */ ++ FIF_OV, /* 0x19: FIF Attn Override */ ++ LNA_TGT, /* 0x1A: Reserved */ ++ PD1_TGT, /* 0x1B: Pwr Det 1 Target */ ++ PD2_TGT, /* 0x1C: Pwr Det 2 Target */ ++ RSVD_1D, /* 0x1D: Reserved */ ++ RSVD_1E, /* 0x1E: Reserved */ ++ RSVD_1F, /* 0x1F: Reserved */ ++ RSVD_20, /* 0x20: Reserved */ ++ BYP_CTRL, /* 0x21: Bypass Control */ ++ RSVD_22, /* 0x22: Reserved */ ++ RSVD_23, /* 0x23: Reserved */ ++ RSVD_24, /* 0x24: Reserved */ ++ RSVD_25, /* 0x25: Reserved */ ++ RSVD_26, /* 0x26: Reserved */ ++ RSVD_27, /* 0x27: Reserved */ ++ FIFF_CTRL, /* 0x28: FIFF Control */ ++ FIFF_OFFSET, /* 0x29: FIFF Offset */ ++ CTUNE_CTRL, /* 0x2A: Reserved */ ++ CTUNE_OV, /* 0x2B: Reserved */ ++ CTRL_2C, /* 0x2C: Reserved */ ++ FIFF_CTRL2, /* 0x2D: Fiff Control */ ++ RSVD_2E, /* 0x2E: Reserved */ ++ DNC_GAIN, /* 0x2F: DNC Control */ ++ VGA_GAIN, /* 0x30: VGA Gain Ctrl */ ++ RSVD_31, /* 0x31: Reserved */ ++ TEMP_SEL, /* 0x32: Temperature Selection */ ++ RSVD_33, /* 0x33: Reserved */ ++ FN_CTRL, /* 0x34: FracN Control */ ++ RSVD_35, /* 0x35: Reserved */ ++ RSVD_36, /* 0x36: Reserved */ ++ RSVD_37, /* 0x37: Reserved */ ++ RSVD_38, /* 0x38: Reserved */ ++ RSVD_39, /* 0x39: Reserved */ ++ RSVD_3A, /* 0x3A: Reserved */ ++ RSVD_3B, /* 0x3B: Reserved */ ++ RSVD_3C, /* 0x3C: Reserved */ ++ END_REGS ++}; ++ ++ ++/* ++** Constants used by the tuning algorithm ++*/ ++#define REF_FREQ (16000000) /* Reference oscillator Frequency (in Hz) */ ++#define IF1_BW (22000000) /* The IF1 filter bandwidth (in Hz) */ ++#define TUNE_STEP_SIZE (62500) /* Tune in steps of 62.5 kHz */ ++#define SPUR_STEP_HZ (250000) /* Step size (in Hz) to move IF1 when avoiding spurs */ ++#define ZIF_BW (2000000) /* Zero-IF spur-free bandwidth (in Hz) */ ++#define MAX_HARMONICS_1 (15) /* Highest intra-tuner LO Spur Harmonic to be avoided */ ++#define MAX_HARMONICS_2 (5) /* Highest inter-tuner LO Spur Harmonic to be avoided */ ++#define MIN_LO_SEP (1000000) /* Minimum inter-tuner LO frequency separation */ ++#define LO1_FRACN_AVOID (0) /* LO1 FracN numerator avoid region (in Hz) */ ++#define LO2_FRACN_AVOID (199999) /* LO2 FracN numerator avoid region (in Hz) */ ++#define MIN_FIN_FREQ (44000000) /* Minimum input frequency (in Hz) */ ++#define MAX_FIN_FREQ (1100000000) /* Maximum input frequency (in Hz) */ ++#define DEF_FIN_FREQ (666000000) /* Default frequency at initialization (in Hz) */ ++#define MIN_FOUT_FREQ (36000000) /* Minimum output frequency (in Hz) */ ++#define MAX_FOUT_FREQ (57000000) /* Maximum output frequency (in Hz) */ ++#define MIN_DNC_FREQ (1293000000) /* Minimum LO2 frequency (in Hz) */ ++#define MAX_DNC_FREQ (1614000000) /* Maximum LO2 frequency (in Hz) */ ++#define MIN_UPC_FREQ (1396000000) /* Minimum LO1 frequency (in Hz) */ ++#define MAX_UPC_FREQ (2750000000U) /* Maximum LO1 frequency (in Hz) */ ++ ++ ++typedef struct ++{ ++ Handle_t handle; ++ Handle_t hUserData; ++ UData_t address; ++ UData_t version; ++ UData_t tuner_id; ++ MT2063_AvoidSpursData_t AS_Data; ++ UData_t f_IF1_actual; ++ UData_t rcvr_mode; ++ UData_t ctfilt_sw; ++ UData_t CTFiltMax[31]; ++ UData_t num_regs; ++ U8Data reg[END_REGS]; ++} MT2063_Info_t; ++ ++static UData_t nMaxTuners = MT2063_CNT; ++static MT2063_Info_t MT2063_Info[MT2063_CNT]; ++static MT2063_Info_t *Avail[MT2063_CNT]; ++static UData_t nOpenTuners = 0; ++ ++ ++/* ++** Constants for setting receiver modes. ++** (6 modes defined at this time, enumerated by MT2063_RCVR_MODES) ++** (DNC1GC & DNC2GC are the values, which are used, when the specific ++** DNC Output is selected, the other is always off) ++** ++** If PAL-L or L' is received, set: ++** MT2063_SetParam(hMT2063,MT2063_TAGC,1); ++** ++** --------------+---------------------------------------------- ++** Mode 0 : | MT2063_CABLE_QAM ++** Mode 1 : | MT2063_CABLE_ANALOG ++** Mode 2 : | MT2063_OFFAIR_COFDM ++** Mode 3 : | MT2063_OFFAIR_COFDM_SAWLESS ++** Mode 4 : | MT2063_OFFAIR_ANALOG ++** Mode 5 : | MT2063_OFFAIR_8VSB ++** --------------+----+----+----+----+-----+-----+-------------- ++** Mode | 0 | 1 | 2 | 3 | 4 | 5 | ++** --------------+----+----+----+----+-----+-----+ ++** ++** ++*/ ++static const U8Data RFAGCEN[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data LNARIN[] = { 0, 0, 3, 3, 3, 3 }; ++static const U8Data FIFFQEN[] = { 1, 1, 1, 1, 1, 1 }; ++static const U8Data FIFFQ[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data DNC1GC[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data DNC2GC[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data ACLNAMAX[] = { 31, 31, 31, 31, 31, 31 }; ++static const U8Data LNATGT[] = { 44, 43, 43, 43, 43, 43 }; ++static const U8Data RFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data ACRFMAX[] = { 31, 31, 31, 31, 31, 31 }; ++static const U8Data PD1TGT[] = { 36, 36, 38, 38, 36, 38 }; ++static const U8Data FIFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; ++static const U8Data ACFIFMAX[] = { 29, 0, 29, 29, 0, 29 }; ++static const U8Data PD2TGT[] = { 40, 34, 38, 42, 34, 38 }; ++ ++ ++static const UData_t df_dosc[] = { ++ 55000, 127000, 167000, 210000, 238000, 267000, 312000, 350000, ++ 372000, 396000, 410000, 421000, 417000, 408000, 387000, 278000, ++ 769000, 816000, 824000, 848000, 903000, 931000, 934000, 961000, ++ 969000, 987000,1005000,1017000, 1006000, 840000, 850000, 0 ++ }; ++ ++ ++/* Forward declaration(s): */ ++static UData_t CalcLO1Mult(UData_t *Div, UData_t *FracN, UData_t f_LO, UData_t f_LO_Step, UData_t f_Ref); ++static UData_t CalcLO2Mult(UData_t *Div, UData_t *FracN, UData_t f_LO, UData_t f_LO_Step, UData_t f_Ref); ++static UData_t fLO_FractionalTerm(UData_t f_ref, UData_t num, UData_t denom); ++static UData_t FindClearTuneFilter(MT2063_Info_t* pInfo, UData_t f_in); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_Open ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: MT2063_Addr - Serial bus address of the tuner. ++** hMT2063 - Tuner handle passed back. ++** hUserData - User-defined data, if needed for the ++** MT_ReadSub() & MT_WriteSub functions. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_ARG_NULL - Null pointer argument passed ++** MT_COMM_ERR - Serial bus communications error ++** MT_TUNER_CNT_ERR - Too many tuners open ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_Open(UData_t MT2063_Addr, ++ Handle_t* hMT2063, ++ Handle_t hUserData) ++{ ++ UData_t status = MT_OK; /* Status to be returned. */ ++ SData_t i; ++ MT2063_Info_t* pInfo = MT_NULL; ++ ++ /* Check the argument before using */ ++ if (hMT2063 == MT_NULL) ++ return (UData_t)MT_ARG_NULL; ++ ++ /* Default tuner handle to NULL. If successful, it will be reassigned */ ++ *hMT2063 = MT_NULL; ++ ++ /* ++ ** If this is our first tuner, initialize the address fields and ++ ** the list of available control blocks. ++ */ ++ if (nOpenTuners == 0) ++ { ++ for (i=MT2063_CNT-1; i>=0; i--) ++ { ++ MT2063_Info[i].handle = MT_NULL; ++ MT2063_Info[i].address = (UData_t)MAX_UDATA; ++ MT2063_Info[i].rcvr_mode = MT2063_CABLE_QAM; ++ MT2063_Info[i].hUserData = MT_NULL; ++ Avail[i] = &MT2063_Info[i]; ++ } ++ } ++ ++ /* ++ ** Look for an existing MT2063_State_t entry with this address. ++ */ ++ for (i=MT2063_CNT-1; i>=0; i--) ++ { ++ /* ++ ** If an open'ed handle provided, we'll re-initialize that structure. ++ ** ++ ** We recognize an open tuner because the address and hUserData are ++ ** the same as one that has already been opened ++ */ ++ if ((MT2063_Info[i].address == MT2063_Addr) && ++ (MT2063_Info[i].hUserData == hUserData)) ++ { ++ pInfo = &MT2063_Info[i]; ++ break; ++ } ++ } ++ ++ /* If not found, choose an empty spot. */ ++ if (pInfo == MT_NULL) ++ { ++ /* Check to see that we're not over-allocating */ ++ if (nOpenTuners == MT2063_CNT) ++ return (UData_t)MT_TUNER_CNT_ERR; ++ ++ /* Use the next available block from the list */ ++ pInfo = Avail[nOpenTuners]; ++ nOpenTuners++; ++ } ++ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_RegisterTuner(&pInfo->AS_Data); ++ ++ if (MT_NO_ERROR(status)) ++ { ++ pInfo->handle = (Handle_t) pInfo; ++ pInfo->hUserData = hUserData; ++ pInfo->address = MT2063_Addr; ++ pInfo->rcvr_mode = MT2063_CABLE_QAM; ++// status |= MT2063_ReInit((Handle_t) pInfo); ++ } ++ ++ if (MT_IS_ERROR(status)) ++ /* MT2063_Close handles the un-registration of the tuner */ ++ (void)MT2063_Close((Handle_t) pInfo); ++ else ++ *hMT2063 = pInfo->handle; ++ ++ return (UData_t)(status); ++} ++ ++ ++static UData_t IsValidHandle(MT2063_Info_t* handle) ++{ ++ return (UData_t)(((handle != MT_NULL) && (handle->handle == handle)) ? 1 : 0); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_Close ++** ++** Description: Release the handle to the tuner. ++** ++** Parameters: hMT2063 - Handle to the MT2063 tuner ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_Close(Handle_t hMT2063) ++{ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) hMT2063; ++ ++ if (!IsValidHandle(pInfo)) ++ return (UData_t)MT_INV_HANDLE; ++ ++ /* Unregister tuner with SpurAvoidance routines (if needed) */ ++ MT2063_UnRegisterTuner(&pInfo->AS_Data); ++ ++ /* Now remove the tuner from our own list of tuners */ ++ pInfo->handle = MT_NULL; ++ pInfo->address = (UData_t)MAX_UDATA; ++ pInfo->hUserData = MT_NULL; ++ nOpenTuners--; ++ Avail[nOpenTuners] = pInfo; /* Return control block to available list */ ++ ++ return (UData_t)MT_OK; ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_GetGPIO ++** ++** Description: Get the current MT2063 GPIO value. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** gpio_id - Selects GPIO0, GPIO1 or GPIO2 ++** attr - Selects input readback, I/O direction or ++** output value (MT2063_GPIO_IN, ++** MT2063_GPIO_DIR or MT2063_GPIO_OUT) ++** *value - current setting of GPIO pin ++** ++** Usage: status = MT2063_GetGPIO(hMT2063, MT2063_GPIO0, ++** MT2063_GPIO_OUT, &value); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_GetGPIO(Handle_t h, ++ MT2063_GPIO_ID gpio_id, ++ MT2063_GPIO_Attr attr, ++ UData_t* value) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data regno; ++ SData_t shift; ++ const U8Data GPIOreg[3] = {RF_STATUS, FIF_OV, RF_OV}; ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ if (value == MT_NULL) ++ return (UData_t)MT_ARG_NULL; ++ ++ regno = GPIOreg[attr]; ++ ++ /* We'll read the register just in case the write didn't work last time */ ++ status = MT2063_ReadSub(pInfo->hUserData, pInfo->address, regno, &pInfo->reg[regno], 1); ++ ++ shift = (SData_t)(gpio_id - MT2063_GPIO0 + 5); ++ *value = (pInfo->reg[regno] >> shift) & 1; ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetLocked ++** ++** Description: Checks to see if LO1 and LO2 are locked. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_UPC_UNLOCK - Upconverter PLL unlocked ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetLocked(Handle_t h) ++{ ++ const UData_t nMaxWait = 100; /* wait a maximum of 100 msec */ ++ const UData_t nPollRate = 2; /* poll status bits every 2 ms */ ++ const UData_t nMaxLoops = nMaxWait / nPollRate; ++ const U8Data LO1LK = 0x80; ++ U8Data LO2LK = 0x08; ++ UData_t status = MT_OK; /* Status to be returned */ ++ UData_t nDelays = 0; ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ /* LO2 Lock bit was in a different place for B0 version */ ++ if (pInfo->tuner_id == MT2063_B0) ++ LO2LK = 0x40; ++ ++ do ++ { ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, LO_STATUS, &pInfo->reg[LO_STATUS], 1); ++ ++ if (MT_IS_ERROR(status)) ++ return (UData_t)(status); ++ ++ if ((pInfo->reg[LO_STATUS] & (LO1LK | LO2LK)) == (LO1LK | LO2LK)) ++ return (UData_t)(status); ++ ++ MT2063_Sleep(pInfo->hUserData, nPollRate); /* Wait between retries */ ++ } ++ while (++nDelays < nMaxLoops); ++ ++ if ((pInfo->reg[LO_STATUS] & LO1LK) == 0x00) ++ status |= MT_UPC_UNLOCK; ++ if ((pInfo->reg[LO_STATUS] & LO2LK) == 0x00) ++ status |= MT_DNC_UNLOCK; ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetParam ++** ++** Description: Gets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm - mostly for testing purposes. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2063_Param) ++** pValue - ptr to returned value ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2063_VER Version of the API ++** MT2063_IC_ADDR Serial Bus address of this tuner ++** MT2063_IC_REV Tuner revision code ++** MT2063_MAX_OPEN Max # of MT2063's allowed open ++** MT2063_NUM_OPEN # of MT2063's open ++** MT2063_SRO_FREQ crystal frequency ++** MT2063_STEPSIZE minimum tuning step size ++** MT2063_INPUT_FREQ input center frequency ++** MT2063_LO1_FREQ LO1 Frequency ++** MT2063_LO1_STEPSIZE LO1 minimum step size ++** MT2063_LO1_FRACN_AVOID LO1 FracN keep-out region ++** MT2063_IF1_ACTUAL Current 1st IF in use ++** MT2063_IF1_REQUEST Requested 1st IF ++** MT2063_IF1_CENTER Center of 1st IF SAW filter ++** MT2063_IF1_BW Bandwidth of 1st IF SAW filter ++** MT2063_ZIF_BW zero-IF bandwidth ++** MT2063_LO2_FREQ LO2 Frequency ++** MT2063_LO2_STEPSIZE LO2 minimum step size ++** MT2063_LO2_FRACN_AVOID LO2 FracN keep-out region ++** MT2063_OUTPUT_FREQ output center frequency ++** MT2063_OUTPUT_BW output bandwidth ++** MT2063_LO_SEPARATION min inter-tuner LO separation ++** MT2063_AS_ALG ID of avoid-spurs algorithm in use ++** MT2063_MAX_HARM1 max # of intra-tuner harmonics ++** MT2063_MAX_HARM2 max # of inter-tuner harmonics ++** MT2063_EXCL_ZONES # of 1st IF exclusion zones ++** MT2063_NUM_SPURS # of spurs found/avoided ++** MT2063_SPUR_AVOIDED >0 spurs avoided ++** MT2063_SPUR_PRESENT >0 spurs in output (mathematically) ++** MT2063_RCVR_MODE Predefined modes. ++** MT2063_LNA_RIN Get LNA RIN value ++** MT2063_LNA_TGT Get target power level at LNA ++** MT2063_PD1_TGT Get target power level at PD1 ++** MT2063_PD2_TGT Get target power level at PD2 ++** MT2063_ACLNA LNA attenuator gain code ++** MT2063_ACRF RF attenuator gain code ++** MT2063_ACFIF FIF attenuator gain code ++** MT2063_ACLNA_MAX LNA attenuator limit ++** MT2063_ACRF_MAX RF attenuator limit ++** MT2063_ACFIF_MAX FIF attenuator limit ++** MT2063_PD1 Actual value of PD1 ++** MT2063_PD2 Actual value of PD2 ++** MT2063_DNC_OUTPUT_ENABLE DNC output selection ++** MT2063_VGAGC VGA gain code ++** MT2063_VGAOI VGA output current ++** MT2063_TAGC TAGC setting ++** MT2063_AMPGC AMP gain code ++** MT2063_AVOID_DECT Avoid DECT Frequencies ++** MT2063_CTFILT_SW Cleartune filter selection ++** ++** Usage: status |= MT2063_GetParam(hMT2063, ++** MT2063_IF1_ACTUAL, ++** &f_IF1_Actual); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** See Also: MT2063_SetParam, MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 154 09-13-2007 RSK Ver 1.05: Get/SetParam changes for LOx_FREQ ++** 10-31-2007 PINZ Ver 1.08: Get/SetParam add VGAGC, VGAOI, AMPGC, TAGC ++** 173 M 01-23-2008 RSK Ver 1.12: Read LO1C and LO2C registers from HW ++** in GetParam. ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 175 I 16-06-2008 PINZ Ver 1.16: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 07-10-2008 PINZ Ver 1.19: Documentation Updates, Add a GetParam ++** for each SetParam (LNA_RIN, TGTs) ++** N/A I 03-19-2009 PINZ Ver 1.32: Add GetParam VERSION (of API) ++** Add GetParam IC_REV ++** N/A I 04-22-2009 PINZ Ver 1.33: Small fix in GetParam PD1/PD2 ++****************************************************************************/ ++UData_t MT2063_GetParam(Handle_t h, ++ MT2063_Param param, ++ UData_t* pValue) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ UData_t Div; ++ UData_t Num; ++ UData_t i; ++ U8Data reg; ++ ++ if (pValue == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ *pValue = 0; ++ ++ switch (param) ++ { ++ /* version of the API, e.g. 10302 = 1.32 */ ++ case MT2063_VER: ++ *pValue = pInfo->version; ++ break; ++ ++ /* Serial Bus address of this tuner */ ++ case MT2063_IC_ADDR: ++ *pValue = pInfo->address; ++ break; ++ ++ /* tuner revision code (see enum MT2063_REVCODE for values) */ ++ case MT2063_IC_REV: ++ *pValue = pInfo->tuner_id; ++ break; ++ ++ /* Max # of MT2063's allowed to be open */ ++ case MT2063_MAX_OPEN: ++ *pValue = nMaxTuners; ++ break; ++ ++ /* # of MT2063's open */ ++ case MT2063_NUM_OPEN: ++ *pValue = nOpenTuners; ++ break; ++ ++ /* crystal frequency */ ++ case MT2063_SRO_FREQ: ++ *pValue = pInfo->AS_Data.f_ref; ++ break; ++ ++ /* minimum tuning step size */ ++ case MT2063_STEPSIZE: ++ *pValue = pInfo->AS_Data.f_LO2_Step; ++ break; ++ ++ /* input center frequency */ ++ case MT2063_INPUT_FREQ: ++ *pValue = pInfo->AS_Data.f_in; ++ break; ++ ++ /* LO1 Frequency */ ++ case MT2063_LO1_FREQ: ++ { ++ /* read the actual tuner register values for LO1C_1 and LO1C_2 */ ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, LO1C_1, &pInfo->reg[LO1C_1], 2); ++ Div = pInfo->reg[LO1C_1]; ++ Num = pInfo->reg[LO1C_2] & 0x3F; ++ pInfo->AS_Data.f_LO1 = (pInfo->AS_Data.f_ref * Div) + fLO_FractionalTerm(pInfo->AS_Data.f_ref, Num, 64); ++ *pValue = pInfo->AS_Data.f_LO1; ++ } ++ break; ++ ++ /* LO1 minimum step size */ ++ case MT2063_LO1_STEPSIZE: ++ *pValue = pInfo->AS_Data.f_LO1_Step; ++ break; ++ ++ /* LO1 FracN keep-out region */ ++ case MT2063_LO1_FRACN_AVOID: ++ *pValue = pInfo->AS_Data.f_LO1_FracN_Avoid; ++ break; ++ ++ /* Current 1st IF in use */ ++ case MT2063_IF1_ACTUAL: ++ *pValue = pInfo->f_IF1_actual; ++ break; ++ ++ /* Requested 1st IF */ ++ case MT2063_IF1_REQUEST: ++ *pValue = pInfo->AS_Data.f_if1_Request; ++ break; ++ ++ /* Center of 1st IF SAW filter */ ++ case MT2063_IF1_CENTER: ++ *pValue = pInfo->AS_Data.f_if1_Center; ++ break; ++ ++ /* Bandwidth of 1st IF SAW filter */ ++ case MT2063_IF1_BW: ++ *pValue = pInfo->AS_Data.f_if1_bw; ++ break; ++ ++ /* zero-IF bandwidth */ ++ case MT2063_ZIF_BW: ++ *pValue = pInfo->AS_Data.f_zif_bw; ++ break; ++ ++ /* LO2 Frequency */ ++ case MT2063_LO2_FREQ: ++ { ++ /* Read the actual tuner register values for LO2C_1, LO2C_2 and LO2C_3 */ ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, LO2C_1, &pInfo->reg[LO2C_1], 3); ++ Div = (pInfo->reg[LO2C_1] & 0xFE ) >> 1; ++ Num = ((pInfo->reg[LO2C_1] & 0x01 ) << 12) | (pInfo->reg[LO2C_2] << 4) | (pInfo->reg[LO2C_3] & 0x00F); ++ pInfo->AS_Data.f_LO2 = (pInfo->AS_Data.f_ref * Div) + fLO_FractionalTerm(pInfo->AS_Data.f_ref, Num, 8191); ++ *pValue = pInfo->AS_Data.f_LO2; ++ } ++ break; ++ ++ /* LO2 minimum step size */ ++ case MT2063_LO2_STEPSIZE: ++ *pValue = pInfo->AS_Data.f_LO2_Step; ++ break; ++ ++ /* LO2 FracN keep-out region */ ++ case MT2063_LO2_FRACN_AVOID: ++ *pValue = pInfo->AS_Data.f_LO2_FracN_Avoid; ++ break; ++ ++ /* output center frequency */ ++ case MT2063_OUTPUT_FREQ: ++ *pValue = pInfo->AS_Data.f_out; ++ break; ++ ++ /* output bandwidth */ ++ case MT2063_OUTPUT_BW: ++ *pValue = pInfo->AS_Data.f_out_bw - 750000; ++ break; ++ ++ /* min inter-tuner LO separation */ ++ case MT2063_LO_SEPARATION: ++ *pValue = pInfo->AS_Data.f_min_LO_Separation; ++ break; ++ ++ /* ID of avoid-spurs algorithm in use */ ++ case MT2063_AS_ALG: ++ *pValue = pInfo->AS_Data.nAS_Algorithm; ++ break; ++ ++ /* max # of intra-tuner harmonics */ ++ case MT2063_MAX_HARM1: ++ *pValue = pInfo->AS_Data.maxH1; ++ break; ++ ++ /* max # of inter-tuner harmonics */ ++ case MT2063_MAX_HARM2: ++ *pValue = pInfo->AS_Data.maxH2; ++ break; ++ ++ /* # of 1st IF exclusion zones */ ++ case MT2063_EXCL_ZONES: ++ *pValue = pInfo->AS_Data.nZones; ++ break; ++ ++ /* # of spurs found/avoided */ ++ case MT2063_NUM_SPURS: ++ *pValue = pInfo->AS_Data.nSpursFound; ++ break; ++ ++ /* >0 spurs avoided */ ++ case MT2063_SPUR_AVOIDED: ++ *pValue = pInfo->AS_Data.bSpurAvoided; ++ break; ++ ++ /* >0 spurs in output (mathematically) */ ++ case MT2063_SPUR_PRESENT: ++ *pValue = pInfo->AS_Data.bSpurPresent; ++ break; ++ ++ /* Predefined receiver setup combination */ ++ case MT2063_RCVR_MODE: ++ *pValue = pInfo->rcvr_mode; ++ break; ++ ++ case MT2063_PD1: ++ case MT2063_PD2: ++ { ++ reg = pInfo->reg[BYP_CTRL] | ( (param == MT2063_PD1 ? 0x01 : 0x03) & 0x03 ); /* PD1 vs PD2 */ ++ ++ /* Initiate ADC output to reg 0x0A */ ++ if (reg != pInfo->reg[BYP_CTRL]) ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, BYP_CTRL, ®, 1); ++ ++ if (MT_IS_ERROR(status)) ++ return (UData_t)(status); ++ ++ for (i=0; i<8; i++) { ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, ADC_OUT, &pInfo->reg[ADC_OUT], 1); ++ ++ if (MT_NO_ERROR(status)) ++ *pValue += (pInfo->reg[ADC_OUT] >> 2); /* only want 6 MSB's out of 8 */ ++ else ++ break; /* break for-loop */ ++ } ++ *pValue /= (i+1); /* divide by number of reads */ ++ ++ /* Restore value of Register BYP_CTRL */ ++ if (reg != pInfo->reg[BYP_CTRL]) ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, BYP_CTRL, &pInfo->reg[BYP_CTRL], 1); ++ } ++ break; ++ ++ ++ /* Get LNA RIN value */ ++ case MT2063_LNA_RIN: ++ status |= (pInfo->reg[CTRL_2C] & 0x03); ++ break; ++ ++ /* Get LNA target value */ ++ case MT2063_LNA_TGT: ++ status |= (pInfo->reg[LNA_TGT] & 0x3f); ++ break; ++ ++ /* Get PD1 target value */ ++ case MT2063_PD1_TGT: ++ status |= (pInfo->reg[PD1_TGT] & 0x3f); ++ break; ++ ++ /* Get PD2 target value */ ++ case MT2063_PD2_TGT: ++ status |= (pInfo->reg[PD2_TGT] & 0x3f); ++ break; ++ ++ /* Get LNA attenuator code */ ++ case MT2063_ACLNA: ++ { ++ status |= MT2063_GetReg(pInfo, XO_STATUS, ®); ++ *pValue = reg & 0x1f; ++ } ++ break; ++ ++ /* Get RF attenuator code */ ++ case MT2063_ACRF: ++ { ++ status |= MT2063_GetReg(pInfo, RF_STATUS, ®); ++ *pValue = reg & 0x1f; ++ } ++ break; ++ ++ /* Get FIF attenuator code */ ++ case MT2063_ACFIF: ++ { ++ status |= MT2063_GetReg(pInfo, FIF_STATUS, ®); ++ *pValue = reg & 0x1f; ++ } ++ break; ++ ++ /* Get LNA attenuator limit */ ++ case MT2063_ACLNA_MAX: ++ status |= (pInfo->reg[LNA_OV] & 0x1f); ++ break; ++ ++ /* Get RF attenuator limit */ ++ case MT2063_ACRF_MAX: ++ status |= (pInfo->reg[RF_OV] & 0x1f); ++ break; ++ ++ /* Get FIF attenuator limit */ ++ case MT2063_ACFIF_MAX: ++ status |= (pInfo->reg[FIF_OV] & 0x1f); ++ break; ++ ++ /* Get current used DNC output */ ++ case MT2063_DNC_OUTPUT_ENABLE: ++ { ++ if ( (pInfo->reg[DNC_GAIN] & 0x03) == 0x03) /* if DNC1 is off */ ++ { ++ if ( (pInfo->reg[VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ ++ *pValue = (UData_t)MT2063_DNC_NONE; ++ else ++ *pValue = (UData_t)MT2063_DNC_2; ++ } ++ else /* DNC1 is on */ ++ { ++ if ( (pInfo->reg[VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ ++ *pValue = (UData_t)MT2063_DNC_1; ++ else ++ *pValue = (UData_t)MT2063_DNC_BOTH; ++ } ++ } ++ break; ++ ++ /* Get VGA Gain Code */ ++ case MT2063_VGAGC: ++ *pValue = ( (pInfo->reg[VGA_GAIN] & 0x0C) >> 2 ); ++ break; ++ ++ /* Get VGA bias current */ ++ case MT2063_VGAOI: ++ *pValue = (pInfo->reg[RSVD_31] & 0x07); ++ break; ++ ++ /* Get TAGC setting */ ++ case MT2063_TAGC: ++ *pValue = (pInfo->reg[RSVD_1E] & 0x03); ++ break; ++ ++ /* Get AMP Gain Code */ ++ case MT2063_AMPGC: ++ *pValue = (pInfo->reg[TEMP_SEL] & 0x03); ++ break; ++ ++ /* Avoid DECT Frequencies */ ++ case MT2063_AVOID_DECT: ++ *pValue = pInfo->AS_Data.avoidDECT; ++ break; ++ ++ /* Cleartune filter selection: 0 - by IC (default), 1 - by software */ ++ case MT2063_CTFILT_SW: ++ *pValue = pInfo->ctfilt_sw; ++ break; ++ ++ case MT2063_EOP: ++ default: ++ status |= MT_ARG_RANGE; ++ } ++ } ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetReg ++** ++** Description: Gets an MT2063 register. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** reg - MT2063 register/subaddress location ++** *val - MT2063 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Use this function if you need to read a register from ++** the MT2063. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetReg(Handle_t h, ++ U8Data reg, ++ U8Data* val) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (val == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, reg, &pInfo->reg[reg], 1); ++ if (MT_NO_ERROR(status)) ++ *val = pInfo->reg[reg]; ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_GetTemp ++** ++** Description: Get the MT2063 Temperature register. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** *value - value read from the register ++** ++** Binary ++** Value Returned Value Approx Temp ++** --------------------------------------------- ++** MT2063_T_0C 0000 0C ++** MT2063_T_10C 0001 10C ++** MT2063_T_20C 0010 20C ++** MT2063_T_30C 0011 30C ++** MT2063_T_40C 0100 40C ++** MT2063_T_50C 0101 50C ++** MT2063_T_60C 0110 60C ++** MT2063_T_70C 0111 70C ++** MT2063_T_80C 1000 80C ++** MT2063_T_90C 1001 90C ++** MT2063_T_100C 1010 100C ++** MT2063_T_110C 1011 110C ++** MT2063_T_120C 1100 120C ++** MT2063_T_130C 1101 130C ++** MT2063_T_140C 1110 140C ++** MT2063_T_150C 1111 150C ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_GetTemp(Handle_t h, MT2063_Temperature* value) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ if (value == MT_NULL) ++ return (UData_t)MT_ARG_NULL; ++ ++ if ((MT_NO_ERROR(status)) && ((pInfo->reg[TEMP_SEL] & 0xE0) != 0x00)) ++ { ++ pInfo->reg[TEMP_SEL] &= (0x1F); ++ status |= MT2063_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ TEMP_SEL, ++ &pInfo->reg[TEMP_SEL], ++ 1); ++ } ++ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_ReadSub(pInfo->hUserData, ++ pInfo->address, ++ TEMP_STATUS, ++ &pInfo->reg[TEMP_STATUS], ++ 1); ++ ++ if (MT_NO_ERROR(status)) ++ *value = (MT2063_Temperature) (pInfo->reg[TEMP_STATUS] >> 4); ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetUserData ++** ++** Description: Gets the user-defined data item. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** The hUserData parameter is a user-specific argument ++** that is stored internally with the other tuner- ++** specific information. ++** ++** For example, if additional arguments are needed ++** for the user to identify the device communicating ++** with the tuner, this argument can be used to supply ++** the necessary information. ++** ++** The hUserData parameter is initialized in the tuner's ++** Open function to NULL. ++** ++** See Also: MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetUserData(Handle_t h, ++ Handle_t* hUserData) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (hUserData == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (MT_NO_ERROR(status)) ++ *hUserData = pInfo->hUserData; ++ ++ return (UData_t)(status); ++} ++ ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_SetReceiverMode ++** ++** Description: Set the MT2063 receiver mode ++** ++** --------------+---------------------------------------------- ++** Mode 0 : | MT2063_CABLE_QAM ++** Mode 1 : | MT2063_CABLE_ANALOG ++** Mode 2 : | MT2063_OFFAIR_COFDM ++** Mode 3 : | MT2063_OFFAIR_COFDM_SAWLESS ++** Mode 4 : | MT2063_OFFAIR_ANALOG ++** Mode 5 : | MT2063_OFFAIR_8VSB ++** --------------+----+----+----+----+-----+-------------------- ++** (DNC1GC & DNC2GC are the values, which are used, when the specific ++** DNC Output is selected, the other is always off) ++** ++** |<---------- Mode -------------->| ++** Reg Field | 0 | 1 | 2 | 3 | 4 | 5 | ++** ------------+-----+-----+-----+-----+-----+-----+ ++** RFAGCen | OFF | OFF | OFF | OFF | OFF | OFF | ++** LNARin | 0 | 0 | 3 | 3 | 3 | 3 | ++** FIFFQen | 1 | 1 | 1 | 1 | 1 | 1 | ++** FIFFq | 0 | 0 | 0 | 0 | 0 | 0 | ++** DNC1gc | 0 | 0 | 0 | 0 | 0 | 0 | ++** DNC2gc | 0 | 0 | 0 | 0 | 0 | 0 | ++** LNA max Atn | 31 | 31 | 31 | 31 | 31 | 31 | ++** LNA Target | 44 | 43 | 43 | 43 | 43 | 43 | ++** ign RF Ovl | 0 | 0 | 0 | 0 | 0 | 0 | ++** RF max Atn | 31 | 31 | 31 | 31 | 31 | 31 | ++** PD1 Target | 36 | 36 | 38 | 38 | 36 | 38 | ++** ign FIF Ovl | 0 | 0 | 0 | 0 | 0 | 0 | ++** FIF max Atn | 29 | 0 | 29 | 29 | 0 | 29 | ++** PD2 Target | 40 | 34 | 38 | 42 | 34 | 38 | ++** ++** ++** Parameters: pInfo - ptr to MT2063_Info_t structure ++** Mode - desired reciever mode ++** ++** Usage: status = MT2063_SetReceiverMode(hMT2063, Mode); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: MT2063_SetReg - Write a byte of data to a HW register. ++** Assumes that the tuner cache is valid. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** N/A 01-10-2007 PINZ Added additional GCU Settings, FIFF Calib will be triggered ++** 155 10-01-2007 DAD Ver 1.06: Add receiver mode for SECAM positive ++** modulation ++** (MT2063_ANALOG_TV_POS_NO_RFAGC_MODE) ++** N/A 10-22-2007 PINZ Ver 1.07: Changed some Registers at init to have ++** the same settings as with MT Launcher ++** N/A 10-30-2007 PINZ Add SetParam VGAGC & VGAOI ++** Add SetParam DNC_OUTPUT_ENABLE ++** Removed VGAGC from receiver mode, ++** default now 1 ++** N/A 10-31-2007 PINZ Ver 1.08: Add SetParam TAGC, removed from rcvr-mode ++** Add SetParam AMPGC, removed from rcvr-mode ++** Corrected names of GCU values ++** reorganized receiver modes, removed, ++** (MT2063_ANALOG_TV_POS_NO_RFAGC_MODE) ++** Actualized Receiver-Mode values ++** N/A 11-12-2007 PINZ Ver 1.09: Actualized Receiver-Mode values ++** N/A 11-27-2007 PINZ Improved buffered writing ++** 01-03-2008 PINZ Ver 1.10: Added a trigger of BYPATNUP for ++** correct wakeup of the LNA after shutdown ++** Set AFCsd = 1 as default ++** Changed CAP1sel default ++** 01-14-2008 PINZ Ver 1.11: Updated gain settings ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 11-05-2008 PINZ Ver 1.25: Bugfix, update rcvr_mode var earlier. ++** N/A I 02-26-2009 PINZ Ver 1.30: RCVRmode 2: acfifmax 29->0, pd2tgt 33->34 ++** RCVRmode 4: acfifmax 29->0, pd2tgt 30->34 ++** ++******************************************************************************/ ++static UData_t MT2063_SetReceiverMode(MT2063_Info_t* pInfo, MT2063_RCVR_MODES Mode) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data val; ++ UData_t longval; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ if (Mode >= MT2063_NUM_RCVR_MODES) ++ status = MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ pInfo->rcvr_mode = Mode; ++ ++ /* RFAGCen */ ++ if (MT_NO_ERROR(status)) ++ { ++ val = (pInfo->reg[PD1_TGT] & (U8Data)~0x40) | (RFAGCEN[Mode] ? 0x40 : 0x00); ++ if( pInfo->reg[PD1_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, PD1_TGT, val); ++ } ++ } ++ ++ /* LNARin */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_LNA_RIN, LNARIN[Mode]); ++ } ++ ++ /* FIFFQEN and FIFFQ */ ++ if (MT_NO_ERROR(status)) ++ { ++ val = (pInfo->reg[FIFF_CTRL2] & (U8Data)~0xF0) | (FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4); ++ if( pInfo->reg[FIFF_CTRL2] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, FIFF_CTRL2, val); ++ /* trigger FIFF calibration, needed after changing FIFFQ */ ++ val = (pInfo->reg[FIFF_CTRL] | (U8Data)0x01); ++ status |= MT2063_SetReg(pInfo, FIFF_CTRL, val); ++ val = (pInfo->reg[FIFF_CTRL] & (U8Data)~0x01); ++ status |= MT2063_SetReg(pInfo, FIFF_CTRL, val); ++ } ++ } ++ ++ /* DNC1GC & DNC2GC */ ++ status |= MT2063_GetParam(pInfo, MT2063_DNC_OUTPUT_ENABLE, &longval); ++ status |= MT2063_SetParam(pInfo, MT2063_DNC_OUTPUT_ENABLE, longval); ++ ++ /* acLNAmax */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_ACLNA_MAX, ACLNAMAX[Mode]); ++ } ++ ++ /* LNATGT */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_LNA_TGT, LNATGT[Mode]); ++ } ++ ++ /* ACRF */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_ACRF_MAX, ACRFMAX[Mode]); ++ } ++ ++ /* PD1TGT */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_PD1_TGT, PD1TGT[Mode]); ++ } ++ ++ /* FIFATN */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_ACFIF_MAX, ACFIFMAX[Mode]); ++ } ++ ++ /* PD2TGT */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_SetParam(pInfo, MT2063_PD2_TGT, PD2TGT[Mode]); ++ } ++ ++ /* Ignore ATN Overload */ ++ if (MT_NO_ERROR(status)) ++ { ++ val = (pInfo->reg[LNA_TGT] & (U8Data)~0x80) | (RFOVDIS[Mode] ? 0x80 : 0x00); ++ if( pInfo->reg[LNA_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, LNA_TGT, val); ++ } ++ } ++ ++ /* Ignore FIF Overload */ ++ if (MT_NO_ERROR(status)) ++ { ++ val = (pInfo->reg[PD1_TGT] & (U8Data)~0x80) | (FIFOVDIS[Mode] ? 0x80 : 0x00); ++ if( pInfo->reg[PD1_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, PD1_TGT, val); ++ } ++ } ++ ++ ++ return (UData_t)(status); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_ReInit ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 148 09-04-2007 RSK Ver 1.02: Corrected logic of Reg 3B Reference ++** 153 09-07-2007 RSK Ver 1.03: Lock Time improvements ++** N/A 10-31-2007 PINZ Ver 1.08: Changed values suitable to rcvr-mode 0 ++** N/A 11-12-2007 PINZ Ver 1.09: Changed values suitable to rcvr-mode 0 ++** N/A 01-03-2007 PINZ Ver 1.10: Added AFCsd = 1 into defaults ++** N/A 01-04-2007 PINZ Ver 1.10: Changed CAP1sel default ++** 01-14-2008 PINZ Ver 1.11: Updated gain settings ++** 03-18-2008 PINZ Ver 1.13: Added Support for B3 ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 08-05-2008 PINZ Ver 1.20: Disable SDEXT pin while MT2063_ReInit ++** with MT2063B3 ++** N/A I 03-02-2009 PINZ Ver 1.31: new default Fout 43.75 -> 36.125MHz ++** new default Output-BW 6 -> 8MHz ++** new default Stepsize 50 -> 62.5kHz ++** new default Fin 651 -> 666 MHz ++** Changed order of receiver-mode init ++** N/A I 04-29-2009 PINZ Ver 1.34: Optimized ReInit function ++** ++******************************************************************************/ ++UData_t MT2063_ReInit(Handle_t h) ++{ ++ U8Data all_resets = 0xF0; /* reset/load bits */ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ UData_t rev=0; ++ ++ U8Data MT2063B0_defaults[] = { /* Reg, Value */ ++ 0x19, 0x05, ++ 0x1B, 0x1D, ++ 0x1C, 0x1F, ++ 0x1D, 0x0F, ++ 0x1E, 0x3F, ++ 0x1F, 0x0F, ++ 0x20, 0x3F, ++ 0x22, 0x21, ++ 0x23, 0x3F, ++ 0x24, 0x20, ++ 0x25, 0x3F, ++ 0x27, 0xEE, ++ 0x2C, 0x27, /* bit at 0x20 is cleared below */ ++ 0x30, 0x03, ++ 0x2C, 0x07, /* bit at 0x20 is cleared here */ ++ 0x2D, 0x87, ++ 0x2E, 0xAA, ++ 0x28, 0xE1, /* Set the FIFCrst bit here */ ++ 0x28, 0xE0, /* Clear the FIFCrst bit here */ ++ 0x00 }; ++ ++ /* writing 0x05 0xf0 sw-resets all registers, so we write only needed changes */ ++ U8Data MT2063B1_defaults[] = { /* Reg, Value */ ++ 0x05, 0xF0, ++ 0x11, 0x10, /* New Enable AFCsd */ ++ 0x19, 0x05, ++ 0x1A, 0x6C, ++ 0x1B, 0x24, ++ 0x1C, 0x28, ++ 0x1D, 0x8F, ++ 0x1E, 0x14, ++ 0x1F, 0x8F, ++ 0x20, 0x57, ++ 0x22, 0x21, /* New - ver 1.03 */ ++ 0x23, 0x3C, /* New - ver 1.10 */ ++ 0x24, 0x20, /* New - ver 1.03 */ ++ 0x2C, 0x24, /* bit at 0x20 is cleared below */ ++ 0x2D, 0x87, /* FIFFQ=0 */ ++ 0x2F, 0xF3, ++ 0x30, 0x0C, /* New - ver 1.11 */ ++ 0x31, 0x1B, /* New - ver 1.11 */ ++ 0x2C, 0x04, /* bit at 0x20 is cleared here */ ++ 0x28, 0xE1, /* Set the FIFCrst bit here */ ++ 0x28, 0xE0, /* Clear the FIFCrst bit here */ ++ 0x00 }; ++ ++ /* writing 0x05 0xf0 sw-resets all registers, so we write only needed changes */ ++ U8Data MT2063B3_defaults[] = { /* Reg, Value */ ++ 0x05, 0xF0, ++ 0x11, 0x13, /* disable SDEXT/INTsd for init */ ++ 0x2C, 0x24, /* bit at 0x20 is cleared below */ ++ 0x2C, 0x04, /* bit at 0x20 is cleared here */ ++ 0x28, 0xE1, /* Set the FIFCrst bit here */ ++ 0x28, 0xE0, /* Clear the FIFCrst bit here */ ++ 0x00 }; ++ ++ U8Data *def=MT2063B3_defaults; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ /* Read the Part/Rev code from the tuner */ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, PART_REV, pInfo->reg, 1); ++ ++ /* Read the Part/Rev codes (2nd byte) from the tuner */ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, RSVD_3B, &pInfo->reg[RSVD_3B], 2); ++ ++ if (MT_NO_ERROR(status)) { /* Check the part/rev code */ ++ switch (pInfo->reg[PART_REV]) { ++ case 0x9e : { ++ if ( (pInfo->reg[RSVD_3C] & 0x18) == 0x08 ) { ++ rev = MT2063_XX; ++ status |= MT_TUNER_ID_ERR; ++ } ++ else { ++ rev = MT2063_B3; ++ def = MT2063B3_defaults; ++ } ++ break; ++ } ++ case 0x9c : { ++ rev = MT2063_B1; ++ def = MT2063B1_defaults; ++ break; ++ } ++ case 0x9b : { ++ rev = MT2063_B0; ++ def = MT2063B0_defaults; ++ break; ++ } ++ default : { ++ rev = MT2063_XX; ++ status |= MT_TUNER_ID_ERR; ++ break; ++ } ++ } ++ } ++ ++ if (MT_NO_ERROR(status) /* Check the 2nd part/rev code */ ++ && ((pInfo->reg[RSVD_3B] & 0x80) != 0x00)) /* b7 != 0 ==> NOT MT2063 */ ++ status |= MT_TUNER_ID_ERR; /* Wrong tuner Part/Rev code */ ++ ++ /* Reset the tuner */ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ LO2CQ_3, ++ &all_resets, ++ 1); ++ ++ while (MT_NO_ERROR(status) && *def) ++ { ++ U8Data reg = *def++; ++ U8Data val = *def++; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, reg, &val, 1); ++ } ++ ++ /* Wait for FIFF location to complete. */ ++ if (MT_NO_ERROR(status)) ++ { ++ UData_t FCRUN = 1; ++ SData_t maxReads = 10; ++ while (MT_NO_ERROR(status) && (FCRUN != 0) && (maxReads-- > 0)) ++ { ++ MT2063_Sleep(pInfo->hUserData, 2); ++ status |= MT2063_ReadSub(pInfo->hUserData, ++ pInfo->address, ++ XO_STATUS, ++ &pInfo->reg[XO_STATUS], ++ 1); ++ FCRUN = (pInfo->reg[XO_STATUS] & 0x40) >> 6; ++ } ++ ++ if (FCRUN != 0) ++ status |= MT_TUNER_INIT_ERR | MT_TUNER_TIMEOUT; ++ ++ if (MT_NO_ERROR(status)) /* Re-read FIFFC value */ ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, FIFFC, &pInfo->reg[FIFFC], 1); ++ } ++ ++ /* Read back all the registers from the tuner */ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_ReadSub(pInfo->hUserData, ++ pInfo->address, ++ PART_REV, ++ pInfo->reg, ++ END_REGS); ++ ++ if (MT_NO_ERROR(status)) ++ { ++ /* Initialize the tuner state. */ ++ pInfo->version = MT2063_VERSION; ++ pInfo->tuner_id = rev; ++ pInfo->AS_Data.f_ref = REF_FREQ; ++ pInfo->AS_Data.f_if1_Center = (pInfo->AS_Data.f_ref / 8) * ((UData_t) pInfo->reg[FIFFC] + 640); ++ pInfo->AS_Data.f_if1_bw = IF1_BW; ++ pInfo->AS_Data.f_out = 36125000; ++ pInfo->AS_Data.f_out_bw = 8000000; ++ pInfo->AS_Data.f_zif_bw = ZIF_BW; ++ pInfo->AS_Data.f_LO1_Step = pInfo->AS_Data.f_ref / 64; ++ pInfo->AS_Data.f_LO2_Step = TUNE_STEP_SIZE; ++ pInfo->AS_Data.maxH1 = MAX_HARMONICS_1; ++ pInfo->AS_Data.maxH2 = MAX_HARMONICS_2; ++ pInfo->AS_Data.f_min_LO_Separation = MIN_LO_SEP; ++ pInfo->AS_Data.f_if1_Request = pInfo->AS_Data.f_if1_Center; ++ pInfo->AS_Data.f_LO1 = 2181000000U; ++ pInfo->AS_Data.f_LO2 = 1486249786; ++ pInfo->f_IF1_actual = pInfo->AS_Data.f_if1_Center; ++ pInfo->AS_Data.f_in = pInfo->AS_Data.f_LO1 - pInfo->f_IF1_actual; ++ pInfo->AS_Data.f_LO1_FracN_Avoid = LO1_FRACN_AVOID; ++ pInfo->AS_Data.f_LO2_FracN_Avoid = LO2_FRACN_AVOID; ++ pInfo->num_regs = END_REGS; ++ pInfo->AS_Data.avoidDECT = MT_AVOID_BOTH; ++ pInfo->ctfilt_sw = 1; ++ } ++ ++ if (MT_NO_ERROR(status)) ++ { ++ pInfo->CTFiltMax[ 0] = 69422000; ++ pInfo->CTFiltMax[ 1] = 106211000; ++ pInfo->CTFiltMax[ 2] = 140427000; ++ pInfo->CTFiltMax[ 3] = 177240000; ++ pInfo->CTFiltMax[ 4] = 213091000; ++ pInfo->CTFiltMax[ 5] = 241378000; ++ pInfo->CTFiltMax[ 6] = 274596000; ++ pInfo->CTFiltMax[ 7] = 309696000; ++ pInfo->CTFiltMax[ 8] = 342398000; ++ pInfo->CTFiltMax[ 9] = 378728000; ++ pInfo->CTFiltMax[10] = 416053000; ++ pInfo->CTFiltMax[11] = 456693000; ++ pInfo->CTFiltMax[12] = 496105000; ++ pInfo->CTFiltMax[13] = 534448000; ++ pInfo->CTFiltMax[14] = 572893000; ++ pInfo->CTFiltMax[15] = 603218000; ++ pInfo->CTFiltMax[16] = 632650000; ++ pInfo->CTFiltMax[17] = 668229000; ++ pInfo->CTFiltMax[18] = 710828000; ++ pInfo->CTFiltMax[19] = 735135000; ++ pInfo->CTFiltMax[20] = 765601000; ++ pInfo->CTFiltMax[21] = 809919000; ++ pInfo->CTFiltMax[22] = 842538000; ++ pInfo->CTFiltMax[23] = 863353000; ++ pInfo->CTFiltMax[24] = 911285000; ++ pInfo->CTFiltMax[25] = 942310000; ++ pInfo->CTFiltMax[26] = 977602000; ++ pInfo->CTFiltMax[27] = 1015100000; ++ pInfo->CTFiltMax[28] = 1053415000; ++ pInfo->CTFiltMax[29] = 1098330000; ++ pInfo->CTFiltMax[30] = 1138990000; ++ } ++ ++ /* ++ ** Fetch the FCU osc value and use it and the fRef value to ++ ** scale all of the Band Max values ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ UData_t fcu_osc; ++ UData_t i; ++ ++ pInfo->reg[CTUNE_CTRL] = 0x0A; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, CTUNE_CTRL, &pInfo->reg[CTUNE_CTRL], 1); ++ ++ /* Read the ClearTune filter calibration value */ ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, FIFFC, &pInfo->reg[FIFFC], 1); ++ fcu_osc = pInfo->reg[FIFFC]; ++ ++ pInfo->reg[CTUNE_CTRL] = 0x00; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, CTUNE_CTRL, &pInfo->reg[CTUNE_CTRL], 1); ++ ++ /* Adjust each of the values in the ClearTune filter cross-over table */ ++ for (i = 0; i < 31; i++) ++ { ++ if (fcu_osc>127) pInfo->CTFiltMax[i] += ( fcu_osc - 128 ) * df_dosc[i]; ++ else pInfo->CTFiltMax[i] -= ( 128 - fcu_osc ) * df_dosc[i]; ++ } ++ } ++ ++ /* ++ ** Set the default receiver mode ++ ** ++ */ ++ ++// if (MT_NO_ERROR(status) ) ++// { ++// status |= MT2063_SetParam(h,MT2063_RCVR_MODE,MT2063_CABLE_QAM); ++// } ++ ++ ++ /* ++ ** Tune to the default frequency ++ ** ++ */ ++ ++// if (MT_NO_ERROR(status) ) ++// { ++// status |= MT2063_Tune(h,DEF_FIN_FREQ); ++// } ++ ++ /* ++ ** Enable SDEXT pin again ++ ** ++ */ ++ ++ if ( (MT_NO_ERROR(status)) && (pInfo->tuner_id >= MT2063_B3) ) ++ { ++ status |= MT2063_SetReg(h,PWR_1,0x1b); ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_SetGPIO ++** ++** Description: Modify the MT2063 GPIO value. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** gpio_id - Selects GPIO0, GPIO1 or GPIO2 ++** attr - Selects input readback, I/O direction or ++** output value ++** value - value to set GPIO pin 15, 14 or 19 ++** ++** Usage: status = MT2063_SetGPIO(hMT2063, MT2063_GPIO1, MT2063_GPIO_OUT, 1); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_SetGPIO(Handle_t h, MT2063_GPIO_ID gpio_id, ++ MT2063_GPIO_Attr attr, ++ UData_t value) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data regno; ++ SData_t shift; ++ const U8Data GPIOreg[3] = {0x15, 0x19, 0x18}; ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ regno = GPIOreg[attr]; ++ ++ shift = (SData_t)(gpio_id - MT2063_GPIO0 + 5); ++ ++ if (value & 0x01) ++ pInfo->reg[regno] |= (0x01 << shift); ++ else ++ pInfo->reg[regno] &= ~(0x01 << shift); ++ status = MT2063_WriteSub(pInfo->hUserData, pInfo->address, regno, &pInfo->reg[regno], 1); ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetParam ++** ++** Description: Sets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm. You can override many of the tuning ++** algorithm defaults using this function. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2063_Param) ++** nValue - value to be set ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2063_SRO_FREQ crystal frequency ++** MT2063_STEPSIZE minimum tuning step size ++** MT2063_LO1_FREQ LO1 frequency ++** MT2063_LO1_STEPSIZE LO1 minimum step size ++** MT2063_LO1_FRACN_AVOID LO1 FracN keep-out region ++** MT2063_IF1_REQUEST Requested 1st IF ++** MT2063_ZIF_BW zero-IF bandwidth ++** MT2063_LO2_FREQ LO2 frequency ++** MT2063_LO2_STEPSIZE LO2 minimum step size ++** MT2063_LO2_FRACN_AVOID LO2 FracN keep-out region ++** MT2063_OUTPUT_FREQ output center frequency ++** MT2063_OUTPUT_BW output bandwidth ++** MT2063_LO_SEPARATION min inter-tuner LO separation ++** MT2063_MAX_HARM1 max # of intra-tuner harmonics ++** MT2063_MAX_HARM2 max # of inter-tuner harmonics ++** MT2063_RCVR_MODE Predefined modes ++** MT2063_LNA_RIN Set LNA Rin (*) ++** MT2063_LNA_TGT Set target power level at LNA (*) ++** MT2063_PD1_TGT Set target power level at PD1 (*) ++** MT2063_PD2_TGT Set target power level at PD2 (*) ++** MT2063_ACLNA_MAX LNA attenuator limit (*) ++** MT2063_ACRF_MAX RF attenuator limit (*) ++** MT2063_ACFIF_MAX FIF attenuator limit (*) ++** MT2063_DNC_OUTPUT_ENABLE DNC output selection ++** MT2063_VGAGC VGA gain code ++** MT2063_VGAOI VGA output current ++** MT2063_TAGC TAGC setting ++** MT2063_AMPGC AMP gain code ++** MT2063_AVOID_DECT Avoid DECT Frequencies ++** MT2063_CTFILT_SW Cleartune filter selection ++** ++** (*) This parameter is set by MT2063_RCVR_MODE, do not call ++** additionally. ++** ++** Usage: status |= MT2063_SetParam(hMT2063, ++** MT2063_STEPSIZE, ++** 50000); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** or set value out of range ++** or non-writable parameter ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** See Also: MT2063_GetParam, MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 154 09-13-2007 RSK Ver 1.05: Get/SetParam changes for LOx_FREQ ++** 10-31-2007 PINZ Ver 1.08: Get/SetParam add VGAGC, VGAOI, AMPGC, TAGC ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 175 I 06-06-2008 PINZ Ver 1.16: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 01-20-2009 PINZ Ver 1.28: Fixed a compare to avoid compiler warning ++** ++****************************************************************************/ ++UData_t MT2063_SetParam(Handle_t h, ++ MT2063_Param param, ++ UData_t nValue) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data val=0; ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ switch (param) ++ { ++ /* crystal frequency */ ++ case MT2063_SRO_FREQ: ++ pInfo->AS_Data.f_ref = nValue; ++ pInfo->AS_Data.f_LO1_FracN_Avoid = 0; ++ pInfo->AS_Data.f_LO2_FracN_Avoid = nValue / 80 - 1; ++ pInfo->AS_Data.f_LO1_Step = nValue / 64; ++ pInfo->AS_Data.f_if1_Center = (pInfo->AS_Data.f_ref / 8) * (pInfo->reg[FIFFC] + 640); ++ break; ++ ++ /* minimum tuning step size */ ++ case MT2063_STEPSIZE: ++ pInfo->AS_Data.f_LO2_Step = nValue; ++ break; ++ ++ ++ /* LO1 frequency */ ++ case MT2063_LO1_FREQ: ++ { ++ /* Note: LO1 and LO2 are BOTH written at toggle of LDLOos */ ++ /* Capture the Divider and Numerator portions of other LO */ ++ U8Data tempLO2CQ[3]; ++ U8Data tempLO2C[3]; ++ U8Data tmpOneShot; ++ UData_t Div, FracN; ++ U8Data restore = 0; ++ ++ /* Buffer the queue for restoration later and get actual LO2 values. */ ++ status |= MT2063_ReadSub (pInfo->hUserData, pInfo->address, LO2CQ_1, &(tempLO2CQ[0]), 3); ++ status |= MT2063_ReadSub (pInfo->hUserData, pInfo->address, LO2C_1, &(tempLO2C[0]), 3); ++ ++ /* clear the one-shot bits */ ++ tempLO2CQ[2] = tempLO2CQ[2] & 0x0F; ++ tempLO2C[2] = tempLO2C[2] & 0x0F; ++ ++ /* only write the queue values if they are different from the actual. */ ++ if( ( tempLO2CQ[0] != tempLO2C[0] ) || ++ ( tempLO2CQ[1] != tempLO2C[1] ) || ++ ( tempLO2CQ[2] != tempLO2C[2] ) ) ++ { ++ /* put actual LO2 value into queue (with 0 in one-shot bits) */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO2CQ_1, &(tempLO2C[0]), 3); ++ ++ if( status == MT_OK ) ++ { ++ /* cache the bytes just written. */ ++ pInfo->reg[LO2CQ_1] = tempLO2C[0]; ++ pInfo->reg[LO2CQ_2] = tempLO2C[1]; ++ pInfo->reg[LO2CQ_3] = tempLO2C[2]; ++ } ++ restore = 1; ++ } ++ ++ /* Calculate the Divider and Numberator components of LO1 */ ++ status = CalcLO1Mult(&Div, &FracN, nValue, pInfo->AS_Data.f_ref/64, pInfo->AS_Data.f_ref); ++ pInfo->reg[LO1CQ_1] = (U8Data)(Div & 0x00FF); ++ pInfo->reg[LO1CQ_2] = (U8Data)(FracN); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO1CQ_1, &pInfo->reg[LO1CQ_1], 2); ++ ++ /* set the one-shot bit to load the pair of LO values */ ++ tmpOneShot = tempLO2CQ[2] | 0xE0; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO2CQ_3, &tmpOneShot, 1); ++ ++ /* only restore the queue values if they were different from the actual. */ ++ if( restore ) ++ { ++ /* put actual LO2 value into queue (0 in one-shot bits) */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO2CQ_1, &(tempLO2CQ[0]), 3); ++ ++ /* cache the bytes just written. */ ++ pInfo->reg[LO2CQ_1] = tempLO2CQ[0]; ++ pInfo->reg[LO2CQ_2] = tempLO2CQ[1]; ++ pInfo->reg[LO2CQ_3] = tempLO2CQ[2]; ++ } ++ ++ status |= MT2063_GetParam( pInfo->hUserData, MT2063_LO1_FREQ, &pInfo->AS_Data.f_LO1 ); ++ } ++ break; ++ ++ /* LO1 minimum step size */ ++ case MT2063_LO1_STEPSIZE: ++ pInfo->AS_Data.f_LO1_Step = nValue; ++ break; ++ ++ /* LO1 FracN keep-out region */ ++ case MT2063_LO1_FRACN_AVOID: ++ pInfo->AS_Data.f_LO1_FracN_Avoid = nValue; ++ break; ++ ++ /* Requested 1st IF */ ++ case MT2063_IF1_REQUEST: ++ pInfo->AS_Data.f_if1_Request = nValue; ++ break; ++ ++ /* zero-IF bandwidth */ ++ case MT2063_ZIF_BW: ++ pInfo->AS_Data.f_zif_bw = nValue; ++ break; ++ ++ /* LO2 frequency */ ++ case MT2063_LO2_FREQ: ++ { ++ /* Note: LO1 and LO2 are BOTH written at toggle of LDLOos */ ++ /* Capture the Divider and Numerator portions of other LO */ ++ U8Data tempLO1CQ[2]; ++ U8Data tempLO1C[2]; ++ UData_t Div2; ++ UData_t FracN2; ++ U8Data tmpOneShot; ++ U8Data restore = 0; ++ ++ /* Buffer the queue for restoration later and get actual LO2 values. */ ++ status |= MT2063_ReadSub (pInfo->hUserData, pInfo->address, LO1CQ_1, &(tempLO1CQ[0]), 2); ++ status |= MT2063_ReadSub (pInfo->hUserData, pInfo->address, LO1C_1, &(tempLO1C[0]), 2); ++ ++ /* only write the queue values if they are different from the actual. */ ++ if( (tempLO1CQ[0] != tempLO1C[0]) || (tempLO1CQ[1] != tempLO1C[1]) ) ++ { ++ /* put actual LO1 value into queue */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO1CQ_1, &(tempLO1C[0]), 2); ++ ++ /* cache the bytes just written. */ ++ pInfo->reg[LO1CQ_1] = tempLO1C[0]; ++ pInfo->reg[LO1CQ_2] = tempLO1C[1]; ++ restore = 1; ++ } ++ ++ /* Calculate the Divider and Numberator components of LO2 */ ++ status |= CalcLO2Mult(&Div2, &FracN2, nValue, pInfo->AS_Data.f_ref/8191, pInfo->AS_Data.f_ref); ++ pInfo->reg[LO2CQ_1] = (U8Data)((Div2 << 1) | ((FracN2 >> 12) & 0x01) ) & 0xFF; ++ pInfo->reg[LO2CQ_2] = (U8Data)((FracN2 >> 4) & 0xFF); ++ pInfo->reg[LO2CQ_3] = (U8Data)((FracN2 & 0x0F) ); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO1CQ_1, &pInfo->reg[LO1CQ_1], 3); ++ ++ /* set the one-shot bit to load the LO values */ ++ tmpOneShot = pInfo->reg[LO2CQ_3] | 0xE0; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO2CQ_3, &tmpOneShot, 1); ++ ++ /* only restore LO1 queue value if they were different from the actual. */ ++ if( restore ) ++ { ++ /* put previous LO1 queue value back into queue */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO1CQ_1, &(tempLO1CQ[0]), 2); ++ ++ /* cache the bytes just written. */ ++ pInfo->reg[LO1CQ_1] = tempLO1CQ[0]; ++ pInfo->reg[LO1CQ_2] = tempLO1CQ[1]; ++ } ++ ++ status |= MT2063_GetParam( pInfo->hUserData, MT2063_LO2_FREQ, &pInfo->AS_Data.f_LO2 ); ++ } ++ break; ++ ++ /* LO2 minimum step size */ ++ case MT2063_LO2_STEPSIZE: ++ pInfo->AS_Data.f_LO2_Step = nValue; ++ break; ++ ++ /* LO2 FracN keep-out region */ ++ case MT2063_LO2_FRACN_AVOID: ++ pInfo->AS_Data.f_LO2_FracN_Avoid = nValue; ++ break; ++ ++ /* output center frequency */ ++ case MT2063_OUTPUT_FREQ: ++ pInfo->AS_Data.f_out = nValue; ++ break; ++ ++ /* output bandwidth */ ++ case MT2063_OUTPUT_BW: ++ pInfo->AS_Data.f_out_bw = nValue + 750000; ++ break; ++ ++ /* min inter-tuner LO separation */ ++ case MT2063_LO_SEPARATION: ++ pInfo->AS_Data.f_min_LO_Separation = nValue; ++ break; ++ ++ /* max # of intra-tuner harmonics */ ++ case MT2063_MAX_HARM1: ++ pInfo->AS_Data.maxH1 = nValue; ++ break; ++ ++ /* max # of inter-tuner harmonics */ ++ case MT2063_MAX_HARM2: ++ pInfo->AS_Data.maxH2 = nValue; ++ break; ++ ++ case MT2063_RCVR_MODE: ++ status |= MT2063_SetReceiverMode(pInfo, (MT2063_RCVR_MODES)nValue); ++ break; ++ ++ /* Set LNA Rin -- nValue is desired value */ ++ case MT2063_LNA_RIN: ++ val = (U8Data)( ( pInfo->reg[CTRL_2C] & (U8Data)~0x03) | (nValue & 0x03) ); ++ if( pInfo->reg[CTRL_2C] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, CTRL_2C, val); ++ } ++ break; ++ ++ /* Set target power level at LNA -- nValue is desired value */ ++ case MT2063_LNA_TGT: ++ val = (U8Data)( ( pInfo->reg[LNA_TGT] & (U8Data)~0x3F) | (nValue & 0x3F) ); ++ if( pInfo->reg[LNA_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, LNA_TGT, val); ++ } ++ break; ++ ++ /* Set target power level at PD1 -- nValue is desired value */ ++ case MT2063_PD1_TGT: ++ val = (U8Data)( ( pInfo->reg[PD1_TGT] & (U8Data)~0x3F) | (nValue & 0x3F) ); ++ if( pInfo->reg[PD1_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, PD1_TGT, val); ++ } ++ break; ++ ++ /* Set target power level at PD2 -- nValue is desired value */ ++ case MT2063_PD2_TGT: ++ val = (U8Data)( ( pInfo->reg[PD2_TGT] & (U8Data)~0x3F) | (nValue & 0x3F) ); ++ if( pInfo->reg[PD2_TGT] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, PD2_TGT, val); ++ } ++ break; ++ ++ /* Set LNA atten limit -- nValue is desired value */ ++ case MT2063_ACLNA_MAX: ++ val = (U8Data)( ( pInfo->reg[LNA_OV] & (U8Data)~0x1F) | (nValue & 0x1F) ); ++ if( pInfo->reg[LNA_OV] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, LNA_OV, val); ++ } ++ break; ++ ++ /* Set RF atten limit -- nValue is desired value */ ++ case MT2063_ACRF_MAX: ++ val = (U8Data)( ( pInfo->reg[RF_OV] & (U8Data)~0x1F) | (nValue & 0x1F) ); ++ if( pInfo->reg[RF_OV] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, RF_OV, val); ++ } ++ break; ++ ++ /* Set FIF atten limit -- nValue is desired value, max. 5 if no B3 */ ++ case MT2063_ACFIF_MAX: ++ if ( (pInfo->tuner_id == MT2063_B0 || pInfo->tuner_id == MT2063_B1) && nValue > 5) ++ nValue = 5; ++ val = (U8Data)( ( pInfo->reg[FIF_OV] & (U8Data)~0x1F) | (nValue & 0x1F) ); ++ if( pInfo->reg[FIF_OV] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, FIF_OV, val); ++ } ++ break; ++ ++ case MT2063_DNC_OUTPUT_ENABLE: ++ /* selects, which DNC output is used */ ++ switch ((MT2063_DNC_Output_Enable)nValue) ++ { ++ case MT2063_DNC_NONE : ++ { ++ val = (pInfo->reg[DNC_GAIN] & 0xFC ) | 0x03; /* Set DNC1GC=3 */ ++ if (pInfo->reg[DNC_GAIN] != val) ++ status |= MT2063_SetReg(h, DNC_GAIN, val); ++ ++ val = (pInfo->reg[VGA_GAIN] & 0xFC ) | 0x03; /* Set DNC2GC=3 */ ++ if (pInfo->reg[VGA_GAIN] != val) ++ status |= MT2063_SetReg(h, VGA_GAIN, val); ++ ++ val = (pInfo->reg[RSVD_20] & ~0x40); /* Set PD2MUX=0 */ ++ if (pInfo->reg[RSVD_20] != val) ++ status |= MT2063_SetReg(h, RSVD_20, val); ++ ++ break; ++ } ++ case MT2063_DNC_1 : ++ { ++ val = (pInfo->reg[DNC_GAIN] & 0xFC ) | (DNC1GC[pInfo->rcvr_mode] & 0x03); /* Set DNC1GC=x */ ++ if (pInfo->reg[DNC_GAIN] != val) ++ status |= MT2063_SetReg(h, DNC_GAIN, val); ++ ++ val = (pInfo->reg[VGA_GAIN] & 0xFC ) | 0x03; /* Set DNC2GC=3 */ ++ if (pInfo->reg[VGA_GAIN] != val) ++ status |= MT2063_SetReg(h, VGA_GAIN, val); ++ ++ val = (pInfo->reg[RSVD_20] & ~0x40); /* Set PD2MUX=0 */ ++ if (pInfo->reg[RSVD_20] != val) ++ status |= MT2063_SetReg(h, RSVD_20, val); ++ ++ break; ++ } ++ case MT2063_DNC_2 : ++ { ++ val = (pInfo->reg[DNC_GAIN] & 0xFC ) | 0x03; /* Set DNC1GC=3 */ ++ if (pInfo->reg[DNC_GAIN] != val) ++ status |= MT2063_SetReg(h, DNC_GAIN, val); ++ ++ val = (pInfo->reg[VGA_GAIN] & 0xFC ) | (DNC2GC[pInfo->rcvr_mode] & 0x03); /* Set DNC2GC=x */ ++ if (pInfo->reg[VGA_GAIN] != val) ++ status |= MT2063_SetReg(h, VGA_GAIN, val); ++ ++ val = (pInfo->reg[RSVD_20] | 0x40); /* Set PD2MUX=1 */ ++ if (pInfo->reg[RSVD_20] != val) ++ status |= MT2063_SetReg(h, RSVD_20, val); ++ ++ break; ++ } ++ case MT2063_DNC_BOTH : ++ { ++ val = (pInfo->reg[DNC_GAIN] & 0xFC ) | (DNC1GC[pInfo->rcvr_mode] & 0x03); /* Set DNC1GC=x */ ++ if (pInfo->reg[DNC_GAIN] != val) ++ status |= MT2063_SetReg(h, DNC_GAIN, val); ++ ++ val = (pInfo->reg[VGA_GAIN] & 0xFC ) | (DNC2GC[pInfo->rcvr_mode] & 0x03); /* Set DNC2GC=x */ ++ if (pInfo->reg[VGA_GAIN] != val) ++ status |= MT2063_SetReg(h, VGA_GAIN, val); ++ ++ val = (pInfo->reg[RSVD_20] | 0x40); /* Set PD2MUX=1 */ ++ if (pInfo->reg[RSVD_20] != val) ++ status |= MT2063_SetReg(h, RSVD_20, val); ++ ++ break; ++ } ++ default : break; ++ } ++ break; ++ ++ case MT2063_VGAGC: ++ /* Set VGA gain code */ ++ val = (U8Data)( (pInfo->reg[VGA_GAIN] & (U8Data)~0x0C) | ( (nValue & 0x03) << 2) ); ++ if( pInfo->reg[VGA_GAIN] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, VGA_GAIN, val); ++ } ++ break; ++ ++ case MT2063_VGAOI: ++ /* Set VGA bias current */ ++ val = (U8Data)( (pInfo->reg[RSVD_31] & (U8Data)~0x07) | (nValue & 0x07) ); ++ if( pInfo->reg[RSVD_31] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, RSVD_31, val); ++ } ++ break; ++ ++ case MT2063_TAGC: ++ /* Set TAGC */ ++ val = (U8Data)( (pInfo->reg[RSVD_1E] & (U8Data)~0x03) | (nValue & 0x03) ); ++ if( pInfo->reg[RSVD_1E] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, RSVD_1E, val); ++ } ++ break; ++ ++ case MT2063_AMPGC: ++ /* Set Amp gain code */ ++ val = (U8Data)( (pInfo->reg[TEMP_SEL] & (U8Data)~0x03) | (nValue & 0x03) ); ++ if( pInfo->reg[TEMP_SEL] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, TEMP_SEL, val); ++ } ++ break; ++ ++ /* Avoid DECT Frequencies */ ++ case MT2063_AVOID_DECT: ++ { ++ MT_DECT_Avoid_Type newAvoidSetting = (MT_DECT_Avoid_Type) nValue; ++ if (newAvoidSetting <= MT_AVOID_BOTH) ++ { ++ pInfo->AS_Data.avoidDECT = newAvoidSetting; ++ } ++ } ++ break; ++ ++ /* Cleartune filter selection: 0 - by IC (default), 1 - by software */ ++ case MT2063_CTFILT_SW: ++ pInfo->ctfilt_sw = (nValue & 0x01); ++ break; ++ ++ /* These parameters are read-only */ ++ case MT2063_VER: ++ case MT2063_IC_ADDR: ++ case MT2063_IC_REV: ++ case MT2063_MAX_OPEN: ++ case MT2063_NUM_OPEN: ++ case MT2063_INPUT_FREQ: ++ case MT2063_IF1_ACTUAL: ++ case MT2063_IF1_CENTER: ++ case MT2063_IF1_BW: ++ case MT2063_AS_ALG: ++ case MT2063_EXCL_ZONES: ++ case MT2063_SPUR_AVOIDED: ++ case MT2063_NUM_SPURS: ++ case MT2063_SPUR_PRESENT: ++ case MT2063_PD1: ++ case MT2063_PD2: ++ case MT2063_ACLNA: ++ case MT2063_ACRF: ++ case MT2063_ACFIF: ++ case MT2063_EOP: ++ default: ++ status |= MT_ARG_RANGE; ++ } ++ } ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetPowerMaskBits ++** ++** Description: Sets the power-down mask bits for various sections of ++** the MT2063 ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to be set. ++** ++** See definition of MT2063_Mask_Bits type for description ++** of each of the power bits. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SetPowerMaskBits(Handle_t h, MT2063_Mask_Bits Bits) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ Bits = (MT2063_Mask_Bits)(Bits & MT2063_ALL_SD); /* Only valid bits for this tuner */ ++ if ((Bits & 0xFF00) != 0) ++ { ++ pInfo->reg[PWR_2] |= (U8Data)((Bits & 0xFF00) >> 8); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_2, &pInfo->reg[PWR_2], 1); ++ } ++ if ((Bits & 0xFF) != 0) ++ { ++ pInfo->reg[PWR_1] |= ((U8Data)Bits & 0xFF); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_1, &pInfo->reg[PWR_1], 1); ++ } ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_ClearPowerMaskBits ++** ++** Description: Clears the power-down mask bits for various sections of ++** the MT2063 ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to be cleared. ++** ++** See definition of MT2063_Mask_Bits type for description ++** of each of the power bits. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_ClearPowerMaskBits(Handle_t h, MT2063_Mask_Bits Bits) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ Bits = (MT2063_Mask_Bits)(Bits & MT2063_ALL_SD); /* Only valid bits for this tuner */ ++ if ((Bits & 0xFF00) != 0) ++ { ++ pInfo->reg[PWR_2] &= ~(U8Data)(Bits >> 8); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_2, &pInfo->reg[PWR_2], 1); ++ } ++ if ((Bits & 0xFF) != 0) ++ { ++ pInfo->reg[PWR_1] &= ~(U8Data)(Bits & 0xFF); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_1, &pInfo->reg[PWR_1], 1); ++ } ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetPowerMaskBits ++** ++** Description: Returns a mask of the enabled power shutdown bits ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to currently set. ++** ++** See definition of MT2063_Mask_Bits type for description ++** of each of the power bits. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Output argument is NULL ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetPowerMaskBits(Handle_t h, MT2063_Mask_Bits *Bits) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ if (Bits == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (MT_NO_ERROR(status)) ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, PWR_1, &pInfo->reg[PWR_1], 2); ++ ++ if (MT_NO_ERROR(status)) ++ { ++ *Bits = (MT2063_Mask_Bits)(((SData_t)pInfo->reg[PWR_2] << 8) + pInfo->reg[PWR_1]); ++ *Bits = (MT2063_Mask_Bits)(*Bits & MT2063_ALL_SD); /* Only valid bits for this tuner */ ++ } ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_EnableExternalShutdown ++** ++** Description: Enables or disables the operation of the external ++** shutdown pin ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Enabled - 0 = disable the pin, otherwise enable it ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_EnableExternalShutdown(Handle_t h, U8Data Enabled) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ if (Enabled == 0) ++ pInfo->reg[PWR_1] &= ~0x08; /* Turn off the bit */ ++ else ++ pInfo->reg[PWR_1] |= 0x08; /* Turn the bit on */ ++ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_1, &pInfo->reg[PWR_1], 1); ++ } ++ ++ return (UData_t)(status); ++} ++ ++/**************************************************************************** ++** ++** Name: MT2063_SoftwareShutdown ++** ++** Description: Enables or disables software shutdown function. When ++** Shutdown==1, any section whose power mask is set will be ++** shutdown. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Shutdown - 1 = shutdown the masked sections, otherwise ++** power all sections on ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 01-03-2008 PINZ Ver 1.xx: Added a trigger of BYPATNUP for ++** correct wakeup of the LNA ++** ++****************************************************************************/ ++UData_t MT2063_SoftwareShutdown(Handle_t h, U8Data Shutdown) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ if (Shutdown == 1) ++ pInfo->reg[PWR_1] |= 0x04; /* Turn the bit on */ ++ else ++ pInfo->reg[PWR_1] &= ~0x04; /* Turn off the bit */ ++ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, PWR_1, &pInfo->reg[PWR_1], 1); ++ ++ if (Shutdown != 1) ++ { ++ pInfo->reg[BYP_CTRL] = (pInfo->reg[BYP_CTRL] & 0x9F) | 0x40; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, BYP_CTRL, &pInfo->reg[BYP_CTRL], 1); ++ pInfo->reg[BYP_CTRL] = (pInfo->reg[BYP_CTRL] & 0x9F); ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, BYP_CTRL, &pInfo->reg[BYP_CTRL], 1); ++ } ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetExtSRO ++** ++** Description: Sets the external SRO driver. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Ext_SRO_Setting - external SRO drive setting ++** ++** (default) MT2063_EXT_SRO_OFF - ext driver off ++** MT2063_EXT_SRO_BY_1 - ext driver = SRO frequency ++** MT2063_EXT_SRO_BY_2 - ext driver = SRO/2 frequency ++** MT2063_EXT_SRO_BY_4 - ext driver = SRO/4 frequency ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** The Ext_SRO_Setting settings default to OFF ++** Use this function if you need to override the default ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 189 S 05-13-2008 RSK Ver 1.16: Correct location for ExtSRO control. ++** ++****************************************************************************/ ++UData_t MT2063_SetExtSRO(Handle_t h, ++ MT2063_Ext_SRO Ext_SRO_Setting) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ else ++ { ++ pInfo->reg[CTRL_2C] = (pInfo->reg[CTRL_2C] & 0x3F) | ((U8Data)Ext_SRO_Setting << 6); ++ status = MT2063_WriteSub(pInfo->hUserData, pInfo->address, CTRL_2C, &pInfo->reg[CTRL_2C], 1); ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetReg ++** ++** Description: Sets an MT2063 register. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** reg - MT2063 register/subaddress location ++** val - MT2063 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Use this function if you need to override a default ++** register value ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SetReg(Handle_t h, ++ U8Data reg, ++ U8Data val) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, reg, &val, 1); ++ if (MT_NO_ERROR(status)) ++ pInfo->reg[reg] = val; ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++static UData_t Round_fLO(UData_t f_LO, UData_t f_LO_Step, UData_t f_ref) ++{ ++ return (UData_t)( f_ref * (f_LO / f_ref) ++ + f_LO_Step * (((f_LO % f_ref) + (f_LO_Step / 2)) / f_LO_Step) ); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: fLO_FractionalTerm ++** ++** Description: Calculates the portion contributed by FracN / denom. ++** ++** This function preserves maximum precision without ++** risk of overflow. It accurately calculates ++** f_ref * num / denom to within 1 HZ with fixed math. ++** ++** Parameters: num - Fractional portion of the multiplier ++** denom - denominator portion of the ratio ++** This routine successfully handles denom values ++** up to and including 2^18. ++** f_Ref - SRO frequency. This calculation handles ++** f_ref as two separate 14-bit fields. ++** Therefore, a maximum value of 2^28-1 ++** may safely be used for f_ref. This is ++** the genesis of the magic number "14" and the ++** magic mask value of 0x03FFF. ++** ++** Returns: f_ref * num / denom ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++static UData_t fLO_FractionalTerm( UData_t f_ref, ++ UData_t num, ++ UData_t denom ) ++{ ++ UData_t t1 = (f_ref >> 14) * num; ++ UData_t term1 = t1 / denom; ++ UData_t loss = t1 % denom; ++ UData_t term2 = ( ((f_ref & 0x00003FFF) * num + (loss<<14)) + (denom/2) ) / denom; ++ return (UData_t)( ((term1 << 14) + term2) ); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: CalcLO1Mult ++** ++** Description: Calculates Integer divider value and the numerator ++** value for a FracN PLL. ++** ++** This function assumes that the f_LO and f_Ref are ++** evenly divisible by f_LO_Step. ++** ++** Parameters: Div - OUTPUT: Whole number portion of the multiplier ++** FracN - OUTPUT: Fractional portion of the multiplier ++** f_LO - desired LO frequency. ++** f_LO_Step - Minimum step size for the LO (in Hz). ++** f_Ref - SRO frequency. ++** f_Avoid - Range of PLL frequencies to avoid near ++** integer multiples of f_Ref (in Hz). ++** ++** Returns: Recalculated LO frequency. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++static UData_t CalcLO1Mult(UData_t *Div, ++ UData_t *FracN, ++ UData_t f_LO, ++ UData_t f_LO_Step, ++ UData_t f_Ref) ++{ ++ /* Calculate the whole number portion of the divider */ ++ *Div = f_LO / f_Ref; ++ ++ /* Calculate the numerator value (round to nearest f_LO_Step) */ ++ *FracN = (64 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) + (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step); ++ ++ return (UData_t)( (f_Ref * (*Div)) + fLO_FractionalTerm( f_Ref, *FracN, 64 ) ); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: CalcLO2Mult ++** ++** Description: Calculates Integer divider value and the numerator ++** value for a FracN PLL. ++** ++** This function assumes that the f_LO and f_Ref are ++** evenly divisible by f_LO_Step. ++** ++** Parameters: Div - OUTPUT: Whole number portion of the multiplier ++** FracN - OUTPUT: Fractional portion of the multiplier ++** f_LO - desired LO frequency. ++** f_LO_Step - Minimum step size for the LO (in Hz). ++** f_Ref - SRO frequency. ++** f_Avoid - Range of PLL frequencies to avoid near ++** integer multiples of f_Ref (in Hz). ++** ++** Returns: Recalculated LO frequency. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 205 M 10-01-2008 JWS Ver 1.22: Use DMAX when LO2 FracN is near 4096 ++** ++****************************************************************************/ ++static UData_t CalcLO2Mult(UData_t *Div, ++ UData_t *FracN, ++ UData_t f_LO, ++ UData_t f_LO_Step, ++ UData_t f_Ref) ++{ ++ UData_t denom = 8191; ++ ++ /* Calculate the whole number portion of the divider */ ++ *Div = f_LO / f_Ref; ++ ++ /* Calculate the numerator value (round to nearest f_LO_Step) */ ++ *FracN = (8191 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) + (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step); ++ ++ /* ++ ** FracN values close to 1/2 (4096) will be forced to 4096. The tuning code must ++ ** then set the DMAX bit for the affected LO(s). ++ */ ++ if ((*FracN >= 4083) && (*FracN <= 4107)) ++ { ++ *FracN = 4096; ++ denom = 8192; ++ } ++ ++ return (UData_t)( (f_Ref * (*Div)) + fLO_FractionalTerm( f_Ref, *FracN, denom ) ); ++} ++ ++/**************************************************************************** ++** ++** Name: FindClearTuneFilter ++** ++** Description: Calculate the corrrect ClearTune filter to be used for ++** a given input frequency. ++** ++** Parameters: pInfo - ptr to tuner data structure ++** f_in - RF input center frequency (in Hz). ++** ++** Returns: ClearTune filter number (0-31) ++** ++** Dependencies: MUST CALL MT2064_Open BEFORE FindClearTuneFilter! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 04-10-2008 PINZ Ver 1.14: Use software-controlled ClearTune ++** cross-over frequency values. ++** ++****************************************************************************/ ++static UData_t FindClearTuneFilter(MT2063_Info_t* pInfo, UData_t f_in) ++{ ++ UData_t RFBand; ++ UData_t idx; /* index loop */ ++ ++ /* ++ ** Find RF Band setting ++ */ ++ RFBand = 31; /* def when f_in > all */ ++ for (idx=0; idx<31; ++idx) ++ { ++ if (pInfo->CTFiltMax[idx] >= f_in) ++ { ++ RFBand = idx; ++ break; ++ } ++ } ++ return (UData_t)(RFBand); ++} ++ ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_Tune ++** ++** Description: Change the tuner's tuned frequency to RFin. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** f_in - RF input center frequency (in Hz). ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_UPC_UNLOCK - Upconverter PLL unlocked ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_SPUR_CNT_MASK - Count of avoided LO spurs ++** MT_SPUR_PRESENT - LO spur possible in output ++** MT_FIN_RANGE - Input freq out of range ++** MT_FOUT_RANGE - Output freq out of range ++** MT_UPC_RANGE - Upconverter freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2063_Open BEFORE MT2063_Tune! ++** ++** MT_ReadSub - Read data from the two-wire serial bus ++** MT_WriteSub - Write data to the two-wire serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** MT2063_GetLocked - Checks to see if LO1 and LO2 are locked ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 04-10-2008 PINZ Ver 1.05: Use software-controlled ClearTune ++** cross-over frequency values. ++** 175 I 16-06-2008 PINZ Ver 1.16: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 205 M 10-01-2008 JWS Ver 1.22: Use DMAX when LO2 FracN is near 4096 ++** M 10-24-2008 JWS Ver 1.25: Use DMAX when LO1 FracN is 32 ++** ++****************************************************************************/ ++UData_t MT2063_Tune(Handle_t h, ++ UData_t f_in) /* RF input center frequency */ ++{ ++ MT2063_Info_t* pInfo = (MT2063_Info_t*) h; ++ ++ UData_t status = MT_OK; /* status of operation */ ++ UData_t LO1; /* 1st LO register value */ ++ UData_t Num1; /* Numerator for LO1 reg. value */ ++ UData_t f_IF1; /* 1st IF requested */ ++ UData_t LO2; /* 2nd LO register value */ ++ UData_t Num2; /* Numerator for LO2 reg. value */ ++ UData_t ofLO1, ofLO2; /* last time's LO frequencies */ ++ U8Data fiffc = 0x80; /* FIFF center freq from tuner */ ++ UData_t fiffof; /* Offset from FIFF center freq */ ++ const U8Data LO1LK = 0x80; /* Mask for LO1 Lock bit */ ++ U8Data LO2LK = 0x08; /* Mask for LO2 Lock bit */ ++ U8Data val; ++ UData_t RFBand; ++ U8Data oFN; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ return (UData_t)MT_INV_HANDLE; ++ ++ /* Check the input and output frequency ranges */ ++ if ((f_in < MIN_FIN_FREQ) || (f_in > MAX_FIN_FREQ)) ++ status |= MT_FIN_RANGE; ++ ++ if ((pInfo->AS_Data.f_out < MIN_FOUT_FREQ) || (pInfo->AS_Data.f_out > MAX_FOUT_FREQ)) ++ status |= MT_FOUT_RANGE; ++ ++ /* ++ ** Save original LO1 and LO2 register values ++ */ ++ ofLO1 = pInfo->AS_Data.f_LO1; ++ ofLO2 = pInfo->AS_Data.f_LO2; ++ ++ /* ++ ** Find and set RF Band setting ++ */ ++ if (pInfo->ctfilt_sw == 1) ++ { ++ val = ( pInfo->reg[CTUNE_CTRL] | 0x08 ); ++ if( pInfo->reg[CTUNE_CTRL] != val ) ++ { ++ status |= MT2063_SetReg(pInfo, CTUNE_CTRL, val); ++ } ++ ++ RFBand = FindClearTuneFilter(pInfo, f_in); ++ val = (U8Data)( (pInfo->reg[CTUNE_OV] & ~0x1F) | RFBand ); ++ if (pInfo->reg[CTUNE_OV] != val) ++ { ++ status |= MT2063_SetReg(pInfo, CTUNE_OV, val); ++ } ++ } ++ ++ /* ++ ** Read the FIFF Center Frequency from the tuner ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_ReadSub(pInfo->hUserData, pInfo->address, FIFFC, &pInfo->reg[FIFFC], 1); ++ fiffc = pInfo->reg[FIFFC]; ++ } ++ ++ /* ++ ** Assign in the requested values ++ */ ++ pInfo->AS_Data.f_in = f_in; ++ /* Request a 1st IF such that LO1 is on a step size */ ++ pInfo->AS_Data.f_if1_Request = Round_fLO(pInfo->AS_Data.f_if1_Request + f_in, pInfo->AS_Data.f_LO1_Step, pInfo->AS_Data.f_ref) - f_in; ++ ++ /* ++ ** Calculate frequency settings. f_IF1_FREQ + f_in is the ++ ** desired LO1 frequency ++ */ ++ MT2063_ResetExclZones(&pInfo->AS_Data); ++ ++ f_IF1 = MT2063_ChooseFirstIF(&pInfo->AS_Data); ++ pInfo->AS_Data.f_LO1 = Round_fLO(f_IF1 + f_in, pInfo->AS_Data.f_LO1_Step, pInfo->AS_Data.f_ref); ++ pInfo->AS_Data.f_LO2 = Round_fLO(pInfo->AS_Data.f_LO1 - pInfo->AS_Data.f_out - f_in, pInfo->AS_Data.f_LO2_Step, pInfo->AS_Data.f_ref); ++ ++ /* ++ ** Check for any LO spurs in the output bandwidth and adjust ++ ** the LO settings to avoid them if needed ++ */ ++ status |= MT2063_AvoidSpurs(h, &pInfo->AS_Data); ++ ++ /* ++ ** MT_AvoidSpurs spurs may have changed the LO1 & LO2 values. ++ ** Recalculate the LO frequencies and the values to be placed ++ ** in the tuning registers. ++ */ ++ pInfo->AS_Data.f_LO1 = CalcLO1Mult(&LO1, &Num1, pInfo->AS_Data.f_LO1, pInfo->AS_Data.f_LO1_Step, pInfo->AS_Data.f_ref); ++ pInfo->AS_Data.f_LO2 = Round_fLO(pInfo->AS_Data.f_LO1 - pInfo->AS_Data.f_out - f_in, pInfo->AS_Data.f_LO2_Step, pInfo->AS_Data.f_ref); ++ pInfo->AS_Data.f_LO2 = CalcLO2Mult(&LO2, &Num2, pInfo->AS_Data.f_LO2, pInfo->AS_Data.f_LO2_Step, pInfo->AS_Data.f_ref); ++ ++ /* ++ ** Check the upconverter and downconverter frequency ranges ++ */ ++ if ((pInfo->AS_Data.f_LO1 < MIN_UPC_FREQ) || (pInfo->AS_Data.f_LO1 > MAX_UPC_FREQ)) ++ status |= MT_UPC_RANGE; ++ ++ if ((pInfo->AS_Data.f_LO2 < MIN_DNC_FREQ) || (pInfo->AS_Data.f_LO2 > MAX_DNC_FREQ)) ++ status |= MT_DNC_RANGE; ++ ++ /* LO2 Lock bit was in a different place for B0 version */ ++ if (pInfo->tuner_id == MT2063_B0) ++ LO2LK = 0x40; ++ ++ /* ++ ** If we have the same LO frequencies and we're already locked, ++ ** then skip re-programming the LO registers. ++ */ ++ if ((ofLO1 != pInfo->AS_Data.f_LO1) ++ || (ofLO2 != pInfo->AS_Data.f_LO2) ++ || ((pInfo->reg[LO_STATUS] & (LO1LK | LO2LK)) != (LO1LK | LO2LK))) ++ { ++ /* ++ ** Calculate the FIFFOF register value ++ ** ++ ** IF1_Actual ++ ** FIFFOF = ------------ - 8 * FIFFC - 4992 ++ ** f_ref/64 ++ */ ++ fiffof = (pInfo->AS_Data.f_LO1 - f_in) / (pInfo->AS_Data.f_ref / 64) - 8 * (UData_t)fiffc - 4992; ++ if (fiffof > 0xFF) ++ fiffof = 0xFF; ++ ++ /* ++ ** Place all of the calculated values into the local tuner ++ ** register fields. ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ oFN = pInfo->reg[FN_CTRL]; /* save current FN_CTRL settings */ ++ ++ /* ++ ** If either FracN is 4096 (or was rounded to there) then set its ++ ** DMAX bit, otherwise clear it. ++ */ ++ if (Num1 == 32) ++ pInfo->reg[FN_CTRL] |= 0x20; ++ else ++ pInfo->reg[FN_CTRL] &= ~0x20; ++ if (Num2 == 4096) ++ pInfo->reg[FN_CTRL] |= 0x02; ++ else ++ pInfo->reg[FN_CTRL] &= ~0x02; ++ ++ pInfo->reg[LO1CQ_1] = (U8Data)(LO1 & 0xFF); /* DIV1q */ ++ pInfo->reg[LO1CQ_2] = (U8Data)(Num1 & 0x3F); /* NUM1q */ ++ pInfo->reg[LO2CQ_1] = (U8Data)(((LO2 & 0x7F) << 1) /* DIV2q */ ++ | (Num2 >> 12)); /* NUM2q (hi) */ ++ pInfo->reg[LO2CQ_2] = (U8Data)((Num2 & 0x0FF0) >> 4); /* NUM2q (mid) */ ++ pInfo->reg[LO2CQ_3] = (U8Data)(0xE0 | (Num2 & 0x000F)); /* NUM2q (lo) */ ++ ++ /* ++ ** Now write out the computed register values ++ ** IMPORTANT: There is a required order for writing ++ ** (0x05 must follow all the others). ++ */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO1CQ_1, &pInfo->reg[LO1CQ_1], 5); /* 0x01 - 0x05 */ ++ ++ /* The FN_CTRL register is only needed if it changes */ ++ if (oFN != pInfo->reg[FN_CTRL]) ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, FN_CTRL, &pInfo->reg[FN_CTRL], 1); /* 0x34 */ ++ ++ if (pInfo->tuner_id == MT2063_B0) ++ { ++ /* Re-write the one-shot bits to trigger the tune operation */ ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, LO2CQ_3, &pInfo->reg[LO2CQ_3], 1); /* 0x05 */ ++ } ++ ++ /* Write out the FIFF offset only if it's changing */ ++ if (pInfo->reg[FIFF_OFFSET] != (U8Data)fiffof) ++ { ++ pInfo->reg[FIFF_OFFSET] = (U8Data)fiffof; ++ status |= MT2063_WriteSub(pInfo->hUserData, pInfo->address, FIFF_OFFSET, &pInfo->reg[FIFF_OFFSET], 1); ++ } ++ } ++ ++ /* ++ ** Check for LO's locking ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2063_GetLocked(h); ++ } ++ ++ /* ++ ** If we locked OK, assign calculated data to MT2063_Info_t structure ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ pInfo->f_IF1_actual = pInfo->AS_Data.f_LO1 - f_in; ++ } ++ } ++ ++ return (UData_t)(status); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt_spuravoid.c ++ ++ ++/***************************************************************************** ++** ++** Name: mt_spuravoid.c ++** ++** Copyright 2006-2008 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt_spuravoid.c ++** ++** Description: Microtune spur avoidance software module. ++** Supports Microtune tuner drivers. ++** ++** CVS ID: $Id: mt_spuravoid.c,v 1.4 2008/11/05 13:46:19 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt_spuravoid.c,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 082 03-25-2005 JWS Original multi-tuner support - requires ++** MTxxxx_CNT declarations ++** 096 04-06-2005 DAD Ver 1.11: Fix divide by 0 error if maxH==0. ++** 094 04-06-2005 JWS Ver 1.11 Added uceil and ufloor to get rid ++** of compiler warnings ++** N/A 04-07-2005 DAD Ver 1.13: Merged single- and multi-tuner spur ++** avoidance into a single module. ++** 103 01-31-2005 DAD Ver 1.14: In MT_AddExclZone(), if the range ++** (f_min, f_max) < 0, ignore the entry. ++** 115 03-23-2007 DAD Fix declaration of spur due to truncation ++** errors. ++** 117 03-29-2007 RSK Ver 1.15: Re-wrote to match search order from ++** tuner DLL. ++** 137 06-18-2007 DAD Ver 1.16: Fix possible divide-by-0 error for ++** multi-tuners that have ++** (delta IF1) > (f_out-f_outbw/2). ++** 147 07-27-2007 RSK Ver 1.17: Corrected calculation (-) to (+) ++** Added logic to force f_Center within 1/2 f_Step. ++** 177 S 02-26-2008 RSK Ver 1.18: Corrected calculation using LO1 > MAX/2 ++** Type casts added to preserve correct sign. ++** 195 I 06-17-2008 RSK Ver 1.19: Refactoring avoidance of DECT ++** frequencies into MT_ResetExclZones(). ++** N/A I 06-20-2008 RSK Ver 1.21: New VERSION number for ver checking. ++** 199 08-06-2008 JWS Ver 1.22: Added 0x1x1 spur frequency calculations ++** and indicate success of AddExclZone operation. ++** 200 08-07-2008 JWS Ver 1.23: Moved definition of DECT avoid constants ++** so users could access them more easily. ++** ++*****************************************************************************/ ++//#include "mt_spuravoid.h" ++//#include ++//#include /* debug purposes */ ++ ++#if !defined(MT_TUNER_CNT) ++#error MT_TUNER_CNT is not defined (see mt_userdef.h) ++#endif ++ ++#if MT_TUNER_CNT == 0 ++#error MT_TUNER_CNT must be updated in mt_userdef.h ++#endif ++ ++/* Version of this module */ ++#define MT_SPURAVOID_VERSION 10203 /* Version 01.23 */ ++ ++ ++/* Implement ceiling, floor functions. */ ++#define ceil(n, d) (((n) < 0) ? (-((-(n))/(d))) : (n)/(d) + ((n)%(d) != 0)) ++#define uceil(n, d) ((n)/(d) + ((n)%(d) != 0)) ++#define floor(n, d) (((n) < 0) ? (-((-(n))/(d))) - ((n)%(d) != 0) : (n)/(d)) ++#define ufloor(n, d) ((n)/(d)) ++ ++/* Macros to check for DECT exclusion options */ ++#define MT_EXCLUDE_US_DECT_FREQUENCIES(s) (((s) & MT_AVOID_US_DECT) != 0) ++#define MT_EXCLUDE_EURO_DECT_FREQUENCIES(s) (((s) & MT_AVOID_EURO_DECT) != 0) ++ ++ ++struct MT_FIFZone_t ++{ ++ SData_t min_; ++ SData_t max_; ++}; ++ ++#if MT_TUNER_CNT > 1 ++static MT2063_AvoidSpursData_t* TunerList[MT_TUNER_CNT]; ++static UData_t TunerCount = 0; ++#endif ++ ++UData_t MT2063_RegisterTuner(MT2063_AvoidSpursData_t* pAS_Info) ++{ ++#if MT_TUNER_CNT == 1 ++ pAS_Info->nAS_Algorithm = 1; ++ return MT_OK; ++#else ++ UData_t index; ++ ++ pAS_Info->nAS_Algorithm = 2; ++ ++ /* ++ ** Check to see if tuner is already registered ++ */ ++ for (index = 0; index < TunerCount; index++) ++ { ++ if (TunerList[index] == pAS_Info) ++ { ++ return MT_OK; /* Already here - no problem */ ++ } ++ } ++ ++ /* ++ ** Add tuner to list - if there is room. ++ */ ++ if (TunerCount < MT_TUNER_CNT) ++ { ++ TunerList[TunerCount] = pAS_Info; ++ TunerCount++; ++ return MT_OK; ++ } ++ else ++ return MT_TUNER_CNT_ERR; ++#endif ++} ++ ++ ++void MT2063_UnRegisterTuner(MT2063_AvoidSpursData_t* pAS_Info) ++{ ++#if MT_TUNER_CNT == 1 ++ // pAS_Info; ++ // pAS_Info->nAS_Algorithm = 1; ++ // return MT_OK; ++#else ++ ++ UData_t index; ++ ++ for (index = 0; index < TunerCount; index++) ++ { ++ if (TunerList[index] == pAS_Info) ++ { ++ TunerList[index] = TunerList[--TunerCount]; ++ } ++ } ++#endif ++} ++ ++ ++/* ++** Reset all exclusion zones. ++** Add zones to protect the PLL FracN regions near zero ++** ++** 195 I 06-17-2008 RSK Ver 1.19: Refactoring avoidance of DECT ++** frequencies into MT_ResetExclZones(). ++*/ ++void MT2063_ResetExclZones(MT2063_AvoidSpursData_t* pAS_Info) ++{ ++ UData_t center; ++#if MT_TUNER_CNT > 1 ++ UData_t index; ++ MT2063_AvoidSpursData_t* adj; ++#endif ++ ++ pAS_Info->nZones = 0; /* this clears the used list */ ++ pAS_Info->usedZones = MT_NULL; /* reset ptr */ ++ pAS_Info->freeZones = MT_NULL; /* reset ptr */ ++ ++ center = pAS_Info->f_ref * ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw/2 + pAS_Info->f_in) / pAS_Info->f_ref) - pAS_Info->f_in; ++ while (center < pAS_Info->f_if1_Center + pAS_Info->f_if1_bw/2 + pAS_Info->f_LO1_FracN_Avoid) ++ { ++ /* Exclude LO1 FracN */ ++ MT2063_AddExclZone(pAS_Info, center-pAS_Info->f_LO1_FracN_Avoid, center-1); ++ MT2063_AddExclZone(pAS_Info, center+1, center+pAS_Info->f_LO1_FracN_Avoid); ++ center += pAS_Info->f_ref; ++ } ++ ++ center = pAS_Info->f_ref * ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw/2 - pAS_Info->f_out) / pAS_Info->f_ref) + pAS_Info->f_out; ++ while (center < pAS_Info->f_if1_Center + pAS_Info->f_if1_bw/2 + pAS_Info->f_LO2_FracN_Avoid) ++ { ++ /* Exclude LO2 FracN */ ++ MT2063_AddExclZone(pAS_Info, center-pAS_Info->f_LO2_FracN_Avoid, center-1); ++ MT2063_AddExclZone(pAS_Info, center+1, center+pAS_Info->f_LO2_FracN_Avoid); ++ center += pAS_Info->f_ref; ++ } ++ ++ if( MT_EXCLUDE_US_DECT_FREQUENCIES(pAS_Info->avoidDECT) ) ++ { ++ /* Exclude LO1 values that conflict with DECT channels */ ++ MT2063_AddExclZone(pAS_Info, 1920836000 - pAS_Info->f_in, 1922236000 - pAS_Info->f_in); /* Ctr = 1921.536 */ ++ MT2063_AddExclZone(pAS_Info, 1922564000 - pAS_Info->f_in, 1923964000 - pAS_Info->f_in); /* Ctr = 1923.264 */ ++ MT2063_AddExclZone(pAS_Info, 1924292000 - pAS_Info->f_in, 1925692000 - pAS_Info->f_in); /* Ctr = 1924.992 */ ++ MT2063_AddExclZone(pAS_Info, 1926020000 - pAS_Info->f_in, 1927420000 - pAS_Info->f_in); /* Ctr = 1926.720 */ ++ MT2063_AddExclZone(pAS_Info, 1927748000 - pAS_Info->f_in, 1929148000 - pAS_Info->f_in); /* Ctr = 1928.448 */ ++ } ++ ++ if( MT_EXCLUDE_EURO_DECT_FREQUENCIES(pAS_Info->avoidDECT) ) ++ { ++ MT2063_AddExclZone(pAS_Info, 1896644000 - pAS_Info->f_in, 1898044000 - pAS_Info->f_in); /* Ctr = 1897.344 */ ++ MT2063_AddExclZone(pAS_Info, 1894916000 - pAS_Info->f_in, 1896316000 - pAS_Info->f_in); /* Ctr = 1895.616 */ ++ MT2063_AddExclZone(pAS_Info, 1893188000 - pAS_Info->f_in, 1894588000 - pAS_Info->f_in); /* Ctr = 1893.888 */ ++ MT2063_AddExclZone(pAS_Info, 1891460000 - pAS_Info->f_in, 1892860000 - pAS_Info->f_in); /* Ctr = 1892.16 */ ++ MT2063_AddExclZone(pAS_Info, 1889732000 - pAS_Info->f_in, 1891132000 - pAS_Info->f_in); /* Ctr = 1890.432 */ ++ MT2063_AddExclZone(pAS_Info, 1888004000 - pAS_Info->f_in, 1889404000 - pAS_Info->f_in); /* Ctr = 1888.704 */ ++ MT2063_AddExclZone(pAS_Info, 1886276000 - pAS_Info->f_in, 1887676000 - pAS_Info->f_in); /* Ctr = 1886.976 */ ++ MT2063_AddExclZone(pAS_Info, 1884548000 - pAS_Info->f_in, 1885948000 - pAS_Info->f_in); /* Ctr = 1885.248 */ ++ MT2063_AddExclZone(pAS_Info, 1882820000 - pAS_Info->f_in, 1884220000 - pAS_Info->f_in); /* Ctr = 1883.52 */ ++ MT2063_AddExclZone(pAS_Info, 1881092000 - pAS_Info->f_in, 1882492000 - pAS_Info->f_in); /* Ctr = 1881.792 */ ++ } ++ ++#if MT_TUNER_CNT > 1 ++ /* ++ ** Iterate through all adjacent tuners and exclude frequencies related to them ++ */ ++ for (index = 0; index < TunerCount; ++index) ++ { ++ adj = TunerList[index]; ++ if (pAS_Info == adj) /* skip over our own data, don't process it */ ++ continue; ++ ++ /* ++ ** Add 1st IF exclusion zone covering adjacent tuner's LO2 ++ ** at "adjfLO2 + f_out" +/- m_MinLOSpacing ++ */ ++ if (adj->f_LO2 != 0) ++ MT2063_AddExclZone(pAS_Info, ++ (adj->f_LO2 + pAS_Info->f_out) - pAS_Info->f_min_LO_Separation, ++ (adj->f_LO2 + pAS_Info->f_out) + pAS_Info->f_min_LO_Separation ); ++ ++ /* ++ ** Add 1st IF exclusion zone covering adjacent tuner's LO1 ++ ** at "adjfLO1 - f_in" +/- m_MinLOSpacing ++ */ ++ if (adj->f_LO1 != 0) ++ MT2063_AddExclZone(pAS_Info, ++ (adj->f_LO1 - pAS_Info->f_in) - pAS_Info->f_min_LO_Separation, ++ (adj->f_LO1 - pAS_Info->f_in) + pAS_Info->f_min_LO_Separation ); ++ } ++#endif ++} ++ ++ ++static struct MT2063_ExclZone_t* InsertNode(MT2063_AvoidSpursData_t* pAS_Info, ++ struct MT2063_ExclZone_t* pPrevNode) ++{ ++ struct MT2063_ExclZone_t* pNode; ++ /* Check for a node in the free list */ ++ if (pAS_Info->freeZones != MT_NULL) ++ { ++ /* Use one from the free list */ ++ pNode = pAS_Info->freeZones; ++ pAS_Info->freeZones = pNode->next_; ++ } ++ else ++ { ++ /* Grab a node from the array */ ++ pNode = &pAS_Info->MT_ExclZones[pAS_Info->nZones]; ++ } ++ ++ if (pPrevNode != MT_NULL) ++ { ++ pNode->next_ = pPrevNode->next_; ++ pPrevNode->next_ = pNode; ++ } ++ else /* insert at the beginning of the list */ ++ { ++ pNode->next_ = pAS_Info->usedZones; ++ pAS_Info->usedZones = pNode; ++ } ++ ++ pAS_Info->nZones++; ++ return pNode; ++} ++ ++ ++static struct MT2063_ExclZone_t* RemoveNode(MT2063_AvoidSpursData_t* pAS_Info, ++ struct MT2063_ExclZone_t* pPrevNode, ++ struct MT2063_ExclZone_t* pNodeToRemove) ++{ ++ struct MT2063_ExclZone_t* pNext = pNodeToRemove->next_; ++ ++ /* Make previous node point to the subsequent node */ ++ if (pPrevNode != MT_NULL) ++ pPrevNode->next_ = pNext; ++ ++ /* Add pNodeToRemove to the beginning of the freeZones */ ++ pNodeToRemove->next_ = pAS_Info->freeZones; ++ pAS_Info->freeZones = pNodeToRemove; ++ ++ /* Decrement node count */ ++ pAS_Info->nZones--; ++ ++ return pNext; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_AddExclZone ++** ++** Description: Add (and merge) an exclusion zone into the list. ++** If the range (f_min, f_max) is totally outside the ++** 1st IF BW, ignore the entry. ++** If the range (f_min, f_max) is negative, ignore the entry. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 103 01-31-2005 DAD Ver 1.14: In MT_AddExclZone(), if the range ++** (f_min, f_max) < 0, ignore the entry. ++** 199 08-06-2008 JWS Ver 1.22: Indicate success of addition operation. ++** ++*****************************************************************************/ ++UData_t MT2063_AddExclZone(MT2063_AvoidSpursData_t* pAS_Info, ++ UData_t f_min, ++ UData_t f_max) ++{ ++ UData_t status = 1; /* Assume addition is possible */ ++ ++ /* Check to see if this overlaps the 1st IF filter */ ++ if ((f_max > (pAS_Info->f_if1_Center - (pAS_Info->f_if1_bw / 2))) ++ && (f_min < (pAS_Info->f_if1_Center + (pAS_Info->f_if1_bw / 2))) ++ && (f_min < f_max)) ++ { ++ /* ++ ** 1 2 3 4 5 6 ++ ** ++ ** New entry: |---| |--| |--| |-| |---| |--| ++ ** or or or or or ++ ** Existing: |--| |--| |--| |---| |-| |--| ++ */ ++ struct MT2063_ExclZone_t* pNode = pAS_Info->usedZones; ++ struct MT2063_ExclZone_t* pPrev = MT_NULL; ++ struct MT2063_ExclZone_t* pNext = MT_NULL; ++ ++ /* Check for our place in the list */ ++ while ((pNode != MT_NULL) && (pNode->max_ < f_min)) ++ { ++ pPrev = pNode; ++ pNode = pNode->next_; ++ } ++ ++ if ((pNode != MT_NULL) && (pNode->min_ < f_max)) ++ { ++ /* Combine me with pNode */ ++ if (f_min < pNode->min_) ++ pNode->min_ = f_min; ++ if (f_max > pNode->max_) ++ pNode->max_ = f_max; ++ } ++ else ++ { ++ pNode = InsertNode(pAS_Info, pPrev); ++ pNode->min_ = f_min; ++ pNode->max_ = f_max; ++ } ++ ++ /* Look for merging possibilities */ ++ pNext = pNode->next_; ++ while ((pNext != MT_NULL) && (pNext->min_ < pNode->max_)) ++ { ++ if (pNext->max_ > pNode->max_) ++ pNode->max_ = pNext->max_; ++ pNext = RemoveNode(pAS_Info, pNode, pNext); /* Remove pNext, return ptr to pNext->next */ ++ } ++ } ++ else ++ status = 0; /* Did not add the zone - caller determines whether this is a problem */ ++ ++ return status; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_ChooseFirstIF ++** ++** Description: Choose the best available 1st IF ++** If f_Desired is not excluded, choose that first. ++** Otherwise, return the value closest to f_Center that is ++** not excluded ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 117 03-29-2007 RSK Ver 1.15: Re-wrote to match search order from ++** tuner DLL. ++** 147 07-27-2007 RSK Ver 1.17: Corrected calculation (-) to (+) ++** Added logic to force f_Center within 1/2 f_Step. ++** ++*****************************************************************************/ ++UData_t MT2063_ChooseFirstIF(MT2063_AvoidSpursData_t* pAS_Info) ++{ ++ /* ++ ** Update "f_Desired" to be the nearest "combinational-multiple" of "f_LO1_Step". ++ ** The resulting number, F_LO1 must be a multiple of f_LO1_Step. And F_LO1 is the arithmetic sum ++ ** of f_in + f_Center. Neither f_in, nor f_Center must be a multiple of f_LO1_Step. ++ ** However, the sum must be. ++ */ ++ const UData_t f_Desired = pAS_Info->f_LO1_Step * ((pAS_Info->f_if1_Request + pAS_Info->f_in + pAS_Info->f_LO1_Step/2) / pAS_Info->f_LO1_Step) - pAS_Info->f_in; ++ const UData_t f_Step = (pAS_Info->f_LO1_Step > pAS_Info->f_LO2_Step) ? pAS_Info->f_LO1_Step : pAS_Info->f_LO2_Step; ++ UData_t f_Center; ++ ++ SData_t i; ++ SData_t j = 0; ++ UData_t bDesiredExcluded = 0; ++ UData_t bZeroExcluded = 0; ++ SData_t tmpMin, tmpMax; ++ SData_t bestDiff; ++ struct MT2063_ExclZone_t* pNode = pAS_Info->usedZones; ++ struct MT_FIFZone_t zones[MT2063_MAX_ZONES]; ++ ++ if (pAS_Info->nZones == 0) ++ return f_Desired; ++ ++ /* f_Center needs to be an integer multiple of f_Step away from f_Desired */ ++ if (pAS_Info->f_if1_Center > f_Desired) ++ f_Center = f_Desired + f_Step * ((pAS_Info->f_if1_Center - f_Desired + f_Step/2) / f_Step); ++ else ++ f_Center = f_Desired - f_Step * ((f_Desired - pAS_Info->f_if1_Center + f_Step/2) / f_Step); ++ ++// assert(abs((SData_t) f_Center - (SData_t) pAS_Info->f_if1_Center) <= (SData_t) (f_Step/2)); ++ ++ /* Take MT_ExclZones, center around f_Center and change the resolution to f_Step */ ++ while (pNode != MT_NULL) ++ { ++ /* floor function */ ++ tmpMin = floor((SData_t) (pNode->min_ - f_Center), (SData_t) f_Step); ++ ++ /* ceil function */ ++ tmpMax = ceil((SData_t) (pNode->max_ - f_Center), (SData_t) f_Step); ++ ++ if ((pNode->min_ < f_Desired) && (pNode->max_ > f_Desired)) ++ bDesiredExcluded = 1; ++ ++ if ((tmpMin < 0) && (tmpMax > 0)) ++ bZeroExcluded = 1; ++ ++ /* See if this zone overlaps the previous */ ++ if ((j>0) && (tmpMin < zones[j-1].max_)) ++ zones[j-1].max_ = tmpMax; ++ else ++ { ++ /* Add new zone */ ++// assert(jnext_; ++ } ++ ++ /* ++ ** If the desired is okay, return with it ++ */ ++ if (bDesiredExcluded == 0) ++ return f_Desired; ++ ++ /* ++ ** If the desired is excluded and the center is okay, return with it ++ */ ++ if (bZeroExcluded == 0) ++ return f_Center; ++ ++ /* Find the value closest to 0 (f_Center) */ ++ bestDiff = zones[0].min_; ++ for (i=0; i= b) ? a : b; ++} ++ ++#if MT_TUNER_CNT > 1 ++static SData_t RoundAwayFromZero(SData_t n, SData_t d) ++{ ++ return (n<0) ? floor(n, d) : ceil(n, d); ++} ++ ++/**************************************************************************** ++** ++** Name: IsSpurInAdjTunerBand ++** ++** Description: Checks to see if a spur will be present within the IF's ++** bandwidth or near the zero IF. ++** (fIFOut +/- fIFBW/2, -fIFOut +/- fIFBW/2) ++** and ++** (0 +/- fZIFBW/2) ++** ++** ma mb me mf mc md ++** <--+-+-+-----------------+-+-+-----------------+-+-+--> ++** | ^ 0 ^ | ++** ^ b=-fIFOut+fIFBW/2 -b=+fIFOut-fIFBW/2 ^ ++** a=-fIFOut-fIFBW/2 -a=+fIFOut+fIFBW/2 ++** ++** Note that some equations are doubled to prevent round-off ++** problems when calculating fIFBW/2 ++** ++** The spur frequencies are computed as: ++** ++** fSpur = n * f1 - m * f2 - fOffset ++** ++** Parameters: f1 - The 1st local oscillator (LO) frequency ++** of the tuner whose output we are examining ++** f2 - The 1st local oscillator (LO) frequency ++** of the adjacent tuner ++** fOffset - The 2nd local oscillator of the tuner whose ++** output we are examining ++** fIFOut - Output IF center frequency ++** fIFBW - Output IF Bandwidth ++** nMaxH - max # of LO harmonics to search ++** fp - If spur, positive distance to spur-free band edge (returned) ++** fm - If spur, negative distance to spur-free band edge (returned) ++** ++** Returns: 1 if an LO spur would be present, otherwise 0. ++** ++** Dependencies: None. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 01-21-2005 JWS Original, adapted from MT_DoubleConversion. ++** 115 03-23-2007 DAD Fix declaration of spur due to truncation ++** errors. ++** 137 06-18-2007 DAD Ver 1.16: Fix possible divide-by-0 error for ++** multi-tuners that have ++** (delta IF1) > (f_out-f_outbw/2). ++** 177 S 02-26-2008 RSK Ver 1.18: Corrected calculation using LO1 > MAX/2 ++** Type casts added to preserve correct sign. ++** 199 08-06-2008 JWS Ver 1.22: Added 0x1x1 spur frequency calculations. ++** ++****************************************************************************/ ++static UData_t IsSpurInAdjTunerBand(UData_t bIsMyOutput, ++ UData_t f1, ++ UData_t f2, ++ UData_t fOffset, ++ UData_t fIFOut, ++ UData_t fIFBW, ++ UData_t fZIFBW, ++ UData_t nMaxH, ++ UData_t *fp, ++ UData_t *fm) ++{ ++ UData_t bSpurFound = 0; ++ ++ const UData_t fHalf_IFBW = fIFBW / 2; ++ const UData_t fHalf_ZIFBW = fZIFBW / 2; ++ ++ /* Calculate a scale factor for all frequencies, so that our ++ calculations all stay within 31 bits */ ++ const UData_t f_Scale = ((f1 + (fOffset + fIFOut + fHalf_IFBW) / nMaxH) / (MAX_UDATA/2 / nMaxH)) + 1; ++ ++ /* ++ ** After this scaling, _f1, _f2, and _f3 are guaranteed to fit into ++ ** signed data types (smaller than MAX_UDATA/2) ++ */ ++ const SData_t _f1 = (SData_t) ( f1 / f_Scale); ++ const SData_t _f2 = (SData_t) ( f2 / f_Scale); ++ const SData_t _f3 = (SData_t) (fOffset / f_Scale); ++ ++ const SData_t c = (SData_t) (fIFOut - fHalf_IFBW) / (SData_t) f_Scale; ++ const SData_t d = (SData_t) ((fIFOut + fHalf_IFBW) / f_Scale); ++ const SData_t f = (SData_t) (fHalf_ZIFBW / f_Scale); ++ ++ SData_t ma, mb, mc, md, me, mf; ++ ++ SData_t fp_ = 0; ++ SData_t fm_ = 0; ++ SData_t n; ++ ++ ++ /* ++ ** If the other tuner does not have an LO frequency defined, ++ ** assume that we cannot interfere with it ++ */ ++ if (f2 == 0) ++ return 0; ++ ++ ++ /* Check out all multiples of f1 from -nMaxH to +nMaxH */ ++ for (n = -(SData_t)nMaxH; n <= (SData_t)nMaxH; ++n) ++ { ++ const SData_t nf1 = n*_f1; ++ md = floor(_f3 + d - nf1, _f2); ++ ++ /* If # f2 harmonics > nMaxH, then no spurs present */ ++ if (md <= -(SData_t) nMaxH ) ++ break; ++ ++ ma = floor(_f3 - d - nf1, _f2); ++ if ((ma == md) || (ma >= (SData_t) (nMaxH))) ++ continue; ++ ++ mc = floor(_f3 + c - nf1, _f2); ++ if (mc != md) ++ { ++ const SData_t m = md; ++ const SData_t fspur = (nf1 + m*_f2 - _f3); ++ const SData_t den = (bIsMyOutput ? n - 1 : n); ++ if (den == 0) ++ { ++ fp_ = (d - fspur)* f_Scale; ++ fm_ = (fspur - c)* f_Scale; ++ } ++ else ++ { ++ fp_ = (SData_t) RoundAwayFromZero((d - fspur)* f_Scale, den); ++ fm_ = (SData_t) RoundAwayFromZero((fspur - c)* f_Scale, den); ++ } ++ if (((UData_t)abs(fm_) >= f_Scale) && ((UData_t)abs(fp_) >= f_Scale)) ++ { ++ bSpurFound = 1; ++ break; ++ } ++ } ++ ++ /* Location of Zero-IF-spur to be checked */ ++ mf = floor(_f3 + f - nf1, _f2); ++ me = floor(_f3 - f - nf1, _f2); ++ if (me != mf) ++ { ++ const SData_t m = mf; ++ const SData_t fspur = (nf1 + m*_f2 - _f3); ++ const SData_t den = (bIsMyOutput ? n - 1 : n); ++ if (den == 0) ++ { ++ fp_ = (d - fspur)* f_Scale; ++ fm_ = (fspur - c)* f_Scale; ++ } ++ else ++ { ++ fp_ = (SData_t) RoundAwayFromZero((f - fspur)* f_Scale, den); ++ fm_ = (SData_t) RoundAwayFromZero((fspur + f)* f_Scale, den); ++ } ++ if (((UData_t)abs(fm_) >= f_Scale) && ((UData_t)abs(fp_) >= f_Scale)) ++ { ++ bSpurFound = 1; ++ break; ++ } ++ } ++ ++ mb = floor(_f3 - c - nf1, _f2); ++ if (ma != mb) ++ { ++ const SData_t m = mb; ++ const SData_t fspur = (nf1 + m*_f2 - _f3); ++ const SData_t den = (bIsMyOutput ? n - 1 : n); ++ if (den == 0) ++ { ++ fp_ = (d - fspur)* f_Scale; ++ fm_ = (fspur - c)* f_Scale; ++ } ++ else ++ { ++ fp_ = (SData_t) RoundAwayFromZero((-c - fspur)* f_Scale, den); ++ fm_ = (SData_t) RoundAwayFromZero((fspur +d)* f_Scale, den); ++ } ++ if (((UData_t)abs(fm_) >= f_Scale) && ((UData_t)abs(fp_) >= f_Scale)) ++ { ++ bSpurFound = 1; ++ break; ++ } ++ } ++ } ++ ++ /* ++ ** Verify that fm & fp are both positive ++ ** Add one to ensure next 1st IF choice is not right on the edge ++ */ ++ if (fp_ < 0) ++ { ++ *fp = -fm_ + 1; ++ *fm = -fp_ + 1; ++ } ++ else if (fp_ > 0) ++ { ++ *fp = fp_ + 1; ++ *fm = fm_ + 1; ++ } ++ else ++ { ++ *fp = 1; ++ *fm = abs(fm_) + 1; ++ } ++ ++ return bSpurFound; ++} ++#endif ++ ++/**************************************************************************** ++** ++** Name: IsSpurInBand ++** ++** Description: Checks to see if a spur will be present within the IF's ++** bandwidth. (fIFOut +/- fIFBW, -fIFOut +/- fIFBW) ++** ++** ma mb mc md ++** <--+-+-+-------------------+-------------------+-+-+--> ++** | ^ 0 ^ | ++** ^ b=-fIFOut+fIFBW/2 -b=+fIFOut-fIFBW/2 ^ ++** a=-fIFOut-fIFBW/2 -a=+fIFOut+fIFBW/2 ++** ++** Note that some equations are doubled to prevent round-off ++** problems when calculating fIFBW/2 ++** ++** Parameters: pAS_Info - Avoid Spurs information block ++** fm - If spur, amount f_IF1 has to move negative ++** fp - If spur, amount f_IF1 has to move positive ++** ++** Global: None ++** ++** Returns: 1 if an LO spur would be present, otherwise 0. ++** ++** Dependencies: None. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 11-28-2002 DAD Implemented algorithm from applied patent ++** ++****************************************************************************/ ++static UData_t IsSpurInBand(MT2063_AvoidSpursData_t* pAS_Info, ++ UData_t* fm, ++ UData_t* fp) ++{ ++ /* ++ ** Calculate LO frequency settings. ++ */ ++ UData_t n, n0; ++ const UData_t f_LO1 = pAS_Info->f_LO1; ++ const UData_t f_LO2 = pAS_Info->f_LO2; ++ const UData_t d = pAS_Info->f_out + pAS_Info->f_out_bw/2; ++ const UData_t c = d - pAS_Info->f_out_bw; ++ const UData_t f = pAS_Info->f_zif_bw/2; ++ const UData_t f_Scale = (f_LO1 / (MAX_UDATA/2 / pAS_Info->maxH1)) + 1; ++ SData_t f_nsLO1, f_nsLO2; ++ SData_t f_Spur; ++ UData_t ma, mb, mc, md, me, mf; ++ UData_t lo_gcd, gd_Scale, gc_Scale, gf_Scale, hgds, hgfs, hgcs; ++#if MT_TUNER_CNT > 1 ++ UData_t index; ++ ++ MT2063_AvoidSpursData_t *adj; ++#endif ++ *fm = 0; ++ ++ /* ++ ** For each edge (d, c & f), calculate a scale, based on the gcd ++ ** of f_LO1, f_LO2 and the edge value. Use the larger of this ++ ** gcd-based scale factor or f_Scale. ++ */ ++ lo_gcd = gcd(f_LO1, f_LO2); ++ gd_Scale = umax((UData_t) gcd(lo_gcd, d), f_Scale); ++ hgds = gd_Scale/2; ++ gc_Scale = umax((UData_t) gcd(lo_gcd, c), f_Scale); ++ hgcs = gc_Scale/2; ++ gf_Scale = umax((UData_t) gcd(lo_gcd, f), f_Scale); ++ hgfs = gf_Scale/2; ++ ++ n0 = uceil(f_LO2 - d, f_LO1 - f_LO2); ++ ++ /* Check out all multiples of LO1 from n0 to m_maxLOSpurHarmonic */ ++ for (n=n0; n<=pAS_Info->maxH1; ++n) ++ { ++ md = (n*((f_LO1+hgds)/gd_Scale) - ((d+hgds)/gd_Scale)) / ((f_LO2+hgds)/gd_Scale); ++ ++ /* If # fLO2 harmonics > m_maxLOSpurHarmonic, then no spurs present */ ++ if (md >= pAS_Info->maxH1) ++ break; ++ ++ ma = (n*((f_LO1+hgds)/gd_Scale) + ((d+hgds)/gd_Scale)) / ((f_LO2+hgds)/gd_Scale); ++ ++ /* If no spurs between +/- (f_out + f_IFBW/2), then try next harmonic */ ++ if (md == ma) ++ continue; ++ ++ mc = (n*((f_LO1+hgcs)/gc_Scale) - ((c+hgcs)/gc_Scale)) / ((f_LO2+hgcs)/gc_Scale); ++ if (mc != md) ++ { ++ f_nsLO1 = (SData_t) (n*(f_LO1/gc_Scale)); ++ f_nsLO2 = (SData_t) (mc*(f_LO2/gc_Scale)); ++ f_Spur = (gc_Scale * (f_nsLO1 - f_nsLO2)) + n*(f_LO1 % gc_Scale) - mc*(f_LO2 % gc_Scale); ++ ++ *fp = ((f_Spur - (SData_t) c) / (mc - n)) + 1; ++ *fm = (((SData_t) d - f_Spur) / (mc - n)) + 1; ++ return 1; ++ } ++ ++ /* Location of Zero-IF-spur to be checked */ ++ me = (n*((f_LO1+hgfs)/gf_Scale) + ((f+hgfs)/gf_Scale)) / ((f_LO2+hgfs)/gf_Scale); ++ mf = (n*((f_LO1+hgfs)/gf_Scale) - ((f+hgfs)/gf_Scale)) / ((f_LO2+hgfs)/gf_Scale); ++ if (me != mf) ++ { ++ f_nsLO1 = n*(f_LO1/gf_Scale); ++ f_nsLO2 = me*(f_LO2/gf_Scale); ++ f_Spur = (gf_Scale * (f_nsLO1 - f_nsLO2)) + n*(f_LO1 % gf_Scale) - me*(f_LO2 % gf_Scale); ++ ++ *fp = ((f_Spur + (SData_t) f) / (me - n)) + 1; ++ *fm = (((SData_t) f - f_Spur) / (me - n)) + 1; ++ return 1; ++ } ++ ++ mb = (n*((f_LO1+hgcs)/gc_Scale) + ((c+hgcs)/gc_Scale)) / ((f_LO2+hgcs)/gc_Scale); ++ if (ma != mb) ++ { ++ f_nsLO1 = n*(f_LO1/gc_Scale); ++ f_nsLO2 = ma*(f_LO2/gc_Scale); ++ f_Spur = (gc_Scale * (f_nsLO1 - f_nsLO2)) + n*(f_LO1 % gc_Scale) - ma*(f_LO2 % gc_Scale); ++ ++ *fp = (((SData_t) d + f_Spur) / (ma - n)) + 1; ++ *fm = (-(f_Spur + (SData_t) c) / (ma - n)) + 1; ++ return 1; ++ } ++ } ++ ++#if MT_TUNER_CNT > 1 ++ /* If no spur found, see if there are more tuners on the same board */ ++ for (index = 0; index < TunerCount; ++index) ++ { ++ adj = TunerList[index]; ++ if (pAS_Info == adj) /* skip over our own data, don't process it */ ++ continue; ++ ++ /* Look for LO-related spurs from the adjacent tuner generated into my IF output */ ++ if (IsSpurInAdjTunerBand(1, /* check my IF output */ ++ pAS_Info->f_LO1, /* my fLO1 */ ++ adj->f_LO1, /* the other tuner's fLO1 */ ++ pAS_Info->f_LO2, /* my fLO2 */ ++ pAS_Info->f_out, /* my fOut */ ++ pAS_Info->f_out_bw, /* my output IF bandwidth */ ++ pAS_Info->f_zif_bw, /* my Zero-IF bandwidth */ ++ pAS_Info->maxH2, ++ fp, /* minimum amount to move LO's positive */ ++ fm)) /* miminum amount to move LO's negative */ ++ return 1; ++ /* Look for LO-related spurs from my tuner generated into the adjacent tuner's IF output */ ++ if (IsSpurInAdjTunerBand(0, /* check his IF output */ ++ pAS_Info->f_LO1, /* my fLO1 */ ++ adj->f_LO1, /* the other tuner's fLO1 */ ++ adj->f_LO2, /* the other tuner's fLO2 */ ++ adj->f_out, /* the other tuner's fOut */ ++ adj->f_out_bw, /* the other tuner's output IF bandwidth */ ++ pAS_Info->f_zif_bw, /* the other tuner's Zero-IF bandwidth */ ++ adj->maxH2, ++ fp, /* minimum amount to move LO's positive */ ++ fm)) /* miminum amount to move LO's negative */ ++ return 1; ++ } ++#endif ++ /* No spurs found */ ++ return 0; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_AvoidSpurs ++** ++** Description: Main entry point to avoid spurs. ++** Checks for existing spurs in present LO1, LO2 freqs ++** and if present, chooses spur-free LO1, LO2 combination ++** that tunes the same input/output frequencies. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 096 04-06-2005 DAD Ver 1.11: Fix divide by 0 error if maxH==0. ++** ++*****************************************************************************/ ++#pragma GCC diagnostic ignored "-Wunused-value" ++UData_t MT2063_AvoidSpurs(Handle_t h, ++ MT2063_AvoidSpursData_t* pAS_Info) ++{ ++ UData_t status = MT_OK; ++ UData_t fm, fp; /* restricted range on LO's */ ++ pAS_Info->bSpurAvoided = 0; ++ pAS_Info->nSpursFound = 0; ++ h; /* compiler warning expected: "code has no effect" */ ++ /* warning disable, see #pragma above */ ++ /* don't change (i.e. remark h) */ ++ ++ if (pAS_Info->maxH1 == 0) ++ return MT_OK; ++ ++ /* ++ ** Avoid LO Generated Spurs ++ ** ++ ** Make sure that have no LO-related spurs within the IF output ++ ** bandwidth. ++ ** ++ ** If there is an LO spur in this band, start at the current IF1 frequency ++ ** and work out until we find a spur-free frequency or run up against the ++ ** 1st IF SAW band edge. Use temporary copies of fLO1 and fLO2 so that they ++ ** will be unchanged if a spur-free setting is not found. ++ */ ++ pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp); ++ if (pAS_Info->bSpurPresent) ++ { ++ UData_t zfIF1 = pAS_Info->f_LO1 - pAS_Info->f_in; /* current attempt at a 1st IF */ ++ UData_t zfLO1 = pAS_Info->f_LO1; /* current attempt at an LO1 freq */ ++ UData_t zfLO2 = pAS_Info->f_LO2; /* current attempt at an LO2 freq */ ++ UData_t delta_IF1; ++ UData_t new_IF1; ++ UData_t added; /* success of Excl Zone addition */ ++ ++ /* ++ ** Spur was found, attempt to find a spur-free 1st IF ++ */ ++ do ++ { ++ pAS_Info->nSpursFound++; ++ ++ /* Raise f_IF1_upper, if needed */ ++ added = MT2063_AddExclZone(pAS_Info, zfIF1 - fm, zfIF1 + fp); ++ ++ /* ++ ** If Exclusion Zone could NOT be added, then we'll just keep picking ++ ** the same bad point, so exit this loop and report that there is a ++ ** spur present in the output ++ */ ++ if (!added) ++ break; ++ ++ /* Choose next IF1 that is closest to f_IF1_CENTER */ ++ new_IF1 = MT2063_ChooseFirstIF(pAS_Info); ++ ++ if (new_IF1 > zfIF1) ++ { ++ pAS_Info->f_LO1 += (new_IF1 - zfIF1); ++ pAS_Info->f_LO2 += (new_IF1 - zfIF1); ++ } ++ else ++ { ++ pAS_Info->f_LO1 -= (zfIF1 - new_IF1); ++ pAS_Info->f_LO2 -= (zfIF1 - new_IF1); ++ } ++ zfIF1 = new_IF1; ++ ++ if (zfIF1 > pAS_Info->f_if1_Center) ++ delta_IF1 = zfIF1 - pAS_Info->f_if1_Center; ++ else ++ delta_IF1 = pAS_Info->f_if1_Center - zfIF1; ++ } ++ /* ++ ** Continue while the new 1st IF is still within the 1st IF bandwidth ++ ** and there is a spur in the band (again) ++ */ ++ while ((2*delta_IF1 + pAS_Info->f_out_bw <= pAS_Info->f_if1_bw) && ++ (pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp))); ++ ++ /* ++ ** Use the LO-spur free values found. If the search went all the way to ++ ** the 1st IF band edge and always found spurs, just leave the original ++ ** choice. It's as "good" as any other. ++ */ ++ if (pAS_Info->bSpurPresent == 1) ++ { ++ status |= MT_SPUR_PRESENT; ++ pAS_Info->f_LO1 = zfLO1; ++ pAS_Info->f_LO2 = zfLO2; ++ } ++ else ++ pAS_Info->bSpurAvoided = 1; ++ } ++ ++ status |= ((pAS_Info->nSpursFound << MT_SPUR_SHIFT) & MT_SPUR_CNT_MASK); ++ ++ return (status); ++} ++ ++ ++UData_t MT2063_AvoidSpursVersion(void) ++{ ++ return (MT_SPURAVOID_VERSION); ++} ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_mt2063.h b/drivers/media/dvb/dvb-usb/tuner_mt2063.h +new file mode 100644 +index 0000000..44b4bcc +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mt2063.h +@@ -0,0 +1,2207 @@ ++#ifndef __TUNER_MT2063_H ++#define __TUNER_MT2063_H ++ ++/** ++ ++@file ++ ++@brief MT2063 tuner module declaration ++ ++One can manipulate MT2063 tuner through MT2063 module. ++MT2063 module is derived from tunerd module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_mt2063.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ MT2063_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long IfFreqHz; ++ ++ ++ ... ++ ++ ++ ++ // Build MT2063 tuner module. ++ BuildMt2063Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0 // I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get MT2063 tuner extra module. ++ pTunerExtra = &(pTuner->pExtra.Mt2063); ++ ++ // Open MT2063 handle. ++ pTunerExtra->OpenHandle(pTuner); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set MT2063 IF frequency. ++ pTunerExtra->SetIfFreqHz(pTuner, IF_FREQ_36125000HZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get MT2063 IF frequency. ++ pTunerExtra->SetIfFreqHz(pTuner, &IfFreqHz); ++ ++ ++ ++ ++ ++ // Close MT2063 handle. ++ pTunerExtra->CloseHandle(pTuner); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Microtune source code - mt_errordef.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt_errordef.h ++** ++** Copyright 2004-2007 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt_errordef.h ++** ++** Description: Definition of bits in status/error word used by various ++** MicroTuner control programs. ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_errordef.h,v 1.2 2008/11/05 13:46:19 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt_errordef.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 09-09-2004 JWS Original ++** 088 01-26-2005 DAD Added MT_TUNER_INIT_ERR. ++** N/A 12-09-2005 DAD Added MT_TUNER_TIMEOUT (info). ++** N/A 10-17-2006 JWS Updated copyright notice. ++** N/A L 02-25-2008 RSK Correcting Comment Block to match constants. ++** ++*****************************************************************************/ ++ ++/* ++** Note to users: DO NOT EDIT THIS FILE ++** ++** If you wish to rename any of the "user defined" bits, ++** it should be done in the user file that includes this ++** source file (e.g. mt_userdef.h) ++** ++*/ ++ ++ ++ ++/* ++** 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 ++** 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ++** M U <- Info Codes --> <# Spurs> < User> <----- Err Codes -----> ++** ++** 31 = MT_ERROR - Master Error Flag. If set, check Err Codes for reason. ++** 30 = MT_USER_ERROR - User-declared error flag. ++** 29 = Unused ++** 28 = Unused ++** ++** 27 = MT_DNC_RANGE ++** 26 = MT_UPC_RANGE ++** 25 = MT_FOUT_RANGE ++** 24 = MT_FIN_OUT_OF_RANGE ++** ++** 23 = MT_SPUR_PRESENT - Unavoidable spur in output ++** 22 = MT_TUNER_TIMEOUT ++** 21 = Unused ++** 20 = MT_SPUR_CNT_MASK (MSB) - Count of avoided spurs ++** ++** 19 = MT_SPUR_CNT_MASK ++** 18 = MT_SPUR_CNT_MASK ++** 17 = MT_SPUR_CNT_MASK ++** 16 = MT_SPUR_CNT_MASK (LSB) ++** ++** 15 = MT_USER_DEFINED4 - User-definable bit (see MT_Userdef.h) ++** 14 = MT_USER_DEFINED3 - User-definable bit (see MT_Userdef.h) ++** 13 = MT_USER_DEFINED2 - User-definable bit (see MT_Userdef.h) ++** 12 = MT_USER_DEFINED1 - User-definable bit (see MT_Userdef.h) ++** ++** 11 = Unused ++** 10 = Unused ++** 9 = MT_TUNER_INIT_ERR - Tuner initialization error ++** 8 = MT_TUNER_ID_ERR - Tuner Part Code / Rev Code mismatches expected value ++** ++** 7 = MT_TUNER_CNT_ERR - Attempt to open more than MT_TUNER_CNT tuners ++** 6 = MT_ARG_NULL - Null pointer passed as argument ++** 5 = MT_ARG_RANGE - Argument value out of range ++** 4 = MT_INV_HANDLE - Tuner handle is invalid ++** ++** 3 = MT_COMM_ERR - Serial bus communications error ++** 2 = MT_DNC_UNLOCK - Downconverter PLL is unlocked ++** 1 = MT_UPC_UNLOCK - Upconverter PLL is unlocked ++** 0 = MT_UNKNOWN - Unknown error ++*/ ++#define MT_ERROR (1 << 31) ++#define MT_USER_ERROR (1 << 30) ++ ++/* Macro to be used to check for errors */ ++#define MT_IS_ERROR(s) (((s) >> 30) != 0) ++#define MT_NO_ERROR(s) (((s) >> 30) == 0) ++ ++ ++#define MT_OK (0x00000000) ++ ++/* Unknown error */ ++#define MT_UNKNOWN (0x80000001) ++ ++/* Error: Upconverter PLL is not locked */ ++#define MT_UPC_UNLOCK (0x80000002) ++ ++/* Error: Downconverter PLL is not locked */ ++#define MT_DNC_UNLOCK (0x80000004) ++ ++/* Error: Two-wire serial bus communications error */ ++#define MT_COMM_ERR (0x80000008) ++ ++/* Error: Tuner handle passed to function was invalid */ ++#define MT_INV_HANDLE (0x80000010) ++ ++/* Error: Function argument is invalid (out of range) */ ++#define MT_ARG_RANGE (0x80000020) ++ ++/* Error: Function argument (ptr to return value) was NULL */ ++#define MT_ARG_NULL (0x80000040) ++ ++/* Error: Attempt to open more than MT_TUNER_CNT tuners */ ++#define MT_TUNER_CNT_ERR (0x80000080) ++ ++/* Error: Tuner Part Code / Rev Code mismatches expected value */ ++#define MT_TUNER_ID_ERR (0x80000100) ++ ++/* Error: Tuner Initialization failure */ ++#define MT_TUNER_INIT_ERR (0x80000200) ++ ++/* User-definable fields (see mt_userdef.h) */ ++#define MT_USER_DEFINED1 (0x00001000) ++#define MT_USER_DEFINED2 (0x00002000) ++#define MT_USER_DEFINED3 (0x00004000) ++#define MT_USER_DEFINED4 (0x00008000) ++#define MT_USER_MASK (0x4000f000) ++#define MT_USER_SHIFT (12) ++ ++/* Info: Mask of bits used for # of LO-related spurs that were avoided during tuning */ ++#define MT_SPUR_CNT_MASK (0x001f0000) ++#define MT_SPUR_SHIFT (16) ++ ++/* Info: Tuner timeout waiting for condition */ ++#define MT_TUNER_TIMEOUT (0x00400000) ++ ++/* Info: Unavoidable LO-related spur may be present in the output */ ++#define MT_SPUR_PRESENT (0x00800000) ++ ++/* Info: Tuner input frequency is out of range */ ++#define MT_FIN_RANGE (0x01000000) ++ ++/* Info: Tuner output frequency is out of range */ ++#define MT_FOUT_RANGE (0x02000000) ++ ++/* Info: Upconverter frequency is out of range (may be reason for MT_UPC_UNLOCK) */ ++#define MT_UPC_RANGE (0x04000000) ++ ++/* Info: Downconverter frequency is out of range (may be reason for MT_DPC_UNLOCK) */ ++#define MT_DNC_RANGE (0x08000000) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt_userdef.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt_userdef.h ++** ++** Copyright 2006-2008 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable and the terms of the end-user software ++** license agreement (EULA). ++** ++** Protected by US Patent 7,035,614 and additional patents pending or filed. ++** ++** BY INSTALLING, COPYING, OR USING THE MICROTUNE SOFTWARE, YOU AGREE TO BE ++** BOUND BY ALL OF THE TERMS AND CONDITIONS OF THE MICROTUNE, INC. END-USER ++** SOFTWARE LICENSE AGREEMENT (EULA), INCLUDING BUT NOT LIMITED TO, THE ++** CONFIDENTIALITY OBLIGATIONS DESCRIBED THEREIN. IF YOU DO NOT AGREE, DO NOT ++** INSTALL, COPY, OR USE THE MICROTUNE SOFTWARE AND IMMEDIATELY RETURN OR ++** DESTROY ANY COPIES OF MICROTUNE SOFTWARE OR CONFIDENTIAL INFORMATION THAT ++** YOU HAVE IN YOUR POSSESSION. ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt_userdef.h ++** ++** Description: User-defined data types needed by MicroTuner source code. ++** ++** Customers must provide the code for these functions ++** in the file "mt_userdef.c". ++** ++** Customers must verify that the typedef's in the ++** "Data Types" section are correct for their platform. ++** ++** Functions ++** Requiring ++** Implementation: MT_WriteSub ++** MT_ReadSub ++** MT_Sleep ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_userdef.h,v 1.2 2008/11/05 13:46:20 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt_userdef.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** 082 12-06-2004 JWS Multi-tuner support - requires MTxxxx_CNT ++** declarations ++** N/A 04-13-2007 JWS Added Signed 8-bit type - S8Data ++** 200 08-07-2008 JWS Included definition of DECT avoid constants. ++** ++*****************************************************************************/ ++#if !defined( __MT_USERDEF_H ) ++#define __MT_USERDEF_H ++ ++#include ++//#include "mt_errordef.h" ++ ++#if defined( __cplusplus ) ++extern "C" /* Use "C" external linkage */ ++{ ++#endif ++ ++#if !defined( __MT_DATA_DEF_H ) ++#define __MT_DATA_DEF_H ++/* ++** Data Types ++*/ ++typedef unsigned char U8Data; /* type corresponds to 8 bits */ ++typedef signed char S8Data; /* type corresponds to 8 bits */ ++typedef unsigned int UData_t; /* type must be at least 32 bits */ ++typedef int SData_t; /* type must be at least 32 bits */ ++typedef void * Handle_t; /* memory pointer type */ ++typedef double FData_t; /* floating point data type */ ++#endif ++#define MAX_UDATA (4294967295U) /* max value storable in UData_t */ ++ ++/* ++** Define an MTxxxx_CNT macro for each type of tuner that will be built ++** into your application (e.g., MT2121, MT2060). MT_TUNER_CNT ++** must be set to the SUM of all of the MTxxxx_CNT macros. ++** ++** #define MT2050_CNT (1) ++** #define MT2060_CNT (1) ++** #define MT2111_CNT (1) ++** #define MT2121_CNT (3) ++*/ ++ ++ ++#if !defined( MT_TUNER_CNT ) ++#define MT_TUNER_CNT (1) /* total num of MicroTuner tuners */ ++#endif ++ ++#ifndef _MT_DECT_Avoid_Type_DEFINE_ ++#define _MT_DECT_Avoid_Type_DEFINE_ ++// ++// DECT Frequency Avoidance: ++// These constants are used to avoid interference from DECT frequencies. ++// ++typedef enum ++{ ++ MT_NO_DECT_AVOIDANCE = 0, /* Do not create DECT exclusion zones. */ ++ MT_AVOID_US_DECT = 0x00000001, /* Avoid US DECT frequencies. */ ++ MT_AVOID_EURO_DECT = 0x00000002, /* Avoid European DECT frequencies. */ ++ MT_AVOID_BOTH /* Avoid both regions. Not typically used. */ ++} MT_DECT_Avoid_Type; ++#endif ++/* ++** Optional user-defined Error/Info Codes (examples below) ++** ++** This is the area where you can define user-specific error/info return ++** codes to be returned by any of the functions you are responsible for ++** writing such as MT_WriteSub() and MT_ReadSub. There are four bits ++** available in the status field for your use. When set, these ++** bits will be returned in the status word returned by any tuner driver ++** call. If you OR in the MT_ERROR bit as well, the tuner driver code ++** will treat the code as an error. ++** ++** The following are a few examples of errors you can provide. ++** ++** Example 1: ++** You might check to see the hUserData handle is correct and issue ++** MY_USERDATA_INVALID which would be defined like this: ++** ++** #define MY_USERDATA_INVALID (MT_USER_ERROR | MT_USER_DEFINED1) ++** ++** ++** Example 2: ++** You might be able to provide more descriptive two-wire bus errors: ++** ++** #define NO_ACK (MT_USER_ERROR | MT_USER_DEFINED1) ++** #define NO_NACK (MT_USER_ERROR | MT_USER_DEFINED2) ++** #define BUS_BUSY (MT_USER_ERROR | MT_USER_DEFINED3) ++** ++** ++** Example 3: ++** You can also provide information (non-error) feedback: ++** ++** #define MY_INFO_1 (MT_USER_DEFINED1) ++** ++** ++** Example 4: ++** You can combine the fields together to make a multi-bit field. ++** This one can provide the tuner number based off of the addr ++** passed to MT_WriteSub or MT_ReadSub. It assumes that ++** MT_USER_DEFINED4 through MT_USER_DEFINED1 are contiguously. If ++** TUNER_NUM were OR'ed into the status word on an error, you could ++** use this to identify which tuner had the problem (and whether it ++** was during a read or write operation). ++** ++** #define TUNER_NUM ((addr & 0x07) >> 1) << MT_USER_SHIFT ++** ++*/ ++ ++/***************************************************************************** ++** ++** Name: MT_WriteSub ++** ++** Description: Write values to device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to write data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2063_WriteSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt); ++ ++ ++/***************************************************************************** ++** ++** Name: MT_ReadSub ++** ++** Description: Read values from device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to read data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2063_ReadSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt); ++ ++ ++/***************************************************************************** ++** ++** Name: MT_Sleep ++** ++** Description: Delay execution for "nMinDelayTime" milliseconds ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** nMinDelayTime - Delay time in milliseconds ++** ++** Returns: None. ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code that ++** blocks execution for the specified period of time. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++void MT2063_Sleep(Handle_t hUserData, ++ UData_t nMinDelayTime); ++ ++ ++#if defined(MT2060_CNT) ++#if MT2060_CNT > 0 ++/***************************************************************************** ++** ++** Name: MT_TunerGain (for MT2060 only) ++** ++** Description: Measure the relative tuner gain using the demodulator ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** pMeas - Tuner gain (1/100 of dB scale). ++** ie. 1234 = 12.34 (dB) ++** ++** Returns: status: ++** MT_OK - No errors ++** user-defined errors could be set ++** ++** Notes: This is a callback function that is called from the ++** the 1st IF location routine. You MUST provide ++** code that measures the relative tuner gain in a dB ++** (not linear) scale. The return value is an integer ++** value scaled to 1/100 of a dB. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 06-16-2004 DAD Original ++** N/A 11-30-2004 DAD Renamed from MT_DemodInputPower. This name ++** better describes what this function does. ++** ++*****************************************************************************/ ++UData_t MT_TunerGain(Handle_t hUserData, ++ SData_t* pMeas); ++#endif ++#endif ++ ++#if defined( __cplusplus ) ++} ++#endif ++ ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt2063.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt2063.h ++** ++** Copyright 2007 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt2063.h ++** ++** Description: Microtune MT2063 B0/B1 Tuner software interface ++** Supports tuners with Part/Rev codes: 0x9B, 0x9C. ++** ++** Functions ++** Implemented: UData_t MT2063_Open ++** UData_t MT2063_Close ++** UData_t MT2063_GetGPIO ++** UData_t MT2063_GetLocked ++** UData_t MT2063_GetParam ++** UData_t MT2063_GetPowerMaskBits ++** UData_t MT2063_GetReg ++** UData_t MT2063_GetTemp ++** UData_t MT2063_GetUserData ++** UData_t MT2063_ReInit ++** UData_t MT2063_SetGPIO ++** UData_t MT2063_SetParam ++** UData_t MT2063_SetPowerMaskBits ++** UData_t MT2063_ClearPowerMaskBits ++** UData_t MT2063_SetReg ++** UData_t MT2063_Tune ++** ++** References: AN-xxxxx: MT2063 Programming Procedures Application Note ++** MicroTune, Inc. ++** AN-00010: MicroTuner Serial Interface Application Note ++** MicroTune, Inc. ++** ++** Enumerations ++** Defined: MT2063_Ext_SRO ++** MT2063_Param ++** MT2063_Mask_Bits ++** MT2063_GPIO_Attr; ++** MT2063_Temperature ++** ++** Exports: None ++** ++** Dependencies: MT_ReadSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Read byte(s) of data from the two-wire bus. ++** ++** MT_WriteSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Write byte(s) of data to the two-wire bus. ++** ++** MT_Sleep(hUserData, nMinDelayTime); ++** - Delay execution for nMinDelayTime milliseconds ++** ++** CVS ID: $Id: mt2063.h,v 1.5 2009/04/29 09:58:14 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt2063.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** N/A 08-01-2007 PINZ Changed Analog & DVB-T settings and added ++** SAW-less receiver mode. ++** 155 10-01-2007 DAD Ver 1.06: Add receiver mode for SECAM positive ++** modulation ++** (MT2063_ANALOG_TV_POS_NO_RFAGC_MODE) ++** N/A 10-22-2007 PINZ Ver 1.07: Changed some Registers at init to have ++** the same settings as with MT Launcher ++** N/A 10-30-2007 PINZ Add SetParam VGAGC & VGAOI ++** Add SetParam DNC_OUTPUT_ENABLE ++** Removed VGAGC from receiver mode, ++** default now 1 ++** N/A 10-31-2007 PINZ Ver 1.08: Add SetParam TAGC, removed from rcvr-mode ++** Add SetParam AMPGC, removed from rcvr-mode ++** Corrected names of GCU values ++** Actualized Receiver-Mode values ++** N/A 04-18-2008 PINZ Ver 1.09: Add SetParam LNA_TGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 175 I 06-06-2008 PINZ Ver 1.10: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 175 I 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 07-10-2008 PINZ Ver 1.19: Documentation Updates, Add a GetParam ++** for each SetParam (LNA_RIN, TGTs) ++** 01-07-2009 PINZ Ver 1.27: Changed value of MT2063_ALL_SD in .h ++** 02-16-2009 PINZ Ver 1.29: Several fixes to improve compiler behavior ++** N/A I 03-19-2009 PINZ Ver 1.32: Add GetParam VERSION (of API) ++** Add GetParam IC_REV ++*****************************************************************************/ ++#if !defined( __MT2063_H ) ++#define __MT2063_H ++ ++//#include "mt_userdef.h" ++ ++#if defined( __cplusplus ) ++extern "C" /* Use "C" external linkage */ ++{ ++#endif ++ ++ ++/* ++** Chip revision ++** ++*/ ++typedef enum ++{ ++ MT2063_XX = 0, ++ MT2063_B0 = 206310, ++ MT2063_B1 = 206311, ++ MT2063_B3 = 206313 ++} MT2063_REVCODE; ++ ++ ++/* ++** Values returned by the MT2063's on-chip temperature sensor ++** to be read/written. ++*/ ++typedef enum ++{ ++ MT2063_T_0C = 0, /* Temperature approx 0C */ ++ MT2063_T_10C, /* Temperature approx 10C */ ++ MT2063_T_20C, /* Temperature approx 20C */ ++ MT2063_T_30C, /* Temperature approx 30C */ ++ MT2063_T_40C, /* Temperature approx 40C */ ++ MT2063_T_50C, /* Temperature approx 50C */ ++ MT2063_T_60C, /* Temperature approx 60C */ ++ MT2063_T_70C, /* Temperature approx 70C */ ++ MT2063_T_80C, /* Temperature approx 80C */ ++ MT2063_T_90C, /* Temperature approx 90C */ ++ MT2063_T_100C, /* Temperature approx 100C */ ++ MT2063_T_110C, /* Temperature approx 110C */ ++ MT2063_T_120C, /* Temperature approx 120C */ ++ MT2063_T_130C, /* Temperature approx 130C */ ++ MT2063_T_140C, /* Temperature approx 140C */ ++ MT2063_T_150C /* Temperature approx 150C */ ++} MT2063_Temperature; ++ ++ ++/* ++** Parameters for selecting GPIO bits ++*/ ++typedef enum ++{ ++ MT2063_GPIO_IN, ++ MT2063_GPIO_DIR, ++ MT2063_GPIO_OUT ++} MT2063_GPIO_Attr; ++ ++typedef enum ++{ ++ MT2063_GPIO0, ++ MT2063_GPIO1, ++ MT2063_GPIO2 ++} MT2063_GPIO_ID; ++ ++ ++/* ++** Parameter for function MT2063_SetExtSRO that specifies the external ++** SRO drive frequency. ++** ++** MT2063_EXT_SRO_OFF is the power-up default value. ++*/ ++typedef enum ++{ ++ MT2063_EXT_SRO_OFF, /* External SRO drive off */ ++ MT2063_EXT_SRO_BY_4, /* External SRO drive divide by 4 */ ++ MT2063_EXT_SRO_BY_2, /* External SRO drive divide by 2 */ ++ MT2063_EXT_SRO_BY_1 /* External SRO drive divide by 1 */ ++} MT2063_Ext_SRO; ++ ++ ++/* ++** Parameter for function MT2063_SetPowerMask that specifies the power down ++** of various sections of the MT2063. ++*/ ++typedef enum ++{ ++ MT2063_REG_SD = 0x0040, /* Shutdown regulator */ ++ MT2063_SRO_SD = 0x0020, /* Shutdown SRO */ ++ MT2063_AFC_SD = 0x0010, /* Shutdown AFC A/D */ ++ MT2063_PD_SD = 0x0002, /* Enable power detector shutdown */ ++ MT2063_PDADC_SD = 0x0001, /* Enable power detector A/D shutdown */ ++ MT2063_VCO_SD = 0x8000, /* Enable VCO shutdown */ ++ MT2063_LTX_SD = 0x4000, /* Enable LTX shutdown */ ++ MT2063_LT1_SD = 0x2000, /* Enable LT1 shutdown */ ++ MT2063_LNA_SD = 0x1000, /* Enable LNA shutdown */ ++ MT2063_UPC_SD = 0x0800, /* Enable upconverter shutdown */ ++ MT2063_DNC_SD = 0x0400, /* Enable downconverter shutdown */ ++ MT2063_VGA_SD = 0x0200, /* Enable VGA shutdown */ ++ MT2063_AMP_SD = 0x0100, /* Enable AMP shutdown */ ++ MT2063_ALL_SD = 0xFF13, /* All shutdown bits for this tuner */ ++ MT2063_NONE_SD = 0x0000 /* No shutdown bits */ ++} MT2063_Mask_Bits; ++ ++ ++/* ++** Parameter for function MT2063_GetParam & MT2063_SetParam that ++** specifies the tuning algorithm parameter to be read/written. ++*/ ++typedef enum ++{ ++ /* version of the API, e.g. 10302 = 1.32 */ ++ MT2063_VER, ++ ++ /* tuner address set by MT2063_Open() */ ++ MT2063_IC_ADDR, ++ ++ /* tuner revision code (see enum MT2063_REVCODE for values) */ ++ MT2063_IC_REV, ++ ++ /* max number of MT2063 tuners set by MT_TUNER_CNT in mt_userdef.h */ ++ MT2063_MAX_OPEN, ++ ++ /* current number of open MT2063 tuners set by MT2063_Open() */ ++ MT2063_NUM_OPEN, ++ ++ /* crystal frequency (default: 16000000 Hz) */ ++ MT2063_SRO_FREQ, ++ ++ /* min tuning step size (default: 50000 Hz) */ ++ MT2063_STEPSIZE, ++ ++ /* input center frequency set by MT2063_Tune() */ ++ MT2063_INPUT_FREQ, ++ ++ /* LO1 Frequency set by MT2063_Tune() */ ++ MT2063_LO1_FREQ, ++ ++ /* LO1 minimum step size (default: 250000 Hz) */ ++ MT2063_LO1_STEPSIZE, ++ ++ /* LO1 FracN keep-out region (default: 999999 Hz) */ ++ MT2063_LO1_FRACN_AVOID, ++ ++ /* Current 1st IF in use set by MT2063_Tune() */ ++ MT2063_IF1_ACTUAL, ++ ++ /* Requested 1st IF set by MT2063_Tune() */ ++ MT2063_IF1_REQUEST, ++ ++ /* Center of 1st IF SAW filter (default: 1218000000 Hz) */ ++ MT2063_IF1_CENTER, ++ ++ /* Bandwidth of 1st IF SAW filter (default: 20000000 Hz) */ ++ MT2063_IF1_BW, ++ ++ /* zero-IF bandwidth (default: 2000000 Hz) */ ++ MT2063_ZIF_BW, ++ ++ /* LO2 Frequency set by MT2063_Tune() */ ++ MT2063_LO2_FREQ, ++ ++ /* LO2 minimum step size (default: 50000 Hz) */ ++ MT2063_LO2_STEPSIZE, ++ ++ /* LO2 FracN keep-out region (default: 374999 Hz) */ ++ MT2063_LO2_FRACN_AVOID, ++ ++ /* output center frequency set by MT2063_Tune() */ ++ MT2063_OUTPUT_FREQ, ++ ++ /* output bandwidth set by MT2063_Tune() */ ++ MT2063_OUTPUT_BW, ++ ++ /* min inter-tuner LO separation (default: 1000000 Hz) */ ++ MT2063_LO_SEPARATION, ++ ++ /* ID of avoid-spurs algorithm in use compile-time constant */ ++ MT2063_AS_ALG, ++ ++ /* max # of intra-tuner harmonics (default: 15) */ ++ MT2063_MAX_HARM1, ++ ++ /* max # of inter-tuner harmonics (default: 7) */ ++ MT2063_MAX_HARM2, ++ ++ /* # of 1st IF exclusion zones used set by MT2063_Tune() */ ++ MT2063_EXCL_ZONES, ++ ++ /* # of spurs found/avoided set by MT2063_Tune() */ ++ MT2063_NUM_SPURS, ++ ++ /* >0 spurs avoided set by MT2063_Tune() */ ++ MT2063_SPUR_AVOIDED, ++ ++ /* >0 spurs in output (mathematically) set by MT2063_Tune() */ ++ MT2063_SPUR_PRESENT, ++ ++ /* Receiver Mode for some parameters. 1 is DVB-T */ ++ MT2063_RCVR_MODE, ++ ++ /* directly set LNA attenuation, parameter is value to set */ ++ MT2063_ACLNA, ++ ++ /* maximum LNA attenuation, parameter is value to set */ ++ MT2063_ACLNA_MAX, ++ ++ /* directly set ATN attenuation. Paremeter is value to set. */ ++ MT2063_ACRF, ++ ++ /* maxium ATN attenuation. Paremeter is value to set. */ ++ MT2063_ACRF_MAX, ++ ++ /* directly set FIF attenuation. Paremeter is value to set. */ ++ MT2063_ACFIF, ++ ++ /* maxium FIF attenuation. Paremeter is value to set. */ ++ MT2063_ACFIF_MAX, ++ ++ /* LNA Rin */ ++ MT2063_LNA_RIN, ++ ++ /* Power Detector LNA level target */ ++ MT2063_LNA_TGT, ++ ++ /* Power Detector 1 level */ ++ MT2063_PD1, ++ ++ /* Power Detector 1 level target */ ++ MT2063_PD1_TGT, ++ ++ /* Power Detector 2 level */ ++ MT2063_PD2, ++ ++ /* Power Detector 2 level target */ ++ MT2063_PD2_TGT, ++ ++ /* Selects, which DNC is activ */ ++ MT2063_DNC_OUTPUT_ENABLE, ++ ++ /* VGA gain code */ ++ MT2063_VGAGC, ++ ++ /* VGA bias current */ ++ MT2063_VGAOI, ++ ++ /* TAGC, determins the speed of the AGC */ ++ MT2063_TAGC, ++ ++ /* AMP gain code */ ++ MT2063_AMPGC, ++ ++ /* Control setting to avoid DECT freqs (default: MT_AVOID_BOTH) */ ++ MT2063_AVOID_DECT, ++ ++ /* Cleartune filter selection: 0 - by IC (default), 1 - by software */ ++ MT2063_CTFILT_SW, ++ ++ MT2063_EOP /* last entry in enumerated list */ ++ ++} MT2063_Param; ++ ++ ++/* ++** Parameter for selecting tuner mode ++*/ ++typedef enum ++{ ++ MT2063_CABLE_QAM = 0, /* Digital cable */ ++ MT2063_CABLE_ANALOG, /* Analog cable */ ++ MT2063_OFFAIR_COFDM, /* Digital offair */ ++ MT2063_OFFAIR_COFDM_SAWLESS, /* Digital offair without SAW */ ++ MT2063_OFFAIR_ANALOG, /* Analog offair */ ++ MT2063_OFFAIR_8VSB, /* Analog offair */ ++ MT2063_NUM_RCVR_MODES ++} MT2063_RCVR_MODES; ++ ++ ++/* ++** Possible values for MT2063_DNC_OUTPUT ++*/ ++typedef enum { ++ MT2063_DNC_NONE = 0, ++ MT2063_DNC_1, ++ MT2063_DNC_2, ++ MT2063_DNC_BOTH ++} MT2063_DNC_Output_Enable; ++ ++ ++/* ====== Functions which are declared in MT2063.c File ======= */ ++ ++/****************************************************************************** ++** ++** Name: MT2063_Open ++** ++** Description: Initialize the tuner's register values. ++** ++** Usage: status = MT2063_Open(0xC0, &hMT2063, NULL); ++** if (MT_IS_ERROR(status)) ++** // Check error codes for reason ++** ++** Parameters: MT2063_Addr - Serial bus address of the tuner. ++** hMT2063 - Tuner handle passed back. ++** hUserData - User-defined data, if needed for the ++** MT_ReadSub() & MT_WriteSub functions. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** MT_COMM_ERR - Serial bus communications error ++** MT_ARG_NULL - Null pointer argument passed ++** MT_TUNER_CNT_ERR - Too many tuners open ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_Open(UData_t MT2063_Addr, ++ Handle_t* hMT2063, ++ Handle_t hUserData); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_Close ++** ++** Description: Release the handle to the tuner. ++** ++** Parameters: hMT2063 - Handle to the MT2063 tuner ++** ++** Usage: status = MT2063_Close(hMT2063); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_Close(Handle_t hMT2063); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_Tune ++** ++** Description: Change the tuner's tuned frequency to f_in. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** f_in - RF input center frequency (in Hz). ++** ++** Usage: status = MT2063_Tune(hMT2063, ++** f_in) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_UPC_UNLOCK - Upconverter PLL unlocked ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_SPUR_CNT_MASK - Count of avoided LO spurs ++** MT_SPUR_PRESENT - LO spur possible in output ++** MT_FIN_RANGE - Input freq out of range ++** MT_FOUT_RANGE - Output freq out of range ++** MT_UPC_RANGE - Upconverter freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2063_Open BEFORE MT2063_Tune! ++** ++** MT_ReadSub - Read data from the two-wire serial bus ++** MT_WriteSub - Write data to the two-wire serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_Tune(Handle_t h, ++ UData_t f_in); /* RF input center frequency */ ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_GetGPIO ++** ++** Description: Get the current MT2063 GPIO value. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** attr - Selects input readback, I/O direction or ++** output value ++** bit - Selects GPIO0, GPIO1, or GPIO2 ++** *value - current setting of GPIO pin ++** ++** Usage: status = MT2063_GetGPIO(hMT2063, MT2063_GPIO2, &value); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_GetGPIO(Handle_t h, MT2063_GPIO_ID gpio_id, MT2063_GPIO_Attr attr, UData_t* value); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetLocked ++** ++** Description: Checks to see if LO1 and LO2 are locked. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** ++** Usage: status = MT2063_GetLocked(hMT2063); ++** if (status & (MT_UPC_UNLOCK | MT_DNC_UNLOCK)) ++** // error!, one or more PLL's unlocked ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_UPC_UNLOCK - Upconverter PLL unlocked ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetLocked(Handle_t h); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetParam ++** ++** Description: Gets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm - mostly for testing purposes. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2063_Param) ++** pValue - ptr to returned value ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2063_IC_ADDR Serial Bus address of this tuner ++** MT2063_MAX_OPEN Max # of MT2063's allowed open ++** MT2063_NUM_OPEN # of MT2063's open ++** MT2063_SRO_FREQ crystal frequency ++** MT2063_STEPSIZE minimum tuning step size ++** MT2063_INPUT_FREQ input center frequency ++** MT2063_LO1_FREQ LO1 Frequency ++** MT2063_LO1_STEPSIZE LO1 minimum step size ++** MT2063_LO1_FRACN_AVOID LO1 FracN keep-out region ++** MT2063_IF1_ACTUAL Current 1st IF in use ++** MT2063_IF1_REQUEST Requested 1st IF ++** MT2063_IF1_CENTER Center of 1st IF SAW filter ++** MT2063_IF1_BW Bandwidth of 1st IF SAW filter ++** MT2063_ZIF_BW zero-IF bandwidth ++** MT2063_LO2_FREQ LO2 Frequency ++** MT2063_LO2_STEPSIZE LO2 minimum step size ++** MT2063_LO2_FRACN_AVOID LO2 FracN keep-out region ++** MT2063_OUTPUT_FREQ output center frequency ++** MT2063_OUTPUT_BW output bandwidth ++** MT2063_LO_SEPARATION min inter-tuner LO separation ++** MT2063_AS_ALG ID of avoid-spurs algorithm in use ++** MT2063_MAX_HARM1 max # of intra-tuner harmonics ++** MT2063_MAX_HARM2 max # of inter-tuner harmonics ++** MT2063_EXCL_ZONES # of 1st IF exclusion zones ++** MT2063_NUM_SPURS # of spurs found/avoided ++** MT2063_SPUR_AVOIDED >0 spurs avoided ++** MT2063_SPUR_PRESENT >0 spurs in output (mathematically) ++** MT2063_RCVR_MODE Predefined modes. ++** MT2063_LNA_RIN Get LNA RIN value ++** MT2063_LNA_TGT Get target power level at LNA ++** MT2063_PD1_TGT Get target power level at PD1 ++** MT2063_PD2_TGT Get target power level at PD2 ++** MT2063_ACLNA LNA attenuator gain code ++** MT2063_ACRF RF attenuator gain code ++** MT2063_ACFIF FIF attenuator gain code ++** MT2063_ACLNA_MAX LNA attenuator limit ++** MT2063_ACRF_MAX RF attenuator limit ++** MT2063_ACFIF_MAX FIF attenuator limit ++** MT2063_PD1 Actual value of PD1 ++** MT2063_PD2 Actual value of PD2 ++** MT2063_DNC_OUTPUT_ENABLE DNC output selection ++** MT2063_VGAGC VGA gain code ++** MT2063_VGAOI VGA output current ++** MT2063_TAGC TAGC setting ++** MT2063_AMPGC AMP gain code ++** MT2063_AVOID_DECT Avoid DECT Frequencies ++** MT2063_CTFILT_SW Cleartune filter selection ++** ++** Usage: status |= MT2063_GetParam(hMT2063, ++** MT2063_IF1_ACTUAL, ++** &f_IF1_Actual); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** See Also: MT2063_SetParam, MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 154 09-13-2007 RSK Ver 1.05: Get/SetParam changes for LOx_FREQ ++** 10-31-2007 PINZ Ver 1.08: Get/SetParam add VGAGC, VGAOI, AMPGC, TAGC ++** 173 M 01-23-2008 RSK Ver 1.12: Read LO1C and LO2C registers from HW ++** in GetParam. ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 175 I 16-06-2008 PINZ Ver 1.16: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** 07-10-2008 PINZ Ver 1.19: Documentation Updates, Add a GetParam ++** for each SetParam (LNA_RIN, TGTs) ++** ++****************************************************************************/ ++UData_t MT2063_GetParam(Handle_t h, ++ MT2063_Param param, ++ UData_t* pValue); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetReg ++** ++** Description: Gets an MT2063 register. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** reg - MT2063 register/subaddress location ++** *val - MT2063 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Use this function if you need to read a register from ++** the MT2063. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetReg(Handle_t h, ++ U8Data reg, ++ U8Data* val); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_GetTemp ++** ++** Description: Get the MT2063 Temperature register. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** *value - value read from the register ++** ++** Binary ++** Value Returned Value Approx Temp ++** --------------------------------------------- ++** MT2063_T_0C 0000 0C ++** MT2063_T_10C 0001 10C ++** MT2063_T_20C 0010 20C ++** MT2063_T_30C 0011 30C ++** MT2063_T_40C 0100 40C ++** MT2063_T_50C 0101 50C ++** MT2063_T_60C 0110 60C ++** MT2063_T_70C 0111 70C ++** MT2063_T_80C 1000 80C ++** MT2063_T_90C 1001 90C ++** MT2063_T_100C 1010 100C ++** MT2063_T_110C 1011 110C ++** MT2063_T_120C 1100 120C ++** MT2063_T_130C 1101 130C ++** MT2063_T_140C 1110 140C ++** MT2063_T_150C 1111 150C ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_GetTemp(Handle_t h, MT2063_Temperature* value); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetUserData ++** ++** Description: Gets the user-defined data item. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** ++** Usage: status = MT2063_GetUserData(hMT2063, &hUserData); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** The hUserData parameter is a user-specific argument ++** that is stored internally with the other tuner- ++** specific information. ++** ++** For example, if additional arguments are needed ++** for the user to identify the device communicating ++** with the tuner, this argument can be used to supply ++** the necessary information. ++** ++** The hUserData parameter is initialized in the tuner's ++** Open function to NULL. ++** ++** See Also: MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetUserData(Handle_t h, ++ Handle_t* hUserData); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_ReInit ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_ReInit(Handle_t h); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2063_SetGPIO ++** ++** Description: Modify the MT2063 GPIO value. ++** ++** Parameters: h - Open handle to the tuner (from MT2063_Open). ++** gpio_id - Selects GPIO0, GPIO1, or GPIO2 ++** attr - Selects input readback, I/O direction or ++** output value ++** value - value to set GPIO pin ++** ++** Usage: status = MT2063_SetGPIO(hMT2063, MT2063_GPIO1, MT2063_GPIO_OUT, 1); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++******************************************************************************/ ++UData_t MT2063_SetGPIO(Handle_t h, MT2063_GPIO_ID gpio_id, MT2063_GPIO_Attr attr, UData_t value); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetParam ++** ++** Description: Sets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm. You can override many of the tuning ++** algorithm defaults using this function. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2063_Param) ++** nValue - value to be set ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2063_SRO_FREQ crystal frequency ++** MT2063_STEPSIZE minimum tuning step size ++** MT2063_LO1_FREQ LO1 frequency ++** MT2063_LO1_STEPSIZE LO1 minimum step size ++** MT2063_LO1_FRACN_AVOID LO1 FracN keep-out region ++** MT2063_IF1_REQUEST Requested 1st IF ++** MT2063_ZIF_BW zero-IF bandwidth ++** MT2063_LO2_FREQ LO2 frequency ++** MT2063_LO2_STEPSIZE LO2 minimum step size ++** MT2063_LO2_FRACN_AVOID LO2 FracN keep-out region ++** MT2063_OUTPUT_FREQ output center frequency ++** MT2063_OUTPUT_BW output bandwidth ++** MT2063_LO_SEPARATION min inter-tuner LO separation ++** MT2063_MAX_HARM1 max # of intra-tuner harmonics ++** MT2063_MAX_HARM2 max # of inter-tuner harmonics ++** MT2063_RCVR_MODE Predefined modes ++** MT2063_LNA_RIN Set LNA Rin (*) ++** MT2063_LNA_TGT Set target power level at LNA (*) ++** MT2063_PD1_TGT Set target power level at PD1 (*) ++** MT2063_PD2_TGT Set target power level at PD2 (*) ++** MT2063_ACLNA_MAX LNA attenuator limit (*) ++** MT2063_ACRF_MAX RF attenuator limit (*) ++** MT2063_ACFIF_MAX FIF attenuator limit (*) ++** MT2063_DNC_OUTPUT_ENABLE DNC output selection ++** MT2063_VGAGC VGA gain code ++** MT2063_VGAOI VGA output current ++** MT2063_TAGC TAGC setting ++** MT2063_AMPGC AMP gain code ++** MT2063_AVOID_DECT Avoid DECT Frequencies ++** MT2063_CTFILT_SW Cleartune filter selection ++** ++** (*) This parameter is set by MT2063_RCVR_MODE, do not call ++** additionally. ++** ++** Usage: status |= MT2063_SetParam(hMT2063, ++** MT2063_STEPSIZE, ++** 50000); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** or set value out of range ++** or non-writable parameter ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** See Also: MT2063_GetParam, MT2063_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** 154 09-13-2007 RSK Ver 1.05: Get/SetParam changes for LOx_FREQ ++** 10-31-2007 PINZ Ver 1.08: Get/SetParam add VGAGC, VGAOI, AMPGC, TAGC ++** 04-18-2008 PINZ Ver 1.15: Add SetParam LNARIN & PDxTGT ++** Split SetParam up to ACLNA / ACLNA_MAX ++** removed ACLNA_INRC/DECR (+RF & FIF) ++** removed GCUAUTO / BYPATNDN/UP ++** 175 I 06-06-2008 PINZ Ver 1.16: Add control to avoid US DECT freqs. ++** 175 I 06-19-2008 RSK Ver 1.17: Refactor DECT control to SpurAvoid. ++** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW ++** ++****************************************************************************/ ++UData_t MT2063_SetParam(Handle_t h, ++ MT2063_Param param, ++ UData_t nValue); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetPowerMaskBits ++** ++** Description: Sets the power-down mask bits for various sections of ++** the MT2063 ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to be set. ++** ++** MT2063_ALL_SD All shutdown bits for this tuner ++** ++** MT2063_REG_SD Shutdown regulator ++** MT2063_SRO_SD Shutdown SRO ++** MT2063_AFC_SD Shutdown AFC A/D ++** MT2063_PD_SD Enable power detector shutdown ++** MT2063_PDADC_SD Enable power detector A/D shutdown ++** MT2063_VCO_SD Enable VCO shutdown VCO ++** MT2063_UPC_SD Enable upconverter shutdown ++** MT2063_DNC_SD Enable downconverter shutdown ++** MT2063_VGA_SD Enable VGA shutdown ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SetPowerMaskBits(Handle_t h, MT2063_Mask_Bits Bits); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_ClearPowerMaskBits ++** ++** Description: Clears the power-down mask bits for various sections of ++** the MT2063 ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to be cleared. ++** ++** MT2063_ALL_SD All shutdown bits for this tuner ++** ++** MT2063_REG_SD Shutdown regulator ++** MT2063_SRO_SD Shutdown SRO ++** MT2063_AFC_SD Shutdown AFC A/D ++** MT2063_PD_SD Enable power detector shutdown ++** MT2063_PDADC_SD Enable power detector A/D shutdown ++** MT2063_VCO_SD Enable VCO shutdown VCO ++** MT2063_UPC_SD Enable upconverter shutdown ++** MT2063_DNC_SD Enable downconverter shutdown ++** MT2063_VGA_SD Enable VGA shutdown ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_ClearPowerMaskBits(Handle_t h, MT2063_Mask_Bits Bits); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_GetPowerMaskBits ++** ++** Description: Returns a mask of the enabled power shutdown bits ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Bits - Mask bits to currently set. ++** ++** MT2063_REG_SD Shutdown regulator ++** MT2063_SRO_SD Shutdown SRO ++** MT2063_AFC_SD Shutdown AFC A/D ++** MT2063_PD_SD Enable power detector shutdown ++** MT2063_PDADC_SD Enable power detector A/D shutdown ++** MT2063_VCO_SD Enable VCO shutdown VCO ++** MT2063_UPC_SD Enable upconverter shutdown ++** MT2063_DNC_SD Enable downconverter shutdown ++** MT2063_VGA_SD Enable VGA shutdown ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Output argument is NULL ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_GetPowerMaskBits(Handle_t h, MT2063_Mask_Bits *Bits); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_EnableExternalShutdown ++** ++** Description: Enables or disables the operation of the external ++** shutdown pin ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Enabled - 0 = disable the pin, otherwise enable it ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_EnableExternalShutdown(Handle_t h, U8Data Enabled); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SoftwareShutdown ++** ++** Description: Enables or disables software shutdown function. When ++** Shutdown==1, any section whose power mask is set will be ++** shutdown. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Shutdown - 1 = shutdown the masked sections, otherwise ++** power all sections on ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SoftwareShutdown(Handle_t h, U8Data Shutdown); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetExtSRO ++** ++** Description: Sets the external SRO driver. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** Ext_SRO_Setting - external SRO drive setting ++** ++** (default) MT2063_EXT_SRO_OFF - ext driver off ++** MT2063_EXT_SRO_BY_1 - ext driver = SRO frequency ++** MT2063_EXT_SRO_BY_2 - ext driver = SRO/2 frequency ++** MT2063_EXT_SRO_BY_4 - ext driver = SRO/4 frequency ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** The Ext_SRO_Setting settings default to OFF ++** Use this function if you need to override the default ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SetExtSRO(Handle_t h, MT2063_Ext_SRO Ext_SRO_Setting); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2063_SetReg ++** ++** Description: Sets an MT2063 register. ++** ++** Parameters: h - Tuner handle (returned by MT2063_Open) ++** reg - MT2063 register/subaddress location ++** val - MT2063 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2063_Open() FIRST! ++** ++** Use this function if you need to override a default ++** register value ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b. ++** ++****************************************************************************/ ++UData_t MT2063_SetReg(Handle_t h, ++ U8Data reg, ++ U8Data val); ++ ++ ++#if defined( __cplusplus ) ++} ++#endif ++ ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt_spuravoid.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt_spuravoid.h ++** ++** Copyright 2006-2008 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt_spuravoid.h ++** ++** Description: Implements spur avoidance for MicroTuners ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_spuravoid.h,v 1.4 2008/11/05 13:46:20 software Exp $ ++** CVS Source: $Source: /export/vol0/cvsroot/software/tuners/MT2063/mt_spuravoid.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** 083 02-08-2005 JWS Added separate version number for expected ++** version of MT_SpurAvoid.h ++** 083 02-08-2005 JWS Added function to return the version of the ++** MT_AvoidSpurs source file. ++** 098 04-12-2005 DAD Increased MAX_ZONES from 32 to 48. 32 is ++** sufficient for the default avoidance params. ++** 103 01-31-2005 DAD In MT_AddExclZone(), if the range ++** (f_min, f_max) < 0, ignore the entry. ++** 195 M 06-20-2008 RSK Ver 1.21: Refactoring to place DECT frequency ++** avoidance (US and Euro) in 'SpurAvoidance'. ++** 199 08-06-2008 JWS Ver 1.22: Added 0x1x1 spur frequency calculations ++** and indicate success of AddExclZone operation. ++** 200 08-07-2008 JWS Ver 1.23: Moved definition of DECT avoid constants ++** so users could access them more easily. ++** ++*****************************************************************************/ ++#if !defined(__MT2063_SPURAVOID_H) ++#define __MT2063_SPURAVOID_H ++ ++//#include "mt_userdef.h" ++ ++#if defined( __cplusplus ) ++extern "C" /* Use "C" external linkage */ ++{ ++#endif ++ ++/* ++** Constant defining the version of the following structure ++** and therefore the API for this code. ++** ++** When compiling the tuner driver, the preprocessor will ++** check against this version number to make sure that ++** it matches the version that the tuner driver knows about. ++*/ ++/* Version 010201 => 1.21 */ ++#define MT2063_AVOID_SPURS_INFO_VERSION 010201 ++ ++ ++#define MT2063_MAX_ZONES 48 ++ ++struct MT2063_ExclZone_t; ++ ++struct MT2063_ExclZone_t ++{ ++ UData_t min_; ++ UData_t max_; ++ struct MT2063_ExclZone_t* next_; ++}; ++#ifndef _MT_DECT_Avoid_Type_DEFINE_ ++#define _MT_DECT_Avoid_Type_DEFINE_ ++// ++// DECT Frequency Avoidance: ++// These constants are used to avoid interference from DECT frequencies. ++// ++typedef enum ++{ ++ MT_NO_DECT_AVOIDANCE = 0x00000000, // Do not create DECT exclusion zones. ++ MT_AVOID_US_DECT = 0x00000001, // Avoid US DECT frequencies. ++ MT_AVOID_EURO_DECT = 0x00000002, // Avoid European DECT frequencies. ++ MT_AVOID_BOTH // Avoid both regions. Not typically used. ++} MT_DECT_Avoid_Type; ++#endif ++ ++/* ++** Structure of data needed for Spur Avoidance ++*/ ++typedef struct ++{ ++ UData_t nAS_Algorithm; ++ UData_t f_ref; ++ UData_t f_in; ++ UData_t f_LO1; ++ UData_t f_if1_Center; ++ UData_t f_if1_Request; ++ UData_t f_if1_bw; ++ UData_t f_LO2; ++ UData_t f_out; ++ UData_t f_out_bw; ++ UData_t f_LO1_Step; ++ UData_t f_LO2_Step; ++ UData_t f_LO1_FracN_Avoid; ++ UData_t f_LO2_FracN_Avoid; ++ UData_t f_zif_bw; ++ UData_t f_min_LO_Separation; ++ UData_t maxH1; ++ UData_t maxH2; ++ MT_DECT_Avoid_Type avoidDECT; ++ UData_t bSpurPresent; ++ UData_t bSpurAvoided; ++ UData_t nSpursFound; ++ UData_t nZones; ++ struct MT2063_ExclZone_t* freeZones; ++ struct MT2063_ExclZone_t* usedZones; ++ struct MT2063_ExclZone_t MT_ExclZones[MT2063_MAX_ZONES]; ++} MT2063_AvoidSpursData_t; ++ ++UData_t MT2063_RegisterTuner(MT2063_AvoidSpursData_t* pAS_Info); ++ ++void MT2063_UnRegisterTuner(MT2063_AvoidSpursData_t* pAS_Info); ++ ++void MT2063_ResetExclZones(MT2063_AvoidSpursData_t* pAS_Info); ++ ++UData_t MT2063_AddExclZone(MT2063_AvoidSpursData_t* pAS_Info, ++ UData_t f_min, ++ UData_t f_max); ++ ++UData_t MT2063_ChooseFirstIF(MT2063_AvoidSpursData_t* pAS_Info); ++ ++UData_t MT2063_AvoidSpurs(Handle_t h, ++ MT2063_AvoidSpursData_t* pAS_Info); ++ ++UData_t MT2063_AvoidSpursVersion(void); ++ ++#if defined( __cplusplus ) ++} ++#endif ++ ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is MT2063 tuner API source code ++ ++ ++ ++ ++ ++/** ++ ++@file ++ ++@brief MT2063 tuner module declaration ++ ++One can manipulate MT2063 tuner through MT2063 module. ++MT2063 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// MT2063 API option ++#define MT2063_CNT 4 ++ ++// MT2063 macro ++//#define abs(x) ((x) < 0 ? -(x) : (x)) ++ ++// MT2063 bandwidth shift ++#define MT2063_BANDWIDTH_SHIFT_HZ 1000000 ++ ++ ++ ++// Bandwidth modes ++enum MT2063_BANDWIDTH_MODE ++{ ++ MT2063_BANDWIDTH_6MHZ = 6000000, ++ MT2063_BANDWIDTH_7MHZ = 7000000, ++ MT2063_BANDWIDTH_8MHZ = 8000000, ++}; ++ ++ ++// Standard modes ++enum MT2063_STANDARD_MODE ++{ ++ MT2063_STANDARD_DVBT, ++ MT2063_STANDARD_QAM, ++}; ++ ++ ++// VGAGC settings ++enum MT2063_VGAGC_SETTINGS ++{ ++ MT2063_VGAGC_0X0 = 0x0, ++ MT2063_VGAGC_0X1 = 0x1, ++ MT2063_VGAGC_0X3 = 0x3, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildMt2063Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ int StandardMode, ++ unsigned long IfVgaGainControl ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++mt2063_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++mt2063_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++mt2063_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++mt2063_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++mt2063_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++mt2063_OpenHandle( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++mt2063_CloseHandle( ++ TUNER_MODULE *pTuner ++ ); ++ ++void ++mt2063_GetHandle( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ); ++ ++int ++mt2063_SetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long IfFreqHz ++ ); ++ ++int ++mt2063_GetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ); ++ ++int ++mt2063_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++int ++mt2063_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_mt2266.c b/drivers/media/dvb/dvb-usb/tuner_mt2266.c +new file mode 100644 +index 0000000..b735924 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mt2266.c +@@ -0,0 +1,3278 @@ ++/** ++ ++@file ++ ++@brief MT2266 tuner module definition ++ ++One can manipulate MT2266 tuner through MT2266 module. ++MT2266 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_mt2266.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief MT2266 tuner module builder ++ ++Use BuildMt2266Module() to build MT2266 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to MT2266 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr MT2266 I2C device address ++ ++ ++@note ++ -# One should call BuildMt2266Module() to build MT2266 module before using it. ++ ++*/ ++void ++BuildMt2266Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_MT2266; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = mt2266_GetTunerType; ++ pTuner->GetDeviceAddr = mt2266_GetDeviceAddr; ++ ++ pTuner->Initialize = mt2266_Initialize; ++ pTuner->SetRfFreqHz = mt2266_SetRfFreqHz; ++ pTuner->GetRfFreqHz = mt2266_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->IsBandwidthHzSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->OpenHandle = mt2266_OpenHandle; ++ pExtra->CloseHandle = mt2266_CloseHandle; ++ pExtra->GetHandle = mt2266_GetHandle; ++ pExtra->SetBandwidthHz = mt2266_SetBandwidthHz; ++ pExtra->GetBandwidthHz = mt2266_GetBandwidthHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++mt2266_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++mt2266_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++mt2266_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Re-initialize tuner. ++ Status = MT2266_ReInit(DeviceHandle); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++mt2266_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Set tuner RF frequency in Hz. ++ Status = MT2266_ChangeFreq(DeviceHandle, RfFreqHz); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++mt2266_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Open MT2266 tuner handle. ++ ++*/ ++int ++mt2266_OpenHandle( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ unsigned char DeviceAddr; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner I2C device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Open MT2266 handle. ++ // Note: 1. Must take tuner extra module DeviceHandle as handle input argument. ++ // 2. Take pTuner as user-defined data input argument. ++ Status = MT2266_Open(DeviceAddr, &pExtra->DeviceHandle, pTuner); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_open_mt2266_handle; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_open_mt2266_handle: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Close MT2266 tuner handle. ++ ++*/ ++int ++mt2266_CloseHandle( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Close MT2266 handle. ++ Status = MT2266_Close(DeviceHandle); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_open_mt2266_handle; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_open_mt2266_handle: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MT2266 tuner handle. ++ ++*/ ++void ++mt2266_GetHandle( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ *pDeviceHandle = pExtra->DeviceHandle; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set MT2266 tuner bandwidth in Hz. ++ ++*/ ++int ++mt2266_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ Handle_t DeviceHandle; ++ UData_t Status; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ // Get tuner handle. ++ DeviceHandle = pExtra->DeviceHandle; ++ ++ ++ // Set tuner bandwidth in Hz. ++ Status = MT2266_SetParam(DeviceHandle, MT2266_OUTPUT_BW, BandwidthHz); ++ ++ if(MT_IS_ERROR(Status)) ++ goto error_status_set_tuner_bandwidth; ++ ++ ++ // Set tuner bandwidth parameter. ++ pExtra->BandwidthHz = BandwidthHz; ++ pExtra->IsBandwidthHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MT2266 tuner bandwidth in Hz. ++ ++*/ ++int ++mt2266_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ) ++{ ++ MT2266_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mt2266); ++ ++ ++ // Get tuner bandwidth in Hz from tuner module. ++ if(pExtra->IsBandwidthHzSet != YES) ++ goto error_status_get_tuner_bandwidth; ++ ++ *pBandwidthHz = pExtra->BandwidthHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Microtune source code - mt_userdef.c ++ ++ ++/***************************************************************************** ++** ++** Name: mt_userdef.c ++** ++** Description: User-defined MicroTuner software interface ++** ++** Functions ++** Requiring ++** Implementation: MT_WriteSub ++** MT_ReadSub ++** MT_Sleep ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_userdef.c,v 1.2 2006/10/26 16:39:18 software Exp $ ++** CVS Source: $Source: /export/home/cvsroot/software/tuners/MT2266/mt_userdef.c,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++//#include "mt_userdef.h" ++ ++ ++/***************************************************************************** ++** ++** Name: MT_WriteSub ++** ++** Description: Write values to device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to write data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2266_WriteSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt) ++{ ++// UData_t status = MT_OK; /* Status to be returned */ ++ /* ++ ** ToDo: Add code here to implement a serial-bus write ++ ** operation to the MTxxxx tuner. If successful, ++ ** return MT_OK. ++ */ ++/* return status; */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned int i, j; ++ ++ unsigned char RegStartAddr; ++ unsigned char *pWritingBytes; ++ unsigned long ByteNum; ++ ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ unsigned long WritingByteNum, WritingByteNumMax, WritingByteNumRem; ++ unsigned char RegWritingAddr; ++ ++ ++ ++ // Get tuner module, base interface, and I2C bridge. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Get regiser start address, writing bytes, and byte number. ++ RegStartAddr = subAddress; ++ pWritingBytes = pData; ++ ByteNum = (unsigned long)cnt; ++ ++ ++ // Calculate maximum writing byte number. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax - LEN_1_BYTE; ++ ++ ++ // Set tuner register bytes with writing bytes. ++ // Note: Set tuner register bytes considering maximum writing byte number. ++ for(i = 0; i < ByteNum; i += WritingByteNumMax) ++ { ++ // Set register writing address. ++ RegWritingAddr = RegStartAddr + i; ++ ++ // Calculate remainder writing byte number. ++ WritingByteNumRem = ByteNum - i; ++ ++ // Determine writing byte number. ++ WritingByteNum = (WritingByteNumRem > WritingByteNumMax) ? WritingByteNumMax : WritingByteNumRem; ++ ++ ++ // Set writing buffer. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegWritingAddr + writing_bytes (WritingByteNum bytes) + ++ // stop_bit ++ WritingBuffer[0] = RegWritingAddr; ++ ++ for(j = 0; j < WritingByteNum; j++) ++ WritingBuffer[LEN_1_BYTE + j] = pWritingBytes[i + j]; ++ ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, WritingByteNum + LEN_1_BYTE) != ++ FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_set_tuner_registers: ++ return MT_COMM_ERR; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_ReadSub ++** ++** Description: Read values from device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to read data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2266_ReadSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt) ++{ ++ // UData_t status = MT_OK; /* Status to be returned */ ++ ++ /* ++ ** ToDo: Add code here to implement a serial-bus read ++ ** operation to the MTxxxx tuner. If successful, ++ ** return MT_OK. ++ */ ++/* return status; */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned int i; ++ ++ unsigned char RegStartAddr; ++ unsigned char *pReadingBytes; ++ unsigned long ByteNum; ++ ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ ++ // Get tuner module, base interface, and I2C bridge. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Get regiser start address, writing bytes, and byte number. ++ RegStartAddr = subAddress; ++ pReadingBytes = pData; ++ ByteNum = (unsigned long)cnt; ++ ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ // Get tuner register bytes. ++ // Note: Get tuner register bytes considering maximum reading byte number. ++ for(i = 0; i < ByteNum; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = RegStartAddr + i; ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ByteNum - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + RegReadingAddr + stop_bit ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegReadingAddr, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register bytes. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_bytes (ReadingByteNum bytes) + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, &pReadingBytes[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ } ++ ++ ++ return MT_OK; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return MT_COMM_ERR; ++} ++ ++ ++/***************************************************************************** ++** ++** Name: MT_Sleep ++** ++** Description: Delay execution for "nMinDelayTime" milliseconds ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** nMinDelayTime - Delay time in milliseconds ++** ++** Returns: None. ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code that ++** blocks execution for the specified period of time. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++void MT2266_Sleep(Handle_t hUserData, ++ UData_t nMinDelayTime) ++{ ++ /* ++ ** ToDo: Add code here to implement a OS blocking ++ ** for a period of "nMinDelayTime" milliseconds. ++ */ ++ ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get tuner module, base interface. ++ pTuner = (TUNER_MODULE *)hUserData; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ ++ // Wait nMinDelayTime milliseconds. ++ pBaseInterface->WaitMs(pBaseInterface, nMinDelayTime); ++ ++ ++ return; ++} ++ ++ ++#if defined(MT2060_CNT) ++#if MT2060_CNT > 0 ++/***************************************************************************** ++** ++** Name: MT_TunerGain (MT2060 only) ++** ++** Description: Measure the relative tuner gain using the demodulator ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** pMeas - Tuner gain (1/100 of dB scale). ++** ie. 1234 = 12.34 (dB) ++** ++** Returns: status: ++** MT_OK - No errors ++** user-defined errors could be set ++** ++** Notes: This is a callback function that is called from the ++** the 1st IF location routine. You MUST provide ++** code that measures the relative tuner gain in a dB ++** (not linear) scale. The return value is an integer ++** value scaled to 1/100 of a dB. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 06-16-2004 DAD Original ++** N/A 11-30-2004 DAD Renamed from MT_DemodInputPower. This name ++** better describes what this function does. ++** ++*****************************************************************************/ ++UData_t MT_TunerGain(Handle_t hUserData, ++ SData_t* pMeas) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ ++ /* ++ ** ToDo: Add code here to return the gain / power level measured ++ ** at the input to the demodulator. ++ */ ++ ++ ++ ++ return (status); ++} ++#endif ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt2266.c ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt2266.c ++** ++** Copyright 2007 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt2266.c ++** ++** Description: Microtune MT2266 Tuner software interface. ++** Supports tuners with Part/Rev code: 0x85. ++** ++** Functions ++** Implemented: UData_t MT2266_Open ++** UData_t MT2266_Close ++** UData_t MT2266_ChangeFreq ++** UData_t MT2266_GetLocked ++** UData_t MT2266_GetParam ++** UData_t MT2266_GetReg ++** UData_t MT2266_GetUHFXFreqs ++** UData_t MT2266_GetUserData ++** UData_t MT2266_ReInit ++** UData_t MT2266_SetParam ++** UData_t MT2266_SetPowerModes ++** UData_t MT2266_SetReg ++** UData_t MT2266_SetUHFXFreqs ++** ++** References: AN-00010: MicroTuner Serial Interface Application Note ++** MicroTune, Inc. ++** ++** Exports: None ++** ++** Dependencies: MT_ReadSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Read byte(s) of data from the two-wire bus. ++** ++** MT_WriteSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Write byte(s) of data to the two-wire bus. ++** ++** MT_Sleep(hUserData, nMinDelayTime); ++** - Delay execution for x milliseconds ++** ++** CVS ID: $Id: mt2266.c,v 1.5 2007/10/02 18:43:17 software Exp $ ++** CVS Source: $Source: /export/home/cvsroot/software/tuners/MT2266/mt2266.c,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 06-08-2006 JWS Ver 1.01: Corrected problem with tuner ID check ++** N/A 11-01-2006 RSK Ver 1.02: Adding multiple-filter support ++** as well as Get/Set functions. ++** N/A 11-29-2006 DAD Ver 1.03: Parenthesis clarification for gcc ++** N/A 12-20-2006 RSK Ver 1.04: Adding fLO_FractionalTerm() usage. ++** 118 05-09-2007 RSK Ver 1.05: Adding Standard MTxxxx_Tune() API. ++** ++*****************************************************************************/ ++//#include "mt2266.h" ++//#include /* for NULL */ ++#define MT_NULL 0 ++ ++/* Version of this module */ ++#define VERSION 10005 /* Version 01.05 */ ++ ++ ++#ifndef MT2266_CNT ++#error You must define MT2266_CNT in the "mt_userdef.h" file ++#endif ++ ++/* ++** Normally, the "reg" array in the tuner structure is used as a cache ++** containing the current value of the tuner registers. If the user's ++** application MUST change tuner registers without using the MT2266_SetReg ++** routine provided, he may compile this code with the __NO_CACHE__ ++** variable defined. ++** The PREFETCH macro will insert code code to re-read tuner registers if ++** __NO_CACHE__ is defined. If it is not defined (normal) then PREFETCH ++** does nothing. ++*/ ++ ++#if defined(__NO_CACHE__) ++#define PREFETCH(var, cnt) \ ++ if (MT_NO_ERROR(status)) \ ++ status |= MT2266_ReadSub(pInfo->hUserData, pInfo->address, (var), &pInfo->reg[(var)], (cnt)); ++#else ++#define PREFETCH(var, cnt) ++#endif ++ ++ ++ ++/* ++** Two-wire serial bus subaddresses of the tuner registers. ++** Also known as the tuner's register addresses. ++*/ ++enum MT2266_Register_Offsets ++{ ++ MT2266_PART_REV = 0, /* 0x00 */ ++ MT2266_LO_CTRL_1, /* 0x01 */ ++ MT2266_LO_CTRL_2, /* 0x02 */ ++ MT2266_LO_CTRL_3, /* 0x03 */ ++ MT2266_SMART_ANT, /* 0x04 */ ++ MT2266_BAND_CTRL, /* 0x05 */ ++ MT2266_CLEARTUNE, /* 0x06 */ ++ MT2266_IGAIN, /* 0x07 */ ++ MT2266_BBFILT_1, /* 0x08 */ ++ MT2266_BBFILT_2, /* 0x09 */ ++ MT2266_BBFILT_3, /* 0x0A */ ++ MT2266_BBFILT_4, /* 0x0B */ ++ MT2266_BBFILT_5, /* 0x0C */ ++ MT2266_BBFILT_6, /* 0x0D */ ++ MT2266_BBFILT_7, /* 0x0E */ ++ MT2266_BBFILT_8, /* 0x0F */ ++ MT2266_RCC_CTRL, /* 0x10 */ ++ MT2266_RSVD_11, /* 0x11 */ ++ MT2266_STATUS_1, /* 0x12 */ ++ MT2266_STATUS_2, /* 0x13 */ ++ MT2266_STATUS_3, /* 0x14 */ ++ MT2266_STATUS_4, /* 0x15 */ ++ MT2266_STATUS_5, /* 0x16 */ ++ MT2266_SRO_CTRL, /* 0x17 */ ++ MT2266_RSVD_18, /* 0x18 */ ++ MT2266_RSVD_19, /* 0x19 */ ++ MT2266_RSVD_1A, /* 0x1A */ ++ MT2266_RSVD_1B, /* 0x1B */ ++ MT2266_ENABLES, /* 0x1C */ ++ MT2266_RSVD_1D, /* 0x1D */ ++ MT2266_RSVD_1E, /* 0x1E */ ++ MT2266_RSVD_1F, /* 0x1F */ ++ MT2266_GPO, /* 0x20 */ ++ MT2266_RSVD_21, /* 0x21 */ ++ MT2266_RSVD_22, /* 0x22 */ ++ MT2266_RSVD_23, /* 0x23 */ ++ MT2266_RSVD_24, /* 0x24 */ ++ MT2266_RSVD_25, /* 0x25 */ ++ MT2266_RSVD_26, /* 0x26 */ ++ MT2266_RSVD_27, /* 0x27 */ ++ MT2266_RSVD_28, /* 0x28 */ ++ MT2266_RSVD_29, /* 0x29 */ ++ MT2266_RSVD_2A, /* 0x2A */ ++ MT2266_RSVD_2B, /* 0x2B */ ++ MT2266_RSVD_2C, /* 0x2C */ ++ MT2266_RSVD_2D, /* 0x2D */ ++ MT2266_RSVD_2E, /* 0x2E */ ++ MT2266_RSVD_2F, /* 0x2F */ ++ MT2266_RSVD_30, /* 0x30 */ ++ MT2266_RSVD_31, /* 0x31 */ ++ MT2266_RSVD_32, /* 0x32 */ ++ MT2266_RSVD_33, /* 0x33 */ ++ MT2266_RSVD_34, /* 0x34 */ ++ MT2266_RSVD_35, /* 0x35 */ ++ MT2266_RSVD_36, /* 0x36 */ ++ MT2266_RSVD_37, /* 0x37 */ ++ MT2266_RSVD_38, /* 0x38 */ ++ MT2266_RSVD_39, /* 0x39 */ ++ MT2266_RSVD_3A, /* 0x3A */ ++ MT2266_RSVD_3B, /* 0x3B */ ++ MT2266_RSVD_3C, /* 0x3C */ ++ END_REGS ++}; ++ ++/* ++** DefaultsEntry points to an array of U8Data used to initialize ++** various registers (the first byte is the starting subaddress) ++** and a count of the bytes (including subaddress) in the array. ++** ++** DefaultsList is an array of DefaultsEntry elements terminated ++** by an entry with a NULL pointer for the data array. ++*/ ++typedef struct MT2266_DefaultsEntryTag ++{ ++ U8Data *data; ++ UData_t cnt; ++} MT2266_DefaultsEntry; ++ ++typedef MT2266_DefaultsEntry MT2266_DefaultsList[]; ++ ++#define DEF_LIST_ENTRY(a) {a, sizeof(a)/sizeof(U8Data) - 1} ++#define END_DEF_LIST {0,0} ++ ++/* ++** Constants used by the tuning algorithm ++*/ ++ /* REF_FREQ is now the actual crystal frequency */ ++#define REF_FREQ (30000000UL) /* Reference oscillator Frequency (in Hz) */ ++#define TUNE_STEP_SIZE (50UL) /* Tune in steps of 50 kHz */ ++#define MIN_UHF_FREQ (350000000UL) /* Minimum UHF frequency (in Hz) */ ++#define MAX_UHF_FREQ (900000000UL) /* Maximum UHF frequency (in Hz) */ ++#define MIN_VHF_FREQ (174000000UL) /* Minimum VHF frequency (in Hz) */ ++#define MAX_VHF_FREQ (230000000UL) /* Maximum VHF frequency (in Hz) */ ++#define OUTPUT_BW (8000000UL) /* Output channel bandwidth (in Hz) */ ++#define UHF_DEFAULT_FREQ (600000000UL) /* Default UHF input frequency (in Hz) */ ++ ++ ++/* ++** The number of Tuner Registers ++*/ ++static const UData_t Num_Registers = END_REGS; ++ ++/* ++** Crossover Frequency sets for 2 filters, without and with attenuation. ++*/ ++typedef struct ++{ ++ MT2266_XFreq_Set xfreq[ MT2266_NUMBER_OF_XFREQ_SETS ]; ++ ++} MT2266_XFreqs_t; ++ ++ ++MT2266_XFreqs_t MT2266_default_XFreqs = ++{ ++ /* xfreq */ ++ { ++ /* uhf0 */ ++ { /* < 0 MHz: 15+1 */ ++ 0UL, /* 0 .. 0 MHz: 15 */ ++ 0UL, /* 0 .. 443 MHz: 14 */ ++ 443000 / TUNE_STEP_SIZE, /* 443 .. 470 MHz: 13 */ ++ 470000 / TUNE_STEP_SIZE, /* 470 .. 496 MHz: 12 */ ++ 496000 / TUNE_STEP_SIZE, /* 496 .. 525 MHz: 11 */ ++ 525000 / TUNE_STEP_SIZE, /* 525 .. 552 MHz: 10 */ ++ 552000 / TUNE_STEP_SIZE, /* 552 .. 580 MHz: 9 */ ++ 580000 / TUNE_STEP_SIZE, /* 580 .. 657 MHz: 8 */ ++ 657000 / TUNE_STEP_SIZE, /* 657 .. 682 MHz: 7 */ ++ 682000 / TUNE_STEP_SIZE, /* 682 .. 710 MHz: 6 */ ++ 710000 / TUNE_STEP_SIZE, /* 710 .. 735 MHz: 5 */ ++ 735000 / TUNE_STEP_SIZE, /* 735 .. 763 MHz: 4 */ ++ 763000 / TUNE_STEP_SIZE, /* 763 .. 802 MHz: 3 */ ++ 802000 / TUNE_STEP_SIZE, /* 802 .. 840 MHz: 2 */ ++ 840000 / TUNE_STEP_SIZE, /* 840 .. 877 MHz: 1 */ ++ 877000 / TUNE_STEP_SIZE /* 877+ MHz: 0 */ ++ }, ++ ++ /* uhf1 */ ++ { /* < 443 MHz: 15+1 */ ++ 443000 / TUNE_STEP_SIZE, /* 443 .. 470 MHz: 15 */ ++ 470000 / TUNE_STEP_SIZE, /* 470 .. 496 MHz: 14 */ ++ 496000 / TUNE_STEP_SIZE, /* 496 .. 525 MHz: 13 */ ++ 525000 / TUNE_STEP_SIZE, /* 525 .. 552 MHz: 12 */ ++ 552000 / TUNE_STEP_SIZE, /* 552 .. 580 MHz: 11 */ ++ 580000 / TUNE_STEP_SIZE, /* 580 .. 605 MHz: 10 */ ++ 605000 / TUNE_STEP_SIZE, /* 605 .. 632 MHz: 9 */ ++ 632000 / TUNE_STEP_SIZE, /* 632 .. 657 MHz: 8 */ ++ 657000 / TUNE_STEP_SIZE, /* 657 .. 682 MHz: 7 */ ++ 682000 / TUNE_STEP_SIZE, /* 682 .. 710 MHz: 6 */ ++ 710000 / TUNE_STEP_SIZE, /* 710 .. 735 MHz: 5 */ ++ 735000 / TUNE_STEP_SIZE, /* 735 .. 763 MHz: 4 */ ++ 763000 / TUNE_STEP_SIZE, /* 763 .. 802 MHz: 3 */ ++ 802000 / TUNE_STEP_SIZE, /* 802 .. 840 MHz: 2 */ ++ 840000 / TUNE_STEP_SIZE, /* 840 .. 877 MHz: 1 */ ++ 877000 / TUNE_STEP_SIZE /* 877+ MHz: 0 */ ++ }, ++ ++ /* uhf0_a */ ++ { /* < 0 MHz: 15+1 */ ++ 0UL, /* 0 .. 0 MHz: 15 */ ++ 0UL, /* 0 .. 442 MHz: 14 */ ++ 442000 / TUNE_STEP_SIZE, /* 442 .. 472 MHz: 13 */ ++ 472000 / TUNE_STEP_SIZE, /* 472 .. 505 MHz: 12 */ ++ 505000 / TUNE_STEP_SIZE, /* 505 .. 535 MHz: 11 */ ++ 535000 / TUNE_STEP_SIZE, /* 535 .. 560 MHz: 10 */ ++ 560000 / TUNE_STEP_SIZE, /* 560 .. 593 MHz: 9 */ ++ 593000 / TUNE_STEP_SIZE, /* 593 .. 673 MHz: 8 */ ++ 673000 / TUNE_STEP_SIZE, /* 673 .. 700 MHz: 7 */ ++ 700000 / TUNE_STEP_SIZE, /* 700 .. 727 MHz: 6 */ ++ 727000 / TUNE_STEP_SIZE, /* 727 .. 752 MHz: 5 */ ++ 752000 / TUNE_STEP_SIZE, /* 752 .. 783 MHz: 4 */ ++ 783000 / TUNE_STEP_SIZE, /* 783 .. 825 MHz: 3 */ ++ 825000 / TUNE_STEP_SIZE, /* 825 .. 865 MHz: 2 */ ++ 865000 / TUNE_STEP_SIZE, /* 865 .. 905 MHz: 1 */ ++ 905000 / TUNE_STEP_SIZE /* 905+ MHz: 0 */ ++ }, ++ ++ /* uhf1_a */ ++ { /* < 442 MHz: 15+1 */ ++ 442000 / TUNE_STEP_SIZE, /* 442 .. 472 MHz: 15 */ ++ 472000 / TUNE_STEP_SIZE, /* 472 .. 505 MHz: 14 */ ++ 505000 / TUNE_STEP_SIZE, /* 505 .. 535 MHz: 13 */ ++ 535000 / TUNE_STEP_SIZE, /* 535 .. 560 MHz: 12 */ ++ 560000 / TUNE_STEP_SIZE, /* 560 .. 593 MHz: 11 */ ++ 593000 / TUNE_STEP_SIZE, /* 593 .. 620 MHz: 10 */ ++ 620000 / TUNE_STEP_SIZE, /* 620 .. 647 MHz: 9 */ ++ 647000 / TUNE_STEP_SIZE, /* 647 .. 673 MHz: 8 */ ++ 673000 / TUNE_STEP_SIZE, /* 673 .. 700 MHz: 7 */ ++ 700000 / TUNE_STEP_SIZE, /* 700 .. 727 MHz: 6 */ ++ 727000 / TUNE_STEP_SIZE, /* 727 .. 752 MHz: 5 */ ++ 752000 / TUNE_STEP_SIZE, /* 752 .. 783 MHz: 4 */ ++ 783000 / TUNE_STEP_SIZE, /* 783 .. 825 MHz: 3 */ ++ 825000 / TUNE_STEP_SIZE, /* 825 .. 865 MHz: 2 */ ++ 865000 / TUNE_STEP_SIZE, /* 865 .. 905 MHz: 1 */ ++ 905000 / TUNE_STEP_SIZE /* 905+ MHz: 0 */ ++ } ++ } ++}; ++ ++typedef struct ++{ ++ Handle_t handle; ++ Handle_t hUserData; ++ UData_t address; ++ UData_t version; ++ UData_t tuner_id; ++ UData_t f_Ref; ++ UData_t f_Step; ++ UData_t f_in; ++ UData_t f_LO; ++ UData_t f_bw; ++ UData_t band; ++ UData_t num_regs; ++ U8Data RC2_Value; ++ U8Data RC2_Nominal; ++ U8Data reg[END_REGS]; ++ ++ MT2266_XFreqs_t xfreqs; ++ ++} MT2266_Info_t; ++ ++static UData_t nMaxTuners = MT2266_CNT; ++static MT2266_Info_t MT2266_Info[MT2266_CNT]; ++static MT2266_Info_t *Avail[MT2266_CNT]; ++static UData_t nOpenTuners = 0; ++ ++/* ++** Constants used to write a minimal set of registers when changing bands. ++** If the user wants a total reset, they should call MT2266_Open() again. ++** Skip 01, 02, 03, 04 (get overwritten anyways) ++** Write 05 ++** Skip 06 - 18 ++** Write 19 (diff for L-Band) ++** Skip 1A 1B 1C ++** Write 1D - 2B ++** Skip 2C - 3C ++*/ ++ ++static U8Data MT2266_VHF_defaults1[] = ++{ ++ 0x05, /* address 0xC0, reg 0x05 */ ++ 0x04, /* Reg 0x05 LBANDen = 1 (that's right)*/ ++}; ++static U8Data MT2266_VHF_defaults2[] = ++{ ++ 0x19, /* address 0xC0, reg 0x19 */ ++ 0x61, /* Reg 0x19 CAPto = 3*/ ++}; ++static U8Data MT2266_VHF_defaults3[] = ++{ ++ 0x1D, /* address 0xC0, reg 0x1D */ ++ 0xFE, /* reg 0x1D */ ++ 0x00, /* reg 0x1E */ ++ 0x00, /* reg 0x1F */ ++ 0xB4, /* Reg 0x20 GPO = 1*/ ++ 0x03, /* Reg 0x21 LBIASen = 1, UBIASen = 1*/ ++ 0xA5, /* Reg 0x22 */ ++ 0xA5, /* Reg 0x23 */ ++ 0xA5, /* Reg 0x24 */ ++ 0xA5, /* Reg 0x25 */ ++ 0x82, /* Reg 0x26 CASCM = b0001 (bits reversed)*/ ++ 0xAA, /* Reg 0x27 */ ++ 0xF1, /* Reg 0x28 */ ++ 0x17, /* Reg 0x29 */ ++ 0x80, /* Reg 0x2A MIXbiasen = 1*/ ++ 0x1F, /* Reg 0x2B */ ++}; ++ ++static MT2266_DefaultsList MT2266_VHF_defaults = { ++ DEF_LIST_ENTRY(MT2266_VHF_defaults1), ++ DEF_LIST_ENTRY(MT2266_VHF_defaults2), ++ DEF_LIST_ENTRY(MT2266_VHF_defaults3), ++ END_DEF_LIST ++}; ++ ++static U8Data MT2266_UHF_defaults1[] = ++{ ++ 0x05, /* address 0xC0, reg 0x05 */ ++ 0x52, /* Reg 0x05 */ ++}; ++static U8Data MT2266_UHF_defaults2[] = ++{ ++ 0x19, /* address 0xC0, reg 0x19 */ ++ 0x61, /* Reg 0x19 CAPto = 3*/ ++}; ++static U8Data MT2266_UHF_defaults3[] = ++{ ++ 0x1D, /* address 0xC0, reg 0x1D */ ++ 0xDC, /* Reg 0x1D */ ++ 0x00, /* Reg 0x1E */ ++ 0x0A, /* Reg 0x1F */ ++ 0xD4, /* Reg 0x20 GPO = 1*/ ++ 0x03, /* Reg 0x21 LBIASen = 1, UBIASen = 1*/ ++ 0x64, /* Reg 0x22 */ ++ 0x64, /* Reg 0x23 */ ++ 0x64, /* Reg 0x24 */ ++ 0x64, /* Reg 0x25 */ ++ 0x22, /* Reg 0x26 CASCM = b0100 (bits reversed)*/ ++ 0xAA, /* Reg 0x27 */ ++ 0xF2, /* Reg 0x28 */ ++ 0x1E, /* Reg 0x29 */ ++ 0x80, /* Reg 0x2A MIXbiasen = 1*/ ++ 0x14, /* Reg 0x2B */ ++}; ++ ++static MT2266_DefaultsList MT2266_UHF_defaults = { ++ DEF_LIST_ENTRY(MT2266_UHF_defaults1), ++ DEF_LIST_ENTRY(MT2266_UHF_defaults2), ++ DEF_LIST_ENTRY(MT2266_UHF_defaults3), ++ END_DEF_LIST ++}; ++ ++ ++static UData_t UncheckedSet(MT2266_Info_t* pInfo, ++ U8Data reg, ++ U8Data val); ++ ++static UData_t UncheckedGet(MT2266_Info_t* pInfo, ++ U8Data reg, ++ U8Data* val); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2266_Open ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: MT2266_Addr - Serial bus address of the tuner. ++** hMT2266 - Tuner handle passed back. ++** hUserData - User-defined data, if needed for the ++** MT_ReadSub() & MT_WriteSub functions. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** MT_COMM_ERR - Serial bus communications error ++** MT_ARG_NULL - Null pointer argument passed ++** MT_TUNER_CNT_ERR - Too many tuners open ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 11-01-2006 RSK Ver 1.02: Initialize Crossover Tables to Default ++** ++******************************************************************************/ ++UData_t MT2266_Open(UData_t MT2266_Addr, ++ Handle_t* hMT2266, ++ Handle_t hUserData) ++{ ++ UData_t status = MT_OK; /* Status to be returned. */ ++ SData_t i, j; ++ MT2266_Info_t* pInfo = MT_NULL; ++ ++ ++ /* Check the argument before using */ ++ if (hMT2266 == MT_NULL) ++ return MT_ARG_NULL; ++ *hMT2266 = MT_NULL; ++ ++ /* ++ ** If this is our first tuner, initialize the address fields and ++ ** the list of available control blocks. ++ */ ++ if (nOpenTuners == 0) ++ { ++ for (i=MT2266_CNT-1; i>=0; i--) ++ { ++ MT2266_Info[i].handle = MT_NULL; ++ MT2266_Info[i].address =MAX_UDATA; ++ MT2266_Info[i].hUserData = MT_NULL; ++ ++ /* Reset the UHF Crossover Frequency tables on open/init. */ ++ for (j=0; j< MT2266_NUM_XFREQS; j++ ) ++ { ++ MT2266_Info[i].xfreqs.xfreq[MT2266_UHF0][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF0][j]; ++ MT2266_Info[i].xfreqs.xfreq[MT2266_UHF1][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF1][j]; ++ MT2266_Info[i].xfreqs.xfreq[MT2266_UHF0_ATTEN][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF0_ATTEN][j]; ++ MT2266_Info[i].xfreqs.xfreq[MT2266_UHF1_ATTEN][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF1_ATTEN][j]; ++ } ++ ++ Avail[i] = &MT2266_Info[i]; ++ } ++ } ++ ++ /* ++ ** Look for an existing MT2266_State_t entry with this address. ++ */ ++ for (i=MT2266_CNT-1; i>=0; i--) ++ { ++ /* ++ ** If an open'ed handle provided, we'll re-initialize that structure. ++ ** ++ ** We recognize an open tuner because the address and hUserData are ++ ** the same as one that has already been opened ++ */ ++ if ((MT2266_Info[i].address == MT2266_Addr) && ++ (MT2266_Info[i].hUserData == hUserData)) ++ { ++ pInfo = &MT2266_Info[i]; ++ break; ++ } ++ } ++ ++ /* If not found, choose an empty spot. */ ++ if (pInfo == MT_NULL) ++ { ++ /* Check to see that we're not over-allocating. */ ++ if (nOpenTuners == MT2266_CNT) ++ return MT_TUNER_CNT_ERR; ++ ++ /* Use the next available block from the list */ ++ pInfo = Avail[nOpenTuners]; ++ nOpenTuners++; ++ } ++ ++ pInfo->handle = (Handle_t) pInfo; ++ pInfo->hUserData = hUserData; ++ pInfo->address = MT2266_Addr; ++ ++// status |= MT2266_ReInit((Handle_t) pInfo); ++ ++ if (MT_IS_ERROR(status)) ++ MT2266_Close((Handle_t) pInfo); ++ else ++ *hMT2266 = pInfo->handle; ++ ++ return (status); ++} ++ ++ ++static UData_t IsValidHandle(MT2266_Info_t* handle) ++{ ++ return ((handle != MT_NULL) && (handle->handle == handle)) ? 1 : 0; ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2266_Close ++** ++** Description: Release the handle to the tuner. ++** ++** Parameters: hMT2266 - Handle to the MT2266 tuner ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++******************************************************************************/ ++UData_t MT2266_Close(Handle_t hMT2266) ++{ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) hMT2266; ++ ++ if (!IsValidHandle(pInfo)) ++ return MT_INV_HANDLE; ++ ++ /* Remove the tuner from our list of tuners */ ++ pInfo->handle = MT_NULL; ++ pInfo->address = MAX_UDATA; ++ pInfo->hUserData = MT_NULL; ++ nOpenTuners--; ++ Avail[nOpenTuners] = pInfo; /* Return control block to available list */ ++ ++ return MT_OK; ++} ++ ++ ++/****************************************************************************** ++** ++** Name: Run_BB_RC_Cal2 ++** ++** Description: Run Base Band RC Calibration (Method 2) ++** MT2266 B0 only, others return MT_OK ++** ++** Parameters: hMT2266 - Handle to the MT2266 tuner ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++******************************************************************************/ ++static UData_t Run_BB_RC_Cal2(Handle_t h) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data tmp_rcc; ++ U8Data dumy; ++ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ /* ++ ** Set the crystal frequency in the calibration register ++ ** and enable RC calibration #2 ++ */ ++ PREFETCH(MT2266_RCC_CTRL, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ tmp_rcc = pInfo->reg[MT2266_RCC_CTRL]; ++ if (pInfo->f_Ref < (36000000 /*/ TUNE_STEP_SIZE*/)) ++ tmp_rcc = (tmp_rcc & 0xDF) | 0x10; ++ else ++ tmp_rcc |= 0x30; ++ status |= UncheckedSet(pInfo, MT2266_RCC_CTRL, tmp_rcc); ++ ++ /* Read RC Calibration value */ ++ status |= UncheckedGet(pInfo, MT2266_STATUS_4, &dumy); ++ ++ /* Disable RC Cal 2 */ ++ status |= UncheckedSet(pInfo, MT2266_RCC_CTRL, pInfo->reg[MT2266_RCC_CTRL] & 0xEF); ++ ++ /* Store RC Cal 2 value */ ++ pInfo->RC2_Value = pInfo->reg[MT2266_STATUS_4]; ++ ++ if (pInfo->f_Ref < (36000000 /*/ TUNE_STEP_SIZE*/)) ++ pInfo->RC2_Nominal = (U8Data) ((pInfo->f_Ref + 77570) / 155139); ++ else ++ pInfo->RC2_Nominal = (U8Data) ((pInfo->f_Ref + 93077) / 186154); ++ ++ return (status); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: Set_BBFilt ++** ++** Description: Set Base Band Filter bandwidth ++** Based on SRO frequency & BB RC Calibration ++** User stores channel bw as 5-8 MHz. This routine ++** calculates a 3 dB corner bw based on 1/2 the bandwidth ++** and a bandwidth related constant. ++** ++** Parameters: hMT2266 - Handle to the MT2266 tuner ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++******************************************************************************/ ++static UData_t Set_BBFilt(Handle_t h) ++{ ++ UData_t f_3dB_bw; ++ U8Data BBFilt = 0; ++ U8Data Sel = 0; ++ SData_t TmpFilt; ++ SData_t i; ++ UData_t status = MT_OK; /* Status to be returned */ ++ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ /* Check RC2_Value value */ ++ if(pInfo->RC2_Value == 0) ++ return MT_UNKNOWN; ++ ++ /* ++ ** Convert the channel bandwidth into a 3 dB bw by dividing it by 2 ++ ** and subtracting 300, 250, 200, or 0 kHz based on 8, 7, 6, 5 MHz ++ ** channel bandwidth. ++ */ ++ f_3dB_bw = (pInfo->f_bw / 2); /* bw -> bw/2 */ ++ if (pInfo->f_bw > 7500000) ++ { ++ /* >3.75 MHz corner */ ++ f_3dB_bw -= 300000; ++ Sel = 0x00; ++ TmpFilt = ((429916107 / pInfo->RC2_Value) * pInfo->RC2_Nominal) / f_3dB_bw - 81; ++ } ++ else if (pInfo->f_bw > 6500000) ++ { ++ /* >3.25 MHz .. 3.75 MHz corner */ ++ f_3dB_bw -= 250000; ++ Sel = 0x00; ++ TmpFilt = ((429916107 / pInfo->RC2_Value) * pInfo->RC2_Nominal) / f_3dB_bw - 81; ++ } ++ else if (pInfo->f_bw > 5500000) ++ { ++ /* >2.75 MHz .. 3.25 MHz corner */ ++ f_3dB_bw -= 200000; ++ Sel = 0x80; ++ TmpFilt = ((429916107 / pInfo->RC2_Value) * pInfo->RC2_Nominal) / f_3dB_bw - 113; ++ } ++ else ++ { ++ /* <= 2.75 MHz corner */ ++ Sel = 0xC0; ++ TmpFilt = ((429916107 / pInfo->RC2_Value) * pInfo->RC2_Nominal) / f_3dB_bw - 129; ++ } ++ ++ if (TmpFilt > 63) ++ TmpFilt = 63; ++ else if (TmpFilt < 0) ++ TmpFilt = 0; ++ BBFilt = ((U8Data) TmpFilt) | Sel; ++ ++ for ( i = MT2266_BBFILT_1; i <= MT2266_BBFILT_8; i++ ) ++ pInfo->reg[i] = BBFilt; ++ ++ if (MT_NO_ERROR(status)) ++ status |= MT2266_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ MT2266_BBFILT_1, ++ &pInfo->reg[MT2266_BBFILT_1], ++ 8); ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetLocked ++** ++** Description: Checks to see if the PLL is locked. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_GetLocked(Handle_t h) ++{ ++ const UData_t nMaxWait = 200; /* wait a maximum of 200 msec */ ++ const UData_t nPollRate = 2; /* poll status bits every 2 ms */ ++ const UData_t nMaxLoops = nMaxWait / nPollRate; ++ UData_t status = MT_OK; /* Status to be returned */ ++ UData_t nDelays = 0; ++ U8Data statreg; ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ if (IsValidHandle(pInfo) == 0) ++ return MT_INV_HANDLE; ++ ++ do ++ { ++ status |= UncheckedGet(pInfo, MT2266_STATUS_1, &statreg); ++ ++ if ((MT_IS_ERROR(status)) || ((statreg & 0x40) == 0x40)) ++ return (status); ++ ++ MT2266_Sleep(pInfo->hUserData, nPollRate); /* Wait between retries */ ++ } ++ while (++nDelays < nMaxLoops); ++ ++ if ((statreg & 0x40) != 0x40) ++ status |= MT_DNC_UNLOCK; ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetParam ++** ++** Description: Gets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm - mostly for testing purposes. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2266_Param) ++** pValue - ptr to returned value ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2266_IC_ADDR Serial Bus address of this tuner ++** MT2266_MAX_OPEN Max number of MT2266's that can be open ++** MT2266_NUM_OPEN Number of MT2266's currently open ++** MT2266_NUM_REGS Number of tuner registers ++** MT2266_SRO_FREQ crystal frequency ++** MT2266_STEPSIZE minimum tuning step size ++** MT2266_INPUT_FREQ input center frequency ++** MT2266_LO_FREQ LO Frequency ++** MT2266_OUTPUT_BW Output channel bandwidth ++** MT2266_RC2_VALUE Base band filter cal RC code (method 2) ++** MT2266_RC2_NOMINAL Base band filter nominal cal RC code ++** MT2266_RF_ADC RF attenuator A/D readback ++** MT2266_RF_ATTN RF attenuation (0-255) ++** MT2266_RF_EXT External control of RF atten ++** MT2266_LNA_GAIN LNA gain setting (0-15) ++** MT2266_BB_ADC BB attenuator A/D readback ++** MT2266_BB_ATTN Baseband attenuation (0-255) ++** MT2266_BB_EXT External control of BB atten ++** ++** Usage: status |= MT2266_GetParam(hMT2266, ++** MT2266_OUTPUT_BW, ++** &f_bw); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetParam, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_GetParam(Handle_t h, ++ MT2266_Param param, ++ UData_t* pValue) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data tmp; ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ if (pValue == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ switch (param) ++ { ++ /* Serial Bus address of this tuner */ ++ case MT2266_IC_ADDR: ++ *pValue = pInfo->address; ++ break; ++ ++ /* Max # of MT2266's allowed to be open */ ++ case MT2266_MAX_OPEN: ++ *pValue = nMaxTuners; ++ break; ++ ++ /* # of MT2266's open */ ++ case MT2266_NUM_OPEN: ++ *pValue = nOpenTuners; ++ break; ++ ++ /* Number of tuner registers */ ++ case MT2266_NUM_REGS: ++ *pValue = Num_Registers; ++ break; ++ ++ /* crystal frequency */ ++ case MT2266_SRO_FREQ: ++ *pValue = pInfo->f_Ref; ++ break; ++ ++ /* minimum tuning step size */ ++ case MT2266_STEPSIZE: ++ *pValue = pInfo->f_Step; ++ break; ++ ++ /* input center frequency */ ++ case MT2266_INPUT_FREQ: ++ *pValue = pInfo->f_in; ++ break; ++ ++ /* LO Frequency */ ++ case MT2266_LO_FREQ: ++ *pValue = pInfo->f_LO; ++ break; ++ ++ /* Output Channel Bandwidth */ ++ case MT2266_OUTPUT_BW: ++ *pValue = pInfo->f_bw; ++ break; ++ ++ /* Base band filter cal RC code */ ++ case MT2266_RC2_VALUE: ++ *pValue = (UData_t) pInfo->RC2_Value; ++ break; ++ ++ /* Base band filter nominal cal RC code */ ++ case MT2266_RC2_NOMINAL: ++ *pValue = (UData_t) pInfo->RC2_Nominal; ++ break; ++ ++ /* RF attenuator A/D readback */ ++ case MT2266_RF_ADC: ++ status |= UncheckedGet(pInfo, MT2266_STATUS_2, &tmp); ++ if (MT_NO_ERROR(status)) ++ *pValue = (UData_t) tmp; ++ break; ++ ++ /* BB attenuator A/D readback */ ++ case MT2266_BB_ADC: ++ status |= UncheckedGet(pInfo, MT2266_STATUS_3, &tmp); ++ if (MT_NO_ERROR(status)) ++ *pValue = (UData_t) tmp; ++ break; ++ ++ /* RF attenuator setting */ ++ case MT2266_RF_ATTN: ++ PREFETCH(MT2266_RSVD_1F, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ if (MT_NO_ERROR(status)) ++ *pValue = pInfo->reg[MT2266_RSVD_1F]; ++ break; ++ ++ /* BB attenuator setting */ ++ case MT2266_BB_ATTN: ++ PREFETCH(MT2266_RSVD_2C, 3); /* Fetch register(s) if __NO_CACHE__ defined */ ++ *pValue = pInfo->reg[MT2266_RSVD_2C] ++ + pInfo->reg[MT2266_RSVD_2D] ++ + pInfo->reg[MT2266_RSVD_2E] - 3; ++ break; ++ ++ /* RF external / internal atten control */ ++ case MT2266_RF_EXT: ++ PREFETCH(MT2266_GPO, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ *pValue = ((pInfo->reg[MT2266_GPO] & 0x40) != 0x00); ++ break; ++ ++ /* BB external / internal atten control */ ++ case MT2266_BB_EXT: ++ PREFETCH(MT2266_RSVD_33, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ *pValue = ((pInfo->reg[MT2266_RSVD_33] & 0x10) != 0x00); ++ break; ++ ++ /* LNA gain setting (0-15) */ ++ case MT2266_LNA_GAIN: ++ PREFETCH(MT2266_IGAIN, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ *pValue = ((pInfo->reg[MT2266_IGAIN] & 0x3C) >> 2); ++ break; ++ ++ case MT2266_EOP: ++ default: ++ status |= MT_ARG_RANGE; ++ } ++ } ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** LOCAL FUNCTION - DO NOT USE OUTSIDE OF mt2266.c ++** ++** Name: UncheckedGet ++** ++** Description: Gets an MT2266 register with minimal checking ++** ++** NOTE: This is a local function that performs the same ++** steps as the MT2266_GetReg function that is available ++** in the external API. It does not do any of the standard ++** error checking that the API function provides and should ++** not be called from outside this file. ++** ++** Parameters: *pInfo - Tuner control structure ++** reg - MT2266 register/subaddress location ++** *val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Use this function if you need to read a register from ++** the MT2266. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++static UData_t UncheckedGet(MT2266_Info_t* pInfo, ++ U8Data reg, ++ U8Data* val) ++{ ++ UData_t status; /* Status to be returned */ ++ ++#if defined(_DEBUG) ++ status = MT_OK; ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (val == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_IS_ERROR(status)) ++ return(status); ++#endif ++ ++ status = MT2266_ReadSub(pInfo->hUserData, pInfo->address, reg, &pInfo->reg[reg], 1); ++ ++ if (MT_NO_ERROR(status)) ++ *val = pInfo->reg[reg]; ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetReg ++** ++** Description: Gets an MT2266 register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** reg - MT2266 register/subaddress location ++** *val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Use this function if you need to read a register from ++** the MT2266. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_GetReg(Handle_t h, ++ U8Data reg, ++ U8Data* val) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (val == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedGet(pInfo, reg, val); ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetUHFXFreqs ++** ++** Description: Retrieves the specified set of UHF Crossover Frequencies ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Usage: MT2266_Freq_Set tmpFreqs; ++** status = MT2266_GetUHFXFreqs(hMT2266, ++** MT2266_UHF1_WITH_ATTENUATION, ++** tmpFreqs ); ++** if (status & MT_ARG_RANGE) ++** // error, Invalid UHF Crossover Frequency Set requested. ++** else ++** for( int i = 0; i < MT2266_NUM_XFREQS; i++ ) ++** . . . ++** ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_ARG_RANGE - freq_type is out of range. ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: freqs_buffer *must* be defined of type MT2266_Freq_Set ++** to assure sufficient space allocation! ++** ++** USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetUHFXFreqs ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 10-26-2006 RSK Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetUHFXFreqs(Handle_t h, ++ MT2266_UHFXFreq_Type freq_type, ++ MT2266_XFreq_Set freqs_buffer) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ ++ if (freq_type >= MT2266_NUMBER_OF_XFREQ_SETS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ int i; ++ ++ for( i = 0; i < MT2266_NUM_XFREQS; i++ ) ++ { ++ freqs_buffer[i] = pInfo->xfreqs.xfreq[ freq_type ][i] * TUNE_STEP_SIZE / 1000; ++ } ++ } ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetUserData ++** ++** Description: Gets the user-defined data item. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** The hUserData parameter is a user-specific argument ++** that is stored internally with the other tuner- ++** specific information. ++** ++** For example, if additional arguments are needed ++** for the user to identify the device communicating ++** with the tuner, this argument can be used to supply ++** the necessary information. ++** ++** The hUserData parameter is initialized in the tuner's ++** Open function to NULL. ++** ++** See Also: MT2266_SetUserData, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_GetUserData(Handle_t h, ++ Handle_t* hUserData) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ ++ if (hUserData == MT_NULL) ++ status |= MT_ARG_NULL; ++ ++ if (MT_NO_ERROR(status)) ++ *hUserData = pInfo->hUserData; ++ ++ return (status); ++} ++ ++ ++/****************************************************************************** ++** ++** Name: MT2266_ReInit ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 06-08-2006 JWS Ver 1.01: Corrected problem with tuner ID check ++** N/A 11-01-2006 RSK Ver 1.02: Initialize XFreq Tables to Default ++** N/A 11-29-2006 DAD Ver 1.03: Parenthesis clarification ++** ++******************************************************************************/ ++UData_t MT2266_ReInit(Handle_t h) ++{ ++ int j; ++ ++ U8Data MT2266_Init_Defaults1[] = ++ { ++ 0x01, /* Start w/register 0x01 */ ++ 0x00, /* Reg 0x01 */ ++ 0x00, /* Reg 0x02 */ ++ 0x28, /* Reg 0x03 */ ++ 0x00, /* Reg 0x04 */ ++ 0x52, /* Reg 0x05 */ ++ 0x99, /* Reg 0x06 */ ++ 0x3F, /* Reg 0x07 */ ++ }; ++ ++ U8Data MT2266_Init_Defaults2[] = ++ { ++ 0x17, /* Start w/register 0x17 */ ++ 0x6D, /* Reg 0x17 */ ++ 0x71, /* Reg 0x18 */ ++ 0x61, /* Reg 0x19 */ ++ 0xC0, /* Reg 0x1A */ ++ 0xBF, /* Reg 0x1B */ ++ 0xFF, /* Reg 0x1C */ ++ 0xDC, /* Reg 0x1D */ ++ 0x00, /* Reg 0x1E */ ++ 0x0A, /* Reg 0x1F */ ++ 0xD4, /* Reg 0x20 */ ++ 0x03, /* Reg 0x21 */ ++ 0x64, /* Reg 0x22 */ ++ 0x64, /* Reg 0x23 */ ++ 0x64, /* Reg 0x24 */ ++ 0x64, /* Reg 0x25 */ ++ 0x22, /* Reg 0x26 */ ++ 0xAA, /* Reg 0x27 */ ++ 0xF2, /* Reg 0x28 */ ++ 0x1E, /* Reg 0x29 */ ++ 0x80, /* Reg 0x2A */ ++ 0x14, /* Reg 0x2B */ ++ 0x01, /* Reg 0x2C */ ++ 0x01, /* Reg 0x2D */ ++ 0x01, /* Reg 0x2E */ ++ 0x01, /* Reg 0x2F */ ++ 0x01, /* Reg 0x30 */ ++ 0x01, /* Reg 0x31 */ ++ 0x7F, /* Reg 0x32 */ ++ 0x5E, /* Reg 0x33 */ ++ 0x3F, /* Reg 0x34 */ ++ 0xFF, /* Reg 0x35 */ ++ 0xFF, /* Reg 0x36 */ ++ 0xFF, /* Reg 0x37 */ ++ 0x00, /* Reg 0x38 */ ++ 0x77, /* Reg 0x39 */ ++ 0x0F, /* Reg 0x3A */ ++ 0x2D, /* Reg 0x3B */ ++ }; ++ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ U8Data BBVref; ++ U8Data tmpreg = 0; ++ U8Data statusreg = 0; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ /* Read the Part/Rev code from the tuner */ ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedGet(pInfo, MT2266_PART_REV, &tmpreg); ++ if (MT_NO_ERROR(status) && (tmpreg != 0x85)) // MT226? B0 ++ status |= MT_TUNER_ID_ERR; ++ else ++ { ++ /* ++ ** Read the status register 5 ++ */ ++ tmpreg = pInfo->reg[MT2266_RSVD_11] |= 0x03; ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedSet(pInfo, MT2266_RSVD_11, tmpreg); ++ tmpreg &= ~(0x02); ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedSet(pInfo, MT2266_RSVD_11, tmpreg); ++ ++ /* Get and store the status 5 register value */ ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedGet(pInfo, MT2266_STATUS_5, &statusreg); ++ ++ /* MT2266 */ ++ if (MT_IS_ERROR(status) || ((statusreg & 0x30) != 0x30)) ++ status |= MT_TUNER_ID_ERR; /* Wrong tuner Part/Rev code */ ++ } ++ ++ if (MT_NO_ERROR(status)) ++ { ++ /* Initialize the tuner state. Hold off on f_in and f_LO */ ++ pInfo->version = VERSION; ++ pInfo->tuner_id = pInfo->reg[MT2266_PART_REV]; ++ pInfo->f_Ref = REF_FREQ; ++ pInfo->f_Step = TUNE_STEP_SIZE * 1000; /* kHz -> Hz */ ++ pInfo->f_in = UHF_DEFAULT_FREQ; ++ pInfo->f_LO = UHF_DEFAULT_FREQ; ++ pInfo->f_bw = OUTPUT_BW; ++ pInfo->band = MT2266_UHF_BAND; ++ pInfo->num_regs = END_REGS; ++ ++ /* Reset the UHF Crossover Frequency tables on open/init. */ ++ for (j=0; j< MT2266_NUM_XFREQS; j++ ) ++ { ++ pInfo->xfreqs.xfreq[MT2266_UHF0][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF0][j]; ++ pInfo->xfreqs.xfreq[MT2266_UHF1][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF1][j]; ++ pInfo->xfreqs.xfreq[MT2266_UHF0_ATTEN][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF0_ATTEN][j]; ++ pInfo->xfreqs.xfreq[MT2266_UHF1_ATTEN][j] = MT2266_default_XFreqs.xfreq[MT2266_UHF1_ATTEN][j]; ++ } ++ ++ /* Write the default values to the tuner registers. Default mode is UHF */ ++ status |= MT2266_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ MT2266_Init_Defaults1[0], ++ &MT2266_Init_Defaults1[1], ++ sizeof(MT2266_Init_Defaults1)/sizeof(U8Data)-1); ++ status |= MT2266_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ MT2266_Init_Defaults2[0], ++ &MT2266_Init_Defaults2[1], ++ sizeof(MT2266_Init_Defaults2)/sizeof(U8Data)-1); ++ } ++ ++ /* Read back all the registers from the tuner */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2266_ReadSub(pInfo->hUserData, pInfo->address, 0, &pInfo->reg[0], END_REGS); ++ } ++ ++ /* ++ ** Set reg[0x33] based on statusreg ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ BBVref = (((statusreg >> 6) + 2) & 0x03); ++ tmpreg = (pInfo->reg[MT2266_RSVD_33] & ~(0x60)) | (BBVref << 5); ++ status |= UncheckedSet(pInfo, MT2266_RSVD_33, tmpreg); ++ } ++ ++ /* Run the baseband filter calibration */ ++ if (MT_NO_ERROR(status)) ++ status |= Run_BB_RC_Cal2(h); ++ ++ /* Set the baseband filter bandwidth to the default */ ++ if (MT_NO_ERROR(status)) ++ status |= Set_BBFilt(h); ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetParam ++** ++** Description: Sets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm. You can override many of the tuning ++** algorithm defaults using this function. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2266_Param) ++** nValue - value to be set ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2266_SRO_FREQ crystal frequency ++** MT2266_STEPSIZE minimum tuning step size ++** MT2266_INPUT_FREQ Center of input channel ++** MT2266_OUTPUT_BW Output channel bandwidth ++** MT2266_RF_ATTN RF attenuation (0-255) ++** MT2266_RF_EXT External control of RF atten ++** MT2266_LNA_GAIN LNA gain setting (0-15) ++** MT2266_LNA_GAIN_DECR Decrement LNA Gain (arg=min) ++** MT2266_LNA_GAIN_INCR Increment LNA Gain (arg=max) ++** MT2266_BB_ATTN Baseband attenuation (0-255) ++** MT2266_BB_EXT External control of BB atten ++** MT2266_UHF_MAXSENS Set for UHF max sensitivity mode ++** MT2266_UHF_NORMAL Set for UHF normal mode ++** ++** Usage: status |= MT2266_SetParam(hMT2266, ++** MT2266_STEPSIZE, ++** 50000); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Invalid parameter requested ++** or set value out of range ++** or non-writable parameter ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_GetParam, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 11-29-2006 DAD Ver 1.03: Parenthesis clarification for gcc ++** ++****************************************************************************/ ++UData_t MT2266_SetParam(Handle_t h, ++ MT2266_Param param, ++ UData_t nValue) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ U8Data tmpreg; ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ switch (param) ++ { ++ /* crystal frequency */ ++ case MT2266_SRO_FREQ: ++ pInfo->f_Ref = nValue; ++ if (pInfo->f_Ref < 22000000) ++ { ++ /* Turn off f_SRO divide by 2 */ ++ status |= UncheckedSet(pInfo, ++ MT2266_SRO_CTRL, ++ (U8Data) (pInfo->reg[MT2266_SRO_CTRL] &= 0xFE)); ++ } ++ else ++ { ++ /* Turn on f_SRO divide by 2 */ ++ status |= UncheckedSet(pInfo, ++ MT2266_SRO_CTRL, ++ (U8Data) (pInfo->reg[MT2266_SRO_CTRL] |= 0x01)); ++ } ++ status |= Run_BB_RC_Cal2(h); ++ if (MT_NO_ERROR(status)) ++ status |= Set_BBFilt(h); ++ break; ++ ++ /* minimum tuning step size */ ++ case MT2266_STEPSIZE: ++ pInfo->f_Step = nValue; ++ break; ++ ++ /* Width of output channel */ ++ case MT2266_OUTPUT_BW: ++ pInfo->f_bw = nValue; ++ status |= Set_BBFilt(h); ++ break; ++ ++ /* BB attenuation (0-255) */ ++ case MT2266_BB_ATTN: ++ if (nValue > 255) ++ status |= MT_ARG_RANGE; ++ else ++ { ++ UData_t BBA_Stage1; ++ UData_t BBA_Stage2; ++ UData_t BBA_Stage3; ++ ++ BBA_Stage3 = (nValue > 102) ? 103 : nValue + 1; ++ BBA_Stage2 = (nValue > 175) ? 75 : nValue + 2 - BBA_Stage3; ++ BBA_Stage1 = (nValue > 176) ? nValue - 175 : 1; ++ pInfo->reg[MT2266_RSVD_2C] = (U8Data) BBA_Stage1; ++ pInfo->reg[MT2266_RSVD_2D] = (U8Data) BBA_Stage2; ++ pInfo->reg[MT2266_RSVD_2E] = (U8Data) BBA_Stage3; ++ pInfo->reg[MT2266_RSVD_2F] = (U8Data) BBA_Stage1; ++ pInfo->reg[MT2266_RSVD_30] = (U8Data) BBA_Stage2; ++ pInfo->reg[MT2266_RSVD_31] = (U8Data) BBA_Stage3; ++ status |= MT2266_WriteSub(pInfo->hUserData, ++ pInfo->address, ++ MT2266_RSVD_2C, ++ &pInfo->reg[MT2266_RSVD_2C], ++ 6); ++ } ++ break; ++ ++ /* RF attenuation (0-255) */ ++ case MT2266_RF_ATTN: ++ if (nValue > 255) ++ status |= MT_ARG_RANGE; ++ else ++ status |= UncheckedSet(pInfo, MT2266_RSVD_1F, (U8Data) nValue); ++ break; ++ ++ /* RF external / internal atten control */ ++ case MT2266_RF_EXT: ++ if (nValue == 0) ++ tmpreg = pInfo->reg[MT2266_GPO] &= ~0x40; ++ else ++ tmpreg = pInfo->reg[MT2266_GPO] |= 0x40; ++ status |= UncheckedSet(pInfo, MT2266_GPO, tmpreg); ++ break; ++ ++ /* LNA gain setting (0-15) */ ++ case MT2266_LNA_GAIN: ++ if (nValue > 15) ++ status |= MT_ARG_RANGE; ++ else ++ { ++ tmpreg = (pInfo->reg[MT2266_IGAIN] & 0xC3) | ((U8Data)nValue << 2); ++ status |= UncheckedSet(pInfo, MT2266_IGAIN, tmpreg); ++ } ++ break; ++ ++ /* Decrement LNA Gain setting, argument is min LNA Gain setting */ ++ case MT2266_LNA_GAIN_DECR: ++ if (nValue > 15) ++ status |= MT_ARG_RANGE; ++ else ++ { ++ PREFETCH(MT2266_IGAIN, 1); ++ if (MT_NO_ERROR(status) && ((U8Data) ((pInfo->reg[MT2266_IGAIN] & 0x3C) >> 2) > (U8Data) nValue)) ++ status |= UncheckedSet(pInfo, MT2266_IGAIN, pInfo->reg[MT2266_IGAIN] - 0x04); ++ } ++ break; ++ ++ /* Increment LNA Gain setting, argument is max LNA Gain setting */ ++ case MT2266_LNA_GAIN_INCR: ++ if (nValue > 15) ++ status |= MT_ARG_RANGE; ++ else ++ { ++ PREFETCH(MT2266_IGAIN, 1); ++ if (MT_NO_ERROR(status) && ((U8Data) ((pInfo->reg[MT2266_IGAIN] & 0x3C) >> 2) < (U8Data) nValue)) ++ status |= UncheckedSet(pInfo, MT2266_IGAIN, pInfo->reg[MT2266_IGAIN] + 0x04); ++ } ++ break; ++ ++ /* BB external / internal atten control */ ++ case MT2266_BB_EXT: ++ if (nValue == 0) ++ tmpreg = pInfo->reg[MT2266_RSVD_33] &= ~0x08; ++ else ++ tmpreg = pInfo->reg[MT2266_RSVD_33] |= 0x08; ++ status |= UncheckedSet(pInfo, MT2266_RSVD_33, tmpreg); ++ break; ++ ++ /* Set for UHF max sensitivity mode */ ++ case MT2266_UHF_MAXSENS: ++ PREFETCH(MT2266_BAND_CTRL, 1); ++ if (MT_NO_ERROR(status) && ((pInfo->reg[MT2266_BAND_CTRL] & 0x30) == 0x10)) ++ status |= UncheckedSet(pInfo, MT2266_BAND_CTRL, pInfo->reg[MT2266_BAND_CTRL] ^ 0x30); ++ break; ++ ++ /* Set for UHF normal mode */ ++ case MT2266_UHF_NORMAL: ++ if (MT_NO_ERROR(status) && ((pInfo->reg[MT2266_BAND_CTRL] & 0x30) == 0x20)) ++ status |= UncheckedSet(pInfo, MT2266_BAND_CTRL, pInfo->reg[MT2266_BAND_CTRL] ^ 0x30); ++ break; ++ ++ /* These parameters are read-only */ ++ case MT2266_IC_ADDR: ++ case MT2266_MAX_OPEN: ++ case MT2266_NUM_OPEN: ++ case MT2266_NUM_REGS: ++ case MT2266_INPUT_FREQ: ++ case MT2266_LO_FREQ: ++ case MT2266_RC2_VALUE: ++ case MT2266_RF_ADC: ++ case MT2266_BB_ADC: ++ case MT2266_EOP: ++ default: ++ status |= MT_ARG_RANGE; ++ } ++ } ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetPowerModes ++** ++** Description: Sets the bits in the MT2266_ENABLES register and the ++** SROsd bit in the MT2266_SROADC_CTRL register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** flags - Bit mask of flags to indicate enabled ++** bits. ++** ++** Usage: status = MT2266_SetPowerModes(hMT2266, flags); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** The bits in the MT2266_ENABLES register and the ++** SROsd bit are set according to the supplied flags. ++** ++** The pre-defined flags are as follows: ++** MT2266_SROen ++** MT2266_LOen ++** MT2266_ADCen ++** MT2266_PDen ++** MT2266_DCOCen ++** MT2266_BBen ++** MT2266_MIXen ++** MT2266_LNAen ++** MT2266_ALL_ENABLES ++** MT2266_NO_ENABLES ++** MT2266_SROsd ++** MT2266_SRO_NOT_sd ++** ++** ONLY the enable bits (or SROsd bit) specified in the ++** flags parameter will be set. Any flag which is not ++** included, will cause that bit to be disabled. ++** ++** The ALL_ENABLES, NO_ENABLES, and SRO_NOT_sd constants ++** are for convenience. The NO_ENABLES and SRO_NOT_sd ++** do not actually have to be included, but are provided ++** for clarity. ++** ++** See Also: MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_SetPowerModes(Handle_t h, ++ UData_t flags) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ U8Data tmpreg; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ PREFETCH(MT2266_SRO_CTRL, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ if (MT_NO_ERROR(status)) ++ { ++ if (flags & MT2266_SROsd) ++ tmpreg = pInfo->reg[MT2266_SRO_CTRL] |= 0x10; /* set the SROsd bit */ ++ else ++ tmpreg = pInfo->reg[MT2266_SRO_CTRL] &= 0xEF; /* clear the SROsd bit */ ++ status |= UncheckedSet(pInfo, MT2266_SRO_CTRL, tmpreg); ++ } ++ ++ PREFETCH(MT2266_ENABLES, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= UncheckedSet(pInfo, MT2266_ENABLES, (U8Data)(flags & 0xff)); ++ } ++ ++ return status; ++} ++ ++ ++/**************************************************************************** ++** LOCAL FUNCTION - DO NOT USE OUTSIDE OF mt2266.c ++** ++** Name: UncheckedSet ++** ++** Description: Sets an MT2266 register. ++** ++** NOTE: This is a local function that performs the same ++** steps as the MT2266_SetReg function that is available ++** in the external API. It does not do any of the standard ++** error checking that the API function provides and should ++** not be called from outside this file. ++** ++** Parameters: *pInfo - Tuner control structure ++** reg - MT2266 register/subaddress location ++** val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Sets a register value without any preliminary checking for ++** valid handles or register numbers. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++static UData_t UncheckedSet(MT2266_Info_t* pInfo, ++ U8Data reg, ++ U8Data val) ++{ ++ UData_t status; /* Status to be returned */ ++ ++#if defined(_DEBUG) ++ status = MT_OK; ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_IS_ERROR(status)) ++ return (status); ++#endif ++ ++ status = MT2266_WriteSub(pInfo->hUserData, pInfo->address, reg, &val, 1); ++ ++ if (MT_NO_ERROR(status)) ++ pInfo->reg[reg] = val; ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetReg ++** ++** Description: Sets an MT2266 register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** reg - MT2266 register/subaddress location ++** val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Use this function if you need to override a default ++** register value ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++UData_t MT2266_SetReg(Handle_t h, ++ U8Data reg, ++ U8Data val) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status |= MT_INV_HANDLE; ++ ++ if (reg >= END_REGS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ status |= UncheckedSet(pInfo, reg, val); ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetUHFXFreqs ++** ++** Description: Assigns the specified set of UHF Crossover Frequencies ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Usage: MT2266_Freq_Set tmpFreqs; ++** status = MT2266_GetUHFXFreqs(hMT2266, ++** MT2266_UHF1_WITH_ATTENUATION, ++** tmpFreqs ); ++** ... ++** tmpFreqs[i] = ++** ... ++** status = MT2266_SetUHFXFreqs(hMT2266, ++** MT2266_UHF1_WITH_ATTENUATION, ++** tmpFreqs ); ++** ++** if (status & MT_ARG_RANGE) ++** // error, Invalid UHF Crossover Frequency Set requested. ++** else ++** for( int i = 0; i < MT2266_NUM_XFREQS; i++ ) ++** . . . ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_ARG_RANGE - freq_type is out of range. ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: freqs_buffer *must* be defined of type MT2266_Freq_Set ++** to assure sufficient space allocation! ++** ++** USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetUHFXFreqs ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 10-26-2006 RSK Original. ++** ++****************************************************************************/ ++UData_t MT2266_SetUHFXFreqs(Handle_t h, ++ MT2266_UHFXFreq_Type freq_type, ++ MT2266_XFreq_Set freqs_buffer) ++{ ++ UData_t status = MT_OK; /* Status to be returned */ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ status = MT_INV_HANDLE; ++ ++ if (freq_type >= MT2266_NUMBER_OF_XFREQ_SETS) ++ status |= MT_ARG_RANGE; ++ ++ if (MT_NO_ERROR(status)) ++ { ++ int i; ++ ++ for( i = 0; i < MT2266_NUM_XFREQS; i++ ) ++ { ++ pInfo->xfreqs.xfreq[ freq_type ][i] = freqs_buffer[i] * 1000 / TUNE_STEP_SIZE; ++ } ++ } ++ ++ return (status); ++} ++ ++ ++/**************************************************************************** ++** LOCAL FUNCTION ++** ++** Name: RoundToStep ++** ++** Description: Rounds the given frequency to the closes f_Step value ++** given the tuner ref frequency.. ++** ++** ++** Parameters: freq - Frequency to be rounded (in Hz). ++** f_Step - Step size for the frequency (in Hz). ++** f_Ref - SRO frequency (in Hz). ++** ++** Returns: Rounded frequency. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** ++****************************************************************************/ ++static UData_t RoundToStep(UData_t freq, UData_t f_Step, UData_t f_ref) ++{ ++ return f_ref * (freq / f_ref) ++ + f_Step * (((freq % f_ref) + (f_Step / 2)) / f_Step); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: fLO_FractionalTerm ++** ++** Description: Calculates the portion contributed by FracN / denom. ++** ++** This function preserves maximum precision without ++** risk of overflow. It accurately calculates ++** f_ref * num / denom to within 1 HZ with fixed math. ++** ++** Parameters: num - Fractional portion of the multiplier ++** denom - denominator portion of the ratio ++** This routine successfully handles denom values ++** up to and including 2^18. ++** f_Ref - SRO frequency. This calculation handles ++** f_ref as two separate 14-bit fields. ++** Therefore, a maximum value of 2^28-1 ++** may safely be used for f_ref. This is ++** the genesis of the magic number "14" and the ++** magic mask value of 0x03FFF. ++** ++** Returns: f_ref * num / denom ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 12-20-2006 RSK Ver 1.04: Adding fLO_FractionalTerm() usage. ++** ++****************************************************************************/ ++static UData_t fLO_FractionalTerm( UData_t f_ref, ++ UData_t num, ++ UData_t denom ) ++{ ++ UData_t t1 = (f_ref >> 14) * num; ++ UData_t term1 = t1 / denom; ++ UData_t loss = t1 % denom; ++ UData_t term2 = ( ((f_ref & 0x00003FFF) * num + (loss<<14)) + (denom/2) ) / denom; ++ return ((term1 << 14) + term2); ++} ++ ++ ++/**************************************************************************** ++** LOCAL FUNCTION ++** ++** Name: CalcLOMult ++** ++** Description: Calculates Integer divider value and the numerator ++** value for LO's FracN PLL. ++** ++** This function assumes that the f_LO and f_Ref are ++** evenly divisible by f_LO_Step. ++** ++** Parameters: Div - OUTPUT: Whole number portion of the multiplier ++** FracN - OUTPUT: Fractional portion of the multiplier ++** f_LO - desired LO frequency. ++** denom - LO FracN denominator value ++** f_Ref - SRO frequency. ++** ++** Returns: Recalculated LO frequency. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 12-20-2006 RSK Ver 1.04: Adding fLO_FractionalTerm() usage. ++** ++****************************************************************************/ ++static UData_t CalcLOMult(UData_t *Div, ++ UData_t *FracN, ++ UData_t f_LO, ++ UData_t denom, ++ UData_t f_Ref) ++{ ++ UData_t a, b, i; ++ const SData_t TwoNShift = 13; // bits to shift to obtain 2^n qty ++ const SData_t RoundShift = 18; // bits to shift before rounding ++ ++ /* Calculate the whole number portion of the divider */ ++ *Div = f_LO / f_Ref; ++ ++ /* ++ ** Calculate the FracN numerator 1 bit at a time. This keeps the ++ ** integer values from overflowing when large values are multiplied. ++ ** This loop calculates the fractional portion of F/20MHz accurate ++ ** to 32 bits. The 2^n factor is represented by the placement of ++ ** the value in the 32-bit word. Since we want as much accuracy ++ ** as possible, we'll leave it at the top of the word. ++ */ ++ *FracN = 0; ++ a = f_LO; ++ for (i=32; i>0; --i) ++ { ++ b = 2*(a % f_Ref); ++ *FracN = (*FracN * 2) + (b >= f_Ref); ++ a = b; ++ } ++ ++ /* ++ ** If the denominator is a 2^n - 1 value (the usual case) then the ++ ** value we really need is (F/20) * 2^n - (F/20). Shifting the ++ ** calculated (F/20) value to the right and subtracting produces ++ ** the desired result -- still accurate to 32 bits. ++ */ ++ if ((denom & 0x01) != 0) ++ *FracN -= (*FracN >> TwoNShift); ++ ++ /* ++ ** Now shift the result so that it is 1 bit bigger than we need, ++ ** use the low-order bit to round the remaining bits, and shift ++ ** to make the answer the desired size. ++ */ ++ *FracN >>= RoundShift; ++ *FracN = (*FracN & 0x01) + (*FracN >> 1); ++ ++ /* Check for rollover (cannot happen with 50 kHz step size) */ ++ if (*FracN == (denom | 1)) ++ { ++ *FracN = 0; ++ ++Div; ++ } ++ ++ ++ return (f_Ref * (*Div)) + fLO_FractionalTerm( f_Ref, *FracN, denom ); ++} ++ ++ ++/**************************************************************************** ++** LOCAL FUNCTION ++** ++** Name: GetCrossover ++** ++** Description: Determines the appropriate value in the set of ++** crossover frequencies. ++** ++** This function assumes that the crossover frequency table ++** ias been properly initialized in descending order. ++** ++** Parameters: f_in - The input frequency to use. ++** freqs - The array of crossover frequency entries. ++** ++** Returns: Index of crossover frequency band to use. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 10-27-2006 RSK Original ++** ++****************************************************************************/ ++static U8Data GetCrossover( UData_t f_in, UData_t* freqs ) ++{ ++ U8Data idx; ++ U8Data retVal = 0; ++ ++ for (idx=0; idx< (U8Data)MT2266_NUM_XFREQS; idx++) ++ { ++ if ( freqs[idx] >= f_in) ++ { ++ retVal = (U8Data)MT2266_NUM_XFREQS - idx; ++ break; ++ } ++ } ++ ++ return retVal; ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_ChangeFreq ++** ++** Description: Change the tuner's tuned frequency to f_in. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** f_in - RF input center frequency (in Hz). ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_FIN_RANGE - Input freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2266_Open BEFORE MT2266_ChangeFreq! ++** ++** MT_ReadSub - Read byte(s) of data from the two-wire-bus ++** MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** MT_Sleep - Delay execution for x milliseconds ++** MT2266_GetLocked - Checks to see if the PLL is locked ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 11-01-2006 RSK Ver 1.02: Added usage of UFILT0 and UFILT1. ++** N/A 11-29-2006 DAD Ver 1.03: Parenthesis clarification ++** 118 05-09-2007 RSK Ver 1.05: Refactored to call _Tune() API. ++** ++****************************************************************************/ ++UData_t MT2266_ChangeFreq(Handle_t h, ++ UData_t f_in) /* RF input center frequency */ ++{ ++ return (MT2266_Tune(h, f_in)); ++} ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_Tune ++** ++** Description: Change the tuner's tuned frequency to f_in. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** f_in - RF input center frequency (in Hz). ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_FIN_RANGE - Input freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2266_Open BEFORE MT2266_Tune! ++** ++** MT_ReadSub - Read byte(s) of data from the two-wire-bus ++** MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** MT_Sleep - Delay execution for x milliseconds ++** MT2266_GetLocked - Checks to see if the PLL is locked ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 11-01-2006 RSK Ver 1.02: Added usage of UFILT0 and UFILT1. ++** N/A 11-29-2006 DAD Ver 1.03: Parenthesis clarification ++** 118 05-09-2007 RSK Ver 1.05: Adding Standard MTxxxx_Tune() API. ++** ++****************************************************************************/ ++UData_t MT2266_Tune(Handle_t h, ++ UData_t f_in) /* RF input center frequency */ ++{ ++ MT2266_Info_t* pInfo = (MT2266_Info_t*) h; ++ ++ UData_t status = MT_OK; /* status of operation */ ++ UData_t LO; /* LO register value */ ++ UData_t Num; /* Numerator for LO reg. value */ ++ UData_t ofLO; /* last time's LO frequency */ ++ UData_t ofin; /* last time's input frequency */ ++ U8Data LO_Band; /* LO Mode bits */ ++ UData_t s_fRef; /* Ref Freq scaled for LO Band */ ++ UData_t this_band; /* Band for the requested freq */ ++ UData_t SROx2; /* SRO times 2 */ ++ ++ /* Verify that the handle passed points to a valid tuner */ ++ if (IsValidHandle(pInfo) == 0) ++ return MT_INV_HANDLE; ++ ++ /* ++ ** Save original input and LO value ++ */ ++ ofLO = pInfo->f_LO; ++ ofin = pInfo->f_in; ++ ++ /* ++ ** Assign in the requested input value ++ */ ++ pInfo->f_in = f_in; ++ ++ /* ++ ** Get the SRO multiplier value ++ */ ++ SROx2 = (2 - (pInfo->reg[MT2266_SRO_CTRL] & 0x01)); ++ ++ /* Check f_Step value */ ++ if(pInfo->f_Step == 0) ++ return MT_UNKNOWN; ++ ++ /* Request an LO that is on a step size boundary */ ++ pInfo->f_LO = RoundToStep(f_in, pInfo->f_Step, pInfo->f_Ref); ++ ++ if (pInfo->f_LO < MIN_VHF_FREQ) ++ { ++ status |= MT_FIN_RANGE | MT_ARG_RANGE | MT_DNC_RANGE; ++ return status; /* Does not support frequencies below MIN_VHF_FREQ */ ++ } ++ else if (pInfo->f_LO <= MAX_VHF_FREQ) ++ { ++ /* VHF Band */ ++ s_fRef = pInfo->f_Ref * SROx2 / 4; ++ LO_Band = 0; ++ this_band = MT2266_VHF_BAND; ++ } ++ else if (pInfo->f_LO < MIN_UHF_FREQ) ++ { ++ status |= MT_FIN_RANGE | MT_ARG_RANGE | MT_DNC_RANGE; ++ return status; /* Does not support frequencies between MAX_VHF_FREQ & MIN_UHF_FREQ */ ++ } ++ else if (pInfo->f_LO <= MAX_UHF_FREQ) ++ { ++ /* UHF Band */ ++ s_fRef = pInfo->f_Ref * SROx2 / 2; ++ LO_Band = 1; ++ this_band = MT2266_UHF_BAND; ++ } ++ else ++ { ++ status |= MT_FIN_RANGE | MT_ARG_RANGE | MT_DNC_RANGE; ++ return status; /* Does not support frequencies above MAX_UHF_FREQ */ ++ } ++ ++ /* ++ ** Calculate the LO frequencies and the values to be placed ++ ** in the tuning registers. ++ */ ++ pInfo->f_LO = CalcLOMult(&LO, &Num, pInfo->f_LO, 8191, s_fRef); ++ ++ /* ++ ** If we have the same LO frequencies and we're already locked, ++ ** then just return without writing any registers. ++ */ ++ if ((ofLO == pInfo->f_LO) ++ && ((pInfo->reg[MT2266_STATUS_1] & 0x40) == 0x40)) ++ { ++ return (status); ++ } ++ ++ /* ++ ** Reset defaults here if we're tuning into a new band ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ if (this_band != pInfo->band) ++ { ++ MT2266_DefaultsEntry *defaults = MT_NULL; ++ switch (this_band) ++ { ++ case MT2266_VHF_BAND: ++ defaults = &MT2266_VHF_defaults[0]; ++ break; ++ case MT2266_UHF_BAND: ++ defaults = &MT2266_UHF_defaults[0]; ++ break; ++ default: ++ status |= MT_ARG_RANGE; ++ } ++ if ( MT_NO_ERROR(status)) ++ { ++ while (defaults->data && MT_NO_ERROR(status)) ++ { ++ status |= MT2266_WriteSub(pInfo->hUserData, pInfo->address, defaults->data[0], &defaults->data[1], defaults->cnt); ++ defaults++; ++ } ++ /* re-read the new registers into the cached values */ ++ status |= MT2266_ReadSub(pInfo->hUserData, pInfo->address, 0, &pInfo->reg[0], END_REGS); ++ pInfo->band = this_band; ++ } ++ } ++ } ++ ++ /* ++ ** Place all of the calculated values into the local tuner ++ ** register fields. ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ pInfo->reg[MT2266_LO_CTRL_1] = (U8Data)(Num >> 8); ++ pInfo->reg[MT2266_LO_CTRL_2] = (U8Data)(Num & 0xFF); ++ pInfo->reg[MT2266_LO_CTRL_3] = (U8Data)(LO & 0xFF); ++ ++ /* ++ ** Now write out the computed register values ++ */ ++ status |= MT2266_WriteSub(pInfo->hUserData, pInfo->address, MT2266_LO_CTRL_1, &pInfo->reg[MT2266_LO_CTRL_1], 3); ++ ++ if (pInfo->band == MT2266_UHF_BAND) ++ { ++ U8Data UFilt0 = 0; /* def when f_in > all */ ++ U8Data UFilt1 = 0; /* def when f_in > all */ ++ UData_t* XFreq0; ++ UData_t* XFreq1; ++ SData_t ClearTune_Fuse; ++ SData_t f_offset; ++ UData_t f_in_; ++ ++ PREFETCH(MT2266_BAND_CTRL, 2); /* Fetch register(s) if __NO_CACHE__ defined */ ++ PREFETCH(MT2266_STATUS_5, 1); /* Fetch register(s) if __NO_CACHE__ defined */ ++ ++ XFreq0 = (pInfo->reg[MT2266_BAND_CTRL] & 0x10) ? pInfo->xfreqs.xfreq[ MT2266_UHF0_ATTEN ] : pInfo->xfreqs.xfreq[ MT2266_UHF0 ]; ++ XFreq1 = (pInfo->reg[MT2266_BAND_CTRL] & 0x10) ? pInfo->xfreqs.xfreq[ MT2266_UHF1_ATTEN ] : pInfo->xfreqs.xfreq[ MT2266_UHF1 ]; ++ ++ ClearTune_Fuse = pInfo->reg[MT2266_STATUS_5] & 0x07; ++ f_offset = (10000000) * ((ClearTune_Fuse > 3) ? (ClearTune_Fuse - 8) : ClearTune_Fuse); ++ f_in_ = (f_in - f_offset) / 1000 / TUNE_STEP_SIZE; ++ ++ UFilt0 = GetCrossover( f_in_, XFreq0 ); ++ UFilt1 = GetCrossover( f_in_, XFreq1 ); ++ ++ /* If UFilt == 16, set UBANDen and set UFilt = 15 */ ++ if ( (UFilt0 == 16) || (UFilt1 == 16) ) ++ { ++ pInfo->reg[MT2266_BAND_CTRL] |= 0x01; ++ if( UFilt0 > 0 ) UFilt0--; ++ if( UFilt1 > 0 ) UFilt1--; ++ } ++ else ++ pInfo->reg[MT2266_BAND_CTRL] &= ~(0x01); ++ ++ pInfo->reg[MT2266_BAND_CTRL] = ++ (pInfo->reg[MT2266_BAND_CTRL] & 0x3F) | (LO_Band << 6); ++ ++ pInfo->reg[MT2266_CLEARTUNE] = (UFilt1 << 4) | UFilt0; ++ /* Write UBANDsel [05] & ClearTune [06] */ ++ status |= MT2266_WriteSub(pInfo->hUserData, pInfo->address, MT2266_BAND_CTRL, &pInfo->reg[MT2266_BAND_CTRL], 2); ++ } ++ } ++ ++ /* ++ ** Check for LO lock ++ */ ++ if (MT_NO_ERROR(status)) ++ { ++ status |= MT2266_GetLocked(h); ++ } ++ ++ return (status); ++} ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_mt2266.h b/drivers/media/dvb/dvb-usb/tuner_mt2266.h +new file mode 100644 +index 0000000..8473076 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mt2266.h +@@ -0,0 +1,1534 @@ ++#ifndef __TUNER_MT2266_H ++#define __TUNER_MT2266_H ++ ++/** ++ ++@file ++ ++@brief MT2266 tuner module declaration ++ ++One can manipulate MT2266 tuner through MT2266 module. ++MT2266 module is derived from tunerd module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_mt2266.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ MT2266_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthHz; ++ ++ ++ ... ++ ++ ++ ++ // Build MT2266 tuner module. ++ BuildMt2266Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0 // I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get MT2266 tuner extra module. ++ pTunerExtra = &(pTuner->Extra.Mt2266); ++ ++ // Open MT2266 handle. ++ pTunerExtra->OpenHandle(pTuner); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set MT2266 bandwidth. ++ pTunerExtra->SetBandwidthHz(pTuner, MT2266_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get MT2266 bandwidth. ++ pTunerExtra->GetBandwidthHz(pTuner, &BandwidthHz); ++ ++ ++ ++ ++ ++ // Close MT2266 handle. ++ pTunerExtra->CloseHandle(pTuner); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++// The following context is source code provided by Microtune. ++ ++ ++ ++ ++ ++// Microtune source code - mt_errordef.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt_errordef.h ++** ++** Description: Definition of bits in status/error word used by various ++** MicroTuner control programs. ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_errordef.h,v 1.1 2006/06/22 20:18:12 software Exp $ ++** CVS Source: $Source: /export/home/cvsroot/software/tuners/MT2266/mt_errordef.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 09-09-2004 JWS Original ++** 088 01-26-2005 DAD Added MT_TUNER_INIT_ERR. ++** N/A 12-09-2005 DAD Added MT_TUNER_TIMEOUT (info). ++** ++*****************************************************************************/ ++ ++/* ++** Note to users: DO NOT EDIT THIS FILE ++** ++** If you wish to rename any of the "user defined" bits, ++** it should be done in the user file that includes this ++** source file (e.g. mt_userdef.h) ++** ++*/ ++ ++ ++ ++/* ++** 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 ++** 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ++** M U <- Info Codes --> <# Spurs> < User> <----- Err Codes -----> ++** ++** 31 = MT_ERROR - Master Error Flag. If set, check Err Codes for reason. ++** 30 = MT_USER_ERROR - User-declared error flag. ++** 29 = Unused ++** 28 = Unused ++** 27 = MT_DNC_RANGE ++** 26 = MT_UPC_RANGE ++** 25 = MT_FOUT_RANGE ++** 24 = MT_FIN_OUT_OF_RANGE ++** 23 = MT_SPUR_PRESENT - Unavoidable spur in output ++** 22 = MT_TUNER_TIMEOUT ++** 21 = Unused ++** 20 = Unused ++** 19 = MT_SPUR_CNT_MASK (MSB) - Count of avoided spurs ++** 18 = MT_SPUR_CNT_MASK ++** 17 = MT_SPUR_CNT_MASK ++** 16 = MT_SPUR_CNT_MASK ++** 15 = MT_SPUR_CNT_MASK (LSB) ++** 14 = MT_USER_DEFINED4 - User-definable bit (see MT_Userdef.h) ++** 13 = MT_USER_DEFINED3 - User-definable bit (see MT_Userdef.h) ++** 12 = MT_USER_DEFINED2 - User-definable bit (see MT_Userdef.h) ++** 11 = MT_USER_DEFINED1 - User-definable bit (see MT_Userdef.h) ++** 10 = Unused ++** 9 = MT_TUNER_INIT_ERR - Tuner initialization error ++** 8 = MT_TUNER_ID_ERR - Tuner Part Code / Rev Code mismatches expected value ++** 7 = MT_TUNER_CNT_ERR - Attempt to open more than MT_TUNER_CNT tuners ++** 6 = MT_ARG_NULL - Null pointer passed as argument ++** 5 = MT_ARG_RANGE - Argument value out of range ++** 4 = MT_INV_HANDLE - Tuner handle is invalid ++** 3 = MT_COMM_ERR - Serial bus communications error ++** 2 = MT_DNC_UNLOCK - Downconverter PLL is unlocked ++** 1 = MT_UPC_UNLOCK - Upconverter PLL is unlocked ++** 0 = MT_UNKNOWN - Unknown error ++*/ ++#define MT_ERROR (1 << 31) ++#define MT_USER_ERROR (1 << 30) ++ ++/* Macro to be used to check for errors */ ++#define MT_IS_ERROR(s) (((s) >> 30) != 0) ++#define MT_NO_ERROR(s) (((s) >> 30) == 0) ++ ++ ++#define MT_OK (0x00000000) ++ ++/* Unknown error */ ++#define MT_UNKNOWN (0x80000001) ++ ++/* Error: Upconverter PLL is not locked */ ++#define MT_UPC_UNLOCK (0x80000002) ++ ++/* Error: Downconverter PLL is not locked */ ++#define MT_DNC_UNLOCK (0x80000004) ++ ++/* Error: Two-wire serial bus communications error */ ++#define MT_COMM_ERR (0x80000008) ++ ++/* Error: Tuner handle passed to function was invalid */ ++#define MT_INV_HANDLE (0x80000010) ++ ++/* Error: Function argument is invalid (out of range) */ ++#define MT_ARG_RANGE (0x80000020) ++ ++/* Error: Function argument (ptr to return value) was NULL */ ++#define MT_ARG_NULL (0x80000040) ++ ++/* Error: Attempt to open more than MT_TUNER_CNT tuners */ ++#define MT_TUNER_CNT_ERR (0x80000080) ++ ++/* Error: Tuner Part Code / Rev Code mismatches expected value */ ++#define MT_TUNER_ID_ERR (0x80000100) ++ ++/* Error: Tuner Initialization failure */ ++#define MT_TUNER_INIT_ERR (0x80000200) ++ ++/* User-definable fields (see mt_userdef.h) */ ++#define MT_USER_DEFINED1 (0x00001000) ++#define MT_USER_DEFINED2 (0x00002000) ++#define MT_USER_DEFINED3 (0x00004000) ++#define MT_USER_DEFINED4 (0x00008000) ++#define MT_USER_MASK (0x4000f000) ++#define MT_USER_SHIFT (12) ++ ++/* Info: Mask of bits used for # of LO-related spurs that were avoided during tuning */ ++#define MT_SPUR_CNT_MASK (0x001f0000) ++#define MT_SPUR_SHIFT (16) ++ ++/* Info: Tuner timeout waiting for condition */ ++#define MT_TUNER_TIMEOUT (0x00400000) ++ ++/* Info: Unavoidable LO-related spur may be present in the output */ ++#define MT_SPUR_PRESENT (0x00800000) ++ ++/* Info: Tuner input frequency is out of range */ ++#define MT_FIN_RANGE (0x01000000) ++ ++/* Info: Tuner output frequency is out of range */ ++#define MT_FOUT_RANGE (0x02000000) ++ ++/* Info: Upconverter frequency is out of range (may be reason for MT_UPC_UNLOCK) */ ++#define MT_UPC_RANGE (0x04000000) ++ ++/* Info: Downconverter frequency is out of range (may be reason for MT_DPC_UNLOCK) */ ++#define MT_DNC_RANGE (0x08000000) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt_userdef.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt_userdef.h ++** ++** Description: User-defined data types needed by MicroTuner source code. ++** ++** Customers must provide the code for these functions ++** in the file "mt_userdef.c". ++** ++** Customers must verify that the typedef's in the ++** "Data Types" section are correct for their platform. ++** ++** Functions ++** Requiring ++** Implementation: MT_WriteSub ++** MT_ReadSub ++** MT_Sleep ++** ++** References: None ++** ++** Exports: None ++** ++** CVS ID: $Id: mt_userdef.h,v 1.1 2006/06/22 20:18:12 software Exp $ ++** CVS Source: $Source: /export/home/cvsroot/software/tuners/MT2266/mt_userdef.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** 082 12-06-2004 JWS Multi-tuner support - requires MTxxxx_CNT ++** declarations ++** ++*****************************************************************************/ ++#if !defined( __MT_USERDEF_H ) ++#define __MT_USERDEF_H ++ ++//#include "mt_errordef.h" ++ ++#if defined( __cplusplus ) ++extern "C" /* Use "C" external linkage */ ++{ ++#endif ++ ++/* ++** Data Types ++*/ ++typedef unsigned char U8Data; /* type corresponds to 8 bits */ ++typedef unsigned int UData_t; /* type must be at least 32 bits */ ++typedef int SData_t; /* type must be at least 32 bits */ ++typedef void * Handle_t; /* memory pointer type */ ++typedef double FData_t; /* floating point data type */ ++ ++#define MAX_UDATA (4294967295U) /* max value storable in UData_t */ ++ ++ ++/* ++** Define an MTxxxx_CNT macro for each type of tuner that will be built ++** into your application (e.g., MT2121, MT2060). MT_TUNER_CNT ++** must be set to the SUM of all of the MTxxxx_CNT macros. ++** ++** #define MT2050_CNT (1) ++** #define MT2060_CNT (1) ++** #define MT2111_CNT (1) ++** #define MT2121_CNT (3) ++*/ ++ ++ ++#if !defined( MT_TUNER_CNT ) ++#define MT_TUNER_CNT (1) /* total num of MicroTuner tuners */ ++#endif ++ ++/* ++** Optional user-defined Error/Info Codes (examples below) ++** ++** This is the area where you can define user-specific error/info return ++** codes to be returned by any of the functions you are responsible for ++** writing such as MT_WriteSub() and MT_ReadSub. There are four bits ++** available in the status field for your use. When set, these ++** bits will be returned in the status word returned by any tuner driver ++** call. If you OR in the MT_ERROR bit as well, the tuner driver code ++** will treat the code as an error. ++** ++** The following are a few examples of errors you can provide. ++** ++** Example 1: ++** You might check to see the hUserData handle is correct and issue ++** MY_USERDATA_INVALID which would be defined like this: ++** ++** #define MY_USERDATA_INVALID (MT_USER_ERROR | MT_USER_DEFINED1) ++** ++** ++** Example 2: ++** You might be able to provide more descriptive two-wire bus errors: ++** ++** #define NO_ACK (MT_USER_ERROR | MT_USER_DEFINED1) ++** #define NO_NACK (MT_USER_ERROR | MT_USER_DEFINED2) ++** #define BUS_BUSY (MT_USER_ERROR | MT_USER_DEFINED3) ++** ++** ++** Example 3: ++** You can also provide information (non-error) feedback: ++** ++** #define MY_INFO_1 (MT_USER_DEFINED1) ++** ++** ++** Example 4: ++** You can combine the fields together to make a multi-bit field. ++** This one can provide the tuner number based off of the addr ++** passed to MT_WriteSub or MT_ReadSub. It assumes that ++** MT_USER_DEFINED4 through MT_USER_DEFINED1 are contiguously. If ++** TUNER_NUM were OR'ed into the status word on an error, you could ++** use this to identify which tuner had the problem (and whether it ++** was during a read or write operation). ++** ++** #define TUNER_NUM ((addr & 0x07) >> 1) << MT_USER_SHIFT ++** ++*/ ++ ++/***************************************************************************** ++** ++** Name: MT_WriteSub ++** ++** Description: Write values to device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to write data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2266_WriteSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt); ++ ++ ++/***************************************************************************** ++** ++** Name: MT_ReadSub ++** ++** Description: Read values from device using a two-wire serial bus. ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** addr - device serial bus address (value passed ++** as parameter to MTxxxx_Open) ++** subAddress - serial bus sub-address (Register Address) ++** pData - pointer to the Data to be written to the ++** device ++** cnt - number of bytes/registers to be written ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** user-defined ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code for this ++** function to read data using the tuner's 2-wire serial ++** bus. ++** ++** The hUserData parameter is a user-specific argument. ++** If additional arguments are needed for the user's ++** serial bus read/write functions, this argument can be ++** used to supply the necessary information. ++** The hUserData parameter is initialized in the tuner's Open ++** function. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++UData_t MT2266_ReadSub(Handle_t hUserData, ++ UData_t addr, ++ U8Data subAddress, ++ U8Data *pData, ++ UData_t cnt); ++ ++ ++/***************************************************************************** ++** ++** Name: MT_Sleep ++** ++** Description: Delay execution for "nMinDelayTime" milliseconds ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** nMinDelayTime - Delay time in milliseconds ++** ++** Returns: None. ++** ++** Notes: This is a callback function that is called from the ++** the tuning algorithm. You MUST provide code that ++** blocks execution for the specified period of time. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 03-25-2004 DAD Original ++** ++*****************************************************************************/ ++void MT2266_Sleep(Handle_t hUserData, ++ UData_t nMinDelayTime); ++ ++ ++#if defined(MT2060_CNT) ++#if MT2060_CNT > 0 ++/***************************************************************************** ++** ++** Name: MT_TunerGain (for MT2060 only) ++** ++** Description: Measure the relative tuner gain using the demodulator ++** ++** Parameters: hUserData - User-specific I/O parameter that was ++** passed to tuner's Open function. ++** pMeas - Tuner gain (1/100 of dB scale). ++** ie. 1234 = 12.34 (dB) ++** ++** Returns: status: ++** MT_OK - No errors ++** user-defined errors could be set ++** ++** Notes: This is a callback function that is called from the ++** the 1st IF location routine. You MUST provide ++** code that measures the relative tuner gain in a dB ++** (not linear) scale. The return value is an integer ++** value scaled to 1/100 of a dB. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 06-16-2004 DAD Original ++** N/A 11-30-2004 DAD Renamed from MT_DemodInputPower. This name ++** better describes what this function does. ++** ++*****************************************************************************/ ++UData_t MT_TunerGain(Handle_t hUserData, ++ SData_t* pMeas); ++#endif ++#endif ++ ++#if defined( __cplusplus ) ++} ++#endif ++ ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Microtune source code - mt2266.h ++ ++ ++ ++/***************************************************************************** ++** ++** Name: mt2266.h ++** ++** Copyright 2007 Microtune, Inc. All Rights Reserved ++** ++** This source code file contains confidential information and/or trade ++** secrets of Microtune, Inc. or its affiliates and is subject to the ++** terms of your confidentiality agreement with Microtune, Inc. or one of ++** its affiliates, as applicable. ++** ++*****************************************************************************/ ++ ++/***************************************************************************** ++** ++** Name: mt2266.h ++** ++** Description: Microtune MT2266 Tuner software interface. ++** Supports tuners with Part/Rev code: 0x85. ++** ++** Functions ++** Implemented: UData_t MT2266_Open ++** UData_t MT2266_Close ++** UData_t MT2266_ChangeFreq ++** UData_t MT2266_GetLocked ++** UData_t MT2266_GetParam ++** UData_t MT2266_GetReg ++** UData_t MT2266_GetUHFXFreqs ++** UData_t MT2266_GetUserData ++** UData_t MT2266_ReInit ++** UData_t MT2266_SetParam ++** UData_t MT2266_SetPowerModes ++** UData_t MT2266_SetReg ++** UData_t MT2266_SetUHFXFreqs ++** UData_t MT2266_Tune ++** ++** References: AN-00010: MicroTuner Serial Interface Application Note ++** MicroTune, Inc. ++** ++** Exports: None ++** ++** Dependencies: MT_ReadSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Read byte(s) of data from the two-wire bus. ++** ++** MT_WriteSub(hUserData, IC_Addr, subAddress, *pData, cnt); ++** - Write byte(s) of data to the two-wire bus. ++** ++** MT_Sleep(hUserData, nMinDelayTime); ++** - Delay execution for x milliseconds ++** ++** CVS ID: $Id: mt2266.h,v 1.3 2007/10/02 18:43:17 software Exp $ ++** CVS Source: $Source: /export/home/cvsroot/software/tuners/MT2266/mt2266.h,v $ ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 05-30-2006 DAD Ver 1.0: Modified version of mt2260.c (Ver 1.01). ++** N/A 11-01-2006 RSK Ver 1.02: Adding Get/Set UHFXFreq access functions. ++** 118 05-09-2007 RSK Ver 1.05: Adding Standard MTxxxx_Tune() API. ++** ++*****************************************************************************/ ++#if !defined( __MT2266_H ) ++#define __MT2266_H ++ ++//#include "mt_userdef.h" ++ ++#if defined( __cplusplus ) ++extern "C" /* Use "C" external linkage */ ++{ ++#endif ++ ++/* ++** Parameter for function MT2266_GetParam & MT2266_SetParam that ++** specifies the tuning algorithm parameter to be read/written. ++*/ ++typedef enum ++{ ++ /* tuner address set by MT2266_Open() */ ++ MT2266_IC_ADDR, ++ ++ /* max number of MT2266 tuners set by MT2266_CNT in mt_userdef.h */ ++ MT2266_MAX_OPEN, ++ ++ /* current number of open MT2266 tuners set by MT2266_Open() */ ++ MT2266_NUM_OPEN, ++ ++ /* Number of tuner registers */ ++ MT2266_NUM_REGS, ++ ++ /* crystal frequency (default: 18000000 Hz) */ ++ MT2266_SRO_FREQ, ++ ++ /* min tuning step size (default: 50000 Hz) */ ++ MT2266_STEPSIZE, ++ ++ /* input center frequency set by MT2266_ChangeFreq() */ ++ MT2266_INPUT_FREQ, ++ ++ /* LO Frequency set by MT2266_ChangeFreq() */ ++ MT2266_LO_FREQ, ++ ++ /* output channel bandwidth (default: 8000000 Hz) */ ++ MT2266_OUTPUT_BW, ++ ++ /* Base band filter calibration RC code (default: N/A) */ ++ MT2266_RC2_VALUE, ++ ++ /* Base band filter nominal cal RC code (default: N/A) */ ++ MT2266_RC2_NOMINAL, ++ ++ /* RF attenuator A/D readback (read-only) */ ++ MT2266_RF_ADC, ++ ++ /* BB attenuator A/D readback (read-only) */ ++ MT2266_BB_ADC, ++ ++ /* RF attenuator setting (default: varies) */ ++ MT2266_RF_ATTN, ++ ++ /* BB attenuator setting (default: varies) */ ++ MT2266_BB_ATTN, ++ ++ /* RF external / internal atten control (default: varies) */ ++ MT2266_RF_EXT, ++ ++ /* BB external / internal atten control (default: 1) */ ++ MT2266_BB_EXT, ++ ++ /* LNA gain setting (0-15) (default: varies) */ ++ MT2266_LNA_GAIN, ++ ++ /* Decrement LNA Gain (where arg=min LNA Gain value) */ ++ MT2266_LNA_GAIN_DECR, ++ ++ /* Increment LNA Gain (where arg=max LNA Gain value) */ ++ MT2266_LNA_GAIN_INCR, ++ ++ /* Set for UHF max sensitivity mode */ ++ MT2266_UHF_MAXSENS, ++ ++ /* Set for UHF normal mode */ ++ MT2266_UHF_NORMAL, ++ ++ MT2266_EOP /* last entry in enumerated list */ ++} MT2266_Param; ++ ++ ++/* ++** Parameter for function MT2266_GetUHFXFreqs & MT2266_SetUHFXFreqs that ++** specifies the particular frequency crossover table to be read/written. ++*/ ++typedef enum ++{ ++ /* Reference the UHF 0 filter, without any attenuation */ ++ MT2266_UHF0, ++ ++ /* Reference the UHF 1 filter, without any attenuation */ ++ MT2266_UHF1, ++ ++ /* Reference the UHF 0 filter, with attenuation */ ++ MT2266_UHF0_ATTEN, ++ ++ /* Reference the UHF 1 filter, with attenuation */ ++ MT2266_UHF1_ATTEN, ++ ++ MT2266_NUMBER_OF_XFREQ_SETS /* last entry in enumerated list */ ++ ++} MT2266_UHFXFreq_Type; ++ ++ ++#define MT2266_NUM_XFREQS (16) ++ ++typedef UData_t MT2266_XFreq_Set[ MT2266_NUM_XFREQS ]; ++ ++/* ++** Constants for Specifying Operating Band of the Tuner ++*/ ++#define MT2266_VHF_BAND (0) ++#define MT2266_UHF_BAND (1) ++#define MT2266_L_BAND (2) ++ ++/* ++** Constants for specifying power modes these values ++** are bit-mapped and can be added/OR'ed to indicate ++** multiple settings. Examples: ++** MT2266_SetPowerModes(h, MT2266_NO_ENABLES + MT22266_SROsd); ++** MT2266_SetPowerModes(h, MT2266_ALL_ENABLES | MT22266_SRO_NOT_sd); ++** MT2266_SetPowerModes(h, MT2266_NO_ENABLES + MT22266_SROsd); ++** MT2266_SetPowerModes(h, MT2266_SROen + MT22266_LOen + MT2266_ADCen); ++*/ ++#define MT2266_SROen (0x01) ++#define MT2266_LOen (0x02) ++#define MT2266_ADCen (0x04) ++#define MT2266_PDen (0x08) ++#define MT2266_DCOCen (0x10) ++#define MT2266_BBen (0x20) ++#define MT2266_MIXen (0x40) ++#define MT2266_LNAen (0x80) ++#define MT2266_ALL_ENABLES (0xFF) ++#define MT2266_NO_ENABLES (0x00) ++#define MT2266_SROsd (0x100) ++#define MT2266_SRO_NOT_sd (0x000) ++ ++/* ====== Functions which are declared in mt2266.c File ======= */ ++ ++/****************************************************************************** ++** ++** Name: MT2266_Open ++** ++** Description: Initialize the tuner's register values. ++** ++** Usage: status = MT2266_Open(0xC0, &hMT2266, NULL); ++** if (MT_IS_ERROR(status)) ++** // Check error codes for reason ++** ++** Parameters: MT2266_Addr - Serial bus address of the tuner. ++** hMT2266 - Tuner handle passed back. ++** hUserData - User-defined data, if needed for the ++** MT_ReadSub() & MT_WriteSub functions. ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** MT_COMM_ERR - Serial bus communications error ++** MT_ARG_NULL - Null pointer argument passed ++** MT_TUNER_CNT_ERR - Too many tuners open ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++******************************************************************************/ ++UData_t MT2266_Open(UData_t MT2266_Addr, ++ Handle_t* hMT2266, ++ Handle_t hUserData); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2266_Close ++** ++** Description: Release the handle to the tuner. ++** ++** Parameters: hMT2266 - Handle to the MT2266 tuner ++** ++** Usage: status = MT2266_Close(hMT2266); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: mt_errordef.h - definition of error codes ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++******************************************************************************/ ++UData_t MT2266_Close(Handle_t hMT2266); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_ChangeFreq ++** ++** Description: Change the tuner's tuned frequency to f_in. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** f_in - RF input center frequency (in Hz). ++** ++** Usage: status = MT2266_ChangeFreq(hMT2266, f_in); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_FIN_RANGE - Input freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2266_Open BEFORE MT2266_ChangeFreq! ++** ++** MT_ReadSub - Read byte(s) of data from the two-wire-bus ++** MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** MT_Sleep - Delay execution for x milliseconds ++** MT2266_GetLocked - Checks to see if the PLL is locked ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++******************************************************************************/ ++UData_t MT2266_ChangeFreq(Handle_t h, ++ UData_t f_in); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetLocked ++** ++** Description: Checks to see if the PLL is locked. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Usage: status = MT2266_GetLocked(hMT2266); ++** if (status & MT_DNC_UNLOCK) ++** // error!, PLL is unlocked ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the serial bus ++** MT_Sleep - Delay execution for x milliseconds ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetLocked(Handle_t h); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetParam ++** ++** Description: Gets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm - mostly for testing purposes. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2266_Param) ++** pValue - ptr to returned value ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2266_IC_ADDR Serial Bus address of this tuner ++** MT2266_MAX_OPEN Max number of MT2266's that can be open ++** MT2266_NUM_OPEN Number of MT2266's currently open ++** MT2266_NUM_REGS Number of tuner registers ++** MT2266_SRO_FREQ crystal frequency ++** MT2266_STEPSIZE minimum tuning step size ++** MT2266_INPUT_FREQ input center frequency ++** MT2266_LO_FREQ LO Frequency ++** MT2266_OUTPUT_BW Output channel bandwidth ++** MT2266_RC2_VALUE Base band filter cal RC code (method 2) ++** MT2266_RF_ADC RF attenuator A/D readback ++** MT2266_RF_ATTN RF attenuation (0-255) ++** MT2266_RF_EXT External control of RF atten ++** MT2266_LNA_GAIN LNA gain setting (0-15) ++** MT2266_BB_ADC BB attenuator A/D readback ++** MT2266_BB_ATTN Baseband attenuation (0-255) ++** MT2266_BB_EXT External control of BB atten ++** ++** Usage: status |= MT2266_GetParam(hMT2266, ++** MT2266_OUTPUT_BW, ++** &f_bw); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetParam, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetParam(Handle_t h, ++ MT2266_Param param, ++ UData_t* pValue); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetReg ++** ++** Description: Gets an MT2266 register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** reg - MT2266 register/subaddress location ++** *val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Use this function if you need to read a register from ++** the MT2266. ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetReg(Handle_t h, ++ U8Data reg, ++ U8Data* val); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetUHFXFreqs ++** ++** Description: Retrieves the specified set of UHF Crossover Frequencies ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Usage: MT2266_Freq_Set tmpFreqs; ++** status = MT2266_GetUHFXFreqs(hMT2266, ++** MT2266_UHF1_WITH_ATTENUATION, ++** tmpFreqs ); ++** if (status & MT_ARG_RANGE) ++** // error, Invalid UHF Crossover Frequency Set requested. ++** else ++** for( int i = 0; i < MT2266_NUM_XFREQS; i++ ) ++** . . . ++** ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_ARG_RANGE - freq_type is out of range. ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: freqs_buffer *must* be defined of type MT2266_Freq_Set ++** to assure sufficient space allocation! ++** ++** USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetUHFXFreqs ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 11-01-2006 RSK Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetUHFXFreqs(Handle_t h, ++ MT2266_UHFXFreq_Type freq_type, ++ MT2266_XFreq_Set freqs_buffer); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_GetUserData ++** ++** Description: Gets the user-defined data item. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** ++** Usage: status = MT2266_GetUserData(hMT2266, &hUserData); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** The hUserData parameter is a user-specific argument ++** that is stored internally with the other tuner- ++** specific information. ++** ++** For example, if additional arguments are needed ++** for the user to identify the device communicating ++** with the tuner, this argument can be used to supply ++** the necessary information. ++** ++** The hUserData parameter is initialized in the tuner's ++** Open function to NULL. ++** ++** See Also: MT2266_SetUserData, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_GetUserData(Handle_t h, ++ Handle_t* hUserData); ++ ++ ++/****************************************************************************** ++** ++** Name: MT2266_ReInit ++** ++** Description: Initialize the tuner's register values. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_TUNER_ID_ERR - Tuner Part/Rev code mismatch ++** MT_TUNER_INIT_ERR - Tuner initialization failed ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_COMM_ERR - Serial bus communications error ++** ++** Dependencies: MT_ReadSub - Read byte(s) of data from the two-wire bus ++** MT_WriteSub - Write byte(s) of data to the two-wire bus ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++******************************************************************************/ ++UData_t MT2266_ReInit(Handle_t h); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetParam ++** ++** Description: Sets a tuning algorithm parameter. ++** ++** This function provides access to the internals of the ++** tuning algorithm. You can override many of the tuning ++** algorithm defaults using this function. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** param - Tuning algorithm parameter ++** (see enum MT2266_Param) ++** nValue - value to be set ++** ++** param Description ++** ---------------------- -------------------------------- ++** MT2266_SRO_FREQ crystal frequency ++** MT2266_STEPSIZE minimum tuning step size ++** MT2266_INPUT_FREQ Center of input channel ++** MT2266_OUTPUT_BW Output channel bandwidth ++** MT2266_RF_ATTN RF attenuation (0-255) ++** MT2266_RF_EXT External control of RF atten ++** MT2266_LNA_GAIN LNA gain setting (0-15) ++** MT2266_LNA_GAIN_DECR Decrement LNA Gain (arg=min) ++** MT2266_LNA_GAIN_INCR Increment LNA Gain (arg=max) ++** MT2266_BB_ATTN Baseband attenuation (0-255) ++** MT2266_BB_EXT External control of BB atten ++** MT2266_UHF_MAXSENS Set for UHF max sensitivity mode ++** MT2266_UHF_NORMAL Set for UHF normal mode ++** ++** Usage: status |= MT2266_SetParam(hMT2266, ++** MT2266_STEPSIZE, ++** 50000); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_NULL - Null pointer argument passed ++** MT_ARG_RANGE - Invalid parameter requested ++** or set value out of range ++** or non-writable parameter ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_GetParam, MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_SetParam(Handle_t h, ++ MT2266_Param param, ++ UData_t nValue); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetPowerModes ++** ++** Description: Sets the bits in the MT2266_ENABLES register and the ++** SROsd bit in the MT2266_SROADC_CTRL register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** flags - Bit mask of flags to indicate enabled ++** bits. ++** ++** Usage: status = MT2266_SetPowerModes(hMT2266, flags); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** The bits in the MT2266_ENABLES register and the ++** SROsd bit are set according to the supplied flags. ++** ++** The pre-defined flags are as follows: ++** MT2266_SROen ++** MT2266_LOen ++** MT2266_ADCen ++** MT2266_PDen ++** MT2266_DCOCen ++** MT2266_BBen ++** MT2266_MIXen ++** MT2266_LNAen ++** MT2266_ALL_ENABLES ++** MT2266_NO_ENABLES ++** MT2266_SROsd ++** MT2266_SRO_NOT_sd ++** ++** ONLY the enable bits (or SROsd bit) specified in the ++** flags parameter will be set. Any flag which is not ++** included, will cause that bit to be disabled. ++** ++** The ALL_ENABLES, NO_ENABLES, and SRO_NOT_sd constants ++** are for convenience. The NO_ENABLES and SRO_NOT_sd ++** do not actually have to be included, but are provided ++** for clarity. ++** ++** See Also: MT2266_Open ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_SetPowerModes(Handle_t h, ++ UData_t flags); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetReg ++** ++** Description: Sets an MT2266 register. ++** ++** Parameters: h - Tuner handle (returned by MT2266_Open) ++** reg - MT2266 register/subaddress location ++** val - MT2266 register/subaddress value ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_COMM_ERR - Serial bus communications error ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_ARG_RANGE - Argument out of range ++** ++** Dependencies: USERS MUST CALL MT2266_Open() FIRST! ++** ++** Use this function if you need to override a default ++** register value ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 02-03-2006 DAD/JWS Original. ++** ++****************************************************************************/ ++UData_t MT2266_SetReg(Handle_t h, ++ U8Data reg, ++ U8Data val); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_SetUHFXFreqs ++** ++** Description: Retrieves the specified set of UHF Crossover Frequencies ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** ++** Usage: MT2266_Freq_Set tmpFreqs; ++** status = MT2266_SetUHFXFreqs(hMT2266, ++** MT2266_UHF1_WITH_ATTENUATION, ++** tmpFreqs ); ++** if (status & MT_ARG_RANGE) ++** // error, Invalid UHF Crossover Frequency Set requested. ++** else ++** for( int i = 0; i < MT2266_NUM_XFREQS; i++ ) ++** . . . ++** ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_ARG_RANGE - freq_type is out of range. ++** MT_INV_HANDLE - Invalid tuner handle ++** ++** Dependencies: freqs_buffer *must* be defined of type MT2266_Freq_Set ++** to assure sufficient space allocation! ++** ++** USERS MUST CALL MT2266_Open() FIRST! ++** ++** See Also: MT2266_SetUHFXFreqs ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 11_01-2006 RSK Original. ++** ++****************************************************************************/ ++UData_t MT2266_SetUHFXFreqs(Handle_t h, ++ MT2266_UHFXFreq_Type freq_type, ++ MT2266_XFreq_Set freqs_buffer); ++ ++ ++/**************************************************************************** ++** ++** Name: MT2266_Tune ++** ++** Description: Change the tuner's tuned frequency to f_in. ++** ++** Parameters: h - Open handle to the tuner (from MT2266_Open). ++** f_in - RF input center frequency (in Hz). ++** ++** Usage: status = MT2266_Tune(hMT2266, f_in); ++** ++** Returns: status: ++** MT_OK - No errors ++** MT_INV_HANDLE - Invalid tuner handle ++** MT_DNC_UNLOCK - Downconverter PLL unlocked ++** MT_COMM_ERR - Serial bus communications error ++** MT_FIN_RANGE - Input freq out of range ++** MT_DNC_RANGE - Downconverter freq out of range ++** ++** Dependencies: MUST CALL MT2266_Open BEFORE MT2266_Tune! ++** ++** MT_ReadSub - Read byte(s) of data from the two-wire-bus ++** MT_WriteSub - Write byte(s) of data to the two-wire-bus ++** MT_Sleep - Delay execution for x milliseconds ++** MT2266_GetLocked - Checks to see if the PLL is locked ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** 118 05-09-2007 RSK Original API Introduction (was ChangeFreq). ++** ++******************************************************************************/ ++UData_t MT2266_Tune(Handle_t h, ++ UData_t f_in); ++ ++ ++#if defined( __cplusplus ) ++} ++#endif ++ ++#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is MT2266 tuner API source code ++ ++ ++ ++ ++ ++/** ++ ++@file ++ ++@brief MT2266 tuner module declaration ++ ++One can manipulate MT2266 tuner through MT2266 module. ++MT2266 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// Definitions ++ ++// MT2266 API option ++#define __NO_CACHE__ ++#define MT2266_CNT 4 ++ ++ ++// Bandwidth modes ++enum MT2266_BANDWIDTH_HZ ++{ ++ MT2266_BANDWIDTH_5MHZ = 5000000, ++ MT2266_BANDWIDTH_6MHZ = 6000000, ++ MT2266_BANDWIDTH_7MHZ = 7000000, ++ MT2266_BANDWIDTH_8MHZ = 8000000, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildMt2266Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++mt2266_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++mt2266_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++mt2266_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++mt2266_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++mt2266_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++mt2266_OpenHandle( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++mt2266_CloseHandle( ++ TUNER_MODULE *pTuner ++ ); ++ ++void ++mt2266_GetHandle( ++ TUNER_MODULE *pTuner, ++ void **pDeviceHandle ++ ); ++ ++int ++mt2266_SetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long BandwidthHz ++ ); ++ ++int ++mt2266_GetBandwidthHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pBandwidthHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_mxl5007t.c b/drivers/media/dvb/dvb-usb/tuner_mxl5007t.c +new file mode 100644 +index 0000000..9a238b2 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mxl5007t.c +@@ -0,0 +1,1267 @@ ++/** ++ ++@file ++ ++@brief MxL5007T tuner module definition ++ ++One can manipulate MxL5007T tuner through MxL5007T module. ++MxL5007T module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_mxl5007t.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief MxL5007T tuner module builder ++ ++Use BuildMxl5007tModule() to build MxL5007T module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to MxL5007T tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr MxL5007T I2C device address ++@param [in] CrystalFreqHz MxL5007T crystal frequency in Hz ++@param [in] StandardMode MxL5007T standard mode ++@param [in] IfFreqHz MxL5007T IF frequency in Hz ++@param [in] LoopThroughMode MxL5007T loop-through mode ++@param [in] ClkOutMode MxL5007T clock output mode ++@param [in] ClkOutAmpMode MxL5007T clock output amplitude mode ++@param [in] QamIfDiffOutLevel MxL5007T QAM IF differential output level for QAM standard only ++ ++ ++@note ++ -# One should call BuildMxl5007tModule() to build MxL5007T module before using it. ++ ++*/ ++void ++BuildMxl5007tModule( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int StandardMode, ++ unsigned long IfFreqHz, ++ int SpectrumMode, ++ int LoopThroughMode, ++ int ClkOutMode, ++ int ClkOutAmpMode, ++ long QamIfDiffOutLevel ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ MXL5007T_EXTRA_MODULE *pExtra; ++ MxL5007_TunerConfigS *pTunerConfigS; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mxl5007t); ++ ++ // Set and get MaxLinear-defined MxL5007T structure pointer. ++ pExtra->pTunerConfigS = &(pExtra->TunerConfigSMemory); ++ pTunerConfigS = pExtra->pTunerConfigS; ++ ++ // Set additional definition tuner module pointer. ++ pTunerConfigS->pTuner = pTuner; ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_MXL5007T; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = mxl5007t_GetTunerType; ++ pTuner->GetDeviceAddr = mxl5007t_GetDeviceAddr; ++ ++ pTuner->Initialize = mxl5007t_Initialize; ++ pTuner->SetRfFreqHz = mxl5007t_SetRfFreqHz; ++ pTuner->GetRfFreqHz = mxl5007t_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->LoopThroughMode = LoopThroughMode; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ ++ // Initialize MaxLinear-defined MxL5007T structure variables. ++ // Note: The API doesn't use I2C device address of MaxLinear-defined MxL5007T structure. ++ switch(StandardMode) ++ { ++ default: ++ case MXL5007T_STANDARD_DVBT: pTunerConfigS->Mode = MxL_MODE_DVBT; break; ++ case MXL5007T_STANDARD_ATSC: pTunerConfigS->Mode = MxL_MODE_ATSC; break; ++ case MXL5007T_STANDARD_QAM: pTunerConfigS->Mode = MxL_MODE_CABLE; break; ++ case MXL5007T_STANDARD_ISDBT: pTunerConfigS->Mode = MxL_MODE_ISDBT; break; ++ } ++ ++ pTunerConfigS->IF_Diff_Out_Level = (SINT32)QamIfDiffOutLevel; ++ ++ switch(CrystalFreqHz) ++ { ++ default: ++ case CRYSTAL_FREQ_16000000HZ: pTunerConfigS->Xtal_Freq = MxL_XTAL_16_MHZ; break; ++ case CRYSTAL_FREQ_24000000HZ: pTunerConfigS->Xtal_Freq = MxL_XTAL_24_MHZ; break; ++ case CRYSTAL_FREQ_25000000HZ: pTunerConfigS->Xtal_Freq = MxL_XTAL_25_MHZ; break; ++ case CRYSTAL_FREQ_27000000HZ: pTunerConfigS->Xtal_Freq = MxL_XTAL_27_MHZ; break; ++ case CRYSTAL_FREQ_28800000HZ: pTunerConfigS->Xtal_Freq = MxL_XTAL_28_8_MHZ; break; ++ } ++ ++ switch(IfFreqHz) ++ { ++ default: ++ case IF_FREQ_4570000HZ: pTunerConfigS->IF_Freq = MxL_IF_4_57_MHZ; break; ++ case IF_FREQ_36150000HZ: pTunerConfigS->IF_Freq = MxL_IF_36_15_MHZ; break; ++ case IF_FREQ_44000000HZ: pTunerConfigS->IF_Freq = MxL_IF_44_MHZ; break; ++ } ++ ++ switch(SpectrumMode) ++ { ++ default: ++ case SPECTRUM_NORMAL: pTunerConfigS->IF_Spectrum = MxL_NORMAL_IF; break; ++ case SPECTRUM_INVERSE: pTunerConfigS->IF_Spectrum = MxL_INVERT_IF; break; ++ } ++ ++ switch(ClkOutMode) ++ { ++ default: ++ case MXL5007T_CLK_OUT_DISABLE: pTunerConfigS->ClkOut_Setting = MxL_CLKOUT_DISABLE; break; ++ case MXL5007T_CLK_OUT_ENABLE: pTunerConfigS->ClkOut_Setting = MxL_CLKOUT_ENABLE; break; ++ } ++ ++ switch(ClkOutAmpMode) ++ { ++ default: ++ case MXL5007T_CLK_OUT_AMP_0: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_0; break; ++ case MXL5007T_CLK_OUT_AMP_1: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_1; break; ++ case MXL5007T_CLK_OUT_AMP_2: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_2; break; ++ case MXL5007T_CLK_OUT_AMP_3: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_3; break; ++ case MXL5007T_CLK_OUT_AMP_4: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_4; break; ++ case MXL5007T_CLK_OUT_AMP_5: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_5; break; ++ case MXL5007T_CLK_OUT_AMP_6: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_6; break; ++ case MXL5007T_CLK_OUT_AMP_7: pTunerConfigS->ClkOut_Amp = MxL_CLKOUT_AMP_7; break; ++ } ++ ++ pTunerConfigS->BW_MHz = MXL5007T_BANDWIDTH_MODE_DEFAULT; ++ pTunerConfigS->RF_Freq_Hz = MXL5007T_RF_FREQ_HZ_DEFAULT; ++ ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = mxl5007t_SetBandwidthMode; ++ pExtra->GetBandwidthMode = mxl5007t_GetBandwidthMode; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++mxl5007t_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++mxl5007t_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++mxl5007t_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ MXL5007T_EXTRA_MODULE *pExtra; ++ MxL5007_TunerConfigS *pTunerConfigS; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mxl5007t); ++ ++ // Get MaxLinear-defined MxL5007T structure. ++ pTunerConfigS = pExtra->pTunerConfigS; ++ ++ ++ // Initialize tuner. ++ if(MxL_Tuner_Init(pTunerConfigS) != MxL_OK) ++ goto error_status_initialize_tuner; ++ ++ // Set tuner loop-through mode. ++ if(MxL_Loop_Through_On(pTunerConfigS, pExtra->LoopThroughMode) != MxL_OK) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++mxl5007t_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ MXL5007T_EXTRA_MODULE *pExtra; ++ MxL5007_TunerConfigS *pTunerConfigS; ++ ++ UINT32 Mxl5007tRfFreqHz; ++ MxL5007_BW_MHz Mxl5007tBandwidthMhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mxl5007t); ++ ++ // Get MaxLinear-defined MxL5007T structure. ++ pTunerConfigS = pExtra->pTunerConfigS; ++ ++ ++ // Get bandwidth. ++ Mxl5007tBandwidthMhz = pTunerConfigS->BW_MHz; ++ ++ // Set RF frequency. ++ Mxl5007tRfFreqHz = (UINT32)RfFreqHz; ++ ++ // Set MxL5007T RF frequency and bandwidth. ++ if(MxL_Tuner_RFTune(pTunerConfigS, Mxl5007tRfFreqHz, Mxl5007tBandwidthMhz) != MxL_OK) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++mxl5007t_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set MxL5007T tuner bandwidth mode. ++ ++*/ ++int ++mxl5007t_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ MXL5007T_EXTRA_MODULE *pExtra; ++ MxL5007_TunerConfigS *pTunerConfigS; ++ ++ UINT32 Mxl5007tRfFreqHz; ++ MxL5007_BW_MHz Mxl5007tBandwidthMhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mxl5007t); ++ ++ // Get MaxLinear-defined MxL5007T structure. ++ pTunerConfigS = pExtra->pTunerConfigS; ++ ++ ++ // Get RF frequency. ++ Mxl5007tRfFreqHz = pTunerConfigS->RF_Freq_Hz; ++ ++ // Set bandwidth. ++ switch(BandwidthMode) ++ { ++ case MXL5007T_BANDWIDTH_6000000HZ: Mxl5007tBandwidthMhz = MxL_BW_6MHz; break; ++ case MXL5007T_BANDWIDTH_7000000HZ: Mxl5007tBandwidthMhz = MxL_BW_7MHz; break; ++ case MXL5007T_BANDWIDTH_8000000HZ: Mxl5007tBandwidthMhz = MxL_BW_8MHz; break; ++ ++ default: goto error_status_get_undefined_value; ++ } ++ ++ // Set MxL5007T RF frequency and bandwidth. ++ if(MxL_Tuner_RFTune(pTunerConfigS, Mxl5007tRfFreqHz, Mxl5007tBandwidthMhz) != MxL_OK) ++ goto error_status_set_tuner_bandwidth; ++ ++ ++ // Set tuner bandwidth parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth: ++error_status_get_undefined_value: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get MxL5007T tuner bandwidth mode. ++ ++*/ ++int ++mxl5007t_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ MXL5007T_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Mxl5007t); ++ ++ ++ // Get tuner bandwidth mode from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth_mode; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by MaxLinear. ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL_User_Define.c ++ ++ ++/* ++ ++ Driver APIs for MxL5007 Tuner ++ ++ Copyright, Maxlinear, Inc. ++ All Rights Reserved ++ ++ File Name: MxL_User_Define.c ++ ++ */ ++ ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++// // ++// I2C Functions (implement by customer) // ++// // ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++ ++/****************************************************************************** ++** ++** Name: MxL_I2C_Write ++** ++** Description: I2C write operations ++** ++** Parameters: ++** DeviceAddr - MxL5007 Device address ++** pArray - Write data array pointer ++** count - total number of array ++** ++** Returns: 0 if success ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 12-16-2007 khuang initial release. ++** ++******************************************************************************/ ++//UINT32 MxL_I2C_Write(UINT8 DeviceAddr, UINT8* pArray, UINT32 count) ++UINT32 MxL_I2C_Write(MxL5007_TunerConfigS* myTuner, UINT8* pArray, UINT32 count) ++{ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned long WritingByteNumMax; ++ ++ unsigned long i; ++ unsigned char Buffer[I2C_BUFFER_LEN]; ++ unsigned long WritingIndex; ++ ++ unsigned char *pData; ++ unsigned long DataLen; ++ ++ ++ ++ // Get tuner module, base interface, and I2C bridge. ++ pTuner = myTuner->pTuner; ++ pBaseInterface = pTuner->pBaseInterface; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ // Get writing byte and byte number. ++ pData = (unsigned char *)pArray; ++ DataLen = (unsigned long)count; ++ ++ // Calculate MxL5007T maximum writing byte number. ++ // Note: MxL5007T maximum writing byte number must be a multiple of 2. ++ WritingByteNumMax = pBaseInterface->I2cWritingByteNumMax; ++ WritingByteNumMax = ((WritingByteNumMax % 2) == 0) ? WritingByteNumMax : (WritingByteNumMax - 1); ++ ++ ++ // Set register bytes. ++ // Note: The 2 kind of I2C formats of MxL5007T is described as follows: ++ // 1. start_bit + (device_addr | writing_bit) + (register_addr + writing_byte) * n + stop_bit ++ // ... ++ // start_bit + (device_addr | writing_bit) + (register_addr + writing_byte) * m + stop_bit ++ // 2. start_bit + (device_addr | writing_bit) + 0xff + stop_bit ++ for(i = 0, WritingIndex = 0; i < DataLen; i++, WritingIndex++) ++ { ++ // Put data into buffer. ++ Buffer[WritingIndex] = pData[i]; ++ ++ // If writing buffer is full or put data into buffer completely, send the I2C writing command with buffer. ++ if( (WritingIndex == (WritingByteNumMax - 1)) || (i == (DataLen - 1)) ) ++ { ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, Buffer, (WritingIndex + LEN_1_BYTE)) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ WritingIndex = -1; ++ } ++ } ++ ++ ++ return MxL_OK; ++ ++ ++error_status_set_tuner_registers: ++ return MxL_ERR_OTHERS; ++} ++ ++/****************************************************************************** ++** ++** Name: MxL_I2C_Read ++** ++** Description: I2C read operations ++** ++** Parameters: ++** DeviceAddr - MxL5007 Device address ++** Addr - register address for read ++** *Data - data return ++** ++** Returns: 0 if success ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 12-16-2007 khuang initial release. ++** ++******************************************************************************/ ++//UINT32 MxL_I2C_Read(UINT8 DeviceAddr, UINT8 Addr, UINT8* mData) ++UINT32 MxL_I2C_Read(MxL5007_TunerConfigS* myTuner, UINT8 Addr, UINT8* mData) ++{ ++ TUNER_MODULE *pTuner; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ unsigned char Buffer[LEN_2_BYTE]; ++ ++ ++ ++ // Get tuner module and I2C bridge. ++ pTuner = myTuner->pTuner; ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + 0xfb + RegReadingAddr + stop_bit ++ Buffer[0] = (unsigned char)MXL5007T_I2C_READING_CONST; ++ Buffer[1] = (unsigned char)Addr; ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, Buffer, LEN_2_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register bytes. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + reading_byte + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, Buffer, LEN_1_BYTE) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ *mData = (UINT8)Buffer[0]; ++ ++ ++ return MxL_OK; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++ return MxL_ERR_OTHERS; ++} ++ ++/****************************************************************************** ++** ++** Name: MxL_Delay ++** ++** Description: Delay function in milli-second ++** ++** Parameters: ++** mSec - milli-second to delay ++** ++** Returns: 0 ++** ++** Revision History: ++** ++** SCR Date Author Description ++** ------------------------------------------------------------------------- ++** N/A 12-16-2007 khuang initial release. ++** ++******************************************************************************/ ++//void MxL_Delay(UINT32 mSec) ++void MxL_Delay(MxL5007_TunerConfigS* myTuner, UINT32 mSec) ++{ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ ++ // Get tuner module and base interface. ++ pTuner = myTuner->pTuner; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ // Wait in ms. ++ pBaseInterface->WaitMs(pBaseInterface, mSec); ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL5007.c ++ ++ ++/* ++ MxL5007 Source Code : V4.1.3 ++ ++ Copyright, Maxlinear, Inc. ++ All Rights Reserved ++ ++ File Name: MxL5007.c ++ ++ Description: The source code is for MxL5007 user to quickly integrate MxL5007 into their software. ++ There are two functions the user can call to generate a array of I2C command that's require to ++ program the MxL5007 tuner. The user should pass an array pointer and an integer pointer in to the ++ function. The funciton will fill up the array with format like follow: ++ ++ addr1 ++ data1 ++ addr2 ++ data2 ++ ... ++ ++ The user can then pass this array to their I2C function to perform progromming the tuner. ++*/ ++//#include "StdAfx.h" ++//#include "MxL5007_Common.h" ++//#include "MxL5007.h" ++ ++ ++ ++UINT32 MxL5007_Init(UINT8* pArray, // a array pointer that store the addr and data pairs for I2C write ++ UINT32* Array_Size, // a integer pointer that store the number of element in above array ++ UINT8 Mode, ++ SINT32 IF_Diff_Out_Level, ++ UINT32 Xtal_Freq_Hz, ++ UINT32 IF_Freq_Hz, ++ UINT8 Invert_IF, ++ UINT8 Clk_Out_Enable, ++ UINT8 Clk_Out_Amp ++ ) ++{ ++ ++ UINT32 Reg_Index=0; ++ UINT32 Array_Index=0; ++ ++ IRVType IRV_Init[]= ++ { ++ //{ Addr, Data} ++ { 0x02, 0x06}, ++ { 0x03, 0x48}, ++ { 0x05, 0x04}, ++ { 0x06, 0x10}, ++ { 0x2E, 0x15}, //Override ++ { 0x30, 0x10}, //Override ++ { 0x45, 0x58}, //Override ++ { 0x48, 0x19}, //Override ++ { 0x52, 0x03}, //Override ++ { 0x53, 0x44}, //Override ++ { 0x6A, 0x4B}, //Override ++ { 0x76, 0x00}, //Override ++ { 0x78, 0x18}, //Override ++ { 0x7A, 0x17}, //Override ++ { 0x85, 0x06}, //Override ++ { 0x01, 0x01}, //TOP_MASTER_ENABLE=1 ++ { 0, 0} ++ }; ++ ++ ++ IRVType IRV_Init_Cable[]= ++ { ++ //{ Addr, Data} ++ { 0x02, 0x06}, ++ { 0x03, 0x48}, ++ { 0x05, 0x04}, ++ { 0x06, 0x10}, ++ { 0x09, 0x3F}, ++ { 0x0A, 0x3F}, ++ { 0x0B, 0x3F}, ++ { 0x2E, 0x15}, //Override ++ { 0x30, 0x10}, //Override ++ { 0x45, 0x58}, //Override ++ { 0x48, 0x19}, //Override ++ { 0x52, 0x03}, //Override ++ { 0x53, 0x44}, //Override ++ { 0x6A, 0x4B}, //Override ++ { 0x76, 0x00}, //Override ++ { 0x78, 0x18}, //Override ++ { 0x7A, 0x17}, //Override ++ { 0x85, 0x06}, //Override ++ { 0x01, 0x01}, //TOP_MASTER_ENABLE=1 ++ { 0, 0} ++ }; ++ //edit Init setting here ++ ++ PIRVType myIRV=IRV_Init; ++ ++ switch(Mode) ++ { ++ case MxL_MODE_ISDBT: //ISDB-T Mode ++ myIRV = IRV_Init; ++ SetIRVBit(myIRV, 0x06, 0x1F, 0x10); ++ break; ++ case MxL_MODE_DVBT: //DVBT Mode ++ myIRV = IRV_Init; ++ SetIRVBit(myIRV, 0x06, 0x1F, 0x11); ++ break; ++ case MxL_MODE_ATSC: //ATSC Mode ++ myIRV = IRV_Init; ++ SetIRVBit(myIRV, 0x06, 0x1F, 0x12); ++ break; ++ case MxL_MODE_CABLE: ++ myIRV = IRV_Init_Cable; ++ SetIRVBit(myIRV, 0x09, 0xFF, 0xC1); ++ SetIRVBit(myIRV, 0x0A, 0xFF, 8-IF_Diff_Out_Level); ++ SetIRVBit(myIRV, 0x0B, 0xFF, 0x17); ++ break; ++ ++ ++ } ++ ++ switch(IF_Freq_Hz) ++ { ++ case MxL_IF_4_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x00); ++ break; ++ case MxL_IF_4_5_MHZ: //4.5MHz ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x02); ++ break; ++ case MxL_IF_4_57_MHZ: //4.57MHz ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x03); ++ break; ++ case MxL_IF_5_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x04); ++ break; ++ case MxL_IF_5_38_MHZ: //5.38MHz ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x05); ++ break; ++ case MxL_IF_6_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x06); ++ break; ++ case MxL_IF_6_28_MHZ: //6.28MHz ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x07); ++ break; ++ case MxL_IF_9_1915_MHZ: //9.1915MHz ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x08); ++ break; ++ case MxL_IF_35_25_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x09); ++ break; ++ case MxL_IF_36_15_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x0a); ++ break; ++ case MxL_IF_44_MHZ: ++ SetIRVBit(myIRV, 0x02, 0x0F, 0x0B); ++ break; ++ } ++ ++ if(Invert_IF) ++ SetIRVBit(myIRV, 0x02, 0x10, 0x10); //Invert IF ++ else ++ SetIRVBit(myIRV, 0x02, 0x10, 0x00); //Normal IF ++ ++ ++ switch(Xtal_Freq_Hz) ++ { ++ case MxL_XTAL_16_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x00); //select xtal freq & Ref Freq ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x00); ++ break; ++ case MxL_XTAL_20_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x10); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x01); ++ break; ++ case MxL_XTAL_20_25_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x20); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x02); ++ break; ++ case MxL_XTAL_20_48_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x30); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x03); ++ break; ++ case MxL_XTAL_24_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x40); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x04); ++ break; ++ case MxL_XTAL_25_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x50); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x05); ++ break; ++ case MxL_XTAL_25_14_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x60); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x06); ++ break; ++ case MxL_XTAL_27_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x70); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x07); ++ break; ++ case MxL_XTAL_28_8_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x80); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x08); ++ break; ++ case MxL_XTAL_32_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0x90); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x09); ++ break; ++ case MxL_XTAL_40_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0xA0); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x0A); ++ break; ++ case MxL_XTAL_44_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0xB0); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x0B); ++ break; ++ case MxL_XTAL_48_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0xC0); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x0C); ++ break; ++ case MxL_XTAL_49_3811_MHZ: ++ SetIRVBit(myIRV, 0x03, 0xF0, 0xD0); ++ SetIRVBit(myIRV, 0x05, 0x0F, 0x0D); ++ break; ++ } ++ ++ if(!Clk_Out_Enable) //default is enable ++ SetIRVBit(myIRV, 0x03, 0x08, 0x00); ++ ++ //Clk_Out_Amp ++ SetIRVBit(myIRV, 0x03, 0x07, Clk_Out_Amp); ++ ++ //Generate one Array that Contain Data, Address ++ while (myIRV[Reg_Index].Num || myIRV[Reg_Index].Val) ++ { ++ pArray[Array_Index++] = myIRV[Reg_Index].Num; ++ pArray[Array_Index++] = myIRV[Reg_Index].Val; ++ Reg_Index++; ++ } ++ ++ *Array_Size=Array_Index; ++ return 0; ++} ++ ++ ++UINT32 MxL5007_RFTune(UINT8* pArray, UINT32* Array_Size, UINT32 RF_Freq, UINT8 BWMHz) ++{ ++ IRVType IRV_RFTune[]= ++ { ++ //{ Addr, Data} ++ { 0x0F, 0x00}, //abort tune ++ { 0x0C, 0x15}, ++ { 0x0D, 0x40}, ++ { 0x0E, 0x0E}, ++ { 0x1F, 0x87}, //Override ++ { 0x20, 0x1F}, //Override ++ { 0x21, 0x87}, //Override ++ { 0x22, 0x1F}, //Override ++ { 0x80, 0x01}, //Freq Dependent Setting ++ { 0x0F, 0x01}, //start tune ++ { 0, 0} ++ }; ++ ++ UINT32 dig_rf_freq=0; ++ UINT32 temp; ++ UINT32 Reg_Index=0; ++ UINT32 Array_Index=0; ++ UINT32 i; ++ UINT32 frac_divider = 1000000; ++ ++ switch(BWMHz) ++ { ++ case MxL_BW_6MHz: //6MHz ++ SetIRVBit(IRV_RFTune, 0x0C, 0x3F, 0x15); //set DIG_MODEINDEX, DIG_MODEINDEX_A, and DIG_MODEINDEX_CSF ++ break; ++ case MxL_BW_7MHz: //7MHz ++ SetIRVBit(IRV_RFTune, 0x0C, 0x3F, 0x2A); ++ break; ++ case MxL_BW_8MHz: //8MHz ++ SetIRVBit(IRV_RFTune, 0x0C, 0x3F, 0x3F); ++ break; ++ } ++ ++ ++ //Convert RF frequency into 16 bits => 10 bit integer (MHz) + 6 bit fraction ++ dig_rf_freq = RF_Freq / MHz; ++ temp = RF_Freq % MHz; ++ for(i=0; i<6; i++) ++ { ++ dig_rf_freq <<= 1; ++ frac_divider /=2; ++ if(temp > frac_divider) ++ { ++ temp -= frac_divider; ++ dig_rf_freq++; ++ } ++ } ++ ++ //add to have shift center point by 7.8124 kHz ++ if(temp > 7812) ++ dig_rf_freq ++; ++ ++ SetIRVBit(IRV_RFTune, 0x0D, 0xFF, (UINT8)dig_rf_freq); ++ SetIRVBit(IRV_RFTune, 0x0E, 0xFF, (UINT8)(dig_rf_freq>>8)); ++ ++ if (RF_Freq >=333*MHz) ++ SetIRVBit(IRV_RFTune, 0x80, 0x40, 0x40); ++ ++ //Generate one Array that Contain Data, Address ++ while (IRV_RFTune[Reg_Index].Num || IRV_RFTune[Reg_Index].Val) ++ { ++ pArray[Array_Index++] = IRV_RFTune[Reg_Index].Num; ++ pArray[Array_Index++] = IRV_RFTune[Reg_Index].Val; ++ Reg_Index++; ++ } ++ ++ *Array_Size=Array_Index; ++ ++ return 0; ++} ++ ++//local functions called by Init and RFTune ++UINT32 SetIRVBit(PIRVType pIRV, UINT8 Num, UINT8 Mask, UINT8 Val) ++{ ++ while (pIRV->Num || pIRV->Val) ++ { ++ if (pIRV->Num==Num) ++ { ++ pIRV->Val&=~Mask; ++ pIRV->Val|=Val; ++ } ++ pIRV++; ++ ++ } ++ return 0; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL5007_API.h ++ ++ ++/* ++ ++ Driver APIs for MxL5007 Tuner ++ ++ Copyright, Maxlinear, Inc. ++ All Rights Reserved ++ ++ File Name: MxL5007_API.c ++ ++ Version: 4.1.3 ++*/ ++ ++ ++//#include "StdAfx.h" ++//#include "MxL5007_API.h" ++//#include "MxL_User_Define.c" ++//#include "MxL5007.c" ++ ++ ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++// // ++// Tuner Functions // ++// // ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// ++MxL_ERR_MSG MxL_Set_Register(MxL5007_TunerConfigS* myTuner, UINT8 RegAddr, UINT8 RegData) ++{ ++ UINT32 Status=0; ++ UINT8 pArray[2]; ++ pArray[0] = RegAddr; ++ pArray[1] = RegData; ++// Status = MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, 2); ++ Status = MxL_I2C_Write(myTuner, pArray, 2); ++ if(Status) return MxL_ERR_SET_REG; ++ ++ return MxL_OK; ++ ++} ++ ++MxL_ERR_MSG MxL_Get_Register(MxL5007_TunerConfigS* myTuner, UINT8 RegAddr, UINT8 *RegData) ++{ ++// if(MxL_I2C_Read((UINT8)myTuner->I2C_Addr, RegAddr, RegData)) ++ if(MxL_I2C_Read(myTuner, RegAddr, RegData)) ++ return MxL_ERR_GET_REG; ++ return MxL_OK; ++ ++} ++ ++MxL_ERR_MSG MxL_Soft_Reset(MxL5007_TunerConfigS* myTuner) ++{ ++/* UINT32 Status=0; */ ++ UINT8 reg_reset=0; ++ reg_reset = 0xFF; ++/* if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, ®_reset, 1))*/ ++ if(MxL_I2C_Write(myTuner, ®_reset, 1)) ++ return MxL_ERR_OTHERS; ++ ++ return MxL_OK; ++} ++ ++MxL_ERR_MSG MxL_Loop_Through_On(MxL5007_TunerConfigS* myTuner, MxL5007_LoopThru isOn) ++{ ++ UINT8 pArray[2]; // a array pointer that store the addr and data pairs for I2C write ++ ++ pArray[0]=0x04; ++ if(isOn) ++ pArray[1]= 0x01; ++ else ++ pArray[1]= 0x0; ++ ++// if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, 2)) ++ if(MxL_I2C_Write(myTuner, pArray, 2)) ++ return MxL_ERR_OTHERS; ++ ++ return MxL_OK; ++} ++ ++MxL_ERR_MSG MxL_Stand_By(MxL5007_TunerConfigS* myTuner) ++{ ++ UINT8 pArray[4]; // a array pointer that store the addr and data pairs for I2C write ++ ++ pArray[0] = 0x01; ++ pArray[1] = 0x0; ++ pArray[2] = 0x0F; ++ pArray[3] = 0x0; ++ ++// if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, 4)) ++ if(MxL_I2C_Write(myTuner, pArray, 4)) ++ return MxL_ERR_OTHERS; ++ ++ return MxL_OK; ++} ++ ++MxL_ERR_MSG MxL_Wake_Up(MxL5007_TunerConfigS* myTuner) ++{ ++ UINT8 pArray[2]; // a array pointer that store the addr and data pairs for I2C write ++ ++ pArray[0] = 0x01; ++ pArray[1] = 0x01; ++ ++// if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, 2)) ++ if(MxL_I2C_Write(myTuner, pArray, 2)) ++ return MxL_ERR_OTHERS; ++ ++ if(MxL_Tuner_RFTune(myTuner, myTuner->RF_Freq_Hz, myTuner->BW_MHz)) ++ return MxL_ERR_RFTUNE; ++ ++ return MxL_OK; ++} ++ ++MxL_ERR_MSG MxL_Tuner_Init(MxL5007_TunerConfigS* myTuner) ++{ ++ UINT8 pArray[MAX_ARRAY_SIZE]; // a array pointer that store the addr and data pairs for I2C write ++ UINT32 Array_Size; // a integer pointer that store the number of element in above array ++ ++ //Soft reset tuner ++ if(MxL_Soft_Reset(myTuner)) ++ return MxL_ERR_INIT; ++ ++ //perform initialization calculation ++ MxL5007_Init(pArray, &Array_Size, (UINT8)myTuner->Mode, myTuner->IF_Diff_Out_Level, (UINT32)myTuner->Xtal_Freq, ++ (UINT32)myTuner->IF_Freq, (UINT8)myTuner->IF_Spectrum, (UINT8)myTuner->ClkOut_Setting, (UINT8)myTuner->ClkOut_Amp); ++ ++ //perform I2C write here ++// if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, Array_Size)) ++ if(MxL_I2C_Write(myTuner, pArray, Array_Size)) ++ return MxL_ERR_INIT; ++ ++ return MxL_OK; ++} ++ ++ ++MxL_ERR_MSG MxL_Tuner_RFTune(MxL5007_TunerConfigS* myTuner, UINT32 RF_Freq_Hz, MxL5007_BW_MHz BWMHz) ++{ ++ //UINT32 Status=0; ++ UINT8 pArray[MAX_ARRAY_SIZE]; // a array pointer that store the addr and data pairs for I2C write ++ UINT32 Array_Size; // a integer pointer that store the number of element in above array ++ ++ //Store information into struc ++ myTuner->RF_Freq_Hz = RF_Freq_Hz; ++ myTuner->BW_MHz = BWMHz; ++ ++ //perform Channel Change calculation ++ MxL5007_RFTune(pArray,&Array_Size,RF_Freq_Hz,BWMHz); ++ ++ //perform I2C write here ++// if(MxL_I2C_Write((UINT8)myTuner->I2C_Addr, pArray, Array_Size)) ++ if(MxL_I2C_Write(myTuner, pArray, Array_Size)) ++ return MxL_ERR_RFTUNE; ++ ++ //wait for 3ms ++// MxL_Delay(3); ++ MxL_Delay(myTuner, 3); ++ ++ return MxL_OK; ++} ++ ++MxL5007_ChipVersion MxL_Check_ChipVersion(MxL5007_TunerConfigS* myTuner) ++{ ++ UINT8 Data; ++// if(MxL_I2C_Read((UINT8)myTuner->I2C_Addr, 0xD9, &Data)) ++ if(MxL_I2C_Read(myTuner, 0xD9, &Data)) ++ return MxL_GET_ID_FAIL; ++ ++ switch(Data) ++ { ++ case 0x14: return MxL_5007T_V4; break; ++ default: return MxL_UNKNOWN_ID; ++ } ++} ++ ++MxL_ERR_MSG MxL_RFSynth_Lock_Status(MxL5007_TunerConfigS* myTuner, BOOL* isLock) ++{ ++ UINT8 Data; ++ *isLock = MxL_FALSE; ++// if(MxL_I2C_Read((UINT8)myTuner->I2C_Addr, 0xD8, &Data)) ++ if(MxL_I2C_Read(myTuner, 0xD8, &Data)) ++ return MxL_ERR_OTHERS; ++ Data &= 0x0C; ++ if (Data == 0x0C) ++ *isLock = MxL_TRUE; //RF Synthesizer is Lock ++ return MxL_OK; ++} ++ ++MxL_ERR_MSG MxL_REFSynth_Lock_Status(MxL5007_TunerConfigS* myTuner, BOOL* isLock) ++{ ++ UINT8 Data; ++ *isLock = MxL_FALSE; ++// if(MxL_I2C_Read((UINT8)myTuner->I2C_Addr, 0xD8, &Data)) ++ if(MxL_I2C_Read(myTuner, 0xD8, &Data)) ++ return MxL_ERR_OTHERS; ++ Data &= 0x03; ++ if (Data == 0x03) ++ *isLock = MxL_TRUE; //REF Synthesizer is Lock ++ return MxL_OK; ++} ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_mxl5007t.h b/drivers/media/dvb/dvb-usb/tuner_mxl5007t.h +new file mode 100644 +index 0000000..18eac8a +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_mxl5007t.h +@@ -0,0 +1,784 @@ ++#ifndef __TUNER_MXL5007T_H ++#define __TUNER_MXL5007T_H ++ ++/** ++ ++@file ++ ++@brief MxL5007T tuner module declaration ++ ++One can manipulate MxL5007T tuner through MxL5007T module. ++MxL5007T module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_mxl5007t.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ MXL5007T_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ unsigned long BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build MxL5007T tuner module. ++ BuildMxl5007tModule( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0, // I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // Crystal frequency is 16.0 MHz. ++ MXL5007T_STANDARD_DVBT, // The MxL5007T standard mode is DVB-T. ++ IF_FREQ_4570000HZ, // The MxL5007T IF frequency is 4.57 MHz. ++ SPECTRUM_NORMAL, // The MxL5007T spectrum mode is normal. ++ MXL5007T_LOOP_THROUGH_DISABLE, // The MxL5007T loop-through mode is disabled. ++ MXL5007T_CLK_OUT_DISABLE, // The MxL5007T clock output mode is disabled. ++ MXL5007T_CLK_OUT_AMP_0, // The MxL5007T clock output amplitude is 0. ++ 0 // The MxL5007T QAM IF differential output level is 0 for cable only. ++ ); ++ ++ ++ ++ ++ ++ // Get MxL5007T tuner extra module. ++ pTunerExtra = (T2266_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set MXL5007T bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, MXL5007T_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get MXL5007T bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// The following context is source code provided by MaxLinear. ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL5007_Common.h ++ ++ ++/******************************************************************************* ++ * ++ * FILE NAME : MxL_Common.h ++ * ++ * AUTHOR : Kyle Huang ++ * DATE CREATED : May 05, 2008 ++ * ++ * DESCRIPTION : ++ * ++ ******************************************************************************* ++ * Copyright (c) 2006, MaxLinear, Inc. ++ ******************************************************************************/ ++ ++//#ifndef __MXL5007_COMMON_H ++//#define __MXL5007_COMMON_H ++ ++ ++ ++/****************************************************************************** ++* User-Defined Types (Typedefs) ++******************************************************************************/ ++ ++ ++/**************************************************************************** ++* Imports and definitions for WIN32 ++****************************************************************************/ ++//#include ++typedef unsigned char UINT8; ++typedef unsigned short UINT16; ++typedef unsigned int UINT32; ++typedef char SINT8; ++typedef short SINT16; ++typedef int SINT32; ++//typedef float REAL32; ++ ++// Additional definition ++#define BOOL int ++#define MxL_FALSE 0 ++#define MxL_TRUE 1 ++ ++/****************************************************************************\ ++* Imports and definitions for non WIN32 platforms * ++\****************************************************************************/ ++/* ++typedef unsigned char UINT8; ++typedef unsigned short UINT16; ++typedef unsigned int UINT32; ++typedef char SINT8; ++typedef short SINT16; ++typedef int SINT32; ++typedef float REAL32; ++ ++// create a boolean ++#ifndef __boolean__ ++#define __boolean__ ++typedef enum {FALSE=0,TRUE} BOOL; ++#endif //boolean ++*/ ++ ++ ++/****************************************************************************\ ++* Definitions for all platforms * ++\****************************************************************************/ ++#ifndef NULL ++#define NULL (void*)0 ++#endif ++ ++ ++ ++/******************************/ ++/* MxL5007 Err message */ ++/******************************/ ++typedef enum{ ++ MxL_OK = 0, ++ MxL_ERR_INIT = 1, ++ MxL_ERR_RFTUNE = 2, ++ MxL_ERR_SET_REG = 3, ++ MxL_ERR_GET_REG = 4, ++ MxL_ERR_OTHERS = 10 ++}MxL_ERR_MSG; ++ ++/******************************/ ++/* MxL5007 Chip verstion */ ++/******************************/ ++typedef enum{ ++ MxL_UNKNOWN_ID = 0x00, ++ MxL_5007T_V4 = 0x14, ++ MxL_GET_ID_FAIL = 0xFF ++}MxL5007_ChipVersion; ++ ++ ++/****************************************************************************** ++ CONSTANTS ++******************************************************************************/ ++ ++#ifndef MHz ++ #define MHz 1000000 ++#endif ++ ++#define MAX_ARRAY_SIZE 100 ++ ++ ++// Enumeration of Mode ++// Enumeration of Mode ++typedef enum ++{ ++ MxL_MODE_ISDBT = 0, ++ MxL_MODE_DVBT = 1, ++ MxL_MODE_ATSC = 2, ++ MxL_MODE_CABLE = 0x10 ++} MxL5007_Mode ; ++ ++typedef enum ++{ ++ MxL_IF_4_MHZ = 4000000, ++ MxL_IF_4_5_MHZ = 4500000, ++ MxL_IF_4_57_MHZ = 4570000, ++ MxL_IF_5_MHZ = 5000000, ++ MxL_IF_5_38_MHZ = 5380000, ++ MxL_IF_6_MHZ = 6000000, ++ MxL_IF_6_28_MHZ = 6280000, ++ MxL_IF_9_1915_MHZ = 9191500, ++ MxL_IF_35_25_MHZ = 35250000, ++ MxL_IF_36_15_MHZ = 36150000, ++ MxL_IF_44_MHZ = 44000000 ++} MxL5007_IF_Freq ; ++ ++typedef enum ++{ ++ MxL_XTAL_16_MHZ = 16000000, ++ MxL_XTAL_20_MHZ = 20000000, ++ MxL_XTAL_20_25_MHZ = 20250000, ++ MxL_XTAL_20_48_MHZ = 20480000, ++ MxL_XTAL_24_MHZ = 24000000, ++ MxL_XTAL_25_MHZ = 25000000, ++ MxL_XTAL_25_14_MHZ = 25140000, ++ MxL_XTAL_27_MHZ = 27000000, ++ MxL_XTAL_28_8_MHZ = 28800000, ++ MxL_XTAL_32_MHZ = 32000000, ++ MxL_XTAL_40_MHZ = 40000000, ++ MxL_XTAL_44_MHZ = 44000000, ++ MxL_XTAL_48_MHZ = 48000000, ++ MxL_XTAL_49_3811_MHZ = 49381100 ++} MxL5007_Xtal_Freq ; ++ ++typedef enum ++{ ++ MxL_BW_6MHz = 6, ++ MxL_BW_7MHz = 7, ++ MxL_BW_8MHz = 8 ++} MxL5007_BW_MHz; ++ ++typedef enum ++{ ++ MxL_NORMAL_IF = 0 , ++ MxL_INVERT_IF ++ ++} MxL5007_IF_Spectrum ; ++ ++typedef enum ++{ ++ MxL_LT_DISABLE = 0 , ++ MxL_LT_ENABLE ++ ++} MxL5007_LoopThru ; ++ ++typedef enum ++{ ++ MxL_CLKOUT_DISABLE = 0 , ++ MxL_CLKOUT_ENABLE ++ ++} MxL5007_ClkOut; ++ ++typedef enum ++{ ++ MxL_CLKOUT_AMP_0 = 0 , ++ MxL_CLKOUT_AMP_1, ++ MxL_CLKOUT_AMP_2, ++ MxL_CLKOUT_AMP_3, ++ MxL_CLKOUT_AMP_4, ++ MxL_CLKOUT_AMP_5, ++ MxL_CLKOUT_AMP_6, ++ MxL_CLKOUT_AMP_7 ++} MxL5007_ClkOut_Amp; ++ ++typedef enum ++{ ++ MxL_I2C_ADDR_96 = 96 , ++ MxL_I2C_ADDR_97 = 97 , ++ MxL_I2C_ADDR_98 = 98 , ++ MxL_I2C_ADDR_99 = 99 ++} MxL5007_I2CAddr ; ++/* ++// ++// MxL5007 TunerConfig Struct ++// ++typedef struct _MxL5007_TunerConfigS ++{ ++ MxL5007_I2CAddr I2C_Addr; ++ MxL5007_Mode Mode; ++ SINT32 IF_Diff_Out_Level; ++ MxL5007_Xtal_Freq Xtal_Freq; ++ MxL5007_IF_Freq IF_Freq; ++ MxL5007_IF_Spectrum IF_Spectrum; ++ MxL5007_ClkOut ClkOut_Setting; ++ MxL5007_ClkOut_Amp ClkOut_Amp; ++ MxL5007_BW_MHz BW_MHz; ++ UINT32 RF_Freq_Hz; ++ ++ // Additional definition ++ TUNER_MODULE *pTuner; ++ ++} MxL5007_TunerConfigS; ++*/ ++ ++ ++ ++//#endif /* __MXL5007_COMMON_H__*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL5007.h ++ ++ ++ ++/* ++ ++ Driver APIs for MxL5007 Tuner ++ ++ Copyright, Maxlinear, Inc. ++ All Rights Reserved ++ ++ File Name: MxL5007.h ++ ++ */ ++ ++ ++//#include "MxL5007_Common.h" ++ ++ ++typedef struct ++{ ++ UINT8 Num; //Register number ++ UINT8 Val; //Register value ++} IRVType, *PIRVType; ++ ++ ++UINT32 MxL5007_Init(UINT8* pArray, // a array pointer that store the addr and data pairs for I2C write ++ UINT32* Array_Size, // a integer pointer that store the number of element in above array ++ UINT8 Mode, ++ SINT32 IF_Diff_Out_Level, ++ UINT32 Xtal_Freq_Hz, ++ UINT32 IF_Freq_Hz, ++ UINT8 Invert_IF, ++ UINT8 Clk_Out_Enable, ++ UINT8 Clk_Out_Amp ++ ); ++UINT32 MxL5007_RFTune(UINT8* pArray, UINT32* Array_Size, ++ UINT32 RF_Freq, // RF Frequency in Hz ++ UINT8 BWMHz // Bandwidth in MHz ++ ); ++UINT32 SetIRVBit(PIRVType pIRV, UINT8 Num, UINT8 Mask, UINT8 Val); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// MaxLinear source code - MxL5007.h ++ ++ ++ ++/* ++ ++ Driver APIs for MxL5007 Tuner ++ ++ Copyright, Maxlinear, Inc. ++ All Rights Reserved ++ ++ File Name: MxL5007_API.h ++ ++ */ ++//#ifndef __MxL5007_API_H ++//#define __MxL5007_API_H ++ ++//#include "MxL5007_Common.h" ++ ++/****************************************************************************** ++** ++** Name: MxL_Set_Register ++** ++** Description: Write one register to MxL5007 ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** RegAddr - Register address to be written ++** RegData - Data to be written ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_SET_REG if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Set_Register(MxL5007_TunerConfigS* myTuner, UINT8 RegAddr, UINT8 RegData); ++ ++/****************************************************************************** ++** ++** Name: MxL_Get_Register ++** ++** Description: Read one register from MxL5007 ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** RegAddr - Register address to be read ++** RegData - Pointer to register read ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_GET_REG if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Get_Register(MxL5007_TunerConfigS* myTuner, UINT8 RegAddr, UINT8 *RegData); ++ ++/****************************************************************************** ++** ++** Name: MxL_Tuner_Init ++** ++** Description: MxL5007 Initialization ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_INIT if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Tuner_Init(MxL5007_TunerConfigS* ); ++ ++/****************************************************************************** ++** ++** Name: MxL_Tuner_RFTune ++** ++** Description: Frequency tunning for channel ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** RF_Freq_Hz - RF Frequency in Hz ++** BWMHz - Bandwidth 6, 7 or 8 MHz ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_RFTUNE if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Tuner_RFTune(MxL5007_TunerConfigS*, UINT32 RF_Freq_Hz, MxL5007_BW_MHz BWMHz); ++ ++/****************************************************************************** ++** ++** Name: MxL_Soft_Reset ++** ++** Description: Software Reset the MxL5007 Tuner ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Soft_Reset(MxL5007_TunerConfigS*); ++ ++/****************************************************************************** ++** ++** Name: MxL_Loop_Through_On ++** ++** Description: Turn On/Off on-chip Loop-through ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** isOn - True to turn On Loop Through ++** - False to turn off Loop Through ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Loop_Through_On(MxL5007_TunerConfigS*, MxL5007_LoopThru); ++ ++/****************************************************************************** ++** ++** Name: MxL_Standby ++** ++** Description: Enter Standby Mode ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Stand_By(MxL5007_TunerConfigS*); ++ ++/****************************************************************************** ++** ++** Name: MxL_Wakeup ++** ++** Description: Wakeup from Standby Mode (Note: after wake up, please call RF_Tune again) ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_Wake_Up(MxL5007_TunerConfigS*); ++ ++/****************************************************************************** ++** ++** Name: MxL_Check_ChipVersion ++** ++** Description: Return the MxL5007 Chip ID ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** ++** Returns: MxL_ChipVersion ++** ++******************************************************************************/ ++MxL5007_ChipVersion MxL_Check_ChipVersion(MxL5007_TunerConfigS*); ++ ++/****************************************************************************** ++** ++** Name: MxL_RFSynth_Lock_Status ++** ++** Description: RF synthesizer lock status of MxL5007 ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** isLock - Pointer to Lock Status ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_RFSynth_Lock_Status(MxL5007_TunerConfigS* , BOOL* isLock); ++ ++/****************************************************************************** ++** ++** Name: MxL_REFSynth_Lock_Status ++** ++** Description: REF synthesizer lock status of MxL5007 ++** ++** Parameters: myTuner - Pointer to MxL5007_TunerConfigS ++** isLock - Pointer to Lock Status ++** ++** Returns: MxL_ERR_MSG - MxL_OK if success ++** - MxL_ERR_OTHERS if fail ++** ++******************************************************************************/ ++MxL_ERR_MSG MxL_REFSynth_Lock_Status(MxL5007_TunerConfigS* , BOOL* isLock); ++ ++//#endif //__MxL5007_API_H ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is MxL5007T tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Standard mode ++enum MXL5007T_STANDARD_MODE ++{ ++ MXL5007T_STANDARD_DVBT, ++ MXL5007T_STANDARD_ATSC, ++ MXL5007T_STANDARD_QAM, ++ MXL5007T_STANDARD_ISDBT, ++}; ++ ++ ++// Loop-through mode ++enum MXL5007T_LOOP_THROUGH_MODE ++{ ++ MXL5007T_LOOP_THROUGH_DISABLE = MxL_LT_DISABLE, ++ MXL5007T_LOOP_THROUGH_ENABLE = MxL_LT_ENABLE, ++}; ++ ++ ++// Clock output mode ++enum MXL5007T_CLK_OUT_MODE ++{ ++ MXL5007T_CLK_OUT_DISABLE, ++ MXL5007T_CLK_OUT_ENABLE, ++}; ++ ++ ++// Clock output amplitude mode ++enum MXL5007T_CLK_OUT_AMP_MODE ++{ ++ MXL5007T_CLK_OUT_AMP_0, ++ MXL5007T_CLK_OUT_AMP_1, ++ MXL5007T_CLK_OUT_AMP_2, ++ MXL5007T_CLK_OUT_AMP_3, ++ MXL5007T_CLK_OUT_AMP_4, ++ MXL5007T_CLK_OUT_AMP_5, ++ MXL5007T_CLK_OUT_AMP_6, ++ MXL5007T_CLK_OUT_AMP_7, ++}; ++ ++ ++// Bandwidth mode ++enum MXL5007T_BANDWIDTH_MODE ++{ ++ MXL5007T_BANDWIDTH_6000000HZ, ++ MXL5007T_BANDWIDTH_7000000HZ, ++ MXL5007T_BANDWIDTH_8000000HZ, ++}; ++ ++ ++ ++// Constant ++#define MXL5007T_I2C_READING_CONST 0xfb ++ ++// Default value ++#define MXL5007T_RF_FREQ_HZ_DEFAULT 44000000; ++#define MXL5007T_BANDWIDTH_MODE_DEFAULT MxL_BW_6MHz; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildMxl5007tModule( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int StandardMode, ++ unsigned long IfFreqHz, ++ int SpectrumMode, ++ int LoopThroughMode, ++ int ClkOutMode, ++ int ClkOutAmpMode, ++ long QamIfDiffOutLevel ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++mxl5007t_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++mxl5007t_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++mxl5007t_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++mxl5007t_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++mxl5007t_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++mxl5007t_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++mxl5007t_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_tda18272.c b/drivers/media/dvb/dvb-usb/tuner_tda18272.c +new file mode 100644 +index 0000000..da3a094 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_tda18272.c +@@ -0,0 +1,21631 @@ ++/** ++ ++@file ++ ++@brief TDA18272 tuner module definition ++ ++One can manipulate TDA18272 tuner through TDA18272 module. ++TDA18272 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_tda18272.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief TDA18272 tuner module builder ++ ++Use BuildTda18272Module() to build TDA18272 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to TDA18272 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr TDA18272 I2C device address ++@param [in] CrystalFreqHz TDA18272 crystal frequency in Hz ++@param [in] UnitNo TDA18272 unit number ++@param [in] IfOutputVppMode TDA18272 IF output Vp-p mode ++ ++ ++@note ++ -# One should call BuildTda18272Module() to build TDA18272 module before using it. ++ ++*/ ++void ++BuildTda18272Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int UnitNo, ++ int IfOutputVppMode ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ TDA18272_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_TDA18272; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = tda18272_GetTunerType; ++ pTuner->GetDeviceAddr = tda18272_GetDeviceAddr; ++ ++ pTuner->Initialize = tda18272_Initialize; ++ pTuner->SetRfFreqHz = tda18272_SetRfFreqHz; ++ pTuner->GetRfFreqHz = tda18272_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ pExtra->CrystalFreqHz = CrystalFreqHz; ++ pExtra->UnitNo = UnitNo; ++ pExtra->IfOutputVppMode = IfOutputVppMode; ++ pExtra->IsStandardBandwidthModeSet = NO; ++ pExtra->IsPowerModeSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetStandardBandwidthMode = tda18272_SetStandardBandwidthMode; ++ pExtra->GetStandardBandwidthMode = tda18272_GetStandardBandwidthMode; ++ pExtra->SetPowerMode = tda18272_SetPowerMode; ++ pExtra->GetPowerMode = tda18272_GetPowerMode; ++ pExtra->GetIfFreqHz = tda18272_GetIfFreqHz; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++tda18272_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++tda18272_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++tda18272_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ ++ int UnitNo; ++ tmbslFrontEndDependency_t sSrvTunerFunc; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ // Get unit number. ++ UnitNo = pExtra->UnitNo; ++ ++ ++ // Set user-defined function to tuner structure. ++ sSrvTunerFunc.sIo.Write = tda18272_Write; ++ sSrvTunerFunc.sIo.Read = tda18272_Read; ++ sSrvTunerFunc.sTime.Get = Null; ++ sSrvTunerFunc.sTime.Wait = tda18272_Wait; ++ sSrvTunerFunc.sDebug.Print = Null; ++ sSrvTunerFunc.sMutex.Init = Null; ++ sSrvTunerFunc.sMutex.DeInit = Null; ++ sSrvTunerFunc.sMutex.Acquire = Null; ++ sSrvTunerFunc.sMutex.Release = Null; ++ sSrvTunerFunc.dwAdditionalDataSize = 0; ++ sSrvTunerFunc.pAdditionalData = Null; ++ ++ // De-initialize tuner. ++ // Note: 1. tmbslTDA182I2DeInit() doesn't access hardware. ++ // 2. Doesn't need to check tmbslTDA182I2DeInit() return, because we will get error return when the module is ++ // un-initialized. ++ tmbslTDA182I2DeInit(UnitNo); ++ ++ // Initialize tuner. ++ // Note: tmbslTDA182I2Init() doesn't access hardware. ++ if(tmbslTDA182I2Init(UnitNo, &sSrvTunerFunc, pTuner) != TM_OK) ++ goto error_status_initialize_tuner; ++ ++ // Reset tuner. ++ if(tmbslTDA182I2Reset(UnitNo) != TM_OK) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++tda18272_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ tmUnitSelect_t UnitNo; ++ tmTDA182I2IF_AGC_Gain_t IfOutputVppMode; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ // Get unit number. ++ UnitNo = (tmUnitSelect_t)pExtra->UnitNo; ++ ++ // Get IF output Vp-p mode. ++ IfOutputVppMode = (tmTDA182I2IF_AGC_Gain_t)pExtra->IfOutputVppMode; ++ ++ ++ // Set tuner RF frequency. ++ if(tmbslTDA182I2SetRf(UnitNo, RfFreqHz, IfOutputVppMode) != TM_OK) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = RfFreqHz; ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++tda18272_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set TDA18272 tuner standard and bandwidth mode. ++ ++*/ ++int ++tda18272_SetStandardBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int StandardBandwidthMode ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ int UnitNo; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ // Get unit number. ++ UnitNo = pExtra->UnitNo; ++ ++ ++ // Set tuner standard and bandwidth mode. ++ if(tmbslTDA182I2SetStandardMode(UnitNo, StandardBandwidthMode) != TM_OK) ++ goto error_status_set_tuner_standard_bandwidth_mode; ++ ++ ++ // Set tuner bandwidth mode parameter. ++ pExtra->StandardBandwidthMode = StandardBandwidthMode; ++ pExtra->IsStandardBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_standard_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get TDA18272 tuner standard and bandwidth mode. ++ ++*/ ++int ++tda18272_GetStandardBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pStandardBandwidthMode ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ ++ // Get tuner bandwidth mode from tuner module. ++ if(pExtra->IsStandardBandwidthModeSet != YES) ++ goto error_status_get_tuner_standard_bandwidth_mode; ++ ++ *pStandardBandwidthMode = pExtra->StandardBandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_standard_bandwidth_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set TDA18272 tuner power mode. ++ ++*/ ++int ++tda18272_SetPowerMode( ++ TUNER_MODULE *pTuner, ++ int PowerMode ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ int UnitNo; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ // Get unit number. ++ UnitNo = pExtra->UnitNo; ++ ++ ++ // Set tuner power mode. ++ if(tmbslTDA182I2SetPowerState(UnitNo, PowerMode) != TM_OK) ++ goto error_status_set_tuner_power_mode; ++ ++ ++ // Set tuner power mode parameter. ++ pExtra->PowerMode = PowerMode; ++ pExtra->IsPowerModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_power_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get TDA18272 tuner power mode. ++ ++*/ ++int ++tda18272_GetPowerMode( ++ TUNER_MODULE *pTuner, ++ int *pPowerMode ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ ++ // Get tuner power mode from tuner module. ++ if(pExtra->IsPowerModeSet != YES) ++ goto error_status_get_tuner_power_mode; ++ ++ *pPowerMode = pExtra->PowerMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_power_mode: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get TDA18272 tuner IF frequency in Hz. ++ ++*/ ++int ++tda18272_GetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ) ++{ ++ TDA18272_EXTRA_MODULE *pExtra; ++ int UnitNo; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tda18272); ++ ++ // Get unit number. ++ UnitNo = pExtra->UnitNo; ++ ++ ++ // Get tuner IF frequency in Hz. ++ if(tmbslTDA182I2GetIF(UnitNo, pIfFreqHz) != TM_OK) ++ goto error_status_get_tuner_if_frequency; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_if_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is implemented for TDA18272 source code. ++ ++ ++// Read TDA18272 registers. ++tmErrorCode_t ++tda18272_Read( ++ tmUnitSelect_t tUnit, ++ UInt32 AddrSize, ++ UInt8* pAddr, ++ UInt32 ReadLen, ++ UInt8* pData ++ ) ++{ ++ ptmTDA182I2Object_t pObj; ++ ++ TUNER_MODULE *pTuner; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ unsigned long i; ++ unsigned long ReadingByteNum, ReadingByteNumMax, ReadingByteNumRem; ++ unsigned char RegReadingAddr; ++ ++ ++ // Get NXP object. ++ pObj = Null; ++ if(TDA182I2GetInstance(tUnit, &pObj) != TM_OK) ++ goto error_status_get_nxp_object; ++ ++ ++ // Get tuner. ++ pTuner = pObj->pTuner; ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ // Get base interface. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ // Calculate maximum reading byte number. ++ ReadingByteNumMax = pBaseInterface->I2cReadingByteNumMax; ++ ++ ++ ++ // Get tuner register bytes. ++ // Note: Get tuner register bytes considering maximum reading byte number. ++ for(i = 0; i < ReadLen; i += ReadingByteNumMax) ++ { ++ // Set register reading address. ++ RegReadingAddr = (unsigned char)(*pAddr + i); ++ ++ // Calculate remainder reading byte number. ++ ReadingByteNumRem = ReadLen - i; ++ ++ // Determine reading byte number. ++ ReadingByteNum = (ReadingByteNumRem > ReadingByteNumMax) ? ReadingByteNumMax : ReadingByteNumRem; ++ ++ ++ // Set tuner register reading address. ++ // Note: The I2C format of tuner register reading address setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr * N + stop_bit ++ ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, &RegReadingAddr, (unsigned long)AddrSize) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_register_reading_address; ++ ++ // Get tuner register byte. ++ // Note: The I2C format of tuner register byte getting is as follows: ++ // start_bit + (DeviceAddr | reading_bit) + read_data * N + stop_bit ++ if(pI2cBridge->ForwardI2cReadingCmd(pI2cBridge, DeviceAddr, &pData[i], ReadingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ } ++ ++ ++ return TM_OK; ++ ++ ++error_status_get_tuner_registers: ++error_status_set_tuner_register_reading_address: ++error_status_get_nxp_object: ++ return TM_ERR_READ; ++} ++ ++ ++ ++ ++ ++// Write TDA18272 registers. ++tmErrorCode_t ++tda18272_Write( ++ tmUnitSelect_t tUnit, ++ UInt32 AddrSize, ++ UInt8* pAddr, ++ UInt32 WriteLen, ++ UInt8* pData ++ ) ++{ ++ ptmTDA182I2Object_t pObj; ++ ++ TUNER_MODULE *pTuner; ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ unsigned char DeviceAddr; ++ unsigned char WritingBuffer[I2C_BUFFER_LEN]; ++ ++ unsigned long i; ++ unsigned long WritingByteNum; ++ ++ ++ // Get NXP object. ++ pObj = Null; ++ if(TDA182I2GetInstance(tUnit, &pObj) != TM_OK) ++ goto error_status_get_nxp_object; ++ ++ ++ // Get tuner. ++ pTuner = pObj->pTuner; ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ // Calculate writing byte number. ++ WritingByteNum = (unsigned char)(AddrSize + WriteLen); ++ ++ ++ // Set writing bytes. ++ // Note: The I2C format of tuner register byte setting is as follows: ++ // start_bit + (DeviceAddr | writing_bit) + addr * N + data * N + stop_bit ++ for(i = 0; i < AddrSize; i++) ++ WritingBuffer[i] = pAddr[i]; ++ ++ for(i = 0; i < WriteLen; i++) ++ WritingBuffer[AddrSize + i] = pData[i]; ++ ++ // Set tuner register bytes with writing buffer. ++ if(pI2cBridge->ForwardI2cWritingCmd(pI2cBridge, DeviceAddr, WritingBuffer, WritingByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return TM_OK; ++ ++ ++error_status_set_tuner_registers: ++error_status_get_nxp_object: ++ return TM_ERR_WRITE; ++} ++ ++ ++ ++ ++ ++// Wait a time. ++tmErrorCode_t ++tda18272_Wait( ++ tmUnitSelect_t tUnit, ++ UInt32 tms ++ ) ++{ ++ ptmTDA182I2Object_t pObj; ++ ++ TUNER_MODULE *pTuner; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ ++ // Get NXP object. ++ pObj = Null; ++ if(TDA182I2GetInstance(tUnit, &pObj) != TM_OK) ++ goto error_status_get_nxp_object; ++ ++ ++ // Get tuner. ++ pTuner = pObj->pTuner; ++ ++ // Get I2C bridge. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ // Wait a time. ++ pBaseInterface->WaitMs(pBaseInterface, tms); ++ ++ ++ return TM_OK; ++ ++ ++error_status_get_nxp_object: ++ return TM_ERR_BAD_UNIT_NUMBER; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by NXP. ++ ++ ++ ++ ++ ++// NXP source code - .\tmbslTDA182I2\src\tmbslTDA182I2.c ++ ++ ++//----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2001 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmbslTDA182I2.c ++// ++// %version: 33 % ++// ++// DESCRIPTION: Function for the Hybrid silicon tuner TDA182I2 ++// ++// DOCUMENT REF: ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Standard include files: ++//----------------------------------------------------------------------------- ++// ++ ++//#include "tmNxTypes.h" ++//#include "tmCompId.h" ++//#include "tmFrontEnd.h" ++//#include "tmbslFrontEndTypes.h" ++ ++//#include "tmddTDA182I2.h" ++ ++//#ifdef TMBSL_TDA18272 ++// #include "tmbslTDA18272.h" ++//#else /* TMBSL_TDA18272 */ ++// #include "tmbslTDA18212.h" ++//#endif /* TMBSL_TDA18272 */ ++ ++//----------------------------------------------------------------------------- ++// Project include files: ++//----------------------------------------------------------------------------- ++// ++//#include "tmbslTDA182I2local.h" ++//#include "tmbslTDA182I2Instance.h" ++ ++//----------------------------------------------------------------------------- ++// Types and defines: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Global data: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Exported functions: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA18211Init: ++// ++// DESCRIPTION: create an instance of a TDA182I2 Tuner ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TM_OK ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2Init ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmbslFrontEndDependency_t* psSrvFunc, /* I: setup parameters */ ++ TUNER_MODULE *pTuner // Added by Realtek ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if (psSrvFunc == Null) ++ { ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ } ++ ++ if(err == TM_OK) ++ { ++ //---------------------- ++ // initialize the Object ++ //---------------------- ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ } ++ ++ /* check driver state */ ++ if (err == TM_OK || err == TDA182I2_ERR_NOT_INITIALIZED) ++ { ++ if (pObj != Null && pObj->init == True) ++ { ++ err = TDA182I2_ERR_NOT_INITIALIZED; ++ } ++ else ++ { ++ /* initialize the Object */ ++ if (pObj == Null) ++ { ++ err = TDA182I2AllocInstance(tUnit, &pObj); ++ if (err != TM_OK || pObj == Null) ++ { ++ err = TDA182I2_ERR_NOT_INITIALIZED; ++ } ++ } ++ ++ if (err == TM_OK) ++ { ++ // initialize the Object by default values ++ pObj->sRWFunc = psSrvFunc->sIo; ++ pObj->sTime = psSrvFunc->sTime; ++ pObj->sDebug = psSrvFunc->sDebug; ++ ++ if( psSrvFunc->sMutex.Init != Null ++ && psSrvFunc->sMutex.DeInit != Null ++ && psSrvFunc->sMutex.Acquire != Null ++ && psSrvFunc->sMutex.Release != Null) ++ { ++ pObj->sMutex = psSrvFunc->sMutex; ++ ++ err = pObj->sMutex.Init(&pObj->pMutex); ++ } ++ ++ pObj->init = True; ++ err = TM_OK; ++ ++ err = tmddTDA182I2Init(tUnit, psSrvFunc); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Init(0x%08X) failed.", pObj->tUnit)); ++ } ++ } ++ } ++ ++ // Added by Realtek ++ pObj->pTuner = pTuner; ++ ++ return err; ++} ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2DeInit: ++// ++// DESCRIPTION: destroy an instance of a TDA182I2 Tuner ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2DeInit ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* check input parameters */ ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2DeInit(tUnit); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2DeInit(0x%08X) failed.", pObj->tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ ++ if(pObj->sMutex.DeInit != Null) ++ { ++ if(pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.DeInit(pObj->pMutex); ++ } ++ ++ pObj->sMutex.Init = Null; ++ pObj->sMutex.DeInit = Null; ++ pObj->sMutex.Acquire = Null; ++ pObj->sMutex.Release = Null; ++ ++ pObj->pMutex = Null; ++ } ++ } ++ ++ err = TDA182I2DeAllocInstance(tUnit); ++ ++ return err; ++} ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2GetSWVersion: ++// ++// DESCRIPTION: Return the version of this device ++// ++// RETURN: TM_OK ++// ++// NOTES: Values defined in the tmTDA182I2local.h file ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2GetSWVersion ++( ++ ptmSWVersion_t pSWVersion /* I: Receives SW Version */ ++) ++{ ++ tmErrorCode_t err = TDA182I2_ERR_NOT_INITIALIZED; ++ ++ err = tmddTDA182I2GetSWVersion(pSWVersion); ++ ++ return err; ++} ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2CheckHWVersion: ++// ++// DESCRIPTION: Check HW version ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: Values defined in the tmTDA182I2local.h file ++//----------------------------------------------------------------------------- ++tmErrorCode_t ++tmbslTDA182I2CheckHWVersion ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TDA182I2_ERR_NOT_INITIALIZED; ++ UInt16 uIdentity = 0; ++ UInt8 majorRevision = 0; ++ ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetIdentity(tUnit, &uIdentity); ++ ++ if(err == TM_OK) ++ { ++ if(uIdentity == 18272 || uIdentity == 18212) ++ { ++ /* TDA18272/12 found. Check Major Revision*/ ++ err = tmddTDA182I2GetMajorRevision(tUnit, &majorRevision); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetMajorRevision(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK && majorRevision != 1) ++ { ++ /* Only TDA18272/12 ES2 are supported */ ++ err = TDA182I2_ERR_BAD_VERSION; ++ } ++ } ++ else ++ { ++ err = TDA182I2_ERR_BAD_VERSION; ++ } ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2SetPowerState: ++// ++// DESCRIPTION: Set the power state of this device. ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2SetPowerState ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2PowerState_t powerState /* I: Power state of this device */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ if(powerState > pObj->minPowerState) ++ { ++ powerState = pObj->minPowerState; ++ } ++ ++ // Call tmddTDA182I2SetPowerState ++ err = tmddTDA182I2SetPowerState(tUnit, powerState); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPowerState(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // set power state ++ pObj->curPowerState = powerState; ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2GetPowerState: ++// ++// DESCRIPTION: Get the power state of this device. ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2GetPowerState ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2PowerState_t *pPowerState /* O: Power state of this device */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pPowerState == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // get power state ++ *pPowerState = pObj->curPowerState; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2SetStandardMode: ++// ++// DESCRIPTION: Set the standard mode of this device. ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2SetStandardMode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2StandardMode_t StandardMode /* I: Standard mode of this device */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // store standard mode ++ pObj->StandardMode = StandardMode; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2GetStandardMode: ++// ++// DESCRIPTION: Get the standard mode of this device. ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2GetStandardMode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2StandardMode_t *pStandardMode /* O: Standard mode of this device */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pStandardMode == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Get standard mode */ ++ *pStandardMode = pObj->StandardMode; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2SetRf: ++// ++// DESCRIPTION: Calculate i2c I2CMap & write in TDA182I2 ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TDA182I2_ERR_BAD_PARAMETER ++// TMBSL_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2SetRf ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uRF, /* I: RF frequency in hertz */ ++ tmTDA182I2IF_AGC_Gain_t IF_Gain // Added by realtek ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ Bool bIRQWait = True; ++ UInt8 ratioL, ratioH; ++ UInt32 DeltaL, DeltaH; ++ UInt8 uAGC1_loop_off; ++ UInt8 uRF_Filter_Gv = 0; ++ ++ //------------------------------ ++ // test input parameters ++ //------------------------------ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetIRQWait(tUnit, &bIRQWait); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetIRQWait(0x%08X) failed.", tUnit)); ++ ++ pObj->uRF = uRF; ++ ++ if(err == TM_OK) ++ { ++ /* Set LPF */ ++ err = tmddTDA182I2SetLP_FC(tUnit, pObj->Std_Array[pObj->StandardMode].LPF); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetLP_FC(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set LPF Offset */ ++ err = tmddTDA182I2SetLP_FC_Offset(tUnit, pObj->Std_Array[pObj->StandardMode].LPF_Offset); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetLP_FC_Offset(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set IF Gain */ ++// err = tmddTDA182I2SetIF_Level(tUnit, pObj->Std_Array[pObj->StandardMode].IF_Gain); ++ err = tmddTDA182I2SetIF_Level(tUnit, IF_Gain); // Modified by Realtek ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIF_Level(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set IF Notch */ ++ err = tmddTDA182I2SetIF_ATSC_Notch(tUnit, pObj->Std_Array[pObj->StandardMode].IF_Notch); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIF_ATSC_Notch(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Enable/disable HPF */ ++ if ( pObj->Std_Array[pObj->StandardMode].IF_HPF == tmTDA182I2_IF_HPF_Disabled ) ++ { ++ err = tmddTDA182I2SetHi_Pass(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetHi_Pass(0x%08X, 0) failed.", tUnit)); ++ } ++ else ++ { ++ err = tmddTDA182I2SetHi_Pass(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetHi_Pass(0x%08X, 1) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Set IF HPF */ ++ err = tmddTDA182I2SetIF_HP_Fc(tUnit, (UInt8)(pObj->Std_Array[pObj->StandardMode].IF_HPF - 1)); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIF_HP_Fc(0x%08X) failed.", tUnit)); ++ } ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set DC Notch */ ++ err = tmddTDA182I2SetIF_Notch(tUnit, pObj->Std_Array[pObj->StandardMode].DC_Notch); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIF_Notch(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC1 LNA Top */ ++ err = tmddTDA182I2SetAGC1_TOP(tUnit, pObj->Std_Array[pObj->StandardMode].AGC1_LNA_TOP); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC1_TOP(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC2 RF Top */ ++ err = tmddTDA182I2SetAGC2_TOP(tUnit, pObj->Std_Array[pObj->StandardMode].AGC2_RF_Attenuator_TOP); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC2_TOP(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC3 RF AGC Top */ ++ if (pObj->uRF < tmTDA182I2_AGC3_RF_AGC_TOP_FREQ_LIM) ++ { ++ err = tmddTDA182I2SetRFAGC_Top(tUnit, pObj->Std_Array[pObj->StandardMode].AGC3_RF_AGC_TOP_Low_band); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRFAGC_Top(0x%08X) failed.", tUnit)); ++ } ++ else ++ { ++ err = tmddTDA182I2SetRFAGC_Top(tUnit, pObj->Std_Array[pObj->StandardMode].AGC3_RF_AGC_TOP_High_band); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRFAGC_Top(0x%08X) failed.", tUnit)); ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC4 IR Mixer Top */ ++ err = tmddTDA182I2SetIR_Mixer_Top(tUnit, pObj->Std_Array[pObj->StandardMode].AGC4_IR_Mixer_TOP); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIR_Mixer_Top(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC5 IF AGC Top */ ++ err = tmddTDA182I2SetAGC5_TOP(tUnit, pObj->Std_Array[pObj->StandardMode].AGC5_IF_AGC_TOP); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC5_TOP(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC3 Adapt */ ++ err = tmddTDA182I2SetPD_RFAGC_Adapt(tUnit, pObj->Std_Array[pObj->StandardMode].AGC3_Adapt); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPD_RFAGC_Adapt(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC3 Adapt TOP */ ++ err = tmddTDA182I2SetRFAGC_Adapt_TOP(tUnit, pObj->Std_Array[pObj->StandardMode].AGC3_Adapt_TOP); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRFAGC_Adapt_TOP(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC5 Atten 3dB */ ++ err = tmddTDA182I2SetRF_Atten_3dB(tUnit, pObj->Std_Array[pObj->StandardMode].AGC5_Atten_3dB); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRF_Atten_3dB(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGC5 Detector HPF */ ++ err = tmddTDA182I2SetAGC5_Ana(tUnit, pObj->Std_Array[pObj->StandardMode].AGC5_Detector_HPF); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC5_Ana(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set AGCK Mode */ ++ err = tmddTDA182I2SetAGCK_Mode(tUnit, pObj->Std_Array[pObj->StandardMode].GSK&0x03); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGCK_Mode(0x%08X) failed.", tUnit)); ++ ++ err = tmddTDA182I2SetAGCK_Step(tUnit, (pObj->Std_Array[pObj->StandardMode].GSK&0x0C)>>2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGCK_Step(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set H3H5 VHF Filter 6 */ ++ err = tmddTDA182I2SetPSM_StoB(tUnit, pObj->Std_Array[pObj->StandardMode].H3H5_VHF_Filter6); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPSM_StoB(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set IF */ ++ err = tmddTDA182I2SetIF_Freq(tUnit, pObj->Std_Array[pObj->StandardMode].IF - pObj->Std_Array[pObj->StandardMode].CF_Offset); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIF_Freq(0x%08X) failed.", tUnit)); ++ } ++ if (pObj->Std_Array[pObj->StandardMode].LTO_STO_immune && pObj->Master ) ++ { ++ /* save RF_Filter_Gv current value */ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetAGC2_Gain_Read (tUnit, &uRF_Filter_Gv); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetRF_Filter_Gv(0x%08X) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetRF_Filter_Gv(tUnit, uRF_Filter_Gv ); ++ } ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetForce_AGC2_gain(tUnit, 0x1); ++ } ++ /* smooth RF_Filter_Gv to min value */ ++ if((err == TM_OK)&&(uRF_Filter_Gv != 0)) ++ { ++ do ++ { ++ err = tmddTDA182I2SetRF_Filter_Gv(tUnit, uRF_Filter_Gv -1 ); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetRF_Filter_Gv(0x%08X) failed.", tUnit)); ++ if(err == TM_OK) ++ { ++ err = TDA182I2Wait(pObj, 10); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRF_Filter_Cap(0x%08X) failed.", tUnit)); ++ } ++ uRF_Filter_Gv = uRF_Filter_Gv -1 ; ++ } ++ while ( uRF_Filter_Gv > 0); ++ } ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetRF_Atten_3dB (tUnit, 0x01); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetRF_Filter_Gv(0x%08X) failed.", tUnit)); ++ } ++ } ++ if(err == TM_OK) ++ { ++ /* Set RF */ ++ err = tmddTDA182I2SetRF_Freq(tUnit, uRF + pObj->Std_Array[pObj->StandardMode].CF_Offset); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRF_Freq(0x%08X) failed.", tUnit)); ++ ++ } ++ ++ if (pObj->Std_Array[pObj->StandardMode].LTO_STO_immune && pObj->Master ) ++ { ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetRF_Atten_3dB (tUnit, 0x00); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetRF_Filter_Gv(0x%08X) failed.", tUnit)); ++ } ++ err = TDA182I2Wait(pObj, 50); ++ if(err == TM_OK) ++ { ++ tmddTDA182I2SetForce_AGC2_gain(tUnit, 0x0); ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Spurious reduction begin */ ++ ratioL = (UInt8)(uRF / 16000000); ++ ratioH = (UInt8)(uRF / 16000000) + 1; ++ DeltaL = (uRF - (ratioL * 16000000)); ++ DeltaH = ((ratioH * 16000000) - uRF); ++ ++ if (uRF < 72000000 ) ++ { ++ /* Set sigma delta clock*/ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, sigma delta clock) failed.", tUnit)); ++ } ++ else if (uRF < 104000000 ) ++ { ++ /* Set 16 Mhz Xtal clock */ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, 16 Mhz xtal clock) failed.", tUnit)); ++ } ++ else if (uRF <= 120000000 ) ++ { ++ /* Set sigma delta clock*/ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, sigma delta clock) failed.", tUnit)); ++ } ++ else /* RF above 120 MHz */ ++ { ++ if (DeltaL <= DeltaH ) ++ { ++ if (ratioL & 0x000001 ) /* ratioL odd */ ++ { ++ /* Set 16 Mhz Xtal clock */ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, 16 Mhz xtal clock) failed.", tUnit)); ++ } ++ else /* ratioL even */ ++ { ++ /* Set sigma delta clock*/ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, sigma delta clock) failed.", tUnit)); ++ } ++ ++ } ++ else /* (DeltaL > DeltaH ) */ ++ { ++ if (ratioL & 0x000001 ) /*(ratioL odd)*/ ++ { ++ /* Set sigma delta clock*/ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, sigma delta clock) failed.", tUnit)); ++ } ++ else ++ { ++ /* Set 16 Mhz Xtal clock */ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, 16 Mhz xtal clock) failed.", tUnit)); ++ } ++ } ++ } ++ } ++ /* Spurious reduction end */ ++ ++ if(err == TM_OK) ++ { ++ if ( pObj->Std_Array[pObj->StandardMode].AGC1_Freeze == True ) ++ { ++ err = tmddTDA182I2GetAGC1_loop_off(tUnit, &uAGC1_loop_off) ; ++ ++ if (uAGC1_loop_off == 0) // first AGC1 freeze ++ { ++ err = tmddTDA182I2SetAGC1_loop_off(tUnit, 0x1 ) ; ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetForce_AGC1_gain(tUnit, 0x1); ++ } ++ } ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2AGC1_Adapt (tUnit); /* Adapt AGC1gain from Last SetRF */ ++ } ++ } ++ else ++ { ++ err = tmddTDA182I2SetForce_AGC1_gain(tUnit, 0x0); ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetAGC1_loop_off(tUnit, 0x0 ) ; ++ } ++ } ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmbslTDA182I2GetRf: ++// ++// DESCRIPTION: Get the frequency programmed in the tuner ++// ++// RETURN: TMBSL_ERR_TUNER_BAD_UNIT_NUMBER ++// TDA182I2_ERR_NOT_INITIALIZED ++// TM_OK ++// ++// NOTES: The value returned is the one stored in the Object ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmbslTDA182I2GetRf ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puRF /* O: RF frequency in hertz */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(puRF == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ //------------------------------ ++ // test input parameters ++ //------------------------------ ++ // pObj initialization ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Get RF */ ++ *puRF = pObj->uRF/* - pObj->Std_Array[pObj->StandardMode].CF_Offset*/; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2Reset */ ++/*============================================================================*/ ++tmErrorCode_t ++tmbslTDA182I2Reset ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ Bool bIRQWait = True; ++ ++ //------------------------------ ++ // test input parameters ++ //------------------------------ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetIRQWait(tUnit, &bIRQWait); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetIRQWait(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2Init(tUnit); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2Init(0x%08X) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ // Wait for XtalCal End ( Master only ) ++ if (pObj->Master) ++ { ++ err = TDA182I2WaitXtalCal_End ( pObj, 100, 5); ++ } ++ else ++ { ++ /* Initialize Fmax_LO and N_CP_Current */ ++ err = tmddTDA182I2SetFmax_Lo(tUnit, 0x00); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetFmax_Lo(0x%08X, 0x0A) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetN_CP_Current(tUnit, 0x68); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetN_CP_Current(0x%08X, 0x68) failed.", tUnit)); ++ } ++ } ++ } ++ if(err == TM_OK) ++ { ++ // initialize tuner ++ err = tmddTDA182I2Reset(tUnit); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Reset(0x%08X) failed.", tUnit)); ++ } ++ if (err == TM_OK) ++ { ++ /* Initialize Fmax_LO and N_CP_Current */ ++ err = tmddTDA182I2SetFmax_Lo(tUnit, 0x0A); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetFmax_Lo(0x%08X, 0x0A) failed.", tUnit)); ++ } ++ if (err == TM_OK) ++ { ++ err = tmddTDA182I2SetLT_Enable(tUnit, pObj->LT_Enable ); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetLT_Enable(0x%08X, 0) failed.", tUnit)); ++ } ++ if (err == TM_OK) ++ { ++ err = tmddTDA182I2SetPSM_AGC1(tUnit, pObj->PSM_AGC1 ); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPSM_AGC1(0x%08X, 1) failed.", tUnit)); ++ } ++ if (err == TM_OK) ++ { ++ err = tmddTDA182I2SetAGC1_6_15dB(tUnit, pObj->AGC1_6_15dB ); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC1_6_15dB(0x%08X, 0) failed.", tUnit)); ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetIF */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetIF ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puIF /* O: IF Frequency in hertz */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(puIF == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *puIF = pObj->Std_Array[pObj->StandardMode].IF - pObj->Std_Array[pObj->StandardMode].CF_Offset; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetCF_Offset */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetCF_Offset( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puOffset /* O: Center frequency offset in hertz */ ++ ) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(puOffset == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *puOffset = pObj->Std_Array[pObj->StandardMode].CF_Offset; ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetLockStatus */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetLockStatus ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmbslFrontEndState_t* pLockStatus /* O: PLL Lock status */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt8 uValue, uValueLO; ++ ++ if( pLockStatus == Null ) ++ { ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetLO_Lock(tUnit, &uValueLO); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetLO_Lock(0x%08X) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetIRQ_status(tUnit, &uValue); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetIRQ_status(0x%08X) failed.", tUnit)); ++ ++ uValue = uValue & uValueLO; ++ } ++ if(err == TM_OK) ++ { ++ *pLockStatus = (uValue)? tmbslFrontEndStateLocked : tmbslFrontEndStateNotLocked; ++ } ++ else ++ { ++ *pLockStatus = tmbslFrontEndStateUnknown; ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetPowerLevel */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetPowerLevel ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* pPowerLevel /* O: Power Level in dBuV */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pPowerLevel == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *pPowerLevel = 0; ++ ++ err = tmddTDA182I2GetPower_Level(tUnit, (UInt8 *)pPowerLevel); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetPower_Level(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2SetIRQWait */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2SetIRQWait ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool bWait /* I: Determine if we need to wait IRQ in driver functions */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetIRQWait(tUnit, bWait); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIRQWait(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetIRQWait */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetIRQWait ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool* pbWait /* O: Determine if we need to wait IRQ in driver functions */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pbWait == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetIRQWait(tUnit, pbWait); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetIRQWait(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetIRQ */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetIRQ ++( ++ tmUnitSelect_t tUnit /* I: Unit number */, ++ Bool* pbIRQ /* O: IRQ triggered */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pbIRQ == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *pbIRQ = 0; ++ ++ err = tmddTDA182I2GetIRQ_status(tUnit, (UInt8 *)pbIRQ); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetIRQ_status(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2WaitIRQ */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2WaitIRQ ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeOut for IRQ wait */ ++ UInt32 waitStep, /* I: wait step */ ++ UInt8 irqStatus /* I: IRQs to wait */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2WaitIRQ(tUnit, timeOut, waitStep, irqStatus); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2GetXtalCal_End */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2GetXtalCal_End ++( ++ tmUnitSelect_t tUnit /* I: Unit number */, ++ Bool* pbXtalCal_End /* O: XtalCal_End triggered */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(pbXtalCal_End == Null) ++ err = TDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *pbXtalCal_End = 0; ++ ++ err = tmddTDA182I2GetMSM_XtalCal_End(tUnit, (UInt8 *)pbXtalCal_End); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetMSM_XtalCal_End(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* tmbslTDA182I2WaitXtalCal_End */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2WaitXtalCal_End ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeOut for IRQ wait */ ++ UInt32 waitStep /* I: wait step */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2WaitXtalCal_End(tUnit, timeOut, waitStep); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2WaitXtalCal_End(0x%08X) failed.", tUnit)); ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++/*============================================================================*/ ++/* tmbslTDA182I2CheckRFFilterRobustness */ ++/*============================================================================*/ ++/* ++tmErrorCode_t ++tmbslTDA182I2CheckRFFilterRobustness ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ ptmTDA182I2RFFilterRating rating // O: RF Filter rating ++ ) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ UInt8 rfcal_log_0 = 0; ++ UInt8 rfcal_log_2 = 0; ++ UInt8 rfcal_log_3 = 0; ++ UInt8 rfcal_log_5 = 0; ++ UInt8 rfcal_log_6 = 0; ++ UInt8 rfcal_log_8 = 0; ++ UInt8 rfcal_log_9 = 0; ++ UInt8 rfcal_log_11 = 0; ++ ++ double VHFLow_0 = 0.0; ++ double VHFLow_1 = 0.0; ++ double VHFHigh_0 = 0.0; ++ double VHFHigh_1 = 0.0; ++ double UHFLow_0 = 0.0; ++ double UHFLow_1 = 0.0; ++ double UHFHigh_0 = 0.0; ++ double UHFHigh_1 = 0.0; ++ ++ err = tmddTDA182I2Getrfcal_log_0(tUnit, &rfcal_log_0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_0(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_2(tUnit, &rfcal_log_2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_2(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_3(tUnit, &rfcal_log_3); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_3(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_5(tUnit, &rfcal_log_5); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_5(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_6(tUnit, &rfcal_log_6); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_6(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_8(tUnit, &rfcal_log_8); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_8(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_9(tUnit, &rfcal_log_9); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_9(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2Getrfcal_log_11(tUnit, &rfcal_log_11); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Getrfcal_log_11(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ if (rfcal_log_0 & 0x80) ++ { ++ rating->VHFLow_0_Margin = 0; ++ rating->VHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // VHFLow_0 ++ VHFLow_0 = 100 * (45 - 39.8225 * (1 + (0.31 * (rfcal_log_0 < 64 ? rfcal_log_0 : rfcal_log_0 - 128)) / 1.0 / 100.0)) / 45.0; ++ rating->VHFLow_0_Margin = 0.0024 * VHFLow_0 * VHFLow_0 * VHFLow_0 - 0.101 * VHFLow_0 * VHFLow_0 + 1.629 * VHFLow_0 + 1.8266; ++ if (rating->VHFLow_0_Margin >= 0) ++ { ++ rating->VHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->VHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_2 & 0x80) ++ { ++ rating->VHFLow_1_Margin = 0; ++ rating->VHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // VHFLow_1 ++ VHFLow_1 = 100 * (152.1828 * (1 + (1.53 * (rfcal_log_2 < 64 ? rfcal_log_2 : rfcal_log_2 - 128)) / 1.0 / 100.0) - (144.896 - 6)) / (144.896 - 6); ++ rating->VHFLow_1_Margin = 0.0024 * VHFLow_1 * VHFLow_1 * VHFLow_1 - 0.101 * VHFLow_1 * VHFLow_1 + 1.629 * VHFLow_1 + 1.8266; ++ if (rating->VHFLow_1_Margin >= 0) ++ { ++ rating->VHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->VHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_3 & 0x80) ++ { ++ rating->VHFHigh_0_Margin = 0; ++ rating->VHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // VHFHigh_0 ++ VHFHigh_0 = 100 * ((144.896 + 6) - 135.4063 * (1 + (0.27 * (rfcal_log_3 < 64 ? rfcal_log_3 : rfcal_log_3 - 128)) / 1.0 / 100.0)) / (144.896 + 6); ++ rating->VHFHigh_0_Margin = 0.0024 * VHFHigh_0 * VHFHigh_0 * VHFHigh_0 - 0.101 * VHFHigh_0 * VHFHigh_0 + 1.629 * VHFHigh_0 + 1.8266; ++ if (rating->VHFHigh_0_Margin >= 0) ++ { ++ rating->VHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->VHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_5 & 0x80) ++ { ++ rating->VHFHigh_1_Margin = 0; ++ rating->VHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // VHFHigh_1 ++ VHFHigh_1 = 100 * (383.1455 * (1 + (0.91 * (rfcal_log_5 < 64 ? rfcal_log_5 : rfcal_log_5 - 128)) / 1.0 / 100.0) - (367.104 - 8)) / (367.104 - 8); ++ rating->VHFHigh_1_Margin = 0.0024 * VHFHigh_1 * VHFHigh_1 * VHFHigh_1 - 0.101 * VHFHigh_1 * VHFHigh_1 + 1.629 * VHFHigh_1 + 1.8266; ++ if (rating->VHFHigh_1_Margin >= 0) ++ { ++ rating->VHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->VHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_6 & 0x80) ++ { ++ rating->UHFLow_0_Margin = 0; ++ rating->UHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // UHFLow_0 ++ UHFLow_0 = 100 * ((367.104 + 8) - 342.6224 * (1 + (0.21 * (rfcal_log_6 < 64 ? rfcal_log_6 : rfcal_log_6 - 128)) / 1.0 / 100.0)) / (367.104 + 8); ++ rating->UHFLow_0_Margin = 0.0024 * UHFLow_0 * UHFLow_0 * UHFLow_0 - 0.101 * UHFLow_0 * UHFLow_0 + 1.629 * UHFLow_0 + 1.8266; ++ if (rating->UHFLow_0_Margin >= 0) ++ { ++ rating->UHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->UHFLow_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_8 & 0x80) ++ { ++ rating->UHFLow_1_Margin = 0; ++ rating->UHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // UHFLow_1 ++ UHFLow_1 = 100 * (662.5595 * (1 + (0.33 * (rfcal_log_8 < 64 ? rfcal_log_8 : rfcal_log_8 - 128)) / 1.0 / 100.0) - (624.128 - 2)) / (624.128 - 2); ++ rating->UHFLow_1_Margin = 0.0024 * UHFLow_1 * UHFLow_1 * UHFLow_1 - 0.101 * UHFLow_1 * UHFLow_1 + 1.629 * UHFLow_1 + 1.8266; ++ if (rating->UHFLow_1_Margin >= 0) ++ { ++ rating->UHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->UHFLow_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_9 & 0x80) ++ { ++ rating->UHFHigh_0_Margin = 0; ++ rating->UHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // UHFHigh_0 ++ UHFHigh_0 = 100 * ((624.128 + 2) - 508.2747 * (1 + (0.23 * (rfcal_log_9 < 64 ? rfcal_log_9 : rfcal_log_9 - 128)) / 1.0 / 100.0)) / (624.128 + 2); ++ rating->UHFHigh_0_Margin = 0.0024 * UHFHigh_0 * UHFHigh_0 * UHFHigh_0 - 0.101 * UHFHigh_0 * UHFHigh_0 + 1.629 * UHFHigh_0 + 1.8266; ++ if (rating->UHFHigh_0_Margin >= 0) ++ { ++ rating->UHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->UHFHigh_0_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ ++ if (rfcal_log_11 & 0x80) ++ { ++ rating->UHFHigh_1_Margin = 0; ++ rating->UHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Error; ++ } ++ else ++ { ++ // UHFHigh_1 ++ UHFHigh_1 = 100 * (947.8913 * (1 + (0.3 * (rfcal_log_11 < 64 ? rfcal_log_11 : rfcal_log_11 - 128)) / 1.0 / 100.0) - (866 - 14)) / (866 - 14); ++ rating->UHFHigh_1_Margin = 0.0024 * UHFHigh_1 * UHFHigh_1 * UHFHigh_1 - 0.101 * UHFHigh_1 * UHFHigh_1 + 1.629 * UHFHigh_1 + 1.8266; ++ if (rating->UHFHigh_1_Margin >= 0) ++ { ++ rating->UHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_High; ++ } ++ else ++ { ++ rating->UHFHigh_1_RFFilterRobustness = tmTDA182I2RFFilterRobustness_Low; ++ } ++ } ++ } ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++*/ ++ ++/*============================================================================*/ ++/* tmbslTDA182I2Write */ ++/*============================================================================*/ ++ ++tmErrorCode_t ++tmbslTDA182I2Write ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uIndex, /* I: Start index to write */ ++ UInt32 WriteLen, /* I: Number of bytes to write */ ++ UInt8* pData /* I: Data to write */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = TDA182I2MutexAcquire(pObj, TDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // Call tmddTDA182I2Write ++ ++ (void)TDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++//----------------------------------------------------------------------------- ++// Internal functions: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: TDA182I2Init: ++// ++// DESCRIPTION: initialization of the Tuner ++// ++// RETURN: always True ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++static tmErrorCode_t ++TDA182I2Init ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ //------------------------------ ++ // test input parameters ++ //------------------------------ ++ // pObj initialization ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "TDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ //err = tmddTDA182I2SetIRQWait(tUnit, True); ++ ++ //if(pObj->bIRQWait) ++ //{ ++ // err = TDA182I2WaitIRQ(pObj); ++ //} ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: TDA182I2Wait ++// ++// DESCRIPTION: This function waits for requested time ++// ++// RETURN: True or False ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++static tmErrorCode_t ++TDA182I2Wait ++( ++ ptmTDA182I2Object_t pObj, /* I: Driver object */ ++ UInt32 Time /* I: Time to wait for */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ // wait Time ms ++ err = POBJ_SRVFUNC_STIME.Wait(pObj->tUnit, Time); ++ ++ // Return value ++ return err; ++} ++ ++/*============================================================================*/ ++/* TDA182I2MutexAcquire */ ++/*============================================================================*/ ++extern tmErrorCode_t ++TDA182I2MutexAcquire ++( ++ ptmTDA182I2Object_t pObj, ++ UInt32 timeOut ++ ) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ if(pObj->sMutex.Acquire != Null && pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.Acquire(pObj->pMutex, timeOut); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* TDA182I2MutexRelease */ ++/*============================================================================*/ ++extern tmErrorCode_t ++TDA182I2MutexRelease ++( ++ ptmTDA182I2Object_t pObj ++ ) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ if(pObj->sMutex.Release != Null && pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.Release(pObj->pMutex); ++ } ++ ++ return err; ++} ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2WaitXtalCal_End */ ++/* */ ++/* DESCRIPTION: Wait for MSM_XtalCal_End to trigger */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++static tmErrorCode_t ++TDA182I2WaitXtalCal_End ++( ++ ptmTDA182I2Object_t pObj, /* I: Instance object */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep /* I: wait step */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ UInt32 counter = timeOut/waitStep; /* Wait max timeOut/waitStepms */ ++ UInt8 uMSM_XtalCal_End = 0; ++ ++ while(err == TM_OK && (--counter)>0) ++ { ++ err = tmddTDA182I2GetMSM_XtalCal_End(pObj->tUnit, &uMSM_XtalCal_End); ++ ++ if(uMSM_XtalCal_End == 1) ++ { ++ /* MSM_XtalCal_End triggered => Exit */ ++ break; ++ } ++ ++ TDA182I2Wait(pObj, waitStep); ++ } ++ ++ if(counter == 0) ++ { ++ err = ddTDA182I2_ERR_NOT_READY; ++ } ++ ++ return err; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmbslTDA182I2\src\tmbslTDA182I2Instance.c ++ ++ ++//----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2001 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmbslTDA182I2Instance.c ++// ++// DESCRIPTION: define the static Objects ++// ++// DOCUMENT REF: DVP Software Coding Guidelines v1.14 ++// DVP Board Support Library Architecture Specification v0.5 ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++ ++//#include "tmNxTypes.h" ++//#include "tmCompId.h" ++//#include "tmFrontEnd.h" ++//#include "tmUnitParams.h" ++//#include "tmbslFrontEndTypes.h" ++ ++//#ifdef TMBSL_TDA18272 ++// #include "tmbslTDA18272.h" ++//#else /* TMBSL_TDA18272 */ ++// #include "tmbslTDA18212.h" ++//#endif /* TMBSL_TDA18272 */ ++ ++//#include "tmbslTDA182I2local.h" ++//#include "tmbslTDA182I2Instance.h" ++//#include ++ ++//----------------------------------------------------------------------------- ++// Global data: ++//----------------------------------------------------------------------------- ++// ++// ++// default instance ++tmTDA182I2Object_t gTDA182I2Instance[] = ++{ ++ { ++ (tmUnitSelect_t)(-1), /* tUnit */ ++ (tmUnitSelect_t)(-1), /* tUnit temporary */ ++ Null, /* pMutex */ ++ False, /* init (instance initialization default) */ ++ { /* sRWFunc */ ++ Null, ++ Null ++ }, ++ { /* sTime */ ++ Null, ++ Null ++ }, ++ { /* sDebug */ ++ Null ++ }, ++ { /* sMutex */ ++ Null, ++ Null, ++ Null, ++ Null ++ }, ++#ifdef TMBSL_TDA18272 ++TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH0 ++ { ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH0 ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG_SELECTION_PATH0 ++ } ++#else ++TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH0 ++ { ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH0 ++ } ++#endif ++ }, ++ { ++ (tmUnitSelect_t)(-1), /* tUnit */ ++ (tmUnitSelect_t)(-1), /* tUnit temporary */ ++ Null, /* pMutex */ ++ False, /* init (instance initialization default) */ ++ { /* sRWFunc */ ++ Null, ++ Null ++ }, ++ { /* sTime */ ++ Null, ++ Null ++ }, ++ { /* sDebug */ ++ Null ++ }, ++ { /* sMutex */ ++ Null, ++ Null, ++ Null, ++ Null ++ }, ++#ifdef TMBSL_TDA18272 ++TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH1 ++ { ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH1 ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG_SELECTION_PATH1 ++ } ++#else ++TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH1 ++ { ++TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH1 ++ } ++#endif ++ } ++}; ++ ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: TDA182I2AllocInstance: ++// ++// DESCRIPTION: allocate new instance ++// ++// RETURN: ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++TDA182I2AllocInstance ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ pptmTDA182I2Object_t ppDrvObject /* I: Device Object */ ++) ++{ ++ tmErrorCode_t err = TDA182I2_ERR_BAD_UNIT_NUMBER; ++ ptmTDA182I2Object_t pObj = Null; ++ UInt32 uLoopCounter = 0; ++ ++ /* Find a free instance */ ++ for(uLoopCounter = 0; uLoopCounterinit == False) ++ { ++ pObj->tUnit = tUnit; ++ pObj->tUnitW = tUnit; ++ ++ // Added by Realtek. ++ // Set master bit manually according to tUnit. ++ pObj->Master = (tUnit == 0) ? True : False; ++ ++ *ppDrvObject = pObj; ++ err = TM_OK; ++ break; ++ } ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: TDA182I2DeAllocInstance: ++// ++// DESCRIPTION: deallocate instance ++// ++// RETURN: always TM_OK ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++TDA182I2DeAllocInstance ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ tmErrorCode_t err = TDA182I2_ERR_BAD_UNIT_NUMBER; ++ ptmTDA182I2Object_t pObj = Null; ++ ++ /* check input parameters */ ++ err = TDA182I2GetInstance(tUnit, &pObj); ++ ++ /* check driver state */ ++ if (err == TM_OK) ++ { ++ if (pObj == Null || pObj->init == False) ++ { ++ err = TDA182I2_ERR_NOT_INITIALIZED; ++ } ++ } ++ ++ if ((err == TM_OK) && (pObj != Null)) ++ { ++ pObj->init = False; ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++//----------------------------------------------------------------------------- ++// FUNCTION: TDA182I2GetInstance: ++// ++// DESCRIPTION: get the instance ++// ++// RETURN: always True ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++tmErrorCode_t ++TDA182I2GetInstance ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ pptmTDA182I2Object_t ppDrvObject /* I: Device Object */ ++) ++{ ++ tmErrorCode_t err = TDA182I2_ERR_NOT_INITIALIZED; ++ ptmTDA182I2Object_t pObj = Null; ++ UInt32 uLoopCounter = 0; ++ ++ /* get instance */ ++ for(uLoopCounter = 0; uLoopCounterinit == True && pObj->tUnit == GET_INDEX_TYPE_TUNIT(tUnit)) ++ { ++ pObj->tUnitW = tUnit; ++ ++ *ppDrvObject = pObj; ++ err = TM_OK; ++ break; ++ } ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\src\tmddTDA182I2.c ++ ++ ++/* ++ Copyright (C) 2006-2009 NXP B.V., All Rights Reserved. ++ This source code and any compilation or derivative thereof is the proprietary ++ information of NXP B.V. and is confidential in nature. Under no circumstances ++ is this software to be exposed to or placed under an Open Source License of ++ any type without the expressed written permission of NXP B.V. ++ * ++ * \file tmddTDA182I2.c ++ * ++ * 3 ++ * ++ * \date %modify_time% ++ * ++ * \brief Describe briefly the purpose of this file. ++ * ++ * REFERENCE DOCUMENTS : ++ * TDA18254_Driver_User_Guide.pdf ++ * ++ * Detailed description may be added here. ++ * ++ * \section info Change Information ++ * ++*/ ++ ++/*============================================================================*/ ++/* Standard include files: */ ++/*============================================================================*/ ++//#include "tmNxTypes.h" ++//#include "tmCompId.h" ++//#include "tmFrontEnd.h" ++//#include "tmbslFrontEndTypes.h" ++//#include "tmUnitParams.h" ++ ++/*============================================================================*/ ++/* Project include files: */ ++/*============================================================================*/ ++//#include "tmddTDA182I2.h" ++//#include ++ ++//#include "tmddTDA182I2Instance.h" ++ ++/*============================================================================*/ ++/* Types and defines: */ ++/*============================================================================*/ ++ ++/*============================================================================*/ ++/* Global data: */ ++/*============================================================================*/ ++ ++/*============================================================================*/ ++/* Internal Prototypes: */ ++/*============================================================================*/ ++ ++/*============================================================================*/ ++/* Exported functions: */ ++/*============================================================================*/ ++ ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2Init */ ++/* */ ++/* DESCRIPTION: Create an instance of a TDA182I2 Tuner */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2Init ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmbslFrontEndDependency_t* psSrvFunc /* I: setup parameters */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if (psSrvFunc == Null) ++ { ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ } ++ ++ /* Get Instance Object */ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ } ++ ++ /* Check driver state */ ++ if (err == TM_OK || err == ddTDA182I2_ERR_NOT_INITIALIZED) ++ { ++ if (pObj != Null && pObj->init == True) ++ { ++ err = ddTDA182I2_ERR_NOT_INITIALIZED; ++ } ++ else ++ { ++ /* Allocate the Instance Object */ ++ if (pObj == Null) ++ { ++ err = ddTDA182I2AllocInstance(tUnit, &pObj); ++ if (err != TM_OK || pObj == Null) ++ { ++ err = ddTDA182I2_ERR_NOT_INITIALIZED; ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* initialize the Instance Object */ ++ pObj->sRWFunc = psSrvFunc->sIo; ++ pObj->sTime = psSrvFunc->sTime; ++ pObj->sDebug = psSrvFunc->sDebug; ++ ++ if( psSrvFunc->sMutex.Init != Null ++ && psSrvFunc->sMutex.DeInit != Null ++ && psSrvFunc->sMutex.Acquire != Null ++ && psSrvFunc->sMutex.Release != Null) ++ { ++ pObj->sMutex = psSrvFunc->sMutex; ++ ++ err = pObj->sMutex.Init(&pObj->pMutex); ++ } ++ ++ pObj->init = True; ++ err = TM_OK; ++ } ++ } ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2DeInit */ ++/* */ ++/* DESCRIPTION: Destroy an instance of a TDA182I2 Tuner */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2DeInit ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ptmddTDA182I2Object_t pObj = Null; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ ++// tmDBGPRINTEx(DEBUGLVL_VERBOSE, "tmddTDA182I2DeInit(0x%08X)", tUnit); ++ ++ if(err == TM_OK) ++ { ++ if(pObj->sMutex.DeInit != Null) ++ { ++ if(pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.DeInit(pObj->pMutex); ++ } ++ ++ pObj->sMutex.Init = Null; ++ pObj->sMutex.DeInit = Null; ++ pObj->sMutex.Acquire = Null; ++ pObj->sMutex.Release = Null; ++ ++ pObj->pMutex = Null; ++ } ++ } ++ ++ err = ddTDA182I2DeAllocInstance(tUnit); ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetSWVersion */ ++/* */ ++/* DESCRIPTION: Return the version of this device */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: Values defined in the tmddTDA182I2local.h file */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetSWVersion ++( ++ ptmSWVersion_t pSWVersion /* I: Receives SW Version */ ++) ++{ ++ pSWVersion->compatibilityNr = TDA182I2_DD_COMP_NUM; ++ pSWVersion->majorVersionNr = TDA182I2_DD_MAJOR_VER; ++ pSWVersion->minorVersionNr = TDA182I2_DD_MINOR_VER; ++ ++ return TM_OK; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2Reset */ ++/* */ ++/* DESCRIPTION: Initialize TDA182I2 Hardware */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2Reset ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /****** I2C map initialization : begin *********/ ++ if(err == TM_OK) ++ { ++ /* read all bytes */ ++ err = ddTDA182I2Read(pObj, 0x00, TDA182I2_I2C_MAP_NB_BYTES); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* RSSI_Ck_Speed 31,25 kHz 0 */ ++ err = tmddTDA182I2SetRSSI_Ck_Speed(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetRSSI_Ck_Speed(0x%08X, 0) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* AGC1_Do_step 8,176 ms 2 */ ++ err = tmddTDA182I2SetAGC1_Do_step(tUnit, 2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC1_Do_step(0x%08X, 2) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* AGC2_Do_step 8,176 ms 1 */ ++ err = tmddTDA182I2SetAGC2_Do_step(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC2_Do_step(0x%08X, 1) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* AGCs_Up_Step_assym UP 12 Asym / 4 Asym / 5 Asym 3 */ ++ err = tmddTDA182I2SetAGCs_Up_Step_assym(tUnit, 3); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGCs_Up_Step_assym(0x%08X, 3) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* AGCs_Do_Step_assym DO 12 Asym / 45 Sym 2 */ ++ err = tmddTDA182I2SetAGCs_Do_Step_assym(tUnit, 2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGCs_Do_Step_assym(0x%08X, 2) failed.", tUnit)); ++ } ++ /****** I2C map initialization : end *********/ ++ ++ /*****************************************/ ++ /* Launch tuner calibration */ ++ /* State reached after 1.5 s max */ ++ if(err == TM_OK) ++ { ++ /* set IRQ_clear */ ++ err = tmddTDA182I2SetIRQ_Clear(tUnit, 0x1F); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIRQ_clear(0x%08X, 0x1F) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* set power state on */ ++ err = tmddTDA182I2SetPowerState(tUnit, tmddTDA182I2_PowerNormalMode); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPowerState(0x%08X, PowerNormalMode) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* set & trigger MSM */ ++ pObj->I2CMap.uBx19.MSM_byte_1 = 0x3B; ++ pObj->I2CMap.uBx1A.MSM_byte_2 = 0x01; ++ ++ /* write bytes 0x19 to 0x1A */ ++ err = ddTDA182I2Write(pObj, 0x19, 2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ pObj->I2CMap.uBx1A.MSM_byte_2 = 0x00; ++ ++ } ++ ++ if(pObj->bIRQWait) ++ { ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitIRQ(pObj, 1500, 50, 0x1F); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetLPF_Gain_Mode */ ++/* */ ++/* DESCRIPTION: Free/Freeze LPF Gain */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetLPF_Gain_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uMode /* I: Unknown/Free/Frozen */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ switch(uMode) ++ { ++ case tmddTDA182I2_LPF_Gain_Unknown: ++ default: ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetLPF_Gain_Free(0x%08X, tmddTDA182I2_LPF_Gain_Unknown).", tUnit)); ++ break; ++ ++ case tmddTDA182I2_LPF_Gain_Free: ++ err = tmddTDA182I2SetAGC5_loop_off(tUnit, False); /* Disable AGC5 loop off */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC5_loop_off(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetForce_AGC5_gain(tUnit, False); /* Do not force AGC5 gain */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetForce_AGC5_gain(0x%08X) failed.", tUnit)); ++ } ++ break; ++ ++ case tmddTDA182I2_LPF_Gain_Frozen: ++ err = tmddTDA182I2SetAGC5_loop_off(tUnit, True); /* Enable AGC5 loop off */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC5_loop_off(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetForce_AGC5_gain(tUnit, True); /* Force AGC5 gain */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetForce_AGC5_gain(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2SetAGC5_Gain(tUnit, 0); /* Force gain to 0dB */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetAGC5_Gain(0x%08X) failed.", tUnit)); ++ } ++ break; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetLPF_Gain_Mode */ ++/* */ ++/* DESCRIPTION: Free/Freeze LPF Gain */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetLPF_Gain_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 *puMode /* I/O: Unknown/Free/Frozen */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt8 AGC5_loop_off = 0; ++ UInt8 Force_AGC5_gain = 0; ++ UInt8 AGC5_Gain = 0; ++ ++ /* Test the parameter */ ++ if (puMode == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *puMode = tmddTDA182I2_LPF_Gain_Unknown; ++ ++ err = tmddTDA182I2GetAGC5_loop_off(tUnit, &AGC5_loop_off); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetAGC5_loop_off(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetForce_AGC5_gain(tUnit, &Force_AGC5_gain); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetForce_AGC5_gain(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = tmddTDA182I2GetAGC5_Gain(tUnit, &AGC5_Gain); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2GetAGC5_Gain(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ if(AGC5_loop_off==False && Force_AGC5_gain==False) ++ { ++ *puMode = tmddTDA182I2_LPF_Gain_Free; ++ } ++ else if(AGC5_loop_off==True && Force_AGC5_gain==True && AGC5_Gain==0) ++ { ++ *puMode = tmddTDA182I2_LPF_Gain_Frozen; ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2Write */ ++/* */ ++/* DESCRIPTION: Write in TDA182I2 hardware */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2Write ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uIndex, /* I: Start index to write */ ++ UInt32 uNbBytes, /* I: Number of bytes to write */ ++ UInt8* puBytes /* I: Pointer on an array of bytes */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt32 uCounter; ++ UInt8* pI2CMap = Null; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* pI2CMap initialization */ ++ pI2CMap = &(pObj->I2CMap.uBx00.ID_byte_1) + uIndex; ++ ++ /* Save the values written in the Tuner */ ++ for (uCounter = 0; uCounter < uNbBytes; uCounter++) ++ { ++ *pI2CMap = puBytes[uCounter]; ++ pI2CMap ++; ++ } ++ ++ /* Write in the Tuner */ ++ err = ddTDA182I2Write(pObj,(UInt8)(uIndex),(UInt8)(uNbBytes)); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2Read */ ++/* */ ++/* DESCRIPTION: Read in TDA182I2 hardware */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2Read ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uIndex, /* I: Start index to read */ ++ UInt32 uNbBytes, /* I: Number of bytes to read */ ++ UInt8* puBytes /* I: Pointer on an array of bytes */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt32 uCounter = 0; ++ UInt8* pI2CMap = Null; ++ ++ /* Test the parameters */ ++ if (uNbBytes > TDA182I2_I2C_MAP_NB_BYTES) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* pI2CMap initialization */ ++ pI2CMap = &(pObj->I2CMap.uBx00.ID_byte_1) + uIndex; ++ ++ /* Read from the Tuner */ ++ err = ddTDA182I2Read(pObj,(UInt8)(uIndex),(UInt8)(uNbBytes)); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Copy read values to puBytes */ ++ for (uCounter = 0; uCounter < uNbBytes; uCounter++) ++ { ++ *puBytes = (*pI2CMap); ++ pI2CMap ++; ++ puBytes ++; ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetMS */ ++/* */ ++/* DESCRIPTION: Get the MS bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetMS ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x00 */ ++ err = ddTDA182I2Read(pObj, 0x00, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx00.bF.MS ; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIdentity */ ++/* */ ++/* DESCRIPTION: Get the Identity bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIdentity ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt16* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x00-0x01 */ ++ err = ddTDA182I2Read(pObj, 0x00, 2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx00.bF.Ident_1 << 8 | pObj->I2CMap.uBx01.bF.Ident_2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetMinorRevision */ ++/* */ ++/* DESCRIPTION: Get the Revision bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetMinorRevision ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x02 */ ++ err = ddTDA182I2Read(pObj, 0x02, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx02.bF.Minor_rev; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetMajorRevision */ ++/* */ ++/* DESCRIPTION: Get the Revision bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetMajorRevision ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x02 */ ++ err = ddTDA182I2Read(pObj, 0x02, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx02.bF.Major_rev; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetLO_Lock */ ++/* */ ++/* DESCRIPTION: Get the LO_Lock bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetLO_Lock ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x05 */ ++ err = ddTDA182I2Read(pObj, 0x05, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx05.bF.LO_Lock ; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetPowerState */ ++/* */ ++/* DESCRIPTION: Set the power state of the TDA182I2 */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetPowerState ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmddTDA182I2PowerState_t powerState /* I: Power state of this device */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read bytes 0x06-0x14 */ ++ err = ddTDA182I2Read(pObj, 0x06, 15); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ /* Set digital clock mode*/ ++ if(err == TM_OK) ++ { ++ switch (powerState) ++ { ++ case tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndWithSyntheOn: ++ case tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn: ++ case tmddTDA182I2_PowerStandbyWithXtalOn: ++ case tmddTDA182I2_PowerStandby: ++ /* Set 16 Mhz Xtal clock */ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 0); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, 16 Mhz xtal clock) failed.", tUnit)); ++ break; ++ ++ default: ++ break; ++ } ++ } ++ ++ /* Set power state */ ++ if(err == TM_OK) ++ { ++ switch (powerState) ++ { ++ case tmddTDA182I2_PowerNormalMode: ++ pObj->I2CMap.uBx06.bF.SM = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_Synthe = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_LT = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_XT = 0x00; ++ break; ++ ++ case tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndWithSyntheOn: ++ pObj->I2CMap.uBx06.bF.SM = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_Synthe = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_LT = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_XT = 0x00; ++ break; ++ ++ case tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn: ++ pObj->I2CMap.uBx06.bF.SM = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_Synthe = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_LT = 0x00; ++ pObj->I2CMap.uBx06.bF.SM_XT = 0x00; ++ break; ++ ++ case tmddTDA182I2_PowerStandbyWithXtalOn: ++ pObj->I2CMap.uBx06.bF.SM = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_Synthe = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_LT = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_XT = 0x00; ++ break; ++ ++ case tmddTDA182I2_PowerStandby: ++ pObj->I2CMap.uBx06.bF.SM = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_Synthe = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_LT = 0x01; ++ pObj->I2CMap.uBx06.bF.SM_XT = 0x01; ++ break; ++ ++ default: ++ /* Power state not supported*/ ++ return ddTDA182I2_ERR_NOT_SUPPORTED; ++ } ++ ++ /* Write byte 0x06 */ ++ err = ddTDA182I2Write(pObj, 0x06, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ } ++ ++ /* Set digital clock mode*/ ++ if(err == TM_OK) ++ { ++ switch (powerState) ++ { ++ case tmddTDA182I2_PowerNormalMode: ++ /* Set sigma delta clock*/ ++ err = tmddTDA182I2SetDigital_Clock_Mode(tUnit, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetDigital_Clock_Mode(0x%08X, sigma delta clock) failed.", tUnit)); ++ break; ++ ++ default: ++ break; ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Store powerstate */ ++ pObj->curPowerState = powerState; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetPowerState */ ++/* */ ++/* DESCRIPTION: Get the power state of the TDA182I2 */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetPowerState ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ ptmddTDA182I2PowerState_t pPowerState /* O: Power state of this device */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Get power state */ ++ if ((pObj->I2CMap.uBx06.bF.SM == 0x00) && (pObj->I2CMap.uBx06.bF.SM_Synthe == 0x00) && (pObj->I2CMap.uBx06.bF.SM_LT == 0x00) && (pObj->I2CMap.uBx06.bF.SM_XT == 0x00)) ++ { ++ *pPowerState = tmddTDA182I2_PowerNormalMode; ++ } ++ else if ((pObj->I2CMap.uBx06.bF.SM == 0x01) && (pObj->I2CMap.uBx06.bF.SM_Synthe == 0x00) && (pObj->I2CMap.uBx06.bF.SM_LT == 0x00) && (pObj->I2CMap.uBx06.bF.SM_XT == 0x00)) ++ { ++ *pPowerState = tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndWithSyntheOn; ++ } ++ else if ((pObj->I2CMap.uBx06.bF.SM == 0x01) && (pObj->I2CMap.uBx06.bF.SM_Synthe == 0x01) && (pObj->I2CMap.uBx06.bF.SM_LT == 0x00) && (pObj->I2CMap.uBx06.bF.SM_XT == 0x00)) ++ { ++ *pPowerState = tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn; ++ } ++ else if ((pObj->I2CMap.uBx06.bF.SM == 0x01) && (pObj->I2CMap.uBx06.bF.SM_Synthe == 0x01) && (pObj->I2CMap.uBx06.bF.SM_LT == 0x01) && (pObj->I2CMap.uBx06.bF.SM_XT == 0x00)) ++ { ++ *pPowerState = tmddTDA182I2_PowerStandbyWithXtalOn; ++ } ++ else if ((pObj->I2CMap.uBx06.bF.SM == 0x01) && (pObj->I2CMap.uBx06.bF.SM_Synthe == 0x01) && (pObj->I2CMap.uBx06.bF.SM_LT == 0x01) && (pObj->I2CMap.uBx06.bF.SM_XT == 0x01)) ++ { ++ *pPowerState = tmddTDA182I2_PowerStandby; ++ } ++ else ++ { ++ *pPowerState = tmddTDA182I2_PowerMax; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetPower_Level */ ++/* */ ++/* DESCRIPTION: Get the Power_Level bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetPower_Level ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt8 uValue = 0; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ if(err == TM_OK) ++ { ++ /* Set IRQ_clear*/ ++ err = tmddTDA182I2SetIRQ_Clear(tUnit, 0x10); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIRQ_clear(0x%08X, 0x10) failed.", tUnit)); ++ } ++ if(err == TM_OK) ++ { ++ /* Trigger RSSI_Meas */ ++ pObj->I2CMap.uBx19.MSM_byte_1 = 0x80; ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /*Trigger MSM_Launch */ ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 1; ++ ++ /* Write byte 0x1A */ ++ err = ddTDA182I2Write(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 0; ++ if(pObj->bIRQWait) ++ { ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitIRQ(pObj, 700, 1, 0x10); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ } ++ } ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x07 */ ++ err = ddTDA182I2Read(pObj, 0x07, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Get value (limit range) */ ++ uValue = pObj->I2CMap.uBx07.bF.Power_Level; ++ if (uValue < TDA182I2_POWER_LEVEL_MIN) ++ { ++ *puValue = 0x00; ++ } ++ else if (uValue > TDA182I2_POWER_LEVEL_MAX) ++ { ++ *puValue = 0xFF; ++ } ++ else ++ { ++ *puValue = uValue; ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIRQ_status */ ++/* */ ++/* DESCRIPTION: Get the IRQ_status bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIRQ_status ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x08 */ ++ err = ddTDA182I2GetIRQ_status(pObj, puValue); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetIRQ_status(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetMSM_XtalCal_End */ ++/* */ ++/* DESCRIPTION: Get the MSM_XtalCal_End bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetMSM_XtalCal_End ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x08 */ ++ err = ddTDA182I2GetMSM_XtalCal_End(pObj, puValue); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIRQ_Clear */ ++/* */ ++/* DESCRIPTION: Set the IRQ_Clear bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIRQ_Clear ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 irqStatus /* I: IRQs to clear */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set IRQ_Clear */ ++ /*pObj->I2CMap.uBx0A.bF.IRQ_Clear = 1; */ ++ pObj->I2CMap.uBx0A.IRQ_clear |= (0x80|(irqStatus&0x1F)); ++ ++ /* Write byte 0x0A */ ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ /* Reset IRQ_Clear (buffer only, no write) */ ++ /*pObj->I2CMap.uBx0A.bF.IRQ_Clear = 0;*/ ++ pObj->I2CMap.uBx0A.IRQ_clear &= (~(0x80|(irqStatus&0x1F))); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC1_TOP */ ++/* */ ++/* DESCRIPTION: Set the AGC1_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC1_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0C.bF.AGC1_TOP = uValue; ++ ++ /* write byte 0x0C */ ++ err = ddTDA182I2Write(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC1_TOP */ ++/* */ ++/* DESCRIPTION: Get the AGC1_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC1_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if ( puValue == Null ) ++ { ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ } ++ ++ /* Get Instance Object */ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0C */ ++ err = ddTDA182I2Read(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0C.bF.AGC1_TOP; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC2_TOP */ ++/* */ ++/* DESCRIPTION: Set the AGC2_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC2_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* set value */ ++ pObj->I2CMap.uBx0D.bF.AGC2_TOP = uValue; ++ ++ /* Write byte 0x0D */ ++ err = ddTDA182I2Write(pObj, 0x0D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC2_TOP */ ++/* */ ++/* DESCRIPTION: Get the AGC2_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC2_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0D */ ++ err = ddTDA182I2Read(pObj, 0x0D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0D.bF.AGC2_TOP; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGCs_Up_Step */ ++/* */ ++/* DESCRIPTION: Set the AGCs_Up_Step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGCs_Up_Step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0E.bF.AGCs_Up_Step = uValue; ++ ++ /* Write byte 0x0E */ ++ err = ddTDA182I2Write(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGCs_Up_Step */ ++/* */ ++/* DESCRIPTION: Get the AGCs_Up_Step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGCs_Up_Step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0E */ ++ err = ddTDA182I2Read(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0E.bF.AGCs_Up_Step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGCK_Step */ ++/* */ ++/* DESCRIPTION: Set the AGCK_Step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGCK_Step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0E.bF.AGCK_Step = uValue; ++ ++ /* Write byte 0x0E */ ++ err = ddTDA182I2Write(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGCK_Step */ ++/* */ ++/* DESCRIPTION: Get the AGCK_Step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGCK_Step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0E */ ++ err = ddTDA182I2Read(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0E.bF.AGCK_Step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGCK_Mode */ ++/* */ ++/* DESCRIPTION: Set the AGCK_Mode bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGCK_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0E.bF.AGCK_Mode = uValue; ++ ++ /* Write byte 0x0E */ ++ err = ddTDA182I2Write(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGCK_Mode */ ++/* */ ++/* DESCRIPTION: Get the AGCK_Mode bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGCK_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0E */ ++ err = ddTDA182I2Read(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0E.bF.AGCK_Mode; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetPD_RFAGC_Adapt */ ++/* */ ++/* DESCRIPTION: Set the PD_RFAGC_Adapt bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetPD_RFAGC_Adapt ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0F.bF.PD_RFAGC_Adapt = uValue; ++ ++ /* Write byte 0x0F */ ++ err = ddTDA182I2Write(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetPD_RFAGC_Adapt */ ++/* */ ++/* DESCRIPTION: Get the PD_RFAGC_Adapt bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetPD_RFAGC_Adapt ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0F */ ++ err = ddTDA182I2Read(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0F.bF.PD_RFAGC_Adapt; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRFAGC_Adapt_TOP */ ++/* */ ++/* DESCRIPTION: Set the RFAGC_Adapt_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRFAGC_Adapt_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0F.bF.RFAGC_Adapt_TOP = uValue; ++ ++ /* Write byte 0x0F */ ++ err = ddTDA182I2Write(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRFAGC_Adapt_TOP */ ++/* */ ++/* DESCRIPTION: Get the RFAGC_Adapt_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRFAGC_Adapt_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0F */ ++ err = ddTDA182I2Read(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0F.bF.RFAGC_Adapt_TOP; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRF_Atten_3dB */ ++/* */ ++/* DESCRIPTION: Set the RF_Atten_3dB bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRF_Atten_3dB ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0F.bF.RF_Atten_3dB = uValue; ++ ++ /* Write byte 0x0F */ ++ err = ddTDA182I2Write(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRF_Atten_3dB */ ++/* */ ++/* DESCRIPTION: Get the RF_Atten_3dB bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRF_Atten_3dB ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0F */ ++ err = ddTDA182I2Read(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0F.bF.RF_Atten_3dB; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRFAGC_Top */ ++/* */ ++/* DESCRIPTION: Set the RFAGC_Top bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRFAGC_Top ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx0F.bF.RFAGC_Top = uValue; ++ ++ /* Write byte 0x0F */ ++ err = ddTDA182I2Write(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRFAGC_Top */ ++/* */ ++/* DESCRIPTION: Get the RFAGC_Top bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRFAGC_Top ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x0F */ ++ err = ddTDA182I2Read(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx0F.bF.RFAGC_Top; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIR_Mixer_Top */ ++/* */ ++/* DESCRIPTION: Set the IR_Mixer_Top bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIR_Mixer_Top ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx10.bF.IR_Mixer_Top = uValue; ++ ++ /* Write byte 0x10 */ ++ err = ddTDA182I2Write(pObj, 0x10, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIR_Mixer_Top */ ++/* */ ++/* DESCRIPTION: Get the IR_Mixer_Top bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIR_Mixer_Top ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x10 */ ++ err = ddTDA182I2Read(pObj, 0x10, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx10.bF.IR_Mixer_Top; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC5_Ana */ ++/* */ ++/* DESCRIPTION: Set the AGC5_Ana bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC5_Ana ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx11.bF.AGC5_Ana = uValue; ++ ++ /* Write byte 0x11 */ ++ err = ddTDA182I2Write(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC5_Ana */ ++/* */ ++/* DESCRIPTION: Get the AGC5_Ana bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC5_Ana ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x11 */ ++ err = ddTDA182I2Read(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx11.bF.AGC5_Ana; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC5_TOP */ ++/* */ ++/* DESCRIPTION: Set the AGC5_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC5_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx11.bF.AGC5_TOP = uValue; ++ ++ /* Write byte 0x11 */ ++ err = ddTDA182I2Write(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC5_TOP */ ++/* */ ++/* DESCRIPTION: Get the AGC5_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC5_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x11 */ ++ err = ddTDA182I2Read(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx11.bF.AGC5_TOP; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIF_Level */ ++/* */ ++/* DESCRIPTION: Set the IF_level bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIF_Level ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx12.bF.IF_level = uValue; ++ ++ /* Write byte 0x12 */ ++ err = ddTDA182I2Write(pObj, 0x12, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIF_Level */ ++/* */ ++/* DESCRIPTION: Get the IF_level bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIF_Level ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x12 */ ++ err = ddTDA182I2Read(pObj, 0x12, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx12.bF.IF_level; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIF_HP_Fc */ ++/* */ ++/* DESCRIPTION: Set the IF_HP_Fc bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIF_HP_Fc ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx13.bF.IF_HP_Fc = uValue; ++ ++ /* Write byte 0x13 */ ++ err = ddTDA182I2Write(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIF_HP_Fc */ ++/* */ ++/* DESCRIPTION: Get the IF_HP_Fc bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIF_HP_Fc ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x13 */ ++ err = ddTDA182I2Read(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx13.bF.IF_HP_Fc; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIF_ATSC_Notch */ ++/* */ ++/* DESCRIPTION: Set the IF_ATSC_Notch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIF_ATSC_Notch ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx13.bF.IF_ATSC_Notch = uValue; ++ ++ /* Write byte 0x13 */ ++ err = ddTDA182I2Write(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIF_ATSC_Notch */ ++/* */ ++/* DESCRIPTION: Get the IF_ATSC_Notch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIF_ATSC_Notch ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x13 */ ++ err = ddTDA182I2Read(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx13.bF.IF_ATSC_Notch; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetLP_FC_Offset */ ++/* */ ++/* DESCRIPTION: Set the LP_FC_Offset bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetLP_FC_Offset ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx13.bF.LP_FC_Offset = uValue; ++ ++ /* Write byte 0x13 */ ++ err = ddTDA182I2Write(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetLP_FC_Offset */ ++/* */ ++/* DESCRIPTION: Get the LP_FC_Offset bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetLP_FC_Offset ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x13 */ ++ err = ddTDA182I2Read(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx13.bF.LP_FC_Offset; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetLP_FC */ ++/* */ ++/* DESCRIPTION: Set the LP_Fc bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetLP_FC ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx13.bF.LP_Fc = uValue; ++ ++ /* Write byte 0x13 */ ++ err = ddTDA182I2Write(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetLP_FC */ ++/* */ ++/* DESCRIPTION: Get the LP_Fc bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetLP_FC ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x13 */ ++ err = ddTDA182I2Read(pObj, 0x13, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx13.bF.LP_Fc; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetDigital_Clock_Mode */ ++/* */ ++/* DESCRIPTION: Set the Digital_Clock_Mode bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetDigital_Clock_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx14.bF.Digital_Clock_Mode = uValue; ++ ++ /* Write byte 0x14 */ ++ err = ddTDA182I2Write(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetDigital_Clock_Mode */ ++/* */ ++/* DESCRIPTION: Get the Digital_Clock_Mode bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetDigital_Clock_Mode ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x14 */ ++ err = ddTDA182I2Read(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx14.bF.Digital_Clock_Mode; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIF_Freq */ ++/* */ ++/* DESCRIPTION: Set the IF_Freq bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIF_Freq ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx15.bF.IF_Freq = (UInt8)(uValue / 50000); ++ ++ /* Write byte 0x15 */ ++ err = ddTDA182I2Write(pObj, 0x15, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIF_Freq */ ++/* */ ++/* DESCRIPTION: Get the IF_Freq bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIF_Freq ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x15 */ ++ err = ddTDA182I2Read(pObj, 0x15, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx15.bF.IF_Freq * 50000; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRF_Freq */ ++/* */ ++/* DESCRIPTION: Set the RF_Freq bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRF_Freq ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt32 uRF = 0; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /*****************************************/ ++ /* Tune the settings that depend on the RF input frequency, expressed in kHz.*/ ++ /* RF filters tuning, PLL locking*/ ++ /* State reached after 5ms*/ ++ ++ if(err == TM_OK) ++ { ++ /* Set IRQ_clear */ ++ err = tmddTDA182I2SetIRQ_Clear(tUnit, 0x0C); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetIRQ_clear(0x%08X, 0x0C) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set power state ON */ ++ err = tmddTDA182I2SetPowerState(tUnit, tmddTDA182I2_PowerNormalMode); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "tmddTDA182I2SetPowerState(0x%08X, PowerNormalMode) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set RF frequency expressed in kHz */ ++ uRF = uValue / 1000; ++ pObj->I2CMap.uBx16.bF.RF_Freq_1 = (UInt8)((uRF & 0x00FF0000) >> 16); ++ pObj->I2CMap.uBx17.bF.RF_Freq_2 = (UInt8)((uRF & 0x0000FF00) >> 8); ++ pObj->I2CMap.uBx18.bF.RF_Freq_3 = (UInt8)(uRF & 0x000000FF); ++ ++ /* write bytes 0x16 to 0x18*/ ++ err = ddTDA182I2Write(pObj, 0x16, 3); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set & trigger MSM */ ++ pObj->I2CMap.uBx19.MSM_byte_1 = 0x41; ++ pObj->I2CMap.uBx1A.MSM_byte_2 = 0x01; ++ ++ /* Write bytes 0x19 to 0x1A */ ++ err = ddTDA182I2Write(pObj, 0x19, 2); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ pObj->I2CMap.uBx1A.MSM_byte_2 = 0x00; ++ } ++ if(pObj->bIRQWait) ++ { ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitIRQ(pObj, 50, 5, 0x0C); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRF_Freq */ ++/* */ ++/* DESCRIPTION: Get the RF_Freq bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRF_Freq ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read bytes 0x16 to 0x18 */ ++ err = ddTDA182I2Read(pObj, 0x16, 3); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = (pObj->I2CMap.uBx16.bF.RF_Freq_1 << 16) | (pObj->I2CMap.uBx17.bF.RF_Freq_2 << 8) | pObj->I2CMap.uBx18.bF.RF_Freq_3; ++ *puValue = *puValue * 1000; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetMSM_Launch */ ++/* */ ++/* DESCRIPTION: Set the MSM_Launch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetMSM_Launch ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 1; ++ ++ /* Write byte 0x1A */ ++ err = ddTDA182I2Write(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ /* reset MSM_Launch (buffer only, no write) */ ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 0x00; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetMSM_Launch */ ++/* */ ++/* DESCRIPTION: Get the MSM_Launch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetMSM_Launch ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1A */ ++ err = ddTDA182I2Read(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1A.bF.MSM_Launch; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetPSM_StoB */ ++/* */ ++/* DESCRIPTION: Set the PSM_StoB bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetPSM_StoB ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1B.bF.PSM_StoB = uValue; ++ ++ /* Read byte 0x1B */ ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetPSM_StoB */ ++/* */ ++/* DESCRIPTION: Get the PSM_StoB bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetPSM_StoB ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1B */ ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1B.bF.PSM_StoB; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetFmax_Lo */ ++/* */ ++/* DESCRIPTION: Set the Fmax_Lo bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetFmax_Lo ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1D.bF.Fmax_Lo = uValue; ++ ++ // read byte 0x1D ++ err = ddTDA182I2Write(pObj, 0x1D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetFmax_Lo */ ++/* */ ++/* DESCRIPTION: Get the Fmax_Lo bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetFmax_Lo ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1D ++ err = ddTDA182I2Read(pObj, 0x1D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1D.bF.Fmax_Lo; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++ ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIR_Loop */ ++/* */ ++/* DESCRIPTION: Set the IR_Loop bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIR_Loop ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1E.bF.IR_Loop = uValue - 4; ++ ++ /* Read byte 0x1E */ ++ err = ddTDA182I2Write(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIR_Loop */ ++/* */ ++/* DESCRIPTION: Get the IR_Loop bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIR_Loop ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1E */ ++ err = ddTDA182I2Read(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1E.bF.IR_Loop + 4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIR_Target */ ++/* */ ++/* DESCRIPTION: Set the IR_Target bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIR_Target ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1E.bF.IR_Target = uValue; ++ ++ /* Read byte 0x1E */ ++ err = ddTDA182I2Write(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIR_Target */ ++/* */ ++/* DESCRIPTION: Get the IR_Target bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIR_Target ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1E */ ++ err = ddTDA182I2Read(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1E.bF.IR_Target; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIR_Corr_Boost */ ++/* */ ++/* DESCRIPTION: Set the IR_Corr_Boost bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIR_Corr_Boost ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1F.bF.IR_Corr_Boost = uValue; ++ ++ /* Read byte 0x1F */ ++ err = ddTDA182I2Write(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIR_Corr_Boost */ ++/* */ ++/* DESCRIPTION: Get the IR_Corr_Boost bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIR_Corr_Boost ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1F */ ++ err = ddTDA182I2Read(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1F.bF.IR_Corr_Boost; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIR_mode_ram_store */ ++/* */ ++/* DESCRIPTION: Set the IR_mode_ram_store bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIR_mode_ram_store ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx1F.bF.IR_mode_ram_store = uValue; ++ ++ /* Write byte 0x1F */ ++ err = ddTDA182I2Write(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIR_mode_ram_store */ ++/* */ ++/* DESCRIPTION: Get the IR_mode_ram_store bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIR_mode_ram_store ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x1F */ ++ err = ddTDA182I2Read(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx1F.bF.IR_mode_ram_store; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetPD_Udld */ ++/* */ ++/* DESCRIPTION: Set the PD_Udld bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetPD_Udld ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx22.bF.PD_Udld = uValue; ++ ++ /* Write byte 0x22 */ ++ err = ddTDA182I2Write(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetPD_Udld */ ++/* */ ++/* DESCRIPTION: Get the PD_Udld bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetPD_Udld ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x22 */ ++ err = ddTDA182I2Read(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx22.bF.PD_Udld; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC_Ovld_TOP */ ++/* */ ++/* DESCRIPTION: Set the AGC_Ovld_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC_Ovld_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx22.bF.AGC_Ovld_TOP = uValue; ++ ++ /* Write byte 0x22 */ ++ err = ddTDA182I2Write(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC_Ovld_TOP */ ++/* */ ++/* DESCRIPTION: Get the AGC_Ovld_TOP bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC_Ovld_TOP ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x22 */ ++ err = ddTDA182I2Read(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx22.bF.AGC_Ovld_TOP; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetHi_Pass */ ++/* */ ++/* DESCRIPTION: Set the Hi_Pass bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetHi_Pass ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx23.bF.Hi_Pass = uValue; ++ ++ /* Read byte 0x23 */ ++ err = ddTDA182I2Write(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetHi_Pass */ ++/* */ ++/* DESCRIPTION: Get the Hi_Pass bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetHi_Pass ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x23 */ ++ err = ddTDA182I2Read(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx23.bF.Hi_Pass; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIF_Notch */ ++/* */ ++/* DESCRIPTION: Set the IF_Notch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIF_Notch ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx23.bF.IF_Notch = uValue; ++ ++ /* Read byte 0x23 */ ++ err = ddTDA182I2Write(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIF_Notch */ ++/* */ ++/* DESCRIPTION: Get the IF_Notch bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIF_Notch ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x23 */ ++ err = ddTDA182I2Read(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx23.bF.IF_Notch; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC5_loop_off */ ++/* */ ++/* DESCRIPTION: Set the AGC5_loop_off bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC5_loop_off ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx25.bF.AGC5_loop_off = uValue; ++ ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Write(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC5_loop_off */ ++/* */ ++/* DESCRIPTION: Get the AGC5_loop_off bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC5_loop_off ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Read(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx25.bF.AGC5_loop_off; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC5_Do_step */ ++/* */ ++/* DESCRIPTION: Set the AGC5_Do_step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC5_Do_step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx25.bF.AGC5_Do_step = uValue; ++ ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Write(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC5_Do_step */ ++/* */ ++/* DESCRIPTION: Get the AGC5_Do_step bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC5_Do_step ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Read(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx25.bF.AGC5_Do_step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetForce_AGC5_gain */ ++/* */ ++/* DESCRIPTION: Set the Force_AGC5_gain bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetForce_AGC5_gain ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx25.bF.Force_AGC5_gain = uValue; ++ ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Write(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetForce_AGC5_gain */ ++/* */ ++/* DESCRIPTION: Get the Force_AGC5_gain bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetForce_AGC5_gain ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Read(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx25.bF.Force_AGC5_gain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetAGC5_Gain */ ++/* */ ++/* DESCRIPTION: Set the AGC5_Gain bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetAGC5_Gain ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx25.bF.AGC5_Gain = uValue; ++ ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Write(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetAGC5_Gain */ ++/* */ ++/* DESCRIPTION: Get the AGC5_Gain bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetAGC5_Gain ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x25 */ ++ err = ddTDA182I2Read(pObj, 0x25, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx25.bF.AGC5_Gain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRF_Filter_Bypass */ ++/* */ ++/* DESCRIPTION: Set the RF_Filter_Bypass bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRF_Filter_Bypass ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx2C.bF.RF_Filter_Bypass = uValue; ++ ++ /* Read byte 0x2C */ ++ err = ddTDA182I2Write(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRF_Filter_Bypass */ ++/* */ ++/* DESCRIPTION: Get the RF_Filter_Bypass bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRF_Filter_Bypass ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x2C */ ++ err = ddTDA182I2Read(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx2C.bF.RF_Filter_Bypass; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRF_Filter_Band */ ++/* */ ++/* DESCRIPTION: Set the RF_Filter_Band bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRF_Filter_Band ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx2C.bF.RF_Filter_Band = uValue; ++ ++ /* Read byte 0x2C */ ++ err = ddTDA182I2Write(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRF_Filter_Band */ ++/* */ ++/* DESCRIPTION: Get the RF_Filter_Band bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRF_Filter_Band ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x2C */ ++ err = ddTDA182I2Read(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx2C.bF.RF_Filter_Band; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRF_Filter_Cap */ ++/* */ ++/* DESCRIPTION: Set the RF_Filter_Cap bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRF_Filter_Cap ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx2D.bF.RF_Filter_Cap = uValue; ++ ++ /* Read byte 0x2D */ ++ err = ddTDA182I2Write(pObj, 0x2D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRF_Filter_Cap */ ++/* */ ++/* DESCRIPTION: Get the RF_Filter_Cap bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRF_Filter_Cap ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x2D */ ++ err = ddTDA182I2Read(pObj, 0x2D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx2D.bF.RF_Filter_Cap; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetGain_Taper */ ++/* */ ++/* DESCRIPTION: Set the Gain_Taper bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetGain_Taper ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx2E.bF.Gain_Taper = uValue; ++ ++ /* Read byte 0x2E */ ++ err = ddTDA182I2Write(pObj, 0x2E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetGain_Taper */ ++/* */ ++/* DESCRIPTION: Get the Gain_Taper bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetGain_Taper ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if( puValue == Null ) ++ { ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ } ++ ++ /* Get Instance Object */ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x2E */ ++ err = ddTDA182I2Read(pObj, 0x2E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx2E.bF.Gain_Taper; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetN_CP_Current */ ++/* */ ++/* DESCRIPTION: Set the N_CP_Current bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetN_CP_Current ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx30.bF.N_CP_Current = uValue; ++ ++ /* Read byte 0x30 */ ++ err = ddTDA182I2Write(pObj, 0x30, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetN_CP_Current */ ++/* */ ++/* DESCRIPTION: Get the N_CP_Current bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetN_CP_Current ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x30 */ ++ err = ddTDA182I2Read(pObj, 0x30, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx30.bF.N_CP_Current; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRSSI_Ck_Speed */ ++/* */ ++/* DESCRIPTION: Set the RSSI_Ck_Speed bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRSSI_Ck_Speed ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx36.bF.RSSI_Ck_Speed = uValue; ++ ++ /* Write byte 0x36 */ ++ err = ddTDA182I2Write(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRSSI_Ck_Speed */ ++/* */ ++/* DESCRIPTION: Get the RSSI_Ck_Speed bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRSSI_Ck_Speed ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x36 */ ++ err = ddTDA182I2Read(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx36.bF.RSSI_Ck_Speed; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetRFCAL_Phi2 */ ++/* */ ++/* DESCRIPTION: Set the RFCAL_Phi2 bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Phi2 ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Set value */ ++ pObj->I2CMap.uBx37.bF.RFCAL_Phi2 = uValue; ++ ++ /* Write byte 0x37 */ ++ err = ddTDA182I2Write(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetRFCAL_Phi2 */ ++/* */ ++/* DESCRIPTION: Get the RFCAL_Phi2 bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Phi2 ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x37 */ ++ err = ddTDA182I2Read(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx37.bF.RFCAL_Phi2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2WaitIRQ */ ++/* */ ++/* DESCRIPTION: Wait the IRQ to trigger */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2WaitIRQ ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep, /* I: wait step */ ++ UInt8 irqStatus /* I: IRQs to wait */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitIRQ(pObj, timeOut, waitStep, irqStatus); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2WaitXtalCal_End */ ++/* */ ++/* DESCRIPTION: Wait the MSM_XtalCal_End to trigger */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2WaitXtalCal_End ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep /* I: wait step */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitXtalCal_End(pObj, timeOut, waitStep); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitXtalCal_End(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2SetIRQWait */ ++/* */ ++/* DESCRIPTION: Set whether wait IRQ in driver or not */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2SetIRQWait ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool bWait /* I: Determine if we need to wait IRQ in driver functions */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ pObj->bIRQWait = bWait; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: tmddTDA182I2GetIRQWait */ ++/* */ ++/* DESCRIPTION: Get whether wait IRQ in driver or not */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2GetIRQWait ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool* pbWait /* O: Determine if we need to wait IRQ in driver functions */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (pbWait == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ *pbWait = pObj->bIRQWait; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2GetIRQ_status */ ++/* */ ++/* DESCRIPTION: Get IRQ status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2GetIRQ_status ++( ++ ptmddTDA182I2Object_t pObj, /* I: Instance object */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ /* Read byte 0x08 */ ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", pObj->tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx08.bF.IRQ_status; ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2GetMSM_XtalCal_End */ ++/* */ ++/* DESCRIPTION: Get MSM_XtalCal_End bit(s) status */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2GetMSM_XtalCal_End ++( ++ ptmddTDA182I2Object_t pObj, /* I: Instance object */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ /* Test the parameters */ ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Read byte 0x08 */ ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", pObj->tUnit)); ++ ++ if(err == TM_OK) ++ { ++ /* Get value */ ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_XtalCal_End; ++ } ++ } ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2WaitIRQ */ ++/* */ ++/* DESCRIPTION: Wait for IRQ to trigger */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2WaitIRQ ++( ++ ptmddTDA182I2Object_t pObj, /* I: Instance object */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep, /* I: wait step */ ++ UInt8 irqStatus /* I: IRQs to wait */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ UInt32 counter = timeOut/waitStep; /* Wait max timeOut/waitStep ms */ ++ UInt8 uIRQ = 0; ++ UInt8 uIRQStatus = 0; ++ Bool bIRQTriggered = False; ++ ++ while(err == TM_OK && (--counter)>0) ++ { ++ err = ddTDA182I2GetIRQ_status(pObj, &uIRQ); ++ ++ if(err == TM_OK && uIRQ == 1) ++ { ++ bIRQTriggered = True; ++ } ++ ++ if(bIRQTriggered) ++ { ++ /* IRQ triggered => Exit */ ++ break; ++ } ++ ++ if(err == TM_OK && irqStatus != 0x00) ++ { ++ uIRQStatus = ((pObj->I2CMap.uBx08.IRQ_status)&0x1F); ++ ++ if(irqStatus == uIRQStatus) ++ { ++ bIRQTriggered = True; ++ } ++ } ++ ++ err = ddTDA182I2Wait(pObj, waitStep); ++ } ++ ++ if(counter == 0) ++ { ++ err = ddTDA182I2_ERR_NOT_READY; ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2WaitXtalCal_End */ ++/* */ ++/* DESCRIPTION: Wait for MSM_XtalCal_End to trigger */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2WaitXtalCal_End ++( ++ ptmddTDA182I2Object_t pObj, /* I: Instance object */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep /* I: wait step */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ UInt32 counter = timeOut/waitStep; /* Wait max timeOut/waitStepms */ ++ UInt8 uMSM_XtalCal_End = 0; ++ ++ while(err == TM_OK && (--counter)>0) ++ { ++ err = ddTDA182I2GetMSM_XtalCal_End(pObj, &uMSM_XtalCal_End); ++ ++ if(uMSM_XtalCal_End == 1) ++ { ++ /* MSM_XtalCal_End triggered => Exit */ ++ break; ++ } ++ ++ ddTDA182I2Wait(pObj, waitStep); ++ } ++ ++ if(counter == 0) ++ { ++ err = ddTDA182I2_ERR_NOT_READY; ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2Write */ ++/* */ ++/* DESCRIPTION: Write in TDA182I2 hardware */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2Write ++( ++ ptmddTDA182I2Object_t pObj, /* I: Driver object */ ++ UInt8 uSubAddress, /* I: sub address */ ++ UInt8 uNbData /* I: nb of data */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ UInt8* pI2CMap = Null; ++ ++ /* pI2CMap initialization */ ++ pI2CMap = &(pObj->I2CMap.uBx00.ID_byte_1); ++ ++ err = POBJ_SRVFUNC_SIO.Write (pObj->tUnitW, 1, &uSubAddress, uNbData, &(pI2CMap[uSubAddress])); ++ ++ /* return value */ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2Read */ ++/* */ ++/* DESCRIPTION: Read in TDA182I2 hardware */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2Read ++( ++ ptmddTDA182I2Object_t pObj, /* I: Driver object */ ++ UInt8 uSubAddress, /* I: sub address */ ++ UInt8 uNbData /* I: nb of data */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ UInt8* pI2CMap = Null; ++ ++ /* pRegister initialization */ ++ pI2CMap = &(pObj->I2CMap.uBx00.ID_byte_1) + uSubAddress; ++ ++ /* Read data from the Tuner */ ++ err = POBJ_SRVFUNC_SIO.Read(pObj->tUnitW, 1, &uSubAddress, uNbData, pI2CMap); ++ ++ /* return value */ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2Wait */ ++/* */ ++/* DESCRIPTION: Wait for the requested time */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2Wait ++( ++ ptmddTDA182I2Object_t pObj, /* I: Driver object */ ++ UInt32 Time /* I: time to wait for */ ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ /* wait Time ms */ ++ err = POBJ_SRVFUNC_STIME.Wait (pObj->tUnit, Time); ++ ++ /* Return value */ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2MutexAcquire */ ++/* */ ++/* DESCRIPTION: Acquire driver mutex */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2MutexAcquire ++( ++ ptmddTDA182I2Object_t pObj, ++ UInt32 timeOut ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ if(pObj->sMutex.Acquire != Null && pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.Acquire(pObj->pMutex, timeOut); ++ } ++ ++ return err; ++} ++ ++/*============================================================================*/ ++/* FUNCTION: ddTDA182I2MutexRelease */ ++/* */ ++/* DESCRIPTION: Release driver mutex */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++ddTDA182I2MutexRelease ++( ++ ptmddTDA182I2Object_t pObj ++) ++{ ++ tmErrorCode_t err = TM_OK; ++ ++ if(pObj->sMutex.Release != Null && pObj->pMutex != Null) ++ { ++ err = pObj->sMutex.Release(pObj->pMutex); ++ } ++ ++ return err; ++} ++/*============================================================================*/ ++/* FUNCTION: tmTDA182I2AGC1_change */ ++/* */ ++/* DESCRIPTION: adapt AGC1_gain from latest call ( simulate AGC1 gain free ) */ ++/* */ ++/* RETURN: TM_OK if no error */ ++/* */ ++/* NOTES: */ ++/* */ ++/*============================================================================*/ ++tmErrorCode_t ++tmddTDA182I2AGC1_Adapt ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ UInt8 counter, vAGC1min, vAGC1_max_step; ++ Int16 TotUp , TotDo ; ++ UInt8 NbStepsDone = 0; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if (pObj->I2CMap.uBx0C.bF.AGC1_6_15dB == 0) ++ { ++ vAGC1min = 0; // -12 dB ++ vAGC1_max_step = 10; // -12 +15 dB ++ } ++ else ++ { ++ vAGC1min = 6; // 6 dB ++ vAGC1_max_step = 4; // 6 -> 15 dB ++ } ++ ++ while(err == TM_OK && NbStepsDone < vAGC1_max_step) // limit to min - max steps 10 ++ { ++ counter = 0; TotUp = 0; TotDo = 0; NbStepsDone = NbStepsDone + 1; ++ while(err == TM_OK && (counter++)<40) ++ { ++ err = ddTDA182I2Read(pObj, 0x31, 1); /* read UP , DO AGC1 */ ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ TotDo = TotDo + ( pObj->I2CMap.uBx31.bF.Do_AGC1 ? 14 : -1 ); ++ TotUp = TotUp + ( pObj->I2CMap.uBx31.bF.Up_AGC1 ? 1 : -4 ); ++ err = ddTDA182I2Wait(pObj, 1); ++ } ++ if ( TotUp >= 15 && pObj->I2CMap.uBx24.bF.AGC1_Gain != 9 ) ++ { ++ pObj->I2CMap.uBx24.bF.AGC1_Gain = pObj->I2CMap.uBx24.bF.AGC1_Gain + 1; ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ } ++ else if ( TotDo >= 10 && pObj->I2CMap.uBx24.bF.AGC1_Gain != vAGC1min ) ++ { ++ pObj->I2CMap.uBx24.bF.AGC1_Gain = pObj->I2CMap.uBx24.bF.AGC1_Gain - 1; ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ } ++ else ++ { ++ NbStepsDone = vAGC1_max_step; ++ } ++ } ++ return err; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\src\tmddTDA182I2Instance.c ++ ++ ++/*----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2008 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmddTDA182I2Instance.c ++// ++// DESCRIPTION: define the static Objects ++// ++// DOCUMENT REF: DVP Software Coding Guidelines v1.14 ++// DVP Board Support Library Architecture Specification v0.5 ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++ ++//#include "tmNxTypes.h" ++//#include "tmCompId.h" ++//#include "tmFrontEnd.h" ++//#include "tmUnitParams.h" ++//#include "tmbslFrontEndTypes.h" ++ ++//#include "tmddTDA182I2.h" ++//#include "tmddTDA182I2local.h" ++ ++//#include "tmddTDA182I2Instance.h" ++ ++/*----------------------------------------------------------------------------- ++// Global data: ++//----------------------------------------------------------------------------- ++// ++*/ ++ ++ ++/* default instance */ ++tmddTDA182I2Object_t gddTDA182I2Instance[] = ++{ ++ { ++ (tmUnitSelect_t)(-1), /* Unit not set */ ++ (tmUnitSelect_t)(-1), /* UnitW not set */ ++ Null, /* pMutex */ ++ False, /* init (instance initialization default) */ ++ { /* sRWFunc */ ++ Null, ++ Null ++ }, ++ { /* sTime */ ++ Null, ++ Null ++ }, ++ { /* sDebug */ ++ Null ++ }, ++ { /* sMutex */ ++ Null, ++ Null, ++ Null, ++ Null ++ }, ++ tmddTDA182I2_PowerStandbyWithXtalOn, /* curPowerState */ ++ True, /* bIRQWait */ ++ { ++ { 0 } // I2CMap; ++ } ++ }, ++ { ++ (tmUnitSelect_t)(-1), /* Unit not set */ ++ (tmUnitSelect_t)(-1), /* UnitW not set */ ++ Null, /* pMutex */ ++ False, /* init (instance initialization default) */ ++ { /* sRWFunc */ ++ Null, ++ Null ++ }, ++ { /* sTime */ ++ Null, ++ Null ++ }, ++ { /* sDebug */ ++ Null ++ }, ++ { /* sMutex */ ++ Null, ++ Null, ++ Null, ++ Null ++ }, ++ tmddTDA182I2_PowerStandbyWithXtalOn, /* curPowerState */ ++ True, /* bIRQWait */ ++ { ++ { 0 } // I2CMap; ++ } ++ } ++}; ++ ++/*----------------------------------------------------------------------------- ++// FUNCTION: ddTDA182I2AllocInstance: ++// ++// DESCRIPTION: allocate new instance ++// ++// RETURN: ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++tmErrorCode_t ++ddTDA182I2AllocInstance ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ pptmddTDA182I2Object_t ppDrvObject /* I: Device Object */ ++ ) ++{ ++ tmErrorCode_t err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ptmddTDA182I2Object_t pObj = Null; ++ UInt32 uLoopCounter = 0; ++ ++ /* Find a free instance */ ++ for(uLoopCounter = 0; uLoopCounterinit == False) ++ { ++ pObj->tUnit = tUnit; ++ pObj->tUnitW = tUnit; ++ ++ *ppDrvObject = pObj; ++ err = TM_OK; ++ break; ++ } ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++/*----------------------------------------------------------------------------- ++// FUNCTION: ddTDA182I2DeAllocInstance: ++// ++// DESCRIPTION: deallocate instance ++// ++// RETURN: always TM_OK ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++tmErrorCode_t ++ddTDA182I2DeAllocInstance ++( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ) ++{ ++ tmErrorCode_t err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ptmddTDA182I2Object_t pObj = Null; ++ ++ /* check input parameters */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ ++ /* check driver state */ ++ if (err == TM_OK) ++ { ++ if (pObj == Null || pObj->init == False) ++ { ++ err = ddTDA182I2_ERR_NOT_INITIALIZED; ++ } ++ } ++ ++ if ((err == TM_OK) && (pObj != Null)) ++ { ++ pObj->init = False; ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++/*----------------------------------------------------------------------------- ++// FUNCTION: ddTDA182I2GetInstance: ++// ++// DESCRIPTION: get the instance ++// ++// RETURN: always True ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++tmErrorCode_t ++ddTDA182I2GetInstance ++( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ pptmddTDA182I2Object_t ppDrvObject /* I: Device Object */ ++ ) ++{ ++ tmErrorCode_t err = ddTDA182I2_ERR_NOT_INITIALIZED; ++ ptmddTDA182I2Object_t pObj = Null; ++ UInt32 uLoopCounter = 0; ++ ++ /* get instance */ ++ for(uLoopCounter = 0; uLoopCounterinit == True && pObj->tUnit == GET_INDEX_TYPE_TUNIT(tUnit)) ++ { ++ pObj->tUnitW = tUnit; ++ ++ *ppDrvObject = pObj; ++ err = TM_OK; ++ break; ++ } ++ } ++ ++ /* return value */ ++ return err; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\src\tmddTDA182I2_Advanced.c ++ ++ ++/*----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2008 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of Philips Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of Philips ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than Philips Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmddTDA182I2_Alt.c ++// ++// DESCRIPTION: TDA182I2 standard APIs ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++ ++//#include "tmNxTypes.h" ++//#include "tmCompId.h" ++//#include "tmFrontEnd.h" ++//#include "tmbslFrontEndTypes.h" ++ ++//#include "tmddTDA182I2.h" ++//#include "tmddTDA182I2local.h" ++ ++//#include "tmddTDA182I2Instance.h" ++ ++/*----------------------------------------------------------------------------- ++// Project include files: ++//----------------------------------------------------------------------------- ++*/ ++ ++/*----------------------------------------------------------------------------- ++// Types and defines: ++//----------------------------------------------------------------------------- ++*/ ++ ++/*----------------------------------------------------------------------------- ++// Global data: ++//----------------------------------------------------------------------------- ++*/ ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetTM_D: ++// ++// DESCRIPTION: Get the TM_D bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetTM_D ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // switch thermometer on ++ pObj->I2CMap.uBx04.bF.TM_ON = 1; ++ ++ // write byte 0x04 ++ err = ddTDA182I2Write(pObj, 0x04, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x03 ++ err = ddTDA182I2Read(pObj, 0x03, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx03.bF.TM_D; ++ ++ // switch thermometer off ++ pObj->I2CMap.uBx04.bF.TM_ON = 0; ++ ++ // write byte 0x04 ++ err = ddTDA182I2Write(pObj, 0x04, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetTM_ON: ++// ++// DESCRIPTION: Set the TM_ON bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetTM_ON ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx04.bF.TM_ON = uValue; ++ ++ // write byte 0x04 ++ err = ddTDA182I2Write(pObj, 0x04, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetTM_ON: ++// ++// DESCRIPTION: Get the TM_ON bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetTM_ON ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x04 ++ err = ddTDA182I2Read(pObj, 0x04, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx04.bF.TM_ON; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPOR: ++// ++// DESCRIPTION: Get the POR bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPOR ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x05 ++ err = ddTDA182I2Read(pObj, 0x05, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx05.bF.POR ; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RSSI_End: ++// ++// DESCRIPTION: Get the MSM_RSSI_End bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RSSI_End ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x08 ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_RSSI_End; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_LOCalc_End: ++// ++// DESCRIPTION: Get the MSM_LOCalc_End bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_LOCalc_End ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x08 ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_LOCalc_End; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RFCal_End: ++// ++// DESCRIPTION: Get the MSM_RFCal_End bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RFCal_End ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x08 ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_RFCal_End; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_IRCAL_End: ++// ++// DESCRIPTION: Get the MSM_IRCAL_End bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_IRCAL_End ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x08 ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_IRCAL_End; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RCCal_End: ++// ++// DESCRIPTION: Get the MSM_RCCal_End bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RCCal_End ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x08 ++ err = ddTDA182I2Read(pObj, 0x08, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx08.bF.MSM_RCCal_End; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIRQ_Enable: ++// ++// DESCRIPTION: Set the IRQ_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIRQ_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.IRQ_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIRQ_Enable: ++// ++// DESCRIPTION: Get the IRQ_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIRQ_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.IRQ_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXtalCal_Enable: ++// ++// DESCRIPTION: Set the XtalCal_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXtalCal_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.XtalCal_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXtalCal_Enable: ++// ++// DESCRIPTION: Get the XtalCal_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXtalCal_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.XtalCal_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RSSI_Enable: ++// ++// DESCRIPTION: Set the MSM_RSSI_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RSSI_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.MSM_RSSI_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RSSI_Enable: ++// ++// DESCRIPTION: Get the MSM_RSSI_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RSSI_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.MSM_RSSI_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_LOCalc_Enable: ++// ++// DESCRIPTION: Set the MSM_LOCalc_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_LOCalc_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.MSM_LOCalc_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_LOCalc_Enable: ++// ++// DESCRIPTION: Get the MSM_LOCalc_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_LOCalc_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.MSM_LOCalc_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RFCAL_Enable: ++// ++// DESCRIPTION: Set the MSM_RFCAL_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RFCAL_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.MSM_RFCAL_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RFCAL_Enable: ++// ++// DESCRIPTION: Get the MSM_RFCAL_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RFCAL_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.MSM_RFCAL_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_IRCAL_Enable: ++// ++// DESCRIPTION: Set the MSM_IRCAL_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_IRCAL_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.MSM_IRCAL_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_IRCAL_Enable: ++// ++// DESCRIPTION: Get the MSM_IRCAL_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_IRCAL_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.MSM_IRCAL_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RCCal_Enable: ++// ++// DESCRIPTION: Set the MSM_RCCal_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RCCal_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx09.bF.MSM_RCCal_Enable = uValue; ++ ++ // write byte 0x09 ++ err = ddTDA182I2Write(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RCCal_Enable: ++// ++// DESCRIPTION: Get the MSM_RCCal_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RCCal_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x09 ++ err = ddTDA182I2Read(pObj, 0x09, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx09.bF.MSM_RCCal_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXtalCal_Clear: ++// ++// DESCRIPTION: Set the XtalCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXtalCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.XtalCal_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXtalCal_Clear: ++// ++// DESCRIPTION: Get the XtalCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXtalCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.XtalCal_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RSSI_Clear: ++// ++// DESCRIPTION: Set the MSM_RSSI_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RSSI_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.MSM_RSSI_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RSSI_Clear: ++// ++// DESCRIPTION: Get the MSM_RSSI_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RSSI_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.MSM_RSSI_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_LOCalc_Clear: ++// ++// DESCRIPTION: Set the MSM_LOCalc_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_LOCalc_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.MSM_LOCalc_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_LOCalc_Clear: ++// ++// DESCRIPTION: Get the MSM_LOCalc_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_LOCalc_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.MSM_LOCalc_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RFCal_Clear: ++// ++// DESCRIPTION: Set the MSM_RFCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RFCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.MSM_RFCal_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RFCal_Clear: ++// ++// DESCRIPTION: Get the MSM_RFCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RFCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.MSM_RFCal_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_IRCAL_Clear: ++// ++// DESCRIPTION: Set the MSM_IRCAL_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_IRCAL_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.MSM_IRCAL_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_IRCAL_Clear: ++// ++// DESCRIPTION: Get the MSM_IRCAL_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_IRCAL_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.MSM_IRCAL_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RCCal_Clear: ++// ++// DESCRIPTION: Set the MSM_RCCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RCCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0A.bF.MSM_RCCal_Clear = uValue; ++ ++ // write byte 0x0A ++ err = ddTDA182I2Write(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RCCal_Clear: ++// ++// DESCRIPTION: Get the MSM_RCCal_Clear bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RCCal_Clear ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0A ++ err = ddTDA182I2Read(pObj, 0x0A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0A.bF.MSM_RCCal_Clear; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIRQ_Set: ++// ++// DESCRIPTION: Set the IRQ_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIRQ_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.IRQ_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIRQ_Set: ++// ++// DESCRIPTION: Get the IRQ_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIRQ_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.IRQ_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXtalCal_Set: ++// ++// DESCRIPTION: Set the XtalCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXtalCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.XtalCal_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXtalCal_Set: ++// ++// DESCRIPTION: Get the XtalCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXtalCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.XtalCal_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RSSI_Set: ++// ++// DESCRIPTION: Set the MSM_RSSI_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RSSI_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.MSM_RSSI_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RSSI_Set: ++// ++// DESCRIPTION: Get the MSM_RSSI_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RSSI_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.MSM_RSSI_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_LOCalc_Set: ++// ++// DESCRIPTION: Set the MSM_LOCalc_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_LOCalc_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.MSM_LOCalc_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_LOCalc_Set: ++// ++// DESCRIPTION: Get the MSM_LOCalc_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_LOCalc_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.MSM_LOCalc_Set; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RFCal_Set: ++// ++// DESCRIPTION: Set the MSM_RFCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RFCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.MSM_RFCal_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RFCal_Set: ++// ++// DESCRIPTION: Get the MSM_RFCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RFCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.MSM_RFCal_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_IRCAL_Set: ++// ++// DESCRIPTION: Set the MSM_IRCAL_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_IRCAL_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.MSM_IRCAL_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_IRCAL_Set: ++// ++// DESCRIPTION: Get the MSM_IRCAL_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_IRCAL_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.MSM_IRCAL_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetMSM_RCCal_Set: ++// ++// DESCRIPTION: Set the MSM_RCCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetMSM_RCCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0B.bF.MSM_RCCal_Set = uValue; ++ ++ // write byte 0x0B ++ err = ddTDA182I2Write(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetMSM_RCCal_Set: ++// ++// DESCRIPTION: Get the MSM_RCCal_Set bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetMSM_RCCal_Set ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0B ++ err = ddTDA182I2Read(pObj, 0x0B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0B.bF.MSM_RCCal_Set; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetLT_Enable: ++// ++// DESCRIPTION: Set the LT_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetLT_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0C.bF.LT_Enable = uValue; ++ ++ // write byte 0x0C ++ err = ddTDA182I2Write(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetLT_Enable: ++// ++// DESCRIPTION: Get the LT_Enable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetLT_Enable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0C ++ err = ddTDA182I2Read(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0C.bF.LT_Enable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC1_6_15dB: ++// ++// DESCRIPTION: Set the AGC1_6_15dB bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC1_6_15dB ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0C.bF.AGC1_6_15dB = uValue; ++ ++ // write byte 0x0C ++ err = ddTDA182I2Write(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC1_6_15dB: ++// ++// DESCRIPTION: Get the AGC1_6_15dB bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC1_6_15dB ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0C ++ err = ddTDA182I2Read(pObj, 0x0C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0C.bF.AGC1_6_15dB; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGCs_Up_Step_assym: ++// ++// DESCRIPTION: Set the AGCs_Up_Step_assym bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGCs_Up_Step_assym ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0E.bF.AGCs_Up_Step_assym = uValue; ++ ++ // write byte 0x0E ++ err = ddTDA182I2Write(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGCs_Up_Step_assym: ++// ++// DESCRIPTION: Get the AGCs_Up_Step_assym bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGCs_Up_Step_assym ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0E ++ err = ddTDA182I2Read(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0E.bF.AGCs_Up_Step_assym; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPulse_Shaper_Disable: ++// ++// DESCRIPTION: Set the Pulse_Shaper_Disable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPulse_Shaper_Disable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0E.bF.Pulse_Shaper_Disable = uValue; ++ ++ // write byte 0x0E ++ err = ddTDA182I2Write(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPulse_Shaper_Disable: ++// ++// DESCRIPTION: Get the Pulse_Shaper_Disable bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPulse_Shaper_Disable ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0E ++ err = ddTDA182I2Read(pObj, 0x0E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0E.bF.Pulse_Shaper_Disable; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFAGC_Low_BW: ++// ++// DESCRIPTION: Set the RFAGC_Low_BW bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFAGC_Low_BW ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx0F.bF.RFAGC_Low_BW = uValue; ++ ++ // write byte 0x0F ++ err = ddTDA182I2Write(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFAGC_Low_BW: ++// ++// DESCRIPTION: Get the RFAGC_Low_BW bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFAGC_Low_BW ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x0F ++ err = ddTDA182I2Read(pObj, 0x0F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx0F.bF.RFAGC_Low_BW; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGCs_Do_Step_assym: ++// ++// DESCRIPTION: Set the AGCs_Do_Step_assym bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGCs_Do_Step_assym ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx11.bF.AGCs_Do_Step_assym = uValue; ++ ++ // write byte 0x11 ++ err = ddTDA182I2Write(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGCs_Do_Step_assym: ++// ++// DESCRIPTION: Get the AGCs_Do_Step_assym bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGCs_Do_Step_assym ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x11 ++ err = ddTDA182I2Read(pObj, 0x11, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx11.bF.AGCs_Do_Step_assym; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetI2C_Clock_Mode: ++// ++// DESCRIPTION: Set the I2C_Clock_Mode bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetI2C_Clock_Mode ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx14.bF.I2C_Clock_Mode = uValue; ++ ++ // write byte 0x14 ++ err = ddTDA182I2Write(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetI2C_Clock_Mode: ++// ++// DESCRIPTION: Get the I2C_Clock_Mode bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetI2C_Clock_Mode ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x14 ++ err = ddTDA182I2Read(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx14.bF.I2C_Clock_Mode; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXtalOsc_AnaReg_En: ++// ++// DESCRIPTION: Set the XtalOsc_AnaReg_En bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXtalOsc_AnaReg_En ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx14.bF.XtalOsc_AnaReg_En = uValue; ++ ++ // write byte 0x14 ++ err = ddTDA182I2Write(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXtalOsc_AnaReg_En: ++// ++// DESCRIPTION: Get the XtalOsc_AnaReg_En bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXtalOsc_AnaReg_En ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x14 ++ err = ddTDA182I2Read(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx14.bF.XtalOsc_AnaReg_En; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXTout: ++// ++// DESCRIPTION: Set the XTout bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXTout ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx14.bF.XTout = uValue; ++ ++ // write byte 0x14 ++ err = ddTDA182I2Write(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXTout: ++// ++// DESCRIPTION: Get the XTout bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXTout ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x14 ++ err = ddTDA182I2Read(pObj, 0x14, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx14.bF.XTout; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI_Meas: ++// ++// DESCRIPTION: Set the RSSI_Meas bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI_Meas ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.RSSI_Meas = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI_Meas: ++// ++// DESCRIPTION: Get the RSSI_Meas bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI_Meas ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.RSSI_Meas; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRF_CAL_AV: ++// ++// DESCRIPTION: Set the RF_CAL_AV bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRF_CAL_AV ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.RF_CAL_AV = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRF_CAL_AV: ++// ++// DESCRIPTION: Get the RF_CAL_AV bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRF_CAL_AV ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.RF_CAL_AV; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRF_CAL: ++// ++// DESCRIPTION: Set the RF_CAL bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRF_CAL ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.RF_CAL = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRF_CAL: ++// ++// DESCRIPTION: Get the RF_CAL bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRF_CAL ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.RF_CAL; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_CAL_Loop: ++// ++// DESCRIPTION: Set the IR_CAL_Loop bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_CAL_Loop ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.IR_CAL_Loop = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_CAL_Loop: ++// ++// DESCRIPTION: Get the IR_CAL_Loop bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_CAL_Loop ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.IR_CAL_Loop; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_Cal_Image: ++// ++// DESCRIPTION: Set the IR_Cal_Image bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_Cal_Image ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.IR_Cal_Image = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_Cal_Image: ++// ++// DESCRIPTION: Get the IR_Cal_Image bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_Cal_Image ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.IR_Cal_Image; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_CAL_Wanted: ++// ++// DESCRIPTION: Set the IR_CAL_Wanted bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_CAL_Wanted ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.IR_CAL_Wanted = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_CAL_Wanted: ++// ++// DESCRIPTION: Get the IR_CAL_Wanted bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_CAL_Wanted ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.IR_CAL_Wanted; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRC_Cal: ++// ++// DESCRIPTION: Set the RC_Cal bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRC_Cal ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.RC_Cal = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRC_Cal: ++// ++// DESCRIPTION: Get the RC_Cal bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRC_Cal ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.RC_Cal; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetCalc_PLL: ++// ++// DESCRIPTION: Set the Calc_PLL bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetCalc_PLL ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx19.bF.Calc_PLL = uValue; ++ ++ // read byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetCalc_PLL: ++// ++// DESCRIPTION: Get the Calc_PLL bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetCalc_PLL ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x19 ++ err = ddTDA182I2Read(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx19.bF.Calc_PLL; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetXtalCal_Launch: ++// ++// DESCRIPTION: Set the XtalCal_Launch bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetXtalCal_Launch ++( ++ tmUnitSelect_t tUnit // I: Unit number ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1A.bF.XtalCal_Launch = 1; ++ ++ // write byte 0x1A ++ err = ddTDA182I2Write(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ // reset XtalCal_Launch (buffer only, no write) ++ pObj->I2CMap.uBx1A.bF.XtalCal_Launch = 0; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetXtalCal_Launch: ++// ++// DESCRIPTION: Get the XtalCal_Launch bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetXtalCal_Launch ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1A ++ err = ddTDA182I2Read(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1A.bF.XtalCal_Launch; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPSM_AGC1: ++// ++// DESCRIPTION: Set the PSM_AGC1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPSM_AGC1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1B.bF.PSM_AGC1 = uValue; ++ ++ // read byte 0x1B ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPSM_AGC1: ++// ++// DESCRIPTION: Get the PSM_AGC1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPSM_AGC1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1B ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1B.bF.PSM_AGC1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPSMRFpoly: ++// ++// DESCRIPTION: Set the PSMRFpoly bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPSMRFpoly ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1B.bF.PSMRFpoly = uValue; ++ ++ // read byte 0x1B ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPSMRFpoly: ++// ++// DESCRIPTION: Get the PSMRFpoly bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPSMRFpoly ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1B ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ // get value ++ *puValue = pObj->I2CMap.uBx1B.bF.PSMRFpoly; ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPSM_Mixer: ++// ++// DESCRIPTION: Set the PSM_Mixer bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPSM_Mixer ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1B.bF.PSM_Mixer = uValue; ++ ++ // read byte 0x1B ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPSM_Mixer: ++// ++// DESCRIPTION: Get the PSM_Mixer bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPSM_Mixer ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1B ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1B.bF.PSM_Mixer; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPSM_Ifpoly: ++// ++// DESCRIPTION: Set the PSM_Ifpoly bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPSM_Ifpoly ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1B.bF.PSM_Ifpoly = uValue; ++ ++ // read byte 0x1B ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPSM_Ifpoly: ++// ++// DESCRIPTION: Get the PSM_Ifpoly bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPSM_Ifpoly ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1B ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1B.bF.PSM_Ifpoly; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPSM_Lodriver: ++// ++// DESCRIPTION: Set the PSM_Lodriver bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPSM_Lodriver ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1B.bF.PSM_Lodriver = uValue; ++ ++ // read byte 0x1B ++ err = ddTDA182I2Write(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPSM_Lodriver: ++// ++// DESCRIPTION: Get the PSM_Lodriver bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPSM_Lodriver ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1B ++ err = ddTDA182I2Read(pObj, 0x1B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1B.bF.PSM_Lodriver; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetDCC_Bypass: ++// ++// DESCRIPTION: Set the DCC_Bypass bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetDCC_Bypass ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1C.bF.DCC_Bypass = uValue; ++ ++ // read byte 0x1C ++ err = ddTDA182I2Write(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDCC_Bypass: ++// ++// DESCRIPTION: Get the DCC_Bypass bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDCC_Bypass ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1C ++ err = ddTDA182I2Read(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1C.bF.DCC_Bypass; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetDCC_Slow: ++// ++// DESCRIPTION: Set the DCC_Slow bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetDCC_Slow ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1C.bF.DCC_Slow = uValue; ++ ++ // read byte 0x1C ++ err = ddTDA182I2Write(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDCC_Slow: ++// ++// DESCRIPTION: Get the DCC_Slow bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDCC_Slow ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1C ++ err = ddTDA182I2Read(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1C.bF.DCC_Slow; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetDCC_psm: ++// ++// DESCRIPTION: Set the DCC_psm bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetDCC_psm ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1C.bF.DCC_psm = uValue; ++ ++ // read byte 0x1C ++ err = ddTDA182I2Write(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDCC_psm: ++// ++// DESCRIPTION: Get the DCC_psm bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDCC_psm ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1C ++ err = ddTDA182I2Read(pObj, 0x1C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1C.bF.DCC_psm; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_GStep: ++// ++// DESCRIPTION: Set the IR_GStep bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_GStep ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1E.bF.IR_GStep = uValue - 40; ++ ++ // read byte 0x1E ++ err = ddTDA182I2Write(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_GStep: ++// ++// DESCRIPTION: Get the IR_GStep bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_GStep ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1E ++ err = ddTDA182I2Read(pObj, 0x1E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1E.bF.IR_GStep + 40; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_FreqLow_Sel: ++// ++// DESCRIPTION: Set the IR_FreqLow_Sel bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_FreqLow_Sel ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1F.bF.IR_FreqLow_Sel = uValue; ++ ++ // read byte 0x1F ++ err = ddTDA182I2Write(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_FreqLow_Sel: ++// ++// DESCRIPTION: Get the IR_FreqLow_Sel bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_FreqLow_Sel ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1F ++ err = ddTDA182I2Read(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1F.bF.IR_FreqLow_Sel; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_FreqLow: ++// ++// DESCRIPTION: Set the IR_FreqLow bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_FreqLow ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx1F.bF.IR_FreqLow = uValue; ++ ++ // read byte 0x1F ++ err = ddTDA182I2Write(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_FreqLow: ++// ++// DESCRIPTION: Get the IR_FreqLow bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_FreqLow ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x1F ++ err = ddTDA182I2Read(pObj, 0x1F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx1F.bF.IR_FreqLow; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_FreqMid: ++// ++// DESCRIPTION: Set the IR_FreqMid bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_FreqMid ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx20.bF.IR_FreqMid = uValue; ++ ++ // read byte 0x20 ++ err = ddTDA182I2Write(pObj, 0x20, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_FreqMid: ++// ++// DESCRIPTION: Get the IR_FreqMid bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_FreqMid ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x20 ++ err = ddTDA182I2Read(pObj, 0x20, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx20.bF.IR_FreqMid; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetCoarse_IR_FreqHigh: ++// ++// DESCRIPTION: Set the Coarse_IR_FreqHigh bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetCoarse_IR_FreqHigh ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx21.bF.Coarse_IR_FreqHigh = uValue; ++ ++ // write byte 0x21 ++ err = ddTDA182I2Write(pObj, 0x21, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetCoarse_IR_FreqHigh: ++// ++// DESCRIPTION: Get the Coarse_IR_FreqHigh bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetCoarse_IR_FreqHigh ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x21 ++ err = ddTDA182I2Read(pObj, 0x21, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx21.bF.Coarse_IR_FreqHigh; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_FreqHigh: ++// ++// DESCRIPTION: Set the IR_FreqHigh bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_FreqHigh ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx21.bF.IR_FreqHigh = uValue; ++ ++ // read byte 0x21 ++ err = ddTDA182I2Write(pObj, 0x21, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_FreqHigh: ++// ++// DESCRIPTION: Get the IR_FreqHigh bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_FreqHigh ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x21 ++ err = ddTDA182I2Read(pObj, 0x21, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx21.bF.IR_FreqHigh; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPD_Vsync_Mgt: ++// ++// DESCRIPTION: Set the PD_Vsync_Mgt bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPD_Vsync_Mgt ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx22.bF.PD_Vsync_Mgt = uValue; ++ ++ // write byte 0x22 ++ err = ddTDA182I2Write(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPD_Vsync_Mgt: ++// ++// DESCRIPTION: Get the PD_Vsync_Mgt bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPD_Vsync_Mgt ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x22 ++ err = ddTDA182I2Read(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx22.bF.PD_Vsync_Mgt; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetPD_Ovld: ++// ++// DESCRIPTION: Set the PD_Ovld bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetPD_Ovld ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx22.bF.PD_Ovld = uValue; ++ ++ // write byte 0x22 ++ err = ddTDA182I2Write(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetPD_Ovld: ++// ++// DESCRIPTION: Get the PD_Ovld bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetPD_Ovld ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x22 ++ err = ddTDA182I2Read(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx22.bF.PD_Ovld; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC_Ovld_Timer: ++// ++// DESCRIPTION: Set the AGC_Ovld_Timer bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC_Ovld_Timer ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx22.bF.AGC_Ovld_Timer = uValue; ++ ++ // write byte 0x22 ++ err = ddTDA182I2Write(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC_Ovld_Timer: ++// ++// DESCRIPTION: Get the AGC_Ovld_Timer bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC_Ovld_Timer ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x22 ++ err = ddTDA182I2Read(pObj, 0x22, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx22.bF.AGC_Ovld_Timer; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_Mixer_loop_off: ++// ++// DESCRIPTION: Set the IR_Mixer_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_Mixer_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx23.bF.IR_Mixer_loop_off = uValue; ++ ++ // read byte 0x23 ++ err = ddTDA182I2Write(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_Mixer_loop_off: ++// ++// DESCRIPTION: Get the IR_Mixer_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_Mixer_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x23 ++ err = ddTDA182I2Read(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx23.bF.IR_Mixer_loop_off; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIR_Mixer_Do_step: ++// ++// DESCRIPTION: Set the IR_Mixer_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIR_Mixer_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx23.bF.IR_Mixer_Do_step = uValue; ++ ++ // read byte 0x23 ++ err = ddTDA182I2Write(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIR_Mixer_Do_step: ++// ++// DESCRIPTION: Get the IR_Mixer_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIR_Mixer_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x23 ++ err = ddTDA182I2Read(pObj, 0x23, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx23.bF.IR_Mixer_Do_step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC1_loop_off: ++// ++// DESCRIPTION: Set the AGC1_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC1_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx24.bF.AGC1_loop_off = uValue; ++ ++ // read byte 0x24 ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC1_loop_off: ++// ++// DESCRIPTION: Get the AGC1_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC1_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x24 ++ err = ddTDA182I2Read(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx24.bF.AGC1_loop_off; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC1_Do_step: ++// ++// DESCRIPTION: Set the AGC1_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC1_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx24.bF.AGC1_Do_step = uValue; ++ ++ // read byte 0x24 ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC1_Do_step: ++// ++// DESCRIPTION: Get the AGC1_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC1_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x24 ++ err = ddTDA182I2Read(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx24.bF.AGC1_Do_step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetForce_AGC1_gain: ++// ++// DESCRIPTION: Set the Force_AGC1_gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetForce_AGC1_gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx24.bF.Force_AGC1_gain = uValue; ++ ++ // read byte 0x24 ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetForce_AGC1_gain: ++// ++// DESCRIPTION: Get the Force_AGC1_gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetForce_AGC1_gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x24 ++ err = ddTDA182I2Read(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx24.bF.Force_AGC1_gain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC1_Gain: ++// ++// DESCRIPTION: Set the AGC1_Gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC1_Gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx24.bF.AGC1_Gain = uValue; ++ ++ // read byte 0x24 ++ err = ddTDA182I2Write(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC1_Gain: ++// ++// DESCRIPTION: Get the AGC1_Gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC1_Gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x24 ++ err = ddTDA182I2Read(pObj, 0x24, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx24.bF.AGC1_Gain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq0: ++// ++// DESCRIPTION: Set the RFCAL_Freq0 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq0 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx26.bF.RFCAL_Freq0 = uValue; ++ ++ // read byte 0x26 ++ err = ddTDA182I2Write(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq0: ++// ++// DESCRIPTION: Get the RFCAL_Freq0 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq0 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x26 ++ err = ddTDA182I2Read(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx26.bF.RFCAL_Freq0; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq1: ++// ++// DESCRIPTION: Set the RFCAL_Freq1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx26.bF.RFCAL_Freq1 = uValue; ++ ++ // read byte 0x26 ++ err = ddTDA182I2Write(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq1: ++// ++// DESCRIPTION: Get the RFCAL_Freq1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x26 ++ err = ddTDA182I2Read(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx26.bF.RFCAL_Freq1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq2: ++// ++// DESCRIPTION: Set the RFCAL_Freq2 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx27.bF.RFCAL_Freq2 = uValue; ++ ++ // read byte 0x27 ++ err = ddTDA182I2Write(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq2: ++// ++// DESCRIPTION: Get the RFCAL_Freq2 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x27 ++ err = ddTDA182I2Read(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx27.bF.RFCAL_Freq2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq3: ++// ++// DESCRIPTION: Set the RFCAL_Freq3 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq3 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx27.bF.RFCAL_Freq3 = uValue; ++ ++ // read byte 0x27 ++ err = ddTDA182I2Write(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq3: ++// ++// DESCRIPTION: Get the RFCAL_Freq3 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq3 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x27 ++ err = ddTDA182I2Read(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx27.bF.RFCAL_Freq3; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq4: ++// ++// DESCRIPTION: Set the RFCAL_Freq4 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx28.bF.RFCAL_Freq4 = uValue; ++ ++ // read byte 0x28 ++ err = ddTDA182I2Write(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq4: ++// ++// DESCRIPTION: Get the RFCAL_Freq4 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x28 ++ err = ddTDA182I2Read(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx28.bF.RFCAL_Freq4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq5: ++// ++// DESCRIPTION: Set the RFCAL_Freq5 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx28.bF.RFCAL_Freq5 = uValue; ++ ++ // read byte 0x28 ++ err = ddTDA182I2Write(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq5: ++// ++// DESCRIPTION: Get the RFCAL_Freq5 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x28 ++ err = ddTDA182I2Read(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx28.bF.RFCAL_Freq5; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq6: ++// ++// DESCRIPTION: Set the RFCAL_Freq6 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq6 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx29.bF.RFCAL_Freq6 = uValue; ++ ++ // read byte 0x29 ++ err = ddTDA182I2Write(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq6: ++// ++// DESCRIPTION: Get the RFCAL_Freq6 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq6 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x29 ++ err = ddTDA182I2Read(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx29.bF.RFCAL_Freq6; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq7: ++// ++// DESCRIPTION: Set the RFCAL_Freq7 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq7 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx29.bF.RFCAL_Freq7 = uValue; ++ ++ // read byte 0x29 ++ err = ddTDA182I2Write(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq7: ++// ++// DESCRIPTION: Get the RFCAL_Freq7 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq7 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x29 ++ err = ddTDA182I2Read(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx29.bF.RFCAL_Freq7; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq8: ++// ++// DESCRIPTION: Set the RFCAL_Freq8 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq8 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2A.bF.RFCAL_Freq8 = uValue; ++ ++ // read byte 0x2A ++ err = ddTDA182I2Write(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq8: ++// ++// DESCRIPTION: Get the RFCAL_Freq8 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq8 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2A ++ err = ddTDA182I2Read(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2A.bF.RFCAL_Freq8; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq9: ++// ++// DESCRIPTION: Set the RFCAL_Freq9 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq9 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2A.bF.RFCAL_Freq9 = uValue; ++ ++ // read byte 0x2A ++ err = ddTDA182I2Write(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq9: ++// ++// DESCRIPTION: Get the RFCAL_Freq9 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq9 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2A ++ err = ddTDA182I2Read(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2A.bF.RFCAL_Freq9; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq10: ++// ++// DESCRIPTION: Set the RFCAL_Freq10 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq10 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2B.bF.RFCAL_Freq10 = uValue; ++ ++ // read byte 0x2B ++ err = ddTDA182I2Write(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq10: ++// ++// DESCRIPTION: Get the ? bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq10 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2B ++ err = ddTDA182I2Read(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2B.bF.RFCAL_Freq10; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Freq11: ++// ++// DESCRIPTION: Set the RFCAL_Freq11 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Freq11 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2B.bF.RFCAL_Freq11 = uValue; ++ ++ // read byte 0x2B ++ err = ddTDA182I2Write(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Freq11: ++// ++// DESCRIPTION: Get the RFCAL_Freq11 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Freq11 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2B ++ err = ddTDA182I2Read(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2B.bF.RFCAL_Freq11; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset0: ++// ++// DESCRIPTION: Set the RFCAL_Offset0 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset0 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx26.bF.RFCAL_Offset_Cprog0 = uValue; ++ ++ // read byte 0x26 ++ err = ddTDA182I2Write(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset0: ++// ++// DESCRIPTION: Get the RFCAL_Offset0 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset0 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x26 ++ err = ddTDA182I2Read(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx26.bF.RFCAL_Offset_Cprog0; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset1: ++// ++// DESCRIPTION: Set the RFCAL_Offset1 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx26.bF.RFCAL_Offset_Cprog1 = uValue; ++ ++ // read byte 0x26 ++ err = ddTDA182I2Write(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset1: ++// ++// DESCRIPTION: Get the RFCAL_Offset1 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ ++ // read byte 0x26 ++ err = ddTDA182I2Read(pObj, 0x26, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx26.bF.RFCAL_Offset_Cprog1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset2: ++// ++// DESCRIPTION: Set the RFCAL_Offset2 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx27.bF.RFCAL_Offset_Cprog2 = uValue; ++ ++ // read byte 0x27 ++ err = ddTDA182I2Write(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset2: ++// ++// DESCRIPTION: Get the RFCAL_Offset2 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x27 ++ err = ddTDA182I2Read(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx27.bF.RFCAL_Offset_Cprog2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset3: ++// ++// DESCRIPTION: Set the RFCAL_Offset3 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset3 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx27.bF.RFCAL_Offset_Cprog3 = uValue; ++ ++ // read byte 0x27 ++ err = ddTDA182I2Write(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset3: ++// ++// DESCRIPTION: Get the RFCAL_Offset3 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset3 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x27 ++ err = ddTDA182I2Read(pObj, 0x27, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx27.bF.RFCAL_Offset_Cprog3; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset4: ++// ++// DESCRIPTION: Set the RFCAL_Offset4 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx28.bF.RFCAL_Offset_Cprog4 = uValue; ++ ++ // read byte 0x28 ++ err = ddTDA182I2Write(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset4: ++// ++// DESCRIPTION: Get the RFCAL_Offset4 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x28 ++ err = ddTDA182I2Read(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx28.bF.RFCAL_Offset_Cprog4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset5: ++// ++// DESCRIPTION: Set the RFCAL_Offset5 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx28.bF.RFCAL_Offset_Cprog5 = uValue; ++ ++ // read byte 0x28 ++ err = ddTDA182I2Write(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset5: ++// ++// DESCRIPTION: Get the RFCAL_Offset5 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x28 ++ err = ddTDA182I2Read(pObj, 0x28, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx28.bF.RFCAL_Offset_Cprog5; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset6: ++// ++// DESCRIPTION: Set the RFCAL_Offset6 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset6 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx29.bF.RFCAL_Offset_Cprog6 = uValue; ++ ++ // read byte 0x29 ++ err = ddTDA182I2Write(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset6: ++// ++// DESCRIPTION: Get the RFCAL_Offset6 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset6 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x29 ++ err = ddTDA182I2Read(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx29.bF.RFCAL_Offset_Cprog6; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset7: ++// ++// DESCRIPTION: Set the RFCAL_Offset7 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset7 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx29.bF.RFCAL_Offset_Cprog7 = uValue; ++ ++ // read byte 0x29 ++ err = ddTDA182I2Write(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset7: ++// ++// DESCRIPTION: Get the RFCAL_Offset7 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset7 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x29 ++ err = ddTDA182I2Read(pObj, 0x29, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx29.bF.RFCAL_Offset_Cprog7; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset8: ++// ++// DESCRIPTION: Set the RFCAL_Offset8 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset8 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2A.bF.RFCAL_Offset_Cprog8 = uValue; ++ ++ // read byte 0x2A ++ err = ddTDA182I2Write(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset8: ++// ++// DESCRIPTION: Get the RFCAL_Offset8 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset8 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2A ++ err = ddTDA182I2Read(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2A.bF.RFCAL_Offset_Cprog8; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset9: ++// ++// DESCRIPTION: Set the RFCAL_Offset9 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset9 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2A.bF.RFCAL_Offset_Cprog9 = uValue; ++ ++ // read byte 0x2A ++ err = ddTDA182I2Write(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset9: ++// ++// DESCRIPTION: Get the RFCAL_Offset9 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset9 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2A ++ err = ddTDA182I2Read(pObj, 0x2A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2A.bF.RFCAL_Offset_Cprog9; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset10: ++// ++// DESCRIPTION: Set the RFCAL_Offset10 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset10 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2B.bF.RFCAL_Offset_Cprog10 = uValue; ++ ++ // read byte 0x2B ++ err = ddTDA182I2Write(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset10: ++// ++// DESCRIPTION: Get the ? bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset10 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2B ++ err = ddTDA182I2Read(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2B.bF.RFCAL_Offset_Cprog10; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_Offset11: ++// ++// DESCRIPTION: Set the RFCAL_Offset11 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_Offset11 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2B.bF.RFCAL_Offset_Cprog11 = uValue; ++ ++ // read byte 0x2B ++ err = ddTDA182I2Write(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_Offset11: ++// ++// DESCRIPTION: Get the RFCAL_Offset11 bit(s) status ++// ++// RETURN: TM_OK if no error ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_Offset11 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2B ++ err = ddTDA182I2Read(pObj, 0x2B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2B.bF.RFCAL_Offset_Cprog11; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC2_loop_off: ++// ++// DESCRIPTION: Set the AGC2_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC2_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2C.bF.AGC2_loop_off = uValue; ++ ++ // read byte 0x2C ++ err = ddTDA182I2Write(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC2_loop_off: ++// ++// DESCRIPTION: Get the AGC2_loop_off bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC2_loop_off ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2C ++ err = ddTDA182I2Read(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2C.bF.AGC2_loop_off; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetForce_AGC2_gain: ++// ++// DESCRIPTION: Set the Force_AGC2_gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetForce_AGC2_gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2C.bF.Force_AGC2_gain = uValue; ++ ++ // write byte 0x2C ++ err = ddTDA182I2Write(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetForce_AGC2_gain: ++// ++// DESCRIPTION: Get the Force_AGC2_gain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetForce_AGC2_gain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2C ++ err = ddTDA182I2Read(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2C.bF.Force_AGC2_gain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRF_Filter_Gv: ++// ++// DESCRIPTION: Set the RF_Filter_Gv bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRF_Filter_Gv ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2C.bF.RF_Filter_Gv = uValue; ++ ++ // read byte 0x2C ++ err = ddTDA182I2Write(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRF_Filter_Gv: ++// ++// DESCRIPTION: Get the RF_Filter_Gv bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRF_Filter_Gv ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2C ++ err = ddTDA182I2Read(pObj, 0x2C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2C.bF.RF_Filter_Gv; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetAGC2_Do_step: ++// ++// DESCRIPTION: Set the AGC2_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetAGC2_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2E.bF.AGC2_Do_step = uValue; ++ ++ // read byte 0x2E ++ err = ddTDA182I2Write(pObj, 0x2E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC2_Do_step: ++// ++// DESCRIPTION: Get the AGC2_Do_step bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC2_Do_step ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2E ++ err = ddTDA182I2Read(pObj, 0x2E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2E.bF.AGC2_Do_step; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRF_BPF_Bypass: ++// ++// DESCRIPTION: Set the RF_BPF_Bypass bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRF_BPF_Bypass ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2F.bF.RF_BPF_Bypass = uValue; ++ ++ // read byte 0x2F ++ err = ddTDA182I2Write(pObj, 0x2F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRF_BPF_Bypass: ++// ++// DESCRIPTION: Get the RF_BPF_Bypass bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRF_BPF_Bypass ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2F ++ err = ddTDA182I2Read(pObj, 0x2F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2F.bF.RF_BPF_Bypass; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRF_BPF: ++// ++// DESCRIPTION: Set the RF_BPF bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRF_BPF ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx2F.bF.RF_BPF = uValue; ++ ++ // read byte 0x2F ++ err = ddTDA182I2Write(pObj, 0x2F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRF_BPF: ++// ++// DESCRIPTION: Get the RF_BPF bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRF_BPF ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x2F ++ err = ddTDA182I2Read(pObj, 0x2F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx2F.bF.RF_BPF; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetUp_AGC5: ++// ++// DESCRIPTION: Get the Up_AGC5 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetUp_AGC5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Up_AGC5; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDo_AGC5: ++// ++// DESCRIPTION: Get the Do_AGC5 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDo_AGC5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Do_AGC5; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetUp_AGC4: ++// ++// DESCRIPTION: Get the Up_AGC4 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetUp_AGC4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Up_AGC4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDo_AGC4: ++// ++// DESCRIPTION: Get the Do_AGC4 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDo_AGC4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Do_AGC4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetUp_AGC2: ++// ++// DESCRIPTION: Get the Up_AGC2 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetUp_AGC2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Up_AGC2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDo_AGC2: ++// ++// DESCRIPTION: Get the Do_AGC2 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDo_AGC2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Do_AGC2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetUp_AGC1: ++// ++// DESCRIPTION: Get the Up_AGC1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetUp_AGC1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Up_AGC1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDo_AGC1: ++// ++// DESCRIPTION: Get the Do_AGC1 bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDo_AGC1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x31 ++ err = ddTDA182I2Read(pObj, 0x31, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx31.bF.Do_AGC1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC2_Gain_Read: ++// ++// DESCRIPTION: Get the AGC2_Gain_Read bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC2_Gain_Read ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x32 ++ err = ddTDA182I2Read(pObj, 0x32, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx32.bF.AGC2_Gain_Read; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC1_Gain_Read: ++// ++// DESCRIPTION: Get the AGC1_Gain_Read bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC1_Gain_Read ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x32 ++ err = ddTDA182I2Read(pObj, 0x32, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx32.bF.AGC1_Gain_Read; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetTOP_AGC3_Read: ++// ++// DESCRIPTION: Get the TOP_AGC3_Read bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetTOP_AGC3_Read ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x33 ++ err = ddTDA182I2Read(pObj, 0x33, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx33.bF.TOP_AGC3_Read; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC5_Gain_Read: ++// ++// DESCRIPTION: Get the AGC5_Gain_Read bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC5_Gain_Read ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x34 ++ err = ddTDA182I2Read(pObj, 0x34, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx34.bF.AGC5_Gain_Read; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetAGC4_Gain_Read: ++// ++// DESCRIPTION: Get the AGC4_Gain_Read bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetAGC4_Gain_Read ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x34 ++ err = ddTDA182I2Read(pObj, 0x34, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx34.bF.AGC4_Gain_Read; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI: ++// ++// DESCRIPTION: Set the RSSI bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx35.RSSI = uValue; ++ ++ // write byte 0x35 ++ err = ddTDA182I2Write(pObj, 0x35, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI: ++// ++// DESCRIPTION: Get the RSSI bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ // tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x35 ++ err = ddTDA182I2Read(pObj, 0x35, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx35.RSSI; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI_AV: ++// ++// DESCRIPTION: Set the RSSI_AV bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI_AV ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx36.bF.RSSI_AV = uValue; ++ ++ // write byte 0x36 ++ err = ddTDA182I2Write(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI_AV: ++// ++// DESCRIPTION: Get the RSSI_AV bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI_AV ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x36 ++ err = ddTDA182I2Read(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx36.bF.RSSI_AV; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI_Cap_Reset_En: ++// ++// DESCRIPTION: Set the RSSI_Cap_Reset_En bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI_Cap_Reset_En ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx36.bF.RSSI_Cap_Reset_En = uValue; ++ ++ // write byte 0x36 ++ err = ddTDA182I2Write(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI_Cap_Reset_En: ++// ++// DESCRIPTION: Get the RSSI_Cap_Reset_En bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI_Cap_Reset_En ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x36 ++ err = ddTDA182I2Read(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx36.bF.RSSI_Cap_Reset_En; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI_Cap_Val: ++// ++// DESCRIPTION: Set the RSSI_Cap_Val bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI_Cap_Val ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx36.bF.RSSI_Cap_Val = uValue; ++ ++ // write byte 0x36 ++ err = ddTDA182I2Write(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI_Cap_Val: ++// ++// DESCRIPTION: Get the RSSI_Cap_Val bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI_Cap_Val ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x36 ++ err = ddTDA182I2Read(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx36.bF.RSSI_Cap_Val; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRSSI_Dicho_not: ++// ++// DESCRIPTION: Set the RSSI_Dicho_not bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRSSI_Dicho_not ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx36.bF.RSSI_Dicho_not = uValue; ++ ++ // write byte 0x36 ++ err = ddTDA182I2Write(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRSSI_Dicho_not: ++// ++// DESCRIPTION: Get the RSSI_Dicho_not bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRSSI_Dicho_not ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x36 ++ err = ddTDA182I2Read(pObj, 0x36, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx36.bF.RSSI_Dicho_not; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetDDS_Polarity: ++// ++// DESCRIPTION: Set the DDS_Polarity bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetDDS_Polarity ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx37.bF.DDS_Polarity = uValue; ++ ++ // write byte 0x37 ++ err = ddTDA182I2Write(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetDDS_Polarity: ++// ++// DESCRIPTION: Get the DDS_Polarity bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetDDS_Polarity ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x37 ++ err = ddTDA182I2Read(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx37.bF.DDS_Polarity; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetRFCAL_DeltaGain: ++// ++// DESCRIPTION: Set the RFCAL_DeltaGain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetRFCAL_DeltaGain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx37.bF.RFCAL_DeltaGain = uValue; ++ ++ // read byte 0x37 ++ err = ddTDA182I2Write(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetRFCAL_DeltaGain: ++// ++// DESCRIPTION: Get the RFCAL_DeltaGain bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetRFCAL_DeltaGain ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x37 ++ err = ddTDA182I2Read(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx37.bF.RFCAL_DeltaGain; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2SetIRQ_Polarity: ++// ++// DESCRIPTION: Set the IRQ_Polarity bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2SetIRQ_Polarity ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8 uValue // I: Item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set value ++ pObj->I2CMap.uBx37.bF.IRQ_Polarity = uValue; ++ ++ // read byte 0x37 ++ err = ddTDA182I2Write(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2GetIRQ_Polarity: ++// ++// DESCRIPTION: Get the IRQ_Polarity bit(s) status ++// ++// RETURN: tmdd_ERR_TUNER_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_PARAMETER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2GetIRQ_Polarity ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_PARAMETER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x37 ++ err = ddTDA182I2Read(pObj, 0x37, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx37.bF.IRQ_Polarity; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_0 ++// ++// DESCRIPTION: Get the rfcal_log_0 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_0 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x38 ++ err = ddTDA182I2Read(pObj, 0x38, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx38.bF.rfcal_log_0; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_1 ++// ++// DESCRIPTION: Get the rfcal_log_1 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_1 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x39 ++ err = ddTDA182I2Read(pObj, 0x39, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx39.bF.rfcal_log_1; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_2 ++// ++// DESCRIPTION: Get the rfcal_log_2 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_2 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3A ++ err = ddTDA182I2Read(pObj, 0x3A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3A.bF.rfcal_log_2; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_3 ++// ++// DESCRIPTION: Get the rfcal_log_3 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_3 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3B ++ err = ddTDA182I2Read(pObj, 0x3B, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3B.bF.rfcal_log_3; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_4 ++// ++// DESCRIPTION: Get the rfcal_log_4 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_4 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3C ++ err = ddTDA182I2Read(pObj, 0x3C, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3C.bF.rfcal_log_4; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_5 ++// ++// DESCRIPTION: Get the rfcal_log_5 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_5 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3D ++ err = ddTDA182I2Read(pObj, 0x3D, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3D.bF.rfcal_log_5; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_6 ++// ++// DESCRIPTION: Get the rfcal_log_6 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_6 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3E ++ err = ddTDA182I2Read(pObj, 0x3E, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3E.bF.rfcal_log_6; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_7 ++// ++// DESCRIPTION: Get the rfcal_log_7 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_7 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x3F ++ err = ddTDA182I2Read(pObj, 0x3F, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx3F.bF.rfcal_log_7; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_8 ++// ++// DESCRIPTION: Get the rfcal_log_8 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_8 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x40 ++ err = ddTDA182I2Read(pObj, 0x40, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx40.bF.rfcal_log_8; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_9 ++// ++// DESCRIPTION: Get the rfcal_log_9 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_9 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x41 ++ err = ddTDA182I2Read(pObj, 0x41, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx41.bF.rfcal_log_9; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_10 ++// ++// DESCRIPTION: Get the rfcal_log_10 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_10 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x42 ++ err = ddTDA182I2Read(pObj, 0x42, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx42.bF.rfcal_log_10; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2Getrfcal_log_11 ++// ++// DESCRIPTION: Get the rfcal_log_11 bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2Getrfcal_log_11 ++( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue // I: Address of the variable to output item value ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ // test the parameter ++ if (puValue == Null) ++ err = ddTDA182I2_ERR_BAD_UNIT_NUMBER; ++ ++ if(err == TM_OK) ++ { ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ } ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // read byte 0x43 ++ err = ddTDA182I2Read(pObj, 0x43, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Read(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // get value ++ *puValue = pObj->I2CMap.uBx43.bF.rfcal_log_11; ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++//------------------------------------------------------------------------------------- ++// FUNCTION: tmddTDA182I2LaunchRF_CAL ++// ++// DESCRIPTION: Launch the RF_CAL bit(s) status ++// ++// RETURN: ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_BAD_UNIT_NUMBER ++// ddTDA182I2_ERR_NOT_INITIALIZED ++// tmdd_ERR_IIC_ERR ++// TM_OK ++// ++// NOTES: ++//------------------------------------------------------------------------------------- ++// ++tmErrorCode_t ++tmddTDA182I2LaunchRF_CAL ++( ++ tmUnitSelect_t tUnit // I: Unit number ++ ) ++{ ++ ptmddTDA182I2Object_t pObj = Null; ++ tmErrorCode_t err = TM_OK; ++ ++ /* Get Instance Object */ ++ err = ddTDA182I2GetInstance(tUnit, &pObj); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2GetInstance(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2MutexAcquire(pObj, ddTDA182I2_MUTEX_TIMEOUT); ++ } ++ ++ if(err == TM_OK) ++ { ++ // set Calc_PLL & RF_CAL ++ pObj->I2CMap.uBx19.MSM_byte_1 = 0x21; ++ ++ // write byte 0x19 ++ err = ddTDA182I2Write(pObj, 0x19, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ if(err == TM_OK) ++ { ++ // trigger MSM_Launch ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 1; ++ ++ // write byte 0x1A ++ err = ddTDA182I2Write(pObj, 0x1A, 1); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2Write(0x%08X) failed.", tUnit)); ++ ++ // reset MSM_Launch (buffer only, no write) ++ pObj->I2CMap.uBx1A.bF.MSM_Launch = 0; ++ ++ if(pObj->bIRQWait) ++ { ++ if(err == TM_OK) ++ { ++ err = ddTDA182I2WaitIRQ(pObj, 1700, 50, 0x0C); ++ tmASSERTExT(err, TM_OK, (DEBUGLVL_ERROR, "ddTDA182I2WaitIRQ(0x%08X) failed.", tUnit)); ++ } ++ ++ } ++ } ++ ++ (void)ddTDA182I2MutexRelease(pObj); ++ } ++ ++ return err; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_tda18272.h b/drivers/media/dvb/dvb-usb/tuner_tda18272.h +new file mode 100644 +index 0000000..023aa3b +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_tda18272.h +@@ -0,0 +1,7362 @@ ++#ifndef __TUNER_TDA18272_H ++#define __TUNER_TDA18272_H ++ ++/** ++ ++@file ++ ++@brief TDA18272 tuner module declaration ++ ++One can manipulate TDA18272 tuner through TDA18272 module. ++TDA18272 module is derived from tuner module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_tda18272.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ TDA18272_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ int StandardBandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build TDA18272 tuner module. ++ BuildTda18272Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0, // I2C device address is 0xc0 in 8-bit format. ++ CRYSTAL_FREQ_16000000HZ, // Crystal frequency is 16.0 MHz. ++ TDA18272_UNIT_0, // Unit number is 0. ++ TDA18272_IF_OUTPUT_VPP_0P7V // IF output Vp-p is 0.7 V. ++ ); ++ ++ ++ ++ ++ ++ // Get TDA18272 tuner extra module. ++ pTunerExtra = (TDA18272_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set TDA18272 standard and bandwidth mode. ++ pTunerExtra->SetStandardBandwidthMode(pTuner, TDA18272_STANDARD_BANDWIDTH_DVBT_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get TDA18272 bandwidth. ++ pTunerExtra->GetStandardBandwidthMode(pTuner, &StandardBandwidthMode); ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++ ++ ++ ++#include "tuner_base.h" ++ ++ ++ ++ ++ ++// Defined by Realtek for tuner TDA18272. ++#define TMBSL_TDA18272 ++ ++ ++ ++ ++ ++// The following context is source code provided by NXP. ++ ++ ++ ++ ++ ++// NXP source code - .\cfg\tmbslTDA182I2_InstanceCustom.h ++ ++ ++ /* ++ Copyright (C) 2006-2009 NXP B.V., All Rights Reserved. ++ This source code and any compilation or derivative thereof is the proprietary ++ information of NXP B.V. and is confidential in nature. Under no circumstances ++ is this software to be exposed to or placed under an Open Source License of ++ any type without the expressed written permission of NXP B.V. ++ * ++ * \file tmbslTDA182I2_InstanceCustom.h ++ * ++ * 1 ++ * ++ * \date %modify_time% ++ * ++ * \brief Describe briefly the purpose of this file. ++ * ++ * REFERENCE DOCUMENTS : ++ * ++ * ++ * Detailed description may be added here. ++ * ++ * \section info Change Information ++ * ++*/ ++ ++#ifndef _TMBSL_TDA182I2_INSTANCE_CUSTOM_H ++#define _TMBSL_TDA182I2_INSTANCE_CUSTOM_H ++ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/*============================================================================*/ ++/* Types and defines: */ ++/*============================================================================*/ ++ ++/* Driver settings version definition */ ++#define TMBSL_TDA182I2_SETTINGS_CUSTOMER_NUM 0 /* SW Settings Customer Number */ ++#define TMBSL_TDA182I2_SETTINGS_PROJECT_NUM 0 /* SW Settings Project Number */ ++#define TMBSL_TDA182I2_SETTINGS_MAJOR_VER 0 /* SW Settings Major Version */ ++#define TMBSL_TDA182I2_SETTINGS_MINOR_VER 0 /* SW Settings Minor Version */ ++ ++/* Custom Driver Instance Parameters: (Path 0) */ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MASTER \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Current Power state */ \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Minimum Power state */ \ ++ 0, /* RF */ \ ++ tmTDA182I2_DVBT_8MHz, /* Standard mode */ \ ++ True, /* Master */ \ ++ 0, /* LT_Enable */ \ ++ 1, /* PSM_AGC1 */ \ ++ 0, /* AGC1_6_15dB */ \ ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MASTER_DIGITAL \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Current Power state */ \ ++ tmTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndSynthe, /* Minimum Power state */ \ ++ 0, /* RF */ \ ++ tmTDA182I2_DVBT_8MHz, /* Standard mode */ \ ++ True, /* Master */ \ ++ 1, /* LT_Enable */ \ ++ 0, /* PSM_AGC1 */ \ ++ 1, /* AGC1_6_15dB */ \ ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_SLAVE \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Current Power state */ \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Minimum Power state */ \ ++ 0, /* RF */ \ ++ tmTDA182I2_DVBT_8MHz, /* Standard mode */ \ ++ False, /* Master */ \ ++ 0, /* LT_Enable */ \ ++ 1, /* PSM_AGC1 */ \ ++ 0, /* AGC1_6_15dB */ \ ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_SLAVE_DIGITAL \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Current Power state */ \ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Minimum Power state */ \ ++ 0, /* RF */ \ ++ tmTDA182I2_DVBT_8MHz, /* Standard mode */ \ ++ False, /* Master */ \ ++ 0, /* LT_Enable */ \ ++ 1, /* PSM_AGC1 */ \ ++ 0, /* AGC1_6_15dB */ \ ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL \ ++ { /* Std_Array */ /* DVB-T 6MHz */ \ ++ 3250000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_6MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_0_4MHz, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* DVB-T 7MHz */ \ ++ 3500000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_7MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_min_8pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* DVB-T 8MHz */ \ ++ 4000000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* QAM 6MHz */ \ ++ 3600000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_6MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_min_8pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ True, /* AGC1_freeze */ \ ++ True /* LTO_STO_immune */ \ ++ }, \ ++ { /* QAM 8MHz */ \ ++ 5000000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_9MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_min_8pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_0_85MHz, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ True, /* AGC1_freeze */ \ ++ True /* LTO_STO_immune */ \ ++ }, \ ++ { /* ISDBT 6MHz */ \ ++ 3250000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_6MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_6Vpp_min_10_3_19_7dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_0_4MHz, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* ATSC 6MHz */ \ ++ 3250000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_6MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_6Vpp_min_10_3_19_7dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_0_4MHz, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d100_u94dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_104dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_104dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d112_u107dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d112_u107dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_3_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* DMB-T 8MHz */ \ ++ 4000000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG \ ++ { /* Analog M/N */ \ ++ 5400000, /* IF */ \ ++ 1750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_6MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog B */ \ ++ 6400000, /* IF */ \ ++ 2250000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_7MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band*/ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog G/H */ \ ++ 6750000, /* IF */ \ ++ 2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog I */ \ ++ 7250000, /* IF */ \ ++ 2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog D/K */ \ ++ 6850000, /* IF */ \ ++ 2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog L */ \ ++ 6750000, /* IF */ \ ++ 2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog L' */ \ ++ 1250000, /* IF */ \ ++ -2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Analog FM Radio */ \ ++ 1250000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_1_5MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_0_85MHz, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x02, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* Blind Scanning copy of PAL-I */ \ ++ 7250000, /* IF */ \ ++ 2750000, /* CF_Offset */ \ ++ tmTDA182I2_LPF_8MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Disabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Disabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Disabled, /* AGC5_Atten_3dB */ \ ++ 0x01, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ }, \ ++ { /* ScanXpress */ \ ++ 5000000, /* IF */ \ ++ 0, /* CF_Offset */ \ ++ tmTDA182I2_LPF_9MHz, /* LPF */ \ ++ tmTDA182I2_LPFOffset_0pc, /* LPF_Offset */ \ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* IF_Gain */ \ ++ tmTDA182I2_IF_Notch_Enabled, /* IF_Notch */ \ ++ tmTDA182I2_IF_HPF_Disabled, /* IF_HPF */ \ ++ tmTDA182I2_DC_Notch_Enabled, /* DC_Notch */ \ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV, /* AGC1_LNA_TOP */ \ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2_RF_Attenuator_TOP */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3_RF_AGC_TOP_Low_band */ \ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3_RF_AGC_TOP_High_band */ \ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4_IR_Mixer_TOP */ \ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5_IF_AGC_TOP */ \ ++ tmTDA182I2_AGC5_Detector_HPF_Disabled, /* AGC5_Detector_HPF */ \ ++ tmTDA182I2_AGC3_Adapt_Enabled, /* AGC3_Adapt */ \ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* AGC3_Adapt_TOP */ \ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB */ \ ++ 0x0e, /* GSK : settings V2.0.0 */ \ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 */ \ ++ tmTDA182I2_LPF_Gain_Free, /* LPF_Gain */ \ ++ False, /* AGC1_freeze */ \ ++ False /* LTO_STO_immune */ \ ++ } ++/* Custom Driver Instance Parameters: (Path 1) */ ++ ++/******************************************************************/ ++/* Mode selection for PATH0 */ ++/******************************************************************/ ++ ++#ifdef TMBSL_TDA18272 ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH0 TMBSL_TDA182I2_INSTANCE_CUSTOM_MASTER ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH0 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG_SELECTION_PATH0 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG ++ ++#else ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH0 TMBSL_TDA182I2_INSTANCE_CUSTOM_MASTER_DIGITAL ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH0 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL ++ ++#endif ++ ++/******************************************************************/ ++/* Mode selection for PATH1 */ ++/******************************************************************/ ++ ++#ifdef TMBSL_TDA18272 ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH1 TMBSL_TDA182I2_INSTANCE_CUSTOM_SLAVE ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH1 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG_SELECTION_PATH1 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_ANALOG ++ ++#else ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_MODE_PATH1 TMBSL_TDA182I2_INSTANCE_CUSTOM_SLAVE_DIGITAL ++ ++#define TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL_SELECTION_PATH1 TMBSL_TDA182I2_INSTANCE_CUSTOM_STD_DIGITAL ++ ++#endif ++ ++/******************************************************************/ ++/* End of Mode selection */ ++/******************************************************************/ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _TMBSL_TDA182I2_INSTANCE_CUSTOM_H */ ++ ++ ++//#endif ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\inc\tmFlags.h ++ ++ ++ /* */ ++ /* */ ++ /* -- DO NOT EDIT -- file built by */ ++ /* */ ++ /*------------------------------------------------------------------------- */ ++ /* (C) Copyright 2000 Koninklijke Philips Electronics N.V., All Rights Reserved*/ ++ /* */ ++ /* This source code and any compilation or derivative thereof is the sole */ ++ /* property of Philips Corporation and is provided pursuant to a Software */ ++ /* License Agreement. This code is the proprietary information of */ ++ /* Philips Corporation and is confidential in nature. Its use and */ ++ /* dissemination by any party other than Philips Corporation is strictly */ ++ /* limited by the confidential information provisions of the Agreement */ ++ /* referenced above. */ ++ /*------------------------------------------------------------------------- */ ++ /* */ ++ ++ /* */ ++ /* DOCUMENT REF: DVP Build Process Specification */ ++ /* */ ++ /* NOTES: This file defines the TMFL_xxx build flags. */ ++ /* */ ++ #if !defined(_TMFLAGS_H_SEEN_) ++ #define _TMFLAGS_H_SEEN_ ++ /* configuration */ ++ /* */ ++ /* FILENAME: tmFlags.h */ ++ /* */ ++ /* DESCRIPTION: Generated by */ ++ #define TMFL_BUILD_VERSION 00.00.00 ++ #define TMFL_CPU 0x00020011 ++ #define TMFL_ENDIAN 1 ++ #define TMFL_OS 0x03020500 ++ #define TMFL_CPU_IS_X86 1 ++ #define TMFL_CPU_IS_MIPS 0 ++ #define TMFL_CPU_IS_HP 0 ++ #define TMFL_CPU_IS_TM 0 ++ #define TMFL_CPU_IS_ARM 0 ++ #define TMFL_CPU_IS_REAL 0 ++ #define TMFL_OS_IS_BTM 0 ++ #define TMFL_OS_IS_CE 0 ++ #define TMFL_OS_IS_NT 1 ++ #define TMFL_OS_IS_PSOS 0 ++ #define TMFL_OS_IS_NULLOS 0 ++ #define TMFL_OS_IS_ECOS 0 ++ #define TMFL_OS_IS_VXWORKS 0 ++ #define TMFL_OS_IS_MTOS 0 ++ #define TMFL_OS_IS_CEXEC 0 ++ /* DO NOT CHANGE THIS FILE INDEPENDENTLY !!! */ ++ /* IT MUST BE SYNCHONISED WITH THE TMFLAGS TEMPLATE FILE ON THE */ ++ /* MOREUSE WEB SITE http://pww.rtg.sc.philips.com/cmd/html/global_files.html */ ++ /* CONTACT MOREUSE BEFORE ADDING NEW VALUES */ ++ /* constants */ ++ #define TMFL_CPU_TYPE_MASK 0xffff0000 ++ #define TMFL_CPU_TYPE_X86 0x00010000 ++ #define TMFL_CPU_TYPE_MIPS 0x00020000 ++ #define TMFL_CPU_TYPE_TM 0x00030000 ++ #define TMFL_CPU_TYPE_HP 0x00040000 ++ #define TMFL_CPU_TYPE_ARM 0x00050000 ++ #define TMFL_CPU_TYPE_REAL 0x00060000 ++ #define TMFL_CPU_MODEL_MASK 0x0000ffff ++ #define TMFL_CPU_MODEL_I486 0x00000001 ++ #define TMFL_CPU_MODEL_R3940 0x00000002 ++ #define TMFL_CPU_MODEL_R4300 0x00000003 ++ #define TMFL_CPU_MODEL_TM1100 0x00000004 ++ #define TMFL_CPU_MODEL_TM1300 0x00000005 ++ #define TMFL_CPU_MODEL_TM32 0x00000006 ++ #define TMFL_CPU_MODEL_HP 0x00000007 ++ #define TMFL_CPU_MODEL_R4640 0x00000008 ++ #define TMFL_CPU_MODEL_ARM7 0x00000009 ++ #define TMFL_CPU_MODEL_ARM920T 0x0000000a ++ #define TMFL_CPU_MODEL_ARM940T 0x0000000b ++ #define TMFL_CPU_MODEL_ARM10 0x0000000c ++ #define TMFL_CPU_MODEL_STRONGARM 0x0000000d ++ #define TMFL_CPU_MODEL_RD24120 0x0000000e ++ #define TMFL_CPU_MODEL_ARM926EJS 0x0000000f ++ #define TMFL_CPU_MODEL_ARM946 0x00000010 ++ #define TMFL_CPU_MODEL_R1910 0x00000011 ++ #define TMFL_CPU_MODEL_R4450 0x00000012 ++ #define TMFL_CPU_MODEL_TM3260 0x00000013 ++ #define TMFL_ENDIAN_BIG 1 ++ #define TMFL_ENDIAN_LITTLE 0 ++ #define TMFL_OS_MASK 0xff000000 ++ #define TMFL_OS_VERSION_MASK 0x00ffffff ++ #define TMFL_OS_BTM 0x00000000 ++ #define TMFL_OS_CE 0x01000000 ++ #define TMFL_OS_CE212 0x01020102 ++ #define TMFL_OS_CE300 0x01030000 ++ #define TMFL_OS_NT 0x02000000 ++ #define TMFL_OS_NT4 0x02040000 ++ #define TMFL_OS_PSOS 0x03000000 ++ #define TMFL_OS_PSOS250 0x03020500 ++ #define TMFL_OS_PSOS200 0x03020000 ++ #define TMFL_OS_NULLOS 0x04000000 ++ #define TMFL_OS_ECOS 0x05000000 ++ #define TMFL_OS_VXWORKS 0x06000000 ++ #define TMFL_OS_MTOS 0x07000000 ++ #define TMFL_OS_CEXEC 0x08000000 ++ #define TMFL_SCOPE_SP 0 ++ #define TMFL_SCOPE_MP 1 ++ #define TMFL_REL_ASSERT 0x00000002 ++ #define TMFL_REL_DEBUG 0x00000001 ++ #define TMFL_REL_RETAIL 0x00000000 ++ #define TMFL_CPU_I486 0x00010001 ++ #define TMFL_CPU_R3940 0x00020002 ++ #define TMFL_CPU_R4300 0x00020003 ++ #define TMFL_CPU_TM1100 0x00030004 ++ #define TMFL_CPU_TM1300 0x00030005 ++ #define TMFL_CPU_TM32 0x00030006 ++ #define TMFL_CPU_HP 0x00040007 ++ #define TMFL_CPU_R4640 0x00020008 ++ #define TMFL_CPU_ARM7 0x00050009 ++ #define TMFL_CPU_ARM920T 0x0005000a ++ #define TMFL_CPU_ARM940T 0x0005000b ++ #define TMFL_CPU_ARM10 0x0005000c ++ #define TMFL_CPU_STRONGARM 0x0005000d ++ #define TMFL_CPU_RD24120 0x0006000e ++ #define TMFL_CPU_ARM926EJS 0x0005000f ++ #define TMFL_CPU_ARM946 0x00050010 ++ #define TMFL_CPU_R1910 0x00020011 ++ #define TMFL_CPU_R4450 0x00020012 ++ #define TMFL_CPU_TM3260 0x00030013 ++ #define TMFL_MODE_KERNEL 1 ++ #define TMFL_MODE_USER 0 ++ ++ #endif /* !defined(_TMFLAGS_H_SEEN_) */ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\inc\tmNxTypes.h ++ ++ ++/*==========================================================================*/ ++/* (Copyright (C) 2003 Koninklijke Philips Electronics N.V. */ ++/* All rights reserved. */ ++/* This source code and any compilation or derivative thereof is the */ ++/* proprietary information of Koninklijke Philips Electronics N.V. */ ++/* and is confidential in nature. */ ++/* Under no circumstances is this software to be exposed to or placed */ ++/* under an Open Source License of any type without the expressed */ ++/* written permission of Koninklijke Philips Electronics N.V. */ ++/*==========================================================================*/ ++/* ++* Copyright (C) 2000,2001 ++* Koninklijke Philips Electronics N.V. ++* All Rights Reserved. ++* ++* Copyright (C) 2000,2001 TriMedia Technologies, Inc. ++* All Rights Reserved. ++* ++*############################################################ ++* ++* Module name : tmNxTypes.h %version: 4 % ++* ++* Last Update : %date_modified: Tue Jul 8 18:08:00 2003 % ++* ++* Description: TriMedia/MIPS global type definitions. ++* ++* Document Ref: DVP Software Coding Guidelines Specification ++* DVP/MoReUse Naming Conventions specification ++* DVP Software Versioning Specification ++* DVP Device Library Architecture Specification ++* DVP Board Support Library Architecture Specification ++* DVP Hardware API Architecture Specification ++* ++* ++*############################################################ ++*/ ++ ++#ifndef TMNXTYPES_H ++#define TMNXTYPES_H ++ ++//----------------------------------------------------------------------------- ++// Standard include files: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Project include files: ++//----------------------------------------------------------------------------- ++// ++//#include "tmFlags.h" // DVP common build control flags ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++ //----------------------------------------------------------------------------- ++ // Types and defines: ++ //----------------------------------------------------------------------------- ++ // ++ ++ /*Under the TCS, may have been included by our client. In ++ order to avoid errors, we take account of this possibility, but in order to ++ support environments where the TCS is not available, we do not include the ++ file by name.*/ ++ ++#ifndef _TMtypes_h ++#define _TMtypes_h ++ ++#define False 0 ++#define True 1 ++ ++#ifdef TMFL_NATIVE_C_FORCED ++ #undef TMFL_DOT_NET_2_0_TYPES ++#undef NXPFE ++#endif ++ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++ #ifdef __cplusplus ++ #define Null 0 ++ #else ++ #define Null ((Void *) 0) ++ #endif ++#else ++ #define Null nullptr ++#endif ++ ++ // ++ // Standard Types ++ // ++ ++ typedef signed char CInt8; // 8 bit signed integer ++ typedef signed short CInt16; // 16 bit signed integer ++ typedef signed long CInt32; // 32 bit signed integer ++ typedef unsigned char CUInt8; // 8 bit unsigned integer ++ typedef unsigned short CUInt16; // 16 bit unsigned integer ++ typedef unsigned long CUInt32; // 32 bit unsigned integer ++// typedef float CFloat; // 32 bit floating point ++ typedef unsigned int CBool; // Boolean (True/False) ++ typedef char CChar; // character, character array ptr ++ typedef int CInt; // machine-natural integer ++ typedef unsigned int CUInt; // machine-natural unsigned integer ++ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++ typedef CInt8 Int8; // 8 bit signed integer ++ typedef CInt16 Int16; // 16 bit signed integer ++ typedef CInt32 Int32; // 32 bit signed integer ++ typedef CUInt8 UInt8; // 8 bit unsigned integer ++ typedef CUInt16 UInt16; // 16 bit unsigned integer ++ typedef CUInt32 UInt32; // 32 bit unsigned integer ++// typedef CFloat Float; // 32 bit floating point ++ typedef CBool Bool; // Boolean (True/False) ++ typedef CChar Char; // character, character array ptr ++ typedef CInt Int; // machine-natural integer ++ typedef CUInt UInt; // machine-natural unsigned integer ++ typedef char *String; // Null terminated 8 bit char str ++ ++ //----------------------------------------------------------------------------- ++ // Legacy TM Types/Structures (Not necessarily DVP Coding Guideline compliant) ++ // NOTE: For DVP Coding Gudeline compliant code, do not use these types. ++ // ++ typedef char *Address; // Ready for address-arithmetic ++ typedef char const *ConstAddress; ++ typedef unsigned char Byte; // Raw byte ++// typedef float Float32; // Single-precision float ++// typedef double Float64; // Double-precision float ++ typedef void *Pointer; // Pointer to anonymous object ++ typedef void const *ConstPointer; ++ typedef char const *ConstString; ++#else ++ using namespace System; ++ typedef int Int; ++ typedef SByte Int8; ++ typedef Byte UInt8; ++ typedef float Float32; ++ typedef unsigned int Bool; ++#endif ++ ++ ++ typedef Int Endian; ++#define BigEndian 0 ++#define LittleEndian 1 ++ ++ typedef struct tmVersion ++ { ++ UInt8 majorVersion; ++ UInt8 minorVersion; ++ UInt16 buildVersion; ++ } tmVersion_t, *ptmVersion_t; ++#endif /*ndef _TMtypes_h*/ ++ ++ /*Define DVP types that are not TCS types.*/ ++ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++ typedef Int8 *pInt8; // 8 bit signed integer ++ typedef Int16 *pInt16; // 16 bit signed integer ++ typedef Int32 *pInt32; // 32 bit signed integer ++ typedef UInt8 *pUInt8; // 8 bit unsigned integer ++ typedef UInt16 *pUInt16; // 16 bit unsigned integer ++ typedef UInt32 *pUInt32; // 32 bit unsigned integer ++ typedef void Void, *pVoid; // Void (typeless) ++// typedef Float *pFloat; // 32 bit floating point ++// typedef double Double, *pDouble; // 32/64 bit floating point ++ typedef Bool *pBool; // Boolean (True/False) ++ typedef Char *pChar; // character, character array ptr ++ typedef Int *pInt; // machine-natural integer ++ typedef UInt *pUInt; // machine-natural unsigned integer ++ typedef String *pString; // Null terminated 8 bit char str, ++#else ++ typedef Void *pVoid; // Void (typeless) ++#endif ++ /*Assume that 64-bit integers are supported natively by C99 compilers and Visual ++ C version 6.00 and higher. More discrimination in this area may be added ++ here as necessary.*/ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++#if defined __STDC_VERSION__ && __STDC_VERSION__ > 199409L ++ /*This can be enabled only when all explicit references to the hi and lo ++ structure members are eliminated from client code.*/ ++#define TMFL_NATIVE_INT64 1 ++ typedef signed long long int Int64, *pInt64; // 64-bit integer ++ typedef unsigned long long int UInt64, *pUInt64; // 64-bit bitmask ++ // #elif defined _MSC_VER && _MSC_VER >= 1200 ++ // /*This can be enabled only when all explicit references to the hi and lo ++ // structure members are eliminated from client code.*/ ++ // #define TMFL_NATIVE_INT64 1 ++ // typedef signed __int64 Int64, *pInt64; // 64-bit integer ++ // typedef unsigned __int64 UInt64, *pUInt64; // 64-bit bitmask ++#else /*!(defined __STDC_VERSION__ && __STDC_VERSION__ > 199409L)*/ ++#define TMFL_NATIVE_INT64 0 ++ typedef ++ struct ++ { ++ /*Get the correct endianness (this has no impact on any other part of ++ the system, but may make memory dumps easier to understand).*/ ++#if TMFL_ENDIAN == TMFL_ENDIAN_BIG ++ Int32 hi; UInt32 lo; ++#else ++ UInt32 lo; Int32 hi; ++#endif ++ } ++ Int64, *pInt64; // 64-bit integer ++ typedef ++ struct ++ { ++#if TMFL_ENDIAN == TMFL_ENDIAN_BIG ++ UInt32 hi; UInt32 lo; ++#else ++ UInt32 lo; UInt32 hi; ++#endif ++ } ++ UInt64, *pUInt64; // 64-bit bitmask ++#endif /*defined __STDC_VERSION__ && __STDC_VERSION__ > 199409L*/ ++#endif /*TMFL_DOT_NET_2_0_TYPES*/ ++ // Maximum length of device name in all BSP and capability structures ++#define HAL_DEVICE_NAME_LENGTH 16 ++ ++ typedef CUInt32 tmErrorCode_t; ++ typedef CUInt32 tmProgressCode_t; ++ ++ /* timestamp definition */ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++ typedef UInt64 tmTimeStamp_t, *ptmTimeStamp_t; ++#endif ++ //for backwards compatibility with the older tmTimeStamp_t definition ++#define ticks lo ++#define hiTicks hi ++ ++ typedef union tmColor3 // 3 byte color structure ++ { ++ unsigned long u32; ++#if (TMFL_ENDIAN == TMFL_ENDIAN_BIG) ++ struct { ++UInt32 : 8; ++ UInt32 red : 8; ++ UInt32 green : 8; ++ UInt32 blue : 8; ++ } rgb; ++ struct { ++UInt32 : 8; ++ UInt32 y : 8; ++ UInt32 u : 8; ++ UInt32 v : 8; ++ } yuv; ++ struct { ++UInt32 : 8; ++ UInt32 u : 8; ++ UInt32 m : 8; ++ UInt32 l : 8; ++ } uml; ++#else ++ struct { ++ UInt32 blue : 8; ++ UInt32 green : 8; ++ UInt32 red : 8; ++UInt32 : 8; ++ } rgb; ++ struct { ++ UInt32 v : 8; ++ UInt32 u : 8; ++ UInt32 y : 8; ++UInt32 : 8; ++ } yuv; ++ struct { ++ UInt32 l : 8; ++ UInt32 m : 8; ++ UInt32 u : 8; ++UInt32 : 8; ++ } uml; ++#endif ++ } tmColor3_t, *ptmColor3_t; ++ ++ typedef union tmColor4 // 4 byte color structure ++ { ++ unsigned long u32; ++#if (TMFL_ENDIAN == TMFL_ENDIAN_BIG) ++ struct { ++ UInt32 alpha : 8; ++ UInt32 red : 8; ++ UInt32 green : 8; ++ UInt32 blue : 8; ++ } argb; ++ struct { ++ UInt32 alpha : 8; ++ UInt32 y : 8; ++ UInt32 u : 8; ++ UInt32 v : 8; ++ } ayuv; ++ struct { ++ UInt32 alpha : 8; ++ UInt32 u : 8; ++ UInt32 m : 8; ++ UInt32 l : 8; ++ } auml; ++#else ++ struct { ++ UInt32 blue : 8; ++ UInt32 green : 8; ++ UInt32 red : 8; ++ UInt32 alpha : 8; ++ } argb; ++ struct { ++ UInt32 v : 8; ++ UInt32 u : 8; ++ UInt32 y : 8; ++ UInt32 alpha : 8; ++ } ayuv; ++ struct { ++ UInt32 l : 8; ++ UInt32 m : 8; ++ UInt32 u : 8; ++ UInt32 alpha : 8; ++ } auml; ++#endif ++ } tmColor4_t, *ptmColor4_t; ++ ++ //----------------------------------------------------------------------------- ++ // Hardware device power states ++ // ++ typedef enum tmPowerState ++ { ++ tmPowerOn, // Device powered on (D0 state) ++ tmPowerStandby, // Device power standby (D1 state) ++ tmPowerSuspend, // Device power suspended (D2 state) ++ tmPowerOff // Device powered off (D3 state) ++ ++ } tmPowerState_t, *ptmPowerState_t; ++ ++ //----------------------------------------------------------------------------- ++ // Software Version Structure ++ // ++ typedef struct tmSWVersion ++ { ++ UInt32 compatibilityNr; // Interface compatibility number ++ UInt32 majorVersionNr; // Interface major version number ++ UInt32 minorVersionNr; // Interface minor version number ++ ++ } tmSWVersion_t, *ptmSWVersion_t; ++ ++ /*Under the TCS, may have been included by our client. In ++ order to avoid errors, we take account of this possibility, but in order to ++ support environments where the TCS is not available, we do not include the ++ file by name.*/ ++#ifndef _TMBOARDDEF_H_ ++#define _TMBOARDDEF_H_ ++ ++ //----------------------------------------------------------------------------- ++ // HW Unit Selection ++ // ++ typedef CInt tmUnitSelect_t, *ptmUnitSelect_t; ++ ++#define tmUnitNone (-1) ++#define tmUnit0 0 ++#define tmUnit1 1 ++#define tmUnit2 2 ++#define tmUnit3 3 ++#define tmUnit4 4 ++ ++ /*+compatibility*/ ++#define unitSelect_t tmUnitSelect_t ++#define unit0 tmUnit0 ++#define unit1 tmUnit1 ++#define unit2 tmUnit2 ++#define unit3 tmUnit3 ++#define unit4 tmUnit4 ++#define DEVICE_NAME_LENGTH HAL_DEVICE_NAME_LENGTH ++ /*-compatibility*/ ++ ++#endif /*ndef _TMBOARDDEF_H_ */ ++ ++ //----------------------------------------------------------------------------- ++ // Instance handle ++ // ++ typedef Int tmInstance_t, *ptmInstance_t; ++ ++#ifndef TMFL_DOT_NET_2_0_TYPES ++ // Callback function declaration ++ typedef Void (*ptmCallback_t) (UInt32 events, Void *pData, UInt32 userData); ++#define tmCallback_t ptmCallback_t /*compatibility*/ ++#endif ++ //----------------------------------------------------------------------------- ++ // INLINE keyword for inline functions in all environments ++ // ++ // WinNT/WinCE: Use TMSHARED_DATA_BEGIN/TMSHARED_DATA_END for multiprocess ++ // shared data on a single CPU. To define data variables that are shared ++ // across all processes for WinNT/WinCE, use the defined #pragma macros ++ // TMSHARED_DATA_BEGIN/TMSHARED_DATA_END and initialize the data variables ++ // as shown in the example below. Data defined outside of the begin/end ++ // section or not initialized will not be shared across all processes for ++ // WinNT/WinCE; there will be a separate instance of the variable in each ++ // process. Use WinNT Explorer "QuickView" on the target DLL or text edit ++ // the target DLL *.map file to verify the shared data section presence and ++ // size (shared/static variables will not be named in the MAP file but will ++ // be included in the shared section virtual size). ++ // NOTE: All data variables in the multiprocess section _MUST_BE_INITIALIZED_ ++ // to be shared across processes; if no explicit initialization is ++ // done, the data variables will not be shared across processes. This ++ // shared data mechanism only applies to WinNT/WinCE multiprocess data ++ // on a single CPU (pSOS shares all data across tasks by default). Use ++ // the TMML MP shared data region for shared data across multiple CPUs ++ // and multiple processes. Example (note global variable naming): ++ // ++ // #if (TMFL_OS_IS_CE || TMFL_OS_IS_NT) ++ // #pragma TMSHARED_DATA_BEGIN // Multiprocess shared data begin ++ // #endif ++ // ++ // static g = ; ++ // gtm = ; ++ // ++ // #if (TMFL_OS_IS_CE || TMFL_OS_IS_NT) ++ // #pragma TMSHARED_DATA_END // Multiprocess shared data end ++ // #endif ++ // ++ ++#if TMFL_OS_IS_CE || TMFL_OS_IS_NT ++// removed to compile without warning with OpenPli ++//#define inline __inline ++ ++ // ++ // Places shared data in named DLL data segment for WinNT/WinCE builds. ++ // NOTE: These pragma defines require DLLFLAGS += -section:.tmShare,RWS in the ++ // nt.mak and ce.mak target OS makefiles for this mechanism to work. ++ // ++#define TMSHARED_DATA_BEGIN data_seg(".tmShare") ++#define TMSHARED_DATA_END data_seg() ++ ++#elif TMFL_OS_IS_PSOS && TMFL_CPU_IS_MIPS ++ ++ // NOTE regarding the keyword INLINE: ++ // ++ // Inline is not an ANSI-C keyword, hence every compiler can implement inlining ++ // the way it wants to. When using the dcc compiler this might possibly lead to ++ // redeclaration warnings when linking. For example: ++ // ++ // dld: warning: Redeclaration of tmmlGetMemHandle ++ // dld: Defined in root.o ++ // dld: and tmmlApi.o(../../lib/pSOS-MIPS/libtmml.a) ++ // ++ // For the dcc compiler inlining is not on by default. When building a retail ++ // version ( _TMTGTREL=ret), inlining is turned on explicitly in the dvp1 pSOS ++ // makefiles by specifying -XO, which enables all standard optimizations plus ++ // some others, including inlining (see the Language User's Manual, D-CC and ++ // D-C++ Compiler Suites p46). When building a debug version ( _TMTGTREL=dbg), ++ // the optimizations are not turned on (and even if they were they would have ++ // been overruled by -g anyway). ++ // ++ // When a .h file with inline function declarations gets included in multiple ++ // source files, redeclaration warnings are issued. ++ // ++ // When building a retail version those functions are inlined, but in addition ++ // the function is also declared within the .o file, resulting in redeclaration ++ // warnings as the same function is also defined by including that same header ++ // file in other source files. Defining the functions as static inline rather ++ // than inline solves the problem, as now the additional function declaration ++ // is omitted (as now the compiler realizes that there is no point in keeping ++ // that declaration as it can only be called from within this specific file, ++ // but it isn't, because all calls are already inline). ++ // ++ // When building a debug version no inlining is done, but the functions are ++ // still defined within the .o file, again resulting in redeclaration warnings. ++ // Again, defining the functions to be static inline rather than inline solves ++ // the problem. ++ ++ // Now if we would change the definition of the inline keyword for pSOS from ++ // __inline__ to static __inline__, all inline function definitions throughout ++ // the code would not issue redeclaration warnings anymore, but all static ++ // inline definitions would. ++ // If we don't change the definition of the inline keyword, all inline func- ++ // tion definitions would return redeclaration warnings. ++ // ++ // As this is a pSOS linker bug, it was decided not to change the code but ++ // rather to ignore the issued warnings. ++ // ++ ++#define inline __inline__ ++ ++#elif TMFL_OS_IS_PSOS && TMFL_CPU_IS_TM ++ // TriMedia keyword is already inline ++ ++#elif TMFL_OS_IS_ECOS && TMFL_CPU_IS_MIPS ++ ++#define inline __inline__ ++ ++// #elif (TMFL_OS_IS_HPUNIX || TMFL_OS_IS_NULLOS) ++ // ++ // TMFL_OS_IS_HPUNIX is the HP Unix workstation target OS environment for the ++ // DVP SDE2 using the GNU gcc toolset. It is the same as TMFL_OS_IS_NULLOS ++ // (which is inaccurately named because it is the HP Unix CPU/OS target ++ // environment). ++ // ++ /* LM; 02/07/2202; to be able to use Insure, I modify the definition of inline */ ++ /* #define inline __inline__ */ ++// #define inline ++ ++#elif TMFL_OS_IS_ECOS && TMFL_CPU_IS_MIPS ++ ++#define inline ++ ++#else // TMFL_OS_IS_??? ++ ++#error confusing value in TMFL_OS! ++ ++#endif // TMFL_OS_IS_XXX ++ ++ /*Assume that |restrict| is supported by tmcc and C99 compilers only. More ++ discrimination in this area may be added here as necessary.*/ ++#if !(defined __TCS__ || \ ++ (defined __STDC_VERSION__ && __STDC_VERSION__ > 199409L)) ++#define restrict /**/ ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif //ndef TMNXTYPES_H ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\inc\tmCompId.h ++ ++ ++/*==========================================================================*/ ++/* (Copyright (C) 2003 Koninklijke Philips Electronics N.V. */ ++/* All rights reserved. */ ++/* This source code and any compilation or derivative thereof is the */ ++/* proprietary information of Koninklijke Philips Electronics N.V. */ ++/* and is confidential in nature. */ ++/* Under no circumstances is this software to be exposed to or placed */ ++/* under an Open Source License of any type without the expressed */ ++/* written permission of Koninklijke Philips Electronics N.V. */ ++/*==========================================================================*/ ++//----------------------------------------------------------------------------- ++// MoReUse - 2001-11-12 Continuus Version 16 ++// ++// Added ++// CID_COMP_TRICK ++// CID_COMP_TODISK ++// CID_COMP_FROMDISK ++// ++// Removed ++// CID_COMP_RTC Twice the same request - duplicate removed ++// ++// (C) Copyright 2000-2001 Koninklijke Philips Electronics N.V., ++// All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of Philips Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of Philips ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than Philips Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmCompId.h ++// ++// DESCRIPTION: This header file identifies the standard component identifiers ++// for DVP platforms. The objective of DVP component IDs is to ++// enable unique identification of software components at all ++// classes, types, and layers. In addition, standard status ++// values are also defined to make determination of typical error ++// cases much easier. The component identifier bitfields are ++// four bit aligned to ease in reading the hexadecimal value. ++// ++// The process to create a new component ID follows the sequence ++// of steps: ++// ++// 1) Select a component class: The class is the most general ++// component classification. If none of the classifications ++// match and the component can still be uniquely identified ++// by its type/tag/layer combination, use CID_CLASS_NONE. ++// For customers, the CID_CLASS_CUSTOMER value is defined. ++// If that value is used in the CID_CLASS_BITMASK field, ++// all other bits in the component ID are user defined. ++// ++// 2) Select a component type: The component type is used to ++// classify how a component processes data. Components may ++// have only output pins (source), only input pins (sink), ++// input and output pins with or without data modifications ++// (filter), control of data flow without input/output pins ++// (control), data storage/access/retrieval (database), ++// or component group (subsystem). If the component does ++// not fit into any type classification, use CID_TYPE_NONE. ++// ++// 3) Create a component ID: The component ID is used to ++// classify the specific type and/or attributes of a software ++// component API interface. The currently defined list should ++// be scanned for a component match. If no component match ++// can be found, define a new component tag that descibes the ++// component clearly. Component name abbreviations/acronyms ++// are generally used; build a name starting from left to ++// right with the most general ('A' or 'AUD' for audio, 'V' or ++// 'VID' for video, etc.) to the most specific ('AC3' or 'MP3' ++// as specific audio filter types) terms for the component. ++// ++// NOTE: Component layer (CID_LAYER_XXX) and status (CID_ERR_XXX) ++// values are defined within the software component APIs ++// header files, not in this file. ++// ++// DOCUMENT REF: DVP Software Coding Guidelines specification ++// DVP/MoReUse Naming Conventions specification ++// ++// NOTES: The 32 bit component identifier bitfields are defined in the ++// diagram below: ++// ++// +----------------------------------------- 4 bit Component Class ++// / +----------------------------------- 4 bit Component Type ++// / / +-------------------------- 8 bit Component Tag ++// / / / +----------------- 4 bit Component Layer ++// / / / / +----- 12 bit Component Status ++// / / / / / ++// |31 28|27 24|23 16|15 12|11 0| bit ++// +------+------+------------+------+------------------+ ++// |Class | Type |ComponentTag|Layer | Error/Progress | ++// +------+------+------------+------+------------------+ ++// ++//----------------------------------------------------------------------------- ++// ++#ifndef TMCOMPID_H //------------------- ++#define TMCOMPID_H ++ ++//----------------------------------------------------------------------------- ++// Standard include files: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Project include files: ++//----------------------------------------------------------------------------- ++// ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++//----------------------------------------------------------------------------- ++// Types and defines: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// TM_OK is the 32 bit global status value used by all DVP software components ++// to indicate successful function/operation status. If a non-zero value is ++// returned as status, it should use the component ID formats defined. ++// ++#define TM_OK 0 // Global success return status ++ ++ ++// ++// NOTE: Component ID types are defined as unsigned 32 bit integers (UInt32). ++// ++//----------------------------------------------------------------------------- ++// Component Class definitions (bits 31:28, 4 bits) ++// NOTE: A class of 0x0 must not be defined to ensure that the overall 32 bit ++// component ID/status combination is always non-0 (no TM_OK conflict). ++// ++#define CID_CLASS_BITSHIFT 28 // Component class bit shift ++#define CID_CLASS_BITMASK (0xF << CID_CLASS_BITSHIFT) // Class AND bitmsk ++#define CID_GET_CLASS(compId) ((compId & CID_CLASS_BITMASK) >> CID_CLASS_BITSHIFT) ++// ++#define CID_CLASS_NONE (0x1 << CID_CLASS_BITSHIFT) // No class information ++#define CID_CLASS_VIDEO (0x2 << CID_CLASS_BITSHIFT) // Video data component ++#define CID_CLASS_AUDIO (0x3 << CID_CLASS_BITSHIFT) // Audio data component ++#define CID_CLASS_GRAPHICS (0x4 << CID_CLASS_BITSHIFT) // Graphics component ++#define CID_CLASS_BUS (0x5 << CID_CLASS_BITSHIFT) // In/out/control bus ++#define CID_CLASS_INFRASTR (0x6 << CID_CLASS_BITSHIFT) // Infrastructure comp. ++ // Up to 0xE = Philips reserved class IDs ++#define CID_CLASS_CUSTOMER (0xF << CID_CLASS_BITSHIFT) // Customer rsvd class ++ ++ ++//----------------------------------------------------------------------------- ++// Component Type definitions (bits 27:24, 4 bits) ++// ++#define CID_TYPE_BITSHIFT 24 // Component type bit shift ++#define CID_TYPE_BITMASK (0xF << CID_TYPE_BITSHIFT) // Type AND bitmask ++#define CID_GET_TYPE(compId) ((compId & CID_TYPE_BITMASK) >> CID_TYPE_BITSHIFT) ++// ++#define CID_TYPE_NONE (0x0 << CID_TYPE_BITSHIFT) // No data connections ++#define CID_TYPE_SOURCE (0x1 << CID_TYPE_BITSHIFT) // Source, output pins ++#define CID_TYPE_SINK (0x2 << CID_TYPE_BITSHIFT) // Sink, input pins ++#define CID_TYPE_ENCODER (0x3 << CID_TYPE_BITSHIFT) // Data encoder ++#define CID_TYPE_DECODER (0x4 << CID_TYPE_BITSHIFT) // Data decoder ++#define CID_TYPE_MUX (0x5 << CID_TYPE_BITSHIFT) // Data multiplexer ++#define CID_TYPE_DEMUX (0x6 << CID_TYPE_BITSHIFT) // Data demultiplexer ++#define CID_TYPE_DIGITIZER (0x7 << CID_TYPE_BITSHIFT) // Data digitizer ++#define CID_TYPE_RENDERER (0x8 << CID_TYPE_BITSHIFT) // Data renderer ++#define CID_TYPE_FILTER (0x9 << CID_TYPE_BITSHIFT) // Data filter/processr ++#define CID_TYPE_CONTROL (0xA << CID_TYPE_BITSHIFT) // Data control/switch ++#define CID_TYPE_DATABASE (0xB << CID_TYPE_BITSHIFT) // Data store/access ++#define CID_TYPE_SUBSYSTEM (0xC << CID_TYPE_BITSHIFT) // MultiComp subsystem ++#define CID_TYPE_CUSTOMER (0xF << CID_TYPE_BITSHIFT) // Customer Defined Type ++ // Up to 0xF = Philips reserved type IDs ++ ++ ++//----------------------------------------------------------------------------- ++// Component Tag definitions (bits 23:16, 8 bits) ++// NOTE: Component tags are defined in groups, dependent on the class and type. ++// ++#define CID_TAG_BITSHIFT 16 // Component tag bit shift ++#define CID_TAG_BITMASK (0xFF << CID_TAG_BITSHIFT) // Comp tag AND bitmask ++// ++#define CID_TAG_NONE (0x00 << CID_TAG_BITSHIFT) // No tag information ++ // Up to 0xFF = Philips reserved component tags ++#define CID_TAG_CUSTOMER (0xE0 << CID_TAG_BITSHIFT) ++ ++#define TAG(number) ((number) << CID_TAG_BITSHIFT) // Create tag from num ++ ++//----------------------------------------------------------------------------- ++// Component Layer definitions (bits 15:12, 4 bits) ++// ++#define CID_LAYER_BITSHIFT 12 // Component layer bit shift ++#define CID_LAYER_BITMASK (0xF << CID_LAYER_BITSHIFT) // Layer AND bitmask ++#define CID_GET_LAYER(compId) ((compId & CID_LAYER_BITMASK) >> CID_LAYER_BITSHIFT) ++// ++#define CID_LAYER_NONE (0x0 << CID_LAYER_BITSHIFT) // No layer info ++#define CID_LAYER_BTM (0x1 << CID_LAYER_BITSHIFT) // Boot manager layer ++#define CID_LAYER_HWAPI (0x2 << CID_LAYER_BITSHIFT) // Hardware API layer ++#define CID_LAYER_BSL (0x3 << CID_LAYER_BITSHIFT) // Board Supp. Lib lyr ++#define CID_LAYER_DEVLIB (0x4 << CID_LAYER_BITSHIFT) // Device Library lyr ++#define CID_LAYER_TMAL (0x5 << CID_LAYER_BITSHIFT) // Application layer ++#define CID_LAYER_TMOL (0x6 << CID_LAYER_BITSHIFT) // OSDependent layer ++#define CID_LAYER_CUSTOMER (0xF << CID_LAYER_BITSHIFT) // Customer Defined Layer ++ // Up to 0xF = Philips reserved layer IDs ++ ++ ++ ++//----------------------------------------------------------------------------- ++// Component Identifier definitions (bits 31:12, 20 bits) ++// NOTE: These DVP platform component identifiers are designed to be unique ++// within the system. The component identifier encompasses the class ++// (CID_CLASS_XXX), type (CID_TYPE_XXX), tag, and layer (CID_LAYER_XXX) ++// fields to form the unique component identifier. This allows any ++// error/progress status value to be identified as to its original ++// source, whether or not the source component's header file is present. ++// The standard error/progress status definitions should be used ++// whenever possible to ease status interpretation. No layer ++// information is defined at this point; it should be OR'd into the API ++// status values defined in the API's header file. ++// ++#if (CID_LAYER_NONE != 0) ++#error ERROR: DVP component identifiers require the layer type 'NONE' = 0 ! ++#endif ++ ++// ++// Classless Types/Components (don't fit into other class categories) ++// ++#define CTYP_NOCLASS_NOTYPE (CID_CLASS_NONE | CID_TYPE_NONE) ++#define CTYP_NOCLASS_SOURCE (CID_CLASS_NONE | CID_TYPE_SOURCE) ++#define CTYP_NOCLASS_SINK (CID_CLASS_NONE | CID_TYPE_SINK) ++#define CTYP_NOCLASS_MUX (CID_CLASS_NONE | CID_TYPE_MUX) ++#define CTYP_NOCLASS_DEMUX (CID_CLASS_NONE | CID_TYPE_DEMUX) ++#define CTYP_NOCLASS_FILTER (CID_CLASS_NONE | CID_TYPE_FILTER) ++#define CTYP_NOCLASS_CONTROL (CID_CLASS_NONE | CID_TYPE_CONTROL) ++#define CTYP_NOCLASS_DATABASE (CID_CLASS_NONE | CID_TYPE_DATABASE) ++#define CTYP_NOCLASS_SUBSYS (CID_CLASS_NONE | CID_TYPE_SUBSYSTEM) ++// ++#define CID_COMP_CLOCK (TAG(0x01) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_DMA (TAG(0x02) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_PIC (TAG(0x03) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_NORFLASH (TAG(0x04) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_NANDFLASH (TAG(0x05) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_GPIO (TAG(0x06) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_SMARTCARD (TAG(0x07) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_UDMA (TAG(0x08) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_DSP (TAG(0x09) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TIMER (TAG(0x0A) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TSDMA (TAG(0x0B) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_MMIARB (TAG(0x0C) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_EEPROM (TAG(0x0D) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_PARPORT (TAG(0x0E) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_VSS (TAG(0x0F) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TSIO (TAG(0x10) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_DBG (TAG(0x11) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TTE (TAG(0x12) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_AVPROP (TAG(0x13) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_BLASTER (TAG(0x14) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_CAPTURE (TAG(0x15) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_STP (TAG(0x16) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_SYN (TAG(0x17) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TTX (TAG(0x18) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_MIU (TAG(0x19) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_INTDRV (TAG(0x1A) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_RESET (TAG(0x1B) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_CONFIG (TAG(0x1C) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_VCTRL (TAG(0x1D) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_TUNER (TAG(0x1E) | CTYP_NOCLASS_NOTYPE) ++#define CID_COMP_DEMOD (TAG(0x1F) | CTYP_NOCLASS_NOTYPE) ++ ++ ++#define CID_COMP_FREAD (TAG(0x01) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_CDRREAD (TAG(0x02) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_VSB (TAG(0x03) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_ANALOGTVTUNER (TAG(0x04) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_TPINMPEG2 (TAG(0x05) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_DREAD (TAG(0x06) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_TREAD (TAG(0x07) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_RTC (TAG(0x08) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_TOUCHC (TAG(0x09) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_KEYPAD (TAG(0x0A) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_ADC (TAG(0x0B) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_READLIST (TAG(0x0C) | CTYP_NOCLASS_SOURCE) ++#define CID_COMP_FROMDISK (TAG(0x0D) | CTYP_NOCLASS_SOURCE) ++ ++#define CID_COMP_FWRITE (TAG(0x01) | CTYP_NOCLASS_SINK) ++#define CID_COMP_CDWRITE (TAG(0x02) | CTYP_NOCLASS_SINK) ++#define CID_COMP_CHARLCD (TAG(0x03) | CTYP_NOCLASS_SINK) ++#define CID_COMP_PWM (TAG(0x04) | CTYP_NOCLASS_SINK) ++#define CID_COMP_DAC (TAG(0x05) | CTYP_NOCLASS_SINK) ++#define CID_COMP_TSDMAINJECTOR (TAG(0x06) | CTYP_NOCLASS_SINK) ++#define CID_COMP_TODISK (TAG(0x07) | CTYP_NOCLASS_SINK) ++ ++#define CID_COMP_MUXMPEGPS (TAG(0x01) | CTYP_NOCLASS_MUX) ++#define CID_COMP_MUXMPEG (TAG(0x02) | CTYP_NOCLASS_MUX) ++ ++#define CID_COMP_DEMUXMPEGTS (TAG(0x01) | CTYP_NOCLASS_DEMUX) ++#define CID_COMP_DEMUXMPEGPS (TAG(0x02) | CTYP_NOCLASS_DEMUX) ++ ++#define CID_COMP_COPYIO (TAG(0x01) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_COPYINPLACE (TAG(0x02) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_UART (TAG(0x03) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_SSI (TAG(0x04) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_MODEMV34 (TAG(0x05) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_MODEMV42 (TAG(0x06) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_HTMLPARSER (TAG(0x07) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_VMSP (TAG(0x08) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_X (TAG(0x09) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_TXTSUBTDECEBU (TAG(0x0A) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_CPI (TAG(0x0B) | CTYP_NOCLASS_FILTER) ++#define CID_COMP_TRICK (TAG(0x0C) | CTYP_NOCLASS_FILTER) ++ ++#define CID_COMP_REMCTL5 (TAG(0x01) | CTYP_NOCLASS_CONTROL) ++#define CID_COMP_INFRARED (TAG(0x02) | CTYP_NOCLASS_CONTROL) ++ ++#define CID_COMP_PSIP (TAG(0x01) | CTYP_NOCLASS_DATABASE) ++#define CID_COMP_IDE (TAG(0x02) | CTYP_NOCLASS_DATABASE) ++#define CID_COMP_DISKSCHED (TAG(0x03) | CTYP_NOCLASS_DATABASE) ++#define CID_COMP_AVFS (TAG(0x04) | CTYP_NOCLASS_DATABASE) ++#define CID_COMP_MDB (TAG(0x05) | CTYP_NOCLASS_DATABASE) ++ ++#define CID_COMP_IRDMMPEG (TAG(0x01) | CTYP_NOCLASS_SUBSYS) ++#define CID_COMP_STORSYS (TAG(0x02) | CTYP_NOCLASS_SUBSYS) ++ ++// ++// Video Class Types/Components (video types handle video/graphics data) ++// ++#define CTYP_VIDEO_SINK (CID_CLASS_VIDEO | CID_TYPE_SINK) ++#define CTYP_VIDEO_SOURCE (CID_CLASS_VIDEO | CID_TYPE_SOURCE) ++#define CTYP_VIDEO_ENCODER (CID_CLASS_VIDEO | CID_TYPE_ENCODER) ++#define CTYP_VIDEO_DECODER (CID_CLASS_VIDEO | CID_TYPE_DECODER) ++#define CTYP_VIDEO_DIGITIZER (CID_CLASS_VIDEO | CID_TYPE_DIGITIZER) ++#define CTYP_VIDEO_RENDERER (CID_CLASS_VIDEO | CID_TYPE_RENDERER) ++#define CTYP_VIDEO_FILTER (CID_CLASS_VIDEO | CID_TYPE_FILTER) ++#define CTYP_VIDEO_SUBSYS (CID_CLASS_VIDEO | CID_TYPE_SUBSYSTEM) ++// ++#define CID_COMP_LCD (TAG(0x01) | CTYP_VIDEO_SINK) ++ ++#define CID_COMP_VCAPVI (TAG(0x01) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_VIP (TAG(0x02) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_VI (TAG(0x03) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_VSLICER (TAG(0x04) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_FBREAD (TAG(0x05) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_QVI (TAG(0x06) | CTYP_VIDEO_SOURCE) ++#define CID_COMP_CAMERA (TAG(0x07) | CTYP_VIDEO_SOURCE) ++ ++#define CID_COMP_VENCM1 (TAG(0x01) | CTYP_VIDEO_ENCODER) ++#define CID_COMP_VENCM2 (TAG(0x02) | CTYP_VIDEO_ENCODER) ++#define CID_COMP_VENCMJ (TAG(0x03) | CTYP_VIDEO_ENCODER) ++#define CID_COMP_VENCH263 (TAG(0x04) | CTYP_VIDEO_ENCODER) ++#define CID_COMP_VENCH261 (TAG(0x05) | CTYP_VIDEO_ENCODER) ++ ++#define CID_COMP_VDECM1 (TAG(0x01) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECM2 (TAG(0x02) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECMPEG (TAG(0x03) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECMJ (TAG(0x04) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECSUBPICSVCD (TAG(0x05) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECH263 (TAG(0x06) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECH261 (TAG(0x07) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDEC (TAG(0x08) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECSUBPICDVD (TAG(0x09) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECSUBPICBMPDVD (TAG(0x0A) | CTYP_VIDEO_DECODER) ++#define CID_COMP_VDECSUBPICRENDDVD (TAG(0x0B) | CTYP_VIDEO_DECODER) ++#define CID_COMP_M4PP (TAG(0x0C) | CTYP_VIDEO_DECODER) ++#define CID_COMP_M4MC (TAG(0x0D) | CTYP_VIDEO_DECODER) ++#define CID_COMP_M4CSC (TAG(0x0E) | CTYP_VIDEO_DECODER) ++ ++#define CID_COMP_VDIG (TAG(0x01) | CTYP_VIDEO_DIGITIZER) ++#define CID_COMP_VDIGVIRAW (TAG(0x02) | CTYP_VIDEO_DIGITIZER) ++ ++#define CID_COMP_VREND (TAG(0x01) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_HDVO (TAG(0x02) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_VRENDGFXVO (TAG(0x03) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_AICP (TAG(0x04) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_VRENDVORAW (TAG(0x05) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_VO (TAG(0x06) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_QVO (TAG(0x06) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_VRENDVOICP (TAG(0x07) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_VMIX (TAG(0x08) | CTYP_VIDEO_RENDERER) ++#define CID_COMP_GFX (TAG(0x09) | CTYP_VIDEO_RENDERER) ++ ++#define CID_COMP_MBS (TAG(0x01) | CTYP_VIDEO_FILTER) ++#define CID_COMP_VTRANS (TAG(0x02) | CTYP_VIDEO_FILTER) ++#define CID_COMP_QNM (TAG(0x03) | CTYP_VIDEO_FILTER) ++#define CID_COMP_ICP (TAG(0x04) | CTYP_VIDEO_FILTER) ++#define CID_COMP_VTRANSNM (TAG(0x05) | CTYP_VIDEO_FILTER) ++#define CID_COMP_QFD (TAG(0x06) | CTYP_VIDEO_FILTER) // film detector ++#define CID_COMP_VRENDDVDVO (TAG(0x07) | CTYP_VIDEO_FILTER) ++#define CID_COMP_VTRANSCRYSTAL (TAG(0x08) | CTYP_VIDEO_FILTER) ++ ++#define CID_COMP_VSYSMT3 (TAG(0x01) | CTYP_VIDEO_SUBSYS) //obsolescent ++#define CID_COMP_VSYSSTB (TAG(0x01) | CTYP_VIDEO_SUBSYS) ++#define CID_COMP_DVDVIDSYS (TAG(0x02) | CTYP_VIDEO_SUBSYS) ++#define CID_COMP_VDECUD (TAG(0x03) | CTYP_VIDEO_SUBSYS) ++#define CID_COMP_VIDSYS (TAG(0x04) | CTYP_VIDEO_SUBSYS) ++// ++// Audio Class Types/Components (audio types primarily handle audio data) ++// ++#define CTYP_AUDIO_NONE (CID_CLASS_AUDIO | CID_TYPE_NONE) ++#define CTYP_AUDIO_SINK (CID_CLASS_AUDIO | CID_TYPE_SINK) ++#define CTYP_AUDIO_SOURCE (CID_CLASS_AUDIO | CID_TYPE_SOURCE) ++#define CTYP_AUDIO_ENCODER (CID_CLASS_AUDIO | CID_TYPE_ENCODER) ++#define CTYP_AUDIO_DECODER (CID_CLASS_AUDIO | CID_TYPE_DECODER) ++#define CTYP_AUDIO_DIGITIZER (CID_CLASS_AUDIO | CID_TYPE_DIGITIZER) ++#define CTYP_AUDIO_RENDERER (CID_CLASS_AUDIO | CID_TYPE_RENDERER) ++#define CTYP_AUDIO_FILTER (CID_CLASS_AUDIO | CID_TYPE_FILTER) ++#define CTYP_AUDIO_SUBSYS (CID_CLASS_AUDIO | CID_TYPE_SUBSYSTEM) ++// ++ ++#define CID_COMP_AI (TAG(0x01) | CTYP_AUDIO_NONE) ++#define CID_COMP_AO (TAG(0x03) | CTYP_AUDIO_NONE) ++#define CID_COMP_ADAI (TAG(0x04) | CTYP_AUDIO_NONE) ++ ++#define CID_COMP_SDAC (TAG(0x01) | CTYP_AUDIO_SINK) ++ ++#define CID_COMP_ADIGAI (TAG(0x01) | CTYP_AUDIO_DIGITIZER) ++#define CID_COMP_ADIGSPDIF (TAG(0x02) | CTYP_AUDIO_DIGITIZER) ++ ++#define CID_COMP_ARENDAO (TAG(0x01) | CTYP_AUDIO_RENDERER) ++#define CID_COMP_ARENDSPDIF (TAG(0x02) | CTYP_AUDIO_RENDERER) ++ ++#define CID_COMP_NOISESEQ (TAG(0x03) | CTYP_AUDIO_SOURCE) ++ ++#define CID_COMP_AENCAC3 (TAG(0x01) | CTYP_AUDIO_ENCODER) ++#define CID_COMP_AENCMPEG1 (TAG(0x02) | CTYP_AUDIO_ENCODER) ++#define CID_COMP_AENCAAC (TAG(0x03) | CTYP_AUDIO_ENCODER) ++#define CID_COMP_AENCG723 (TAG(0x04) | CTYP_AUDIO_ENCODER) ++#define CID_COMP_AENCG728 (TAG(0x05) | CTYP_AUDIO_ENCODER) ++#define CID_COMP_AENCWMA (TAG(0x06) | CTYP_AUDIO_ENCODER) ++ ++#define CID_COMP_ADECPROLOGIC (TAG(0x01) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECAC3 (TAG(0x02) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECMPEG1 (TAG(0x03) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECMP3 (TAG(0x04) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECAAC (TAG(0x05) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECG723 (TAG(0x06) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECG728 (TAG(0x07) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECWMA (TAG(0x08) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADECTHRU (TAG(0x09) | CTYP_AUDIO_DECODER) ++#define CID_COMP_ADEC (TAG(0x0A) | CTYP_AUDIO_DECODER) ++ ++#define CID_COMP_ASPLIB (TAG(0x01) | CTYP_AUDIO_FILTER) ++#define CID_COMP_IIR (TAG(0x02) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPEQ2 (TAG(0x03) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPEQ5 (TAG(0x04) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPBASSREDIR (TAG(0x05) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPLAT2 (TAG(0x06) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPPLUGIN (TAG(0x07) | CTYP_AUDIO_FILTER) ++#define CID_COMP_AMIXDTV (TAG(0x08) | CTYP_AUDIO_FILTER) ++#define CID_COMP_AMIXSIMPLE (TAG(0x09) | CTYP_AUDIO_FILTER) ++#define CID_COMP_AMIXSTB (TAG(0x0A) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ASPEQ (TAG(0x0B) | CTYP_AUDIO_FILTER) ++#define CID_COMP_ATESTSIG (TAG(0x0C) | CTYP_AUDIO_FILTER) ++ ++#define CID_COMP_AUDSUBSYS (TAG(0x01) | CTYP_AUDIO_SUBSYS) ++#define CID_COMP_AUDSYSSTB (TAG(0x02) | CTYP_AUDIO_SUBSYS) ++#define CID_COMP_AUDSYSDVD (TAG(0x03) | CTYP_AUDIO_SUBSYS) ++ ++// ++// Graphics Class Types/Components ++// ++#define CTYP_GRAPHICS_RENDERER (CID_CLASS_GRAPHICS | CID_TYPE_SINK) ++// ++#define CID_COMP_WM (TAG(0x01) | CTYP_GRAPHICS_RENDERER) ++#define CID_COMP_WIDGET (TAG(0x02) | CTYP_GRAPHICS_RENDERER) ++#define CID_COMP_OM (TAG(0x03) | CTYP_GRAPHICS_RENDERER) ++#define CID_COMP_HTMLRENDER (TAG(0x04) | CTYP_GRAPHICS_RENDERER) ++#define CID_COMP_VRENDEIA708 (TAG(0x05) | CTYP_GRAPHICS_RENDERER) ++#define CID_COMP_VRENDEIA608 (TAG(0x06) | CTYP_GRAPHICS_RENDERER) ++// ++#define CTYP_GRAPHICS_DRAW (CID_CLASS_GRAPHICS | CID_TYPE_NONE) ++// ++#define CID_COMP_DRAW (TAG(0x10) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_UT (TAG(0x11) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_DE (TAG(0x12) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_REF (TAG(0x13) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_TMH (TAG(0x14) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_TMT (TAG(0x15) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_DRAW_TMTH (TAG(0x16) | CTYP_GRAPHICS_DRAW) ++// ++#define CID_COMP_3D (TAG(0x30) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_JAWT (TAG(0x31) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_JINPUT (TAG(0x32) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_LWM (TAG(0x33) | CTYP_GRAPHICS_DRAW) ++#define CID_COMP_2D (TAG(0x34) | CTYP_GRAPHICS_DRAW) ++ ++ ++// ++// Bus Class Types/Components (busses connect hardware components together) ++// ++#define CTYP_BUS_NOTYPE (CID_CLASS_BUS | CID_TYPE_NONE) ++// ++#define CID_COMP_XIO (TAG(0x01) | CTYP_BUS_NOTYPE) ++#define CID_COMP_IIC (TAG(0x02) | CTYP_BUS_NOTYPE) ++#define CID_COMP_PCI (TAG(0x03) | CTYP_BUS_NOTYPE) ++#define CID_COMP_P1394 (TAG(0x04) | CTYP_BUS_NOTYPE) ++#define CID_COMP_ENET (TAG(0x05) | CTYP_BUS_NOTYPE) ++#define CID_COMP_ATA (TAG(0x06) | CTYP_BUS_NOTYPE) ++#define CID_COMP_CAN (TAG(0x07) | CTYP_BUS_NOTYPE) ++#define CID_COMP_UCGDMA (TAG(0x08) | CTYP_BUS_NOTYPE) ++#define CID_COMP_I2S (TAG(0x09) | CTYP_BUS_NOTYPE) ++#define CID_COMP_SPI (TAG(0x0A) | CTYP_BUS_NOTYPE) ++#define CID_COMP_PCM (TAG(0x0B) | CTYP_BUS_NOTYPE) ++#define CID_COMP_L3 (TAG(0x0C) | CTYP_BUS_NOTYPE) ++ ++// ++// Infrastructure Class Types/Components ++#define CTYP_INFRASTR_NOTYPE (CID_CLASS_INFRASTR | CID_TYPE_NONE) ++// ++#define CID_COMP_OSAL (TAG(0x01) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_MML (TAG(0x02) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_TSSA_DEFAULTS (TAG(0x03) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_RPC (TAG(0x04) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_THI (TAG(0x05) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_REGISTRY (TAG(0x06) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_TMMAN (TAG(0x07) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_LDT (TAG(0x08) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_CPUCONN (TAG(0x09) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_COMMQUE (TAG(0x0A) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_BSLMGR (TAG(0x0B) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_CR (TAG(0x0C) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_NODE (TAG(0x0D) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_COM (TAG(0x0E) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_UTIL (TAG(0x0F) | CTYP_INFRASTR_NOTYPE) ++#define CID_COMP_SGLIST (TAG(0x10) | CTYP_INFRASTR_NOTYPE) ++ ++//----------------------------------------------------------------------------- ++// Component Standard Error/Progress Status definitions (bits 11:0, 12 bits) ++// NOTE: These status codes are OR'd with the component identifier to create ++// component unique 32 bit status values. The component status values ++// should be defined in the header files where the APIs are defined. ++// ++#define CID_ERR_BITMASK 0xFFF // Component error AND bitmask ++#define CID_ERR_BITSHIFT 0 // Component error bit shift ++#define CID_GET_ERROR(compId) ((compId & CID_ERR_BITMASK) >> CID_ERR_BITSHIFT) ++// ++#define TM_ERR_COMPATIBILITY 0x001 // SW Interface compatibility ++#define TM_ERR_MAJOR_VERSION 0x002 // SW Major Version error ++#define TM_ERR_COMP_VERSION 0x003 // SW component version error ++#define TM_ERR_BAD_MODULE_ID 0x004 // SW - HW module ID error ++#define TM_ERR_BAD_UNIT_NUMBER 0x005 // Invalid device unit number ++#define TM_ERR_BAD_INSTANCE 0x006 // Bad input instance value ++#define TM_ERR_BAD_HANDLE 0x007 // Bad input handle ++#define TM_ERR_BAD_INDEX 0x008 // Bad input index ++#define TM_ERR_BAD_PARAMETER 0x009 // Invalid input parameter ++#define TM_ERR_NO_INSTANCES 0x00A // No instances available ++#define TM_ERR_NO_COMPONENT 0x00B // Component is not present ++#define TM_ERR_NO_RESOURCES 0x00C // Resource is not available ++#define TM_ERR_INSTANCE_IN_USE 0x00D // Instance is already in use ++#define TM_ERR_RESOURCE_OWNED 0x00E // Resource is already in use ++#define TM_ERR_RESOURCE_NOT_OWNED 0x00F // Caller does not own resource ++#define TM_ERR_INCONSISTENT_PARAMS 0x010 // Inconsistent input params ++#define TM_ERR_NOT_INITIALIZED 0x011 // Component is not initialized ++#define TM_ERR_NOT_ENABLED 0x012 // Component is not enabled ++#define TM_ERR_NOT_SUPPORTED 0x013 // Function is not supported ++#define TM_ERR_INIT_FAILED 0x014 // Initialization failed ++#define TM_ERR_BUSY 0x015 // Component is busy ++#define TM_ERR_NOT_BUSY 0x016 // Component is not busy ++#define TM_ERR_READ 0x017 // Read error ++#define TM_ERR_WRITE 0x018 // Write error ++#define TM_ERR_ERASE 0x019 // Erase error ++#define TM_ERR_LOCK 0x01A // Lock error ++#define TM_ERR_UNLOCK 0x01B // Unlock error ++#define TM_ERR_OUT_OF_MEMORY 0x01C // Memory allocation failed ++#define TM_ERR_BAD_VIRT_ADDRESS 0x01D // Bad virtual address ++#define TM_ERR_BAD_PHYS_ADDRESS 0x01E // Bad physical address ++#define TM_ERR_TIMEOUT 0x01F // Timeout error ++#define TM_ERR_OVERFLOW 0x020 // Data overflow/overrun error ++#define TM_ERR_FULL 0x021 // Queue (etc.) is full ++#define TM_ERR_EMPTY 0x022 // Queue (etc.) is empty ++#define TM_ERR_NOT_STARTED 0x023 // Component stream not started ++#define TM_ERR_ALREADY_STARTED 0x024 // Comp. stream already started ++#define TM_ERR_NOT_STOPPED 0x025 // Component stream not stopped ++#define TM_ERR_ALREADY_STOPPED 0x026 // Comp. stream already stopped ++#define TM_ERR_ALREADY_SETUP 0x027 // Component already setup ++#define TM_ERR_NULL_PARAMETER 0x028 // Null input parameter ++#define TM_ERR_NULL_DATAINFUNC 0x029 // Null data input function ++#define TM_ERR_NULL_DATAOUTFUNC 0x02A // Null data output function ++#define TM_ERR_NULL_CONTROLFUNC 0x02B // Null control function ++#define TM_ERR_NULL_COMPLETIONFUNC 0x02C // Null completion function ++#define TM_ERR_NULL_PROGRESSFUNC 0x02D // Null progress function ++#define TM_ERR_NULL_ERRORFUNC 0x02E // Null error handler function ++#define TM_ERR_NULL_MEMALLOCFUNC 0x02F // Null memory alloc function ++#define TM_ERR_NULL_MEMFREEFUNC 0x030 // Null memory free function ++#define TM_ERR_NULL_CONFIGFUNC 0x031 // Null configuration function ++#define TM_ERR_NULL_PARENT 0x032 // Null parent data ++#define TM_ERR_NULL_IODESC 0x033 // Null in/out descriptor ++#define TM_ERR_NULL_CTRLDESC 0x034 // Null control descriptor ++#define TM_ERR_UNSUPPORTED_DATACLASS 0x035 // Unsupported data class ++#define TM_ERR_UNSUPPORTED_DATATYPE 0x036 // Unsupported data type ++#define TM_ERR_UNSUPPORTED_DATASUBTYPE 0x037 // Unsupported data subtype ++#define TM_ERR_FORMAT 0x038 // Invalid/unsupported format ++#define TM_ERR_INPUT_DESC_FLAGS 0x039 // Bad input descriptor flags ++#define TM_ERR_OUTPUT_DESC_FLAGS 0x03A // Bad output descriptor flags ++#define TM_ERR_CAP_REQUIRED 0x03B // Capabilities required ??? ++#define TM_ERR_BAD_TMALFUNC_TABLE 0x03C // Bad TMAL function table ++#define TM_ERR_INVALID_CHANNEL_ID 0x03D // Invalid channel identifier ++#define TM_ERR_INVALID_COMMAND 0x03E // Invalid command/request ++#define TM_ERR_STREAM_MODE_CONFUSION 0x03F // Stream mode config conflict ++#define TM_ERR_UNDERRUN 0x040 // Data underflow/underrun ++#define TM_ERR_EMPTY_PACKET_RECVD 0x041 // Empty data packet received ++#define TM_ERR_OTHER_DATAINOUT_ERR 0x042 // Other data input/output err ++#define TM_ERR_STOP_REQUESTED 0x043 // Stop in progress ++#define TM_ERR_PIN_NOT_STARTED 0x044 // Pin not started ++#define TM_ERR_PIN_ALREADY_STARTED 0x045 // Pin already started ++#define TM_ERR_PIN_NOT_STOPPED 0x046 // Pin not stopped ++#define TM_ERR_PIN_ALREADY_STOPPED 0x047 // Pin already stopped ++#define TM_ERR_STOP_PIN_REQUESTED 0x048 // Stop of a single pin is in progress (obsolescent) ++#define TM_ERR_PAUSE_PIN_REQUESTED 0x048 // Stop of a single pin is in progress ++#define TM_ERR_ASSERTION 0x049 // Assertion failure ++#define TM_ERR_HIGHWAY_BANDWIDTH 0x04A // Highway bandwidth bus error ++#define TM_ERR_HW_RESET_FAILED 0x04B // Hardware reset failed ++#define TM_ERR_PIN_PAUSED 0x04C // Pin Paused ++ ++// Add new standard error/progress status codes here ++ ++#define TM_ERR_COMP_UNIQUE_START 0x800 // 0x800-0xDFF: Component unique ++ ++#define TM_ERR_CUSTOMER_START 0xC00 ++ ++// DVP Standard assert error code start offset ++// NOTE: This define should be added to the component's base error value and ++// standard error code(s) to define assert error codes. For example: ++// #define TMBSL_ERR_MGR_ASSERT_BAD_PARAM ++// (TMBSL_ERR_MGR_BASE + TM_ERR_ASSERT_START + TM_ERR_BAD_PARAMETER) ++// ++#define TM_ERR_ASSERT_START 0xE00 // 0xE00-0xEFF: Assert failures ++#define TM_ERR_ASSERT_LAST 0xEFF // Last assert error range value ++#define CID_IS_ASSERT_ERROR(compId) \ ++ ((CID_GET_ERROR(compId) >= TM_ERR_ASSERT_START) && \ ++ (CID_GET_ERROR(compId) <= TM_ERR_ASSERT_LAST)) ++ ++// DVP Standard fatal error code start offset ++// NOTE: This define should be added to the component's base error value and ++// standard error code(s) to define fatal error codes. For example: ++// #define TMML_ERR_FATAL_OUT_OF_MEMORY ++// (TMML_ERR_BASE + TM_ERR_FATAL_START + TM_ERR_OUT_OF_MEMORY) ++// ++#define TM_ERR_FATAL_START 0xF00 // 0xF00-0xFFF: Fatal failures ++#define TM_ERR_FATAL_LAST 0xFFF // Last fatal error range value ++#define CID_IS_FATAL_ERROR(compId) \ ++ ((CID_GET_ERROR(compId) >= TM_ERR_FATAL_START) && \ ++ (CID_GET_ERROR(compId) <= TM_ERR_FATAL_LAST)) ++ ++ ++//----------------------------------------------------------------------------- ++// DVP hardware module IDs ++// ++#define VMPG_100_MOD_ID 0x00000100 ++#define C1394_101_MOD_ID 0x00000101 ++#define FPBC_102_MOD_ID 0x00000102 ++#define JTAG_103_MOD_ID 0x00000103 ++#define EJTAG_104_MOD_ID 0x00000104 ++#define IIC_105_MOD_ID 0x00000105 ++#define SMCARD_106_MOD_ID 0x00000106 ++#define UART_107_MOD_ID 0x00000107 ++/* #define CLOCKS_108_MOD_ID 0x00000108 */ ++#define USB_109_MOD_ID 0x00000109 ++#define BOOT_10A_MOD_ID 0x0000010A ++#define MPBC_10B_MOD_ID 0x0000010B ++#define SSI_10C_MOD_ID 0x0000010C ++#define AI_10D_MOD_ID 0x0000010D ++#define VMSP_10E_MOD_ID 0x0000010E ++#define GPIO_10F_MOD_ID 0x0000010F ++#define SPDI_110_MOD_ID 0x00000110 ++#define AICP_111_MOD_ID 0x00000111 ++#define TPBC_112_MOD_ID 0x00000112 ++#define PCI_113_MOD_ID 0x00000113 ++#define MMI_114_MOD_ID 0x00000114 ++#define ORCA3_115_MOD_ID 0x00000115 ++#define DBG_116_MOD_ID 0x00000116 ++#define DE_117_MOD_ID 0x00000117 ++#define AICP_118_MOD_ID 0x00000118 ++#define MBS_119_MOD_ID 0x00000119 ++#define VIP_11A_MOD_ID 0x0000011A ++#define PIMI_11B_MOD_ID 0x0000011B ++#define PIB_11C_MOD_ID 0x0000011C ++#define PIC_11D_MOD_ID 0x0000011D ++#define TMDBG_11F_MOD_ID 0x0000011F ++#define AO_120_MOD_ID 0x00000120 ++#define SPDO_121_MOD_ID 0x00000121 ++#define FPIMI_122_MOD_ID 0x00000122 ++#define RESET_123_MOD_ID 0x00000123 ++#define NULL_124_MOD_ID 0x00000124 ++#define TSDMA_125_MOD_ID 0x00000125 ++#define GLBREG_126_MOD_ID 0x00000126 ++#define TMDBG_127_MOD_ID 0x00000127 ++#define GLBREG_128_MOD_ID 0x00000128 ++#define DMA_130_MOD_ID 0x00000130 ++#define IR_131_MOD_ID 0x00000131 ++#define GFX2D_131_MOD_ID 0x00000132 // TODO: Remove after code corrected ++#define GFX2D_132_MOD_ID 0x00000132 ++#define P1284_133_MOD_ID 0x00000133 ++#define QNM_134_MOD_ID 0x00000134 ++#define OSD_136_MOD_ID 0x00000136 ++#define MIX_137_MOD_ID 0x00000137 ++#define DENC_138_MOD_ID 0x00000138 ++#define SYN_13A_MOD_ID 0x0000013A ++#define CLOCKS_13E_MOD_ID 0x0000013E ++#define CONFIG_13F_MOD_ID 0x0000013F ++#define MIU_A04C_MOD_ID 0x0000A04C ++#define DISP_A04D_MOD_ID 0x0000A04D ++#define VCTRL_A04E_MOD_ID 0x0000A04E ++ ++ ++#define PR3930_2B10_MOD_ID 0x00002B10 ++#define PR3940_2B11_MOD_ID 0x00002B11 ++ ++#define TM3218_2B80_MOD_ID 0x00002B80 ++#define TM64_2b81_MOD_ID 0x00002B81 ++ ++#define QNM_A017_MOD_ID 0x0000A017 ++ ++// There is no HW module ID for TS IO ROUTER. We assign ++// a SW module ID to this module, because it is needed by Clock ++// device and HWAPI libraries. Use 010Eh for lower word ++// (for lack of better reason ! because IO Router is closely ++// associated with VMSP module) ++ ++#define IORT_1010E_MOD_ID 0x0001010E ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // TMCOMPID_H //----------------- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\inc\tmFrontEnd.h ++ ++ ++/** ++ Copyright (C) 2007 NXP B.V., All Rights Reserved. ++ This source code and any compilation or derivative thereof is the proprietary ++ information of NXP B.V. and is confidential in nature. Under no circumstances ++ is this software to be exposed to or placed under an Open Source License of ++ any type without the expressed written permission of NXP B.V. ++ * ++ * \file tmFrontEnd.h ++ * %version: CFR_STB#0.4.1.7 % ++ * ++ * \date %date_modified% ++ * ++ * \brief Describe briefly the purpose of this file. ++ * ++ * REFERENCE DOCUMENTS : ++ * ++ * Detailed description may be added here. ++ * ++ * \section info Change Information ++ * ++ * \verbatim ++ Date Modified by CRPRNr TASKNr Maintenance description ++ -------------|-----------|-------|-------|----------------------------------- ++ 26-Mar-2008 | B.GUILLOT | 13122 | 23456 | Creation ++ -------------|-----------|-------|-------|----------------------------------- ++ \endverbatim ++ * ++*/ ++ ++ ++#ifndef TMFRONTEND_H ++#define TMFRONTEND_H ++ ++/*============================================================================*/ ++/* INCLUDE FILES */ ++/*============================================================================*/ ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++ ++/*============================================================================*/ ++/* ENUM OR TYPE DEFINITION */ ++/*============================================================================*/ ++#define TMFRONTEND_DVBT2MAXPLPNB 250 ++ ++/* standard*/ ++typedef enum _tmFrontEndStandard_t { ++ tmFrontEndStandardDVBT, ++ tmFrontEndStandardDVBS, ++ tmFrontEndStandardDVBC, ++ tmFrontEndStandardDSS, ++ tmFrontEndStandardBSD, ++ tmFrontEndStandardDVBH, ++ tmFrontEndStandardAnalogDVBT, ++ tmFrontEndStandardDVBS2, ++ tmFrontEndStandardDVBT2, ++ tmFrontEndStandardMax ++} tmFrontEndStandard_t, *ptmFrontEndStandard_t; ++ ++/* spectral inversion*/ ++typedef enum _tmFrontEndSpecInv_t { ++ tmFrontEndSpecInvAuto = 0, ++ tmFrontEndSpecInvOff, ++ tmFrontEndSpecInvOn, ++ tmFrontEndSpecInvMax ++} tmFrontEndSpecInv_t, *ptmFrontEndSpecInv_t; ++ ++/* modulation*/ ++typedef enum _tmFrontEndModulation_t { ++ tmFrontEndModulationAuto = 0, ++ tmFrontEndModulationBpsk, ++ tmFrontEndModulationQpsk, ++ tmFrontEndModulationQam4, ++ tmFrontEndModulationPsk8, ++ tmFrontEndModulationQam16, ++ tmFrontEndModulationQam32, ++ tmFrontEndModulationQam64, ++ tmFrontEndModulationQam128, ++ tmFrontEndModulationQam256, ++ tmFrontEndModulationQam512, ++ tmFrontEndModulationQam1024, ++ tmFrontEndModulation8VSB, ++ tmFrontEndModulation16VSB, ++ tmFrontEndModulationQam, ++ tmFrontEndModulationMax ++} tmFrontEndModulation_t, *ptmFrontEndModulation_t; ++ ++/* viterbi rate*/ ++typedef enum _tmFrontEndCodeRate_t { ++ tmFrontEndCodeRateAuto = 0, ++ tmFrontEndCodeRate_1_4, ++ tmFrontEndCodeRate_1_3, ++ tmFrontEndCodeRate_2_5, ++ tmFrontEndCodeRate_1_2, ++ tmFrontEndCodeRate_3_5, ++ tmFrontEndCodeRate_2_3, ++ tmFrontEndCodeRate_3_4, ++ tmFrontEndCodeRate_4_5, ++ tmFrontEndCodeRate_5_6, ++ tmFrontEndCodeRate_6_7, ++ tmFrontEndCodeRate_7_8, ++ tmFrontEndCodeRate_8_9, ++ tmFrontEndCodeRate_9_10, ++ tmFrontEndCodeRate_NotRelevant, ++ tmFrontEndCodeRateMax ++} tmFrontEndCodeRate_t, *ptmFrontEndCodeRate_t; ++ ++/* frequency offset*/ ++typedef enum _tmFrontEndRfOffset_t { ++ tmFrontEndRfOffsetAuto = 0, ++ tmFrontEndRfOffsetNull, ++ tmFrontEndRfOffsetPlus125, ++ tmFrontEndRfOffsetMinus125, ++ tmFrontEndRfOffsetPlus166, ++ tmFrontEndRfOffsetMinus166, ++ tmFrontEndRfOffsetPlus333, ++ tmFrontEndRfOffsetMinus333, ++ tmFrontEndRfOffsetPlus500, ++ tmFrontEndRfOffsetMinus500, ++ tmFrontEndRfOffsetMax ++} tmFrontEndRfOffset_t, *ptmFrontEndRfOffset_t; ++ ++/* frequency offset*/ ++typedef enum _tmFrontEndRfOffsetMode_t { ++ tmFrontEndRfOffsetModeAuto, ++ tmFrontEndRfOffsetModeManual, ++ tmFrontEndRfOffsetModeMax ++} tmFrontEndRfOffsetMode_t, *ptmFrontEndRfOffsetMode_t; ++ ++/* guard interval*/ ++typedef enum _tmFrontEndGI_t { ++ tmFrontEndGIAuto = 0, ++ tmFrontEndGI_1_32, ++ tmFrontEndGI_1_16, ++ tmFrontEndGI_1_8, ++ tmFrontEndGI_1_4, ++ tmFrontEndGI_1_128, ++ tmFrontEndGI_19_128, ++ tmFrontEndGI_19_256, ++ tmFrontEndGIMax ++} tmFrontEndGI_t, *ptmFrontEndGI_t; ++ ++/* fast Fourrier transform size*/ ++typedef enum _tmFrontEndFft_t { ++ tmFrontEndFftAuto = 0, ++ tmFrontEndFft2K, ++ tmFrontEndFft8K, ++ tmFrontEndFft4K, ++ tmFrontEndFft16K, ++ tmFrontEndFft32K, ++ tmFrontEndFftMax ++} tmFrontEndFft_t, *ptmFrontEndFft_t; ++ ++/* hierarchy*/ ++typedef enum _tmFrontEndHier_t { ++ tmFrontEndHierAuto = 0, ++ tmFrontEndHierNo, ++ tmFrontEndHierAlpha1, ++ tmFrontEndHierAlpha2, ++ tmFrontEndHierAlpha4, ++ tmFrontEndHierMax ++} tmFrontEndHier_t, *ptmFrontEndHier_t; ++ ++/* priority*/ ++typedef enum _tmFrontEndPrior_t { ++ tmFrontEndPriorAuto = 0, ++ tmFrontEndPriorHigh, ++ tmFrontEndPriorLow, ++ tmFrontEndPriorMax ++} tmFrontEndPrior_t, *ptmFrontEndPrior_t; ++ ++/* roll off */ ++typedef enum _tmFrontEndRollOff_t { ++ tmFrontEndRollOffAuto = 0, ++ tmFrontEndRollOff_0_15, ++ tmFrontEndRollOff_0_20, ++ tmFrontEndRollOff_0_25, ++ tmFrontEndRollOff_0_35, ++ tmFrontEndRollOffMax ++} tmFrontEndRollOff_t, *ptmFrontEndRollOff_t; ++ ++/* LNB polarity */ ++typedef enum _tmFrontEndLNBPolarity_t { ++ tmFrontEndLNBPolarityAuto = 0, ++ tmFrontEndLNBPolarityHigh, ++ tmFrontEndLNBPolarityLow, ++ tmFrontEndLNBPolarityMax ++} tmFrontEndLNBPolarity_t, *ptmFrontEndLNBPolarity_t; ++ ++/* continuous tone */ ++typedef enum _tmFrontEndContinuousTone_t { ++ tmFrontEndContinuousToneAuto = 0, ++ tmFrontEndContinuousToneOff, ++ tmFrontEndContinuousTone22KHz, ++ tmFrontEndContinuousToneMax ++} tmFrontEndContinuousTone_t, *ptmFrontEndContinuousTone_t; ++ ++typedef enum _tmFrontEndChannelType_t ++{ ++ tmFrontEndChannelTypeNone = 0x00, /* No detection */ ++ tmFrontEndChannelTypeDigital = 0x01, /* Digital channel */ ++ tmFrontEndChannelTypeAnalog = 0x02, /* Analog channel */ ++ tmFrontEndChannelTypeUnknown = 0x20 /* unknown channel type */ ++} tmFrontEndChannelType_t; ++ ++typedef enum _tmFrontEndChannelConfidence_t ++{ ++ tmFrontEndConfidenceNotAvailable, ++ tmFrontEndConfidenceNull, ++ tmFrontEndConfidenceLow, ++ tmFrontEndConfidenceMedium, ++ tmFrontEndConfidenceHigh ++} tmFrontEndConfidence_t; ++ ++typedef enum _tmFrontEndDVBT2PLPType_t ++{ ++ tmFrontEndDVBT2PLPTypeAuto, ++ tmFrontEndDVBT2PLPTypeCommon, ++ tmFrontEndDVBT2PLPType1, ++ tmFrontEndDVBT2PLPType2, ++ tmFrontEndDVBT2PLPTypeMax ++} tmFrontEndDVBT2PLPType_t; ++ ++typedef enum _tmFrontEndDVBT2PLPPayloadType_t ++{ ++ tmFrontEndDVBT2PLPPayloadTypeAuto, ++ tmFrontEndDVBT2PLPPayloadTypeGFPS, ++ tmFrontEndDVBT2PLPPayloadTypeGCS, ++ tmFrontEndDVBT2PLPPayloadTypeGSE, ++ tmFrontEndDVBT2PLPPayloadTypeTS, ++ tmFrontEndDVBT2PLPPayloadTypeMax ++} tmFrontEndDVBT2PLPPayloadType_t; ++ ++typedef enum _tmFrontEndRotationState_t ++{ ++ tmFrontEndRotationStateAuto, ++ tmFrontEndRotationStateOn, ++ tmFrontEndRotationStateOff, ++ tmFrontEndRotationStateMax ++} tmFrontEndRotationState; ++ ++typedef enum _tmFrontEndDVBT2FECType_t ++{ ++ tmFrontEndDVBT2FECTypeAuto, ++ tmFrontEndDVBT2FECType16K, ++ tmFrontEndDVBT2FECType64K, ++ tmFrontEndDVBT2FECTypeMax ++} tmFrontEndDVBT2FECType_t; ++ ++typedef enum _tmFrontEndDVBT2InputType_t ++{ ++ tmFrontEndDVBT2InputTypeAuto, ++ tmFrontEndDVBT2InputTypeSISO, ++ tmFrontEndDVBT2InputTypeMISO, ++ tmFrontEndDVBT2InputTypeMax ++} tmFrontEndDVBT2InputType_t; ++ ++typedef enum _tmFrontEndFECMode_t ++{ ++ tmFrontEndFECModeUnknown = 0, ++ tmFrontEndFECModeAnnexA, ++ tmFrontEndFECModeAnnexB, ++ tmFrontEndFECModeAnnexC, ++ tmFrontEndFECModeMax ++} tmFrontEndFECMode_t; ++ ++typedef struct _tmFrontEndFracNb8_t ++{ ++ Int8 lInteger; ++ UInt8 uDivider; ++}tmFrontEndFracNb8_t; ++ ++typedef struct _tmFrontEndFracNb16_t ++{ ++ Int16 lInteger; ++ UInt16 uDivider; ++}tmFrontEndFracNb16_t; ++ ++typedef struct _tmFrontEndFracNb32_t ++{ ++ Int32 lInteger; ++ UInt32 uDivider; ++}tmFrontEndFracNb32_t; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* TMFRONTEND_H */ ++/*============================================================================*/ ++/* END OF FILE */ ++/*============================================================================*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\inc\tmUnitParams.h ++ ++ ++/** ++ Copyright (C) 2007 NXP B.V., All Rights Reserved. ++ This source code and any compilation or derivative thereof is the proprietary ++ information of NXP B.V. and is confidential in nature. Under no circumstances ++ is this software to be exposed to or placed under an Open Source License of ++ any type without the expressed written permission of NXP B.V. ++ * ++ * \file tmUnitParams.h ++ * %version: 2 % ++ * ++ * \date %date_modified% ++ * ++ * \brief Describe briefly the purpose of this file. ++ * ++ * REFERENCE DOCUMENTS : ++ * ++ * Detailed description may be added here. ++ * ++ * \section info Change Information ++ * ++ * \verbatim ++ Date Modified by CRPRNr TASKNr Maintenance description ++ -------------|-----------|-------|-------|----------------------------------- ++ 26-Mar-2008 | B.GUILLOT | 13122 | 23456 | Creation ++ -------------|-----------|-------|-------|----------------------------------- ++ \endverbatim ++ * ++*/ ++ ++ ++#ifndef TMUNITPARAMS_H ++#define TMUNITPARAMS_H ++ ++/*============================================================================*/ ++/* INCLUDE FILES */ ++/*============================================================================*/ ++ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++ ++/*============================================================================*/ ++/* ENUM OR TYPE DEFINITION */ ++/*============================================================================*/ ++ ++ ++/******************************************************************************/ ++/** \brief "These macros map to tmUnitSelect_t variables parts" ++* ++******************************************************************************/ ++ ++#define UNIT_VALID(_tUnIt) (((_tUnIt)&0x80000000)==0) ++ ++#define UNIT_PATH_INDEX_MASK (0x0000001F) ++#define UNIT_PATH_INDEX_POS (0) ++ ++#define UNIT_PATH_TYPE_MASK (0x000003E0) ++#define UNIT_PATH_TYPE_POS (5) ++ ++#define UNIT_PATH_CONFIG_MASK (0x0003FC00) ++#define UNIT_PATH_CONFIG_POS (10) ++ ++#define UNIT_SYSTEM_INDEX_MASK (0x007C0000) ++#define UNIT_SYSTEM_INDEX_POS (18) ++ ++#define UNIT_SYSTEM_CONFIG_MASK (0x7F800000) ++#define UNIT_SYSTEM_CONFIG_POS (23) ++ ++ ++ ++ ++#define UNIT_PATH_INDEX_GET(_tUnIt) ((_tUnIt)&UNIT_PATH_INDEX_MASK) ++#define UNIT_PATH_INDEX_VAL(_val) (((_val)<> UNIT_PATH_TYPE_POS) ++#define UNIT_PATH_TYPE_VAL(_val) (((_val)<> UNIT_PATH_CONFIG_POS) ++#define UNIT_PATH_CONFIG_VAL(_val) (((_val)<> UNIT_SYSTEM_INDEX_POS) ++#define UNIT_SYSTEM_INDEX_VAL(_val) (((_val)<> UNIT_SYSTEM_CONFIG_POS) ++#define UNIT_SYSTEM_CONFIG_VAL(_val) (((_val)< ", __FUNCTION__, __LINE__ ); \ ++ } \ ++ P_DBGPRINTEx(_level, _format, __VA_ARGS__); \ ++ } \ ++} ++*/ ++#else ++//#define tmDBGPRINTEx(_level, _format, ...) ++#endif ++ ++#define tmASSERTExTR(_retVar, _expr, _strings) ++/* ++{ ++ if((_retVar) != (_expr)) ++ { ++ tmDBGPRINTEx _strings ; ++ return _retVar; ++ } ++} ++*/ ++ ++#define tmASSERTExT(_retVar, _expr, _strings) ++/*{ \ ++ if((_retVar) != (_expr)) \ ++ { \ ++ tmDBGPRINTEx _strings ; \ ++ } \ ++} ++*/ ++/*============================================================================*/ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* TMBSLFRONTENDTYPES_H */ ++/*============================================================================*/ ++/* END OF FILE */ ++/*============================================================================*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmbslTDA182I2\inc\tmbslTDA18272.h ++ ++ ++/** ++Copyright (C) 2008 NXP B.V., All Rights Reserved. ++This source code and any compilation or derivative thereof is the proprietary ++information of NXP B.V. and is confidential in nature. Under no circumstances ++is this software to be exposed to or placed under an Open Source License of ++any type without the expressed written permission of NXP B.V. ++* ++* \file tmbslTDA18272.h ++* %version: 21 % ++* ++* \date %date_modified% ++* ++* \brief Describe briefly the purpose of this file. ++* ++* REFERENCE DOCUMENTS : ++* ++* Detailed description may be added here. ++* ++* \section info Change Information ++* ++* \verbatim ++Date Modified by CRPRNr TASKNr Maintenance description ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++\endverbatim ++* ++*/ ++ ++#ifndef _TMBSL_TDA18272_H ++#define _TMBSL_TDA18272_H ++ ++/*------------------------------------------------------------------------------*/ ++/* Standard include files: */ ++/*------------------------------------------------------------------------------*/ ++ ++/*------------------------------------------------------------------------------*/ ++/* Project include files: */ ++/*------------------------------------------------------------------------------*/ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++ /*------------------------------------------------------------------------------*/ ++ /* Types and defines: */ ++ /*------------------------------------------------------------------------------*/ ++ ++ /* SW Error codes */ ++#define TDA182I2_ERR_BASE (CID_COMP_TUNER | CID_LAYER_BSL) ++#define TDA182I2_ERR_COMP (CID_COMP_TUNER | CID_LAYER_BSL | TM_ERR_COMP_UNIQUE_START) ++ ++#define TDA182I2_ERR_BAD_UNIT_NUMBER (TDA182I2_ERR_BASE + TM_ERR_BAD_UNIT_NUMBER) ++#define TDA182I2_ERR_NOT_INITIALIZED (TDA182I2_ERR_BASE + TM_ERR_NOT_INITIALIZED) ++#define TDA182I2_ERR_INIT_FAILED (TDA182I2_ERR_BASE + TM_ERR_INIT_FAILED) ++#define TDA182I2_ERR_BAD_PARAMETER (TDA182I2_ERR_BASE + TM_ERR_BAD_PARAMETER) ++#define TDA182I2_ERR_NOT_SUPPORTED (TDA182I2_ERR_BASE + TM_ERR_NOT_SUPPORTED) ++#define TDA182I2_ERR_HW_FAILED (TDA182I2_ERR_COMP + 0x0001) ++#define TDA182I2_ERR_NOT_READY (TDA182I2_ERR_COMP + 0x0002) ++#define TDA182I2_ERR_BAD_VERSION (TDA182I2_ERR_COMP + 0x0003) ++ ++ ++ typedef enum _tmTDA182I2PowerState_t { ++ tmTDA182I2_PowerNormalMode = 0, /* Device normal mode */ ++ tmTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndSynthe, /* Device standby mode with LNA and Xtal Output and Synthe */ ++ tmTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn, /* Device standby mode with LNA and Xtal Output */ ++ tmTDA182I2_PowerStandbyWithXtalOn, /* Device standby mode with Xtal Output */ ++ tmTDA182I2_PowerStandby, /* Device standby mode */ ++ tmTDA182I2_PowerMax ++ } tmTDA182I2PowerState_t, *ptmTDA182I2PowerState_t; ++ ++ typedef enum _tmTDA182I2StandardMode_t { ++ tmTDA182I2_DVBT_6MHz = 0, /* Digital TV DVB-T 6MHz */ ++ tmTDA182I2_DVBT_7MHz, /* Digital TV DVB-T 7MHz */ ++ tmTDA182I2_DVBT_8MHz, /* Digital TV DVB-T 8MHz */ ++ tmTDA182I2_QAM_6MHz, /* Digital TV QAM 6MHz */ ++ tmTDA182I2_QAM_8MHz, /* Digital TV QAM 8MHz */ ++ tmTDA182I2_ISDBT_6MHz, /* Digital TV ISDBT 6MHz */ ++ tmTDA182I2_ATSC_6MHz, /* Digital TV ATSC 6MHz */ ++ tmTDA182I2_DMBT_8MHz, /* Digital TV DMB-T 8MHz */ ++ tmTDA182I2_ANLG_MN, /* Analog TV M/N */ ++ tmTDA182I2_ANLG_B, /* Analog TV B */ ++ tmTDA182I2_ANLG_GH, /* Analog TV G/H */ ++ tmTDA182I2_ANLG_I, /* Analog TV I */ ++ tmTDA182I2_ANLG_DK, /* Analog TV D/K */ ++ tmTDA182I2_ANLG_L, /* Analog TV L */ ++ tmTDA182I2_ANLG_LL, /* Analog TV L' */ ++ tmTDA182I2_FM_Radio, /* Analog FM Radio */ ++ tmTDA182I2_Scanning, /* analog preset blind Scanning */ ++ tmTDA182I2_ScanXpress, /* ScanXpress */ ++ tmTDA182I2_StandardMode_Max ++ } tmTDA182I2StandardMode_t, *ptmTDA182I2StandardMode_t; ++ ++ typedef enum _tmTDA182I2LPF_t { ++ tmTDA182I2_LPF_6MHz = 0, /* 6MHz LPFc */ ++ tmTDA182I2_LPF_7MHz, /* 7MHz LPFc */ ++ tmTDA182I2_LPF_8MHz, /* 8MHz LPFc */ ++ tmTDA182I2_LPF_9MHz, /* 9MHz LPFc */ ++ tmTDA182I2_LPF_1_5MHz, /* 1.5MHz LPFc */ ++ tmTDA182I2_LPF_Max ++ } tmTDA182I2LPF_t, *ptmTDA182I2LPF_t; ++ ++ typedef enum _tmTDA182I2LPFOffset_t { ++ tmTDA182I2_LPFOffset_0pc = 0, /* LPFc 0% */ ++ tmTDA182I2_LPFOffset_min_4pc, /* LPFc -4% */ ++ tmTDA182I2_LPFOffset_min_8pc, /* LPFc -8% */ ++ tmTDA182I2_LPFOffset_min_12pc, /* LPFc -12% */ ++ tmTDA182I2_LPFOffset_Max ++ } tmTDA182I2LPFOffset_t, *ptmTDA182I2LPFOffset_t; ++ ++ typedef enum _tmTDA182I2IF_AGC_Gain_t { ++ tmTDA182I2_IF_AGC_Gain_2Vpp_0_30dB = 0, /* 2Vpp 0 - 30dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_1_25Vpp_min_4_26dB, /* 1.25Vpp -4 - 26dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, /* 1Vpp -6 - 24dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_0_8Vpp_min_8_22dB, /* 0.8Vpp -8 - 22dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_0_85Vpp_min_7_5_22_5dB, /* 0.85Vpp -7.5 - 22.5dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, /* 0.7Vpp -9 - 21dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_0_6Vpp_min_10_3_19_7dB, /* 0.6Vpp -10.3 - 19.7dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_0_5Vpp_min_12_18dB, /* 0.5Vpp -12 - 18dB IF AGC Gain */ ++ tmTDA182I2_IF_AGC_Gain_Max ++ } tmTDA182I2IF_AGC_Gain_t, *ptmTDA182I2IF_AGC_Gain_t; ++ ++ typedef enum _tmTDA182I2IF_Notch_t { ++ tmTDA182I2_IF_Notch_Disabled = 0, /* IF Notch Enabled */ ++ tmTDA182I2_IF_Notch_Enabled, /* IF Notch Disabled */ ++ tmTDA182I2_IF_Notch_Max ++ } tmTDA182I2IF_Notch_t, *ptmTDA182I2IF_Notch_t; ++ ++ typedef enum _tmTDA182I2IF_HPF_t { ++ tmTDA182I2_IF_HPF_Disabled = 0, /* IF HPF 0.4MHz */ ++ tmTDA182I2_IF_HPF_0_4MHz, /* IF HPF 0.4MHz */ ++ tmTDA182I2_IF_HPF_0_85MHz, /* IF HPF 0.85MHz */ ++ tmTDA182I2_IF_HPF_1MHz, /* IF HPF 1MHz */ ++ tmTDA182I2_IF_HPF_1_5MHz, /* IF HPF 1.5MHz */ ++ tmTDA182I2_IF_HPF_Max ++ } tmTDA182I2IF_HPF_t, *ptmTDA182I2IF_HPF_t; ++ ++ typedef enum _tmTDA182I2DC_Notch_t { ++ tmTDA182I2_DC_Notch_Disabled = 0, /* IF Notch Enabled */ ++ tmTDA182I2_DC_Notch_Enabled, /* IF Notch Disabled */ ++ tmTDA182I2_DC_Notch_Max ++ } tmTDA182I2DC_Notch_t, *ptmTDA182I2DC_Notch_t; ++ ++ typedef enum _tmTDA182I2AGC1_LNA_TOP_t { ++ tmTDA182I2_AGC1_LNA_TOP_d95_u89dBuV = 0, /* AGC1 LNA TOP down 95 up 89 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u93dBuV_do_not_use, /* AGC1 LNA TOP down 95 up 93 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u94dBuV_do_not_use, /* AGC1 LNA TOP down 95 up 94 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d95_u95dBuV_do_not_use, /* AGC1 LNA TOP down 95 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d99_u89dBuV, /* AGC1 LNA TOP down 99 up 89 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d99_u93dBuV, /* AGC1 LNA TOP down 95 up 93 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d99_u94dBuV, /* AGC1 LNA TOP down 99 up 94 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d99_u95dBuV, /* AGC1 LNA TOP down 99 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d99_u9SdBuV, /* AGC1 LNA TOP down 99 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d100_u93dBuV, /* AGC1 LNA TOP down 100 up 93 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d100_u94dBuV, /* AGC1 LNA TOP down 100 up 94 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d100_u95dBuV, /* AGC1 LNA TOP down 100 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d100_u9SdBuV, /* AGC1 LNA TOP down 100 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d101_u93dBuV, /* AGC1 LNA TOP down 101 up 93 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d101_u94dBuV, /* AGC1 LNA TOP down 101 up 94 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d101_u95dBuV, /* AGC1 LNA TOP down 101 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_d101_u9SdBuV, /* AGC1 LNA TOP down 101 up 95 dBuV */ ++ tmTDA182I2_AGC1_LNA_TOP_Max ++ } tmTDA182I2AGC1_LNA_TOP_t, *ptmTDA182I2AGC1_LNA_TOP_t; ++ ++ typedef enum _tmTDA182I2AGC2_RF_Attenuator_TOP_t { ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d89_u81dBuV = 0, /* AGC2 RF Attenuator TOP down 89 up 81 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d91_u83dBuV, /* AGC2 RF Attenuator TOP down 91 up 83 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d93_u85dBuV, /* AGC2 RF Attenuator TOP down 93 up 85 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d95_u87dBuV, /* AGC2 RF Attenuator TOP down 95 up 87 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d88_u88dBuV, /* AGC2 RF Attenuator TOP down 88 up 81 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d89_u82dBuV, /* AGC2 RF Attenuator TOP down 89 up 82 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u83dBuV, /* AGC2 RF Attenuator TOP down 90 up 83 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d91_u84dBuV, /* AGC2 RF Attenuator TOP down 91 up 84 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d92_u85dBuV, /* AGC2 RF Attenuator TOP down 92 up 85 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d93_u86dBuV, /* AGC2 RF Attenuator TOP down 93 up 86 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d94_u87dBuV, /* AGC2 RF Attenuator TOP down 94 up 87 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d95_u88dBuV, /* AGC2 RF Attenuator TOP down 95 up 88 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d87_u81dBuV, /* AGC2 RF Attenuator TOP down 87 up 81 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d88_u82dBuV, /* AGC2 RF Attenuator TOP down 88 up 82 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d89_u83dBuV, /* AGC2 RF Attenuator TOP down 89 up 83 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d90_u84dBuV, /* AGC2 RF Attenuator TOP down 90 up 84 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d91_u85dBuV, /* AGC2 RF Attenuator TOP down 91 up 85 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d92_u86dBuV, /* AGC2 RF Attenuator TOP down 92 up 86 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d93_u87dBuV, /* AGC2 RF Attenuator TOP down 93 up 87 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d94_u88dBuV, /* AGC2 RF Attenuator TOP down 94 up 88 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_d95_u89dBuV, /* AGC2 RF Attenuator TOP down 95 up 89 dBuV */ ++ tmTDA182I2_AGC2_RF_Attenuator_TOP_Max ++ } tmTDA182I2AGC2_RF_Attenuator_TOP_t, *ptmTDA182I2AGC2_RF_Attenuator_TOP_t; ++ ++ typedef enum _tmTDA182I2AGC3_RF_AGC_TOP_t { ++ tmTDA182I2_AGC3_RF_AGC_TOP_94dBuV = 0, /* AGC3 RF AGC TOP 94 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_96dBuV, /* AGC3 RF AGC TOP 96 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_98dBuV, /* AGC3 RF AGC TOP 98 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_100dBuV, /* AGC3 RF AGC TOP 100 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_102dBuV, /* AGC3 RF AGC TOP 102 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_104dBuV, /* AGC3 RF AGC TOP 104 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_106dBuV, /* AGC3 RF AGC TOP 106 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_107dBuV, /* AGC3 RF AGC TOP 107 dBuV */ ++ tmTDA182I2_AGC3_RF_AGC_TOP_Max ++ } tmTDA182I2AGC3_RF_AGC_TOP_t, *ptmTDA182I2AGC3_RF_AGC_TOP_t; ++ ++#define tmTDA182I2_AGC3_RF_AGC_TOP_FREQ_LIM 291000000 ++ ++ typedef enum _tmTDA182I2AGC4_IR_Mixer_TOP_t { ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u99dBuV = 0, /* AGC4 IR_Mixer TOP down 105 up 99 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u100dBuV, /* AGC4 IR_Mixer TOP down 105 up 100 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d105_u101dBuV, /* AGC4 IR_Mixer TOP down 105 up 101 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d107_u101dBuV, /* AGC4 IR_Mixer TOP down 107 up 101 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d107_u102dBuV, /* AGC4 IR_Mixer TOP down 107 up 102 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d107_u103dBuV, /* AGC4 IR_Mixer TOP down 107 up 103 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d108_u103dBuV, /* AGC4 IR_Mixer TOP down 108 up 103 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d109_u103dBuV, /* AGC4 IR_Mixer TOP down 109 up 103 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d109_u104dBuV, /* AGC4 IR_Mixer TOP down 109 up 104 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d109_u105dBuV, /* AGC4 IR_Mixer TOP down 109 up 105 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u104dBuV, /* AGC4 IR_Mixer TOP down 110 up 104 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u105dBuV, /* AGC4 IR_Mixer TOP down 110 up 105 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d110_u106dBuV, /* AGC4 IR_Mixer TOP down 110 up 106 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d112_u106dBuV, /* AGC4 IR_Mixer TOP down 112 up 106 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d112_u107dBuV, /* AGC4 IR_Mixer TOP down 112 up 107 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_d112_u108dBuV, /* AGC4 IR_Mixer TOP down 112 up 108 dBuV */ ++ tmTDA182I2_AGC4_IR_Mixer_TOP_Max ++ } tmTDA182I2AGC4_IR_Mixer_TOP_t, *ptmTDA182I2AGC4_IR_Mixer_TOP_t; ++ ++ typedef enum _tmTDA182I2AGC5_IF_AGC_TOP_t { ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u99dBuV = 0, /* AGC5 IF AGC TOP down 105 up 99 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u100dBuV, /* AGC5 IF AGC TOP down 105 up 100 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d105_u101dBuV, /* AGC5 IF AGC TOP down 105 up 101 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d107_u101dBuV, /* AGC5 IF AGC TOP down 107 up 101 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d107_u102dBuV, /* AGC5 IF AGC TOP down 107 up 102 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d107_u103dBuV, /* AGC5 IF AGC TOP down 107 up 103 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d108_u103dBuV, /* AGC5 IF AGC TOP down 108 up 103 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d109_u103dBuV, /* AGC5 IF AGC TOP down 109 up 103 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d109_u104dBuV, /* AGC5 IF AGC TOP down 109 up 104 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d109_u105dBuV, /* AGC5 IF AGC TOP down 109 up 105 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u104dBuV, /* AGC5 IF AGC TOP down 108 up 104 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u105dBuV, /* AGC5 IF AGC TOP down 108 up 105 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d110_u106dBuV, /* AGC5 IF AGC TOP down 108 up 106 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d112_u106dBuV, /* AGC5 IF AGC TOP down 108 up 106 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d112_u107dBuV, /* AGC5 IF AGC TOP down 108 up 107 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_d112_u108dBuV, /* AGC5 IF AGC TOP down 108 up 108 dBuV */ ++ tmTDA182I2_AGC5_IF_AGC_TOP_Max ++ } tmTDA182I2AGC5_IF_AGC_TOP_t, *ptmTDA182I2AGC5_IF_AGC_TOP_t; ++ ++ typedef enum _tmTDA182I2AGC5_Detector_HPF_t { ++ tmTDA182I2_AGC5_Detector_HPF_Disabled = 0, /* AGC5_Detector_HPF Enabled */ ++ tmTDA182I2_AGC5_Detector_HPF_Enabled, /* IF Notch Disabled */ ++ tmTDA182I2_AGC5_Detector_HPF_Max ++ } tmTDA182I2AGC5_Detector_HPF_t, *ptmTDA182I2AGC5_Detector_HPFh_t; ++ ++ typedef enum _tmTDA182I2AGC3_Adapt_t { ++ tmTDA182I2_AGC3_Adapt_Enabled = 0, /* AGC3_Adapt Enabled */ ++ tmTDA182I2_AGC3_Adapt_Disabled, /* AGC3_Adapt Disabled */ ++ tmTDA182I2_AGC3_Adapt_Max ++ } tmTDA182I2AGC3_Adapt_t, *ptmTDA182I2AGC3_Adapt_t; ++ ++ typedef enum _tmTDA182I2AGC3_Adapt_TOP_t { ++ tmTDA182I2_AGC3_Adapt_TOP_0_Step = 0, /* same level as AGC3 TOP */ ++ tmTDA182I2_AGC3_Adapt_TOP_1_Step, /* 1 level below AGC3 TOP */ ++ tmTDA182I2_AGC3_Adapt_TOP_2_Step, /* 2 level below AGC3 TOP */ ++ tmTDA182I2_AGC3_Adapt_TOP_3_Step, /* 3 level below AGC3 TOP */ ++ } tmTDA182I2AGC3_Adapt_TOP_t, *ptmTDA182I2AGC3_Adapt_TOP_t; ++ ++ typedef enum _tmTDA182I2AGC5_Atten_3dB_t { ++ tmTDA182I2_AGC5_Atten_3dB_Disabled = 0, /* AGC5_Atten_3dB Disabled */ ++ tmTDA182I2_AGC5_Atten_3dB_Enabled, /* AGC5_Atten_3dB Enabled */ ++ tmTDA182I2_AGC5_Atten_3dB_Max ++ } tmTDA182I2AGC5_Atten_3dB_t, *ptmTDA182I2AGC5_Atten_3dB_t; ++ ++ typedef enum _tmTDA182I2H3H5_VHF_Filter6_t { ++ tmTDA182I2_H3H5_VHF_Filter6_Disabled = 0, /* H3H5_VHF_Filter6 Disabled */ ++ tmTDA182I2_H3H5_VHF_Filter6_Enabled, /* H3H5_VHF_Filter6 Enabled */ ++ tmTDA182I2_H3H5_VHF_Filter6_Max ++ } tmTDA182I2H3H5_VHF_Filter6_t, *ptmTDA182I2H3H5_VHF_Filter6_t; ++ ++ typedef enum _tmTDA182I2_LPF_Gain_t { ++ tmTDA182I2_LPF_Gain_Unknown = 0, /* LPF_Gain Unknown */ ++ tmTDA182I2_LPF_Gain_Frozen, /* LPF_Gain Frozen */ ++ tmTDA182I2_LPF_Gain_Free /* LPF_Gain Free */ ++ } tmTDA182I2_LPF_Gain_t, *ptmTDA182I2_LPF_Gain_t; ++ ++ typedef struct _tmTDA182I2StdCoefficients ++ { ++ UInt32 IF; ++ Int32 CF_Offset; ++ tmTDA182I2LPF_t LPF; ++ tmTDA182I2LPFOffset_t LPF_Offset; ++ tmTDA182I2IF_AGC_Gain_t IF_Gain; ++ tmTDA182I2IF_Notch_t IF_Notch; ++ tmTDA182I2IF_HPF_t IF_HPF; ++ tmTDA182I2DC_Notch_t DC_Notch; ++ tmTDA182I2AGC1_LNA_TOP_t AGC1_LNA_TOP; ++ tmTDA182I2AGC2_RF_Attenuator_TOP_t AGC2_RF_Attenuator_TOP; ++ tmTDA182I2AGC3_RF_AGC_TOP_t AGC3_RF_AGC_TOP_Low_band; ++ tmTDA182I2AGC3_RF_AGC_TOP_t AGC3_RF_AGC_TOP_High_band; ++ tmTDA182I2AGC4_IR_Mixer_TOP_t AGC4_IR_Mixer_TOP; ++ tmTDA182I2AGC5_IF_AGC_TOP_t AGC5_IF_AGC_TOP; ++ tmTDA182I2AGC5_Detector_HPF_t AGC5_Detector_HPF; ++ tmTDA182I2AGC3_Adapt_t AGC3_Adapt; ++ tmTDA182I2AGC3_Adapt_TOP_t AGC3_Adapt_TOP; ++ tmTDA182I2AGC5_Atten_3dB_t AGC5_Atten_3dB; ++ UInt8 GSK; ++ tmTDA182I2H3H5_VHF_Filter6_t H3H5_VHF_Filter6; ++ tmTDA182I2_LPF_Gain_t LPF_Gain; ++ Bool AGC1_Freeze; ++ Bool LTO_STO_immune; ++ } tmTDA182I2StdCoefficients, *ptmTDA182I2StdCoefficients; ++ ++ typedef enum _tmTDA182I2RFFilterRobustness_t { ++ tmTDA182I2RFFilterRobustness_Low = 0, ++ tmTDA182I2RFFilterRobustness_High, ++ tmTDA182I2RFFilterRobustness_Error, ++ tmTDA182I2RFFilterRobustness_Max ++ } tmTDA182I2RFFilterRobustness_t, *ptmTDA182I2RFFilterRobustness_t; ++/* ++ typedef struct _tmTDA182I2RFFilterRating { ++ double VHFLow_0_Margin; ++ double VHFLow_1_Margin; ++ double VHFHigh_0_Margin; ++ double VHFHigh_1_Margin; ++ double UHFLow_0_Margin; ++ double UHFLow_1_Margin; ++ double UHFHigh_0_Margin; ++ double UHFHigh_1_Margin; ++ tmTDA182I2RFFilterRobustness_t VHFLow_0_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t VHFLow_1_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t VHFHigh_0_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t VHFHigh_1_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t UHFLow_0_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t UHFLow_1_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t UHFHigh_0_RFFilterRobustness; ++ tmTDA182I2RFFilterRobustness_t UHFHigh_1_RFFilterRobustness; ++ } tmTDA182I2RFFilterRating, *ptmTDA182I2RFFilterRating; ++*/ ++ tmErrorCode_t ++ tmbslTDA182I2Init( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmbslFrontEndDependency_t* psSrvFunc, /* I: setup parameters */ ++ TUNER_MODULE *pTuner // Added by Realtek ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2DeInit ( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetSWVersion ( ++ ptmSWVersion_t pSWVersion /* I: Receives SW Version */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2CheckHWVersion ( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2SetPowerState ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2PowerState_t powerState /* I: Power state of this device */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetPowerState ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2PowerState_t *pPowerState /* O: Power state of this device */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2SetStandardMode ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2StandardMode_t StandardMode /* I: Standard mode of this device */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetStandardMode ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmTDA182I2StandardMode_t *pStandardMode /* O: Standard mode of this device */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2SetRf( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uRF, /* I: RF frequency in hertz */ ++ tmTDA182I2IF_AGC_Gain_t IF_Gain // Added by realtek ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetRf( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* pRF /* O: RF frequency in hertz */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2Reset( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetIF( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puIF /* O: IF Frequency in hertz */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetCF_Offset( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puOffset /* O: Center frequency offset in hertz */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetLockStatus( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmbslFrontEndState_t* pLockStatus /* O: PLL Lock status */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetPowerLevel( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* pPowerLevel /* O: Power Level in dBuV */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2SetIRQWait( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool bWait /* I: Determine if we need to wait IRQ in driver functions */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetIRQWait( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool* pbWait /* O: Determine if we need to wait IRQ in driver functions */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetIRQ( ++ tmUnitSelect_t tUnit /* I: Unit number */, ++ Bool* pbIRQ /* O: IRQ triggered */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2WaitIRQ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeOut for IRQ wait */ ++ UInt32 waitStep, /* I: wait step */ ++ UInt8 irqStatus /* I: IRQs to wait */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2GetXtalCal_End( ++ tmUnitSelect_t tUnit /* I: Unit number */, ++ Bool* pbXtalCal_End /* O: XtalCal_End triggered */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2WaitXtalCal_End( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeOut for IRQ wait */ ++ UInt32 waitStep /* I: wait step */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2SoftReset( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++/* ++ tmErrorCode_t ++ tmbslTDA182I2CheckRFFilterRobustness ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ ptmTDA182I2RFFilterRating rating // O: RF Filter rating ++ ); ++*/ ++ tmErrorCode_t ++ tmbslTDA182I2Write ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uIndex, /* I: Start index to write */ ++ UInt32 WriteLen, /* I: Number of bytes to write */ ++ UInt8* pData /* I: Data to write */ ++ ); ++ tmErrorCode_t ++ tmbslTDA182I2Read ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uIndex, /* I: Start index to read */ ++ UInt32 ReadLen, /* I: Number of bytes to read */ ++ UInt8* pData /* I: Data to read */ ++ ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _TMBSL_TDA18272_H */ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmbslTDA182I2\inc\tmbslTDA182I2local.h ++ ++ ++/** ++Copyright (C) 2008 NXP B.V., All Rights Reserved. ++This source code and any compilation or derivative thereof is the proprietary ++information of NXP B.V. and is confidential in nature. Under no circumstances ++is this software to be exposed to or placed under an Open Source License of ++any type without the expressed written permission of NXP B.V. ++* ++* \file tmbslTDA182I2local.h ++* %version: 9 % ++* ++* \date %date_modified% ++* ++* \brief Describe briefly the purpose of this file. ++* ++* REFERENCE DOCUMENTS : ++* ++* Detailed description may be added here. ++* ++* \section info Change Information ++* ++* \verbatim ++Date Modified by CRPRNr TASKNr Maintenance description ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++\endverbatim ++* ++*/ ++ ++#ifndef _TMBSL_TDA182I2LOCAL_H ++#define _TMBSL_TDA182I2LOCAL_H ++ ++/*------------------------------------------------------------------------------*/ ++/* Standard include files: */ ++/*------------------------------------------------------------------------------*/ ++ ++/*------------------------------------------------------------------------------*/ ++/* Project include files: */ ++/*------------------------------------------------------------------------------*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/*------------------------------------------------------------------------------*/ ++/* Types and defines: */ ++/*------------------------------------------------------------------------------*/ ++ ++#define TDA182I2_MUTEX_TIMEOUT TMBSL_FRONTEND_MUTEX_TIMEOUT_INFINITE ++ ++#ifdef TMBSL_TDA18272 ++ #define TMBSL_TDA182I2_COMPONENT_NAME_STR "TDA18272" ++#else /* TMBSL_TDA18272 */ ++ #define TMBSL_TDA182I2_COMPONENT_NAME_STR "TDA18212" ++#endif /* TMBSL_TDA18272 */ ++ ++#define _SYSTEMFUNC (pObj->SystemFunc) ++#define POBJ_SRVFUNC_SIO pObj->sRWFunc ++#define POBJ_SRVFUNC_STIME pObj->sTime ++#define P_DBGPRINTEx pObj->sDebug.Print ++#define P_DBGPRINTVALID ((pObj != Null) && (pObj->sDebug.Print != Null)) ++ ++ ++/*-------------*/ ++/* ERROR CODES */ ++/*-------------*/ ++ ++#define TDA182I2_MAX_UNITS 2 ++ ++ typedef struct _tmTDA182I2Object_t ++ { ++ tmUnitSelect_t tUnit; ++ tmUnitSelect_t tUnitW; ++ ptmbslFrontEndMutexHandle pMutex; ++ Bool init; ++ tmbslFrontEndIoFunc_t sRWFunc; ++ tmbslFrontEndTimeFunc_t sTime; ++ tmbslFrontEndDebugFunc_t sDebug; ++ tmbslFrontEndMutexFunc_t sMutex; ++ tmTDA182I2PowerState_t curPowerState; ++ tmTDA182I2PowerState_t minPowerState; ++ UInt32 uRF; ++ tmTDA182I2StandardMode_t StandardMode; ++ Bool Master; ++ UInt8 LT_Enable; ++ UInt8 PSM_AGC1; ++ UInt8 AGC1_6_15dB; ++ tmTDA182I2StdCoefficients Std_Array[tmTDA182I2_StandardMode_Max]; ++ ++ // Added by Realtek. ++ TUNER_MODULE *pTuner; ++ ++ } tmTDA182I2Object_t, *ptmTDA182I2Object_t, **pptmTDA182I2Object_t; ++ ++ ++/* suppress warning about static */ ++#pragma GCC diagnostic ignored "-Wunused-function" ++static tmErrorCode_t TDA182I2Init(tmUnitSelect_t tUnit); ++static tmErrorCode_t TDA182I2Wait(ptmTDA182I2Object_t pObj, UInt32 Time); ++static tmErrorCode_t TDA182I2WaitXtalCal_End( ptmTDA182I2Object_t pObj, UInt32 timeOut, UInt32 waitStep); ++ ++ ++extern tmErrorCode_t TDA182I2MutexAcquire(ptmTDA182I2Object_t pObj, UInt32 timeOut); ++extern tmErrorCode_t TDA182I2MutexRelease(ptmTDA182I2Object_t pObj); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _TMBSL_TDA182I2LOCAL_H */ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmbslTDA182I2\inc\tmbslTDA182I2Instance.h ++ ++ ++//----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2001 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmbslTDA182I2Instance.h ++// ++// DESCRIPTION: define the static Objects ++// ++// DOCUMENT REF: DVP Software Coding Guidelines v1.14 ++// DVP Board Support Library Architecture Specification v0.5 ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++#ifndef _TMBSLTDA182I2_INSTANCE_H //----------------- ++#define _TMBSLTDA182I2_INSTANCE_H ++ ++tmErrorCode_t TDA182I2AllocInstance (tmUnitSelect_t tUnit, pptmTDA182I2Object_t ppDrvObject); ++tmErrorCode_t TDA182I2DeAllocInstance (tmUnitSelect_t tUnit); ++tmErrorCode_t TDA182I2GetInstance (tmUnitSelect_t tUnit, pptmTDA182I2Object_t ppDrvObject); ++ ++ ++#endif // _TMBSLTDA182I2_INSTANCE_H //--------------- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\inc\tmddTDA182I2.h ++ ++ ++/** ++Copyright (C) 2008 NXP B.V., All Rights Reserved. ++This source code and any compilation or derivative thereof is the proprietary ++information of NXP B.V. and is confidential in nature. Under no circumstances ++is this software to be exposed to or placed under an Open Source License of ++any type without the expressed written permission of NXP B.V. ++* ++* \file tmddTDA182I2.h ++* %version: 11 % ++* ++* \date %date_modified% ++* ++* \brief Describe briefly the purpose of this file. ++* ++* REFERENCE DOCUMENTS : ++* ++* Detailed description may be added here. ++* ++* \section info Change Information ++* ++* \verbatim ++Date Modified by CRPRNr TASKNr Maintenance description ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++| | | | ++-------------|-----------|-------|-------|----------------------------------- ++\endverbatim ++* ++*/ ++#ifndef _TMDD_TDA182I2_H //----------------- ++#define _TMDD_TDA182I2_H ++ ++//----------------------------------------------------------------------------- ++// Standard include files: ++//----------------------------------------------------------------------------- ++// ++ ++//----------------------------------------------------------------------------- ++// Project include files: ++//----------------------------------------------------------------------------- ++// ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++ //----------------------------------------------------------------------------- ++ // Types and defines: ++ //----------------------------------------------------------------------------- ++ // ++ ++ /* SW Error codes */ ++#define ddTDA182I2_ERR_BASE (CID_COMP_TUNER | CID_LAYER_BSL) ++#define ddTDA182I2_ERR_COMP (CID_COMP_TUNER | CID_LAYER_BSL | TM_ERR_COMP_UNIQUE_START) ++ ++#define ddTDA182I2_ERR_BAD_UNIT_NUMBER (ddTDA182I2_ERR_BASE + TM_ERR_BAD_UNIT_NUMBER) ++#define ddTDA182I2_ERR_NOT_INITIALIZED (ddTDA182I2_ERR_BASE + TM_ERR_NOT_INITIALIZED) ++#define ddTDA182I2_ERR_INIT_FAILED (ddTDA182I2_ERR_BASE + TM_ERR_INIT_FAILED) ++#define ddTDA182I2_ERR_BAD_PARAMETER (ddTDA182I2_ERR_BASE + TM_ERR_BAD_PARAMETER) ++#define ddTDA182I2_ERR_NOT_SUPPORTED (ddTDA182I2_ERR_BASE + TM_ERR_NOT_SUPPORTED) ++#define ddTDA182I2_ERR_HW_FAILED (ddTDA182I2_ERR_COMP + 0x0001) ++#define ddTDA182I2_ERR_NOT_READY (ddTDA182I2_ERR_COMP + 0x0002) ++#define ddTDA182I2_ERR_BAD_VERSION (ddTDA182I2_ERR_COMP + 0x0003) ++ ++ ++ typedef enum _tmddTDA182I2PowerState_t { ++ tmddTDA182I2_PowerNormalMode, /* Device normal mode */ ++ tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndWithSyntheOn, /* Device standby mode with LNA and Xtal Output and Synthe on*/ ++ tmddTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn, /* Device standby mode with LNA and Xtal Output */ ++ tmddTDA182I2_PowerStandbyWithXtalOn, /* Device standby mode with Xtal Output */ ++ tmddTDA182I2_PowerStandby, /* Device standby mode */ ++ tmddTDA182I2_PowerMax ++ } tmddTDA182I2PowerState_t, *ptmddTDA182I2PowerState_t; ++ ++ typedef enum _tmddTDA182I2_LPF_Gain_t { ++ tmddTDA182I2_LPF_Gain_Unknown = 0, /* LPF_Gain Unknown */ ++ tmddTDA182I2_LPF_Gain_Frozen, /* LPF_Gain Frozen */ ++ tmddTDA182I2_LPF_Gain_Free /* LPF_Gain Free */ ++ } tmddTDA182I2_LPF_Gain_t, *ptmddTDA182I2_LPF_Gain_t; ++ ++ tmErrorCode_t ++ tmddTDA182I2Init ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ tmbslFrontEndDependency_t* psSrvFunc /* I: setup parameters */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2DeInit ++ ( ++ tmUnitSelect_t tUnit // I: Unit number ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetSWVersion ++ ( ++ ptmSWVersion_t pSWVersion // I: Receives SW Version ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Reset ++ ( ++ tmUnitSelect_t tUnit // I: Unit number ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetLPF_Gain_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uMode /* I: Unknown/Free/Frozen */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetLPF_Gain_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 *puMode /* O: Unknown/Free/Frozen */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Write ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt32 uIndex, // I: Start index to write ++ UInt32 uNbBytes, // I: Number of bytes to write ++ UInt8* puBytes // I: Pointer on an array of bytes ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Read ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt32 uIndex, // I: Start index to read ++ UInt32 uNbBytes, // I: Number of bytes to read ++ UInt8* puBytes // I: Pointer on an array of bytes ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPOR ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetLO_Lock ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMS ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIdentity ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt16* puValue // I: Address of the variable to output item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMinorRevision ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMajorRevision ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetTM_D ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetTM_ON ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetTM_ON ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPowerState ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ tmddTDA182I2PowerState_t powerState // I: Power state of this device ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPowerState ++ ( ++ tmUnitSelect_t tUnit, // I: Unit number ++ ptmddTDA182I2PowerState_t pPowerState // O: Power state of this device ++ ); ++ ++ tmErrorCode_t ++ tmddTDA182I2GetPower_Level ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIRQ_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIRQ_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXtalCal_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXtalCal_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RSSI_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RSSI_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_LOCalc_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_LOCalc_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RFCAL_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RFCAL_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_IRCAL_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_IRCAL_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RCCal_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RCCal_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIRQ_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 irqStatus /* I: IRQs to clear */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXtalCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXtalCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RSSI_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RSSI_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_LOCalc_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_LOCalc_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RFCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RFCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_IRCAL_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_IRCAL_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RCCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RCCal_Clear ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIRQ_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIRQ_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXtalCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXtalCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RSSI_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RSSI_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_LOCalc_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_LOCalc_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RFCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RFCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_IRCAL_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_IRCAL_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_RCCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RCCal_Set ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIRQ_status ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_XtalCal_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RSSI_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_LOCalc_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RFCal_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_IRCAL_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_RCCal_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetLT_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetLT_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC1_6_15dB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_6_15dB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC1_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC2_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC2_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGCs_Up_Step_assym ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGCs_Up_Step_assym ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGCs_Up_Step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGCs_Up_Step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPulse_Shaper_Disable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPulse_Shaper_Disable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGCK_Step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGCK_Step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGCK_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGCK_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPD_RFAGC_Adapt ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPD_RFAGC_Adapt ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFAGC_Adapt_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFAGC_Adapt_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFAGC_Low_BW ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFAGC_Low_BW ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Atten_3dB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Atten_3dB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFAGC_Top ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFAGC_Top ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Mixer_Top ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Mixer_Top ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGCs_Do_Step_assym ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGCs_Do_Step_assym ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC5_Ana ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_Ana ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC5_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIF_Level ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIF_Level ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIF_HP_Fc ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIF_HP_Fc ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIF_ATSC_Notch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIF_ATSC_Notch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetLP_FC_Offset ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetLP_FC_Offset ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetLP_FC ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetLP_FC ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetI2C_Clock_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetI2C_Clock_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetDigital_Clock_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDigital_Clock_Mode ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXtalOsc_AnaReg_En ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXtalOsc_AnaReg_En ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXTout ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXTout ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIF_Freq ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIF_Freq ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puValue // I: Address of the variable to output item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Freq ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Freq ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32* puValue // I: Address of the variable to output item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_Meas ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_Meas ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_CAL_AV ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_CAL_AV ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_CAL ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_CAL ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_CAL_Loop ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_CAL_Loop ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Cal_Image ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Cal_Image ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_CAL_Wanted ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_CAL_Wanted ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRC_Cal ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRC_Cal ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetCalc_PLL ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetCalc_PLL ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetXtalCal_Launch ++ ( ++ tmUnitSelect_t tUnit // I: Unit number ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetXtalCal_Launch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetMSM_Launch ++ ( ++ tmUnitSelect_t tUnit // I: Unit number ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetMSM_Launch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSM_AGC1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSM_AGC1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSM_StoB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSM_StoB ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSMRFpoly ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSMRFpoly ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSM_Mixer ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSM_Mixer ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSM_Ifpoly ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSM_Ifpoly ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPSM_Lodriver ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPSM_Lodriver ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetDCC_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDCC_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetDCC_Slow ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDCC_Slow ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetDCC_psm ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDCC_psm ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetFmax_Lo ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetFmax_Lo ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Loop ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Loop ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Target ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Target ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_GStep ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_GStep ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Corr_Boost ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Corr_Boost ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_FreqLow_Sel ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_FreqLow_Sel ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_mode_ram_store ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_mode_ram_store ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_FreqLow ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_FreqLow ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_FreqMid ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_FreqMid ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetCoarse_IR_FreqHigh ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetCoarse_IR_FreqHigh ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_FreqHigh ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_FreqHigh ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ ++ tmErrorCode_t ++ tmddTDA182I2SetPD_Vsync_Mgt ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPD_Vsync_Mgt ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPD_Ovld ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPD_Ovld ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetPD_Udld ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetPD_Udld ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC_Ovld_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC_Ovld_TOP ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC_Ovld_Timer ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC_Ovld_Timer ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Mixer_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Mixer_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIR_Mixer_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIR_Mixer_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetHi_Pass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetHi_Pass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIF_Notch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIF_Notch ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC1_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC1_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetForce_AGC1_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetForce_AGC1_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC1_Gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_Gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC5_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC5_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetForce_AGC5_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetForce_AGC5_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC5_Gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_Gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq0 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq0 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq3 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq3 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq6 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq6 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq7 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq7 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq8 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq8 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq9 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq9 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq10 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq10 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Freq11 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Freq11 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset0 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset0 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset3 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset3 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset6 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset6 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset7 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset7 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset8 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset8 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset9 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset9 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset10 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset10 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Offset11 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Offset11 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_SW_Algo_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_SW_Algo_Enable ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Filter_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Filter_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC2_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC2_loop_off ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetForce_AGC2_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetForce_AGC2_gain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Filter_Gv ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Filter_Gv ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Filter_Band ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Filter_Band ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_Filter_Cap ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_Filter_Cap ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetAGC2_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC2_Do_step ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetGain_Taper ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetGain_Taper ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_BPF ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_BPF ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRF_BPF_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRF_BPF_Bypass ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetN_CP_Current ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetN_CP_Current ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetUp_AGC5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDo_AGC5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetUp_AGC4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDo_AGC4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetUp_AGC2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDo_AGC2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetUp_AGC1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDo_AGC1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC2_Gain_Read ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC1_Gain_Read ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetTOP_AGC3_Read ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC5_Gain_Read ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetAGC4_Gain_Read ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_AV ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_AV ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_Cap_Reset_En ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_Cap_Reset_En ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_Cap_Val ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_Cap_Val ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_Ck_Speed ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_Ck_Speed ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRSSI_Dicho_not ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRSSI_Dicho_not ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_Phi2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_Phi2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetDDS_Polarity ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue // I: Item value ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetDDS_Polarity ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetRFCAL_DeltaGain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetRFCAL_DeltaGain ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIRQ_Polarity ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8 uValue /* I: Item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIRQ_Polarity ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_0 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_1 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_2 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_3 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_4 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_5 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_6 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_7 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_8 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_9 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_10 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2Getrfcal_log_11 ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt8* puValue /* I: Address of the variable to output item value */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2LaunchRF_CAL ++ ( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2WaitIRQ ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep, /* I: wait step */ ++ UInt8 irqStatus /* I: IRQs to wait */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2WaitXtalCal_End ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ UInt32 timeOut, /* I: timeout */ ++ UInt32 waitStep /* I: wait step */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2SetIRQWait ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool bWait /* I: Determine if we need to wait IRQ in driver functions */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2GetIRQWait ++ ( ++ tmUnitSelect_t tUnit, /* I: Unit number */ ++ Bool* pbWait /* O: Determine if we need to wait IRQ in driver functions */ ++ ); ++ tmErrorCode_t ++ tmddTDA182I2AGC1_Adapt ++ ( ++ tmUnitSelect_t tUnit /* I: Unit number */ ++ ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // _TMDD_TDA182I2_H //--------------- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\inc\tmddTDA182I2local.h ++ ++ ++//----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2007 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmddTDA182I2local.h ++// ++// DESCRIPTION: define the Object for the TDA182I2 ++// ++// DOCUMENT REF: DVP Software Coding Guidelines v1.14 ++// DVP Board Support Library Architecture Specification v0.5 ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++// ++#ifndef _TMDD_TDA182I2LOCAL_H //----------------- ++#define _TMDD_TDA182I2LOCAL_H ++ ++//----------------------------------------------------------------------------- ++// Standard include files: ++//----------------------------------------------------------------------------- ++ ++//#include "tmddTDA182I2.h" ++ ++/*------------------------------------------------------------------------------*/ ++/* Project include files: */ ++/*------------------------------------------------------------------------------*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++ //----------------------------------------------------------------------------- ++ // Types and defines: ++ //----------------------------------------------------------------------------- ++ // ++ ++#define ddTDA182I2_MUTEX_TIMEOUT TMBSL_FRONTEND_MUTEX_TIMEOUT_INFINITE ++ ++#define _SYSTEMFUNC (pObj->SystemFunc) ++ ++#define POBJ_SRVFUNC_SIO pObj->sRWFunc ++#define POBJ_SRVFUNC_STIME pObj->sTime ++#define P_DBGPRINTEx pObj->sDebug.Print ++#define P_DBGPRINTVALID ((pObj != Null) && (pObj->sDebug.Print != Null)) ++ ++#define TDA182I2_DD_COMP_NUM 2 // Major protocol change - Specification change required ++#define TDA182I2_DD_MAJOR_VER 4 // Minor protocol change - Specification change required ++#define TDA182I2_DD_MINOR_VER 7 // Software update - No protocol change - No specification change required ++ ++#define TDA182I2_POWER_LEVEL_MIN 40 ++#define TDA182I2_POWER_LEVEL_MAX 110 ++ ++#define TDA182I2_MAX_UNITS 2 ++#define TDA182I2_I2C_MAP_NB_BYTES 68 ++ ++#define TDA182I2_DEVICE_ID_MASTER 1 ++#define TDA182I2_DEVICE_ID_SLAVE 0 ++ ++ ++ typedef struct _TDA182I2_I2C_Map_t ++ { ++ union ++ { ++ UInt8 ID_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 MS:1; ++ UInt8 Ident_1:7; ++#else ++ UInt8 Ident_1:7; ++ UInt8 MS:1; ++#endif ++ }bF; ++ }uBx00; ++ ++ union ++ { ++ UInt8 ID_byte_2; ++ struct ++ { ++ UInt8 Ident_2:8; ++ }bF; ++ }uBx01; ++ ++ union ++ { ++ UInt8 ID_byte_3; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 Major_rev:4; ++ UInt8 Minor_rev:4; ++#else ++ UInt8 Minor_rev:4; ++ UInt8 Major_rev:4; ++#endif ++ }bF; ++ }uBx02; ++ ++ union ++ { ++ UInt8 Thermo_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 TM_D:7; ++#else ++ UInt8 TM_D:7; ++ UInt8 UNUSED_I0_D0:1; ++#endif ++ }bF; ++ }uBx03; ++ ++ union ++ { ++ UInt8 Thermo_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:7; ++ UInt8 TM_ON:1; ++#else ++ UInt8 TM_ON:1; ++ UInt8 UNUSED_I0_D0:7; ++#endif ++ }bF; ++ }uBx04; ++ ++ union ++ { ++ UInt8 Power_state_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:6; ++ UInt8 POR:1; ++ UInt8 LO_Lock:1; ++#else ++ UInt8 LO_Lock:1; ++ UInt8 POR:1; ++ UInt8 UNUSED_I0_D0:6; ++#endif ++ }bF; ++ }uBx05; ++ ++ union ++ { ++ UInt8 Power_state_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:4; ++ UInt8 SM:1; ++ UInt8 SM_Synthe:1; ++ UInt8 SM_LT:1; ++ UInt8 SM_XT:1; ++#else ++ UInt8 SM_XT:1; ++ UInt8 SM_LT:1; ++ UInt8 SM_Synthe:1; ++ UInt8 SM:1; ++ UInt8 UNUSED_I0_D0:4; ++#endif ++ }bF; ++ }uBx06; ++ ++ union ++ { ++ UInt8 Input_Power_Level_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 Power_Level:7; ++#else ++ UInt8 Power_Level:7; ++ UInt8 UNUSED_I0_D0:1; ++#endif ++ }bF; ++ }uBx07; ++ ++ union ++ { ++ UInt8 IRQ_status; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IRQ_status:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 MSM_XtalCal_End:1; ++ UInt8 MSM_RSSI_End:1; ++ UInt8 MSM_LOCalc_End:1; ++ UInt8 MSM_RFCal_End:1; ++ UInt8 MSM_IRCAL_End:1; ++ UInt8 MSM_RCCal_End:1; ++#else ++ UInt8 MSM_RCCal_End:1; ++ UInt8 MSM_IRCAL_End:1; ++ UInt8 MSM_RFCal_End:1; ++ UInt8 MSM_LOCalc_End:1; ++ UInt8 MSM_RSSI_End:1; ++ UInt8 MSM_XtalCal_End:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 IRQ_status:1; ++#endif ++ }bF; ++ }uBx08; ++ ++ union ++ { ++ UInt8 IRQ_enable; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IRQ_Enable:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 XtalCal_Enable:1; ++ UInt8 MSM_RSSI_Enable:1; ++ UInt8 MSM_LOCalc_Enable:1; ++ UInt8 MSM_RFCAL_Enable:1; ++ UInt8 MSM_IRCAL_Enable:1; ++ UInt8 MSM_RCCal_Enable:1; ++#else ++ UInt8 MSM_RCCal_Enable:1; ++ UInt8 MSM_IRCAL_Enable:1; ++ UInt8 MSM_RFCAL_Enable:1; ++ UInt8 MSM_LOCalc_Enable:1; ++ UInt8 MSM_RSSI_Enable:1; ++ UInt8 XtalCal_Enable:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 IRQ_Enable:1; ++#endif ++ }bF; ++ }uBx09; ++ ++ union ++ { ++ UInt8 IRQ_clear; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IRQ_Clear:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 XtalCal_Clear:1; ++ UInt8 MSM_RSSI_Clear:1; ++ UInt8 MSM_LOCalc_Clear:1; ++ UInt8 MSM_RFCal_Clear:1; ++ UInt8 MSM_IRCAL_Clear:1; ++ UInt8 MSM_RCCal_Clear:1; ++#else ++ UInt8 MSM_RCCal_Clear:1; ++ UInt8 MSM_IRCAL_Clear:1; ++ UInt8 MSM_RFCal_Clear:1; ++ UInt8 MSM_LOCalc_Clear:1; ++ UInt8 MSM_RSSI_Clear:1; ++ UInt8 XtalCal_Clear:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 IRQ_Clear:1; ++#endif ++ }bF; ++ }uBx0A; ++ ++ union ++ { ++ UInt8 IRQ_set; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IRQ_Set:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 XtalCal_Set:1; ++ UInt8 MSM_RSSI_Set:1; ++ UInt8 MSM_LOCalc_Set:1; ++ UInt8 MSM_RFCal_Set:1; ++ UInt8 MSM_IRCAL_Set:1; ++ UInt8 MSM_RCCal_Set:1; ++#else ++ UInt8 MSM_RCCal_Set:1; ++ UInt8 MSM_IRCAL_Set:1; ++ UInt8 MSM_RFCal_Set:1; ++ UInt8 MSM_LOCalc_Set:1; ++ UInt8 MSM_RSSI_Set:1; ++ UInt8 XtalCal_Set:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 IRQ_Set:1; ++#endif ++ }bF; ++ }uBx0B; ++ ++ union ++ { ++ UInt8 AGC1_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 LT_Enable:1; ++ UInt8 AGC1_6_15dB:1; ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 AGC1_TOP:4; ++#else ++ UInt8 AGC1_TOP:4; ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 AGC1_6_15dB:1; ++ UInt8 LT_Enable:1; ++#endif ++ }bF; ++ }uBx0C; ++ ++ union ++ { ++ UInt8 AGC2_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:3; ++ UInt8 AGC2_TOP:5; ++#else ++ UInt8 AGC2_TOP:5; ++ UInt8 UNUSED_I0_D0:3; ++#endif ++ }bF; ++ }uBx0D; ++ ++ union ++ { ++ UInt8 AGCK_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 AGCs_Up_Step_assym:2; ++ UInt8 AGCs_Up_Step:1; ++ UInt8 Pulse_Shaper_Disable:1; ++ UInt8 AGCK_Step:2; ++ UInt8 AGCK_Mode:2; ++#else ++ UInt8 AGCK_Mode:2; ++ UInt8 AGCK_Step:2; ++ UInt8 Pulse_Shaper_Disable:1; ++ UInt8 AGCs_Up_Step:1; ++ UInt8 AGCs_Up_Step_assym:2; ++#endif ++ }bF; ++ }uBx0E; ++ ++ union ++ { ++ UInt8 RF_AGC_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 PD_RFAGC_Adapt:1; ++ UInt8 RFAGC_Adapt_TOP:2; ++ UInt8 RFAGC_Low_BW:1; ++ UInt8 RF_Atten_3dB:1; ++ UInt8 RFAGC_Top:3; ++#else ++ UInt8 RFAGC_Top:3; ++ UInt8 RF_Atten_3dB:1; ++ UInt8 RFAGC_Low_BW:1; ++ UInt8 RFAGC_Adapt_TOP:2; ++ UInt8 PD_RFAGC_Adapt:1; ++#endif ++ }bF; ++ }uBx0F; ++ ++ union ++ { ++ UInt8 IR_Mixer_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:4; ++ UInt8 IR_Mixer_Top:4; ++#else ++ UInt8 IR_Mixer_Top:4; ++ UInt8 UNUSED_I0_D0:4; ++#endif ++ }bF; ++ }uBx10; ++ ++ union ++ { ++ UInt8 AGC5_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 AGCs_Do_Step_assym:2; ++ UInt8 AGC5_Ana:1; ++ UInt8 AGC5_TOP:4; ++#else ++ UInt8 AGC5_TOP:4; ++ UInt8 AGC5_Ana:1; ++ UInt8 AGCs_Do_Step_assym:2; ++ UInt8 UNUSED_I0_D0:1; ++#endif ++ }bF; ++ }uBx11; ++ ++ union ++ { ++ UInt8 IF_AGC_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:5; ++ UInt8 IF_level:3; ++#else ++ UInt8 IF_level:3; ++ UInt8 UNUSED_I0_D0:5; ++#endif ++ }bF; ++ }uBx12; ++ ++ union ++ { ++ UInt8 IF_Byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IF_HP_Fc:2; ++ UInt8 IF_ATSC_Notch:1; ++ UInt8 LP_FC_Offset:2; ++ UInt8 LP_Fc:3; ++#else ++ UInt8 LP_Fc:3; ++ UInt8 LP_FC_Offset:2; ++ UInt8 IF_ATSC_Notch:1; ++ UInt8 IF_HP_Fc:2; ++#endif ++ }bF; ++ }uBx13; ++ ++ union ++ { ++ UInt8 Reference_Byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 I2C_Clock_Mode:1; ++ UInt8 Digital_Clock_Mode:1; ++ UInt8 UNUSED_I1_D0:1; ++ UInt8 XtalOsc_AnaReg_En:1; ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 XTout:2; ++#else ++ UInt8 XTout:2; ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 XtalOsc_AnaReg_En:1; ++ UInt8 UNUSED_I1_D0:1; ++ UInt8 Digital_Clock_Mode:1; ++ UInt8 I2C_Clock_Mode:1; ++#endif ++ }bF; ++ }uBx14; ++ ++ union ++ { ++ UInt8 IF_Frequency_byte; ++ struct ++ { ++ UInt8 IF_Freq:8; ++ }bF; ++ }uBx15; ++ ++ union ++ { ++ UInt8 RF_Frequency_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:4; ++ UInt8 RF_Freq_1:4; ++#else ++ UInt8 RF_Freq_1:4; ++ UInt8 UNUSED_I0_D0:4; ++#endif ++ }bF; ++ }uBx16; ++ ++ union ++ { ++ UInt8 RF_Frequency_byte_2; ++ struct ++ { ++ UInt8 RF_Freq_2:8; ++ }bF; ++ }uBx17; ++ ++ ++ union ++ { ++ UInt8 RF_Frequency_byte_3; ++ struct ++ { ++ UInt8 RF_Freq_3:8; ++ }bF; ++ }uBx18; ++ ++ union ++ { ++ UInt8 MSM_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RSSI_Meas:1; ++ UInt8 RF_CAL_AV:1; ++ UInt8 RF_CAL:1; ++ UInt8 IR_CAL_Loop:1; ++ UInt8 IR_Cal_Image:1; ++ UInt8 IR_CAL_Wanted:1; ++ UInt8 RC_Cal:1; ++ UInt8 Calc_PLL:1; ++#else ++ UInt8 Calc_PLL:1; ++ UInt8 RC_Cal:1; ++ UInt8 IR_CAL_Wanted:1; ++ UInt8 IR_Cal_Image:1; ++ UInt8 IR_CAL_Loop:1; ++ UInt8 RF_CAL:1; ++ UInt8 RF_CAL_AV:1; ++ UInt8 RSSI_Meas:1; ++#endif ++ }bF; ++ }uBx19; ++ ++ union ++ { ++ UInt8 MSM_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:6; ++ UInt8 XtalCal_Launch:1; ++ UInt8 MSM_Launch:1; ++#else ++ UInt8 MSM_Launch:1; ++ UInt8 XtalCal_Launch:1; ++ UInt8 UNUSED_I0_D0:6; ++#endif ++ }bF; ++ }uBx1A; ++ ++ union ++ { ++ UInt8 PowerSavingMode; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 PSM_AGC1:2; ++ UInt8 PSM_StoB:1; ++ UInt8 PSMRFpoly:1; ++ UInt8 PSM_Mixer:1; ++ UInt8 PSM_Ifpoly:1; ++ UInt8 PSM_Lodriver:2; ++#else ++ UInt8 PSM_Lodriver:2; ++ UInt8 PSM_Ifpoly:1; ++ UInt8 PSM_Mixer:1; ++ UInt8 PSMRFpoly:1; ++ UInt8 PSM_StoB:1; ++ UInt8 PSM_AGC1:2; ++#endif ++ }bF; ++ }uBx1B; ++ ++ union ++ { ++ UInt8 DCC_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 DCC_Bypass:1; ++ UInt8 DCC_Slow:1; ++ UInt8 DCC_psm:1; ++ UInt8 UNUSED_I0_D0:5; ++#else ++ UInt8 UNUSED_I0_D0:5; ++ UInt8 DCC_psm:1; ++ UInt8 DCC_Slow:1; ++ UInt8 DCC_Bypass:1; ++#endif ++ }bF; ++ }uBx1C; ++ ++ union ++ { ++ UInt8 FLO_max_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 Fmax_Lo:6; ++#else ++ UInt8 Fmax_Lo:6; ++ UInt8 UNUSED_I0_D0:2; ++#endif ++ }bF; ++ }uBx1D; ++ ++ union ++ { ++ UInt8 IR_Cal_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IR_Loop:2; ++ UInt8 IR_Target:3; ++ UInt8 IR_GStep:3; ++#else ++ UInt8 IR_GStep:3; ++ UInt8 IR_Target:3; ++ UInt8 IR_Loop:2; ++#endif ++ }bF; ++ }uBx1E; ++ ++ union ++ { ++ UInt8 IR_Cal_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IR_Corr_Boost:1; ++ UInt8 IR_FreqLow_Sel:1; ++ UInt8 IR_mode_ram_store:1; ++ UInt8 IR_FreqLow:5; ++#else ++ UInt8 IR_FreqLow:5; ++ UInt8 IR_mode_ram_store:1; ++ UInt8 IR_FreqLow_Sel:1; ++ UInt8 IR_Corr_Boost:1; ++#endif ++ }bF; ++ }uBx1F; ++ ++ union ++ { ++ UInt8 IR_Cal_byte_3; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:3; ++ UInt8 IR_FreqMid:5; ++#else ++ UInt8 IR_FreqMid:5; ++ UInt8 UNUSED_I0_D0:3; ++#endif ++ }bF; ++ }uBx20; ++ ++ union ++ { ++ UInt8 IR_Cal_byte_4; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 Coarse_IR_FreqHigh:1; ++ UInt8 IR_FreqHigh:5; ++#else ++ UInt8 IR_FreqHigh:5; ++ UInt8 Coarse_IR_FreqHigh:1; ++ UInt8 UNUSED_I0_D0:2; ++#endif ++ }bF; ++ }uBx21; ++ ++ union ++ { ++ UInt8 Vsync_Mgt_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 PD_Vsync_Mgt:1; ++ UInt8 PD_Ovld:1; ++ UInt8 PD_Udld:1; ++ UInt8 AGC_Ovld_TOP:3; ++ UInt8 AGC_Ovld_Timer:2; ++#else ++ UInt8 AGC_Ovld_Timer:2; ++ UInt8 AGC_Ovld_TOP:3; ++ UInt8 PD_Udld:1; ++ UInt8 PD_Ovld:1; ++ UInt8 PD_Vsync_Mgt:1; ++#endif ++ }bF; ++ }uBx22; ++ ++ union ++ { ++ UInt8 IR_Mixer_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 IR_Mixer_loop_off:1; ++ UInt8 IR_Mixer_Do_step:2; ++ UInt8 UNUSED_I0_D0:3; ++ UInt8 Hi_Pass:1; ++ UInt8 IF_Notch:1; ++#else ++ UInt8 IF_Notch:1; ++ UInt8 Hi_Pass:1; ++ UInt8 UNUSED_I0_D0:3; ++ UInt8 IR_Mixer_Do_step:2; ++ UInt8 IR_Mixer_loop_off:1; ++#endif ++ }bF; ++ }uBx23; ++ ++ union ++ { ++ UInt8 AGC1_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 AGC1_loop_off:1; ++ UInt8 AGC1_Do_step:2; ++ UInt8 Force_AGC1_gain:1; ++ UInt8 AGC1_Gain:4; ++#else ++ UInt8 AGC1_Gain:4; ++ UInt8 Force_AGC1_gain:1; ++ UInt8 AGC1_Do_step:2; ++ UInt8 AGC1_loop_off:1; ++#endif ++ }bF; ++ }uBx24; ++ ++ union ++ { ++ UInt8 AGC5_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 AGC5_loop_off:1; ++ UInt8 AGC5_Do_step:2; ++ UInt8 UNUSED_I1_D0:1; ++ UInt8 Force_AGC5_gain:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 AGC5_Gain:2; ++#else ++ UInt8 AGC5_Gain:2; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 Force_AGC5_gain:1; ++ UInt8 UNUSED_I1_D0:1; ++ UInt8 AGC5_Do_step:2; ++ UInt8 AGC5_loop_off:1; ++#endif ++ }bF; ++ }uBx25; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog0:2; ++ UInt8 RFCAL_Freq0:2; ++ UInt8 RFCAL_Offset_Cprog1:2; ++ UInt8 RFCAL_Freq1:2; ++#else ++ UInt8 RFCAL_Freq1:2; ++ UInt8 RFCAL_Offset_Cprog1:2; ++ UInt8 RFCAL_Freq0:2; ++ UInt8 RFCAL_Offset_Cprog0:2; ++#endif ++ }bF; ++ }uBx26; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog2:2; ++ UInt8 RFCAL_Freq2:2; ++ UInt8 RFCAL_Offset_Cprog3:2; ++ UInt8 RFCAL_Freq3:2; ++#else ++ UInt8 RFCAL_Freq3:2; ++ UInt8 RFCAL_Offset_Cprog3:2; ++ UInt8 RFCAL_Freq2:2; ++ UInt8 RFCAL_Offset_Cprog2:2; ++#endif ++ }bF; ++ }uBx27; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_3; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog4:2; ++ UInt8 RFCAL_Freq4:2; ++ UInt8 RFCAL_Offset_Cprog5:2; ++ UInt8 RFCAL_Freq5:2; ++#else ++ UInt8 RFCAL_Freq5:2; ++ UInt8 RFCAL_Offset_Cprog5:2; ++ UInt8 RFCAL_Freq4:2; ++ UInt8 RFCAL_Offset_Cprog4:2; ++#endif ++ }bF; ++ }uBx28; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_4; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog6:2; ++ UInt8 RFCAL_Freq6:2; ++ UInt8 RFCAL_Offset_Cprog7:2; ++ UInt8 RFCAL_Freq7:2; ++#else ++ UInt8 RFCAL_Freq7:2; ++ UInt8 RFCAL_Offset_Cprog7:2; ++ UInt8 RFCAL_Freq6:2; ++ UInt8 RFCAL_Offset_Cprog6:2; ++#endif ++ }bF; ++ }uBx29; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_5; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog8:2; ++ UInt8 RFCAL_Freq8:2; ++ UInt8 RFCAL_Offset_Cprog9:2; ++ UInt8 RFCAL_Freq9:2; ++#else ++ UInt8 RFCAL_Freq9:2; ++ UInt8 RFCAL_Offset_Cprog9:2; ++ UInt8 RFCAL_Freq8:2; ++ UInt8 RFCAL_Offset_Cprog8:2; ++#endif ++ }bF; ++ }uBx2A; ++ ++ union ++ { ++ UInt8 RF_Cal_byte_6; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Offset_Cprog10:2; ++ UInt8 RFCAL_Freq10:2; ++ UInt8 RFCAL_Offset_Cprog11:2; ++ UInt8 RFCAL_Freq11:2; ++#else ++ UInt8 RFCAL_Freq11:2; ++ UInt8 RFCAL_Offset_Cprog11:2; ++ UInt8 RFCAL_Freq10:2; ++ UInt8 RFCAL_Offset_Cprog10:2; ++#endif ++ }bF; ++ }uBx2B; ++ ++ union ++ { ++ UInt8 RF_Filters_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RF_Filter_Bypass:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 AGC2_loop_off:1; ++ UInt8 Force_AGC2_gain:1; ++ UInt8 RF_Filter_Gv:2; ++ UInt8 RF_Filter_Band:2; ++#else ++ ++ UInt8 RF_Filter_Band:2; ++ UInt8 RF_Filter_Gv:2; ++ UInt8 Force_AGC2_gain:1; ++ UInt8 AGC2_loop_off:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 RF_Filter_Bypass:1; ++#endif ++ }bF; ++ }uBx2C; ++ ++ union ++ { ++ UInt8 RF_Filters_byte_2; ++ struct ++ { ++ UInt8 RF_Filter_Cap:8; ++ }bF; ++ }uBx2D; ++ ++ union ++ { ++ UInt8 RF_Filters_byte_3; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 AGC2_Do_step:2; ++ UInt8 Gain_Taper:6; ++#else ++ UInt8 Gain_Taper:6; ++ UInt8 AGC2_Do_step:2; ++#endif ++ }bF; ++ }uBx2E; ++ ++ union ++ { ++ UInt8 RF_Band_Pass_Filter_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RF_BPF_Bypass:1; ++ UInt8 UNUSED_I0_D0:4; ++ UInt8 RF_BPF:3; ++#else ++ UInt8 RF_BPF:3; ++ UInt8 UNUSED_I0_D0:4; ++ UInt8 RF_BPF_Bypass:1; ++#endif ++ }bF; ++ }uBx2F; ++ ++ union ++ { ++ UInt8 CP_Current_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 N_CP_Current:7; ++#else ++ UInt8 N_CP_Current:7; ++ UInt8 UNUSED_I0_D0:1; ++#endif ++ }bF; ++ }uBx30; ++ ++ union ++ { ++ UInt8 AGCs_DetOut_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 Up_AGC5:1; ++ UInt8 Do_AGC5:1; ++ UInt8 Up_AGC4:1; ++ UInt8 Do_AGC4:1; ++ UInt8 Up_AGC2:1; ++ UInt8 Do_AGC2:1; ++ UInt8 Up_AGC1:1; ++ UInt8 Do_AGC1:1; ++#else ++ UInt8 Do_AGC1:1; ++ UInt8 Up_AGC1:1; ++ UInt8 Do_AGC2:1; ++ UInt8 Up_AGC2:1; ++ UInt8 Do_AGC4:1; ++ UInt8 Up_AGC4:1; ++ UInt8 Do_AGC5:1; ++ UInt8 Up_AGC5:1; ++#endif ++ }bF; ++ }uBx31; ++ ++ union ++ { ++ UInt8 RFAGCs_Gain_byte_1; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:2; ++ UInt8 AGC2_Gain_Read:2; ++ UInt8 AGC1_Gain_Read:4; ++#else ++ UInt8 AGC1_Gain_Read:4; ++ UInt8 AGC2_Gain_Read:2; ++ UInt8 UNUSED_I0_D0:2; ++#endif ++ }bF; ++ }uBx32; ++ ++ union ++ { ++ UInt8 RFAGCs_Gain_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:5; ++ UInt8 TOP_AGC3_Read:3; ++#else ++ UInt8 TOP_AGC3_Read:3; ++ UInt8 UNUSED_I0_D0:5; ++#endif ++ }bF; ++ }uBx33; ++ ++ union ++ { ++ UInt8 IFAGCs_Gain_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I0_D0:3; ++ UInt8 AGC5_Gain_Read:2; ++ UInt8 AGC4_Gain_Read:3; ++#else ++ UInt8 AGC4_Gain_Read:3; ++ UInt8 AGC5_Gain_Read:2; ++ UInt8 UNUSED_I0_D0:3; ++#endif ++ }bF; ++ }uBx34; ++ ++ union ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++#else ++#endif ++ UInt8 RSSI_byte_1; ++ UInt8 RSSI; ++ }uBx35; ++ ++ union ++ { ++ UInt8 RSSI_byte_2; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 UNUSED_I1_D0:2; ++ UInt8 RSSI_AV:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 RSSI_Cap_Reset_En:1; ++ UInt8 RSSI_Cap_Val:1; ++ UInt8 RSSI_Ck_Speed:1; ++ UInt8 RSSI_Dicho_not:1; ++#else ++ UInt8 RSSI_Dicho_not:1; ++ UInt8 RSSI_Ck_Speed:1; ++ UInt8 RSSI_Cap_Val:1; ++ UInt8 RSSI_Cap_Reset_En:1; ++ UInt8 UNUSED_I0_D0:1; ++ UInt8 RSSI_AV:1; ++ UInt8 UNUSED_I1_D0:2; ++#endif ++ }bF; ++ }uBx36; ++ ++ union ++ { ++ UInt8 Misc_byte; ++ struct ++ { ++#ifdef _TARGET_PLATFORM_MSB_FIRST ++ UInt8 RFCAL_Phi2:2; ++ UInt8 DDS_Polarity:1; ++ UInt8 RFCAL_DeltaGain:4; ++ UInt8 IRQ_Polarity:1; ++#else ++ UInt8 IRQ_Polarity:1; ++ UInt8 RFCAL_DeltaGain:4; ++ UInt8 DDS_Polarity:1; ++ UInt8 RFCAL_Phi2:2; ++#endif ++ }bF; ++ }uBx37; ++ ++ union ++ { ++ UInt8 rfcal_log_0; ++ struct ++ { ++ UInt8 rfcal_log_0:8; ++ }bF; ++ }uBx38; ++ ++ union ++ { ++ UInt8 rfcal_log_1; ++ struct ++ { ++ UInt8 rfcal_log_1:8; ++ }bF; ++ }uBx39; ++ ++ union ++ { ++ UInt8 rfcal_log_2; ++ struct ++ { ++ UInt8 rfcal_log_2:8; ++ }bF; ++ }uBx3A; ++ ++ union ++ { ++ UInt8 rfcal_log_3; ++ struct ++ { ++ UInt8 rfcal_log_3:8; ++ }bF; ++ }uBx3B; ++ ++ union ++ { ++ UInt8 rfcal_log_4; ++ struct ++ { ++ UInt8 rfcal_log_4:8; ++ }bF; ++ }uBx3C; ++ ++ union ++ { ++ UInt8 rfcal_log_5; ++ struct ++ { ++ UInt8 rfcal_log_5:8; ++ }bF; ++ }uBx3D; ++ ++ union ++ { ++ UInt8 rfcal_log_6; ++ struct ++ { ++ UInt8 rfcal_log_6:8; ++ }bF; ++ }uBx3E; ++ ++ union ++ { ++ UInt8 rfcal_log_7; ++ struct ++ { ++ UInt8 rfcal_log_7:8; ++ }bF; ++ }uBx3F; ++ ++ union ++ { ++ UInt8 rfcal_log_8; ++ struct ++ { ++ UInt8 rfcal_log_8:8; ++ }bF; ++ }uBx40; ++ ++ union ++ { ++ UInt8 rfcal_log_9; ++ struct ++ { ++ UInt8 rfcal_log_9:8; ++ }bF; ++ }uBx41; ++ ++ union ++ { ++ UInt8 rfcal_log_10; ++ struct ++ { ++ UInt8 rfcal_log_10:8; ++ }bF; ++ }uBx42; ++ ++ union ++ { ++ UInt8 rfcal_log_11; ++ struct ++ { ++ UInt8 rfcal_log_11:8; ++ }bF; ++ }uBx43; ++ ++ } TDA182I2_I2C_Map_t, *pTDA182I2_I2C_Map_t; ++ ++ typedef struct _tmTDA182I2_RFCalProg_t { ++ UInt8 Cal_number; ++ Int8 DeltaCprog; ++ Int8 CprogOffset; ++ } tmTDA182I2_RFCalProg_t, *ptmTDA182I2_RFCalProg_t; ++ ++ typedef struct _tmTDA182I2_RFCalCoeffs_t { ++ UInt8 Sub_band; ++ UInt8 Cal_number; ++ Int32 RF_A1; ++ Int32 RF_B1; ++ } tmTDA182I2_RFCalCoeffs_t, *ptmTDA182I2_RFCalCoeffs_t; ++ ++#define TDA182I2_RFCAL_PROG_ROW (12) ++#define TDA182I2_RFCAL_COEFFS_ROW (8) ++ ++ typedef struct _tmddTDA182I2Object_t { ++ tmUnitSelect_t tUnit; ++ tmUnitSelect_t tUnitW; ++ ptmbslFrontEndMutexHandle pMutex; ++ Bool init; ++ tmbslFrontEndIoFunc_t sRWFunc; ++ tmbslFrontEndTimeFunc_t sTime; ++ tmbslFrontEndDebugFunc_t sDebug; ++ tmbslFrontEndMutexFunc_t sMutex; ++ tmddTDA182I2PowerState_t curPowerState; ++ Bool bIRQWait; ++ TDA182I2_I2C_Map_t I2CMap; ++ } tmddTDA182I2Object_t, *ptmddTDA182I2Object_t, **pptmddTDA182I2Object_t; ++ ++ ++ extern tmErrorCode_t ddTDA182I2GetIRQ_status(ptmddTDA182I2Object_t pObj, UInt8* puValue); ++ extern tmErrorCode_t ddTDA182I2GetMSM_XtalCal_End(ptmddTDA182I2Object_t pObj, UInt8* puValue); ++ ++ extern tmErrorCode_t ddTDA182I2WaitIRQ(ptmddTDA182I2Object_t pObj, UInt32 timeOut, UInt32 waitStep, UInt8 irqStatus); ++ extern tmErrorCode_t ddTDA182I2WaitXtalCal_End(ptmddTDA182I2Object_t pObj, UInt32 timeOut, UInt32 waitStep); ++ ++ extern tmErrorCode_t ddTDA182I2Write(ptmddTDA182I2Object_t pObj, UInt8 uSubAddress, UInt8 uNbData); ++ extern tmErrorCode_t ddTDA182I2Read(ptmddTDA182I2Object_t pObj, UInt8 uSubAddress, UInt8 uNbData); ++ extern tmErrorCode_t ddTDA182I2Wait(ptmddTDA182I2Object_t pObj, UInt32 Time); ++ ++ extern tmErrorCode_t ddTDA182I2MutexAcquire(ptmddTDA182I2Object_t pObj, UInt32 timeOut); ++ extern tmErrorCode_t ddTDA182I2MutexRelease(ptmddTDA182I2Object_t pObj); ++ extern tmErrorCode_t tmddTDA182I2AGC1_Adapt(tmUnitSelect_t tUnit); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // _TMDD_TDA182I2LOCAL_H //--------------- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// NXP source code - .\tmddTDA182I2\inc\tmddTDA182I2Instance.h ++ ++ ++/*----------------------------------------------------------------------------- ++// $Header: ++// (C) Copyright 2001 NXP Semiconductors, All rights reserved ++// ++// This source code and any compilation or derivative thereof is the sole ++// property of NXP Corporation and is provided pursuant to a Software ++// License Agreement. This code is the proprietary information of NXP ++// Corporation and is confidential in nature. Its use and dissemination by ++// any party other than NXP Corporation is strictly limited by the ++// confidential information provisions of the Agreement referenced above. ++//----------------------------------------------------------------------------- ++// FILE NAME: tmddTDA182I2Instance.h ++// ++// DESCRIPTION: define the static Objects ++// ++// DOCUMENT REF: DVP Software Coding Guidelines v1.14 ++// DVP Board Support Library Architecture Specification v0.5 ++// ++// NOTES: ++//----------------------------------------------------------------------------- ++*/ ++#ifndef _TMDDTDA182I2_INSTANCE_H //----------------- ++#define _TMDDTDA182I2_INSTANCE_H ++ ++tmErrorCode_t ddTDA182I2AllocInstance (tmUnitSelect_t tUnit, pptmddTDA182I2Object_t ppDrvObject); ++tmErrorCode_t ddTDA182I2DeAllocInstance (tmUnitSelect_t tUnit); ++tmErrorCode_t ddTDA182I2GetInstance (tmUnitSelect_t tUnit, pptmddTDA182I2Object_t ppDrvObject); ++ ++ ++#endif // _TMDDTDA182I2_INSTANCE_H //--------------- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is TDA18272 tuner API source code ++ ++ ++ ++ ++ ++// Definitions ++ ++// Unit number ++enum TDA18272_UNIT_NUM ++{ ++ TDA18272_UNIT_0, // For master tuner or single tuner only. ++ TDA18272_UNIT_1, // For slave tuner only. ++}; ++ ++ ++// IF output Vp-p mode ++enum TDA18272_IF_OUTPUT_VPP_MODE ++{ ++ TDA18272_IF_OUTPUT_VPP_2V = tmTDA182I2_IF_AGC_Gain_2Vpp_0_30dB, ++ TDA18272_IF_OUTPUT_VPP_1P25V = tmTDA182I2_IF_AGC_Gain_1_25Vpp_min_4_26dB, ++ TDA18272_IF_OUTPUT_VPP_1V = tmTDA182I2_IF_AGC_Gain_1Vpp_min_6_24dB, ++ TDA18272_IF_OUTPUT_VPP_0P8V = tmTDA182I2_IF_AGC_Gain_0_8Vpp_min_8_22dB, ++ TDA18272_IF_OUTPUT_VPP_0P85V = tmTDA182I2_IF_AGC_Gain_0_85Vpp_min_7_5_22_5dB, ++ TDA18272_IF_OUTPUT_VPP_0P7V = tmTDA182I2_IF_AGC_Gain_0_7Vpp_min_9_21dB, ++ TDA18272_IF_OUTPUT_VPP_0P6V = tmTDA182I2_IF_AGC_Gain_0_6Vpp_min_10_3_19_7dB, ++ TDA18272_IF_OUTPUT_VPP_0P5V = tmTDA182I2_IF_AGC_Gain_0_5Vpp_min_12_18dB, ++ TDA18272_IF_OUTPUT_VPP_MAX = tmTDA182I2_IF_AGC_Gain_Max, ++}; ++ ++ ++// Standard bandwidth mode ++enum TDA18272_STANDARD_BANDWIDTH_MODE ++{ ++ TDA18272_STANDARD_BANDWIDTH_DVBT_6MHZ = tmTDA182I2_DVBT_6MHz, ++ TDA18272_STANDARD_BANDWIDTH_DVBT_7MHZ = tmTDA182I2_DVBT_7MHz, ++ TDA18272_STANDARD_BANDWIDTH_DVBT_8MHZ = tmTDA182I2_DVBT_8MHz, ++ TDA18272_STANDARD_BANDWIDTH_QAM_6MHZ = tmTDA182I2_QAM_6MHz, ++ TDA18272_STANDARD_BANDWIDTH_QAM_8MHZ = tmTDA182I2_QAM_8MHz, ++ TDA18272_STANDARD_BANDWIDTH_ISDBT_6MHZ = tmTDA182I2_ISDBT_6MHz, ++ TDA18272_STANDARD_BANDWIDTH_ATSC_6MHZ = tmTDA182I2_ATSC_6MHz, ++ TDA18272_STANDARD_BANDWIDTH_DMBT_8MHZ = tmTDA182I2_DMBT_8MHz, ++}; ++ ++ ++// Power mode ++enum TDA18272_POWER_MODE ++{ ++ TDA18272_POWER_NORMAL = tmTDA182I2_PowerNormalMode, ++ TDA18272_POWER_STANDBY_WITH_XTALOUT_LNA_SYNTHE_ON = tmTDA182I2_PowerStandbyWithLNAOnAndWithXtalOnAndSynthe, ++ TDA18272_POWER_STANDBY_WITH_XTALOUT_LNA_ON = tmTDA182I2_PowerStandbyWithLNAOnAndWithXtalOn, ++ TDA18272_POWER_STANDBY_WITH_XTALOUT_ON = tmTDA182I2_PowerStandbyWithXtalOn, ++ TDA18272_POWER_STANDBY = tmTDA182I2_PowerStandby, ++}; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildTda18272Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr, ++ unsigned long CrystalFreqHz, ++ int UnitNo, ++ int IfOutputVppMode ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++tda18272_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++tda18272_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++tda18272_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++tda18272_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++tda18272_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++tda18272_SetStandardBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int StandardBandwidthMode ++ ); ++ ++int ++tda18272_GetStandardBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pStandardBandwidthMode ++ ); ++ ++int ++tda18272_SetPowerMode( ++ TUNER_MODULE *pTuner, ++ int PowerMode ++ ); ++ ++int ++tda18272_GetPowerMode( ++ TUNER_MODULE *pTuner, ++ int *pPowerMode ++ ); ++ ++int ++tda18272_GetIfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pIfFreqHz ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is implemented for TDA18272 source code. ++ ++ ++// Functions ++tmErrorCode_t ++tda18272_Read( ++ tmUnitSelect_t tUnit, ++ UInt32 AddrSize, ++ UInt8* pAddr, ++ UInt32 ReadLen, ++ UInt8* pData ++ ); ++ ++tmErrorCode_t ++tda18272_Write( ++ tmUnitSelect_t tUnit, ++ UInt32 AddrSize, ++ UInt8* pAddr, ++ UInt32 WriteLen, ++ UInt8* pData ++ ); ++ ++tmErrorCode_t ++tda18272_Wait( ++ tmUnitSelect_t tUnit, ++ UInt32 tms ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +diff --git a/drivers/media/dvb/dvb-usb/tuner_tua9001.c b/drivers/media/dvb/dvb-usb/tuner_tua9001.c +new file mode 100644 +index 0000000..404ea95 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_tua9001.c +@@ -0,0 +1,1245 @@ ++/** ++ ++@file ++ ++@brief TUA9001 tuner module definition ++ ++One can manipulate TUA9001 tuner through TUA9001 module. ++TUA9001 module is derived from tuner module. ++ ++*/ ++ ++ ++#include "tuner_tua9001.h" ++ ++ ++ ++ ++ ++/** ++ ++@brief TUA9001 tuner module builder ++ ++Use BuildTua9001Module() to build TUA9001 module, set all module function pointers with the corresponding functions, ++and initialize module private variables. ++ ++ ++@param [in] ppTuner Pointer to TUA9001 tuner module pointer ++@param [in] pTunerModuleMemory Pointer to an allocated tuner module memory ++@param [in] pBaseInterfaceModuleMemory Pointer to an allocated base interface module memory ++@param [in] pI2cBridgeModuleMemory Pointer to an allocated I2C bridge module memory ++@param [in] DeviceAddr TUA9001 I2C device address ++ ++ ++@note ++ -# One should call BuildTua9001Module() to build TUA9001 module before using it. ++ ++*/ ++void ++BuildTua9001Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr ++ ) ++{ ++ TUNER_MODULE *pTuner; ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Set tuner module pointer. ++ *ppTuner = pTunerModuleMemory; ++ ++ // Get tuner module. ++ pTuner = *ppTuner; ++ ++ // Set base interface module pointer and I2C bridge module pointer. ++ pTuner->pBaseInterface = pBaseInterfaceModuleMemory; ++ pTuner->pI2cBridge = pI2cBridgeModuleMemory; ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ ++ ++ // Set tuner type. ++ pTuner->TunerType = TUNER_TYPE_TUA9001; ++ ++ // Set tuner I2C device address. ++ pTuner->DeviceAddr = DeviceAddr; ++ ++ ++ // Initialize tuner parameter setting status. ++ pTuner->IsRfFreqHzSet = NO; ++ ++ // Initialize tuner module variables. ++ // Note: Need to give both RF frequency and bandwidth for TUA9001 tuning function, ++ // so we have to give a default RF frequncy. ++ pTuner->RfFreqHz = TUA9001_RF_FREQ_HZ_DEFAULT; ++ ++ ++ // Set tuner module manipulating function pointers. ++ pTuner->GetTunerType = tua9001_GetTunerType; ++ pTuner->GetDeviceAddr = tua9001_GetDeviceAddr; ++ ++ pTuner->Initialize = tua9001_Initialize; ++ pTuner->SetRfFreqHz = tua9001_SetRfFreqHz; ++ pTuner->GetRfFreqHz = tua9001_GetRfFreqHz; ++ ++ ++ // Initialize tuner extra module variables. ++ // Note: Need to give both RF frequency and bandwidth for TUA9001 tuning function, ++ // so we have to give a default bandwidth. ++ pExtra->BandwidthMode = TUA9001_BANDWIDTH_MODE_DEFAULT; ++ pExtra->IsBandwidthModeSet = NO; ++ ++ // Set tuner extra module function pointers. ++ pExtra->SetBandwidthMode = tua9001_SetBandwidthMode; ++ pExtra->GetBandwidthMode = tua9001_GetBandwidthMode; ++ pExtra->GetRegBytesWithRegAddr = tua9001_GetRegBytesWithRegAddr; ++ pExtra->SetSysRegByte = tua9001_SetSysRegByte; ++ pExtra->GetSysRegByte = tua9001_GetSysRegByte; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_TUNER_TYPE ++ ++*/ ++void ++tua9001_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ) ++{ ++ // Get tuner type from tuner module. ++ *pTunerType = pTuner->TunerType; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_DEVICE_ADDR ++ ++*/ ++void ++tua9001_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ) ++{ ++ // Get tuner I2C device address from tuner module. ++ *pDeviceAddr = pTuner->DeviceAddr; ++ ++ ++ return; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_INITIALIZE ++ ++*/ ++int ++tua9001_Initialize( ++ TUNER_MODULE *pTuner ++ ) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ // Initialize TUA9001 tuner. ++ if(initializeTua9001(pTuner) != TUA9001_TUNER_OK) ++ goto error_status_initialize_tuner; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_initialize_tuner: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_SET_RF_FREQ_HZ ++ ++*/ ++int ++tua9001_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ long RfFreqKhz; ++ int BandwidthMode; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ // Get bandwidth mode. ++ BandwidthMode = pExtra->BandwidthMode; ++ ++ // Calculate RF frequency in KHz. ++ // Note: RfFreqKhz = round(RfFreqHz / 1000) ++ RfFreqKhz = (long)((RfFreqHz + 500) / 1000); ++ ++ // Set TUA9001 RF frequency and bandwidth. ++ if(tuneTua9001(pTuner, RfFreqKhz, BandwidthMode) != TUA9001_TUNER_OK) ++ goto error_status_set_tuner_rf_frequency; ++ ++ ++ // Set tuner RF frequency parameter. ++ pTuner->RfFreqHz = (unsigned long)(RfFreqKhz * 1000); ++ pTuner->IsRfFreqHzSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@see TUNER_FP_GET_RF_FREQ_HZ ++ ++*/ ++int ++tua9001_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ) ++{ ++ // Get tuner RF frequency in Hz from tuner module. ++ if(pTuner->IsRfFreqHzSet != YES) ++ goto error_status_get_tuner_rf_frequency; ++ ++ *pRfFreqHz = pTuner->RfFreqHz; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_rf_frequency: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set TUA9001 tuner bandwidth mode. ++ ++*/ ++int ++tua9001_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ long RfFreqKhz; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ // Get RF frequncy in KHz. ++ // Note: Doesn't need to take round() of RfFreqHz, because its value unit is 1000 Hz. ++ RfFreqKhz = (long)(pTuner->RfFreqHz / 1000); ++ ++ // Set TUA9001 RF frequency and bandwidth. ++ if(tuneTua9001(pTuner, RfFreqKhz, BandwidthMode) != TUA9001_TUNER_OK) ++ goto error_status_set_tuner_bandwidth; ++ ++ ++ // Set tuner bandwidth parameter. ++ pExtra->BandwidthMode = BandwidthMode; ++ pExtra->IsBandwidthModeSet = YES; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get TUA9001 tuner bandwidth mode. ++ ++*/ ++int ++tua9001_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ ++ // Get tuner bandwidth in Hz from tuner module. ++ if(pExtra->IsBandwidthModeSet != YES) ++ goto error_status_get_tuner_bandwidth; ++ ++ *pBandwidthMode = pExtra->BandwidthMode; ++ ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_bandwidth: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get register bytes with address. ++ ++*/ ++int ++tua9001_GetRegBytesWithRegAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char RegAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ) ++{ ++ // Get tuner register byte. ++ //if(rtl2832usb_ReadWithRegAddr(DeviceAddr, RegAddr, pReadingBytes, ByteNum) != FUNCTION_SUCCESS) ++ // goto error_status_get_tuner_registers_with_address; ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char TunerDeviceAddr; ++ ++ struct dvb_usb_device *d; ++ ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ // Get tuner device address. ++ pTuner->GetDeviceAddr(pTuner,&TunerDeviceAddr); ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ if( read_rtl2832_tuner_register( d, TunerDeviceAddr, RegAddr, pReadingBytes, ByteNum ) ) ++ goto error_status_get_tuner_registers_with_address; ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_tuner_registers_with_address: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Set system register byte. ++ ++*/ ++int ++tua9001_SetSysRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char WritingByte ++ ) ++{ ++ // Set demod system register byte. ++// if(RTK_SYS_Byte_Write(RegAddr, LEN_1_BYTE, &WritingByte) != TRUE) ++// goto error_status_set_system_registers; ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ struct dvb_usb_device *d; ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ if ( write_usb_sys_char_bytes( d, RTD2832U_SYS, RegAddr, &WritingByte, LEN_1_BYTE) ) ++ goto error_status_set_system_registers; ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_set_system_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++/** ++ ++@brief Get system register byte. ++ ++*/ ++int ++tua9001_GetSysRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char *pReadingByte ++ ) ++{ ++ // Get demod system register byte. ++// if(RTK_SYS_Byte_Read(RegAddr, LEN_1_BYTE, pReadingByte) != TRUE) ++// goto error_status_get_system_registers; ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ struct dvb_usb_device *d; ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ if ( read_usb_sys_char_bytes(d, RTD2832U_SYS, RegAddr, pReadingByte, LEN_1_BYTE) ) ++ goto error_status_get_system_registers; ++ ++ return FUNCTION_SUCCESS; ++ ++ ++error_status_get_system_registers: ++ return FUNCTION_ERROR; ++} ++ ++ ++ ++ ++ ++// TUA9001 custom-implement functions ++ ++ ++int tua9001setRESETN (TUNER_MODULE *pTuner, unsigned int i_state) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ unsigned char Byte; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ // Get GPO value. ++ ++ if(pExtra->GetSysRegByte(pTuner, GPO_ADDR, &Byte) != FUNCTION_SUCCESS) ++ goto error_status_get_system_registers; ++ ++ // Note: Hardware PCB has inverter in this pin, should give inverted value on GPIO3. ++ if (i_state == TUA9001_H_LEVEL) ++ { ++ /* set tuner RESETN pin to "H" */ ++ // Note: The GPIO3 output value should be '0'. ++ Byte &= ~BIT_3_MASK; ++ } ++ else ++ { ++ /* set tuner RESETN pin to "L" */ ++ // Note: The GPIO3 output value should be '1'. ++ Byte |= BIT_3_MASK; ++ } ++ ++ // Set GPO value. ++ if(pExtra->SetSysRegByte(pTuner, GPO_ADDR, Byte) != FUNCTION_SUCCESS) ++ goto error_status_set_system_registers; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status_set_system_registers: ++error_status_get_system_registers: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++ ++int tua9001setRXEN (TUNER_MODULE *pTuner, unsigned int i_state) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ unsigned char Byte; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ // Get GPO value. ++ if(pExtra->GetSysRegByte(pTuner, GPO_ADDR, &Byte) != FUNCTION_SUCCESS) ++ goto error_status_get_system_registers; ++ ++ if (i_state == TUA9001_H_LEVEL) ++ { ++ /* set tuner RXEN pin to "H" */ ++ // Note: The GPIO1 output value should be '1'. ++ Byte |= BIT_1_MASK; ++ } ++ else ++ { ++ /* set tuner RXEN pin to "L" */ ++ // Note: The GPIO1 output value should be '0'. ++ Byte &= ~BIT_1_MASK; ++ } ++ ++ // Set GPO value. ++ if(pExtra->SetSysRegByte(pTuner, GPO_ADDR, Byte) != FUNCTION_SUCCESS) ++ goto error_status_set_system_registers; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status_set_system_registers: ++error_status_get_system_registers: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++ ++int tua9001setCEN (TUNER_MODULE *pTuner, unsigned int i_state) ++{ ++ // Do nothing. ++ // Note: Hardware PCB always gives 'H' to tuner CEN pin. ++ return TUA9001_TUNER_OK; ++} ++ ++ ++ ++int tua9001waitloop (TUNER_MODULE *pTuner, unsigned int i_looptime) ++{ ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ unsigned long WaitTimeMs; ++ ++ ++ // Get base interface. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ /* wait time = i_looptime * 1 uS */ ++ // Note: 1. The unit of WaitMs() function is ms. ++ // 2. WaitTimeMs = ceil(i_looptime / 1000) ++ WaitTimeMs = i_looptime / 1000; ++ ++ if((i_looptime % 1000) > 0) ++ WaitTimeMs += 1; ++ ++ pBaseInterface->WaitMs(pBaseInterface, WaitTimeMs); ++ ++ ++ return TUA9001_TUNER_OK; ++} ++ ++ ++ ++int tua9001i2cBusWrite (TUNER_MODULE *pTuner, unsigned char deviceAddress, unsigned char registerAddress, char *data, ++ unsigned int length) ++{ ++ ++#if 0 ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char ByteNum; ++ unsigned char WritingBytes[I2C_BUFFER_LEN]; ++ unsigned int i; ++ ++ ++ // Get base interface. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ ++ /* I2C write data format */ ++ /* STA device_address ACK register_address ACK H_Byte-Data ACK L_Byte-Data !ACK STO */ ++ ++ /* STA = start condition, ACK = Acknowledge, STO = stop condition */ ++ /* *data = pointer to data source */ ++ /* length = number of bytes to write */ ++ ++ // Determine byte number. ++ ByteNum = length + LEN_1_BYTE; ++ ++ // Determine writing bytes. ++ WritingBytes[0] = registerAddress; ++ ++ for(i = 0; i < length; i++) ++ WritingBytes[LEN_1_BYTE + i] = data[i]; ++ ++ ++ // Send I2C writing command. ++ if(pBaseInterface->I2cWrite(pBaseInterface, deviceAddress, WritingBytes, ByteNum) != FUNCTION_SUCCESS) ++ goto error_status_set_tuner_registers; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status_set_tuner_registers: ++ return TUA9001_TUNER_ERR; ++#endif ++ BASE_INTERFACE_MODULE *pBaseInterface; ++ ++ unsigned char ByteNum; ++ unsigned char WritingBytes[I2C_BUFFER_LEN]; ++ unsigned int i=0; ++ ++ I2C_BRIDGE_MODULE *pI2cBridge; ++ ++ struct dvb_usb_device *d; ++ ++ // Get base interface. ++ pBaseInterface = pTuner->pBaseInterface; ++ ++ // Get I2C bridge. ++ pI2cBridge = pTuner->pI2cBridge; ++ ++ // Get tuner device address. ++ pBaseInterface->GetUserDefinedDataPointer(pBaseInterface, (void **)&d); ++ ++ // Determine byte number. ++ ByteNum = length; ++ ++ // Determine writing bytes. ++ //WritingBytes[0] = registerAddress; ++ ++ for(i = 0; i < length; i++) ++ WritingBytes[i] = data[i]; ++ ++ // Send I2C writing command. ++ if( write_rtl2832_tuner_register( d, deviceAddress, registerAddress, WritingBytes, ByteNum ) ) ++ goto error_status_set_tuner_registers; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status_set_tuner_registers: ++ return TUA9001_TUNER_ERR; ++ ++} ++ ++ ++ ++int tua9001i2cBusRead (TUNER_MODULE *pTuner, unsigned char deviceAddress, unsigned char registerAddress, char *data, ++ unsigned int length) ++{ ++ TUA9001_EXTRA_MODULE *pExtra; ++ ++ ++ // Get tuner extra module. ++ pExtra = &(pTuner->Extra.Tua9001); ++ ++ ++ /* I2C read data format */ ++ /* STA device_address ACK register_address ACK STA H_Byte-Data ACK device_address_read ACK H_Byte-Data ACK L_Byte-Data ACKH STO */ ++ ++ /* STA = start condition, ACK = Acknowledge (generated by TUA9001), ACKH = Acknowledge (generated by Host), STO = stop condition */ ++ /* *data = pointer to data destination */ ++ /* length = number of bytes to read */ ++ ++ // Get tuner register bytes with address. ++ // Note: We must use re-start I2C reading format for TUA9001 tuner register reading. ++ if(pExtra->GetRegBytesWithRegAddr(pTuner, deviceAddress, registerAddress, data, length) != FUNCTION_SUCCESS) ++ goto error_status_get_tuner_registers; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status_get_tuner_registers: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is source code provided by Infineon. ++ ++ ++ ++ ++ ++// Infineon source code - driver_tua9001.c ++ ++ ++/* ============================================================================ ++** Copyright (C) 1997-2007 Infineon AG All rights reserved. ++** ============================================================================ ++** ++** ============================================================================ ++** Revision Information : ++** File name: driver_tua9001.c ++** Version: V 1.01 ++** Date: ++** ++** ============================================================================ ++** History: ++** ++** Date Author Comment ++** ---------------------------------------------------------------------------- ++** ++** 2007.11.06 Walter Pichler created. ++** 2008.04.08 Walter Pichler adaption to TUA 9001E ++** ++** ============================================================================ ++*/ ++ ++/*============================================================================ ++Includes ++============================================================================*/ ++ ++//#include "driver_tua9001.h" ++//#include "driver_tua9001_NeededFunctions.h" /* Note: This function have to be provided by the user */ ++ ++/*============================================================================ ++Local compiler keeys ( usage depends on the application ) ++============================================================================*/ ++ ++#define CRYSTAL_26_0_MHZ ++//#define CRYSTAL_19_2_MHZ ++//#define CRYSTAL_20_48_MHZ ++ ++//#define AGC_BY_IIC ++//#define AGC_BY_AGC_BUS ++#define AGC_BY_EXT_PIN ++ ++ ++/*============================================================================ ++Named Constants Definitions ( usage depends on the application ) ++============================================================================*/ ++ ++#define TUNERs_TUA9001_DEVADDR 0xC0 ++ ++/* Note: The correct device address depends hardware settings. See Datasheet ++ and User Manual for details. */ ++ ++/*============================================================================ ++Local Named Constants Definitions ++============================================================================*/ ++#define OPERATIONAL_MODE 0x03 ++#define CHANNEL_BANDWITH 0x04 ++#define SW_CONTR_TIME_SLICING 0x05 ++#define BASEBAND_GAIN_CONTROL 0x06 ++#define MANUAL_BASEBAND_GAIN 0x0b ++#define REFERENCE_FREQUENCY 0x1d ++#define CHANNEL_WORD 0x1f ++#define CHANNEL_OFFSET 0x20 ++#define CHANNEL_FILTER_TRIMMING 0x2f ++#define OUTPUT_BUFFER 0x32 ++#define RF_AGC_CONFIG_A 0x36 ++#define RF_AGC_CONFIG_B 0x37 ++#define UHF_LNA_SELECT 0x39 ++#define LEVEL_DETECTOR 0x3a ++#define MIXER_CURRENT 0x3b ++#define PORT_CONTROL 0x3e ++#define CRYSTAL_TRIMMING 0x41 ++#define CHANNEL_FILTER_STATUS 0x60 ++#define SIG_STRENGHT_INDICATION 0x62 ++#define PLL_LOCK 0x69 ++#define RECEIVER_STATE 0x70 ++#define RF_INPUT 0x71 ++#define BASEBAND_GAIN 0x72 ++#define CHIP_IDENT_CODE 0x7e ++#define CHIP_REVISION 0x7f ++ ++#define TUNERs_TUA9001_BW_8 0xcf ++#define TUNERs_TUA9001_BW_7 0x10 ++#define TUNERs_TUA9001_BW_6 0x20 ++#define TUNERs_TUA9001_BW_5 0x30 ++ ++ ++ ++ ++/*============================================================================ ++ Types definition ++============================================================================*/ ++ ++ ++ ++ ++/*============================================================================ ++ Public Functions ++============================================================================*/ ++ ++ ++/** ++ * tuner initialisation ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int initializeTua9001 (TUNER_MODULE *pTuner) ++{ ++// unsigned int counter; ++ char i2cseq[2]; ++// tua9001tunerReceiverState_t tunerState; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ /* Note: CEN may also be hard wired in the application*/ ++ if(tua9001setCEN (pTuner, TUA9001_H_LEVEL) != TUA9001_TUNER_OK) goto error_status; /* asserting Chip enable */ ++ ++ if(tua9001setRESETN (pTuner, TUA9001_L_LEVEL) != TUA9001_TUNER_OK) goto error_status; /* asserting RESET */ ++ ++ if(tua9001setRXEN (pTuner, TUA9001_L_LEVEL) != TUA9001_TUNER_OK) goto error_status; /* RXEN to low >> IDLE STATE */ ++ ++ /* Note: 20ms assumes that all external power supplies are settled. If not, add more time here */ ++ tua9001waitloop (pTuner, 20); /* wait for 20 uS */ ++ ++ if(tua9001setRESETN (pTuner, TUA9001_H_LEVEL) != TUA9001_TUNER_OK) goto error_status; /* de-asserting RESET */ ++ ++ /* This is to wait for the Crystal Oscillator to settle .. wait until IDLE mode is reached */ ++// counter = 6; ++// do ++// { ++// counter --; ++// tua9001waitloop (pTuner, 1000); /* wait for 1 mS */ ++// if(getReceiverStateTua9001 (pTuner, &tunerState) != TUA9001_TUNER_OK) goto error_status; ++// }while ((tunerState != TUA9001_IDLE) && (counter)); ++ ++// if (tunerState != TUA9001_IDLE) ++// return TUA9001_TUNER_ERR; /* error >> break initialization */ ++ ++ // Replace the above check loop with 6 ms delay. ++ // Because maybe there are undefined cases in getReceiverStateTua9001(), we have to avoid using the function. ++ tua9001waitloop (pTuner, 6000); /* wait for 6 mS */ ++ ++ /**** Overwrite default register value ****/ ++ i2cseq[0] = 0x65; /* Waiting time before PLL cal. start */ ++ i2cseq[1] = 0x12; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x1e, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0xB8; /* VCO Varactor bias fine tuning */ ++ i2cseq[1] = 0x88; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x25, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x54; /* LNA switching Threshold for UHF1/2 */ ++ i2cseq[1] = 0x60; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x39, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x00; ++ i2cseq[1] = 0xC0; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x3b, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0xF0; /* LO- Path Set LDO output voltage */ ++ i2cseq[1] = 0x00; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x3a, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x00; /* Set EXTAGC interval */ ++ i2cseq[1] = 0x00; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x08, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x00; /* Set max. capacitive load */ ++ i2cseq[1] = 0x30; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x32, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ ++ /**** Set Crystal Reference Frequency an Trim value ****/ ++ ++#if defined(CRYSTAL_26_0_MHZ) // Frequency 26 MHz ++ i2cseq[0] = 0x01; ++ i2cseq[1] = 0xB0; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x1d, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x70; // NDK 3225 series 26 MHz XTAL ++ i2cseq[1] = 0x3a; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x41, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ i2cseq[0] = 0x1C; ++ i2cseq[1] = 0x78; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x40, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++#elif defined(CRYSTAL_19_2_MHZ) // Frequency 19.2 MHz ++ i2cseq[0] = 0x01; ++ i2cseq[1] = 0xA0; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x1d, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ // Note: Insert optimised register values for 0x40 / 0x41 for used crystal ++ // contact application support for further information ++#elif defined(CRYSTAL_20_48_MHZ) // Frequency 20,48 MHz ++ i2cseq[0] = 0x01; ++ i2cseq[1] = 0xA8; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x1d, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ // Note: Insert optimised register values for 0x40 / 0x41 for used crystal ++ // contact application support for further information ++#endif ++ ++ ++ ++ /**** Set desired Analog Baseband AGC mode ****/ ++#if defined (AGC_BY_IIC) ++ i2cseq[0] = 0x00; /* Bypass AGC controller >> IIC based AGC */ ++ i2cseq[1] = 0x40; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x06, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++#elif defined(AGC_BY_AGC_BUS) ++ i2cseq[0] = 0x00; /* Digital AGC bus */ ++ i2cseq[1] = 0x00; /* 0,5 dB steps */ ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x06, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++#elif defined(AGC_BY_EXT_PIN) ++ i2cseq[0] = 0x40; /* Ext. AGC pin */ ++ i2cseq[1] = 0x00; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x06, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++#endif ++ ++ ++ /**** set desired RF AGC parameter *****/ ++ i2cseq[0] = 0x1c; /* Set Wideband Detector Current (100 uA) */ ++ i2cseq[1] = 0x00; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x2c, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0xC0; /* Set RF AGC Threshold (-32.5dBm) */ ++ i2cseq[1] = 0x13; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x36, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x6f; /* RF AGC Parameter */ ++ i2cseq[1] = 0x18; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x37, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x00; /* aditional VCO settings */ ++ i2cseq[1] = 0x08; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x27, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x00; /* aditional PLL settings */ ++ i2cseq[1] = 0x01; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x2a, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ i2cseq[0] = 0x0a; /* VCM correction */ ++ i2cseq[1] = 0x40; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x34, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++ ++/** ++ * tuner tune ++ * @param i_freq tuning frequency ++ * @param i_bandwidth channel bandwidth ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int tuneTua9001 (TUNER_MODULE *pTuner, long i_freq, tua9001tunerDriverBW_t i_bandwidth) ++{ ++ char i2cseq[2]; ++ unsigned int divider_factor; ++ unsigned int ch_offset; ++// unsigned int counter; ++ unsigned int lo_path_settings; ++// tua9001tunerReceiverState_t tunerState; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ ++ ++ /* de-assert RXEN >> IDLE STATE */ ++ if(tua9001setRXEN (pTuner, TUA9001_L_LEVEL) != TUA9001_TUNER_OK) goto error_status; ++ ++ ++ /* calculate divider factor */ ++ if (i_freq < 1000000) /* divider factor and channel offset for UHF/VHF III */ ++ { ++ ch_offset = 0x1C20; /* channel offset 150 MHz */ ++ divider_factor = (unsigned int) (((i_freq - 150000) * 48) / 1000); ++ lo_path_settings = 0xb6de; ++ } ++ ++ else /* calculate divider factor for L-Band Frequencies */ ++ { ++ ch_offset = 0x5460; /* channel offset 450 MHz */ ++ divider_factor = (unsigned int) (((i_freq - 450000) * 48) / 1000); ++ lo_path_settings = 0xbede; ++ } ++ ++ ++ // Set LO Path ++ i2cseq[0] = lo_path_settings >> 8; ++ i2cseq[1] = lo_path_settings & 0xff; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x2b, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ // Set channel offset ++ i2cseq [0] = ch_offset >> 8; ++ i2cseq [1] = ch_offset & 0xff; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x20, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ // Set Frequency ++ i2cseq [0] = divider_factor >> 8; ++ i2cseq [1] = divider_factor & 0xff; ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x1f, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ // Set bandwidth ++ if(tua9001i2cBusRead (pTuner, DeviceAddr, 0x04, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; /* get current register value */ ++ i2cseq [0] &= TUNERs_TUA9001_BW_8; ++ ++ switch (i_bandwidth) ++ { ++ case TUA9001_TUNER_BANDWIDTH_8MHZ: ++ // Do nothing. ++ break; ++ case TUA9001_TUNER_BANDWIDTH_7MHZ: i2cseq [0] |= TUNERs_TUA9001_BW_7; ++ break; ++ case TUA9001_TUNER_BANDWIDTH_6MHZ: i2cseq [0] |= TUNERs_TUA9001_BW_6; ++ break; ++ case TUA9001_TUNER_BANDWIDTH_5MHZ: i2cseq [0] |= TUNERs_TUA9001_BW_5; ++ break; ++ default: ++ goto error_status; ++ break; ++ } ++ ++ if(tua9001i2cBusWrite (pTuner, DeviceAddr, 0x04, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; ++ ++ /* assert RXEN >> RX STATE */ ++ if(tua9001setRXEN (pTuner, TUA9001_H_LEVEL) != TUA9001_TUNER_OK) goto error_status; ++ ++ /* This is to wait for the RX state to settle .. wait until RX mode is reached */ ++// counter = 3; ++// do ++// { ++// counter --; ++// tua9001waitloop (pTuner, 1000); /* wait for 1 mS */ ++// if(getReceiverStateTua9001 (pTuner, &tunerState) != TUA9001_TUNER_OK) goto error_status; ++// }while ((tunerState != TUA9001_RX) && (counter)); ++ ++// if (tunerState != TUA9001_RX) ++// { ++// if(tua9001setRXEN (pTuner, TUA9001_L_LEVEL) != TUA9001_TUNER_OK) goto error_status; /* d-assert RXEN >> IDLE STATE */ ++// return TUA9001_TUNER_ERR; /* error >> tuning fail */ ++// } ++ ++ // Replace the above check loop with 3 ms delay. ++ // Because maybe there are undefined cases in getReceiverStateTua9001(), we have to avoid using the function. ++ tua9001waitloop (pTuner, 3000); /* wait for 3 mS */ ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++/** ++ * Get pll locked state ++ * @param o_pll pll locked state ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int getPllLockedStateTua9001 (TUNER_MODULE *pTuner, tua9001tunerPllLocked_t *o_pll) ++{ ++ char i2cseq[2]; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ if(tua9001i2cBusRead (pTuner, DeviceAddr, 0x69, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; /* get current register value */ ++ ++ o_pll[0] = (i2cseq[1] & 0x08) ? TUA9001_PLL_LOCKED : TUA9001_PLL_NOT_LOCKED; ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++/** ++ * Get tuner state ++ * @param o_tunerState tuner state ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++/* ++int getReceiverStateTua9001 (TUNER_MODULE *pTuner, tua9001tunerReceiverState_t *o_tunerState) ++{ ++ char i2cseq[2]; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ if(tua9001i2cBusRead (pTuner, DeviceAddr, 0x70, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; // get current register value ++ ++// switch (i2cseq[1] & ~0x1f) ++ // Note: Maybe the MSB byte is i2cseq[0] ++ // The original code looks like the MSB byte is i2cseq[1] ++ // Note: ~0x1f = 0xffffffe0, not 0xe0 --> i2cseq[0] & ~0x1f result is wrong. ++ switch (i2cseq[0] & 0xe0) ++ { ++ case 0x80: o_tunerState [0] = TUA9001_IDLE; break; ++ case 0x40: o_tunerState [0] = TUA9001_RX; break; ++ case 0x20: o_tunerState [0] = TUA9001_STANDBY; break; ++ default: goto error_status; break; ++ } ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++*/ ++ ++/** ++ * Get active input ++ * @param o_activeInput active input info ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++/* ++int getActiveInputTua9001 (TUNER_MODULE *pTuner, tua9001tunerActiveInput_t *o_activeInput) ++{ ++ char i2cseq[2]; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ if(tua9001i2cBusRead (pTuner, DeviceAddr, 0x71, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; // get current register value ++ ++// switch (i2cseq[1] & ~0x0f) ++ // Note: Maybe the MSB byte is i2cseq[0] ++ // The original code looks like the MSB byte is i2cseq[1] ++ // Note: ~0x0f = 0xfffffff0, not 0xf0 --> i2cseq[0] & ~0x0f result is wrong. ++ switch (i2cseq[0] & 0xf0) ++ { ++ case 0x80: o_activeInput [0] = TUA9001_L_INPUT_ACTIVE; break; ++ case 0x20: o_activeInput [0] = TUA9001_UHF_INPUT_ACTIVE; break; ++ case 0x10: o_activeInput [0] = TUA9001_VHF_INPUT_ACTIVE; break; ++ default: goto error_status; break; ++ } ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++*/ ++ ++/** ++ * Get baseband gain value ++ * @param o_basebandGain baseband gain value ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int getBasebandGainTua9001 (TUNER_MODULE *pTuner, char *o_basebandGain) ++{ ++ char i2cseq[2]; ++ unsigned char DeviceAddr; ++ ++ // Get tuner deviece address. ++ pTuner->GetDeviceAddr(pTuner, &DeviceAddr); ++ ++ if(tua9001i2cBusRead (pTuner, DeviceAddr, 0x72, i2cseq, 2) != TUA9001_TUNER_OK) goto error_status; /* get current register value */ ++// o_basebandGain [0] = i2cseq [1]; ++ // Note: Maybe the MSB byte is i2cseq[0] ++ // The original code looks like the MSB byte is i2cseq[1] ++ o_basebandGain [0] = i2cseq [0]; ++ ++ return TUA9001_TUNER_OK; ++ ++ ++error_status: ++ return TUA9001_TUNER_ERR; ++} ++ ++ ++ +diff --git a/drivers/media/dvb/dvb-usb/tuner_tua9001.h b/drivers/media/dvb/dvb-usb/tuner_tua9001.h +new file mode 100644 +index 0000000..dbfbce6 +--- /dev/null ++++ b/drivers/media/dvb/dvb-usb/tuner_tua9001.h +@@ -0,0 +1,493 @@ ++#ifndef __TUNER_TUA9001_H ++#define __TUNER_TUA9001_H ++ ++/** ++ ++@file ++ ++@brief TUA9001 tuner module declaration ++ ++One can manipulate TUA9001 tuner through TUA9001 module. ++TUA9001 module is derived from tunerd module. ++ ++ ++ ++@par Example: ++@code ++ ++// The example is the same as the tuner example in tuner_base.h except the listed lines. ++ ++ ++ ++#include "tuner_tua9001.h" ++ ++ ++... ++ ++ ++ ++int main(void) ++{ ++ TUNER_MODULE *pTuner; ++ TUA9001_EXTRA_MODULE *pTunerExtra; ++ ++ TUNER_MODULE TunerModuleMemory; ++ BASE_INTERFACE_MODULE BaseInterfaceModuleMemory; ++ I2C_BRIDGE_MODULE I2cBridgeModuleMemory; ++ ++ int BandwidthMode; ++ ++ ++ ... ++ ++ ++ ++ // Build TUA9001 tuner module. ++ BuildTua9001Module( ++ &pTuner, ++ &TunerModuleMemory, ++ &BaseInterfaceModuleMemory, ++ &I2cBridgeModuleMemory, ++ 0xc0 // I2C device address is 0xc0 in 8-bit format. ++ ); ++ ++ ++ ++ ++ ++ // Get TUA9001 tuner extra module. ++ pTunerExtra = (T2266_EXTRA_MODULE *)(pTuner->pExtra); ++ ++ ++ ++ ++ ++ // ==== Initialize tuner and set its parameters ===== ++ ++ ... ++ ++ // Set TUA9001 bandwidth. ++ pTunerExtra->SetBandwidthMode(pTuner, TUA9001_BANDWIDTH_6MHZ); ++ ++ ++ ++ ++ ++ // ==== Get tuner information ===== ++ ++ ... ++ ++ // Get TUA9001 bandwidth. ++ pTunerExtra->GetBandwidthMode(pTuner, &BandwidthMode); ++ ++ ++ ++ ++ ++ // See the example for other tuner functions in tuner_base.h ++ ++ ++ return 0; ++} ++ ++ ++@endcode ++ ++*/ ++ ++ ++#include "tuner_base.h" ++//#include "i2c_rtl2832usb.h" ++ ++ ++ ++ ++ ++// The following context is source code provided by Infineon. ++ ++ ++ ++ ++ ++// Infineon source code - driver_tua9001.h ++ ++ ++ ++/* ============================================================================ ++** Copyright (C) 1997-2007 Infineon AG All rights reserved. ++** ============================================================================ ++** ++** ============================================================================ ++** Revision Information : ++** File name: driver_tua9001.h ++** Version: ++** Date: ++** ++** ============================================================================ ++** History: ++** ++** Date Author Comment ++** ---------------------------------------------------------------------------- ++** ++** 2007.11.06 Walter Pichler created. ++** ============================================================================ ++*/ ++ ++ ++/*============================================================================ ++ Named Constants Definitions ++============================================================================*/ ++ ++#define TUA9001_TUNER_OK 0 ++#define TUA9001_TUNER_ERR 0xff ++ ++#define TUA9001_H_LEVEL 1 ++#define TUA9001_L_LEVEL 0 ++ ++ ++/*============================================================================ ++ Types definition ++============================================================================*/ ++ ++ ++typedef enum { ++ TUA9001_TUNER_BANDWIDTH_8MHZ, ++ TUA9001_TUNER_BANDWIDTH_7MHZ, ++ TUA9001_TUNER_BANDWIDTH_6MHZ, ++ TUA9001_TUNER_BANDWIDTH_5MHZ, ++ } tua9001tunerDriverBW_t; ++ ++ ++typedef enum { ++ TUA9001_PLL_LOCKED, ++ TUA9001_PLL_NOT_LOCKED ++ }tua9001tunerPllLocked_t; ++ ++ ++typedef enum { ++ TUA9001_STANDBY, ++ TUA9001_IDLE, ++ TUA9001_RX ++ } tua9001tunerReceiverState_t; ++ ++ ++typedef enum { ++ TUA9001_L_INPUT_ACTIVE, ++ TUA9001_UHF_INPUT_ACTIVE, ++ TUA9001_VHF_INPUT_ACTIVE ++ } tua9001tunerActiveInput_t; ++ ++ ++ ++/*============================================================================ ++ Public functions ++============================================================================*/ ++ ++/** ++ * tuner initialisation ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++extern int initializeTua9001 (TUNER_MODULE *pTuner); ++ ++ ++/** ++ * tuner tune ++ * @param i_freq tuning frequency ++ * @param i_bandwidth channel bandwidth ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++extern int tuneTua9001 (TUNER_MODULE *pTuner, long i_freq, tua9001tunerDriverBW_t i_bandwidth); ++ ++ ++/** ++ * Get tuner state ++ * @param o_tunerState tuner state ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++extern int getReceiverStateTua9001 (TUNER_MODULE *pTuner, tua9001tunerReceiverState_t *o_tunerState); ++ ++/** ++ * Get active input ++ * @param o_activeInput active input info ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++extern int getActiveInputTua9001 (TUNER_MODULE *pTuner, tua9001tunerActiveInput_t *o_activeInput); ++ ++ ++/** ++ * Get baseband gain value ++ * @param o_basebandGain baseband gain value ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++extern int getBasebandGainTua9001 (TUNER_MODULE *pTuner, char *o_basebandGain); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// Infineon source code - driver_tua9001_NeededFunctions.h ++ ++ ++ ++/*======================================================================================================================== ++ additional needed external funtions ( have to be provided by the user! ) ++========================================================================================================================*/ ++ ++/** ++ * set / reset tuner reset input ++ * @param i_state level ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int tua9001setRESETN (TUNER_MODULE *pTuner, unsigned int i_state); ++ ++ ++/** ++ * set / reset tuner receive enable input ++ * @param i_state level ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int tua9001setRXEN (TUNER_MODULE *pTuner, unsigned int i_state); ++ ++ ++/** ++ * set / reset tuner chiop enable input ++ * @param i_state level ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int tua9001setCEN (TUNER_MODULE *pTuner, unsigned int i_state); ++ ++ ++/** ++ * waitloop ++ * @param i_looptime * 1uS ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++int tua9001waitloop (TUNER_MODULE *pTuner, unsigned int i_looptime); ++ ++ ++/** ++ * i2cBusWrite ++ * @param deviceAdress chip address ++ * @param registerAdress register address ++ * @param *data pointer to data source ++ * @param length number of bytes to transmit ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++ int tua9001i2cBusWrite (TUNER_MODULE *pTuner, unsigned char deviceAddress, unsigned char registerAddress, char *data, ++ unsigned int length); ++ ++ ++/** ++ * i2cBusRead ++ * @param deviceAdress chip address ++ * @param registerAdress register address ++ * @param *data pointer to data destination ++ * @param length number of bytes to read ++ * @retval TUA9001_TUNER_OK No error ++ * @retval TUA9001_TUNER_ERR Error ++*/ ++ ++ int tua9001i2cBusRead (TUNER_MODULE *pTuner, unsigned char deviceAddress, unsigned char registerAddress, char *data, ++ unsigned int length); ++ ++/*======================================================================================================================== ++ end of additional needed external funtions ++========================================================================================================================*/ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++// The following context is TUA9001 tuner API source code ++ ++ ++ ++ ++ ++/** ++ ++@file ++ ++@brief TUA9001 tuner module declaration ++ ++One can manipulate TUA9001 tuner through TUA9001 module. ++TUA9001 module is derived from tuner module. ++ ++*/ ++ ++ ++ ++ ++ ++// Definitions ++ ++// Constant ++#define GPO_ADDR 0x1 ++ ++// Bandwidth modes ++enum TUA9001_BANDWIDTH_MODE ++{ ++ TUA9001_BANDWIDTH_5MHZ = TUA9001_TUNER_BANDWIDTH_5MHZ, ++ TUA9001_BANDWIDTH_6MHZ = TUA9001_TUNER_BANDWIDTH_6MHZ, ++ TUA9001_BANDWIDTH_7MHZ = TUA9001_TUNER_BANDWIDTH_7MHZ, ++ TUA9001_BANDWIDTH_8MHZ = TUA9001_TUNER_BANDWIDTH_8MHZ, ++}; ++ ++// Default value ++#define TUA9001_RF_FREQ_HZ_DEFAULT 50000000; ++#define TUA9001_BANDWIDTH_MODE_DEFAULT TUA9001_BANDWIDTH_5MHZ; ++ ++ ++ ++ ++ ++// Builder ++void ++BuildTua9001Module( ++ TUNER_MODULE **ppTuner, ++ TUNER_MODULE *pTunerModuleMemory, ++ BASE_INTERFACE_MODULE *pBaseInterfaceModuleMemory, ++ I2C_BRIDGE_MODULE *pI2cBridgeModuleMemory, ++ unsigned char DeviceAddr ++ ); ++ ++ ++ ++ ++ ++// Manipulaing functions ++void ++tua9001_GetTunerType( ++ TUNER_MODULE *pTuner, ++ int *pTunerType ++ ); ++ ++void ++tua9001_GetDeviceAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char *pDeviceAddr ++ ); ++ ++int ++tua9001_Initialize( ++ TUNER_MODULE *pTuner ++ ); ++ ++int ++tua9001_SetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long RfFreqHz ++ ); ++ ++int ++tua9001_GetRfFreqHz( ++ TUNER_MODULE *pTuner, ++ unsigned long *pRfFreqHz ++ ); ++ ++ ++ ++ ++ ++// Extra manipulaing functions ++int ++tua9001_SetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int BandwidthMode ++ ); ++ ++int ++tua9001_GetBandwidthMode( ++ TUNER_MODULE *pTuner, ++ int *pBandwidthMode ++ ); ++ ++int ++tua9001_GetRegBytesWithRegAddr( ++ TUNER_MODULE *pTuner, ++ unsigned char DeviceAddr, ++ unsigned char RegAddr, ++ unsigned char *pReadingBytes, ++ unsigned char ByteNum ++ ); ++ ++int ++tua9001_SetSysRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char WritingByte ++ ); ++ ++int ++tua9001_GetSysRegByte( ++ TUNER_MODULE *pTuner, ++ unsigned short RegAddr, ++ unsigned char *pReadingByte ++ ); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++#endif +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-dvb-stop-URBs-when-stopping-the-streaming.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-dvb-stop-URBs-when-stopping-the-streaming.patch new file mode 100644 index 0000000000..eac9d080d0 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-dvb-stop-URBs-when-stopping-the-streaming.patch @@ -0,0 +1,87 @@ +em28xx-dvb: stop URBs when stopping the streaming + +Stop the URBs in em28xx_stop_streaming(), so that em28xx_irq_callback() +cannot be called after the streaming has stopped. + +This should eliminate the crashes reported by Antti Palosaari and the warnings +reported by Andy Furniss. + +Signed-off-by: Gianluca Gennari +--- + drivers/media/video/em28xx/em28xx-core.c | 26 +++++++++++++++++++++++++- + drivers/media/video/em28xx/em28xx-dvb.c | 2 +- + drivers/media/video/em28xx/em28xx.h | 1 + + 3 files changed, 27 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c +index 53a9fb9..cbbe399 100644 +--- a/drivers/media/video/em28xx/em28xx-core.c ++++ b/drivers/media/video/em28xx/em28xx-core.c +@@ -666,7 +666,6 @@ int em28xx_capture_start(struct em28xx *dev, int start) + + return rc; + } +-EXPORT_SYMBOL_GPL(em28xx_capture_start); + + int em28xx_vbi_supported(struct em28xx *dev) + { +@@ -1008,6 +1007,31 @@ void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode) + EXPORT_SYMBOL_GPL(em28xx_uninit_isoc); + + /* ++ * Stop URBs ++ */ ++void em28xx_stop_urbs(struct em28xx *dev) ++{ ++ int i; ++ struct urb *urb; ++ struct em28xx_usb_isoc_bufs *isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ ++ em28xx_isocdbg("em28xx: called em28xx_stop_urbs\n"); ++ ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ urb = isoc_bufs->urb[i]; ++ if (urb) { ++ if (!irqs_disabled()) ++ usb_kill_urb(urb); ++ else ++ usb_unlink_urb(urb); ++ } ++ } ++ ++ em28xx_capture_start(dev, 0); ++} ++EXPORT_SYMBOL_GPL(em28xx_stop_urbs); ++ ++/* + * Allocate URBs + */ + int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode, +diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c +index 21f3e55..ea3810f 100644 +--- a/drivers/media/video/em28xx/em28xx-dvb.c ++++ b/drivers/media/video/em28xx/em28xx-dvb.c +@@ -183,7 +183,7 @@ static int em28xx_stop_streaming(struct em28xx_dvb *dvb) + { + struct em28xx *dev = dvb->adapter.priv; + +- em28xx_capture_start(dev, 0); ++ em28xx_stop_urbs(dev); + + em28xx_set_mode(dev, EM28XX_SUSPEND); + +diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h +index 2868b19..286b9f8 100644 +--- a/drivers/media/video/em28xx/em28xx.h ++++ b/drivers/media/video/em28xx/em28xx.h +@@ -695,6 +695,7 @@ int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode, + int max_packets, int num_bufs, int max_pkt_size, + int (*isoc_copy) (struct em28xx *dev, struct urb *urb)); + void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode); ++void em28xx_stop_urbs(struct em28xx *dev); + int em28xx_isoc_dvb_max_packetsize(struct em28xx *dev); + int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode); + int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio); +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-iso-transfer-buffers.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-iso-transfer-buffers.patch new file mode 100644 index 0000000000..f05841a5a9 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-iso-transfer-buffers.patch @@ -0,0 +1,447 @@ +em28xx: pre-allocate DVB iso transfer buffers + +From: Gianluca Gennari +--- + drivers/media/video/em28xx/em28xx-cards.c | 16 +++- + drivers/media/video/em28xx/em28xx-core.c | 140 +++++++++++++++++++---------- + drivers/media/video/em28xx/em28xx-dvb.c | 14 ++-- + drivers/media/video/em28xx/em28xx-video.c | 10 ++- + drivers/media/video/em28xx/em28xx.h | 23 ++++- + 5 files changed, 139 insertions(+), 64 deletions(-) + +diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c +index 4561cd8..ce1b60f 100644 +--- a/drivers/media/video/em28xx/em28xx-cards.c ++++ b/drivers/media/video/em28xx/em28xx-cards.c +@@ -3307,6 +3307,17 @@ static int em28xx_usb_probe(struct usb_interface *interface, + goto unlock_and_free; + } + ++ if (has_dvb) { ++ /* pre-allocate DVB isoc transfer buffers */ ++ retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE, ++ EM28XX_DVB_MAX_PACKETS, ++ EM28XX_DVB_NUM_BUFS, ++ dev->dvb_max_pkt_size); ++ if (retval) { ++ goto unlock_and_free; ++ } ++ } ++ + request_modules(dev); + + /* Should be the last thing to do, to avoid newer udev's to +@@ -3379,7 +3390,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) + video_device_node_name(dev->vdev)); + + dev->state |= DEV_MISCONFIGURED; +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, dev->mode); + dev->state |= DEV_DISCONNECTED; + wake_up_interruptible(&dev->wait_frame); + wake_up_interruptible(&dev->wait_stream); +@@ -3388,6 +3399,9 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) + em28xx_release_resources(dev); + } + ++ /* free DVB isoc buffers */ ++ em28xx_uninit_isoc(dev, EM28XX_DIGITAL_MODE); ++ + mutex_unlock(&dev->lock); + + em28xx_close_extension(dev); +diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c +index 0aacc96..b1e8a51 100644 +--- a/drivers/media/video/em28xx/em28xx-core.c ++++ b/drivers/media/video/em28xx/em28xx-core.c +@@ -666,6 +666,7 @@ int em28xx_capture_start(struct em28xx *dev, int start) + + return rc; + } ++EXPORT_SYMBOL_GPL(em28xx_capture_start); + + int em28xx_vbi_supported(struct em28xx *dev) + { +@@ -961,40 +962,46 @@ static void em28xx_irq_callback(struct urb *urb) + /* + * Stop and Deallocate URBs + */ +-void em28xx_uninit_isoc(struct em28xx *dev) ++void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode) + { + struct urb *urb; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; + int i; + +- em28xx_isocdbg("em28xx: called em28xx_uninit_isoc\n"); ++ em28xx_isocdbg("em28xx: called em28xx_uninit_isoc in mode %d\n", mode); ++ ++ if (mode == EM28XX_DIGITAL_MODE) ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ else ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; + + dev->isoc_ctl.nfields = -1; +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- urb = dev->isoc_ctl.urb[i]; ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ urb = isoc_bufs->urb[i]; + if (urb) { + if (!irqs_disabled()) + usb_kill_urb(urb); + else + usb_unlink_urb(urb); + +- if (dev->isoc_ctl.transfer_buffer[i]) { ++ if (isoc_bufs->transfer_buffer[i]) { + usb_free_coherent(dev->udev, + urb->transfer_buffer_length, +- dev->isoc_ctl.transfer_buffer[i], ++ isoc_bufs->transfer_buffer[i], + urb->transfer_dma); + } + usb_free_urb(urb); +- dev->isoc_ctl.urb[i] = NULL; ++ isoc_bufs->urb[i] = NULL; + } +- dev->isoc_ctl.transfer_buffer[i] = NULL; ++ isoc_bufs->transfer_buffer[i] = NULL; + } + +- kfree(dev->isoc_ctl.urb); +- kfree(dev->isoc_ctl.transfer_buffer); ++ kfree(isoc_bufs->urb); ++ kfree(isoc_bufs->transfer_buffer); + +- dev->isoc_ctl.urb = NULL; +- dev->isoc_ctl.transfer_buffer = NULL; +- dev->isoc_ctl.num_bufs = 0; ++ isoc_bufs->urb = NULL; ++ isoc_bufs->transfer_buffer = NULL; ++ isoc_bufs->num_bufs = 0; + + em28xx_capture_start(dev, 0); + } +@@ -1003,91 +1010,130 @@ EXPORT_SYMBOL_GPL(em28xx_uninit_isoc); + /* + * Allocate URBs and start IRQ + */ +-int em28xx_init_isoc(struct em28xx *dev, int max_packets, +- int num_bufs, int max_pkt_size, +- int (*isoc_copy) (struct em28xx *dev, struct urb *urb)) ++int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size) + { +- struct em28xx_dmaqueue *dma_q = &dev->vidq; +- struct em28xx_dmaqueue *vbi_dma_q = &dev->vbiq; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; + int i; + int sb_size, pipe; + struct urb *urb; + int j, k; +- int rc; + +- em28xx_isocdbg("em28xx: called em28xx_prepare_isoc\n"); ++ em28xx_isocdbg("em28xx: called em28xx_alloc_isoc in mode %d\n", mode); ++ ++ if (mode == EM28XX_DIGITAL_MODE) ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ else ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; + + /* De-allocates all pending stuff */ +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + +- dev->isoc_ctl.isoc_copy = isoc_copy; +- dev->isoc_ctl.num_bufs = num_bufs; ++ isoc_bufs->num_bufs = num_bufs; + +- dev->isoc_ctl.urb = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); +- if (!dev->isoc_ctl.urb) { ++ isoc_bufs->urb = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); ++ if (!isoc_bufs->urb) { + em28xx_errdev("cannot alloc memory for usb buffers\n"); + return -ENOMEM; + } + +- dev->isoc_ctl.transfer_buffer = kzalloc(sizeof(void *)*num_bufs, ++ isoc_bufs->transfer_buffer = kzalloc(sizeof(void *)*num_bufs, + GFP_KERNEL); +- if (!dev->isoc_ctl.transfer_buffer) { ++ if (!isoc_bufs->transfer_buffer) { + em28xx_errdev("cannot allocate memory for usb transfer\n"); +- kfree(dev->isoc_ctl.urb); ++ kfree(isoc_bufs->urb); + return -ENOMEM; + } + +- dev->isoc_ctl.max_pkt_size = max_pkt_size; ++ isoc_bufs->max_pkt_size = max_pkt_size; ++ isoc_bufs->num_packets = max_packets; + dev->isoc_ctl.vid_buf = NULL; + dev->isoc_ctl.vbi_buf = NULL; + +- sb_size = max_packets * dev->isoc_ctl.max_pkt_size; ++ sb_size = isoc_bufs->num_packets * isoc_bufs->max_pkt_size; + + /* allocate urbs and transfer buffers */ +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- urb = usb_alloc_urb(max_packets, GFP_KERNEL); ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ urb = usb_alloc_urb(isoc_bufs->num_packets, GFP_KERNEL); + if (!urb) { + em28xx_err("cannot alloc isoc_ctl.urb %i\n", i); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return -ENOMEM; + } +- dev->isoc_ctl.urb[i] = urb; ++ isoc_bufs->urb[i] = urb; + +- dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev, ++ isoc_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, + sb_size, GFP_KERNEL, &urb->transfer_dma); +- if (!dev->isoc_ctl.transfer_buffer[i]) { ++ if (!isoc_bufs->transfer_buffer[i]) { + em28xx_err("unable to allocate %i bytes for transfer" + " buffer %i%s\n", + sb_size, i, + in_interrupt() ? " while in int" : ""); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return -ENOMEM; + } +- memset(dev->isoc_ctl.transfer_buffer[i], 0, sb_size); ++ memset(isoc_bufs->transfer_buffer[i], 0, sb_size); + + /* FIXME: this is a hack - should be + 'desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK' + should also be using 'desc.bInterval' + */ + pipe = usb_rcvisocpipe(dev->udev, +- dev->mode == EM28XX_ANALOG_MODE ? ++ mode == EM28XX_ANALOG_MODE ? + EM28XX_EP_ANALOG : EM28XX_EP_DIGITAL); + + usb_fill_int_urb(urb, dev->udev, pipe, +- dev->isoc_ctl.transfer_buffer[i], sb_size, ++ isoc_bufs->transfer_buffer[i], sb_size, + em28xx_irq_callback, dev, 1); + +- urb->number_of_packets = max_packets; ++ urb->number_of_packets = isoc_bufs->num_packets; + urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; + + k = 0; +- for (j = 0; j < max_packets; j++) { ++ for (j = 0; j < isoc_bufs->num_packets; j++) { + urb->iso_frame_desc[j].offset = k; + urb->iso_frame_desc[j].length = +- dev->isoc_ctl.max_pkt_size; +- k += dev->isoc_ctl.max_pkt_size; ++ isoc_bufs->max_pkt_size; ++ k += isoc_bufs->max_pkt_size; + } + } ++ return 0; ++} ++EXPORT_SYMBOL_GPL(em28xx_alloc_isoc); ++ ++/* ++ * Allocate URBs and start IRQ ++ */ ++int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size, ++ int (*isoc_copy) (struct em28xx *dev, struct urb *urb)) ++{ ++ struct em28xx_dmaqueue *dma_q = &dev->vidq; ++ struct em28xx_dmaqueue *vbi_dma_q = &dev->vbiq; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; ++ int i; ++ int rc; ++ int alloc; ++ ++ em28xx_isocdbg("em28xx: called em28xx_init_isoc in mode %d\n", mode); ++ ++ dev->isoc_ctl.isoc_copy = isoc_copy; ++ ++ if (mode == EM28XX_DIGITAL_MODE) { ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ /* no need to free/alloc isoc buffers in digital mode */ ++ alloc = 0; ++ } else { ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; ++ alloc = 1; ++ } ++ ++ if (alloc) { ++ rc = em28xx_alloc_isoc(dev, mode, max_packets, ++ num_bufs, max_pkt_size); ++ if (rc) ++ return rc; ++ } + + init_waitqueue_head(&dma_q->wq); + init_waitqueue_head(&vbi_dma_q->wq); +@@ -1095,12 +1141,12 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets, + em28xx_capture_start(dev, 1); + + /* submit urbs and enables IRQ */ +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- rc = usb_submit_urb(dev->isoc_ctl.urb[i], GFP_ATOMIC); ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ rc = usb_submit_urb(isoc_bufs->urb[i], GFP_ATOMIC); + if (rc) { + em28xx_err("submit of urb %i failed (error=%i)\n", i, + rc); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return rc; + } + } +diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c +index 25fc73f..4917b71 100644 +--- a/drivers/media/video/em28xx/em28xx-dvb.c ++++ b/drivers/media/video/em28xx/em28xx-dvb.c +@@ -61,9 +61,6 @@ if (debug >= level) \ + printk(KERN_DEBUG "%s/2-dvb: " fmt, dev->name, ## arg); \ + } while (0) + +-#define EM28XX_DVB_NUM_BUFS 5 +-#define EM28XX_DVB_MAX_PACKETS 64 +- + struct em28xx_dvb { + struct dvb_frontend *fe[2]; + +@@ -172,20 +169,21 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb) + max_dvb_packet_size = dev->dvb_max_pkt_size; + if (max_dvb_packet_size < 0) + return max_dvb_packet_size; +- dprintk(1, "Using %d buffers each with %d bytes\n", ++ dprintk(1, "Using %d buffers each with %d x %d bytes\n", + EM28XX_DVB_NUM_BUFS, ++ EM28XX_DVB_MAX_PACKETS, + max_dvb_packet_size); + +- return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS, +- EM28XX_DVB_NUM_BUFS, max_dvb_packet_size, +- em28xx_dvb_isoc_copy); ++ return em28xx_init_isoc(dev, EM28XX_DIGITAL_MODE, ++ EM28XX_DVB_MAX_PACKETS, EM28XX_DVB_NUM_BUFS, ++ max_dvb_packet_size, em28xx_dvb_isoc_copy); + } + + static int em28xx_stop_streaming(struct em28xx_dvb *dvb) + { + struct em28xx *dev = dvb->adapter.priv; + +- em28xx_uninit_isoc(dev); ++ em28xx_capture_start(dev, 0); + + em28xx_set_mode(dev, EM28XX_SUSPEND); + +diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c +index 613300b..324b695 100644 +--- a/drivers/media/video/em28xx/em28xx-video.c ++++ b/drivers/media/video/em28xx/em28xx-video.c +@@ -760,17 +760,19 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, + goto fail; + } + +- if (!dev->isoc_ctl.num_bufs) ++ if (!dev->isoc_ctl.analog_bufs.num_bufs) + urb_init = 1; + + if (urb_init) { + if (em28xx_vbi_supported(dev) == 1) +- rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, ++ rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE, ++ EM28XX_NUM_PACKETS, + EM28XX_NUM_BUFS, + dev->max_pkt_size, + em28xx_isoc_copy_vbi); + else +- rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, ++ rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE, ++ EM28XX_NUM_PACKETS, + EM28XX_NUM_BUFS, + dev->max_pkt_size, + em28xx_isoc_copy); +@@ -2267,7 +2269,7 @@ static int em28xx_v4l2_close(struct file *filp) + v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0); + + /* do this before setting alternate! */ +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, EM28XX_ANALOG_MODE); + em28xx_set_mode(dev, EM28XX_SUSPEND); + + /* set alternate 0 */ +diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h +index 22e252b..2ae6815 100644 +--- a/drivers/media/video/em28xx/em28xx.h ++++ b/drivers/media/video/em28xx/em28xx.h +@@ -151,12 +151,14 @@ + + /* number of buffers for isoc transfers */ + #define EM28XX_NUM_BUFS 5 ++#define EM28XX_DVB_NUM_BUFS 5 + + /* number of packets for each buffer + windows requests only 64 packets .. so we better do the same + this is what I found out for all alternate numbers there! + */ + #define EM28XX_NUM_PACKETS 64 ++#define EM28XX_DVB_MAX_PACKETS 64 + + #define EM28XX_INTERLACED_DEFAULT 1 + +@@ -197,10 +199,13 @@ enum em28xx_mode { + + struct em28xx; + +-struct em28xx_usb_isoc_ctl { ++struct em28xx_usb_isoc_bufs { + /* max packet size of isoc transaction */ + int max_pkt_size; + ++ /* number of packets in each buffer */ ++ int num_packets; ++ + /* number of allocated urbs */ + int num_bufs; + +@@ -209,6 +214,14 @@ struct em28xx_usb_isoc_ctl { + + /* transfer buffers for isoc transfer */ + char **transfer_buffer; ++}; ++ ++struct em28xx_usb_isoc_ctl { ++ /* isoc transfer buffers for analog mode */ ++ struct em28xx_usb_isoc_bufs analog_bufs; ++ ++ /* isoc transfer buffers for digital mode */ ++ struct em28xx_usb_isoc_bufs digital_bufs; + + /* Last buffer command and region */ + u8 cmd; +@@ -676,10 +689,12 @@ int em28xx_vbi_supported(struct em28xx *dev); + int em28xx_set_outfmt(struct em28xx *dev); + int em28xx_resolution_set(struct em28xx *dev); + int em28xx_set_alternate(struct em28xx *dev); +-int em28xx_init_isoc(struct em28xx *dev, int max_packets, +- int num_bufs, int max_pkt_size, ++int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size); ++int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size, + int (*isoc_copy) (struct em28xx *dev, struct urb *urb)); +-void em28xx_uninit_isoc(struct em28xx *dev); ++void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode); + int em28xx_isoc_dvb_max_packetsize(struct em28xx *dev); + int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode); + int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio); +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-isoc-transfer-buffers.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-isoc-transfer-buffers.patch new file mode 100644 index 0000000000..45f721ebb9 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/em28xx-pre-allocate-DVB-isoc-transfer-buffers.patch @@ -0,0 +1,454 @@ +em28xx: pre-allocate DVB isoc transfer buffers + +full description: +http://patchwork.linuxtv.org/patch/9875/ + +Signed-off-by: Gianluca Gennari +--- + drivers/media/video/em28xx/em28xx-cards.c | 16 +++- + drivers/media/video/em28xx/em28xx-core.c | 145 +++++++++++++++++++---------- + drivers/media/video/em28xx/em28xx-dvb.c | 14 +-- + drivers/media/video/em28xx/em28xx-video.c | 10 +- + drivers/media/video/em28xx/em28xx.h | 23 ++++- + 5 files changed, 142 insertions(+), 66 deletions(-) + +diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c +index 2aa772a..5c06bac 100644 +--- a/drivers/media/video/em28xx/em28xx-cards.c ++++ b/drivers/media/video/em28xx/em28xx-cards.c +@@ -3307,6 +3307,17 @@ static int em28xx_usb_probe(struct usb_interface *interface, + goto unlock_and_free; + } + ++ if (has_dvb) { ++ /* pre-allocate DVB isoc transfer buffers */ ++ retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE, ++ EM28XX_DVB_MAX_PACKETS, ++ EM28XX_DVB_NUM_BUFS, ++ dev->dvb_max_pkt_size); ++ if (retval) { ++ goto unlock_and_free; ++ } ++ } ++ + request_modules(dev); + + /* Should be the last thing to do, to avoid newer udev's to +@@ -3379,7 +3390,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) + video_device_node_name(dev->vdev)); + + dev->state |= DEV_MISCONFIGURED; +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, dev->mode); + dev->state |= DEV_DISCONNECTED; + wake_up_interruptible(&dev->wait_frame); + wake_up_interruptible(&dev->wait_stream); +@@ -3388,6 +3399,9 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) + em28xx_release_resources(dev); + } + ++ /* free DVB isoc buffers */ ++ em28xx_uninit_isoc(dev, EM28XX_DIGITAL_MODE); ++ + mutex_unlock(&dev->lock); + + em28xx_close_extension(dev); +diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c +index 0aacc96..53a9fb9 100644 +--- a/drivers/media/video/em28xx/em28xx-core.c ++++ b/drivers/media/video/em28xx/em28xx-core.c +@@ -666,6 +666,7 @@ int em28xx_capture_start(struct em28xx *dev, int start) + + return rc; + } ++EXPORT_SYMBOL_GPL(em28xx_capture_start); + + int em28xx_vbi_supported(struct em28xx *dev) + { +@@ -961,146 +962,192 @@ static void em28xx_irq_callback(struct urb *urb) + /* + * Stop and Deallocate URBs + */ +-void em28xx_uninit_isoc(struct em28xx *dev) ++void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode) + { + struct urb *urb; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; + int i; + +- em28xx_isocdbg("em28xx: called em28xx_uninit_isoc\n"); ++ em28xx_isocdbg("em28xx: called em28xx_uninit_isoc in mode %d\n", mode); ++ ++ if (mode == EM28XX_DIGITAL_MODE) ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ else ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; + + dev->isoc_ctl.nfields = -1; +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- urb = dev->isoc_ctl.urb[i]; ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ urb = isoc_bufs->urb[i]; + if (urb) { + if (!irqs_disabled()) + usb_kill_urb(urb); + else + usb_unlink_urb(urb); + +- if (dev->isoc_ctl.transfer_buffer[i]) { ++ if (isoc_bufs->transfer_buffer[i]) { + usb_free_coherent(dev->udev, + urb->transfer_buffer_length, +- dev->isoc_ctl.transfer_buffer[i], ++ isoc_bufs->transfer_buffer[i], + urb->transfer_dma); + } + usb_free_urb(urb); +- dev->isoc_ctl.urb[i] = NULL; ++ isoc_bufs->urb[i] = NULL; + } +- dev->isoc_ctl.transfer_buffer[i] = NULL; ++ isoc_bufs->transfer_buffer[i] = NULL; + } + +- kfree(dev->isoc_ctl.urb); +- kfree(dev->isoc_ctl.transfer_buffer); ++ kfree(isoc_bufs->urb); ++ kfree(isoc_bufs->transfer_buffer); + +- dev->isoc_ctl.urb = NULL; +- dev->isoc_ctl.transfer_buffer = NULL; +- dev->isoc_ctl.num_bufs = 0; ++ isoc_bufs->urb = NULL; ++ isoc_bufs->transfer_buffer = NULL; ++ isoc_bufs->num_bufs = 0; + + em28xx_capture_start(dev, 0); + } + EXPORT_SYMBOL_GPL(em28xx_uninit_isoc); + + /* +- * Allocate URBs and start IRQ ++ * Allocate URBs + */ +-int em28xx_init_isoc(struct em28xx *dev, int max_packets, +- int num_bufs, int max_pkt_size, +- int (*isoc_copy) (struct em28xx *dev, struct urb *urb)) ++int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size) + { +- struct em28xx_dmaqueue *dma_q = &dev->vidq; +- struct em28xx_dmaqueue *vbi_dma_q = &dev->vbiq; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; + int i; + int sb_size, pipe; + struct urb *urb; + int j, k; +- int rc; + +- em28xx_isocdbg("em28xx: called em28xx_prepare_isoc\n"); ++ em28xx_isocdbg("em28xx: called em28xx_alloc_isoc in mode %d\n", mode); ++ ++ if (mode == EM28XX_DIGITAL_MODE) ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ else ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; + + /* De-allocates all pending stuff */ +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + +- dev->isoc_ctl.isoc_copy = isoc_copy; +- dev->isoc_ctl.num_bufs = num_bufs; ++ isoc_bufs->num_bufs = num_bufs; + +- dev->isoc_ctl.urb = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); +- if (!dev->isoc_ctl.urb) { ++ isoc_bufs->urb = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); ++ if (!isoc_bufs->urb) { + em28xx_errdev("cannot alloc memory for usb buffers\n"); + return -ENOMEM; + } + +- dev->isoc_ctl.transfer_buffer = kzalloc(sizeof(void *)*num_bufs, +- GFP_KERNEL); +- if (!dev->isoc_ctl.transfer_buffer) { ++ isoc_bufs->transfer_buffer = kzalloc(sizeof(void *)*num_bufs, ++ GFP_KERNEL); ++ if (!isoc_bufs->transfer_buffer) { + em28xx_errdev("cannot allocate memory for usb transfer\n"); +- kfree(dev->isoc_ctl.urb); ++ kfree(isoc_bufs->urb); + return -ENOMEM; + } + +- dev->isoc_ctl.max_pkt_size = max_pkt_size; ++ isoc_bufs->max_pkt_size = max_pkt_size; ++ isoc_bufs->num_packets = max_packets; + dev->isoc_ctl.vid_buf = NULL; + dev->isoc_ctl.vbi_buf = NULL; + +- sb_size = max_packets * dev->isoc_ctl.max_pkt_size; ++ sb_size = isoc_bufs->num_packets * isoc_bufs->max_pkt_size; + + /* allocate urbs and transfer buffers */ +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- urb = usb_alloc_urb(max_packets, GFP_KERNEL); ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ urb = usb_alloc_urb(isoc_bufs->num_packets, GFP_KERNEL); + if (!urb) { + em28xx_err("cannot alloc isoc_ctl.urb %i\n", i); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return -ENOMEM; + } +- dev->isoc_ctl.urb[i] = urb; ++ isoc_bufs->urb[i] = urb; + +- dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev, ++ isoc_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, + sb_size, GFP_KERNEL, &urb->transfer_dma); +- if (!dev->isoc_ctl.transfer_buffer[i]) { ++ if (!isoc_bufs->transfer_buffer[i]) { + em28xx_err("unable to allocate %i bytes for transfer" + " buffer %i%s\n", + sb_size, i, + in_interrupt() ? " while in int" : ""); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return -ENOMEM; + } +- memset(dev->isoc_ctl.transfer_buffer[i], 0, sb_size); ++ memset(isoc_bufs->transfer_buffer[i], 0, sb_size); + + /* FIXME: this is a hack - should be + 'desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK' + should also be using 'desc.bInterval' + */ + pipe = usb_rcvisocpipe(dev->udev, +- dev->mode == EM28XX_ANALOG_MODE ? ++ mode == EM28XX_ANALOG_MODE ? + EM28XX_EP_ANALOG : EM28XX_EP_DIGITAL); + + usb_fill_int_urb(urb, dev->udev, pipe, +- dev->isoc_ctl.transfer_buffer[i], sb_size, ++ isoc_bufs->transfer_buffer[i], sb_size, + em28xx_irq_callback, dev, 1); + +- urb->number_of_packets = max_packets; ++ urb->number_of_packets = isoc_bufs->num_packets; + urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; + + k = 0; +- for (j = 0; j < max_packets; j++) { ++ for (j = 0; j < isoc_bufs->num_packets; j++) { + urb->iso_frame_desc[j].offset = k; + urb->iso_frame_desc[j].length = +- dev->isoc_ctl.max_pkt_size; +- k += dev->isoc_ctl.max_pkt_size; ++ isoc_bufs->max_pkt_size; ++ k += isoc_bufs->max_pkt_size; + } + } + ++ return 0; ++} ++EXPORT_SYMBOL_GPL(em28xx_alloc_isoc); ++ ++/* ++ * Allocate URBs and start IRQ ++ */ ++int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size, ++ int (*isoc_copy) (struct em28xx *dev, struct urb *urb)) ++{ ++ struct em28xx_dmaqueue *dma_q = &dev->vidq; ++ struct em28xx_dmaqueue *vbi_dma_q = &dev->vbiq; ++ struct em28xx_usb_isoc_bufs *isoc_bufs; ++ int i; ++ int rc; ++ int alloc; ++ ++ em28xx_isocdbg("em28xx: called em28xx_init_isoc in mode %d\n", mode); ++ ++ dev->isoc_ctl.isoc_copy = isoc_copy; ++ ++ if (mode == EM28XX_DIGITAL_MODE) { ++ isoc_bufs = &dev->isoc_ctl.digital_bufs; ++ /* no need to free/alloc isoc buffers in digital mode */ ++ alloc = 0; ++ } else { ++ isoc_bufs = &dev->isoc_ctl.analog_bufs; ++ alloc = 1; ++ } ++ ++ if (alloc) { ++ rc = em28xx_alloc_isoc(dev, mode, max_packets, ++ num_bufs, max_pkt_size); ++ if (rc) ++ return rc; ++ } ++ + init_waitqueue_head(&dma_q->wq); + init_waitqueue_head(&vbi_dma_q->wq); + + em28xx_capture_start(dev, 1); + + /* submit urbs and enables IRQ */ +- for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { +- rc = usb_submit_urb(dev->isoc_ctl.urb[i], GFP_ATOMIC); ++ for (i = 0; i < isoc_bufs->num_bufs; i++) { ++ rc = usb_submit_urb(isoc_bufs->urb[i], GFP_ATOMIC); + if (rc) { + em28xx_err("submit of urb %i failed (error=%i)\n", i, + rc); +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, mode); + return rc; + } + } +diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c +index aabbf48..fbd9010 100644 +--- a/drivers/media/video/em28xx/em28xx-dvb.c ++++ b/drivers/media/video/em28xx/em28xx-dvb.c +@@ -61,9 +61,6 @@ if (debug >= level) \ + printk(KERN_DEBUG "%s/2-dvb: " fmt, dev->name, ## arg); \ + } while (0) + +-#define EM28XX_DVB_NUM_BUFS 5 +-#define EM28XX_DVB_MAX_PACKETS 64 +- + struct em28xx_dvb { + struct dvb_frontend *fe[2]; + +@@ -172,20 +169,21 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb) + max_dvb_packet_size = dev->dvb_max_pkt_size; + if (max_dvb_packet_size < 0) + return max_dvb_packet_size; +- dprintk(1, "Using %d buffers each with %d bytes\n", ++ dprintk(1, "Using %d buffers each with %d x %d bytes\n", + EM28XX_DVB_NUM_BUFS, ++ EM28XX_DVB_MAX_PACKETS, + max_dvb_packet_size); + +- return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS, +- EM28XX_DVB_NUM_BUFS, max_dvb_packet_size, +- em28xx_dvb_isoc_copy); ++ return em28xx_init_isoc(dev, EM28XX_DIGITAL_MODE, ++ EM28XX_DVB_MAX_PACKETS, EM28XX_DVB_NUM_BUFS, ++ max_dvb_packet_size, em28xx_dvb_isoc_copy); + } + + static int em28xx_stop_streaming(struct em28xx_dvb *dvb) + { + struct em28xx *dev = dvb->adapter.priv; + +- em28xx_uninit_isoc(dev); ++ em28xx_capture_start(dev, 0); + + em28xx_set_mode(dev, EM28XX_SUSPEND); + +diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c +index 613300b..324b695 100644 +--- a/drivers/media/video/em28xx/em28xx-video.c ++++ b/drivers/media/video/em28xx/em28xx-video.c +@@ -760,17 +760,19 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, + goto fail; + } + +- if (!dev->isoc_ctl.num_bufs) ++ if (!dev->isoc_ctl.analog_bufs.num_bufs) + urb_init = 1; + + if (urb_init) { + if (em28xx_vbi_supported(dev) == 1) +- rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, ++ rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE, ++ EM28XX_NUM_PACKETS, + EM28XX_NUM_BUFS, + dev->max_pkt_size, + em28xx_isoc_copy_vbi); + else +- rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, ++ rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE, ++ EM28XX_NUM_PACKETS, + EM28XX_NUM_BUFS, + dev->max_pkt_size, + em28xx_isoc_copy); +@@ -2267,7 +2269,7 @@ static int em28xx_v4l2_close(struct file *filp) + v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0); + + /* do this before setting alternate! */ +- em28xx_uninit_isoc(dev); ++ em28xx_uninit_isoc(dev, EM28XX_ANALOG_MODE); + em28xx_set_mode(dev, EM28XX_SUSPEND); + + /* set alternate 0 */ +diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h +index 22e252b..2ae6815 100644 +--- a/drivers/media/video/em28xx/em28xx.h ++++ b/drivers/media/video/em28xx/em28xx.h +@@ -151,12 +151,14 @@ + + /* number of buffers for isoc transfers */ + #define EM28XX_NUM_BUFS 5 ++#define EM28XX_DVB_NUM_BUFS 5 + + /* number of packets for each buffer + windows requests only 64 packets .. so we better do the same + this is what I found out for all alternate numbers there! + */ + #define EM28XX_NUM_PACKETS 64 ++#define EM28XX_DVB_MAX_PACKETS 64 + + #define EM28XX_INTERLACED_DEFAULT 1 + +@@ -197,10 +199,13 @@ enum em28xx_mode { + + struct em28xx; + +-struct em28xx_usb_isoc_ctl { ++struct em28xx_usb_isoc_bufs { + /* max packet size of isoc transaction */ + int max_pkt_size; + ++ /* number of packets in each buffer */ ++ int num_packets; ++ + /* number of allocated urbs */ + int num_bufs; + +@@ -209,6 +214,14 @@ struct em28xx_usb_isoc_ctl { + + /* transfer buffers for isoc transfer */ + char **transfer_buffer; ++}; ++ ++struct em28xx_usb_isoc_ctl { ++ /* isoc transfer buffers for analog mode */ ++ struct em28xx_usb_isoc_bufs analog_bufs; ++ ++ /* isoc transfer buffers for digital mode */ ++ struct em28xx_usb_isoc_bufs digital_bufs; + + /* Last buffer command and region */ + u8 cmd; +@@ -676,10 +689,12 @@ int em28xx_vbi_supported(struct em28xx *dev); + int em28xx_set_outfmt(struct em28xx *dev); + int em28xx_resolution_set(struct em28xx *dev); + int em28xx_set_alternate(struct em28xx *dev); +-int em28xx_init_isoc(struct em28xx *dev, int max_packets, +- int num_bufs, int max_pkt_size, ++int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size); ++int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode, ++ int max_packets, int num_bufs, int max_pkt_size, + int (*isoc_copy) (struct em28xx *dev, struct urb *urb)); +-void em28xx_uninit_isoc(struct em28xx *dev); ++void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode); + int em28xx_isoc_dvb_max_packetsize(struct em28xx *dev); + int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode); + int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio); +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/et5x00/defconfig b/meta-openpli/recipes-linux/linux/linux-etxx00/et5x00/defconfig new file mode 100644 index 0000000000..10caaeb02d --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/et5x00/defconfig @@ -0,0 +1,2877 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.3.0 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_NLM_XLP_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +# CONFIG_BCM7405B0 is not set +CONFIG_BCM7405D0=y +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +CONFIG_BRCM_UPPER_MEMORY=y +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +# CONFIG_MTD_BRCMNAND_VERIFY_WRITE is not set +# CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING is not set +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTB=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTB_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NOR=y +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_3=y +CONFIG_BRCMNAND_MAJOR_VERS=3 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_UPPER_256MB=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_CLEANCACHE is not set +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +# CONFIG_NO_HZ is not set +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_RELAY=y +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_PCI_QUIRKS=y +CONFIG_COMPAT_BRK=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# Partition Types +# +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=y +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 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +# CONFIG_PM_RUNTIME is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +# CONFIG_UNIX_DIAG is not set +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +CONFIG_INET_TUNNEL=m +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_INET_UDP_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_IPV6_ROUTER_PREF=y +# CONFIG_IPV6_ROUTE_INFO is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_IPV6_MIP6=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPV6_MROUTE=y +# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set +CONFIG_IPV6_PIMSM_V2=y +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NF_CONNTRACK is not set +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +# CONFIG_NETFILTER_XT_MARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set + +# +# Xtables matches +# +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV4 is not set +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=m +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV6 is not set +# CONFIG_IP6_NF_QUEUE is not set +CONFIG_IP6_NF_IPTABLES=m +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_HL is not set +# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +# CONFIG_IP6_NF_MANGLE is not set +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +CONFIG_BQL=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +# CONFIG_BT_BNEP_MC_FILTER is not set +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=y + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=y +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +# CONFIG_BT_HCIUART_ATH3K is not set +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=y +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +CONFIG_CFG80211_DEFAULT_PS=y +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +CONFIG_LIB80211=y +CONFIG_LIB80211_CRYPT_WEP=m +CONFIG_LIB80211_CRYPT_CCMP=m +CONFIG_LIB80211_CRYPT_TKIP=m +# CONFIG_LIB80211_DEBUG is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +# CONFIG_MAC80211_RC_PID is not set +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +CONFIG_RFKILL_INPUT=y +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_GENERIC_CPU_DEVICES is not set +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +CONFIG_MTD_ROM=y +CONFIG_MTD_ABSENT=y + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_NAND_ECC=y +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_DENALI is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set + +# +# Misc devices +# +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=y +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_SCSI_BNX2X_FCOE is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_FCOE is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_PMCRAID is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_BFA_FC is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +# CONFIG_MD is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_CALXEDA_XGMAC is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_HSO=m +CONFIG_USB_IPHETH=m +CONFIG_WLAN=y +CONFIG_LIBERTAS_THINFIRM=m +# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set +CONFIG_LIBERTAS_THINFIRM_USB=m +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=y +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +# CONFIG_ATH9K_DFS_CERTIFIED is not set +CONFIG_ATH9K_RATE_CONTROL=y +CONFIG_ATH9K_BTCOEX_SUPPORT=y +CONFIG_ATH9K_HTC=m +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_CARL9170_HWRNG is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +CONFIG_BRCMUTIL=m +CONFIG_BRCMFMAC=m +# CONFIG_BRCMDBG is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set +# CONFIG_HOSTAP_PLX is not set +# CONFIG_HOSTAP_PCI is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +CONFIG_IWLWIFI=m + +# +# Debugging Options +# +# CONFIG_IWLWIFI_DEBUG is not set +# CONFIG_IWLWIFI_P2P is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +CONFIG_LIBERTAS=m +# CONFIG_LIBERTAS_USB is not set +# CONFIG_LIBERTAS_DEBUG is not set +# CONFIG_LIBERTAS_MESH is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +# CONFIG_P54_USB is not set +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8192CU is not set +CONFIG_WL1251=m +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_MWIFIEX=y +# CONFIG_MWIFIEX_PCIE is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +CONFIG_INPUT_POLLDEV=m +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +CONFIG_DEVKMEM=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +# CONFIG_RAMOOPS is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_S5M_CORE is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=y +CONFIG_LIRC=y +CONFIG_RC_MAP=y +CONFIG_IR_NEC_DECODER=y +CONFIG_IR_RC5_DECODER=y +CONFIG_IR_RC6_DECODER=y +CONFIG_IR_JVC_DECODER=y +CONFIG_IR_SONY_DECODER=y +CONFIG_IR_RC5_SZ_DECODER=y +CONFIG_IR_SANYO_DECODER=y +CONFIG_IR_MCE_KBD_DECODER=y +CONFIG_IR_LIRC_CODEC=y +# CONFIG_RC_ATI_REMOTE is not set +# CONFIG_IR_IMON is not set +# CONFIG_IR_MCEUSB is not set +# CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_STREAMZAP is not set +# CONFIG_RC_LOOPBACK is not set +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +CONFIG_MEDIA_TUNER_CUSTOMISE=y + +# +# Customize TV tuners +# +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2063=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_MT2131=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_IR_I2C=m + +# +# Encoders, decoders, sensors and other helper chips +# + +# +# Audio decoders, processors and mixers +# +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_VP27SMPX is not set + +# +# RDS decoders +# +# CONFIG_VIDEO_SAA6588 is not set + +# +# Video decoders +# +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_SAA7191 is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_VPX3220 is not set + +# +# Video and audio decoders +# +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_CX25840 is not set + +# +# MPEG video encoders +# +# CONFIG_VIDEO_CX2341X is not set + +# +# Video encoders +# +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_AK881X is not set + +# +# Camera sensor devices +# +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_TCM825X is not set +# CONFIG_VIDEO_SR030PC30 is not set + +# +# Flash devices +# + +# +# Video improvement chips +# +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_VIVI is not set +CONFIG_V4L_USB_DRIVERS=y +# CONFIG_USB_VIDEO_CLASS is not set +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_JL2005BCD is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_HDPVR is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +CONFIG_VIDEO_EM28XX_RC=y +# CONFIG_VIDEO_TLG2300 is not set +# CONFIG_VIDEO_CX231XX is not set +# CONFIG_VIDEO_TM6000 is not set +# CONFIG_VIDEO_USBVISION is not set +# CONFIG_USB_ET61X251 is not set +# CONFIG_USB_SN9C102 is not set +# CONFIG_USB_PWC is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_S2255 is not set +# CONFIG_V4L_PCI_DRIVERS is not set +# CONFIG_V4L_PLATFORM_DRIVERS is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_SI470X is not set +# CONFIG_USB_MR800 is not set +# CONFIG_USB_DSBR is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_I2C_SI4713 is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_RADIO_TEA5764 is not set +# CONFIG_RADIO_SAA7706H is not set +# CONFIG_RADIO_TEF6862 is not set +# CONFIG_RADIO_WL1273 is not set + +# +# Texas Instruments WL128x FM driver (ST based) +# +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=y +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +# CONFIG_DVB_TTUSB_BUDGET is not set +# CONFIG_DVB_TTUSB_DEC is not set +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +# CONFIG_DVB_B2C2_FLEXCOP is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_HD29L2=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +# CONFIG_DVB_DUMMY_FE is not set + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +CONFIG_FB_BCM=y +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +CONFIG_FONT_10x18=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_SEQUENCER=y +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +# CONFIG_SND_PCM_OSS_PLUGINS is not set +# CONFIG_SND_SEQUENCER_OSS is not set +# CONFIG_SND_HRTIMER is not set +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +# CONFIG_SND_USB is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +CONFIG_HID_LOGITECH=y +CONFIG_HID_LOGITECH_DJ=y +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGIG940_FF is not set +# CONFIG_LOGIWHEELS_FF is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +CONFIG_HID_WACOM=m +# CONFIG_HID_WACOM_POWER_SUPPLY is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DEVICE_CLASS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_UAS is not set +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRCABLE is not set +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +CONFIG_USB_SERIAL_FTDI_SIO=m +# CONFIG_USB_SERIAL_FUNSOFT is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=m +# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MOTOROLA is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_OTI6858 is not set +# CONFIG_USB_SERIAL_QCAUX is not set +# CONFIG_USB_SERIAL_QUALCOMM is not set +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_SAFE is not set +# CONFIG_USB_SERIAL_SIEMENS_MPI is not set +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set +# CONFIG_USB_SERIAL_ZIO is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_DEBUG is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_OT200 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set + +# +# Microsoft Hyper-V guest support +# +CONFIG_STAGING=y +# CONFIG_ET131X is not set +# CONFIG_USBIP_CORE is not set +CONFIG_W35UND=m +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +CONFIG_R8187SE=m +CONFIG_RTL8192U=m +CONFIG_RTLLIB=m +CONFIG_RTLLIB_CRYPTO_CCMP=m +CONFIG_RTLLIB_CRYPTO_TKIP=m +CONFIG_RTLLIB_CRYPTO_WEP=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_R8712_AP is not set +# CONFIG_RTS_PSTOR is not set +# CONFIG_RTS5139 is not set +# CONFIG_TRANZPORT is not set +# CONFIG_IDE_PHISON is not set +# CONFIG_LINE6_USB is not set +# CONFIG_USB_SERIAL_QUATECH2 is not set +# CONFIG_USB_SERIAL_QUATECH_USB2 is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +# CONFIG_USB_ENESTORAGE is not set +# CONFIG_BCM_WIMAX is not set +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +# CONFIG_DVB_CXD2099 is not set +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Android +# +# CONFIG_ANDROID is not set + +# +# Hardware Spinlock drivers +# +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT23=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_FS_POSIX_ACL is not set +CONFIG_EXPORTFS=m +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=y +CONFIG_FUSE_FS=y +# CONFIG_CUSE is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=y +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=y +CONFIG_HFSPLUS_FS=y +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +# CONFIG_LOGFS is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_CEPH_FS is not set +CONFIG_CIFS=y +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-15" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_PRINTK_TIME is not set +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=0 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_EARLY_PRINTK is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="bmem=130M ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw console=null" +CONFIG_CMDLINE_OVERRIDE=y +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=m +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +CONFIG_CRYPTO_MD4=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +# CONFIG_CRYPTO_ZLIB is not set +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +CONFIG_CRC_ITU_T=y +CONFIG_CRC32=y +CONFIG_CRC7=m +# CONFIG_LIBCRC32C is not set +# CONFIG_CRC8 is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_XZ_DEC is not set +# CONFIG_XZ_DEC_BCJ is not set +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/et6x00/defconfig b/meta-openpli/recipes-linux/linux/linux-etxx00/et6x00/defconfig new file mode 100644 index 0000000000..22d570c1f8 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/et6x00/defconfig @@ -0,0 +1,2877 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.3.0 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_NLM_XLP_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +# CONFIG_BCM7405B0 is not set +CONFIG_BCM7405D0=y +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +CONFIG_BRCM_UPPER_MEMORY=y +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +# CONFIG_MTD_BRCMNAND_VERIFY_WRITE is not set +# CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING is not set +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTB=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTB_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NOR=y +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_3=y +CONFIG_BRCMNAND_MAJOR_VERS=3 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_UPPER_256MB=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_CLEANCACHE is not set +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +# CONFIG_NO_HZ is not set +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_RELAY=y +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_PCI_QUIRKS=y +CONFIG_COMPAT_BRK=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# Partition Types +# +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=y +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 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +# CONFIG_PM_RUNTIME is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +# CONFIG_UNIX_DIAG is not set +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +CONFIG_INET_TUNNEL=m +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_INET_UDP_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_IPV6_ROUTER_PREF=y +# CONFIG_IPV6_ROUTE_INFO is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_IPV6_MIP6=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPV6_MROUTE=y +# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set +CONFIG_IPV6_PIMSM_V2=y +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NF_CONNTRACK is not set +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +# CONFIG_NETFILTER_XT_MARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set + +# +# Xtables matches +# +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV4 is not set +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=m +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV6 is not set +# CONFIG_IP6_NF_QUEUE is not set +CONFIG_IP6_NF_IPTABLES=m +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_HL is not set +# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +# CONFIG_IP6_NF_MANGLE is not set +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +CONFIG_BQL=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +# CONFIG_BT_BNEP_MC_FILTER is not set +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=y + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=y +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +# CONFIG_BT_HCIUART_ATH3K is not set +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=y +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +CONFIG_CFG80211_DEFAULT_PS=y +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +CONFIG_LIB80211=y +CONFIG_LIB80211_CRYPT_WEP=m +CONFIG_LIB80211_CRYPT_CCMP=m +CONFIG_LIB80211_CRYPT_TKIP=m +# CONFIG_LIB80211_DEBUG is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +# CONFIG_MAC80211_RC_PID is not set +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +CONFIG_RFKILL_INPUT=y +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_GENERIC_CPU_DEVICES is not set +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +CONFIG_MTD_ROM=y +CONFIG_MTD_ABSENT=y + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_NAND_ECC=y +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_DENALI is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set + +# +# Misc devices +# +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=y +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_SCSI_BNX2X_FCOE is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_FCOE is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_PMCRAID is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_BFA_FC is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +# CONFIG_MD is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_CALXEDA_XGMAC is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_HSO=m +CONFIG_USB_IPHETH=m +CONFIG_WLAN=y +CONFIG_LIBERTAS_THINFIRM=m +# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set +CONFIG_LIBERTAS_THINFIRM_USB=m +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=y +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +# CONFIG_ATH9K_DFS_CERTIFIED is not set +CONFIG_ATH9K_RATE_CONTROL=y +CONFIG_ATH9K_BTCOEX_SUPPORT=y +CONFIG_ATH9K_HTC=m +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_CARL9170_HWRNG is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +CONFIG_BRCMUTIL=m +CONFIG_BRCMFMAC=m +# CONFIG_BRCMDBG is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set +# CONFIG_HOSTAP_PLX is not set +# CONFIG_HOSTAP_PCI is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +CONFIG_IWLWIFI=m + +# +# Debugging Options +# +# CONFIG_IWLWIFI_DEBUG is not set +# CONFIG_IWLWIFI_P2P is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +CONFIG_LIBERTAS=m +# CONFIG_LIBERTAS_USB is not set +# CONFIG_LIBERTAS_DEBUG is not set +# CONFIG_LIBERTAS_MESH is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +# CONFIG_P54_USB is not set +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8192CU is not set +CONFIG_WL1251=m +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_MWIFIEX=y +# CONFIG_MWIFIEX_PCIE is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +CONFIG_INPUT_POLLDEV=m +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +CONFIG_DEVKMEM=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +# CONFIG_RAMOOPS is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_S5M_CORE is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=y +CONFIG_LIRC=y +CONFIG_RC_MAP=y +CONFIG_IR_NEC_DECODER=y +CONFIG_IR_RC5_DECODER=y +CONFIG_IR_RC6_DECODER=y +CONFIG_IR_JVC_DECODER=y +CONFIG_IR_SONY_DECODER=y +CONFIG_IR_RC5_SZ_DECODER=y +CONFIG_IR_SANYO_DECODER=y +CONFIG_IR_MCE_KBD_DECODER=y +CONFIG_IR_LIRC_CODEC=y +# CONFIG_RC_ATI_REMOTE is not set +# CONFIG_IR_IMON is not set +# CONFIG_IR_MCEUSB is not set +# CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_STREAMZAP is not set +# CONFIG_RC_LOOPBACK is not set +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +CONFIG_MEDIA_TUNER_CUSTOMISE=y + +# +# Customize TV tuners +# +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2063=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_MT2131=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_IR_I2C=m + +# +# Encoders, decoders, sensors and other helper chips +# + +# +# Audio decoders, processors and mixers +# +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_VP27SMPX is not set + +# +# RDS decoders +# +# CONFIG_VIDEO_SAA6588 is not set + +# +# Video decoders +# +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_SAA7191 is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_VPX3220 is not set + +# +# Video and audio decoders +# +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_CX25840 is not set + +# +# MPEG video encoders +# +# CONFIG_VIDEO_CX2341X is not set + +# +# Video encoders +# +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_AK881X is not set + +# +# Camera sensor devices +# +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_TCM825X is not set +# CONFIG_VIDEO_SR030PC30 is not set + +# +# Flash devices +# + +# +# Video improvement chips +# +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_VIVI is not set +CONFIG_V4L_USB_DRIVERS=y +# CONFIG_USB_VIDEO_CLASS is not set +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_JL2005BCD is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_HDPVR is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +CONFIG_VIDEO_EM28XX_RC=y +# CONFIG_VIDEO_TLG2300 is not set +# CONFIG_VIDEO_CX231XX is not set +# CONFIG_VIDEO_TM6000 is not set +# CONFIG_VIDEO_USBVISION is not set +# CONFIG_USB_ET61X251 is not set +# CONFIG_USB_SN9C102 is not set +# CONFIG_USB_PWC is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_S2255 is not set +# CONFIG_V4L_PCI_DRIVERS is not set +# CONFIG_V4L_PLATFORM_DRIVERS is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_SI470X is not set +# CONFIG_USB_MR800 is not set +# CONFIG_USB_DSBR is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_I2C_SI4713 is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_RADIO_TEA5764 is not set +# CONFIG_RADIO_SAA7706H is not set +# CONFIG_RADIO_TEF6862 is not set +# CONFIG_RADIO_WL1273 is not set + +# +# Texas Instruments WL128x FM driver (ST based) +# +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=y +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +# CONFIG_DVB_TTUSB_BUDGET is not set +# CONFIG_DVB_TTUSB_DEC is not set +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +# CONFIG_DVB_B2C2_FLEXCOP is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_HD29L2=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +# CONFIG_DVB_DUMMY_FE is not set + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +CONFIG_FB_BCM=y +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +CONFIG_FONT_10x18=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_SEQUENCER=y +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +# CONFIG_SND_PCM_OSS_PLUGINS is not set +# CONFIG_SND_SEQUENCER_OSS is not set +# CONFIG_SND_HRTIMER is not set +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +# CONFIG_SND_USB is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +CONFIG_HID_LOGITECH=y +CONFIG_HID_LOGITECH_DJ=y +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGIG940_FF is not set +# CONFIG_LOGIWHEELS_FF is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +CONFIG_HID_WACOM=m +# CONFIG_HID_WACOM_POWER_SUPPLY is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DEVICE_CLASS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_UAS is not set +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRCABLE is not set +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +CONFIG_USB_SERIAL_FTDI_SIO=m +# CONFIG_USB_SERIAL_FUNSOFT is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=m +# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MOTOROLA is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_OTI6858 is not set +# CONFIG_USB_SERIAL_QCAUX is not set +# CONFIG_USB_SERIAL_QUALCOMM is not set +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_SAFE is not set +# CONFIG_USB_SERIAL_SIEMENS_MPI is not set +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set +# CONFIG_USB_SERIAL_ZIO is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_DEBUG is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_OT200 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set + +# +# Microsoft Hyper-V guest support +# +CONFIG_STAGING=y +# CONFIG_ET131X is not set +# CONFIG_USBIP_CORE is not set +CONFIG_W35UND=m +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +CONFIG_R8187SE=m +CONFIG_RTL8192U=m +CONFIG_RTLLIB=m +CONFIG_RTLLIB_CRYPTO_CCMP=m +CONFIG_RTLLIB_CRYPTO_TKIP=m +CONFIG_RTLLIB_CRYPTO_WEP=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_R8712_AP is not set +# CONFIG_RTS_PSTOR is not set +# CONFIG_RTS5139 is not set +# CONFIG_TRANZPORT is not set +# CONFIG_IDE_PHISON is not set +# CONFIG_LINE6_USB is not set +# CONFIG_USB_SERIAL_QUATECH2 is not set +# CONFIG_USB_SERIAL_QUATECH_USB2 is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +# CONFIG_USB_ENESTORAGE is not set +# CONFIG_BCM_WIMAX is not set +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +# CONFIG_DVB_CXD2099 is not set +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Android +# +# CONFIG_ANDROID is not set + +# +# Hardware Spinlock drivers +# +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT23=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_FS_POSIX_ACL is not set +CONFIG_EXPORTFS=m +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=y +CONFIG_FUSE_FS=y +# CONFIG_CUSE is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=y +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=y +CONFIG_HFSPLUS_FS=y +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +# CONFIG_LOGFS is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_CEPH_FS is not set +CONFIG_CIFS=y +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-15" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_PRINTK_TIME is not set +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=0 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_EARLY_PRINTK is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="bmem=216M ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw console=null" +CONFIG_CMDLINE_OVERRIDE=y +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=m +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +CONFIG_CRYPTO_MD4=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +# CONFIG_CRYPTO_ZLIB is not set +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +CONFIG_CRC_ITU_T=y +CONFIG_CRC32=y +CONFIG_CRC7=m +# CONFIG_LIBCRC32C is not set +# CONFIG_CRC8 is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_XZ_DEC is not set +# CONFIG_XZ_DEC_BCJ is not set +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/et9x00/defconfig b/meta-openpli/recipes-linux/linux/linux-etxx00/et9x00/defconfig new file mode 100644 index 0000000000..22d570c1f8 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/et9x00/defconfig @@ -0,0 +1,2877 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/mips 3.3.0 Kernel Configuration +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_ATH79 is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +CONFIG_BRCMSTB=y +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LANTIQ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_NLM_XLP_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set + +# +# Broadcom STB options +# +# CONFIG_BRCM_LEGACY is not set +# CONFIG_BCM3548B0 is not set +# CONFIG_BCM35125A0 is not set +# CONFIG_BCM35230C0 is not set +# CONFIG_BCM35330A0 is not set +# CONFIG_BCM7125C0 is not set +# CONFIG_BCM7135A0 is not set +# CONFIG_BCM7231A0 is not set +# CONFIG_BCM7325B0 is not set +# CONFIG_BCM7335B0 is not set +# CONFIG_BCM7340B0 is not set +# CONFIG_BCM7342B0 is not set +# CONFIG_BCM7344A0 is not set +# CONFIG_BCM7346A0 is not set +# CONFIG_BCM7358A0 is not set +# CONFIG_BCM7405B0 is not set +CONFIG_BCM7405D0=y +# CONFIG_BCM7408B0 is not set +# CONFIG_BCM7420C0 is not set +# CONFIG_BCM7422A0 is not set +# CONFIG_BCM7425A0 is not set +# CONFIG_BCM7468B0 is not set +# CONFIG_BCM7550A0 is not set +# CONFIG_BCM7550B0 is not set +# CONFIG_BCM7552A0 is not set +# CONFIG_BCM7601B0 is not set +# CONFIG_BCM7630B0 is not set +# CONFIG_BCM7631B0 is not set +# CONFIG_BCM7635A0 is not set +# CONFIG_BCM7640A0 is not set + +# +# Memory map +# +CONFIG_BRCM_UPPER_MEMORY=y +# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set + +# +# Onchip peripherals +# +CONFIG_BRCM_CONSOLE_DEVICE=0 +CONFIG_BRCM_FLASH=y +CONFIG_BRCM_FIXED_MTD_PARTITIONS=y +CONFIG_MTD_BRCMNAND=y +CONFIG_BRCMNAND_MTD_EXTENSION=y +# CONFIG_MTD_BRCMNAND_VERIFY_WRITE is not set +# CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING is not set +CONFIG_BCMEMAC=y +CONFIG_SATA_BRCMSTB=y +CONFIG_BRCM_USB=y +# CONFIG_BRCM_OVERRIDE_USB is not set +CONFIG_BRCM_PM=y +CONFIG_CSRC_UPG=y + +# +# Miscellaneous options +# +# CONFIG_BRCM_FORCE_DOCSIS is not set +CONFIG_BRCM_LIBGCC=y +# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set +# CONFIG_BRCM_DEBUG_OPTIONS is not set +CONFIG_BMIPS4380=y +CONFIG_BRCM_HAS_16550=y +CONFIG_BRCM_HAS_UARTA=y +CONFIG_BRCM_HAS_UARTB=y +CONFIG_BRCM_HAS_UARTC=y +CONFIG_BRCM_UARTA_IS_16550=y +CONFIG_BRCM_UARTB_IS_16550=y +CONFIG_BRCM_UARTC_IS_16550=y +CONFIG_BRCM_HAS_PCI23=y +CONFIG_BRCM_HAS_EMAC_0=y +CONFIG_BRCM_HAS_EMAC_1=y +CONFIG_BRCM_HAS_SATA=y +CONFIG_BRCM_HAS_SATA2=y +# CONFIG_BRCM_SATA_75MHZ_PLL is not set +# CONFIG_BRCM_SATA_SINGLE_PORT is not set +CONFIG_BRCM_HAS_NOR=y +CONFIG_BRCM_HAS_NAND_MINOR_2=y +CONFIG_BRCM_HAS_NAND_MAJOR_3=y +CONFIG_BRCMNAND_MAJOR_VERS=3 +CONFIG_BRCMNAND_MINOR_VERS=2 +CONFIG_BRCM_HAS_NAND=y +CONFIG_BRCM_CPU_DIV=y +CONFIG_BRCM_HAS_UPPER_MEMORY=y +CONFIG_BRCM_UPPER_256MB=y +CONFIG_BRCM_HAS_1GB_MEMC0=y +CONFIG_BRCM_PLATFORM_DEFAULTS=y +CONFIG_BCM7405=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_BOOT_RAW=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CFE=y +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +CONFIG_DMA_NONCOHERENT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_HOTPLUG_CPU is not set +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_WEAK_ORDERING=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_CLEANCACHE is not set +CONFIG_SMP=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_TICK_ONESHOT=y +# CONFIG_NO_HZ is not set +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +CONFIG_HZ_1000=y +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=1000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +# CONFIG_USE_OF is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_HAVE_IRQ_WORK=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_FHANDLE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_IRQ_FORCED_THREADING=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_RELAY=y +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EXPERT=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_COUNTERS is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_PCI_QUIRKS=y +CONFIG_COMPAT_BRK=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_STOP_MACHINE=y +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# Partition Types +# +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=y +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 + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +CONFIG_HW_HAS_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_RAPIDIO is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_SUSPEND is not set +# CONFIG_HIBERNATION is not set +# CONFIG_PM_RUNTIME is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_UNIX=y +# CONFIG_UNIX_DIAG is not set +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_XFRM_IPCOMP=m +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +CONFIG_INET_TUNNEL=m +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_INET_UDP_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_IPV6_ROUTER_PREF=y +# CONFIG_IPV6_ROUTE_INFO is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_IPV6_MIP6=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m +CONFIG_IPV6_SIT=m +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPV6_MROUTE=y +# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set +CONFIG_IPV6_PIMSM_V2=y +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NF_CONNTRACK is not set +CONFIG_NETFILTER_XTABLES=m + +# +# Xtables combined modules +# +# CONFIG_NETFILTER_XT_MARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set + +# +# Xtables matches +# +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV4 is not set +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=m +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_DEFRAG_IPV6 is not set +# CONFIG_IP6_NF_QUEUE is not set +CONFIG_IP6_NF_IPTABLES=m +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_HL is not set +# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_REJECT=m +# CONFIG_IP6_NF_MANGLE is not set +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +CONFIG_BQL=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +CONFIG_BT=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +# CONFIG_BT_BNEP_MC_FILTER is not set +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=y + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIBTUSB=y +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +# CONFIG_BT_HCIUART_ATH3K is not set +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +# CONFIG_BT_MRVL is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=y +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_REG_DEBUG is not set +CONFIG_CFG80211_DEFAULT_PS=y +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CFG80211_WEXT=y +CONFIG_WIRELESS_EXT_SYSFS=y +CONFIG_LIB80211=y +CONFIG_LIB80211_CRYPT_WEP=m +CONFIG_LIB80211_CRYPT_CCMP=m +CONFIG_LIB80211_CRYPT_TKIP=m +# CONFIG_LIB80211_DEBUG is not set +CONFIG_MAC80211=m +CONFIG_MAC80211_HAS_RC=y +# CONFIG_MAC80211_RC_PID is not set +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_MINSTREL_HT=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUG_MENU is not set +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +CONFIG_RFKILL_INPUT=y +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_GENERIC_CPU_DEVICES is not set +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +CONFIG_MTD_ROM=y +CONFIG_MTD_ABSENT=y + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_NAND_ECC=y +# CONFIG_MTD_NAND_ECC_SMC is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +# CONFIG_MTD_NAND_DENALI is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_DEBUG is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_XIP is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set + +# +# Misc devices +# +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_AD525X_DPOT is not set +# CONFIG_PHANTOM is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +CONFIG_EEPROM_93CX6=y +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_SENSORS_LIS3_I2C is not set + +# +# Altera FPGA firmware download module +# +# CONFIG_ALTERA_STAPL is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_SCSI_BNX2X_FCOE is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_FCOE is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_PMCRAID is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_BFA_FC is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +CONFIG_ATA=y +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +# CONFIG_ATA_PIIX is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +# CONFIG_MD is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_I2O is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +CONFIG_MII=y +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set + +# +# CAIF transport drivers +# +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2X is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_CALXEDA_XGMAC is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_IP1000 is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_SFC is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_TOSHIBA is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PHYLIB is not set +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_TR is not set + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_HSO=m +CONFIG_USB_IPHETH=m +CONFIG_WLAN=y +CONFIG_LIBERTAS_THINFIRM=m +# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set +CONFIG_LIBERTAS_THINFIRM_USB=m +# CONFIG_ATMEL is not set +CONFIG_AT76C50X_USB=m +# CONFIG_PRISM54 is not set +CONFIG_USB_ZD1201=y +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_RTL8180 is not set +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +# CONFIG_ADM8211 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K=m +# CONFIG_ATH9K_PCI is not set +# CONFIG_ATH9K_AHB is not set +# CONFIG_ATH9K_DFS_CERTIFIED is not set +CONFIG_ATH9K_RATE_CONTROL=y +CONFIG_ATH9K_BTCOEX_SUPPORT=y +CONFIG_ATH9K_HTC=m +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y +CONFIG_CARL9170_WPC=y +# CONFIG_CARL9170_HWRNG is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +CONFIG_BRCMUTIL=m +CONFIG_BRCMFMAC=m +# CONFIG_BRCMDBG is not set +CONFIG_HOSTAP=m +CONFIG_HOSTAP_FIRMWARE=y +# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set +# CONFIG_HOSTAP_PLX is not set +# CONFIG_HOSTAP_PCI is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +CONFIG_IWLWIFI=m + +# +# Debugging Options +# +# CONFIG_IWLWIFI_DEBUG is not set +# CONFIG_IWLWIFI_P2P is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +CONFIG_LIBERTAS=m +# CONFIG_LIBERTAS_USB is not set +# CONFIG_LIBERTAS_DEBUG is not set +# CONFIG_LIBERTAS_MESH is not set +# CONFIG_HERMES is not set +CONFIG_P54_COMMON=m +# CONFIG_P54_USB is not set +# CONFIG_P54_PCI is not set +CONFIG_P54_LEDS=y +CONFIG_RT2X00=m +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2800PCI is not set +CONFIG_RT2500USB=m +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT33XX=y +CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_UNKNOWN=y +CONFIG_RT2800_LIB=m +CONFIG_RT2X00_LIB_USB=m +CONFIG_RT2X00_LIB=m +CONFIG_RT2X00_LIB_FIRMWARE=y +CONFIG_RT2X00_LIB_CRYPTO=y +CONFIG_RT2X00_LIB_LEDS=y +# CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8192CU is not set +CONFIG_WL1251=m +# CONFIG_WL12XX_MENU is not set +CONFIG_ZD1211RW=m +# CONFIG_ZD1211RW_DEBUG is not set +CONFIG_MWIFIEX=y +# CONFIG_MWIFIEX_PCIE is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +CONFIG_INPUT_POLLDEV=m +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +CONFIG_DEVKMEM=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_MFD_HSU is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +# CONFIG_RAMOOPS is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_INTEL_MID is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I2C_EG20T is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable Device Drivers -> PPS to see the PTP clock options. +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y + +# +# Broadcom specific AMBA +# +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_S5M_CORE is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_REGULATOR is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +# CONFIG_MEDIA_CONTROLLER is not set +CONFIG_VIDEO_DEV=m +CONFIG_VIDEO_V4L2_COMMON=m +CONFIG_DVB_CORE=y +CONFIG_DVB_NET=y +CONFIG_VIDEO_MEDIA=m + +# +# Multimedia drivers +# +CONFIG_RC_CORE=y +CONFIG_LIRC=y +CONFIG_RC_MAP=y +CONFIG_IR_NEC_DECODER=y +CONFIG_IR_RC5_DECODER=y +CONFIG_IR_RC6_DECODER=y +CONFIG_IR_JVC_DECODER=y +CONFIG_IR_SONY_DECODER=y +CONFIG_IR_RC5_SZ_DECODER=y +CONFIG_IR_SANYO_DECODER=y +CONFIG_IR_MCE_KBD_DECODER=y +CONFIG_IR_LIRC_CODEC=y +# CONFIG_RC_ATI_REMOTE is not set +# CONFIG_IR_IMON is not set +# CONFIG_IR_MCEUSB is not set +# CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_STREAMZAP is not set +# CONFIG_RC_LOOPBACK is not set +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=m +CONFIG_MEDIA_TUNER_CUSTOMISE=y + +# +# Customize TV tuners +# +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2063=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_MT2131=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_VMALLOC=m +CONFIG_VIDEOBUF_DVB=m +CONFIG_VIDEO_TVEEPROM=m +CONFIG_VIDEO_TUNER=m +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set +CONFIG_VIDEO_IR_I2C=m + +# +# Encoders, decoders, sensors and other helper chips +# + +# +# Audio decoders, processors and mixers +# +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_VP27SMPX is not set + +# +# RDS decoders +# +# CONFIG_VIDEO_SAA6588 is not set + +# +# Video decoders +# +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_SAA7191 is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_VPX3220 is not set + +# +# Video and audio decoders +# +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_CX25840 is not set + +# +# MPEG video encoders +# +# CONFIG_VIDEO_CX2341X is not set + +# +# Video encoders +# +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_AK881X is not set + +# +# Camera sensor devices +# +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_TCM825X is not set +# CONFIG_VIDEO_SR030PC30 is not set + +# +# Flash devices +# + +# +# Video improvement chips +# +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set + +# +# Miscelaneous helper chips +# +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_VIVI is not set +CONFIG_V4L_USB_DRIVERS=y +# CONFIG_USB_VIDEO_CLASS is not set +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +CONFIG_USB_GSPCA=m +# CONFIG_USB_M5602 is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_JL2005BCD is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_HDPVR is not set +CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_ALSA=m +CONFIG_VIDEO_EM28XX_DVB=m +CONFIG_VIDEO_EM28XX_RC=y +# CONFIG_VIDEO_TLG2300 is not set +# CONFIG_VIDEO_CX231XX is not set +# CONFIG_VIDEO_TM6000 is not set +# CONFIG_VIDEO_USBVISION is not set +# CONFIG_USB_ET61X251 is not set +# CONFIG_USB_SN9C102 is not set +# CONFIG_USB_PWC is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_S2255 is not set +# CONFIG_V4L_PCI_DRIVERS is not set +# CONFIG_V4L_PLATFORM_DRIVERS is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_SI470X is not set +# CONFIG_USB_MR800 is not set +# CONFIG_USB_DSBR is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_I2C_SI4713 is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_RADIO_TEA5764 is not set +# CONFIG_RADIO_SAA7706H is not set +# CONFIG_RADIO_TEF6862 is not set +# CONFIG_RADIO_WL1273 is not set + +# +# Texas Instruments WL128x FM driver (ST based) +# +CONFIG_DVB_MAX_ADAPTERS=8 +CONFIG_DVB_DYNAMIC_MINORS=y +CONFIG_DVB_CAPTURE_DRIVERS=y + +# +# Supported SAA7146 based PCI Adapters +# +CONFIG_TTPCI_EEPROM=m +# CONFIG_DVB_AV7110 is not set +# CONFIG_DVB_BUDGET_CORE is not set + +# +# Supported USB Adapters +# +CONFIG_DVB_USB=y +# CONFIG_DVB_USB_DEBUG is not set +CONFIG_DVB_USB_A800=m +CONFIG_DVB_USB_DIBUSB_MB=m +CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y +CONFIG_DVB_USB_DIBUSB_MC=m +CONFIG_DVB_USB_DIB0700=m +CONFIG_DVB_USB_UMT_010=m +CONFIG_DVB_USB_CXUSB=m +CONFIG_DVB_USB_M920X=m +CONFIG_DVB_USB_GL861=m +CONFIG_DVB_USB_AU6610=m +CONFIG_DVB_USB_DIGITV=m +CONFIG_DVB_USB_VP7045=m +CONFIG_DVB_USB_VP702X=m +CONFIG_DVB_USB_GP8PSK=m +CONFIG_DVB_USB_NOVA_T_USB2=m +CONFIG_DVB_USB_TTUSB2=m +CONFIG_DVB_USB_DTT200U=m +CONFIG_DVB_USB_OPERA1=m +CONFIG_DVB_USB_AF9005=m +CONFIG_DVB_USB_AF9005_REMOTE=m +CONFIG_DVB_USB_PCTV452E=m +CONFIG_DVB_USB_DW2102=m +CONFIG_DVB_USB_CINERGY_T2=m +CONFIG_DVB_USB_ANYSEE=m +CONFIG_DVB_USB_DTV5100=m +CONFIG_DVB_USB_AF9015=m +CONFIG_DVB_USB_CE6230=m +CONFIG_DVB_USB_FRIIO=m +CONFIG_DVB_USB_EC168=m +CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_USB_IT913X=m +CONFIG_DVB_USB_MXL111SF=m +# CONFIG_DVB_TTUSB_BUDGET is not set +# CONFIG_DVB_TTUSB_DEC is not set +CONFIG_SMS_SIANO_MDTV=m + +# +# Siano module components +# +CONFIG_SMS_USB_DRV=m + +# +# Supported FlexCopII (B2C2) Adapters +# +# CONFIG_DVB_B2C2_FLEXCOP is not set + +# +# Supported BT878 Adapters +# + +# +# Supported Pluto2 Adapters +# +# CONFIG_DVB_PLUTO2 is not set + +# +# Supported SDMC DM1105 Adapters +# +# CONFIG_DVB_DM1105 is not set + +# +# Supported Earthsoft PT1 Adapters +# +# CONFIG_DVB_PT1 is not set + +# +# Supported Mantis Adapters +# +# CONFIG_MANTIS_CORE is not set + +# +# Supported nGene Adapters +# +# CONFIG_DVB_NGENE is not set + +# +# Supported ddbridge ('Octopus') Adapters +# +# CONFIG_DVB_DDBRIDGE is not set + +# +# Supported DVB Frontends +# +CONFIG_DVB_FE_CUSTOMISE=y + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV6110x=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_AF9013=m +CONFIG_DVB_EC100=m +CONFIG_DVB_HD29L2=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_IT913X_FE=m + +# +# Tools to develop new frontends +# +# CONFIG_DVB_DUMMY_FE is not set + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +# CONFIG_DRM is not set +# CONFIG_STUB_POULSBO is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_WMT_GE_ROPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +CONFIG_FB_BCM=y +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +CONFIG_FONT_10x18=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_SEQUENCER=y +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +# CONFIG_SND_PCM_OSS_PLUGINS is not set +# CONFIG_SND_SEQUENCER_OSS is not set +# CONFIG_SND_HRTIMER is not set +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_MIPS is not set +# CONFIG_SND_USB is not set +# CONFIG_SND_SOC is not set +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +CONFIG_HIDRAW=y + +# +# USB Input Devices +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_LCPOWER is not set +CONFIG_HID_LOGITECH=y +CONFIG_HID_LOGITECH_DJ=y +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGIG940_FF is not set +# CONFIG_LOGIWHEELS_FF is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THRUSTMASTER is not set +CONFIG_HID_WACOM=m +# CONFIG_HID_WACOM_POWER_SUPPLY is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +CONFIG_USB_ARCH_HAS_EHCI=y +CONFIG_USB_ARCH_HAS_XHCI=y +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DEVICE_CLASS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_WUSB_CBAF is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_UAS is not set +# CONFIG_USB_LIBUSUAL is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=m +CONFIG_USB_EZUSB=y +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRCABLE is not set +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +CONFIG_USB_SERIAL_FTDI_SIO=m +# CONFIG_USB_SERIAL_FUNSOFT is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=m +# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MOTOROLA is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_OTI6858 is not set +# CONFIG_USB_SERIAL_QCAUX is not set +# CONFIG_USB_SERIAL_QUALCOMM is not set +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_SAFE is not set +# CONFIG_USB_SERIAL_SIEMENS_MPI is not set +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SERIAL_WWAN=m +CONFIG_USB_SERIAL_OPTION=m +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set +# CONFIG_USB_SERIAL_ZIO is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_DEBUG is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_OT200 is not set +CONFIG_LEDS_TRIGGERS=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_MMIO is not set + +# +# Microsoft Hyper-V guest support +# +CONFIG_STAGING=y +# CONFIG_ET131X is not set +# CONFIG_USBIP_CORE is not set +CONFIG_W35UND=m +CONFIG_PRISM2_USB=m +# CONFIG_ECHO is not set +# CONFIG_ASUS_OLED is not set +CONFIG_R8187SE=m +CONFIG_RTL8192U=m +CONFIG_RTLLIB=m +CONFIG_RTLLIB_CRYPTO_CCMP=m +CONFIG_RTLLIB_CRYPTO_TKIP=m +CONFIG_RTLLIB_CRYPTO_WEP=m +# CONFIG_RTL8192E is not set +CONFIG_R8712U=m +# CONFIG_R8712_AP is not set +# CONFIG_RTS_PSTOR is not set +# CONFIG_RTS5139 is not set +# CONFIG_TRANZPORT is not set +# CONFIG_IDE_PHISON is not set +# CONFIG_LINE6_USB is not set +# CONFIG_USB_SERIAL_QUATECH2 is not set +# CONFIG_USB_SERIAL_QUATECH_USB2 is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VME_BUS is not set +# CONFIG_DX_SEP is not set +# CONFIG_IIO is not set +# CONFIG_XVMALLOC is not set +# CONFIG_ZRAM is not set +# CONFIG_FB_SM7XX is not set +# CONFIG_CRYSTALHD is not set +# CONFIG_FB_XGI is not set +# CONFIG_USB_ENESTORAGE is not set +# CONFIG_BCM_WIMAX is not set +# CONFIG_FT1000 is not set + +# +# Speakup console speech +# +# CONFIG_SPEAKUP is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +CONFIG_STAGING_MEDIA=y +CONFIG_DVB_AS102=m +# CONFIG_DVB_CXD2099 is not set +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_EASYCAP is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_SOLO6X10 is not set +# CONFIG_LIRC_STAGING is not set + +# +# Android +# +# CONFIG_ANDROID is not set + +# +# Hardware Spinlock drivers +# +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_VIRT_DRIVERS is not set +# CONFIG_PM_DEVFREQ is not set + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT23=y +# CONFIG_EXT4_FS_XATTR is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_FS_POSIX_ACL is not set +CONFIG_EXPORTFS=m +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +CONFIG_AUTOFS4_FS=y +CONFIG_FUSE_FS=y +# CONFIG_CUSE is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=y +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +CONFIG_NTFS_FS=m +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=y +CONFIG_HFSPLUS_FS=y +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +# CONFIG_JFFS2_CMODE_PRIORITY is not set +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_CMODE_FAVOURLZO=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +# CONFIG_LOGFS is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=m +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_CEPH_FS is not set +CONFIG_CIFS=y +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-15" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=y + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_PRINTK_TIME is not set +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=0 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_EARLY_PRINTK is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="bmem=216M ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw console=null" +CONFIG_CMDLINE_OVERRIDE=y +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=m +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_AUTHENC=m +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=m +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +CONFIG_CRYPTO_MD4=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_MICHAEL_MIC=m +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +# CONFIG_CRYPTO_ZLIB is not set +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +CONFIG_CRC_ITU_T=y +CONFIG_CRC32=y +CONFIG_CRC7=m +# CONFIG_LIBCRC32C is not set +# CONFIG_CRC8 is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_XZ_DEC is not set +# CONFIG_XZ_DEC_BCJ is not set +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_AVERAGE=y +# CONFIG_CORDIC is not set diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/fix-proc-cputype.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/fix-proc-cputype.patch new file mode 100644 index 0000000000..e5b45c0520 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/fix-proc-cputype.patch @@ -0,0 +1,13 @@ +diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c +index bb133d1..23e3434 100644 +--- a/arch/mips/kernel/cpu-probe.c ++++ b/arch/mips/kernel/cpu-probe.c +@@ -942,7 +942,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) + if (rev >= PRID_REV_BMIPS4380_LO && + rev <= PRID_REV_BMIPS4380_HI) { + c->cputype = CPU_BMIPS4380; +- __cpu_name[cpu] = "Broadcom BMIPS4380"; ++ __cpu_name[cpu] = "Brcm4380"; + set_elf_platform(cpu, "bmips4380"); + } else { + c->cputype = CPU_BMIPS4350; diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/iosched-slice_idle-1.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/iosched-slice_idle-1.patch new file mode 100644 index 0000000000..cf6d39944b --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/iosched-slice_idle-1.patch @@ -0,0 +1,15 @@ +Index: linux-3.2.2/block/cfq-iosched.c +=================================================================== +--- linux-3.2.2.orig/block/cfq-iosched.c ++++ linux-3.2.2/block/cfq-iosched.c +@@ -29,8 +29,8 @@ static const int cfq_back_penalty = 2; + static const int cfq_slice_sync = HZ / 10; + static int cfq_slice_async = HZ / 25; + static const int cfq_slice_async_rq = 2; +-static int cfq_slice_idle = HZ / 125; +-static int cfq_group_idle = HZ / 125; ++static int cfq_slice_idle = HZ / 1000; /* 1 ms */ ++static int cfq_group_idle = HZ / 250; /* 4 ms, not used */ + static const int cfq_target_latency = HZ * 3/10; /* 300 ms */ + static const int cfq_hist_divisor = 4; + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.4.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.4.patch new file mode 100644 index 0000000000..d1a43cfc43 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.4.patch @@ -0,0 +1,730 @@ +it913x: backports from kernel 3.4 + +includes the following patches from Malcolm Priestley: + +it913x-v1.23-use-it913x_config.chip_ver-to-select-firmware..patch +it913x-ver-1.24-Make-0x60-default-on-version-2-devices..patch +1-2-it913x-v1.25-support-different-for-remotes..patch +2-2-IT913X-Version-1-and-Version-2-keymaps.patch +it913x-ver-1.26-change-to-remove-interruptible-mutex-locks..patch +it913x-ver-1.27-Allow-PID-8192-to-turn-PID-filter-off.patch +it913x-fe-ver-1.15-read-signal-strenght-using-reg-VAR_P_INBAND..patch + +From: Gianluca Gennari +--- + drivers/media/dvb/dvb-usb/it913x.c | 170 +++++++++++++++++++------- + drivers/media/dvb/frontends/it913x-fe-priv.h | 5 + + drivers/media/dvb/frontends/it913x-fe.c | 91 ++++++++++++-- + drivers/media/dvb/frontends/it913x-fe.h | 4 + + drivers/media/rc/keymaps/Makefile | 2 + + drivers/media/rc/keymaps/rc-it913x-v1.c | 95 ++++++++++++++ + drivers/media/rc/keymaps/rc-it913x-v2.c | 94 ++++++++++++++ + include/media/rc-map.h | 2 + + 8 files changed, 407 insertions(+), 56 deletions(-) + create mode 100644 drivers/media/rc/keymaps/rc-it913x-v1.c + create mode 100644 drivers/media/rc/keymaps/rc-it913x-v2.c + +diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c +index 9f01cd7..3b7b102 100644 +--- a/drivers/media/dvb/dvb-usb/it913x.c ++++ b/drivers/media/dvb/dvb-usb/it913x.c +@@ -64,6 +64,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); + struct it913x_state { + u8 id; + struct ite_config it913x_config; ++ u8 pid_filter_onoff; + }; + + struct ite_config it913x_config; +@@ -259,15 +260,16 @@ static u32 it913x_query(struct usb_device *udev, u8 pro) + + static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) + { ++ struct it913x_state *st = adap->dev->priv; + struct usb_device *udev = adap->dev->udev; + int ret; + u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; + +- if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) +- return -EAGAIN; ++ mutex_lock(&adap->dev->i2c_mutex); ++ + deb_info(1, "PID_C (%02x)", onoff); + +- ret = it913x_wr_reg(udev, pro, PID_EN, onoff); ++ ret = it913x_wr_reg(udev, pro, PID_EN, st->pid_filter_onoff); + + mutex_unlock(&adap->dev->i2c_mutex); + return ret; +@@ -276,12 +278,13 @@ static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) + static int it913x_pid_filter(struct dvb_usb_adapter *adap, + int index, u16 pid, int onoff) + { ++ struct it913x_state *st = adap->dev->priv; + struct usb_device *udev = adap->dev->udev; + int ret; + u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; + +- if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) +- return -EAGAIN; ++ mutex_lock(&adap->dev->i2c_mutex); ++ + deb_info(1, "PID_F (%02x)", onoff); + + ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff)); +@@ -292,6 +295,13 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap, + + ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f)); + ++ if (udev->speed == USB_SPEED_HIGH && pid == 0x2000) { ++ ret |= it913x_wr_reg(udev, pro, PID_EN, !onoff); ++ st->pid_filter_onoff = !onoff; ++ } else ++ st->pid_filter_onoff = ++ adap->fe_adap[adap->active_fe].pid_filtering; ++ + mutex_unlock(&adap->dev->i2c_mutex); + return 0; + } +@@ -316,8 +326,8 @@ static int it913x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], + int ret; + u32 reg; + u8 pro; +- if (mutex_lock_interruptible(&d->i2c_mutex) < 0) +- return -EAGAIN; ++ ++ mutex_lock(&d->i2c_mutex); + + debug_data_snipet(1, "Message out", msg[0].buf); + deb_info(2, "num of messages %d address %02x", num, msg[0].addr); +@@ -358,8 +368,7 @@ static int it913x_rc_query(struct dvb_usb_device *d) + int ret; + u32 key; + /* Avoid conflict with frontends*/ +- if (mutex_lock_interruptible(&d->i2c_mutex) < 0) +- return -EAGAIN; ++ mutex_lock(&d->i2c_mutex); + + ret = it913x_io(d->udev, READ_LONG, PRO_LINK, CMD_IR_GET, + 0, 0, &ibuf[0], sizeof(ibuf)); +@@ -388,19 +397,12 @@ static int ite_firmware_select(struct usb_device *udev, + { + int sw; + /* auto switch */ +- if (le16_to_cpu(udev->descriptor.idProduct) == +- USB_PID_ITETECH_IT9135) +- sw = IT9135_V1_FW; +- else if (le16_to_cpu(udev->descriptor.idProduct) == +- USB_PID_ITETECH_IT9135_9005) ++ if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_KWORLD_2) ++ sw = IT9137_FW; ++ else if (it913x_config.chip_ver == 1) + sw = IT9135_V1_FW; +- else if (le16_to_cpu(udev->descriptor.idProduct) == +- USB_PID_ITETECH_IT9135_9006) { ++ else + sw = IT9135_V2_FW; +- if (it913x_config.tuner_id_0 == 0) +- it913x_config.tuner_id_0 = IT9135_60; +- } else +- sw = IT9137_FW; + + /* force switch */ + if (dvb_usb_it913x_firmware != IT9135_AUTO) +@@ -410,41 +412,103 @@ static int ite_firmware_select(struct usb_device *udev, + case IT9135_V1_FW: + it913x_config.firmware_ver = 1; + it913x_config.adc_x2 = 1; ++ it913x_config.read_slevel = false; + props->firmware = fw_it9135_v1; + break; + case IT9135_V2_FW: + it913x_config.firmware_ver = 1; + it913x_config.adc_x2 = 1; ++ it913x_config.read_slevel = false; + props->firmware = fw_it9135_v2; ++ switch (it913x_config.tuner_id_0) { ++ case IT9135_61: ++ case IT9135_62: ++ break; ++ default: ++ info("Unknown tuner ID applying default 0x60"); ++ case IT9135_60: ++ it913x_config.tuner_id_0 = IT9135_60; ++ } + break; + case IT9137_FW: + default: + it913x_config.firmware_ver = 0; + it913x_config.adc_x2 = 0; ++ it913x_config.read_slevel = true; + props->firmware = fw_it9137; + } + + return 0; + } + ++static void it913x_select_remote(struct usb_device *udev, ++ struct dvb_usb_device_properties *props) ++{ ++ switch (le16_to_cpu(udev->descriptor.idProduct)) { ++ case USB_PID_ITETECH_IT9135_9005: ++ props->rc.core.rc_codes = RC_MAP_IT913X_V2; ++ return; ++ default: ++ props->rc.core.rc_codes = RC_MAP_IT913X_V1; ++ } ++ return; ++} ++ + #define TS_MPEG_PKT_SIZE 188 + #define EP_LOW 21 + #define TS_BUFFER_SIZE_PID (EP_LOW*TS_MPEG_PKT_SIZE) + #define EP_HIGH 348 + #define TS_BUFFER_SIZE_MAX (EP_HIGH*TS_MPEG_PKT_SIZE) + +-static int it913x_identify_state(struct usb_device *udev, +- struct dvb_usb_device_properties *props, +- struct dvb_usb_device_description **desc, +- int *cold) ++static int it913x_select_config(struct usb_device *udev, ++ struct dvb_usb_device_properties *props) + { +- int ret = 0, firm_no; +- u8 reg, remote; ++ int ret = 0, reg; ++ bool proprietary_ir = false; + +- firm_no = it913x_return_status(udev); ++ if (it913x_config.chip_ver == 0x02 ++ && it913x_config.chip_type == 0x9135) ++ reg = it913x_read_reg(udev, 0x461d); ++ else ++ reg = it913x_read_reg(udev, 0x461b); + +- /* checnk for dual mode */ +- it913x_config.dual_mode = it913x_read_reg(udev, 0x49c5); ++ if (reg < 0) ++ return reg; ++ ++ if (reg == 0) { ++ it913x_config.dual_mode = 0; ++ it913x_config.tuner_id_0 = IT9135_38; ++ proprietary_ir = true; ++ } else { ++ /* TS mode */ ++ reg = it913x_read_reg(udev, 0x49c5); ++ if (reg < 0) ++ return reg; ++ it913x_config.dual_mode = reg; ++ ++ /* IR mode type */ ++ reg = it913x_read_reg(udev, 0x49ac); ++ if (reg < 0) ++ return reg; ++ if (reg == 5) { ++ info("Remote propriety (raw) mode"); ++ proprietary_ir = true; ++ } else if (reg == 1) { ++ info("Remote HID mode NOT SUPPORTED"); ++ proprietary_ir = false; ++ props->rc.core.rc_codes = NULL; ++ } else ++ props->rc.core.rc_codes = NULL; ++ ++ /* Tuner_id */ ++ reg = it913x_read_reg(udev, 0x49d0); ++ if (reg < 0) ++ return reg; ++ it913x_config.tuner_id_0 = reg; ++ } ++ ++ if (proprietary_ir) ++ it913x_select_remote(udev, props); + + if (udev->speed != USB_SPEED_HIGH) { + props->adapter[0].fe[0].pid_filter_count = 5; +@@ -459,17 +523,6 @@ static int it913x_identify_state(struct usb_device *udev, + if(props->adapter[0].fe[0].pid_filter_count == 5) + props->adapter[0].fe[0].pid_filter_count = 31; + +- /* TODO different remotes */ +- remote = it913x_read_reg(udev, 0x49ac); /* Remote */ +- if (remote == 0) +- props->rc.core.rc_codes = NULL; +- +- /* TODO at the moment tuner_id is always assigned to 0x38 */ +- it913x_config.tuner_id_0 = it913x_read_reg(udev, 0x49d0); +- +- info("Dual mode=%x Remote=%x Tuner Type=%x", it913x_config.dual_mode +- , remote, it913x_config.tuner_id_0); +- + /* Select Stream Buffer Size and pid filter option*/ + if (pid_filter) { + props->adapter[0].fe[0].stream.u.bulk.buffersize = +@@ -490,8 +543,29 @@ static int it913x_identify_state(struct usb_device *udev, + } else + props->num_adapters = 1; + ++ info("Dual mode=%x Tuner Type=%x", it913x_config.dual_mode, ++ it913x_config.tuner_id_0); ++ + ret = ite_firmware_select(udev, props); + ++ return ret; ++} ++ ++static int it913x_identify_state(struct usb_device *udev, ++ struct dvb_usb_device_properties *props, ++ struct dvb_usb_device_description **desc, ++ int *cold) ++{ ++ int ret = 0, firm_no; ++ u8 reg; ++ ++ firm_no = it913x_return_status(udev); ++ ++ /* Read and select config */ ++ ret = it913x_select_config(udev, props); ++ if (ret < 0) ++ return ret; ++ + if (firm_no > 0) { + *cold = 0; + return 0; +@@ -538,18 +612,22 @@ static int it913x_identify_state(struct usb_device *udev, + + static int it913x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) + { ++ struct it913x_state *st = adap->dev->priv; + int ret = 0; + u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; + +- if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) +- return -EAGAIN; + deb_info(1, "STM (%02x)", onoff); + +- if (!onoff) ++ if (!onoff) { ++ mutex_lock(&adap->dev->i2c_mutex); ++ + ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1); + ++ mutex_unlock(&adap->dev->i2c_mutex); ++ st->pid_filter_onoff = ++ adap->fe_adap[adap->active_fe].pid_filtering; + +- mutex_unlock(&adap->dev->i2c_mutex); ++ } + + return ret; + } +@@ -789,7 +867,7 @@ static struct dvb_usb_device_properties it913x_properties = { + .rc_query = it913x_rc_query, + .rc_interval = IT913X_POLL, + .allowed_protos = RC_TYPE_NEC, +- .rc_codes = RC_MAP_MSI_DIGIVOX_III, ++ .rc_codes = RC_MAP_IT913X_V1, + }, + .i2c_algo = &it913x_i2c_algo, + .num_device_descs = 5, +@@ -823,5 +901,5 @@ module_usb_driver(it913x_driver); + + MODULE_AUTHOR("Malcolm Priestley "); + MODULE_DESCRIPTION("it913x USB 2 Driver"); +-MODULE_VERSION("1.22"); ++MODULE_VERSION("1.27"); + MODULE_LICENSE("GPL"); +diff --git a/drivers/media/dvb/frontends/it913x-fe-priv.h b/drivers/media/dvb/frontends/it913x-fe-priv.h +index 93b086e..eb6fd8a 100644 +--- a/drivers/media/dvb/frontends/it913x-fe-priv.h ++++ b/drivers/media/dvb/frontends/it913x-fe-priv.h +@@ -201,6 +201,11 @@ fe_modulation_t fe_con[] = { + QAM_64, + }; + ++enum { ++ PRIORITY_HIGH = 0, /* High-priority stream */ ++ PRIORITY_LOW, /* Low-priority stream */ ++}; ++ + /* Standard demodulator functions */ + static struct it913xset set_solo_fe[] = { + {PRO_LINK, GPIOH5_EN, {0x01}, 0x01}, +diff --git a/drivers/media/dvb/frontends/it913x-fe.c b/drivers/media/dvb/frontends/it913x-fe.c +index ccc36bf..84df03c 100644 +--- a/drivers/media/dvb/frontends/it913x-fe.c ++++ b/drivers/media/dvb/frontends/it913x-fe.c +@@ -57,6 +57,7 @@ struct it913x_fe_state { + u32 frequency; + fe_modulation_t constellation; + fe_transmit_mode_t transmission_mode; ++ u8 priority; + u32 crystalFrequency; + u32 adcFrequency; + u8 tuner_type; +@@ -500,19 +501,87 @@ static int it913x_fe_read_status(struct dvb_frontend *fe, fe_status_t *status) + return 0; + } + ++/* FEC values based on fe_code_rate_t non supported values 0*/ ++int it913x_qpsk_pval[] = {0, -93, -91, -90, 0, -89, -88}; ++int it913x_16qam_pval[] = {0, -87, -85, -84, 0, -83, -82}; ++int it913x_64qam_pval[] = {0, -82, -80, -78, 0, -77, -76}; ++ ++static int it913x_get_signal_strength(struct dvb_frontend *fe) ++{ ++ struct dtv_frontend_properties *p = &fe->dtv_property_cache; ++ struct it913x_fe_state *state = fe->demodulator_priv; ++ u8 code_rate; ++ int ret, temp; ++ u8 lna_gain_os; ++ ++ ret = it913x_read_reg_u8(state, VAR_P_INBAND); ++ if (ret < 0) ++ return ret; ++ ++ /* VHF/UHF gain offset */ ++ if (state->frequency < 300000000) ++ lna_gain_os = 7; ++ else ++ lna_gain_os = 14; ++ ++ temp = (ret - 100) - lna_gain_os; ++ ++ if (state->priority == PRIORITY_HIGH) ++ code_rate = p->code_rate_HP; ++ else ++ code_rate = p->code_rate_LP; ++ ++ if (code_rate >= ARRAY_SIZE(it913x_qpsk_pval)) ++ return -EINVAL; ++ ++ deb_info("Reg VAR_P_INBAND:%d Calc Offset Value:%d", ret, temp); ++ ++ /* Apply FEC offset values*/ ++ switch (p->modulation) { ++ case QPSK: ++ temp -= it913x_qpsk_pval[code_rate]; ++ break; ++ case QAM_16: ++ temp -= it913x_16qam_pval[code_rate]; ++ break; ++ case QAM_64: ++ temp -= it913x_64qam_pval[code_rate]; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ if (temp < -15) ++ ret = 0; ++ else if ((-15 <= temp) && (temp < 0)) ++ ret = (2 * (temp + 15)) / 3; ++ else if ((0 <= temp) && (temp < 20)) ++ ret = 4 * temp + 10; ++ else if ((20 <= temp) && (temp < 35)) ++ ret = (2 * (temp - 20)) / 3 + 90; ++ else if (temp >= 35) ++ ret = 100; ++ ++ deb_info("Signal Strength :%d", ret); ++ ++ return ret; ++} ++ + static int it913x_fe_read_signal_strength(struct dvb_frontend *fe, + u16 *strength) + { + struct it913x_fe_state *state = fe->demodulator_priv; +- int ret = it913x_read_reg_u8(state, SIGNAL_LEVEL); +- /*SIGNAL_LEVEL always returns 100%! so using FE_HAS_SIGNAL as switch*/ +- if (state->it913x_status & FE_HAS_SIGNAL) +- ret = (ret * 0xff) / 0x64; +- else +- ret = 0x0; +- ret |= ret << 0x8; +- *strength = ret; +- return 0; ++ int ret = 0; ++ if (state->config->read_slevel) { ++ if (state->it913x_status & FE_HAS_SIGNAL) ++ ret = it913x_read_reg_u8(state, SIGNAL_LEVEL); ++ } else ++ ret = it913x_get_signal_strength(fe); ++ ++ if (ret >= 0) ++ *strength = (u16)((u32)ret * 0xffff / 0x64); ++ ++ return (ret < 0) ? -ENODEV : 0; + } + + static int it913x_fe_read_snr(struct dvb_frontend *fe, u16 *snr) +@@ -606,6 +675,8 @@ static int it913x_fe_get_frontend(struct dvb_frontend *fe) + if (reg[2] < 4) + p->hierarchy = fe_hi[reg[2]]; + ++ state->priority = reg[5]; ++ + p->code_rate_HP = (reg[6] < 6) ? fe_code[reg[6]] : FEC_NONE; + p->code_rate_LP = (reg[7] < 6) ? fe_code[reg[7]] : FEC_NONE; + +@@ -972,5 +1043,5 @@ static struct dvb_frontend_ops it913x_fe_ofdm_ops = { + + MODULE_DESCRIPTION("it913x Frontend and it9137 tuner"); + MODULE_AUTHOR("Malcolm Priestley tvboxspy@gmail.com"); +-MODULE_VERSION("1.13"); ++MODULE_VERSION("1.15"); + MODULE_LICENSE("GPL"); +diff --git a/drivers/media/dvb/frontends/it913x-fe.h b/drivers/media/dvb/frontends/it913x-fe.h +index c4a908e..07fa459 100644 +--- a/drivers/media/dvb/frontends/it913x-fe.h ++++ b/drivers/media/dvb/frontends/it913x-fe.h +@@ -34,6 +34,8 @@ struct ite_config { + u8 tuner_id_1; + u8 dual_mode; + u8 adf; ++ /* option to read SIGNAL_LEVEL */ ++ u8 read_slevel; + }; + + #if defined(CONFIG_DVB_IT913X_FE) || (defined(CONFIG_DVB_IT913X_FE_MODULE) && \ +@@ -168,6 +170,8 @@ static inline struct dvb_frontend *it913x_fe_attach( + #define EST_SIGNAL_LEVEL 0x004a + #define FREE_BAND 0x004b + #define SUSPEND_FLAG 0x004c ++#define VAR_P_INBAND 0x00f7 ++ + /* Build in tuner types */ + #define IT9137 0x38 + #define IT9135_38 0x38 +diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile +index 36e4d5e..9514d82 100644 +--- a/drivers/media/rc/keymaps/Makefile ++++ b/drivers/media/rc/keymaps/Makefile +@@ -41,6 +41,8 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ + rc-imon-mce.o \ + rc-imon-pad.o \ + rc-iodata-bctv7e.o \ ++ rc-it913x-v1.o \ ++ rc-it913x-v2.o \ + rc-kaiomy.o \ + rc-kworld-315u.o \ + rc-kworld-plus-tv-analog.o \ +diff --git a/drivers/media/rc/keymaps/rc-it913x-v1.c b/drivers/media/rc/keymaps/rc-it913x-v1.c +new file mode 100644 +index 0000000..0ac775f +--- /dev/null ++++ b/drivers/media/rc/keymaps/rc-it913x-v1.c +@@ -0,0 +1,95 @@ ++/* ITE Generic remotes Version 1 ++ * ++ * Copyright (C) 2012 Malcolm Priestley (tvboxspy@gmail.com) ++ * ++ * 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 ++ ++ ++static struct rc_map_table it913x_v1_rc[] = { ++ /* Type 1 */ ++ { 0x61d601, KEY_VIDEO }, /* Source */ ++ { 0x61d602, KEY_3 }, ++ { 0x61d603, KEY_POWER }, /* ShutDown */ ++ { 0x61d604, KEY_1 }, ++ { 0x61d605, KEY_5 }, ++ { 0x61d606, KEY_6 }, ++ { 0x61d607, KEY_CHANNELDOWN }, /* CH- */ ++ { 0x61d608, KEY_2 }, ++ { 0x61d609, KEY_CHANNELUP }, /* CH+ */ ++ { 0x61d60a, KEY_9 }, ++ { 0x61d60b, KEY_ZOOM }, /* Zoom */ ++ { 0x61d60c, KEY_7 }, ++ { 0x61d60d, KEY_8 }, ++ { 0x61d60e, KEY_VOLUMEUP }, /* Vol+ */ ++ { 0x61d60f, KEY_4 }, ++ { 0x61d610, KEY_ESC }, /* [back up arrow] */ ++ { 0x61d611, KEY_0 }, ++ { 0x61d612, KEY_OK }, /* [enter arrow] */ ++ { 0x61d613, KEY_VOLUMEDOWN }, /* Vol- */ ++ { 0x61d614, KEY_RECORD }, /* Rec */ ++ { 0x61d615, KEY_STOP }, /* Stop */ ++ { 0x61d616, KEY_PLAY }, /* Play */ ++ { 0x61d617, KEY_MUTE }, /* Mute */ ++ { 0x61d618, KEY_UP }, ++ { 0x61d619, KEY_DOWN }, ++ { 0x61d61a, KEY_LEFT }, ++ { 0x61d61b, KEY_RIGHT }, ++ { 0x61d61c, KEY_RED }, ++ { 0x61d61d, KEY_GREEN }, ++ { 0x61d61e, KEY_YELLOW }, ++ { 0x61d61f, KEY_BLUE }, ++ { 0x61d643, KEY_POWER2 }, /* [red power button] */ ++ /* Type 2 - 20 buttons */ ++ { 0x807f0d, KEY_0 }, ++ { 0x807f04, KEY_1 }, ++ { 0x807f05, KEY_2 }, ++ { 0x807f06, KEY_3 }, ++ { 0x807f07, KEY_4 }, ++ { 0x807f08, KEY_5 }, ++ { 0x807f09, KEY_6 }, ++ { 0x807f0a, KEY_7 }, ++ { 0x807f1b, KEY_8 }, ++ { 0x807f1f, KEY_9 }, ++ { 0x807f12, KEY_POWER }, ++ { 0x807f01, KEY_MEDIA_REPEAT}, /* Recall */ ++ { 0x807f19, KEY_PAUSE }, /* Timeshift */ ++ { 0x807f1e, KEY_VOLUMEUP }, /* 2 x -/+ Keys not marked */ ++ { 0x807f03, KEY_VOLUMEDOWN }, /* Volume defined as right hand*/ ++ { 0x807f1a, KEY_CHANNELUP }, ++ { 0x807f02, KEY_CHANNELDOWN }, ++ { 0x807f0c, KEY_ZOOM }, ++ { 0x807f00, KEY_RECORD }, ++ { 0x807f0e, KEY_STOP }, ++}; ++ ++static struct rc_map_list it913x_v1_map = { ++ .map = { ++ .scan = it913x_v1_rc, ++ .size = ARRAY_SIZE(it913x_v1_rc), ++ .rc_type = RC_TYPE_NEC, ++ .name = RC_MAP_IT913X_V1, ++ } ++}; ++ ++static int __init init_rc_it913x_v1_map(void) ++{ ++ return rc_map_register(&it913x_v1_map); ++} ++ ++static void __exit exit_rc_it913x_v1_map(void) ++{ ++ rc_map_unregister(&it913x_v1_map); ++} ++ ++module_init(init_rc_it913x_v1_map) ++module_exit(exit_rc_it913x_v1_map) ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Malcolm Priestley tvboxspy@gmail.com"); +diff --git a/drivers/media/rc/keymaps/rc-it913x-v2.c b/drivers/media/rc/keymaps/rc-it913x-v2.c +new file mode 100644 +index 0000000..28e376e +--- /dev/null ++++ b/drivers/media/rc/keymaps/rc-it913x-v2.c +@@ -0,0 +1,94 @@ ++/* ITE Generic remotes Version 2 ++ * ++ * Copyright (C) 2012 Malcolm Priestley (tvboxspy@gmail.com) ++ * ++ * 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 ++ ++ ++static struct rc_map_table it913x_v2_rc[] = { ++ /* Type 1 */ ++ /* 9005 remote */ ++ { 0x807f12, KEY_POWER2 }, /* Power (RED POWER BUTTON)*/ ++ { 0x807f1a, KEY_VIDEO }, /* Source */ ++ { 0x807f1e, KEY_MUTE }, /* Mute */ ++ { 0x807f01, KEY_RECORD }, /* Record */ ++ { 0x807f02, KEY_CHANNELUP }, /* Channel+ */ ++ { 0x807f03, KEY_TIME }, /* TimeShift */ ++ { 0x807f04, KEY_VOLUMEUP }, /* Volume- */ ++ { 0x807f05, KEY_SCREEN }, /* FullScreen */ ++ { 0x807f06, KEY_VOLUMEDOWN }, /* Volume- */ ++ { 0x807f07, KEY_0 }, /* 0 */ ++ { 0x807f08, KEY_CHANNELDOWN }, /* Channel- */ ++ { 0x807f09, KEY_PREVIOUS }, /* Recall */ ++ { 0x807f0a, KEY_1 }, /* 1 */ ++ { 0x807f1b, KEY_2 }, /* 2 */ ++ { 0x807f1f, KEY_3 }, /* 3 */ ++ { 0x807f0c, KEY_4 }, /* 4 */ ++ { 0x807f0d, KEY_5 }, /* 5 */ ++ { 0x807f0e, KEY_6 }, /* 6 */ ++ { 0x807f00, KEY_7 }, /* 7 */ ++ { 0x807f0f, KEY_8 }, /* 8 */ ++ { 0x807f19, KEY_9 }, /* 9 */ ++ ++ /* Type 2 */ ++ /* keys stereo, snapshot unassigned */ ++ { 0x866b00, KEY_0 }, ++ { 0x866b1b, KEY_1 }, ++ { 0x866b02, KEY_2 }, ++ { 0x866b03, KEY_3 }, ++ { 0x866b04, KEY_4 }, ++ { 0x866b05, KEY_5 }, ++ { 0x866b06, KEY_6 }, ++ { 0x866b07, KEY_7 }, ++ { 0x866b08, KEY_8 }, ++ { 0x866b09, KEY_9 }, ++ { 0x866b12, KEY_POWER }, ++ { 0x866b13, KEY_MUTE }, ++ { 0x866b0a, KEY_PREVIOUS }, /* Recall */ ++ { 0x866b1e, KEY_PAUSE }, ++ { 0x866b0c, KEY_VOLUMEUP }, ++ { 0x866b18, KEY_VOLUMEDOWN }, ++ { 0x866b0b, KEY_CHANNELUP }, ++ { 0x866b18, KEY_CHANNELDOWN }, ++ { 0x866b10, KEY_ZOOM }, ++ { 0x866b1d, KEY_RECORD }, ++ { 0x866b0e, KEY_STOP }, ++ { 0x866b11, KEY_EPG}, ++ { 0x866b1a, KEY_FASTFORWARD }, ++ { 0x866b0f, KEY_REWIND }, ++ { 0x866b1c, KEY_TV }, ++ { 0x866b1b, KEY_TEXT }, ++ ++}; ++ ++static struct rc_map_list it913x_v2_map = { ++ .map = { ++ .scan = it913x_v2_rc, ++ .size = ARRAY_SIZE(it913x_v2_rc), ++ .rc_type = RC_TYPE_NEC, ++ .name = RC_MAP_IT913X_V2, ++ } ++}; ++ ++static int __init init_rc_it913x_v2_map(void) ++{ ++ return rc_map_register(&it913x_v2_map); ++} ++ ++static void __exit exit_rc_it913x_v2_map(void) ++{ ++ rc_map_unregister(&it913x_v2_map); ++} ++ ++module_init(init_rc_it913x_v2_map) ++module_exit(exit_rc_it913x_v2_map) ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Malcolm Priestley tvboxspy@gmail.com"); +diff --git a/include/media/rc-map.h b/include/media/rc-map.h +index f688bde..5b988d7 100644 +--- a/include/media/rc-map.h ++++ b/include/media/rc-map.h +@@ -102,6 +102,8 @@ void rc_map_init(void); + #define RC_MAP_IMON_MCE "rc-imon-mce" + #define RC_MAP_IMON_PAD "rc-imon-pad" + #define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e" ++#define RC_MAP_IT913X_V1 "rc-it913x-v1" ++#define RC_MAP_IT913X_V2 "rc-it913x-v2" + #define RC_MAP_KAIOMY "rc-kaiomy" + #define RC_MAP_KWORLD_315U "rc-kworld-315u" + #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.5.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.5.patch new file mode 100644 index 0000000000..527009f2cb --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-backports-from-kernel-3.5.patch @@ -0,0 +1,108 @@ +it913x: backports from kernel 3.5 + +includes the following patches from Malcolm Priestley: + +it913x-ver-1.28.-fix-firmware-loading-errors..patch + +From: Gianluca Gennari +--- + drivers/media/dvb/dvb-usb/it913x.c | 54 ++++++++++++++++++++++++++--------- + 1 files changed, 40 insertions(+), 14 deletions(-) + +diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c +index 3b7b102..482d249 100644 +--- a/drivers/media/dvb/dvb-usb/it913x.c ++++ b/drivers/media/dvb/dvb-usb/it913x.c +@@ -238,12 +238,27 @@ static int it913x_read_reg(struct usb_device *udev, u32 reg) + + static u32 it913x_query(struct usb_device *udev, u8 pro) + { +- int ret; ++ int ret, i; + u8 data[4]; +- ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ, +- 0x1222, 0, &data[0], 3); ++ u8 ver; ++ ++ for (i = 0; i < 5; i++) { ++ ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ, ++ 0x1222, 0, &data[0], 3); ++ ver = data[0]; ++ if (ver > 0 && ver < 3) ++ break; ++ msleep(100); ++ } + +- it913x_config.chip_ver = data[0]; ++ if (ver < 1 || ver > 2) { ++ info("Failed to identify chip version applying 1"); ++ it913x_config.chip_ver = 0x1; ++ it913x_config.chip_type = 0x9135; ++ return 0; ++ } ++ ++ it913x_config.chip_ver = ver; + it913x_config.chip_type = (u16)(data[2] << 8) + data[1]; + + info("Chip Version=%02x Chip Type=%04x", it913x_config.chip_ver, +@@ -660,30 +675,41 @@ static int it913x_download_firmware(struct usb_device *udev, + if ((packet_size > min_pkt) || (i == fw->size)) { + fw_data = (u8 *)(fw->data + pos); + pos += packet_size; +- if (packet_size > 0) +- ret |= it913x_io(udev, WRITE_DATA, ++ if (packet_size > 0) { ++ ret = it913x_io(udev, WRITE_DATA, + DEV_0, CMD_SCATTER_WRITE, 0, + 0, fw_data, packet_size); ++ if (ret < 0) ++ break; ++ } + udelay(1000); + } + } + i++; + } + +- ret |= it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0); +- +- msleep(100); +- + if (ret < 0) +- info("FRM Firmware Download Failed (%04x)" , ret); ++ info("FRM Firmware Download Failed (%d)" , ret); + else + info("FRM Firmware Download Completed - Resetting Device"); + +- ret |= it913x_return_status(udev); ++ msleep(30); ++ ++ ret = it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0); ++ if (ret < 0) ++ info("FRM Device not responding to reboot"); ++ ++ ret = it913x_return_status(udev); ++ if (ret == 0) { ++ info("FRM Failed to reboot device"); ++ return -ENODEV; ++ } + + msleep(30); + +- ret |= it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400); ++ ret = it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400); ++ ++ msleep(30); + + /* Tuner function */ + if (it913x_config.dual_mode) +@@ -901,5 +927,5 @@ module_usb_driver(it913x_driver); + + MODULE_AUTHOR("Malcolm Priestley "); + MODULE_DESCRIPTION("it913x USB 2 Driver"); +-MODULE_VERSION("1.27"); ++MODULE_VERSION("1.28"); + MODULE_LICENSE("GPL"); +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-switch-off-PID-filter-by-default.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-switch-off-PID-filter-by-default.patch new file mode 100644 index 0000000000..407fc527bd --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/it913x-switch-off-PID-filter-by-default.patch @@ -0,0 +1,29 @@ +it913x: switch off PID filter by default + +PID filter can cause troubles, as reported by a few users, so switch it off +by default as we do not need it anyway. + +From: Gianluca Gennari +--- + drivers/media/dvb/dvb-usb/it913x.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c +index 482d249..614370c 100644 +--- a/drivers/media/dvb/dvb-usb/it913x.c ++++ b/drivers/media/dvb/dvb-usb/it913x.c +@@ -48,9 +48,9 @@ module_param_named(debug, dvb_usb_it913x_debug, int, 0644); + MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." + DVB_USB_DEBUG_STATUS); + +-static int pid_filter; ++static int pid_filter = 1; + module_param_named(pid, pid_filter, int, 0644); +-MODULE_PARM_DESC(pid, "set default 0=on 1=off"); ++MODULE_PARM_DESC(pid, "set 0=on default 1=off"); + + static int dvb_usb_it913x_firmware; + module_param_named(firmware, dvb_usb_it913x_firmware, int, 0644); +-- +1.7.0.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/rtl8712-release-firmware-fix.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/rtl8712-release-firmware-fix.patch new file mode 100644 index 0000000000..c859adcc3f --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/rtl8712-release-firmware-fix.patch @@ -0,0 +1,44 @@ +In commit 8c213fa, the command to release the firmware was placed +in the wrong routine. With NetworkManager, problems were rare, but +when using wicd as the network control, there is a problem as shown +in https://bugs.archlinux.org/task/27996#comment89833. + +Signed-off-by: Larry Finger +--- + +Index: wireless-testing-new/drivers/staging/rtl8712/os_intfs.c +=================================================================== +--- wireless-testing-new.orig/drivers/staging/rtl8712/os_intfs.c ++++ wireless-testing-new/drivers/staging/rtl8712/os_intfs.c +@@ -477,9 +477,6 @@ static int netdev_close(struct net_devic + r8712_free_network_queue(padapter); + /* The interface is no longer Up: */ + padapter->bup = false; +- release_firmware(padapter->fw); +- /* never exit with a firmware callback pending */ +- wait_for_completion(&padapter->rtl8712_fw_ready); + return 0; + } + +Index: wireless-testing-new/drivers/staging/rtl8712/usb_intf.c +=================================================================== +--- wireless-testing-new.orig/drivers/staging/rtl8712/usb_intf.c ++++ wireless-testing-new/drivers/staging/rtl8712/usb_intf.c +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + #include "osdep_service.h" + #include "drv_types.h" +@@ -620,6 +621,9 @@ static void r871xu_dev_remove(struct usb + struct _adapter *padapter = netdev_priv(pnetdev); + struct usb_device *udev = interface_to_usbdev(pusb_intf); + ++ release_firmware(padapter->fw); ++ /* never exit with a firmware callback pending */ ++ wait_for_completion(&padapter->rtl8712_fw_ready); + usb_set_intfdata(pusb_intf, NULL); + if (padapter) { + if (drvpriv.drv_registered == true) diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/tda10071-BUGFIX-delivery-system.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/tda10071-BUGFIX-delivery-system.patch new file mode 100644 index 0000000000..02c041c0f2 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/tda10071-BUGFIX-delivery-system.patch @@ -0,0 +1,21 @@ +Commit b2a29b578d9c21b2e5c88020f830d3c42115c51d sets accidentally supported +delivery systems as DVB-T/T2 whilst it should be DVB-S/S2. Due to that frontend +cannot be used at all. + +Bug reported: Ji?í Zelenka + +Signed-off-by: Antti Palosaari +--- +diff --git a/drivers/media/dvb/frontends/tda10071.c b/drivers/media/dvb/frontends/tda10071.c +index a992050..c21bc92 100644 +--- a/drivers/media/dvb/frontends/tda10071.c ++++ b/drivers/media/dvb/frontends/tda10071.c +@@ -1215,7 +1215,7 @@ error: + EXPORT_SYMBOL(tda10071_attach); + + static struct dvb_frontend_ops tda10071_ops = { +- .delsys = { SYS_DVBT, SYS_DVBT2 }, ++ .delsys = { SYS_DVBS, SYS_DVBS2 }, + .info = { + .name = "NXP TDA10071", + .frequency_min = 950000, diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00/tda18218-7mhz-lopass.patch b/meta-openpli/recipes-linux/linux/linux-etxx00/tda18218-7mhz-lopass.patch new file mode 100644 index 0000000000..15d2a64774 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00/tda18218-7mhz-lopass.patch @@ -0,0 +1,16 @@ +diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c +index dfb3a83..b079696 100644 +--- a/drivers/media/common/tuners/tda18218.c ++++ b/drivers/media/common/tuners/tda18218.c +@@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend *fe) + priv->if_frequency = 3000000; + } else if (bw <= 7000000) { + LP_Fc = 1; +- priv->if_frequency = 3500000; ++ priv->if_frequency = 4000000; + } else { + LP_Fc = 2; + priv->if_frequency = 4000000; +-- +1.7.5.4 + diff --git a/meta-openpli/recipes-linux/linux/linux-etxx00_3.3.0.bb b/meta-openpli/recipes-linux/linux/linux-etxx00_3.3.0.bb new file mode 100644 index 0000000000..2b0f85cd13 --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux-etxx00_3.3.0.bb @@ -0,0 +1,81 @@ +DESCRIPTION = "Linux kernel for ${MACHINE}" +SECTION = "kernel" +LICENSE = "GPLv2" + +KERNEL_RELEASE = "3.3.0" + +SRC_URI[md5sum] = "155f1c246dbc9e1148ef5857c0d880a5" +SRC_URI[sha256sum] = "67f2c4cec122e1f1b070a7dbfdfe0ac8afb2a80bb0c7d226d516a83664adf140" + +LIC_FILES_CHKSUM = "file://${WORKDIR}/linux-${PV}/COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +MACHINE_KERNEL_PR_append = ".4" + +# By default, kernel.bbclass modifies package names to allow multiple kernels +# to be installed in parallel. We revert this change and rprovide the versioned +# package names instead, to allow only one kernel to be installed. +PKG_kernel-base = "kernel-base" +PKG_kernel-image = "kernel-image" +RPROVIDES_kernel-base = "kernel-${KERNEL_VERSION}" +RPROVIDES_kernel-image = "kernel-image-${KERNEL_VERSION}" + +SRC_URI += "http://www.et-view.com/download/linux-${PV}.tar.gz \ + file://defconfig \ + file://fix-proc-cputype.patch \ + file://disable_early_fb.patch \ + file://iosched-slice_idle-1.patch \ + file://add-dmx-source-timecode.patch \ + file://rtl8712-release-firmware-fix.patch \ + file://dvb-usb-af9035.patch \ + file://tda18218-7mhz-lopass.patch \ + file://dvb-usb-a867.patch \ + file://dvb-usb-rtl2832.patch \ + file://cxd2820r-enable-LNA-for-DVB-T.patch \ + file://cxd2820r-changed-condition-to-break-out-from-wait-lock-loop.patch \ + file://cxd2820r-output-full-range-SNR.patch \ + file://cinergy_s2_usb_r2.patch \ + file://as102-backports-from-kernel-3.4.patch \ + file://as102-scale-MER-to-full-range.patch \ + file://as102-adjust-signal-strength-report.patch \ + file://em28xx-pre-allocate-DVB-isoc-transfer-buffers.patch \ + file://em28xx-dvb-stop-URBs-when-stopping-the-streaming.patch \ + file://af9015-output-full-range-SNR.patch \ + file://it913x-backports-from-kernel-3.4.patch \ + file://it913x-backports-from-kernel-3.5.patch \ + file://it913x-switch-off-PID-filter-by-default.patch \ + file://tda10071-BUGFIX-delivery-system.patch \ + " + +S = "${WORKDIR}/linux-${PV}" + +inherit kernel + +export OS = "Linux" +KERNEL_OBJECT_SUFFIX = "ko" +KERNEL_OUTPUT = "vmlinux" +KERNEL_IMAGETYPE = "vmlinux" +KERNEL_IMAGEDEST = "/tmp" + +FILES_kernel-image = "${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}*" + +do_configure_prepend() { + oe_machinstall -m 0644 ${WORKDIR}/defconfig ${S}/.config + oe_runmake oldconfig +} + +kernel_do_install_append() { + install -d ${D}${KERNEL_IMAGEDEST} + install -m 0755 ${KERNEL_OUTPUT} ${D}${KERNEL_IMAGEDEST} + gzip ${D}${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} +} + +pkg_postinst_kernel-image () { + if [ "x$D" == "x" ]; then + if [ -f /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}.gz ] ; then + flash_eraseall /dev/mtd1 + nandwrite -p /dev/mtd1 /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}.gz + rm -f /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}.gz + fi + fi + true +} diff --git a/meta-openpli/recipes-linux/linux/linux.inc b/meta-openpli/recipes-linux/linux/linux.inc new file mode 100644 index 0000000000..53efe3202c --- /dev/null +++ b/meta-openpli/recipes-linux/linux/linux.inc @@ -0,0 +1,263 @@ +SUMMARY = "Linux Kernel" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +inherit kernel siteinfo + +RPSRC = "http://www.rpsys.net/openzaurus/patches/archive" + +# Enable OABI compat for people stuck with obsolete userspace +ARM_KEEP_OABI ?= "1" + +# Quirk for udev greater or equal 141 +UDEV_GE_141 ?= "0" + +# Specify the commandline for your device + +# Boot from mmc +CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfstype=ext2 rootdelay=5" +# Boot from nfs +#CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=301 root=/dev/nfs nfsroot=172.20.3.1:/data/at91 ip=172.20.0.5:::255.255.0.0" + +# Set the verbosity of kernel messages during runtime +# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour +CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug", d)}' +CMDLINE_append = " ${CMDLINE_DEBUG} " + +# Kernel bootlogo is distro-specific (default is OE logo). +# Logo resolution (qvga, vga, ...) is machine-specific. +LOGO_SIZE ?= "." + +# Support for binary device tree generation + +FILES_kernel-devicetree = "/boot/devicetree*" + +KERNEL_DEVICETREE_boc01 = "${WORKDIR}/boc01.dts" +KERNEL_DEVICETREE_calamari = "arch/${ARCH}/boot/dts/mpc8536ds.dts" +KERNEL_DEVICETREE_canyonlands = "arch/${ARCH}/boot/dts/canyonlands.dts" +KERNEL_DEVICETREE_kilauea = "arch/${ARCH}/boot/dts/kilauea.dts" +KERNEL_DEVICETREE_lite5200 = "arch/${ARCH}/boot/dts/lite5200.dts" +KERNEL_DEVICETREE_lsppchd = "arch/${ARCH}/boot/dts/kuroboxHD.dts" +KERNEL_DEVICETREE_lsppchg = "arch/${ARCH}/boot/dts/kuroboxHG.dts" +KERNEL_DEVICETREE_mpc8313e-rdb = "arch/${ARCH}/boot/dts/mpc8313erdb.dts" +KERNEL_DEVICETREE_mpc8315e-rdb = "arch/${ARCH}/boot/dts/mpc8315erdb.dts" +KERNEL_DEVICETREE_mpc8323e-rdb = "arch/${ARCH}/boot/dts/mpc832x_rdb.dts" +KERNEL_DEVICETREE_mpc8544ds = "arch/${ARCH}/boot/dts/mpc8544ds.dts" +KERNEL_DEVICETREE_mpc8641-hpcn = "arch/${ARCH}/boot/dts/mpc8641_hpcn.dts" +KERNEL_DEVICETREE_p1020rdb = "arch/${ARCH}/boot/dts/p1020rdb.dts" +KERNEL_DEVICETREE_p2020rdb = "arch/${ARCH}/boot/dts/p2020rdb.dts" +KERNEL_DEVICETREE_p2020ds = "arch/${ARCH}/boot/dts/p2020ds.dts" +KERNEL_DEVICETREE_sequoia = "arch/${ARCH}/boot/dts/sequoia.dts" +KERNEL_DEVICETREE_tqm8540 = "arch/${ARCH}/boot/dts/tqm8540.dts" +KERNEL_DEVICETREE_xilinx-ml507 = "arch/${ARCH}/boot/dts/virtex440-ml507.dts" + +KERNEL_DEVICETREE_FLAGS = "-R 8 -S 0x3000" + +CORTEXA8FIXUP ?= "yes" +LOCALVERSION ?= "" + +python __anonymous () { + devicetree = d.getVar('KERNEL_DEVICETREE', True) or '' + machine = d.getVar('MACHINE', True) + if devicetree: + depends = d.getVar("DEPENDS", True) + d.setVar("DEPENDS", "%s dtc-native" % depends) + packages = d.getVar("PACKAGES", True) + d.setVar("PACKAGES", "%s kernel-devicetree" % packages) + if 'nokia900' in machine or 'om-gta0' in machine or 'eee701' in machine: + depends = d.getVar("DEPENDS", True) + d.setVar("DEPENDS", "%s lzma-native" % depends) +} + +do_configure_prepend() { + + # Rename getline in ./scripts/unifdef.c + # Kernels up to 2.6.29 are currently failing to build unifdef.c, + # clashing with exposed getline() from + # see https://patchwork.kernel.org/patch/11166/ + # committed in 2.6.29 (commit d15bd1067b1fcb2b7250d22bc0c7c7fea0b759f7) + + if [ -e ${S}/scripts/unifdef.c ]; then + sed -i -e 's/getline/parseline/g' ${S}/scripts/unifdef.c + fi + + + echo "" > ${S}/.config + + # + # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used + # + if [ -e ${WORKDIR}/${LOGO_SIZE}/logo_linux_clut224.ppm ]; then + install -m 0644 ${WORKDIR}/${LOGO_SIZE}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm + echo "CONFIG_LOGO=y" >> ${S}/.config + echo "CONFIG_LOGO_LINUX_CLUT224=y" >> ${S}/.config + fi + + # + # oabi / eabi support + # + if [ "${TARGET_OS}" = "linux-gnueabi" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then + echo "CONFIG_AEABI=y" >> ${S}/.config + if [ "${ARM_KEEP_OABI}" = "1" ] ; then + echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config + else + echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config + fi + else + echo "# CONFIG_AEABI is not set" >> ${S}/.config + echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config + fi + + # When enabling thumb for userspace we also need thumb support in the kernel + if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then + sed -i -e /CONFIG_ARM_THUMB/d ${WORKDIR}/defconfig + echo "CONFIG_ARM_THUMB=y" >> ${S}/.config + fi + + # Enable thumb2 fixup for specific issue in angstrom toolchains when used on A8 r1p[012] silicon + if [ "${DISTRO_NAME}" = "Angstrom" -a "${CORTEXA8FIXUP}" = "yes" ] ; then + sed -i -e /CONFIG_ARM_ERRATA_430973/d ${WORKDIR}/defconfig + echo "CONFIG_ARM_ERRATA_430973=y" >> ${S}/.config + fi + + # + # endian support + # + if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then + echo "CONFIG_CPU_BIG_ENDIAN=y" >> ${S}/.config + fi + + echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config + + sed -e '/CONFIG_AEABI/d' \ + -e '/CONFIG_OABI_COMPAT=/d' \ + -e '/CONFIG_CMDLINE=/d' \ + -e '/CONFIG_CPU_BIG_ENDIAN/d' \ + -e '/CONFIG_LOGO=/d' \ + -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \ + -e '/CONFIG_LOCALVERSION/d' \ + -e '/CONFIG_LOCALVERSION_AUTO/d' \ + < '${WORKDIR}/defconfig' >>'${S}/.config' + + echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >>${S}/.config + echo '# CONFIG_LOCALVERSION_AUTO is not set' >>${S}/.config + + # + # Udev quirks + # + + # Newer versions of udev mandate that sysfs doesn't have deprecated entries + if [ "${UDEV_GE_141}" = "1" ] ; then + sed -e /CONFIG_SYSFS_DEPRECATED/d \ + -e /CONFIG_SYSFS_DEPRECATED_V2/d \ + -e /CONFIG_HOTPLUG/d \ + -e /CONFIG_UEVENT_HELPER_PATH/d \ + -e /CONFIG_UNIX/d \ + -e /CONFIG_SYSFS/d \ + -e /CONFIG_PROC_FS/d \ + -e /CONFIG_TMPFS/d \ + -e /CONFIG_INOTIFY_USER/d \ + -e /CONFIG_SIGNALFD/d \ + -e /CONFIG_TMPFS_POSIX_ACL/d \ + -e /CONFIG_BLK_DEV_BSG/d \ + -i '${S}/.config' + + echo '# CONFIG_SYSFS_DEPRECATED is not set' >> ${S}/.config + echo '# CONFIG_SYSFS_DEPRECATED_V2 is not set' >> ${S}/.config + echo 'CONFIG_HOTPLUG=y' >> ${S}/.config + echo 'CONFIG_UEVENT_HELPER_PATH=""' >> ${S}/.config + echo 'CONFIG_UNIX=y' >> ${S}/.config + echo 'CONFIG_SYSFS=y' >> ${S}/.config + echo 'CONFIG_PROC_FS=y' >> ${S}/.config + echo 'CONFIG_TMPFS=y' >> ${S}/.config + echo 'CONFIG_INOTIFY_USER=y' >> ${S}/.config + echo 'CONFIG_SIGNALFD=y' >> ${S}/.config + echo 'CONFIG_TMPFS_POSIX_ACL=y' >> ${S}/.config + echo 'CONFIG_BLK_DEV_BSG=y' >> ${S}/.config + echo 'CONFIG_DEVTMPFS=y' >> ${S}/.config + echo 'CONFIG_DEVTMPFS_MOUNT=y' >> ${S}/.config + fi + + # Newer inits like systemd need cgroup support + if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then + sed -e /CONFIG_CGROUP_SCHED/d \ + -e /CONFIG_CGROUPS/d \ + -i '${S}/.config' + + echo 'CONFIG_CGROUP_SCHED=y' >> ${S}/.config + echo 'CONFIG_CGROUPS=y' >> ${S}/.config + echo 'CONFIG_CGROUP_NS=y' >> ${S}/.config + echo 'CONFIG_CGROUP_FREEZER=y' >> ${S}/.config + echo 'CONFIG_CGROUP_DEVICE=y' >> ${S}/.config + echo 'CONFIG_CPUSETS=y' >> ${S}/.config + echo 'CONFIG_PROC_PID_CPUSET=y' >> ${S}/.config + echo 'CONFIG_CGROUP_CPUACCT=y' >> ${S}/.config + echo 'CONFIG_RESOURCE_COUNTERS=y' >> ${S}/.config + fi + + # + # root-over-nfs-over-usb-eth support. Limited, but should cover some cases. + # Enable this by setting a proper CMDLINE_NFSROOT_USB. + # + if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then + oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}" + sed -e '/CONFIG_INET/d' \ + -e '/CONFIG_IP_PNP=/d' \ + -e '/CONFIG_USB_GADGET=/d' \ + -e '/CONFIG_USB_GADGET_SELECTED=/d' \ + -e '/CONFIG_USB_ETH=/d' \ + -e '/CONFIG_NFS_FS=/d' \ + -e '/CONFIG_ROOT_NFS=/d' \ + -e '/CONFIG_CMDLINE=/d' \ + -i ${S}/.config + echo "CONFIG_INET=y" >> ${S}/.config + echo "CONFIG_IP_PNP=y" >> ${S}/.config + echo "CONFIG_USB_GADGET=y" >> ${S}/.config + echo "CONFIG_USB_GADGET_SELECTED=y" >> ${S}/.config + echo "CONFIG_USB_ETH=y" >> ${S}/.config + echo "CONFIG_NFS_FS=y" >> ${S}/.config + echo "CONFIG_ROOT_NFS=y" >> ${S}/.config + echo "CONFIG_CMDLINE=\"${CMDLINE_NFSROOT_USB}\"" >> ${S}/.config + fi + yes '' | oe_runmake oldconfig +} + +do_configure_append() { + if test -e scripts/Makefile.fwinst ; then + sed -i -e "s:-m0644:-m 0644:g" scripts/Makefile.fwinst + fi +} + +do_install_append() { + oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}/src/linux-${KERNEL_VERSION} ARCH=$ARCH +} + +PACKAGES =+ "kernel-headers" +FILES_kernel-headers = "${exec_prefix}/src/linux*" + +do_devicetree_image() { + if test -n "${KERNEL_DEVICETREE}" ; then + dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE} + install -d ${D}/boot + install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb + package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb + cd ${DEPLOY_DIR_IMAGE} + rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb + ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb + package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_SYMLINK_NAME}.dtb + fi +} + +addtask devicetree_image after do_install before do_package do_deploy + +pkg_postinst_kernel-devicetree () { + cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/devicetree devicetree devicetree-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true +} + +pkg_postrm_kernel-devicetree () { + cd /${KERNEL_IMAGEDEST}; update-alternatives --remove devicetree devicetree-${KERNEL_VERSION} || true +} + diff --git a/meta-openpli/recipes-multimedia/aio-grab/aio-grab.bb b/meta-openpli/recipes-multimedia/aio-grab/aio-grab.bb new file mode 100644 index 0000000000..fc64cc1ac5 --- /dev/null +++ b/meta-openpli/recipes-multimedia/aio-grab/aio-grab.bb @@ -0,0 +1,18 @@ +DESCRIPTION="AiO screenshot grabber" +MAINTAINER = "PLi team" +LICENSE = "GPL" +LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" + +DEPENDS = "jpeg libpng zlib" + +inherit gitpkgv + +PV = "1.0+git${SRCPV}" +PKGV = "1.0+git${GITPKGV}" +PR = "r1" + +SRC_URI = "git://openpli.git.sourceforge.net/gitroot/openpli/aio-grab;protocol=git" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/Makefile.in.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/Makefile.in.patch new file mode 100644 index 0000000000..40cf4ad516 --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/Makefile.in.patch @@ -0,0 +1,13 @@ +--- cdparanoia-III-10.2/Makefile.in.orig 2009-01-27 23:32:15.000000000 +0100 ++++ cdparanoia-III-10.2/Makefile.in 2009-01-27 23:32:53.000000000 +0100 +@@ -87,8 +87,9 @@ + $(LIBDIR)/libcdda_paranoia.so + + cdparanoia: $(OFILES) $(LIBDEP) +- $(LD) $(CFLAGS) $(LDFLAGS) $(OFILES) \ ++ $(LD) $(CFLAGS) \ + -L$(PWD)/paranoia -L$(PWD)/interface \ ++ $(LDFLAGS) $(OFILES) \ + -o cdparanoia $(LIBS) + + .c.o: diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/cdparanoia-III-10.2-privatefix.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/cdparanoia-III-10.2-privatefix.patch new file mode 100644 index 0000000000..55f39b26da --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/cdparanoia-III-10.2-privatefix.patch @@ -0,0 +1,561 @@ +diff -ru cdparanoia-III-10.2/interface/cdda_interface.h cdparanoia-III-10.2-mod/interface/cdda_interface.h +--- cdparanoia-III-10.2/interface/cdda_interface.h 2008-09-11 11:43:52.000000000 +0100 ++++ cdparanoia-III-10.2-mod/interface/cdda_interface.h 2009-09-08 16:08:37.000000000 +0100 +@@ -84,7 +84,7 @@ + int is_atapi; + int is_mmc; + +- cdda_private_data_t *private; ++ cdda_private_data_t *impl; + void *reserved; + unsigned char inqbytes[4]; + +diff -ru cdparanoia-III-10.2/interface/cooked_interface.c cdparanoia-III-10.2-mod/interface/cooked_interface.c +--- cdparanoia-III-10.2/interface/cooked_interface.c 2008-08-26 10:55:22.000000000 +0100 ++++ cdparanoia-III-10.2-mod/interface/cooked_interface.c 2009-09-08 16:09:35.000000000 +0100 +@@ -13,13 +13,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->impl->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->impl->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->impl->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->impl->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +diff -ru cdparanoia-III-10.2/interface/interface.c cdparanoia-III-10.2-mod/interface/interface.c +--- cdparanoia-III-10.2/interface/interface.c 2008-09-11 11:43:52.000000000 +0100 ++++ cdparanoia-III-10.2-mod/interface/interface.c 2009-09-08 16:09:50.000000000 +0100 +@@ -39,9 +39,9 @@ + if(d->drive_model)free(d->drive_model); + if(d->cdda_fd!=-1)close(d->cdda_fd); + if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->impl){ ++ if(d->impl->sg_hd)free(d->impl->sg_hd); ++ free(d->impl); + } + + free(d); +@@ -127,7 +127,7 @@ + } + } + } +- if(ms)*ms=d->private->last_milliseconds; ++ if(ms)*ms=d->impl->last_milliseconds; + return(sectors); + } + +diff -ru cdparanoia-III-10.2/interface/scan_devices.c cdparanoia-III-10.2-mod/interface/scan_devices.c +--- cdparanoia-III-10.2/interface/scan_devices.c 2008-08-26 10:55:22.000000000 +0100 ++++ cdparanoia-III-10.2-mod/interface/scan_devices.c 2009-09-08 16:09:17.000000000 +0100 +@@ -264,11 +264,11 @@ + d->interface=COOKED_IOCTL; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->impl=calloc(1,sizeof(*d->impl)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->impl->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); + return(d); +@@ -674,15 +674,15 @@ + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; + d->messagedest = messagedest; +- d->private=calloc(1,sizeof(*d->private)); ++ d->impl=calloc(1,sizeof(*d->impl)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->impl->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + if(use_sgio){ + d->interface=SGIO_SCSI; +- d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); ++ d->impl->sg_buffer=(unsigned char *)(d->impl->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); + g_fd=d->cdda_fd=dup(d->ioctl_fd); + }else{ + version=verify_SG_version(d,messagedest,messages); +@@ -696,8 +696,8 @@ + } + + /* malloc our big buffer for scsi commands */ +- d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->impl->sg_hd=malloc(MAX_BIG_BUFF_SIZE); ++ d->impl->sg_buffer=((unsigned char *)d->impl->sg_hd)+SG_OFF; + } + + { +@@ -772,9 +772,9 @@ + if(i_fd!=-1)close(i_fd); + if(g_fd!=-1)close(g_fd); + if(d){ +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->impl){ ++ if(d->impl->sg_hd)free(d->impl->sg_hd); ++ free(d->impl); + } + free(d); + } +@@ -821,7 +821,7 @@ + d->interface=TEST_INTERFACE; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->impl=calloc(1,sizeof(*d->impl)); + d->drive_model=copystring("File based test interface"); + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model); + +diff -ru cdparanoia-III-10.2/interface/scsi_interface.c cdparanoia-III-10.2-mod/interface/scsi_interface.c +--- cdparanoia-III-10.2/interface/scsi_interface.c 2008-09-11 21:33:30.000000000 +0100 ++++ cdparanoia-III-10.2-mod/interface/scsi_interface.c 2009-09-08 16:10:30.000000000 +0100 +@@ -15,13 +15,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->impl->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->impl->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->impl->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->impl->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +@@ -96,7 +96,7 @@ + static void clear_garbage(cdrom_drive *d){ + fd_set fdset; + struct timeval tv; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->impl->sg_hd; + int flag=0; + + /* clear out any possibly preexisting garbage */ +@@ -185,7 +185,7 @@ + struct timespec tv2; + int tret1,tret2; + int status = 0; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->impl->sg_hd; + long writebytes=SG_OFF+cmd_len+in_size; + + /* generic scsi device services */ +@@ -195,7 +195,7 @@ + + memset(sg_hd,0,sizeof(sg_hd)); + memset(sense_buffer,0,SG_MAX_SENSE); +- memcpy(d->private->sg_buffer,cmd,cmd_len+in_size); ++ memcpy(d->impl->sg_buffer,cmd,cmd_len+in_size); + sg_hd->twelve_byte = cmd_len == 12; + sg_hd->result = 0; + sg_hd->reply_len = SG_OFF + out_size; +@@ -209,7 +209,7 @@ + tell if the command failed. Scared yet? */ + + if(bytecheck && out_size>in_size){ +- memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); ++ memset(d->impl->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); + /* the size does not remove cmd_len due to the way the kernel + driver copies buffers */ + writebytes+=(out_size-in_size); +@@ -243,7 +243,7 @@ + } + + sigprocmask (SIG_BLOCK, &(d->sigset), NULL ); +- tret1=clock_gettime(d->private->clock,&tv1); ++ tret1=clock_gettime(d->impl->clock,&tv1); + errno=0; + status = write(d->cdda_fd, sg_hd, writebytes ); + +@@ -289,7 +289,7 @@ + } + } + +- tret2=clock_gettime(d->private->clock,&tv2); ++ tret2=clock_gettime(d->impl->clock,&tv2); + errno=0; + status = read(d->cdda_fd, sg_hd, SG_OFF + out_size); + sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL ); +@@ -313,7 +313,7 @@ + if(bytecheck && in_size+cmd_lenprivate->sg_buffer[i]!=bytefill){ ++ if(d->impl->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -326,9 +326,9 @@ + + errno=0; + if(tret1<0 || tret2<0){ +- d->private->last_milliseconds=-1; ++ d->impl->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; ++ d->impl->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; + } + return(0); + } +@@ -347,7 +347,7 @@ + + memset(&hdr,0,sizeof(hdr)); + memset(sense,0,sizeof(sense)); +- memcpy(d->private->sg_buffer,cmd+cmd_len,in_size); ++ memcpy(d->impl->sg_buffer,cmd+cmd_len,in_size); + + hdr.cmdp = cmd; + hdr.cmd_len = cmd_len; +@@ -355,7 +355,7 @@ + hdr.mx_sb_len = SG_MAX_SENSE; + hdr.timeout = 50000; + hdr.interface_id = 'S'; +- hdr.dxferp = d->private->sg_buffer; ++ hdr.dxferp = d->impl->sg_buffer; + hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ + + /* scary buffer fill hack */ +@@ -400,7 +400,7 @@ + if(bytecheck && in_sizeprivate->sg_buffer[i]!=bytefill){ ++ if(d->impl->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -412,7 +412,7 @@ + } + + /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */ +- /* d->private->last_milliseconds = hdr.duration; */ ++ /* d->impl->last_milliseconds = hdr.duration; */ + + errno = 0; + return 0; +@@ -445,9 +445,9 @@ + + handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense); + +- key = d->private->sg_buffer[2] & 0xf; +- ASC = d->private->sg_buffer[12]; +- ASCQ = d->private->sg_buffer[13]; ++ key = d->impl->sg_buffer[2] & 0xf; ++ ASC = d->impl->sg_buffer[12]; ++ ASCQ = d->impl->sg_buffer[13]; + + if(key == 2 && ASC == 4 && ASCQ == 1) return 0; + return 1; +@@ -492,7 +492,7 @@ + if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1); + + { +- unsigned char *b=d->private->sg_buffer; ++ unsigned char *b=d->impl->sg_buffer; + if(b[0])return(1); /* Handles only up to 256 bytes */ + if(b[6])return(1); /* Handles only up to 256 bytes */ + +@@ -604,8 +604,8 @@ + static unsigned int get_orig_sectorsize(cdrom_drive *d){ + if(mode_sense(d,12,0x01))return(-1); + +- d->orgdens = d->private->sg_buffer[4]; +- return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]); ++ d->orgdens = d->impl->sg_buffer[4]; ++ return(d->orgsize = ((int)(d->impl->sg_buffer[10])<<8)+d->impl->sg_buffer[11]); + } + + /* switch CDROM scsi drives to given sector size */ +@@ -664,8 +664,8 @@ + return(-4); + } + +- first=d->private->sg_buffer[2]; +- last=d->private->sg_buffer[3]; ++ first=d->impl->sg_buffer[2]; ++ last=d->impl->sg_buffer[3]; + tracks=last-first+1; + + if (last > MAXTRK || first > MAXTRK || last<0 || first<0) { +@@ -683,7 +683,7 @@ + return(-5); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->impl->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=i; +@@ -704,7 +704,7 @@ + return(-2); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->impl->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=0xAA; +@@ -738,7 +738,7 @@ + } + + /* copy to our structure and convert start sector */ +- tracks = d->private->sg_buffer[1]; ++ tracks = d->impl->sg_buffer[1]; + if (tracks > MAXTRK) { + cderror(d,"003: CDROM reporting illegal number of tracks\n"); + return(-3); +@@ -754,33 +754,33 @@ + return(-5); + } + +- d->disc_toc[i].bFlags = d->private->sg_buffer[10]; ++ d->disc_toc[i].bFlags = d->impl->sg_buffer[10]; + d->disc_toc[i].bTrack = i + 1; + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- (((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5])); ++ (((signed char)(d->impl->sg_buffer[2])<<24) | ++ (d->impl->sg_buffer[3]<<16)| ++ (d->impl->sg_buffer[4]<<8)| ++ (d->impl->sg_buffer[5])); + } + + d->disc_toc[i].bFlags = 0; + d->disc_toc[i].bTrack = i + 1; +- memcpy (&foo, d->private->sg_buffer+2, 4); +- memcpy (&bar, d->private->sg_buffer+6, 4); ++ memcpy (&foo, d->impl->sg_buffer+2, 4); ++ memcpy (&bar, d->impl->sg_buffer+6, 4); + d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) + + be32_to_cpu(bar)); + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- ((((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5]))+ ++ ((((signed char)(d->impl->sg_buffer[2])<<24) | ++ (d->impl->sg_buffer[3]<<16)| ++ (d->impl->sg_buffer[4]<<8)| ++ (d->impl->sg_buffer[5]))+ + +- ((((signed char)(d->private->sg_buffer[6])<<24) | +- (d->private->sg_buffer[7]<<16)| +- (d->private->sg_buffer[8]<<8)| +- (d->private->sg_buffer[9])))); ++ ((((signed char)(d->impl->sg_buffer[6])<<24) | ++ (d->impl->sg_buffer[7]<<16)| ++ (d->impl->sg_buffer[8]<<8)| ++ (d->impl->sg_buffer[9])))); + + + d->cd_extra = FixupTOC(d,tracks+1); +@@ -817,7 +817,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -836,7 +836,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -854,7 +854,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -872,7 +872,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -890,7 +890,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -908,7 +908,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -922,7 +922,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -936,7 +936,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -950,7 +950,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -964,7 +964,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -978,7 +978,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -992,7 +992,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1026,7 +1026,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1039,7 +1039,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1052,7 +1052,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->impl->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1275,7 +1275,7 @@ + static int count_2352_bytes(cdrom_drive *d){ + long i; + for(i=2351;i>=0;i--) +- if(d->private->sg_buffer[i]!=(unsigned char)'\177') ++ if(d->impl->sg_buffer[i]!=(unsigned char)'\177') + return(((i+3)>>2)<<2); + + return(0); +@@ -1284,7 +1284,7 @@ + static int verify_nonzero(cdrom_drive *d){ + long i,flag=0; + for(i=0;i<2352;i++) +- if(d->private->sg_buffer[i]!=0){ ++ if(d->impl->sg_buffer[i]!=0){ + flag=1; + break; + } +@@ -1625,7 +1625,7 @@ + d->is_mmc=0; + if(mode_sense(d,22,0x2A)==0){ + +- b=d->private->sg_buffer; ++ b=d->impl->sg_buffer; + b+=b[3]+4; + + if((b[0]&0x3F)==0x2A){ +@@ -1673,7 +1673,7 @@ + cderror(d,"008: Unable to identify CDROM model\n"); + return(NULL); + } +- return (d->private->sg_buffer); ++ return (d->impl->sg_buffer); + } + + int scsi_init_drive(cdrom_drive *d){ +@@ -1742,8 +1742,8 @@ + check_cache(d); + + d->error_retry=1; +- d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->impl->sg_hd=realloc(d->impl->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); ++ d->impl->sg_buffer=((unsigned char *)d->impl->sg_hd)+SG_OFF; + d->report_all=1; + return(0); + } diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/configure.in.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/configure.in.patch new file mode 100644 index 0000000000..2ca251613f --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/configure.in.patch @@ -0,0 +1,13 @@ +--- cdparanoia-III-10.2.old/configure.in 2009-12-02 22:44:37.000000000 +0100 ++++ cdparanoia-III-10.2/configure.in 2009-12-02 22:45:04.000000000 +0100 +@@ -5,9 +5,7 @@ + + AC_CANONICAL_HOST + +-if test -z "$CC"; then +- AC_PROG_CC +-fi ++AC_PROG_CC + AC_PROG_RANLIB + AC_CHECK_PROG(AR,ar,ar) + AC_CHECK_PROG(INSTALL,install,install) diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/fixes10.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/fixes10.patch new file mode 100644 index 0000000000..414ff3944d --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/fixes10.patch @@ -0,0 +1,25 @@ +--- cdparanoia-III-alpha9.8/configure.in 2000-03-26 00:33:22.000000000 -0700 ++++ cdparanoia-III-alpha9.8.new/configure.in 2004-12-23 16:34:04.072846728 -0700 +@@ -1,7 +1,7 @@ + AC_INIT(interface/interface.c) + +-cp $srcdir/configure.guess $srcdir/config.guess +-cp $srcdir/configure.sub $srcdir/config.sub ++#cp $srcdir/configure.guess $srcdir/config.guess ++#cp $srcdir/configure.sub $srcdir/config.sub + + AC_CANONICAL_HOST + +--- cdparanoia-III-alpha9.8/interface/scan_devices.c 2001-03-25 22:44:01.000000000 -0700 ++++ cdparanoia-III-alpha9.8.new/interface/scan_devices.c 2004-12-23 16:38:47.128815680 -0700 +@@ -19,6 +19,10 @@ + #include "common_interface.h" + #include "utils.h" + ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ + #define MAX_DEV_LEN 20 /* Safe because strings only come from below */ + /* must be absolute paths! */ + static char *scsi_cdrom_prefixes[]={ diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/interface_Makefile.in.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/interface_Makefile.in.patch new file mode 100644 index 0000000000..4dbd2bb19a --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/interface_Makefile.in.patch @@ -0,0 +1,11 @@ +--- cdparanoia-III-10.2/interface/Makefile.in.orig 2009-01-27 23:52:42.000000000 +0100 ++++ cdparanoia-III-10.2/interface/Makefile.in 2009-01-27 23:53:27.000000000 +0100 +@@ -46,7 +46,7 @@ + $(RANLIB) libcdda_interface.a + + libcdda_interface.so: $(OFILES) +- $(CC) -fpic -shared -o libcdda_interface.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_interface.so.0 $(OFILES) $(LIBS) ++ $(CC) -fpic -shared -o libcdda_interface.so.0.$(VERSION) $(LDFLAGS) -Wl,-soname -Wl,libcdda_interface.so.0 $(OFILES) $(LIBS) + [ -e libcdda_interface.so.0 ] || ln -s libcdda_interface.so.0.$(VERSION) libcdda_interface.so.0 + [ -e libcdda_interface.so ] || ln -s libcdda_interface.so.0.$(VERSION) libcdda_interface.so + diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/paranoia_Makefile.in.patch b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/paranoia_Makefile.in.patch new file mode 100644 index 0000000000..962a43a634 --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia/paranoia_Makefile.in.patch @@ -0,0 +1,11 @@ +--- cdparanoia-III-10.2/paranoia/Makefile.in.orig 2009-01-27 23:54:45.000000000 +0100 ++++ cdparanoia-III-10.2/paranoia/Makefile.in 2009-01-27 23:55:05.000000000 +0100 +@@ -44,7 +44,7 @@ + $(RANLIB) libcdda_paranoia.a + + libcdda_paranoia.so: $(OFILES) +- $(CC) -fpic -shared -o libcdda_paranoia.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_paranoia.so.0 $(OFILES) -L ../interface -lcdda_interface ++ $(CC) -fpic -shared -o libcdda_paranoia.so.0.$(VERSION) $(LDFLAGS) -Wl,-soname -Wl,libcdda_paranoia.so.0 $(OFILES) -L ../interface -lcdda_interface + [ -e libcdda_paranoia.so.0 ] || ln -s libcdda_paranoia.so.0.$(VERSION) libcdda_paranoia.so.0 + [ -e libcdda_paranoia.so ] || ln -s libcdda_paranoia.so.0.$(VERSION) libcdda_paranoia.so + diff --git a/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia_svn.bb b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia_svn.bb new file mode 100644 index 0000000000..b88c74ba4c --- /dev/null +++ b/meta-openpli/recipes-multimedia/cdparanoia/cdparanoia_svn.bb @@ -0,0 +1,43 @@ +# Copyright (C) 2005, Advanced Micro Devices, Inc. All Rights Reserved +SUMMARY = "audio extraction tool for sampling CDs" +HOMEPAGE = "http://xiph.org/paranoia/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING-GPL;md5=1ed9d357695b2e3ef099df37fed63d96 \ + file://COPYING-LGPL;md5=d370feaa1c9edcdbd29ca27ea3d2304d" +SECTION = "multimedia" +SRCREV = "17289" +PV = "10.2+svnr${SRCPV}" +PR = "r1" + +SRC_URI = "svn://svn.xiph.org/trunk;module=cdparanoia;proto=http \ + file://fixes10.patch \ + file://Makefile.in.patch \ + file://interface_Makefile.in.patch \ + file://paranoia_Makefile.in.patch \ + file://configure.in.patch" + +S = "${WORKDIR}/cdparanoia" + +PARALLEL_MAKE = "" + +inherit autotools pkgconfig + +PACKAGES += "libcdparanoia libcdparanoia-dev libcdparanoia-static" + +LICENSE_libcdparanoia = "LGPLv2.1" +LICENSE_libcdparanoia-dev = "LGPLv2.1" +LICENSE_libcdparanoia-static = "LGPLv2.1" + +FILES_${PN} = "${bindir}/*" +FILES_${PN}-dev = "" +FILES_${PN}-static = "" +FILES_libcdparanoia = "${libdir}/lib*${SOLIBS}" +FILES_libcdparanoia-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/pkgconfig" +FILES_libcdparanoia-static = "${libdir}/*.a" + +do_install() { + oe_runmake BINDIR="${D}${bindir}" MANDIR="${D}${datadir}/man/" \ + INCLUDEDIR="${D}${includedir}" LIBDIR="${D}${libdir}" \ + PKGCONFIGDIR="${D}${libdir}/pkgconfig" \ + install +} diff --git a/meta-openpli/recipes-multimedia/dvbsnoop/dvbsnoop.bb b/meta-openpli/recipes-multimedia/dvbsnoop/dvbsnoop.bb new file mode 100644 index 0000000000..1a85bc8ecb --- /dev/null +++ b/meta-openpli/recipes-multimedia/dvbsnoop/dvbsnoop.bb @@ -0,0 +1,13 @@ +SUMMARY = "DVB / MPEG stream analyzer" +AUTHOR = "Rainer Scherg " +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +SRCDATE = "20081001" +PV = "0.0+cvs${SRCDATE}" +PR = "r1" + +SRC_URI = "cvs://anoncvs@cvs.tuxbox.org/cvs/tuxbox;module=apps/dvb/dvbsnoop;method=ext" + +S = "${WORKDIR}/dvbsnoop" + +inherit autotools diff --git a/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-tip.diff b/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-tip.diff new file mode 100644 index 0000000000..b91a7506d7 --- /dev/null +++ b/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-tip.diff @@ -0,0 +1,37589 @@ +Update to: + +changeset 1406:c87abbb20491 tip + +update scan file for fr-Reims +submitted by sylvestre.cartier gmail.com +author Christoph Pfister +date Sun Nov 28 21:24:42 2010 +0100 (3 weeks ago) +parents ce1c094b9636 + + +Make.rules | 2 + README | 7 + a/util/scan/dvb-t/be-Brussels | 5 + a/util/scan/dvb-t/be-Libramont | 10 + a/util/scan/dvb-t/be-Schoten | 3 + a/util/scan/dvb-t/be-St_Pieters_Leeuw | 3 + a/util/scan/dvb-t/be-Tournai | 3 + a/util/scan/dvb-t/cz-Brno | 10 + a/util/scan/dvb-t/cz-Domazlice | 3 + a/util/scan/dvb-t/cz-Klet | 4 + a/util/scan/dvb-t/cz-Ostrava | 3 + a/util/scan/dvb-t/cz-Plzen | 8 + a/util/scan/dvb-t/cz-Praha | 7 + a/util/scan/dvb-t/fr-Lille | 30 + a/util/scan/dvb-t/fr-LilleT2 | 13 + a/util/scan/dvb-t/hr-Zagreb | 3 + b/util/alevt/COPYRIGHT | 297 + + b/util/alevt/ChangeLog | 535 ++ + b/util/alevt/EXPORT.HOWTO | 84 + b/util/alevt/Makefile | 130 + b/util/alevt/README | 72 + b/util/alevt/README.OLD | 78 + b/util/alevt/ReadmeGR | 28 + b/util/alevt/TODO | 12 + b/util/alevt/alevt-cap.1 | 53 + b/util/alevt/alevt-cap.c | 280 + + b/util/alevt/alevt-date.1 | 41 + b/util/alevt/alevt-date.c | 225 + + b/util/alevt/alevt.1 | 60 + b/util/alevt/alevt.desktop | 9 + b/util/alevt/bdf2xbm.c | 212 + + b/util/alevt/cache.c | 229 + + b/util/alevt/cache.h | 41 + b/util/alevt/dllist.h | 55 + b/util/alevt/exp-gfx.c | 258 + + b/util/alevt/exp-html.c | 299 + + b/util/alevt/exp-txt.c | 226 + + b/util/alevt/export.c | 364 + + b/util/alevt/export.h | 66 + b/util/alevt/fdset.c | 97 + b/util/alevt/fdset.h | 28 + b/util/alevt/font.c | 5 + b/util/alevt/font.h | 19 + b/util/alevt/hamm.c | 229 + + b/util/alevt/hamm.h | 7 + b/util/alevt/help.c | 83 + b/util/alevt/help.h | 8 + b/util/alevt/icon.xbm | 17 + b/util/alevt/lang.c | 393 + + b/util/alevt/lang.h | 28 + b/util/alevt/main.c | 221 + + b/util/alevt/misc.c | 66 + b/util/alevt/misc.h | 32 + b/util/alevt/os.h | 7 + b/util/alevt/search.c | 127 + b/util/alevt/search.h | 16 + b/util/alevt/ui.c | 721 +++ + b/util/alevt/ui.h | 35 + b/util/alevt/vbi.c | 942 ++++ + b/util/alevt/vbi.h | 47 + b/util/alevt/vt.h | 62 + b/util/alevt/vt900.out | 29 + b/util/alevt/vt901.out | 29 + b/util/alevt/vt902.out | 29 + b/util/alevt/vt903.out | 29 + b/util/alevt/vt904.out | 29 + b/util/alevt/vt905.out | 29 + b/util/alevt/vt906.out | 29 + b/util/alevt/vt907.out | 29 + b/util/alevt/vt908.out | 29 + b/util/alevt/vt909.out | 29 + b/util/alevt/vt910.out | 29 + b/util/alevt/vt911.out | 29 + b/util/alevt/vt912.out | 29 + b/util/alevt/vt913.out | 29 + b/util/alevt/vt914.out | 29 + b/util/alevt/vt915.out | 29 + b/util/alevt/vtxt-iso8859-7.bdf | 5768 ++++++++++++++++++++++++++++ + b/util/alevt/vtxt-koi8.bdf | 5906 +++++++++++++++++++++++++++++ + b/util/alevt/vtxt-latin-1.bdf | 5906 +++++++++++++++++++++++++++++ + b/util/alevt/vtxt-latin-2.bdf | 5906 +++++++++++++++++++++++++++++ + b/util/alevt/xio.c | 1156 +++++ + b/util/alevt/xio.h | 80 + b/util/gotox/Makefile | 17 + b/util/gotox/gotox.c | 145 + b/util/scan/dvb-c/at-Kabel-Braunau | 26 + b/util/scan/dvb-c/at-Kabelsignal | 38 + b/util/scan/dvb-c/de-komro-Rosenheim | 30 + b/util/scan/dvb-c/fi-Oulu | 19 + b/util/scan/dvb-c/hu-Digikabel | 21 + b/util/scan/dvb-c/nl-REKAM-CAIW_Gouda | 4 + b/util/scan/dvb-s/Agila2_C-146.0E | 60 + b/util/scan/dvb-s/Apstar6_C-134.0E | 15 + b/util/scan/dvb-s/AsiaSat2_C-100.5E | 51 + b/util/scan/dvb-s/Asiasat4_C-122.2E | 27 + b/util/scan/dvb-s/Astra-23.5E | 66 + b/util/scan/dvb-s/Atlantic-Bird-3-5.0W | 4 + b/util/scan/dvb-s/Chinastar1_C-87.5E | 15 + b/util/scan/dvb-s/Insat2E_C-83.0E | 93 + b/util/scan/dvb-s/Insat3A_C-93.5E | 66 + b/util/scan/dvb-s/Insat4A_C-83.0E | 93 + b/util/scan/dvb-s/Insat4B_C-93.5E | 51 + b/util/scan/dvb-s/Intelsat8_C-166.0E | 39 + b/util/scan/dvb-s/JCSat3A_C-128.0E | 18 + b/util/scan/dvb-s/Measat3_C-91.5E | 54 + b/util/scan/dvb-s/PalapaC2_C-113.0E | 39 + b/util/scan/dvb-s/ST1_C-80.0E | 27 + b/util/scan/dvb-s/Telkom1_C-108.0E | 48 + b/util/scan/dvb-s/Telstar10_C-76.5E | 63 + b/util/scan/dvb-s/Telstar18_C-138.0E | 18 + b/util/scan/dvb-s/Thaicom1A_C-120.0E | 24 + b/util/scan/dvb-s/Thaicom2_C-78.5E | 33 + b/util/scan/dvb-s/Thaicom5_C-78.5E | 69 + b/util/scan/dvb-s/Vinasat1_C-132.0E | 12 + b/util/scan/dvb-t/au-AdelaideFoothills | 12 + b/util/scan/dvb-t/au-Ballarat | 12 + b/util/scan/dvb-t/au-Bendigo | 41 + b/util/scan/dvb-t/au-Devonport | 19 + b/util/scan/dvb-t/au-FraserCoast-Bundaberg | 12 + b/util/scan/dvb-t/au-Goulburn-Rocky_Hill | 19 + b/util/scan/dvb-t/au-Hervey_Bay-Ghost_Hill | 16 + b/util/scan/dvb-t/au-Sutherland | 20 + b/util/scan/dvb-t/be-All | 8 + b/util/scan/dvb-t/ch-Geneva | 16 + b/util/scan/dvb-t/cz-All | 41 + b/util/scan/dvb-t/es-BaixoMinho | 16 + b/util/scan/dvb-t/es-Granada | 8 + b/util/scan/dvb-t/es-Pamplona | 9 + b/util/scan/dvb-t/es-SC_Tenerife | 18 + b/util/scan/dvb-t/es-Vitoria-Gasteiz | 8 + b/util/scan/dvb-t/fi-Smedsbole | 13 + b/util/scan/dvb-t/fr-Lille-Bouvigny | 26 + b/util/scan/dvb-t/fr-Rochefort-sur-mer | 14 + b/util/scan/dvb-t/hr-All | 30 + b/util/scan/dvb-t/hu-Budapest | 8 + b/util/scan/dvb-t/hu-Debrecen | 8 + b/util/scan/dvb-t/hu-Gyor | 8 + b/util/scan/dvb-t/hu-Kabhegy | 8 + b/util/scan/dvb-t/hu-Kekes | 8 + b/util/scan/dvb-t/hu-Kiskoros | 8 + b/util/scan/dvb-t/hu-Nagykanizsa-Ujudvar | 8 + b/util/scan/dvb-t/hu-Pecs | 8 + b/util/scan/dvb-t/hu-Szeged | 8 + b/util/scan/dvb-t/hu-Szentes | 8 + b/util/scan/dvb-t/hu-Tokaj | 8 + b/util/scan/dvb-t/hu-Uzd | 8 + b/util/scan/dvb-t/hu-Vasvar-Hegyhatsal | 8 + b/util/scan/dvb-t/il-All | 5 + b/util/scan/dvb-t/ir-Tehran | 4 + b/util/scan/dvb-t/it-Montevergine | 18 + b/util/scan/dvb-t/lt-All | 39 + b/util/scan/dvb-t/ro-Bucharest | 5 + b/util/scan/dvb-t/si-Ljubljana | 5 + b/util/scan/dvb-t/sk-Bardejov | 11 + b/util/scan/dvb-t/sk-Michalovce | 11 + b/util/scan/dvb-t/sk-Namestovo | 11 + b/util/scan/dvb-t/sk-Poprad | 11 + b/util/scan/dvb-t/sk-RimavskaSobota | 11 + b/util/scan/dvb-t/sk-Trencin | 12 + b/util/scan/dvb-t/sk-VelkyKrtis | 11 + b/util/scan/dvb-t/sk-Zilina | 11 + b/util/scan/dvb-t/vn-Thaibinh | 5 + b/util/szap/util.c | 126 + b/util/szap/util.h | 24 + lib/libdvben50221/en50221_stdcam_llci.c | 19 + lib/libdvbsec/dvbsec_api.c | 17 + test/Makefile | 1 + test/README | 2 + test/test_video.c | 53 + util/Makefile | 1 + util/femon/femon.c | 57 + util/scan/dvb-c/at-KarrerNet | 18 + util/scan/dvb-c/de-Primacom | 5 + util/scan/dvb-c/de-Unitymedia | 17 + util/scan/dvb-c/fi-Turku | 8 + util/scan/dvb-c/se-comhem | 22 + util/scan/dvb-s/AsiaSat3S_C-105.5E | 164 + util/scan/dvb-t/au-Adelaide | 2 + util/scan/dvb-t/au-Brisbane | 2 + util/scan/dvb-t/au-SunshineCoast | 2 + util/scan/dvb-t/ch-All | 1 + util/scan/dvb-t/de-Baden-Wuerttemberg | 23 + util/scan/dvb-t/de-Bayern | 56 + util/scan/dvb-t/de-Berlin | 13 + util/scan/dvb-t/de-Brandenburg | 4 + util/scan/dvb-t/de-Bremen | 8 + util/scan/dvb-t/de-Hamburg | 20 + util/scan/dvb-t/de-Hessen | 26 + util/scan/dvb-t/de-Mecklenburg-Vorpommern | 10 + util/scan/dvb-t/de-Niedersachsen | 33 + util/scan/dvb-t/de-Nordrhein-Westfalen | 16 + util/scan/dvb-t/de-Rheinland-Pfalz | 10 + util/scan/dvb-t/de-Saarland | 6 + util/scan/dvb-t/de-Sachsen | 14 + util/scan/dvb-t/de-Sachsen-Anhalt | 8 + util/scan/dvb-t/de-Schleswig-Holstein | 26 + util/scan/dvb-t/de-Thueringen | 8 + util/scan/dvb-t/dk-All | 16 + util/scan/dvb-t/es-Albacete | 20 + util/scan/dvb-t/es-Alfabia | 3 + util/scan/dvb-t/es-Collserola | 16 + util/scan/dvb-t/es-Las_Palmas | 22 + util/scan/dvb-t/es-Sevilla | 17 + util/scan/dvb-t/fr-Boulogne | 17 + util/scan/dvb-t/fr-Brest | 10 + util/scan/dvb-t/fr-Chambery | 42 + util/scan/dvb-t/fr-Laval | 12 + util/scan/dvb-t/fr-Montbeliard | 28 + util/scan/dvb-t/fr-Nantes | 13 + util/scan/dvb-t/fr-Poitiers | 12 + util/scan/dvb-t/fr-Reims | 18 + util/scan/dvb-t/fr-Tours | 32 + util/scan/dvb-t/gr-Athens | 2 + util/scan/dvb-t/is-Reykjavik | 42 + util/scan/dvb-t/it-Milano | 38 + util/scan/dvb-t/se-Horby_Sallerup | 2 + util/scan/dvb-t/se-Ornskoldsvik_As | 1 + util/scan/dvb-t/se-Skelleftea | 1 + util/scan/dvb-t/sk-BanskaBystrica | 9 + util/scan/dvb-t/sk-Bratislava | 9 + util/scan/dvb-t/sk-Kosice | 9 + util/scan/dvb-t/uk-Aberdare | 17 + util/scan/dvb-t/uk-Redruth | 13 + util/scan/dvb-t/uk-StocklandHill | 15 + util/scan/dvb-t/uk-Storeton | 15 + util/scan/dvb-t/uk-WinterHill | 18 + util/scan/scan.c | 11 + util/szap/Makefile | 2 + util/szap/azap.c | 27 + util/szap/czap.c | 91 + util/szap/szap.c | 97 + util/szap/tzap.c | 73 + 232 files changed, 34875 insertions(+), 778 deletions(-) +diff -r af23d23c278b Make.rules +--- a/Make.rules Sat Jun 20 16:47:55 2009 +0200 ++++ b/Make.rules Tue Dec 21 12:13:28 2010 +0100 +@@ -35,7 +35,7 @@ + sharedir ?= $(prefix)/share + + ifneq ($(DESTDIR),) +-DESTDIR = $(DESTDIR)/ ++DESTDIR := $(DESTDIR)/ + endif + + ifeq ($(V),1) +diff -r af23d23c278b README +--- a/README Sat Jun 20 16:47:55 2009 +0200 ++++ b/README Tue Dec 21 12:13:28 2010 +0100 +@@ -15,6 +15,8 @@ + util/dvbtraffic - Monitor traffic on a digital device. + util/femon - Monitor the tuning on a digital TV device. + util/zap - *Just* tunes a digital device - really intended for developers. ++util/gotox - Simple Rotor control utility ++util/alevt - Teletext capture and display utility + + Hardware Specific Utilities: + util/av7110_loadkeys - Load remote keys into an av7110 based card +@@ -36,5 +38,10 @@ + files as they are contained in the linuxtv-dvb-1.? release + and the 2.6.x Linux kernel. + ++AleVT is not compiled by the main Makefile, because it depends on external ++libraries which might not be available in your system (see util/alevt/README for ++details). If you have the required libraries, to compile AleVT go to util/alevt/ ++and type "make". ++ + Johannes Stezenbach + Andrew de Quincey +diff -r af23d23c278b lib/libdvben50221/en50221_stdcam_llci.c +--- a/lib/libdvben50221/en50221_stdcam_llci.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/lib/libdvben50221/en50221_stdcam_llci.c Tue Dec 21 12:13:28 2010 +0100 +@@ -374,14 +374,21 @@ + } else if (resource_id == EN50221_APP_MMI_RESOURCEID) { + llci->stdcam.mmi_session_number = session_number; + } ++ break; + ++ case S_SCALLBACK_REASON_CLOSE: ++ if (resource_id == EN50221_APP_MMI_RESOURCEID) { ++ llci->stdcam.mmi_session_number = -1; ++ } else if (resource_id == EN50221_APP_DATETIME_RESOURCEID) { ++ llci->datetime_session_number = -1; ++ } else if (resource_id == EN50221_APP_AI_RESOURCEID) { ++ llci->stdcam.ai_session_number = -1; ++ } else if (resource_id == EN50221_APP_CA_RESOURCEID) { ++ llci->stdcam.ca_session_number = -1; ++ } else if (resource_id == EN50221_APP_MMI_RESOURCEID) { ++ llci->stdcam.mmi_session_number = -1; ++ } + break; +- case S_SCALLBACK_REASON_CLOSE: +- if (resource_id == EN50221_APP_MMI_RESOURCEID) { +- llci->stdcam.mmi_session_number = -1; +- } +- +- break; + } + return 0; + } +diff -r af23d23c278b lib/libdvbsec/dvbsec_api.c +--- a/lib/libdvbsec/dvbsec_api.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/lib/libdvbsec/dvbsec_api.c Tue Dec 21 12:13:28 2010 +0100 +@@ -537,19 +537,12 @@ + } + + // generate the command +- if (integer < -256) { +- return -EINVAL; +- } else if (integer < 0) { +- integer = -integer; +- data[3] = 0xf0; +- } else if (integer < 256) { +- data[3] = 0x00; +- } else if (integer < 512) { +- integer -= 256; +- data[3] = 0x10; +- } else { +- return -EINVAL; ++ if (integer < 0.0) { ++ data[3] = 0xD0; // West is a negative angle value ++ } else if (integer >= 0.0) { ++ data[3] = 0xE0; // East is a positive angle value + } ++ integer = abs(integer); + data[3] |= ((integer / 16) & 0x0f); + integer = integer % 16; + data[4] |= ((integer & 0x0f) << 4) | fraction; +diff -r af23d23c278b test/Makefile +--- a/test/Makefile Sat Jun 20 16:47:55 2009 +0200 ++++ b/test/Makefile Tue Dec 21 12:13:28 2010 +0100 +@@ -18,6 +18,7 @@ + test_stillimage \ + test_tt \ + test_vevent \ ++ test_video \ + evtest \ + video \ + szap2 +diff -r af23d23c278b test/README +--- a/test/README Sat Jun 20 16:47:55 2009 +0200 ++++ b/test/README Tue Dec 21 12:13:28 2010 +0100 +@@ -47,4 +47,4 @@ + test_dvr : + test_front : + test_switch : +-test_video : ++test_video : Play video-only file on /dev/dvb/adapter0/video0 +diff -r af23d23c278b test/test_video.c +--- a/test/test_video.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/test/test_video.c Tue Dec 21 12:13:28 2010 +0100 +@@ -23,6 +23,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -31,8 +32,7 @@ + #include + + #include +-#include +-#include ++#include + #include + #include + +@@ -100,7 +100,7 @@ + + + +-int videoSetBlank(int fd, boolean state) ++int videoSetBlank(int fd, int state) + { + int ans; + +@@ -138,72 +138,72 @@ + + int videoGetStatus(int fd) + { +- struct video_status stat; ++ struct video_status vstat; + int ans; + +- if ((ans = ioctl(fd,VIDEO_GET_STATUS, &stat)) < 0) { ++ if ((ans = ioctl(fd,VIDEO_GET_STATUS, &vstat)) < 0) { + perror("VIDEO GET STATUS: "); + return -1; + } + + printf("Video Status:\n"); + printf(" Blank State : %s\n", +- (stat.video_blank ? "BLANK" : "STILL")); ++ (vstat.video_blank ? "BLANK" : "STILL")); + printf(" Play State : "); +- switch ((int)stat.play_state){ ++ switch ((int)vstat.play_state){ + case VIDEO_STOPPED: +- printf("STOPPED (%d)\n",stat.play_state); ++ printf("STOPPED (%d)\n",vstat.play_state); + break; + case VIDEO_PLAYING: +- printf("PLAYING (%d)\n",stat.play_state); ++ printf("PLAYING (%d)\n",vstat.play_state); + break; + case VIDEO_FREEZED: +- printf("FREEZED (%d)\n",stat.play_state); ++ printf("FREEZED (%d)\n",vstat.play_state); + break; + default: +- printf("unknown (%d)\n",stat.play_state); ++ printf("unknown (%d)\n",vstat.play_state); + break; + } + + printf(" Stream Source : "); +- switch((int)stat.stream_source){ ++ switch((int)vstat.stream_source){ + case VIDEO_SOURCE_DEMUX: +- printf("DEMUX (%d)\n",stat.stream_source); ++ printf("DEMUX (%d)\n",vstat.stream_source); + break; + case VIDEO_SOURCE_MEMORY: +- printf("MEMORY (%d)\n",stat.stream_source); ++ printf("MEMORY (%d)\n",vstat.stream_source); + break; + default: +- printf("unknown (%d)\n",stat.stream_source); ++ printf("unknown (%d)\n",vstat.stream_source); + break; + } + + printf(" Format (Aspect Ratio): "); +- switch((int)stat.video_format){ ++ switch((int)vstat.video_format){ + case VIDEO_FORMAT_4_3: +- printf("4:3 (%d)\n",stat.video_format); ++ printf("4:3 (%d)\n",vstat.video_format); + break; + case VIDEO_FORMAT_16_9: +- printf("16:9 (%d)\n",stat.video_format); ++ printf("16:9 (%d)\n",vstat.video_format); + break; + default: +- printf("unknown (%d)\n",stat.video_format); ++ printf("unknown (%d)\n",vstat.video_format); + break; + } + + printf(" Display Format : "); +- switch((int)stat.display_format){ ++ switch((int)vstat.display_format){ + case VIDEO_PAN_SCAN: +- printf("Pan&Scan (%d)\n",stat.display_format); ++ printf("Pan&Scan (%d)\n",vstat.display_format); + break; + case VIDEO_LETTER_BOX: +- printf("Letterbox (%d)\n",stat.display_format); ++ printf("Letterbox (%d)\n",vstat.display_format); + break; + case VIDEO_CENTER_CUT_OUT: +- printf("Center cutout (%d)\n",stat.display_format); ++ printf("Center cutout (%d)\n",vstat.display_format); + break; + default: +- printf("unknown (%d)\n",stat.display_format); ++ printf("unknown (%d)\n",vstat.display_format); + break; + } + return 0; +@@ -230,7 +230,6 @@ + int written; + struct pollfd pfd[NFD]; + int stopped = 0; +- int ch; + + pfd[0].fd = STDIN_FILENO; + pfd[0].events = POLLIN; +@@ -327,7 +326,7 @@ + videoPlay(fd); + } + +-main(int argc, char **argv) ++int main(int argc, char **argv) + { + int fd; + int filefd; +@@ -338,7 +337,7 @@ + perror("File open:"); + return -1; + } +- if ((fd = open("/dev/ost/video1",O_RDWR|O_NONBLOCK)) < 0){ ++ if ((fd = open("/dev/dvb/adapter0/video0",O_RDWR|O_NONBLOCK)) < 0){ + perror("VIDEO DEVICE: "); + return -1; + } +diff -r af23d23c278b util/Makefile +--- a/util/Makefile Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/Makefile Tue Dec 21 12:13:28 2010 +0100 +@@ -16,4 +16,5 @@ + $(MAKE) -C szap $@ + $(MAKE) -C ttusb_dec_reset $@ + $(MAKE) -C gnutv $@ ++ $(MAKE) -C gotox $@ + $(MAKE) -C zap $@ +diff -r af23d23c278b util/alevt/COPYRIGHT +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/COPYRIGHT Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,297 @@ ++This message applies to all files within the archive: ++ ++ Copyright (C) 1998,1999,2000 Edgar Toernig (froese@gmx.de) ++ All rights reserved. ++ ++ 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. ++ ++ 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. ++ ++ ++And here's the GNU GPL V2: ++ ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 ++ ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc. ++ 675 Mass Ave, Cambridge, MA 02139, USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++License is intended to guarantee your freedom to share and change free ++software--to make sure the software is free for all its users. This ++General Public License applies to most of the Free Software ++Foundation's software and to any other program whose authors commit to ++using it. (Some other Free Software Foundation software is covered by ++the GNU Library General Public License instead.) You can apply it to ++your programs, too. ++ ++ When we speak of free software, we are referring to freedom, not ++price. Our General Public Licenses are designed to make sure that you ++have the freedom to distribute copies of free software (and charge for ++this service if you wish), that you receive source code or can get it ++if you want it, that you can change the software or use pieces of it ++in new free programs; and that you know you can do these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++anyone to deny you these rights or to ask you to surrender the rights. ++These restrictions translate to certain responsibilities for you if you ++distribute copies of the software, or if you modify it. ++ ++ For example, if you distribute copies of such a program, whether ++gratis or for a fee, you must give the recipients all the rights that ++you have. You must make sure that they, too, receive or can get the ++source code. And you must show them these terms so they know their ++rights. ++ ++ We protect your rights with two steps: (1) copyright the software, and ++(2) offer you this license which gives you legal permission to copy, ++distribute and/or modify the software. ++ ++ Also, for each author's protection and ours, we want to make certain ++that everyone understands that there is no warranty for this free ++software. If the software is modified by someone else and passed on, we ++want its recipients to know that what they have is not the original, so ++that any problems introduced by others will not reflect on the original ++authors' reputations. ++ ++ Finally, any free program is threatened constantly by software ++patents. We wish to avoid the danger that redistributors of a free ++program will individually obtain patent licenses, in effect making the ++program proprietary. To prevent this, we have made it clear that any ++patent must be licensed for everyone's free use or not licensed at all. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. ++ ++ GNU GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License applies to any program or other work which contains ++a notice placed by the copyright holder saying it may be distributed ++under the terms of this General Public License. The "Program", below, ++refers to any such program or work, and a "work based on the Program" ++means either the Program or any derivative work under copyright law: ++that is to say, a work containing the Program or a portion of it, ++either verbatim or with modifications and/or translated into another ++language. (Hereinafter, translation is included without limitation in ++the term "modification".) Each licensee is addressed as "you". ++ ++Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running the Program is not restricted, and the output from the Program ++is covered only if its contents constitute a work based on the ++Program (independent of having been made by running the Program). ++Whether that is true depends on what the Program does. ++ ++ 1. You may copy and distribute verbatim copies of the Program's ++source code as you receive it, in any medium, provided that you ++conspicuously and appropriately publish on each copy an appropriate ++copyright notice and disclaimer of warranty; keep intact all the ++notices that refer to this License and to the absence of any warranty; ++and give any other recipients of the Program a copy of this License ++along with the Program. ++ ++You may charge a fee for the physical act of transferring a copy, and ++you may at your option offer warranty protection in exchange for a fee. ++ ++ 2. You may modify your copy or copies of the Program or any portion ++of it, thus forming a work based on the Program, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) You must cause the modified files to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ b) You must cause any work that you distribute or publish, that in ++ whole or in part contains or is derived from the Program or any ++ part thereof, to be licensed as a whole at no charge to all third ++ parties under the terms of this License. ++ ++ c) If the modified program normally reads commands interactively ++ when run, you must cause it, when started running for such ++ interactive use in the most ordinary way, to print or display an ++ announcement including an appropriate copyright notice and a ++ notice that there is no warranty (or else, saying that you provide ++ a warranty) and that users may redistribute the program under ++ these conditions, and telling the user how to view a copy of this ++ License. (Exception: if the Program itself is interactive but ++ does not normally print such an announcement, your work based on ++ the Program is not required to print an announcement.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Program, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Program, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Program. ++ ++In addition, mere aggregation of another work not based on the Program ++with the Program (or with a work based on the Program) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may copy and distribute the Program (or a work based on it, ++under Section 2) in object code or executable form under the terms of ++Sections 1 and 2 above provided that you also do one of the following: ++ ++ a) Accompany it with the complete corresponding machine-readable ++ source code, which must be distributed under the terms of Sections ++ 1 and 2 above on a medium customarily used for software interchange; or, ++ ++ b) Accompany it with a written offer, valid for at least three ++ years, to give any third party, for a charge no more than your ++ cost of physically performing source distribution, a complete ++ machine-readable copy of the corresponding source code, to be ++ distributed under the terms of Sections 1 and 2 above on a medium ++ customarily used for software interchange; or, ++ ++ c) Accompany it with the information you received as to the offer ++ to distribute corresponding source code. (This alternative is ++ allowed only for noncommercial distribution and only if you ++ received the program in object code or executable form with such ++ an offer, in accord with Subsection b above.) ++ ++The source code for a work means the preferred form of the work for ++making modifications to it. For an executable work, complete source ++code means all the source code for all modules it contains, plus any ++associated interface definition files, plus the scripts used to ++control compilation and installation of the executable. However, as a ++special exception, the source code distributed need not include ++anything that is normally distributed (in either source or binary ++form) with the major components (compiler, kernel, and so on) of the ++operating system on which the executable runs, unless that component ++itself accompanies the executable. ++ ++If distribution of executable or object code is made by offering ++access to copy from a designated place, then offering equivalent ++access to copy the source code from the same place counts as ++distribution of the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 4. You may not copy, modify, sublicense, or distribute the Program ++except as expressly provided under this License. Any attempt ++otherwise to copy, modify, sublicense or distribute the Program is ++void, and will automatically terminate your rights under this License. ++However, parties who have received copies, or rights, from you under ++this License will not have their licenses terminated so long as such ++parties remain in full compliance. ++ ++ 5. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Program or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Program (or any work based on the ++Program), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Program or works based on it. ++ ++ 6. Each time you redistribute the Program (or any work based on the ++Program), the recipient automatically receives a license from the ++original licensor to copy, distribute or modify the Program subject to ++these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties to ++this License. ++ ++ 7. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Program at all. For example, if a patent ++license would not permit royalty-free redistribution of the Program by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Program. ++ ++If any portion of this section is held invalid or unenforceable under ++any particular circumstance, the balance of the section is intended to ++apply and the section as a whole is intended to apply in other ++circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system, which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 8. If the distribution and/or use of the Program is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Program under this License ++may add an explicit geographical distribution limitation excluding ++those countries, so that distribution is permitted only in or among ++countries not thus excluded. In such case, this License incorporates ++the limitation as if written in the body of this License. ++ ++ 9. The Free Software Foundation may publish revised and/or new versions ++of the General Public License from time to time. Such new versions will ++be similar in spirit to the present version, but may differ in detail to ++address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Program ++specifies a version number of this License which applies to it and "any ++later version", you have the option of following the terms and conditions ++either of that version or of any later version published by the Free ++Software Foundation. If the Program does not specify a version number of ++this License, you may choose any version ever published by the Free Software ++Foundation. ++ ++ 10. If you wish to incorporate parts of the Program into other free ++programs whose distribution conditions are different, write to the author ++to ask for permission. For software which is copyrighted by the Free ++Software Foundation, write to the Free Software Foundation; we sometimes ++make exceptions for this. Our decision will be guided by the two goals ++of preserving the free status of all derivatives of our free software and ++of promoting the sharing and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY ++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN ++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES ++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED ++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS ++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, ++REPAIR OR CORRECTION. ++ ++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING ++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR ++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, ++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED ++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGES. ++ ++ END OF TERMS AND CONDITIONS +diff -r af23d23c278b util/alevt/ChangeLog +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/ChangeLog Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,535 @@ ++Thu Feb 11 22:05:00 MET 2010 (1.7.0) ++ ++ - redesigned version: ++ - outfile, new starting methods, libzvbi implementation ++ - lots of bug fixes, all patches available in the Internet applied ++ - extensive code cleanup ++ ++Mon Dec 3 03:11:07 MET 2007 (1.6.2) ++ ++ - compilation fixes for newer gcc ++ - makefile tweaks (man vs share/man, /usr/X11R6 vs /usr, etc) ++ - default device changed to /dev/vbi0 ++ - adapt to current v4l2 api ++ - some minor fixes collected during the past years ++ ++ This is a build-time update to conform to newer compilers and ++ system environments. If you have a running AleVT there's no ++ reason to update. The only real fix is in the html-exporter ++ which was producing broken html (missing double-quotes). ++ ++Thu Jan 23 01:53:10 MET 2003 ++ ++ - Fixed a bug in contrib/cap-all.c (fdset_init before vbi_open) ++ - Expaned cap-all.c to show how to save in two formats simultaneously. ++ ++Tue Aug 20 05:22:16 MEST 2002 (1.6.1) ++ ++ - Removed the bttv-warning from the help pages ;-) ++ ++Mon Jul 23 18:34:32 MEST 2001 ++ ++ - Fixed bug in ui.c - found by . ++ - When clicking on page numbers accept sub-page numbers too. ++ ++Sat Dec 23 15:12:11 MET 2000 ++ ++ - Fixed 'double height last line' bug in export.c reported by ++ ++ ++Thu Oct 12 02:19:31 MEST 2000 ++ ++ - The   fix was wrong. Removed it. ++ ++Wed Oct 11 19:41:38 MEST 2000 (1.6.0) ++ ++ - Some documentation tweaks. ++ - Release. Made it 1.6 because of V4l2 API. ++ ++Thu Sep 21 21:07:12 MEST 2000 ++ ++ - Removed old bttv-only decoder. Only the v4l2-based stays. ++ If the device does not support v4l2, default parameters ++ appropriate for the bttv-driver are taken. ++ - Subpage cycling (up/down and 2nd wheel) stays in the current ++ page. ++ ++Sat Sep 16 23:52:12 MEST 2000 ++ ++ - Experimental v4l2 interface added. ++ - Finetune defaults to 1 now. Works best for me. Tell me ++ if you don't like it. ++ - Russian patch still not added :-/ ++ - Fixed the bug in xio.c that Ben Smithurst ++ found. ++ - Added the dual-wheel-mouse patch from Holger Fitzner. ++ ++Tue May 30 03:09:24 MEST 2000 ++ ++ - As Matto Fransen reported: the ; after   ++ in exp-html is missing. fixed that. ++ ++Tue May 9 20:21:52 MEST 2000 ++ ++ - Removed the -oldbttv/-newbttv options. If your driver has ++ a buffer size different from that in the current bttv you ++ either have to support the VBISIZE ioctl or change the source. ++ (Tried to implement an autodetect by non-blocking reads but ++ that confuses the driver that much that it no longers gives ++ reasonable data.) ++ - Added a compression option to the png export filter and ++ changed the default compression level to the lib's default. ++ The prev default of 9 was way to slow. ++ ++Wed May 3 19:18:55 MEST 2000 ++ ++ - Added a smaller font. Made out of the neep9 font from ++ the really great jmk-fonts (http://www.pobox.com/~jmknoble). ++ ++Sat Apr 29 02:36:41 MEST 2000 ++ ++ - Fixed SEGV in export.c:adjust. ++ - Fixed a possible buffer overrun in exp-txt.c ++ ++Thu Nov 4 21:18:52 MET 1999 (1.5.1) ++ ++ - Added os.h. That way alevt compiles right out of the ++ box on all BSD systems (I hope *g*). ++ - Fixed the DST bug in alevt-date. ++ - Put vtwiz.pl in contrib, a perl/tk/set-tv script to ++ launch alevt written by Joern Borgert. ++ ++Tue Oct 26 23:55:09 MEST 1999 (1.5.1-pre1) ++ ++ - Added timeout option to alevt-cap. ++ - Use install instead of cp in the Makefile. ++ - Added -I/usr/local/include and -L/usr/local/lib ++ in the Makefile. ++ - Changed #ifdef FREEBSD to #ifdef BSD. ++ - exchanged contrib/paul-export.patch with ++ paul.fmt_page.c (a replacement for export.c:fmt_page()) ++ and paul.fmt_page.patch (the same in form of a ++ patch file). ++ - Some doc corrections. ++ ++Thu Oct 14 02:49:48 MEST 1999 ++ ++ - Added FREEBSD patches. ++ ++Fri Oct 8 23:36:45 MEST 1999 (1.5.0) ++ ++ - Updated the documentation. ++ ++ So, what's new since 1.4.9 (nearly 4 months ago)? ++ Two major things: full latin-2 support and export ++ filters for alevt-cap and alevt itself. ++ ++ For the latin-2 support page enhancement packets ++ have to be decoded and some latin-1 pages may ++ benefit from that, too. Note: if you select ++ latin-2 everything is latin-2, even cut'n paste. ++ (new cmdline option -charset latin-1|2) ++ ++ The export filters allow saving pages in different ++ formats. At the moment there's ascii (with and with- ++ out color), html, png, and ppm. The png filter ++ requires libpng. If you don't have it (or don't want ++ png support) just remove the WITH_PNG from the ++ Makefile. To save the currently displayed page just ++ press 's'. See alevt-cap(1) for the format string. ++ ++ Preview: 1.5.1 will have the FreeBSD patches and ++ any bug fixes. (But not more *g*). ++ ++Fri Oct 8 02:06:35 MEST 1999 (1.5.0-pre4) ++ ++ Finally I could get away from my Playstation and ++ work a little bit on alevt *g* ++ ++ - Tried to change alevt-date with freebsd patches from ++ Thomas Runge . They do not ++ have the timezone and daylight variables. But I do ++ not have tm_gmtoff. So it's commented out for the ++ moment. ++ - Made font.[ch] so that only one copy of the fonts is ++ in the executable when including export modules ++ (exp-gfx.c uses them). Had to tweak the makefile. ++ - Added 's' for saving pages to files. Prompts for ++ a format string and a filename and saves the ++ currently displayed page. ++ (Formerly, 's' and 'S' were aliases for '/' and '?' ++ (searching)) ++ - Found a bug in export.c regarding double height lines. ++ - Added a patch to the contrib dir to pass the URL you ++ click on to netscape. ++ ++ The documentation updates are still missing. That's ++ the last thing to do for 1.5.0. But that's so boring... ++ ++Fri Aug 20 21:28:18 MEST 1999 ++ ++ Back from holidays and time for alevt... ++ ++ - Added html, png, and ppm export modules from Paul. ++ - Fixed the return status for export_output. ++ - Tweaked the makefile for libpng support. ++ - Added the export howto to the contrib dir. ++ - Added Paul's fmt_page routine to contrib as a patch ++ to export.c ++ - Added "-format help" to list all output formats and ++ its options. ++ ++ Still to do: update man page of alevt-cap, add export ++ to alevt, add erc to alevt-cap. ++ ++ Oh, btw, alevt is running on FreeBSD with the bt848 ++ driver from Roger Hardiman *g*. ++ I wonder if it's possible to port his driver to linux. ++ Maybe it runs better then bttv... (I still get reports ++ with stuck xawtvs ...) ++ ++Mon Jul 19 01:15:50 MEST 1999 (1.5.0-pre3) ++ ++ - Added export modules. It's gotten much to complex. ++ ++ A lot of things still to do: add other formats [Paul?], ++ add documentation, add format-help, add export to alevt, ++ add erc to alevt-cap, ... ++ ++Mon Jul 12 00:09:03 MEST 1999 ++ ++ - Added an incomplete 20x24 font to the contrib dir. ++ ++Tue Jun 29 00:46:03 MEST 1999 (1.5.0-pre2) ++ ++ - Added lanugage tables from Radoslaw. ++ - Added new latin-2 font from Radoslaw. ++ - Fixed a bug with hold graphics. There's still one bug ++ on CNN's page 100 (has to do with set-after behaviour of ++ color select in hold graphics mode). The last line of the ++ earth should be blue-blue-green not blue-green-green. ++ AleVT always uses set-at behaviour. Afaik, this combination ++ (hold + set-after) is the only way to see the difference ++ between set-at and set-after. Set-after will blow up the ++ code so I will leave it as it is. ++ - vbi now collects all pkt26 and enhances the page before ++ it is passed on. Seem's to work. ++ ++Tue Jun 22 22:13:45 MEST 1999 (1.5.0-pre1) ++ ++ - Fixed hamm24. And, it should be fast now *g* ++ - Moved the language conversion parts to lang.c ++ - Added additional lang_chars for use with the latin-2 charset. ++ - Added -charset latin-1/2 option. ++ - Added pkt x/26 decoding. ... and noticed, that these packets ++ are sent between line 0 and 1. FUCK. Now I have to save ++ all x/26 until the page is complete. But not today... :-( ++ ++ Things are getting more and more uglier. The right thing ++ to do would be to make a big font with all possible chars ++ (including cyrillic, arabic, smoothed graphics, ...). ++ That would mean to make each char in vtp->data 16 bit. ++ And then add an attribute word for each char so that the ++ enhanced attributes work, too. Searching and cut & paste ++ would be more complicated... but the worst, the pages ++ will be much bigger (4 times larger). Really bad for ++ the cache and god knows for what else... ++ Is it worth all the trouble??? I don't need that! ++ ++Tue Jun 15 01:25:40 MEST 1999 ++ ++ - Changed .specs file again. I previously changed alevt.spec ++ instead of alevt.spec.in :-( ++ ++Mon Jun 14 23:45:48 MEST 1999 (1.4.9) ++ ++ - Made a very simple capture program (alevt-cap). Just collects ++ the given pages and writes them to disk in ASCII. ++ I will only accept bug reports/fixes, no enhancement requests ++ at the moment *g* ++ (I can't believe it; I even wrote a man page...) ++ - Changed the subpage delimiter on the command line from '/' to '.' ++ The old one ('/') is still accepted. (Reason: alevt-cap uses ++ the page number as part of the filename and a / is inconvenient. ++ And I already wanted to let you enter subpages with the keypad ++ and the '.' would be a nice key for that.) ++ - Tweaked the .specs file... (Btw, alevt-date and alevt-cap should ++ not be installed in the X11 tree.) ++ ++Thu Jun 10 22:13:40 MEST 1999 ++ ++ - moved the hamming decoding and associated table to hamm.c ++ - played with pkt26 to support polish stations. not finished. ++ ++Tue Jun 8 21:00:42 MEST 1999 ++ ++ - Added -[no]bell option. And the 'b' key. ++ - Replaced all xio_bell calls with appropriate status messages. ++ ++Sat Jun 5 00:42:19 MEST 1999 (1.4.8) ++ ++ - Shit. Just after the release I found a bug. The header line ++ isn't updated as it should :-( (Just affects parallel mode ++ transmission, so no new version, yet.) ++ - Created mailing list. Either go to http://alevt.listbot.com/ ++ or write mail to alevt-subscribe@listbot.com. ++ - Added bttv-patch to the contrib dir for those who don't want ++ to wait for bttv-0.6.5. ++ ++Fri Jun 4 17:19:41 MEST 1999 (1.4.7) ++ ++ - Added autodetection of VBIBUF_SIZE (only with newer bttv, 0.6.5). ++ - Forgot to close vbi_fd in vbi_close :-/ ++ - Made ERC on by default. If the page has no errors it ++ costs nothing and if it has you'll turn it on anyway. ++ - Changed parameters of EV_HEADER. ++ - Removed XAWTV_HACKS. ++ - Updated some docu. ++ - Modified the contrib samples to reflect previous API changes. ++ ++Fri May 28 20:16:44 MEST 1999 ++ ++ - Added status messages. ++ - Added EV_TIMER event. ++ - Added channel change detection (only with newer bttv, 0.6.5). ++ Sends EV_RESET event. The XAWTV_HACKS can be removed *phww*. ++ Now the cache is automatically cleared if you switch to a ++ new channel. It even works with a SAT receiver connected to ++ Video-In. ++ ++Thu May 27 23:54:32 MEST 1999 (1.4.6 unofficial) ++ ++ - Cache reset didn't reset npages and hi_subno. ++ - Added XAWTV_HACKS, that is: alevt scans for a window with ++ the _XAWTV_STATION property and registers for property changes. ++ Result: when switching channels in xawtv, the cache is cleared. ++ (This is just an ugly hack. Xawtv must already be running ++ when alevt is started. If you quit and restart xawtv, it no ++ longer works. There's no method to detect if the monitored ++ xawtv is really the one controlling our /dev/vbi, etc...) ++ Added on request of Paul Ortyl . ++ - Added error reduction circuit. It's part of the cache. ++ Errors in a new page are replaced by characters/lines from ++ an already cached (older) page. May be toggled by pressing ++ 'e' (editor is now on 'E'). It's not enabled by default ++ because it takes some CPU time. Idea by Paul Ortyl. ++ - TODO: clean up. document new features. add status messages. ++ ++Sun May 23 19:13:07 MEST 1999 (1.4.5) ++ ++ - New spec file from Karsten Hopp ++ - Changed it even further *g* ++ - Fixed a bug with graphics selection of double height lines. ++ - Documented the -oldbttv option in the man page. Now it's in ++ every page. This should finally halve the mails I get. ++ (For the other halve I have to write alevt-capture *g*) ++ ++Sat May 8 02:41:21 MEST 1999 ++ ++ - Ehhh, changed u32 typedef from unsigned long to unsigned int. ++ Same for s32. The Alpha's longs are 64 bits. ++ Thanks to Sdruddin Rejeb . ++ (There's something strange with this in the X libs. They are ++ sometimes very lazy about ints and longs. Someone with an ++ Alpha should check the cut & paste, both, text and graphics ++ selections.) ++ ++Thu Apr 29 22:38:37 MEST 1999 ++ ++ - Updated contrib/t1.c ++ - Added ':' as a subpage delimiter for clicking (2:7 is the same as 2/7) ++ ++Mon Apr 19 19:40:09 MEST 1999 ++ ++ - Switched the scrolling direction of the wheel ++ ++Mon Mar 29 01:23:06 MEST 1999 (1.4.4) ++ ++ - fixed DST bug in alevt-date ++ - added crude latin-2 support. 'make FONT=latin-2' should be enough. ++ (found the stuff on the website http://www.penguin.cz/~marvin/ of ++ Daniel Smolik . I don't know if he is the one ++ who made the font). ++ ++Wed Mar 17 20:53:59 MET 1999 ++ ++ - added timeout to alevt-date ++ ++Fri Feb 19 18:22:53 MET 1999 (1.4.3> ++ ++ - Makefile changes. ++ ++Fri Jan 29 18:01:27 MET 1999 ++ ++ - fixed bug in dllist.h. dl_insert_first(h, dl_remove(n)) was only ++ working due to gcc implementation details. ++ ++Mon Jan 25 18:33:42 MET 1999 (1.4.2) ++ ++ - fixed 'clear cache'. no longer removes the help pages. ++ - made next/prev key/button to skip missing pages. ++ - added support for wheeled mice. (I heard it's really cool *g*) ++ - problem with subpages > 0xff fixed. ++ ++Thu Jan 21 17:31:46 MET 1999 (1.4.1) ++ ++ - added man pages from Thomas Schoepf . ++ - added rpm-spec file from Mario Mikocevic . ++ (looks a little bit odd, but I don't know very much about rpms) ++ - minor option fix in alevt-date (people are really using it!?!) ++ ++Tue Jan 5 03:50:08 MET 1999 (1.4.0) ++ ++ - should be 1.3.10 but that gives problems with the help pages :-( ++ - fixed varargs for alpha ++ - default is now -newbttv (aka -fuckbttv). use -oldbttv for v<0.5.20. ++ ++Sat Jan 2 21:40:54 MET 1999 ++ ++ - small patches to alevt-date (-vbi options and tzset fix) ++ - played with pkt8/30. what a mess. MTV is 25:13 ahead *g* ++ ++Wed Dec 30 19:30:14 MET 1998 (1.3.9) ++ ++ - slightly modified the pll (may need further tuning) ++ ++Wed Dec 30 05:27:26 MET 1998 (1.3.8) ++ ++ - added pll (-finetune auto). try -debug for status msgs. ++ ++Tue Dec 29 05:15:53 MET 1998 (1.3.7) ++ ++ - added finetune option (see README) ++ - you may now type -newbttv instead of -fuckbttv *g* ++ ++Mon Dec 28 19:36:32 MET 1998 (1.3.6) ++ ++ - Makefile: R5 -> R6 :-( ++ - vbi.c now works without cache.c ++ - added alevt-date (set system time from teletext) ++ - bug in option parsing (error reporting) ++ ++Thu Dec 17 19:56:16 MET 1998 (1.3.5) ++ ++ - added -L/usr/X11R6/lib in Makefile ++ - put some blurb (in german) in contrib. ++ ++Thu Dec 17 05:01:34 MET 1998 (1.3.4) ++ ++ - added class hints on (invisible) leader window to make docking ++ in wmaker easier. instant name for leader is "VTLeader" and for ++ the viewing windows "VTPage" ++ - made the icon a little bit smaller ++ ++Mon Dec 14 23:05:41 MET 1998 (1.3.3) ++ ++ Release 1.3.3 ++ ++ - added spanish/portuguese charset decoding ++ - added similar looking glyphs for czech ++ - minor changes on the font ++ - middle click on current page number opens new parent window ++ - case dependant search if the pattern begins with a '!' ++ - line editing may be aborted with ^C ++ ++Sun Dec 13 17:55:32 MET 1998 (1.3.2) ++ ++ - when there were multiple windows of the same page, cycling through ++ the subpages changed all windows. fixed. ++ - hilight the found text (make it the selection). ++ - slightly modified the hilight colors. ++ - default window size set to 41x25 (looks better). ++ - rewrote the editor. ++ ++Sun Dec 13 07:03:10 MET 1998 (1.3.1) ++ ++ - fixed one command line option ++ - corrected bug in searching ++ ++Sat Dec 12 20:27:03 MET 1998 (1.3.0) ++ ++ Release 1.3.0 ++ ++ - searching is now ready (still need a status line for error msgs). ++ - set SIGPIPE to SIG_DFL. some shells (KDE) set it to SIG_IGN and then ++ the timer task won't be killed on exit. ++ - updated the help pages. ++ - I'm frustrated! BTTV_VERSION doesn't work on /dev/vbi. So no ++ autodetection of driver version. Added -fuckbttv option instead. ++ ++Fri Dec 11 19:36:03 MET 1998 (1.2.5) ++ ++ - reworked national charset (lang) handling. everthing now done in vbi.c. ++ the rest just deals with latin-1. ++ - first version of searching (functional, but dirty. needs more work.) ++ ++Thu Dec 10 20:06:27 MET 1998 (1.2.4) ++ ++ - new file edline.c (line editor for the menu line. start for searching...) ++ - blinking cursor ++ - added an 48x48 icon from Ulf Rompe ++ - added pasting into the line editor (insert key). ++ - release ownership of XA_PRIMARY when deselecting selection. ++ ++Tue Dec 8 21:26:26 MET 1998 (1.2.3) ++ ++ - new file ui.c (most user interface stuff from main.c) ++ - rewrote option parsing ++ - allow specification of child windows on command line. now ++ it's possible to regenerate the complete window layout by ++ the commandline (may be of some use for session management). ++ - some spelling fixes in the help pages from Mark Bryars ++ ++Mon Dec 7 16:59:28 MET 1998 (1.2.2) ++ ++ - reworked hidden handling in xio.c ++ ++Sun Dec 6 19:54:10 MET 1998 (1.2.1) ++ ++ - class name changed! from Alevt to AleVT. ++ - window/icon title shows current page number ++ - changed the icon to a 64 pixel width one. not nice but ... ++ - added a small mini icon for the title bar. is there a property I can set? ++ - pressing on the CPN puts the page on hold ++ - pressing on the violet * reveals concealed text ++ - added simple menu if no FastText menu is present ++ - allow subpages to be specified on the command line (eg 100/4) ++ ++Sat Dec 5 20:59:51 MET 1998 (1.2.0) ++ ++ Release 1.2.0 ++ ++ - finished the help pages. ++ - added command line handling ++ - added user geometry handling in xio.c ++ ++Sat Dec 5 02:28:16 MET 1998 (1.1.2) ++ ++ - allow magazin 9 (help system) ++ - start box char after a pagenumber selects subpage 1 (hack) ++ - added a crude page editor (just to create the help pages. not for users.) ++ - started with the online help system (sounds great, hehe) ++ ++Tue Dec 1 20:19:53 MET 1998 (1.1.1) ++ ++ - added concept of parent and child windows. now, the middle mouse ++ button changes the contens of the child window. if there isn't ++ one, it is created. ++ - Middle mouse button on x/y (subpage cycling) selects the previous ++ subpage. (updating the child with subpages is hairy...) ++ ++Sun Nov 29 23:34:18 MET 1998 (1.1.0) ++ ++ Release 1.1.0 ++ ++ - removed most of the recovery for single bad lines (does too much harm) ++ - changed handling of parallel mode transmission (untested. unused in .de) ++ - added selection (text & graphic!). try pasting into xpaint :-) ++ - added cache-clear function ('c') ++ - click on x/y selects the next subpage ++ - some minor tweaks ++ - added an icon bitmap. ++ ++Wed Nov 24 23:33:34 MET 1998 (1.0.0) ++ ++ First Release 1.0.0 +diff -r af23d23c278b util/alevt/EXPORT.HOWTO +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/EXPORT.HOWTO Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,84 @@ ++HOW TO IMPLEMENT A NEW EXPORT MODULE: ++ ++As an example look at exp-txt.c (it implements two modules which ++are pretty similar). ++ ++You have to create one exported structure (struct export_module). ++This structure holds the following data: ++ ++1. The name of the format (example: "ascii"). ++ ++2. The default extension to use for building filenames ("txt"). ++ ++3. A list of module options. It's a 0 terminated array of char ++pointers, one for each option (similar to argv of main). ++If an option string contains a '=', it is an option that ++requires an argument. The part after the '=' is ignored at ++the moment. Later, I want to add help messages that show ++these options strings and then the part after the '=' becomes ++useful. ++If you do not have local options, set this field to 0. ++ ++4. The number of bytes for local data in the export structure. ++There you may store data collected during option parsing or ++for whatever you want. ++Don't use global variables for storing this data! With ++alevt-cap you may give: ++ ++alevt-cap -format ascii,color 100 -format ascii 100 ++ ++to save the page in two different formats. Using global ++vars would inhibit this. The data area in struct export ++starts at the 'data' field. You have to cast it to the ++appropriate type (see the D macro in exp-txt.c). ++If you do not need local data, set this field to 0. ++ ++5. An open function (or call it constructor). It is called ++when your module is needed and it is passed a struct export ++(the instance). This function may be used to initialize ++the local data in the export struct. ++If all goes well return 0. Else call export_error (see ++below) and return -1. ++If you do not need an open function, set this field to 0. ++ ++6. A close function (or call it destructor). It is called ++when your module is no longer needed. If you allocated ++memory in the open func, this is the place to free it. ++If you do not need a close function, set it to 0. ++ ++7. An option function. It is called for each module option ++the user has given. It is passed an option number (first ++option in the option-array gives 1, ...) and a char pointer ++to the argument for that option (0 if the option does not ++need an arg). The argument pointer keeps valid until the ++close function is called. ++If all goes well, return 0. Else call export_error and ++return -1. ++If you gave an option list at point 3 you have to specify ++this function. Else set it to 0. ++ ++8. An output function. It is called to produce the output. ++It is given the file name to use and a fmt_page pointer. ++The fmt_page contains an interpreted image of the page. ++There are no control chars in it. It uses the character ++set defined by the two fonts. ++These function may be called consecutive for multiple ++pages. Don't expect one output for one open/close. ++Return codes as above... (0: ok, -1: error). ++ ++The export_error function: If one of your functions wants to ++report an error, it has to use the export_error function. ++It's a printf like function to set error messages. In alevt-cap ++these messages are printed to stderr, in alevt they will be ++shown in the status line (so don't make them too long). ++ ++The last step is to add your export_module structure to the ++list of modules in export.c (at the top). ++Please, make sure that this structure is the only exported ++symbol. All other things should be static. ++ ++That's all. A structure describing your module and 4 functions ++(open, close, option, output) to implement it. Shouldn't be too ++complicated. ++ ++Ciao, ET. +diff -r af23d23c278b util/alevt/Makefile +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/Makefile Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,130 @@ ++VER=1.7.0 ++OPT=-O -g -w ++DEFS=-DWITH_PNG ++DEFS+=-DUSE_LIBZVBI ++FONT=vtxt ++MAN_DIR=man ++DESTDIR= ++PREFIX=/usr ++HOSTCC=$(CC) ++CFLAGS=$(OPT) -DVERSION=\"$(VER)\" $(DEFS) -I$(USR_X11R6)/include ++EXPOBJS=export.o exp-txt.o exp-html.o exp-gfx.o font.o ++OBJS=main.o ui.o xio.o fdset.o vbi.o cache.o help.o search.o misc.o hamm.o lang.o $(EXPOBJS) ++TOBJS=alevt-date.o vbi.o fdset.o misc.o hamm.o lang.o ++COBJS=alevt-cap.o vbi.o fdset.o misc.o hamm.o lang.o $(EXPOBJS) ++ ++ifneq ($(findstring WITH_PNG,$(DEFS)),) ++EXPLIBS=-lpng -lz -lm ++endif ++ ++ifneq ($(findstring USE_LIBZVBI,$(DEFS)),) ++ZVBILIB=-lzvbi -lpthread ++EXPLIBS+=$(ZVBILIB) ++endif ++ ++all: alevt alevt-date alevt-cap alevt.1 alevt-date.1 alevt-cap.1 ++ ++alevt: $(OBJS) ++ $(CC) $(OPT) $(OBJS) -o alevt -L$(PREFIX)/lib -L$(PREFIX)/lib64 -lX11 $(EXPLIBS) ++ ++alevt-date: $(TOBJS) ++ $(CC) $(OPT) $(TOBJS) -o alevt-date $(ZVBILIB) ++ ++alevt-cap: $(COBJS) ++ $(CC) $(OPT) $(COBJS) -o alevt-cap $(EXPLIBS) ++ ++font.o: font1.xbm font2.xbm font3.xbm font4.xbm ++fontsize.h: font1.xbm font2.xbm font3.xbm font4.xbm ++ fgrep -h "#define" font1.xbm font2.xbm font3.xbm font4.xbm >fontsize.h ++ ++font1.xbm: bdf2xbm $(FONT)-latin-1.bdf ++ ./bdf2xbm font1 <$(FONT)-latin-1.bdf >font1.xbm ++ ++font2.xbm: bdf2xbm $(FONT)-latin-2.bdf ++ ./bdf2xbm font2 <$(FONT)-latin-2.bdf >font2.xbm ++ ++font3.xbm: bdf2xbm vtxt-koi8.bdf ++ ./bdf2xbm font3 font3.xbm ++ ++font4.xbm: bdf2xbm vtxt-iso8859-7.bdf ++ ./bdf2xbm font4 font4.xbm ++ ++bdf2xbm: bdf2xbm.c ++ $(HOSTCC) bdf2xbm.c -o bdf2xbm ++ ++clean: ++ rm -f *.o page*.txt a.out core bdf2xbm font?.xbm fontsize.h ++ rm -f alevt alevt-date alevt-cap ++ ++rpm-install: all ++ install -m 0755 alevt ${RPM_BUILD_ROOT}$(USR_X11R6)/bin ++ install -m 0755 alevt-date ${RPM_BUILD_ROOT}$(USR_X11R6)/bin ++ install -m 0755 alevt-cap ${RPM_BUILD_ROOT}$(USR_X11R6)/bin ++ install -m 0644 alevt.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1 ++ install -m 0644 alevt-date.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1 ++ install -m 0644 alevt-cap.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1 ++ install -d 0755 $(RPM_BUILD_ROOT)$(USR_X11R6)/include/X11/pixmaps ++ install -m 0644 alevt.png $(RPM_BUILD_ROOT)$(USR_X11R6)/include/X11/pixmaps ++ ++install: all ++ install -m 0755 alevt $(DESTDIR)$(PREFIX)/bin ++ install -m 0755 alevt-date $(DESTDIR)$(PREFIX)/bin ++ install -m 0755 alevt-cap $(DESTDIR)$(PREFIX)/bin ++ install -m 0644 alevt.1 $(DESTDIR)$(PREFIX)/share/man/man1 ++ install -m 0644 alevt-date.1 $(DESTDIR)$(PREFIX)/share/man/man1 ++ install -m 0644 alevt-cap.1 $(DESTDIR)$(PREFIX)/share/man/man1 ++ install -m 0644 alevt.png $(DESTDIR)$(PREFIX)/share/pixmaps ++ install -m 0644 alevt.desktop $(DESTDIR)$(PREFIX)/share/applications ++ ++uninstall: clean ++ rm -f /usr/bin/alevt /usr/bin/alevt-cap /usr/bin/alevt-date \ ++ /usr/share/pixmaps/alevt.png /usr/share/applications/alevt.desktop \ ++ /usr/share/man/man1/alevt.1 /usr/share/man/man1/alevt-cap.1 \ ++ /usr/share/man/man1/alevt-date.1 ++ ++depend: ++ makedepend -Y -- $(CFLAGS_none) -- *.c 2>/dev/null ++ ++tar-html: alevt.1 alevt-date.1 alevt-cap.1 ++ for i in alevt.1 alevt-date.1 alevt-cap.1 ; do \ ++ j=`basename $$i .1` ; \ ++ j=`basename $$j .1x` ; \ ++ nroff -man $$i | { \ ++ echo "AleVT" ; \ ++ man2html -bare -uelem U -nodepage ; \ ++ echo "" ; \ ++ } | sed -e "s, , ,g" -e "s, , ,g" >~/exit/alevt/$$j.html ;\ ++ done ++ ++tar: tar-html clean ++ sed s/VERSION/$(VER)/g ~/exit/alevt/alevt-$(VER).lsm ++ sed s/VERSION/$(VER)/g alevt.spec ++ cd .. ;\ ++ ln -s alevt alevt-$(VER) ;\ ++ tar vcfz ~/exit/alevt/alevt-$(VER).tar.gz alevt-$(VER)/* ;\ ++ rm alevt-$(VER) ++ cat ~/exit/alevt/changes ++ ++# DO NOT DELETE ++ ++alevt-cap.o: vt.h misc.h fdset.h dllist.h vbi.h cache.h lang.h export.h ++alevt-date.o: os.h vt.h misc.h fdset.h dllist.h vbi.h cache.h lang.h ++cache.o: misc.h dllist.h cache.h vt.h help.h ++exp-gfx.o: lang.h misc.h vt.h export.h font.h fontsize.h ++exp-html.o: lang.h misc.h vt.h export.h ++exp-txt.o: os.h export.h vt.h misc.h ++export.o: vt.h misc.h export.h ++fdset.o: dllist.h misc.h fdset.h ++font.o: font1.xbm font2.xbm font3.xbm font4.xbm ++hamm.o: vt.h misc.h hamm.h ++help.o: vt.h misc.h vt900.out vt901.out vt902.out vt903.out vt904.out vt905.out ++help.o: vt906.out vt907.out vt908.out vt909.out vt910.out vt911.out vt912.out ++lang.o: misc.h vt.h lang.h ++main.o: vt.h misc.h fdset.h dllist.h xio.h vbi.h cache.h lang.h ui.h ++main.o: search.h ++misc.o: misc.h ++search.o: vt.h misc.h cache.h dllist.h search.h ++ui.o: vt.h misc.h xio.h dllist.h vbi.h cache.h lang.h fdset.h ++ui.o: search.h export.h ui.h ++vbi.o: os.h vt.h misc.h vbi.h dllist.h cache.h lang.h fdset.h hamm.h ++xio.o: vt.h misc.h dllist.h xio.h fdset.h lang.h icon.xbm font.h fontsize.h +diff -r af23d23c278b util/alevt/README +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/README Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,72 @@ ++Hi, ++ ++this software is not just a program, it's moreover a legend. ++It is THE protagonist of all videotext applications under Linux. ++ ++During the past 10 years the video standards, the APIs, the kernel ++have seen lots of changes. ++But unfortunately this program has NOT seen much maintenance. ++The results of that misfit appearance are: ++ ++1. lots of forks flying around in the Internet ++2. lots of patches flying around, some good, some disgusting, some out of time ++3. lots of cruft which is completely outdated or obsolete for other reasons ++ ++To handle all that in one big effort I decided to redesign the program ++completely, enlarging its capabilities for DVB-S at the same time. ++ ++So here are the changes: ++ ++1. Erasure of old help pages and rename / reorganize / update the rest ++-> redesign of the online help system / implying alevt-date and alevt-cap ++ ++2. Erasure of old outdated integers, functions, parameters: ++ ++- bell, big_buf, debug, display, editor, erc, fine_tune, newbttv, ++- oldbttv ++ ++3. Coding style cleanups (no superfluous comments, not more than ++ 80 characters per column, no uncommented code. ++ ++4. No strange characters in the outfile, latin alphabet in purity instead. ++ ++5. Alevt can be started in 4 modes now if you are running it in DVB mode: ++ ++- by service id (sid) ++- by teletext pid (ttpid) ++- by channel name ++- without parameter ++ ++6. Starting it in DVB mode on the command line it presents you ++a table with human readable values such as sid, teletext pid, ++PMT (Program Map Table), provider name, service name, language, service type. ++This makes it easier for you to start multiple teletext windows ++in multiple console sessions manually. ++ ++If working with a script and the option -o (outfile) you can ++also start multiple teletext windows of all channels in a transponder. ++I develop a GUI using TCL / TK 8.5 and Iwidgets 4.01 to do that and other ++tasks graphically (i. e. by mouse click). ++ ++7. If you install the program on the command line by typing "make & ++ make install" there is an uninstaller now to revert the installation: ++ "make uninstall". ++ ++ENJOY IT! ++ ++Uwe Bugla, February 11th, 2010. ++ ++External dependencies ++ ++AleVT needs some system libraries to be installed in your system. ++They are zlib, libX11, libpng and libzvbi. ++ ++Credits go to: ++- Andreas Rottmann from debian.org for compiler fixes and ++ other kinds of investigation. ++- Francesco Lavra for supplying a kernel patch to avoid kernel demux ++ incompatibilities with kernels >= 2.6.32 ++- Andy Walls for helpful investigation in kernelspace ++- Edgar Toernig for providing the source version 1.6.2 and doing all the ++ development for the basic versions ++- Tom Zoerner for the implementation of libzvbi +diff -r af23d23c278b util/alevt/README.OLD +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/README.OLD Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,78 @@ ++Hi, Menden, 21 Sep 2000 ++ ++ This program decodes and displays Videotext/Teletext from a ++ /dev/vbi device. ++ ++ ++COMPILE & INSTALL: ++ ++ There's nothing to configure. A simple 'make' is all. ++ If you do not want png support remove the WITH_PNG in ++ the Makefile. Additionally, if you want a smaller font ++ uncomment the "FONT=neep9" line. ++ ++ It gives you 'alevt', 'alevt-date', and 'alevt-cap' and ++ their man pages 'alevt.1x', 'alevt-date.1', and 'alevt-cap.1'. ++ ++ You can install them where ever you want (i.e. /usr/local/bin). ++ The programs are self-contained and require no other files. ++ ++ NOTE: Be careful with 'make install'. It's just for me :-) ++ ++ ++PROBLEMS: ++ ++ If you have a lot of decoding errors (lot of these lightning symbols) ++ you may try pressing the 'f' and 'F' key. This allows fine tuning of ++ the decoder circuit. There's also a -finetune command line option. ++ This should only be necessary on really bad signals. ++ ++ Maybe, I add autotuning later... ++ ++ UPDATE: added autotuning. It's the default. If you add -debug the ++ the actions of the pll are printed to stdout. ++ ++ To get the old (pre finetune) behaviour start it with -finetune 0. ++ ++ UPDATE: disabled autotuning *g* sometimes it's too jumpy... ++ ++ ++ALEVT-DATE: ++ I added a little tool to set the system time from the videotext ++ time. The date is not interpreted (not even transmitted on some ++ channels). So it allows only adjustment of +/-12 hours. ++ The default allowed adjustment is limited to +/-2 hours (use ++ -delta to change). Without the -set option it just display ++ the date in the format of the date command. Look at strftime(3) ++ for possible control sequences you may use in the -format option. ++ ++ ++HACKING: ++ ++ If you want to play with the font size, you may resize it with ++ xv (xv font1.xbm). Just make sure, that its width is a multiple of ++ 32 and its height a multiple of 8. A simple make will create ++ a version of AleTV with the new font. Warning: a make clean ++ will erase font1.xbm. The next make will recreate font.xbm from ++ vtxt.bdf. ++ ++ AleVT has a built in page editor. If you start it with -editor ++ you may press 'E' to invoke it. For the usage you have to consult ++ the sources. (It's very crude!) ++ ++ ++TODO: (no specific order) ++ ++ - Error correction in alevt-cap ++ - Better language support. Internal 16-bit charset. ++ - Separated graphics. ++ - Rewrite the whole stuff. A networked teletext daemon and clients ++ that connect to it for display, capture, cgi, ... ++ ++ ++NEWER VERSIONS: ++ ++ The primary site of AleVT is http://goron.de/~froese ++ ++Have fun, ++Edgar Toernig (froese@gmx.de) +diff -r af23d23c278b util/alevt/ReadmeGR +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/ReadmeGR Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,28 @@ ++29-9-2003 ++ ++ ALEVT ++ patch alevt-1.6.3.rus.diff ++contrib sources alevt-1.6.3 ++ ++ ++ ++alevt -charset iso8859-7 ++ ++ ++ ++alevt -charset el ++ ++ : ++ font file vtxt-iso8859-7.bdf ++ bold ++ graphics (0x01 -0x1f) ++ ++ ++ ++ sl45sms@yahoo.gr ++ ++ ++ ++ http://go.to/sl45sms/alevt/index.html ++ ++ +diff -r af23d23c278b util/alevt/TODO +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/TODO Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++Hi, these are issues that I unfortunately cannot resolve myself: ++ ++1. graphical menu written in GKT2, to be used in general connection with ++ the outfile (-o) option. ++ ++2. for usage without script and outfile option: ++ DVB monitoring demon helping the program to rewrite the PAT when the ++ external player software has chosen a channel which is part of a ++ new transponder. ++ At the moment alevt hangs when the transponder is changed. ++ ++Uwe Bugla, February 11th, 2010. +diff -r af23d23c278b util/alevt/alevt-cap.1 +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt-cap.1 Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,53 @@ ++.TH alevt-cap 1 "February 07, 2010" ++.SH NAME ++alevt-cap \- capture teletext windows. ++.SH SYNOPSIS ++.B alevt-cap ++.RI [ options ] ++.br ++.SH DESCRIPTION ++This manual page documents briefly the ++.B alevt-cap ++commands. ++.PP ++\fBalevt-cap\fP is a program to capture teletext pages. ++.SH OPTIONS ++.TP ++.B \-cs -charset ++character set ++.TP ++.B \-f -format ++format to save ++.TP ++.B \-f help -format help ++lists available storage formats ++.TP ++.B \-h -help ++print this page ++.TP ++.B \-n -name ++page name to save ++.B \-t -timeout ++timeout ++.TP ++.B \-s -sid ++service pid ++.TP ++.B \-t -ttpid ++teletext pid ++.TP ++.B \-v -vbi ++vbi device ++.TP ++Sequence: /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0 ++.TP ++ppp.ss stands for a page number and an optional ++subpage number (example: 123.4). ++.TP ++.SH SEE ALSO ++.BR alevt-date (1) , alevt (1). ++.br ++.SH AUTHOR ++alevt-cap was written by Edgar Toernig . ++.PP ++This manual page was written by Uwe Bugla . +diff -r af23d23c278b util/alevt/alevt-cap.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt-cap.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,280 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "vt.h" ++#include "misc.h" ++#include "fdset.h" ++#include "vbi.h" ++#include "lang.h" ++#include "dllist.h" ++#include "export.h" ++ ++static volatile int timed_out = 0; ++static char *channel; ++char *outfile = ""; ++u_int16_t sid; ++ ++ ++struct req ++{ ++ struct dl_node node[1]; ++ char *name; // file name ++ char *pgno_str; // the pgno as given on the cmdline ++ int pgno, subno; // decoded pgno ++ struct export *export; // export data ++ struct vt_page vtp[1]; // the capture page data ++}; ++ ++ ++static void usage(FILE *fp, int exitval) ++{ ++ fprintf(fp, "\nUsage: %s [options] ppp.ss...\n", prgname); ++ fprintf(fp, ++ "\n" ++ " Valid options:\t\tDefault:\n" ++ " -cs -charset\t\tlatin-1\n" ++ " \n" ++ " -f -format \tascii\n" ++ " -f help -format help\n" ++ " -h -help\n" ++ " -n -name \t\tttext-%%s.%%e\n" ++ " -s -sid \t\t(none;dvb only)\n" ++ " -to -timeout \t\t(none)\n" ++ " -t -ttpid \t\t(none;dvb only)\n" ++ " -v -vbi \t\t/dev/vbi\n" ++ " \t\t/dev/vbi0\n" ++ " \t\t/dev/video0\n" ++ " \t\t/dev/dvb/adapter0/demux0\n" ++ "\n" ++ " ppp.ss stands for a page number and an\n" ++ " optional subpage number (ie 123.4).\n" ++ ); ++ exit(exitval); ++} ++ ++ ++static void exp_help(FILE *fp) ++{ ++ struct export_module **ep; ++ char **cp, c; ++ ++ fprintf(fp, ++ "\nSyntax: -format Name[,Options]\n" ++ "\n" ++ " Name\tExt.\tOptions\n" ++ " --------------------------------\n" ++ ); ++ for (ep = modules; *ep; ep++) ++ { ++ fprintf(fp, " %-7s\t.%-4s", (*ep)->fmt_name, (*ep)->extension); ++ for (c = '\t', cp = (*ep)->options; cp && *cp; cp++, c = ',') ++ fprintf(fp, "%c%s", c, *cp); ++ fprintf(fp, "\n"); ++ } ++ fprintf(fp, ++ "\n" ++ "Common options: reveal,hide\n" ++ "Example: -format ansi,reveal,bg=none\n" ++ "\n" ++ ); ++ exit(0); ++} ++ ++ ++static int arg_pgno(char *p, int *subno) ++{ ++ char *end; ++ int pgno; ++ ++ *subno = ANY_SUB; ++ if (*p) ++ { ++ pgno = strtol(p, &end, 16); ++ if ((*end == ':' || *end == '/' || *end == '.') && end[1]) ++ *subno = strtol(end + 1, &end, 16); ++ if (*end == 0) ++ if (pgno >= 0x100 && pgno <= 0x899) ++ if (*subno == ANY_SUB || (*subno >= 0x00 && *subno <= 0x3f7f)) ++ return pgno; ++ } ++ fatal("%s: invalid page number", p); ++} ++ ++ ++static int option(int argc, char **argv, int *ind, char **arg) ++{ ++ static struct { char *nam, *altnam; int arg; } opts[] = { ++ { "-charset", "-cs", 1 }, ++ { "-format", "-f", 1 }, ++ { "-help", "-h", 0 }, ++ { "-name", "-n", 1 }, ++ { "-sid", "-s", 1 }, ++ { "-timeout", "-to", 1 }, ++ { "-ttpid", "-t", 1 }, ++ { "-vbi", "-v", 1 }, ++ }; ++ int i; ++ ++ if (*ind >= argc) ++ return 0; ++ ++ *arg = argv[(*ind)++]; ++ for (i = 0; i < NELEM(opts); ++i) ++ if (streq(*arg, opts[i].nam) || streq(*arg, opts[i].altnam)) ++ { ++ if (opts[i].arg) ++ if (*ind < argc) ++ *arg = argv[(*ind)++]; ++ else ++ fatal("option %s requires an argument", *arg); ++ return i+1; ++ } ++ ++ if (**arg == '-') ++ { ++ fatal("%s: invalid option", *arg); ++ usage(stderr, 2); ++ } ++ ++ return -1; ++} ++ ++ ++static void event(struct dl_head *reqs, struct vt_event *ev) ++{ ++ struct req *req, *nxt; ++ ++ switch (ev->type) ++ { ++ case EV_PAGE: // new page ++ { ++ struct vt_page *vtp = ev->p1; ++ ++ for (req = PTR reqs->first; nxt = PTR req->node->next; req = nxt) ++ if (req->pgno == vtp->pgno) ++ if (req->subno == ANY_SUB || req->subno == vtp->subno) ++ { ++ *req->vtp = *vtp; ++ dl_insert_last(reqs + 1, dl_remove(req->node)); ++ } ++ } ++ } ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ char *vbi_name = NULL; ++ int timeout = 0; ++ char *fname = "ttext-%s.%e"; ++ char *out_fmt = "ascii"; ++ struct export *fmt = 0; ++ int opt, ind; ++ char *arg; ++ struct vbi *vbi; ++ struct req *req; ++ struct dl_head reqs[2]; // simple linear lists of requests & captures ++ int ttpid = -1; ++ ++ setlocale (LC_CTYPE, ""); ++ setprgname(argv[0]); ++ ++ fdset_init(fds); ++ dl_init(reqs); // the requests ++ dl_init(reqs+1); // the captured pages ++ ++ ind = 1; ++ while (opt = option(argc, argv, &ind, &arg)) ++ switch (opt) ++ { ++ case 1: // charset ++ if (streq(arg, "latin-1") || streq(arg, "1")) ++ latin1 = 1; ++ else if (streq(arg, "latin-2") || streq(arg, "2")) ++ latin1 = 0; ++ else if (streq(arg, "koi8-r") || streq(arg, "koi")) ++ latin1 = KOI8; ++ else if (streq(arg, "iso8859-7") || streq(arg, "el")) ++ latin1 = GREEK; ++ else ++ fatal("bad charset (not latin-1/2/koi8-r/iso8859-7)"); ++ break; ++ case 2: // format ++ if (streq(arg, "help") || streq(arg, "?") || streq(arg, "list")) ++ exp_help(stdout); ++ out_fmt = arg; ++ fmt = 0; ++ break; ++ case 3: // help ++ usage(stdout, 0); ++ break; ++ case 4: // name ++ fname = arg; ++ break; ++ case 5: // timeout ++ timeout = strtol(arg, 0, 10); ++ if (timeout < 1 || timeout > 999999) ++ fatal("bad timeout value", timeout); ++ break; ++ case 6: // service id ++ sid = strtoul(arg, NULL, 0); ++ break; ++ case 7: // teletext pid ++ ttpid = strtoul(arg, NULL, 0); ++ break; ++ case 8: // vbi ++ vbi_name = arg; ++ break; ++ case -1: // non-option arg ++ if (not fmt) ++ fmt = export_open(out_fmt); ++ if (not fmt) ++ fatal("%s", export_errstr()); ++ if (not(req = malloc(sizeof(*req)))) ++ out_of_mem(sizeof(*req)); ++ req->name = fname; ++ req->pgno_str = arg; ++ req->pgno = arg_pgno(arg, &req->subno); ++ req->export = fmt; ++ dl_insert_last(reqs, req->node); ++ break; ++ } ++ ++ if (dl_empty(reqs)) ++ fatal("no pages requested"); ++ ++ // setup device ++ if (not(vbi = vbi_open(vbi_name, 0, channel, outfile, sid, ttpid))) ++ fatal("cannot open %s", vbi_name); ++ vbi_add_handler(vbi, event, reqs); // register event handler ++ ++ if (timeout) ++ alarm(timeout); ++ ++ // capture pages (moves requests from reqs[0] to reqs[1]) ++ while (not dl_empty(reqs) && not timed_out) ++ if (fdset_select(fds, 30000) == 0) // 30sec select time out ++ { ++ error("no signal."); ++ break; ++ } ++ ++ alarm(0); ++ vbi_del_handler(vbi, event, reqs); ++ vbi_close(vbi); ++ if (not dl_empty(reqs)) ++ error("capture aborted. Some pages are missing."); ++ ++ for (req = PTR reqs[1].first; req->node->next; req = PTR req->node->next) ++ { ++ fname = export_mkname(req->export, req->name, req->vtp, req->pgno_str); ++ if (not fname || export(req->export, req->vtp, fname)) ++ error("error saving page %s: %s", req->pgno_str, export_errstr()); ++ if (fname) ++ free(fname); ++ } ++ exit(dl_empty(reqs) ? 0 : 1); ++} +diff -r af23d23c278b util/alevt/alevt-date.1 +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt-date.1 Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,41 @@ ++.TH alevt-date 1 "February 07, 2010" ++.SH NAME ++alevt-date \- print out UTC date. ++.SH SYNOPSIS ++.B alevt-date ++.RI [ options ] ++.br ++.SH DESCRIPTION ++This manual page documents briefly the ++.B alevt-date ++commands. ++.PP ++\fBalevt-date\fP is a program to print the UTC date. ++.SH OPTIONS ++.TP ++.B \-d -delta ++maximum delta ++.TP ++.B \-f -format ++time format ++.TP ++.B \-h -help ++print this page ++.TP ++.B \-s -set ++set the system clock ++.TP ++.B \-t -timeout ++timeout ++.TP ++.B \-v -vbi ++vbi device /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0 ++.TP ++.br ++.SH SEE ALSO ++.BR alevt-cap (1) , alevt (1). ++.br ++.SH AUTHOR ++alevt-date was written by Edgar Toernig . ++.PP ++This manual page was written by Uwe Bugla . +diff -r af23d23c278b util/alevt/alevt-date.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt-date.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,225 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "os.h" ++#include "vt.h" ++#include "fdset.h" ++#include "vbi.h" ++#include "lang.h" ++#include "misc.h" ++ ++char *fmt = "%a %b %d %H:%M:%S %Z %Y"; ++int max_diff = 2*60*60; // default: 2 hours ++int set_time = 0; ++char *outfile = ""; ++static char *channel; ++u_int16_t sid; ++ ++ ++static void chk_time(int t) ++{ ++ struct tm *tm; ++ time_t sys_t; ++ int dt; ++ char buf[256]; ++ ++ if (t < 0 || t > 235959 || t%100 > 59 || t/100%100 > 59) ++ return; ++ ++ sys_t = time(0); ++ tm = localtime(&sys_t); ++ ++ // Now convert to UTC seconds ++ t = t/100/100 * 60*60 + t/100%100 * 60 + t%100; ++#ifdef BSD ++ t -= tm->tm_gmtoff; // dst already included... ++#else ++ t += timezone; ++ if (tm->tm_isdst) ++ t -= 60*60; ++#endif ++ ++ dt = t - sys_t % (24*60*60); ++ if (dt <= -12*60*60) ++ dt += 24*60*60; ++ ++ if (dt <= -max_diff || dt >= max_diff) ++ fatal("time diff too big (%2d:%02d:%02d)", dt/60/60, abs(dt)/60%60, abs(dt)%60); ++ ++ sys_t += dt; ++ ++ if (set_time) ++ { ++ struct timeval tv[1]; ++ ++ tv->tv_sec = sys_t; ++ tv->tv_usec = 500000; ++ if (settimeofday(tv, 0) == -1) ++ ioerror("settimeofday"); ++ } ++ if (*fmt) ++ { ++ tm = localtime(&sys_t); ++ if (strftime(buf, sizeof(buf), fmt, tm)) ++ puts(buf); ++ } ++ exit(0); ++} ++ ++ ++static void event(void *_, struct vt_event *ev) ++{ ++ switch (ev->type) ++ { ++ /* vbi may generate EV_PAGE, EV_HEADER, EV_XPACKET */ ++ /* for event arguments see vt.h */ ++ ++ case EV_HEADER: // a new title line (for running headers) ++ { ++ static int last_t = -1; ++ u8 *s = ev->p1; ++ int i, t = 1; ++ ++ if (ev->i2 & PG_OUTOFSEQ) ++ break; ++ ++ for (i = 32; i < 40; ++i) ++ if (s[i] >= '0' && s[i] <= '9') ++ t = t * 10+ s[i] - '0'; ++ if (t >= 1000000 && t <= 1235959) ++ if (t == last_t || t - last_t == 1) ++ chk_time(t - 1000000); ++ last_t = t; ++ break; ++ } ++ } ++} ++ ++ ++static void usage(FILE *fp, int exit_val) ++{ ++ fprintf(fp, "usage: %s [options]\n", prgname); ++ fprintf(fp, ++ "\n" ++ " Valid options:\t\tDefault:\n" ++ " -d -delta \t7200 (2 hours)\n" ++ " -f -format \t\t%%c\n" ++ " -h -help\n" ++ " -s -set\t\t\toff\n" ++ " -to -timeout \t(none)\n" ++ " -v -vbi \t\t/dev/vbi\n" ++ " \t\t/dev/vbi0\n" ++ " \t\t/dev/video0\n" ++ " \t\t/dev/dvb/adapter0/demux0\n" ++ ); ++ exit(exit_val); ++} ++ ++ ++static int option(int argc, char **argv, int *ind, char **arg) ++{ ++ static struct { char *nam, *altnam; int arg; } opts[] = { ++ { "-delta", "-d", 1 }, ++ { "-format", "-f", 1 }, ++ { "-help", "-h", 0 }, ++ { "-set", "-s", 0 }, ++ { "-timeout", "-to", 1 }, ++ { "-vbi", "-v", 1 }, ++ }; ++ int i; ++ ++ if (*ind >= argc) ++ return 0; ++ ++ *arg = argv[(*ind)++]; ++ for (i = 0; i < NELEM(opts); ++i) ++ if (streq(*arg, opts[i].nam) || streq(*arg, opts[i].altnam)) ++ { ++ if (opts[i].arg) ++ if (*ind < argc) ++ *arg = argv[(*ind)++]; ++ else ++ fatal("option %s requires an argument", *arg); ++ return i+1; ++ } ++ ++ if (**arg == '-') ++ { ++ fatal("%s: invalid option", *arg); ++ usage(stderr, 1); ++ } ++ ++ return -1; ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ char *vbi_name = NULL; ++ int timeout = 0; ++ struct vbi *vbi; ++ int opt, ind; ++ char *arg; ++ int ttpid = -1; ++ ++ setprgname(argv[0]); ++ ind = 1; ++ while (opt = option(argc, argv, &ind, &arg)) ++ switch (opt) ++ { ++ case 1: // -delta ++ max_diff = atoi(arg); ++ if (max_diff < 1) ++ fatal("-delta: illegal value '%s'", arg); ++ if (max_diff > 12*60*60) ++ { ++ max_diff = 12*60*60; ++ error("-delta: %d too big. Assuming %d", arg, max_diff); ++ } ++ break; ++ case 2: // -format ++ fmt = arg; ++ break; ++ case 3: // help ++ usage(stdout, 0); ++ break; ++ case 4: // -set ++ set_time = 1; ++ break; ++ case 5: // -timeout ++ timeout = atoi(arg); ++ if (timeout < 1 || timeout > 60*60) ++ fatal("-timeout: illegal value '%s'", arg); ++ break; ++ case 6: // -vbi ++ vbi_name = arg; ++ break; ++ case -1: ++ usage(stderr, 1); ++ break; ++ } ++ ++ fdset_init(fds); ++ ++ if (timeout) ++ { ++ signal(SIGALRM, SIG_DFL); // kill me ++ alarm(timeout); ++ } ++ vbi = vbi_open(vbi_name, 0, channel, outfile, sid, ttpid); // open device ++ if (not vbi) ++ fatal_ioerror(vbi_name); ++ vbi_add_handler(vbi, event, 0); // register event handler ++ ++ for (;;) ++ fdset_select(fds, -1); // call scheduler ++ ++ /* never reached */ ++ vbi_del_handler(vbi, event, 0); ++ vbi_close(vbi); ++ exit(0); ++} +diff -r af23d23c278b util/alevt/alevt.1 +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt.1 Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,60 @@ ++.TH alevt 1 "February 07, 2010" ++.SH NAME ++alevt \- a teletext browser for analogue and DVB channels. ++.SH SYNOPSIS ++.B alevt ++.RI [ options ] ++.br ++.SH DESCRIPTION ++This manual page documents briefly the ++.B alevt ++commands. ++.PP ++\fBalevt\fP is a program to read teletext from analogue or DVB channels. ++.SH OPTIONS ++.TP ++.B \-c ++channel name (dvb only) ++.TP ++.B \-ch -child ++child window ++.TP ++.B \-cs -charset ++character set ++.TP ++.B \-h -help ++print this page ++.TP ++.B \-o ++path + file for all services (dvb only) ++.TP ++.B \-p -parent ++parent window ++.TP ++.B \-s -sid ++service id (dvb only) ++.TP ++.B \-t -ttpid ++teletext pid (dvb only) ++.TP ++.B \-v -vbi ++vbi device ++.TP ++Sequence: /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0 ++.TP ++Order is important! Each page number opens a new window ++with the previously given geometry, device, and display. ++.TP ++ppp.ss stands for a page number and an optional ++subpage number (example: 123.4). ++.TP ++The -child option requires a parent window. So it must ++be preceded by a parent or another child window. ++.TP ++.SH SEE ALSO ++.BR alevt-cap (1), alevt-date (1). ++.br ++.SH AUTHOR ++alevt was written by Edgar Toernig . ++.PP ++This manual page was written by Uwe Bugla . +diff -r af23d23c278b util/alevt/alevt.desktop +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/alevt.desktop Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,9 @@ ++[Desktop Entry] ++Encoding=UTF-8 ++Name=alevt ++Comment=Teletext Browser ++Exec=alevt ++Icon=alevt ++Terminal=false ++Type=Application ++Categories=GNOME;GTK;AudioVideo;Video; +diff -r af23d23c278b util/alevt/bdf2xbm.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/bdf2xbm.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,212 @@ ++/* ++ Simple program to convert a bdf-font to a bitmap. ++ The characters are arranged in a 32x8 matrix. ++ usage: bdf2xbm [identifier] xbm ++ Copyright 1998,1999 by E. Toernig (froese@gmx.de) ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define not ! ++#define streq(a,b) (strcmp((a),(b)) == 0) ++ ++int lineno; ++char *word[64]; ++int nword; ++ ++char *font = "font%dx%d"; ++int w, h, bpl; ++unsigned char *bmap; ++ ++ ++static void error(char *fmt, ...) ++{ ++ va_list args; ++ ++ va_start(args, fmt); ++ fprintf(stderr, "bdf2xbm"); ++ if (lineno) ++ fprintf(stderr, ":%d", lineno); ++ fprintf(stderr, ": "); ++ vfprintf(stderr, fmt, args); ++ fputc('\n', stderr); ++ exit(1); ++} ++ ++ ++static int nextline() ++{ ++ static char buf[256]; ++ char *p; ++ int i; ++ ++ do ++ { ++ nword = 0; ++ if (fgets(buf, sizeof(buf), stdin) == 0) ++ return nword; ++ lineno++; ++ ++ p = buf; ++ for (;;) ++ { ++ while (isspace(*p)) ++ p++; ++ if (*p == 0) ++ break; ++ word[nword++] = p; ++ while (*p && not isspace(*p)) ++ *p = toupper(*p), p++; ++ if (*p == 0) ++ break; ++ *p++ = 0; ++ } ++ } while (nword == 0); ++ ++ for (i = nword; i < 64; ++i) ++ word[i] = ""; ++ return nword; ++} ++ ++ ++static inline void setbit(int ch, int x, int y) ++{ ++ ++ int yo = ch / 32 * h + y; ++ int xo = ch % 32 * w + x; ++ ++ bmap[yo * bpl + xo / 8] |= 1 << (xo % 8); ++} ++ ++ ++static void dobitmap(int ch, int x, int y) ++{ ++ int i, j; ++ ++ for (i = 0; i < y; ++i) ++ { ++ nextline(); ++ if (nword > 1 || strlen(word[0]) != (x + 7) / 8 * 2) ++ error("bad BITMAP"); ++ for (j = 0; j < x; ++j) ++ { ++ int c = word[0][j / 4]; ++ if (c >= '0' && c <= '9') ++ c -= '0'; ++ else if (c >= 'A' && c <= 'F') ++ c -= 'A' - 10; ++ else ++ error("bad hexchar in BITMAP"); ++ if (c & (8 >> (j % 4))) ++ setbit(ch, j, i); ++ } ++ } ++} ++ ++ ++static void dochar() ++{ ++ int ch = -1, x = -1, y = -1; ++ ++ while (nextline()) ++ { ++ if (streq(word[0], "ENDCHAR")) ++ return; ++ else if (streq(word[0], "ENCODING") && nword == 2) ++ { ++ ch = atoi(word[1]); ++ if (ch < 0 || ch > 255) ++ error("bad character code %d", ch); ++ } ++ else if (streq(word[0], "BBX") && nword == 5) ++ { ++ x = atoi(word[1]), y = atoi(word[2]); ++ if (x < 1 || x > 64 || y < 1 || y > 64) ++ error("bad BBX (%dx%d)", x, y); ++ } ++ else if (streq(word[0], "BITMAP")) ++ { ++ if (x < 0) ++ error("missing BBX"); ++ if (ch < 0) ++ error("missing ENDCODING"); ++ dobitmap(ch, x, y); ++ } ++ } ++ error("unexpected EOF (missing ENDCHAR)"); ++} ++ ++ ++static void dofile() ++{ ++ lineno = 0; ++ w = h = 0; ++ bmap = 0; ++ ++ nextline(); ++ if (nword != 2 || not streq(word[0], "STARTFONT")) ++ error("not a bdf-file"); ++ ++ while (nextline()) ++ { ++ if (streq(word[0], "ENDFONT")) ++ return; ++ else if (streq(word[0], "FONTBOUNDINGBOX") && nword == 5) ++ { ++ if (bmap) ++ error("multiple FONTBOUNDINGBOXes!?!"); ++ w = atoi(word[1]), h = atoi(word[2]); ++ if (w < 1 || w > 64 || h < 1 || h > 64) ++ error("bad bounding box %dx%d\n", w, h); ++ bpl = (w*32+7)/8; // rounding is unnecessary ++ bmap = calloc(1, bpl * h*8); ++ if (bmap == 0) ++ error("out of memory"); ++ } ++ else if (streq(word[0], "STARTCHAR")) ++ { ++ if (not bmap) ++ error("no FONTBOUNDINGBOX"); ++ dochar(); ++ } ++ } ++ error("unexpected EOF (missing ENDFONT)"); ++} ++ ++ ++static void writexbm() ++{ ++ char buf[256]; ++ int i, j; ++ unsigned char *p = bmap; ++ ++ if (not bmap) ++ return; ++ ++ sprintf(buf, font, w, h); ++ ++ printf("#define %s_width %d\n", buf, 32 * w); ++ printf("#define %s_height %d\n", buf, 8 * h); ++ printf("static unsigned char %s_bits[] = {\n", buf); ++ for (i = 0; i < 16 * h * w / 8; ++i) ++ { ++ for (j = 0; j < 16; ++j) ++ printf("0x%02x,", *p++); ++ printf("\n"); ++ } ++ printf("};\n"); ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ if (argc > 1) ++ font = argv[1]; ++ dofile(); ++ writexbm(); ++ exit(0); ++} +diff -r af23d23c278b util/alevt/cache.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/cache.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,229 @@ ++#include ++#include ++#include "misc.h" ++#include "dllist.h" ++#include "cache.h" ++#include "help.h" ++ ++ ++static inline int hash(int pgno) ++{ ++ // very simple... ++ return pgno % HASH_SIZE; ++} ++ ++ ++static void do_erc(struct vt_page *ovtp, struct vt_page *nvtp) ++{ ++ int l, c; ++ ++ if (nvtp->errors == 0 && ovtp->lines == nvtp->lines) ++ return; ++ ++ for (l = 0; l < H; ++l) ++ { ++ if (~nvtp->lines & (1 << l)) ++ memcpy(nvtp->data[l], ovtp->data[l], W); ++ else if (ovtp->lines & (1 << l)) ++ for (c = 0; c < W; ++c) ++ if (nvtp->data[l][c] == BAD_CHAR) ++ nvtp->data[l][c] = ovtp->data[l][c]; ++ } ++ nvtp->lines |= ovtp->lines; ++} ++ ++ ++static void cache_close(struct cache *ca) ++{ ++ struct cache_page *cp; ++ int i; ++ ++ for (i = 0; i < HASH_SIZE; ++i) ++ while (not dl_empty(ca->hash + i)) ++ { ++ cp = PTR ca->hash[i].first; ++ dl_remove(cp->node); ++ free(cp); ++ } ++ free(ca); ++} ++ ++ ++static void cache_reset(struct cache *ca) ++{ ++ struct cache_page *cp, *cpn; ++ int i; ++ ++ for (i = 0; i < HASH_SIZE; ++i) ++ for (cp = PTR ca->hash[i].first; cpn = PTR cp->node->next; cp = cpn) ++ if (cp->page->pgno / 256 != 9) // don't remove help pages ++ { ++ dl_remove(cp->node); ++ free(cp); ++ ca->npages--; ++ } ++ memset(ca->hi_subno, 0, sizeof(ca->hi_subno[0]) * 0x900); ++} ++ ++/* Get a page from the cache. ++ If subno is SUB_ANY, the newest subpage of that page is returned */ ++ ++ ++static struct vt_page * cache_get(struct cache *ca, int pgno, int subno) ++{ ++ struct cache_page *cp; ++ int h = hash(pgno); ++ ++ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next) ++ if (cp->page->pgno == pgno) ++ if (subno == ANY_SUB || cp->page->subno == subno) ++ { ++ // found, move to front (make it 'new') ++ dl_insert_first(ca->hash + h, dl_remove(cp->node)); ++ return cp->page; ++ } ++ return 0; ++} ++ ++/* Put a page in the cache. ++ If it's already there, it is updated. */ ++ ++ ++static struct vt_page * cache_put(struct cache *ca, struct vt_page *vtp) ++{ ++ struct cache_page *cp; ++ int h = hash(vtp->pgno); ++ ++ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next) ++ if (cp->page->pgno == vtp->pgno && cp->page->subno == vtp->subno) ++ break; ++ ++ if (cp->node->next) ++ { ++ // move to front. ++ dl_insert_first(ca->hash + h, dl_remove(cp->node)); ++ if (ca->erc) ++ do_erc(cp->page, vtp); ++ } ++ else ++ { ++ cp = malloc(sizeof(*cp)); ++ if (cp == 0) ++ return 0; ++ if (vtp->subno >= ca->hi_subno[vtp->pgno]) ++ ca->hi_subno[vtp->pgno] = vtp->subno + 1; ++ ca->npages++; ++ dl_insert_first(ca->hash + h, cp->node); ++ } ++ ++ *cp->page = *vtp; ++ return cp->page; ++} ++ ++/* Same as cache_get but doesn't make the found entry new */ ++ ++ ++static struct vt_page * cache_lookup(struct cache *ca, int pgno, int subno) ++{ ++ struct cache_page *cp; ++ int h = hash(pgno); ++ ++ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next) ++ if (cp->page->pgno == pgno) ++ if (subno == ANY_SUB || cp->page->subno == subno) ++ return cp->page; ++ return 0; ++} ++ ++ ++static struct vt_page * cache_foreach_pg(struct cache *ca, int pgno, int subno, ++ int dir, int (*func)(), void *data) ++{ ++ struct vt_page *vtp, *s_vtp = 0; ++ ++ if (ca->npages == 0) ++ return 0; ++ ++ if (vtp = cache_lookup(ca, pgno, subno)) ++ subno = vtp->subno; ++ else if (subno == ANY_SUB) ++ subno = dir < 0 ? 0 : 0xffff; ++ ++ for (;;) ++ { ++ subno += dir; ++ while (subno < 0 || subno >= ca->hi_subno[pgno]) ++ { ++ pgno += dir; ++ if (pgno < 0x100) ++ pgno = 0x9ff; ++ if (pgno > 0x9ff) ++ pgno = 0x100; ++ subno = dir < 0 ? ca->hi_subno[pgno] - 1 : 0; ++ } ++ if (vtp = cache_lookup(ca, pgno, subno)) ++ { ++ if (s_vtp == vtp) ++ return 0; ++ if (s_vtp == 0) ++ s_vtp = vtp; ++ if (func(data, vtp)) ++ return vtp; ++ } ++ } ++} ++ ++ ++static int cache_mode(struct cache *ca, int mode, int arg) ++{ ++ int res = -1; ++ ++ switch (mode) ++ { ++ case CACHE_MODE_ERC: ++ res = ca->erc; ++ ca->erc = arg ? 1 : 0; ++ break; ++ } ++ return res; ++} ++ ++ ++static struct cache_ops cops = ++{ ++ cache_close, ++ cache_get, ++ cache_put, ++ cache_reset, ++ cache_foreach_pg, ++ cache_mode, ++}; ++ ++ ++struct cache * cache_open(void) ++{ ++ struct cache *ca; ++ struct vt_page *vtp; ++ int i; ++ ++ if (not(ca = malloc(sizeof(*ca)))) ++ goto fail1; ++ ++ for (i = 0; i < HASH_SIZE; ++i) ++ dl_init(ca->hash + i); ++ ++ memset(ca->hi_subno, 0, sizeof(ca->hi_subno)); ++ ca->erc = 1; ++ ca->npages = 0; ++ ca->op = &cops; ++ ++ for (vtp = help_pages; vtp < help_pages + nr_help_pages; vtp++) ++ cache_put(ca, vtp); ++ ++ return ca; ++ ++fail2: ++ free(ca); ++fail1: ++ return 0; ++} +diff -r af23d23c278b util/alevt/cache.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/cache.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,41 @@ ++#ifndef CACHE_H ++#define CACHE_H ++ ++#include "vt.h" ++#include "misc.h" ++#include "dllist.h" ++ ++#define HASH_SIZE 113 ++ ++ ++struct cache ++{ ++ struct dl_head hash[HASH_SIZE]; ++ int erc; // error reduction circuit on ++ int npages; ++ u16 hi_subno[0x9ff + 1]; // 0:pg not in cache, 1-3f80:highest subno + 1 ++ struct cache_ops *op; ++}; ++ ++ ++struct cache_page ++{ ++ struct dl_node node[1]; ++ struct vt_page page[1]; ++}; ++ ++ ++struct cache_ops ++{ ++ void (*close)(struct cache *ca); ++ struct vt_page *(*get)(struct cache *ca, int pgno, int subno); ++ struct vt_page *(*put)(struct cache *ca, struct vt_page *vtp); ++ void (*reset)(struct cache *ca); ++ struct vt_page *(*foreach_pg)(struct cache *ca, int pgno, int subno, int dir, ++ int (*func)(), void *data); ++ int (*mode)(struct cache *ca, int mode, int arg); ++}; ++ ++struct cache *cache_open(void); ++#define CACHE_MODE_ERC 1 ++#endif +diff -r af23d23c278b util/alevt/dllist.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/dllist.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,55 @@ ++#ifndef DLLIST_H ++#define DLLIST_H ++ ++ ++struct dl_node ++{ ++ struct dl_node *next; ++ struct dl_node *prev; ++}; ++ ++ ++struct dl_head ++{ ++ struct dl_node *first; ++ struct dl_node *null; ++ struct dl_node *last; ++}; ++ ++ ++static inline struct dl_head * dl_init(struct dl_head *h) ++{ ++ h->first = (struct dl_node *)&h->null; ++ h->null = 0; ++ h->last = (struct dl_node *)&h->first; ++ return h; ++} ++ ++ ++static inline struct dl_node * dl_remove(struct dl_node *n) ++{ ++ n->prev->next = n->next; ++ n->next->prev = n->prev; ++ return n; ++} ++ ++ ++static inline struct dl_node * ++ dl_insert_after(struct dl_node *p, struct dl_node *n) ++{ ++ n->next = p->next; ++ n->prev = p; ++ p->next = n; ++ n->next->prev = n; ++ return n; ++} ++ ++#define dl_empty(h) ((h)->first->next == 0) ++#define dl_insert_before(p, n) dl_insert_after((p)->prev, (n)) ++#define dl_insert_first(h, n) ({ struct dl_node *_n = (n); \ ++ dl_insert_before((h)->first, _n); }) ++#define dl_insert_last(h, n) ({ struct dl_node *_n = (n); \ ++ dl_insert_after((h)->last, _n); }) ++#define dl_remove_first(h) dl_remove((h)->first) // mustn't be empty! ++#define dl_remove_last(h) dl_remove((h)->last) // mustn't be empty! ++#endif +diff -r af23d23c278b util/alevt/exp-gfx.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/exp-gfx.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,258 @@ ++/* Copyright 1999 by Paul Ortyl */ ++ ++#include ++#include ++#include ++#include "lang.h" ++#include "export.h" ++#include "font.h" ++#define WW (W*CW) /* pixel width of window */ ++#define WH (H*CH) /* pixel hegiht of window */ ++ ++ ++static inline void draw_char(unsigned char * colour_matrix, int fg, int bg, ++ int c, int dbl, int _x, int _y, int sep) ++{ ++ int x,y; ++ unsigned char* src= (latin1==LATIN1 ? font1_bits : font2_bits); ++ int dest_x=_x*CW; ++ int dest_y=_y*CH; ++ ++ for(y=0;y<(CH<>dbl))*CW*32+ c%32*CW +x; ++ bit=(*(src+bitnr/8))&(1<>dbl))*CW*32+ 0xa0%32*CW +x; ++ maskbit=(*(src+maskbitnr/8))&(1<dbl & (1<<(y-1))) ++ { ++ if (pg->data[y-1][x].attr & EA_HDOUBLE) ++ draw_char(colour_matrix, pg->data[y][x].fg, ++ pg->data[y][x].bg, pg->data[y][x].ch, ++ (0), ++ x, y, ++ ((pg->data[y][x].attr & EA_SEPARATED) ? 1 : 0) ++ ); ++ } ++ else ++ { ++ draw_char(colour_matrix, pg->data[y][x].fg, ++ pg->data[y][x].bg, pg->data[y][x].ch, ++ ((pg->data[y][x].attr & EA_DOUBLE) ? 1 : 0), ++ x, y, ++ ((pg->data[y][x].attr & EA_SEPARATED) ? 1 : 0) ++ ); ++ } ++ } ++ } ++ return; ++} ++ ++ ++static int ppm_output(struct export *e, char *name, struct fmt_page *pg); ++ ++struct export_module export_ppm = // exported module definition ++{ ++ "ppm", // id ++ "ppm", // extension ++ 0, // options ++ 0, // size ++ 0, // open ++ 0, // close ++ 0, // option ++ ppm_output // output ++}; ++ ++ ++static int ppm_output(struct export *e, char *name, struct fmt_page *pg) ++{ ++ FILE *fp; ++ long n; ++ static u8 rgb1[][3]={{0,0,0}, ++ {1,0,0}, ++ {0,1,0}, ++ {1,1,0}, ++ {0,0,1}, ++ {1,0,1}, ++ {0,1,1}, ++ {1,1,1}}; ++ unsigned char *colour_matrix; ++ ++ if (!(colour_matrix=malloc(WH*WW))) ++ { ++ export_error("cannot allocate memory"); ++ return 0; ++ } ++ ++ prepare_colour_matrix(/*e,*/ pg, (unsigned char *)colour_matrix); ++ if (not(fp = fopen(name, "w"))) ++ { ++ free(colour_matrix); ++ export_error("cannot create file"); ++ return -1; ++ } ++ fprintf(fp,"P6 %d %d 1\n", WW, WH); ++ ++ for(n=0;n ++static int png_open(struct export *e); ++static int png_option(struct export *e, int opt, char *arg); ++static int png_output(struct export *e, char *name, struct fmt_page *pg); ++static char *png_opts[] = // module options ++{ ++ "compression=<0-9>", // set compression level ++ 0 ++}; ++ ++struct png_data // private data in struct export ++{ ++ int compression; ++}; ++ ++struct export_module export_png = // exported module definition ++{ ++ "png", // id ++ "png", // extension ++ png_opts, // options ++ sizeof(struct png_data), // size ++ png_open, // open ++ 0, // close ++ png_option, // option ++ png_output // output ++}; ++ ++#define D ((struct png_data *)e->data) ++ ++ ++static int png_open(struct export *e) ++{ ++ D->compression = Z_DEFAULT_COMPRESSION; ++ return 0; ++} ++ ++ ++static int png_option(struct export *e, int opt, char *arg) ++{ ++ switch (opt) ++ { ++ case 1: // compression= ++ if (*arg >= '0' && *arg <= '9') ++ D->compression = *arg - '0'; ++ break; ++ } ++ return 0; ++} ++ ++ ++static int png_output(struct export *e, char *name, struct fmt_page *pg) ++{ ++ FILE *fp; ++ int x; ++ png_structp png_ptr; ++ png_infop info_ptr; ++ png_byte *row_pointers[WH]; ++ static u8 rgb8[][3]={{ 0, 0, 0}, ++ {255, 0, 0}, ++ { 0,255, 0}, ++ {255,255, 0}, ++ { 0, 0,255}, ++ {255, 0,255}, ++ { 0,255,255}, ++ {255,255,255}}; ++ unsigned char *colour_matrix; ++ ++ if (!(colour_matrix=malloc(WH*WW))) ++ { ++ export_error("cannot allocate memory"); ++ return -1; ++ } ++ prepare_colour_matrix(/*e,*/ pg, (unsigned char *)colour_matrix); ++ if (not(fp = fopen(name, "w"))) ++ { ++ free(colour_matrix); ++ export_error("cannot create file"); ++ return -1; ++ } ++ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, ++ NULL, NULL, NULL); ++ if (!png_ptr) ++ { ++ free(colour_matrix); ++ fclose(fp); ++ export_error("libpng init error"); ++ return -1; ++ } ++ info_ptr = png_create_info_struct(png_ptr); ++ if (!info_ptr) ++ { ++ png_destroy_write_struct(&png_ptr, ++ (png_infopp)NULL); ++ free(colour_matrix); ++ fclose(fp); ++ export_error("libpng init error"); ++ return -1; ++ } ++ png_init_io(png_ptr, fp); ++ png_set_compression_level(png_ptr, D->compression); ++ png_set_compression_mem_level(png_ptr, 9); ++ png_set_compression_window_bits(png_ptr, 15); ++ png_set_IHDR(png_ptr, info_ptr, WW, WH, ++ 8, PNG_COLOR_TYPE_PALETTE , PNG_INTERLACE_NONE, ++ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); ++ png_set_PLTE(png_ptr, info_ptr,(png_color*) rgb8 , 8); ++ png_write_info(png_ptr, info_ptr); ++ for(x=0; x */ ++ ++#include ++#include ++#include "lang.h" ++#include "export.h" ++ ++static int html_open(struct export *e); ++static int html_option(struct export *e, int opt, char *arg); ++static int html_output(struct export *e, char *name, struct fmt_page *pg); ++static char *html_opts[] = // module options ++{ ++ "gfx-chr=", // substitute for gfx-symbols ++ "bare", // no headers ++ 0 ++}; ++ ++struct html_data // private data in struct export ++{ ++ u8 gfx_chr; ++ u8 bare; ++}; ++ ++ ++struct export_module export_html = // exported module definition ++{ ++ "html", // id ++ "html", // extension ++ html_opts, // options ++ sizeof(struct html_data), // size ++ html_open, // open ++ 0, // close ++ html_option, // option ++ html_output // output ++}; ++ ++#define D ((struct html_data *)e->data) ++ ++ ++static int html_open(struct export *e) ++{ ++ D->gfx_chr = '#'; ++ D->bare = 0; ++ //e->reveal=1; // the default should be the same for all formats. ++ return 0; ++} ++ ++ ++static int html_option(struct export *e, int opt, char *arg) ++{ ++ switch (opt) ++ { ++ case 1: // gfx-chr= ++ D->gfx_chr = *arg ?: ' '; ++ break; ++ case 2: // bare (no headers) ++ D->bare=1; ++ break; ++ } ++ return 0; ++} ++ ++#define HTML_BLACK "#000000" ++#define HTML_RED "#FF0000" ++#define HTML_GREEN "#00FF00" ++#define HTML_YELLOW "#FFFF00" ++#define HTML_BLUE "#0000FF" ++#define HTML_MAGENTA "#FF00FF" ++#define HTML_CYAN "#00FFFF" ++#define HTML_WHITE "#FFFFFF" ++ ++#undef UNREADABLE_HTML //no '\n' ++#define STRIPPED_HTML //only necessary fields in header ++ ++static int html_output(struct export *e, char *name, struct fmt_page *pg) ++{ ++ ++ const char* html_colours[]={ HTML_BLACK, ++ HTML_RED, ++ HTML_GREEN, ++ HTML_YELLOW, ++ HTML_BLUE, ++ HTML_MAGENTA, ++ HTML_CYAN, ++ HTML_WHITE}; ++ FILE *fp; ++ int x, y; ++ ++#ifdef UNREADABLE_HTML ++#define HTML_NL ++#else ++#define HTML_NL fputc('\n',fp); ++#endif ++ ++ if (not(fp = fopen(name, "w"))) ++ { ++ export_error("cannot create file"); ++ return -1; ++ } ++ ++if (!D->bare) ++ { ++#ifndef STRIPPED_HTML ++ fputs("",fp); ++ HTML_NL ++#endif ++ fputs("",fp); ++ HTML_NL ++#ifndef STRIPPED_HTML ++ fputs(""); break; ++ case LATIN2: fprintf(fp,"charset=iso-8859-2\">"); break; ++ case KOI8: fprintf(fp,"charset=koi8-r\">"); break; ++ case GREEK: fprintf(fp,"charset=iso-8859-7\">"); break; ++ } ++ HTML_NL ++ fputs("",fp); ++ HTML_NL ++#else ++ switch(latin1) { ++ case LATIN1: fprintf(fp,""); break; ++ case LATIN2: fprintf(fp,""); break; ++ case KOI8: fprintf(fp,""); break; ++ case GREEK: fprintf(fp,""); break; ++ } ++ HTML_NL ++#endif ++ fputs("",fp); ++ fputs("",fp); ++ HTML_NL ++ } //bare ++ ++ fputs("",fp); ++ HTML_NL ++ ++ // write tables in form of HTML format ++ for (y = 0; y < 25; ++y) ++ { ++ int last_nonblank=0; ++ int first_unprinted=0; ++ int last_space=1; ++ // previous char was   ++ // is used for deciding to put semicolon or not ++ int nbsp=0; ++ ++ // for output filled with ' ' up to 40 chars ++ // set last_nonblank=39 ++ for (x = 0 ; x < 40; ++x) ++ { ++ if (pg->data[y][x].attr & EA_GRAPHIC) ++ {pg->data[y][x].ch= D->gfx_chr;} ++ ++ if (pg->data[y][x].ch!=' ') ++ { ++ last_nonblank=x; ++ } ++ } ++ ++ for (x = 0 ; x <= last_nonblank ; ++x) ++ { ++ if (pg->data[y][x].ch==' ') ++ { ++ // if single space between blinking/colour words ++ // then make the space blinking/colour too ++ if ((x)&&(x<39)) ++ { ++ if ((pg->data[y][x-1].ch!=' ') ++ &&(pg->data[y][x+1].ch!=' ') ++ &&(pg->data[y][x-1].attr & EA_BLINK) ++ &&(pg->data[y][x+1].attr & EA_BLINK)) ++ {pg->data[y][x].attr |= EA_BLINK;} ++ else ++ {pg->data[y][x].attr &= ~EA_BLINK;} ++ ++ if ((pg->data[y][x-1].ch!=' ') ++ &&(pg->data[y][x+1].ch!=' ') ++ &&(pg->data[y][x-1].fg==pg->data[y][x+1].fg)) ++ {pg->data[y][x].fg=pg->data[y][x-1].fg;} ++ else ++ pg->data[y][x].fg=7; ++ } ++ else ++ { ++ pg->data[y][x].attr &= ~EA_BLINK; ++ pg->data[y][x].fg=7; ++ } ++ } ++ else ++ { ++ // if foreground is black set the foreground to previous ++ // background colour to let it be visible ++ if (!pg->data[y][x].fg) ++ {pg->data[y][x].fg=pg->data[y][x].bg;} ++ } ++ //check if attributes changed, ++ //if yes then print chars and update first_unprinted ++ //if not then go to next char ++ if (x) ++ { ++ if ((( ++ (pg->data[y][x].attr & EA_BLINK) ++ == ++ (pg->data[y][x-1].attr & EA_BLINK) ++ ) ++ && ++ ( ++ pg->data[y][x].fg == pg->data[y][x-1].fg ++ )) ++ &&(x!=last_nonblank)) ++ ++ { continue; } ++ } ++ else continue; ++ ++ { ++ int z=first_unprinted; ++ for(;(pg->data[y][z].ch==' ') && (zdata[y][first_unprinted].attr & EA_BLINK) ++ { ++ fprintf(fp,""); ++ nbsp=0; ++ } ++ ++ if (pg->data[y][first_unprinted].fg!=7) ++ { ++ fprintf(fp,"", ++ html_colours[pg->data[y][first_unprinted].fg]); ++ nbsp=0; ++ } ++ for(;(zdata[y][z].ch==' ') ++ { ++ for(;(pg->data[y][z].ch==' ') && (z put semicolon!!! ++ if (nbsp) fputc(';',fp); ++ fputc(pg->data[y][z].ch,fp); ++ last_space=0; ++ nbsp=0; ++ } ++ } ++ if (pg->data[y][first_unprinted].fg!=7) ++ { ++ fprintf(fp,""); ++ } ++ if (pg->data[y][first_unprinted].attr & EA_BLINK) ++ fprintf(fp,""); ++ ++ first_unprinted=z; ++ } ++ } ++ fputs("
",fp); ++ HTML_NL ++ } ++ fputs("
",fp); ++ if (!D->bare) ++ fputs("",fp); ++ fclose(fp); ++ return 0; ++} +diff -r af23d23c278b util/alevt/exp-txt.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/exp-txt.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,226 @@ ++#include ++#include ++#include ++#include "os.h" ++#include "export.h" ++ ++static int txt_open(struct export *e); ++static int txt_option(struct export *e, int opt, char *arg); ++static int txt_output(struct export *e, char *name, struct fmt_page *pg); ++static char *txt_opts[] = // module options ++{ ++ "color", // generate ansi color codes (and attributes) ++ "gfx-chr=", // substitute for gfx-symbols ++ "fg=<0-7|none>", // assume term has as foreground color ++ "bg=<0-7|none>", // assume term has as background color ++ "lines=<1-25>", // output 24 or 25 lines ++ 0 ++}; ++ ++ ++struct txt_data // private data in struct export ++{ ++ u8 color; ++ u8 gfx_chr; ++ u8 def_fg; ++ u8 def_bg; ++ int endline; ++ struct fmt_char curr[1]; ++ FILE *fp; ++}; ++ ++ ++struct export_module export_txt = // exported module definition ++{ ++ "ascii", // id ++ "txt", // extension ++ txt_opts, // options ++ sizeof(struct txt_data), // data size ++ txt_open, // open ++ 0, // close ++ txt_option, // option ++ txt_output, // output ++}; ++ ++ ++struct export_module export_ansi = // exported module definition ++{ ++ "ansi", // id ++ "txt", // extension ++ txt_opts, // options ++ sizeof(struct txt_data), // data size ++ txt_open, // open ++ 0, // close ++ txt_option, // option ++ txt_output, // output ++}; ++ ++#define D ((struct txt_data *)e->data) ++ ++ ++char * my_stpcpy(char *dst, const char *src) ++{ ++ while (*dst = *src++) ++ dst++; ++ return dst; ++} ++ ++ ++static int txt_open(struct export *e) ++{ ++ D->gfx_chr = '#'; ++ D->def_fg = -1; ++ D->def_bg = -1; ++ D->endline = H; ++ if (e->mod == &export_ansi) ++ D->color = 1; ++ return 0; ++} ++ ++ ++static int txt_option(struct export *e, int opt, char *arg) ++{ ++ switch (opt) ++ { ++ case 1: // color ++ D->color = 1; ++ break; ++ case 2: // gfx-chr= ++ D->gfx_chr = *arg ?: ' '; ++ break; ++ case 3: // fg= ++ D->def_fg = *arg - '0'; ++ break; ++ case 4: // bg= ++ D->def_bg = *arg - '0'; ++ break; ++ case 5: // lines= ++ D->endline = atoi(arg); ++ if (D->endline < 1 || D->endline > H) ++ { ++ export_error("lines: invalid number"); ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++ ++static void put_attr(struct export *e, struct fmt_char *new) ++{ ++ char buf[512]; ++ char *p = buf; ++ int fg, bg, attr; ++ int reset = 0; ++ ++ if (D->color) ++ { ++ fg = D->curr->fg ^ new->fg; ++ bg = D->curr->bg ^ new->bg; ++ attr = (D->curr->attr ^ new->attr) & (EA_BLINK | EA_DOUBLE); ++ ++ if (fg | bg | attr) ++ { ++ if (~new->attr & attr) // reset some attributes -> reset all. ++ reset = 1; ++ if (fg && new->fg == D->def_fg) // switch to def fg -> reset all ++ reset = 1; ++ if (bg && new->bg == D->def_bg) // switch to def bg -> reset all ++ reset = 1; ++ ++ p = my_stpcpy(buf, "\e["); ++ if (reset) ++ { ++ p = my_stpcpy(p, ";"); // "0;" but 0 isn't neccesary ++ attr = -1; // set all attributes ++ fg = new->fg ^ D->def_fg; // set fg if != default fg ++ bg = new->bg ^ D->def_bg; // set bg if != default bg ++ } ++ if (attr & new->attr & EA_BLINK) ++ p = my_stpcpy(p, "5;"); // blink ++ if (attr & new->attr & EA_DOUBLE) ++ p = my_stpcpy(p, "1;"); // bold ++ if (fg) ++ p += sprintf(p, "%d;", new->fg + 30); // fg-color ++ if (bg) ++ p += sprintf(p, "%d;", new->bg + 40); // bg-color ++ p[-1] = 'm'; // replace last ; ++ *D->curr = *new; ++ } ++ } ++ *p++ = new->ch; ++ *p = 0; ++ fputs(buf, D->fp); ++} ++ ++ ++static int txt_output(struct export *e, char *name, struct fmt_page *pg) ++{ ++ struct fmt_char def_c[1]; ++ struct fmt_char l[W+2]; ++ #define L (l+1) ++ int x, y; ++ ++ D->fp = fopen(name, "w"); ++ if (not D->fp) ++ { ++ export_error("cannot create file"); ++ return -1; ++ } ++ ++ /* initialize default colors. These have to be restored at EOL. */ ++ def_c->ch = '\n'; ++ def_c->fg = D->def_fg; ++ def_c->bg = D->def_bg; ++ def_c->attr = E_DEF_ATTR; ++ *D->curr = *def_c; ++ L[-1] = L[W] = *def_c; ++ ++ for (y = 0; y < D->endline; y++) ++ if (~pg->hid & (1 << y)) // not hidden ++ { ++ // character conversion ++ for (x = 0; x < W; ++x) ++ { ++ struct fmt_char c = pg->data[y][x]; ++ ++ switch (c.ch) ++ { ++ case 0x00: case 0xa0: c.ch = ' '; break; ++ case 0x7f: c.ch = '*'; break; ++ case BAD_CHAR: c.ch = '?'; break; ++ default: ++ if (c.attr & EA_GRAPHIC) ++ c.ch = D->gfx_chr; ++ break; ++ } ++ L[x] = c; ++ } ++ ++ if (D->color) ++ { ++ // optimize color and attribute changes ++ // delay fg and attr changes as far as possible ++ for (x = 0; x < W; ++x) ++ if (L[x].ch == ' ') ++ { ++ L[x].fg = L[x-1].fg; ++ l[x].attr = L[x-1].attr; ++ } ++ ++ // move fg and attr changes to prev bg change point ++ for (x = W-1; x >= 0; x--) ++ if (L[x].ch == ' ' && L[x].bg == L[x+1].bg) ++ { ++ L[x].fg = L[x+1].fg; ++ L[x].attr = L[x+1].attr; ++ } ++ } ++ ++ // now emit the whole line (incl EOL) ++ for (x = 0; x < W+1; ++x) ++ put_attr(e, L + x); ++ } ++ fclose(D->fp); ++ return 0; ++} +diff -r af23d23c278b util/alevt/export.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/export.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,364 @@ ++#include ++#include ++#include ++#include ++#include "vt.h" ++#include "misc.h" ++#include "export.h" ++ ++extern struct export_module export_txt; ++extern struct export_module export_ansi; ++extern struct export_module export_html; ++extern struct export_module export_png; ++extern struct export_module export_ppm; ++struct export_module *modules[] = ++{ ++ &export_txt, ++ &export_ansi, ++ &export_html, ++ &export_ppm, ++#ifdef WITH_PNG ++ &export_png, ++#endif ++ 0 ++}; ++ ++ ++static char *glbl_opts[] = ++{ ++ "reveal", // show hidden text ++ "hide", // don't show hidden text (default) ++ 0 ++}; ++ ++static char errbuf[64]; ++ ++ ++void export_error(char *str, ...) ++{ ++ va_list args; ++ ++ va_start(args, str); ++ vsnprintf(errbuf, sizeof(errbuf)-1, str, args); ++} ++ ++ ++char * export_errstr(void) ++{ ++ return errbuf; ++} ++ ++ ++static int find_opt(char **opts, char *opt, char *arg) ++{ ++ int err = 0; ++ char buf[256]; ++ char **oo, *o, *a; ++ ++ if (oo = opts) ++ while (o = *oo++) ++ { ++ if (a = strchr(o, '=')) ++ { ++ a = buf + (a - o); ++ o = strcpy(buf, o); ++ *a++ = 0; ++ } ++ if (strcasecmp(o, opt) == 0) ++ { ++ if ((a != 0) == (arg != 0)) ++ return oo - opts; ++ err = -1; ++ } ++ } ++ return err; ++} ++ ++ ++struct export * export_open(char *fmt) ++{ ++ struct export_module **eem, *em; ++ struct export *e; ++ char *opt, *optend, *optarg; ++ int opti; ++ ++ if (fmt = strdup(fmt)) ++ { ++ if (opt = strchr(fmt, ',')) ++ *opt++ = 0; ++ for (eem = modules; em = *eem; eem++) ++ if (strcasecmp(em->fmt_name, fmt) == 0) ++ break; ++ if (em) ++ { ++ if (e = malloc(sizeof(*e) + em->local_size)) ++ { ++ e->mod = em; ++ e->fmt_str = fmt; ++ e->reveal = 0; ++ memset(e + 1, 0, em->local_size); ++ if (not em->open || em->open(e) == 0) ++ { ++ for (; opt; opt = optend) ++ { ++ if (optend = strchr(opt, ',')) ++ *optend++ = 0; ++ if (not *opt) ++ continue; ++ if (optarg = strchr(opt, '=')) ++ *optarg++ = 0; ++ if ((opti = find_opt(glbl_opts, opt, optarg)) > 0) ++ { ++ if (opti == 1) // reveal ++ e->reveal = 1; ++ else if (opti == 2) // hide ++ e->reveal = 0; ++ } ++ else if (opti == 0 && ++ (opti = find_opt(em->options, opt, optarg)) > 0) ++ { ++ if (em->option(e, opti, optarg)) ++ break; ++ } ++ else ++ { ++ if (opti == 0) ++ export_error("%s: unknown option", opt); ++ else if (optarg) ++ export_error("%s: takes no arg", opt); ++ else ++ export_error("%s: missing arg", opt); ++ break; ++ } ++ } ++ if (opt == 0) ++ return e; ++ ++ if (em->close) ++ em->close(e); ++ } ++ free(e); ++ } ++ else ++ export_error("out of memory"); ++ } ++ else ++ export_error("unknown format: %s", fmt); ++ free(fmt); ++ } ++ else ++ export_error("out of memory"); ++ return 0; ++} ++ ++ ++void export_close(struct export *e) ++{ ++ if (e->mod->close) ++ e->mod->close(e); ++ free(e->fmt_str); ++ free(e); ++} ++ ++ ++static char * hexnum(char *buf, unsigned int num) ++{ ++ char *p = buf + 5; ++ ++ num &= 0xffff; ++ *--p = 0; ++ do ++ { ++ *--p = "0123456789abcdef"[num % 16]; ++ num /= 16; ++ } while (num); ++ return p; ++} ++ ++ ++static char * adjust(char *p, char *str, char fill, int width) ++{ ++ int l = width - strlen(str); ++ ++ while (l-- > 0) ++ *p++ = fill; ++ while (*p = *str++) ++ p++; ++ return p; ++} ++ ++ ++char * export_mkname(struct export *e, char *fmt, struct vt_page *vtp, char *usr) ++{ ++ char bbuf[1024]; ++ char *p = bbuf; ++ ++ while (*p = *fmt++) ++ if (*p++ == '%') ++ { ++ char buf[32], buf2[32]; ++ int width = 0; ++ ++ p--; ++ while (*fmt >= '0' && *fmt <= '9') ++ width = width*10 + *fmt++ - '0'; ++ ++ switch (*fmt++) ++ { ++ case '%': ++ p = adjust(p, "%", '%', width); ++ break; ++ case 'e': // extension ++ p = adjust(p, e->mod->extension, '.', width); ++ break; ++ case 'p': // pageno[.subno] ++ if (vtp->subno) ++ p = adjust(p,strcat(strcat(hexnum(buf, vtp->pgno), ++ "."), hexnum(buf2, vtp->subno)), ' ', width); ++ else ++ p = adjust(p, hexnum(buf, vtp->pgno), ' ', width); ++ break; ++ case 'S': // subno ++ p = adjust(p, hexnum(buf, vtp->subno), '0', width); ++ break; ++ case 'P': // pgno ++ p = adjust(p, hexnum(buf, vtp->pgno), '0', width); ++ break; ++ case 's': // user strin ++ p = adjust(p, usr, ' ', width); ++ break; ++ //TODO: add date, channel name, ... ++ } ++ } ++ p = strdup(bbuf); ++ if (not p) ++ export_error("out of memory"); ++ return p; ++} ++ ++ ++static void fmt_page(struct export *e, struct fmt_page *pg, struct vt_page *vtp) ++{ ++ char buf[16]; ++ int x, y; ++ u8 *p = vtp->data[0]; ++ ++ pg->dbl = 0; ++ ++ sprintf(buf, "\2%x.%02x\7", vtp->pgno, vtp->subno & 0xff); ++ ++ for (y = 0; y < H; y++) ++ { ++ struct fmt_char c; ++ int last_ch = ' '; ++ int dbl = 0, hold = 0; ++ ++ c.fg = 7; ++ c.bg = 0; ++ c.attr = 0; ++ ++ for (x = 0; x < W; ++x) ++ { ++ c.ch = *p++; ++ if (y == 0 && x < 8) ++ c.ch = buf[x]; ++ switch (c.ch) ++ { ++ case 0x00 ... 0x07: /* alpha + fg color */ ++ c.fg = c.ch & 7; ++ c.attr &= ~(EA_GRAPHIC | EA_CONCEALED); ++ goto ctrl; ++ case 0x08: /* flash */ ++ c.attr |= EA_BLINK; ++ goto ctrl; ++ case 0x09: /* steady */ ++ c.attr &= ~EA_BLINK; ++ goto ctrl; ++ case 0x0a: /* end box */ ++ case 0x0b: /* start box */ ++ goto ctrl; ++ case 0x0c: /* normal height */ ++ c.attr &= EA_DOUBLE; ++ goto ctrl; ++ case 0x0d: /* double height */ ++ if (y < H-2) /* ignored on last 2 lines */ ++ { ++ c.attr |= EA_DOUBLE; ++ dbl = 1; ++ } ++ goto ctrl; ++ case 0x10 ... 0x17: /* gfx + fg color */ ++ c.fg = c.ch & 7; ++ c.attr |= EA_GRAPHIC; ++ c.attr &= ~EA_CONCEALED; ++ goto ctrl; ++ case 0x18: /* conceal */ ++ c.attr |= EA_CONCEALED; ++ goto ctrl; ++ case 0x19: /* contiguous gfx */ ++ c.attr &= ~EA_SEPARATED; ++ goto ctrl; ++ case 0x1a: /* separate gfx */ ++ c.attr |= EA_SEPARATED; ++ goto ctrl; ++ case 0x1c: /* black bg */ ++ c.bg = 0; ++ goto ctrl; ++ case 0x1d: /* new bg */ ++ c.bg = c.fg; ++ goto ctrl; ++ case 0x1e: /* hold gfx */ ++ hold = 1; ++ goto ctrl; ++ case 0x1f: /* release gfx */ ++ hold = 0; ++ goto ctrl; ++ ++ case 0x0e: /* SO */ ++ case 0x0f: /* SI */ ++ case 0x1b: /* ESC */ ++ c.ch = ' '; ++ break; ++ ++ ctrl: ++ c.ch = ' '; ++ if (hold && (c.attr & EA_GRAPHIC)) ++ c.ch = last_ch; ++ break; ++ } ++ if (c.attr & EA_GRAPHIC) ++ if ((c.ch & 0xa0) == 0x20) ++ { ++ last_ch = c.ch; ++ c.ch += (c.ch & 0x40) ? 32 : -32; ++ } ++ if (c.attr & EA_CONCEALED) ++ if (not e->reveal) ++ c.ch = ' '; ++ pg->data[y][x] = c; ++ } ++ if (dbl) ++ { ++ pg->dbl |= 1 << y; ++ for (x = 0; x < W; ++x) ++ { ++ if (~pg->data[y][x].attr & EA_DOUBLE) ++ pg->data[y][x].attr |= EA_HDOUBLE; ++ pg->data[y+1][x] = pg->data[y][x]; ++ pg->data[y+1][x].ch = ' '; ++ } ++ y++; ++ p += W; ++ } ++ } ++ pg->hid = pg->dbl << 1; ++} ++ ++ ++int export(struct export *e, struct vt_page *vtp, char *name) ++{ ++ struct fmt_page pg[1]; ++ ++ fmt_page(e, pg, vtp); ++ return e->mod->output(e, name, pg); ++} +diff -r af23d23c278b util/alevt/export.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/export.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,66 @@ ++#ifndef EXPORT_H ++#define EXPORT_H ++ ++#include "vt.h" ++#include "misc.h" ++ ++ ++struct fmt_char ++{ ++ u8 ch, fg, bg, attr; ++}; ++ ++#define EA_DOUBLE 1 // double height char ++#define EA_HDOUBLE 2 // single height char in double height line ++#define EA_BLINK 4 // blink ++#define EA_CONCEALED 8 // concealed ++#define EA_GRAPHIC 16 // graphic symbol ++#define EA_SEPARATED 32 // use separated graphic symbol ++ ++#define E_DEF_FG 7 ++#define E_DEF_BG 0 ++#define E_DEF_ATTR 0 ++ ++ ++struct fmt_page ++{ ++ struct vt_page *vtp; ++ u32 dbl, hid; ++ struct fmt_char data[H][W]; ++}; ++ ++ ++struct export ++{ ++ struct export_module *mod; // module type ++ char *fmt_str; // saved option string (splitted) ++ // global options ++ int reveal; // reveal hidden chars ++ // local data for module's use. initialized to 0. ++ struct { int dummy; } data[0]; ++}; ++ ++ ++struct export_module ++{ ++ char *fmt_name; // the format type name (ASCII/HTML/PNG/...) ++ char *extension; // the default file name extension ++ char **options; // module options ++ int local_size; ++ int (*open)(struct export *fmt); ++ void (*close)(struct export *fmt); ++ int (*option)(struct export *fmt, int opt, char *arg); ++ int (*output)(struct export *fmt, char *name, struct fmt_page *pg); ++}; ++ ++ ++extern struct export_module *modules[]; // list of modules (for help msgs) ++void export_error(char *str, ...); // set error ++char *export_errstr(void); // return last error ++char *export_mkname(struct export *e, char *fmt, struct vt_page *vtp, char *usr); ++ ++ ++struct export *export_open(char *fmt); ++void export_close(struct export *e); ++int export(struct export *e, struct vt_page *vtp, char *user_str); ++#endif +diff -r af23d23c278b util/alevt/fdset.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/fdset.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,97 @@ ++#include ++#include ++#include ++#include "dllist.h" ++#include "misc.h" ++#include "fdset.h" ++ ++struct fdset fds[1]; /* global fd list */ ++ ++ ++int fdset_init(struct fdset *fds) ++{ ++ dl_init(fds->list); ++ fds->del_count = 0; ++ return 0; ++} ++ ++ ++int fdset_add_fd(struct fdset *fds, int fd, void *handler, void *data) ++{ ++ struct fdset_node *fn; ++ ++ if (fd < 0) ++ return -1; ++ if (handler == 0) ++ return -1; ++ ++ for (fn = PTR fds->list->first; fn->node->next; fn = PTR fn->node->next) ++ if (fn->fd == fd) ++ return -1; ++ ++ if (not(fn = malloc(sizeof(*fn)))) ++ return -1; ++ fn->fd = fd; ++ fn->handler = handler; ++ fn->data = data; ++ dl_insert_last(fds->list, fn->node); ++ return 0; ++} ++ ++ ++int fdset_del_fd(struct fdset *fds, int fd) ++{ ++ struct fdset_node *fn; ++ ++ for (fn = PTR fds->list->first; fn->node->next; fn = PTR fn->node->next) ++ if (fn->fd == fd) ++ { ++ dl_remove(fn->node); ++ free(fn); ++ fds->del_count++; ++ return 0; ++ } ++ return -1; ++} ++ ++ ++int fdset_select(struct fdset *fds, int timeout) ++{ ++ struct fdset_node *fn; ++ fd_set rfds[1]; ++ struct timeval tv[1], *tvp = 0; ++ int max_fd, x, del_count; ++ ++ FD_ZERO(rfds); ++ max_fd = 0; ++ for (fn = PTR fds->list->first; fn->node->next; fn = PTR fn->node->next) ++ { ++ FD_SET(fn->fd, rfds); ++ if (fn->fd >= max_fd) ++ max_fd = fn->fd + 1; ++ } ++ ++ if (timeout >= 0) ++ { ++ tv->tv_sec = timeout/1000; ++ tv->tv_usec = timeout%1000*1000; ++ tvp = tv; ++ } ++ ++ x = select(max_fd, rfds, 0, 0, tvp); ++ if (x <= 0) ++ return x; ++ ++ /* A little bit complicated. A called handler may modify the fdset... */ ++restart: ++ del_count = fds->del_count; ++ for (fn = PTR fds->list->first; fn->node->next; fn = PTR fn->node->next) ++ if (FD_ISSET(fn->fd, rfds)) ++ { ++ FD_CLR(fn->fd, rfds); ++ fn->handler(fn->data, fn->fd); ++ if (fds->del_count != del_count) ++ goto restart; ++ } ++ return 1; ++} +diff -r af23d23c278b util/alevt/fdset.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/fdset.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,28 @@ ++#ifndef FDSET_H ++#define FDSET_H ++ ++#include "dllist.h" ++ ++ ++struct fdset ++{ ++ struct dl_head list[1]; ++ int del_count; ++}; ++ ++ ++struct fdset_node /*internal*/ ++{ ++ struct dl_node node[1]; ++ int fd; ++ void (*handler)(void *data, int fd); ++ void *data; ++}; ++ ++extern struct fdset fds[1]; /* global fd list */ ++ ++int fdset_init(struct fdset *fds); ++int fdset_add_fd(struct fdset *fds, int fd, void *handler, void *data); ++int fdset_del_fd(struct fdset *fds, int fd); ++int fdset_select(struct fdset *fds, int timeout /*millisec*/); ++#endif +diff -r af23d23c278b util/alevt/font.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/font.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5 @@ ++#define static /* I want them global */ ++#include "font1.xbm" ++#include "font2.xbm" ++#include "font3.xbm" ++#include "font4.xbm" +diff -r af23d23c278b util/alevt/font.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/font.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,19 @@ ++#ifndef FONT_H ++#define FONT_H ++ ++#include "fontsize.h" /* the #defines from font?.xbm */ ++ ++#if font1_width != font2_width || font1_height != font2_height ++#error different font sizes. ++#endif ++ ++extern unsigned char font1_bits[]; ++extern unsigned char font2_bits[]; ++extern unsigned char font3_bits[]; ++extern unsigned char font4_bits[]; ++ ++#define font_width font1_width ++#define font_height font1_height ++#define CW (font_width/32) /* pixel width of a character */ ++#define CH (font_height/8) /* pixel height of a character */ ++#endif +diff -r af23d23c278b util/alevt/hamm.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/hamm.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,229 @@ ++#include "vt.h" ++#include "hamm.h" ++ ++// table to decode hamm8/4 encoded bytes. ++// the low 4 bits are the (corrected) data bits ++// bit 8 is set if there was a single bit error ++// bit 12 is set if there was an uncorrectable error ++ ++// the idea: you may add up to 15 words and get the ++// number of single bit errors in b8-b11 and the number ++// of double errors in b12-b15 ++ ++ ++static unsigned short hammtab[256] = ++{ ++ 0x0101, 0x100f, 0x0001, 0x0101, 0x100f, 0x0100, 0x0101, 0x100f, ++ 0x100f, 0x0102, 0x0101, 0x100f, 0x010a, 0x100f, 0x100f, 0x0107, ++ 0x100f, 0x0100, 0x0101, 0x100f, 0x0100, 0x0000, 0x100f, 0x0100, ++ 0x0106, 0x100f, 0x100f, 0x010b, 0x100f, 0x0100, 0x0103, 0x100f, ++ 0x100f, 0x010c, 0x0101, 0x100f, 0x0104, 0x100f, 0x100f, 0x0107, ++ 0x0106, 0x100f, 0x100f, 0x0107, 0x100f, 0x0107, 0x0107, 0x0007, ++ 0x0106, 0x100f, 0x100f, 0x0105, 0x100f, 0x0100, 0x010d, 0x100f, ++ 0x0006, 0x0106, 0x0106, 0x100f, 0x0106, 0x100f, 0x100f, 0x0107, ++ 0x100f, 0x0102, 0x0101, 0x100f, 0x0104, 0x100f, 0x100f, 0x0109, ++ 0x0102, 0x0002, 0x100f, 0x0102, 0x100f, 0x0102, 0x0103, 0x100f, ++ 0x0108, 0x100f, 0x100f, 0x0105, 0x100f, 0x0100, 0x0103, 0x100f, ++ 0x100f, 0x0102, 0x0103, 0x100f, 0x0103, 0x100f, 0x0003, 0x0103, ++ 0x0104, 0x100f, 0x100f, 0x0105, 0x0004, 0x0104, 0x0104, 0x100f, ++ 0x100f, 0x0102, 0x010f, 0x100f, 0x0104, 0x100f, 0x100f, 0x0107, ++ 0x100f, 0x0105, 0x0105, 0x0005, 0x0104, 0x100f, 0x100f, 0x0105, ++ 0x0106, 0x100f, 0x100f, 0x0105, 0x100f, 0x010e, 0x0103, 0x100f, ++ 0x100f, 0x010c, 0x0101, 0x100f, 0x010a, 0x100f, 0x100f, 0x0109, ++ 0x010a, 0x100f, 0x100f, 0x010b, 0x000a, 0x010a, 0x010a, 0x100f, ++ 0x0108, 0x100f, 0x100f, 0x010b, 0x100f, 0x0100, 0x010d, 0x100f, ++ 0x100f, 0x010b, 0x010b, 0x000b, 0x010a, 0x100f, 0x100f, 0x010b, ++ 0x010c, 0x000c, 0x100f, 0x010c, 0x100f, 0x010c, 0x010d, 0x100f, ++ 0x100f, 0x010c, 0x010f, 0x100f, 0x010a, 0x100f, 0x100f, 0x0107, ++ 0x100f, 0x010c, 0x010d, 0x100f, 0x010d, 0x100f, 0x000d, 0x010d, ++ 0x0106, 0x100f, 0x100f, 0x010b, 0x100f, 0x010e, 0x010d, 0x100f, ++ 0x0108, 0x100f, 0x100f, 0x0109, 0x100f, 0x0109, 0x0109, 0x0009, ++ 0x100f, 0x0102, 0x010f, 0x100f, 0x010a, 0x100f, 0x100f, 0x0109, ++ 0x0008, 0x0108, 0x0108, 0x100f, 0x0108, 0x100f, 0x100f, 0x0109, ++ 0x0108, 0x100f, 0x100f, 0x010b, 0x100f, 0x010e, 0x0103, 0x100f, ++ 0x100f, 0x010c, 0x010f, 0x100f, 0x0104, 0x100f, 0x100f, 0x0109, ++ 0x010f, 0x100f, 0x000f, 0x010f, 0x100f, 0x010e, 0x010f, 0x100f, ++ 0x0108, 0x100f, 0x100f, 0x0105, 0x100f, 0x010e, 0x010d, 0x100f, ++ 0x100f, 0x010e, 0x010f, 0x100f, 0x010e, 0x000e, 0x100f, 0x010e, ++}; ++ ++#if 0 // this information is contained in hamm24par bit 5 ++// simple parity table (sum of 1 bits modulo 2) ++ ++ ++static char odd_parity[256] = ++{ ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, ++ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 ++}; ++#endif ++ ++// this table generates the parity checks for hamm24/18 decoding. ++// bit 0 is for test A, 1 for B, ... ++// thanks to R. Gancarz for this fine table *g* ++ ++ ++static char hamm24par[3][256] = ++{ ++ { // parities of first byte ++ 0, 33, 34, 3, 35, 2, 1, 32, 36, 5, 6, 39, 7, 38, 37, 4, ++ 37, 4, 7, 38, 6, 39, 36, 5, 1, 32, 35, 2, 34, 3, 0, 33, ++ 38, 7, 4, 37, 5, 36, 39, 6, 2, 35, 32, 1, 33, 0, 3, 34, ++ 3, 34, 33, 0, 32, 1, 2, 35, 39, 6, 5, 36, 4, 37, 38, 7, ++ 39, 6, 5, 36, 4, 37, 38, 7, 3, 34, 33, 0, 32, 1, 2, 35, ++ 2, 35, 32, 1, 33, 0, 3, 34, 38, 7, 4, 37, 5, 36, 39, 6, ++ 1, 32, 35, 2, 34, 3, 0, 33, 37, 4, 7, 38, 6, 39, 36, 5, ++ 36, 5, 6, 39, 7, 38, 37, 4, 0, 33, 34, 3, 35, 2, 1, 32, ++ 40, 9, 10, 43, 11, 42, 41, 8, 12, 45, 46, 15, 47, 14, 13, 44, ++ 13, 44, 47, 14, 46, 15, 12, 45, 41, 8, 11, 42, 10, 43, 40, 9, ++ 14, 47, 44, 13, 45, 12, 15, 46, 42, 11, 8, 41, 9, 40, 43, 10, ++ 43, 10, 9, 40, 8, 41, 42, 11, 15, 46, 45, 12, 44, 13, 14, 47, ++ 15, 46, 45, 12, 44, 13, 14, 47, 43, 10, 9, 40, 8, 41, 42, 11, ++ 42, 11, 8, 41, 9, 40, 43, 10, 14, 47, 44, 13, 45, 12, 15, 46, ++ 41, 8, 11, 42, 10, 43, 40, 9, 13, 44, 47, 14, 46, 15, 12, 45, ++ 12, 45, 46, 15, 47, 14, 13, 44, 40, 9, 10, 43, 11, 42, 41, 8 ++ }, { // parities of second byte ++ 0, 41, 42, 3, 43, 2, 1, 40, 44, 5, 6, 47, 7, 46, 45, 4, ++ 45, 4, 7, 46, 6, 47, 44, 5, 1, 40, 43, 2, 42, 3, 0, 41, ++ 46, 7, 4, 45, 5, 44, 47, 6, 2, 43, 40, 1, 41, 0, 3, 42, ++ 3, 42, 41, 0, 40, 1, 2, 43, 47, 6, 5, 44, 4, 45, 46, 7, ++ 47, 6, 5, 44, 4, 45, 46, 7, 3, 42, 41, 0, 40, 1, 2, 43, ++ 2, 43, 40, 1, 41, 0, 3, 42, 46, 7, 4, 45, 5, 44, 47, 6, ++ 1, 40, 43, 2, 42, 3, 0, 41, 45, 4, 7, 46, 6, 47, 44, 5, ++ 44, 5, 6, 47, 7, 46, 45, 4, 0, 41, 42, 3, 43, 2, 1, 40, ++ 48, 25, 26, 51, 27, 50, 49, 24, 28, 53, 54, 31, 55, 30, 29, 52, ++ 29, 52, 55, 30, 54, 31, 28, 53, 49, 24, 27, 50, 26, 51, 48, 25, ++ 30, 55, 52, 29, 53, 28, 31, 54, 50, 27, 24, 49, 25, 48, 51, 26, ++ 51, 26, 25, 48, 24, 49, 50, 27, 31, 54, 53, 28, 52, 29, 30, 55, ++ 31, 54, 53, 28, 52, 29, 30, 55, 51, 26, 25, 48, 24, 49, 50, 27, ++ 50, 27, 24, 49, 25, 48, 51, 26, 30, 55, 52, 29, 53, 28, 31, 54, ++ 49, 24, 27, 50, 26, 51, 48, 25, 29, 52, 55, 30, 54, 31, 28, 53, ++ 28, 53, 54, 31, 55, 30, 29, 52, 48, 25, 26, 51, 27, 50, 49, 24 ++ }, { // parities of third byte ++ 63, 14, 13, 60, 12, 61, 62, 15, 11, 58, 57, 8, 56, 9, 10, 59, ++ 10, 59, 56, 9, 57, 8, 11, 58, 62, 15, 12, 61, 13, 60, 63, 14, ++ 9, 56, 59, 10, 58, 11, 8, 57, 61, 12, 15, 62, 14, 63, 60, 13, ++ 60, 13, 14, 63, 15, 62, 61, 12, 8, 57, 58, 11, 59, 10, 9, 56, ++ 8, 57, 58, 11, 59, 10, 9, 56, 60, 13, 14, 63, 15, 62, 61, 12, ++ 61, 12, 15, 62, 14, 63, 60, 13, 9, 56, 59, 10, 58, 11, 8, 57, ++ 62, 15, 12, 61, 13, 60, 63, 14, 10, 59, 56, 9, 57, 8, 11, 58, ++ 11, 58, 57, 8, 56, 9, 10, 59, 63, 14, 13, 60, 12, 61, 62, 15, ++ 31, 46, 45, 28, 44, 29, 30, 47, 43, 26, 25, 40, 24, 41, 42, 27, ++ 42, 27, 24, 41, 25, 40, 43, 26, 30, 47, 44, 29, 45, 28, 31, 46, ++ 41, 24, 27, 42, 26, 43, 40, 25, 29, 44, 47, 30, 46, 31, 28, 45, ++ 28, 45, 46, 31, 47, 30, 29, 44, 40, 25, 26, 43, 27, 42, 41, 24, ++ 40, 25, 26, 43, 27, 42, 41, 24, 28, 45, 46, 31, 47, 30, 29, 44, ++ 29, 44, 47, 30, 46, 31, 28, 45, 41, 24, 27, 42, 26, 43, 40, 25, ++ 30, 47, 44, 29, 45, 28, 31, 46, 42, 27, 24, 41, 25, 40, 43, 26, ++ 43, 26, 25, 40, 24, 41, 42, 27, 31, 46, 45, 28, 44, 29, 30, 47 ++ } ++}; ++ ++// table to extract the lower 4 bit from hamm24/18 encoded bytes ++ ++ ++static char hamm24val[256] = ++{ ++ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, ++ 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, ++ 4, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 5, 5, 5, 5, ++ 6, 6, 6, 6, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7, 7, ++ 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9, 9, 9, ++ 10, 10, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11, 11, 11, ++ 12, 12, 12, 12, 13, 13, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, ++ 14, 14, 14, 14, 15, 15, 15, 15, 14, 14, 14, 14, 15, 15, 15, 15, ++ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, ++ 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, ++ 4, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 5, 5, 5, 5, ++ 6, 6, 6, 6, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7, 7, ++ 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9, 9, 9, ++ 10, 10, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11, 11, 11, ++ 12, 12, 12, 12, 13, 13, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, ++ 14, 14, 14, 14, 15, 15, 15, 15, 14, 14, 14, 14, 15, 15, 15, 15 ++}; ++ ++// mapping from parity checks made by table hamm24par to error ++// results return by hamm24. ++// (0 = no error, 0x0100 = single bit error, 0x1000 = double error) ++ ++ ++static short hamm24err[64] = ++{ ++ 0x0000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, ++ 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, ++ 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, ++ 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, ++ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, ++ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, ++ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, ++ 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, ++}; ++ ++// mapping from parity checks made by table hamm24par to faulty bit ++// in the decoded 18 bit word. ++ ++ ++static int hamm24cor[64] = ++{ ++ 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, ++ 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, ++ 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, ++ 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, ++ 0x00000, 0x00000, 0x00000, 0x00001, 0x00000, 0x00002, 0x00004, 0x00008, ++ 0x00000, 0x00010, 0x00020, 0x00040, 0x00080, 0x00100, 0x00200, 0x00400, ++ 0x00000, 0x00800, 0x01000, 0x02000, 0x04000, 0x08000, 0x10000, 0x20000, ++ 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, 0x00000, ++}; ++ ++ ++int hamm8(u8 *p, int *err) ++{ ++ int a = hammtab[p[0]]; ++ *err += a; ++ return a & 15; ++} ++ ++ ++int hamm16(u8 *p, int *err) ++{ ++ int a = hammtab[p[0]]; ++ int b = hammtab[p[1]]; ++ *err += a; ++ *err += b; ++ return (a & 15) | (b & 15) * 16; ++} ++ ++ ++int hamm24(u8 *p, int *err) ++{ ++ int e = hamm24par[0][p[0]] ^ hamm24par[1][p[1]] ^ hamm24par[2][p[2]]; ++ int x = hamm24val[p[0]] + p[1] % 128 * 16 + p[2] % 128 * 2048; ++ *err += hamm24err[e]; ++ return x ^ hamm24cor[e]; ++} ++ ++ ++int chk_parity(u8 *p, int n) ++{ ++ int err; ++ for (err = 0; n--; p++) ++ if (hamm24par[0][*p] & 32) ++ *p &= 0x7f; ++ else ++ *p = BAD_CHAR, err++; ++ return err; ++} +diff -r af23d23c278b util/alevt/hamm.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/hamm.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,7 @@ ++#ifndef HAMM_H ++#define HAMM_H ++int hamm8(u8 *p, int *err); ++int hamm16(u8 *p, int *err); ++int hamm24(u8 *p, int *err); ++int chk_parity(u8 *p, int n); ++#endif +diff -r af23d23c278b util/alevt/help.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/help.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,83 @@ ++#include "vt.h" ++#include "misc.h" ++ ++#define VFILL " " ++#define HELP_HEADER \ ++"........\6AleVT Online Help System ", \ ++" \22`p0`0 p `0pppp ", \ ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", \ ++"\4\35\22\177,\177j5\177.! +t>! j5 \7"VFILL VERSION" \34", \ ++" \22# #\42!\42# \42 \42! ", ++#define FLOF_DATA \ ++ 1, { {0x100,ANY_SUB}, {0x200,ANY_SUB}, {0x300,ANY_SUB}, \ ++ {0x400,ANY_SUB}, {0x0ff,ANY_SUB}, {0x100,ANY_SUB} } ++ ++ ++struct vt_page help_pages[] = ++{ ++ { 0x900, 0, -1, 0, 0, (1<<26)-1, { ++#include "vt900.out" ++ }, FLOF_DATA }, ++ ++ { 0x901, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt901.out" ++ }, FLOF_DATA }, ++ ++ { 0x902, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt902.out" ++ }, FLOF_DATA }, ++ ++ { 0x903, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt903.out" ++ }, FLOF_DATA }, ++ ++ { 0x904, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt904.out" ++ }, FLOF_DATA }, ++ ++ { 0x905, 2, -1, 0, 0, (1<<26)-1, { ++#include "vt905.out" ++ }, FLOF_DATA }, ++ ++ { 0x906, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt906.out" ++ }, FLOF_DATA }, ++ ++ { 0x907, 2, -1, 0, 0, (1<<26)-1, { ++#include "vt907.out" ++ }, FLOF_DATA }, ++ ++ { 0x908, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt908.out" ++ }, FLOF_DATA }, ++ ++ { 0x909, 0, -1, 0, 0, (1<<26)-1, { ++#include "vt909.out" ++ }, FLOF_DATA }, ++ ++ { 0x910, 2, -1, 0, 0, (1<<26)-1, { ++#include "vt910.out" ++ }, FLOF_DATA }, ++ ++ { 0x911, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt911.out" ++ }, FLOF_DATA }, ++ ++ { 0x912, 2, -1, 0, 0, (1<<26)-1, { ++#include "vt912.out" ++ }, FLOF_DATA }, ++ ++ { 0x913, 1, -1, 0, 0, (1<<26)-1, { ++#include "vt913.out" ++ }, FLOF_DATA }, ++ ++ { 0x914, 0, -1, 0, 0, (1<<26)-1, { ++#include "vt914.out" ++ }, FLOF_DATA }, ++ ++ { 0x915, 0, -1, 0, 0, (1<<26)-1, { ++#include "vt915.out" ++ }, FLOF_DATA }, ++}; ++ ++const int nr_help_pages = NELEM(help_pages); +diff -r af23d23c278b util/alevt/help.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/help.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++#ifndef HELP_H ++#define HELP_H ++ ++#include "vt.h" ++ ++extern struct vt_page help_pages[]; ++extern const int nr_help_pages; ++#endif +diff -r af23d23c278b util/alevt/icon.xbm +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/icon.xbm Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,17 @@ ++#define icon_width 58 ++#define icon_height 20 ++static unsigned char icon_bits[] = { ++ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, ++ 0xff, 0xff, 0xff, 0x03, 0x0f, 0x30, 0xfe, 0xff, 0xf8, 0x11, 0x00, 0x03, ++ 0x0f, 0x30, 0xfe, 0xff, 0xf8, 0x11, 0x00, 0x03, 0xc5, 0x23, 0xaa, 0xaa, ++ 0xa8, 0xf1, 0xf1, 0x03, 0xc6, 0x22, 0xfe, 0xd5, 0x58, 0xb1, 0xb1, 0x02, ++ 0x45, 0x23, 0x06, 0xaa, 0xa8, 0x51, 0x51, 0x01, 0xc6, 0x22, 0x06, 0xd6, ++ 0x58, 0xb1, 0xb1, 0x02, 0x45, 0x23, 0x62, 0xac, 0xa8, 0x51, 0x51, 0x01, ++ 0xc6, 0x22, 0x62, 0xd4, 0x58, 0xb1, 0xb1, 0x02, 0x45, 0x23, 0x62, 0xac, ++ 0xa8, 0x51, 0x51, 0x01, 0xc6, 0x23, 0x62, 0xd4, 0xf8, 0xb1, 0xb1, 0x02, ++ 0x05, 0x20, 0x02, 0xae, 0x61, 0x58, 0x51, 0x01, 0x06, 0x20, 0x02, 0x56, ++ 0x61, 0xa8, 0xb1, 0x02, 0xc5, 0x23, 0xe2, 0xab, 0x06, 0x56, 0x51, 0x01, ++ 0x46, 0x22, 0xe2, 0x57, 0x05, 0xaa, 0xb1, 0x02, 0xc7, 0x23, 0x06, 0xfe, ++ 0x9f, 0xff, 0xf1, 0x03, 0xc7, 0x23, 0x06, 0xfe, 0x9f, 0xff, 0xf1, 0x03, ++ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, ++ 0xff, 0xff, 0xff, 0x03, }; +diff -r af23d23c278b util/alevt/lang.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/lang.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,393 @@ ++#include ++#include ++#include "misc.h" ++#include "vt.h" ++#include "lang.h" ++ ++int latin1 = -1; ++ ++ ++static u8 lang_char[256]; ++static u8 lang_chars[1+8+8][16] = ++{ ++ { 0, 0x23,0x24,0x40,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x7b,0x7c,0x7d,0x7e }, ++ ++ // for latin-1 font ++ // English (100%) ++ { 0, '', '$', '@', '', '', '', '', '#', '', '', '', '', '' }, ++ // German (100%) ++ { 0, '#', '$', '', '', '', '', '^', '_', '', '', '', '', '' }, ++ // Swedish/Finnish/Hungarian (100%) ++ { 0, '#', '', '', '', '', '', '', '_', '', '', '', '', '' }, ++ // Italian (100%) ++ { 0, '', '$', '', '', '', '', '', '#', '', '', '', '', '' }, ++ // French (100%) ++ { 0, '', '', '', '', '', '', '', '#', '', '', '', '', '' }, ++ // Portuguese/Spanish (100%) ++ { 0, '', '$', '', '', '', '', '', '', '', '', '', '', '' }, ++ // Czech/Slovak (60%) ++ { 0, '#', 'u', 'c', 't', 'z', '', '', 'r', '', '', 'e', '', 's' }, ++ // reserved (English mapping) ++ { 0, '', '$', '@', '', '', '', '', '#', '', '', '', '', '' }, ++ ++ // for latin-2 font ++ // Polish (100%) ++ { 0, '#', '', '', '', '', '', '', '', '', '', '', '', '' }, ++ // German (100%) ++ { 0, '#', '$', '', '', '', '', '^', '_', '', '', '', '', '' }, ++ // Estonian (100%) ++ { 0, '#', '', '', '', '', '', '', '', '', '', '', '', '' }, ++ // Lettish/Lithuanian (90%) ++ { 0, '#', '$', '', '', '', '', '', '', '', '', 'u', '', 'i' }, ++ // French (90%) ++ { 0, '', 'i', 'a', '', '', 'u', '', '#', 'e', '', '', 'u', '' }, ++ // Serbian/Croation/Slovenian (100%) ++ { 0, '#', '', '', '', '', '', '', '', '', '', '', '', '' }, ++ // Czech/Slovak (100%) ++ { 0, '#', '', '', '', '', '', '', '', '', '', '', '', '' }, ++ // Rumanian (95%) ++ { 0, '#', '', '', '', '', '', '', 'i', '', '', '', '', '' }, ++}; ++ ++/* Yankable latin charset :-) ++ !"#$%&'()*+,-./0123456789:;<=>? ++ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ++ `abcdefghijklmnopqrstuvwxyz{|}~ ++ ++ ++ ++*/ ++ ++ ++static struct mark { u8 *g0, *latin1, *latin2; } marks[16] = ++{ ++ /* none */ { "#", ++ "", ++ "$" }, ++ /* grave - ` */ { " aeiouAEIOU", ++ "`", ++ "`aeiouAEIOU" }, ++ /* acute - ' */ { " aceilnorsuyzACEILNORSUYZ", ++ "'clnrszCLNRSZ", ++ "'ݬ" }, ++ /* cirumflex - ^ */ { " aeiouAEIOU", ++ "^", ++ "^euEU" }, ++ /* tilde - ~ */ { " anoANO", ++ "~", ++ "~anoANO" }, ++ /* ??? - */ { "", ++ "", ++ "" }, ++ /* breve - u */ { "aA", ++ "aA", ++ "" }, ++ /* abovedot - */ { "zZ", ++ "zZ", ++ "" }, ++ /* diaeresis */ { "aeiouAEIOU", ++ "", ++ "iI" }, ++ /* ??? - . */ { "", ++ "", ++ "" }, ++ /* ringabove - */ { " auAU", ++ "uU", ++ "aA" }, ++ /* cedilla - */ { "cstCST", ++ "stST", ++ "Ǫ" }, ++ /* ??? - _ */ { " ", ++ "_", ++ "_" }, ++ /* dbl acute - " */ { " ouOU", ++ "\"ouOU", ++ "\"" }, ++ /* ogonek - \, */ { "aeAE", ++ "aeAE", ++ "" }, ++ /* caron - v */ { "cdelnrstzCDELNRSTZ", ++ "cdelnrstzCDELNRSTZ", ++ "̥ة" }, ++}; ++ ++ ++static u8 g2map_latin1[] = ++ /*0123456789abcdef*/ ++ " $#'\" " ++ "׵'\"" ++ " `^~ ._\" " ++ "_ " ++ " ЪH ILL TNn" ++ "Kdhiill tn\x7f"; ++ ++ ++static u8 g2map_latin2[] = ++ /*0123456789abcdef*/ ++ " icL$Y#'\"< " ++ " u '\"> " ++ " `^~ ._" ++ "- RC " ++ " aH iLO opTNn" ++ "K dhiilo ptn\x7f"; ++ ++ ++void lang_init(void) ++{ ++ int i; ++ ++ memset(lang_char, 0, sizeof(lang_char)); ++ for (i = 1; i <= 13; i++) ++ lang_char[lang_chars[0][i]] = i; ++} ++ ++ ++void conv2latin(u8 *p, int n, int lang) ++{ ++ int c, gfx = 0, lat=0; ++ ++ if ((latin1 == KOI8) && lang==12) { /* russian */ ++ while (n--) { ++ c=*p; ++ ++ if(c==0x1b) lat = !lat; /* ESC switches languages inside page */ ++ ++ if ( is_koi(c)) { ++ if (not gfx || (c & 0xa0) != 0x20) { ++ if(!lat) conv2koi8(p); ++ } ++ } ++ else if ((c & 0xe8) == 0) ++ gfx = c & 0x10; ++ p++; ++ } ++ } ++else if ((latin1 == GREEK) && lang==15) { /* Hellas */ ++ while (n--) { ++ c=*p; ++ ++ if(c==0x1b) lat = !lat; /* ESC switches languages inside page */ ++ ++ if ( is_greek(c)) { ++ if (not gfx || (c & 0xa0) != 0x20) { ++ if(!lat) conv2greek(p); ++ } ++ } ++ else if ((c & 0xe8) == 0) ++ gfx = c & 0x10; ++ p++; ++ } ++ } ++ ++ else { ++ while (n--) ++ { ++ if (lang_char[c = *p]) ++ { ++ if (not gfx || (c & 0xa0) != 0x20) ++ *p = lang_chars[lang + 1][lang_char[c]]; ++ } ++ else if ((c & 0xe8) == 0) ++ gfx = c & 0x10; ++ p++; ++ } ++ } ++} ++ ++ ++/* check for Greek chars - needs locale iso8859-7 set */ ++int is_greek(int c) ++{ ++ if( isalpha(c | 0x80)) return 1; ++ return 0; ++} ++ ++ ++/* check for russian chars - needs locale KOI8-R set */ ++int is_koi(int c) ++{ ++ if( isalpha(c | 0x80)) return 1; ++ if( c=='&' ) return 1; ++ return 0; ++} ++ ++ ++/* teletext to koi8-r conversion */ ++void conv2koi8(u8 *p) ++{ ++ u8 c; ++ static u8 l2koi[]={ ++ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, ++ 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, ++ 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xFF, 0xFA, 0xFB, 0xFC, 0xFD, ++ 0xFE, 0xF9, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, ++ 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, ++ 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, ++ 0xDC, 0xDD, 0xDE, 0xDF ++ }; ++ ++ c= *p; ++ if ( (c >= 0x40) && (c <= 0x7f)) *p=l2koi[(c & 0x7f) - 0x40]; ++ if (c=='&') *p=''; ++} ++ ++ ++/* teletext to iso8859-7 conversion */ ++void conv2greek(u8 *p) ++{ ++ u8 c; ++ static u8 l2greek[]={ ++/* 1 @ 0x40->*/0xc0, ++/* 2 A 0x41->*/0xc1, ++/* 3 B 0x42->*/0xc2, ++/* 4 C 0x43->*/0xc3, ++/* 5 D 0x44->*/0xc4, ++/* 6 E 0x45->*/0xc5, ++/* 7 F 0x46->*/0xc6, ++/* 8 G 0x47->*/0xc7, ++/* 9 H 0x48->*/0xc8, ++/*10 I 0x49->*/0xc9, ++/*11 J 0x4a->*/0xca, ++/*12 K 0x4b->*/0xcb, ++/*13 L 0x4c->*/0xcc, ++/*14 M 0x4d->*/0xcd, ++/*15 N 0x4e->*/0xce, ++/*16 O 0x4f->*/0xcf, ++/*17 P 0x50->*/0xd0, ++/*18 Q 0x51->*/0xd1, ++/*19 R 0x52->?*/0x52, ++/*20 S 0x53->*/0xd3, ++/*21 T 0x54->*/0xd4, ++/*22 U 0x55->*/0xd5, ++/*23 V 0x56->*/0xd6, ++/*24 W 0x57->*/0xd7, ++/*25 X 0x58->*/0xd8, ++/*26 Y 0x59->*/0xd9, ++/*27 Z 0x5a->?*/0x5a, ++/*28 [ 0x5b->?*/0x5b, ++/*!29 \ 0x5c->*/0xdc, ++/*!30 ] 0x5d->*/0xdd, ++/*!31 ^ 0x5e->*/0xde, ++/*!32 _ 0x5f->*/0xdf, ++/*33 ` 0x60->?*/0x60, ++/*!34 a 0x61->*/0xe1, ++/*!35 b 0x62->*/0xe2, ++/*!36 c 0x63->*/0xe3, ++/*!37 d 0x64->*/0xe4, ++/*!38 e 0x65->*/0xe5, ++/*!39 f 0x66->*/0xe6, ++/*!40 g 0x67->*/0xe7, ++/*!41 h 0x68->*/0xe8, ++/*!42 i 0x69->*/0xe9, ++/*!43 j 0x6a->*/0xea, ++/*!44 k 0x6b->*/0xeb, ++/*!45 l 0x6c->*/0xec, ++/*!46 m 0x6d->*/0xed, ++/*!47 n 0x6e->*/0xee, ++/*!48 o 0x6f->*/0xef, ++/*!49 p 0x70->*/0xf0, ++/*!50 q 0x71->*/0xf1, ++/*!51 r 0x72->*/0xf2, ++/*!52 s 0x73->*/0xf3, ++/*!53 t 0x74->*/0xf4, ++/*!54 u 0x75->*/0xf5, ++/*!55 v 0x76->*/0xf6, ++/*!56 w 0x77->*/0xf7, ++/*!57 x 0x78->*/0xf8, ++/*!58 y 0x79->*/0xf9, ++/*59 z 0x7a->( )*/0xc0, ++/*60 { 0x7b->?*/0x7b, ++/*!61 | 0x7c->*/0xfc, ++/*!62 } 0x7d->*/0xfd, ++/*!63 ~ 0x7e->*/0xfe, ++/*64 0x7f->?*/0x7f ++ }; ++ c= *p; ++ if ( (c >= 0x40) && (c <= 0x7f)) *p=l2greek[(c & 0x7f) - 0x40]; ++} ++ ++ ++void init_enhance(struct enhance *eh) ++{ ++ eh->next_des = 0; ++} ++ ++ ++void add_enhance(struct enhance *eh, int dcode, u32 *t) ++{ ++ ++ if (dcode == eh->next_des) ++ { ++ memcpy(eh->trip + dcode * 13, t, 13 * sizeof(*t)); ++ eh->next_des++; ++ } ++ else ++ eh->next_des = -1; ++} ++ ++ ++void enhance(struct enhance *eh, struct vt_page *vtp) ++{ ++ int row = 0; ++ u32 *p, *e; ++ ++ if (eh->next_des < 1) ++ return; ++ ++ for (p = eh->trip, e = p + eh->next_des * 13; p < e; p++) ++ if (*p % 2048 != 2047) ++ { ++ int adr = *p % 64; ++ int mode = *p / 64 % 32; ++ int data = *p / 2048 % 128; ++ ++ if (adr < 40) ++ { ++ // col functions ++ switch (mode) ++ { ++ case 15: // char from G2 set ++ if (adr < W && row < H) ++ if (latin1==LATIN1) ++ vtp->data[row][adr] = g2map_latin1[data-32]; ++ else if (latin1==LATIN2) ++ vtp->data[row][adr] = g2map_latin2[data-32]; ++ break; ++ case 16 ... 31: // char from G0 set with diacritical mark ++ if (adr < W && row < H) ++ { ++ struct mark *mark = marks + (mode - 16); ++ u8 *x; ++ ++ if (x = strchr(mark->g0, data)) ++ if (latin1==LATIN1) ++ data = mark->latin1[x - mark->g0]; ++ else if (latin1==LATIN2) ++ data = mark->latin2[x - mark->g0]; ++ vtp->data[row][adr] = data; ++ } ++ break; ++ } ++ } ++ else ++ { ++ // row functions ++ if ((adr -= 40) == 0) ++ adr = 24; ++ ++ switch (mode) ++ { ++ case 1: // full row color ++ row = adr; ++ break; ++ case 4: // set active position ++ row = adr; ++ break; ++ case 7: // address row 0 (+ full row color) ++ if (adr == 23) ++ row = 0; ++ break; ++ } ++ } ++ } ++} +diff -r af23d23c278b util/alevt/lang.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/lang.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,28 @@ ++#ifndef LANG_H ++#define LANG_H ++ ++#include "misc.h" ++#include "vt.h" ++ ++extern int latin1; ++ ++#define LATIN1 1 ++#define LATIN2 2 ++#define KOI8 3 ++#define GREEK 4 ++ ++ ++struct enhance ++{ ++ int next_des; // next expected designation code ++ u32 trip[13*16]; // tripplets ++}; ++ ++void lang_init(void); ++void conv2latin(u8 *p, int n, int lang); ++void conv2koi8(u8 *p); ++void conv2greek(u8 *p); ++void init_enhance(struct enhance *eh); ++void add_enhance(struct enhance *eh, int dcode, u32 *data); ++void enhance(struct enhance *eh, struct vt_page *vtp); ++#endif +diff -r af23d23c278b util/alevt/main.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/main.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,221 @@ ++#include ++#include ++#include ++#include ++#include "vt.h" ++#include "misc.h" ++#include "fdset.h" ++#include "xio.h" ++#include "vbi.h" ++#include "lang.h" ++#include "cache.h" ++#include "ui.h" ++ ++static char *geometry; ++static char *dpy_name; ++static char *vbi_name = NULL; ++static struct xio *xio; ++static struct vbi *vbi; ++static int erc = 1; ++char *outfile = ""; ++static char *channel; ++static int ttpid = -1; ++u_int16_t sid = 0; ++ ++ ++static void usage(FILE *fp, int exitval) ++{ ++ fprintf(fp, "\nUsage: %s [options]\n", prgname); ++ fprintf(fp, ++ "\n" ++ " Valid options:\t\tDefault:\n" ++ " -c \t\t(none;dvb only)\n" ++ " -ch -child \t\t(none)\n" ++ " -cs -charset\t\tlatin-1\n" ++ " \n" ++ " -h -help\n" ++ " -o \t\t(none;dvb only)\n" ++ " -p -parent \t\t900\n" ++ " -s -sid \t\t(none;dvb only)\n" ++ " -t -ttpid \t\t(none;dvb only)\n" ++ " -v -vbi \t\t/dev/vbi\n" ++ " \t\t/dev/vbi0\n" ++ " \t\t/dev/video0\n" ++ " \t\t/dev/dvb/adapter0/demux0\n" ++ "\n" ++ " ppp.ss stands for a page number and an\n" ++ " optional subpage number (Example: 123.4).\n" ++ "\n" ++ " The -child option requires a parent\n" ++ " window. So it must be preceded by\n" ++ " a parent or another child window.\n" ++ ); ++ exit(exitval); ++} ++ ++ ++static int arg_pgno(char *p, int *subno) ++{ ++ char *end; ++ int pgno; ++ ++ *subno = ANY_SUB; ++ if (*p) ++ { ++ pgno = strtol(p, &end, 16); ++ if ((*end == ':' || *end == '/' || *end == '.') && end[1]) ++ *subno = strtol(end + 1, &end, 16); ++ if (*end == 0) ++ if (pgno >= 0x100 && pgno <= 0x999) ++ if (*subno == ANY_SUB || (*subno >= 0x00 && *subno <= 0x3f7f)) ++ return pgno; ++ } ++ fatal("%s: invalid page number", p); ++} ++ ++ ++static struct vtwin * start(int argc, char **argv, struct vtwin *parent, ++ int pgno, int subno) ++{ ++ static int valid_vbi_name = 1; ++ ++ if (!valid_vbi_name) ++ return parent; ++ ++ if (vbi == 0) ++ vbi = vbi_open(vbi_name, cache_open(), channel, outfile, sid, ttpid); ++ if (vbi == 0) ++ { ++ if (vbi_name) ++ error("cannot open device: %s", vbi_name); ++ valid_vbi_name = 0; ++ vbi = open_null_vbi(cache_open()); ++ } ++ if (vbi->cache) ++ vbi->cache->op->mode(vbi->cache, CACHE_MODE_ERC, erc); ++ ++ if (xio == 0) ++ xio = xio_open_dpy(dpy_name, argc, argv); ++ if (xio == 0) ++ fatal("cannot open display"); ++ ++ parent = vtwin_new(xio, vbi, geometry, parent, pgno, subno); ++ if (parent == 0) ++ fatal("cannot create window"); ++ ++ if (!valid_vbi_name) ++ { ++ if (vbi_name) ++ send_errmsg(vbi, "cannot open device: %s", vbi_name); ++ else ++ send_errmsg(vbi, "cannot open any device", vbi_name); ++ } ++ ++ return parent; ++} ++ ++ ++static int option(int argc, char **argv, int *ind, char **arg) ++{ ++ static struct { char *nam, *altnam; int arg; } opts[] = { ++ { "-channel", "-c", 1 }, ++ { "-child", "-ch", 1 }, ++ { "-charset", "-cs", 1 }, ++ { "-help", "-h", 0 }, ++ { "-outfile", "-o", 1 }, ++ { "-parent", "-p", 1 }, ++ { "-sid", "-s", 1 }, ++ { "-ttpid", "-t", 1 }, ++ { "-vbi", "-v", 1 }, ++ }; ++ int i; ++ if (*ind >= argc) ++ return 0; ++ *arg = argv[(*ind)++]; ++ for (i = 0; i < NELEM(opts); ++i) ++ if (streq(*arg, opts[i].nam) || streq(*arg, opts[i].altnam)) ++ { ++ if (opts[i].arg) ++ if (*ind < argc) ++ *arg = argv[(*ind)++]; ++ else ++ fatal("option %s requires an argument", *arg); ++ return i+1; ++ } ++ if (**arg == '-') ++ { ++ fatal("%s: invalid option", *arg); ++ usage(stderr, 1); ++ } ++ return -1; ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ struct vtwin *parent = 0; ++ int pgno, subno; ++ int opt, ind; ++ char *arg; ++ sid = 0; ++ ++ setprgname(argv[0]); ++ fdset_init(fds); ++ ++ ind = 1; ++ while (opt = option(argc, argv, &ind, &arg)) ++ switch (opt) ++ { ++ ++ case 1: // channel ++ channel = arg; ++ break; ++ case 2: // child ++ if (parent == 0) ++ fatal("-child requires a parent window"); ++ pgno = arg_pgno(arg, &subno); ++ parent = start(argc, argv, parent, pgno, subno); ++ geometry = 0; ++ break; ++ case 3: // charset ++ if (streq(arg, "latin-1") || streq(arg, "1")) ++ latin1 = LATIN1; ++ else if (streq(arg, "latin-2") || streq(arg, "2")) ++ latin1 = LATIN2; ++ else if (streq(arg, "koi8-r") || streq(arg, "koi")) ++ latin1 = KOI8; ++ else if (streq(arg, "iso8859-7") || streq(arg, "el")) ++ latin1 = GREEK; ++ else ++ fatal("bad charset (not latin-1/2/koi8-r/iso8859-7)"); ++ break; ++ case 4: // help ++ usage(stdout, 0); ++ break; ++ case 5: // outfile ++ outfile = arg; ++ break; ++ case 6: // parent ++ case -1: // non-option arg ++ pgno = arg_pgno(arg, &subno); ++ parent = start(argc, argv, 0, pgno, subno); ++ geometry = 0; ++ break; ++ case 7: // sid ++ sid = strtoul(arg, NULL, 0); ++ break; ++ case 8: // ttpid ++ ttpid = strtoul(arg, NULL, 0); ++ break; ++ case 9: // vbi ++ vbi_name = arg; ++ vbi = 0; ++ parent = 0; ++ break; ++ } ++ ++ if (parent == 0) ++ start(argc, argv, 0, 0x900, ANY_SUB); ++ xio_event_loop(); ++ exit(0); ++} +diff -r af23d23c278b util/alevt/misc.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/misc.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,66 @@ ++#include ++#include ++#include "misc.h" ++ ++char *prgname = 0; ++ ++extern char *strrchr(const char *, int); ++NORETURN(exit(int)); ++ ++ ++void setprgname(char *str) ++{ ++ char *x = strrchr(str, '/'); ++ prgname = x ? x+1 : str; ++} ++ ++ ++static void print_prgname(void) ++{ ++ if (prgname && *prgname) ++ fprintf(stderr, "%s: ", prgname); ++} ++ ++ ++void error(const char *str, ...) ++{ ++ va_list args; ++ va_start(args, str); ++ print_prgname(); ++ vfprintf(stderr, str, args); ++ fputc('\n', stderr); ++} ++ ++ ++void ioerror(const char *str) ++{ ++ print_prgname(); ++ perror(str); ++} ++ ++ ++void fatal(const char *str, ...) ++{ ++ va_list args; ++ va_start(args, str); ++ print_prgname(); ++ vfprintf(stderr, str, args); ++ fputc('\n', stderr); ++ exit(2); ++} ++ ++ ++void fatal_ioerror(const char *str) ++{ ++ print_prgname(); ++ perror(str); ++ exit(2); ++} ++ ++ ++void out_of_mem(int size) ++{ ++ if (size > 0) ++ fatal("out of memory allocating %d bytes.", size); ++ fatal("out of memory."); ++} +diff -r af23d23c278b util/alevt/misc.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/misc.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,32 @@ ++#ifndef MISC_H ++#define MISC_H ++#define PTR (void *) ++#define NELEM(x) ((int)(sizeof(x)/sizeof(*(x)))) ++#define NORETURN(x) void x __attribute__((__noreturn__)) ++#define DEFINE(x) typeof(x) x ++#define OFFSET_OF(type, elem) ((u8 *)&((type *)0)->elem - (u8 *)0) ++#define BASE_OF(type, elem, p) ((type *)((u8 *)(p) - OFFSET_OF(type, elem))) ++ ++#define not ! ++#define streq(a, b) (strcmp((a), (b)) == 0) ++#define min(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a < _b ? _a : _b; }) ++#define max(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a > _b ? _a : _b; }) ++#define bound(a,b,c) ({ typeof(a) _a = a; typeof(b) _b = b; typeof(c) _c = c; \ ++ _b < _a ? _a : _b > _c ? _c : _b; }) ++ ++typedef unsigned char u8; ++typedef unsigned short u16; ++typedef unsigned int u32; ++typedef signed char s8; ++typedef signed short s16; ++typedef signed int s32; ++ ++extern char *prgname; ++void setprgname(char *argv_0); ++ ++NORETURN(fatal(const char *str, ...)); ++NORETURN(fatal_ioerror(const char *str)); ++NORETURN(out_of_mem(int size)); ++void error(const char *str, ...); ++void ioerror(const char *str); ++#endif +diff -r af23d23c278b util/alevt/os.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/os.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,7 @@ ++#ifndef OS_H ++#define OS_H ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBsd__) \ ++ || defined(__bsdi__) ++#define BSD ++#endif ++#endif +diff -r af23d23c278b util/alevt/search.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/search.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,127 @@ ++#include // for freebsd ++#include ++#include "vt.h" ++#include "misc.h" ++#include "cache.h" ++#include "search.h" ++ ++ ++static void convert(u8 *p, u8 *buf, int *line) ++{ ++ int x, y, c, ch, gfx, hid = 0; ++ ++ for (y = 1, p += 40; y < 25; ++y) ++ { ++ if (not hid) ++ { ++ gfx = 0; ++ for (x = 0; x < 40; ++x) ++ { ++ c = ' '; ++ switch (ch = *p++) ++ { ++ case 0x00 ... 0x07: ++ gfx = 0; ++ break; ++ case 0x10 ... 0x17: ++ gfx = 1; ++ break; ++ case 0x0c: ++ hid = 1; ++ break; ++ case 0x7f: ++ c = '*'; ++ break; ++ case 0x20 ... 0x7e: ++ if (gfx && ch != ' ' && (ch & 0xa0) == 0x20) ++ ch = '#'; ++ case 0xa0 ... 0xff: ++ c= ch; ++ } ++ *buf++ = c; ++ } ++ *buf++ = '\n'; ++ *line++ = y; ++ } ++ else ++ { ++ p += 40; ++ hid = 0; ++ } ++ } ++ *line = y; ++ *buf = 0; ++} ++ ++ ++static int search_pg(struct search *s, struct vt_page *vtp) ++{ ++ regmatch_t m[1]; ++ u8 buf[H *(W+1) + 1]; ++ int line[H]; ++ ++ convert(PTR vtp->data, buf, line); ++ if (regexec(s->pattern, buf, 1, m, 0) == 0) ++ { ++ s->len = 0; ++ if (m->rm_so >= 0) ++ { ++ s->y = line[m->rm_so / (W+1)]; ++ s->x = m->rm_so % (W+1); ++ s->len = m->rm_eo - m->rm_so; ++ if (s->x + s->len > 40) ++ s->len = 40 - s->x; ++ } ++ return 1; ++ } ++ return 0; ++} ++ ++ ++struct search * search_start(struct cache *ca, u8 *pattern) ++{ ++ struct search *s; ++ int f = 0; ++ ++ if (not(s = malloc(sizeof(*s)))) ++ goto fail1; ++ ++ if (pattern[0] == '!') ++ pattern++; ++ else ++ f = REG_ICASE; ++ ++ if (regcomp(s->pattern, pattern, f | REG_NEWLINE) != 0) ++ goto fail2; ++ ++ s->cache = ca; ++ return s; ++ ++fail2: ++ free(s); ++fail1: ++ return 0; ++} ++ ++ ++void search_end(struct search *s) ++{ ++ regfree(s->pattern); ++ free(s); ++} ++ ++ ++int search_next(struct search *s, int *pgno, int *subno, int dir) ++{ ++ struct vt_page *vtp = 0; ++ ++ if (s->cache) ++ vtp = s->cache->op->foreach_pg(s->cache, *pgno, *subno, dir, ++ search_pg, s); ++ if (vtp == 0) ++ return -1; ++ ++ *pgno = vtp->pgno; ++ *subno = vtp->subno ?: ANY_SUB; ++ return 0; ++} +diff -r af23d23c278b util/alevt/search.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/search.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,16 @@ ++#ifndef SEARCH_H ++#define SEARCH_H ++ ++#include ++ ++struct search ++{ ++ struct cache *cache; ++ regex_t pattern[1]; ++ int x, y, len; // the position of the match ++}; ++ ++struct search *search_start(struct cache *ca, u8 *pattern); ++void search_end(struct search *s); ++int search_next(struct search *s, int *pgno, int *subno, int dir); ++#endif +diff -r af23d23c278b util/alevt/ui.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/ui.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,721 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "vt.h" ++#include "misc.h" ++#include "xio.h" ++#include "vbi.h" ++#include "fdset.h" ++#include "search.h" ++#include "export.h" ++#include "ui.h" ++ ++static void vtwin_event(struct vtwin *w, struct vt_event *ev); ++static void msg(struct vtwin *w, u8 *str, ...); ++static void err(struct vtwin *w, u8 *str, ...); ++ ++#define hist(w,o) ((w)->hist + (((w)->hist_top + (o)) & (N_HISTORY-1))) ++ ++ ++static int inc_hex(int i, int bcd_mode) ++{ ++ i++; ++ if (bcd_mode) ++ { ++ if ((i & 0x000f) > 0x0009) ++ i = (i + 0x0010) & 0x0ff0; ++ if ((i & 0x00f0) > 0x090) ++ i = (i + 0x0100) & 0x0f00; ++ if ((i & 0x0f00) > 0x0900) ++ i = (i + 0x1000) & 0xf000; ++ } ++ return i; ++} ++ ++ ++static int dec_hex(int i, int bcd_mode) ++{ ++ i--; ++ if (bcd_mode) ++ { ++ if ((i & 0x000f) > 0x0009) ++ i = (i & 0xfff0) + 0x0009; ++ if ((i & 0x00f0) > 0x0090) ++ i = (i & 0xff00) + 0x0099; ++ if ((i & 0x0f00) > 0x0900) ++ i = (i & 0xf000) + 0x0999; ++ } ++ return i; ++} ++ ++ ++static void set_title(struct vtwin *w) ++{ ++ char buf[32], buf2[32]; ++ ++ if (w->subno == ANY_SUB) ++ sprintf(buf, "%x", w->pgno); ++ else ++ sprintf(buf, "%x/%x", w->pgno, w->subno); ++ if (w->searching) ++ sprintf(buf2, "(%s)", buf); ++ else ++ sprintf(buf2, "%s", buf); ++ xio_title(w->xw, buf2); ++} ++ ++ ++static void query_page(struct vtwin *w, int pgno, int subno) ++{ ++ w->pgno = pgno; ++ w->subno = subno; ++ w->searching = 1; ++ w->hold = 0; //subno != ANY_SUB; ++ xio_set_concealed(w->xw, w->revealed = 0); ++ ++ if (hist(w, 0)->pgno != pgno || ++ (hist(w,0)->subno == ANY_SUB && subno != ANY_SUB)) ++ w->hist_top++; ++ hist(w, 0)->pgno = pgno; ++ hist(w, 0)->subno = subno; ++ hist(w, 1)->pgno = 0; // end marker ++ ++ xio_cancel_selection(w->xw); ++ if (vbi_query_page(w->vbi, pgno, subno) == 0) ++ { ++ w->vtp = 0; ++ } ++ set_title(w); ++} ++ ++ ++static void new_or_query(struct vtwin *w, int pgno, int subno, int new_win) ++{ ++ if (new_win) ++ { ++ if (w->child) ++ query_page(w->child, pgno, subno); ++ else ++ vtwin_new(w->xw->xio, w->vbi, 0, w, pgno, subno); ++ } ++ else ++ query_page(w, pgno, subno); ++} ++ ++static int _next_pgno(int *arg, struct vt_page *vtp) ++{ ++ int pgno = vtp->pgno; ++ ++ if (arg[0] == pgno) // want different page ++ return 0; ++ if (arg[1]) // and not a hex page ++ for (; pgno; pgno >>=4) ++ if ((pgno & 15) > 9) ++ return 0; ++ return 1; ++} ++ ++ ++static int _next_subno(int *arg, struct vt_page *vtp) ++{ ++ return vtp->pgno == arg[0]; // only subpages of this page ++} ++ ++ ++static void do_next_pgno(struct vtwin *w, int dir, int bcd_mode, int subs, ++ int new_win) ++{ ++ struct vt_page *vtp; ++ struct vtwin *cw = (new_win && w->child) ? w->child : w; ++ int pgno = cw->pgno; ++ int subno = cw->subno; ++ ++ if (w->vbi->cache) ++ { ++ int arg[2]; ++ arg[0] = pgno; ++ arg[1] = bcd_mode; ++ if (vtp = w->vbi->cache->op->foreach_pg(w->vbi->cache, ++ pgno, subno, dir, subs ? _next_subno:_next_pgno, &arg)) ++ { ++ new_or_query(w, vtp->pgno, subs ? vtp->subno : ANY_SUB, new_win); ++ return; ++ } ++ } ++ err(w, "No page."); ++} ++ ++#define notdigit(x) (not isdigit((x))) ++ ++ ++static int chk_screen_fromto(u8 *p, int x, int *n1, int *n2) ++{ ++ p += x; ++ ++ if (x >= 0 && x+5 < 42) ++ if (notdigit(p[1]) || notdigit(p[0])) ++ if (isdigit(p[2])) ++ if (p[3] == '/' || p[3] == ':') ++ if (isdigit(p[4])) ++ if (notdigit(p[5]) || notdigit(p[6])) /* p[6] is save here */ ++ { ++ *n1 = p[2] % 16; ++ if (isdigit(p[1])) ++ *n1 += p[1] % 16 * 16; ++ *n2 = p[4] % 16; ++ if (isdigit(p[5])) ++ *n2 = *n2 * 16 + p[5] % 16; ++ return 1; ++ } ++ return 0; ++} ++ ++ ++static int chk_screen_pgno(u8 *p, int x, int *pgno, int *subno) ++{ ++ p += x; ++ ++ if (x >= 0 && x+4 < 42) ++ if (notdigit(p[0]) && notdigit(p[4])) ++ if (isdigit(p[1]) && isdigit(p[2]) && isdigit(p[3])) ++ { ++ *pgno = p[1] % 16 * 256 + p[2] % 16 * 16 + p[3] % 16; ++ if (*pgno >= 0x100 && *pgno <= 0x999) ++ { ++ *subno = ANY_SUB; ++ if (x+6 < 42) ++ if (p[4] == '.' || p[4] == '/') ++ if (isdigit(p[5])) ++ if (notdigit(p[6]) || notdigit(p[7])) /* p[7] is save here */ ++ { ++ *subno = p[5] % 16; ++ if (isdigit(p[6])) ++ *subno = *subno * 16 + p[6] % 16; ++ } ++ // hackhackhack: ++ // pgno followed by start box gets subno 1 ++ if (x+4 < 42 && p[4] == 11) ++ *subno = 1; ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++ ++static void do_screen_pgno(struct vtwin *w, int x, int y, int new_win) ++{ ++ u8 buf[42]; ++ int n1, n2, i; ++ ++ if (x >= 0 && x < 40) ++ { ++ if (xio_get_line(w->xw, y, buf+1) == 0) ++ { ++ buf[0] = buf[41] = ' '; ++ x++; ++ ++ for (i = -6; i < 35; i++) ++ { ++ if (w->vtp == 0 || w->vtp->subno != 0) ++ if (chk_screen_fromto(buf, x+i, &n1, &n2)) ++ { ++ // subno cycling works wrong with children. ++ // so middle button cycles backwards... ++ if (w->subno != ANY_SUB) ++ n1 = w->subno; ++ n1 = new_win ? dec_hex(n1, 1) : inc_hex(n1, 1); ++ if (n1 < 1) ++ n1 = n2; ++ if (n1 > n2) ++ n1 = 1; ++ new_or_query(w, w->pgno, n1, 0); ++ return; ++ } ++ if (i >= -4) ++ if (chk_screen_pgno(buf, x+i, &n1, &n2)) ++ { ++ new_or_query(w, n1, n2, new_win); ++ return; ++ } ++ } ++ } ++ } ++ err(w, "No page."); ++} ++ ++ ++static void do_flof_pgno(struct vtwin *w, int button, int x, int new_win) ++{ ++ struct vt_page *vtp = w->vtp; ++ int lk = 99, i, c; ++ ++ if (vtp && vtp->flof) ++ { ++ switch (button) ++ { ++ case 1 ... 3: ++ for (i = 0; i <= x && i < 40; ++i) ++ if ((c = vtp->data[24][i]) < 8) // fg-color code ++ lk = c; ++ lk = "x\0\1\2\3x\3x"[lk]; // color -> link# ++ break; ++ case KEY_F(1): lk = 0; break; ++ case KEY_F(2): lk = 1; break; ++ case KEY_F(3): lk = 2; break; ++ case KEY_F(4): lk = 3; break; ++ case KEY_F(5): lk = 5; break; ++ } ++ if (lk < 6 && (vtp->link[lk].pgno & 0xff) != 0xff) ++ { ++ new_or_query(w, vtp->link[lk].pgno, vtp->link[lk].subno, new_win); ++ return; ++ } ++ } ++ else ++ { ++ switch (button) ++ { ++ case 1 ... 3: lk = x / 8; break; ++ case KEY_F(1): lk = 0; break; ++ case KEY_F(2): lk = 1; break; ++ case KEY_F(3): lk = 2; break; ++ case KEY_F(4): lk = 3; break; ++ case KEY_F(5): lk = 4; break; ++ } ++ switch (lk) ++ { ++ case 0: new_or_query(w, 0x100, ANY_SUB, new_win); return; ++ case 1: do_next_pgno(w, -1, 1, 0, new_win); return; ++ case 2: new_or_query(w, 0x900, ANY_SUB, new_win); return; ++ case 3: do_next_pgno(w, 1, 1, 0, new_win); return; ++ case 4: new_or_query(w, 0x999, ANY_SUB, new_win); return; ++ } ++ } ++ err(w, "No page."); ++} ++ ++ ++static void do_hist_pgno(struct vtwin *w) ++{ ++ if (hist(w, -1)->pgno) ++ { ++ w->hist_top--; ++ query_page(w, hist(w, 0)->pgno, hist(w, 0)->subno); ++ } ++ else ++ err(w, "Empty history."); ++} ++ ++ ++static void put_head_line(struct vtwin *w, u8 *p) ++{ ++ char buf[40]; ++ ++ if (p == 0) ++ xio_get_line(w->xw, 0, buf); ++ else ++ memcpy(buf + 8, p + 8, 32); ++ ++ if (w->subno == ANY_SUB) ++ sprintf(buf, "\2%3x \5\xb7", w->pgno); ++ else ++ sprintf(buf, "\2S%02x \5\xb7", w->subno & 0xff); ++ ++ if (w->searching) ++ buf[0] = 1; ++ if (w->hold) ++ buf[4] = 'H'; ++ if (w->xw->concealed) ++ buf[6] = '*'; ++ buf[7] = 7; ++ ++ xio_put_line(w->xw, 0, buf); ++} ++ ++ ++static void put_menu_line(struct vtwin *w) ++{ ++ if (w->status > 0) ++ xio_put_line(w->xw, 24, w->statusline); ++ else if (w->vtp && w->vtp->flof) ++ xio_put_line(w->xw, 24, w->vtp->data[24]); ++ else ++ xio_put_line(w->xw, 24, "\0 100 \4<< \6Help \4>>\0 999 "); ++} ++ ++ ++static void _msg(struct vtwin *w, u8 *str, va_list args) ++{ ++ u8 buf[128]; ++ int i; ++ ++ i = vsprintf(buf, str, args); ++ if (i > W) ++ i = W; ++ memset(w->statusline, ' ', W); ++ memcpy(w->statusline + (W-i+1)/2, buf, i); ++ w->status = 6; ++ put_menu_line(w); ++} ++ ++ ++static void msg(struct vtwin *w, u8 *str, ...) ++{ ++ va_list args; ++ ++ va_start(args, str); ++ _msg(w, str, args); ++ va_end(args); ++} ++ ++ ++static void err(struct vtwin *w, u8 *str, ...) ++{ ++ va_list args; ++ ++ va_start(args, str); ++ _msg(w, str, args); ++ va_end(args); ++} ++ ++ ++static void next_search(struct vtwin *w, int rev) ++{ ++ if (w->search) ++ { ++ int pgno = w->pgno; ++ int subno = w->subno; ++ int dir = rev ? -w->searchdir : w->searchdir; ++ ++ if (search_next(w->search, &pgno, &subno, dir) == 0) ++ { ++ query_page(w, pgno, subno); ++ if (not w->searching && w->search->len) ++ xio_set_selection(w->xw, w->search->x, w->search->y, ++ w->search->x + w->search->len - 1, w->search->y); ++ return; ++ } ++ else ++ err(w, "Pattern not found."); ++ } ++ else ++ err(w, "No search pattern."); ++} ++ ++ ++static void start_search(struct vtwin *w, u8 *string) ++{ ++ if (not string) ++ return; ++ ++ if (*string) ++ { ++ if (w->search) ++ search_end(w->search); ++ w->search = search_start(w->vbi->cache, string); ++ if (w->search == 0) ++ { ++ err(w, "Bad search pattern."); ++ return; ++ } ++ } ++ next_search(w, 0); ++} ++ ++ ++static void start_save2(struct vtwin *w, u8 *name) ++{ ++ if (name && *name) ++ if (export(w->export, w->vtp, name)) ++ err(w, export_errstr()); ++ ++ export_close(w->export); ++ w->export = 0; ++ put_menu_line(w); ++} ++ ++ ++struct vtwin * vtwin_new(struct xio *xio, struct vbi *vbi, char *geom, ++ struct vtwin *parent, int pgno, int subno) ++{ ++ struct vtwin *w; ++ ++ if (not(w = malloc(sizeof(*w)))) ++ goto fail1; ++ ++ if (not (w->xw = xio_open_win(xio, geom))) ++ goto fail2; ++ w->vbi = vbi; ++ w->vtp = 0; ++ w->search = 0; ++ w->export = 0; ++ w->parent = parent; ++ w->child = 0; ++ if (parent && parent->child) ++ fatal("internal error: parent already has a child != 0"); ++ if (parent) ++ parent->child = w; ++ ++ w->hist_top = 1; ++ hist(w,0)->pgno = 0; ++ hist(w,1)->pgno = 0; ++ w->status = 0; ++ xio_set_handler(w->xw, vtwin_event, w); ++ vbi_add_handler(w->vbi, vtwin_event, w); ++ query_page(w, pgno, subno); ++ return w; ++ ++fail2: ++ free(w); ++fail1: ++ return 0; ++} ++ ++ ++static void vtwin_close(struct vtwin *w) ++{ ++ if (w->parent) ++ w->parent->child = w->child; ++ if (w->child) ++ w->child->parent = w->parent; ++ ++ if (w->search) ++ search_end(w->search); ++ if (w->export) ++ export_close(w->export); ++ ++ vbi_del_handler(w->vbi, vtwin_event, w); ++ xio_close_win(w->xw, 1); ++ free(w); ++} ++ ++ ++static void vtwin_event(struct vtwin *w, struct vt_event *ev) ++{ ++ struct xio_win *xw = w->xw; ++ int i; ++ ++ switch (ev->type) ++ { ++ case EV_CLOSE: ++ vtwin_close(w); ++ break; ++ ++ case EV_TIMER: ++ if (w->status > 0 && --w->status == 0) ++ put_menu_line(w); ++ break; ++ ++ case EV_KEY: ++ { ++ switch (ev->i1) ++ { ++ case '0' ... '9': ++ i = ev->i1 - '0'; ++ if (w->pgno >= 0x100) ++ { ++ if (i == 0) ++ break; ++ w->pgno = i; ++ } ++ else ++ { ++ w->pgno = w->pgno * 16 + i; ++ if (w->pgno >= 0x100) ++ query_page(w, w->pgno, ANY_SUB); ++ } ++ break; ++ case 'q': ++ case '\e': ++ vtwin_close(w); ++ break; ++ case 'h': ++ query_page(w, 0x900, ANY_SUB); ++ break; ++ case 'e': ++ if (w->vbi->cache) ++ { ++ i = w->vbi->cache->op->mode(w->vbi->cache, ++ CACHE_MODE_ERC, 0); ++ w->vbi->cache->op->mode(w->vbi->cache, ++ CACHE_MODE_ERC, !i); ++ msg(w, "Error reduction %sabled.", i ? "dis" : "en"); ++ } ++ break; ++ case 'o': ++ if (vtwin_new(xw->xio, w->vbi, 0, 0, w->pgno, w->subno) == 0) ++ err(w, "Unable to open new window."); ++ break; ++ case KEY_RIGHT: ++ do_next_pgno(w, 1, not ev->i2, 0, 0); ++ break; ++ case KEY_LEFT: ++ do_next_pgno(w, -1, not ev->i2, 0, 0); ++ break; ++ case KEY_UP: ++ do_next_pgno(w, -1, not ev->i2, 1, 0); ++ break; ++ case KEY_DOWN: ++ do_next_pgno(w, 1, not ev->i2, 1, 0); ++ break; ++ case '\b': ++ do_hist_pgno(w); ++ break; ++ case ' ': ++ w->hold = !w->hold; ++ break; ++ case 'c': ++ vbi_reset(w->vbi); ++ break; ++ case 'i': ++ if (w->vtp && w->vtp->flof && ++ (w->vtp->link[5].pgno & 0xff) != 0xff) ++ query_page(w, w->vtp->link[5].pgno, ++ w->vtp->link[5].subno); ++ else ++ query_page(w, 0x100, ANY_SUB); ++ break; ++ case 'r': ++ xio_set_concealed(xw, w->revealed = !w->revealed); ++ break; ++ case KEY_F(1) ... KEY_F(5): ++ do_flof_pgno(w, ev->i1, 0, ev->i2); ++ break; ++ case 'n': ++ next_search(w, 0); ++ break; ++ case 'N': ++ next_search(w, 1); ++ break; ++ default: ++ err(w, "Unused key."); ++ break; ++ } ++ break; ++ } ++ case EV_RESET: ++ { ++ if (w->search) ++ search_end(w->search); ++ w->search = 0; ++ ++ query_page(w, w->pgno, w->subno); ++ msg(w, "Cache cleared!"); ++ break; ++ } ++ case EV_MOUSE: ++ { ++ if (ev->i1 == 3) ++ do_hist_pgno(w); ++ else if (ev->i1 == 5) // wheel mouse ++ do_next_pgno(w, 1, not ev->i2, 0, 0); ++ else if (ev->i1 == 4) // wheel mouse ++ do_next_pgno(w, -1, not ev->i2, 0, 0); ++ else if (ev->i1 == 7) // dual wheel mouse ++ do_next_pgno(w, 1, not ev->i2, 1, 0); ++ else if (ev->i1 == 6) // dual wheel mouse ++ do_next_pgno(w, -1, not ev->i2, 1, 0); ++ else if (ev->i4 == 24) ++ do_flof_pgno(w, ev->i1, ev->i3, ev->i1 == 2); ++ else if (ev->i4 == 0 && ev->i3 < 5) ++ { ++ if (ev->i1 == 1) ++ w->hold = !w->hold; ++ else ++ vtwin_new(xw->xio, w->vbi, 0, 0, w->pgno, w->subno); ++ } ++ else if (ev->i4 == 0 && ev->i3 < 8) ++ { ++ if (ev->i1 == 2 && w->child) ++ w = w->child; ++ xio_set_concealed(w->xw, w->revealed = !w->revealed); ++ } ++ else ++ do_screen_pgno(w, ev->i3, ev->i4, ev->i1 == 2); ++ break; ++ } ++ case EV_PAGE: ++ { ++ struct vt_page *vtp = ev->p1; ++ ++ if (0) ++ if (vtp->errors) ++ printf("errors=%4d\n",vtp->errors); ++ if (w->searching || not(w->hold || ev->i1)) ++ if (vtp->pgno == w->pgno) ++ if (w->subno == ANY_SUB || vtp->subno == w->subno) ++ { ++ w->searching = 0; ++ w->vtp = vtp; ++ put_head_line(w, vtp->data[0]); ++ for (i = 1; i < 24; ++i) ++ xio_put_line(w->xw, i, vtp->data[i]); ++ put_menu_line(w); ++ set_title(w); ++ } ++ break; ++ } ++ case EV_HEADER: ++ { ++ u8 *p = ev->p1; ++ int hdr_mag = ev->i1 / 256; ++ int flags = ev->i3; ++ int mag = w->pgno; ++ if (mag >= 0x10) ++ mag = mag >> 4; ++ if (mag >= 0x10) ++ mag = mag >> 4; ++ if (flags & PG_OUTOFSEQ) ++ p = 0; ++ else ++ if (~flags & PG_MAGSERIAL) ++ if (mag != hdr_mag) ++ p = 0; ++ ++ put_head_line(w, p); ++ break; ++ } ++ case EV_XPACKET: ++ { ++#if 0 /* VPS data (seems to be unused in .de */ ++ u8 *p = ev->p1; ++ ++ if (ev->i1 == 8 && ev->i2 == 30 && p[0]/2 == 1) ++ { ++ int i; ++ int pil, cni, pty, misc; ++ ++ for (i = 7; i < 20; ++i) ++ p[i] = hamm8(p+i, &ev->i3); ++ if (ev->i3 & 0xf000) /* uncorrectable errors */ ++ break; ++ cni = p[9] + p[15]/4*16 + p[16]%4*64 + p[10]%4*256 ++ + p[16]/4*1024 + p[17]*4096; ++ pty = p[18] + p[19]*16; ++ pil = p[10]/4 + p[11]*4 + p[12]*64 + p[13]*1024 ++ + p[14]*16384 + p[15]%4*262144; ++ misc = p[7] + p[8]*16; ++ err(w, "%02x %04x %05x %02x: %.20s", misc, cni, pil, pty, p+20); ++ } ++#endif ++ break; ++ } ++ case EV_ERR: ++ { ++ char *errmsg = ev->p1; ++ if (errmsg != NULL && *errmsg != '\0') ++ { ++ err(w, errmsg); ++ w->status = 30; ++ ev->p1 = NULL; ++ free(errmsg); ++ } ++ break; ++ } ++ } ++} +diff -r af23d23c278b util/alevt/ui.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/ui.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,35 @@ ++#ifndef UI_H ++#define UI_H ++ ++#include "vt.h" ++#include "xio.h" ++#include "vbi.h" ++#include "search.h" ++ ++#define N_HISTORY (1 << 6) // number of history entries ++ ++struct vtwin ++{ ++ struct vtwin *parent, *child; ++ struct xio_win *xw; ++ struct vbi *vbi; ++ struct { ++ int pgno; ++ int subno; ++ } hist[N_HISTORY]; ++ int hist_top; ++ int searching; ++ int revealed; ++ int hold; ++ int pgno, subno; ++ struct vt_page *vtp; ++ struct search *search; ++ int searchdir; ++ int status; ++ u8 statusline[W+1]; ++ struct export *export; ++}; ++ ++extern struct vtwin *vtwin_new(struct xio *xio, struct vbi *vbi, char *geom, ++ struct vtwin *parent, int pgno, int subno); ++#endif +diff -r af23d23c278b util/alevt/vbi.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vbi.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,942 @@ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "os.h" ++#include "vt.h" ++#include "misc.h" ++#include "vbi.h" ++#include "fdset.h" ++#include "hamm.h" ++#include "lang.h" ++#include ++ ++ ++static vbi_capture * pZvbiCapt; ++static vbi_raw_decoder * pZvbiRawDec; ++static vbi_sliced * pZvbiData; ++static vbi_proxy_client * pProxy; ++ ++#define ZVBI_BUFFER_COUNT 10 ++#define ZVBI_TRACE 0 ++ ++ ++static int vbi_dvb_open(struct vbi *vbi, const char *vbi_name, ++ const char *channel, char *outfile, u_int16_t sid, int ttpid); ++static void dvb_handler(struct vbi *vbi, int fd); ++ ++#define FAC (1<<16) // factor for fix-point arithmetic ++ ++static u8 *rawbuf; // one common buffer for raw vbi data ++static int rawbuf_size; // its current size ++u_int16_t sid; ++static char *vbi_names[] ++ = { "/dev/vbi", "/dev/vbi0", "/dev/video0", "/dev/dvb/adapter0/demux0", ++ NULL }; // default device names if none was given at the command line ++ ++ ++static void out_of_sync(struct vbi *vbi) ++{ ++ int i; // discard all in progress pages ++ for (i = 0; i < 8; ++i) ++ vbi->rpage[i].page->flags &= ~PG_ACTIVE; ++} ++ ++ ++// send an event to all clients ++static void vbi_send(struct vbi *vbi, int type, int i1, int i2, int i3, void *p1) ++{ ++ struct vt_event ev[1]; ++ struct vbi_client *cl, *cln; ++ ev->resource = vbi; ++ ev->type = type; ++ ev->i1 = i1; ++ ev->i2 = i2; ++ ev->i3 = i3; ++ ev->p1 = p1; ++ for (cl = PTR vbi->clients->first; cln = PTR cl->node->next; cl = cln) ++ cl->handler(cl->data, ev); ++} ++ ++ ++static void vbi_send_page(struct vbi *vbi, struct raw_page *rvtp, int page) ++{ ++ struct vt_page *cvtp = 0; ++ ++ if (rvtp->page->flags & PG_ACTIVE) ++ { ++ if (rvtp->page->pgno % 256 != page) ++ { ++ rvtp->page->flags &= ~PG_ACTIVE; ++ enhance(rvtp->enh, rvtp->page); ++ if (vbi->cache) ++ cvtp = vbi->cache->op->put(vbi->cache, rvtp->page); ++ vbi_send(vbi, EV_PAGE, 0, 0, 0, cvtp ?: rvtp->page); ++ } ++ } ++} ++ ++ ++static void pll_add(struct vbi *vbi, int n, int err) ++{ ++} ++ ++ ++// process one videotext packet ++static int vt_line(struct vbi *vbi, u8 *p) ++{ ++ struct vt_page *cvtp; ++ struct raw_page *rvtp; ++ int hdr, mag, mag8, pkt, i; ++ int err = 0; ++ ++ hdr = hamm16(p, &err); ++ if (err & 0xf000) ++ return -4; ++ mag = hdr & 7; ++ mag8 = mag?: 8; ++ pkt = (hdr >> 3) & 0x1f; ++ p += 2; ++ rvtp = vbi->rpage + mag; ++ cvtp = rvtp->page; ++ switch (pkt) ++ { ++ case 0: ++ { ++ int b1, b2, b3, b4; ++ b1 = hamm16(p, &err); // page number ++ b2 = hamm16(p+2, &err); // subpage number + flags ++ b3 = hamm16(p+4, &err); // subpage number + flags ++ b4 = hamm16(p+6, &err); // language code + more flags ++ if (vbi->ppage->page->flags & PG_MAGSERIAL) ++ vbi_send_page(vbi, vbi->ppage, b1); ++ vbi_send_page(vbi, rvtp, b1); ++ ++ if (err & 0xf000) ++ return 4; ++ ++ cvtp->errors = (err >> 8) + chk_parity(p + 8, 32);; ++ cvtp->pgno = mag8 * 256 + b1; ++ cvtp->subno = (b2 + b3 * 256) & 0x3f7f; ++ cvtp->lang = "\0\4\2\6\1\5\3\7"[b4 >> 5] + (latin1==LATIN1 ? 0 : 8); ++ cvtp->flags = b4 & 0x1f; ++ cvtp->flags |= b3 & 0xc0; ++ cvtp->flags |= (b2 & 0x80) >> 2; ++ cvtp->lines = 1; ++ cvtp->flof = 0; ++ vbi->ppage = rvtp; ++ pll_add(vbi, 1, cvtp->errors); ++ conv2latin(p + 8, 32, cvtp->lang); ++ vbi_send(vbi, EV_HEADER, cvtp->pgno, cvtp->subno, cvtp->flags, p); ++ ++ if (b1 == 0xff) ++ return 0; ++ cvtp->flags |= PG_ACTIVE; ++ init_enhance(rvtp->enh); ++ memcpy(cvtp->data[0]+0, p, 40); ++ memset(cvtp->data[0]+40, ' ', sizeof(cvtp->data)-40); ++ return 0; ++ } ++ ++ case 1 ... 24: ++ { ++ pll_add(vbi, 1, err = chk_parity(p, 40)); ++ ++ if (~cvtp->flags & PG_ACTIVE) ++ return 0; ++ ++ cvtp->errors += err; ++ cvtp->lines |= 1 << pkt; ++ conv2latin(p, 40, cvtp->lang); ++ memcpy(cvtp->data[pkt], p, 40); ++ return 0; ++ } ++ case 26: ++ { ++ int d, t[13]; ++ ++ if (~cvtp->flags & PG_ACTIVE) ++ return 0; ++ ++ d = hamm8(p, &err); ++ if (err & 0xf000) ++ return 4; ++ ++ for (i = 0; i < 13; ++i) ++ t[i] = hamm24(p + 1 + 3*i, &err); ++ if (err & 0xf000) ++ return 4; ++ ++ add_enhance(rvtp->enh, d, t); ++ return 0; ++ } ++ case 27: ++ { ++ int b1,b2,b3,x; ++ if (~cvtp->flags & PG_ACTIVE) ++ return 0; // -1 flushes all pages. We may never resync again ++ ++ b1 = hamm8(p, &err); ++ b2 = hamm8(p + 37, &err); ++ if (err & 0xf000) ++ return 4; ++ if (b1 != 0 || not(b2 & 8)) ++ return 0; ++ ++ for (i = 0; i < 6; ++i) ++ { ++ err = 0; ++ b1 = hamm16(p+1+6*i, &err); ++ b2 = hamm16(p+3+6*i, &err); ++ b3 = hamm16(p+5+6*i, &err); ++ if (err & 0xf000) ++ return 1; ++ x = (b2 >> 7) | ((b3 >> 5) & 0x06); ++ cvtp->link[i].pgno = ((mag ^ x) ?: 8) * 256 + b1; ++ cvtp->link[i].subno = (b2 + b3 * 256) & 0x3f7f; ++ } ++ cvtp->flof = 1; ++ return 0; ++ } ++ case 30: ++ { ++ if (mag8 != 8) ++ return 0; ++ p[0] = hamm8(p, &err); // designation code ++ p[1] = hamm16(p+1, &err); // initial page ++ p[3] = hamm16(p+3, &err); // initial subpage + mag ++ p[5] = hamm16(p+5, &err); // initial subpage + mag ++ if (err & 0xf000) ++ return 4; ++ err += chk_parity(p+20, 20); ++ conv2latin(p+20, 20, 0); ++ vbi_send(vbi, EV_XPACKET, mag8, pkt, err, p); ++ return 0; ++ } ++ default: ++ return 0; ++ } ++ return 0; ++} ++ ++ ++// called when new vbi data is waiting ++static void vbi_handler(struct vbi *vbi, int fd) ++{ ++ double timestamp; ++ struct timeval timeout; ++ int lineCount; ++ int line; ++ int res; ++ ++ timeout.tv_sec = 0; ++ timeout.tv_usec = 25000; ++ res = vbi_capture_read_sliced(pZvbiCapt, pZvbiData, &lineCount, ×tamp, ++ &timeout); ++ if (res > 0) ++ { ++ for (line=0; line < lineCount; line++) ++ { ++ if ((pZvbiData[line].id & VBI_SLICED_TELETEXT_B) != 0) ++ { ++ vt_line(vbi, pZvbiData[line].data); ++ } ++ } ++ } ++ else if (res < 0) ++ { ++ } ++} ++ ++ ++int vbi_add_handler(struct vbi *vbi, void *handler, void *data) ++{ ++ struct vbi_client *cl; ++ ++ if (not(cl = malloc(sizeof(*cl)))) ++ return -1; ++ cl->handler = handler; ++ cl->data = data; ++ dl_insert_last(vbi->clients, cl->node); ++ return 0; ++} ++ ++ ++void vbi_del_handler(struct vbi *vbi, void *handler, void *data) ++{ ++ struct vbi_client *cl; ++ ++ for (cl = PTR vbi->clients->first; cl->node->next; cl = PTR cl->node->next) ++ if (cl->handler == handler && cl->data == data) ++ { ++ dl_remove(cl->node); ++ break; ++ } ++ return; ++} ++ ++ ++struct vbi * vbi_open(char *vbi_name, struct cache *ca, ++ const char *channel, char *outfile, u_int16_t sid, int ttpid) ++{ ++ static int inited = 0; ++ struct vbi *vbi; ++ char * pErrStr; ++ int services; ++ ++ if (vbi_name == NULL) ++ { ++ int i; ++ char *tried_devices = NULL; ++ char *old_tried_devices = NULL; ++ for (i = 0; vbi_names[i] != NULL; i++) ++ { ++ vbi_name = vbi_names[i]; ++ // collect device names for the error message below ++ if (old_tried_devices) ++ { ++ if (asprintf(&tried_devices, "%s, %s", old_tried_devices, vbi_name) < 0) ++ tried_devices = NULL; ++ free(old_tried_devices); ++ } ++ else if (asprintf(&tried_devices, "%s", vbi_name) < 0) ++ tried_devices = NULL; ++ if (tried_devices == NULL) ++ out_of_mem(-1); ++ old_tried_devices = tried_devices; ++ if (access(vbi_name, R_OK) != 0) ++ continue; ++ vbi = vbi_open(vbi_name, ca, channel, outfile, sid, ttpid); ++ if (vbi != NULL) ++ { ++ if (tried_devices != NULL) ++ free(tried_devices); ++ return vbi; ++ } ++ } ++ ++ error("could not open any of the standard devices (%s)", tried_devices); ++ free(tried_devices); ++ return NULL; ++ } ++ ++ if (not inited) ++ lang_init(); ++ inited = 1; ++ ++ if (not(vbi = malloc(sizeof(*vbi)))) ++ { ++ error("out of memory"); ++ goto fail1; ++ } ++ if (!vbi_dvb_open(vbi, vbi_name, channel, outfile, sid, ttpid)) { ++ vbi->cache = ca; ++ dl_init(vbi->clients); ++ out_of_sync(vbi); ++ vbi->ppage = vbi->rpage; ++ fdset_add_fd(fds, vbi->fd, dvb_handler, vbi); ++ return vbi; ++ } ++ ++ services = VBI_SLICED_TELETEXT_B; ++ pErrStr = NULL; ++ vbi->fd = -1; ++ ++ pProxy = vbi_proxy_client_create(vbi_name, "alevt", ++ VBI_PROXY_CLIENT_NO_STATUS_IND, &pErrStr, ZVBI_TRACE); ++ if (pProxy != NULL) ++ { ++ pZvbiCapt = vbi_capture_proxy_new(pProxy, ZVBI_BUFFER_COUNT, 0, ++ &services, 0, &pErrStr); ++ if (pZvbiCapt == NULL) ++ { ++ vbi_proxy_client_destroy(pProxy); ++ pProxy = NULL; ++ } ++ } ++ if (pZvbiCapt == NULL) ++ pZvbiCapt = vbi_capture_v4l2_new(vbi_name, ZVBI_BUFFER_COUNT, ++ &services, 0, &pErrStr, ZVBI_TRACE); ++ if (pZvbiCapt == NULL) ++ pZvbiCapt = vbi_capture_v4l_new(vbi_name, 0, &services, 0, &pErrStr, ++ ZVBI_TRACE); ++ ++ if (pZvbiCapt != NULL) ++ { ++ pZvbiRawDec = vbi_capture_parameters(pZvbiCapt); ++ if ((pZvbiRawDec != NULL) && ((services & VBI_SLICED_TELETEXT_B) != 0)) ++ { ++ pZvbiData = malloc((pZvbiRawDec->count[0] + pZvbiRawDec->count[1]) \ ++ * sizeof(*pZvbiData)); ++ ++ vbi->fd = vbi_capture_fd(pZvbiCapt); ++ } ++ else ++ vbi_capture_delete(pZvbiCapt); ++ } ++ ++ if (pErrStr != NULL) ++ { ++ fprintf(stderr, "libzvbi: %s\n", pErrStr); ++ free(pErrStr); ++ } ++ ++ if (vbi->fd == -1) ++ goto fail2; ++ vbi->cache = ca; ++ dl_init(vbi->clients); ++ out_of_sync(vbi); ++ vbi->ppage = vbi->rpage; ++ fdset_add_fd(fds, vbi->fd, vbi_handler, vbi); ++ return vbi; ++ ++fail3: ++ close(vbi->fd); ++fail2: ++ free(vbi); ++fail1: ++ return 0; ++} ++ ++ ++void vbi_close(struct vbi *vbi) ++{ ++ fdset_del_fd(fds, vbi->fd); ++ if (vbi->cache) ++ vbi->cache->op->close(vbi->cache); ++ ++ if (pZvbiData != NULL) ++ free(pZvbiData); ++ pZvbiData = NULL; ++ ++ if (pZvbiCapt != NULL) ++ { ++ vbi_capture_delete(pZvbiCapt); ++ pZvbiCapt = NULL; ++ } ++ if (pProxy != NULL) ++ { ++ vbi_proxy_client_destroy(pProxy); ++ pProxy = NULL; ++ } ++ free(vbi); ++} ++ ++ ++struct vt_page * vbi_query_page(struct vbi *vbi, int pgno, int subno) ++{ ++ struct vt_page *vtp = 0; ++ if (vbi->cache) ++ vtp = vbi->cache->op->get(vbi->cache, pgno, subno); ++ if (vtp == 0) ++ { ++ return 0; ++ } ++ vbi_send(vbi, EV_PAGE, 1, 0, 0, vtp); ++ return vtp; ++} ++ ++ ++void vbi_reset(struct vbi *vbi) ++{ ++ if (vbi->cache) ++ vbi->cache->op->reset(vbi->cache); ++ vbi_send(vbi, EV_RESET, 0, 0, 0, 0); ++} ++ ++ ++/* Starting from here: DVB API */ ++#include ++#include ++#include ++ ++static int dvb_get_table(int fd, u_int16_t pid, u_int8_t tblid, u_int8_t *buf, ++ size_t bufsz) ++{ ++ struct dmx_sct_filter_params sctFilterParams; ++ struct pollfd pfd; ++ int r; ++ memset(&sctFilterParams, 0, sizeof(sctFilterParams)); ++ sctFilterParams.pid = pid; ++ sctFilterParams.timeout = 10000; ++ sctFilterParams.flags = DMX_ONESHOT | DMX_IMMEDIATE_START | DMX_CHECK_CRC; ++ sctFilterParams.filter.filter[0] = tblid; ++ sctFilterParams.filter.mask[0] = 0xff; ++ if (ioctl(fd, DMX_SET_FILTER, &sctFilterParams)) { ++ perror("DMX_SET_FILTER"); ++ return -1; ++ } ++ pfd.fd = fd; ++ pfd.events = POLLIN; ++ r = poll(&pfd, 1, 10000); ++ if (r < 0) { ++ perror("poll"); ++ goto out; ++ } ++ if (r > 0) { ++ r = read(fd, buf, bufsz); ++ if (r < 0) { ++ perror("read"); ++ goto out; ++ } ++ } ++ out: ++ ioctl(fd, DMX_STOP, 0); ++ return r; ++} ++ ++static const u_int8_t byterev8[256] = { ++ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, ++ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, ++ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, ++ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, ++ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, ++ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, ++ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, ++ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, ++ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, ++ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, ++ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, ++ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, ++ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, ++ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, ++ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, ++ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, ++ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, ++ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, ++ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, ++ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, ++ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, ++ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, ++ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, ++ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, ++ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, ++ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, ++ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, ++ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, ++ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, ++ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, ++ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, ++ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff ++}; ++ ++static void dvb_handle_pes_payload(struct vbi *vbi, const u_int8_t *buf, ++ unsigned int len) ++{ ++ unsigned int p, i; ++ u_int8_t data[42]; ++ ++ if (buf[0] < 0x10 || buf[0] > 0x1f) ++ return; /* no EBU teletext data */ ++ for (p = 1; p < len; p += /*6 + 40*/ 2 + buf[p + 1]) { ++#if 0 ++ printf("Txt Line:\n" ++ " data_unit_id 0x%02x\n" ++ " data_unit_length 0x%02x\n" ++ " reserved_for_future_use 0x%01x\n" ++ " field_parity 0x%01x\n" ++ " line_offset 0x%02x\n" ++ " framing_code 0x%02x\n" ++ " magazine_and_packet_addr 0x%04x\n" ++ " data_block 0x%02x 0x%02x 0x%02x 0x%02x\n", ++ buf[p], buf[p+1], ++ buf[p+2] >> 6, ++ (buf[p+2] >> 5) & 1, ++ buf[p+2] & 0x1f, ++ buf[p+3], ++ (buf[p+4] << 8) | buf[p+5], ++ buf[p+6], buf[p+7], buf[p+8], buf[p+9]); ++#endif ++ for (i = 0; i < sizeof(data); i++) ++ data[i] = byterev8[buf[p+4+i]]; ++ /* note: we should probably check for missing lines and then ++ * call out_of_sync(vbi); and/or vbi_reset(vbi); */ ++ vt_line(vbi, data); ++ } ++} ++ ++static unsigned int rawptr; ++ ++static void dvb_handler(struct vbi *vbi, int fd) ++{ ++ /* PES packet start code prefix and stream_id == private_stream_1 */ ++ static const u_int8_t peshdr[4] = { 0x00, 0x00, 0x01, 0xbd }; ++ u_int8_t *bp; ++ int n; ++ unsigned int p, i, len; ++ u_int16_t rpid; ++ u_int32_t crc, crccomp; ++ ++ if (rawptr >= (unsigned int)rawbuf_size) ++ rawptr = 0; ++ n = read(vbi->fd, rawbuf + rawptr, rawbuf_size - rawptr); ++ if (n <= 0) ++ return; ++ rawptr += n; ++ if (rawptr < 6) ++ return; ++ if (memcmp(rawbuf, peshdr, sizeof(peshdr))) { ++ bp = memmem(rawbuf, rawptr, peshdr, sizeof(peshdr)); ++ if (!bp) ++ return; ++ rawptr -= (bp - rawbuf); ++ memmove(rawbuf, bp, rawptr); ++ if (rawptr < 6) ++ return; ++ } ++ len = (rawbuf[4] << 8) | rawbuf[5]; ++ if (len < 9) { ++ rawptr = 0; ++ return; ++ } ++ if (rawptr < len + 6) ++ return; ++ p = 9 + rawbuf[8]; ++#if 0 ++ for (i = 0; i < len - p; i++) { ++ if (!(i & 15)) ++ printf("\n%04x:", i); ++ printf(" %02x", rawbuf[p + i]); ++ } ++ printf("\n"); ++#endif ++ if (!dl_empty(vbi->clients)) ++ dvb_handle_pes_payload(vbi, rawbuf + p, len - p); ++ rawptr -= len; ++ if (rawptr) ++ memmove(rawbuf, rawbuf + len, rawptr); ++} ++ ++ ++static int vbi_dvb_open(struct vbi *vbi, const char *vbi_name, ++ const char *channel, char *outfile, u_int16_t sid, int ttpid) ++{ ++ struct { ++ u_int16_t pmtpid; ++ u_int16_t ttpid; ++ u_int16_t service_id; ++ u_int8_t service_type; ++ char service_provider_name[64]; ++ char service_name[64]; ++ u_int8_t txtlang[3]; ++ u_int8_t txttype; ++ u_int8_t txtmagazine; ++ u_int8_t txtpage; ++ } progtbl[16], *progp; ++ u_int8_t tbl[4096]; ++ u_int8_t * ppname, * psname, pncode, sncode, pnlen, snlen; ++ int r; ++ FILE *ofd; ++ unsigned int i, j, k, l, progcnt = 0; ++ struct dmx_pes_filter_params filterpar; ++ ++ /* open DVB demux device */ ++ if (!vbi_name) ++ vbi_name = "/dev/dvb/adapter0/demux0"; ++ if ((vbi->fd = open(vbi_name, O_RDWR)) == -1) { ++ error("cannot open demux device %s", vbi_name); ++ return -1; ++ } ++ memset(progtbl, 0, sizeof(progtbl)); ++ if (ttpid >= 0x15 && ttpid < 0x1fff) { ++ vbi->ttpid = ttpid; ++ printf("Using command line specified teletext PID 0x%x\n", ++ vbi->ttpid); ++ goto ttpidfound; ++ } ++ /* parse PAT to enumerate services and to find the PMT PIDs */ ++ r = dvb_get_table(vbi->fd, 0, 0, tbl, sizeof(tbl)); ++ if (r == -1) ++ goto outerr; ++ if (!(tbl[5] & 1)) { ++ error("PAT not active (current_next_indicator == 0)"); ++ goto outerr; ++ } ++ if (tbl[6] != 0 || tbl[7] != 0) { ++ error("PAT has multiple sections"); ++ goto outerr; ++ } ++ if (r < 13) { ++ error("PAT too short\n"); ++ goto outerr; ++ } ++ r -= 13; ++ for (i = 0; i < (unsigned)r; i += 4) { ++ if (progcnt >= sizeof(progtbl)/sizeof(progtbl[0])) { ++ error("Program table overflow"); ++ goto outerr; ++ } ++ progtbl[progcnt].service_id = (tbl[8 + i] << 8) | tbl[9 + i]; ++ if (!progtbl[progcnt].service_id) /* this is the NIT pointer */ ++ continue; ++ progtbl[progcnt].pmtpid = ((tbl[10 + i] << 8) | tbl[11 + i]) ++ & 0x1fff; ++ progcnt++; ++ } ++ /* find the SDT to get the station names */ ++ r = dvb_get_table(vbi->fd, 0x11, 0x42, tbl, sizeof(tbl)); ++ if (r == -1) ++ goto outerr; ++ if (!(tbl[5] & 1)) { ++ error("SDT not active (current_next_indicator == 0)"); ++ goto outerr; ++ } ++ if (tbl[6] != 0 || tbl[7] != 0) { ++ error("SDT has multiple sections"); ++ goto outerr; ++ } ++ if (r < 12) { ++ error("SDT too short\n"); ++ goto outerr; ++ } ++ i = 11; ++ while (i < (unsigned)r - 1) { ++ k = (tbl[i] << 8) | tbl[i+1]; /* service ID */ ++ progp = NULL; ++ for (j = 0; j < progcnt; j++) ++ if (progtbl[j].service_id == k) { ++ progp = &progtbl[j]; ++ break; ++ } ++ j = i + 5; ++ i = j + (((tbl[i+3] << 8) | tbl[i+4]) & 0x0fff); ++ if (!progp) { ++ error("SDT: service_id 0x%x not in PAT\n", k); ++ continue; ++ } ++ while (j < i) { ++ switch (tbl[j]) { ++ case 0x48: // service descriptor ++ k = j + 4 + tbl[j + 3]; ++ progp->service_type = tbl[j+2]; ++ ppname = tbl+j+4 ; // points to 1st byte of provider_name ++ pncode = *ppname ; // 1st byte of provider_name ++ pnlen = tbl[j+3]; // length of provider_name ++ psname = tbl+k+1 ; // points to 1st byte of service_name ++ sncode = *psname ; // 1st byte of service_name ++ snlen = tbl[k] ; // length of service_name ++ if (pncode >= 0x20) { ++ pncode = 0 ; // default character set Latin alphabet fig.A.1 ++ } else { ++ ppname++ ; pnlen-- ; ++ // character code from table A.3 1st byte = ctrl-code ++ } ++ if (sncode >= 0x20) { ++ sncode = 0 ; // default character set Latin alphabet fig.A.1 ++ } else { ++ psname++ ; snlen-- ; ++ // character code from table A.3 ; 1st byte = ctrl-code ++ } ++ snprintf(progp->service_provider_name, ++ sizeof(progp->service_provider_name), "%.*s", pnlen, ppname); ++ snprintf(progp->service_name, ++ sizeof(progp->service_name), "%.*s", snlen, psname); break; ++ } ++ j += 2 + tbl[j + 1]; // next descriptor ++ } ++ } ++ /* parse PMT's to find Teletext Services */ ++ for (l = 0; l < progcnt; l++) { ++ progtbl[l].ttpid = 0x1fff; ++ if (progtbl[l].service_type != 0x01 || /* not digital TV */ ++ progtbl[l].pmtpid < 0x15 || /* PMT PID sanity check */ ++ progtbl[l].pmtpid >= 0x1fff) ++ continue; ++ r = dvb_get_table(vbi->fd, progtbl[l].pmtpid, 0x02, tbl, ++ sizeof(tbl)); ++ if (r == -1) ++ goto outerr; ++ if (!(tbl[5] & 1)) { error \ ++ ("PMT pid 0x%x not active (current_next_indicator == 0)", ++ progtbl[l].pmtpid); ++ goto outerr; ++ } ++ if (tbl[6] != 0 || tbl[7] != 0) { ++ error("PMT pid 0x%x has multiple sections", ++ progtbl[l].pmtpid); ++ goto outerr; ++ } ++ if (r < 13) { ++ error("PMT pid 0x%x too short\n", progtbl[l].pmtpid); ++ goto outerr; ++ } ++ i = 12 + (((tbl[10] << 8) | tbl[11]) & 0x0fff); ++ /* skip program info section */ ++ while (i <= (unsigned)r-6) { ++ j = i + 5; ++ i = j + (((tbl[i + 3] << 8) | tbl[i + 4]) & 0x0fff); ++ if (tbl[j - 5] != 0x06) ++ /* teletext streams have type 0x06 */ ++ continue; ++ k = ((tbl[j - 4] << 8) | tbl[j - 3]) & 0x1fff; ++ /* elementary PID - save until we know if it's teletext PID */ ++ while (j < i) { ++ switch (tbl[j]) { ++ case 0x56: /* EBU teletext descriptor */ ++ progtbl[l].txtlang[0] = tbl[j + 2]; ++ progtbl[l].txtlang[1] = tbl[j + 3]; ++ progtbl[l].txtlang[2] = tbl[j + 4]; ++ progtbl[l].txttype = tbl[j + 5] >> 3; ++ progtbl[l].txtmagazine = tbl[j + 5] & 7; ++ progtbl[l].txtpage = tbl[j + 6]; ++ progtbl[l].ttpid = k; ++ break; ++ } ++ j += 2 + tbl[j + 1]; ++ } ++ } ++ } ++ ++ printf \ ++ ("sid:pmtpid:ttpid:type:provider:name:language:texttype:magazine:page\n\n"); ++ for (i = 0; i < progcnt; i++) { ++ printf("%d:%d:%d:%d:%s:%s:lang=%.3s:type=%d:magazine=%1u:page=%3u\n", ++ progtbl[i].service_id, progtbl[i].pmtpid, progtbl[i].ttpid, ++ progtbl[i].service_type, progtbl[i].service_provider_name, ++ progtbl[i].service_name, progtbl[i].txtlang, progtbl[i].txttype, ++ progtbl[i].txtmagazine, progtbl[i].txtpage); ++ } ++ ++ if (*outfile) { ++ ofd = fopen(outfile,"w") ; ++ if (ofd == NULL) { error("cannot open outfile\n"); goto outerr ; } ++ for (i = 0; i < progcnt; i++) { ++ if (progtbl[i].ttpid == 0x1fff) continue ; // service without teletext ++ fprintf(ofd,"%d:%d:%s:%s:lang=%.3s\n", ++ progtbl[i].service_id, progtbl[i].ttpid, progtbl[i].service_provider_name, ++ progtbl[i].service_name, progtbl[i].txtlang); ++ } ++ fclose(ofd) ; ++ } ++ ++ progp = NULL; ++ ++ if (channel) { ++ j = strlen(channel); ++ for (i = 0; i < progcnt; i++) ++ if (!strncmp(progtbl[i].service_name, channel, j) ++ && progtbl[i].ttpid != 0x1fff) { progp = &progtbl[i]; ++ break ; ++ } ++ } ++ ++ if (channel && !progp) { ++ j = strlen(channel); ++ for (i = 0; i < progcnt; i++) ++ if (!strncasecmp(progtbl[i].service_name, channel, j) ++ && progtbl[i].ttpid != 0x1fff) { progp = &progtbl[i]; ++ break ; ++ } ++ } ++ ++ if (sid) { ++ for (i = 0; i < progcnt; i++) { ++ if ((progtbl[i].service_id == sid) && (progtbl[i].ttpid != 0x1fff)) { ++ progp = &progtbl[i]; break ; } ++ } ++ } ++ ++ if (!progp) { ++ for (i = 0; i < progcnt; i++) ++ if (progtbl[i].ttpid != 0x1fff) { ++ progp = &progtbl[i]; break ; ++ } ++ } ++ ++ printf("\nUsing: Service ID = %d ; PMT PID = %d ; TXT PID = %d ;\n" ++ "Service type = %d ; Provider Name = %s ; Service name = %s ;\n" ++ "language = %.3s ; Text type = %d ; Text Magazine = %1u ; Text page = %3u\n", ++ progp->service_id, progp->pmtpid, progp->ttpid, progp->service_type, ++ progp->service_provider_name, progp->service_name, progp->txtlang, ++ progp->txttype, progp->txtmagazine, progp->txtpage); ++ vbi->ttpid = progp->ttpid; ++ ++ ttpidfound: ++ rawbuf = malloc(rawbuf_size = 8192); ++ if (!rawbuf) ++ goto outerr; ++ rawptr = 0; ++#if 0 ++ close(vbi->fd); ++ if ((vbi->fd = open(vbi_name, O_RDWR)) == -1) { ++ error("cannot open demux device %s", vbi_name); ++ return -1; ++ } ++#endif ++ memset(&filterpar, 0, sizeof(filterpar)); ++ filterpar.pid = vbi->ttpid; ++ filterpar.input = DMX_IN_FRONTEND; ++ filterpar.output = DMX_OUT_TAP; ++ filterpar.pes_type = DMX_PES_OTHER; ++ filterpar.flags = DMX_IMMEDIATE_START; ++ if (ioctl(vbi->fd, DMX_SET_PES_FILTER, &filterpar) < 0) { ++ error("ioctl: DMX_SET_PES_FILTER %s (%u)", strerror(errno), errno); ++ goto outerr; ++ } ++ return 0; ++ ++ outerr: ++ close(vbi->fd); ++ vbi->fd = -1; ++ return -1; ++} ++ ++ ++struct vbi *open_null_vbi(struct cache *ca) ++{ ++ static int inited = 0; ++ struct vbi *vbi; ++ ++ if (not inited) ++ lang_init(); ++ inited = 1; ++ ++ vbi = malloc(sizeof(*vbi)); ++ if (!vbi) ++ { ++ error("out of memory"); ++ goto fail1; ++ } ++ ++ vbi->fd = open("/dev/null", O_RDONLY); ++ if (vbi->fd == -1) ++ { ++ error("cannot open null device"); ++ goto fail2; ++ } ++ ++ vbi->ttpid = -1; ++ out_of_sync(vbi); ++ vbi->ppage = vbi->rpage; ++ fdset_add_fd(fds, vbi->fd, vbi_handler, vbi); ++ return vbi; ++ ++fail3: ++ close(vbi->fd); ++fail2: ++ free(vbi); ++fail1: ++ return 0; ++} ++ ++ ++void send_errmsg(struct vbi *vbi, char *errmsg, ...) ++{ ++ va_list args; ++ if (errmsg == NULL || *errmsg == '\0') ++ return; ++ va_start(args, errmsg); ++ char *buff = NULL; ++ if (vasprintf(&buff, errmsg, args) < 0) ++ buff = NULL; ++ va_end(args); ++ if(buff == NULL) ++ out_of_mem(-1); ++ vbi_send(vbi, EV_ERR, 0, 0, 0, buff); ++} +diff -r af23d23c278b util/alevt/vbi.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vbi.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,47 @@ ++#ifndef VBI_H ++#define VBI_H ++ ++#include "vt.h" ++#include "dllist.h" ++#include "cache.h" ++#include "lang.h" ++ ++#define PLL_ADJUST 4 ++ ++struct raw_page ++{ ++ struct vt_page page[1]; ++ struct enhance enh[1]; ++}; ++ ++struct vbi ++{ ++ int fd; ++ struct cache *cache; ++ struct dl_head clients[1]; ++ // page assembly ++ struct raw_page rpage[8]; // one for each magazin ++ struct raw_page *ppage; // points to page of previous pkt0 ++ // DVB stuff ++ unsigned int ttpid; ++ u_int16_t sid; ++}; ++ ++struct vbi_client ++{ ++ struct dl_node node[1]; ++ void (*handler)(void *data, struct vt_event *ev); ++ void *data; ++}; ++ ++struct vbi *vbi_open(char *vbi_dev_name, struct cache *ca, ++ const char *channel, char *outfile, u_int16_t sid, int ttpid); ++void vbi_close(struct vbi *vbi); ++void vbi_reset(struct vbi *vbi); ++int vbi_add_handler(struct vbi *vbi, void *handler, void *data); ++void vbi_del_handler(struct vbi *vbi, void *handler, void *data); ++struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno); ++ ++struct vbi *open_null_vbi(struct cache *ca); ++void send_errmsg(struct vbi *vbi, char *errmsg, ...); ++#endif +diff -r af23d23c278b util/alevt/vt.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,62 @@ ++#ifndef VT_H ++#define VT_H ++ ++#include "misc.h" ++ ++#define W 40 ++#define H 25 ++#define BAD_CHAR 0xb8 // substitute for chars with bad parity ++ ++struct vt_event ++{ ++ int type; ++ void *resource; /* struct xio_win *, struct vbi *, ... */ ++ int i1, i2, i3, i4; ++ void *p1; ++}; ++ ++#define EV_CLOSE 1 ++#define EV_KEY 2 // i1:KEY_xxx i2:shift-flag ++#define EV_MOUSE 3 // i1:button i2:shift-flag i3:x i4:y ++#define EV_SELECTION 4 // i1:len p1:data ++#define EV_PAGE 5 // p1:vt_page i1:query-flag ++#define EV_HEADER 6 // i1:pgno i2:subno i3:flags p1:data ++#define EV_XPACKET 7 // i1:mag i2:pkt i3:errors p1:data ++#define EV_RESET 8 // ./. ++#define EV_TIMER 9 // ./. ++#define EV_ERR 10 // p1: errmsg ++#define KEY_F(i) (1000+i) ++#define KEY_LEFT 2001 ++#define KEY_RIGHT 2002 ++#define KEY_UP 2003 ++#define KEY_DOWN 2004 ++#define KEY_PUP 2005 ++#define KEY_PDOWN 2006 ++#define KEY_DEL 2007 ++#define KEY_INS 2008 ++ ++struct vt_page ++{ ++ int pgno, subno; // the wanted page number ++ int lang; // language code ++ int flags; // misc flags (see PG_xxx below) ++ int errors; // number of single bit errors in page ++ u32 lines; // 1 bit for each line received ++ u8 data[25][40]; // page contents ++ int flof; // page has FastText links ++ struct { ++ int pgno; ++ int subno; ++ } link[6]; // FastText links (FLOF) ++}; ++ ++#define PG_SUPPHEADER 0x01 // C7 row 0 is not to be displayed ++#define PG_OUTOFSEQ 0x04 // C9 page out of numerical order ++#define PG_NODISPLAY 0x08 // C10 rows 1-24 is not to be displayed ++#define PG_MAGSERIAL 0x10 // C11 serial trans. (any pkt0 terminates page) ++#define PG_ERASE 0x20 // C4 clear previously stored lines ++#define PG_NEWSFLASH 0x40 // C5 box it and insert into normal video pict. ++#define PG_SUBTITLE 0x80 // C6 box it and insert into normal video pict. ++#define PG_ACTIVE 0x100 // currently fetching this page ++#define ANY_SUB 0x3f7f // universal subpage number ++#endif +diff -r af23d23c278b util/alevt/vt900.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt900.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Contents: ", ++"\6\15Contents: ", ++"\24 #################################### ", ++" ", ++" \3\177\6Starting alevt . . . . . . 902 ", ++" ", ++" \3\177\6Copying/Warranty . . . . . 904 ", ++" ", ++" \3\177\6The Status Line . . . . . 905 ", ++" ", ++" \3\177\6Selecting Pages . . . . . 907 ", ++" ", ++" \3\177\6QuickClick Page . . . . . 915 ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" (Click to select a page) ", ++" ", ++"\4\35\7 Next 901 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt901.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt901.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Contents: ", ++"\6\15Contents: ", ++"\24 #################################### ", ++" ", ++"\6 \3\177\6FastText Menu . . . . . . 909 ", ++"\6 ", ++"\6 \3\177\6Keyboard Commands . . . . 910 ", ++"\6 ", ++"\6 \3\177\6Starting alevt-cap . . . . 912 ", ++"\6 ", ++"\6 \3\177\6Starting alevt-date . . . 914 ", ++"\6 ", ++"\6 \3\177\6QuickClick Page . . . . . 915 ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" (Click to select a page) ", ++" ", ++"\4\35\7Back 900 Index 900 Next 902 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt902.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt902.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Starting alevt: ", ++"\6\15Starting alevt: ", ++"\24 #################################### ", ++"\6 $\7alevt\6[options] Default: ", ++" ", ++" -c\6 (none;dvb only) ", ++" -ch -child\6 (none) ", ++" -cs -charset \6latin-1 ", ++" \6 ", ++" -h -help ", ++" ", ++" ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 901 Index 900 Next 903 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt903.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt903.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Starting alevt: ", ++"\6\15Starting alevt: ", ++"\24 #################################### ", ++"\6 $\7alevt\6[options] Default: ", ++" -o\6 (none;dvb only) ", ++" -p -parent\6 900 ", ++" -s -sid\6 (none;dvb only) ", ++" -t -ttpid\6 (none;dvb only) ", ++" -v -vbi\6 /dev/vbi ", ++" \6/dev/vbi0 ", ++" \6/dev/video0 ", ++" \6/dev/dvb/adapter0/demux0 ", ++" ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 902 Index 900 Next 904 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt904.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt904.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Copying: ", ++"\6\15Copying: ", ++"\24 #################################### ", ++"\6 2002-07 Edgar Toernig (froese@gmx.de) ", ++"\6 All Rights Reserved. ", ++"\6 ", ++"\6 This program is free software; you ", ++"\6 can redistribute it and/or modify it ", ++"\6 under the terms of the GNU General ", ++"\6 Public License Version 2 as published ", ++"\6 by the Free Software Foundation. ", ++"\6 ", ++"\6 This program is distributed in the ", ++"\6 hope that it will be useful, but ", ++"\6\7without any warranty.\6See the GNU ", ++"\6 General Public License for details. ", ++" ", ++"\4\35\7Back 903 Index 900 Next 905 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt905.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt905.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Status Line: ", ++"\6\15Status Line: ", ++"\24 #################################### ", ++"\6 The top line of each window is the ", ++"\6 status line. On the left it shows ", ++"\6 the current page number (CPN) and ", ++"\6 some flags. The rest of the line ", ++"\6 is the running header sent by the ", ++"\6 TV station. ", ++"\6 ", ++"\6 If the CPN is red, the program is ", ++"\6 searching for that page. If it's ", ++"\6 green, it's the PN of the currently ", ++"\6 displayed page. ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 904 Index 900 Next 906 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt906.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt906.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Status Line: \14\5\30 ", ++"\6\15Status Line: \14\5\30 ", ++"\24 #################################### ", ++"\6 An\2H\6behind the CPN indicates that ", ++"\6 the page is on hold. This inhibits ", ++"\6 subpage cycling and page updates. A ", ++"\6 click on the CPN toggles the\2H\6flag.", ++" ", ++"\6 A\5*\6indicates that the page ", ++"\6 contains concealed text. Clicking on ", ++"\6 the\5*\6reveals that text. ", ++" ", ++"\6 A CPN in the form\2Sxx\6is shown if a ", ++"\6 specific subpage is selected. ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 905 Index 900 Next 907 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt907.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt907.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Selecting Pages: ", ++"\6\15Selecting Pages: ", ++"\24 #################################### ", ++"\6 To select a specific page, you may ", ++"\6 either enter the page number with ", ++"\6 the keyboard or click with the\7left ", ++"\6 mouse button on a page number ", ++"\6 somewhere on the screen. ", ++"\6 ", ++"\6 Clicking with the\7middle\6button will ", ++"\6 show the page in a child window. If ", ++"\6 there is no child window, a new one ", ++"\6 will be opened. ", ++"\6 ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 906 Index 900 Next 908 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt908.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt908.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Selecting Pages: ", ++"\6\15Selecting Pages: ", ++"\24 #################################### ", ++"\6 AleVT also recognizes something like ", ++"\3 3/7\6as a valid page number. Clicking ", ++"\6 with the\7left\6button will cycle to ", ++"\6 the next subpage of the current page. ", ++"\6 The\7middle\6buttons cycles backwards. ", ++"\6 ", ++"\6 For each window a history of ", ++"\6 recently visited pages is kept. ", ++"\6 Pressing the\7right\6mouse button will ", ++"\6 take you back to the previous page. ", ++"\6 ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 907 Index 900 Next 909 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt909.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt909.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15FastText Menu: ", ++"\6\15FastText Menu: ", ++"\24 #################################### ", ++"\6 The last line of each window shows ", ++"\6 the FastText Menu (only if one is ", ++"\6 transmitted for that page). ", ++"\6 ", ++"\6 It consists of up to four colored ", ++"\6 labels. You may click on a label ", ++"\6 or press one of the function keys ", ++"\6 F1-F4 to go to the associated page. ", ++"\6 ", ++"\6 For the 5th (white) key present on ", ++"\6 some remote controls press F5. ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 908 Index 900 Next 910 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt910.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt910.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Keyboard Commands: ", ++"\6\15Keyboard Commands: ", ++"\24 #################################### ", ++" 0\6-\0079 \6Enter page number ", ++" q\6or\7ESC \6Close window ", ++" h \6Goto page 900 (help page) ", ++" i \6Goto page 100 (index page) ", ++" o \6Open a new window ", ++" SPACE \6Hold page ", ++" RIGHT \6Goto next page ", ++" LEFT \6Goto previous page ", ++" DOWN \6Goto next subpage ", ++" UP \6Goto previous subpage ", ++" BACKSPACE\6Previous page from history ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 909 Index 900 Next 911 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt911.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt911.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \007 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Keyboard Commands: ", ++"\6\15Keyboard Commands: ", ++"\24 #################################### ", ++" s \6Save page to file ", ++" c \6Clear page cache ", ++" r \6Reveal concealed text ", ++" F1\6-\7F5 \6FastText keys ", ++" /\6and\7? \6Search forward/backward ", ++" n\6and\7N \6Search next/previous ", ++" f\6and\7F \6Fine tune the decoder ", ++" e \6Error reduction on/off ", ++" b \6Error bell on/off ", ++"\6 Holding the\7shift\6key while pressing ", ++"\6 one of the\7cursor\6keys allows ", ++"\6 selecting the 'hex' pages (Ex.: 1f1). ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++"\4\35\7Back 910 Index 900 Next 912 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt912.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt912.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Starting alevt-cap: ", ++"\6\15Starting alevt-cap: ", ++"\24 #################################### ", ++"\6 $\7alevt-cap\6[options] Default: ", ++" ", ++" -cs -charset \6latin-1 ", ++" \6 ", ++" -f -format \6ascii ", ++" \6 ", ++" -f help -format help ", ++" -h -help ", ++" -n -name \6 ttext-%s.%e ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 911 Index 900 Next 913 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt913.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt913.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Starting alevt-cap: ", ++"\6\15Starting alevt-cap: ", ++"\24 #################################### ", ++"\6 $\7alevt-cap\6[options] Default: ", ++" ", ++" -s -sid\6 (none;dvb only) ", ++" -t -ttpid\6 (none;dvb only) ", ++" -to -timeout\6 (none) ", ++" -v -vbi\6 /dev/vbi ", ++" \6/dev/vbi0 ", ++" \6/dev/video0 ", ++" \6/dev/dvb/adapter0/demux0 ", ++" ", ++" ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 912 Index 900 Next 914 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt914.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt914.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7 Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15Starting alevt-date: ", ++"\6\15Starting alevt-date: ", ++"\24 #################################### ", ++"\6 $\7alevt-date\6[options] Default: ", ++" ", ++" -d -delta\6 7200 (2 hours) ", ++" -f -format\6 %c ", ++" -h -help ", ++" -s -set \6off ", ++" -to -timeout\6(none) ", ++" -v -vbi\6 /dev/vbi ", ++" \6/dev/vbi0 ", ++" \6/dev/video0 ", ++" \6/dev/dvb/adapter0/demux0 ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7Back 913 Index 900 Next 915 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vt915.out +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vt915.out Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,29 @@ ++#ifndef HELP_HEADER ++" \6AleVT Online Help System ", ++" \22`p0`0 p `0pppp ", ++"\4\35\22\177 \177j5`p \177 j5 j5 \7Version \34", ++"\4\35\22\177,\177j5\177.! +t>! j5 \7 1.7.0 \34", ++" \22# #\42!\42# \42 \42! ", ++#else ++HELP_HEADER ++#endif ++" ", ++"\6\15QuickClick: ", ++"\6\15QuickClick: ", ++"\24 #################################### ", ++"\6 100 200 300 400 500 600 700 800 ", ++"\6 101 201 301 401 501 601 701 801 ", ++"\6 110 210 310 410 510 610 710 810 ", ++"\6 120\006220 320 420 520 620 720 820 ", ++"\6 130 230 330 430 530 630 730 830 ", ++"\6 140\006240 340 440 540 640 740 840 ", ++"\6 150 250 350 450 550 650 750 850 ", ++"\6 160\006260 360 460 560 660 760 860 ", ++"\6 170 270 370 470 570 670 770 870 ", ++"\6 180\006280 380 480 580 680 780 880 ", ++"\6 190 290 390 490 590 690 790 890 ", ++"\24 pppppppppppppppppppppppppppppppppppp ", ++" ", ++" ", ++"\4\35\7 Index 900 \34", ++"\1Page 100 \2Page 200 \3Page 300 \6Page 400\34", +diff -r af23d23c278b util/alevt/vtxt-iso8859-7.bdf +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vtxt-iso8859-7.bdf Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5768 @@ ++STARTFONT 2.1 ++FONT -alevt-teletext-medium-r-normal--16-1-75-75-c-90-fontspecific-1 ++SIZE 1 75 75 ++FONTBOUNDINGBOX 9 16 0 -4 ++STARTPROPERTIES 10 ++POINT_SIZE 1 ++PIXEL_SIZE 16 ++RESOLUTION_X 75 ++RESOLUTION_Y 75 ++FONT_ASCENT 12 ++FONT_DESCENT 4 ++AVERAGE_WIDTH 90 ++SPACING "C" ++_XMBDFED_INFO "Edited with xmbdfed 4.5." ++FONT "vtxt" ++ENDPROPERTIES ++CHARS 250 ++STARTCHAR char0 ++ENCODING 0 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 1 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 2 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 3 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 4 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 5 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 6 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 7 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 8 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 9 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 10 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 11 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 12 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 13 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 14 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 15 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 16 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 17 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 18 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 19 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 20 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 21 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 22 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 23 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 24 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 25 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 26 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 27 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 28 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 29 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 30 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 31 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char32 ++ENCODING 32 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char33 ++ENCODING 33 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++1800 ++1800 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char34 ++ENCODING 34 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++2400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char35 ++ENCODING 35 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3600 ++3600 ++7F00 ++3600 ++3600 ++3600 ++7F00 ++3600 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char36 ++ENCODING 36 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++0C00 ++3E00 ++6300 ++6100 ++6000 ++3E00 ++0300 ++0300 ++4300 ++6300 ++3E00 ++0C00 ++0C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char37 ++ENCODING 37 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6100 ++6300 ++0600 ++0C00 ++1800 ++3000 ++6300 ++4300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char38 ++ENCODING 38 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3600 ++1C00 ++3B00 ++6E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char39 ++ENCODING 39 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++3000 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char40 ++ENCODING 40 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0C00 ++1800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++1800 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char41 ++ENCODING 41 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3000 ++1800 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++1800 ++3000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char42 ++ENCODING 42 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++3C00 ++FF00 ++3C00 ++6600 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char43 ++ENCODING 43 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char44 ++ENCODING 44 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char45 ++ENCODING 45 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char46 ++ENCODING 46 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char47 ++ENCODING 47 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0100 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char48 ++ENCODING 48 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++6600 ++C300 ++C300 ++DB00 ++DB00 ++C300 ++C300 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char49 ++ENCODING 49 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3800 ++7800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char50 ++ENCODING 50 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char51 ++ENCODING 51 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0300 ++1E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char52 ++ENCODING 52 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0E00 ++1E00 ++3600 ++6600 ++7F00 ++0600 ++0600 ++0600 ++0F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char53 ++ENCODING 53 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6000 ++6000 ++6000 ++7E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char54 ++ENCODING 54 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3000 ++6000 ++6000 ++7E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char55 ++ENCODING 55 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6300 ++0300 ++0300 ++0600 ++0C00 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char56 ++ENCODING 56 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char57 ++ENCODING 57 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0300 ++0300 ++0600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char58 ++ENCODING 58 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char59 ++ENCODING 59 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char60 ++ENCODING 60 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0600 ++0C00 ++1800 ++3000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char61 ++ENCODING 61 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char62 ++ENCODING 62 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0C00 ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char63 ++ENCODING 63 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++0600 ++0C00 ++0C00 ++0C00 ++0000 ++0C00 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char64 ++ENCODING 64 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6F00 ++6F00 ++6F00 ++6E00 ++6000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char65 ++ENCODING 65 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char66 ++ENCODING 66 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3300 ++3300 ++3300 ++3300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char67 ++ENCODING 67 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char68 ++ENCODING 68 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char69 ++ENCODING 69 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char70 ++ENCODING 70 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char71 ++ENCODING 71 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6F00 ++6300 ++6300 ++3300 ++1D00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char72 ++ENCODING 72 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char73 ++ENCODING 73 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char74 ++ENCODING 74 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0F00 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char75 ++ENCODING 75 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7300 ++3300 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 76 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char77 ++ENCODING 77 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++E700 ++FF00 ++FF00 ++DB00 ++C300 ++C300 ++C300 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char78 ++ENCODING 78 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char79 ++ENCODING 79 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char80 ++ENCODING 80 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char81 ++ENCODING 81 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6B00 ++6F00 ++3E00 ++0600 ++0700 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char82 ++ENCODING 82 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 83 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char84 ++ENCODING 84 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char85 ++ENCODING 85 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char86 ++ENCODING 86 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char87 ++ENCODING 87 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char88 ++ENCODING 88 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++3C00 ++6600 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char89 ++ENCODING 89 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 90 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char91 ++ENCODING 91 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char92 ++ENCODING 92 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4000 ++6000 ++7000 ++3800 ++1C00 ++0E00 ++0700 ++0300 ++0100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char93 ++ENCODING 93 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char94 ++ENCODING 94 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char95 ++ENCODING 95 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char96 ++ENCODING 96 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 97 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char98 ++ENCODING 98 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char99 ++ENCODING 99 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 100 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0600 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char101 ++ENCODING 101 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char102 ++ENCODING 102 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char103 ++ENCODING 103 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char104 ++ENCODING 104 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3600 ++3B00 ++3300 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char105 ++ENCODING 105 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char106 ++ENCODING 106 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0600 ++0000 ++0E00 ++0600 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char107 ++ENCODING 107 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 108 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char109 ++ENCODING 109 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++E600 ++FF00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char110 ++ENCODING 110 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char111 ++ENCODING 111 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char112 ++ENCODING 112 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++0000 ++ENDCHAR ++STARTCHAR char113 ++ENCODING 113 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++0600 ++0600 ++0000 ++ENDCHAR ++STARTCHAR char114 ++ENCODING 114 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 115 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char116 ++ENCODING 116 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1800 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char117 ++ENCODING 117 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char118 ++ENCODING 118 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char119 ++ENCODING 119 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char120 ++ENCODING 120 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++3C00 ++6600 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char121 ++ENCODING 121 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++0C00 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 122 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char123 ++ENCODING 123 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++1800 ++1800 ++1800 ++7000 ++1800 ++1800 ++1800 ++1800 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char124 ++ENCODING 124 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char125 ++ENCODING 125 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++1800 ++1800 ++1800 ++0E00 ++1800 ++1800 ++1800 ++1800 ++7000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char126 ++ENCODING 126 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char127 ++ENCODING 127 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 128 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 129 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 130 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 131 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 132 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 133 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 134 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 135 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 136 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 137 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 138 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 139 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 140 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 141 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 142 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 143 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 144 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 145 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 146 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 147 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 148 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 149 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 150 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 151 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 152 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 153 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 154 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 155 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 156 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 157 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 158 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 159 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A0 NO-BREAK SPACE ++ENCODING 160 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+02BD MODIFIER LETTER REVERSED COMMA ++ENCODING 161 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++1000 ++1000 ++0800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+02BC MODIFIER LETTER APOSTROPHE ++ENCODING 162 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++0800 ++0800 ++1000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A3 POUND SIGN ++ENCODING 163 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++1000 ++1000 ++1000 ++7C00 ++1000 ++1000 ++1000 ++3E00 ++6100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A6 BROKEN BAR ++ENCODING 166 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A7 SECTION SIGN ++ENCODING 167 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++4200 ++4000 ++3C00 ++4200 ++4200 ++3C00 ++0200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A8 DIAERESIS ++ENCODING 168 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++2400 ++2400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00A9 COPYRIGHT SIGN ++ENCODING 169 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++4200 ++9900 ++A500 ++A100 ++A100 ++A500 ++9900 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK ++ENCODING 171 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++1200 ++1200 ++2400 ++2400 ++4800 ++2400 ++2400 ++1200 ++1200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00AC NOT SIGN ++ENCODING 172 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0200 ++0200 ++0200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00AD SOFT HYPHEN ++ENCODING 173 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+2015 HORIZONTAL BAR ++ENCODING 175 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00B0 DEGREE SIGN ++ENCODING 176 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++2800 ++2800 ++1000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00B1 PLUS-MINUS SIGN ++ENCODING 177 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++0800 ++0800 ++7F00 ++0800 ++0800 ++0800 ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00B2 SUPERSCRIPT TWO ++ENCODING 178 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++2200 ++0200 ++1C00 ++2000 ++2000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00B3 SUPERSCRIPT THREE ++ENCODING 179 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++2200 ++0200 ++1C00 ++0200 ++2200 ++1C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0384 GREEK TONOS ++ENCODING 180 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++1000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0385 GREEK DIALYTIKA TONOS ++ENCODING 181 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++1000 ++4400 ++4400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS ++ENCODING 182 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++1800 ++2400 ++2400 ++4200 ++4200 ++7E00 ++4200 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00B7 MIDDLE DOT ++ENCODING 183 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS ++ENCODING 184 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++7E00 ++4000 ++4000 ++4000 ++7C00 ++4000 ++4000 ++4000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0389 GREEK CAPITAL LETTER ETA WITH TONOS ++ENCODING 185 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++4200 ++4200 ++4200 ++4200 ++7E00 ++4200 ++4200 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+038A GREEK CAPITAL LETTER IOTA WITH TONOS ++ENCODING 186 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++3E00 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK ++ENCODING 187 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4800 ++4800 ++2400 ++2400 ++1200 ++2400 ++2400 ++4800 ++4800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS ++ENCODING 188 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+00BD VULGAR FRACTION ONE HALF ++ENCODING 189 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++2200 ++6200 ++2400 ++2800 ++2800 ++1400 ++1A00 ++2200 ++4400 ++4E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS ++ENCODING 190 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++4100 ++4100 ++2200 ++2200 ++1400 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS ++ENCODING 191 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++4000 ++4000 ++0000 ++3E00 ++4100 ++4100 ++4100 ++4100 ++2200 ++1400 ++1400 ++7700 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS ++ENCODING 192 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1000 ++5400 ++4400 ++0000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0391 GREEK CAPITAL LETTER ALPHA ++ENCODING 193 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++2400 ++2400 ++4200 ++4200 ++7E00 ++4200 ++4200 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0392 GREEK CAPITAL LETTER BETA ++ENCODING 194 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++4200 ++4200 ++4200 ++7C00 ++4200 ++4200 ++4200 ++4200 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0393 GREEK CAPITAL LETTER GAMMA ++ENCODING 195 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++4000 ++4000 ++4000 ++4000 ++4000 ++4000 ++4000 ++4000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0394 GREEK CAPITAL LETTER DELTA ++ENCODING 196 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++0800 ++1400 ++1400 ++2200 ++2200 ++2200 ++4100 ++4100 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0395 GREEK CAPITAL LETTER EPSILON ++ENCODING 197 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++4000 ++4000 ++4000 ++7C00 ++4000 ++4000 ++4000 ++4000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0396 GREEK CAPITAL LETTER ZETA ++ENCODING 198 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++0200 ++0200 ++0400 ++0800 ++1000 ++2000 ++4000 ++4000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0397 GREEK CAPITAL LETTER ETA ++ENCODING 199 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4200 ++4200 ++4200 ++4200 ++7E00 ++4200 ++4200 ++4200 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0398 GREEK CAPITAL LETTER THETA ++ENCODING 200 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++7E00 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+0399 GREEK CAPITAL LETTER IOTA ++ENCODING 201 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039A GREEK CAPITAL LETTER KAPPA ++ENCODING 202 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4200 ++4400 ++4800 ++5000 ++6000 ++6000 ++5000 ++4800 ++4400 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039B GREEK CAPITAL LETTER LAMDA ++ENCODING 203 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++0800 ++1400 ++1400 ++2200 ++2200 ++2200 ++4100 ++4100 ++4100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039C GREEK CAPITAL LETTER MU ++ENCODING 204 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4200 ++4200 ++6600 ++6600 ++5A00 ++5A00 ++4200 ++4200 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039D GREEK CAPITAL LETTER NU ++ENCODING 205 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4200 ++6200 ++6200 ++5200 ++5200 ++4A00 ++4A00 ++4600 ++4600 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039E GREEK CAPITAL LETTER XI ++ENCODING 206 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++3C00 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+039F GREEK CAPITAL LETTER OMICRON ++ENCODING 207 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A0 GREEK CAPITAL LETTER PI ++ENCODING 208 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++2200 ++2200 ++2200 ++2200 ++2200 ++2200 ++2200 ++2200 ++2200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A1 GREEK CAPITAL LETTER RHO ++ENCODING 209 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++4200 ++4200 ++4200 ++7C00 ++4000 ++4000 ++4000 ++4000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A3 GREEK CAPITAL LETTER SIGMA ++ENCODING 211 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++4000 ++2000 ++1000 ++0800 ++0800 ++1000 ++2000 ++4000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A4 GREEK CAPITAL LETTER TAU ++ENCODING 212 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A5 GREEK CAPITAL LETTER UPSILON ++ENCODING 213 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4100 ++4100 ++2200 ++2200 ++1400 ++0800 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A6 GREEK CAPITAL LETTER PHI ++ENCODING 214 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++0800 ++3E00 ++4900 ++4900 ++4900 ++4900 ++3E00 ++0800 ++1C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A7 GREEK CAPITAL LETTER CHI ++ENCODING 215 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4200 ++4200 ++2400 ++2400 ++1800 ++1800 ++2400 ++2400 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A8 GREEK CAPITAL LETTER PSI ++ENCODING 216 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4900 ++4900 ++4900 ++4900 ++4900 ++3E00 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03A9 GREEK CAPITAL LETTER OMEGA ++ENCODING 217 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++4100 ++4100 ++4100 ++4100 ++4100 ++2200 ++1400 ++1400 ++7700 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA ++ENCODING 218 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++2400 ++2400 ++0000 ++3E00 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++0800 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA ++ENCODING 219 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++2400 ++2400 ++0000 ++4100 ++4100 ++2200 ++2200 ++1400 ++0800 ++0800 ++0800 ++0800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AC GREEK SMALL LETTER ALPHA WITH TONOS ++ENCODING 220 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++3200 ++4A00 ++4400 ++4400 ++4400 ++4400 ++4A00 ++3200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AD GREEK SMALL LETTER EPSILON WITH TONOS ++ENCODING 221 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++3E00 ++4000 ++4000 ++3C00 ++4000 ++4000 ++4000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AE GREEK SMALL LETTER ETA WITH TONOS ++ENCODING 222 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++5C00 ++6200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++0200 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03AF GREEK SMALL LETTER IOTA WITH TONOS ++ENCODING 223 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS ++ENCODING 224 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++4400 ++4400 ++0000 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B1 GREEK SMALL LETTER ALPHA ++ENCODING 225 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3200 ++4A00 ++4400 ++4400 ++4400 ++4400 ++4A00 ++3200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B2 GREEK SMALL LETTER BETA ++ENCODING 226 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++4400 ++4400 ++4400 ++7C00 ++4200 ++4200 ++4200 ++6200 ++5C00 ++4000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B3 GREEK SMALL LETTER GAMMA ++ENCODING 227 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3100 ++4900 ++0A00 ++0400 ++0800 ++0800 ++1000 ++1000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B4 GREEK SMALL LETTER DELTA ++ENCODING 228 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++2000 ++2000 ++2000 ++1800 ++2400 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B5 GREEK SMALL LETTER EPSILON ++ENCODING 229 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3C00 ++4200 ++4000 ++3C00 ++4000 ++4000 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B6 GREEK SMALL LETTER ZETA ++ENCODING 230 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++2000 ++2000 ++1C00 ++0800 ++1000 ++2000 ++2000 ++2000 ++2000 ++1C00 ++0200 ++1C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B7 GREEK SMALL LETTER ETA ++ENCODING 231 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++5C00 ++6200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++0200 ++0200 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B8 GREEK SMALL LETTER THETA ++ENCODING 232 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++2400 ++2400 ++4200 ++7E00 ++4200 ++4200 ++2400 ++2400 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03B9 GREEK SMALL LETTER IOTA ++ENCODING 233 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BA GREEK SMALL LETTER KAPPA ++ENCODING 234 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++2200 ++2400 ++2800 ++3000 ++3000 ++2800 ++2400 ++2200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BB GREEK SMALL LETTER LAMDA ++ENCODING 235 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++2000 ++2000 ++1000 ++1000 ++0800 ++1800 ++2400 ++2400 ++4200 ++4200 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BC GREEK SMALL LETTER MU ++ENCODING 236 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++4200 ++4200 ++4200 ++4200 ++6600 ++6600 ++5A00 ++4200 ++4000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BD GREEK SMALL LETTER NU ++ENCODING 237 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++4200 ++4200 ++4200 ++4400 ++4400 ++4800 ++5000 ++6000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BE GREEK SMALL LETTER XI ++ENCODING 238 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++4000 ++4000 ++3C00 ++4000 ++4000 ++3C00 ++4000 ++4000 ++3C00 ++0200 ++0200 ++3C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03BF GREEK SMALL LETTER OMICRON ++ENCODING 239 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C0 GREEK SMALL LETTER PI ++ENCODING 240 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++7E00 ++2400 ++2400 ++2400 ++2400 ++2400 ++2400 ++2400 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C1 GREEK SMALL LETTER RHO ++ENCODING 241 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++4200 ++4200 ++6200 ++5C00 ++4000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C2 GREEK SMALL LETTER FINAL SIGMA ++ENCODING 242 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1E00 ++2000 ++4000 ++4000 ++4000 ++2000 ++1C00 ++0200 ++0200 ++1C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C3 GREEK SMALL LETTER SIGMA ++ENCODING 243 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3F00 ++4800 ++4400 ++4400 ++4400 ++4400 ++4400 ++3800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C4 GREEK SMALL LETTER TAU ++ENCODING 244 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++7E00 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C5 GREEK SMALL LETTER UPSILON ++ENCODING 245 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C6 GREEK SMALL LETTER PHI ++ENCODING 246 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3E00 ++4900 ++4900 ++4900 ++4900 ++4900 ++4900 ++3E00 ++0800 ++0800 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C7 GREEK SMALL LETTER CHI ++ENCODING 247 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++4200 ++4200 ++2400 ++2400 ++1800 ++1800 ++2400 ++2400 ++4200 ++4200 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C8 GREEK SMALL LETTER PSI ++ENCODING 248 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++4900 ++4900 ++4900 ++4900 ++4900 ++3E00 ++0800 ++0800 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03C9 GREEK SMALL LETTER OMEGA ++ENCODING 249 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++2200 ++4100 ++4100 ++4900 ++4900 ++4900 ++4900 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA ++ENCODING 250 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++2400 ++2400 ++0000 ++0000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++1000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA ++ENCODING 251 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++2400 ++2400 ++0000 ++0000 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03CC GREEK SMALL LETTER OMICRON WITH TONOS ++ENCODING 252 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++3C00 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03CD GREEK SMALL LETTER UPSILON WITH TONOS ++ENCODING 253 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1000 ++1000 ++0000 ++0000 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++4200 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR U+03CE GREEK SMALL LETTER OMEGA WITH TONOS ++ENCODING 254 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++0800 ++0000 ++0000 ++2200 ++4100 ++4100 ++4900 ++4900 ++4900 ++4900 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++ENDFONT +diff -r af23d23c278b util/alevt/vtxt-koi8.bdf +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vtxt-koi8.bdf Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5906 @@ ++STARTFONT 2.1 ++FONT -alevt-teletext-medium-r-normal--16-1-75-75-c-90-fontspecific-1 ++SIZE 1 75 75 ++FONTBOUNDINGBOX 9 16 0 -4 ++STARTPROPERTIES 10 ++POINT_SIZE 1 ++PIXEL_SIZE 16 ++RESOLUTION_X 75 ++RESOLUTION_Y 75 ++FONT_ASCENT 12 ++FONT_DESCENT 4 ++AVERAGE_WIDTH 90 ++SPACING "C" ++_XMBDFED_INFO "Edited with xmbdfed 3.0." ++FONT "vtxt" ++ENDPROPERTIES ++CHARS 256 ++STARTCHAR char0 ++ENCODING 0 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 1 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 2 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 3 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 4 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 5 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 6 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 7 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 8 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 9 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 10 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 11 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 12 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 13 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 14 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 15 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 16 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 17 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 18 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 19 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 20 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 21 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 22 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 23 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 24 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 25 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 26 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 27 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 28 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 29 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 30 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 31 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char32 ++ENCODING 32 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char33 ++ENCODING 33 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++1800 ++1800 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char34 ++ENCODING 34 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++2400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char35 ++ENCODING 35 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3600 ++3600 ++7F00 ++3600 ++3600 ++3600 ++7F00 ++3600 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char36 ++ENCODING 36 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++0C00 ++3E00 ++6300 ++6100 ++6000 ++3E00 ++0300 ++0300 ++4300 ++6300 ++3E00 ++0C00 ++0C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char37 ++ENCODING 37 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6100 ++6300 ++0600 ++0C00 ++1800 ++3000 ++6300 ++4300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char38 ++ENCODING 38 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3600 ++1C00 ++3B00 ++6E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char39 ++ENCODING 39 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++3000 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char40 ++ENCODING 40 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0C00 ++1800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++1800 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char41 ++ENCODING 41 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3000 ++1800 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++1800 ++3000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char42 ++ENCODING 42 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++3C00 ++FF00 ++3C00 ++6600 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char43 ++ENCODING 43 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char44 ++ENCODING 44 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char45 ++ENCODING 45 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char46 ++ENCODING 46 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char47 ++ENCODING 47 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0100 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char48 ++ENCODING 48 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++6600 ++C300 ++C300 ++DB00 ++DB00 ++C300 ++C300 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char49 ++ENCODING 49 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3800 ++7800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char50 ++ENCODING 50 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char51 ++ENCODING 51 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0300 ++1E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char52 ++ENCODING 52 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0E00 ++1E00 ++3600 ++6600 ++7F00 ++0600 ++0600 ++0600 ++0F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char53 ++ENCODING 53 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6000 ++6000 ++6000 ++7E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char54 ++ENCODING 54 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3000 ++6000 ++6000 ++7E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char55 ++ENCODING 55 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6300 ++0300 ++0300 ++0600 ++0C00 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char56 ++ENCODING 56 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char57 ++ENCODING 57 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0300 ++0300 ++0600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char58 ++ENCODING 58 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char59 ++ENCODING 59 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char60 ++ENCODING 60 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0600 ++0C00 ++1800 ++3000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char61 ++ENCODING 61 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char62 ++ENCODING 62 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0C00 ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char63 ++ENCODING 63 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++0600 ++0C00 ++0C00 ++0C00 ++0000 ++0C00 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char64 ++ENCODING 64 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6F00 ++6F00 ++6F00 ++6E00 ++6000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char65 ++ENCODING 65 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char66 ++ENCODING 66 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3300 ++3300 ++3300 ++3300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char67 ++ENCODING 67 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char68 ++ENCODING 68 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char69 ++ENCODING 69 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char70 ++ENCODING 70 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char71 ++ENCODING 71 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6F00 ++6300 ++6300 ++3300 ++1D00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char72 ++ENCODING 72 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char73 ++ENCODING 73 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char74 ++ENCODING 74 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0F00 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char75 ++ENCODING 75 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7300 ++3300 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 76 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char77 ++ENCODING 77 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++E700 ++FF00 ++FF00 ++DB00 ++C300 ++C300 ++C300 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char78 ++ENCODING 78 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char79 ++ENCODING 79 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char80 ++ENCODING 80 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char81 ++ENCODING 81 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6B00 ++6F00 ++3E00 ++0600 ++0700 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char82 ++ENCODING 82 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 83 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char84 ++ENCODING 84 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char85 ++ENCODING 85 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char86 ++ENCODING 86 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char87 ++ENCODING 87 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char88 ++ENCODING 88 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++3C00 ++6600 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char89 ++ENCODING 89 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 90 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char91 ++ENCODING 91 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char92 ++ENCODING 92 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4000 ++6000 ++7000 ++3800 ++1C00 ++0E00 ++0700 ++0300 ++0100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char93 ++ENCODING 93 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char94 ++ENCODING 94 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char95 ++ENCODING 95 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char96 ++ENCODING 96 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 97 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char98 ++ENCODING 98 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char99 ++ENCODING 99 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 100 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0600 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char101 ++ENCODING 101 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char102 ++ENCODING 102 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char103 ++ENCODING 103 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char104 ++ENCODING 104 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3600 ++3B00 ++3300 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char105 ++ENCODING 105 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char106 ++ENCODING 106 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0600 ++0000 ++0E00 ++0600 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char107 ++ENCODING 107 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 108 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char109 ++ENCODING 109 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++E600 ++FF00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char110 ++ENCODING 110 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char111 ++ENCODING 111 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char112 ++ENCODING 112 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++7800 ++0000 ++ENDCHAR ++STARTCHAR char113 ++ENCODING 113 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++0600 ++0F00 ++0000 ++ENDCHAR ++STARTCHAR char114 ++ENCODING 114 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 115 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char116 ++ENCODING 116 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1800 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char117 ++ENCODING 117 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char118 ++ENCODING 118 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char119 ++ENCODING 119 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char120 ++ENCODING 120 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++3C00 ++6600 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char121 ++ENCODING 121 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 122 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char123 ++ENCODING 123 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++1800 ++1800 ++1800 ++7000 ++1800 ++1800 ++1800 ++1800 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char124 ++ENCODING 124 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char125 ++ENCODING 125 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++1800 ++1800 ++1800 ++0E00 ++1800 ++1800 ++1800 ++1800 ++7000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char126 ++ENCODING 126 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char127 ++ENCODING 127 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 128 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 129 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 130 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 131 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 132 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 133 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 134 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 135 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 136 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 137 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 138 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 139 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 140 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 141 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 142 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 143 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 144 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 145 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 146 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 147 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 148 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 149 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 150 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 151 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 152 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 153 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 154 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 155 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 156 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 157 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 158 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 159 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char160 ++ENCODING 160 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++ENDCHAR ++STARTCHAR char161 ++ENCODING 161 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++1800 ++1800 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char162 ++ENCODING 162 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++1800 ++7E00 ++C300 ++C000 ++C000 ++C000 ++C300 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char163 ++ENCODING 163 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char164 ++ENCODING 164 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4100 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++6300 ++4100 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char165 ++ENCODING 165 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++FF00 ++1800 ++FF00 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char166 ++ENCODING 166 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char167 ++ENCODING 167 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3E00 ++6300 ++3000 ++1C00 ++3600 ++6300 ++6300 ++3600 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char168 ++ENCODING 168 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++7E00 ++DB00 ++FF00 ++BD00 ++C300 ++E700 ++FF00 ++7E00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char169 ++ENCODING 169 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++4100 ++5D00 ++5100 ++5100 ++5D00 ++4100 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char170 ++ENCODING 170 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++0C00 ++3C00 ++6400 ++3C00 ++0000 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char171 ++ENCODING 171 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++3000 ++7F00 ++7F00 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char172 ++ENCODING 172 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++7E00 ++5A00 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char173 ++ENCODING 173 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char174 ++ENCODING 174 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++4100 ++5D00 ++5500 ++5900 ++5500 ++4100 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char175 ++ENCODING 175 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char176 ++ENCODING 176 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++3600 ++1C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char177 ++ENCODING 177 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char178 ++ENCODING 178 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++6C00 ++1800 ++3000 ++6400 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char179 ++ENCODING 179 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7C00 ++0C00 ++1800 ++0C00 ++6C00 ++3800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char180 ++ENCODING 180 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char181 ++ENCODING 181 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++7E00 ++6300 ++6000 ++C000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char182 ++ENCODING 182 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++DB00 ++DB00 ++DB00 ++7B00 ++1B00 ++1B00 ++1B00 ++1B00 ++1B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char183 ++ENCODING 183 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char184 ++ENCODING 184 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0080 ++0100 ++0300 ++0600 ++0C00 ++1C00 ++3000 ++7F00 ++7700 ++0E00 ++1C00 ++1800 ++3000 ++6000 ++8000 ++0000 ++ENDCHAR ++STARTCHAR char185 ++ENCODING 185 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++7000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char186 ++ENCODING 186 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++6C00 ++4400 ++6C00 ++3800 ++0000 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char187 ++ENCODING 187 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0C00 ++0600 ++7F00 ++7F00 ++0600 ++0C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char188 ++ENCODING 188 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++6000 ++6100 ++6300 ++6600 ++0C00 ++1800 ++3300 ++6700 ++4B00 ++1F00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char189 ++ENCODING 189 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++6000 ++6100 ++6300 ++6600 ++0C00 ++1800 ++3000 ++6700 ++4D80 ++0300 ++0600 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char190 ++ENCODING 190 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7800 ++1800 ++3900 ++1B00 ++7600 ++0C00 ++1800 ++3300 ++6700 ++4B00 ++1F00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char191 ++ENCODING 191 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++1800 ++1800 ++3000 ++6000 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char238 ++ENCODING 192 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++CE00 ++DB00 ++DB00 ++FB00 ++DB00 ++DB00 ++CE00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char160 ++ENCODING 193 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7800 ++0C00 ++7C00 ++CC00 ++CC00 ++CC00 ++7600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char161 ++ENCODING 194 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0200 ++0600 ++3C00 ++6000 ++6000 ++7C00 ++6600 ++6600 ++6600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char230 ++ENCODING 195 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++FE00 ++0600 ++0600 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char164 ++ENCODING 196 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1E00 ++3600 ++3600 ++6600 ++6600 ++6600 ++FF00 ++C300 ++C300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char165 ++ENCODING 197 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7C00 ++C600 ++FE00 ++C000 ++C000 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char228 ++ENCODING 198 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++3C00 ++1800 ++7E00 ++DB00 ++DB00 ++DB00 ++DB00 ++7E00 ++1800 ++1800 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char163 ++ENCODING 199 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++3200 ++3200 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char229 ++ENCODING 200 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++6C00 ++3800 ++3800 ++3800 ++6C00 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char168 ++ENCODING 201 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++C600 ++CE00 ++D600 ++E600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char169 ++ENCODING 202 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3800 ++3800 ++C600 ++C600 ++CE00 ++D600 ++E600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char170 ++ENCODING 203 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++E600 ++6C00 ++7800 ++7800 ++6C00 ++6600 ++E600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char171 ++ENCODING 204 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char172 ++ENCODING 205 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++EE00 ++FE00 ++FE00 ++D600 ++D600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char173 ++ENCODING 206 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++C600 ++C600 ++FE00 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char174 ++ENCODING 207 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7C00 ++C600 ++C600 ++C600 ++C600 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char175 ++ENCODING 208 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FE00 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char239 ++ENCODING 209 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++CC00 ++CC00 ++FC00 ++6C00 ++CC00 ++CE00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char224 ++ENCODING 210 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++DC00 ++6600 ++6600 ++6600 ++6600 ++6600 ++7C00 ++6000 ++6000 ++F000 ++0000 ++ENDCHAR ++STARTCHAR char225 ++ENCODING 211 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7C00 ++C600 ++C000 ++C000 ++C000 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char226 ++ENCODING 212 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++5A00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char227 ++ENCODING 213 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++C600 ++C600 ++C600 ++C600 ++7E00 ++0600 ++0600 ++C600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char166 ++ENCODING 214 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++D600 ++D600 ++5400 ++7C00 ++5400 ++D600 ++D600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char162 ++ENCODING 215 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FC00 ++6600 ++6600 ++7C00 ++6600 ++6600 ++FC00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char236 ++ENCODING 216 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++6000 ++6000 ++7C00 ++6600 ++6600 ++FC00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char235 ++ENCODING 217 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++C600 ++C600 ++F600 ++DE00 ++DE00 ++F600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char167 ++ENCODING 218 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++6600 ++0600 ++0C00 ++0600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char232 ++ENCODING 219 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++D600 ++D600 ++D600 ++D600 ++D600 ++D600 ++FE00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char237 ++ENCODING 220 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++6600 ++0600 ++1E00 ++0600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char233 ++ENCODING 221 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++D600 ++D600 ++D600 ++D600 ++D600 ++D600 ++FE00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char231 ++ENCODING 222 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C600 ++C600 ++C600 ++C600 ++7E00 ++0600 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char234 ++ENCODING 223 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F800 ++B000 ++3000 ++3E00 ++3300 ++3300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char158 ++ENCODING 224 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++CE00 ++DB00 ++DB00 ++DB00 ++FB00 ++DB00 ++DB00 ++DB00 ++DB00 ++CE00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char128 ++ENCODING 225 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3600 ++6600 ++C600 ++C600 ++FE00 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char129 ++ENCODING 226 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FE00 ++6200 ++6200 ++6000 ++7C00 ++6600 ++6600 ++6600 ++6600 ++FC00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char150 ++ENCODING 227 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++CC00 ++FE00 ++0600 ++0600 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char132 ++ENCODING 228 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++FF00 ++C300 ++8100 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char133 ++ENCODING 229 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FE00 ++6600 ++6200 ++6800 ++7800 ++6800 ++6000 ++6200 ++6600 ++FE00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char148 ++ENCODING 230 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3C00 ++1800 ++7E00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++7E00 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char131 ++ENCODING 231 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FE00 ++6200 ++6200 ++6000 ++6000 ++6000 ++6000 ++6000 ++6000 ++F000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char149 ++ENCODING 232 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++C600 ++6C00 ++7C00 ++3800 ++3800 ++7C00 ++6C00 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char136 ++ENCODING 233 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++C600 ++CE00 ++CE00 ++D600 ++E600 ++E600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char137 ++ENCODING 234 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3800 ++3800 ++C600 ++C600 ++CE00 ++CE00 ++D600 ++E600 ++E600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char138 ++ENCODING 235 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++E600 ++6600 ++6C00 ++6C00 ++7800 ++7800 ++6C00 ++6C00 ++6600 ++E600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char139 ++ENCODING 236 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3600 ++6600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char140 ++ENCODING 237 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++EE00 ++FE00 ++FE00 ++D600 ++C600 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char141 ++ENCODING 238 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++C600 ++C600 ++C600 ++FE00 ++C600 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char142 ++ENCODING 239 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char143 ++ENCODING 240 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FE00 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++C600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char159 ++ENCODING 241 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3F00 ++6600 ++6600 ++6600 ++3E00 ++3E00 ++6600 ++6600 ++6600 ++E700 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char144 ++ENCODING 242 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FC00 ++6600 ++6600 ++6600 ++7C00 ++6000 ++6000 ++6000 ++6000 ++F000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char145 ++ENCODING 243 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++6600 ++C200 ++C000 ++C000 ++C000 ++C000 ++C200 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char146 ++ENCODING 244 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++5A00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char147 ++ENCODING 245 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++C600 ++C600 ++C600 ++C600 ++7E00 ++0600 ++0600 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char134 ++ENCODING 246 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++D600 ++D600 ++5400 ++5400 ++7C00 ++7C00 ++5400 ++D600 ++D600 ++D600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char130 ++ENCODING 247 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FC00 ++6600 ++6600 ++6600 ++7C00 ++6600 ++6600 ++6600 ++6600 ++FC00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char156 ++ENCODING 248 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++F000 ++6000 ++6000 ++6000 ++7C00 ++6600 ++6600 ++6600 ++6600 ++FC00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char155 ++ENCODING 249 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++F300 ++DB00 ++DB00 ++DB00 ++DB00 ++F300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char135 ++ENCODING 250 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++C600 ++0600 ++0600 ++3C00 ++0600 ++0600 ++0600 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char152 ++ENCODING 251 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char157 ++ENCODING 252 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++C600 ++0600 ++2600 ++3E00 ++2600 ++0600 ++0600 ++C600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char153 ++ENCODING 253 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++FF00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char151 ++ENCODING 254 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C600 ++C600 ++C600 ++C600 ++C600 ++7E00 ++0600 ++0600 ++0600 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char154 ++ENCODING 255 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++F800 ++B000 ++3000 ++3000 ++3C00 ++3600 ++3600 ++3600 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++ENDFONT +diff -r af23d23c278b util/alevt/vtxt-latin-1.bdf +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vtxt-latin-1.bdf Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5906 @@ ++STARTFONT 2.1 ++FONT -alevt-teletext-medium-r-normal--16-1-75-75-c-90-fontspecific-1 ++SIZE 1 75 75 ++FONTBOUNDINGBOX 9 16 0 -4 ++STARTPROPERTIES 10 ++POINT_SIZE 1 ++PIXEL_SIZE 16 ++RESOLUTION_X 75 ++RESOLUTION_Y 75 ++FONT_ASCENT 12 ++FONT_DESCENT 4 ++AVERAGE_WIDTH 90 ++SPACING "C" ++_XMBDFED_INFO "Edited with xmbdfed 2.4." ++FONT "vtxt" ++ENDPROPERTIES ++CHARS 256 ++STARTCHAR char0 ++ENCODING 0 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 1 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 2 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 3 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 4 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 5 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 6 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 7 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 8 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 9 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 10 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 11 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 12 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 13 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 14 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 15 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 16 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 17 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 18 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 19 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 20 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 21 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 22 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 23 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 24 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 25 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 26 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 27 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 28 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 29 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 30 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 31 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char32 ++ENCODING 32 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char33 ++ENCODING 33 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++1800 ++1800 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char34 ++ENCODING 34 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++2400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char35 ++ENCODING 35 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3600 ++3600 ++7F00 ++3600 ++3600 ++3600 ++7F00 ++3600 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char36 ++ENCODING 36 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++0C00 ++3E00 ++6300 ++6100 ++6000 ++3E00 ++0300 ++0300 ++4300 ++6300 ++3E00 ++0C00 ++0C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char37 ++ENCODING 37 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6100 ++6300 ++0600 ++0C00 ++1800 ++3000 ++6300 ++4300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char38 ++ENCODING 38 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3600 ++1C00 ++3B00 ++6E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char39 ++ENCODING 39 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++3000 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char40 ++ENCODING 40 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0C00 ++1800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++1800 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char41 ++ENCODING 41 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3000 ++1800 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++1800 ++3000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char42 ++ENCODING 42 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++3C00 ++FF00 ++3C00 ++6600 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char43 ++ENCODING 43 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char44 ++ENCODING 44 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char45 ++ENCODING 45 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char46 ++ENCODING 46 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char47 ++ENCODING 47 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0100 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char48 ++ENCODING 48 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++6600 ++C300 ++C300 ++DB00 ++DB00 ++C300 ++C300 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char49 ++ENCODING 49 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3800 ++7800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char50 ++ENCODING 50 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char51 ++ENCODING 51 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0300 ++1E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char52 ++ENCODING 52 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0E00 ++1E00 ++3600 ++6600 ++7F00 ++0600 ++0600 ++0600 ++0F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char53 ++ENCODING 53 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6000 ++6000 ++6000 ++7E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char54 ++ENCODING 54 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3000 ++6000 ++6000 ++7E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char55 ++ENCODING 55 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6300 ++0300 ++0300 ++0600 ++0C00 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char56 ++ENCODING 56 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char57 ++ENCODING 57 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0300 ++0300 ++0600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char58 ++ENCODING 58 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char59 ++ENCODING 59 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char60 ++ENCODING 60 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0600 ++0C00 ++1800 ++3000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char61 ++ENCODING 61 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char62 ++ENCODING 62 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0C00 ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char63 ++ENCODING 63 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++0600 ++0C00 ++0C00 ++0C00 ++0000 ++0C00 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char64 ++ENCODING 64 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6F00 ++6F00 ++6F00 ++6E00 ++6000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char65 ++ENCODING 65 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char66 ++ENCODING 66 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3300 ++3300 ++3300 ++3300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char67 ++ENCODING 67 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char68 ++ENCODING 68 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char69 ++ENCODING 69 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char70 ++ENCODING 70 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char71 ++ENCODING 71 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6F00 ++6300 ++6300 ++3300 ++1D00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char72 ++ENCODING 72 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char73 ++ENCODING 73 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char74 ++ENCODING 74 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0F00 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char75 ++ENCODING 75 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7300 ++3300 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 76 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char77 ++ENCODING 77 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++E700 ++FF00 ++FF00 ++DB00 ++C300 ++C300 ++C300 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char78 ++ENCODING 78 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char79 ++ENCODING 79 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char80 ++ENCODING 80 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char81 ++ENCODING 81 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6B00 ++6F00 ++3E00 ++0600 ++0700 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char82 ++ENCODING 82 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 83 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char84 ++ENCODING 84 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char85 ++ENCODING 85 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char86 ++ENCODING 86 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char87 ++ENCODING 87 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char88 ++ENCODING 88 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++3C00 ++6600 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char89 ++ENCODING 89 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 90 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char91 ++ENCODING 91 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char92 ++ENCODING 92 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4000 ++6000 ++7000 ++3800 ++1C00 ++0E00 ++0700 ++0300 ++0100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char93 ++ENCODING 93 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char94 ++ENCODING 94 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char95 ++ENCODING 95 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char96 ++ENCODING 96 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 97 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char98 ++ENCODING 98 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char99 ++ENCODING 99 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 100 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0600 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char101 ++ENCODING 101 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char102 ++ENCODING 102 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char103 ++ENCODING 103 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char104 ++ENCODING 104 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3600 ++3B00 ++3300 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char105 ++ENCODING 105 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char106 ++ENCODING 106 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0600 ++0000 ++0E00 ++0600 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char107 ++ENCODING 107 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 108 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char109 ++ENCODING 109 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++E600 ++FF00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char110 ++ENCODING 110 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char111 ++ENCODING 111 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char112 ++ENCODING 112 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++7800 ++0000 ++ENDCHAR ++STARTCHAR char113 ++ENCODING 113 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++0600 ++0F00 ++0000 ++ENDCHAR ++STARTCHAR char114 ++ENCODING 114 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 115 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char116 ++ENCODING 116 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1800 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char117 ++ENCODING 117 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char118 ++ENCODING 118 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char119 ++ENCODING 119 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char120 ++ENCODING 120 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++3C00 ++6600 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char121 ++ENCODING 121 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 122 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char123 ++ENCODING 123 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++1800 ++1800 ++1800 ++7000 ++1800 ++1800 ++1800 ++1800 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char124 ++ENCODING 124 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char125 ++ENCODING 125 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++1800 ++1800 ++1800 ++0E00 ++1800 ++1800 ++1800 ++1800 ++7000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char126 ++ENCODING 126 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char127 ++ENCODING 127 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 128 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 129 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 130 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 131 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 132 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 133 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 134 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 135 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 136 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 137 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 138 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 139 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 140 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 141 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 142 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 143 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 144 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 145 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 146 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 147 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 148 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 149 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 150 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 151 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 152 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 153 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 154 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 155 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 156 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 157 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 158 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 159 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char160 ++ENCODING 160 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++ENDCHAR ++STARTCHAR char161 ++ENCODING 161 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++1800 ++1800 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char162 ++ENCODING 162 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++1800 ++7E00 ++C300 ++C000 ++C000 ++C000 ++C300 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char163 ++ENCODING 163 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char164 ++ENCODING 164 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4100 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++6300 ++4100 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char165 ++ENCODING 165 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++FF00 ++1800 ++FF00 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char166 ++ENCODING 166 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char167 ++ENCODING 167 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3E00 ++6300 ++3000 ++1C00 ++3600 ++6300 ++6300 ++3600 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char168 ++ENCODING 168 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++7E00 ++DB00 ++FF00 ++BD00 ++C300 ++E700 ++FF00 ++7E00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char169 ++ENCODING 169 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++4100 ++5D00 ++5100 ++5100 ++5D00 ++4100 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char170 ++ENCODING 170 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++0C00 ++3C00 ++6400 ++3C00 ++0000 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char171 ++ENCODING 171 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++3000 ++7F00 ++7F00 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char172 ++ENCODING 172 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++7E00 ++5A00 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char173 ++ENCODING 173 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char174 ++ENCODING 174 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++4100 ++5D00 ++5500 ++5900 ++5500 ++4100 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char175 ++ENCODING 175 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char176 ++ENCODING 176 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++3600 ++1C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char177 ++ENCODING 177 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char178 ++ENCODING 178 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++6C00 ++1800 ++3000 ++6400 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char179 ++ENCODING 179 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7C00 ++0C00 ++1800 ++0C00 ++6C00 ++3800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char180 ++ENCODING 180 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char181 ++ENCODING 181 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++7E00 ++6300 ++6000 ++C000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char182 ++ENCODING 182 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++DB00 ++DB00 ++DB00 ++7B00 ++1B00 ++1B00 ++1B00 ++1B00 ++1B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char183 ++ENCODING 183 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char184 ++ENCODING 184 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0080 ++0100 ++0300 ++0600 ++0C00 ++1C00 ++3000 ++7F00 ++7700 ++0E00 ++1C00 ++1800 ++3000 ++6000 ++8000 ++0000 ++ENDCHAR ++STARTCHAR char185 ++ENCODING 185 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++7000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char186 ++ENCODING 186 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3800 ++6C00 ++4400 ++6C00 ++3800 ++0000 ++7C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char187 ++ENCODING 187 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0C00 ++0600 ++7F00 ++7F00 ++0600 ++0C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char188 ++ENCODING 188 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++6000 ++6100 ++6300 ++6600 ++0C00 ++1800 ++3300 ++6700 ++4B00 ++1F00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char189 ++ENCODING 189 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++6000 ++6100 ++6300 ++6600 ++0C00 ++1800 ++3000 ++6700 ++4D80 ++0300 ++0600 ++0F80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char190 ++ENCODING 190 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++7800 ++1800 ++3900 ++1B00 ++7600 ++0C00 ++1800 ++3300 ++6700 ++4B00 ++1F00 ++0300 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char191 ++ENCODING 191 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++1800 ++1800 ++3000 ++6000 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char192 ++ENCODING 192 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++0C00 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char193 ++ENCODING 193 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char194 ++ENCODING 194 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++3600 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char195 ++ENCODING 195 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3B00 ++6E00 ++0000 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char196 ++ENCODING 196 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char197 ++ENCODING 197 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++1400 ++1C00 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char198 ++ENCODING 198 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1F00 ++3600 ++6600 ++6600 ++7F00 ++6600 ++6600 ++6600 ++6600 ++6700 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char199 ++ENCODING 199 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0600 ++0300 ++3E00 ++0000 ++ENDCHAR ++STARTCHAR char200 ++ENCODING 200 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++0C00 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char201 ++ENCODING 201 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char202 ++ENCODING 202 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++3600 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char203 ++ENCODING 203 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char204 ++ENCODING 204 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++1800 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char205 ++ENCODING 205 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char206 ++ENCODING 206 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3C00 ++6600 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char207 ++ENCODING 207 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char208 ++ENCODING 208 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3600 ++3300 ++3300 ++7B00 ++7B00 ++3300 ++3300 ++3600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char209 ++ENCODING 209 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3B00 ++6E00 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char210 ++ENCODING 210 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++1800 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char211 ++ENCODING 211 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char212 ++ENCODING 212 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++3600 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char213 ++ENCODING 213 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3B00 ++6E00 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char214 ++ENCODING 214 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char215 ++ENCODING 215 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6300 ++3600 ++1C00 ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char216 ++ENCODING 216 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0100 ++0300 ++3E00 ++6700 ++6700 ++6F00 ++6B00 ++6B00 ++7B00 ++7300 ++7300 ++3E00 ++6000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char217 ++ENCODING 217 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++1800 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char218 ++ENCODING 218 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char219 ++ENCODING 219 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++1400 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char220 ++ENCODING 220 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char221 ++ENCODING 221 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++3000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char222 ++ENCODING 222 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++7800 ++3000 ++3E00 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char223 ++ENCODING 223 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++6300 ++6700 ++6E00 ++6C00 ++6600 ++6300 ++6B00 ++6E00 ++6000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char224 ++ENCODING 224 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++1800 ++0C00 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char225 ++ENCODING 225 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char226 ++ENCODING 226 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0800 ++1C00 ++3600 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char227 ++ENCODING 227 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char228 ++ENCODING 228 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char229 ++ENCODING 229 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++1C00 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char230 ++ENCODING 230 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3B00 ++1B00 ++7E00 ++D800 ++DC00 ++7700 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char231 ++ENCODING 231 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0C00 ++0600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char232 ++ENCODING 232 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++1800 ++0C00 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char233 ++ENCODING 233 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0600 ++0C00 ++1800 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char234 ++ENCODING 234 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0800 ++1C00 ++3600 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char235 ++ENCODING 235 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char236 ++ENCODING 236 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++3000 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char237 ++ENCODING 237 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0600 ++0C00 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char238 ++ENCODING 238 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++3C00 ++6600 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char239 ++ENCODING 239 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++0000 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 240 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0F00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char241 ++ENCODING 241 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char242 ++ENCODING 242 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++1800 ++0C00 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char243 ++ENCODING 243 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char244 ++ENCODING 244 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0800 ++1C00 ++3600 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char245 ++ENCODING 245 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char246 ++ENCODING 246 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char247 ++ENCODING 247 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++7E00 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char248 ++ENCODING 248 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0100 ++0300 ++3E00 ++6700 ++6F00 ++6B00 ++7B00 ++7300 ++3E00 ++6000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char249 ++ENCODING 249 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++1800 ++0C00 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char250 ++ENCODING 250 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char251 ++ENCODING 251 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++3C00 ++6600 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char252 ++ENCODING 252 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char253 ++ENCODING 253 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char254 ++ENCODING 254 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++7800 ++3000 ++3E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++7800 ++0000 ++ENDCHAR ++STARTCHAR char255 ++ENCODING 255 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++ENDFONT +diff -r af23d23c278b util/alevt/vtxt-latin-2.bdf +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/vtxt-latin-2.bdf Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5906 @@ ++STARTFONT 2.1 ++FONT -alevt-teletext-medium-r-normal--16-1-75-75-c-90-fontspecific-2 ++SIZE 1 75 75 ++FONTBOUNDINGBOX 9 16 0 -4 ++STARTPROPERTIES 10 ++POINT_SIZE 1 ++PIXEL_SIZE 16 ++RESOLUTION_X 75 ++RESOLUTION_Y 75 ++FONT_ASCENT 12 ++FONT_DESCENT 4 ++AVERAGE_WIDTH 90 ++SPACING "C" ++_XMBDFED_INFO "Edited with xmbdfed 3.3." ++FONT "vtxt" ++ENDPROPERTIES ++CHARS 256 ++STARTCHAR char0 ++ENCODING 0 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 1 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 2 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 3 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 4 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 5 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 6 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 7 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 8 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 9 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 10 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 11 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 12 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 13 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 14 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 15 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 16 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 17 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 18 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 19 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 20 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 21 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 22 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 23 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 24 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 25 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 26 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 27 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 28 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 29 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 30 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 31 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++ENDCHAR ++STARTCHAR char32 ++ENCODING 32 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char33 ++ENCODING 33 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3C00 ++3C00 ++3C00 ++1800 ++1800 ++1800 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char34 ++ENCODING 34 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++6600 ++6600 ++2400 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char35 ++ENCODING 35 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3600 ++3600 ++7F00 ++3600 ++3600 ++3600 ++7F00 ++3600 ++3600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char36 ++ENCODING 36 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++0C00 ++3E00 ++6300 ++6100 ++6000 ++3E00 ++0300 ++0300 ++4300 ++6300 ++3E00 ++0C00 ++0C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char37 ++ENCODING 37 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6100 ++6300 ++0600 ++0C00 ++1800 ++3000 ++6300 ++4300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char38 ++ENCODING 38 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3600 ++1C00 ++3B00 ++6E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char39 ++ENCODING 39 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3000 ++3000 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char40 ++ENCODING 40 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0C00 ++1800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++1800 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char41 ++ENCODING 41 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3000 ++1800 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++1800 ++3000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char42 ++ENCODING 42 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++3C00 ++FF00 ++3C00 ++6600 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char43 ++ENCODING 43 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++7E00 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char44 ++ENCODING 44 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char45 ++ENCODING 45 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char46 ++ENCODING 46 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char47 ++ENCODING 47 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0100 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++4000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char48 ++ENCODING 48 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++6600 ++C300 ++C300 ++DB00 ++DB00 ++C300 ++C300 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char49 ++ENCODING 49 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++3800 ++7800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char50 ++ENCODING 50 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0600 ++0C00 ++1800 ++3000 ++6000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char51 ++ENCODING 51 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++0300 ++0300 ++1E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char52 ++ENCODING 52 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0E00 ++1E00 ++3600 ++6600 ++7F00 ++0600 ++0600 ++0600 ++0F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char53 ++ENCODING 53 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6000 ++6000 ++6000 ++7E00 ++0300 ++0300 ++0300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char54 ++ENCODING 54 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3000 ++6000 ++6000 ++7E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char55 ++ENCODING 55 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++6300 ++0300 ++0300 ++0600 ++0C00 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char56 ++ENCODING 56 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char57 ++ENCODING 57 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0300 ++0300 ++0600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char58 ++ENCODING 58 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char59 ++ENCODING 59 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++1800 ++1800 ++1800 ++3000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char60 ++ENCODING 60 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0600 ++0C00 ++1800 ++3000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char61 ++ENCODING 61 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7E00 ++0000 ++0000 ++7E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char62 ++ENCODING 62 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6000 ++3000 ++1800 ++0C00 ++0600 ++0C00 ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char63 ++ENCODING 63 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++0600 ++0C00 ++0C00 ++0C00 ++0000 ++0C00 ++0C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char64 ++ENCODING 64 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6F00 ++6F00 ++6F00 ++6E00 ++6000 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char65 ++ENCODING 65 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char66 ++ENCODING 66 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3300 ++3300 ++3300 ++3300 ++7E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char67 ++ENCODING 67 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char68 ++ENCODING 68 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char69 ++ENCODING 69 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char70 ++ENCODING 70 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char71 ++ENCODING 71 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6F00 ++6300 ++6300 ++3300 ++1D00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char72 ++ENCODING 72 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char73 ++ENCODING 73 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char74 ++ENCODING 74 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0F00 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char75 ++ENCODING 75 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7300 ++3300 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 76 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7800 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char77 ++ENCODING 77 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++E700 ++FF00 ++FF00 ++DB00 ++C300 ++C300 ++C300 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char78 ++ENCODING 78 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char79 ++ENCODING 79 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char80 ++ENCODING 80 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char81 ++ENCODING 81 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6B00 ++6F00 ++3E00 ++0600 ++0700 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char82 ++ENCODING 82 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 83 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char84 ++ENCODING 84 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char85 ++ENCODING 85 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char86 ++ENCODING 86 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char87 ++ENCODING 87 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char88 ++ENCODING 88 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++3C00 ++6600 ++C300 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char89 ++ENCODING 89 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 90 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char91 ++ENCODING 91 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char92 ++ENCODING 92 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4000 ++6000 ++7000 ++3800 ++1C00 ++0E00 ++0700 ++0300 ++0100 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char93 ++ENCODING 93 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++0C00 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char94 ++ENCODING 94 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char95 ++ENCODING 95 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char96 ++ENCODING 96 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3000 ++3000 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 97 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char98 ++ENCODING 98 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char99 ++ENCODING 99 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 100 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0600 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char101 ++ENCODING 101 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char102 ++ENCODING 102 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++3200 ++3000 ++7800 ++3000 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char103 ++ENCODING 103 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char104 ++ENCODING 104 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3600 ++3B00 ++3300 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char105 ++ENCODING 105 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char106 ++ENCODING 106 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0600 ++0000 ++0E00 ++0600 ++0600 ++0600 ++0600 ++0600 ++0600 ++6600 ++6600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char107 ++ENCODING 107 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++3000 ++3000 ++3300 ++3600 ++3C00 ++3C00 ++3600 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 108 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char109 ++ENCODING 109 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++E600 ++FF00 ++DB00 ++DB00 ++DB00 ++DB00 ++DB00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char110 ++ENCODING 110 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char111 ++ENCODING 111 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char112 ++ENCODING 112 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3E00 ++3000 ++3000 ++7800 ++0000 ++ENDCHAR ++STARTCHAR char113 ++ENCODING 113 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3B00 ++6600 ++6600 ++6600 ++6600 ++6600 ++3E00 ++0600 ++0600 ++0F00 ++0000 ++ENDCHAR ++STARTCHAR char114 ++ENCODING 114 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 115 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char116 ++ENCODING 116 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1800 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char117 ++ENCODING 117 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char118 ++ENCODING 118 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char119 ++ENCODING 119 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++C300 ++C300 ++DB00 ++DB00 ++FF00 ++6600 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char120 ++ENCODING 120 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++C300 ++6600 ++3C00 ++1800 ++3C00 ++6600 ++C300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char121 ++ENCODING 121 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 122 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char123 ++ENCODING 123 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++1800 ++1800 ++1800 ++7000 ++1800 ++1800 ++1800 ++1800 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char124 ++ENCODING 124 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char125 ++ENCODING 125 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7000 ++1800 ++1800 ++1800 ++0E00 ++1800 ++1800 ++1800 ++1800 ++7000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char126 ++ENCODING 126 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3B00 ++6E00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char127 ++ENCODING 127 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++7F00 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 128 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 129 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 130 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 131 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 132 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 133 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 134 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 135 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 136 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 137 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 138 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 139 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 140 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 141 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 142 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 143 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 144 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 145 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 146 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 147 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 148 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 149 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 150 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 151 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++F000 ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 152 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 153 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 154 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 155 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char0 ++ENCODING 156 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 157 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++F000 ++F000 ++F000 ++F000 ++F000 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char2 ++ENCODING 158 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0F80 ++0F80 ++0F80 ++0F80 ++0F80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char1 ++ENCODING 159 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++FF80 ++ENDCHAR ++STARTCHAR char160 ++ENCODING 160 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++FF80 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++0880 ++FF80 ++0880 ++0880 ++0880 ++0880 ++ENDCHAR ++STARTCHAR char65 ++ENCODING 161 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0600 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char162 ++ENCODING 162 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 163 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7800 ++3000 ++3000 ++3C00 ++3800 ++3000 ++7000 ++F100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char164 ++ENCODING 164 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++4100 ++6300 ++3E00 ++6300 ++6300 ++6300 ++6300 ++3E00 ++6300 ++4100 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 165 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7B00 ++3300 ++3600 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 166 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char167 ++ENCODING 167 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3E00 ++6300 ++3000 ++1C00 ++3600 ++6300 ++6300 ++3600 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char196 ++ENCODING 168 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char169 ++ENCODING 169 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char83 ++ENCODING 170 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3E00 ++6300 ++6300 ++3000 ++1C00 ++0600 ++0300 ++6300 ++6300 ++3E00 ++0600 ++0300 ++3E00 ++0000 ++ENDCHAR ++STARTCHAR char171 ++ENCODING 171 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 172 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char173 ++ENCODING 173 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++FF80 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char174 ++ENCODING 174 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++FF00 ++C300 ++8600 ++0C00 ++1800 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char90 ++ENCODING 175 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++C300 ++8600 ++0C00 ++7E00 ++3000 ++6000 ++C100 ++C300 ++FF00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char176 ++ENCODING 176 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1C00 ++3600 ++3600 ++1C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 177 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0600 ++0300 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char97 ++ENCODING 178 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0C00 ++1800 ++0E00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 179 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3800 ++1800 ++1E00 ++1C00 ++1800 ++3800 ++7800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char180 ++ENCODING 180 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++3000 ++6000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 181 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3980 ++1980 ++1B00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 182 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0C00 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char171 ++ENCODING 183 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char184 ++ENCODING 184 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0080 ++0100 ++0300 ++0600 ++0C00 ++1C00 ++3000 ++7F00 ++7700 ++0E00 ++1C00 ++1800 ++3000 ++6000 ++8000 ++0000 ++ENDCHAR ++STARTCHAR char185 ++ENCODING 185 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3600 ++1C00 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char115 ++ENCODING 186 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++3000 ++1C00 ++0600 ++6300 ++3E00 ++0300 ++1E00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char187 ++ENCODING 187 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0180 ++0980 ++1B00 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 188 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0C00 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char189 ++ENCODING 189 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++3300 ++6600 ++CC00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char190 ++ENCODING 190 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6600 ++3C00 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char122 ++ENCODING 191 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0C00 ++0C00 ++0000 ++7F00 ++6600 ++0C00 ++1800 ++3000 ++6300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char82 ++ENCODING 192 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char193 ++ENCODING 193 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0300 ++0600 ++0000 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char194 ++ENCODING 194 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++3600 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char195 ++ENCODING 195 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++3E00 ++0000 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char196 ++ENCODING 196 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++0800 ++1C00 ++3600 ++6300 ++6300 ++7F00 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char76 ++ENCODING 197 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++7C00 ++3000 ++3000 ++3000 ++3000 ++3000 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char67 ++ENCODING 198 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char199 ++ENCODING 199 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0600 ++0300 ++3E00 ++0000 ++ENDCHAR ++STARTCHAR char200 ++ENCODING 200 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3300 ++1E00 ++1E00 ++3300 ++6100 ++6000 ++6000 ++6000 ++6000 ++6100 ++3300 ++1E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char201 ++ENCODING 201 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char202 ++ENCODING 202 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0C00 ++0600 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char203 ++ENCODING 203 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char204 ++ENCODING 204 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3300 ++1E00 ++7F00 ++3300 ++3100 ++3400 ++3C00 ++3400 ++3000 ++3100 ++3300 ++7F00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char205 ++ENCODING 205 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char206 ++ENCODING 206 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3C00 ++6600 ++0000 ++3C00 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char207 ++ENCODING 207 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++7C00 ++3600 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++3600 ++7C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char208 ++ENCODING 208 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3C00 ++3600 ++3300 ++3300 ++7B00 ++7B00 ++3300 ++3300 ++3600 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char78 ++ENCODING 209 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char210 ++ENCODING 210 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++6300 ++7300 ++7B00 ++7F00 ++6F00 ++6700 ++6300 ++6300 ++6300 ++6300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char211 ++ENCODING 211 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char212 ++ENCODING 212 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1C00 ++3600 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char213 ++ENCODING 213 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++3300 ++6600 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char214 ++ENCODING 214 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char215 ++ENCODING 215 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++6300 ++3600 ++1C00 ++0800 ++1C00 ++3600 ++6300 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char216 ++ENCODING 216 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6600 ++3C00 ++7E00 ++3300 ++3300 ++3300 ++3E00 ++3600 ++3300 ++3300 ++3300 ++7300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char217 ++ENCODING 217 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0800 ++1400 ++6B00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char218 ++ENCODING 218 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0600 ++0C00 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char219 ++ENCODING 219 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1B00 ++3600 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char220 ++ENCODING 220 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++6300 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char221 ++ENCODING 221 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++1800 ++3000 ++C300 ++C300 ++C300 ++6600 ++3C00 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char84 ++ENCODING 222 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++FF00 ++DB00 ++9900 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0600 ++3C00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char223 ++ENCODING 223 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++1C00 ++3600 ++6300 ++6700 ++6E00 ++6C00 ++6600 ++6300 ++6B00 ++6E00 ++6000 ++4000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char224 ++ENCODING 224 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0C00 ++1800 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char225 ++ENCODING 225 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char226 ++ENCODING 226 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0800 ++1C00 ++3600 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char227 ++ENCODING 227 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++3C00 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char228 ++ENCODING 228 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++0000 ++0000 ++3C00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char108 ++ENCODING 229 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0C00 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char99 ++ENCODING 230 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0C00 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char231 ++ENCODING 231 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0C00 ++0600 ++3C00 ++0000 ++ENDCHAR ++STARTCHAR char232 ++ENCODING 232 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++6600 ++3C00 ++3E00 ++6300 ++6000 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char233 ++ENCODING 233 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0600 ++0C00 ++1800 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char234 ++ENCODING 234 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++1800 ++0E00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char235 ++ENCODING 235 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++0000 ++0000 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char236 ++ENCODING 236 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3300 ++1E00 ++3E00 ++6300 ++7F00 ++6000 ++6000 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char237 ++ENCODING 237 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0600 ++0C00 ++1800 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char238 ++ENCODING 238 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++3C00 ++6600 ++0000 ++3800 ++1800 ++1800 ++1800 ++1800 ++1800 ++3C00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char239 ++ENCODING 239 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++6000 ++6E00 ++3600 ++0600 ++1E00 ++3600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char100 ++ENCODING 240 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0E00 ++0600 ++0F00 ++0600 ++3E00 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char241 ++ENCODING 241 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0C00 ++0000 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char242 ++ENCODING 242 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3300 ++1E00 ++6E00 ++3300 ++3300 ++3300 ++3300 ++3300 ++3300 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char243 ++ENCODING 243 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0600 ++0C00 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char244 ++ENCODING 244 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0800 ++1C00 ++3600 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char245 ++ENCODING 245 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3300 ++6600 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char246 ++ENCODING 246 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6300 ++0000 ++0000 ++3E00 ++6300 ++6300 ++6300 ++6300 ++6300 ++3E00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char247 ++ENCODING 247 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++0000 ++1800 ++1800 ++0000 ++7E00 ++0000 ++1800 ++1800 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char248 ++ENCODING 248 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0000 ++3300 ++1E00 ++6E00 ++3B00 ++3300 ++3000 ++3000 ++3000 ++7800 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char249 ++ENCODING 249 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++1800 ++2400 ++2400 ++1800 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char250 ++ENCODING 250 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char251 ++ENCODING 251 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++3300 ++6600 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char252 ++ENCODING 252 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++6600 ++0000 ++0000 ++6600 ++6600 ++6600 ++6600 ++6600 ++6600 ++3B00 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char253 ++ENCODING 253 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++1800 ++3000 ++0000 ++6300 ++6300 ++6300 ++6300 ++6300 ++6300 ++3F00 ++0300 ++0600 ++7C00 ++0000 ++ENDCHAR ++STARTCHAR char116 ++ENCODING 254 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0000 ++0800 ++1800 ++1800 ++7E00 ++1800 ++1800 ++1800 ++1800 ++1B00 ++0E00 ++0300 ++1E00 ++0000 ++0000 ++ENDCHAR ++STARTCHAR char255 ++ENCODING 255 ++SWIDTH 8640 0 ++DWIDTH 9 0 ++BBX 9 16 0 -4 ++BITMAP ++0000 ++0C00 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++0000 ++ENDCHAR ++ENDFONT +diff -r af23d23c278b util/alevt/xio.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/xio.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,1156 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#define XK_MISCELLANY ++#define XK_LATIN1 ++#include ++#include ++#include "vt.h" ++#include "misc.h" ++#include "dllist.h" ++#include "xio.h" ++#include "fdset.h" ++#include "lang.h" ++#include "icon.xbm" ++#include "font.h" ++ ++#define WW (W*CW) /* pixel width of window */ ++#define WH (H*CH) /* pixel hegiht of window */ ++#define NO_SEL 999 /* sel_y1 value if no selection */ ++#define SEL_MIN_TIME 500 /* anything shorter is a click */ ++ ++static struct dl_head dpys[1]; /* list of all displays */ ++static void xio_timer(void *data, int fd); ++static void handle_event(struct xio *xio, int fd); ++ ++ ++static int timer_init(int argc, char **argv) ++{ ++ int p[2], timer_pid, i; ++ ++ if (pipe(p) == -1) ++ return -1; ++ ++ signal(SIGPIPE, SIG_DFL); ++ timer_pid = fork(); ++ if (timer_pid == -1) ++ return -1; ++ if (timer_pid > 0) ++ { ++ fdset_add_fd(fds, p[0], xio_timer, 0); ++ close(p[1]); ++ return 0; ++ } ++ ++ close(p[0]); ++ for (i = 0; i < 32; ++i) ++ if (p[1] != i) ++ close(i); ++ memcpy(argv[0], "Timer", 6); ++ ++ for (;;) ++ { ++ usleep(300000); ++ write(p[1], "*", 1); ++ } ++} ++ ++ ++static int local_init(int argc, char **argv) ++{ ++ static int inited = 0; ++ ++ if (inited) ++ return 0; ++ ++ if (timer_init(argc, argv) == -1) ++ return -1; ++ ++ dl_init(dpys); ++ ++ inited = 1; ++ return 0; ++} ++ ++ ++static int get_colors(struct xio *xio) ++{ ++ int i; ++ XColor c; ++ ++ static short rgb[][3] = ++ { ++ { 0x0000,0x0000,0x0000 }, ++ { 0xffff,0x0000,0x0000 }, ++ { 0x0000,0xffff,0x0000 }, ++ { 0xffff,0xffff,0x0000 }, ++ { 0x0000,0x0000,0xffff }, ++ { 0xffff,0x0000,0xffff }, ++ { 0x0000,0xffff,0xffff }, ++ { 0xffff,0xffff,0xffff }, ++ { 0x7fff,0x7fff,0x7fff }, ++ { 0x7fff,0x0000,0x0000 }, ++ { 0x0000,0x7fff,0x0000 }, ++ { 0x7fff,0x7fff,0x0000 }, ++ { 0x0000,0x0000,0x7fff }, ++ { 0x7fff,0x0000,0x7fff }, ++ { 0x0000,0x7fff,0x7fff }, ++ { 0x3fff,0x3fff,0x3fff }, ++ }; ++ ++ for (i = 0; i < 16; ++i) ++ { ++ c.red = rgb[i][0]; ++ c.green = rgb[i][1]; ++ c.blue = rgb[i][2]; ++ if (XAllocColor(xio->dpy, xio->cmap, &c) == 0) ++ return -1; ++ xio->color[i] = c.pixel; ++ } ++ return 0; ++} ++ ++ ++static int get_fonts(struct xio *xio) ++{ ++ GC gc; ++ int i; ++ unsigned char *font_bits; ++ switch(latin1) { ++ case LATIN1: font_bits=font1_bits; break; ++ case LATIN2: font_bits=font2_bits; break; ++ case KOI8: font_bits=font3_bits; break; ++ case GREEK: font_bits=font4_bits; break; ++ default: font_bits=font1_bits; break; ++ } ++ ++ xio->font[0] = XCreateBitmapFromData(xio->dpy, xio->root, ++ font_bits, font_width, font_height); ++ xio->font[1] = XCreatePixmap(xio->dpy, xio->root, ++ font_width, font_height*2, 1); ++ gc = XCreateGC(xio->dpy, xio->font[0], 0, 0); ++ for (i = 0; i < font_height; ++i) ++ { ++ XCopyArea(xio->dpy, xio->font[0], xio->font[1], gc, 0, i, ++ font_width, 1, 0, i*2); ++ XCopyArea(xio->dpy, xio->font[0], xio->font[1], gc, 0, i, ++ font_width, 1, 0, i*2+1); ++ } ++ XFreeGC(xio->dpy, gc); ++ return 0; ++} ++ ++ ++static void xlib_conn_watch(Display *dpy, void *fds, int fd, int open_flag, void *data) ++{ ++ if (open_flag) ++ fdset_add_fd(fds, fd, XProcessInternalConnection, dpy); ++ else ++ fdset_del_fd(fds, fd); ++} ++ ++ ++struct xio * xio_open_dpy(char *dpy, int argc, char **argv) ++{ ++ XClassHint classhint[1]; ++ struct xio *xio; ++ ++ if (local_init(argc, argv) == -1) ++ goto fail1; ++ ++ if (not(xio = malloc(sizeof(*xio)))) ++ goto fail1; ++ ++ if (not(xio->dpy = XOpenDisplay(dpy))) ++ goto fail2; ++ ++ xio->fd = ConnectionNumber(xio->dpy); ++ xio->argc = argc; ++ xio->argv = argv; ++ dl_init(xio->windows); ++ xio->screen = DefaultScreen(xio->dpy); ++ xio->depth = DefaultDepth(xio->dpy, xio->screen); ++ xio->width = DisplayWidth(xio->dpy, xio->screen); ++ xio->height = DisplayHeight(xio->dpy, xio->screen); ++ xio->root = DefaultRootWindow(xio->dpy); ++ xio->cmap = DefaultColormap(xio->dpy, xio->screen); ++ xio->xa_del_win = XInternAtom(xio->dpy, "WM_DELETE_WINDOW", False); ++ xio->xa_targets = XInternAtom(xio->dpy, "TARGETS", False); ++ xio->xa_timestamp = XInternAtom(xio->dpy, "TIMESTAMP", False); ++ xio->xa_multiple = XInternAtom(xio->dpy, "MULTIPLE", False); ++ xio->xa_text = XInternAtom(xio->dpy, "TEXT", False); ++ ++ if (get_colors(xio) == -1) ++ goto fail3; ++ ++ if (get_fonts(xio) == -1) ++ goto fail3; ++ ++ if (fdset_add_fd(fds, xio->fd, handle_event, xio) == -1) ++ goto fail3; ++ ++ XAddConnectionWatch(xio->dpy, PTR xlib_conn_watch, PTR fds); ++ ++ xio->icon = XCreateBitmapFromData(xio->dpy, xio->root, ++ icon_bits, icon_width, icon_height); ++ ++ xio->group_leader = XCreateSimpleWindow(xio->dpy, xio->root, ++ 0, 0, 1, 1, 0, 0, 0); ++ XSetCommand(xio->dpy, xio->group_leader, xio->argv, xio->argc); ++ classhint->res_name = "VTLeader"; ++ classhint->res_class = "AleVT"; ++ XSetClassHint(xio->dpy, xio->group_leader, classhint); ++ ++ dl_insert_first(dpys, xio->node); ++ return xio; ++ ++fail4: ++ fdset_del_fd(fds, xio->fd); ++fail3: ++ XCloseDisplay(xio->dpy); ++fail2: ++ free(xio); ++fail1: ++ return 0; ++} ++ ++ ++static void set_user_geometry(struct xio_win *xw, char *geom, XSizeHints *sh, int bwidth) ++{ ++ static int gravs[] = { NorthWestGravity, NorthEastGravity, ++ SouthWestGravity, SouthEastGravity }; ++ int f, g = 0; ++ ++ f = XParseGeometry(geom, &sh->x, &sh->y, &sh->width, &sh->height); ++ ++ if (f & WidthValue) ++ sh->width = sh->base_width + sh->width * sh->width_inc; ++ if (f & HeightValue) ++ sh->height = sh->base_height + sh->height * sh->height_inc; ++ if (f & XNegative) ++ g+=1, sh->x = xw->xio->width + sh->x - sh->width - bwidth; ++ if (f & YNegative) ++ g+=2, sh->y = xw->xio->height + sh->y - sh->height - bwidth; ++ ++ sh->width = bound(sh->min_width, sh->width, sh->max_width); ++ sh->height = bound(sh->min_height, sh->height, sh->max_height); ++ ++ if (f & (WidthValue | HeightValue)) ++ sh->flags |= USSize; ++ if (f & (XValue | YValue)) ++ sh->flags |= USPosition | PWinGravity; ++ ++ sh->win_gravity = gravs[g]; ++} ++ ++ ++struct xio_win * xio_open_win(struct xio *xio, char *geom) ++{ ++ struct xio_win *xw; ++ XSetWindowAttributes attr; ++ XGCValues gcval; ++ XSizeHints sizehint[1]; ++ XClassHint classhint[1]; ++ XWMHints wmhint[1]; ++ ++ if (not(xw = malloc(sizeof(*xw)))) ++ goto fail1; ++ ++ xw->xio = xio; ++ ++ sizehint->flags = PSize | PBaseSize | PMinSize | PMaxSize | PResizeInc; ++ sizehint->x = sizehint->y = 0; ++ sizehint->width_inc = CW; ++ sizehint->height_inc = CH; ++ sizehint->base_width = 0; ++ sizehint->base_height = 0; ++ sizehint->min_width = 11*CW; ++ sizehint->min_height = 1*CH; ++ sizehint->max_width = sizehint->width = WW + CW; ++ sizehint->max_height = sizehint->height = WH; ++ set_user_geometry(xw, geom, sizehint, 1); ++ ++ attr.background_pixel = xio->color[0]; ++ attr.event_mask = KeyPressMask | ++ ButtonPressMask|ButtonReleaseMask|Button1MotionMask | ++ ExposureMask; ++ xw->win = XCreateWindow(xio->dpy, xio->root, ++ sizehint->x, sizehint->y, sizehint->width, sizehint->height, 1, ++ CopyFromParent, CopyFromParent, CopyFromParent, ++ CWBackPixel|CWEventMask, &attr); ++ ++ classhint->res_name = "VTPage"; ++ classhint->res_class = "AleVT"; ++ ++ wmhint->flags = InputHint | StateHint | WindowGroupHint | IconPixmapHint; ++ wmhint->input = True; ++ wmhint->initial_state = NormalState; //IconicState; ++ wmhint->window_group = xio->group_leader; ++ wmhint->icon_pixmap = xio->icon; ++ ++ XSetWMProperties(xio->dpy, xw->win, 0,0, 0,0, sizehint, wmhint, classhint); ++ XSetWMProtocols(xio->dpy, xw->win, &xio->xa_del_win, 1); ++ ++ xw->title[0] = 0; ++ xio_title(xw, "AleVT"); // will be reset pretty soon ++ ++ gcval.graphics_exposures = False; ++ xw->gc = XCreateGC(xio->dpy, xw->win, GCGraphicsExposures, &gcval); ++ ++ xw->tstamp = CurrentTime; ++ xw->fg = xw->bg = -1; /* unknown colors */ ++ ++ xw->curs_x = xw->curs_y = 999; // no cursor ++ ++ xw->sel_y1 = NO_SEL; /* no selection area */ ++ xw->sel_start_t = 0; /* no selection-drag active */ ++ xw->sel_set_t = 0; /* not selection owner */ ++ xw->sel_pixmap = 0; /* no selection pixmap yet */ ++ ++ xio_clear_win(xw); ++ xw->blink_on = xw->reveal = 0; ++ ++ xw->handler = 0; ++ ++ XMapWindow(xio->dpy, xw->win); ++ dl_insert_first(xio->windows, xw->node); ++ return xw; ++ ++fail2: ++ free(xw); ++fail1: ++ return 0; ++} ++ ++ ++void xio_close_win(struct xio_win *xw, int dpy_too) ++{ ++ struct xio *xio = xw->xio; ++ ++ XDestroyWindow(xio->dpy, xw->win); ++ dl_remove(xw->node); ++ free(xw); ++ ++ if (dpy_too && dl_empty(xio->windows)) ++ xio_close_dpy(xio); ++} ++ ++ ++void xio_close_dpy(struct xio *xio) ++{ ++ while (not dl_empty(xio->windows)) ++ xio_close_win((struct xio_win *)xio->windows->first, 0); ++ ++ XDestroyWindow(xio->dpy, xio->group_leader); ++ XRemoveConnectionWatch(xio->dpy, PTR xlib_conn_watch, PTR fds); ++ fdset_del_fd(fds, xio->fd); ++ dl_remove(xio->node); ++ free(xio); ++} ++ ++ ++void xio_set_handler(struct xio_win *xw, void *handler, void *data) ++{ ++ xw->handler = handler; ++ xw->data = data; ++} ++ ++ ++void xio_title(struct xio_win *xw, char *title) ++{ ++ char buf[sizeof(xw->title) + 32]; ++ ++ if (strlen(title) >= sizeof(xw->title)) ++ return; //TODO: trimm... ++ if (strcmp(xw->title, title) == 0) ++ return; ++ ++ strcpy(xw->title, title); ++ sprintf(buf, "AleVT " VERSION " %s", xw->title); ++ XStoreName(xw->xio->dpy, xw->win, buf); ++ XSetIconName(xw->xio->dpy, xw->win, xw->title); ++} ++ ++ ++void xio_clear_win(struct xio_win *xw) ++{ ++ memset(xw->ch, ' ', sizeof(xw->ch)); ++ xw->dheight = xw->blink = xw->concealed = 0; ++ xw->hidden = xw->lhidden = 0; ++ xw->modified = ALL_LINES; ++} ++ ++ ++void xio_put_line(struct xio_win *xw, int y, u8 *data) ++{ ++ u8 *p = xw->ch + y*W; ++ u8 *ep = p + W; ++ lbits yb = 1 << y; ++ lbits x = xw->dheight; ++ ++ if (y < 0 || y >= H) ++ return; ++ ++ if (memcmp(data, p, ep - p) == 0) ++ return; ++ ++ xw->modified |= yb; ++ xw->blink &= ~yb; ++ xw->dheight &= ~yb; ++ xw->concealed &= ~yb; ++ ++ while (p < ep) ++ switch (*p++ = *data++) ++ { ++ case 0x08: ++ xw->blink |= yb; ++ break; ++ case 0x0d: ++ if (y < H-1) ++ xw->dheight |= yb; ++ break; ++ case 0x18: ++ xw->concealed |= yb; ++ break; ++ } ++ ++ if ((xw->dheight ^ x) & yb) // dheight has changed, recalc hidden ++ { ++ xw->hidden &= yb*2 - 1; ++ for (; yb & ALL_LINES/2; yb *= 2) ++ if (~xw->hidden & xw->dheight & yb) ++ xw->hidden |= yb*2; ++ } ++} ++ ++ ++void xio_put_str(struct xio_win *xw, int y, u8 *str) ++{ ++ u8 buf[W]; ++ int l; ++ l = strlen(str); ++ if (l < W) ++ { ++ memcpy(buf, str, l); ++ memset(buf + l, ' ', W - l); ++ } ++ else ++ memcpy(buf, str, W); ++ xio_put_line(xw, y, buf); ++} ++ ++ ++static void dirty(struct xio_win *xw, int y1, int y2) // mark [y1,y2[ dirty ++{ ++ if (y1 >= 0 && y1 < H && y1 < y2) ++ { ++ if (y2 > H) ++ y2 = H; ++ if (xw->hidden & (1 << y1)) ++ y1--; ++ while (y1 < y2) ++ xw->modified |= 1 << y1++; ++ } ++} ++ ++ ++int xio_get_line(struct xio_win *xw, int y, u8 *data) ++{ ++ if (y < 0 || y >= H) ++ return -1; ++ if (xw->hidden & (1 << y)) ++ y--; ++ memcpy(data, xw->ch + y*W, 40); ++ return 0; ++} ++ ++ ++void xio_set_cursor(struct xio_win *xw, int x, int y) ++{ ++ if (xw->curs_y >= 0 && xw->curs_y < H) ++ dirty(xw, xw->curs_y, xw->curs_y + 1); ++ if (x >= 0 && x < W && y >= 0 && y < H) ++ dirty(xw, y, y + 1); ++ else ++ x = y = 999; ++ xw->curs_x = x; ++ xw->curs_y = y; ++} ++ ++ ++static inline void draw_char(struct xio_win *xw, Window win, int fg, int bg, ++ int c, int dbl, int x, int y, int ry) ++{ ++ struct xio *xio = xw->xio; ++ ++ if (fg != xw->fg) ++ XSetForeground(xio->dpy, xw->gc, xio->color[xw->fg = fg]); ++ if (bg != xw->bg) ++ XSetBackground(xio->dpy, xw->gc, xio->color[xw->bg = bg]); ++ ++ if (dbl) ++ { ++ XCopyPlane(xio->dpy, xio->font[1], win, xw->gc, ++ c%32*CW, c/32*CH*2, CW, CH*2, x*CW, y*CH, 1); ++ } ++ else ++ { ++ XCopyPlane(xio->dpy, xio->font[0], win, xw->gc, ++ c%32*CW, c/32*CH, CW, CH, x*CW, y*CH, 1); ++ if (xw->dheight & (1<dpy, xio->font[0], win, xw->gc, ++ ' '%32*CW, ' '/32*CH, CW, CH, x*CW, y*CH+CH, 1); ++ } ++} ++ ++static void draw_cursor(struct xio_win *xw, int x, int y, int dbl) ++{ ++ struct xio *xio = xw->xio; ++ ++ if (xw->blink_on) ++ XSetForeground(xio->dpy, xw->gc, xio->color[xw->fg = xw->bg ^ 8]); ++ XDrawRectangle(xio->dpy, xw->win, xw->gc, x * CW, y * CH, CW-1, ++ (dbl ? 2*CH : CH)-1); ++} ++ ++ ++void xio_update_win(struct xio_win *xw) ++{ ++ u8 *p = xw->ch; ++ lbits yb, redraw; ++ int x, y, c; ++ ++ if (xw->modified == 0) ++ return; ++ ++ redraw = xw->modified; // all modified lines ++ redraw |= xw->lhidden; // all previously hidden lines ++ redraw &= ~xw->hidden; ++ ++ xw->lhidden = xw->hidden; ++ xw->modified = 0; ++ ++ if (redraw == 0) ++ return; ++ ++ for (yb = 1, y = 0; y < H; ++y, yb *= 2) ++ if (redraw & yb) ++ { ++ int fg = 7, bg = 0, _fg, _bg; ++ int dbl = 0, blk = 0, con = 0, gfx = 0, sep = 0, hld = 0; ++ int last_ch = ' '; ++ ++ for (x = 0; x < W; ++x) ++ { ++ switch (c = *p++) ++ { ++ case 0x00 ... 0x07: /* alpha + foreground color */ ++ fg = c & 7; ++ gfx = 0; ++ con = 0; ++ goto ctrl; ++ case 0x08: /* flash */ ++ blk = not xw->blink_on; ++ goto ctrl; ++ case 0x09: /* steady */ ++ blk = 0; ++ goto ctrl; ++ case 0x0a: /* end box */ ++ case 0x0b: /* start box */ ++ goto ctrl; ++ case 0x0c: /* normal height */ ++ dbl = 0; ++ goto ctrl; ++ case 0x0d: /* double height */ ++ dbl = y < H-1; ++ goto ctrl; ++ case 0x10 ... 0x17: /* graphics + foreground color */ ++ fg = c & 7; ++ gfx = 1; ++ con = 0; ++ goto ctrl; ++ case 0x18: /* conceal display */ ++ con = not xw->reveal; ++ goto ctrl; ++ case 0x19: /* contiguous graphics */ ++ sep = 0; ++ goto ctrl; ++ case 0x1a: /* separate graphics */ ++ sep = 1; ++ goto ctrl; ++ case 0x1c: /* black background */ ++ bg = 0; ++ goto ctrl; ++ case 0x1d: /* new background */ ++ bg = fg; ++ goto ctrl; ++ case 0x1e: /* hold graphics */ ++ hld = 1; ++ goto ctrl; ++ case 0x1f: /* release graphics */ ++ hld = 0; ++ goto ctrl; ++ ++ case 0x0e: /* SO (reserved, double width) */ ++ case 0x0f: /* SI (reserved, double size) */ ++ c= ' '; break; ++ case 0x1b: /* ESC (reserved) */ ++ c = ' '; ++ break; ++ ++ ctrl: ++ c = ' '; ++ if (hld && gfx) ++ c = last_ch; ++ break; ++ ++ case 0x80 ... 0x9f: /* these aren't used */ ++ c = BAD_CHAR; ++ break; ++ ++ default: /* mapped to selected font */ ++ break; ++ } ++ ++ if (gfx && (c & 0xa0) == 0x20) ++ { ++ last_ch = c; ++ c += (c & 0x40) ? 32 : -32; ++ } ++ ++ _fg = fg; ++ _bg = bg; ++ if (blk) ++ _fg |= 8; ++ if (y >= xw->sel_y1 && y < xw->sel_y2 && ++ x >= xw->sel_x1 && x < xw->sel_x2) ++ _bg |= 8; ++ if (con) ++ _fg = _bg; ++ ++ draw_char(xw, xw->win, _fg, _bg, c, dbl, x, y, y); ++ ++ if (y == xw->curs_y && x == xw->curs_x) ++ draw_cursor(xw, xw->curs_x, xw->curs_y, dbl); ++ ++ if (xw->sel_pixmap && (_bg & 8)) ++ draw_char(xw, xw->sel_pixmap, con ? bg : fg, bg, c, dbl, ++ x - xw->sel_x1, y - xw->sel_y1, y); ++ } ++ } ++ else ++ p += 40; ++} ++ ++ ++static void for_all_windows(void (*func)(struct xio_win *xw), struct xio_win *except) ++{ ++ struct xio *xio, *vtn; ++ struct xio_win *xw, *vwn; ++ ++ for (xio = PTR dpys->first; vtn = PTR xio->node->next; xio = vtn) ++ for (xw = PTR xio->windows->first; vwn = PTR xw->node->next; xw = vwn) ++ if (xw != except) ++ func(xw); ++} ++ ++ ++int xio_set_concealed(struct xio_win *xw, int on) ++{ ++ on = !!on; ++ if (xw->reveal == on) ++ return on; ++ ++ xw->reveal = on; ++ xw->modified |= xw->concealed; ++ return !on; ++} ++ ++ ++static void sel_set(struct xio_win *xw, int x1, int y1, int x2, int y2) ++{ ++ int t; ++ ++ x1 = bound(0, x1, W-1); ++ y1 = bound(0, y1, H-1); ++ x2 = bound(0, x2, W-1); ++ y2 = bound(0, y2, H-1); ++ ++ if (x1 > x2) ++ t = x1, x1 = x2, x2 = t; ++ if (y1 > y2) ++ t = y1, y1 = y2, y2 = t; ++ ++ dirty(xw, xw->sel_y1, xw->sel_y2); ++ ++ if (xw->hidden & (1 << y1)) ++ y1--; ++ if (xw->hidden & (2 << y2)) ++ y2++; ++ ++ xw->sel_x1 = x1; ++ xw->sel_y1 = y1; ++ xw->sel_x2 = x2 + 1; ++ xw->sel_y2 = y2 + 1; ++ dirty(xw, xw->sel_y1, xw->sel_y2); ++} ++ ++ ++static void sel_abort(struct xio_win *xw) ++{ ++ if (xw->sel_set_t) ++ XSetSelectionOwner(xw->xio->dpy, XA_PRIMARY, None, xw->sel_set_t); ++ if (xw->sel_y1 != NO_SEL) ++ dirty(xw, xw->sel_y1, xw->sel_y2); ++ xw->sel_y1 = NO_SEL; ++ xw->sel_set_t = 0; ++ xw->sel_start_t = 0; ++} ++ ++ ++static void sel_start(struct xio_win *xw, int x, int y, Time t) ++{ ++ sel_abort(xw); ++ xw->sel_start_x = x; ++ xw->sel_start_y = y; ++ xw->sel_start_t = t; ++} ++ ++ ++static void sel_move(struct xio_win *xw, int x, int y, Time t) ++{ ++ if (xw->sel_start_t == 0) ++ return; ++ if (xw->sel_y1 == NO_SEL) ++ if (t - xw->sel_start_t < SEL_MIN_TIME) ++ if (x == xw->sel_start_x) ++ if (y == xw->sel_start_y) ++ return; ++ sel_set(xw, xw->sel_start_x, xw->sel_start_y, x, y); ++} ++ ++ ++static int sel_end(struct xio_win *xw, int x, int y, Time t) ++{ ++ sel_move(xw, x, y, t); ++ xw->sel_start_t = 0; ++ ++ if (xw->sel_y1 == NO_SEL) ++ return 0; ++ ++ for_all_windows(sel_abort, xw); ++ XSetSelectionOwner(xw->xio->dpy, XA_PRIMARY, xw->win, t); ++ if (XGetSelectionOwner(xw->xio->dpy, XA_PRIMARY) == xw->win) ++ xw->sel_set_t = t; ++ else ++ sel_abort(xw); ++ return 1; ++} ++ ++ ++static int sel_convert2ascii(struct xio_win *xw, u8 *buf) ++{ ++ u8 *d = buf; ++ int x, y, nl = 0; ++ ++ for (y = xw->sel_y1; y < xw->sel_y2; y++) ++ { ++ u8 *s = xw->ch + y * W; ++ int gfx = 0, con = 0; ++ ++ if (~xw->hidden & (1 << y)) ++ { ++ for (x = 0; x < xw->sel_x2; ++x) ++ { ++ int ch, c = ' '; ++ switch (ch = *s++) ++ { ++ case 0x00 ... 0x07: ++ gfx = con = 0; ++ break; ++ case 0x10 ... 0x17: ++ gfx = 1, con = 0; ++ break; ++ case 0x18: ++ con = not xw->reveal; ++ break; ++ case 0xa0 ... 0xff: ++ case 0x20 ... 0x7f: ++ if (not con) ++ if (gfx && ch != ' ' && (ch & 0xa0) == 0x20) ++ c = '#'; ++ else if (ch == 0x7f) ++ c = '*'; ++ else ++ c = ch; ++ break; ++ } ++ if (x >= xw->sel_x1) ++ { ++ if (nl) ++ *d++ = '\n', nl = 0; ++ *d++ = c; ++ } ++ } ++ nl = 1; ++ } ++ } ++ *d = 0; // not necessary ++ return d - buf; ++} ++ ++ ++static Pixmap sel_convert2pixmap(struct xio_win *xw) ++{ ++ struct xio *xio = xw->xio; ++ Pixmap pm; ++ ++ if (xw->sel_y1 == NO_SEL) ++ return None; ++ ++ pm = XCreatePixmap(xio->dpy, xio->root, (xw->sel_x2 - xw->sel_x1) * CW, ++ (xw->sel_y2 - xw->sel_y1) * CH, ++ xio->depth); ++ xw->sel_pixmap = pm; ++ dirty(xw, xw->sel_y1, xw->sel_y2); ++ xio_update_win(xw); ++ xw->sel_pixmap = 0; ++ ++ return pm; ++} ++ ++ ++static int sel_do_conv(struct xio_win *xw, Window w, Atom type, Atom prop) ++{ ++ struct xio *xio = xw->xio; ++ ++ if (type == xio->xa_targets) ++ { ++ u32 atoms[6]; ++ ++ atoms[0] = XA_STRING; ++ atoms[1] = xio->xa_text; ++ atoms[2] = XA_PIXMAP; ++ atoms[3] = XA_COLORMAP; ++ atoms[4] = xio->xa_multiple; ++ atoms[5] = xio->xa_timestamp; ++ XChangeProperty(xio->dpy, w, prop, type, ++ 32, PropModeReplace, PTR atoms, NELEM(atoms)); ++ } ++ else if (type == xio->xa_timestamp) ++ { ++ u32 t = xw->sel_set_t; ++ ++ XChangeProperty(xio->dpy, w, prop, type, 32, PropModeReplace, PTR &t, 1); ++ } ++ else if (type == XA_COLORMAP) ++ { ++ u32 t = xio->cmap; ++ ++ XChangeProperty(xio->dpy, w, prop, type, 32, PropModeReplace, PTR &t, 1); ++ } ++ else if (type == XA_STRING || type == xio->xa_text) ++ { ++ u8 buf[H * (W+1)]; ++ int len; ++ ++ len = sel_convert2ascii(xw, buf); ++ ++ XChangeProperty(xio->dpy, w, prop, type, 8, PropModeReplace, buf, len); ++ } ++ else if (type == XA_PIXMAP || type == XA_DRAWABLE) ++ { ++ Pixmap pm; ++ ++ pm = sel_convert2pixmap(xw); ++ ++ XChangeProperty(xio->dpy, w, prop, type, 32, PropModeReplace, PTR &pm, 1); ++ } ++ else if (type == xio->xa_multiple) ++ { ++ u32 *atoms, ty, fo, i; ++ unsigned long n, b; ++ ++ if (prop != None) ++ { ++ if (Success == XGetWindowProperty(xio->dpy, w, prop, 0, 1024, 0, ++ AnyPropertyType, PTR &ty, PTR &fo, &n, &b, PTR &atoms)) ++ { ++ if (fo == 32 && n%2 == 0) ++ { ++ for (i = 0; i < n; i += 2) ++ if (sel_do_conv(xw, w, atoms[i], atoms[i+1]) == None) ++ atoms[i] = None; ++ } ++ XChangeProperty(xio->dpy, w, prop, type, 32, PropModeReplace, ++ PTR atoms, n); ++ XFree(atoms); ++ } ++ } ++ } ++ else ++ return None; ++ return prop; ++} ++ ++ ++static void sel_send(struct xio_win *xw, XSelectionRequestEvent *req) ++{ ++ XSelectionEvent ev[1]; ++ ++ if (req->property == None) ++ req->property = req->target; ++ ++ ev->type = SelectionNotify; ++ ev->requestor = req->requestor; ++ ev->selection = req->selection; ++ ev->target = req->target; ++ ev->property = sel_do_conv(xw, req->requestor, req->target, req->property); ++ ev->time = req->time; ++ XSendEvent(xw->xio->dpy, req->requestor, False, 0, PTR ev); ++} ++ ++ ++static void sel_retrieve(struct xio_win *xw, Window w, Atom prop, int del) ++{ ++ u8 *data; ++ u32 ty, fo; ++ unsigned long n, b; ++ struct xio *xio = xw->xio; ++ ++ if (prop == None) ++ return; ++ ++ if (Success == XGetWindowProperty(xio->dpy, w, prop, 0, 1024, del, ++ AnyPropertyType, PTR &ty, PTR &fo, &n, &b, PTR &data)) ++ { ++ if (fo == 8 && n != 0) ++ { ++ struct vt_event vtev[1]; ++ ++ vtev->resource = xw; ++ vtev->type = EV_SELECTION; ++ vtev->i1 = n; ++ vtev->p1 = data; ++ xw->handler(xw->data, vtev); ++ } ++ XFree(data); ++ } ++} ++ ++ ++void xio_cancel_selection(struct xio_win *xw) ++{ ++ sel_abort(xw); ++} ++ ++ ++void xio_query_selection(struct xio_win *xw) ++{ ++ struct xio *xio = xw->xio; ++ ++ if (XGetSelectionOwner(xio->dpy, XA_PRIMARY) == None) ++ sel_retrieve(xw, xio->root, XA_CUT_BUFFER0, False); ++ else ++ { ++ XDeleteProperty(xio->dpy, xw->win, XA_STRING); ++ XConvertSelection(xio->dpy, XA_PRIMARY, XA_STRING, ++ XA_STRING, xw->win, xw->tstamp); ++ } ++} ++ ++ ++void xio_set_selection(struct xio_win *xw, int x1, int y1, int x2, int y2) ++{ ++ sel_start(xw, x1, y1, xw->tstamp - SEL_MIN_TIME); ++ sel_end(xw, x2, y2, xw->tstamp); ++} ++ ++ ++static void handle_event(struct xio *xio, int fd) ++{ ++ struct xio_win *xw; ++ struct vt_event vtev[1]; ++ XEvent ev[1]; ++ ++ XNextEvent(xio->dpy, ev); ++ ++ for (xw = PTR xio->windows->first; xw->node->next; xw = PTR xw->node->next) ++ if (xw->win == ev->xany.window) ++ break; ++ if (xw->node->next == 0) ++ return; ++ ++ vtev->resource = xw; ++ ++ switch(ev->type) ++ { ++ case Expose: ++ { ++ int y1 = ev->xexpose.y / CH; ++ int y2 = (ev->xexpose.y + ev->xexpose.height + CH-1) / CH; ++ ++ dirty(xw, y1, y2); ++ break; ++ } ++ case ClientMessage: ++ { ++ vtev->type = EV_CLOSE; ++ if (ev->xclient.format == 32) ++ if ((Atom)ev->xclient.data.l[0] == xio->xa_del_win) ++ xw->handler(xw->data, vtev); ++ break; ++ } ++ case KeyPress: ++ { ++ unsigned char ch; ++ KeySym k; ++ ++ xw->tstamp = ev->xkey.time; ++ vtev->type = EV_KEY; ++ vtev->i1 = 0; ++ vtev->i2 = (ev->xkey.state & ShiftMask) != 0; ++ if (XLookupString(&ev->xkey, &ch, 1, &k, 0)) ++ vtev->i1 = ch; ++ else ++ switch (k) ++ { ++ case XK_Left: vtev->i1 = KEY_LEFT; break; ++ case XK_Right: vtev->i1 = KEY_RIGHT; break; ++ case XK_Up: vtev->i1 = KEY_UP; break; ++ case XK_Down: vtev->i1 = KEY_DOWN; break; ++ case XK_Prior: vtev->i1 = KEY_PUP; break; ++ case XK_Next: vtev->i1 = KEY_PDOWN; break; ++ case XK_Delete: vtev->i1 = KEY_DEL; break; ++ case XK_Insert: vtev->i1 = KEY_INS; break; ++ case XK_F1: vtev->i1 = KEY_F(1); break; ++ case XK_F2: vtev->i1 = KEY_F(2); break; ++ case XK_F3: vtev->i1 = KEY_F(3); break; ++ case XK_F4: vtev->i1 = KEY_F(4); break; ++ case XK_F5: vtev->i1 = KEY_F(5); break; ++ case XK_F6: vtev->i1 = KEY_F(6); break; ++ case XK_F7: vtev->i1 = KEY_F(7); break; ++ case XK_F8: vtev->i1 = KEY_F(8); break; ++ case XK_F9: vtev->i1 = KEY_F(9); break; ++ case XK_F10: vtev->i1 = KEY_F(10); break; ++ case XK_F11: vtev->i1 = KEY_F(11); break; ++ case XK_F12: vtev->i1 = KEY_F(12); break; ++ } ++ if (vtev->i1) ++ xw->handler(xw->data, vtev); ++ break; ++ } ++ case ButtonPress: ++ { ++ xw->tstamp = ev->xkey.time; ++ ev->xbutton.x /= CW; ++ ev->xbutton.y /= CH; ++ if (ev->xbutton.button == Button1) ++ sel_start(xw, ev->xbutton.x, ev->xbutton.y, ev->xbutton.time); ++ break; ++ } ++ case MotionNotify: ++ { ++ xw->tstamp = ev->xkey.time; ++ ev->xmotion.x /= CW; ++ ev->xmotion.y /= CH; ++ if (ev->xmotion.state & Button1Mask) ++ sel_move(xw, ev->xmotion.x, ev->xmotion.y, ev->xmotion.time); ++ break; ++ } ++ case ButtonRelease: ++ { ++ xw->tstamp = ev->xkey.time; ++ ev->xbutton.x /= CW; ++ ev->xbutton.y /= CH; ++ if (ev->xbutton.button == Button1) ++ if (sel_end(xw, ev->xbutton.x, ev->xbutton.y, ev->xbutton.time)) ++ break; ++ ++ vtev->type = EV_MOUSE; ++ vtev->i1 = ev->xbutton.button; ++ vtev->i2 = (ev->xbutton.state & ShiftMask) != 0; ++ vtev->i3 = ev->xbutton.x; ++ vtev->i4 = ev->xbutton.y; ++ if (vtev->i3 >= 0 && vtev->i3 < W && vtev->i4 >= 0 && vtev->i4 < H) ++ xw->handler(xw->data, vtev); ++ break; ++ } ++ case SelectionClear: ++ { ++ // may be our own Owner=None due to sel_start ++ if (xw->sel_set_t && ev->xselectionclear.time >= xw->sel_set_t) ++ { ++ xw->sel_set_t = 0; // no need to reset owner ++ sel_abort(xw); ++ } ++ break; ++ } ++ case SelectionRequest: ++ { ++ sel_send(xw, &ev->xselectionrequest); ++ break; ++ } ++ case SelectionNotify: ++ { ++ sel_retrieve(xw, ev->xselection.requestor, ev->xselection.property, True); ++ break; ++ } ++ default: ++ break; ++ } ++} ++ ++ ++static void switch_blink_state(struct xio_win *xw) ++{ ++ xw->blink_on = !xw->blink_on; ++ xw->modified |= xw->blink; ++ dirty(xw, xw->curs_y, xw->curs_y + 1); ++} ++ ++ ++static void send_timer_event(struct xio_win *xw) ++{ ++ struct vt_event vtev[1]; ++ vtev->type = EV_TIMER; ++ xw->handler(xw->data, vtev); ++} ++ ++ ++static void xio_timer(void *data, int fd) ++{ ++ char buf[64]; ++ read(fd, buf, sizeof(buf)); ++ for_all_windows(switch_blink_state, 0); ++ for_all_windows(send_timer_event, 0); ++} ++ ++ ++void xio_event_loop(void) ++{ ++ struct xio *xio, *vtn; ++ int f; ++ ++ while (not dl_empty(dpys)) ++ { ++ do ++ { ++ for_all_windows(xio_update_win, 0); ++ f = 0; ++ for (xio = PTR dpys->first; vtn = PTR xio->node->next; xio = vtn) ++ while (XPending(xio->dpy)) ++ { ++ handle_event(xio, xio->fd); ++ f++; ++ } ++ } while (f); ++ fdset_select(fds, -1); ++ } ++} +diff -r af23d23c278b util/alevt/xio.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/alevt/xio.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,80 @@ ++#ifndef VTXIO_H ++#define VTXIO_H ++ ++#include ++#include "vt.h" ++#include "dllist.h" ++ ++typedef u32 lbits; ++#define ALL_LINES ((1ul << H) - 1) ++ ++/* one xio per display */ ++struct xio ++{ ++ struct dl_node node[1]; ++ int argc; ++ char **argv; ++ Display *dpy; /* display connection */ ++ int fd; /* the displays file descriptor */ ++ Atom xa_del_win; /* WM_DELETE_WINDOW atom */ ++ Atom xa_targets; /* TARGETS atom (selection) */ ++ Atom xa_timestamp; /* TIMESTAMP atom (selection) */ ++ Atom xa_text; /* TEXT atom (selection) */ ++ Atom xa_multiple; /* MULTIPLE atom (selection) */ ++ Window group_leader; /* unmapped window */ ++ int screen; /* DefaultScreen */ ++ int width, height; /* DisplayWidth/Height */ ++ int depth; /* DefaultDepth */ ++ Window root; /* DefaultRoot */ ++ Colormap cmap; ++ int color[16]; /* 8 normal, 8 dim intensity */ ++ Pixmap font[2]; /* normal, dbl-height */ ++ Pixmap icon; /* icon pixmap */ ++ struct dl_head windows[1]; /* all windows on this display */ ++}; ++ ++/* one vt_win per window */ ++struct xio_win ++{ ++ struct dl_node node[1]; ++ struct xio *xio; /* display */ ++ Window win; /* the drawing window */ ++ Time tstamp; /* timestamp of last user event */ ++ GC gc; /* it's graphics context */ ++ u8 ch[H*W]; /* the page contents */ ++ lbits modified, hidden, lhidden; /* states for each line */ ++ lbits dheight, blink, concealed; /* attributes for each line */ ++ int fg, bg; /* current foreground/background */ ++ int blink_on; /* blinking on */ ++ int reveal; /* reveal concealed text */ ++ void (*handler)(void *data, struct vt_event *ev); /* event-handler */ ++ void *data; /* data for the event-handler */ ++ int curs_x, curs_y; /* cursor position */ ++ u8 title[32]; /* the user title */ ++ // selection support ++ int sel_start_x, sel_start_y; ++ Time sel_start_t; ++ Time sel_set_t; /* time we got selection owner */ ++ int sel_x1, sel_y1, sel_x2, sel_y2; /* selected area */ ++ Pixmap sel_pixmap; /* for pixmap-selection requests */ ++}; ++ ++struct xio *xio_open_dpy(char *dpy, int argc, char **argv); ++struct xio_win *xio_open_win(struct xio *xio, char *geom); ++void xio_close_win(struct xio_win *xw, int dpy_too); ++void xio_close_dpy(struct xio *xio); ++void xio_set_handler(struct xio_win *xw, void *handler, void *data); ++void xio_clear_win(struct xio_win *xw); ++void xio_put_line(struct xio_win *xw, int line, u8 *data); ++void xio_put_str(struct xio_win *xw, int line, u8 *c_str); ++int xio_get_line(struct xio_win *xw, int line, u8 *data); ++int xio_set_concealed(struct xio_win *xw, int on); ++void xio_update_win(struct xio_win *xw); ++void xio_fd_handler(int fd, void *handler, void *data); ++void xio_cancel_selection(struct xio_win *xw); ++void xio_query_selection(struct xio_win *xw); ++void xio_set_selection(struct xio_win *xw, int x1, int y1, int x2, int y2); ++void xio_set_cursor(struct xio_win *xw, int x, int y); ++void xio_event_loop(void); ++void xio_title(struct xio_win *xw, char *title); ++#endif +diff -r af23d23c278b util/femon/femon.c +--- a/util/femon/femon.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/femon/femon.c Tue Dec 21 12:13:28 2010 +0100 +@@ -42,14 +42,21 @@ + static char *usage_str = + "\nusage: femon [options]\n" + " -H : human readable output\n" ++ " -A : Acoustical mode. A sound indicates the signal quality.\n" ++ " -r : If 'Acoustical mode' is active it tells the application\n" ++ " is called remotely via ssh. The sound is heard on the 'real'\n" ++ " machine but. The user has to be root.\n" + " -a number : use given adapter (default 0)\n" + " -f number : use given frontend (default 0)\n" + " -c number : samples to take (default 0 = infinite)\n\n"; + ++int sleep_time=1000000; ++int acoustical_mode=0; ++int remote=0; + + static void usage(void) + { +- fprintf(stderr, usage_str); ++ fprintf(stderr, "%s", usage_str); + exit(1); + } + +@@ -59,6 +66,27 @@ + { + struct dvbfe_info fe_info; + unsigned int samples = 0; ++ FILE *ttyFile=NULL; ++ ++ // We dont write the "beep"-codes to stdout but to /dev/tty1. ++ // This is neccessary for Thin-Client-Systems or Streaming-Boxes ++ // where the computer does not have a monitor and femon is called via ssh. ++ if(acoustical_mode) ++ { ++ if(remote) ++ { ++ ttyFile=fopen("/dev/tty1","w"); ++ if(!ttyFile) ++ { ++ fprintf(stderr, "Could not open /dev/tty1. No access rights?\n"); ++ exit(-1); ++ } ++ } ++ else ++ { ++ ttyFile=stdout; ++ } ++ } + + do { + if (dvbfe_get_info(fe, FE_STATUS_PARAMS, &fe_info, DVBFE_INFO_QUERYTYPE_IMMEDIATE, 0) != FE_STATUS_PARAMS) { +@@ -94,12 +122,24 @@ + if (fe_info.lock) + printf("FE_HAS_LOCK"); + ++ // create beep if acoustical_mode enabled ++ if(acoustical_mode) ++ { ++ int signal=(fe_info.signal_strength * 100) / 0xffff; ++ fprintf( ttyFile, "\033[10;%d]\a", 500+(signal*2)); ++ // printf("Variable : %d\n", signal); ++ fflush(ttyFile); ++ } ++ + printf("\n"); + fflush(stdout); +- usleep(1000000); ++ usleep(sleep_time); + samples++; + } while ((!count) || (count-samples)); +- ++ ++ if(ttyFile) ++ fclose(ttyFile); ++ + return 0; + } + +@@ -148,7 +188,7 @@ + int human_readable = 0; + int opt; + +- while ((opt = getopt(argc, argv, "Ha:f:c:")) != -1) { ++ while ((opt = getopt(argc, argv, "rAHa:f:c:")) != -1) { + switch (opt) + { + default: +@@ -166,6 +206,15 @@ + case 'H': + human_readable = 1; + break; ++ case 'A': ++ // Acoustical mode: we have to reduce the delay between ++ // checks in order to hear nice sound ++ sleep_time=5000; ++ acoustical_mode=1; ++ break; ++ case 'r': ++ remote=1; ++ break; + } + } + +diff -r af23d23c278b util/gotox/Makefile +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/gotox/Makefile Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,17 @@ ++# Makefile for linuxtv.org dvb-apps/util/gotox ++ ++binaries = gotox ++ ++inst_bin = $(binaries) ++ ++CPPFLAGS += -I../../lib ++LDFLAGS += -L../../lib/libdvbapi ++LDFLAGS += -L../../lib/libdvbsec ++LDLIBS += -ldvbapi ++LDLIBS += -ldvbsec ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -r af23d23c278b util/gotox/gotox.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/gotox/gotox.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,145 @@ ++/* ++ * Copyright (C) 2006 by Michel Verbraak ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the ++ * Free Software Foundation, Inc., ++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++static char *usage_str = ++ "\nusage: gotox [options] -d \n" ++ " Goto the specified angle. Positive value for East rotation\n" ++ " Negative value for West rotation on Northern Hemisphere.\n" ++ " -d degrees : Angle to turn to in degrees (default 0)\n" ++ " -a number : use given adapter (default 0)\n" ++ " -f number : use given frontend (default 0)\n" ++ " -t seconds : leave power on to rotor for at least specified seconds of time (default 30)\n\n"; ++ ++int main(int argc, char *argv[]) ++{ ++ struct dvbfe_handle *fe; ++ unsigned int adapter = 0, frontend = 0; ++ double angle = 0; ++ int opt; ++ unsigned int sleepcount = 30; ++ static char *weststr = "west"; ++ static char *eaststr = "east"; ++ ++ while ((opt = getopt(argc, argv, "ha:f:t:d:")) != -1) { ++ ++ switch (opt){ ++ case '?': ++ case 'h': ++ default: ++ fprintf(stderr, "%s", usage_str); ++ return EXIT_SUCCESS; ++ ++ case 'a': ++ adapter = strtoul(optarg, NULL, 0); ++ break; ++ ++ case 'f': ++ frontend = strtoul(optarg, NULL, 0); ++ break; ++ ++ case 't': ++ sleepcount = strtoul(optarg, NULL, 0); ++ break; ++ ++ case 'd': ++ angle = strtod(optarg, NULL); ++ break; ++ } ++ } ++ ++ printf("Will try to rotate %s to %.2f degrees.\n", (angle < 0.0) ? weststr : eaststr, angle ); ++ ++ fe = dvbfe_open(adapter, frontend, 0); ++ if (fe == NULL) { ++ fprintf(stderr, "Could not open frontend %d on adapter %d.\n", frontend, adapter); ++ exit(1); ++ } ++ ++ if (dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_OFF) != 0) { ++ fprintf(stderr, "Could not turn off power.\n"); ++ dvbfe_close(fe); ++ return 1; ++ } ++ else ++ printf("Power OFF.\n"); ++ ++ sleep(1); ++ ++ if (dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_18) != 0) { ++ fprintf(stderr, "Could not turn on power.\n"); ++ dvbfe_close(fe); ++ return 1; ++ } ++ else ++ printf("Power on to 18V.\n"); ++ ++ sleep(1); ++ ++ if (abs(angle) == 0.0) { ++ ++ if (dvbsec_diseqc_goto_satpos_preset(fe, DISEQC_ADDRESS_POLAR_AZIMUTH_POSITIONER, 0) != 0) { ++ fprintf(stderr, "Could not goto 0.\n"); ++ dvbfe_close(fe); ++ return 2; ++ } else { ++ printf("Going to home base 0 degrees.\n"); ++ } ++ } else { ++ ++ if (dvbsec_diseqc_goto_rotator_bearing(fe, DISEQC_ADDRESS_POLAR_AZIMUTH_POSITIONER, angle) != 0) { ++ fprintf(stderr, "Could not rotate.\n"); ++ dvbfe_close(fe); ++ return 2; ++ } ++ } ++ ++ while (sleepcount != 0) { ++ printf("%d: Rotating to %.2f.\r", sleepcount, angle); ++ fflush(NULL); ++ sleepcount--; ++ sleep(1); ++ } ++ ++ printf("\nRotated.\n"); ++ ++ if (dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_OFF) != 0) { ++ fprintf(stderr, "Could not turn off power.\n"); ++ dvbfe_close(fe); ++ return 1; ++ } ++ else ++ printf("Power OFF.\n"); ++ ++ sleep(1); ++ ++ dvbfe_close(fe); ++ ++ return EXIT_SUCCESS; ++} +diff -r af23d23c278b util/scan/dvb-c/at-Kabel-Braunau +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/at-Kabel-Braunau Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,26 @@ ++# Kabel Braunau ++# freq sr fec mod ++C 386000000 6900000 NONE QAM64 ++C 394000000 6875000 NONE QAM64 ++C 402000000 6875000 NONE QAM64 ++C 410000000 6875000 NONE QAM64 ++C 418000000 6875000 NONE QAM64 ++C 426000000 6875000 NONE QAM64 ++C 434000000 6875000 NONE QAM64 ++C 458000000 6875000 NONE QAM64 ++C 466000000 6900000 NONE QAM64 ++C 474000000 6900000 NONE QAM64 ++C 482000000 6111000 NONE QAM64 ++C 490000000 6111000 NONE QAM64 ++C 498000000 6875000 NONE QAM64 ++C 506000000 6111000 NONE QAM64 ++C 514000000 6111000 NONE QAM64 ++C 522000000 6428000 NONE QAM128 ++C 530000000 6428000 NONE QAM128 ++C 546000000 6875000 NONE QAM64 ++C 554000000 6875000 NONE QAM64 ++C 562000000 6875000 NONE QAM64 ++C 570000000 6111000 NONE QAM64 ++C 578000000 6900000 NONE QAM256 ++C 586000000 6900000 NONE QAM256 ++C 594000000 6875000 NONE QAM64 +diff -r af23d23c278b util/scan/dvb-c/at-Kabelsignal +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/at-Kabelsignal Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,38 @@ ++# kabelsignal ++# freq sr fec mod ++C 314000000 6900000 NONE QAM256 ++C 322000000 6900000 NONE QAM256 ++C 330000000 6900000 NONE QAM256 ++C 338000000 6900000 NONE QAM256 ++C 346000000 6900000 NONE QAM256 ++C 354000000 6900000 NONE QAM256 ++C 362000000 6900000 NONE QAM256 ++C 370000000 6900000 NONE QAM256 ++C 378000000 6900000 NONE QAM256 ++C 386000000 6900000 NONE QAM256 ++C 394000000 6900000 NONE QAM256 ++C 402000000 6900000 NONE QAM256 ++C 410000000 6900000 NONE QAM256 ++C 418000000 6900000 NONE QAM256 ++C 426000000 6900000 NONE QAM256 ++C 434000000 6900000 NONE QAM256 ++C 442000000 6900000 NONE QAM256 ++C 450000000 6900000 NONE QAM256 ++C 666000000 6900000 NONE QAM256 ++C 674000000 6900000 NONE QAM256 ++C 682000000 6900000 NONE QAM256 ++C 690000000 6900000 NONE QAM256 ++C 698000000 6900000 NONE QAM256 ++C 706000000 6900000 NONE QAM256 ++C 714000000 6900000 NONE QAM256 ++C 722000000 6900000 NONE QAM256 ++C 730000000 6900000 NONE QAM256 ++C 738000000 6900000 NONE QAM256 ++C 746000000 6900000 NONE QAM256 ++C 762000000 6900000 NONE QAM256 ++C 770000000 6900000 NONE QAM256 ++C 778000000 6900000 NONE QAM256 ++C 786000000 6900000 NONE QAM256 ++C 794000000 6900000 NONE QAM256 ++C 802000000 6900000 NONE QAM256 ++C 810000000 6900000 NONE QAM256 +diff -r af23d23c278b util/scan/dvb-c/at-KarrerNet +--- a/util/scan/dvb-c/at-KarrerNet Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-c/at-KarrerNet Tue Dec 21 12:13:28 2010 +0100 +@@ -1,18 +1,26 @@ + # Kabel St. Florian bei Linz/AT KarrerNet + # 2009-01-10 + # freq sr fec mod +-C 418000000 6900000 NONE QAM64 +-C 426000000 6900000 NONE QAM64 +-C 434000000 6900000 NONE QAM64 + C 442000000 6900000 NONE QAM64 +-C 450000000 6900000 NONE QAM64 + C 458000000 6900000 NONE QAM64 + C 466000000 6900000 NONE QAM64 + C 474000000 6900000 NONE QAM64 + C 482000000 6900000 NONE QAM64 ++C 490000000 6900000 NONE QAM64 ++C 498000000 6900000 NONE QAM64 ++C 506000000 6900000 NONE QAM64 ++C 514000000 6900000 NONE QAM64 + C 522000000 6900000 NONE QAM64 + C 530000000 6900000 NONE QAM64 + C 538000000 6900000 NONE QAM64 ++C 546000000 6900000 NONE QAM64 ++C 554000000 6900000 NONE QAM64 ++C 562000000 6900000 NONE QAM64 ++C 570000000 6900000 NONE QAM64 + C 578000000 6900000 NONE QAM64 +-C 402000000 6900000 NONE QAM256 ++C 586000000 6900000 NONE QAM64 ++C 610000000 6900000 NONE QAM64 ++C 386000000 6900000 NONE QAM256 ++C 394000000 6900000 NONE QAM256 + C 410000000 6900000 NONE QAM256 ++C 434000000 6900000 NONE QAM256 +diff -r af23d23c278b util/scan/dvb-c/de-Primacom +--- a/util/scan/dvb-c/de-Primacom Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-c/de-Primacom Tue Dec 21 12:13:28 2010 +0100 +@@ -1,6 +1,9 @@ + # Primacom + # freq sr fec mod + C 121000000 6900000 NONE QAM64 ++C 129000000 6900000 NONE QAM256 ++C 137000000 6900000 NONE QAM256 ++C 145000000 6900000 NONE QAM256 + C 306000000 6900000 NONE QAM64 + C 314000000 6900000 NONE QAM64 + C 322000000 6900000 NONE QAM64 +@@ -13,6 +16,8 @@ + C 378000000 6900000 NONE QAM256 + C 386000000 6900000 NONE QAM256 + C 394000000 6900000 NONE QAM256 ++C 402000000 6900000 NONE QAM256 ++C 410000000 6900000 NONE QAM256 + C 418000000 6900000 NONE QAM256 + C 434000000 6900000 NONE QAM64 + C 442000000 6900000 NONE QAM64 +diff -r af23d23c278b util/scan/dvb-c/de-Unitymedia +--- a/util/scan/dvb-c/de-Unitymedia Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-c/de-Unitymedia Tue Dec 21 12:13:28 2010 +0100 +@@ -1,35 +1,36 @@ + # Unitymedia +-# Created from http://www.unitymedia.de/service/tv/frequenzen.html +-# and http://blob.unitymedia.de/Download/Unitymedia_Senderlineup_digital_2008-05-28.pdf ++# Created from http://www.unitymedia.de/service/soforthilfe/frequenzen.html ++# and http://www.unitymedia.de/images/UnityDigitalTV_Lineup_01-07-2009.pdf + # freq sr fec mod + C 113000000 6900000 NONE QAM256 + C 121000000 6900000 NONE QAM256 +-C 338000000 6900000 NONE QAM256 + C 346000000 6900000 NONE QAM256 + C 354000000 6900000 NONE QAM64 + C 362000000 6900000 NONE QAM64 + C 370000000 6900000 NONE QAM64 + C 378000000 6900000 NONE QAM64 + C 386000000 6900000 NONE QAM64 +-C 394000000 6900000 NONE QAM256 ++C 394000000 6900000 NONE QAM64 + C 402000000 6900000 NONE QAM256 + C 410000000 6900000 NONE QAM256 + C 418000000 6900000 NONE QAM256 + C 426000000 6900000 NONE QAM256 + C 434000000 6900000 NONE QAM256 +-C 442000000 6900000 NONE QAM64 +-C 450000000 6900000 NONE QAM64 ++C 442000000 6900000 NONE QAM256 ++C 450000000 6900000 NONE QAM256 + C 458000000 6900000 NONE QAM256 + C 466000000 6900000 NONE QAM256 +-C 474000000 6900000 NONE QAM64 + C 522000000 6900000 NONE QAM256 + C 530000000 6900000 NONE QAM256 + C 538000000 6900000 NONE QAM256 ++C 546000000 6900000 NONE QAM256 + C 554000000 6900000 NONE QAM256 + C 562000000 6900000 NONE QAM256 + C 570000000 6900000 NONE QAM256 +-C 610000000 6900000 NONE QAM64 + C 650000000 6900000 NONE QAM256 + C 658000000 6900000 NONE QAM256 + C 666000000 6900000 NONE QAM256 + C 674000000 6900000 NONE QAM256 ++C 682000000 6900000 NONE QAM256 ++C 690000000 6900000 NONE QAM256 ++C 698000000 6900000 NONE QAM256 +diff -r af23d23c278b util/scan/dvb-c/de-komro-Rosenheim +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/de-komro-Rosenheim Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,30 @@ ++# komro (Rosenheim) ++# freq sr fec mod ++C 113000000 6900000 NONE QAM64 ++C 121000000 6900000 NONE QAM64 ++C 338000000 6900000 NONE QAM256 ++C 394000000 6900000 NONE QAM256 ++C 450000000 6900000 NONE QAM64 ++C 458000000 6900000 NONE QAM64 ++C 466000000 6900000 NONE QAM64 ++C 522000000 6900000 NONE QAM256 ++C 530000000 6900000 NONE QAM256 ++C 602000000 6900000 NONE QAM256 ++C 610000000 6900000 NONE QAM256 ++C 626000000 6900000 NONE QAM256 ++C 642000000 6900000 NONE QAM256 ++C 650000000 6900000 NONE QAM256 ++C 658000000 6900000 NONE QAM64 ++C 666000000 6900000 NONE QAM64 ++C 682000000 6900000 NONE QAM64 ++C 690000000 6900000 NONE QAM256 ++C 698000000 6900000 NONE QAM256 ++C 706000000 6900000 NONE QAM256 ++C 714000000 6900000 NONE QAM256 ++C 722000000 6900000 NONE QAM256 ++C 730000000 6900000 NONE QAM64 ++C 738000000 6900000 NONE QAM64 ++C 746000000 6900000 NONE QAM64 ++C 754000000 6900000 NONE QAM64 ++C 762000000 6900000 NONE QAM256 ++C 778000000 6900000 NONE QAM64 +diff -r af23d23c278b util/scan/dvb-c/fi-Oulu +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/fi-Oulu Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,19 @@ ++# DVB-C Channels in Oulu (Finland) ++# dna network ++# freq sr fec mod ++C 330000000 6875000 NONE QAM128 #mux1 ++C 370000000 6875000 NONE QAM128 #mux2 ++C 362000000 6875000 NONE QAM128 #mux3 ++C 354000000 6875000 NONE QAM128 #mux4 ++C 346000000 6875000 NONE QAM128 #mux5 ++C 338000000 6875000 NONE QAM128 #mux6 ++C 322000000 6875000 NONE QAM128 #mux7 ++C 314000000 6875000 NONE QAM128 #mux8 ++C 378000000 6875000 NONE QAM128 #mux9 ++C 306000000 6875000 NONE QAM128 #mux10 ++C 298000000 6875000 NONE QAM128 #mux11 ++C 290000000 6875000 NONE QAM128 #mux12 ++C 274000000 6875000 NONE QAM128 #mux13 ++C 266000000 6875000 NONE QAM128 #mux14 ++C 258000000 6875000 NONE QAM128 #mux15 ++C 250000000 6875000 NONE QAM128 #mux16 +diff -r af23d23c278b util/scan/dvb-c/fi-Turku +--- a/util/scan/dvb-c/fi-Turku Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-c/fi-Turku Tue Dec 21 12:13:28 2010 +0100 +@@ -3,6 +3,13 @@ + C 146000000 6900000 NONE QAM128 + C 154000000 6900000 NONE QAM128 + C 162000000 6900000 NONE QAM128 ++C 234000000 6900000 NONE QAM256 ++C 242000000 6900000 NONE QAM256 ++C 250000000 6900000 NONE QAM256 ++C 258000000 6900000 NONE QAM256 ++C 266000000 6900000 NONE QAM256 ++C 290000000 6900000 NONE QAM128 ++C 298000000 6900000 NONE QAM128 + C 322000000 6900000 NONE QAM128 + C 330000000 6900000 NONE QAM128 + C 338000000 6900000 NONE QAM128 +@@ -14,4 +21,3 @@ + C 418000000 6900000 NONE QAM128 + C 426000000 6900000 NONE QAM128 + C 442000000 6900000 NONE QAM128 +-C 354000000 6900000 NONE QAM256 +diff -r af23d23c278b util/scan/dvb-c/hu-Digikabel +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/hu-Digikabel Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,21 @@ ++# Digikabel, Hungary ++# For the following cities: ++# Budapest, Dorog, Hatvan, Kiskunhalas, Debrecen, Szekesfehervar, Pecs, ++# Veszprem, Dunaujvaros, Miskolc, Gyongyos, Tatabanya, Varpalota, Nagykanizsa, ++# Salgotarjan, Batonyterenye, Szolnok, Szentistvan, Nyiregyhaza, Gyor, ++# Szazhalombatta, Bekescsaba, Bekes, Eger, Komlo, Oroszlany ++# In some of the cities not all the frequencies are available. ++# freq sr fec mod ++C 354000000 6900000 NONE QAM256 ++C 362000000 6900000 NONE QAM256 ++C 370000000 6900000 NONE QAM256 ++C 378000000 6900000 NONE QAM256 ++C 386000000 6900000 NONE QAM256 ++C 394000000 6900000 NONE QAM256 ++C 402000000 6900000 NONE QAM256 ++C 410000000 6900000 NONE QAM256 ++C 762000000 6900000 NONE QAM256 ++C 770000000 6900000 NONE QAM256 ++C 778000000 6900000 NONE QAM256 ++C 786000000 6900000 NONE QAM256 ++C 794000000 6900000 NONE QAM256 +diff -r af23d23c278b util/scan/dvb-c/nl-REKAM-CAIW_Gouda +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-c/nl-REKAM-CAIW_Gouda Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,4 @@ ++# REKAM / Caiway, Gouda, Netherlands ++# freq sr fec mod ++C 163000000 6875000 NONE QAM64 ++C 770000000 6900000 NONE QAM64 +diff -r af23d23c278b util/scan/dvb-c/se-comhem +--- a/util/scan/dvb-c/se-comhem Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-c/se-comhem Tue Dec 21 12:13:28 2010 +0100 +@@ -1,3 +1,25 @@ + # com hem + # freq sr fec mod ++C 289500000 6875000 NONE QAM64 ++C 298000000 6875000 NONE QAM64 ++C 306000000 6875000 NONE QAM64 ++C 314000000 6875000 NONE QAM64 ++C 322000000 6875000 NONE QAM64 ++C 338000000 6875000 NONE QAM64 ++C 346000000 6875000 NONE QAM64 ++C 354000000 6875000 NONE QAM64 + C 362000000 6875000 NONE QAM64 ++C 370000000 6875000 NONE QAM64 ++C 378000000 6875000 NONE QAM64 ++C 386000000 6875000 NONE QAM64 ++C 394000000 6875000 NONE QAM64 ++C 402000000 6875000 NONE QAM64 ++C 418000000 6875000 NONE QAM64 ++C 434000000 6875000 NONE QAM64 ++C 442000000 6875000 NONE QAM64 ++C 450000000 6875000 NONE QAM64 ++C 458000000 6875000 NONE QAM64 ++C 714000000 6875000 NONE QAM64 ++C 722000000 6875000 NONE QAM64 ++C 738000000 6875000 NONE QAM64 ++C 786000000 6875000 NONE QAM64 +diff -r af23d23c278b util/scan/dvb-s/Agila2_C-146.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Agila2_C-146.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,60 @@ ++# Agila 2 @ 146.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Viva Prime Channel ++S 3725000 H 2345000 3/4 ++ ++# Zoe Philippines ++S 3774000 V 3300000 3/4 ++ ++# Da Ai TV indonesia ++S 3791000 H 3100000 3/4 ++ ++# Trinity Broadcasting Multiplex ++S 3791000 V 10091000 5/6 ++ ++# Bayon TV ++S 3796000 H 3360000 3/4 ++ ++# White Springs TV ++S 3846000 H 6110000 3/4 ++ ++# TCT World ++S 3854000 H 2603000 5/6 ++ ++# CCTN ++S 3873000 V 2532000 3/4 ++ ++# NBN Philippines ++S 3875000 H 3000000 3/4 ++ ++# Al Masriyah ++S 3880000 H 2000000 3/4 ++ ++# Viva Entertainment Multiplex ++S 3887000 H 6716000 3/4 ++ ++# IBC13 ++S 3896000 H 3000000 3/4 ++ ++# CTN Cambodia Multiplex ++S 3979000 V 9628000 3/4 ++ ++# Divya TV ++S 3990000 V 13330000 3/4 ++ ++# Familyland TV Network ++S 4164000 V 3735000 7/8 ++ ++# MTV Philippines ++S 4171000 V 3213000 3/4 ++ ++# The Old Path TV ++S 4183000 V 2170000 3/4 ++ ++# UNTV ++S 4188000 V 2170000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Apstar6_C-134.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Apstar6_C-134.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,15 @@ ++# Apstar 6 @ 134.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# New Entertainment ++S 3766000 H 4285000 3/4 ++ ++# Test ++S 3840000 H 27500000 3/4 ++ ++# TV Nusantara ++S 3905000 H 3250000 3/4 +diff -r af23d23c278b util/scan/dvb-s/AsiaSat2_C-100.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/AsiaSat2_C-100.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,51 @@ ++# AsiaSat 2 100.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Iris Sat Multiplex ++S 3660000 V 27500000 3/4 ++ ++# APTN Direct ++S 3706000 H 4167000 5/6 ++ ++# APTN Global Video Wire (MPEG-4 S/2) ++S 3732000 H 8889000 2/3 ++ ++# BYU TV ++S 3767000 V 6527000 1/2 ++ ++# AJK TV ++S 3778000 V 3333000 3/4 ++ ++# RTB International Brunei ++S 3786000 H 6000000 7/8 ++ ++# Shamshad TV ++S 3790000 V 2444000 3/4 ++ ++# FTV HD (MPEG-4 S/2) ++S 3794000 H 4640000 3/4 ++ ++# Arabsat ASBU Bouquet Multiplex ++S 3820000 V 27500000 3/4 ++ ++# Star TV Multiplex (MPEG-4 S/2) ++S 3840000 H 30000000 3/4 ++ ++# E Network Multiplex ++S 3880000 H 27500000 3/4 ++ ++# SatLink Multiplex ++S 3960000 H 27500000 3/4 ++ ++# Star TV Multiplex ++S 3980000 V 28100000 3/4 ++ ++# SatLink European Bouquet (MPEG-2 & MPEG-4 S2) ++S 4000000 H 28125000 3/4 ++ ++# Macau Satellite TV Multiplex ++S 4148000 V 11852000 3/4 +diff -r af23d23c278b util/scan/dvb-s/AsiaSat3S_C-105.5E +--- a/util/scan/dvb-s/AsiaSat3S_C-105.5E Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-s/AsiaSat3S_C-105.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -1,122 +1,102 @@ + # AsiaSat 3S 105.5E C-BAND +-# Generated by Xingbo Wang +-# Apr 2, 2005 ++# Generated by Pietro Casoar ++# 1st March 2009 + +-# MPEG-2 QPSK ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) + # freq pol sr fec + +-# [encrypted] ZEE English, ZEE TV International, ZEE Movies, MX, ZEE TV SE Asia, ZEE TV Asia, Trendz +-S 3700000 V 27500000 3/4 ++# China Entertainment TV & Maharishi Veda Vision ++S 3680000 H 26670000 3/4 ++ ++# MediaCorp Channel News Asia ++S 3706000 H 6000000 3/4 + + # BTV World + S 3725000 V 4450000 3/4 + +-# SAB TV +-S 3743000 V 3300000 3/4 ++# Galaxy TVB ++S 3729000 H 13650000 3/4 + +-# AAJ TV +-S 3750000 V 2820000 3/4 ++# Zee Network ++S 3733000 V 6500000 3/4 + +-# Arirang TV +-S 3755150 V 4417900 7/8 ++# Madani Channel ++S 3739000 V 2815000 3/4 + +-# [encrypted] STAR Plus India, STAR Movies India, STAR News India, National Geographic India, STAR Gold, STAR Movies (Middle East) +-# STAR Utsav ++# Fashion TV ++S 3746000 V 2625000 3/4 ++ ++# Aaj News ++S 3750000 V 2821000 3/4 ++ ++# Arirang Arab ++S 3755000 V 4418000 7/8 ++ ++# Globecast multiplex ++S 3760000 H 26000000 7/8 ++ ++# Star TV Multiplex + S 3780000 V 28100000 3/4 + +-# Chinese Provincial TV: Guangxi, Shanxi, Anhui, Jiangsu, Heilongjiang +-S 3806000 V 4420000 3/4 +-S 3813000 V 4420000 3/4 +-S 3820000 V 4420000 3/4 +-S 3827000 V 4420000 3/4 +-S 3834000 V 4420000 3/4 ++# Airwaves Media Multiplex ++S 3786000 H 5700000 3/4 + +-# [encrypted] ESPN Taiwan, STAR Sports Taiwan, ESPN Asia, STAR Sports South East Asia, STAR Sports India, ESPN India, ESPN Philippines ++# Zee Network Multiplex ++S 3820000 V 27500000 3/4 ++ ++# Star TV Multiplex ++S 3840000 H 26850000 7/8 ++ ++# Star TV Multiplex + S 3860000 V 27500000 3/4 + +-# Dragon TV +-S 3886000 V 4800000 3/4 ++# B4U INDIA - MPEG-4 S/2 Multiplex ++S 3880000 H 27500000 3/4 + +-# Shandong TV +-S 3895000 V 6813000 3/4 ++# Star TV Multiplex ++S 3940000 V 28100000 3/4 + +-# CCTV-1(comprehensive), China National Radio Channel 1 +-S 3904000 V 4420000 7/8 ++# Tuner International Multiplex ++S 3960000 H 28100000 3/4 + +-# Jilin Provincial TV +-S 3914500 V 4420000 3/4 +- +-# [encrypted] A1, History, STAR Movies SEA/China, STAR World India, STAR Plus Pakistan, Channel[V] India, STAR Chinese Movies, CNBC India, STAR One, STAR Vijay ++# Star TV Multiplex + S 3980000 V 28100000 3/4 + +-# Sahara One, Sahara Samay National, Sahara Samay Mumbai, Sahara Samay Uttar Pradesh, Sahara Samay Bihar, Sahara Samay Madhya Pradesh ++# Star TV Multiplex ++S 4000000 H 26850000 7/8 ++ ++# Sahara Samay Multiplex + S 4020000 V 27250000 3/4 + +-# Tianjin TV +-S 4046000 V 5950000 3/4 ++# VOA Voice Of America Multiplex ++S 4040000 H 20400000 1/2 + +-# PTV-1, PTV World, PTV Channel 3, AVT Khyber ++# Globecast Multiplex ++S 4071000 H 14240000 3/4 ++ ++# PTV Multiplex + S 4091000 V 13333000 3/4 + +-# PTV National +-S 4106000 V 3333300 3/4 ++# Sun TV ++S 4095000 H 5554000 3/4 + +-# Indus News +-S 4115750 V 3333000 3/4 ++# PTV Global USA ++S 4102000 V 2894000 3/4 + +-# [encrypted] ZEE Biz, ZEE News, ZEE Cinema, ZEE Music, Alpha TV Punjabi, Alpha TV Gujarati, Alpha TV Bangla, Alpha TV Marathi, Smile TV ++# PTV Global UK & Europe ++S 4106000 V 2894000 3/4 ++ ++# Galaxy TVB Multiplex ++S 4111000 H 13650000 3/4 ++ ++# PTV Multiplex ++S 4114000 V 7000000 3/4 ++ ++# Eye TV Multiplex ++S 4129000 H 13600000 3/4 ++ ++# Zee Network Multiplex + S 4140000 V 27500000 3/4 + +-# Chinese Provincial TV: Henan, Fujian, Jiangxi, Liaoning +-S 4166000 V 4420000 3/4 +-S 4180000 V 4420000 3/4 +-S 4187000 V 4420000 3/4 +-S 4194000 V 4420000 3/4 +- +-# CETV +-S 3680000 H 26670000 3/4 +- +-# Channel NewsAsia +-S 3706000 H 6000000 3/4 +- +-# Asia Plus +-S 3715500 H 7000000 3/4 +- +-# TVB 8, CETV +-S 3729000 H 13650000 3/4 +- +-# Network of the World, Bloomberg TV Asia, Indus Vision, Indus Music, Muslim TV Ahmadiyya, Living Asia Channel +-# [encrypted] Filmazia +-S 3760000 H 26000000 7/8 +- +-# [encrypted] Fox News, Sky News, STAR Movies Int'l Taiwan, National Geographic Taiwan, STAR Chinese Channel, STAR Movies mandarin, Channel[V] Taiwan +-S 3840000 H 26850000 7/8 +- +-# STAR Sports Asia +-# [encrypted] ESPN China, STAR Sports Hong Kong, ESPN Hong Kong +-S 3920000 H 26750000 7/8 +- +-# [encrypted] CNN International Asia, CNN Newsource, Cartoon Network Asia, Cartoon Network Taiwan, Cartoon Network Philippines, Cartoon Network Australia/New Zealand, TCM Australia, Boomerang +-S 3960000 H 27500000 3/4 +- +-# [encrypted] Phoenix Movies, star World Asia, Star Movies Int'l, Channel[V] International, National Geographic Regional +-# Phoenix Chinese Channel, Phoenix Info News Channel, Xiong Kong Int'l, Xing Kong Regional, Channel[V](Greater China) +-S 4000000 H 26850000 7/8 +- +-# Chinese Provincial TV: Hubei, Sichuan +-S 4034600 H 4420000 3/4 +-S 4051000 H 4420000 3/4 +- +-# Chinese Provincial TV: Qinghai, Hunan +-S 4067000 H 4420000 3/4 +-S 4082000 H 4420000 3/4 +- +-# Sun TV +-S 4094000 H 5555000 3/4 +- +-# MATV, Horizon Channel +-# [encrypted] Tian Ying Movies Channel, TVB Xing He Channel +-S 4111000 H 13650000 3/4 +- +-# CCTV Channel 4 (International), Channel 9 (English language), CCTV E&F +-S 4129000 H 13240000 3/4 ++# Geo TV Network Multiplex ++S 4180000 V 26666000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Asiasat4_C-122.2E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Asiasat4_C-122.2E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,27 @@ ++# Asiasat 4 @ 122.2E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# SITI Digital Network Multiplex ++S 3760000 H 27500000 3/4 ++ ++# SITI Digital Network Multiplex ++S 3820000 V 27500000 3/4 ++ ++# Henan Radio Multiplex ++S 3856000 H 2170000 3/4 ++ ++# SITI Digital Network Multiplex ++S 3880000 H 27500000 3/4 ++ ++# SITI Digital network Multiplex ++S 3920000 H 27500000 3/4 ++ ++# SITI Digital network Multiplex ++S 3960000 H 27500000 3/4 ++ ++# SITI Digital network Multiplex ++S 4180000 V 27500000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Astra-23.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Astra-23.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,66 @@ ++# Astra 23.5E ++# freq pol sr fec ++S 10758000 V 22000000 7/8 ++S 10788000 V 22000000 5/6 ++S 10802000 H 22000000 5/6 ++S 10842000 V 13333000 5/6 ++S 10862000 H 22000000 5/6 ++# Astra2Connect ++# S2 10891250 H 22000000 3/4 AUTO 8PSK ++S 11475000 V 27500000 3/4 ++S 11515000 H 27500000 3/4 ++S2 11515000 V 28500000 9/10 AUTO QPSK ++S2 11555000 H 28500000 9/10 AUTO QPSK ++S2 11555000 V 28500000 9/10 AUTO QPSK ++S2 11592000 V 28500000 9/10 AUTO QPSK ++S2 11595000 H 28500000 9/10 AUTO QPSK ++S2 11635000 H 28500000 9/10 AUTO QPSK ++S2 11635000 V 28500000 9/10 AUTO QPSK ++S 11675000 H 27500000 3/4 ++S2 11675000 V 28500000 9/10 AUTO QPSK ++S2 11719000 H 27500000 9/10 AUTO QPSK ++S 11739000 V 27500000 3/4 ++# Astra2Connect ++# S2 11758000 H 27500000 5/6 AUTO 8PSK ++S2 11778000 V 27500000 9/10 AUTO QPSK ++S 11798000 H 27500000 3/4 ++S2 11817000 V 27500000 9/10 AUTO QPSK ++S 11836000 H 29900000 3/4 ++S2 11856000 V 27500000 5/6 AUTO QPSK ++S 11875000 H 27500000 3/4 ++S 11914000 H 27500000 3/4 ++# Astra2Connect ++# S2 11954000 H 27500000 3/4 AUTO 8PSK ++S 11992000 H 27500000 3/4 ++S 12012000 V 27500000 3/4 ++S2 12032000 H 27500000 9/10 AUTO QPSK ++S 12070000 H 27500000 3/4 ++S2 12109000 H 27500000 9/10 AUTO QPSK ++# Astra2Connect ++# S2 12148000 H 27500000 3/4 AUTO 8PSK ++S 12168000 V 27500000 3/4 ++# Astra2Connect ++# S2 12226000 H 27500000 3/5 AUTO 8PSK ++# Astra2Connect ++# S2 12304000 H 27500000 5/6 AUTO 8PSK ++# Astra2Connect ++# S2 12344000 H 28200000 5/6 AUTO 8PSK ++# Astra2Connect ++# S2 12382000 H 27500000 3/4 AUTO 8PSK ++S 12525000 H 27500000 3/4 ++S 12525000 V 27500000 3/4 ++S 12565000 H 27500000 2/3 ++S 12565000 V 27500000 3/4 ++S2 12605000 H 28500000 9/10 AUTO QPSK ++S2 12605000 V 28500000 9/10 AUTO QPSK ++S 12630000 V 6000000 3/4 ++S 12631000 H 6666000 7/8 ++S 12636000 V 2277000 5/6 ++S 12641000 H 2220000 7/8 ++S 12644000 H 2170000 3/4 ++S 12649000 H 5600000 5/6 ++S 12661000 H 2170000 5/6 ++S 12685000 V 27500000 3/4 ++S 12696000 H 3255000 1/2 ++S 12711000 H 6111000 AUTO ++S 12725000 V 27500000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Atlantic-Bird-3-5.0W +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Atlantic-Bird-3-5.0W Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,4 @@ ++# Atlantic Bird 3 @ 5.0W ++# freq pol sr fec ++S 11096000 V 29950000 7/8 ++S 11591000 V 20000000 2/3 +diff -r af23d23c278b util/scan/dvb-s/Chinastar1_C-87.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Chinastar1_C-87.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,15 @@ ++# ChinaStar 1 @ 87.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Myawady TV ++S 3734000 H 5925000 3/4 ++ ++# Zam TV Tests ++S 4076000 H 2532000 3/4 ++ ++# Test Card ++S 4081000 H 4687000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Insat2E_C-83.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Insat2E_C-83.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,93 @@ ++# Insat 2E @ 83.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# NE TV Multiplex ++S 3521000 V 8640000 3/4 ++ ++# NE TV Multiplex ++S 3537000 V 10800000 3/4 ++ ++# TV 9 Telugu ++S 3550000 V 3255000 3/4 ++ ++# S1 Channel ++S 3559000 V 3366000 3/4 ++ ++# TV 9 Kannada ++S 3581000 V 3255000 3/4 ++ ++# Jaya TV ++S 3593000 V 8680000 3/4 ++ ++# Tata Communications Multiplex ++S 3593000 V 9629000 3/4 ++ ++# Asianet Multiplex ++S 3643000 V 19531000 3/4 ++ ++# Amrita TV Middle East ++S 3678000 V 5926000 3/4 ++ ++# Mahaa TV ++S 3689000 V 2893000 3/4 ++ ++# Tata Communications Multiplex ++S 3696000 V 6111000 3/4 ++ ++# CNBC India ++S 3760000 V 6500000 3/4 ++ ++# Raj TV Network Multiplex ++S 3774000 V 13021000 3/4 ++ ++# UTVi TV ++S 3794000 V 3500000 3/5 ++ ++# PTC Multiplex (MPEG-4 S/2) ++S 3815000 V 6000000 3/4 ++ ++# Tata Communications Multiplex ++S 3845000 V 26043000 3/4 ++ ++# Indiavision ++S 3914000 V 3000000 3/4 ++ ++# Yes Indiavision ++S 3919000 V 3000000 3/4 ++ ++# Manorama News International ++S 3923000 V 3000000 3/4 ++ ++# Tata Communications Multiplex ++S 3934000 V 13021000 3/4 ++ ++# Raj Musix kanada ++S 3961000 V 6656000 3/4 ++ ++# TV 9 Multiplex ++S 3974000 V 13333000 3/4 ++ ++# Asianet Multiplex ++S 4010000 V 19531000 3/4 ++ ++# Tata Communications Multiplex ++S 4031000 V 7440000 7/8 ++ ++# RRSat Multiplex ++S 4042000 V 7420000 7/8 ++ ++# Tata Communications Multiplex ++S 4050000 V 5084000 7/8 ++ ++# DD national ++S 4070000 V 5000000 3/4 ++ ++# Indiasign Mulitplex ++S 4091000 V 9230000 7/8 ++ ++# News Live (MPEG-4 S/2) ++S 4100000 V 4700000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Insat3A_C-93.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Insat3A_C-93.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,66 @@ ++# Insat 3A @ 93.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# DD Bangla ++S 3732000 V 6250000 3/4 ++ ++# DD Punjab ++S 3740000 V 6250000 3/4 ++ ++# DD Gujarati ++S 3750000 V 6250000 3/4 ++ ++# DD Chandana ++S 3759000 V 6250000 3/4 ++ ++# DD Oriya ++S 3772000 V 6250000 3/4 ++ ++# DD kashir ++S 3782000 V 6250000 3/4 ++ ++# DD Sahyadri ++S 3791000 V 8600000 3/4 ++ ++# DD Malayalam ++S 3812000 V 6250000 3/4 ++ ++# DD Saptagiri ++S 3820000 V 6250000 3/4 ++ ++# DD podhigai ++S 3831000 V 8600000 3/4 ++ ++# DD Himachal Pradesh ++S 3932000 V 6250000 3/4 ++ ++# DD Jaipur ++S 3940000 V 6250000 3/4 ++ ++# Madhya Pradesh ++S 3950000 V 6250000 3/4 ++ ++# DD Uttar Pradesh ++S 3958000 V 6250000 3/4 ++ ++# DD North East ++S 4092000 V 6250000 3/4 ++ ++# DD Mizoram ++S 4101000 V 6250000 3/4 ++ ++# DD Tripura ++S 4109000 V 4250000 3/4 ++ ++# RTA Afghanistan ++S 4132000 V 4000000 3/4 ++ ++# RTA Afghanistan Nangarhar ++S 4136000 V 2000000 3/4 ++ ++# Ariana TV Network Multiplex ++S 4141000 V 5150000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Insat4A_C-83.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Insat4A_C-83.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,93 @@ ++# Insat 4A @ 83.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# NSTPL Multiplex ++S 3725000 H 26665000 3/4 ++ ++# Indiasign multiplex ++S 3756000 H 13333000 3/4 ++ ++# Star TV Multiplex ++S 3777000 H 10900000 3/4 ++ ++# Essel Shyam Multiplex ++S 3805000 H 28500000 7/8 ++ ++# Tarang TV Multiplex (MPEG-4 S/2) ++S 3841000 H 6920000 3/4 ++ ++# CTVN AKD Plus ++S 3853000 H 3265000 3/4 ++ ++# Kasthuri TV ++S 3857000 H 3462000 3/4 ++ ++# Kamyab TV ++S 3874000 H 3403000 3/4 ++ ++# Vanitha TV ++S 3892000 H 3300000 3/4 ++ ++# Essel Shayam Multiplex ++S 3898000 H 6800000 3/4 ++ ++# Channel 10 India ++S 3910000 H 3600000 7/8 ++ ++# Essel Shyam ++S 3923000 H 13000000 3/4 ++ ++# DY 365 ++S 3949000 H 3225000 3/4 ++ ++# Multiplex ++S 3958000 H 9500000 7/8 ++ ++# Zee News Uttar Pradesh ++S 3976000 H 3200000 3/4 ++ ++# ETV Network Multiplex ++S 4004000 H 22220000 5/6 ++ ++# Essel Shyam ++S 4040000 H 7500000 7/8 ++ ++# Lamhas Multiplex ++S 4054000 H 13230000 3/4 ++ ++# Network 18 Multiplex ++S 4072000 H 6500000 3/4 ++ ++# IBN Lokmat ++S 4078000 H 3250000 3/4 ++ ++# Live India ++S 4087000 H 3300000 3/4 ++ ++# Mi Marathi ++S 4091000 H 3000000 3/4 ++ ++# BBS TV ++S 4100000 H 4750000 3/4 ++ ++# Manorama News ++S 4115000 H 5555000 3/4 ++ ++# BAG Films ++S 4134000 H 10600000 3/4 ++ ++# Zee Network Multiplex ++S 4151000 H 6500000 3/4 ++ ++# Zee Network Multiplex ++S 4161000 H 6500000 3/4 ++ ++# Lok Sabha TV ++S 4170000 H 6500000 3/4 ++ ++# Kolkata TV ++S 4180000 H 3233000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Insat4B_C-93.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Insat4B_C-93.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,51 @@ ++# Insat 4B @ 93.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Doordarshan Multiplex ++S 3725000 H 27500000 3/4 ++ ++# DD Dehradun ++S 3750000 H 4250000 3/4 ++ ++# DD Raipur ++S 3762000 H 4250000 3/4 ++ ++# DD Ranchi ++S 3768000 H 4250000 3/4 ++ ++# DD Jammu ++S 3774000 H 4250000 3/4 ++ ++# DD Hissar ++S 3802000 H 4250000 3/4 ++ ++# DD Chandigarh ++S 3808000 H 4250000 3/4 ++ ++# DD Port Blair ++S 3822000 H 4250000 3/4 ++ ++# DD Bihar ++S 3832000 H 6250000 3/4 ++ ++# DD North East ++S 3841000 H 6250000 3/4 ++ ++# Sun network ++S 3885000 H 28000000 3/4 ++ ++# Doordarshan Multiplex ++S 3925000 H 27500000 3/4 ++ ++# Sakshi TV ++S 3950000 H 4440000 3/4 ++ ++# Tata Communications Multiplex ++S 4005000 H 25422000 7/8 ++ ++# Sun Network ++S 4045000 H 28000000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Intelsat8_C-166.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Intelsat8_C-166.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,39 @@ ++# Intelsat 8 @ 166.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Viacom Multiplex ++S 3740000 H 27500000 2/3 ++ ++# South Korean Multiplex ++S 3790000 V 6510000 3/4 ++ ++# Arirang World ++S 3815000 V 4400000 3/4 ++ ++# Australian network Multiplex ++S 3829000 H 13238000 3/4 ++ ++# TVBS multiplex ++S 3833000 V 17500000 3/4 ++ ++# NBC Universal ++S 3900000 H 27500000 3/4 ++ ++# Intelsat multiplex ++S 3940000 H 27690000 7/8 ++ ++# China Radio multiplex ++S 3959000 V 3428000 3/4 ++ ++# NHK World network Multiplex ++S 4060000 H 16180000 1/2 ++ ++# Philippines Network TV Multiplex ++S 4122000 V 5554000 3/4 ++ ++# TAS Multiplex ++S 4130000 V 5800000 3/4 +diff -r af23d23c278b util/scan/dvb-s/JCSat3A_C-128.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/JCSat3A_C-128.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,18 @@ ++# JCSAT 3A @ 128.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# TAS Multiplex ++S 3960000 V 30000000 5/6 ++ ++# TAS Multiplex ++S 4000000 V 30000000 5/6 ++ ++# Miraclenet ++S 4055000 V 3332000 3/4 ++ ++# TAS Multiplex ++S 4120000 V 30000000 5/6 +diff -r af23d23c278b util/scan/dvb-s/Measat3_C-91.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Measat3_C-91.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,54 @@ ++# Measat 3 @ 91.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Shop TV ++S 3629000 V 2200000 3/4 ++ ++# Aora TV Mulitplex ++S 3644000 H 22320000 3/4 ++ ++# Solar Entertainment ++S 3645000 V 19510000 3/4 ++ ++# National Geographic music ++S 3718000 V 1700000 7/8 ++ ++# DZRH TV Multiplex ++S 3721000 V 2170000 3/4 ++ ++# Ascent Media (MPEG-4 S/2) ++S 3751000 V 13330000 2/3 ++ ++# Globecast Multiplex (MPEG-4 S/2) ++S 3769000 V 14000000 3/4 ++ ++# HTV Multiplex ++S 3796000 V 7030000 3/4 ++ ++# Sky International ++S 3814000 V 6666000 3/4 ++ ++# Un-named Mulitplex ++S 3865000 V 3835000 3/4 ++ ++# RTM Multiplex ++S 3877000 V 12525000 7/8 ++ ++# RTM Sarawak Feeds ++S 3887000 V 3984000 3/4 ++ ++# Globecast Multiplex ++S 3920000 V 28000000 7/8 ++ ++# Ginx TV ++S 4113000 V 2960000 3/4 ++ ++# YR Asia TV ++S 4117000 V 2963000 3/4 ++ ++# All Sports Network (MPEG-4 S/2) ++S 4134000 V 7200000 3/4 +diff -r af23d23c278b util/scan/dvb-s/PalapaC2_C-113.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/PalapaC2_C-113.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,39 @@ ++# Palapa C2 @ 113.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# SCTV Jawa Timur ++S 3745000 H 3125000 3/4 ++ ++# SCTV ++S 3758000 H 4470000 3/4 ++ ++# TVRI Nasional ++S 3765000 H 5555000 3/4 ++ ++# RCTI ++S 3774000 H 6520000 3/4 ++ ++# KBS World Indonesia ++S 3836000 V 2097000 3/4 ++ ++# Bali TV ++S 3926000 H 4208000 3/4 ++ ++# TV One Indonesia ++S 4054000 H 5632000 3/4 ++ ++# ANTV Indonesia ++S 4055000 V 6510000 3/4 ++ ++# Indosiar ++S 4074000 V 6500000 3/4 ++ ++# Satelindo Multiplex ++S 4080000 H 28125000 3/4 ++ ++# TPI Indonesia ++S 4184000 V 6700000 3/4 +diff -r af23d23c278b util/scan/dvb-s/ST1_C-80.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/ST1_C-80.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,27 @@ ++# ST1 @ 88.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# GTV Multiplex ++S 3469000 V 30000000 3/4 ++ ++# ABTV Multiplex ++S 3521000 H 8332000 5/6 ++ ++# Videoland Multiplex ++S 3550000 V 30000000 3/4 ++ ++# GTV Multiplex ++S 3595000 H 30000000 3/4 ++ ++# Videoland multiplex ++S 3632000 V 30000000 3/4 ++ ++# Chungwa Telecom ++S 3671000 H 9256000 3/4 ++ ++# NTD TV Asia-Pacific ++S 3689000 H 3000000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Telkom1_C-108.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Telkom1_C-108.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,48 @@ ++# Telkom 1 @ 108.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Telkom Vision Multiplex ++S 3580000 H 28000000 3/4 ++ ++# Telkom Vision Multiplex ++S 3620000 H 28000000 3/4 ++ ++# Telkom Vision Multiplex ++S 3640000 V 28000000 3/4 ++ ++# TV Timor Leste ++S 3776000 H 4285000 3/4 ++ ++# TV Edukasi 1 ++S 3785000 H 4000000 3/4 ++ ++# TVRI Kalbar ++S 3793000 H 3000000 3/4 ++ ++# TVRI Papua ++S 3797000 H 3900000 3/4 ++ ++# TV Edukasi 2 ++S 3807000 H 4000000 3/4 ++ ++# Trans 7 ++S 3990000 H 6000000 3/4 ++ ++# TVRI Aceh ++S 4015000 H 6000000 3/4 ++ ++# RCTI Jawa Timur ++S 4025000 H 3000000 3/4 ++ ++# Trans TV ++S 4084000 H 6000000 3/4 ++ ++# Papua TV ++S 4092000 H 3570000 3/4 ++ ++# JTV ++S 4097000 H 3125000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Telstar10_C-76.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Telstar10_C-76.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,63 @@ ++# Telstar 10 @ 76.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# Racing International ++S 3646000 H 5064000 3/4 ++ ++# Image Channel ++S 3655000 H 3214000 3/4 ++ ++# Globe Cast Asia multiplex ++S 3680000 H 27500000 3/4 ++ ++# UBI World TV Multiplex ++S 3760000 H 28066000 2/3 ++ ++# UBI World TV Multiplex ++S 3780000 V 28066000 2/3 ++ ++# Ekushey TV ++S 3787000 H 4600000 2/3 ++ ++# Diganta TV ++S 3793000 H 4340000 3/4 ++ ++# RRSat Global Network Multiplex ++S 3840000 H 27500000 3/4 ++ ++# Channel 1 ++S 4003000 H 4080000 3/4 ++ ++# Boishakhi TV ++S 4009000 H 4300000 3/4 ++ ++# TV Maldives ++S 4030000 V 6312000 1/2 ++ ++# Channel I ++S 4034000 H 4300000 3/4 ++ ++# Bangla Vision ++S 4049000 H 3600000 3/4 ++ ++# Kantipur TV ++S 4056000 H 3214000 3/4 ++ ++# BBC World Service Multiplex ++S 4073000 H 13020000 1/2 ++ ++# MNC Indonesia ++S 4105000 H 3125000 3/4 ++ ++# NDTV Arabia ++S 4137000 H 2893000 3/4 ++ ++# Islamic TV ++S 4146000 H 3600000 3/4 ++ ++# Bangladesh Multiplex ++S 4173000 H 7400000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Telstar18_C-138.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Telstar18_C-138.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,18 @@ ++# Telstar 18 @ 138.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# I-Sky-Net Multiplex ++S 3599000 V 30000000 3/4 ++ ++# I-Sky-Net Multiplex ++S 3660000 V 30000000 3/4 ++ ++# LNTV Laos ++S 3704000 V 3034000 3/4 ++ ++# BBC World Service Multiplex ++S 4124000 V 3255000 1/2 +diff -r af23d23c278b util/scan/dvb-s/Thaicom1A_C-120.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Thaicom1A_C-120.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,24 @@ ++# Thaicom 1A @ 120.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# TV3 Cambodia ++S 3725000 V 3255000 3/4 ++ ++# Panyapiwat ++S 3745000 V 2850000 5/6 ++ ++# CTN Cambodia Multiplex ++S 3854000 V 9628000 3/4 ++ ++# Kasikorn TV ++S 3881000 V 2000000 3/4 ++ ++# Bayon TV ++S 3916000 V 3359000 3/4 ++ ++# Radio Thailand Multiplex ++S 4135000 V 1808000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Thaicom2_C-78.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Thaicom2_C-78.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,33 @@ ++# Thaicom 2 @ 78.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# BBTV Channel 7 ++S 3764000 H 5900000 3/4 ++ ++# SBT TV ++S 3803000 H 1445000 7/8 ++ ++# MCOT Multiplex ++S 3888000 H 15625000 3/4 ++ ++# Royal Thai Army TV 5 ++S 3905000 H 6250000 3/4 ++ ++# Thai TV Color Channel 3 ++S 3967000 H 4551000 3/4 ++ ++# RU TV 1 ++S 4003000 H 1085000 3/4 ++ ++# Ten TV & Rich Channel ++S 4016000 H 2305000 7/8 ++ ++# NBT TV ++S 4106000 H 4688000 3/4 ++ ++# Thai PBS ++S 4145000 H 4815000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Thaicom5_C-78.5E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Thaicom5_C-78.5E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,69 @@ ++# Thaicom 5 @ 78.5E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# ETC India Multiplex ++S 3421000 V 6667000 3/4 ++ ++# Europe Media Port Multiplex ++S 3431000 H 13333000 3/4 ++ ++# Nepal TV Multiplex ++S 3432000 V 6667000 3/4 ++ ++# CTV9 ++S 3448000 V 2222000 3/4 ++ ++# RRSat Global Network (MPEG-4 S/2) ++S 3450000 H 13333000 3/4 ++ ++# Avenues TV ++S 3454000 V 3333000 3/4 ++ ++# PSI Channel ++S 3460000 V 1538000 3/4 ++ ++# Sagarmatha TV ++S 3489000 V 3333000 3/4 ++ ++# Dhi TV ++S 3502000 V 4444000 2/3 ++ ++# Korean Central TV ++S 3504000 H 3367000 2/3 ++ ++# Gang Cartoon Channel ++S 3505000 V 1852000 3/4 ++ ++# Lao Star Channel ++S 3521000 V 2917000 3/4 ++ ++# Thaicom Multiplex ++S 3545000 V 30000000 5/6 ++ ++# RRSat Global Network ++S 3551000 H 13333000 3/4 ++ ++# VTV Maldives ++S 3562000 H 4444000 1/2 ++ ++# MRTV Multiplex ++S 3574000 H 7492000 2/3 ++ ++# Thaicom Multiplex ++S 3585000 V 26667000 3/4 ++ ++# Thaicom Multiplex ++S 3600000 H 26667000 3/4 ++ ++# MRTV Multiplex ++S 3617000 V 12500000 3/4 ++ ++# RRSat Global Network Multiplex ++S 3640000 H 28066000 3/4 ++ ++# TVK Cambodia ++S 3664000 H 3704000 3/4 +diff -r af23d23c278b util/scan/dvb-s/Vinasat1_C-132.0E +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-s/Vinasat1_C-132.0E Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++# VINASAT 1 @ 132.0E C-BAND ++# Generated by Pietro Casoar ++# 1st March 2009 ++ ++# MPEG-2 & MPEG-4 QPSK (DVBS/S2) ++# freq pol sr fec ++ ++# VTV Multiplex (VTV 1, VTV 2, VTV 3, VTV 4, VTV6) ++S 3413000 V 9766000 3/4 ++ ++# VOV TV (Voice of VietNam) ++S 3529000 V 2500000 2/3 +diff -r af23d23c278b util/scan/dvb-t/au-Adelaide +--- a/util/scan/dvb-t/au-Adelaide Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/au-Adelaide Tue Dec 21 12:13:28 2010 +0100 +@@ -10,3 +10,5 @@ + T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE + # SBS + T 564500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# 3D Trial Australia ++T 536625000 7MHz 3/4 NONE QAM16 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-AdelaideFoothills +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-AdelaideFoothills Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++# Australia / Adelaide / Grenfell Street ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ABC ++T 781625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Seven ++T 711500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Nine ++T 795500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Ten ++T 732500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# SBS ++T 760500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Ballarat +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Ballarat Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++# Australia / Ballarat ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ABC ++T 620625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Prime ++T 655500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# WIN ++T 592625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# SC ++T 613500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# SBS ++T 634625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Bendigo +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Bendigo Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,41 @@ ++# Australia / Bendigo (Mt Alexandria transmitters) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ABC ++T 669500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 620500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 572500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# Seven ++T 690500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 655500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 555250000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# Nine ++T 576250000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 592500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# Ten ++T 618250000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# SBS ++T 529500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 634500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 534250000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++ ++# UNK1 ++T 676500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# UNK2 ++T 571500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++T 536625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 585625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 564500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 543500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 536500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 529500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 205500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 564500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 536625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 690500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 711500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++T 550500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Brisbane +--- a/util/scan/dvb-t/au-Brisbane Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/au-Brisbane Tue Dec 21 12:13:28 2010 +0100 +@@ -10,3 +10,5 @@ + T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE + # SBS + T 585625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# 31 Digital ++T 599500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Devonport +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Devonport Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,19 @@ ++# Australia / Tasmania / Devonport ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ++# Brett S Hallett October 2009 , may not be complete !! ++# ++# ABC VHF 57 ++T 730250000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# ABC Digital 45 ++T 648500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# SBS VHF 54 ++T 709250000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# SBS Digital 39 ++T 606500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# SCTV ++T 613498000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# WIN ++T 627498000 7MHz 3/4 NONE QAM64 8k 1/8 NONE ++# TDT ++T 585498000 7MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-FraserCoast-Bundaberg +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-FraserCoast-Bundaberg Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++# Australia / QLD / Fraser Coast - Bundaberg / Mt Goonaneman ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ABC VHF9A ++T 205625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# SBS UHF28 ++T 529500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# Seven VHF7 ++T 184625000 7MHz 2/3 NONE QAM64 8k 1/16 NONE ++# WIN Wide Bay VHF10 ++T 212500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Southern Cross Ten VHF9 ++T 198525000 7MHz 3/4 NONE QAM64 8k 1/16 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Goulburn-Rocky_Hill +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Goulburn-Rocky_Hill Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,19 @@ ++# Australia / Goulburn / Rocky Hill ++# ++# Scanned 17/10/2009 - Alex Ferrara (alex@receptiveit.com.au) ++ ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ABC - netid (4112) tid (547) offset (+125Khz) ++T 725625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# SBS - netid (12802) tid (848) offset (+125Khz) ++T 746625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++ ++# WIN - netid (12915) tid (12922) offset (+125Khz) ++T 767625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# Prime - netid (12929) tid (2462) offset (+125Khz) ++T 788625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++ ++# TEN - netid (12812) tid (2055) offset (0Khz) ++T 809500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE +diff -r af23d23c278b util/scan/dvb-t/au-Hervey_Bay-Ghost_Hill +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Hervey_Bay-Ghost_Hill Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,16 @@ ++# Australia / Hervey Bay / Ghost Hill ++# ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ++# ABC UHF56 ++T 725500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Seven UHF59 ++T 746500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Nine UHF62 ++T 767625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# Ten UHF68 ++T 809500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++# SBS UHF28 ++T 529500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++# SBS UHF34 ++T 704500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/au-SunshineCoast +--- a/util/scan/dvb-t/au-SunshineCoast Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/au-SunshineCoast Tue Dec 21 12:13:28 2010 +0100 +@@ -3,7 +3,7 @@ + # SBS36 SBS *** + T 585625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE + # TNQ47 10 *** +-T 662625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 662625000 7MHz 3/4 NONE QAM64 8k 1/8 NONE + # ABQ62 ABC *** + T 767625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE + # STQ65 7 *** +diff -r af23d23c278b util/scan/dvb-t/au-Sutherland +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/au-Sutherland Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,20 @@ ++# Australia / Sutherland ++# ++# Australia modulation params: ++# - http://www.dba.org.au/index.asp?sectionID=120 ++# ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# ++# North (Broadcast Site Escarpment Road BROKERS NOSE) ++# - http://www.dba.org.au/index.asp?query=true§ionID=22&recLocation=Wollongong+%2D+North ++# ++#Channel 7 stations ++T 177500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++#Channel 9 bundle ++# T 191500000 7MHz AUTO AUTO AUTO AUTO AUTO AUTO ++#One and Channel 10 ++T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++#Aunty ++T 226500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE ++#SBS ++T 571500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE +diff -r af23d23c278b util/scan/dvb-t/be-All +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/be-All Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Belgium, whole country ++# Created from http://nl.wikipedia.org/wiki/DVB-T-frequenties ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 482000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE ++T 506000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE ++T 666000000 8MHz 3/4 NONE QAM16 8k 1/4 NONE ++T 754000000 8MHz 3/4 NONE QAM16 8k 1/4 NONE ++T 834000000 8MHz 3/4 NONE QAM16 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/be-Brussels +--- a/util/scan/dvb-t/be-Brussels Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,5 +0,0 @@ +-# Brussels - Belgium (Transmitters of the RTBF and the VRT) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 754000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # RTBF +-T 746000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # BE-TV +-T 482000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # VRT +diff -r af23d23c278b util/scan/dvb-t/be-Libramont +--- a/util/scan/dvb-t/be-Libramont Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,10 +0,0 @@ +-# Libramont - Belgique +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-# Canal 7 191.5 MHz M6 +-# Canal 24 498.0 MHz RTL-TVI Club-RTL Plug-TV RTL 4,5,7 +-# Canal 27 522.0 MHz RTL Lux, den 2ten RTL +-# Canal 56 834.0 MHz RTBF 1,2,3 + radio +-T 191500000 7MHz 1/2 NONE QAM64 8k 1/8 NONE +-T 498000000 8MHz 1/2 NONE QAM64 8k 1/16 NONE +-T 522000000 8MHz 1/2 NONE QAM64 8k 1/16 NONE +-T 834000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/be-Schoten +--- a/util/scan/dvb-t/be-Schoten Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# Schoten-Antwerpen - Belgie +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 778000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/be-St_Pieters_Leeuw +--- a/util/scan/dvb-t/be-St_Pieters_Leeuw Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# St.-Pieters-Leeuw - Belgie +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 482000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/be-Tournai +--- a/util/scan/dvb-t/be-Tournai Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# Tournai - Belgique +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 754000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/ch-All +--- a/util/scan/dvb-t/ch-All Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/ch-All Tue Dec 21 12:13:28 2010 +0100 +@@ -19,6 +19,7 @@ + T 682000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE + T 690000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE + T 698000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE ++T 706000000 8MHz 1/2 NONE QAM16 8k 1/4 NONE + T 714000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE + T 722000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE + T 722000000 8MHz 5/6 NONE QAM16 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/ch-Geneva +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/ch-Geneva Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,16 @@ ++# Switzerland, whole country ++# Created from http://www.broadcast.ch/portal.aspx?pid=705 ++# and http://www.broadcast.ch/data_program_dvbt.aspx ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 570166000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 578000000 8MHz 5/6 NONE QAM16 8k 1/4 NONE ++T 658166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 666166000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 682166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 706000000 8MHz 1/2 NONE QAM16 8k 1/4 NONE ++T 746166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 770166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 794166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 818166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++T 850166000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-All +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/cz-All Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,41 @@ ++# Czech Republic, whole country ++# Created from http://www.digizone.cz/texty/mapy-pokryti-multiplex-1-ceska-televize/ ++# and http://www.digizone.cz/texty/mapy-pokryti-multiplex-2-radiokomunikace/ ++# and http://www.digizone.cz/texty/mapy-pokryti-multiplex-3-czech-digital-group/ ++# and http://www.digizone.cz/texty/mapy-pokryti-multiplex-4-telefonica-o2/ ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 482000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 546000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 562000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 578000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 586000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 594000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 618000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 626000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 634000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 642000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 650000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 658000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 666000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 674000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 706000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 730000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 738000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 746000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 802000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 818000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 826000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Brno +--- a/util/scan/dvb-t/cz-Brno Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,10 +0,0 @@ +-# DVB-T Brno (Brno, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-# MUX 1 Ceska televize +-T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-# MUX 2 Ceske radiokomunikace +-T 626000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-# MUX 3 Czech Digital Group +-T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-# MUX 4 Telefonica O2 +-T 818000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Domazlice +--- a/util/scan/dvb-t/cz-Domazlice Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# DVB-T Domažlice (Domažlice, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 610000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Klet +--- a/util/scan/dvb-t/cz-Klet Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,4 +0,0 @@ +-# DVB-T Ceske Budejovice (Klet, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-# CRa - Ceske radiokomunikace, TX Klet +-T 698000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Ostrava +--- a/util/scan/dvb-t/cz-Ostrava Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# DVB-T Ostrava (Ostrava, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 618000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Plzen +--- a/util/scan/dvb-t/cz-Plzen Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,8 +0,0 @@ +-# DVB-T Plzen (Pilsen, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-# MUX 1 Ceska televize +-T 578000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-# MUX 2 Ceske Radiokomunikace +-T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-# MUX 3 Czech Digital Group +-T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/cz-Praha +--- a/util/scan/dvb-t/cz-Praha Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,7 +0,0 @@ +-# DVB-T Praha (Prague, Czech Republic) +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 634000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 674000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 730000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 818000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/de-Baden-Wuerttemberg +--- a/util/scan/dvb-t/de-Baden-Wuerttemberg Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Baden-Wuerttemberg Tue Dec 21 12:13:28 2010 +0100 +@@ -1,20 +1,19 @@ + # DVB-T Baden-Württemberg + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 474000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH21: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: Das Erste, arte, Phoenix, EinsPlus +-T 522000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH27: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: SWR-BW, BR, hr, WDR +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: SWR-BW, BR, hr, WDR +-T 634000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH41: SWR-BW, BR, hr, WDR ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: SWR-BW, Bayerisches Fernsehen, hr, WDR ++T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: SWR-BW, Bayerisches Fernsehen, hr, WDR ++T 634000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH41: SWR-BW, Bayerisches Fernsehen, hr, WDR + T 650000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH43: Das Erste, arte, Phoenix, EinsPlus +-T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: SWR-BW, BR, hr, WDR +-T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: Das Erste, arte, Phoenix, EinsPlus +- # CH50: SWR-BW, BR, hr, WDR ++T 666000000 8MHz 3/4 NONE QAM16 8k 1/8 NONE # CH45: RTL, RTL 2, Super RTL, VOX, RTL Crime, Passion [Sendenorm: MPEG-4] ++T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: SWR-BW, Bayerisches Fernsehen, hr, WDR ++T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: SWR-BW, Bayerisches Fernsehen, hr, WDR + T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: Das Erste, arte, Phoenix, EinsPlus +-T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: Das Erste, arte, Phoenix, EinsPlus +- # CH53: SWR-BW, BR, hr, WDR + T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: Das Erste, arte, Phoenix, EinsPlus ++T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: Das Erste, arte, Phoenix, EinsPlus + T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Das Erste, arte, Phoenix, EinsPlus +diff -r af23d23c278b util/scan/dvb-t/de-Bayern +--- a/util/scan/dvb-t/de-Bayern Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Bayern Tue Dec 21 12:13:28 2010 +0100 +@@ -1,40 +1,40 @@ + # DVB-T Bayern + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 184500000 7MHz 3/4 NONE QAM16 8k 1/4 NONE # CH06: Das Erste, arte, Phoenix, EinsPlus + T 191500000 7MHz 3/4 NONE QAM16 8k 1/4 NONE # CH07: Das Erste, arte, Phoenix, EinsPlus + T 212500000 7MHz 3/4 NONE QAM16 8k 1/4 NONE # CH10: Das Erste, arte, Phoenix, EinsPlus +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 506000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH25: BR, BRalpha, SWR, Das Erste +- # CH25: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 522000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH27: BR, BRalpha, SWR, Das Erste +-T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: BR, BRalpha, SWR, Das Erste +- # CH28: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 506000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH25: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++ # CH25: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 522000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH27: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++ # CH28: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: Das Erste, arte, Phoenix, EinsPlus + T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: Das Erste, arte, Phoenix, EinsPlus +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 578000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH34: RTL, RTL II, Super RTL, VOX +- # CH34: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 578000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH34: RTL, RTL 2, Super RTL, VOX ++ # CH34: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: Das Erste, arte, Phoenix, EinsPlus +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: BR, BRalpha, hr, mdr ++T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: Bayerisches Fernsehen, BR-alpha, MDR, hr + # CH40: Das Erste, arte, Phoenix, EinsPlus +-T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: BR, BRalpha, hr, mdr ++T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: Bayerisches Fernsehen, BR-alpha, MDR, hr + # CH45: Das Erste, arte, Phoenix, EinsPlus +-T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: BR, BRalpha, SWR, Das Erste +- # CH46: BR, BRalpha, hr, mdr +-T 682000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH47: BR, BRalpha, hr, mdr ++T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: Bayerisches Fernsehen, BR-alpha, MDR, hr ++ # CH46: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++T 682000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH47: Bayerisches Fernsehen, BR-alpha, MDR, hr + # CH47: Das Erste, arte, Phoenix, EinsPlus +-T 690000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH48: Pro7, Sat.1, Kabel1, N24 +-T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: Pro7, Sat.1, Kabel1, N24 +-T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: BR, BRalpha, SWR, Das Erste +- # CH53: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: http://www.digitalfernsehen.de/news/news_769785.html ++T 690000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH48: Sat.1, ProSieben, Kabel1, N24 ++T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: Das Erste, arte, Phoenix, EinsPlus ++T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: ProSieben, Sat.1, Kabel1, N24 ++T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++ # CH53: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: Das Erste, arte, Phoenix, EinsPlus + T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: Das Erste, arte, Phoenix, EinsPlus +-T 754000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH56: BR, BRalpha, SWR, Das Erste +-T 770000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH58: Das Erste, arte, Phoenix, EinsPlus +-T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Tele 5, Eurosport, MonA, Franken Fernsehen +-T 834000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH66: RTL, RTL II, Super RTL, VOX +- # CH66: Tele 5, Eurosport, HSE 24, münchen.tv ++T 754000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH56: Bayerisches Fernsehen, BR-alpha, SWR, EinsExtra ++T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Tele 5, Channel21/ Euronews, Bibel TV, HSE 24, Franken Fernsehen ++T 834000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH66: RTL, RTL 2, Super RTL, VOX ++ # CH66: Tele 5, Channel21/ Euronews, Bibel TV, HSE 24, münchen.tv +diff -r af23d23c278b util/scan/dvb-t/de-Berlin +--- a/util/scan/dvb-t/de-Berlin Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Berlin Tue Dec 21 12:13:28 2010 +0100 +@@ -1,11 +1,12 @@ + # DVB-T Berlin + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 177500000 7MHz 3/4 NONE QAM16 8k 1/8 NONE # CH05: HSE 24/MONA, FAB, WDR, SWR ++T 177500000 7MHz 3/4 NONE QAM16 8k 1/8 NONE # CH05: Tele 5, HSE 24, WDR, SWR (BW / RP) + T 191500000 7MHz 2/3 NONE QAM16 8k 1/8 NONE # CH07: MDR, NDR, arte +-T 506000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH25: RTL, RTL II, Super RTL, VOX ++T 506000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH25: RTL, RTL 2, Super RTL, VOX + T 522000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH27: Das Erste, RBB, Phoenix, EinsExtra +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 658000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH44: Pro7, Sat.1, Kabel1, N24 +-T 754000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH56: Eurosport, TV.B, DSF, Neun live +-T 778000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH59: n-tv, EuroNews, + 26 Radioprogramme ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 618000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH39: Das Vierte, Bibel.TV, QVC, Bayerisches Fernsehen ++T 658000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH44: ProSieben, Sat.1, Kabel1, N24 ++T 754000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH56: Eurosport, TV.B, Sport1, 9Live ++T 778000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH59: n-tv, EuroNews / Channel 21 Shop, PLACE2BE + 8 Radioprogramme +diff -r af23d23c278b util/scan/dvb-t/de-Brandenburg +--- a/util/scan/dvb-t/de-Brandenburg Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Brandenburg Tue Dec 21 12:13:28 2010 +0100 +@@ -1,7 +1,7 @@ + # DVB-T Brandenburg + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 730000000 8MHz 3/4 NONE QAM16 8k 1/4 NONE # CH53: Das Erste, RBB, Phoenix, EinsExtra + T 762000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH57: MDR, NDR, arte +diff -r af23d23c278b util/scan/dvb-t/de-Bremen +--- a/util/scan/dvb-t/de-Bremen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Bremen Tue Dec 21 12:13:28 2010 +0100 +@@ -3,7 +3,7 @@ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: Das Erste (RB), RB TV (NDR NDS), arte, Phoenix + T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH +-T 562000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH32: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: RTL, RTL II, Super RTL, VOX +-T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: Tele 5, Neun live, Eurosport, MONA/DMAX +-T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: Pro7, Sat.1, Kabel1, N24 ++T 562000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH32: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: RTL, RTL 2, Super RTL, VOX ++T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: Tele 5, 9Live, Eurosport, MONA / Channel 21 ++T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: ProSieben, Sat.1, Kabel1, N24 +diff -r af23d23c278b util/scan/dvb-t/de-Hamburg +--- a/util/scan/dvb-t/de-Hamburg Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Hamburg Tue Dec 21 12:13:28 2010 +0100 +@@ -1,16 +1,12 @@ + # DVB-T Hamburg + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf ++# CH36 entry from http://www.dvb-t-nord.de/programme/index.html + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR HH +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: Pro7, Sat.1, Kabel1, N24 +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH30: Pro7, Sat.1, Kabel1, N24 ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR Fernsehen/NDR HH ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ProSieben, Sat.1, Kabel1, N24 + T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: Das Erste, arte, Phoenix, EinsExtra +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH33: Das Erste, arte, Phoenix, EinsExtra +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: RTL, RTL II, Super RTL, VOX +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH40: RTL, RTL II, Super RTL, VOX +-T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: Neun live, HH1, BibelTV, Eurosport +-T 674000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH46: Neun live, HH1, BibelTV, Eurosport +-T 738000000 8MHz 1/2 NONE QAM64 8k 1/8 NONE # CH54: NDR HH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR SH +-T 738000000 8MHz 3/4 NONE QAM16 8k 1/8 NONE # CH54: NDR HH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR SH ++T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: TELE 5, QVC, DAS VIERTE, Channel 21 / Euronews ++T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: RTL, RTL 2, Super RTL, VOX ++T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: 9Live, HH1, Bibel.TV, Eurosport ++T 738000000 8MHz 1/2 NONE QAM64 8k 1/8 NONE # CH54: NDR HH, WDR/NDR NDS, MDR/NDR MVP, BR Fernsehen/NDR SH +diff -r af23d23c278b util/scan/dvb-t/de-Hessen +--- a/util/scan/dvb-t/de-Hessen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Hessen Tue Dec 21 12:13:28 2010 +0100 +@@ -1,19 +1,19 @@ + # DVB-T Hessen + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 198500000 7MHz 2/3 NONE QAM16 8k 1/4 NONE # CH08: Phoenix, BR, SWR-RP +-T 474000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH21: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 498000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH24: Phoenix, BR, SWR-RP, WDR +-T 506000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH25: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 198500000 7MHz 2/3 NONE QAM16 8k 1/4 NONE # CH08: Phoenix, Bayerisches Fernsehen, SWR-RP ++T 474000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH21: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 498000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH24: Phoenix, Bayerisches Fernsehen, SWR-RP, WDR ++T 506000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH25: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 562000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH32: Das Erste, hr, EinsExtra/arte +-T 578000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH34: RTL, RTL II, Super RTL, VOX ++T 578000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH34: RTL, RTL 2, Super RTL, VOX + T 602000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH37: Das Erste, hr, EinsExtra/arte +-T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: Phoenix, BR, SWR-RP, mdr +-T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: Phoenix, Bayerisches Fernsehen, SWR-RP, MDR ++T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 650000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH43: Das Erste, hr, EinsExtra/arte +-T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: BR, hr, SWR-BW, WDR +-T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: Pro7, Sat.1, Kabel1, N24 +-T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: Phoenix, NDR, mdr, WDR +-T 818000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH64: Tele5, Eurosport, rheinmaintv ++T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: Bayerisches Fernsehen, hr, SWR-BW, WDR ++T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: ProSieben, Sat.1, Kabel1, N24 ++T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: Phoenix, NDR, MDR, WDR ++T 818000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH64: Tele5, Eurosport, rheinmaintv, Bibel.TV +diff -r af23d23c278b util/scan/dvb-t/de-Mecklenburg-Vorpommern +--- a/util/scan/dvb-t/de-Mecklenburg-Vorpommern Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Mecklenburg-Vorpommern Tue Dec 21 12:13:28 2010 +0100 +@@ -2,11 +2,11 @@ + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: Das Erste, NDR MVP, RBB, MDR/NDR SH +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: Das Erste, NDR MVP, RBB, MDR/NDR SH + T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: Das Erste, NDR MVP, RBB, MDR/NDR SH + T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: Das Erste, NDR MVP, RBB, MDR/NDR SH +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 714000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH51: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 738000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH54: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 602000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH37: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal +diff -r af23d23c278b util/scan/dvb-t/de-Niedersachsen +--- a/util/scan/dvb-t/de-Niedersachsen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Niedersachsen Tue Dec 21 12:13:28 2010 +0100 +@@ -5,36 +5,35 @@ + T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: Das Erste (RB), RB TV (NDR NDS), arte, Phoenix + # CH22: Das Erste, arte, Phoenix, EinsExtra + # CH22: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 498000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH24: RTL, RTL II, Super RTL, VOX +- # CH24: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 522000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH27: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: Tele 5, NICK/Comedy Central, Eurosport, MONA/DMAX ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 498000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH24: RTL, RTL 2, Super RTL, VOX ++T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: Das Erste, arte, Phoenix, EinsExtra ++T 522000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH27: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: Tele 5, NICK / Comedy Central, Eurosport, MONA / Channel 21 + T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH +-T 562000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH32: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 554000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH31: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 562000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH32: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: Das Erste, arte, Phoenix, EinsExtra +-T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH + T 602000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH37: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH +-T 610000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH38: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 610000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH38: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 634000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH41: Das Erste, arte, Phoenix, EinsExtra +-T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: RTL, RTL II, Super RTL, VOX +- # CH42: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: RTL, RTL 2, Super RTL, VOX ++ # CH42: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 650000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH43: Das Erste, arte, Phoenix, EinsExtra + # CH43: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH +-T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: Pro7, Sat.1, Kabel1, N24 +-T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: Tele 5, Neun live, Eurosport, MONA/DMAX ++T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: ProSieben, Sat.1, Kabel1, N24 ++T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: Tele 5, 9Live, Eurosport, MONA / Channel 21 + T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH + T 682000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH47: Das Erste, arte, Phoenix, EinsExtra + T 690000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH48: Das Erste, arte, Phoenix, EinsExtra +-T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: Pro7, Sat.1, Kabel1, N24 ++T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: ProSieben, Sat.1, Kabel1, N24 + T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: Das Erste, arte, Phoenix, EinsExtra +-T 714000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH51: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH + T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: Das Erste, arte, Phoenix, EinsExtra + T 754000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH56: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH + T 770000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH58: NDR NDS, WDR/NDR SH, MDR/NDR MVP, HR/NDR HH + T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: Das Erste, arte, Phoenix, EinsExtra +- # CH59: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Tele 5, Comedy Central, Eurosport, MONA/DMAX +- # CH60: Tele 5, NICK/Comedy Central, Eurosport, MONA/DMAX ++ # CH59: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Tele 5, NICK / Comedy Central, Eurosport, MONA / Channel 21 + T 826000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH65: Das Erste, arte, Phoenix, EinsExtra +diff -r af23d23c278b util/scan/dvb-t/de-Nordrhein-Westfalen +--- a/util/scan/dvb-t/de-Nordrhein-Westfalen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Nordrhein-Westfalen Tue Dec 21 12:13:28 2010 +0100 +@@ -5,13 +5,13 @@ + T 482000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH22: WDR-Wuppertal, NDR/WDR-Düsseldorf, MDR, SWR + T 506000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH25: WDR-Dortmund, NDR/WDR-Essen, MDR, SWR + T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: Das Erste, arte, Phoenix, EinsFestival +- # CH26: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++ # CH26: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 522000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE # CH27: WDR-Siegen, NDR, MDR, SWR +-T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: RTL, RTL II, Super RTL, VOX +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH29: RTL, RTL 2, Super RTL, VOX ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 554000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE # CH31: WDR-Bielefeld, NDR/WDR-Siegen, MDR, SWR +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: CNN, Eurosport, Tele5, VIVA + T 602000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE # CH37: WDR-Aachen, NDR/WDR-Köln, MDR, SWR + T 666000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE # CH45: WDR-Münster, NDR/WDR-Dortmund, MDR, SWR +@@ -20,8 +20,8 @@ + T 698000000 8MHz 1/2 NONE QAM64 8k 1/4 NONE # CH49: WDR-Köln, MDR/WDR-Bonn, NDR/WDR-Aachen, SWR + T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: Das Erste, arte, Phoenix, EinsFestival + T 722000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH52: CNN, Eurosport, Tele5, VIVA +-T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: Pro7, Sat.1, Kabel1, N24 +-T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: Pro7, Sat.1, Kabel1, N24 ++T 730000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH53: ProSieben, Sat.1, Kabel1, N24 ++T 746000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH55: ProSieben, Sat.1, Kabel1, N24 + T 762000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH57: WDR-Essen, NDR/WDR-Dortmund, MDR, SWR +-T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Das Erste, arte, Phoenix, EinsFestival +diff -r af23d23c278b util/scan/dvb-t/de-Rheinland-Pfalz +--- a/util/scan/dvb-t/de-Rheinland-Pfalz Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Rheinland-Pfalz Tue Dec 21 12:13:28 2010 +0100 +@@ -1,12 +1,12 @@ + # DVB-T Rheinland-Pfalz + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: SWR-RP, BR, hr, WDR +-T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: SWR-RP, BR, hr, WDR ++T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: SWR-RP, Bayerisches Fernsehen, hr, WDR ++T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: SWR-RP, Bayerisches Fernsehen, hr, WDR + T 674000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH46: Das Erste, arte, Phoenix, EinsPlus +-T 690000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH48: SWR-RP, BR, hr, WDR ++T 690000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH48: SWR-RP, Bayerisches Fernsehen, hr, WDR + T 754000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH56: Das Erste, arte, Phoenix, EinsPlus + T 762000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH57: Das Erste, arte, Phoenix, EinsPlus + T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Das Erste, arte, Phoenix, EinsPlus +diff -r af23d23c278b util/scan/dvb-t/de-Saarland +--- a/util/scan/dvb-t/de-Saarland Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Saarland Tue Dec 21 12:13:28 2010 +0100 +@@ -1,7 +1,7 @@ + # DVB-T Saarland + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 642000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH42: Das Erste, SR Fernsehen, arte, Phoenix +-T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: SWR-RP, BR, hr, WDR +-T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: SaarTV, Tele 5, QVC, BibelTV ++T 658000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH44: SWR-RP, Bayerisches Fernsehen, hr, WDR ++T 698000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH49: Tele 5, QVC, Bibel.TV, freie Kapazität +diff -r af23d23c278b util/scan/dvb-t/de-Sachsen +--- a/util/scan/dvb-t/de-Sachsen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Sachsen Tue Dec 21 12:13:28 2010 +0100 +@@ -1,12 +1,14 @@ + # DVB-T Sachsen + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 205500000 7MHz 2/3 NONE QAM64 8k 1/16 NONE # CH09: MDR-SN, rbb, BR, WDR +-T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 498000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH24: Das Erste, arte, Phoenix, EinsFestival + T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH25: Das Erste, arte, Phoenix, EinsFestival +-T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH27: MDR-SN, rbb, BR, WDR +-T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH29: MDR-SN, rbb, BR, WDR +-T 562000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH32: MDR-SN, rbb, BR, WDR +-T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH27: MDR-SN, rbb, Bayerisches Fernsehen, WDR ++T 530000000 8MHz 3/4 NONE QAM16 8k 1/8 NONE # CH28: RTL, RTL 2, Super RTL, VOX, RTL Crime, Passion [Sendenorm: MPEG ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH29: MDR-SN, rbb, Bayerisches Fernsehen, WDR ++T 554000000 8MHz 2/3 NONE QAM16 8k 1/8 NONE # CH31: LF Leipzg.Ferns., InfoTVLeipzig, BBCWorld, Bibel.TV, RadioLeipzig, RadioHoreb ++T 562000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH32: MDR-SN, rbb, Bayerisches Fernsehen, WDR ++T 594000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH36: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH37: MDR-SN, rbb, Bayerisches Fernsehen, WDR + T 618000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH39: Das Erste, arte, Phoenix, EinsFestival +diff -r af23d23c278b util/scan/dvb-t/de-Sachsen-Anhalt +--- a/util/scan/dvb-t/de-Sachsen-Anhalt Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Sachsen-Anhalt Tue Dec 21 12:13:28 2010 +0100 +@@ -1,12 +1,12 @@ + # DVB-T Sachsen-Anhalt + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 498000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH24: Das Erste, arte, Phoenix, EinsFestival ++T 530000000 8MHz 3/4 NONE QAM16 8k 1/8 NONE # CH28: RTL, RTL 2, Super RTL, VOX, RTL Crime, Passion [Sendenorm: MPEG-4] + T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH29: Das Erste, arte, Phoenix, EinsFestival +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 554000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH31: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 554000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH31: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 578000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH34: MDR-ST, rbb, NDR, WDR +-T 586000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH35: MDR-ST, rbb, NDR, WDR + T 610000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH38: MDR-ST, rbb, NDR, WDR + T 634000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH41: Das Erste, arte, Phoenix, EinsFestival +diff -r af23d23c278b util/scan/dvb-t/de-Schleswig-Holstein +--- a/util/scan/dvb-t/de-Schleswig-Holstein Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Schleswig-Holstein Tue Dec 21 12:13:28 2010 +0100 +@@ -1,18 +1,18 @@ + # DVB-T Schleswig-Holstein + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 474000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH21: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal +-T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR HH +-T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR HH +-T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: Pro7, Sat.1, Kabel1, N24 +-T 554000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH31: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 474000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH21: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 490000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH23: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal ++T 498000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH24: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR Fernsehen/NDR HH ++T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH26: Das Erste, arte, Phoenix, EinsExtra ++T 530000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH28: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR Fernsehen/NDR HH ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH30: ProSieben, Sat.1, Kabel1, N24 ++T 554000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH31: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 570000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH33: Das Erste, arte, Phoenix, EinsExtra +-T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: Pro7, Sat.1, Kabel1, N24 +-T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR/NDR HH +-T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: RTL, RTL II, Super RTL, VOX +-T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: RTL, RTL II, Super RTL, VOX ++T 586000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH35: ProSieben, Sat.1, Kabel1, N24 ++T 618000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH39: NDR SH, WDR/NDR NDS, MDR/NDR MVP, BR Fernsehen/NDR HH ++T 626000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH40: RTL, RTL 2, Super RTL, VOX ++T 666000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH45: RTL, RTL 2, Super RTL, VOX + T 682000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH47: Das Erste, arte, Phoenix, EinsExtra +-T 762000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH57: Neun live, Tele 5, Eurosport, MONA/DMAX +-T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: Neun live, Tele 5, Eurosport, MONA/DMAX +-T 786000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH60: Das Erste, arte, Phoenix, EinsExtra ++T 762000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH57: 9Live, Tele 5, Eurosport, Bibel.TV ++T 778000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH59: 9Live, Tele 5, Eurosport, Bibel.TV +diff -r af23d23c278b util/scan/dvb-t/de-Thueringen +--- a/util/scan/dvb-t/de-Thueringen Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/de-Thueringen Tue Dec 21 12:13:28 2010 +0100 +@@ -2,9 +2,9 @@ + # Created from http://www.ueberallfernsehen.de/data/senderliste.pdf + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + T 474000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH21: Das Erste, arte, Phoenix, EinsFestival +-T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 482000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH22: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH25: Das Erste, arte, Phoenix, EinsFestival +-T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH27: MDR-TH, rbb, hr, BR +-T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH48: MDR-TH, rbb, hr, BR +-T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: ZDF, 3sat, KiKa / ZDFdokukanal, ZDFinfokanal ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH27: MDR-TH, rbb, hr, Bayerisches Fernsehen ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH48: MDR-TH, rbb, hr, Bayerisches Fernsehen ++T 706000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE # CH50: ZDF, 3sat, KiKa / ZDFneo, ZDFinfokanal + T 730000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # CH53: Das Erste, arte, Phoenix, EinsFestival +diff -r af23d23c278b util/scan/dvb-t/dk-All +--- a/util/scan/dvb-t/dk-All Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/dk-All Tue Dec 21 12:13:28 2010 +0100 +@@ -2,16 +2,22 @@ + # Created from http://www.digi-tv.dk/Indhold_og_tilbud/frekvenser.asp + # and http://www.digi-tv.dk/Sendenettets_opbygning/ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 482000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 546000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 554000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 578000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 626000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 642000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 658000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 682000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 706000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 714000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 730000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 738000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE + T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +-T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/es-Albacete +--- a/util/scan/dvb-t/es-Albacete Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/es-Albacete Tue Dec 21 12:13:28 2010 +0100 +@@ -1,8 +1,14 @@ +-# Spain, Albacete ++# Spain, Albacete - Update 2010/08/12 (Freud) + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 59: La Primera, La 2, Canal 24H, Clan/TVE 50, RNE1, RNE Clásica, RNE 3 +-T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 63: CLMTV +-T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 66: Veo, Veo 2, Net TV, Teledeporte +-T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 67: Cuatro, CNN+, 40 Latino, La Sexta 1 +-T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 68: Telecinco, Telecinco Sport, Telecinco Estrellas, Fly Music +-T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 69: Antena 3, Antena Neox, Antena Nova, La Sexta 2 ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 37: La Regional, TCM, CRN ++T 674000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 46: Sogecuatro, laSexta2, laSexta3 (Todos pendientes de asignar) ++T 682000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 47: CNC, Vision6, ABTeVe, Punto Radio ++T 706000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 50: Boing, La 10, MTV, Punto Radio ++T 730000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 53: Nitro, Marca TV, Veo13 ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 56: TVE HD, Teledeporte, Pruebas TVE, RNE 1, RNE CLÁSICA, RNE 3 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 59: La 1, La 2, 24H, Clan, RNE1, RNE Clásica, RNE 3 ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 63: CMT, CMT2, RCM ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 66: Veo7, Tienda en Veo, Intereconomía, AXN, Teledeporte, Radio Intereconomía, Radio Marca, esRadio, Vaughan Radio ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 67: Cuatro, CNN+, 40 Latino, Canal+ Dos, Canal Club, LaSexta, SER, 40 Principales, Cadena Dial ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 68: Telecinco, La Siete, FDF, CincoShop, Disney Channel, Punto Radio ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 69: Antena 3, Neox, Nova, Gol Televisión, Onda Cero, Europa FM, Onda Melodía +diff -r af23d23c278b util/scan/dvb-t/es-Alfabia +--- a/util/scan/dvb-t/es-Alfabia Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/es-Alfabia Tue Dec 21 12:13:28 2010 +0100 +@@ -1,5 +1,8 @@ + # DVB-T Alfabia, Mallorca, Balearic Islands, Spain. + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # TV3 Cat, 3/24, 33, Super3/300 ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # TV Mallorca, Canal 4 ++T 634000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Popular TV, TEVEi + T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C.63: 24h, 50 aniv., ClanTV, La 2, TVE1; RNE 1, RNE 3, RNE C; Digitext, EPG, Lanzadera. + T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C.65: IB3, Aprenda Ingles TV + T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C.66: NetTV, Teledeporte, VeoTV1, VeoTV2. +diff -r af23d23c278b util/scan/dvb-t/es-BaixoMinho +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/es-BaixoMinho Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,16 @@ ++# file automatically generated by w_scan ++# (http://wirbel.htpc-forum.de/w_scan/index2.html) ++#! 20090528 1 0 OFDM ES ++#------------------------------------------------------------------------------ ++# location and provider: Baixo Minho, Pontevedra (Spain) ++# date (yyyy-mm-dd) : 2009-07-11 ++# provided by (opt) : neonmann@gmail.com ++# ++# T[2] [# comment] ++#------------------------------------------------------------------------------ ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # SFN ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # SFN ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # RAR Pontevedra ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # RGE GALICIA +diff -r af23d23c278b util/scan/dvb-t/es-Collserola +--- a/util/scan/dvb-t/es-Collserola Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/es-Collserola Tue Dec 21 12:13:28 2010 +0100 +@@ -1,10 +1,12 @@ + # DVB-T Collserola (Barcelona) + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c26: BTV +-T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c33: CityTV +-T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c61: TV3, K3/33, 3/24, 300 ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c26: BTV, TV Badalona, TV L'Hospitalet, TV del Besòs, COM Ràdio, Ràdio Ciutat Badalona, Ràdio L'Hospitalet ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c33: 8TV, Barça TV, EDC3, 105TV, RAC 1, RAC 105 ++T 650000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c43: TV3HD, 3/24, Canal 9, IB3, Catalunya Música, iCat FM ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c48: Urbe TV, Canal Català, 25 TV, Localia, Ona FM, Onda Rambla, Sensació Ràdio ++T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c61: TV3, 33, 3/24, K3/300, Catalunya Ràdio, Catalunya Informació + T 818000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c64: TVE1, TVE2, TVE 24H, Clan/TVE 50 Años, RNE1, RNEC, RNE3 +-T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c66: Veo TV, Veo2, Net TV, Teledeporte +-T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c67: Cuatro, CNN+, 40 Latino, La Sexta1 +-T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c68: Telecino, T5 Sport, T5 Estrellas, Fly Music +-T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c69: Antena 3, Antena.Neox, Antena.Nova, La Sexta2 ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c66: Veo7, Sony TV en Veo, Tienda en Veo, Intereconomía, Teledeporte, Radio Intereconomía, Radio Marca ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c67: Cuatro, CNN+, 40 Latino, La Sexta, Ser, 40 Principales, Cadena Dial ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c68: Telecino, La Siete, FDF, CincoShop, Disney Channel, Punto Radio ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE #c69: Antena 3, Antena.Neox, Antena.Nova, Hogar 10, Onda Cero, Europa FM, Onda Melodía +diff -r af23d23c278b util/scan/dvb-t/es-Granada +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/es-Granada Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Spain, Granada ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/es-Las_Palmas +--- a/util/scan/dvb-t/es-Las_Palmas Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/es-Las_Palmas Tue Dec 21 12:13:28 2010 +0100 +@@ -1,8 +1,18 @@ +-# Funciona correctamente en Las Palmas de Gran Canaria (24-4-2007) ++# Funciona correctamente en Las Palmas de Gran Canaria (25-09-2010) ++# ++# Revisada y corregida por el Grupo de Usuarios de Linux de Canarias ++# http://www.gulic.org ++# + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 530000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 28: TVE HD, Teledeporte, RNE Clásica, RNE 3 ++T 562000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 32: Boing, Telecinco HD, La 10, MTV, Punto Radio ++T 586000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 35: Sogecuatro, LaSexta2, LaSexta3 ++T 610000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 38: Nitro, Antena 3 HD, Marca TV, Veo13 ++T 658000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 44: Canal 7 Gran Canaria, TIC Canal 8, Canal 4, RTI ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 52: Localia, Nueve TV, Nueve Radio + T 786000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 60: TVE1, TVE2, 24H TVE, Clan/TVE, RNE, RNEC, RNE3, Lanzadera, EPG, Digitext, Meteo, Bolsa, Trafico, Empleat +-T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 65: TV C, TV C2 +-T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 66: Net TV, Teledeporte, Veo TV1, SETenVeo, Radio Intereconomía Lanzadera, EPG, Digitext, Meteo, Bolsa, Trafico, Empleat +-T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 67: CNN+, Cuatro, La Sexta 1, 40 Latino TV, EPG Soge V2 5 +-T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 68: Fly Music, Punto Radio, Tele 5, Tele 5 Estrellas, Tele 5 Sport +-T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 69: Antena 3, Antena.Neox, Antena.Nova, Telehit, Onda Cero, Europa FM, Onda Melodia, A3Lanzadera, A3Portal, EPGA3, A3Ticker ++T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 65: TV C, TV C2, Antena 3 Canarias, Popular TV, Canarias Radio, Cope, Cadena 100, Radio ECCA, Lanzadera, Ticker, Piloto TDT ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 66: Veo7, Tienda en Veo, AXN, Intereconomia, Teledeporte, Radio Intereconomia, Radio Marca, esRadio, Vaughan Radio, Canal Ingeniería, GUIDE Plus +, C66Gancho, C66Lanzadera, C66EPG, EpgNet ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 67: Cuatro, CNN+, Canal+ Dos, Canal Club, laSexta, SER, 40 Principales, Cadena Dial, Lanzadera, EPG TDT, Ticker, Lanzadera, Noticias, EPG ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 68: Telecinco, La Siete, FDF, CincoShop, Disney Channel, T5Lanzadera, T5Digitext, Noticias, Tiempo, Bolsa, Tráfico ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 69: Antena 3, Neox, Nova, Gol Televisión, Onda Cero, Europa FM, Onda Melodía, tvtv DIGITAL, A3Lanzadera, A3Portal, A3EPG, A3Ticker, T-seniority, Gol Bar +diff -r af23d23c278b util/scan/dvb-t/es-Pamplona +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/es-Pamplona Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,9 @@ ++# DVB-T Pamplona ++# T freq bw fec_hi fec_lo mod transm-mode guard-interval hierarchy ++T 610000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 802000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/es-SC_Tenerife +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/es-SC_Tenerife Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,18 @@ ++# Funciona correctamente en Santa Cruz de Tenerife (25-09-2010) ++# ++# Revisada y corregida por el Grupo de Usuarios de Linux de Canarias ++# http://www.gulic.org ++# ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 490000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C23 ++T 498000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C24 ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C26 ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C29 ++T 666000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C45 ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C56 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C59 ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C60 ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C66 ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C67 ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C68 ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C69 +diff -r af23d23c278b util/scan/dvb-t/es-Sevilla +--- a/util/scan/dvb-t/es-Sevilla Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/es-Sevilla Tue Dec 21 12:13:28 2010 +0100 +@@ -1,7 +1,22 @@ +-# DVB-T Sevilla (Andalucia) by x2 15 Agosto 2006 ++# DVB-T Sevilla (Spain) by x2 15-agos-2010, modificado 15-ago-2010 ++# thanks to http://www.tdt1.com ++# thanks to http://wirbel.htpc-forum.de/w_scan/index2.html + # T freq bw fec_hi fec_lo mod transm-mode guard-interval hierarchy ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C33 ++T 594000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C36 ++T 610000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C38 ++T 634000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C41 ++T 658000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C44 ++T 666000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C45 ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C49 ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C52 ++T 738000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C54 ++T 746000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C55 ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C56 + T 762000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C57 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C59 + T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C61 ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C63 + T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C66 + T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C67 + T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C68 +diff -r af23d23c278b util/scan/dvb-t/es-Vitoria-Gasteiz +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/es-Vitoria-Gasteiz Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Channel names in use at 2009/07/12, in Channel 66 [fffe] is a scrambled channel. ++# In the generated *channels.conf file could be necesary to change Intereconomía, Radio Intereconomía, ONDA MELODÍA to Intereconomia, Radio Intereconomia, ONDA MELODIA for Totem to work well. ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 58: ETB1, ETB2, ETB3, ETBSAT, Euskadi Irratia, Gaztea, EiTB Irratia, Radio Euskadi, Radio Vitoria ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 63: La 1, La 2, 24h, Clan, RNE1, RNEC, RNE3 ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 66: Teledeporte, Canal Ingenieria, VEO7, SONY TV en VEO, Tienda en VEO, GUIDE PLUS+, Intereconomía, Radio Intereconomía, [fffe], RADIO MARCA ++T 842000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 67: laSexta, CUATRO, CNN+, 40 LATINO, CANAL CLUB, SER, 40 PRINCIPALES, CADENA DIAL ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 68: Telecinco, FDF, LaSiete, Disney Channel, Cincoshop ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # Canal 69: ANTENA 3, ANTENA.NEOX, ANTENA.NOVA, ONDA CERO, EUROPA FM, ONDA MELODÍA, HOGAR 10 +diff -r af23d23c278b util/scan/dvb-t/fi-Smedsbole +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/fi-Smedsbole Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,13 @@ ++#------------------------------------------------------------------------------ ++# file automatically generated by w_scan ++# (http://wirbel.htpc-forum.de/w_scan/index2.html) ++#! 20090808 2 0 OFDM FI ++#------------------------------------------------------------------------------ ++# location and provider: Åland Smedsböle/Sund ++# date (yyyy-mm-dd) : 2009-12-23 ++# provided by (opt) : k.hampf@gmail.com ++# ++# T[2] [# comment] ++#------------------------------------------------------------------------------ ++T 506000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # Åland Network ++T 586000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # Åland Network +diff -r af23d23c278b util/scan/dvb-t/fr-Boulogne +--- a/util/scan/dvb-t/fr-Boulogne Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Boulogne Tue Dec 21 12:13:28 2010 +0100 +@@ -1,24 +1,21 @@ + # Boulogne - France (DVB-T transmitter of Boulogne ( MontLambert ) ) + # Boulogne - France (signal DVB-T transmis depuis l'émetteur de MontLambert ) + # +-# ATTENTION ! Ce fichier a ete construit automatiquement a partir +-# des frequences obtenues sur : http://www.tvnt.net/multiplex_frequences.htm +-# en Avril 2006. Si vous constatez des problemes et voulez apporter des ++# Si vous constatez des problemes et voulez apporter des + # modifications au fichier, envoyez le fichier modifie a +-# l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) +-# ou a l'auteur du fichier : +-# Nicolas Estre ++# l'adresse linux-media@vger.kernel.org (depot des fichiers d'init dvb) + # + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + #### Boulogne - MontLambert #### ++# (Boulogne sur mer) + #R1 ++T 530000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R2 + T 586000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R2 +-T 626000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R3 +-T 666000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 634000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R4 +-T 690000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 658000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R5 + T 698000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R6 +diff -r af23d23c278b util/scan/dvb-t/fr-Brest +--- a/util/scan/dvb-t/fr-Brest Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Brest Tue Dec 21 12:13:28 2010 +0100 +@@ -2,8 +2,8 @@ + # Emetteur du Roch Tredudon + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + T 546000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +-T 482000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +-T 506000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +-T 490000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +-T 530000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +-T 514000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE ++T 578000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE ++T 586000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE ++T 618000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE ++T 650000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE ++T 770000000 8MHz 1/2 NONE QAM16 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Chambery +--- a/util/scan/dvb-t/fr-Chambery Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Chambery Tue Dec 21 12:13:28 2010 +0100 +@@ -1,30 +1,24 @@ +-# Chambéry - France (DVB-T transmitter of Chambéry ( Nondéfini ) ) +-# Chambéry - France (signal DVB-T transmis depuis l'émetteur de Nondéfini ) ++# Chambery - France (DVB-T transmitter of Chambery ) ++# Chambery - France (signal DVB-T transmis depuis l'emetteur de Chambery ) + # +-# ATTENTION ! Ce fichier a ete construit automatiquement a partir +-# des frequences obtenues sur : http://www.tvnt.net/multiplex_frequences.htm +-# en Avril 2006. Si vous constatez des problemes et voulez apporter des ++# Ce fichier a ete ecrit par Yann Soubeyrand (04/2010) ++# Si vous constatez des problemes et voulez apporter des + # modifications au fichier, envoyez le fichier modifie a + # l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) +-# ou a l'auteur du fichier : ++# ou au mainteneur du fichier : + # Nicolas Estre + # + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-#### Chambéry - Nondéfini #### +-#R1 +-#T FREQ1 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R2 +-#T FREQ2 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R3 +-#T FREQ3 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R4 +-#T FREQ4 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R5 +-#T FREQ5 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R6 +-#T FREQ6 8MHz AUTO NONE QAM64 8k AUTO NONE +-############################################################## +-# en Avril 2006, l'emetteur pour Chambéry n'etait pas defini +-# Vous devez donc modifier les frequences manuellement. +-# SVP Renvoyez le fichier mis a jour aux contacts ci-dessus. +-############################################################## ++#### Chambery - Defini par Alex le 23/05/2008 pour l'emetteur des monts ++# R1 canal 62 ++T 802167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# R2 canal 48 ++T 690167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# R3 canal 51 ++T 714167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# R4 canal 54 ++T 738167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# R5 canal 59 ++T 778167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# R6 canal 47 ++T 682167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Laval +--- a/util/scan/dvb-t/fr-Laval Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Laval Tue Dec 21 12:13:28 2010 +0100 +@@ -12,14 +12,14 @@ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + #### Laval - MontRochard #### + #R1 +-T 778000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + #R2 +-T 610000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + #R3 +-T 754000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + #R4 +-T 794000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + #R5 +-T 602000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 650000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + #R6 +-T 802000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Lille +--- a/util/scan/dvb-t/fr-Lille Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,30 +0,0 @@ +-# Lille - France (DVB-T transmitter of Lille ( Nondéfini ) ) +-# Lille - France (signal DVB-T transmis depuis l'émetteur de Nondéfini ) +-# +-# ATTENTION ! Ce fichier a ete construit automatiquement a partir +-# des frequences obtenues sur : http://www.tvnt.net/multiplex_frequences.htm +-# en Avril 2006. Si vous constatez des problemes et voulez apporter des +-# modifications au fichier, envoyez le fichier modifie a +-# l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) +-# ou a l'auteur du fichier : +-# Nicolas Estre +-# +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-#### Lille - Nondéfini #### +-#R1 +-#T FREQ1 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R2 +-#T FREQ2 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R3 +-#T FREQ3 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R4 +-#T FREQ4 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R5 +-#T FREQ5 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R6 +-#T FREQ6 8MHz AUTO NONE QAM64 8k AUTO NONE +-############################################################## +-# en Avril 2006, l'emetteur pour Lille n'etait pas defini +-# Vous devez donc modifier les frequences manuellement. +-# SVP Renvoyez le fichier mis a jour aux contacts ci-dessus. +-############################################################## +diff -r af23d23c278b util/scan/dvb-t/fr-Lille-Bouvigny +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/fr-Lille-Bouvigny Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,26 @@ ++# Lille - France (DVB-T transmitter of Lille ( Bouvigny ) ) ++# Lille - France (signal DVB-T transmis depuis l'emetteur de Bouvigny ) ++# ++# Fichier construit par Romain Bajeux (05/2010) ++# Si vous constatez des problemes et voulez apporter des ++# modifications au fichier, envoyez le fichier modifie a ++# l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) ++# ou au mainteneur du fichier : ++# Nicolas Estre ++# ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++#### Lille - Bouvigny #### ++#R1 ++T 490167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R2 ++T 690167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R3 ++T 514167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R4 ++T 546167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R5 ++T 554167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R6 ++T 586167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#Belge ++T 754167000 8MHz AUTO NONE QAM64 8k AUTO NONE +diff -r af23d23c278b util/scan/dvb-t/fr-LilleT2 +--- a/util/scan/dvb-t/fr-LilleT2 Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,13 +0,0 @@ +-# Lille - France (DVB-T transmitter of Lambersart) +-#offset of 167000 for Cinergy T2. Other type of card users need to replace 167 by 000 +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-#R2 +-T 538167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-#R4 +-T 546167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-#R3 +-T 562167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-#R6 +-T 586167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-#R1 +-T 594167000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Montbeliard +--- a/util/scan/dvb-t/fr-Montbeliard Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Montbeliard Tue Dec 21 12:13:28 2010 +0100 +@@ -1,18 +1,18 @@ +-# Montbéliard - France (DVB-T transmitter of Montbéliard "Fort Lachaux" ) +-# Montbéliard - France (signal DVB-T transmis depuis l'émetteur de Fort Lachaux ) ++# Montbéliard - France (DVB-T transmitter of Montbéliard "Fort Lachaux", since 16 nov. 2010) ++# Montbéliard - France (signal DVB-T transmis depuis l'émetteur de Fort Lachaux, à compter du 16/11/2010) + # + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-# multiplex R1 (GR1), canal 29V + offset 167000 : FRANCE 2 SD , FRANCE 5 , ARTE SD , La Chaîne Parlementaire/Public Sénat , FRANCE 3 , FRANCE 3 Franche-Comté ++# multiplex R4 (MULTI4), canal 58V + offset 167000 : ARTE HD , PARIS PREMIERE, M6 SD , W9 et NT1 ++T 490167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++# multiplex R6 (SMR6), canal 26V + offset 167000 : TF1 SD , NRJ 12 , EUROSPORT, LCI, TMC et TF6 ++T 514167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++# multiplex R5 (MR5), canal 29 : TF1 HD , France 2 HD et M6HD + T 538167000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# multiplex R3 (CNH), canal 43V + offset 167000 : CANAL+ , CANAL+HD , CANAL+ CINEMA , CANAL+ SPORT , PLANETE , CANAL J et TPS STAR +-T 650167000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# multiplex R2 (NTN), canal 55V + offset 167000 : DIRECT 8 , BFM TV , I>TELE , FRANCE 4 , VIRGIN 17 , GULLI et France 4 +-T 746167000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# multiplex R6 (SMR6), canal 32V + offset 167000 : TF1 SD , NRJ 12 , TMC , EUROSPORT , LCI et TF6 +-T 562167000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# Télévision Suisse, canal 56V + offset 000000 : TSR1 , TSR2 , TSI1 et SF 1 ++# multiplex R2 (NTN), canal 55V + offset 167000 : Direct 8 , BFM TV , i>TELE , DirectStar , Gulli et France 4 ++T 658167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++# multiplex R3 (CNH), canal 54V + offset 167000 : CANAL+ , CANAL+ CINEMA , CANAL+ SPORT , PLANETE et TPS STAR ++T 738167000 8MHz AUTO NONE QAM64 8k AUTO NONE ++# Télévision Suisse, canal 56V + offset 000000 : SF1, TSR1 , TSR2 et RSI LA 1 + T 754000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# multiplex R4 (MULTI4), canal 58V + offset 167000 : ARTE HD , PARIS PREMIERE, M6 SD , W9 , NT1 +-T 770167000 8MHz AUTO NONE QAM64 8k AUTO NONE +-# multiplex R5 (???), canal ??? : TF1 HD , FRANCE 2 HD, M6 HD +-# canal d'émission pas encore défini (février 2009) ++# multiplex R1 (GR1), canal 60V + offset 167000 : France 2 SD , France 5 , France Ô , LCP et France 3 ++T 786167000 8MHz AUTO NONE QAM64 8k AUTO NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Nantes +--- a/util/scan/dvb-t/fr-Nantes Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Nantes Tue Dec 21 12:13:28 2010 +0100 +@@ -1,8 +1,9 @@ + # Nantes - France + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 498000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 506000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 522000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 530000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 658000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 802000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 682000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 490000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 546000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 738000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 658000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 538000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 754000000 8MHz AUTO NONE QAM16 8k AUTO NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Poitiers +--- a/util/scan/dvb-t/fr-Poitiers Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Poitiers Tue Dec 21 12:13:28 2010 +0100 +@@ -12,14 +12,12 @@ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + #### Poitiers - Agglomération #### + #R1 +-T 706000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 506000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R2 +-T 778000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 546000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R3 +-T 802000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 722000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R4 +-T 730000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R5 ++T 738000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++#R6 (no R5) + T 754000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R6 +-T 794000000 8MHz AUTO NONE QAM64 8k AUTO NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Reims +--- a/util/scan/dvb-t/fr-Reims Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Reims Tue Dec 21 12:13:28 2010 +0100 +@@ -1,25 +1,21 @@ + # Reims - France (DVB-T transmitter of Reims ( Hautvillers ) ) + # Reims - France (signal DVB-T transmis depuis l'émetteur de Hautvillers ) + # +-# ATTENTION ! Ce fichier a ete construit automatiquement a partir +-# des frequences obtenues sur : http://www.tvnt.net/multiplex_frequences.htm +-# en Avril 2006. Si vous constatez des problemes et voulez apporter des ++# Si vous constatez des problemes et voulez apporter des + # modifications au fichier, envoyez le fichier modifie a + # l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) +-# ou a l'auteur du fichier : +-# Nicolas Estre + # + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + #### Reims - Hautvillers #### + #R1 +-T 562000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 626000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R2 +-T 554000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 650000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R3 +-T 602000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 666000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R4 +-T 578000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 674000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R5 +-T 666000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 730000000 8MHz AUTO NONE QAM64 8k AUTO NONE + #R6 +-T 642000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 754000000 8MHz AUTO NONE QAM64 8k AUTO NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Rochefort-sur-mer +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/fr-Rochefort-sur-mer Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,14 @@ ++# TNT à Rochefort (17) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++#multiplex 6 ( TF1 LCI Eurosport TF6 NRJ12 TMC ) ++T 498166000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++ ++#multiplex 4 ( M6 W9 NT1 Paris Première ARTE HD ) ++T 738166000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++ ++#multiplex 1 ( France 2 France 3 France 5 ARTE LCP Chaîne locale ou France Ô ) ++T 602166000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++ ++#multiplex 2 ( Direct 8 France 4 BFM TV Virgin 17 Gulli i>Télé ) ++T 778167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/fr-Tours +--- a/util/scan/dvb-t/fr-Tours Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/fr-Tours Tue Dec 21 12:13:28 2010 +0100 +@@ -1,25 +1,11 @@ +-# Tours - France (DVB-T transmitter of Tours ( Chissay ) ) +-# Tours - France (signal DVB-T transmis depuis l'émetteur de Chissay ) +-# +-# ATTENTION ! Ce fichier a ete construit automatiquement a partir +-# des frequences obtenues sur : http://www.tvnt.net/multiplex_frequences.htm +-# en Avril 2006. Si vous constatez des problemes et voulez apporter des +-# modifications au fichier, envoyez le fichier modifie a +-# l'adresse linux-dvb@linuxtv.org (depot des fichiers d'init dvb) +-# ou a l'auteur du fichier : +-# Nicolas Estre ++# Tours (Chissay) - France ++# Initial DVB-T tuning as of 19 october 2010 + # + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-#### Tours - Chissay #### +-#R1 +-T 578000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R2 +-T 610000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R3 +-T 810000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R4 +-T 690000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R5 +-T 602000000 8MHz AUTO NONE QAM64 8k AUTO NONE +-#R6 +-T 714000000 8MHz AUTO NONE QAM64 8k AUTO NONE ++T 498000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++T 578000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++T 602000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++T 610000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++T 690000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++T 714000000 8MHz AUTO NONE AUTO AUTO AUTO NONE ++ +diff -r af23d23c278b util/scan/dvb-t/gr-Athens +--- a/util/scan/dvb-t/gr-Athens Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/gr-Athens Tue Dec 21 12:13:28 2010 +0100 +@@ -1,3 +1,5 @@ + # Initial scan config for Digital DVB-T (Ert) in Athens Greece + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 674000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE # Digea DVB-T ++T 682000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE # Digea DVB-T + T 690000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hr-All +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hr-All Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,30 @@ ++# Croatia, whole country ++# Created from http://www.oiv.hr/broadcasting/tables/dtv_hr.aspx ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 474000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D1 MUXD ++T 490000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D2 MUXA ++T 506000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D4 MUXA ++T 530000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D5 MUXA, D9 MUXD ++T 538000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D5 MUXD ++T 546000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D6 MUXA ++T 554000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D7 MUXD ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # D1 MUXC ++T 570000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D8 MUXA ++T 578000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D8 MUXD ++T 594000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # D5 MUXC ++T 594000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D3 MUXD ++T 610000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D1 MUXA ++T 618000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D2 MUXB ++T 642000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D4 MUXD ++T 658000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D1 MUXB, D3 MUXA ++T 666000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # SLO MUXA ++T 674000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # D8 MUXC ++T 674000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D8 MUXD ++T 690000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D3 MUXB, D4 MUXB ++T 714000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D7 MUXA, D9 MUXA ++T 730000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D5 MUXB, D8 MUXB ++T 738000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D6 MUXB ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # D4 MUXC ++T 762000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # Tusti Vrh MUXD ++T 770000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D2 MUXD ++T 778000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE # D7 MUXB, D9 MUXB +diff -r af23d23c278b util/scan/dvb-t/hr-Zagreb +--- a/util/scan/dvb-t/hr-Zagreb Sat Jun 20 16:47:55 2009 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,3 +0,0 @@ +-# DVB-T Hamburg +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 522000000 8MHz 3/4 NONE AUTO 8k 1/32 NONE # CH27: +diff -r af23d23c278b util/scan/dvb-t/hu-Budapest +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Budapest Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Budapest ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-55: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 746000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-62: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 802000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Debrecen +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Debrecen Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Debrecen ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-46: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 714000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-62: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 802000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Gyor +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Gyor Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Gyor ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-42: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 642000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-61: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 794000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Kabhegy +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Kabhegy Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Kabhegy ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# C.multiplex UHF-61: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 794000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# A2.multiplex UHF-64: ++# MTV-1 HD Sopron, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 818000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Kekes +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Kekes Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Kekes ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-44: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 658000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-69: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 858000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Kiskoros +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Kiskoros Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Kiskoros ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-45: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 666000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-68: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 850000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Nagykanizsa-Ujudvar +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Nagykanizsa-Ujudvar Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Nagykanizsa / Ujudvar ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-24: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 498000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-65: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 826000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Pecs +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Pecs Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Pecs ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-52: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 722000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-67: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 842000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Szeged +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Szeged Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Szeged ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-60: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 786000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-65: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 826000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Szentes +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Szentes Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Szentes ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A3.multiplex UHF-60: ++# MTV-1 HD Szeged, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 786000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-65: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 826000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Tokaj +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Tokaj Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Tokaj ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-68: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 850000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-63: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 810000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Uzd +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Uzd Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Uzd ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-52: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 722000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-67: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 842000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/hu-Vasvar-Hegyhatsal +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/hu-Vasvar-Hegyhatsal Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,8 @@ ++# Hungary / Vasvar / Hegyhatsal ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# A1.multiplex UHF-58: ++# MTV-1 HD Budapest, MTV-2 HD, ATV (Hungary), Hir TV, MR-1 Kossuth R, MR-2 Petofi R, MR-3 Bartok R, Katolikus R ++T 770000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE ++# C.multiplex UHF-68: ++# Duna TV HD, Duna-II. Autonomia, RTL Klub, TV-2 (Hungary), Euronews ++T 850000000 8MHz 3/4 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/il-All +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/il-All Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5 @@ ++# Israel, Israel Broadcasting Authority's transmitters ++# Generated from list in http://www.iba.org.il/reception/ ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 514000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE ++T 538000000 8MHz 2/3 NONE QAM16 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/ir-Tehran +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/ir-Tehran Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,4 @@ ++# DVB-T Tehran ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # IRIB-TV1/2/3/4/5, IRINN, AMOUZESH, QURAN-TV ++T 650000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE # PRESS TV, AL-ALAM, AL-KOUSAR, JAAMEJAM 1, IRIB MOSTANAD, IRIB OSTANI +diff -r af23d23c278b util/scan/dvb-t/is-Reykjavik +--- a/util/scan/dvb-t/is-Reykjavik Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/is-Reykjavik Tue Dec 21 12:13:28 2010 +0100 +@@ -1,13 +1,29 @@ +-# Initial scan config for Digital Ísland in Iceland +-# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 682000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 690000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 698000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 706000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 714000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 738000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 754000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 762000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 778000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 794000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +-T 818000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++#------------------------------------------------------------------------------ ++# file automatically generated by w_scan ++# (http://wirbel.htpc-forum.de/w_scan/index2.html) ++#! 20100316 1 0 OFDM IS ++#------------------------------------------------------------------------------ ++# location and provider: ++# date (yyyy-mm-dd) : 2010-10-22 ++# provided by (opt) : ++# ++# T[2] [# comment] ++#------------------------------------------------------------------------------ ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE ++T 530000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE # Vodafone ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE ++T 674000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 770000000 8MHz 1/2 NONE QAM64 2k 1/32 NONE # Vodafone ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 738000000 8MHz 1/2 NONE QPSK 2k 1/32 NONE # Vodafone ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 818000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 682000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 706000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 794000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone ++T 802000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # Vodafone +diff -r af23d23c278b util/scan/dvb-t/it-Milano +--- a/util/scan/dvb-t/it-Milano Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/it-Milano Tue Dec 21 12:13:28 2010 +0100 +@@ -1,15 +1,49 @@ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + # MUX-A RAI +-T 818000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 800000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 490000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX-B RAI + T 482000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX-A MEDIASET + T 842000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX-A MEDIASET-2 + T 618000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MEDIASET LA 5 ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX La7/MTV +-T 506000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 802000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX DFREE + T 706000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + # MUX DFREE 2 + T 538000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX RETE A ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX STUDIO1 ++T 184500000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX STUDIO NORD ++T 191500000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX VIDEO STAR NOVARA ++T 219500000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX TELENOVA ++T 474000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX TELE 7 LAGHI ++T 495250000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX VIDEO BERGAMO ++T 594000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# MUX TELE MILANO ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# RETE 55 ++T 682000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# TELE LIBERTA' ++T 735250000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# RSI ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# TELE COLOR PRIMARETE ++T 783250000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# TELESTAR ++T 807250000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 810000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++# TELECAMPIONE ++T 847250000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/it-Montevergine +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/it-Montevergine Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,18 @@ ++# DVB-T Montevergine (Avellino) 83100 ++# 12/12/2009 by Antonio Galasso anto1714@libero.it ++# (ricordati di mettere il lettore in posizione stop orima di iniziare la scansione dei canali) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++# C-MUX ++T 177500000 7MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 482000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 498000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 530000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 546000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 554000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 594000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 642000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 682000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/lt-All +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/lt-All Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,39 @@ ++# Lithuania, whole country ++# Created from http://www.skaitmenine.lt/lt/skaitmenine_tv_lietuvoje/antzemine_dvb_t.html ++# Created by baruse@gmail.com ++ ++# LRTC I tinklas ++T 482000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 22 ++T 514000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 26 ++T 618000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 39 ++T 658000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 44 ++T 682000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 47 ++T 762000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 57 ++T 770000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 58 ++T 786000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 60 ++T 794000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 61 ++ ++# LRTC II tinklas ++T 570000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 33 ++T 610000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 38 ++T 690000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 48 ++T 738000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 54 ++T 802000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 62 ++T 810000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 63 ++T 818000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 64 ++ ++# TEO LT I tinklas ++T 594000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 36 ++T 706000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 50 ++T 778000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 59 ++T 826000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 65 ++ ++# TEO LT II tinklas ++T 474000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 21 ++T 546000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 30 ++T 730000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 53 ++#T 786000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 60 ++ ++# Vilniui bonusas ++T 602000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 37 ++#T 730000000 8MHz AUTO NONE QAM64 8k 1/16 NONE # kanalas 53 +diff -r af23d23c278b util/scan/dvb-t/ro-Bucharest +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/ro-Bucharest Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5 @@ ++# Romania / Bucharest ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 546000000 8MHz 2/3 NONE QAM16 8k 1/16 NONE ++T 738000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE # SRTV ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE # SNR DVB-T +diff -r af23d23c278b util/scan/dvb-t/se-Horby_Sallerup +--- a/util/scan/dvb-t/se-Horby_Sallerup Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/se-Horby_Sallerup Tue Dec 21 12:13:28 2010 +0100 +@@ -2,6 +2,8 @@ + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + T 482000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE + T 506000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE ++T 570000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE + T 634000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE ++T 650000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE + T 818000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE + T 794000000 8MHz 3/4 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/se-Ornskoldsvik_As +--- a/util/scan/dvb-t/se-Ornskoldsvik_As Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/se-Ornskoldsvik_As Tue Dec 21 12:13:28 2010 +0100 +@@ -4,3 +4,4 @@ + T 474000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE + T 578000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE + T 506000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 642000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/se-Skelleftea +--- a/util/scan/dvb-t/se-Skelleftea Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/se-Skelleftea Tue Dec 21 12:13:28 2010 +0100 +@@ -4,3 +4,4 @@ + T 514000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE + T 778000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE + T 650000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++T 698000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/si-Ljubljana +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/si-Ljubljana Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5 @@ ++# Slovenia / Ljubljana ++# MULTIPLEX A ++#------------------------------------------ ++T 602000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-BanskaBystrica +--- a/util/scan/dvb-t/sk-BanskaBystrica Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/sk-BanskaBystrica Tue Dec 21 12:13:28 2010 +0100 +@@ -1,4 +1,11 @@ + # DVB-T Banska Bystrica (Banska Bystrica, Slovak Republic) + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + +-T 778000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++# 1.st multiplex - on channel 65 ++T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 51 ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 33 ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Bardejov +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Bardejov Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Bardejov (Bardejov, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 62 ++T 802000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 40 ++T 626000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 54 ++T 738000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Bratislava +--- a/util/scan/dvb-t/sk-Bratislava Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/sk-Bratislava Tue Dec 21 12:13:28 2010 +0100 +@@ -1,4 +1,11 @@ + # DVB-T Bratislava (Bratislava, Slovak Republic) + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + +-T 834000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++# 1.st multiplex - on channel 66 ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 56 ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 27 ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Kosice +--- a/util/scan/dvb-t/sk-Kosice Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/sk-Kosice Tue Dec 21 12:13:28 2010 +0100 +@@ -1,4 +1,11 @@ + # DVB-T Kosice (Kosice, Slovak Republic) + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy + +-T 658000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE ++# 1.st multiplex - on channel 64 ++T 818000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 59 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 25 ++T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Michalovce +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Michalovce Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Michalovce (Michalovce, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 64 ++T 818000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 59 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 25 ++T 506000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Namestovo +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Namestovo Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Namestovo (Namestovo, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 68 ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 59 ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 26 ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Poprad +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Poprad Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Poprad (Poprad, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 66 ++T 834000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 55 ++T 746000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 24 ++T 498000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-RimavskaSobota +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-RimavskaSobota Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Rimavska Sobota (Rimavska Sobota, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 61 ++T 794000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 27 ++T 522000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 54 ++T 738000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Trencin +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Trencin Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,12 @@ ++# DVB-T Trencin (Trencin, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 69 ++T 858000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 52/56 ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++T 754000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 57 ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-VelkyKrtis +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-VelkyKrtis Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Velky Krtis (Velky Krtis, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 65 ++T 826000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 60 ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 33 ++T 570000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/sk-Zilina +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/sk-Zilina Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,11 @@ ++# DVB-T Zilina (Zilina, Slovak Republic) ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++ ++# 1.st multiplex - on channel 68 ++T 850000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 2.st multiplex (commercial) - on channel 52 ++T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE ++ ++# 3.st multiplex (public) - on channel 32 ++T 562000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE +diff -r af23d23c278b util/scan/dvb-t/uk-Aberdare +--- a/util/scan/dvb-t/uk-Aberdare Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/uk-Aberdare Tue Dec 21 12:13:28 2010 +0100 +@@ -2,9 +2,14 @@ + # Auto-generated from http://www.dtg.org.uk/retailer/dtt_channels.html + # and http://www.ofcom.org.uk/static/reception_advice/index.asp.html + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 530167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 562167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 489833000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 513833000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 538167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 570167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++ ++T 474167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++T 482167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++T 497833000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++T 506167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++T 521833000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++T 530167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE ++ ++ ++#C21+ C22+ C24- C25+ C27- C28+ ++ +diff -r af23d23c278b util/scan/dvb-t/uk-Redruth +--- a/util/scan/dvb-t/uk-Redruth Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/uk-Redruth Tue Dec 21 12:13:28 2010 +0100 +@@ -2,9 +2,12 @@ + # Auto-generated from http://www.dtg.org.uk/retailer/dtt_channels.html + # and http://www.ofcom.org.uk/static/reception_advice/index.asp.html + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 618000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 642167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 666167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 697833000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++T 474167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 497833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 506167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 521833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 634167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE + T 650167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 705833000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++T 658167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 690000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 714000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/uk-StocklandHill +--- a/util/scan/dvb-t/uk-StocklandHill Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/uk-StocklandHill Tue Dec 21 12:13:28 2010 +0100 +@@ -1,10 +1,9 @@ + # UK, Stockland Hill +-# Auto-generated from http://www.dtg.org.uk/retailer/dtt_channels.html +-# and http://www.ofcom.org.uk/static/reception_advice/index.asp.html ++# http://www.ukfree.tv/txdetail.php?a=ST222014 + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 481833000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 529833000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 505833000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 561833000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 546167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 578167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++T 514167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # PSB1 ++T 490167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # PSB2 ++#T 538167000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # PSB3 (DVB-T2) ++T 505833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # COM4 ++T 481833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # COM5 ++T 529833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE # COM6 +diff -r af23d23c278b util/scan/dvb-t/uk-Storeton +--- a/util/scan/dvb-t/uk-Storeton Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/uk-Storeton Tue Dec 21 12:13:28 2010 +0100 +@@ -2,9 +2,12 @@ + # Auto-generated from http://www.dtg.org.uk/retailer/dtt_channels.html + # and http://www.ofcom.org.uk/static/reception_advice/index.asp.html + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 546167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 578167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 490167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 514167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 538167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 570167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++T 490000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 506000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 514000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 530000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 538000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 546000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 730000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 762000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 786000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/uk-WinterHill +--- a/util/scan/dvb-t/uk-WinterHill Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/dvb-t/uk-WinterHill Tue Dec 21 12:13:28 2010 +0100 +@@ -1,13 +1,9 @@ + # UK, Winter Hill +-# Auto-generated from http://www.dtg.org.uk/retailer/dtt_channels.html +-# and http://www.ofcom.org.uk/static/reception_advice/index.asp.html ++# Populated by J. Hornsby from a scan of active multiplexes ++# UK, Winter Hill B Ceased broadcasting on 02 December 2009 + # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy +-T 754167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 834167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 850167000 8MHz 2/3 NONE QAM64 2k 1/32 NONE +-T 842167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 786167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 810167000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-# UK, Winter Hill B +-T 650000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE +-T 626000000 8MHz 3/4 NONE QAM16 2k 1/32 NONE ++T 746000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 770000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 778000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 794000000 8MHz 2/3 NONE QAM64 8k 1/32 NONE ++T 801833000 8MHz 2/3 NONE QAM64 8k 1/32 NONE +diff -r af23d23c278b util/scan/dvb-t/vn-Thaibinh +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/scan/dvb-t/vn-Thaibinh Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,5 @@ ++# Thaibinh - Vietnam - DVB-T by VTC ++# contributed by Pham Thanh Nam ++# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy ++T 626000000 8MHz 3/4 NONE QAM64 2k 1/32 NONE ++T 634000000 8MHz 3/4 NONE QAM64 2k 1/32 NONE +diff -r af23d23c278b util/scan/scan.c +--- a/util/scan/scan.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/scan/scan.c Tue Dec 21 12:13:28 2010 +0100 +@@ -236,6 +236,17 @@ + + static void copy_transponder(struct transponder *d, struct transponder *s) + { ++ struct list_head *pos; ++ struct service *service; ++ ++ if (d->transport_stream_id != s->transport_stream_id) { ++ /* propagate change to any already allocated services */ ++ list_for_each(pos, &d->services) { ++ service = list_entry(pos, struct service, list); ++ service->transport_stream_id = s->transport_stream_id; ++ } ++ } ++ + d->network_id = s->network_id; + d->original_network_id = s->original_network_id; + d->transport_stream_id = s->transport_stream_id; +diff -r af23d23c278b util/szap/Makefile +--- a/util/szap/Makefile Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/szap/Makefile Tue Dec 21 12:13:28 2010 +0100 +@@ -1,6 +1,6 @@ + # Makefile for linuxtv.org dvb-apps/util/szap + +-objects = lnb.o ++objects = lnb.o util.o + + binaries = azap \ + czap \ +diff -r af23d23c278b util/szap/azap.c +--- a/util/szap/azap.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/szap/azap.c Tue Dec 21 12:13:28 2010 +0100 +@@ -13,6 +13,8 @@ + #include + #include + ++#include "util.h" ++ + static char FRONTEND_DEV [80]; + static char DEMUX_DEV [80]; + +@@ -209,31 +211,6 @@ + + + static +-int set_pesfilter (int fd, int pid, dmx_pes_type_t type, int dvr) +-{ +- struct dmx_pes_filter_params pesfilter; +- +- if (pid <= 0 || pid >= 0x1fff) +- return 0; +- +- pesfilter.pid = pid; +- pesfilter.input = DMX_IN_FRONTEND; +- pesfilter.output = dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER; +- pesfilter.pes_type = type; +- pesfilter.flags = DMX_IMMEDIATE_START; +- +- if (ioctl(fd, DMX_SET_PES_FILTER, &pesfilter) < 0) { +- PERROR ("ioctl(DMX_SET_PES_FILTER) for %s PID failed", +- type == DMX_PES_AUDIO ? "Audio" : +- type == DMX_PES_VIDEO ? "Video" : "??"); +- return -1; +- } +- +- return 0; +-} +- +- +-static + int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) + { + struct dvb_frontend_info fe_info; +diff -r af23d23c278b util/szap/czap.c +--- a/util/szap/czap.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/szap/czap.c Tue Dec 21 12:13:28 2010 +0100 +@@ -13,6 +13,8 @@ + #include + #include + ++#include "util.h" ++ + + static char FRONTEND_DEV [80]; + static char DEMUX_DEV [80]; +@@ -118,7 +120,7 @@ + + + int parse(const char *fname, int list_channels, int chan_no, const char *channel, +- struct dvb_frontend_parameters *frontend, int *vpid, int *apid) ++ struct dvb_frontend_parameters *frontend, int *vpid, int *apid, int *sid) + { + FILE *f; + char *chan; +@@ -141,10 +143,10 @@ + } + printf("%3d %s", chan_no, chan); + +- if ((sscanf(chan, "%a[^:]:%d:%a[^:]:%d:%a[^:]:%a[^:]:%d:%d\n", ++ if ((sscanf(chan, "%m[^:]:%d:%m[^:]:%d:%m[^:]:%m[^:]:%d:%d:%d\n", + &name, &frontend->frequency, + &inv, &frontend->u.qam.symbol_rate, +- &fec, &mod, vpid, apid) != 8) ++ &fec, &mod, vpid, apid, sid) != 9) + || !name || !inv || !fec | !mod) { + ERROR("cannot parse service data"); + return -3; +@@ -165,10 +167,10 @@ + ERROR("modulation field syntax '%s'", mod); + return -6; + } +- printf("%3d %s: f %d, s %d, i %d, fec %d, qam %d, v %#x, a %#x\n", ++ printf("%3d %s: f %d, s %d, i %d, fec %d, qam %d, v %#x, a %#x, s %#x \n", + chan_no, name, frontend->frequency, frontend->u.qam.symbol_rate, + frontend->inversion, frontend->u.qam.fec_inner, +- frontend->u.qam.modulation, *vpid, *apid); ++ frontend->u.qam.modulation, *vpid, *apid, *sid); + free(name); + free(inv); + free(fec); +@@ -178,31 +180,6 @@ + } + + +- +-static +-int set_pesfilter (int fd, int pid, dmx_pes_type_t type, int dvr) +-{ +- struct dmx_pes_filter_params pesfilter; +- +- if (pid <= 0 || pid >= 0x1fff) +- return 0; +- +- pesfilter.pid = pid; +- pesfilter.input = DMX_IN_FRONTEND; +- pesfilter.output = dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER; +- pesfilter.pes_type = type; +- pesfilter.flags = DMX_IMMEDIATE_START; +- +- if (ioctl(fd, DMX_SET_PES_FILTER, &pesfilter) < 0) { +- PERROR ("ioctl(DMX_SET_PES_FILTER) for %s PID failed", +- type == DMX_PES_AUDIO ? "Audio" : +- type == DMX_PES_VIDEO ? "Video" : "??"); +- return -1; +- } +- +- return 0; +-} +- + static + int setup_frontend(int fe_fd, struct dvb_frontend_parameters *frontend) + { +@@ -264,9 +241,20 @@ + } + + +-static const char *usage = "\nusage: %s [-a adapter_num] [-f frontend_id] [-d demux_id] [-c conf_file] [ -H ] {| -n channel_num} [-x]\n" +- " or: %s [-c conf_file] -l\n\n"; +- ++static const char *usage = ++ "\nusage: %s [options] -l\n" ++ " list known channels\n" ++ " %s [options] {-n channel-number|channel_name}\n" ++ " zap to channel via number or full name (case insensitive)\n" ++ " -a number : use given adapter (default 0)\n" ++ " -f number : use given frontend (default 0)\n" ++ " -d number : use given demux (default 0)\n" ++ " -c file : read channels list from 'file'\n" ++ " -x : exit after tuning\n" ++ " -H : human readable output\n" ++ " -r : set up /dev/dvb/adapterX/dvr0 for TS recording\n" ++ " -p : add pat and pmt to TS recording (implies -r)\n" ++; + + int main(int argc, char **argv) + { +@@ -275,12 +263,12 @@ + char *confname = NULL; + char *channel = NULL; + int adapter = 0, frontend = 0, demux = 0, dvr = 0; +- int vpid, apid; +- int frontend_fd, video_fd, audio_fd; ++ int vpid, apid, sid, pmtpid = 0; ++ int frontend_fd, video_fd, audio_fd, pat_fd, pmt_fd; + int opt, list_channels = 0, chan_no = 0; +- int human_readable = 0; ++ int human_readable = 0, rec_psi = 0; + +- while ((opt = getopt(argc, argv, "Hln:hrn:a:f:d:c:x")) != -1) { ++ while ((opt = getopt(argc, argv, "Hln:hrn:a:f:d:c:x:p")) != -1) { + switch (opt) { + case 'a': + adapter = strtoul(optarg, NULL, 0); +@@ -300,6 +288,9 @@ + case 'n': + chan_no = strtoul(optarg, NULL, 0); + break; ++ case 'p': ++ rec_psi = 1; ++ break; + case 'x': + exit_after_tuning = 1; + break; +@@ -352,7 +343,7 @@ + + memset(&frontend_param, 0, sizeof(struct dvb_frontend_parameters)); + +- if (parse(confname, list_channels, chan_no, channel, &frontend_param, &vpid, &apid)) ++ if (parse(confname, list_channels, chan_no, channel, &frontend_param, &vpid, &apid, &sid)) + return -1; + if (list_channels) + return 0; +@@ -365,6 +356,28 @@ + if (setup_frontend(frontend_fd, &frontend_param) < 0) + return -1; + ++ if (rec_psi) { ++ pmtpid = get_pmt_pid(DEMUX_DEV, sid); ++ if (pmtpid <= 0) { ++ fprintf(stderr,"couldn't find pmt-pid for sid %04x\n",sid); ++ return -1; ++ } ++ ++ if ((pat_fd = open(DEMUX_DEV, O_RDWR)) < 0) { ++ perror("opening pat demux failed"); ++ return -1; ++ } ++ if (set_pesfilter(pat_fd, 0, DMX_PES_OTHER, dvr) < 0) ++ return -1; ++ ++ if ((pmt_fd = open(DEMUX_DEV, O_RDWR)) < 0) { ++ perror("opening pmt demux failed"); ++ return -1; ++ } ++ if (set_pesfilter(pmt_fd, pmtpid, DMX_PES_OTHER, dvr) < 0) ++ return -1; ++ } ++ + if ((video_fd = open(DEMUX_DEV, O_RDWR)) < 0) { + PERROR("failed opening '%s'", DEMUX_DEV); + return -1; +@@ -383,6 +396,8 @@ + + check_frontend (frontend_fd, human_readable); + ++ close (pat_fd); ++ close (pmt_fd); + close (audio_fd); + close (video_fd); + close (frontend_fd); +diff -r af23d23c278b util/szap/szap.c +--- a/util/szap/szap.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/szap/szap.c Tue Dec 21 12:13:28 2010 +0100 +@@ -48,6 +48,7 @@ + #include + #include + #include "lnb.h" ++#include "util.h" + + #ifndef TRUE + #define TRUE (1==1) +@@ -92,94 +93,6 @@ + " -p : add pat and pmt to TS recording (implies -r)\n" + " or -n numbers for zapping\n"; + +-static int set_demux(int dmxfd, int pid, int pes_type, int dvr) +-{ +- struct dmx_pes_filter_params pesfilter; +- +- if (pid < 0 || pid >= 0x1fff) /* ignore this pid to allow radio services */ +- return TRUE; +- +- if (dvr) { +- int buffersize = 64 * 1024; +- if (ioctl(dmxfd, DMX_SET_BUFFER_SIZE, buffersize) == -1) +- perror("DMX_SET_BUFFER_SIZE failed"); +- } +- +- pesfilter.pid = pid; +- pesfilter.input = DMX_IN_FRONTEND; +- pesfilter.output = dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER; +- pesfilter.pes_type = pes_type; +- pesfilter.flags = DMX_IMMEDIATE_START; +- +- if (ioctl(dmxfd, DMX_SET_PES_FILTER, &pesfilter) == -1) { +- fprintf(stderr, "DMX_SET_PES_FILTER failed " +- "(PID = 0x%04x): %d %m\n", pid, errno); +- return FALSE; +- } +- +- return TRUE; +-} +- +-int get_pmt_pid(char *dmxdev, int sid) +-{ +- int patfd, count; +- int pmt_pid = 0; +- int patread = 0; +- int section_length; +- unsigned char buft[4096]; +- unsigned char *buf = buft; +- struct dmx_sct_filter_params f; +- +- memset(&f, 0, sizeof(f)); +- f.pid = 0; +- f.filter.filter[0] = 0x00; +- f.filter.mask[0] = 0xff; +- f.timeout = 0; +- f.flags = DMX_IMMEDIATE_START | DMX_CHECK_CRC; +- +- if ((patfd = open(dmxdev, O_RDWR)) < 0) { +- perror("openening pat demux failed"); +- return -1; +- } +- +- if (ioctl(patfd, DMX_SET_FILTER, &f) == -1) { +- perror("ioctl DMX_SET_FILTER failed"); +- close(patfd); +- return -1; +- } +- +- while (!patread){ +- if (((count = read(patfd, buf, sizeof(buft))) < 0) && errno == EOVERFLOW) +- count = read(patfd, buf, sizeof(buft)); +- if (count < 0) { +- perror("read_sections: read error"); +- close(patfd); +- return -1; +- } +- +- section_length = ((buf[1] & 0x0f) << 8) | buf[2]; +- if (count != section_length + 3) +- continue; +- +- buf += 8; +- section_length -= 8; +- +- patread = 1; /* assumes one section contains the whole pat */ +- while (section_length > 0) { +- int service_id = (buf[0] << 8) | buf[1]; +- if (service_id == sid) { +- pmt_pid = ((buf[2] & 0x1f) << 8) | buf[3]; +- section_length = 0; +- } +- buf += 4; +- section_length -= 4; +- } +- } +- +- close(patfd); +- return pmt_pid; +-} +- + struct diseqc_cmd { + struct dvb_diseqc_master_cmd cmd; + uint32_t wait; +@@ -390,10 +303,10 @@ + + if (diseqc(fefd, sat_no, pol, hiband)) + if (do_tune(fefd, ifreq, sr)) +- if (set_demux(dmxfdv, vpid, DMX_PES_VIDEO, dvr)) ++ if (set_pesfilter(dmxfdv, vpid, DMX_PES_VIDEO, dvr)) + if (audiofd >= 0) + (void)ioctl(audiofd, AUDIO_SET_BYPASS_MODE, bypass); +- if (set_demux(dmxfda, apid, DMX_PES_AUDIO, dvr)) { ++ if (set_pesfilter(dmxfda, apid, DMX_PES_AUDIO, dvr)) { + if (rec_psi) { + pmtpid = get_pmt_pid(dmxdev, sid); + if (pmtpid < 0) { +@@ -403,8 +316,8 @@ + fprintf(stderr,"couldn't find pmt-pid for sid %04x\n",sid); + result = FALSE; + } +- if (set_demux(patfd, 0, DMX_PES_OTHER, dvr)) +- if (set_demux(pmtfd, pmtpid, DMX_PES_OTHER, dvr)) ++ if (set_pesfilter(patfd, 0, DMX_PES_OTHER, dvr)) ++ if (set_pesfilter(pmtfd, pmtpid, DMX_PES_OTHER, dvr)) + result = TRUE; + } else { + result = TRUE; +diff -r af23d23c278b util/szap/tzap.c +--- a/util/szap/tzap.c Sat Jun 20 16:47:55 2009 +0200 ++++ b/util/szap/tzap.c Tue Dec 21 12:13:28 2010 +0100 +@@ -35,6 +35,8 @@ + #include + #include + ++#include "util.h" ++ + static char FRONTEND_DEV [80]; + static char DEMUX_DEV [80]; + static char DVR_DEV [80]; +@@ -269,7 +271,8 @@ + + + int parse(const char *fname, const char *channel, +- struct dvb_frontend_parameters *frontend, int *vpid, int *apid) ++ struct dvb_frontend_parameters *frontend, int *vpid, int *apid, ++ int *sid) + { + int fd; + int err; +@@ -343,7 +346,11 @@ + + if ((err = try_parse_int(fd, apid, "Audio PID"))) + return -13; +- ++ ++ if ((err = try_parse_int(fd, sid, "Service ID"))) ++ return -14; ++ ++ + close(fd); + + return 0; +@@ -351,31 +358,6 @@ + + + static +-int set_pesfilter (int fd, int pid, dmx_pes_type_t type, int dvr) +-{ +- struct dmx_pes_filter_params pesfilter; +- +- if (pid <= 0 || pid >= 0x1fff) +- return 0; +- +- pesfilter.pid = pid; +- pesfilter.input = DMX_IN_FRONTEND; +- pesfilter.output = dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER; +- pesfilter.pes_type = type; +- pesfilter.flags = DMX_IMMEDIATE_START; +- +- if (ioctl(fd, DMX_SET_PES_FILTER, &pesfilter) < 0) { +- PERROR ("ioctl(DMX_SET_PES_FILTER) for %s PID failed", +- type == DMX_PES_AUDIO ? "Audio" : +- type == DMX_PES_VIDEO ? "Video" : "??"); +- return -1; +- } +- +- return 0; +-} +- +- +-static + int setup_frontend (int fe_fd, struct dvb_frontend_parameters *frontend) + { + struct dvb_frontend_info fe_info; +@@ -503,6 +485,7 @@ + " -c file : read channels list from 'file'\n" + " -x : exit after tuning\n" + " -r : set up /dev/dvb/adapterX/dvr0 for TS recording\n" ++ " -p : add pat and pmt to TS recording (implies -r)\n" + " -s : only print summary\n" + " -S : run silently (no output)\n" + " -H : human readable output\n" +@@ -519,15 +502,16 @@ + char *confname = NULL; + char *channel = NULL; + int adapter = 0, frontend = 0, demux = 0, dvr = 0; +- int vpid, apid; ++ int vpid, apid, sid, pmtpid = 0; ++ int pat_fd, pmt_fd; + int frontend_fd, audio_fd = 0, video_fd = 0, dvr_fd, file_fd; + int opt; + int record = 0; + int frontend_only = 0; + char *filename = NULL; +- int human_readable = 0; ++ int human_readable = 0, rec_psi = 0; + +- while ((opt = getopt(argc, argv, "H?hrxRsFSn:a:f:d:c:t:o:")) != -1) { ++ while ((opt = getopt(argc, argv, "H?hrpxRsFSn:a:f:d:c:t:o:")) != -1) { + switch (opt) { + case 'a': + adapter = strtoul(optarg, NULL, 0); +@@ -548,6 +532,9 @@ + case 'r': + dvr = 1; + break; ++ case 'p': ++ rec_psi = 1; ++ break; + case 'x': + exit_after_tuning = 1; + break; +@@ -610,7 +597,7 @@ + + memset(&frontend_param, 0, sizeof(struct dvb_frontend_parameters)); + +- if (parse (confname, channel, &frontend_param, &vpid, &apid)) ++ if (parse (confname, channel, &frontend_param, &vpid, &apid, &sid)) + return -1; + + if ((frontend_fd = open(FRONTEND_DEV, O_RDWR)) < 0) { +@@ -624,6 +611,28 @@ + if (frontend_only) + goto just_the_frontend_dude; + ++ if (rec_psi) { ++ pmtpid = get_pmt_pid(DEMUX_DEV, sid); ++ if (pmtpid <= 0) { ++ fprintf(stderr,"couldn't find pmt-pid for sid %04x\n",sid); ++ return -1; ++ } ++ ++ if ((pat_fd = open(DEMUX_DEV, O_RDWR)) < 0) { ++ perror("opening pat demux failed"); ++ return -1; ++ } ++ if (set_pesfilter(pat_fd, 0, DMX_PES_OTHER, dvr) < 0) ++ return -1; ++ ++ if ((pmt_fd = open(DEMUX_DEV, O_RDWR)) < 0) { ++ perror("opening pmt demux failed"); ++ return -1; ++ } ++ if (set_pesfilter(pmt_fd, pmtpid, DMX_PES_OTHER, dvr) < 0) ++ return -1; ++ } ++ + if ((video_fd = open(DEMUX_DEV, O_RDWR)) < 0) { + PERROR("failed opening '%s'", DEMUX_DEV); + return -1; +@@ -689,6 +698,8 @@ + check_frontend (frontend_fd, human_readable); + } + ++ close (pat_fd); ++ close (pmt_fd); + close (audio_fd); + close (video_fd); + close (frontend_fd); +diff -r af23d23c278b util/szap/util.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/szap/util.c Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,126 @@ ++/* ++ * util functions for various ?zap implementations ++ * ++ * Copyright (C) 2001 Johannes Stezenbach (js@convergence.de) ++ * for convergence integrated media ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++ ++int set_pesfilter(int dmxfd, int pid, int pes_type, int dvr) ++{ ++ struct dmx_pes_filter_params pesfilter; ++ ++ /* ignore this pid to allow radio services */ ++ if (pid < 0 || ++ pid >= 0x1fff || ++ (pid == 0 && pes_type != DMX_PES_OTHER)) ++ return 0; ++ ++ if (dvr) { ++ int buffersize = 64 * 1024; ++ if (ioctl(dmxfd, DMX_SET_BUFFER_SIZE, buffersize) == -1) ++ perror("DMX_SET_BUFFER_SIZE failed"); ++ } ++ ++ pesfilter.pid = pid; ++ pesfilter.input = DMX_IN_FRONTEND; ++ pesfilter.output = dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER; ++ pesfilter.pes_type = pes_type; ++ pesfilter.flags = DMX_IMMEDIATE_START; ++ ++ if (ioctl(dmxfd, DMX_SET_PES_FILTER, &pesfilter) == -1) { ++ fprintf(stderr, "DMX_SET_PES_FILTER failed " ++ "(PID = 0x%04x): %d %m\n", pid, errno); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ ++int get_pmt_pid(char *dmxdev, int sid) ++{ ++ int patfd, count; ++ int pmt_pid = 0; ++ int patread = 0; ++ int section_length; ++ unsigned char buft[4096]; ++ unsigned char *buf = buft; ++ struct dmx_sct_filter_params f; ++ ++ memset(&f, 0, sizeof(f)); ++ f.pid = 0; ++ f.filter.filter[0] = 0x00; ++ f.filter.mask[0] = 0xff; ++ f.timeout = 0; ++ f.flags = DMX_IMMEDIATE_START | DMX_CHECK_CRC; ++ ++ if ((patfd = open(dmxdev, O_RDWR)) < 0) { ++ perror("openening pat demux failed"); ++ return -1; ++ } ++ ++ if (ioctl(patfd, DMX_SET_FILTER, &f) == -1) { ++ perror("ioctl DMX_SET_FILTER failed"); ++ close(patfd); ++ return -1; ++ } ++ ++ while (!patread){ ++ if (((count = read(patfd, buf, sizeof(buft))) < 0) && errno == EOVERFLOW) ++ count = read(patfd, buf, sizeof(buft)); ++ if (count < 0) { ++ perror("read_sections: read error"); ++ close(patfd); ++ return -1; ++ } ++ ++ section_length = ((buf[1] & 0x0f) << 8) | buf[2]; ++ if (count != section_length + 3) ++ continue; ++ ++ buf += 8; ++ section_length -= 8; ++ ++ patread = 1; /* assumes one section contains the whole pat */ ++ while (section_length > 0) { ++ int service_id = (buf[0] << 8) | buf[1]; ++ if (service_id == sid) { ++ pmt_pid = ((buf[2] & 0x1f) << 8) | buf[3]; ++ section_length = 0; ++ } ++ buf += 4; ++ section_length -= 4; ++ } ++ } ++ ++ close(patfd); ++ return pmt_pid; ++} +diff -r af23d23c278b util/szap/util.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/util/szap/util.h Tue Dec 21 12:13:28 2010 +0100 +@@ -0,0 +1,24 @@ ++/* ++ * util functions for various ?zap implementations ++ * ++ * Copyright (C) 2001 Johannes Stezenbach (js@convergence.de) ++ * for convergence integrated media ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++int set_pesfilter(int dmxfd, int pid, int pes_type, int dvr); ++ ++int get_pmt_pid(char *dmxdev, int sid); diff --git a/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-trunk.diff b/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-trunk.diff new file mode 100644 index 0000000000..55c34195bb --- /dev/null +++ b/meta-openpli/recipes-multimedia/dvbtools/dvb-apps-1.1.1/update-to-trunk.diff @@ -0,0 +1,84321 @@ +update to: + +changeset 1281:af23d23c278b + +update scan files for several satellites +submitted by kosava gmail.com +author Christoph Pfister +date Sat Jun 20 16:47:55 2009 +0200 (18 months ago) +parents 291041ebe58f +children 6d6dad45d8ef + +COPYING | 339 + COPYING.LGPL | 502 + + INSTALL | 26 + Make.rules | 104 + Makefile | 32 + README | 46 + TODO | 1 + include/audio.h | 140 + include/ca.h | 90 + include/dmx.h | 154 + include/frontend.h | 648 + + include/linux/dvb/audio.h | 125 + include/linux/dvb/ca.h | 91 + include/linux/dvb/dmx.h | 181 + include/linux/dvb/frontend.h | 267 + include/linux/dvb/net.h | 41 + include/linux/dvb/osd.h | 111 + include/linux/dvb/version.h | 29 + include/linux/dvb/video.h | 199 + include/net.h | 53 + include/osd.h | 142 + include/version.h | 29 + include/video.h | 277 + lib/Makefile | 11 + lib/libdvbapi/Makefile | 25 + lib/libdvbapi/dvbaudio.c | 50 + lib/libdvbapi/dvbaudio.h | 55 + lib/libdvbapi/dvbca.c | 159 + lib/libdvbapi/dvbca.h | 135 + lib/libdvbapi/dvbdemux.c | 255 + lib/libdvbapi/dvbdemux.h | 204 + lib/libdvbapi/dvbfe.c | 574 + + lib/libdvbapi/dvbfe.h | 333 + lib/libdvbapi/dvbnet.c | 104 + lib/libdvbapi/dvbnet.h | 87 + lib/libdvbapi/dvbvideo.c | 46 + lib/libdvbapi/dvbvideo.h | 46 + lib/libdvbcfg/Makefile | 18 + lib/libdvbcfg/dvbcfg_common.c | 136 + lib/libdvbcfg/dvbcfg_common.h | 37 + lib/libdvbcfg/dvbcfg_scanfile.c | 282 + lib/libdvbcfg/dvbcfg_scanfile.h | 61 + lib/libdvbcfg/dvbcfg_zapchannel.c | 384 + + lib/libdvbcfg/dvbcfg_zapchannel.h | 77 + lib/libdvbcfg/zapchannel.txt | 72 + lib/libdvben50221/Makefile | 49 + lib/libdvben50221/asn_1.c | 83 + lib/libdvben50221/asn_1.h | 41 + lib/libdvben50221/en50221_app_ai.c | 191 + lib/libdvben50221/en50221_app_ai.h | 136 + lib/libdvben50221/en50221_app_auth.c | 180 + lib/libdvben50221/en50221_app_auth.h | 123 + lib/libdvben50221/en50221_app_ca.c | 631 + + lib/libdvben50221/en50221_app_ca.h | 264 + lib/libdvben50221/en50221_app_datetime.c | 173 + lib/libdvben50221/en50221_app_datetime.h | 119 + lib/libdvben50221/en50221_app_dvb.c | 282 + lib/libdvben50221/en50221_app_dvb.h | 176 + lib/libdvben50221/en50221_app_epg.c | 167 + lib/libdvben50221/en50221_app_epg.h | 138 + lib/libdvben50221/en50221_app_lowspeed.c | 533 + + lib/libdvben50221/en50221_app_lowspeed.h | 219 + lib/libdvben50221/en50221_app_mmi.c | 1397 +++ + lib/libdvben50221/en50221_app_mmi.h | 618 + + lib/libdvben50221/en50221_app_rm.c | 307 + lib/libdvben50221/en50221_app_rm.h | 187 + lib/libdvben50221/en50221_app_smartcard.c | 296 + lib/libdvben50221/en50221_app_smartcard.h | 200 + lib/libdvben50221/en50221_app_tags.h | 104 + lib/libdvben50221/en50221_app_teletext.c | 141 + lib/libdvben50221/en50221_app_teletext.h | 107 + lib/libdvben50221/en50221_app_utils.c | 38 + lib/libdvben50221/en50221_app_utils.h | 112 + lib/libdvben50221/en50221_errno.h | 49 + lib/libdvben50221/en50221_session.c | 1055 ++ + lib/libdvben50221/en50221_session.h | 232 + lib/libdvben50221/en50221_stdcam.c | 54 + lib/libdvben50221/en50221_stdcam.h | 102 + lib/libdvben50221/en50221_stdcam_hlci.c | 216 + lib/libdvben50221/en50221_stdcam_llci.c | 437 + + lib/libdvben50221/en50221_transport.c | 1296 +++ + lib/libdvben50221/en50221_transport.h | 234 + lib/libdvbmisc/dvbmisc.h | 72 + lib/libdvbsec/Makefile | 17 + lib/libdvbsec/dvbsec_api.c | 951 ++ + lib/libdvbsec/dvbsec_api.h | 436 + + lib/libdvbsec/dvbsec_cfg.c | 366 + + lib/libdvbsec/dvbsec_cfg.h | 203 + lib/libesg/Makefile | 27 + lib/libesg/TODO | 18 + lib/libesg/bootstrap/Makefile | 24 + lib/libesg/bootstrap/access_descriptor.c | 115 + lib/libesg/bootstrap/access_descriptor.h | 86 + lib/libesg/bootstrap/provider_discovery_descriptor.c | 50 + lib/libesg/bootstrap/provider_discovery_descriptor.h | 59 + lib/libesg/encapsulation/Makefile | 28 + lib/libesg/encapsulation/auxiliary_data.h | 62 + lib/libesg/encapsulation/container.c | 206 + lib/libesg/encapsulation/container.h | 94 + lib/libesg/encapsulation/data_repository.c | 53 + lib/libesg/encapsulation/data_repository.h | 59 + lib/libesg/encapsulation/fragment_management_information.c | 118 + lib/libesg/encapsulation/fragment_management_information.h | 96 + lib/libesg/encapsulation/string_repository.c | 54 + lib/libesg/encapsulation/string_repository.h | 60 + lib/libesg/representation/Makefile | 26 + lib/libesg/representation/bim_decoder_init.h | 40 + lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h | 40 + lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c | 70 + lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h | 60 + lib/libesg/representation/init_message.c | 112 + lib/libesg/representation/init_message.h | 80 + lib/libesg/representation/textual_decoder_init.c | 128 + lib/libesg/representation/textual_decoder_init.h | 104 + lib/libesg/transport/Makefile | 22 + lib/libesg/transport/session_partition_declaration.c | 253 + lib/libesg/transport/session_partition_declaration.h | 139 + lib/libesg/types.c | 37 + lib/libesg/types.h | 53 + lib/libesg/xml/provider_discovery_descriptor.xsd | 22 + lib/libucsi/Makefile | 34 + lib/libucsi/atsc/Makefile | 55 + lib/libucsi/atsc/ac3_descriptor.h | 112 + lib/libucsi/atsc/atsc_text.c | 743 ++ + lib/libucsi/atsc/caption_service_descriptor.h | 137 + lib/libucsi/atsc/component_name_descriptor.h | 92 + lib/libucsi/atsc/content_advisory_descriptor.h | 235 + lib/libucsi/atsc/cvct_section.c | 77 + lib/libucsi/atsc/cvct_section.h | 228 + lib/libucsi/atsc/dcc_arriving_request_descriptor.h | 107 + lib/libucsi/atsc/dcc_departing_request_descriptor.h | 108 + lib/libucsi/atsc/dccsct_section.c | 109 + lib/libucsi/atsc/dccsct_section.h | 327 + lib/libucsi/atsc/dcct_section.c | 96 + lib/libucsi/atsc/dcct_section.h | 380 + + lib/libucsi/atsc/descriptor.h | 68 + lib/libucsi/atsc/eit_section.c | 71 + lib/libucsi/atsc/eit_section.h | 191 + lib/libucsi/atsc/ett_section.c | 42 + lib/libucsi/atsc/ett_section.h | 91 + lib/libucsi/atsc/extended_channel_name_descriptor.h | 92 + lib/libucsi/atsc/genre_descriptor.h | 82 + lib/libucsi/atsc/mgt_section.c | 76 + lib/libucsi/atsc/mgt_section.h | 215 + lib/libucsi/atsc/rc_descriptor.h | 83 + lib/libucsi/atsc/rrt_section.c | 108 + lib/libucsi/atsc/rrt_section.h | 379 + + lib/libucsi/atsc/section.h | 84 + lib/libucsi/atsc/service_location_descriptor.h | 141 + lib/libucsi/atsc/stt_section.c | 42 + lib/libucsi/atsc/stt_section.h | 105 + lib/libucsi/atsc/stuffing_descriptor.h | 82 + lib/libucsi/atsc/time_shifted_service_descriptor.h | 136 + lib/libucsi/atsc/tvct_section.c | 81 + lib/libucsi/atsc/tvct_section.h | 227 + lib/libucsi/atsc/types.c | 71 + lib/libucsi/atsc/types.h | 227 + lib/libucsi/crc32.c | 89 + lib/libucsi/crc32.h | 58 + lib/libucsi/descriptor.h | 129 + lib/libucsi/dvb/Makefile | 123 + lib/libucsi/dvb/ac3_descriptor.h | 88 + lib/libucsi/dvb/adaptation_field_data_descriptor.h | 62 + lib/libucsi/dvb/ait_application_descriptor.h | 204 + lib/libucsi/dvb/ait_application_icons_descriptor.h | 157 + lib/libucsi/dvb/ait_application_name_descriptor.h | 145 + lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h | 125 + lib/libucsi/dvb/ancillary_data_descriptor.h | 67 + lib/libucsi/dvb/announcement_support_descriptor.h | 219 + lib/libucsi/dvb/application_signalling_descriptor.h | 124 + lib/libucsi/dvb/bat_section.c | 77 + lib/libucsi/dvb/bat_section.h | 211 + lib/libucsi/dvb/bouquet_name_descriptor.h | 82 + lib/libucsi/dvb/ca_identifier_descriptor.h | 94 + lib/libucsi/dvb/cable_delivery_descriptor.h | 70 + lib/libucsi/dvb/cell_frequency_link_descriptor.h | 190 + lib/libucsi/dvb/cell_list_descriptor.h | 201 + lib/libucsi/dvb/component_descriptor.h | 147 + lib/libucsi/dvb/content_descriptor.h | 116 + lib/libucsi/dvb/content_identifier_descriptor.h | 233 + lib/libucsi/dvb/country_availability_descriptor.h | 120 + lib/libucsi/dvb/data_broadcast_descriptor.h | 139 + lib/libucsi/dvb/data_broadcast_id_descriptor.h | 221 + lib/libucsi/dvb/default_authority_descriptor.h | 82 + lib/libucsi/dvb/descriptor.h | 230 + lib/libucsi/dvb/dit_section.c | 32 + lib/libucsi/dvb/dit_section.h | 54 + lib/libucsi/dvb/dsng_descriptor.h | 80 + lib/libucsi/dvb/eit_section.c | 63 + lib/libucsi/dvb/eit_section.h | 160 + lib/libucsi/dvb/extended_event_descriptor.h | 232 + lib/libucsi/dvb/frequency_list_descriptor.h | 107 + lib/libucsi/dvb/int_section.c | 79 + lib/libucsi/dvb/int_section.h | 245 + lib/libucsi/dvb/ip_mac_platform_name_descriptor.h | 87 + lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h | 87 + lib/libucsi/dvb/ip_mac_stream_location_descriptor.h | 73 + lib/libucsi/dvb/linkage_descriptor.h | 480 + + lib/libucsi/dvb/local_time_offset_descriptor.h | 127 + lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h | 110 + lib/libucsi/dvb/mosaic_descriptor.h | 324 + lib/libucsi/dvb/mpe_fec_section.h | 73 + lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h | 145 + lib/libucsi/dvb/multilingual_component_descriptor.h | 149 + lib/libucsi/dvb/multilingual_network_name_descriptor.h | 145 + lib/libucsi/dvb/multilingual_service_name_descriptor.h | 197 + lib/libucsi/dvb/network_name_descriptor.h | 82 + lib/libucsi/dvb/nit_section.c | 78 + lib/libucsi/dvb/nit_section.h | 207 + lib/libucsi/dvb/nvod_reference_descriptor.h | 125 + lib/libucsi/dvb/parental_rating_descriptor.h | 135 + lib/libucsi/dvb/partial_transport_stream_descriptor.h | 68 + lib/libucsi/dvb/pdc_descriptor.h | 64 + lib/libucsi/dvb/private_data_specifier_descriptor.h | 63 + lib/libucsi/dvb/related_content_descriptor.h | 56 + lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h | 110 + lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h | 87 + lib/libucsi/dvb/rnt_rnt_scan_descriptor.h | 125 + lib/libucsi/dvb/rst_section.c | 47 + lib/libucsi/dvb/rst_section.h | 110 + lib/libucsi/dvb/s2_satellite_delivery_descriptor.h | 116 + lib/libucsi/dvb/satellite_delivery_descriptor.h | 73 + lib/libucsi/dvb/scrambling_descriptor.h | 61 + lib/libucsi/dvb/sdt_section.c | 60 + lib/libucsi/dvb/sdt_section.h | 157 + lib/libucsi/dvb/section.h | 108 + lib/libucsi/dvb/service_availability_descriptor.h | 98 + lib/libucsi/dvb/service_descriptor.h | 163 + lib/libucsi/dvb/service_identifier_descriptor.h | 82 + lib/libucsi/dvb/service_list_descriptor.h | 122 + lib/libucsi/dvb/service_move_descriptor.h | 67 + lib/libucsi/dvb/short_event_descriptor.h | 135 + lib/libucsi/dvb/short_smoothing_buffer_descriptor.h | 87 + lib/libucsi/dvb/sit_section.c | 69 + lib/libucsi/dvb/sit_section.h | 173 + lib/libucsi/dvb/st_section.c | 29 + lib/libucsi/dvb/st_section.h | 77 + lib/libucsi/dvb/stream_identifier_descriptor.h | 61 + lib/libucsi/dvb/stuffing_descriptor.h | 82 + lib/libucsi/dvb/subtitling_descriptor.h | 126 + lib/libucsi/dvb/target_ip_address_descriptor.h | 116 + lib/libucsi/dvb/target_ip_slash_descriptor.h | 116 + lib/libucsi/dvb/target_ip_source_slash_descriptor.h | 118 + lib/libucsi/dvb/target_ipv6_address_descriptor.h | 116 + lib/libucsi/dvb/target_ipv6_slash_descriptor.h | 116 + lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h | 118 + lib/libucsi/dvb/tdt_section.c | 33 + lib/libucsi/dvb/tdt_section.h | 54 + lib/libucsi/dvb/telephone_descriptor.h | 150 + lib/libucsi/dvb/teletext_descriptor.h | 127 + lib/libucsi/dvb/terrestrial_delivery_descriptor.h | 77 + lib/libucsi/dvb/time_shifted_event_descriptor.h | 65 + lib/libucsi/dvb/time_shifted_service_descriptor.h | 63 + lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h | 94 + lib/libucsi/dvb/tot_section.c | 50 + lib/libucsi/dvb/tot_section.h | 97 + lib/libucsi/dvb/transport_stream_descriptor.h | 82 + lib/libucsi/dvb/tva_container_section.c | 33 + lib/libucsi/dvb/tva_container_section.h | 90 + lib/libucsi/dvb/tva_id_descriptor.h | 124 + lib/libucsi/dvb/types.c | 270 + lib/libucsi/dvb/types.h | 127 + lib/libucsi/dvb/vbi_data_descriptor.h | 186 + lib/libucsi/dvb/vbi_teletext_descriptor.h | 116 + lib/libucsi/endianops.h | 128 + lib/libucsi/mpeg/Makefile | 66 + lib/libucsi/mpeg/audio_stream_descriptor.h | 65 + lib/libucsi/mpeg/ca_descriptor.h | 91 + lib/libucsi/mpeg/cat_section.c | 34 + lib/libucsi/mpeg/cat_section.h | 94 + lib/libucsi/mpeg/content_labelling_descriptor.h | 356 + + lib/libucsi/mpeg/copyright_descriptor.h | 89 + lib/libucsi/mpeg/data_stream_alignment_descriptor.h | 73 + lib/libucsi/mpeg/datagram_section.h | 81 + lib/libucsi/mpeg/descriptor.h | 102 + lib/libucsi/mpeg/external_es_id_descriptor.h | 63 + lib/libucsi/mpeg/fmc_descriptor.h | 122 + lib/libucsi/mpeg/fmxbuffer_size_descriptor.h | 83 + lib/libucsi/mpeg/hierarchy_descriptor.h | 83 + lib/libucsi/mpeg/ibp_descriptor.h | 65 + lib/libucsi/mpeg/iod_descriptor.h | 87 + lib/libucsi/mpeg/iso_639_language_descriptor.h | 124 + lib/libucsi/mpeg/maximum_bitrate_descriptor.h | 64 + lib/libucsi/mpeg/metadata_descriptor.h | 472 + + lib/libucsi/mpeg/metadata_pointer_descriptor.h | 360 + + lib/libucsi/mpeg/metadata_section.c | 27 + lib/libucsi/mpeg/metadata_section.h | 122 + lib/libucsi/mpeg/metadata_std_descriptor.h | 72 + lib/libucsi/mpeg/mpeg4_audio_descriptor.h | 61 + lib/libucsi/mpeg/mpeg4_video_descriptor.h | 61 + lib/libucsi/mpeg/multiplex_buffer_descriptor.h | 65 + lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h | 67 + lib/libucsi/mpeg/muxcode_descriptor.h | 82 + lib/libucsi/mpeg/odsmt_section.c | 80 + lib/libucsi/mpeg/odsmt_section.h | 224 + lib/libucsi/mpeg/pat_section.c | 46 + lib/libucsi/mpeg/pat_section.h | 118 + lib/libucsi/mpeg/pmt_section.c | 71 + lib/libucsi/mpeg/pmt_section.h | 188 + lib/libucsi/mpeg/private_data_indicator_descriptor.h | 63 + lib/libucsi/mpeg/registration_descriptor.h | 91 + lib/libucsi/mpeg/section.h | 60 + lib/libucsi/mpeg/sl_descriptor.h | 63 + lib/libucsi/mpeg/smoothing_buffer_descriptor.h | 66 + lib/libucsi/mpeg/std_descriptor.h | 62 + lib/libucsi/mpeg/system_clock_descriptor.h | 65 + lib/libucsi/mpeg/target_background_grid_descriptor.h | 66 + lib/libucsi/mpeg/tsdt_section.c | 34 + lib/libucsi/mpeg/tsdt_section.h | 94 + lib/libucsi/mpeg/types.h | 127 + lib/libucsi/mpeg/video_stream_descriptor.h | 101 + lib/libucsi/mpeg/video_window_descriptor.h | 64 + lib/libucsi/section.h | 253 + lib/libucsi/section_buf.c | 173 + lib/libucsi/section_buf.h | 124 + lib/libucsi/testrecord.txt | 146 + lib/libucsi/transport_packet.c | 256 + lib/libucsi/transport_packet.h | 195 + lib/libucsi/types.h | 36 + libdvb2/README | 23 + test/Makefile | 64 + test/README | 11 + test/dia | 1 + test/diseqc.c | 19 + test/evtest.c | 251 + test/hex_dump.c | 1 + test/libdvbcfg/Makefile | 12 + test/libdvbcfg/dvbcfg_test.c | 100 + test/libdvbcfg/test_zapchannels.txt | 446 + + test/libdvben50221/Makefile | 14 + test/libdvben50221/test-app.c | 854 ++ + test/libdvben50221/test-session.c | 171 + test/libdvben50221/test-transport.c | 144 + test/libdvbsec/Makefile | 12 + test/libdvbsec/dvbsec_test.c | 85 + test/libdvbsec/test_sec.txt | 28 + test/libesg/Makefile | 12 + test/libesg/samples/ESGProviderDiscoveryDescriptor.xml | 13 + test/libesg/testesg.c | 563 + + test/libucsi/Makefile | 13 + test/libucsi/testucsi.c | 3528 ++++++++++ + test/lnb.c | 101 + test/lnb.h | 22 + test/sendburst.c | 14 + test/set22k.c | 18 + test/setpid.c | 17 + test/setvoltage.c | 18 + test/szap2.c | 767 ++ + test/test.c | 81 + test/test_audio.c | 41 + test/test_av.c | 100 + test/test_av_play.c | 516 + + test/test_dvr.c | 3 + test/test_dvr_play.c | 1 + test/test_front.c | 37 + test/test_sec_ne.c | 7 + test/test_sections.c | 3 + test/test_stc.c | 1 + test/test_stillimage.c | 7 + test/test_switch.c | 106 + test/test_tt.c | 1 + test/test_vevent.c | 6 + test/test_video.c | 51 + test/video.c | 42 + util/Makefile | 25 + util/atsc_epg/Makefile | 16 + util/atsc_epg/README | 12 + util/atsc_epg/atsc_epg.c | 1249 +++ + util/av7110_loadkeys/Makefile | 53 + util/av7110_loadkeys/README | 15 + util/av7110_loadkeys/activy.rcmm | 1 + util/av7110_loadkeys/av7110_loadkeys.c | 48 + util/av7110_loadkeys/evtest.c | 177 + util/av7110_loadkeys/galaxis.rcmm | 3 + util/av7110_loadkeys/generate-keynames.sh | 37 + util/av7110_loadkeys/hauppauge.rc5 | 1 + util/av7110_loadkeys/hauppauge2.rc5 | 40 + util/av7110_loadkeys/hauppauge_grey.rc5 | 1 + util/av7110_loadkeys/input_fake.h | 15 + util/av7110_loadkeys/philips1358.rc5 | 5 + util/av7110_loadkeys/technotrend.rc5 | 41 + util/dib3000-watch/Makefile | 13 + util/dib3000-watch/README.dib3000-watch | 29 + util/dib3000-watch/dib-i2c.h | 43 + util/dib3000-watch/dib3000-watch.c | 296 + util/dib3000-watch/dib3000-watch.h | 46 + util/dib3000-watch/dib3000.h | 56 + util/dib3000-watch/make-i2c-dev | 6 + util/dst-utils/Makefile | 13 + util/dst-utils/dst_test.c | 258 + util/dvbdate/Makefile | 28 + util/dvbdate/dvbdate.c | 282 + util/dvbnet/Makefile | 32 + util/dvbnet/dvbnet.c | 106 + util/dvbnet/net_start.pl | 1 + util/dvbnet/version.h.in | 1 + util/dvbscan/Makefile | 22 + util/dvbscan/dvbscan.c | 370 + + util/dvbscan/dvbscan.h | 136 + util/dvbscan/dvbscan_atsc.c | 30 + util/dvbscan/dvbscan_dvb.c | 30 + util/dvbscan/dvbscan_structutils.c | 99 + util/dvbtraffic/Makefile | 17 + util/dvbtraffic/dvbtraffic.c | 110 + util/femon/Makefile | 15 + util/femon/femon.c | 175 + util/gnutv/Makefile | 21 + util/gnutv/gnutv.c | 375 + + util/gnutv/gnutv.h | 37 + util/gnutv/gnutv_ca.c | 404 + + util/gnutv/gnutv_ca.h | 40 + util/gnutv/gnutv_data.c | 483 + + util/gnutv/gnutv_data.h | 39 + util/gnutv/gnutv_dvb.c | 376 + + util/gnutv/gnutv_dvb.h | 44 + util/lib/Makefile | 20 + util/lib/lnb.c | 101 + util/lib/lnb.h | 24 + util/scan/Makefile | 46 + util/scan/README | 26 + util/scan/atsc/us-ATSC-center-frequencies-8VSB | 1 + util/scan/atsc/us-NTSC-center-frequencies-8VSB | 1 + util/scan/atsc/us-NY-TWC-NYC | 53 + util/scan/atsc_psip_section.c | 62 + util/scan/atsc_psip_section.h | 60 + util/scan/atsc_psip_section.pl | 76 + util/scan/diseqc.c | 5 + util/scan/diseqc.h | 1 + util/scan/dump-vdr.c | 13 + util/scan/dump-vdr.h | 1 + util/scan/dump-zap.c | 1 + util/scan/dump-zap.h | 1 + util/scan/dvb-c/at-Innsbruck | 8 + util/scan/dvb-c/at-KarrerNet | 18 + util/scan/dvb-c/at-Liwest | 31 + util/scan/dvb-c/at-SalzburgAG | 8 + util/scan/dvb-c/be-IN.DI-Integan | 16 + util/scan/dvb-c/ch-Rega-Sense | 34 + util/scan/dvb-c/ch-Video2000 | 5 + util/scan/dvb-c/ch-Zuerich-cablecom | 3 + util/scan/dvb-c/cz-Moravianet | 24 + util/scan/dvb-c/de-Berlin | 1 + util/scan/dvb-c/de-Kabel_BW | 16 + util/scan/dvb-c/de-Muenchen | 27 + util/scan/dvb-c/de-Primacom | 23 + util/scan/dvb-c/de-Unitymedia | 35 + util/scan/dvb-c/de-iesy | 19 + util/scan/dvb-c/de-neftv | 23 + util/scan/dvb-c/dk-Copenhagen-AFDK | 11 + util/scan/dvb-c/dk-Odense | 10 + util/scan/dvb-c/es-Euskaltel | 19 + util/scan/dvb-c/fi-3ktv | 23 + util/scan/dvb-c/fi-HTV | 4 + util/scan/dvb-c/fi-Joensuu-Tikka | 13 + util/scan/dvb-c/fi-TTV | 4 + util/scan/dvb-c/fi-Turku | 17 + util/scan/dvb-c/fi-jkl | 10 + util/scan/dvb-c/fi-sonera | 12 + util/scan/dvb-c/fr-noos-numericable | 41 + util/scan/dvb-c/lu-Ettelbruck-ACE | 20 + util/scan/dvb-c/nl-Ziggo | 14 + util/scan/dvb-c/nl-Ziggo-Zwolle | 26 + util/scan/dvb-c/no-Oslo-CanalDigital | 13 + util/scan/dvb-c/no-Oslo-Get | 22 + util/scan/dvb-c/se-Gothnet | 23 + util/scan/dvb-c/se-comhem | 3 + util/scan/dvb-h/README | 3 + util/scan/dvb-h/fi-Helsinki | 2 + util/scan/dvb-h/fi-Oulu | 2 + util/scan/dvb-h/fi-Oulu-Nokia-devel | 4 + util/scan/dvb-h/fi-Turku | 2 + util/scan/dvb-s/ABS1-75.0E | 10 + util/scan/dvb-s/AMC1-103w | 5 + util/scan/dvb-s/AMC2-85w | 6 + util/scan/dvb-s/AMC3-87w | 10 + util/scan/dvb-s/AMC4-101w | 10 + util/scan/dvb-s/AMC5-79w | 5 + util/scan/dvb-s/AMC6-72w | 44 + util/scan/dvb-s/AMC9-83w | 18 + util/scan/dvb-s/Amazonas-61.0W | 54 + util/scan/dvb-s/Amos-4w | 48 + util/scan/dvb-s/Anik-F1-107.3W | 7 + util/scan/dvb-s/AsiaSat3S_C-105.5E | 122 + util/scan/dvb-s/Astra-28.2E | 186 + util/scan/dvb-s/Atlantic-Bird-1-12.5W | 30 + util/scan/dvb-s/BrasilSat-B1-75.0W | 11 + util/scan/dvb-s/BrasilSat-B2-65.0W | 34 + util/scan/dvb-s/BrasilSat-B3-84.0W | 85 + util/scan/dvb-s/BrasilSat-B4-70.0W | 39 + util/scan/dvb-s/Estrela-do-Sul-63.0W | 27 + util/scan/dvb-s/Eurobird1-28.5E | 5 + util/scan/dvb-s/Eurobird9-9.0E | 16 + util/scan/dvb-s/EutelsatW2-16E | 59 + util/scan/dvb-s/Express-3A-11.0W | 4 + util/scan/dvb-s/ExpressAM1-40.0E | 5 + util/scan/dvb-s/ExpressAM2-80.0E | 35 + util/scan/dvb-s/ExpressAM22-53.0E | 9 + util/scan/dvb-s/Galaxy10R-123w | 10 + util/scan/dvb-s/Galaxy11-91w | 49 + util/scan/dvb-s/Galaxy25-97w | 19 + util/scan/dvb-s/Galaxy26-93w | 58 + util/scan/dvb-s/Galaxy27-129w | 4 + util/scan/dvb-s/Galaxy28-89w | 41 + util/scan/dvb-s/Galaxy3C-95w | 4 + util/scan/dvb-s/Hispasat-30.0W | 37 + util/scan/dvb-s/Hotbird-13.0E | 93 + util/scan/dvb-s/IA5-97w | 18 + util/scan/dvb-s/IA6-93w | 61 + util/scan/dvb-s/IA7-129w | 4 + util/scan/dvb-s/IA8-89w | 34 + util/scan/dvb-s/Intel4-72.0E | 6 + util/scan/dvb-s/Intel904-60.0E | 13 + util/scan/dvb-s/Intelsat-1002-1.0W | 20 + util/scan/dvb-s/Intelsat-11-43.0W | 4 + util/scan/dvb-s/Intelsat-1R-45.0W | 44 + util/scan/dvb-s/Intelsat-3R-43.0W | 35 + util/scan/dvb-s/Intelsat-6B-43.0W | 17 + util/scan/dvb-s/Intelsat-705-50.0W | 7 + util/scan/dvb-s/Intelsat-707-53.0W | 5 + util/scan/dvb-s/Intelsat-805-55.5W | 67 + util/scan/dvb-s/Intelsat-9-58.0W | 58 + util/scan/dvb-s/Intelsat-903-34.5W | 7 + util/scan/dvb-s/Intelsat-905-24.5W | 9 + util/scan/dvb-s/Intelsat-907-27.5W | 9 + util/scan/dvb-s/NSS-10-37.5W | 12 + util/scan/dvb-s/NSS-7-22.0W | 25 + util/scan/dvb-s/NSS-806-40.5W | 108 + util/scan/dvb-s/Nahuel-1-71.8W | 11 + util/scan/dvb-s/Nilesat101+102-7.0W | 41 + util/scan/dvb-s/OptusC1-156E | 20 + util/scan/dvb-s/SBS6-74w | 4 + util/scan/dvb-s/Satmex-5-116.8W | 72 + util/scan/dvb-s/Satmex-6-113.0W | 19 + util/scan/dvb-s/Sirius-5.0E | 57 + util/scan/dvb-s/Telecom2-8.0W | 17 + util/scan/dvb-s/Telstar12-15.0W | 26 + util/scan/dvb-s/Thor-1.0W | 32 + util/scan/dvb-s/Turksat-42.0E | 104 + util/scan/dvb-s/Yamal201-90.0E | 48 + util/scan/dvb-t/ad-Andorra | 6 + util/scan/dvb-t/at-Official | 24 + util/scan/dvb-t/au-Adelaide | 12 + util/scan/dvb-t/au-Brisbane | 12 + util/scan/dvb-t/au-Cairns | 12 + util/scan/dvb-t/au-Canberra-Black-Mt | 12 + util/scan/dvb-t/au-Coonabarabran | 16 + util/scan/dvb-t/au-Darwin | 8 + util/scan/dvb-t/au-GoldCoast | 21 + util/scan/dvb-t/au-Hobart | 12 + util/scan/dvb-t/au-Mackay | 14 + util/scan/dvb-t/au-Melbourne | 12 + util/scan/dvb-t/au-Melbourne-Upwey | 12 + util/scan/dvb-t/au-MidNorthCoast | 22 + util/scan/dvb-t/au-Newcastle | 12 + util/scan/dvb-t/au-Perth | 12 + util/scan/dvb-t/au-Perth_Roleystone | 12 + util/scan/dvb-t/au-SpencerGulf | 8 + util/scan/dvb-t/au-SunshineCoast | 12 + util/scan/dvb-t/au-Sydney_Kings_Cross | 14 + util/scan/dvb-t/au-Sydney_North_Shore | 16 + util/scan/dvb-t/au-Tamworth | 38 + util/scan/dvb-t/au-Townsville | 12 + util/scan/dvb-t/au-WaggaWagga | 12 + util/scan/dvb-t/au-Wollongong | 40 + util/scan/dvb-t/au-canberra | 6 + util/scan/dvb-t/au-sydney_north_shore | 12 + util/scan/dvb-t/be-Brussels | 5 + util/scan/dvb-t/be-Libramont | 10 + util/scan/dvb-t/be-Schoten | 3 + util/scan/dvb-t/be-St_Pieters_Leeuw | 3 + util/scan/dvb-t/be-Tournai | 3 + util/scan/dvb-t/ch-All | 31 + util/scan/dvb-t/ch-Citycable | 18 + util/scan/dvb-t/cz-Brno | 10 + util/scan/dvb-t/cz-Domazlice | 3 + util/scan/dvb-t/cz-Klet | 4 + util/scan/dvb-t/cz-Ostrava | 3 + util/scan/dvb-t/cz-Plzen | 8 + util/scan/dvb-t/cz-Praha | 7 + util/scan/dvb-t/de-Baden-Wuerttemberg | 20 + util/scan/dvb-t/de-Bayern | 40 + util/scan/dvb-t/de-Berlin | 12 + util/scan/dvb-t/de-Brandenburg | 7 + util/scan/dvb-t/de-Bremen | 9 + util/scan/dvb-t/de-Hamburg | 16 + util/scan/dvb-t/de-Hessen | 19 + util/scan/dvb-t/de-Mecklenburg-Vorpommern | 12 + util/scan/dvb-t/de-Niedersachsen | 40 + util/scan/dvb-t/de-Nordrhein-Westfalen | 27 + util/scan/dvb-t/de-Rheinland-Pfalz | 12 + util/scan/dvb-t/de-Saarland | 7 + util/scan/dvb-t/de-Sachsen | 12 + util/scan/dvb-t/de-Sachsen-Anhalt | 12 + util/scan/dvb-t/de-Schleswig-Holstein | 18 + util/scan/dvb-t/de-Thueringen | 10 + util/scan/dvb-t/dk-All | 17 + util/scan/dvb-t/es-Albacete | 8 + util/scan/dvb-t/es-Alfabia | 8 + util/scan/dvb-t/es-Alicante | 9 + util/scan/dvb-t/es-Alpicat | 8 + util/scan/dvb-t/es-Asturias | 8 + util/scan/dvb-t/es-Bilbao | 6 + util/scan/dvb-t/es-Cadiz | 8 + util/scan/dvb-t/es-Carceres | 10 + util/scan/dvb-t/es-Collserola | 12 + util/scan/dvb-t/es-Donostia | 14 + util/scan/dvb-t/es-Huesca | 8 + util/scan/dvb-t/es-Las_Palmas | 8 + util/scan/dvb-t/es-Lugo | 9 + util/scan/dvb-t/es-Madrid | 8 + util/scan/dvb-t/es-Malaga | 9 + util/scan/dvb-t/es-Muros-Noia | 9 + util/scan/dvb-t/es-Mussara | 8 + util/scan/dvb-t/es-Rocacorba | 6 + util/scan/dvb-t/es-Santander | 7 + util/scan/dvb-t/es-Santiago_de_Compostela | 9 + util/scan/dvb-t/es-Sevilla | 8 + util/scan/dvb-t/es-Valencia | 9 + util/scan/dvb-t/es-Valladolid | 7 + util/scan/dvb-t/es-Vilamarxant | 4 + util/scan/dvb-t/es-Zaragoza | 7 + util/scan/dvb-t/fi-Aanekoski | 6 + util/scan/dvb-t/fi-Aanekoski_Konginkangas | 5 + util/scan/dvb-t/fi-Ahtari | 4 + util/scan/dvb-t/fi-Ala-Vuokki | 4 + util/scan/dvb-t/fi-Alajarvi | 5 + util/scan/dvb-t/fi-Ammansaari | 4 + util/scan/dvb-t/fi-Anjalankoski | 6 + util/scan/dvb-t/fi-Enontekio_Ahovaara_Raattama | 4 + util/scan/dvb-t/fi-Espoo | 5 + util/scan/dvb-t/fi-Eurajoki | 6 + util/scan/dvb-t/fi-Fiskars | 6 + util/scan/dvb-t/fi-Haapavesi | 6 + util/scan/dvb-t/fi-Hameenkyro_Kyroskoski | 5 + util/scan/dvb-t/fi-Hameenlinna_Painokangas | 5 + util/scan/dvb-t/fi-Hanko | 5 + util/scan/dvb-t/fi-Hartola | 4 + util/scan/dvb-t/fi-Heinavesi | 4 + util/scan/dvb-t/fi-Heinola | 6 + util/scan/dvb-t/fi-Hetta | 4 + util/scan/dvb-t/fi-Houtskari | 5 + util/scan/dvb-t/fi-Hyrynsalmi | 4 + util/scan/dvb-t/fi-Hyrynsalmi_Kyparavaara | 4 + util/scan/dvb-t/fi-Hyrynsalmi_Paljakka | 4 + util/scan/dvb-t/fi-Hyvinkaa_Musta-Mannisto | 5 + util/scan/dvb-t/fi-Ii_Raiskio | 4 + util/scan/dvb-t/fi-Iisalmi | 4 + util/scan/dvb-t/fi-Ikaalinen | 5 + util/scan/dvb-t/fi-Ikaalinen_Riitiala | 5 + util/scan/dvb-t/fi-Inari | 4 + util/scan/dvb-t/fi-Inari_Janispaa | 4 + util/scan/dvb-t/fi-Inari_Naatamo | 4 + util/scan/dvb-t/fi-Ivalo_Saarineitamovaara | 4 + util/scan/dvb-t/fi-Jalasjarvi | 5 + util/scan/dvb-t/fi-Jamsa_Kaipola | 5 + util/scan/dvb-t/fi-Jamsa_Kuorevesi_Halli | 5 + util/scan/dvb-t/fi-Jamsa_Matkosvuori | 6 + util/scan/dvb-t/fi-Jamsa_Ouninpohja | 4 + util/scan/dvb-t/fi-Jamsankoski | 5 + util/scan/dvb-t/fi-Joensuu_Vestinkallio | 4 + util/scan/dvb-t/fi-Joroinen_Puukkola | 4 + util/scan/dvb-t/fi-Joutsa_Lankia | 5 + util/scan/dvb-t/fi-Joutseno | 6 + util/scan/dvb-t/fi-Juntusranta | 4 + util/scan/dvb-t/fi-Juupajoki_Kopsamo | 4 + util/scan/dvb-t/fi-Jyvaskyla | 6 + util/scan/dvb-t/fi-Jyvaskylan_mlk_Vaajakoski | 4 + util/scan/dvb-t/fi-Kaavi_Sivakkavaara_Luikonlahti | 4 + util/scan/dvb-t/fi-Kajaani_Pollyvaara | 4 + util/scan/dvb-t/fi-Kalajoki | 4 + util/scan/dvb-t/fi-Kangaslampi | 5 + util/scan/dvb-t/fi-Kangasniemi_Turkinmaki | 5 + util/scan/dvb-t/fi-Kankaanpaa | 5 + util/scan/dvb-t/fi-Karigasniemi | 4 + util/scan/dvb-t/fi-Karkkila | 6 + util/scan/dvb-t/fi-Karstula | 4 + util/scan/dvb-t/fi-Karvia | 5 + util/scan/dvb-t/fi-Kaunispaa | 4 + util/scan/dvb-t/fi-Kemijarvi_Suomutunturi | 4 + util/scan/dvb-t/fi-Kerimaki | 6 + util/scan/dvb-t/fi-Keuruu | 6 + util/scan/dvb-t/fi-Keuruu_Haapamaki | 5 + util/scan/dvb-t/fi-Kihnio | 5 + util/scan/dvb-t/fi-Kiihtelysvaara | 4 + util/scan/dvb-t/fi-Kilpisjarvi | 4 + util/scan/dvb-t/fi-Kittila_Sirkka_Levitunturi | 4 + util/scan/dvb-t/fi-Kolari_Vuolittaja | 4 + util/scan/dvb-t/fi-Koli | 6 + util/scan/dvb-t/fi-Korpilahti_Vaarunvuori | 5 + util/scan/dvb-t/fi-Korppoo | 5 + util/scan/dvb-t/fi-Kruunupyy | 6 + util/scan/dvb-t/fi-Kuhmo_Iivantiira | 4 + util/scan/dvb-t/fi-Kuhmo_Lentiira | 4 + util/scan/dvb-t/fi-Kuhmo_Tikkasenmaki | 4 + util/scan/dvb-t/fi-Kuhmoinen | 5 + util/scan/dvb-t/fi-Kuhmoinen_Harjunsalmi | 5 + util/scan/dvb-t/fi-Kuhmoinen_Puukkoinen | 4 + util/scan/dvb-t/fi-Kuopio | 6 + util/scan/dvb-t/fi-Kustavi_Viherlahti | 5 + util/scan/dvb-t/fi-Kuttanen | 4 + util/scan/dvb-t/fi-Kuusamo_Hamppulampi | 4 + util/scan/dvb-t/fi-Kyyjarvi_Noposenaho | 4 + util/scan/dvb-t/fi-Lahti | 6 + util/scan/dvb-t/fi-Lapua | 6 + util/scan/dvb-t/fi-Laukaa | 5 + util/scan/dvb-t/fi-Laukaa_Vihtavuori | 5 + util/scan/dvb-t/fi-Lavia_Lavianjarvi | 4 + util/scan/dvb-t/fi-Lieksa_Vieki | 5 + util/scan/dvb-t/fi-Lohja | 6 + util/scan/dvb-t/fi-Loimaa | 5 + util/scan/dvb-t/fi-Luhanka | 5 + util/scan/dvb-t/fi-Luopioinen | 5 + util/scan/dvb-t/fi-Mantta | 5 + util/scan/dvb-t/fi-Mantyharju | 4 + util/scan/dvb-t/fi-Mikkeli | 6 + util/scan/dvb-t/fi-Muonio_Olostunturi | 4 + util/scan/dvb-t/fi-Nilsia | 5 + util/scan/dvb-t/fi-Nilsia_Keski-Siikajarvi | 4 + util/scan/dvb-t/fi-Nilsia_Pisa | 4 + util/scan/dvb-t/fi-Nokia | 6 + util/scan/dvb-t/fi-Nokia_Siuro_Linnavuori | 5 + util/scan/dvb-t/fi-Nummi-Pusula_Hyonola | 5 + util/scan/dvb-t/fi-Nurmes_Kortevaara | 4 + util/scan/dvb-t/fi-Orivesi_Langelmaki_Talviainen | 4 + util/scan/dvb-t/fi-Oulu | 6 + util/scan/dvb-t/fi-Padasjoki | 5 + util/scan/dvb-t/fi-Padasjoki_Arrakoski | 5 + util/scan/dvb-t/fi-Paltamo_Kivesvaara | 4 + util/scan/dvb-t/fi-Parikkala | 5 + util/scan/dvb-t/fi-Parkano | 5 + util/scan/dvb-t/fi-Pello | 4 + util/scan/dvb-t/fi-Pello_Ratasvaara | 4 + util/scan/dvb-t/fi-Perho | 5 + util/scan/dvb-t/fi-Pernaja | 5 + util/scan/dvb-t/fi-Pieksamaki_Halkokumpu | 4 + util/scan/dvb-t/fi-Pihtipudas | 5 + util/scan/dvb-t/fi-Porvoo_Suomenkyla | 5 + util/scan/dvb-t/fi-Posio | 4 + util/scan/dvb-t/fi-Pudasjarvi | 4 + util/scan/dvb-t/fi-Pudasjarvi_Iso-Syote | 4 + util/scan/dvb-t/fi-Pudasjarvi_Kangasvaara | 4 + util/scan/dvb-t/fi-Puolanka | 5 + util/scan/dvb-t/fi-Pyhatunturi | 4 + util/scan/dvb-t/fi-Pyhavuori | 5 + util/scan/dvb-t/fi-Pylkonmaki_Karankajarvi | 4 + util/scan/dvb-t/fi-Raahe_Mestauskallio | 5 + util/scan/dvb-t/fi-Raahe_Piehinki | 4 + util/scan/dvb-t/fi-Ranua_Haasionmaa | 4 + util/scan/dvb-t/fi-Ranua_Leppiaho | 4 + util/scan/dvb-t/fi-Rautavaara_Angervikko | 5 + util/scan/dvb-t/fi-Rautjarvi_Simpele | 4 + util/scan/dvb-t/fi-Ristijarvi | 4 + util/scan/dvb-t/fi-Rovaniemi | 5 + util/scan/dvb-t/fi-Rovaniemi_Ala-Nampa_Yli-Nampa_Rantalaki | 4 + util/scan/dvb-t/fi-Rovaniemi_Kaihuanvaara | 4 + util/scan/dvb-t/fi-Rovaniemi_Karhuvaara_Marrasjarvi | 4 + util/scan/dvb-t/fi-Rovaniemi_Marasenkallio | 4 + util/scan/dvb-t/fi-Rovaniemi_Meltaus_Sorviselka | 4 + util/scan/dvb-t/fi-Rovaniemi_Sonka | 4 + util/scan/dvb-t/fi-Ruka | 5 + util/scan/dvb-t/fi-Ruovesi_Storminiemi | 5 + util/scan/dvb-t/fi-Saarijarvi | 5 + util/scan/dvb-t/fi-Saarijarvi_Kalmari | 4 + util/scan/dvb-t/fi-Saarijarvi_Mahlu | 4 + util/scan/dvb-t/fi-Salla_Hirvasvaara | 4 + util/scan/dvb-t/fi-Salla_Ihistysjanka | 4 + util/scan/dvb-t/fi-Salla_Naruska | 4 + util/scan/dvb-t/fi-Salla_Sallatunturi | 4 + util/scan/dvb-t/fi-Salla_Sarivaara | 4 + util/scan/dvb-t/fi-Salo_Isokyla | 6 + util/scan/dvb-t/fi-Savukoski_Martti_Haarahonganmaa | 4 + util/scan/dvb-t/fi-Savukoski_Tanhua | 4 + util/scan/dvb-t/fi-Siilinjarvi | 5 + util/scan/dvb-t/fi-Sipoo_Norrkulla | 5 + util/scan/dvb-t/fi-Sodankyla_Pittiovaara | 4 + util/scan/dvb-t/fi-Sulkava_Vaatalanmaki | 4 + util/scan/dvb-t/fi-Suomussalmi_Myllylahti | 4 + util/scan/dvb-t/fi-Sysma_Liikola | 5 + util/scan/dvb-t/fi-Taivalkoski | 4 + util/scan/dvb-t/fi-Taivalkoski_Taivalvaara | 4 + util/scan/dvb-t/fi-Tammela | 6 + util/scan/dvb-t/fi-Tammisaari | 5 + util/scan/dvb-t/fi-Tampere | 4 + util/scan/dvb-t/fi-Tampere_Pyynikki | 6 + util/scan/dvb-t/fi-Tervola | 5 + util/scan/dvb-t/fi-Turku | 5 + util/scan/dvb-t/fi-Utsjoki | 4 + util/scan/dvb-t/fi-Utsjoki_Nuorgam_Njallavaara | 4 + util/scan/dvb-t/fi-Utsjoki_Nuorgam_raja | 4 + util/scan/dvb-t/fi-Utsjoki_Nuvvus | 4 + util/scan/dvb-t/fi-Utsjoki_Outakoski | 4 + util/scan/dvb-t/fi-Utsjoki_Polvarniemi | 4 + util/scan/dvb-t/fi-Utsjoki_Rovisuvanto | 4 + util/scan/dvb-t/fi-Utsjoki_Tenola | 4 + util/scan/dvb-t/fi-Uusikaupunki_Orivo | 5 + util/scan/dvb-t/fi-Vaala | 4 + util/scan/dvb-t/fi-Vaasa | 5 + util/scan/dvb-t/fi-Valtimo | 4 + util/scan/dvb-t/fi-Vammala_Jyranvuori | 5 + util/scan/dvb-t/fi-Vammala_Roismala | 4 + util/scan/dvb-t/fi-Vammala_Savi | 4 + util/scan/dvb-t/fi-Vantaa_Hakunila | 6 + util/scan/dvb-t/fi-Varpaisjarvi_Honkamaki | 5 + util/scan/dvb-t/fi-Virrat_Lappavuori | 5 + util/scan/dvb-t/fi-Vuokatti | 6 + util/scan/dvb-t/fi-Vuotso | 4 + util/scan/dvb-t/fi-Ylitornio_Ainiovaara | 5 + util/scan/dvb-t/fi-Ylitornio_Raanujarvi | 4 + util/scan/dvb-t/fi-Yllas | 4 + util/scan/dvb-t/fr-Abbeville | 25 + util/scan/dvb-t/fr-Agen | 25 + util/scan/dvb-t/fr-Ajaccio | 25 + util/scan/dvb-t/fr-Albi | 25 + util/scan/dvb-t/fr-Alençon | 25 + util/scan/dvb-t/fr-Ales | 25 + util/scan/dvb-t/fr-Ales-Bouquet | 25 + util/scan/dvb-t/fr-Amiens | 25 + util/scan/dvb-t/fr-Angers | 25 + util/scan/dvb-t/fr-Annecy | 25 + util/scan/dvb-t/fr-Arcachon | 25 + util/scan/dvb-t/fr-Argenton | 25 + util/scan/dvb-t/fr-Aubenas | 25 + util/scan/dvb-t/fr-Aurillac | 25 + util/scan/dvb-t/fr-Autun | 25 + util/scan/dvb-t/fr-Auxerre | 25 + util/scan/dvb-t/fr-Avignon | 25 + util/scan/dvb-t/fr-BarleDuc | 25 + util/scan/dvb-t/fr-Bastia | 25 + util/scan/dvb-t/fr-Bayonne | 25 + util/scan/dvb-t/fr-Bergerac | 25 + util/scan/dvb-t/fr-Besançon | 25 + util/scan/dvb-t/fr-Bordeaux | 9 + util/scan/dvb-t/fr-Bordeaux-Bouliac | 25 + util/scan/dvb-t/fr-Bordeaux-Cauderan | 25 + util/scan/dvb-t/fr-Boulogne | 25 + util/scan/dvb-t/fr-Bourges | 25 + util/scan/dvb-t/fr-Brest | 9 + util/scan/dvb-t/fr-Brive | 25 + util/scan/dvb-t/fr-Caen | 25 + util/scan/dvb-t/fr-Caen-Pincon | 25 + util/scan/dvb-t/fr-Cannes | 25 + util/scan/dvb-t/fr-Carcassonne | 25 + util/scan/dvb-t/fr-Chambery | 30 + util/scan/dvb-t/fr-Chartres | 25 + util/scan/dvb-t/fr-Chennevieres | 25 + util/scan/dvb-t/fr-Cherbourg | 25 + util/scan/dvb-t/fr-ClermontFerrand | 25 + util/scan/dvb-t/fr-Cluses | 23 + util/scan/dvb-t/fr-Dieppe | 25 + util/scan/dvb-t/fr-Dijon | 28 + util/scan/dvb-t/fr-Dunkerque | 30 + util/scan/dvb-t/fr-Epinal | 25 + util/scan/dvb-t/fr-Evreux | 25 + util/scan/dvb-t/fr-Forbach | 30 + util/scan/dvb-t/fr-Gex | 30 + util/scan/dvb-t/fr-Grenoble | 25 + util/scan/dvb-t/fr-Gueret | 25 + util/scan/dvb-t/fr-Hirson | 30 + util/scan/dvb-t/fr-Hyeres | 25 + util/scan/dvb-t/fr-LaRochelle | 25 + util/scan/dvb-t/fr-Laval | 25 + util/scan/dvb-t/fr-LeCreusot | 25 + util/scan/dvb-t/fr-LeHavre | 25 + util/scan/dvb-t/fr-LeMans | 21 + util/scan/dvb-t/fr-LePuyEnVelay | 25 + util/scan/dvb-t/fr-Lille | 30 + util/scan/dvb-t/fr-Lille-Lambersart | 25 + util/scan/dvb-t/fr-LilleT2 | 13 + util/scan/dvb-t/fr-Limoges | 25 + util/scan/dvb-t/fr-Longwy | 30 + util/scan/dvb-t/fr-Lorient | 25 + util/scan/dvb-t/fr-Lyon-Fourviere | 18 + util/scan/dvb-t/fr-Lyon-Pilat | 17 + util/scan/dvb-t/fr-Macon | 30 + util/scan/dvb-t/fr-Mantes | 25 + util/scan/dvb-t/fr-Marseille | 6 + util/scan/dvb-t/fr-Maubeuge | 30 + util/scan/dvb-t/fr-Meaux | 25 + util/scan/dvb-t/fr-Mende | 25 + util/scan/dvb-t/fr-Menton | 25 + util/scan/dvb-t/fr-Metz | 30 + util/scan/dvb-t/fr-Mezieres | 30 + util/scan/dvb-t/fr-Montbeliard | 18 + util/scan/dvb-t/fr-Montlucon | 25 + util/scan/dvb-t/fr-Montpellier | 25 + util/scan/dvb-t/fr-Mulhouse | 26 + util/scan/dvb-t/fr-Nancy | 25 + util/scan/dvb-t/fr-Nantes | 8 + util/scan/dvb-t/fr-NeufchatelEnBray | 25 + util/scan/dvb-t/fr-Nice | 25 + util/scan/dvb-t/fr-Niort | 7 + util/scan/dvb-t/fr-Orleans | 17 + util/scan/dvb-t/fr-Paris | 19 + util/scan/dvb-t/fr-Parthenay | 25 + util/scan/dvb-t/fr-Perpignan | 25 + util/scan/dvb-t/fr-Poitiers | 25 + util/scan/dvb-t/fr-Privas | 25 + util/scan/dvb-t/fr-Reims | 25 + util/scan/dvb-t/fr-Rennes | 7 + util/scan/dvb-t/fr-Roanne | 25 + util/scan/dvb-t/fr-Rouen | 8 + util/scan/dvb-t/fr-SaintEtienne | 25 + util/scan/dvb-t/fr-SaintRaphael | 25 + util/scan/dvb-t/fr-Sannois | 25 + util/scan/dvb-t/fr-Sarrebourg | 30 + util/scan/dvb-t/fr-Sens | 25 + util/scan/dvb-t/fr-Strasbourg | 18 + util/scan/dvb-t/fr-Toulon | 25 + util/scan/dvb-t/fr-Toulouse | 8 + util/scan/dvb-t/fr-Toulouse-Midi | 25 + util/scan/dvb-t/fr-Tours | 25 + util/scan/dvb-t/fr-Troyes | 25 + util/scan/dvb-t/fr-Ussel | 25 + util/scan/dvb-t/fr-Valence | 25 + util/scan/dvb-t/fr-Valenciennes | 30 + util/scan/dvb-t/fr-Vannes | 7 + util/scan/dvb-t/fr-Villebon | 22 + util/scan/dvb-t/fr-Vittel | 30 + util/scan/dvb-t/fr-Voiron | 30 + util/scan/dvb-t/gr-Athens | 3 + util/scan/dvb-t/hk-HongKong | 18 + util/scan/dvb-t/hr-Zagreb | 3 + util/scan/dvb-t/is-Reykjavik | 13 + util/scan/dvb-t/it-Aosta | 21 + util/scan/dvb-t/it-Bari | 18 + util/scan/dvb-t/it-Bologna | 28 + util/scan/dvb-t/it-Bolzano | 5 + util/scan/dvb-t/it-Cagliari | 23 + util/scan/dvb-t/it-Caivano | 17 + util/scan/dvb-t/it-Catania | 27 + util/scan/dvb-t/it-Conero | 8 + util/scan/dvb-t/it-Firenze | 20 + util/scan/dvb-t/it-Genova | 12 + util/scan/dvb-t/it-Livorno | 15 + util/scan/dvb-t/it-Milano | 15 + util/scan/dvb-t/it-Pagnacco | 27 + util/scan/dvb-t/it-Palermo | 23 + util/scan/dvb-t/it-Pescara | 15 + util/scan/dvb-t/it-Pisa | 18 + util/scan/dvb-t/it-Roma | 16 + util/scan/dvb-t/it-S-Stefano_al_mare | 19 + util/scan/dvb-t/it-Sassari | 33 + util/scan/dvb-t/it-Torino | 13 + util/scan/dvb-t/it-Trieste | 23 + util/scan/dvb-t/it-Varese | 16 + util/scan/dvb-t/it-Venezia | 19 + util/scan/dvb-t/it-Verona | 19 + util/scan/dvb-t/lu-All | 5 + util/scan/dvb-t/lv-Riga | 25 + util/scan/dvb-t/nl-All | 42 + util/scan/dvb-t/nl-AlphenaandenRijn | 7 + util/scan/dvb-t/nl-Randstad | 7 + util/scan/dvb-t/no-Trondelag_Stjordal | 7 + util/scan/dvb-t/nz-Waiatarua | 13 + util/scan/dvb-t/pl-Rzeszow | 3 + util/scan/dvb-t/pl-Warszawa | 4 + util/scan/dvb-t/pl-Wroclaw | 3 + util/scan/dvb-t/se-Alvdalen_Brunnsberg | 3 + util/scan/dvb-t/se-Alvdalsasen | 3 + util/scan/dvb-t/se-Alvsbyn | 7 + util/scan/dvb-t/se-Amot | 3 + util/scan/dvb-t/se-Ange_Snoberg | 6 + util/scan/dvb-t/se-Angebo | 3 + util/scan/dvb-t/se-Angelholm_Vegeholm | 7 + util/scan/dvb-t/se-Arvidsjaur_Jultrask | 6 + util/scan/dvb-t/se-Aspeboda | 3 + util/scan/dvb-t/se-Atvidaberg | 4 + util/scan/dvb-t/se-Avesta_Krylbo | 4 + util/scan/dvb-t/se-Backefors | 7 + util/scan/dvb-t/se-Bankeryd | 4 + util/scan/dvb-t/se-Bergsjo_Balleberget | 3 + util/scan/dvb-t/se-Bergvik | 3 + util/scan/dvb-t/se-Bollebygd | 4 + util/scan/dvb-t/se-Bollnas | 6 + util/scan/dvb-t/se-Boras_Dalsjofors | 7 + util/scan/dvb-t/se-Boras_Sjobo | 4 + util/scan/dvb-t/se-Borlange_Idkerberget | 6 + util/scan/dvb-t/se-Borlange_Nygardarna | 4 + util/scan/dvb-t/se-Bottnaryd_Ryd | 3 + util/scan/dvb-t/se-Bromsebro | 4 + util/scan/dvb-t/se-Bruzaholm | 3 + util/scan/dvb-t/se-Byxelkrok | 4 + util/scan/dvb-t/se-Dadran | 3 + util/scan/dvb-t/se-Dalfors | 3 + util/scan/dvb-t/se-Dalstuga | 3 + util/scan/dvb-t/se-Degerfors | 6 + util/scan/dvb-t/se-Delary | 3 + util/scan/dvb-t/se-Djura | 3 + util/scan/dvb-t/se-Drevdagen | 3 + util/scan/dvb-t/se-Duvnas | 3 + util/scan/dvb-t/se-Duvnas_Basna | 3 + util/scan/dvb-t/se-Edsbyn | 3 + util/scan/dvb-t/se-Emmaboda_Balshult | 6 + util/scan/dvb-t/se-Enviken | 4 + util/scan/dvb-t/se-Fagersta | 4 + util/scan/dvb-t/se-Falerum_Centrum | 3 + util/scan/dvb-t/se-Falun_Lovberget | 6 + util/scan/dvb-t/se-Farila | 3 + util/scan/dvb-t/se-Faro_Ajkerstrask | 4 + util/scan/dvb-t/se-Farosund_Bunge | 7 + util/scan/dvb-t/se-Filipstad_Klockarhojden | 6 + util/scan/dvb-t/se-Finnveden | 6 + util/scan/dvb-t/se-Fredriksberg | 3 + util/scan/dvb-t/se-Fritsla | 3 + util/scan/dvb-t/se-Furudal | 3 + util/scan/dvb-t/se-Gallivare | 6 + util/scan/dvb-t/se-Garpenberg_Kuppgarden | 3 + util/scan/dvb-t/se-Gavle | 6 + util/scan/dvb-t/se-Gavle_Skogmur | 6 + util/scan/dvb-t/se-Gnarp | 3 + util/scan/dvb-t/se-Gnesta | 4 + util/scan/dvb-t/se-Gnosjo_Marieholm | 3 + util/scan/dvb-t/se-Goteborg_Brudaremossen | 7 + util/scan/dvb-t/se-Goteborg_Slattadamm | 7 + util/scan/dvb-t/se-Gullbrandstorp | 3 + util/scan/dvb-t/se-Gunnarsbo | 3 + util/scan/dvb-t/se-Gusum | 3 + util/scan/dvb-t/se-Hagfors_Varmullsasen | 6 + util/scan/dvb-t/se-Hallaryd | 3 + util/scan/dvb-t/se-Hallbo | 3 + util/scan/dvb-t/se-Halmstad_Hamnen | 4 + util/scan/dvb-t/se-Halmstad_Oskarstrom | 6 + util/scan/dvb-t/se-Harnosand_Harnon | 6 + util/scan/dvb-t/se-Hassela | 3 + util/scan/dvb-t/se-Havdhem | 7 + util/scan/dvb-t/se-Hedemora | 3 + util/scan/dvb-t/se-Helsingborg_Olympia | 7 + util/scan/dvb-t/se-Hennan | 3 + util/scan/dvb-t/se-Hestra_Aspas | 3 + util/scan/dvb-t/se-Hjo_Grevback | 3 + util/scan/dvb-t/se-Hofors | 6 + util/scan/dvb-t/se-Hogfors | 3 + util/scan/dvb-t/se-Hogsby_Virstad | 4 + util/scan/dvb-t/se-Holsbybrunn_Holsbyholm | 3 + util/scan/dvb-t/se-Horby_Sallerup | 7 + util/scan/dvb-t/se-Horken | 3 + util/scan/dvb-t/se-Hudiksvall_Forsa | 6 + util/scan/dvb-t/se-Hudiksvall_Galgberget | 4 + util/scan/dvb-t/se-Huskvarna | 3 + util/scan/dvb-t/se-Idre | 3 + util/scan/dvb-t/se-Ingatorp | 3 + util/scan/dvb-t/se-Ingvallsbenning | 3 + util/scan/dvb-t/se-Irevik | 4 + util/scan/dvb-t/se-Jamjo | 4 + util/scan/dvb-t/se-Jarnforsen | 3 + util/scan/dvb-t/se-Jarvso | 3 + util/scan/dvb-t/se-Jokkmokk_Tjalmejaure | 6 + util/scan/dvb-t/se-Jonkoping_Bondberget | 6 + util/scan/dvb-t/se-Kalix | 6 + util/scan/dvb-t/se-Karbole | 3 + util/scan/dvb-t/se-Karlsborg_Vaberget | 3 + util/scan/dvb-t/se-Karlshamn | 6 + util/scan/dvb-t/se-Karlskrona_Vamo | 6 + util/scan/dvb-t/se-Karlstad_Sormon | 9 + util/scan/dvb-t/se-Kaxholmen_Vistakulle | 3 + util/scan/dvb-t/se-Kinnastrom | 3 + util/scan/dvb-t/se-Kiruna_Kirunavaara | 6 + util/scan/dvb-t/se-Kisa | 7 + util/scan/dvb-t/se-Knared | 3 + util/scan/dvb-t/se-Kopmanholmen | 6 + util/scan/dvb-t/se-Kopparberg | 4 + util/scan/dvb-t/se-Kramfors_Lugnvik | 6 + util/scan/dvb-t/se-Kristinehamn_Utsiktsberget | 6 + util/scan/dvb-t/se-Kungsater | 3 + util/scan/dvb-t/se-Kungsberget_GI | 3 + util/scan/dvb-t/se-Langshyttan | 3 + util/scan/dvb-t/se-Langshyttan_Engelsfors | 3 + util/scan/dvb-t/se-Leksand_Karingberget | 3 + util/scan/dvb-t/se-Lerdala | 3 + util/scan/dvb-t/se-Lilltjara_Digerberget | 3 + util/scan/dvb-t/se-Limedsforsen | 3 + util/scan/dvb-t/se-Lindshammar_Ramkvilla | 3 + util/scan/dvb-t/se-Linkoping_Vattentornet | 7 + util/scan/dvb-t/se-Ljugarn | 4 + util/scan/dvb-t/se-Loffstrand | 6 + util/scan/dvb-t/se-Lonneberga | 4 + util/scan/dvb-t/se-Lorstrand | 3 + util/scan/dvb-t/se-Ludvika_Bjorkasen | 4 + util/scan/dvb-t/se-Lumsheden_Trekanten | 3 + util/scan/dvb-t/se-Lycksele_Knaften | 6 + util/scan/dvb-t/se-Mahult | 3 + util/scan/dvb-t/se-Malmo_Jagersro | 7 + util/scan/dvb-t/se-Malung | 4 + util/scan/dvb-t/se-Mariannelund | 3 + util/scan/dvb-t/se-Markaryd_Hualtet | 4 + util/scan/dvb-t/se-Matfors | 6 + util/scan/dvb-t/se-Molnbo_Tallstugan | 2 + util/scan/dvb-t/se-Molndal_Vasterberget | 7 + util/scan/dvb-t/se-Mora_Eldris | 6 + util/scan/dvb-t/se-Motala_Ervasteby | 7 + util/scan/dvb-t/se-Mullsjo_Torestorp | 4 + util/scan/dvb-t/se-Nassjo | 6 + util/scan/dvb-t/se-Navekvarn | 3 + util/scan/dvb-t/se-Norrahammar | 3 + util/scan/dvb-t/se-Norrkoping_Krokek | 7 + util/scan/dvb-t/se-Norrtalje_Sodra_Bergen | 7 + util/scan/dvb-t/se-Nykoping | 3 + util/scan/dvb-t/se-Orebro_Lockhyttan | 7 + util/scan/dvb-t/se-Ornskoldsvik_As | 6 + util/scan/dvb-t/se-Oskarshamn | 6 + util/scan/dvb-t/se-Ostersund_Brattasen | 7 + util/scan/dvb-t/se-Osthammar_Valo | 7 + util/scan/dvb-t/se-Overkalix | 6 + util/scan/dvb-t/se-Oxberg | 3 + util/scan/dvb-t/se-Pajala | 6 + util/scan/dvb-t/se-Paulistom | 3 + util/scan/dvb-t/se-Rattvik | 3 + util/scan/dvb-t/se-Rengsjo | 3 + util/scan/dvb-t/se-Rorbacksnas | 3 + util/scan/dvb-t/se-Sagmyra | 3 + util/scan/dvb-t/se-Salen | 3 + util/scan/dvb-t/se-Salfjallet | 3 + util/scan/dvb-t/se-Sarna_Mickeltemplet | 3 + util/scan/dvb-t/se-Satila | 3 + util/scan/dvb-t/se-Saxdalen | 3 + util/scan/dvb-t/se-Siljansnas_Uvberget | 3 + util/scan/dvb-t/se-Skarstad | 3 + util/scan/dvb-t/se-Skattungbyn | 3 + util/scan/dvb-t/se-Skelleftea | 6 + util/scan/dvb-t/se-Skene_Nycklarberget | 3 + util/scan/dvb-t/se-Skovde | 7 + util/scan/dvb-t/se-Smedjebacken_Uvberget | 6 + util/scan/dvb-t/se-Soderhamn | 4 + util/scan/dvb-t/se-Soderkoping | 4 + util/scan/dvb-t/se-Sodertalje_Ragnhildsborg | 8 + util/scan/dvb-t/se-Solleftea_Hallsta | 6 + util/scan/dvb-t/se-Solleftea_Multra | 6 + util/scan/dvb-t/se-Sorsjon | 3 + util/scan/dvb-t/se-Stockholm_Marieberg | 7 + util/scan/dvb-t/se-Stockholm_Nacka | 8 + util/scan/dvb-t/se-Stora_Skedvi | 3 + util/scan/dvb-t/se-Storfjaten | 3 + util/scan/dvb-t/se-Storuman | 6 + util/scan/dvb-t/se-Stromstad | 7 + util/scan/dvb-t/se-Styrsjobo | 3 + util/scan/dvb-t/se-Sundborn | 3 + util/scan/dvb-t/se-Sundsbruk | 6 + util/scan/dvb-t/se-Sundsvall_S_Stadsberget | 7 + util/scan/dvb-t/se-Sunne_Blabarskullen | 6 + util/scan/dvb-t/se-Svartnas | 3 + util/scan/dvb-t/se-Sveg_Brickan | 6 + util/scan/dvb-t/se-Taberg | 3 + util/scan/dvb-t/se-Tandadalen | 3 + util/scan/dvb-t/se-Tasjo | 6 + util/scan/dvb-t/se-Tollsjo | 3 + util/scan/dvb-t/se-Torsby_Bada | 6 + util/scan/dvb-t/se-Tranas_Bredkarr | 4 + util/scan/dvb-t/se-Tranemo | 3 + util/scan/dvb-t/se-Transtrand_Bolheden | 4 + util/scan/dvb-t/se-Traryd_Betas | 4 + util/scan/dvb-t/se-Trollhattan | 7 + util/scan/dvb-t/se-Trosa | 4 + util/scan/dvb-t/se-Tystberga | 3 + util/scan/dvb-t/se-Uddevalla_Herrestad | 7 + util/scan/dvb-t/se-Ullared | 3 + util/scan/dvb-t/se-Ulricehamn | 4 + util/scan/dvb-t/se-Ulvshyttan_Porjus | 3 + util/scan/dvb-t/se-Uppsala_Rickomberga | 3 + util/scan/dvb-t/se-Uppsala_Vedyxa | 7 + util/scan/dvb-t/se-Vaddo_Elmsta | 4 + util/scan/dvb-t/se-Valdemarsvik | 4 + util/scan/dvb-t/se-Vannas_Granlundsberget | 6 + util/scan/dvb-t/se-Vansbro_Hummelberget | 3 + util/scan/dvb-t/se-Varberg_Grimeton | 6 + util/scan/dvb-t/se-Vasteras_Lillharad | 7 + util/scan/dvb-t/se-Vastervik_Farhult | 6 + util/scan/dvb-t/se-Vaxbo | 3 + util/scan/dvb-t/se-Vessigebro | 3 + util/scan/dvb-t/se-Vetlanda_Nye | 3 + util/scan/dvb-t/se-Vikmanshyttan | 3 + util/scan/dvb-t/se-Virserum | 6 + util/scan/dvb-t/se-Visby_Follingbo | 7 + util/scan/dvb-t/se-Visby_Hamnen | 7 + util/scan/dvb-t/se-Visingso | 3 + util/scan/dvb-t/se-Vislanda_Nydala | 6 + util/scan/dvb-t/se-Voxna | 3 + util/scan/dvb-t/se-Ystad_Metallgatan | 7 + util/scan/dvb-t/se-Yttermalung | 3 + util/scan/dvb-t/sk-BanskaBystrica | 4 + util/scan/dvb-t/sk-Bratislava | 4 + util/scan/dvb-t/sk-Kosice | 4 + util/scan/dvb-t/tw-Kaohsiung | 6 + util/scan/dvb-t/tw-Taipei | 7 + util/scan/dvb-t/uk-Aberdare | 10 + util/scan/dvb-t/uk-Angus | 10 + util/scan/dvb-t/uk-BeaconHill | 10 + util/scan/dvb-t/uk-Belmont | 10 + util/scan/dvb-t/uk-Bilsdale | 10 + util/scan/dvb-t/uk-BlackHill | 11 + util/scan/dvb-t/uk-Blaenplwyf | 10 + util/scan/dvb-t/uk-BluebellHill | 10 + util/scan/dvb-t/uk-Bressay | 10 + util/scan/dvb-t/uk-BrierleyHill | 10 + util/scan/dvb-t/uk-BristolIlchesterCres | 10 + util/scan/dvb-t/uk-BristolKingsWeston | 10 + util/scan/dvb-t/uk-Bromsgrove | 10 + util/scan/dvb-t/uk-BrougherMountain | 10 + util/scan/dvb-t/uk-Caldbeck | 10 + util/scan/dvb-t/uk-CaradonHill | 10 + util/scan/dvb-t/uk-Carmel | 10 + util/scan/dvb-t/uk-Chatton | 10 + util/scan/dvb-t/uk-Chesterfield | 10 + util/scan/dvb-t/uk-Craigkelly | 10 + util/scan/dvb-t/uk-CrystalPalace | 11 + util/scan/dvb-t/uk-Darvel | 10 + util/scan/dvb-t/uk-Divis | 10 + util/scan/dvb-t/uk-Dover | 14 + util/scan/dvb-t/uk-Durris | 10 + util/scan/dvb-t/uk-Eitshal | 10 + util/scan/dvb-t/uk-EmleyMoor | 10 + util/scan/dvb-t/uk-Fenham | 10 + util/scan/dvb-t/uk-Fenton | 10 + util/scan/dvb-t/uk-Ferryside | 8 + util/scan/dvb-t/uk-Guildford | 10 + util/scan/dvb-t/uk-Hannington | 9 + util/scan/dvb-t/uk-Hastings | 10 + util/scan/dvb-t/uk-Heathfield | 10 + util/scan/dvb-t/uk-HemelHempstead | 10 + util/scan/dvb-t/uk-HuntshawCross | 13 + util/scan/dvb-t/uk-Idle | 10 + util/scan/dvb-t/uk-KeelylangHill | 10 + util/scan/dvb-t/uk-Keighley | 10 + util/scan/dvb-t/uk-KilveyHill | 10 + util/scan/dvb-t/uk-KnockMore | 10 + util/scan/dvb-t/uk-Lancaster | 10 + util/scan/dvb-t/uk-LarkStoke | 10 + util/scan/dvb-t/uk-Limavady | 10 + util/scan/dvb-t/uk-Llanddona | 10 + util/scan/dvb-t/uk-Malvern | 10 + util/scan/dvb-t/uk-Mendip | 10 + util/scan/dvb-t/uk-Midhurst | 10 + util/scan/dvb-t/uk-Moel-y-Parc | 10 + util/scan/dvb-t/uk-Nottingham | 10 + util/scan/dvb-t/uk-OliversMount | 10 + util/scan/dvb-t/uk-Oxford | 11 + util/scan/dvb-t/uk-PendleForest | 10 + util/scan/dvb-t/uk-Plympton | 10 + util/scan/dvb-t/uk-PontopPike | 11 + util/scan/dvb-t/uk-Pontypool | 10 + util/scan/dvb-t/uk-Presely | 10 + util/scan/dvb-t/uk-Redruth | 9 + util/scan/dvb-t/uk-Reigate | 11 + util/scan/dvb-t/uk-RidgeHill | 10 + util/scan/dvb-t/uk-Rosemarkie | 10 + util/scan/dvb-t/uk-Rosneath | 10 + util/scan/dvb-t/uk-Rowridge | 11 + util/scan/dvb-t/uk-RumsterForest | 10 + util/scan/dvb-t/uk-Saddleworth | 10 + util/scan/dvb-t/uk-Salisbury | 10 + util/scan/dvb-t/uk-SandyHeath | 11 + util/scan/dvb-t/uk-Selkirk | 10 + util/scan/dvb-t/uk-Sheffield | 10 + util/scan/dvb-t/uk-StocklandHill | 10 + util/scan/dvb-t/uk-Storeton | 9 + util/scan/dvb-t/uk-Sudbury | 12 + util/scan/dvb-t/uk-SuttonColdfield | 10 + util/scan/dvb-t/uk-Tacolneston | 10 + util/scan/dvb-t/uk-TheWrekin | 15 + util/scan/dvb-t/uk-Torosay | 10 + util/scan/dvb-t/uk-TunbridgeWells | 10 + util/scan/dvb-t/uk-Waltham | 10 + util/scan/dvb-t/uk-Wenvoe | 10 + util/scan/dvb-t/uk-WhitehawkHill | 10 + util/scan/dvb-t/uk-WinterHill | 14 + util/scan/dvb-t/vn-Hanoi | 5 + util/scan/list.h | 6 + util/scan/lnb.c | 1 + util/scan/lnb.h | 2 + util/scan/scan.c | 62 + util/scan/scan.h | 1 + util/scan/section_generate.pl | 92 + util/szap/Makefile | 39 + util/szap/README | 23 + util/szap/azap.c | 8 + util/szap/channels-conf/atsc/make_atsc_chanconf.pl | 110 + util/szap/channels-conf/atsc/us-Raleigh-Durham | 8 + util/szap/channels-conf/dvb-c/de-Berlin | 171 + util/szap/channels-conf/dvb-s/Astra-19.2E | 226 + util/szap/channels-conf/dvb-s/Astra-28.2E | 522 + + util/szap/channels-conf/dvb-s/BrasilSat-B3-84.0W | 39 + util/szap/channels-conf/dvb-t/au-Adelaide | 28 + util/szap/channels-conf/dvb-t/au-Brisbane | 29 + util/szap/channels-conf/dvb-t/au-Hobart | 18 + util/szap/channels-conf/dvb-t/au-Melbourne | 17 + util/szap/channels-conf/dvb-t/au-Sydney-NorthShore | 31 + util/szap/channels-conf/dvb-t/cz-Praha | 16 + util/szap/channels-conf/dvb-t/de-Berlin | 47 + util/szap/channels-conf/dvb-t/de-Braunschweig | 25 + util/szap/channels-conf/dvb-t/de-Bremen | 25 + util/szap/channels-conf/dvb-t/de-Koeln-Bonn | 23 + util/szap/channels-conf/dvb-t/de-Leipzig | 7 + util/szap/channels-conf/dvb-t/de-Luebeck | 22 + util/szap/channels-conf/dvb-t/de-Rhein-Main | 6 + util/szap/channels-conf/dvb-t/de-Ruhrgebiet | 46 + util/szap/channels-conf/dvb-t/es-Alpicat | 19 + util/szap/channels-conf/dvb-t/es-Collserola | 19 + util/szap/channels-conf/dvb-t/es-Madrid | 26 + util/szap/channels-conf/dvb-t/es-Mussara | 19 + util/szap/channels-conf/dvb-t/uk-Crystal-Palace | 67 + util/szap/channels-conf/dvb-t/uk-Hannington | 28 + util/szap/channels-conf/dvb-t/uk-Oxford | 41 + util/szap/channels-conf/dvb-t/uk-Reigate | 51 + util/szap/channels-conf/dvb-t/uk-Sandy-Heath | 12 + util/szap/channels.conf-dvbc-berlin | 171 + util/szap/channels.conf-dvbs-astra | 226 + util/szap/channels.conf-dvbt-australia | 31 + util/szap/channels.conf-dvbt-berlin | 51 + util/szap/channels.conf-dvbt-collserola | 25 + util/szap/channels.conf-dvbt-crystal-palace | 70 + util/szap/channels.conf-dvbt-hannington | 28 + util/szap/channels.conf-dvbt-madrid | 16 + util/szap/channels.conf-dvbt-oxford | 41 + util/szap/channels.conf-dvbt-reigate | 51 + util/szap/channels.conf-dvbt-sandy_heath | 13 + util/szap/czap.c | 145 + util/szap/femon.c | 149 + util/szap/lnb.c | 101 + util/szap/lnb.h | 22 + util/szap/szap.c | 220 + util/szap/tzap.c | 344 + util/ttusb_dec_reset/Makefile | 28 + util/ttusb_dec_reset/ttusb_dec_reset.c | 4 + util/zap/Makefile | 20 + util/zap/zap.c | 226 + util/zap/zap_ca.c | 198 + util/zap/zap_ca.h | 37 + util/zap/zap_dvb.c | 353 + + util/zap/zap_dvb.h | 41 + 1328 files changed, 71527 insertions(+), 3595 deletions(-) +diff -Nurd linuxtv-dvb-apps-1.1.1/COPYING dvb-apps/COPYING +--- linuxtv-dvb-apps-1.1.1/COPYING 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/COPYING 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,339 @@ ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 ++ ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++License is intended to guarantee your freedom to share and change free ++software--to make sure the software is free for all its users. This ++General Public License applies to most of the Free Software ++Foundation's software and to any other program whose authors commit to ++using it. (Some other Free Software Foundation software is covered by ++the GNU Lesser General Public License instead.) You can apply it to ++your programs, too. ++ ++ When we speak of free software, we are referring to freedom, not ++price. Our General Public Licenses are designed to make sure that you ++have the freedom to distribute copies of free software (and charge for ++this service if you wish), that you receive source code or can get it ++if you want it, that you can change the software or use pieces of it ++in new free programs; and that you know you can do these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++anyone to deny you these rights or to ask you to surrender the rights. ++These restrictions translate to certain responsibilities for you if you ++distribute copies of the software, or if you modify it. ++ ++ For example, if you distribute copies of such a program, whether ++gratis or for a fee, you must give the recipients all the rights that ++you have. You must make sure that they, too, receive or can get the ++source code. And you must show them these terms so they know their ++rights. ++ ++ We protect your rights with two steps: (1) copyright the software, and ++(2) offer you this license which gives you legal permission to copy, ++distribute and/or modify the software. ++ ++ Also, for each author's protection and ours, we want to make certain ++that everyone understands that there is no warranty for this free ++software. If the software is modified by someone else and passed on, we ++want its recipients to know that what they have is not the original, so ++that any problems introduced by others will not reflect on the original ++authors' reputations. ++ ++ Finally, any free program is threatened constantly by software ++patents. We wish to avoid the danger that redistributors of a free ++program will individually obtain patent licenses, in effect making the ++program proprietary. To prevent this, we have made it clear that any ++patent must be licensed for everyone's free use or not licensed at all. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. ++ ++ GNU GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License applies to any program or other work which contains ++a notice placed by the copyright holder saying it may be distributed ++under the terms of this General Public License. The "Program", below, ++refers to any such program or work, and a "work based on the Program" ++means either the Program or any derivative work under copyright law: ++that is to say, a work containing the Program or a portion of it, ++either verbatim or with modifications and/or translated into another ++language. (Hereinafter, translation is included without limitation in ++the term "modification".) Each licensee is addressed as "you". ++ ++Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running the Program is not restricted, and the output from the Program ++is covered only if its contents constitute a work based on the ++Program (independent of having been made by running the Program). ++Whether that is true depends on what the Program does. ++ ++ 1. You may copy and distribute verbatim copies of the Program's ++source code as you receive it, in any medium, provided that you ++conspicuously and appropriately publish on each copy an appropriate ++copyright notice and disclaimer of warranty; keep intact all the ++notices that refer to this License and to the absence of any warranty; ++and give any other recipients of the Program a copy of this License ++along with the Program. ++ ++You may charge a fee for the physical act of transferring a copy, and ++you may at your option offer warranty protection in exchange for a fee. ++ ++ 2. You may modify your copy or copies of the Program or any portion ++of it, thus forming a work based on the Program, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) You must cause the modified files to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ b) You must cause any work that you distribute or publish, that in ++ whole or in part contains or is derived from the Program or any ++ part thereof, to be licensed as a whole at no charge to all third ++ parties under the terms of this License. ++ ++ c) If the modified program normally reads commands interactively ++ when run, you must cause it, when started running for such ++ interactive use in the most ordinary way, to print or display an ++ announcement including an appropriate copyright notice and a ++ notice that there is no warranty (or else, saying that you provide ++ a warranty) and that users may redistribute the program under ++ these conditions, and telling the user how to view a copy of this ++ License. (Exception: if the Program itself is interactive but ++ does not normally print such an announcement, your work based on ++ the Program is not required to print an announcement.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Program, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Program, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Program. ++ ++In addition, mere aggregation of another work not based on the Program ++with the Program (or with a work based on the Program) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may copy and distribute the Program (or a work based on it, ++under Section 2) in object code or executable form under the terms of ++Sections 1 and 2 above provided that you also do one of the following: ++ ++ a) Accompany it with the complete corresponding machine-readable ++ source code, which must be distributed under the terms of Sections ++ 1 and 2 above on a medium customarily used for software interchange; or, ++ ++ b) Accompany it with a written offer, valid for at least three ++ years, to give any third party, for a charge no more than your ++ cost of physically performing source distribution, a complete ++ machine-readable copy of the corresponding source code, to be ++ distributed under the terms of Sections 1 and 2 above on a medium ++ customarily used for software interchange; or, ++ ++ c) Accompany it with the information you received as to the offer ++ to distribute corresponding source code. (This alternative is ++ allowed only for noncommercial distribution and only if you ++ received the program in object code or executable form with such ++ an offer, in accord with Subsection b above.) ++ ++The source code for a work means the preferred form of the work for ++making modifications to it. For an executable work, complete source ++code means all the source code for all modules it contains, plus any ++associated interface definition files, plus the scripts used to ++control compilation and installation of the executable. However, as a ++special exception, the source code distributed need not include ++anything that is normally distributed (in either source or binary ++form) with the major components (compiler, kernel, and so on) of the ++operating system on which the executable runs, unless that component ++itself accompanies the executable. ++ ++If distribution of executable or object code is made by offering ++access to copy from a designated place, then offering equivalent ++access to copy the source code from the same place counts as ++distribution of the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 4. You may not copy, modify, sublicense, or distribute the Program ++except as expressly provided under this License. Any attempt ++otherwise to copy, modify, sublicense or distribute the Program is ++void, and will automatically terminate your rights under this License. ++However, parties who have received copies, or rights, from you under ++this License will not have their licenses terminated so long as such ++parties remain in full compliance. ++ ++ 5. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Program or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Program (or any work based on the ++Program), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Program or works based on it. ++ ++ 6. Each time you redistribute the Program (or any work based on the ++Program), the recipient automatically receives a license from the ++original licensor to copy, distribute or modify the Program subject to ++these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties to ++this License. ++ ++ 7. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Program at all. For example, if a patent ++license would not permit royalty-free redistribution of the Program by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Program. ++ ++If any portion of this section is held invalid or unenforceable under ++any particular circumstance, the balance of the section is intended to ++apply and the section as a whole is intended to apply in other ++circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system, which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 8. If the distribution and/or use of the Program is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Program under this License ++may add an explicit geographical distribution limitation excluding ++those countries, so that distribution is permitted only in or among ++countries not thus excluded. In such case, this License incorporates ++the limitation as if written in the body of this License. ++ ++ 9. The Free Software Foundation may publish revised and/or new versions ++of the General Public License from time to time. Such new versions will ++be similar in spirit to the present version, but may differ in detail to ++address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Program ++specifies a version number of this License which applies to it and "any ++later version", you have the option of following the terms and conditions ++either of that version or of any later version published by the Free ++Software Foundation. If the Program does not specify a version number of ++this License, you may choose any version ever published by the Free Software ++Foundation. ++ ++ 10. If you wish to incorporate parts of the Program into other free ++programs whose distribution conditions are different, write to the author ++to ask for permission. For software which is copyrighted by the Free ++Software Foundation, write to the Free Software Foundation; we sometimes ++make exceptions for this. Our decision will be guided by the two goals ++of preserving the free status of all derivatives of our free software and ++of promoting the sharing and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY ++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN ++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES ++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED ++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS ++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, ++REPAIR OR CORRECTION. ++ ++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING ++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR ++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, ++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED ++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Programs ++ ++ If you develop a new program, and you want it to be of the greatest ++possible use to the public, the best way to achieve this is to make it ++free software which everyone can redistribute and change under these terms. ++ ++ To do so, attach the following notices to the program. It is safest ++to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least ++the "copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License along ++ with this program; if not, write to the Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++If the program is interactive, make it output a short notice like this ++when it starts in an interactive mode: ++ ++ Gnomovision version 69, Copyright (C) year name of author ++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. ++ This is free software, and you are welcome to redistribute it ++ under certain conditions; type `show c' for details. ++ ++The hypothetical commands `show w' and `show c' should show the appropriate ++parts of the General Public License. Of course, the commands you use may ++be called something other than `show w' and `show c'; they could even be ++mouse-clicks or menu items--whatever suits your program. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the program, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program ++ `Gnomovision' (which makes passes at compilers) written by James Hacker. ++ ++ , 1 April 1989 ++ Ty Coon, President of Vice ++ ++This General Public License does not permit incorporating your program into ++proprietary programs. If your program is a subroutine library, you may ++consider it more useful to permit linking proprietary applications with the ++library. If this is what you want to do, use the GNU Lesser General ++Public License instead of this License. +diff -Nurd linuxtv-dvb-apps-1.1.1/COPYING.LGPL dvb-apps/COPYING.LGPL +--- linuxtv-dvb-apps-1.1.1/COPYING.LGPL 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/COPYING.LGPL 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,502 @@ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ Version 2.1, February 1999 ++ ++ Copyright (C) 1991, 1999 Free Software Foundation, Inc. ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++[This is the first released version of the Lesser GPL. It also counts ++ as the successor of the GNU Library Public License, version 2, hence ++ the version number 2.1.] ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++Licenses are intended to guarantee your freedom to share and change ++free software--to make sure the software is free for all its users. ++ ++ This license, the Lesser General Public License, applies to some ++specially designated software packages--typically libraries--of the ++Free Software Foundation and other authors who decide to use it. You ++can use it too, but we suggest you first think carefully about whether ++this license or the ordinary General Public License is the better ++strategy to use in any particular case, based on the explanations below. ++ ++ When we speak of free software, we are referring to freedom of use, ++not price. Our General Public Licenses are designed to make sure that ++you have the freedom to distribute copies of free software (and charge ++for this service if you wish); that you receive source code or can get ++it if you want it; that you can change the software and use pieces of ++it in new free programs; and that you are informed that you can do ++these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++distributors to deny you these rights or to ask you to surrender these ++rights. These restrictions translate to certain responsibilities for ++you if you distribute copies of the library or if you modify it. ++ ++ For example, if you distribute copies of the library, whether gratis ++or for a fee, you must give the recipients all the rights that we gave ++you. You must make sure that they, too, receive or can get the source ++code. If you link other code with the library, you must provide ++complete object files to the recipients, so that they can relink them ++with the library after making changes to the library and recompiling ++it. And you must show them these terms so they know their rights. ++ ++ We protect your rights with a two-step method: (1) we copyright the ++library, and (2) we offer you this license, which gives you legal ++permission to copy, distribute and/or modify the library. ++ ++ To protect each distributor, we want to make it very clear that ++there is no warranty for the free library. Also, if the library is ++modified by someone else and passed on, the recipients should know ++that what they have is not the original version, so that the original ++author's reputation will not be affected by problems that might be ++introduced by others. ++ ++ Finally, software patents pose a constant threat to the existence of ++any free program. We wish to make sure that a company cannot ++effectively restrict the users of a free program by obtaining a ++restrictive license from a patent holder. Therefore, we insist that ++any patent license obtained for a version of the library must be ++consistent with the full freedom of use specified in this license. ++ ++ Most GNU software, including some libraries, is covered by the ++ordinary GNU General Public License. This license, the GNU Lesser ++General Public License, applies to certain designated libraries, and ++is quite different from the ordinary General Public License. We use ++this license for certain libraries in order to permit linking those ++libraries into non-free programs. ++ ++ When a program is linked with a library, whether statically or using ++a shared library, the combination of the two is legally speaking a ++combined work, a derivative of the original library. The ordinary ++General Public License therefore permits such linking only if the ++entire combination fits its criteria of freedom. The Lesser General ++Public License permits more lax criteria for linking other code with ++the library. ++ ++ We call this license the "Lesser" General Public License because it ++does Less to protect the user's freedom than the ordinary General ++Public License. It also provides other free software developers Less ++of an advantage over competing non-free programs. These disadvantages ++are the reason we use the ordinary General Public License for many ++libraries. However, the Lesser license provides advantages in certain ++special circumstances. ++ ++ For example, on rare occasions, there may be a special need to ++encourage the widest possible use of a certain library, so that it becomes ++a de-facto standard. To achieve this, non-free programs must be ++allowed to use the library. A more frequent case is that a free ++library does the same job as widely used non-free libraries. In this ++case, there is little to gain by limiting the free library to free ++software only, so we use the Lesser General Public License. ++ ++ In other cases, permission to use a particular library in non-free ++programs enables a greater number of people to use a large body of ++free software. For example, permission to use the GNU C Library in ++non-free programs enables many more people to use the whole GNU ++operating system, as well as its variant, the GNU/Linux operating ++system. ++ ++ Although the Lesser General Public License is Less protective of the ++users' freedom, it does ensure that the user of a program that is ++linked with the Library has the freedom and the wherewithal to run ++that program using a modified version of the Library. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. Pay close attention to the difference between a ++"work based on the library" and a "work that uses the library". The ++former contains code derived from the library, whereas the latter must ++be combined with the library in order to run. ++ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License Agreement applies to any software library or other ++program which contains a notice placed by the copyright holder or ++other authorized party saying it may be distributed under the terms of ++this Lesser General Public License (also called "this License"). ++Each licensee is addressed as "you". ++ ++ A "library" means a collection of software functions and/or data ++prepared so as to be conveniently linked with application programs ++(which use some of those functions and data) to form executables. ++ ++ The "Library", below, refers to any such software library or work ++which has been distributed under these terms. A "work based on the ++Library" means either the Library or any derivative work under ++copyright law: that is to say, a work containing the Library or a ++portion of it, either verbatim or with modifications and/or translated ++straightforwardly into another language. (Hereinafter, translation is ++included without limitation in the term "modification".) ++ ++ "Source code" for a work means the preferred form of the work for ++making modifications to it. For a library, complete source code means ++all the source code for all modules it contains, plus any associated ++interface definition files, plus the scripts used to control compilation ++and installation of the library. ++ ++ Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running a program using the Library is not restricted, and output from ++such a program is covered only if its contents constitute a work based ++on the Library (independent of the use of the Library in a tool for ++writing it). Whether that is true depends on what the Library does ++and what the program that uses the Library does. ++ ++ 1. You may copy and distribute verbatim copies of the Library's ++complete source code as you receive it, in any medium, provided that ++you conspicuously and appropriately publish on each copy an ++appropriate copyright notice and disclaimer of warranty; keep intact ++all the notices that refer to this License and to the absence of any ++warranty; and distribute a copy of this License along with the ++Library. ++ ++ You may charge a fee for the physical act of transferring a copy, ++and you may at your option offer warranty protection in exchange for a ++fee. ++ ++ 2. You may modify your copy or copies of the Library or any portion ++of it, thus forming a work based on the Library, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) The modified work must itself be a software library. ++ ++ b) You must cause the files modified to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ c) You must cause the whole of the work to be licensed at no ++ charge to all third parties under the terms of this License. ++ ++ d) If a facility in the modified Library refers to a function or a ++ table of data to be supplied by an application program that uses ++ the facility, other than as an argument passed when the facility ++ is invoked, then you must make a good faith effort to ensure that, ++ in the event an application does not supply such function or ++ table, the facility still operates, and performs whatever part of ++ its purpose remains meaningful. ++ ++ (For example, a function in a library to compute square roots has ++ a purpose that is entirely well-defined independent of the ++ application. Therefore, Subsection 2d requires that any ++ application-supplied function or table used by this function must ++ be optional: if the application does not supply it, the square ++ root function must still compute square roots.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Library, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Library, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote ++it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Library. ++ ++In addition, mere aggregation of another work not based on the Library ++with the Library (or with a work based on the Library) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may opt to apply the terms of the ordinary GNU General Public ++License instead of this License to a given copy of the Library. To do ++this, you must alter all the notices that refer to this License, so ++that they refer to the ordinary GNU General Public License, version 2, ++instead of to this License. (If a newer version than version 2 of the ++ordinary GNU General Public License has appeared, then you can specify ++that version instead if you wish.) Do not make any other change in ++these notices. ++ ++ Once this change is made in a given copy, it is irreversible for ++that copy, so the ordinary GNU General Public License applies to all ++subsequent copies and derivative works made from that copy. ++ ++ This option is useful when you wish to copy part of the code of ++the Library into a program that is not a library. ++ ++ 4. You may copy and distribute the Library (or a portion or ++derivative of it, under Section 2) in object code or executable form ++under the terms of Sections 1 and 2 above provided that you accompany ++it with the complete corresponding machine-readable source code, which ++must be distributed under the terms of Sections 1 and 2 above on a ++medium customarily used for software interchange. ++ ++ If distribution of object code is made by offering access to copy ++from a designated place, then offering equivalent access to copy the ++source code from the same place satisfies the requirement to ++distribute the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 5. A program that contains no derivative of any portion of the ++Library, but is designed to work with the Library by being compiled or ++linked with it, is called a "work that uses the Library". Such a ++work, in isolation, is not a derivative work of the Library, and ++therefore falls outside the scope of this License. ++ ++ However, linking a "work that uses the Library" with the Library ++creates an executable that is a derivative of the Library (because it ++contains portions of the Library), rather than a "work that uses the ++library". The executable is therefore covered by this License. ++Section 6 states terms for distribution of such executables. ++ ++ When a "work that uses the Library" uses material from a header file ++that is part of the Library, the object code for the work may be a ++derivative work of the Library even though the source code is not. ++Whether this is true is especially significant if the work can be ++linked without the Library, or if the work is itself a library. The ++threshold for this to be true is not precisely defined by law. ++ ++ If such an object file uses only numerical parameters, data ++structure layouts and accessors, and small macros and small inline ++functions (ten lines or less in length), then the use of the object ++file is unrestricted, regardless of whether it is legally a derivative ++work. (Executables containing this object code plus portions of the ++Library will still fall under Section 6.) ++ ++ Otherwise, if the work is a derivative of the Library, you may ++distribute the object code for the work under the terms of Section 6. ++Any executables containing that work also fall under Section 6, ++whether or not they are linked directly with the Library itself. ++ ++ 6. As an exception to the Sections above, you may also combine or ++link a "work that uses the Library" with the Library to produce a ++work containing portions of the Library, and distribute that work ++under terms of your choice, provided that the terms permit ++modification of the work for the customer's own use and reverse ++engineering for debugging such modifications. ++ ++ You must give prominent notice with each copy of the work that the ++Library is used in it and that the Library and its use are covered by ++this License. You must supply a copy of this License. If the work ++during execution displays copyright notices, you must include the ++copyright notice for the Library among them, as well as a reference ++directing the user to the copy of this License. Also, you must do one ++of these things: ++ ++ a) Accompany the work with the complete corresponding ++ machine-readable source code for the Library including whatever ++ changes were used in the work (which must be distributed under ++ Sections 1 and 2 above); and, if the work is an executable linked ++ with the Library, with the complete machine-readable "work that ++ uses the Library", as object code and/or source code, so that the ++ user can modify the Library and then relink to produce a modified ++ executable containing the modified Library. (It is understood ++ that the user who changes the contents of definitions files in the ++ Library will not necessarily be able to recompile the application ++ to use the modified definitions.) ++ ++ b) Use a suitable shared library mechanism for linking with the ++ Library. A suitable mechanism is one that (1) uses at run time a ++ copy of the library already present on the user's computer system, ++ rather than copying library functions into the executable, and (2) ++ will operate properly with a modified version of the library, if ++ the user installs one, as long as the modified version is ++ interface-compatible with the version that the work was made with. ++ ++ c) Accompany the work with a written offer, valid for at ++ least three years, to give the same user the materials ++ specified in Subsection 6a, above, for a charge no more ++ than the cost of performing this distribution. ++ ++ d) If distribution of the work is made by offering access to copy ++ from a designated place, offer equivalent access to copy the above ++ specified materials from the same place. ++ ++ e) Verify that the user has already received a copy of these ++ materials or that you have already sent this user a copy. ++ ++ For an executable, the required form of the "work that uses the ++Library" must include any data and utility programs needed for ++reproducing the executable from it. However, as a special exception, ++the materials to be distributed need not include anything that is ++normally distributed (in either source or binary form) with the major ++components (compiler, kernel, and so on) of the operating system on ++which the executable runs, unless that component itself accompanies ++the executable. ++ ++ It may happen that this requirement contradicts the license ++restrictions of other proprietary libraries that do not normally ++accompany the operating system. Such a contradiction means you cannot ++use both them and the Library together in an executable that you ++distribute. ++ ++ 7. You may place library facilities that are a work based on the ++Library side-by-side in a single library together with other library ++facilities not covered by this License, and distribute such a combined ++library, provided that the separate distribution of the work based on ++the Library and of the other library facilities is otherwise ++permitted, and provided that you do these two things: ++ ++ a) Accompany the combined library with a copy of the same work ++ based on the Library, uncombined with any other library ++ facilities. This must be distributed under the terms of the ++ Sections above. ++ ++ b) Give prominent notice with the combined library of the fact ++ that part of it is a work based on the Library, and explaining ++ where to find the accompanying uncombined form of the same work. ++ ++ 8. You may not copy, modify, sublicense, link with, or distribute ++the Library except as expressly provided under this License. Any ++attempt otherwise to copy, modify, sublicense, link with, or ++distribute the Library is void, and will automatically terminate your ++rights under this License. However, parties who have received copies, ++or rights, from you under this License will not have their licenses ++terminated so long as such parties remain in full compliance. ++ ++ 9. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Library or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Library (or any work based on the ++Library), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Library or works based on it. ++ ++ 10. Each time you redistribute the Library (or any work based on the ++Library), the recipient automatically receives a license from the ++original licensor to copy, distribute, link with or modify the Library ++subject to these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties with ++this License. ++ ++ 11. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Library at all. For example, if a patent ++license would not permit royalty-free redistribution of the Library by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Library. ++ ++If any portion of this section is held invalid or unenforceable under any ++particular circumstance, the balance of the section is intended to apply, ++and the section as a whole is intended to apply in other circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 12. If the distribution and/or use of the Library is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Library under this License may add ++an explicit geographical distribution limitation excluding those countries, ++so that distribution is permitted only in or among countries not thus ++excluded. In such case, this License incorporates the limitation as if ++written in the body of this License. ++ ++ 13. The Free Software Foundation may publish revised and/or new ++versions of the Lesser General Public License from time to time. ++Such new versions will be similar in spirit to the present version, ++but may differ in detail to address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Library ++specifies a version number of this License which applies to it and ++"any later version", you have the option of following the terms and ++conditions either of that version or of any later version published by ++the Free Software Foundation. If the Library does not specify a ++license version number, you may choose any version ever published by ++the Free Software Foundation. ++ ++ 14. If you wish to incorporate parts of the Library into other free ++programs whose distribution conditions are incompatible with these, ++write to the author to ask for permission. For software which is ++copyrighted by the Free Software Foundation, write to the Free ++Software Foundation; we sometimes make exceptions for this. Our ++decision will be guided by the two goals of preserving the free status ++of all derivatives of our free software and of promoting the sharing ++and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ++OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ++ ++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Libraries ++ ++ If you develop a new library, and you want it to be of the greatest ++possible use to the public, we recommend making it free software that ++everyone can redistribute and change. You can do so by permitting ++redistribution under these terms (or, alternatively, under the terms of the ++ordinary General Public License). ++ ++ To apply these terms, attach the following notices to the library. It is ++safest to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least the ++"copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the library, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the ++ library `Frob' (a library for tweaking knobs) written by James Random Hacker. ++ ++ , 1 April 1990 ++ Ty Coon, President of Vice ++ ++That's all there is to it! +diff -Nurd linuxtv-dvb-apps-1.1.1/include/audio.h dvb-apps/include/audio.h +--- linuxtv-dvb-apps-1.1.1/include/audio.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/audio.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,140 @@ ++/* ++ * audio.h ++ * ++ * Copyright (C) 2000 Ralph Metzler ++ * & Marcus Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Lesser Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBAUDIO_H_ ++#define _DVBAUDIO_H_ ++ ++#ifdef __KERNEL__ ++#include ++#else ++#include ++#endif ++ ++ ++typedef enum { ++ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ ++ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ ++} audio_stream_source_t; ++ ++ ++typedef enum { ++ AUDIO_STOPPED, /* Device is stopped */ ++ AUDIO_PLAYING, /* Device is currently playing */ ++ AUDIO_PAUSED /* Device is paused */ ++} audio_play_state_t; ++ ++ ++typedef enum { ++ AUDIO_STEREO, ++ AUDIO_MONO_LEFT, ++ AUDIO_MONO_RIGHT, ++ AUDIO_MONO, ++ AUDIO_STEREO_SWAPPED ++} audio_channel_select_t; ++ ++ ++typedef struct audio_mixer { ++ unsigned int volume_left; ++ unsigned int volume_right; ++ // what else do we need? bass, pass-through, ... ++} audio_mixer_t; ++ ++ ++typedef struct audio_status { ++ int AV_sync_state; /* sync audio and video? */ ++ int mute_state; /* audio is muted */ ++ audio_play_state_t play_state; /* current playback state */ ++ audio_stream_source_t stream_source; /* current stream source */ ++ audio_channel_select_t channel_select; /* currently selected channel */ ++ int bypass_mode; /* pass on audio data to */ ++ audio_mixer_t mixer_state; /* current mixer state */ ++} audio_status_t; /* separate decoder hardware */ ++ ++ ++typedef ++struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ ++ int vocal1; /* into left and right t at 70% each */ ++ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ ++ int melody; /* mixed into the left channel and */ ++ /* Vocal2 into the right channel at 100% each. */ ++ /* if Melody is non-zero, the melody channel gets mixed*/ ++} audio_karaoke_t; /* into left and right */ ++ ++ ++typedef uint16_t audio_attributes_t; ++/* bits: descr. */ ++/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */ ++/* 12 multichannel extension */ ++/* 11-10 audio type (0=not spec, 1=language included) */ ++/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */ ++/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */ ++/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */ ++/* 2- 0 number of audio channels (n+1 channels) */ ++ ++ ++/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */ ++#define AUDIO_CAP_DTS 1 ++#define AUDIO_CAP_LPCM 2 ++#define AUDIO_CAP_MP1 4 ++#define AUDIO_CAP_MP2 8 ++#define AUDIO_CAP_MP3 16 ++#define AUDIO_CAP_AAC 32 ++#define AUDIO_CAP_OGG 64 ++#define AUDIO_CAP_SDDS 128 ++#define AUDIO_CAP_AC3 256 ++ ++#define AUDIO_STOP _IO('o', 1) ++#define AUDIO_PLAY _IO('o', 2) ++#define AUDIO_PAUSE _IO('o', 3) ++#define AUDIO_CONTINUE _IO('o', 4) ++#define AUDIO_SELECT_SOURCE _IO('o', 5) ++#define AUDIO_SET_MUTE _IO('o', 6) ++#define AUDIO_SET_AV_SYNC _IO('o', 7) ++#define AUDIO_SET_BYPASS_MODE _IO('o', 8) ++#define AUDIO_CHANNEL_SELECT _IO('o', 9) ++#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t) ++ ++#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int) ++#define AUDIO_CLEAR_BUFFER _IO('o', 12) ++#define AUDIO_SET_ID _IO('o', 13) ++#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t) ++#define AUDIO_SET_STREAMTYPE _IO('o', 15) ++#define AUDIO_SET_EXT_ID _IO('o', 16) ++#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) ++#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) ++ ++/** ++ * AUDIO_GET_PTS ++ * ++ * Read the 33 bit presentation time stamp as defined ++ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. ++ * ++ * The PTS should belong to the currently played ++ * frame if possible, but may also be a value close to it ++ * like the PTS of the last decoded frame or the last PTS ++ * extracted by the PES parser. ++ */ ++#define AUDIO_GET_PTS _IOR('o', 19, __u64) ++#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20) ++ ++#endif /* _DVBAUDIO_H_ */ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/ca.h dvb-apps/include/ca.h +--- linuxtv-dvb-apps-1.1.1/include/ca.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/ca.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,90 @@ ++/* ++ * ca.h ++ * ++ * Copyright (C) 2000 Ralph Metzler ++ * & Marcus Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Lesser Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBCA_H_ ++#define _DVBCA_H_ ++ ++/* slot interface types and info */ ++ ++typedef struct ca_slot_info { ++ int num; /* slot number */ ++ ++ int type; /* CA interface this slot supports */ ++#define CA_CI 1 /* CI high level interface */ ++#define CA_CI_LINK 2 /* CI link layer level interface */ ++#define CA_CI_PHYS 4 /* CI physical layer level interface */ ++#define CA_DESCR 8 /* built-in descrambler */ ++#define CA_SC 128 /* simple smart card interface */ ++ ++ unsigned int flags; ++#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ ++#define CA_CI_MODULE_READY 2 ++} ca_slot_info_t; ++ ++ ++/* descrambler types and info */ ++ ++typedef struct ca_descr_info { ++ unsigned int num; /* number of available descramblers (keys) */ ++ unsigned int type; /* type of supported scrambling system */ ++#define CA_ECD 1 ++#define CA_NDS 2 ++#define CA_DSS 4 ++} ca_descr_info_t; ++ ++typedef struct ca_caps { ++ unsigned int slot_num; /* total number of CA card and module slots */ ++ unsigned int slot_type; /* OR of all supported types */ ++ unsigned int descr_num; /* total number of descrambler slots (keys) */ ++ unsigned int descr_type; /* OR of all supported types */ ++} ca_caps_t; ++ ++/* a message to/from a CI-CAM */ ++typedef struct ca_msg { ++ unsigned int index; ++ unsigned int type; ++ unsigned int length; ++ unsigned char msg[256]; ++} ca_msg_t; ++ ++typedef struct ca_descr { ++ unsigned int index; ++ unsigned int parity; /* 0 == even, 1 == odd */ ++ unsigned char cw[8]; ++} ca_descr_t; ++ ++typedef struct ca_pid { ++ unsigned int pid; ++ int index; /* -1 == disable*/ ++} ca_pid_t; ++ ++#define CA_RESET _IO('o', 128) ++#define CA_GET_CAP _IOR('o', 129, ca_caps_t) ++#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) ++#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) ++#define CA_GET_MSG _IOR('o', 132, ca_msg_t) ++#define CA_SEND_MSG _IOW('o', 133, ca_msg_t) ++#define CA_SET_DESCR _IOW('o', 134, ca_descr_t) ++#define CA_SET_PID _IOW('o', 135, ca_pid_t) ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/include/dmx.h dvb-apps/include/dmx.h +--- linuxtv-dvb-apps-1.1.1/include/dmx.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/dmx.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,154 @@ ++/* ++ * dmx.h ++ * ++ * Copyright (C) 2000 Marcus Metzler ++ * & Ralph Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBDMX_H_ ++#define _DVBDMX_H_ ++ ++#include ++#ifdef __KERNEL__ ++#include ++#else ++#include ++#endif ++ ++ ++#define DMX_FILTER_SIZE 16 ++ ++typedef enum ++{ ++ DMX_OUT_DECODER, /* Streaming directly to decoder. */ ++ DMX_OUT_TAP, /* Output going to a memory buffer */ ++ /* (to be retrieved via the read command).*/ ++ DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ ++ /* (to be retrieved by reading from the */ ++ /* logical DVR device). */ ++} dmx_output_t; ++ ++ ++typedef enum ++{ ++ DMX_IN_FRONTEND, /* Input from a front-end device. */ ++ DMX_IN_DVR /* Input from the logical DVR device. */ ++} dmx_input_t; ++ ++ ++typedef enum ++{ ++ DMX_PES_AUDIO0, ++ DMX_PES_VIDEO0, ++ DMX_PES_TELETEXT0, ++ DMX_PES_SUBTITLE0, ++ DMX_PES_PCR0, ++ ++ DMX_PES_AUDIO1, ++ DMX_PES_VIDEO1, ++ DMX_PES_TELETEXT1, ++ DMX_PES_SUBTITLE1, ++ DMX_PES_PCR1, ++ ++ DMX_PES_AUDIO2, ++ DMX_PES_VIDEO2, ++ DMX_PES_TELETEXT2, ++ DMX_PES_SUBTITLE2, ++ DMX_PES_PCR2, ++ ++ DMX_PES_AUDIO3, ++ DMX_PES_VIDEO3, ++ DMX_PES_TELETEXT3, ++ DMX_PES_SUBTITLE3, ++ DMX_PES_PCR3, ++ ++ DMX_PES_OTHER ++} dmx_pes_type_t; ++ ++#define DMX_PES_AUDIO DMX_PES_AUDIO0 ++#define DMX_PES_VIDEO DMX_PES_VIDEO0 ++#define DMX_PES_TELETEXT DMX_PES_TELETEXT0 ++#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 ++#define DMX_PES_PCR DMX_PES_PCR0 ++ ++ ++typedef struct dmx_filter ++{ ++ __u8 filter[DMX_FILTER_SIZE]; ++ __u8 mask[DMX_FILTER_SIZE]; ++ __u8 mode[DMX_FILTER_SIZE]; ++} dmx_filter_t; ++ ++ ++struct dmx_sct_filter_params ++{ ++ __u16 pid; ++ dmx_filter_t filter; ++ __u32 timeout; ++ __u32 flags; ++#define DMX_CHECK_CRC 1 ++#define DMX_ONESHOT 2 ++#define DMX_IMMEDIATE_START 4 ++#define DMX_KERNEL_CLIENT 0x8000 ++}; ++ ++ ++struct dmx_pes_filter_params ++{ ++ __u16 pid; ++ dmx_input_t input; ++ dmx_output_t output; ++ dmx_pes_type_t pes_type; ++ __u32 flags; ++}; ++ ++typedef struct dmx_caps { ++ __u32 caps; ++ int num_decoders; ++} dmx_caps_t; ++ ++typedef enum { ++ DMX_SOURCE_FRONT0 = 0, ++ DMX_SOURCE_FRONT1, ++ DMX_SOURCE_FRONT2, ++ DMX_SOURCE_FRONT3, ++ DMX_SOURCE_DVR0 = 16, ++ DMX_SOURCE_DVR1, ++ DMX_SOURCE_DVR2, ++ DMX_SOURCE_DVR3 ++} dmx_source_t; ++ ++struct dmx_stc { ++ unsigned int num; /* input : which STC? 0..N */ ++ unsigned int base; /* output: divisor for stc to get 90 kHz clock */ ++ __u64 stc; /* output: stc in 'base'*90 kHz units */ ++}; ++ ++ ++#define DMX_START _IO('o', 41) ++#define DMX_STOP _IO('o', 42) ++#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) ++#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) ++#define DMX_SET_BUFFER_SIZE _IO('o', 45) ++#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) ++#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) ++#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) ++#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) ++ ++#endif /*_DVBDMX_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/frontend.h dvb-apps/include/frontend.h +--- linuxtv-dvb-apps-1.1.1/include/frontend.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/frontend.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,648 @@ ++/* ++ * frontend.h ++ * ++ * Copyright (C) 2000 Marcus Metzler ++ * Ralph Metzler ++ * Holger Waechtler ++ * Andre Draszik ++ * for convergence integrated media GmbH ++ * ++ * Copyright (C) Manu Abraham ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBFRONTEND_H_ ++#define _DVBFRONTEND_H_ ++ ++#include ++ ++ ++typedef enum fe_type { ++ FE_QPSK, ++ FE_QAM, ++ FE_OFDM, ++ FE_ATSC ++} fe_type_t; ++ ++ ++typedef enum fe_caps { ++ FE_IS_STUPID = 0, ++ FE_CAN_INVERSION_AUTO = 0x1, ++ FE_CAN_FEC_1_2 = 0x2, ++ FE_CAN_FEC_2_3 = 0x4, ++ FE_CAN_FEC_3_4 = 0x8, ++ FE_CAN_FEC_4_5 = 0x10, ++ FE_CAN_FEC_5_6 = 0x20, ++ FE_CAN_FEC_6_7 = 0x40, ++ FE_CAN_FEC_7_8 = 0x80, ++ FE_CAN_FEC_8_9 = 0x100, ++ FE_CAN_FEC_AUTO = 0x200, ++ FE_CAN_QPSK = 0x400, ++ FE_CAN_QAM_16 = 0x800, ++ FE_CAN_QAM_32 = 0x1000, ++ FE_CAN_QAM_64 = 0x2000, ++ FE_CAN_QAM_128 = 0x4000, ++ FE_CAN_QAM_256 = 0x8000, ++ FE_CAN_QAM_AUTO = 0x10000, ++ FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000, ++ FE_CAN_BANDWIDTH_AUTO = 0x40000, ++ FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, ++ FE_CAN_HIERARCHY_AUTO = 0x100000, ++ FE_CAN_8VSB = 0x200000, ++ FE_CAN_16VSB = 0x400000, ++ FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) ++ FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically ++ FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output ++} fe_caps_t; ++ ++ ++struct dvb_frontend_info { ++ char name[128]; ++ fe_type_t type; ++ __u32 frequency_min; ++ __u32 frequency_max; ++ __u32 frequency_stepsize; ++ __u32 frequency_tolerance; ++ __u32 symbol_rate_min; ++ __u32 symbol_rate_max; ++ __u32 symbol_rate_tolerance; /* ppm */ ++ __u32 notifier_delay; /* DEPRECATED */ ++ fe_caps_t caps; ++}; ++ ++ ++/** ++ * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for ++ * the meaning of this struct... ++ */ ++struct dvb_diseqc_master_cmd { ++ __u8 msg [6]; /* { framing, address, command, data [3] } */ ++ __u8 msg_len; /* valid values are 3...6 */ ++}; ++ ++ ++struct dvb_diseqc_slave_reply { ++ __u8 msg [4]; /* { framing, data [3] } */ ++ __u8 msg_len; /* valid values are 0...4, 0 means no msg */ ++ int timeout; /* return from ioctl after timeout ms with */ ++}; /* errorcode when no message was received */ ++ ++ ++typedef enum fe_sec_voltage { ++ SEC_VOLTAGE_13, ++ SEC_VOLTAGE_18, ++ SEC_VOLTAGE_OFF ++} fe_sec_voltage_t; ++ ++ ++typedef enum fe_sec_tone_mode { ++ SEC_TONE_ON, ++ SEC_TONE_OFF ++} fe_sec_tone_mode_t; ++ ++ ++typedef enum fe_sec_mini_cmd { ++ SEC_MINI_A, ++ SEC_MINI_B ++} fe_sec_mini_cmd_t; ++ ++ ++typedef enum fe_status { ++ FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ ++ FE_HAS_CARRIER = 0x02, /* found a DVB signal */ ++ FE_HAS_VITERBI = 0x04, /* FEC is stable */ ++ FE_HAS_SYNC = 0x08, /* found sync bytes */ ++ FE_HAS_LOCK = 0x10, /* everything's working... */ ++ FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ ++ FE_REINIT = 0x40 /* frontend was reinitialized, */ ++} fe_status_t; /* application is recommended to reset */ ++ /* DiSEqC, tone and parameters */ ++ ++typedef enum fe_spectral_inversion { ++ INVERSION_OFF, ++ INVERSION_ON, ++ INVERSION_AUTO ++} fe_spectral_inversion_t; ++ ++ ++typedef enum fe_code_rate { ++ FEC_NONE = 0, ++ FEC_1_2, ++ FEC_2_3, ++ FEC_3_4, ++ FEC_4_5, ++ FEC_5_6, ++ FEC_6_7, ++ FEC_7_8, ++ FEC_8_9, ++ FEC_AUTO ++} fe_code_rate_t; ++ ++ ++typedef enum fe_modulation { ++ QPSK, ++ QAM_16, ++ QAM_32, ++ QAM_64, ++ QAM_128, ++ QAM_256, ++ QAM_AUTO, ++ VSB_8, ++ VSB_16 ++} fe_modulation_t; ++ ++typedef enum fe_transmit_mode { ++ TRANSMISSION_MODE_2K, ++ TRANSMISSION_MODE_8K, ++ TRANSMISSION_MODE_AUTO ++} fe_transmit_mode_t; ++ ++typedef enum fe_bandwidth { ++ BANDWIDTH_8_MHZ, ++ BANDWIDTH_7_MHZ, ++ BANDWIDTH_6_MHZ, ++ BANDWIDTH_AUTO ++} fe_bandwidth_t; ++ ++ ++typedef enum fe_guard_interval { ++ GUARD_INTERVAL_1_32, ++ GUARD_INTERVAL_1_16, ++ GUARD_INTERVAL_1_8, ++ GUARD_INTERVAL_1_4, ++ GUARD_INTERVAL_AUTO ++} fe_guard_interval_t; ++ ++ ++typedef enum fe_hierarchy { ++ HIERARCHY_NONE, ++ HIERARCHY_1, ++ HIERARCHY_2, ++ HIERARCHY_4, ++ HIERARCHY_AUTO ++} fe_hierarchy_t; ++ ++ ++struct dvb_qpsk_parameters { ++ __u32 symbol_rate; /* symbol rate in Symbols per second */ ++ fe_code_rate_t fec_inner; /* forward error correction (see above) */ ++}; ++ ++struct dvb_qam_parameters { ++ __u32 symbol_rate; /* symbol rate in Symbols per second */ ++ fe_code_rate_t fec_inner; /* forward error correction (see above) */ ++ fe_modulation_t modulation; /* modulation type (see above) */ ++}; ++ ++struct dvb_vsb_parameters { ++ fe_modulation_t modulation; /* modulation type (see above) */ ++}; ++ ++struct dvb_ofdm_parameters { ++ fe_bandwidth_t bandwidth; ++ fe_code_rate_t code_rate_HP; /* high priority stream code rate */ ++ fe_code_rate_t code_rate_LP; /* low priority stream code rate */ ++ fe_modulation_t constellation; /* modulation type (see above) */ ++ fe_transmit_mode_t transmission_mode; ++ fe_guard_interval_t guard_interval; ++ fe_hierarchy_t hierarchy_information; ++}; ++ ++ ++struct dvb_frontend_parameters { ++ __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ ++ /* intermediate frequency in kHz for QPSK */ ++ fe_spectral_inversion_t inversion; ++ union { ++ struct dvb_qpsk_parameters qpsk; ++ struct dvb_qam_parameters qam; ++ struct dvb_ofdm_parameters ofdm; ++ struct dvb_vsb_parameters vsb; ++ } u; ++}; ++ ++ ++/** ++ * When set, this flag will disable any zigzagging or other "normal" tuning ++ * behaviour. Additionally, there will be no automatic monitoring of the lock ++ * status, and hence no frontend events will be generated. If a frontend device ++ * is closed, this flag will be automatically turned off when the device is ++ * reopened read-write. ++ */ ++#define FE_TUNE_MODE_ONESHOT 0x01 ++ ++ ++#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) ++ ++#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) ++#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd) ++#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply) ++#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */ ++ ++#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */ ++#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */ ++#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */ ++ ++#define FE_READ_STATUS _IOR('o', 69, fe_status_t) ++#define FE_READ_BER _IOR('o', 70, __u32) ++#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16) ++#define FE_READ_SNR _IOR('o', 72, __u16) ++#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) ++ ++#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) ++#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) ++#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ ++ ++#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ ++ ++/* ++ * References: ++ * DVB-S : EN 300 421 ++ * DVB-S2: EN 302 307, TR 102 376, EN 301 210 ++ * DVB-C : EN 300 429 ++ * DVB-T : EN 300 744 ++ * DVB-H : EN 300 304 ++ * ATSC : A/53A ++ */ ++ ++/* ++ * Delivery Systems ++ * needs to set/queried for multistandard frontends ++ */ ++enum dvbfe_delsys { ++ DVBFE_DELSYS_DVBS = (1 << 0), ++ DVBFE_DELSYS_DSS = (1 << 1), ++ DVBFE_DELSYS_DVBS2 = (1 << 2), ++ DVBFE_DELSYS_DVBC = (1 << 3), ++ DVBFE_DELSYS_DVBT = (1 << 4), ++ DVBFE_DELSYS_DVBH = (1 << 5), ++ DVBFE_DELSYS_ATSC = (1 << 6), ++ DVBFE_DELSYS_DUMMY = (1 << 31) ++}; ++#define DVBFE_GET_DELSYS _IOR('o', 82, enum dvbfe_delsys) ++#define DVBFE_SET_DELSYS _IOW('o', 87, enum dvbfe_delsys) ++ ++/* Modulation types */ ++enum dvbfe_modulation { ++ DVBFE_MOD_NONE = (0 << 0), ++ DVBFE_MOD_BPSK = (1 << 0), ++ DVBFE_MOD_QPSK = (1 << 1), ++ DVBFE_MOD_OQPSK = (1 << 2), ++ DVBFE_MOD_8PSK = (1 << 3), ++ DVBFE_MOD_16APSK = (1 << 4), ++ DVBFE_MOD_32APSK = (1 << 5), ++ DVBFE_MOD_QAM4 = (1 << 6), ++ DVBFE_MOD_QAM16 = (1 << 7), ++ DVBFE_MOD_QAM32 = (1 << 8), ++ DVBFE_MOD_QAM64 = (1 << 9), ++ DVBFE_MOD_QAM128 = (1 << 10), ++ DVBFE_MOD_QAM256 = (1 << 11), ++ DVBFE_MOD_QAM512 = (1 << 12), ++ DVBFE_MOD_QAM1024 = (1 << 13), ++ DVBFE_MOD_QAMAUTO = (1 << 14), ++ DVBFE_MOD_OFDM = (1 << 15), ++ DVBFE_MOD_COFDM = (1 << 16), ++ DVBFE_MOD_VSB8 = (1 << 17), ++ DVBFE_MOD_VSB16 = (1 << 18), ++ DVBFE_MOD_AUTO = (1 << 31) ++}; ++ ++/* ++ * Convolution Code Rate (Viterbi Inner Code Rate) ++ * DVB-S2 uses LDPC. Information on LDPC can be found at ++ * http://www.ldpc-codes.com ++ */ ++enum dvbfe_fec { ++ DVBFE_FEC_NONE = (0 << 0), ++ DVBFE_FEC_1_4 = (1 << 0), ++ DVBFE_FEC_1_3 = (1 << 1), ++ DVBFE_FEC_2_5 = (1 << 2), ++ DVBFE_FEC_1_2 = (1 << 3), ++ DVBFE_FEC_3_5 = (1 << 4), ++ DVBFE_FEC_2_3 = (1 << 5), ++ DVBFE_FEC_3_4 = (1 << 6), ++ DVBFE_FEC_4_5 = (1 << 7), ++ DVBFE_FEC_5_6 = (1 << 8), ++ DVBFE_FEC_6_7 = (1 << 9), ++ DVBFE_FEC_7_8 = (1 << 10), ++ DVBFE_FEC_8_9 = (1 << 11), ++ DVBFE_FEC_9_10 = (1 << 12), ++ DVBFE_FEC_AUTO = (1 << 31) ++}; ++ ++/* Frontend Inversion (I/Q Swap) */ ++enum dvbfe_inversion { ++ DVBFE_INVERSION_OFF = 0, ++ DVBFE_INVERSION_ON = 1, ++ DVBFE_INVERSION_AUTO = 2 ++}; ++ ++/* DVB-S parameters */ ++struct dvbs_params { ++ __u32 symbol_rate; ++ ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++}; ++ ++/* DSS parameters */ ++struct dss_params { ++ __u32 symbol_rate; ++ ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++}; ++ ++/* ++ * Rolloff Rate (Nyquist Filter Rolloff) ++ * NOTE: DVB-S2 has rates of 0.20, 0.25, 0.35 ++ * Values are x100 ++ * Applies to DVB-S2 ++ */ ++enum dvbfe_rolloff { ++ DVBFE_ROLLOFF_35 = 0, ++ DVBFE_ROLLOFF_25 = 1, ++ DVBFE_ROLLOFF_20 = 2, ++ DVBFE_ROLLOFF_UNKNOWN = 3 ++}; ++ ++/* DVB-S2 parameters */ ++struct dvbs2_params { ++ __u32 symbol_rate; ++ ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++ ++ /* Informational fields only */ ++ enum dvbfe_rolloff rolloff; ++ ++ __u8 matype_1; ++ __u8 matype_2; ++ __u8 upl_1; ++ __u8 upl_2; ++ __u8 dfl_1; ++ __u8 dfl_2; ++ __u8 sync; ++ __u8 syncd_1; ++ __u8 syncd_2; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB-C parameters */ ++struct dvbc_params { ++ __u32 symbol_rate; ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++}; ++ ++/* DVB-T Channel bandwidth */ ++enum dvbfe_bandwidth { ++ DVBFE_BANDWIDTH_8_MHZ = (1 << 0), ++ DVBFE_BANDWIDTH_7_MHZ = (1 << 1), ++ DVBFE_BANDWIDTH_6_MHZ = (1 << 2), ++ DVBFE_BANDWIDTH_5_MHZ = (1 << 3), ++ DVBFE_BANDWIDTH_AUTO = (1 << 31) ++}; ++ ++/* DVB-T/DVB-H transmission mode */ ++enum dvbfe_transmission_mode { ++ DVBFE_TRANSMISSION_MODE_2K = (1 << 0), ++ DVBFE_TRANSMISSION_MODE_4K = (1 << 1), ++ DVBFE_TRANSMISSION_MODE_8K = (1 << 2), ++ DVBFE_TRANSMISSION_MODE_AUTO = (1 << 31) ++}; ++ ++/* DVB-T/DVB-H Guard interval */ ++enum dvbfe_guard_interval { ++ DVBFE_GUARD_INTERVAL_1_32 = (1 << 1), ++ DVBFE_GUARD_INTERVAL_1_16 = (1 << 2), ++ DVBFE_GUARD_INTERVAL_1_8 = (1 << 3), ++ DVBFE_GUARD_INTERVAL_1_4 = (1 << 4), ++ DVBFE_GUARD_INTERVAL_AUTO = (1 << 31) ++}; ++ ++/* DVB-T/DVB-H Hierarchial modulation */ ++enum dvbfe_hierarchy { ++ DVBFE_HIERARCHY_OFF = (1 << 0), ++ DVBFE_HIERARCHY_ON = (1 << 1), ++ DVBFE_HIERARCHY_AUTO = (1 << 2) ++}; ++ ++/* DVB-T/DVB-H Rolloff's */ ++enum dvbfe_alpha { ++ DVBFE_ALPHA_1 = (1 << 0), ++ DVBFE_ALPHA_2 = (1 << 1), ++ DVBFE_ALPHA_4 = (1 << 2) ++}; ++ ++/* Stream priority (Hierachial coding) */ ++enum dvbfe_stream_priority { ++ DVBFE_STREAM_PRIORITY_HP = (0 << 0), ++ DVBFE_STREAM_PRIORITY_LP = (1 << 0) ++}; ++ ++/* DVB-T parameters */ ++struct dvbt_params { ++ enum dvbfe_modulation constellation; ++ enum dvbfe_bandwidth bandwidth; ++ enum dvbfe_fec code_rate_HP; ++ enum dvbfe_fec code_rate_LP; ++ enum dvbfe_transmission_mode transmission_mode; ++ enum dvbfe_guard_interval guard_interval; ++ enum dvbfe_hierarchy hierarchy; ++ enum dvbfe_alpha alpha; ++ enum dvbfe_stream_priority priority; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB-H Interleaver type */ ++enum dvbfe_interleaver { ++ DVBFE_INTERLEAVER_NATIVE = (1 << 0), ++ DVBFE_INTERLEAVER_INDEPTH = (1 << 1), ++ DVBFE_INTERLEAVER_AUTO = (1 << 31) ++}; ++ ++/* DVB-H MPE-FEC Indicator */ ++enum dvbfe_mpefec { ++ DVBFE_MPEFEC_OFF = (1 << 0), ++ DVBFE_MPEFEC_ON = (1 << 1) ++}; ++ ++/* DVB-H Timeslicing Indicator */ ++enum dvbfe_timeslicing { ++ DVBFE_TIMESLICING_OFF = (1 << 0), ++ DVBFE_TIMESLICING_ON = (1 << 1) ++}; ++ ++/* DVB-H parameters */ ++struct dvbh_params { ++ enum dvbfe_modulation constellation; ++ enum dvbfe_fec code_rate_HP; ++ enum dvbfe_fec code_rate_LP; ++ enum dvbfe_transmission_mode transmission_mode; ++ enum dvbfe_guard_interval guard_interval; ++ enum dvbfe_hierarchy hierarchy; ++ enum dvbfe_alpha alpha; ++ enum dvbfe_interleaver interleaver; ++ enum dvbfe_mpefec mpefec; ++ enum dvbfe_timeslicing timeslicing; ++ enum dvbfe_stream_priority priority; ++ ++ __u32 bandwidth; ++ __u8 pad[32]; ++}; ++ ++/* ATSC parameters */ ++struct atsc_params { ++ enum dvbfe_modulation modulation; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB Frontend Tuning Parameters */ ++struct dvbfe_params { ++ __u32 frequency; ++ enum fe_spectral_inversion inversion; ++ enum dvbfe_delsys delivery; ++ ++ __u8 pad[32]; ++ ++ union { ++ struct dvbs_params dvbs; ++ struct dss_params dss; ++ struct dvbs2_params dvbs2; ++ struct dvbc_params dvbc; ++ struct dvbt_params dvbt; ++ struct dvbh_params dvbh; ++ struct atsc_params atsc; ++ ++ __u8 pad[128]; ++ } delsys; ++}; ++#define DVBFE_SET_PARAMS _IOW('o', 83, struct dvbfe_params) ++#define DVBFE_GET_PARAMS _IOWR('o', 84, struct dvbfe_params) ++ ++/* DVB-S capability bitfields */ ++struct dvbfe_dvbs_info { ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++}; ++ ++/* DSS capability bitfields */ ++struct dvbfe_dss_info { ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++}; ++ ++/* DVB-S2 capability bitfields */ ++struct dvbfe_dvbs2_info { ++ enum dvbfe_modulation modulation; ++ enum dvbfe_fec fec; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB-C capability bitfields */ ++struct dvbfe_dvbc_info { ++ enum dvbfe_modulation modulation; ++}; ++ ++/* DVB-T capability bitfields */ ++struct dvbfe_dvbt_info { ++ enum dvbfe_modulation modulation; ++ enum dvbfe_stream_priority stream_priority; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB-H capability bitfields */ ++struct dvbfe_dvbh_info { ++ enum dvbfe_modulation modulation; ++ enum dvbfe_stream_priority stream_priority; ++ ++ __u8 pad[32]; ++}; ++ ++/* ATSC capability bitfields */ ++struct dvbfe_atsc_info { ++ enum dvbfe_modulation modulation; ++ ++ __u8 pad[32]; ++}; ++ ++/* DVB Frontend related Information */ ++struct dvbfe_info { ++ char name[128]; ++ ++ union { ++ struct dvbfe_dvbs_info dvbs; ++ struct dvbfe_dss_info dss; ++ struct dvbfe_dvbs2_info dvbs2; ++ struct dvbfe_dvbc_info dvbc; ++ struct dvbfe_dvbt_info dvbt; ++ struct dvbfe_dvbh_info dvbh; ++ struct dvbfe_atsc_info atsc; ++ ++ __u8 pad[128]; ++ } delsys; ++ ++ __u32 frequency_min; ++ __u32 frequency_max; ++ __u32 frequency_step; ++ __u32 frequency_tolerance; ++ __u32 symbol_rate_min; ++ __u32 symbol_rate_max; ++ __u32 symbol_rate_tolerance; ++ ++ enum fe_spectral_inversion inversion; ++ ++ __u8 pad[128]; ++}; ++#define DVBFE_GET_INFO _IOR('o', 85, struct dvbfe_info) ++ ++enum dvbfe_status { ++ DVBFE_HAS_SIGNAL = (1 << 0), /* something above noise floor */ ++ DVBFE_HAS_CARRIER = (1 << 1), /* Signal found */ ++ DVBFE_HAS_VITERBI = (1 << 2), /* FEC is stable */ ++ DVBFE_HAS_SYNC = (1 << 3), /* SYNC found */ ++ DVBFE_HAS_LOCK = (1 << 4), /* OK .. */ ++ DVBFE_TIMEDOUT = (1 << 5), /* no lock in last ~2 s */ ++ DVBFE_STATUS_DUMMY = (1 << 31) ++}; ++ ++/* DVB Frontend events */ ++struct dvbfe_events { ++ enum dvbfe_status status; ++ ++ __u8 pad[32]; ++}; ++ ++struct dvb_frontend_event { ++ fe_status_t status; ++ struct dvb_frontend_parameters parameters; ++}; ++#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) ++ ++struct dvbfe_event { ++ struct dvbfe_events fe_events; ++ struct dvbfe_params fe_params; ++}; ++#define DVBFE_GET_EVENT _IOR('o', 86, struct dvbfe_event) ++ ++#endif /*_DVBFRONTEND_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/audio.h dvb-apps/include/linux/dvb/audio.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/audio.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/audio.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,125 +0,0 @@ +-/* +- * audio.h +- * +- * Copyright (C) 2000 Ralph Metzler +- * & Marcus Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Lesser Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBAUDIO_H_ +-#define _DVBAUDIO_H_ +- +-#ifdef __KERNEL__ +-#include +-#else +-#include +-#endif +- +- +-typedef enum { +- AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ +- AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ +-} audio_stream_source_t; +- +- +-typedef enum { +- AUDIO_STOPPED, /* Device is stopped */ +- AUDIO_PLAYING, /* Device is currently playing */ +- AUDIO_PAUSED /* Device is paused */ +-} audio_play_state_t; +- +- +-typedef enum { +- AUDIO_STEREO, +- AUDIO_MONO_LEFT, +- AUDIO_MONO_RIGHT +-} audio_channel_select_t; +- +- +-typedef struct audio_mixer { +- unsigned int volume_left; +- unsigned int volume_right; +- // what else do we need? bass, pass-through, ... +-} audio_mixer_t; +- +- +-typedef struct audio_status { +- int AV_sync_state; /* sync audio and video? */ +- int mute_state; /* audio is muted */ +- audio_play_state_t play_state; /* current playback state */ +- audio_stream_source_t stream_source; /* current stream source */ +- audio_channel_select_t channel_select; /* currently selected channel */ +- int bypass_mode; /* pass on audio data to */ +- audio_mixer_t mixer_state; /* current mixer state */ +-} audio_status_t; /* separate decoder hardware */ +- +- +-typedef +-struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ +- int vocal1; /* into left and right t at 70% each */ +- int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ +- int melody; /* mixed into the left channel and */ +- /* Vocal2 into the right channel at 100% each. */ +- /* if Melody is non-zero, the melody channel gets mixed*/ +-} audio_karaoke_t; /* into left and right */ +- +- +-typedef uint16_t audio_attributes_t; +-/* bits: descr. */ +-/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */ +-/* 12 multichannel extension */ +-/* 11-10 audio type (0=not spec, 1=language included) */ +-/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */ +-/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */ +-/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */ +-/* 2- 0 number of audio channels (n+1 channels) */ +- +- +-/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */ +-#define AUDIO_CAP_DTS 1 +-#define AUDIO_CAP_LPCM 2 +-#define AUDIO_CAP_MP1 4 +-#define AUDIO_CAP_MP2 8 +-#define AUDIO_CAP_MP3 16 +-#define AUDIO_CAP_AAC 32 +-#define AUDIO_CAP_OGG 64 +-#define AUDIO_CAP_SDDS 128 +-#define AUDIO_CAP_AC3 256 +- +-#define AUDIO_STOP _IO('o', 1) +-#define AUDIO_PLAY _IO('o', 2) +-#define AUDIO_PAUSE _IO('o', 3) +-#define AUDIO_CONTINUE _IO('o', 4) +-#define AUDIO_SELECT_SOURCE _IO('o', 5) +-#define AUDIO_SET_MUTE _IO('o', 6) +-#define AUDIO_SET_AV_SYNC _IO('o', 7) +-#define AUDIO_SET_BYPASS_MODE _IO('o', 8) +-#define AUDIO_CHANNEL_SELECT _IO('o', 9) +-#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t) +- +-#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int) +-#define AUDIO_CLEAR_BUFFER _IO('o', 12) +-#define AUDIO_SET_ID _IO('o', 13) +-#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t) +-#define AUDIO_SET_STREAMTYPE _IO('o', 15) +-#define AUDIO_SET_EXT_ID _IO('o', 16) +-#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) +-#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) +- +-#endif /* _DVBAUDIO_H_ */ +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/ca.h dvb-apps/include/linux/dvb/ca.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/ca.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/ca.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,91 +0,0 @@ +-/* +- * ca.h +- * +- * Copyright (C) 2000 Ralph Metzler +- * & Marcus Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Lesser Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBCA_H_ +-#define _DVBCA_H_ +- +-/* slot interface types and info */ +- +-typedef struct ca_slot_info { +- int num; /* slot number */ +- +- int type; /* CA interface this slot supports */ +-#define CA_CI 1 /* CI high level interface */ +-#define CA_CI_LINK 2 /* CI link layer level interface */ +-#define CA_CI_PHYS 4 /* CI physical layer level interface */ +-#define CA_DESCR 8 /* built-in descrambler */ +-#define CA_SC 128 /* simple smart card interface */ +- +- unsigned int flags; +-#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ +-#define CA_CI_MODULE_READY 2 +-} ca_slot_info_t; +- +- +-/* descrambler types and info */ +- +-typedef struct ca_descr_info { +- unsigned int num; /* number of available descramblers (keys) */ +- unsigned int type; /* type of supported scrambling system */ +-#define CA_ECD 1 +-#define CA_NDS 2 +-#define CA_DSS 4 +-} ca_descr_info_t; +- +-typedef struct ca_caps { +- unsigned int slot_num; /* total number of CA card and module slots */ +- unsigned int slot_type; /* OR of all supported types */ +- unsigned int descr_num; /* total number of descrambler slots (keys) */ +- unsigned int descr_type; /* OR of all supported types */ +-} ca_caps_t; +- +-/* a message to/from a CI-CAM */ +-typedef struct ca_msg { +- unsigned int index; +- unsigned int type; +- unsigned int length; +- unsigned char msg[256]; +-} ca_msg_t; +- +-typedef struct ca_descr { +- unsigned int index; +- unsigned int parity; /* 0 == even, 1 == odd */ +- unsigned char cw[8]; +-} ca_descr_t; +- +-typedef struct ca_pid { +- unsigned int pid; +- int index; /* -1 == disable*/ +-} ca_pid_t; +- +-#define CA_RESET _IO('o', 128) +-#define CA_GET_CAP _IOR('o', 129, ca_caps_t) +-#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) +-#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) +-#define CA_GET_MSG _IOR('o', 132, ca_msg_t) +-#define CA_SEND_MSG _IOW('o', 133, ca_msg_t) +-#define CA_SET_DESCR _IOW('o', 134, ca_descr_t) +-#define CA_SET_PID _IOW('o', 135, ca_pid_t) +- +-#endif +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/dmx.h dvb-apps/include/linux/dvb/dmx.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/dmx.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/dmx.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,181 +0,0 @@ +-/* +- * dmx.h +- * +- * Copyright (C) 2000 Marcus Metzler +- * & Ralph Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBDMX_H_ +-#define _DVBDMX_H_ +- +-#include +-#ifdef __KERNEL__ +-#include +-#else +-#include +-#endif +- +- +-#define DMX_FILTER_SIZE 16 +- +-typedef enum +-{ +- DMX_OUT_DECODER, /* Streaming directly to decoder. */ +- DMX_OUT_TAP, /* Output going to a memory buffer */ +- /* (to be retrieved via the read command).*/ +- DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ +- /* (to be retrieved by reading from the */ +- /* logical DVR device). */ +-} dmx_output_t; +- +- +-typedef enum +-{ +- DMX_IN_FRONTEND, /* Input from a front-end device. */ +- DMX_IN_DVR /* Input from the logical DVR device. */ +-} dmx_input_t; +- +- +-typedef enum +-{ +- DMX_PES_AUDIO0, +- DMX_PES_VIDEO0, +- DMX_PES_TELETEXT0, +- DMX_PES_SUBTITLE0, +- DMX_PES_PCR0, +- +- DMX_PES_AUDIO1, +- DMX_PES_VIDEO1, +- DMX_PES_TELETEXT1, +- DMX_PES_SUBTITLE1, +- DMX_PES_PCR1, +- +- DMX_PES_AUDIO2, +- DMX_PES_VIDEO2, +- DMX_PES_TELETEXT2, +- DMX_PES_SUBTITLE2, +- DMX_PES_PCR2, +- +- DMX_PES_AUDIO3, +- DMX_PES_VIDEO3, +- DMX_PES_TELETEXT3, +- DMX_PES_SUBTITLE3, +- DMX_PES_PCR3, +- +- DMX_PES_OTHER +-} dmx_pes_type_t; +- +-#define DMX_PES_AUDIO DMX_PES_AUDIO0 +-#define DMX_PES_VIDEO DMX_PES_VIDEO0 +-#define DMX_PES_TELETEXT DMX_PES_TELETEXT0 +-#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 +-#define DMX_PES_PCR DMX_PES_PCR0 +- +- +-typedef enum +-{ +- DMX_SCRAMBLING_EV, +- DMX_FRONTEND_EV +-} dmx_event_t; +- +- +-typedef enum +-{ +- DMX_SCRAMBLING_OFF, +- DMX_SCRAMBLING_ON +-} dmx_scrambling_status_t; +- +- +-typedef struct dmx_filter +-{ +- __u8 filter[DMX_FILTER_SIZE]; +- __u8 mask[DMX_FILTER_SIZE]; +- __u8 mode[DMX_FILTER_SIZE]; +-} dmx_filter_t; +- +- +-struct dmx_sct_filter_params +-{ +- __u16 pid; +- dmx_filter_t filter; +- __u32 timeout; +- __u32 flags; +-#define DMX_CHECK_CRC 1 +-#define DMX_ONESHOT 2 +-#define DMX_IMMEDIATE_START 4 +-#define DMX_KERNEL_CLIENT 0x8000 +-}; +- +- +-struct dmx_pes_filter_params +-{ +- __u16 pid; +- dmx_input_t input; +- dmx_output_t output; +- dmx_pes_type_t pes_type; +- __u32 flags; +-}; +- +- +-struct dmx_event +-{ +- dmx_event_t event; +- time_t timeStamp; +- union +- { +- dmx_scrambling_status_t scrambling; +- } u; +-}; +- +-typedef struct dmx_caps { +- __u32 caps; +- int num_decoders; +-} dmx_caps_t; +- +-typedef enum { +- DMX_SOURCE_FRONT0 = 0, +- DMX_SOURCE_FRONT1, +- DMX_SOURCE_FRONT2, +- DMX_SOURCE_FRONT3, +- DMX_SOURCE_DVR0 = 16, +- DMX_SOURCE_DVR1, +- DMX_SOURCE_DVR2, +- DMX_SOURCE_DVR3 +-} dmx_source_t; +- +-struct dmx_stc { +- unsigned int num; /* input : which STC? 0..N */ +- unsigned int base; /* output: divisor for stc to get 90 kHz clock */ +- __u64 stc; /* output: stc in 'base'*90 kHz units */ +-}; +- +- +-#define DMX_START _IO('o', 41) +-#define DMX_STOP _IO('o', 42) +-#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) +-#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) +-#define DMX_SET_BUFFER_SIZE _IO('o', 45) +-#define DMX_GET_EVENT _IOR('o', 46, struct dmx_event) +-#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) +-#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) +-#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) +-#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) +- +-#endif /*_DVBDMX_H_*/ +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/frontend.h dvb-apps/include/linux/dvb/frontend.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/frontend.h 2006-05-18 01:32:38.000000000 +0200 ++++ dvb-apps/include/linux/dvb/frontend.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,267 +0,0 @@ +-/* +- * frontend.h +- * +- * Copyright (C) 2000 Marcus Metzler +- * Ralph Metzler +- * Holger Waechtler +- * Andre Draszik +- * for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBFRONTEND_H_ +-#define _DVBFRONTEND_H_ +- +-#include +- +- +-typedef enum fe_type { +- FE_QPSK, +- FE_QAM, +- FE_OFDM, +- FE_ATSC +-} fe_type_t; +- +- +-typedef enum fe_caps { +- FE_IS_STUPID = 0, +- FE_CAN_INVERSION_AUTO = 0x1, +- FE_CAN_FEC_1_2 = 0x2, +- FE_CAN_FEC_2_3 = 0x4, +- FE_CAN_FEC_3_4 = 0x8, +- FE_CAN_FEC_4_5 = 0x10, +- FE_CAN_FEC_5_6 = 0x20, +- FE_CAN_FEC_6_7 = 0x40, +- FE_CAN_FEC_7_8 = 0x80, +- FE_CAN_FEC_8_9 = 0x100, +- FE_CAN_FEC_AUTO = 0x200, +- FE_CAN_QPSK = 0x400, +- FE_CAN_QAM_16 = 0x800, +- FE_CAN_QAM_32 = 0x1000, +- FE_CAN_QAM_64 = 0x2000, +- FE_CAN_QAM_128 = 0x4000, +- FE_CAN_QAM_256 = 0x8000, +- FE_CAN_QAM_AUTO = 0x10000, +- FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000, +- FE_CAN_BANDWIDTH_AUTO = 0x40000, +- FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, +- FE_CAN_HIERARCHY_AUTO = 0x100000, +- FE_CAN_8VSB = 0x200000, +- FE_CAN_16VSB = 0x400000, +- FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) +- FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically +- FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output +-} fe_caps_t; +- +- +-struct dvb_frontend_info { +- char name[128]; +- fe_type_t type; +- __u32 frequency_min; +- __u32 frequency_max; +- __u32 frequency_stepsize; +- __u32 frequency_tolerance; +- __u32 symbol_rate_min; +- __u32 symbol_rate_max; +- __u32 symbol_rate_tolerance; /* ppm */ +- __u32 notifier_delay; /* DEPRECATED */ +- fe_caps_t caps; +-}; +- +- +-/** +- * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for +- * the meaning of this struct... +- */ +-struct dvb_diseqc_master_cmd { +- __u8 msg [6]; /* { framing, address, command, data [3] } */ +- __u8 msg_len; /* valid values are 3...6 */ +-}; +- +- +-struct dvb_diseqc_slave_reply { +- __u8 msg [4]; /* { framing, data [3] } */ +- __u8 msg_len; /* valid values are 0...4, 0 means no msg */ +- int timeout; /* return from ioctl after timeout ms with */ +-}; /* errorcode when no message was received */ +- +- +-typedef enum fe_sec_voltage { +- SEC_VOLTAGE_13, +- SEC_VOLTAGE_18, +- SEC_VOLTAGE_OFF +-} fe_sec_voltage_t; +- +- +-typedef enum fe_sec_tone_mode { +- SEC_TONE_ON, +- SEC_TONE_OFF +-} fe_sec_tone_mode_t; +- +- +-typedef enum fe_sec_mini_cmd { +- SEC_MINI_A, +- SEC_MINI_B +-} fe_sec_mini_cmd_t; +- +- +-typedef enum fe_status { +- FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ +- FE_HAS_CARRIER = 0x02, /* found a DVB signal */ +- FE_HAS_VITERBI = 0x04, /* FEC is stable */ +- FE_HAS_SYNC = 0x08, /* found sync bytes */ +- FE_HAS_LOCK = 0x10, /* everything's working... */ +- FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ +- FE_REINIT = 0x40 /* frontend was reinitialized, */ +-} fe_status_t; /* application is recommended to reset */ +- /* DiSEqC, tone and parameters */ +- +-typedef enum fe_spectral_inversion { +- INVERSION_OFF, +- INVERSION_ON, +- INVERSION_AUTO +-} fe_spectral_inversion_t; +- +- +-typedef enum fe_code_rate { +- FEC_NONE = 0, +- FEC_1_2, +- FEC_2_3, +- FEC_3_4, +- FEC_4_5, +- FEC_5_6, +- FEC_6_7, +- FEC_7_8, +- FEC_8_9, +- FEC_AUTO +-} fe_code_rate_t; +- +- +-typedef enum fe_modulation { +- QPSK, +- QAM_16, +- QAM_32, +- QAM_64, +- QAM_128, +- QAM_256, +- QAM_AUTO, +- VSB_8, +- VSB_16 +-} fe_modulation_t; +- +-typedef enum fe_transmit_mode { +- TRANSMISSION_MODE_2K, +- TRANSMISSION_MODE_8K, +- TRANSMISSION_MODE_AUTO +-} fe_transmit_mode_t; +- +-typedef enum fe_bandwidth { +- BANDWIDTH_8_MHZ, +- BANDWIDTH_7_MHZ, +- BANDWIDTH_6_MHZ, +- BANDWIDTH_AUTO +-} fe_bandwidth_t; +- +- +-typedef enum fe_guard_interval { +- GUARD_INTERVAL_1_32, +- GUARD_INTERVAL_1_16, +- GUARD_INTERVAL_1_8, +- GUARD_INTERVAL_1_4, +- GUARD_INTERVAL_AUTO +-} fe_guard_interval_t; +- +- +-typedef enum fe_hierarchy { +- HIERARCHY_NONE, +- HIERARCHY_1, +- HIERARCHY_2, +- HIERARCHY_4, +- HIERARCHY_AUTO +-} fe_hierarchy_t; +- +- +-struct dvb_qpsk_parameters { +- __u32 symbol_rate; /* symbol rate in Symbols per second */ +- fe_code_rate_t fec_inner; /* forward error correction (see above) */ +-}; +- +-struct dvb_qam_parameters { +- __u32 symbol_rate; /* symbol rate in Symbols per second */ +- fe_code_rate_t fec_inner; /* forward error correction (see above) */ +- fe_modulation_t modulation; /* modulation type (see above) */ +-}; +- +-struct dvb_vsb_parameters { +- fe_modulation_t modulation; /* modulation type (see above) */ +-}; +- +-struct dvb_ofdm_parameters { +- fe_bandwidth_t bandwidth; +- fe_code_rate_t code_rate_HP; /* high priority stream code rate */ +- fe_code_rate_t code_rate_LP; /* low priority stream code rate */ +- fe_modulation_t constellation; /* modulation type (see above) */ +- fe_transmit_mode_t transmission_mode; +- fe_guard_interval_t guard_interval; +- fe_hierarchy_t hierarchy_information; +-}; +- +- +-struct dvb_frontend_parameters { +- __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ +- /* intermediate frequency in kHz for QPSK */ +- fe_spectral_inversion_t inversion; +- union { +- struct dvb_qpsk_parameters qpsk; +- struct dvb_qam_parameters qam; +- struct dvb_ofdm_parameters ofdm; +- struct dvb_vsb_parameters vsb; +- } u; +-}; +- +- +-struct dvb_frontend_event { +- fe_status_t status; +- struct dvb_frontend_parameters parameters; +-}; +- +- +- +-#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) +- +-#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) +-#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd) +-#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply) +-#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */ +- +-#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */ +-#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */ +-#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */ +- +-#define FE_READ_STATUS _IOR('o', 69, fe_status_t) +-#define FE_READ_BER _IOR('o', 70, __u32) +-#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16) +-#define FE_READ_SNR _IOR('o', 72, __u16) +-#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32) +- +-#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) +-#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) +-#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) +- +-#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ +- +-#endif /*_DVBFRONTEND_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/net.h dvb-apps/include/linux/dvb/net.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/net.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/net.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,41 +0,0 @@ +-/* +- * net.h +- * +- * Copyright (C) 2000 Marcus Metzler +- * & Ralph Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBNET_H_ +-#define _DVBNET_H_ +- +-#include +- +- +-struct dvb_net_if { +- __u16 pid; +- __u16 if_num; +-}; +- +- +-#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if) +-#define NET_REMOVE_IF _IO('o', 53) +-#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if) +- +-#endif /*_DVBNET_H_*/ +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/osd.h dvb-apps/include/linux/dvb/osd.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/osd.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/osd.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,111 +0,0 @@ +-/* +- * osd.h +- * +- * Copyright (C) 2001 Ralph Metzler +- * & Marcus Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Lesser Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBOSD_H_ +-#define _DVBOSD_H_ +- +-typedef enum { +- // All functions return -2 on "not open" +- OSD_Close=1, // () +- // Disables OSD and releases the buffers +- // returns 0 on success +- OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) +- // Opens OSD with this size and bit depth +- // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" +- OSD_Show, // () +- // enables OSD mode +- // returns 0 on success +- OSD_Hide, // () +- // disables OSD mode +- // returns 0 on success +- OSD_Clear, // () +- // Sets all pixel to color 0 +- // returns 0 on success +- OSD_Fill, // (color) +- // Sets all pixel to color +- // returns 0 on success +- OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1}) +- // set palette entry to , and apply +- // R,G,B: 0..255 +- // R=Red, G=Green, B=Blue +- // opacity=0: pixel opacity 0% (only video pixel shows) +- // opacity=1..254: pixel opacity as specified in header +- // opacity=255: pixel opacity 100% (only OSD pixel shows) +- // returns 0 on success, -1 on error +- OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data) +- // Set a number of entries in the palette +- // sets the entries "firstcolor" through "lastcolor" from the array "data" +- // data has 4 byte for each color: +- // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel +- OSD_SetTrans, // (transparency{color}) +- // Sets transparency of mixed pixel (0..15) +- // returns 0 on success +- OSD_SetPixel, // (x0,y0,color) +- // sets pixel , to color number +- // returns 0 on success, -1 on error +- OSD_GetPixel, // (x0,y0) +- // returns color number of pixel ,, or -1 +- OSD_SetRow, // (x0,y0,x1,data) +- // fills pixels x0,y through x1,y with the content of data[] +- // returns 0 on success, -1 on clipping all pixel (no pixel drawn) +- OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data) +- // fills pixels x0,y0 through x1,y1 with the content of data[] +- // inc contains the width of one line in the data block, +- // inc<=0 uses blockwidth as linewidth +- // returns 0 on success, -1 on clipping all pixel +- OSD_FillRow, // (x0,y0,x1,color) +- // fills pixels x0,y through x1,y with the color +- // returns 0 on success, -1 on clipping all pixel +- OSD_FillBlock, // (x0,y0,x1,y1,color) +- // fills pixels x0,y0 through x1,y1 with the color +- // returns 0 on success, -1 on clipping all pixel +- OSD_Line, // (x0,y0,x1,y1,color) +- // draw a line from x0,y0 to x1,y1 with the color +- // returns 0 on success +- OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11 +- // fills parameters with the picture dimensions and the pixel aspect ratio +- // returns 0 on success +- OSD_Test, // () +- // draws a test picture. for debugging purposes only +- // returns 0 on success +-// TODO: remove "test" in final version +- OSD_Text, // (x0,y0,size,color,text) +- OSD_SetWindow, // (x0) set window with number 0 +- * for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBVERSION_H_ +-#define _DVBVERSION_H_ +- +-#define DVB_API_VERSION 3 +- +-#endif /*_DVBVERSION_H_*/ +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/linux/dvb/video.h dvb-apps/include/linux/dvb/video.h +--- linuxtv-dvb-apps-1.1.1/include/linux/dvb/video.h 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/include/linux/dvb/video.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,199 +0,0 @@ +-/* +- * video.h +- * +- * Copyright (C) 2000 Marcus Metzler +- * & Ralph Metzler +- for convergence integrated media GmbH +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public License +- * as published by the Free Software Foundation; either version 2.1 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser 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. +- * +- */ +- +-#ifndef _DVBVIDEO_H_ +-#define _DVBVIDEO_H_ +- +-#ifdef __KERNEL__ +-#include +-#else +-#include +-#include +-#endif +- +- +-typedef enum { +- VIDEO_FORMAT_4_3, /* Select 4:3 format */ +- VIDEO_FORMAT_16_9, /* Select 16:9 format. */ +- VIDEO_FORMAT_221_1 /* 2.21:1 */ +-} video_format_t; +- +- +-typedef enum { +- VIDEO_SYSTEM_PAL, +- VIDEO_SYSTEM_NTSC, +- VIDEO_SYSTEM_PALN, +- VIDEO_SYSTEM_PALNc, +- VIDEO_SYSTEM_PALM, +- VIDEO_SYSTEM_NTSC60, +- VIDEO_SYSTEM_PAL60, +- VIDEO_SYSTEM_PALM60 +-} video_system_t; +- +- +-typedef enum { +- VIDEO_PAN_SCAN, /* use pan and scan format */ +- VIDEO_LETTER_BOX, /* use letterbox format */ +- VIDEO_CENTER_CUT_OUT /* use center cut out format */ +-} video_displayformat_t; +- +-typedef struct { +- int w; +- int h; +- video_format_t aspect_ratio; +-} video_size_t; +- +-typedef enum { +- VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ +- VIDEO_SOURCE_MEMORY /* If this source is selected, the stream +- comes from the user through the write +- system call */ +-} video_stream_source_t; +- +- +-typedef enum { +- VIDEO_STOPPED, /* Video is stopped */ +- VIDEO_PLAYING, /* Video is currently playing */ +- VIDEO_FREEZED /* Video is freezed */ +-} video_play_state_t; +- +- +-struct video_event { +- int32_t type; +-#define VIDEO_EVENT_SIZE_CHANGED 1 +- time_t timestamp; +- union { +- video_size_t size; +- } u; +-}; +- +- +-struct video_status { +- int video_blank; /* blank video on freeze? */ +- video_play_state_t play_state; /* current state of playback */ +- video_stream_source_t stream_source; /* current source (demux/memory) */ +- video_format_t video_format; /* current aspect ratio of stream*/ +- video_displayformat_t display_format;/* selected cropping mode */ +-}; +- +- +-struct video_still_picture { +- char *iFrame; /* pointer to a single iframe in memory */ +- int32_t size; +-}; +- +- +-typedef +-struct video_highlight { +- int active; /* 1=show highlight, 0=hide highlight */ +- uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ +- /* 3- 0 Background pixel contrast */ +- uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ +- /* 3- 0 Emphasis pixel-1 contrast */ +- uint8_t color1; /* 7- 4 Pattern pixel color */ +- /* 3- 0 Background pixel color */ +- uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ +- /* 3- 0 Emphasis pixel-1 color */ +- uint32_t ypos; /* 23-22 auto action mode */ +- /* 21-12 start y */ +- /* 9- 0 end y */ +- uint32_t xpos; /* 23-22 button color number */ +- /* 21-12 start x */ +- /* 9- 0 end x */ +-} video_highlight_t; +- +- +-typedef struct video_spu { +- int active; +- int stream_id; +-} video_spu_t; +- +- +-typedef struct video_spu_palette { /* SPU Palette information */ +- int length; +- uint8_t *palette; +-} video_spu_palette_t; +- +- +-typedef struct video_navi_pack { +- int length; /* 0 ... 1024 */ +- uint8_t data[1024]; +-} video_navi_pack_t; +- +- +-typedef uint16_t video_attributes_t; +-/* bits: descr. */ +-/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ +-/* 13-12 TV system (0=525/60, 1=625/50) */ +-/* 11-10 Aspect ratio (0=4:3, 3=16:9) */ +-/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ +-/* 7 line 21-1 data present in GOP (1=yes, 0=no) */ +-/* 6 line 21-2 data present in GOP (1=yes, 0=no) */ +-/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ +-/* 2 source letterboxed (1=yes, 0=no) */ +-/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ +- +- +-/* bit definitions for capabilities: */ +-/* can the hardware decode MPEG1 and/or MPEG2? */ +-#define VIDEO_CAP_MPEG1 1 +-#define VIDEO_CAP_MPEG2 2 +-/* can you send a system and/or program stream to video device? +- (you still have to open the video and the audio device but only +- send the stream to the video device) */ +-#define VIDEO_CAP_SYS 4 +-#define VIDEO_CAP_PROG 8 +-/* can the driver also handle SPU, NAVI and CSS encoded data? +- (CSS API is not present yet) */ +-#define VIDEO_CAP_SPU 16 +-#define VIDEO_CAP_NAVI 32 +-#define VIDEO_CAP_CSS 64 +- +- +-#define VIDEO_STOP _IO('o', 21) +-#define VIDEO_PLAY _IO('o', 22) +-#define VIDEO_FREEZE _IO('o', 23) +-#define VIDEO_CONTINUE _IO('o', 24) +-#define VIDEO_SELECT_SOURCE _IO('o', 25) +-#define VIDEO_SET_BLANK _IO('o', 26) +-#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status) +-#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event) +-#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29) +-#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture) +-#define VIDEO_FAST_FORWARD _IO('o', 31) +-#define VIDEO_SLOWMOTION _IO('o', 32) +-#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int) +-#define VIDEO_CLEAR_BUFFER _IO('o', 34) +-#define VIDEO_SET_ID _IO('o', 35) +-#define VIDEO_SET_STREAMTYPE _IO('o', 36) +-#define VIDEO_SET_FORMAT _IO('o', 37) +-#define VIDEO_SET_SYSTEM _IO('o', 38) +-#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t) +-#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t) +-#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t) +-#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t) +-#define VIDEO_SET_ATTRIBUTES _IO('o', 53) +-#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) +- +-#endif /*_DVBVIDEO_H_*/ +- +diff -Nurd linuxtv-dvb-apps-1.1.1/include/net.h dvb-apps/include/net.h +--- linuxtv-dvb-apps-1.1.1/include/net.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/net.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,53 @@ ++/* ++ * net.h ++ * ++ * Copyright (C) 2000 Marcus Metzler ++ * & Ralph Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBNET_H_ ++#define _DVBNET_H_ ++ ++#include ++ ++ ++struct dvb_net_if { ++ __u16 pid; ++ __u16 if_num; ++ __u8 feedtype; ++#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */ ++#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */ ++}; ++ ++ ++#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if) ++#define NET_REMOVE_IF _IO('o', 53) ++#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if) ++ ++ ++/* binary compatibility cruft: */ ++struct __dvb_net_if_old { ++ __u16 pid; ++ __u16 if_num; ++}; ++#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old) ++#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old) ++ ++ ++#endif /*_DVBNET_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/osd.h dvb-apps/include/osd.h +--- linuxtv-dvb-apps-1.1.1/include/osd.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/osd.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,142 @@ ++/* ++ * osd.h ++ * ++ * Copyright (C) 2001 Ralph Metzler ++ * & Marcus Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Lesser Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBOSD_H_ ++#define _DVBOSD_H_ ++ ++typedef enum { ++ // All functions return -2 on "not open" ++ OSD_Close=1, // () ++ // Disables OSD and releases the buffers ++ // returns 0 on success ++ OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) ++ // Opens OSD with this size and bit depth ++ // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" ++ OSD_Show, // () ++ // enables OSD mode ++ // returns 0 on success ++ OSD_Hide, // () ++ // disables OSD mode ++ // returns 0 on success ++ OSD_Clear, // () ++ // Sets all pixel to color 0 ++ // returns 0 on success ++ OSD_Fill, // (color) ++ // Sets all pixel to color ++ // returns 0 on success ++ OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1}) ++ // set palette entry to , and apply ++ // R,G,B: 0..255 ++ // R=Red, G=Green, B=Blue ++ // opacity=0: pixel opacity 0% (only video pixel shows) ++ // opacity=1..254: pixel opacity as specified in header ++ // opacity=255: pixel opacity 100% (only OSD pixel shows) ++ // returns 0 on success, -1 on error ++ OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data) ++ // Set a number of entries in the palette ++ // sets the entries "firstcolor" through "lastcolor" from the array "data" ++ // data has 4 byte for each color: ++ // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel ++ OSD_SetTrans, // (transparency{color}) ++ // Sets transparency of mixed pixel (0..15) ++ // returns 0 on success ++ OSD_SetPixel, // (x0,y0,color) ++ // sets pixel , to color number ++ // returns 0 on success, -1 on error ++ OSD_GetPixel, // (x0,y0) ++ // returns color number of pixel ,, or -1 ++ OSD_SetRow, // (x0,y0,x1,data) ++ // fills pixels x0,y through x1,y with the content of data[] ++ // returns 0 on success, -1 on clipping all pixel (no pixel drawn) ++ OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data) ++ // fills pixels x0,y0 through x1,y1 with the content of data[] ++ // inc contains the width of one line in the data block, ++ // inc<=0 uses blockwidth as linewidth ++ // returns 0 on success, -1 on clipping all pixel ++ OSD_FillRow, // (x0,y0,x1,color) ++ // fills pixels x0,y through x1,y with the color ++ // returns 0 on success, -1 on clipping all pixel ++ OSD_FillBlock, // (x0,y0,x1,y1,color) ++ // fills pixels x0,y0 through x1,y1 with the color ++ // returns 0 on success, -1 on clipping all pixel ++ OSD_Line, // (x0,y0,x1,y1,color) ++ // draw a line from x0,y0 to x1,y1 with the color ++ // returns 0 on success ++ OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11 ++ // fills parameters with the picture dimensions and the pixel aspect ratio ++ // returns 0 on success ++ OSD_Test, // () ++ // draws a test picture. for debugging purposes only ++ // returns 0 on success ++// TODO: remove "test" in final version ++ OSD_Text, // (x0,y0,size,color,text) ++ OSD_SetWindow, // (x0) set window with number 0 ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBVERSION_H_ ++#define _DVBVERSION_H_ ++ ++#define DVB_API_VERSION 3 ++#define DVB_API_VERSION_MINOR 3 ++ ++#endif /*_DVBVERSION_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/include/video.h dvb-apps/include/video.h +--- linuxtv-dvb-apps-1.1.1/include/video.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/include/video.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,277 @@ ++/* ++ * video.h ++ * ++ * Copyright (C) 2000 Marcus Metzler ++ * & Ralph Metzler ++ * for convergence integrated media GmbH ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser 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. ++ * ++ */ ++ ++#ifndef _DVBVIDEO_H_ ++#define _DVBVIDEO_H_ ++ ++#ifdef __KERNEL__ ++#include ++#else ++#include ++#include ++#include ++#endif ++ ++ ++typedef enum { ++ VIDEO_FORMAT_4_3, /* Select 4:3 format */ ++ VIDEO_FORMAT_16_9, /* Select 16:9 format. */ ++ VIDEO_FORMAT_221_1 /* 2.21:1 */ ++} video_format_t; ++ ++ ++typedef enum { ++ VIDEO_SYSTEM_PAL, ++ VIDEO_SYSTEM_NTSC, ++ VIDEO_SYSTEM_PALN, ++ VIDEO_SYSTEM_PALNc, ++ VIDEO_SYSTEM_PALM, ++ VIDEO_SYSTEM_NTSC60, ++ VIDEO_SYSTEM_PAL60, ++ VIDEO_SYSTEM_PALM60 ++} video_system_t; ++ ++ ++typedef enum { ++ VIDEO_PAN_SCAN, /* use pan and scan format */ ++ VIDEO_LETTER_BOX, /* use letterbox format */ ++ VIDEO_CENTER_CUT_OUT /* use center cut out format */ ++} video_displayformat_t; ++ ++typedef struct { ++ int w; ++ int h; ++ video_format_t aspect_ratio; ++} video_size_t; ++ ++typedef enum { ++ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ ++ VIDEO_SOURCE_MEMORY /* If this source is selected, the stream ++ comes from the user through the write ++ system call */ ++} video_stream_source_t; ++ ++ ++typedef enum { ++ VIDEO_STOPPED, /* Video is stopped */ ++ VIDEO_PLAYING, /* Video is currently playing */ ++ VIDEO_FREEZED /* Video is freezed */ ++} video_play_state_t; ++ ++ ++/* Decoder commands */ ++#define VIDEO_CMD_PLAY (0) ++#define VIDEO_CMD_STOP (1) ++#define VIDEO_CMD_FREEZE (2) ++#define VIDEO_CMD_CONTINUE (3) ++ ++/* Flags for VIDEO_CMD_FREEZE */ ++#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) ++ ++/* Flags for VIDEO_CMD_STOP */ ++#define VIDEO_CMD_STOP_TO_BLACK (1 << 0) ++#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) ++ ++/* Play input formats: */ ++/* The decoder has no special format requirements */ ++#define VIDEO_PLAY_FMT_NONE (0) ++/* The decoder requires full GOPs */ ++#define VIDEO_PLAY_FMT_GOP (1) ++ ++/* The structure must be zeroed before use by the application ++ This ensures it can be extended safely in the future. */ ++struct video_command { ++ __u32 cmd; ++ __u32 flags; ++ union { ++ struct { ++ __u64 pts; ++ } stop; ++ ++ struct { ++ /* 0 or 1000 specifies normal speed, ++ 1 specifies forward single stepping, ++ -1 specifies backward single stepping, ++ >1: playback at speed/1000 of the normal speed, ++ <-1: reverse playback at (-speed/1000) of the normal speed. */ ++ __s32 speed; ++ __u32 format; ++ } play; ++ ++ struct { ++ __u32 data[16]; ++ } raw; ++ }; ++}; ++ ++/* FIELD_UNKNOWN can be used if the hardware does not know whether ++ the Vsync is for an odd, even or progressive (i.e. non-interlaced) ++ field. */ ++#define VIDEO_VSYNC_FIELD_UNKNOWN (0) ++#define VIDEO_VSYNC_FIELD_ODD (1) ++#define VIDEO_VSYNC_FIELD_EVEN (2) ++#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) ++ ++struct video_event { ++ int32_t type; ++#define VIDEO_EVENT_SIZE_CHANGED 1 ++#define VIDEO_EVENT_FRAME_RATE_CHANGED 2 ++#define VIDEO_EVENT_DECODER_STOPPED 3 ++#define VIDEO_EVENT_VSYNC 4 ++ time_t timestamp; ++ union { ++ video_size_t size; ++ unsigned int frame_rate; /* in frames per 1000sec */ ++ unsigned char vsync_field; /* unknown/odd/even/progressive */ ++ } u; ++}; ++ ++ ++struct video_status { ++ int video_blank; /* blank video on freeze? */ ++ video_play_state_t play_state; /* current state of playback */ ++ video_stream_source_t stream_source; /* current source (demux/memory) */ ++ video_format_t video_format; /* current aspect ratio of stream*/ ++ video_displayformat_t display_format;/* selected cropping mode */ ++}; ++ ++ ++struct video_still_picture { ++ char *iFrame; /* pointer to a single iframe in memory */ ++ int32_t size; ++}; ++ ++ ++typedef ++struct video_highlight { ++ int active; /* 1=show highlight, 0=hide highlight */ ++ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ ++ /* 3- 0 Background pixel contrast */ ++ uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ ++ /* 3- 0 Emphasis pixel-1 contrast */ ++ uint8_t color1; /* 7- 4 Pattern pixel color */ ++ /* 3- 0 Background pixel color */ ++ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ ++ /* 3- 0 Emphasis pixel-1 color */ ++ uint32_t ypos; /* 23-22 auto action mode */ ++ /* 21-12 start y */ ++ /* 9- 0 end y */ ++ uint32_t xpos; /* 23-22 button color number */ ++ /* 21-12 start x */ ++ /* 9- 0 end x */ ++} video_highlight_t; ++ ++ ++typedef struct video_spu { ++ int active; ++ int stream_id; ++} video_spu_t; ++ ++ ++typedef struct video_spu_palette { /* SPU Palette information */ ++ int length; ++ uint8_t *palette; ++} video_spu_palette_t; ++ ++ ++typedef struct video_navi_pack { ++ int length; /* 0 ... 1024 */ ++ uint8_t data[1024]; ++} video_navi_pack_t; ++ ++ ++typedef uint16_t video_attributes_t; ++/* bits: descr. */ ++/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ ++/* 13-12 TV system (0=525/60, 1=625/50) */ ++/* 11-10 Aspect ratio (0=4:3, 3=16:9) */ ++/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ ++/* 7 line 21-1 data present in GOP (1=yes, 0=no) */ ++/* 6 line 21-2 data present in GOP (1=yes, 0=no) */ ++/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ ++/* 2 source letterboxed (1=yes, 0=no) */ ++/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ ++ ++ ++/* bit definitions for capabilities: */ ++/* can the hardware decode MPEG1 and/or MPEG2? */ ++#define VIDEO_CAP_MPEG1 1 ++#define VIDEO_CAP_MPEG2 2 ++/* can you send a system and/or program stream to video device? ++ (you still have to open the video and the audio device but only ++ send the stream to the video device) */ ++#define VIDEO_CAP_SYS 4 ++#define VIDEO_CAP_PROG 8 ++/* can the driver also handle SPU, NAVI and CSS encoded data? ++ (CSS API is not present yet) */ ++#define VIDEO_CAP_SPU 16 ++#define VIDEO_CAP_NAVI 32 ++#define VIDEO_CAP_CSS 64 ++ ++ ++#define VIDEO_STOP _IO('o', 21) ++#define VIDEO_PLAY _IO('o', 22) ++#define VIDEO_FREEZE _IO('o', 23) ++#define VIDEO_CONTINUE _IO('o', 24) ++#define VIDEO_SELECT_SOURCE _IO('o', 25) ++#define VIDEO_SET_BLANK _IO('o', 26) ++#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status) ++#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event) ++#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29) ++#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture) ++#define VIDEO_FAST_FORWARD _IO('o', 31) ++#define VIDEO_SLOWMOTION _IO('o', 32) ++#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int) ++#define VIDEO_CLEAR_BUFFER _IO('o', 34) ++#define VIDEO_SET_ID _IO('o', 35) ++#define VIDEO_SET_STREAMTYPE _IO('o', 36) ++#define VIDEO_SET_FORMAT _IO('o', 37) ++#define VIDEO_SET_SYSTEM _IO('o', 38) ++#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t) ++#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t) ++#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t) ++#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t) ++#define VIDEO_SET_ATTRIBUTES _IO('o', 53) ++#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) ++#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) ++ ++/** ++ * VIDEO_GET_PTS ++ * ++ * Read the 33 bit presentation time stamp as defined ++ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. ++ * ++ * The PTS should belong to the currently played ++ * frame if possible, but may also be a value close to it ++ * like the PTS of the last decoded frame or the last PTS ++ * extracted by the PES parser. ++ */ ++#define VIDEO_GET_PTS _IOR('o', 57, __u64) ++ ++/* Read the number of displayed frames since the decoder was started */ ++#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) ++ ++#define VIDEO_COMMAND _IOWR('o', 59, struct video_command) ++#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) ++ ++#endif /*_DVBVIDEO_H_*/ +diff -Nurd linuxtv-dvb-apps-1.1.1/INSTALL dvb-apps/INSTALL +--- linuxtv-dvb-apps-1.1.1/INSTALL 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/INSTALL 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,26 @@ ++Requirements: ++ ++For ttusb_dec_reset, you will need libusb. ++ ++Building: ++ ++Simply type ++$ make ++ ++Build options ++ static=1 - Build all applications statically. ++ V=1 - Verbose output during build. ++ ttusb_dec_reset=1 - Build the optional ttusb_dec_reset. ++ ++Installing: ++ ++Install libraries and utils to /usr/[bin,include,lib,share] ++$ make install ++ ++Install options ++ prefix=<...> - basic installation dir [default: /usr] ++ bindir=<...> - installation dir for applications [default: $(prefix)/bin] ++ includedir=<...> - installation dir for include files [default: $(prefix)/include] ++ libdir=<...> - installation dir for applications [default: $(prefix)/lib] ++ sharedir=<...> - installation dir for shared data [default: $(prefix)/share] ++ DESTDIR=<...> - prefix for all files, useful for packaging +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbaudio.c dvb-apps/lib/libdvbapi/dvbaudio.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbaudio.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbaudio.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,50 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbaudio.h" ++ ++int dvbaudio_open(int adapter, int audiodeviceid) ++{ ++ char filename[PATH_MAX+1]; ++ int fd; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/audio%i", adapter, audiodeviceid); ++ if ((fd = open(filename, O_RDWR)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.audio%i", adapter, audiodeviceid); ++ fd = open(filename, O_RDWR); ++ } ++ ++ return fd; ++} ++ ++int dvbaudio_set_bypass(int fd, int bypass) ++{ ++ return ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbaudio.h dvb-apps/lib/libdvbapi/dvbaudio.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbaudio.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbaudio.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,55 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBAUDIO_H ++#define LIBDVBAUDIO_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * Open a DVB audio device. ++ * ++ * @param adapter DVB adapter ID. ++ * @param audiodeviceid Id of audio device of that adapter to open. ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbaudio_open(int adapter, int audiodeviceid); ++ ++/** ++ * Control audio bypass - i.e. output decoded audio, or the raw bitstream (e.g. AC3). ++ * ++ * @param fd Audio device opened with dvbaudio_open(). ++ * @param bypass 1=> enable bypass, 0=> disable. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbaudio_set_bypass(int fd, int bypass); ++ ++// FIXME: this is a stub library ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBAUDIO_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbca.c dvb-apps/lib/libdvbapi/dvbca.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbca.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbca.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,159 @@ ++/* ++ * libdvbca - interface onto raw CA devices ++ * ++ * Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbca.h" ++ ++ ++int dvbca_open(int adapter, int cadevice) ++{ ++ char filename[PATH_MAX+1]; ++ int fd; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/ca%i", adapter, cadevice); ++ if ((fd = open(filename, O_RDWR)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.ca%i", adapter, cadevice); ++ fd = open(filename, O_RDWR); ++ } ++ ++ return fd; ++} ++ ++int dvbca_reset(int fd, uint8_t slot) ++{ ++ return ioctl(fd, CA_RESET, (1 << slot)); ++} ++ ++int dvbca_get_interface_type(int fd, uint8_t slot) ++{ ++ ca_slot_info_t info; ++ ++ info.num = slot; ++ if (ioctl(fd, CA_GET_SLOT_INFO, &info)) ++ return -1; ++ ++ if (info.type & CA_CI_LINK) ++ return DVBCA_INTERFACE_LINK; ++ if (info.type & CA_CI) ++ return DVBCA_INTERFACE_HLCI; ++ ++ return -1; ++} ++ ++int dvbca_get_cam_state(int fd, uint8_t slot) ++{ ++ ca_slot_info_t info; ++ ++ info.num = slot; ++ if (ioctl(fd, CA_GET_SLOT_INFO, &info)) ++ return -1; ++ ++ if (info.flags == 0) ++ return DVBCA_CAMSTATE_MISSING; ++ if (info.flags & CA_CI_MODULE_READY) ++ return DVBCA_CAMSTATE_READY; ++ if (info.flags & CA_CI_MODULE_PRESENT) ++ return DVBCA_CAMSTATE_INITIALISING; ++ ++ return -1; ++} ++ ++int dvbca_link_write(int fd, uint8_t slot, uint8_t connection_id, ++ uint8_t *data, uint16_t data_length) ++{ ++ uint8_t *buf = malloc(data_length + 2); ++ if (buf == NULL) ++ return -1; ++ ++ buf[0] = slot; ++ buf[1] = connection_id; ++ memcpy(buf+2, data, data_length); ++ ++ int result = write(fd, buf, data_length+2); ++ free(buf); ++ return result; ++} ++ ++int dvbca_link_read(int fd, uint8_t *slot, uint8_t *connection_id, ++ uint8_t *data, uint16_t data_length) ++{ ++ int size; ++ ++ uint8_t *buf = malloc(data_length + 2); ++ if (buf == NULL) ++ return -1; ++ ++ if ((size = read(fd, buf, data_length+2)) < 2) ++ return -1; ++ ++ *slot = buf[0]; ++ *connection_id = buf[1]; ++ memcpy(data, buf+2, size-2); ++ free(buf); ++ ++ return size - 2; ++} ++ ++int dvbca_hlci_write(int fd, uint8_t *data, uint16_t data_length) ++{ ++ struct ca_msg msg; ++ ++ if (data_length > 256) { ++ return -1; ++ } ++ memset(&msg, 0, sizeof(msg)); ++ msg.length = data_length; ++ ++ memcpy(msg.msg, data, data_length); ++ ++ return ioctl(fd, CA_SEND_MSG, &msg); ++} ++ ++int dvbca_hlci_read(int fd, uint32_t app_tag, uint8_t *data, ++ uint16_t data_length) ++{ ++ struct ca_msg msg; ++ ++ if (data_length > 256) { ++ data_length = 256; ++ } ++ memset(&msg, 0, sizeof(msg)); ++ msg.length = data_length; ++ msg.msg[0] = app_tag >> 16; ++ msg.msg[1] = app_tag >> 8; ++ msg.msg[2] = app_tag; ++ ++ int status = ioctl(fd, CA_GET_MSG, &msg); ++ if (status < 0) return status; ++ ++ if (msg.length > data_length) msg.length = data_length; ++ memcpy(data, msg.msg, msg.length); ++ return msg.length; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbca.h dvb-apps/lib/libdvbapi/dvbca.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbca.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbca.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,135 @@ ++/* ++ * libdvbca - interface onto raw CA devices ++ * ++ * Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBCA_H ++#define LIBDVBCA_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * The types of CA interface we support. ++ */ ++#define DVBCA_INTERFACE_LINK 0 ++#define DVBCA_INTERFACE_HLCI 1 ++ ++/** ++ * States a CAM in a slot can be in. ++ */ ++#define DVBCA_CAMSTATE_MISSING 0 ++#define DVBCA_CAMSTATE_INITIALISING 1 ++#define DVBCA_CAMSTATE_READY 2 ++ ++ ++/** ++ * Open a CA device. Multiple CAMs can be accessed through a CA device. ++ * ++ * @param adapter Index of the DVB adapter. ++ * @param cadevice Index of the CA device on that adapter (usually 0). ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbca_open(int adapter, int cadevice); ++ ++/** ++ * Reset a CAM. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param slot Slot where the requested CAM is in. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int dvbca_reset(int fd, uint8_t slot); ++ ++/** ++ * Get the interface type of a CAM. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param slot Slot where the requested CAM is in. ++ * @return One of the DVBCA_INTERFACE_* values, or -1 on failure. ++ */ ++extern int dvbca_get_interface_type(int fd, uint8_t slot); ++ ++/** ++ * Get the state of a CAM. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param slot Slot where the requested CAM is in. ++ * @return One of the DVBCA_CAMSTATE_* values, or -1 on failure. ++ */ ++extern int dvbca_get_cam_state(int fd, uint8_t slot); ++ ++/** ++ * Write a message to a CAM using a link-layer interface. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param slot Slot where the requested CAM is in. ++ * @param connection_id Connection ID of the message. ++ * @param data Data to write. ++ * @param data_length Number of bytes to write. ++ * @return 0 on success, or -1 on failure. ++ */ ++extern int dvbca_link_write(int fd, uint8_t slot, uint8_t connection_id, ++ uint8_t *data, uint16_t data_length); ++ ++/** ++ * Read a message from a CAM using a link-layer interface. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param slot Slot where the responding CAM is in. ++ * @param connection_id Destination for the connection ID the message came from. ++ * @param data Data that was read. ++ * @param data_length Max number of bytes to read. ++ * @return Number of bytes read on success, or -1 on failure. ++ */ ++extern int dvbca_link_read(int fd, uint8_t *slot, uint8_t *connection_id, ++ uint8_t *data, uint16_t data_length); ++ ++// FIXME how do we determine which CAM slot of a CA is meant? ++/** ++ * Write a message to a CAM using an HLCI interface. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param data Data to write. ++ * @param data_length Number of bytes to write. ++ * @return 0 on success, or -1 on failure. ++ */ ++extern int dvbca_hlci_write(int fd, uint8_t *data, uint16_t data_length); ++ ++// FIXME how do we determine which CAM slot of a CA is meant? ++/** ++ * Read a message from a CAM using an HLCI interface. ++ * ++ * @param fd File handle opened with dvbca_open. ++ * @param app_tag Application layer tag giving the message type to read. ++ * @param data Data that was read. ++ * @param data_length Max number of bytes to read. ++ * @return Number of bytes read on success, or -1 on failure. ++ */ ++extern int dvbca_hlci_read(int fd, uint32_t app_tag, uint8_t *data, ++ uint16_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBCA_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbdemux.c dvb-apps/lib/libdvbapi/dvbdemux.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbdemux.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbdemux.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,255 @@ ++/* ++ * libdvbdemux - a DVB demux library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbdemux.h" ++ ++ ++int dvbdemux_open_demux(int adapter, int demuxdevice, int nonblocking) ++{ ++ char filename[PATH_MAX+1]; ++ int flags = O_RDWR; ++ int fd; ++ ++ if (nonblocking) ++ flags |= O_NONBLOCK; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/demux%i", adapter, demuxdevice); ++ if ((fd = open(filename, flags)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.demux%i", adapter, demuxdevice); ++ fd = open(filename, flags); ++ } ++ ++ return fd; ++} ++ ++int dvbdemux_open_dvr(int adapter, int dvrdevice, int readonly, int nonblocking) ++{ ++ char filename[PATH_MAX+1]; ++ int flags = O_RDWR; ++ int fd; ++ ++ if (readonly) ++ flags = O_RDONLY; ++ if (nonblocking) ++ flags |= O_NONBLOCK; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/dvr%i", adapter, dvrdevice); ++ if ((fd = open(filename, flags)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.dvr%i", adapter, dvrdevice); ++ fd = open(filename, flags); ++ } ++ ++ return fd; ++} ++ ++int dvbdemux_set_section_filter(int fd, int pid, ++ uint8_t filter[18], uint8_t mask[18], ++ int start, int checkcrc) ++{ ++ struct dmx_sct_filter_params sctfilter; ++ ++ memset(&sctfilter, 0, sizeof(sctfilter)); ++ sctfilter.pid = pid; ++ memcpy(sctfilter.filter.filter, filter, 1); ++ memcpy(sctfilter.filter.filter+1, filter+3, 15); ++ memcpy(sctfilter.filter.mask, mask, 1); ++ memcpy(sctfilter.filter.mask+1, mask+3, 15); ++ memset(sctfilter.filter.mode, 0, 16); ++ if (start) ++ sctfilter.flags |= DMX_IMMEDIATE_START; ++ if (checkcrc) ++ sctfilter.flags |= DMX_CHECK_CRC; ++ ++ return ioctl(fd, DMX_SET_FILTER, &sctfilter); ++} ++ ++int dvbdemux_set_pes_filter(int fd, int pid, ++ int input, int output, ++ int pestype, ++ int start) ++{ ++ struct dmx_pes_filter_params filter; ++ ++ memset(&filter, 0, sizeof(filter)); ++ filter.pid = pid; ++ ++ switch(input) { ++ case DVBDEMUX_INPUT_FRONTEND: ++ filter.input = DMX_IN_FRONTEND; ++ break; ++ ++ case DVBDEMUX_INPUT_DVR: ++ filter.input = DMX_IN_DVR; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ switch(output) { ++ case DVBDEMUX_OUTPUT_DECODER: ++ filter.output = DMX_OUT_DECODER; ++ break; ++ ++ case DVBDEMUX_OUTPUT_DEMUX: ++ filter.output = DMX_OUT_TAP; ++ break; ++ ++ case DVBDEMUX_OUTPUT_DVR: ++ filter.output = DMX_OUT_TS_TAP; ++ break; ++ ++#ifdef DMX_OUT_TSDEMUX_TAP ++ case DVBDEMUX_OUTPUT_TS_DEMUX: ++ filter.output = DMX_OUT_TSDEMUX_TAP; ++ break; ++#endif ++ ++ default: ++ return -EINVAL; ++ } ++ ++ switch(pestype) { ++ case DVBDEMUX_PESTYPE_AUDIO: ++ filter.pes_type = DMX_PES_AUDIO; ++ break; ++ ++ case DVBDEMUX_PESTYPE_VIDEO: ++ filter.pes_type = DMX_PES_VIDEO; ++ break; ++ ++ case DVBDEMUX_PESTYPE_TELETEXT: ++ filter.pes_type = DMX_PES_TELETEXT; ++ break; ++ ++ case DVBDEMUX_PESTYPE_SUBTITLE: ++ filter.pes_type = DMX_PES_SUBTITLE; ++ break; ++ ++ case DVBDEMUX_PESTYPE_PCR: ++ filter.pes_type = DMX_PES_PCR; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ if (start) ++ filter.flags |= DMX_IMMEDIATE_START; ++ ++ return ioctl(fd, DMX_SET_PES_FILTER, &filter); ++} ++ ++int dvbdemux_set_pid_filter(int fd, int pid, ++ int input, int output, ++ int start) ++{ ++ struct dmx_pes_filter_params filter; ++ ++ memset(&filter, 0, sizeof(filter)); ++ if (pid == -1) ++ filter.pid = 0x2000; ++ else ++ filter.pid = pid; ++ ++ switch(input) { ++ case DVBDEMUX_INPUT_FRONTEND: ++ filter.input = DMX_IN_FRONTEND; ++ break; ++ ++ case DVBDEMUX_INPUT_DVR: ++ filter.input = DMX_IN_DVR; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ switch(output) { ++ case DVBDEMUX_OUTPUT_DECODER: ++ filter.output = DMX_OUT_DECODER; ++ break; ++ ++ case DVBDEMUX_OUTPUT_DEMUX: ++ filter.output = DMX_OUT_TAP; ++ break; ++ ++ case DVBDEMUX_OUTPUT_DVR: ++ filter.output = DMX_OUT_TS_TAP; ++ break; ++ ++#ifdef DMX_OUT_TSDEMUX_TAP ++ case DVBDEMUX_OUTPUT_TS_DEMUX: ++ filter.output = DMX_OUT_TSDEMUX_TAP; ++ break; ++#endif ++ ++ default: ++ return -EINVAL; ++ } ++ ++ filter.pes_type = DMX_PES_OTHER; ++ ++ if (start) ++ filter.flags |= DMX_IMMEDIATE_START; ++ ++ return ioctl(fd, DMX_SET_PES_FILTER, &filter); ++} ++ ++int dvbdemux_start(int fd) ++{ ++ return ioctl(fd, DMX_START); ++} ++ ++int dvbdemux_stop(int fd) ++{ ++ return ioctl(fd, DMX_STOP); ++} ++ ++int dvbdemux_get_stc(int fd, uint64_t *stc) ++{ ++ struct dmx_stc _stc; ++ int result; ++ ++ memset(stc, 0, sizeof(_stc)); ++ if ((result = ioctl(fd, DMX_GET_STC, &_stc)) != 0) { ++ return result; ++ } ++ ++ *stc = _stc.stc / _stc.base; ++ return 0; ++} ++ ++int dvbdemux_set_buffer(int fd, int bufsize) ++{ ++ return ioctl(fd, DMX_SET_BUFFER_SIZE, bufsize); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbdemux.h dvb-apps/lib/libdvbapi/dvbdemux.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbdemux.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbdemux.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,204 @@ ++/* ++ * libdvbdemux - a DVB demux library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBDEMUX_H ++#define LIBDVBDEMUX_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * Source of the data to be demuxed. ++ * ++ * FRONTEND. The data will be read from the frontend on the adapter. ++ * ++ * DVR. The data will be read from the DVR device of the adapter (of course, ++ * you need to write data TO the DVR device as well). ++ */ ++#define DVBDEMUX_INPUT_FRONTEND 0 ++#define DVBDEMUX_INPUT_DVR 1 ++ ++/** ++ * Destination of the demuxed data. ++ * ++ * DECODER. Sends the data directly to a hardware decoder (if present). ++ * ++ * DEMUX. Sends the PID stream to the current demux file descriptor. HOWEVER, the ++ * data will be the payload *only* - transport stream headers will be stripped. ++ * ++ * DVR sends the data to the DVR device. The data will be the complete transport ++ * stream packets with headers intact. Note: if multiple filters specify ++ * DVBDEMUX_OUTPUT_DVR, the individual PID streams will be re-multiplexed ++ * together. ++ */ ++#define DVBDEMUX_OUTPUT_DECODER 0 ++#define DVBDEMUX_OUTPUT_DEMUX 1 ++#define DVBDEMUX_OUTPUT_DVR 2 ++#define DVBDEMUX_OUTPUT_TS_DEMUX 3 ++ ++/** ++ * PES types. ++ */ ++#define DVBDEMUX_PESTYPE_AUDIO 0 ++#define DVBDEMUX_PESTYPE_VIDEO 1 ++#define DVBDEMUX_PESTYPE_TELETEXT 2 ++#define DVBDEMUX_PESTYPE_SUBTITLE 3 ++#define DVBDEMUX_PESTYPE_PCR 4 ++ ++ ++/** ++ * Open a demux device. Can be called multiple times. These let you setup a ++ * single filter per FD. It can can also be read() from if you use a section ++ * filter, or create a pes_filter or raw_filter with output DVBDEMUX_OUTPUT_DEMUX. ++ * ++ * @param adapter Index of the DVB adapter. ++ * @param demuxdevice Index of the demux device on that adapter (usually 0). ++ * @param nonblocking If 1, frontend will be opened in nonblocking mode. ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbdemux_open_demux(int adapter, int demuxdevice, int nonblocking); ++ ++/** ++ * Open a DVR device. May be opened for writing or reading once. ++ * It is used to either write() transport stream data to be demuxed ++ * (if input == DVBDEMUX_INPUT_DVR), or to read() a stream of demuxed data ++ * (if output == DVBDEMUX_OUTPUT_DVR). ++ * ++ * Note, all demux filters with output set to DVBDEMUX_OUTPUT_DVR will be ++ * multiplexed together and output their data on this device. ++ * ++ * @param adapter Index of the DVB adapter. ++ * @param dvrdevice Index of the dvr device on that adapter (usually 0) ++ * @param readonly If 1, frontend will be opened in readonly mode only. ++ * @param nonblocking If 1, frontend will be opened in nonblocking mode. ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbdemux_open_dvr(int adapter, int dvrdevice, int readonly, int nonblocking); ++ ++/** ++ * Set filter for the first 18 bytes of decoded SI table sections. Note that ++ * bytes 1 and 2 are _not_ filtered since they contain the length field. ++ * ++ * Conceptually, the driver computes the following for each filtered bit. ++ * ++ * (filter[X].bit[Y] & mask[X].bit[Y]) == (header[X].bit[Y] & mask[X].bit[Y]) ++ * ++ * Any sections which do not match this criteria for every bit will be discarded. ++ * ++ * The SI data is always read from the frontend, and is always returned by ++ * read()ing the demux fd. FIXME: check this statement! ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @param pid PID of the stream. ++ * @param filter The filter values of the first 18 bytes of the desired sections. ++ * @param mask Bitmask indicating which bits in the filter array should be tested ++ * (if a bit is 1, it will be tested). ++ * @param start If 1, the filter will be started immediately. Otherwise you must ++ * call dvbdemux_start() manually. ++ * @param checkcrc If 1, the driver will check the CRC on the table sections. ++ * Any bad sections will be dropped. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_set_section_filter(int fd, int pid, ++ uint8_t filter[18], uint8_t mask[18], ++ int start, int checkcrc); ++ ++/** ++ * Set filter for a stream of PES data. This call can only used for cards ++ * equipped with a hardware decoder. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @param pid PID of the stream. ++ * @param input One of DVBDEMUX_INPUT_*. ++ * @param output One of DVBDEMUX_OUTPUT_*. ++ * @param pestype One of DVBDEMUX_PESTYPE_* - this tells the decoder the type ++ * of data in this stream. ++ * @param start If 1, the filter will be started immediately. Otherwise you must ++ * call dvbdemux_start() manually. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_set_pes_filter(int fd, int pid, ++ int input, int output, ++ int pestype, ++ int start); ++ ++/** ++ * Create a pid filter - this will extract transport stream packets for a ++ * specified PID. ++ * ++ * Note: The wildcard PID can only be used on "budget" cards. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @param pid PID to retrieve, or use -1 as a wildcard for ALL PIDs. ++ * @param input One of DVBDEMUX_INPUT_*. ++ * @param output One of DVBDEMUX_OUTPUT_*. ++ * @param start If 1, the filter will be started immediately. Otherwise you must ++ * call dvbdemux_start() manually. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_set_pid_filter(int fd, int pid, ++ int input, int output, ++ int start); ++ ++/** ++ * Start a demux going. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_start(int fd); ++ ++/** ++ * Stop a demux. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_stop(int fd); ++ ++/** ++ * Retrieve the current STC from the demux. This call can only used for cards ++ * equipped with a hardware decoder. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @param stc Where to put the retrieved STC value (in 90kHz clock). ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_get_stc(int fd, uint64_t *stc); ++ ++/** ++ * Change the internal buffer size used by the demuxer. The default buffer size ++ * is 8192 bytes. Can only be used if the demux in question is stopped. ++ * ++ * @param fd FD as opened with dvbdemux_open_demux() above. ++ * @param bufsize New buffer size to use. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbdemux_set_buffer(int fd, int bufsize); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBDEMUX_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbfe.c dvb-apps/lib/libdvbapi/dvbfe.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbfe.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbfe.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,574 @@ ++/* ++ * libdvbfe - a DVB frontend library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2005 Manu Abraham ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbfe.h" ++ ++int verbose = 0; ++ ++static int dvbfe_spectral_inversion_to_kapi[][2] = ++{ ++ { DVBFE_INVERSION_OFF, INVERSION_OFF }, ++ { DVBFE_INVERSION_ON, INVERSION_ON }, ++ { DVBFE_INVERSION_AUTO, INVERSION_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_code_rate_to_kapi[][2] = ++{ ++ { DVBFE_FEC_NONE, FEC_NONE }, ++ { DVBFE_FEC_1_2, FEC_1_2 }, ++ { DVBFE_FEC_2_3, FEC_2_3 }, ++ { DVBFE_FEC_3_4, FEC_3_4 }, ++ { DVBFE_FEC_4_5, FEC_4_5 }, ++ { DVBFE_FEC_5_6, FEC_5_6 }, ++ { DVBFE_FEC_6_7, FEC_6_7 }, ++ { DVBFE_FEC_7_8, FEC_7_8 }, ++ { DVBFE_FEC_8_9, FEC_8_9 }, ++ { DVBFE_FEC_AUTO, FEC_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbt_const_to_kapi[][2] = ++{ ++ { DVBFE_DVBT_CONST_QPSK, FE_QPSK }, ++ { DVBFE_DVBT_CONST_QAM_16, QAM_16 }, ++ { DVBFE_DVBT_CONST_QAM_32, QAM_32 }, ++ { DVBFE_DVBT_CONST_QAM_64, QAM_64 }, ++ { DVBFE_DVBT_CONST_QAM_128, QAM_128 }, ++ { DVBFE_DVBT_CONST_QAM_256, QAM_256 }, ++ { DVBFE_DVBT_CONST_AUTO, QAM_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbc_mod_to_kapi[][2] = ++{ ++ { DVBFE_DVBC_MOD_QAM_16, QAM_16 }, ++ { DVBFE_DVBC_MOD_QAM_32, QAM_32 }, ++ { DVBFE_DVBC_MOD_QAM_64, QAM_64 }, ++ { DVBFE_DVBC_MOD_QAM_128, QAM_128 }, ++ { DVBFE_DVBC_MOD_QAM_256, QAM_256 }, ++ { DVBFE_DVBC_MOD_AUTO, QAM_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_atsc_mod_to_kapi[][2] = ++{ ++ { DVBFE_ATSC_MOD_QAM_64, QAM_64 }, ++ { DVBFE_ATSC_MOD_QAM_256, QAM_256 }, ++ { DVBFE_ATSC_MOD_VSB_8, VSB_8 }, ++ { DVBFE_ATSC_MOD_VSB_16, VSB_16 }, ++ { DVBFE_ATSC_MOD_AUTO, QAM_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbt_transmit_mode_to_kapi[][2] = ++{ ++ { DVBFE_DVBT_TRANSMISSION_MODE_2K, TRANSMISSION_MODE_2K }, ++ { DVBFE_DVBT_TRANSMISSION_MODE_8K, TRANSMISSION_MODE_8K }, ++ { DVBFE_DVBT_TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbt_bandwidth_to_kapi[][2] = ++{ ++ { DVBFE_DVBT_BANDWIDTH_8_MHZ, BANDWIDTH_8_MHZ }, ++ { DVBFE_DVBT_BANDWIDTH_7_MHZ, BANDWIDTH_7_MHZ }, ++ { DVBFE_DVBT_BANDWIDTH_6_MHZ, BANDWIDTH_6_MHZ }, ++ { DVBFE_DVBT_BANDWIDTH_AUTO, BANDWIDTH_AUTO }, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbt_guard_interval_to_kapi[][2] = ++{ ++ { DVBFE_DVBT_GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_32}, ++ { DVBFE_DVBT_GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_16}, ++ { DVBFE_DVBT_GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_8}, ++ { DVBFE_DVBT_GUARD_INTERVAL_1_4, GUARD_INTERVAL_1_4}, ++ { DVBFE_DVBT_GUARD_INTERVAL_AUTO, GUARD_INTERVAL_AUTO}, ++ { -1, -1 } ++}; ++ ++static int dvbfe_dvbt_hierarchy_to_kapi[][2] = ++{ ++ { DVBFE_DVBT_HIERARCHY_NONE, HIERARCHY_NONE }, ++ { DVBFE_DVBT_HIERARCHY_1, HIERARCHY_1 }, ++ { DVBFE_DVBT_HIERARCHY_2, HIERARCHY_2 }, ++ { DVBFE_DVBT_HIERARCHY_4, HIERARCHY_4 }, ++ { DVBFE_DVBT_HIERARCHY_AUTO, HIERARCHY_AUTO }, ++ { -1, -1 } ++}; ++ ++ ++static int lookupval(int val, int reverse, int table[][2]) ++{ ++ int i =0; ++ ++ while(table[i][0] != -1) { ++ if (!reverse) { ++ if (val == table[i][0]) { ++ return table[i][1]; ++ } ++ } else { ++ if (val == table[i][1]) { ++ return table[i][0]; ++ } ++ } ++ i++; ++ } ++ ++ return -1; ++} ++ ++ ++struct dvbfe_handle { ++ int fd; ++ enum dvbfe_type type; ++ char *name; ++}; ++ ++struct dvbfe_handle *dvbfe_open(int adapter, int frontend, int readonly) ++{ ++ char filename[PATH_MAX+1]; ++ struct dvbfe_handle *fehandle; ++ int fd; ++ struct dvb_frontend_info info; ++ ++ // flags ++ int flags = O_RDWR; ++ if (readonly) { ++ flags = O_RDONLY; ++ } ++ ++ // open it (try normal /dev structure first) ++ sprintf(filename, "/dev/dvb/adapter%i/frontend%i", adapter, frontend); ++ if ((fd = open(filename, flags)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.frontend%i", adapter, frontend); ++ if ((fd = open(filename, flags)) < 0) { ++ return NULL; ++ } ++ } ++ ++ // determine fe type ++ if (ioctl(fd, FE_GET_INFO, &info)) { ++ close(fd); ++ return NULL; ++ } ++ ++ // setup structure ++ fehandle = (struct dvbfe_handle*) malloc(sizeof(struct dvbfe_handle)); ++ memset(fehandle, 0, sizeof(struct dvbfe_handle)); ++ fehandle->fd = fd; ++ switch(info.type) { ++ case FE_QPSK: ++ fehandle->type = DVBFE_TYPE_DVBS; ++ break; ++ ++ case FE_QAM: ++ fehandle->type = DVBFE_TYPE_DVBC; ++ break; ++ ++ case FE_OFDM: ++ fehandle->type = DVBFE_TYPE_DVBT; ++ break; ++ ++ case FE_ATSC: ++ fehandle->type = DVBFE_TYPE_ATSC; ++ break; ++ } ++ fehandle->name = strndup(info.name, sizeof(info.name)); ++ ++ // done ++ return fehandle; ++} ++ ++void dvbfe_close(struct dvbfe_handle *fehandle) ++{ ++ close(fehandle->fd); ++ free(fehandle->name); ++ free(fehandle); ++} ++ ++extern int dvbfe_get_info(struct dvbfe_handle *fehandle, ++ enum dvbfe_info_mask querymask, ++ struct dvbfe_info *result, ++ enum dvbfe_info_querytype querytype, ++ int timeout) ++{ ++ int returnval = 0; ++ struct dvb_frontend_event kevent; ++ int ok = 0; ++ ++ result->name = fehandle->name; ++ result->type = fehandle->type; ++ ++ switch(querytype) { ++ case DVBFE_INFO_QUERYTYPE_IMMEDIATE: ++ if (querymask & DVBFE_INFO_LOCKSTATUS) { ++ if (!ioctl(fehandle->fd, FE_READ_STATUS, &kevent.status)) { ++ returnval |= DVBFE_INFO_LOCKSTATUS; ++ } ++ } ++ if (querymask & DVBFE_INFO_FEPARAMS) { ++ if (!ioctl(fehandle->fd, FE_GET_FRONTEND, &kevent.parameters)) { ++ returnval |= DVBFE_INFO_FEPARAMS; ++ } ++ } ++ break; ++ ++ case DVBFE_INFO_QUERYTYPE_LOCKCHANGE: ++ { ++ struct pollfd pollfd; ++ pollfd.fd = fehandle->fd; ++ pollfd.events = POLLIN | POLLERR; ++ ++ ok = 1; ++ if (poll(&pollfd, 1, timeout) < 0) ++ ok = 0; ++ if (pollfd.revents & POLLERR) ++ ok = 0; ++ if (!(pollfd.revents & POLLIN)) ++ ok = 0; ++ } ++ ++ if (ok && ++ ((querymask & DVBFE_INFO_LOCKSTATUS) || ++ (querymask & DVBFE_INFO_FEPARAMS))) { ++ if (!ioctl(fehandle->fd, FE_GET_EVENT, &kevent)) { ++ if (querymask & DVBFE_INFO_LOCKSTATUS) ++ returnval |= DVBFE_INFO_LOCKSTATUS; ++ if (querymask & DVBFE_INFO_FEPARAMS) ++ returnval |= DVBFE_INFO_FEPARAMS; ++ } ++ } ++ break; ++ } ++ ++ if (returnval & DVBFE_INFO_LOCKSTATUS) { ++ result->signal = kevent.status & FE_HAS_SIGNAL ? 1 : 0; ++ result->carrier = kevent.status & FE_HAS_CARRIER ? 1 : 0; ++ result->viterbi = kevent.status & FE_HAS_VITERBI ? 1 : 0; ++ result->sync = kevent.status & FE_HAS_SYNC ? 1 : 0; ++ result->lock = kevent.status & FE_HAS_LOCK ? 1 : 0; ++ } ++ ++ if (returnval & DVBFE_INFO_FEPARAMS) { ++ result->feparams.frequency = kevent.parameters.frequency; ++ result->feparams.inversion = lookupval(kevent.parameters.inversion, 1, dvbfe_spectral_inversion_to_kapi); ++ switch(fehandle->type) { ++ case FE_QPSK: ++ result->feparams.u.dvbs.symbol_rate = kevent.parameters.u.qpsk.symbol_rate; ++ result->feparams.u.dvbs.fec_inner = ++ lookupval(kevent.parameters.u.qpsk.fec_inner, 1, dvbfe_code_rate_to_kapi); ++ break; ++ ++ case FE_QAM: ++ result->feparams.u.dvbc.symbol_rate = kevent.parameters.u.qam.symbol_rate; ++ result->feparams.u.dvbc.fec_inner = ++ lookupval(kevent.parameters.u.qam.fec_inner, 1, dvbfe_code_rate_to_kapi); ++ result->feparams.u.dvbc.modulation = ++ lookupval(kevent.parameters.u.qam.modulation, 1, dvbfe_dvbc_mod_to_kapi); ++ break; ++ ++ case FE_OFDM: ++ result->feparams.u.dvbt.bandwidth = ++ lookupval(kevent.parameters.u.ofdm.bandwidth, 1, dvbfe_dvbt_bandwidth_to_kapi); ++ result->feparams.u.dvbt.code_rate_HP = ++ lookupval(kevent.parameters.u.ofdm.code_rate_HP, 1, dvbfe_code_rate_to_kapi); ++ result->feparams.u.dvbt.code_rate_LP = ++ lookupval(kevent.parameters.u.ofdm.code_rate_LP, 1, dvbfe_code_rate_to_kapi); ++ result->feparams.u.dvbt.constellation = ++ lookupval(kevent.parameters.u.ofdm.constellation, 1, dvbfe_dvbt_const_to_kapi); ++ result->feparams.u.dvbt.transmission_mode = ++ lookupval(kevent.parameters.u.ofdm.transmission_mode, 1, dvbfe_dvbt_transmit_mode_to_kapi); ++ result->feparams.u.dvbt.guard_interval = ++ lookupval(kevent.parameters.u.ofdm.guard_interval, 1, dvbfe_dvbt_guard_interval_to_kapi); ++ result->feparams.u.dvbt.hierarchy_information = ++ lookupval(kevent.parameters.u.ofdm.hierarchy_information, 1, dvbfe_dvbt_hierarchy_to_kapi); ++ break; ++ ++ case FE_ATSC: ++ result->feparams.u.atsc.modulation = ++ lookupval(kevent.parameters.u.vsb.modulation, 1, dvbfe_atsc_mod_to_kapi); ++ break; ++ } ++ } ++ ++ if (querymask & DVBFE_INFO_BER) { ++ if (!ioctl(fehandle->fd, FE_READ_BER, &result->ber)) ++ returnval |= DVBFE_INFO_BER; ++ } ++ if (querymask & DVBFE_INFO_SIGNAL_STRENGTH) { ++ if (!ioctl(fehandle->fd, FE_READ_SIGNAL_STRENGTH, &result->signal_strength)) ++ returnval |= DVBFE_INFO_SIGNAL_STRENGTH; ++ } ++ if (querymask & DVBFE_INFO_SNR) { ++ if (!ioctl(fehandle->fd, FE_READ_SNR, &result->snr)) ++ returnval |= DVBFE_INFO_SNR; ++ } ++ if (querymask & DVBFE_INFO_UNCORRECTED_BLOCKS) { ++ if (!ioctl(fehandle->fd, FE_READ_UNCORRECTED_BLOCKS, &result->ucblocks)) ++ returnval |= DVBFE_INFO_UNCORRECTED_BLOCKS; ++ } ++ ++ // done ++ return returnval; ++} ++ ++int dvbfe_set(struct dvbfe_handle *fehandle, ++ struct dvbfe_parameters *params, ++ int timeout) ++{ ++ struct dvb_frontend_parameters kparams; ++ int res; ++ struct timeval endtime; ++ fe_status_t status; ++ ++ kparams.frequency = params->frequency; ++ kparams.inversion = lookupval(params->inversion, 0, dvbfe_spectral_inversion_to_kapi); ++ switch(fehandle->type) { ++ case FE_QPSK: ++ kparams.u.qpsk.symbol_rate = params->u.dvbs.symbol_rate; ++ kparams.u.qpsk.fec_inner = lookupval(params->u.dvbs.fec_inner, 0, dvbfe_code_rate_to_kapi); ++ break; ++ ++ case FE_QAM: ++ kparams.u.qam.symbol_rate = params->u.dvbc.symbol_rate; ++ kparams.u.qam.fec_inner = lookupval(params->u.dvbc.fec_inner, 0, dvbfe_code_rate_to_kapi); ++ kparams.u.qam.modulation = lookupval(params->u.dvbc.modulation, 0, dvbfe_dvbc_mod_to_kapi); ++ break; ++ ++ case FE_OFDM: ++ kparams.u.ofdm.bandwidth = lookupval(params->u.dvbt.bandwidth, 0, dvbfe_dvbt_bandwidth_to_kapi); ++ kparams.u.ofdm.code_rate_HP = lookupval(params->u.dvbt.code_rate_HP, 0, dvbfe_code_rate_to_kapi); ++ kparams.u.ofdm.code_rate_LP = lookupval(params->u.dvbt.code_rate_LP, 0, dvbfe_code_rate_to_kapi); ++ kparams.u.ofdm.constellation = lookupval(params->u.dvbt.constellation, 0, dvbfe_dvbt_const_to_kapi); ++ kparams.u.ofdm.transmission_mode = ++ lookupval(params->u.dvbt.transmission_mode, 0, dvbfe_dvbt_transmit_mode_to_kapi); ++ kparams.u.ofdm.guard_interval = ++ lookupval(params->u.dvbt.guard_interval, 0, dvbfe_dvbt_guard_interval_to_kapi); ++ kparams.u.ofdm.hierarchy_information = ++ lookupval(params->u.dvbt.hierarchy_information, 0, dvbfe_dvbt_hierarchy_to_kapi); ++ break; ++ ++ case FE_ATSC: ++ kparams.u.vsb.modulation = lookupval(params->u.atsc.modulation, 0, dvbfe_atsc_mod_to_kapi); ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ // set it and check for error ++ res = ioctl(fehandle->fd, FE_SET_FRONTEND, &kparams); ++ if (res) ++ return res; ++ ++ // 0 => return immediately ++ if (timeout == 0) { ++ return 0; ++ } ++ ++ /* calculate timeout */ ++ if (timeout > 0) { ++ gettimeofday(&endtime, NULL); ++ timeout *= 1000; ++ endtime.tv_sec += timeout / 1000000; ++ endtime.tv_usec += timeout % 1000000; ++ } ++ ++ /* wait for a lock */ ++ while(1) { ++ /* has it locked? */ ++ if (!ioctl(fehandle->fd, FE_READ_STATUS, &status)) { ++ if (status & FE_HAS_LOCK) { ++ break; ++ } ++ } ++ ++ /* check for timeout */ ++ if (timeout > 0) { ++ struct timeval curtime; ++ gettimeofday(&curtime, NULL); ++ if ((curtime.tv_sec > endtime.tv_sec) || ++ ((curtime.tv_sec == endtime.tv_sec) && (curtime.tv_usec >= endtime.tv_usec))) { ++ break; ++ } ++ } ++ ++ /* delay for a bit */ ++ usleep(100000); ++ } ++ ++ /* exit */ ++ if (status & FE_HAS_LOCK) ++ return 0; ++ return -ETIMEDOUT; ++} ++ ++int dvbfe_get_pollfd(struct dvbfe_handle *handle) ++{ ++ return handle->fd; ++} ++ ++int dvbfe_set_22k_tone(struct dvbfe_handle *fehandle, enum dvbfe_sec_tone_mode tone) ++{ ++ int ret = 0; ++ ++ switch (tone) { ++ case DVBFE_SEC_TONE_OFF: ++ ret = ioctl(fehandle->fd, FE_SET_TONE, SEC_TONE_OFF); ++ break; ++ case DVBFE_SEC_TONE_ON: ++ ret = ioctl(fehandle->fd, FE_SET_TONE, SEC_TONE_ON); ++ break; ++ default: ++ print(verbose, ERROR, 1, "Invalid command !"); ++ break; ++ } ++ if (ret == -1) ++ print(verbose, ERROR, 1, "IOCTL failed !"); ++ ++ return ret; ++} ++ ++int dvbfe_set_tone_data_burst(struct dvbfe_handle *fehandle, enum dvbfe_sec_mini_cmd minicmd) ++{ ++ int ret = 0; ++ ++ switch (minicmd) { ++ case DVBFE_SEC_MINI_A: ++ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_BURST, SEC_MINI_A); ++ break; ++ case DVBFE_SEC_MINI_B: ++ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_BURST, SEC_MINI_B); ++ break; ++ default: ++ print(verbose, ERROR, 1, "Invalid command"); ++ break; ++ } ++ if (ret == -1) ++ print(verbose, ERROR, 1, "IOCTL failed"); ++ ++ return ret; ++} ++ ++int dvbfe_set_voltage(struct dvbfe_handle *fehandle, enum dvbfe_sec_voltage voltage) ++{ ++ int ret = 0; ++ ++ switch (voltage) { ++ case DVBFE_SEC_VOLTAGE_OFF: ++ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_OFF); ++ break; ++ case DVBFE_SEC_VOLTAGE_13: ++ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13); ++ break; ++ case DVBFE_SEC_VOLTAGE_18: ++ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18); ++ break; ++ default: ++ print(verbose, ERROR, 1, "Invalid command"); ++ break; ++ } ++ if (ret == -1) ++ print(verbose, ERROR, 1, "IOCTL failed"); ++ ++ return ret; ++} ++ ++int dvbfe_set_high_lnb_voltage(struct dvbfe_handle *fehandle, int on) ++{ ++ switch (on) { ++ case 0: ++ ioctl(fehandle->fd, FE_ENABLE_HIGH_LNB_VOLTAGE, 0); ++ break; ++ default: ++ ioctl(fehandle->fd, FE_ENABLE_HIGH_LNB_VOLTAGE, 1); ++ break; ++ } ++ return 0; ++} ++ ++int dvbfe_do_dishnetworks_legacy_command(struct dvbfe_handle *fehandle, unsigned int cmd) ++{ ++ int ret = 0; ++ ++ ret = ioctl(fehandle->fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd); ++ if (ret == -1) ++ print(verbose, ERROR, 1, "IOCTL failed"); ++ ++ return ret; ++} ++ ++int dvbfe_do_diseqc_command(struct dvbfe_handle *fehandle, uint8_t *data, uint8_t len) ++{ ++ int ret = 0; ++ struct dvb_diseqc_master_cmd diseqc_message; ++ ++ if (len > 6) ++ return -EINVAL; ++ ++ diseqc_message.msg_len = len; ++ memcpy(diseqc_message.msg, data, len); ++ ++ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_MASTER_CMD, &diseqc_message); ++ if (ret == -1) ++ print(verbose, ERROR, 1, "IOCTL failed"); ++ ++ return ret; ++} ++ ++int dvbfe_diseqc_read(struct dvbfe_handle *fehandle, int timeout, unsigned char *buf, unsigned int len) ++{ ++ struct dvb_diseqc_slave_reply reply; ++ int result; ++ ++ if (len > 4) ++ len = 4; ++ ++ reply.timeout = timeout; ++ reply.msg_len = len; ++ ++ if ((result = ioctl(fehandle->fd, FE_DISEQC_RECV_SLAVE_REPLY, reply)) != 0) ++ return result; ++ ++ if (reply.msg_len < len) ++ len = reply.msg_len; ++ memcpy(buf, reply.msg, len); ++ ++ return len; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbfe.h dvb-apps/lib/libdvbapi/dvbfe.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbfe.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbfe.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,333 @@ ++/* ++ * libdvbfe - a DVB frontend library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2005 Manu Abraham ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBFE_H ++#define LIBDVBFE_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * The types of frontend we support. ++ */ ++enum dvbfe_type { ++ DVBFE_TYPE_DVBS, ++ DVBFE_TYPE_DVBC, ++ DVBFE_TYPE_DVBT, ++ DVBFE_TYPE_ATSC, ++}; ++ ++enum dvbfe_spectral_inversion { ++ DVBFE_INVERSION_OFF, ++ DVBFE_INVERSION_ON, ++ DVBFE_INVERSION_AUTO ++}; ++ ++enum dvbfe_code_rate { ++ DVBFE_FEC_NONE, ++ DVBFE_FEC_1_2, ++ DVBFE_FEC_2_3, ++ DVBFE_FEC_3_4, ++ DVBFE_FEC_4_5, ++ DVBFE_FEC_5_6, ++ DVBFE_FEC_6_7, ++ DVBFE_FEC_7_8, ++ DVBFE_FEC_8_9, ++ DVBFE_FEC_AUTO ++}; ++ ++enum dvbfe_dvbt_const { ++ DVBFE_DVBT_CONST_QPSK, ++ DVBFE_DVBT_CONST_QAM_16, ++ DVBFE_DVBT_CONST_QAM_32, ++ DVBFE_DVBT_CONST_QAM_64, ++ DVBFE_DVBT_CONST_QAM_128, ++ DVBFE_DVBT_CONST_QAM_256, ++ DVBFE_DVBT_CONST_AUTO ++}; ++ ++enum dvbfe_dvbc_mod { ++ DVBFE_DVBC_MOD_QAM_16, ++ DVBFE_DVBC_MOD_QAM_32, ++ DVBFE_DVBC_MOD_QAM_64, ++ DVBFE_DVBC_MOD_QAM_128, ++ DVBFE_DVBC_MOD_QAM_256, ++ DVBFE_DVBC_MOD_AUTO, ++}; ++ ++enum dvbfe_atsc_mod { ++ DVBFE_ATSC_MOD_QAM_64, ++ DVBFE_ATSC_MOD_QAM_256, ++ DVBFE_ATSC_MOD_VSB_8, ++ DVBFE_ATSC_MOD_VSB_16, ++ DVBFE_ATSC_MOD_AUTO ++}; ++ ++enum dvbfe_dvbt_transmit_mode { ++ DVBFE_DVBT_TRANSMISSION_MODE_2K, ++ DVBFE_DVBT_TRANSMISSION_MODE_8K, ++ DVBFE_DVBT_TRANSMISSION_MODE_AUTO ++}; ++ ++enum dvbfe_dvbt_bandwidth { ++ DVBFE_DVBT_BANDWIDTH_8_MHZ, ++ DVBFE_DVBT_BANDWIDTH_7_MHZ, ++ DVBFE_DVBT_BANDWIDTH_6_MHZ, ++ DVBFE_DVBT_BANDWIDTH_AUTO ++}; ++ ++enum dvbfe_dvbt_guard_interval { ++ DVBFE_DVBT_GUARD_INTERVAL_1_32, ++ DVBFE_DVBT_GUARD_INTERVAL_1_16, ++ DVBFE_DVBT_GUARD_INTERVAL_1_8, ++ DVBFE_DVBT_GUARD_INTERVAL_1_4, ++ DVBFE_DVBT_GUARD_INTERVAL_AUTO ++}; ++ ++enum dvbfe_dvbt_hierarchy { ++ DVBFE_DVBT_HIERARCHY_NONE, ++ DVBFE_DVBT_HIERARCHY_1, ++ DVBFE_DVBT_HIERARCHY_2, ++ DVBFE_DVBT_HIERARCHY_4, ++ DVBFE_DVBT_HIERARCHY_AUTO ++}; ++ ++/** ++ * Structure used to store and communicate frontend parameters. ++ */ ++struct dvbfe_parameters { ++ uint32_t frequency; ++ enum dvbfe_spectral_inversion inversion; ++ union { ++ struct { ++ uint32_t symbol_rate; ++ enum dvbfe_code_rate fec_inner; ++ } dvbs; ++ ++ struct { ++ uint32_t symbol_rate; ++ enum dvbfe_code_rate fec_inner; ++ enum dvbfe_dvbc_mod modulation; ++ } dvbc; ++ ++ struct { ++ enum dvbfe_dvbt_bandwidth bandwidth; ++ enum dvbfe_code_rate code_rate_HP; ++ enum dvbfe_code_rate code_rate_LP; ++ enum dvbfe_dvbt_const constellation; ++ enum dvbfe_dvbt_transmit_mode transmission_mode; ++ enum dvbfe_dvbt_guard_interval guard_interval; ++ enum dvbfe_dvbt_hierarchy hierarchy_information; ++ } dvbt; ++ ++ struct { ++ enum dvbfe_atsc_mod modulation; ++ } atsc; ++ } u; ++}; ++ ++enum dvbfe_sec_voltage { ++ DVBFE_SEC_VOLTAGE_13, ++ DVBFE_SEC_VOLTAGE_18, ++ DVBFE_SEC_VOLTAGE_OFF ++}; ++ ++enum dvbfe_sec_tone_mode { ++ DVBFE_SEC_TONE_ON, ++ DVBFE_SEC_TONE_OFF ++}; ++ ++enum dvbfe_sec_mini_cmd { ++ DVBFE_SEC_MINI_A, ++ DVBFE_SEC_MINI_B ++}; ++ ++/** ++ * Mask of values used in the dvbfe_get_info() call. ++ */ ++enum dvbfe_info_mask { ++ DVBFE_INFO_LOCKSTATUS = 0x01, ++ DVBFE_INFO_FEPARAMS = 0x02, ++ DVBFE_INFO_BER = 0x04, ++ DVBFE_INFO_SIGNAL_STRENGTH = 0x08, ++ DVBFE_INFO_SNR = 0x10, ++ DVBFE_INFO_UNCORRECTED_BLOCKS = 0x20, ++}; ++ ++/** ++ * Structure containing values used by the dvbfe_get_info() call. ++ */ ++struct dvbfe_info { ++ enum dvbfe_type type; /* always retrieved */ ++ const char *name; /* always retrieved */ ++ unsigned int signal : 1; /* } DVBFE_INFO_LOCKSTATUS */ ++ unsigned int carrier : 1; /* } */ ++ unsigned int viterbi : 1; /* } */ ++ unsigned int sync : 1; /* } */ ++ unsigned int lock : 1; /* } */ ++ struct dvbfe_parameters feparams; /* DVBFE_INFO_FEPARAMS */ ++ uint32_t ber; /* DVBFE_INFO_BER */ ++ uint16_t signal_strength; /* DVBFE_INFO_SIGNAL_STRENGTH */ ++ uint16_t snr; /* DVBFE_INFO_SNR */ ++ uint32_t ucblocks; /* DVBFE_INFO_UNCORRECTED_BLOCKS */ ++}; ++ ++/** ++ * Possible types of query used in dvbfe_get_info. ++ * ++ * DVBFE_INFO_QUERYTYPE_IMMEDIATE - interrogate frontend for most up to date values. ++ * DVBFE_INFO_QUERYTYPE_LOCKCHANGE - return details from queued lock status ++ * change events, or wait for one to occur ++ * if none are queued. ++ */ ++enum dvbfe_info_querytype { ++ DVBFE_INFO_QUERYTYPE_IMMEDIATE, ++ DVBFE_INFO_QUERYTYPE_LOCKCHANGE, ++}; ++ ++ ++/** ++ * Frontend handle datatype. ++ */ ++struct dvbfe_handle; ++ ++/** ++ * Open a DVB frontend. ++ * ++ * @param adapter DVB adapter ID. ++ * @param frontend Frontend ID of that adapter to open. ++ * @param readonly If 1, frontend will be opened in readonly mode only. ++ * @return A handle on success, or NULL on failure. ++ */ ++extern struct dvbfe_handle *dvbfe_open(int adapter, int frontend, int readonly); ++ ++/** ++ * Close a DVB frontend. ++ * ++ * @param fehandle Handle opened with dvbfe_open(). ++ */ ++extern void dvbfe_close(struct dvbfe_handle *handle); ++ ++/** ++ * Set the frontend tuning parameters. ++ * ++ * Note: this function provides only the basic tuning operation; you might want to ++ * investigate dvbfe_set_sec() in sec.h for a unified device tuning operation. ++ * ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param params Params to set. ++ * @param timeout <0 => wait forever for lock. 0=>return immediately, >0=> ++ * number of milliseconds to wait for a lock. ++ * @return 0 on locked (or if timeout==0 and everything else worked), or ++ * nonzero on failure (including no lock). ++ */ ++extern int dvbfe_set(struct dvbfe_handle *fehandle, ++ struct dvbfe_parameters *params, ++ int timeout); ++ ++/** ++ * Retrieve information about the frontend. ++ * ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param querymask ORed bitmask of desired DVBFE_INFO_* values. ++ * @param result Where to put the retrieved results. ++ * @param querytype Type of query requested. ++ * @param timeout Timeout in ms to use if querytype==lockchange (0=>no timeout, <0=> wait forever). ++ * @return ORed bitmask of DVBFE_INFO_* indicating which values were read successfully. ++ */ ++extern int dvbfe_get_info(struct dvbfe_handle *fehandle, ++ enum dvbfe_info_mask querymask, ++ struct dvbfe_info *result, ++ enum dvbfe_info_querytype querytype, ++ int timeout); ++ ++/** ++ * Get a file descriptor for polling for lock status changes. ++ * ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @return FD for polling. ++ */ ++extern int dvbfe_get_pollfd(struct dvbfe_handle *handle); ++ ++/** ++ * Tone/Data Burst control ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param tone, SEC_TONE_ON/SEC_TONE_OFF ++ */ ++extern int dvbfe_set_22k_tone(struct dvbfe_handle *handle, enum dvbfe_sec_tone_mode tone); ++ ++/** ++ * 22khz Tone control ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param adapter, minicmd, SEC_MINI_A/SEC_MINI_B ++ */ ++extern int dvbfe_set_tone_data_burst(struct dvbfe_handle *handle, enum dvbfe_sec_mini_cmd minicmd); ++ ++/** ++ * Voltage control ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param polarization, SEC_VOLTAGE_13/SEC_VOLTAGE_18/SEC_VOLTAGE_OFF ++ */ ++extern int dvbfe_set_voltage(struct dvbfe_handle *handle, enum dvbfe_sec_voltage voltage); ++ ++/** ++ * High LNB voltage control (increases voltage by 1v to compensate for long cables) ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param on 1 to enable, 0 to disable. ++ */ ++extern int dvbfe_set_high_lnb_voltage(struct dvbfe_handle *fehandle, int on); ++ ++/** ++ * Send a legacy Dish Networks command ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param cmd, the command to send ++ */ ++extern int dvbfe_do_dishnetworks_legacy_command(struct dvbfe_handle *handle, unsigned int cmd); ++ ++/** ++ * Send a DiSEqC Command ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param data, a pointer to am array containing the data to be sent. ++ * @param len Length of data in bytes, max 6 bytes. ++ */ ++extern int dvbfe_do_diseqc_command(struct dvbfe_handle *handle, uint8_t *data, uint8_t len); ++ ++/** ++ * Read a DISEQC response from the frontend. ++ * ++ * @param fehandle Handle opened with dvbfe_open(). ++ * @param timeout Timeout for DISEQC response. ++ * @param buf Buffer to store response in. ++ * @param len Number of bytes in buffer. ++ * @return >= 0 on success (number of received bytes), <0 on failure. ++ */ ++extern int dvbfe_diseqc_read(struct dvbfe_handle *fehandle, int timeout, unsigned char *buf, unsigned int len); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBFE_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbnet.c dvb-apps/lib/libdvbapi/dvbnet.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbnet.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbnet.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,104 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbnet.h" ++ ++int dvbnet_open(int adapter, int netdeviceid) ++{ ++ char filename[PATH_MAX+1]; ++ int fd; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/net%i", adapter, netdeviceid); ++ if ((fd = open(filename, O_RDWR)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.net%i", adapter, netdeviceid); ++ fd = open(filename, O_RDWR); ++ } ++ ++ return fd; ++} ++ ++int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation) ++{ ++ struct dvb_net_if params; ++ int status; ++ ++ memset(¶ms, 0, sizeof(params)); ++ params.pid = pid; ++ ++ switch(encapsulation) { ++ case DVBNET_ENCAP_MPE: ++ params.feedtype = DVB_NET_FEEDTYPE_MPE; ++ break; ++ ++ case DVBNET_ENCAP_ULE: ++ params.feedtype = DVB_NET_FEEDTYPE_ULE; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ status = ioctl(fd, NET_ADD_IF, ¶ms); ++ if (status < 0) ++ return status; ++ return params.if_num; ++} ++ ++int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation) ++{ ++ struct dvb_net_if info; ++ int res; ++ ++ memset(&info, 0, sizeof(struct dvb_net_if)); ++ info.if_num = ifnum; ++ ++ if ((res = ioctl(fd, NET_GET_IF, &info)) < 0) ++ return res; ++ ++ *pid = info.pid; ++ switch(info.feedtype) { ++ case DVB_NET_FEEDTYPE_MPE: ++ *encapsulation = DVBNET_ENCAP_MPE; ++ break; ++ ++ case DVB_NET_FEEDTYPE_ULE: ++ *encapsulation = DVBNET_ENCAP_ULE; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ return 0; ++} ++ ++int dvbnet_remove_interface(int fd, int ifnum) ++{ ++ return ioctl(fd, NET_REMOVE_IF, ifnum); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbnet.h dvb-apps/lib/libdvbapi/dvbnet.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbnet.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbnet.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBNET_H ++#define LIBDVBNET_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * Possible encapsulations of data. ++ */ ++enum dvbnet_encap { ++ DVBNET_ENCAP_MPE, ++ DVBNET_ENCAP_ULE, ++}; ++ ++/** ++ * The maximum allowed number of dvb network devices per adapter netdevice. ++ */ ++#define DVBNET_MAX_INTERFACES 10 ++ ++/** ++ * Open a DVB net interface. ++ * ++ * @param adapter DVB adapter ID. ++ * @param netdeviceid Network control interface of that adapter to open. ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbnet_open(int adapter, int netdeviceid); ++ ++/** ++ * Create a new DVBNET interface. ++ * ++ * @param fd FD opened with libdvbnet_open(). ++ * @param pid PID of the stream containing the network data. ++ * @param encapsulation Encapsulation type of the stream (one of DVBNET_ENCAP_*). ++ * @return Index of new interface on success, < 0 on failure. ++ */ ++extern int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation); ++ ++/** ++ * Get details of a DVBNET interface. ++ * ++ * @param fd FD opened with libdvbnet_open(). ++ * @param ifnum Index of interface to retrieve. ++ * @param pid The PID of the interface. ++ * @param encapsulation The encapsulation of the interface (DVBNET_ENCAP_*). ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation); ++ ++/** ++ * Remove a DVBNET interface. ++ * ++ * @param fd FD opened with libdvbnet_open(). ++ * @param ifnum Index of interface to remove. ++ * @return 0 on success, nonzero on failure. ++ */ ++extern int dvbnet_remove_interface(int fd, int ifnum); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBNET_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbvideo.c dvb-apps/lib/libdvbapi/dvbvideo.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbvideo.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbvideo.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,46 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbvideo.h" ++ ++int dvbvideo_open(int adapter, int videodeviceid) ++{ ++ char filename[PATH_MAX+1]; ++ int fd; ++ ++ sprintf(filename, "/dev/dvb/adapter%i/video%i", adapter, videodeviceid); ++ if ((fd = open(filename, O_RDWR)) < 0) { ++ // if that failed, try a flat /dev structure ++ sprintf(filename, "/dev/dvb%i.video%i", adapter, videodeviceid); ++ fd = open(filename, O_RDWR); ++ } ++ ++ return fd; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbvideo.h dvb-apps/lib/libdvbapi/dvbvideo.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/dvbvideo.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/dvbvideo.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,46 @@ ++/* ++ * libdvbnet - a DVB network support library ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef LIBDVBVIDEO_H ++#define LIBDVBVIDEO_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * Open a DVB video device. ++ * ++ * @param adapter DVB adapter ID. ++ * @param videodeviceid Id of video device of that adapter to open. ++ * @return A unix file descriptor on success, or -1 on failure. ++ */ ++extern int dvbvideo_open(int adapter, int videodeviceid); ++ ++// FIXME: this is a stub library ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif // LIBDVBVIDEO_H +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbapi/Makefile dvb-apps/lib/libdvbapi/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libdvbapi/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbapi/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,25 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libdvbapi ++ ++includes = dvbaudio.h \ ++ dvbca.h \ ++ dvbdemux.h \ ++ dvbfe.h \ ++ dvbnet.h \ ++ dvbvideo.h ++ ++objects = dvbaudio.o \ ++ dvbca.o \ ++ dvbdemux.o \ ++ dvbfe.o \ ++ dvbnet.o \ ++ dvbvideo.o ++ ++lib_name = libdvbapi ++ ++CPPFLAGS += -I../../lib ++ ++.PHONY: all ++ ++all: library ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_common.c dvb-apps/lib/libdvbcfg/dvbcfg_common.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_common.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_common.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,136 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * common functions ++ * ++ * Copyright (C) 2006 Christoph Pfister ++ * Copyright (C) 2005 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include "dvbcfg_common.h" ++ ++int dvbcfg_parse_int(char **text, char *tokens) ++{ ++ char *start = *text; ++ char *stop = *text; ++ int value; ++ ++ while (*stop != '\0') { ++ if (strchr(tokens, *stop) != NULL) { ++ *stop = '\0'; ++ stop++; ++ break; ++ } ++ stop++; ++ } ++ ++ if (sscanf(start, "%i", &value) == 1) { ++ *text = stop; ++ return value; ++ } ++ ++ *text = NULL; ++ return -1; ++} ++ ++int dvbcfg_parse_char(char **text, char *tokens) ++{ ++ char *start = *text; ++ char *stop = *text; ++ char value; ++ ++ while (*stop != '\0') { ++ if (strchr(tokens, *stop) != NULL) { ++ *stop = '\0'; ++ stop++; ++ break; ++ } ++ stop++; ++ } ++ ++ if (sscanf(start, "%c", &value) == 1) { ++ *text = stop; ++ return value; ++ } ++ ++ *text = NULL; ++ return -1; ++} ++ ++int dvbcfg_parse_setting(char **text, char *tokens, const struct dvbcfg_setting *settings) ++{ ++ char *start = *text; ++ char *stop = *text; ++ ++ while (*stop != '\0') { ++ if (strchr(tokens, *stop) != NULL) { ++ *stop = '\0'; ++ stop++; ++ break; ++ } ++ stop++; ++ } ++ ++ while (settings->name) { ++ if (strcmp(start, settings->name) == 0) { ++ *text = stop; ++ return settings->value; ++ } ++ settings++; ++ } ++ ++ *text = NULL; ++ return -1; ++} ++ ++void dvbcfg_parse_string(char **text, char *tokens, char *dest, unsigned long size) ++{ ++ char *start = *text; ++ char *stop = *text; ++ unsigned long length; ++ ++ while ((*stop != '\0') && (strchr(tokens, *stop) == NULL)) ++ stop++; ++ ++ length = (stop - start) + 1; ++ ++ if (length <= size) { ++ if (strchr(tokens, *stop) != NULL) { ++ *stop = '\0'; ++ *text = stop + 1; ++ } else ++ *text = stop; ++ memcpy(dest, start, length); ++ return; ++ } ++ ++ *text = NULL; ++ return; ++} ++ ++const char *dvbcfg_lookup_setting(unsigned int setting, const struct dvbcfg_setting *settings) ++{ ++ while (settings->name) { ++ if (setting == settings->value) ++ return settings->name; ++ settings++; ++ } ++ ++ return NULL; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_common.h dvb-apps/lib/libdvbcfg/dvbcfg_common.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_common.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,37 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * common functions ++ * ++ * Copyright (C) 2006 Christoph Pfister ++ * Copyright (C) 2005 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef DVBCFG_COMMON_H ++#define DVBCFG_COMMON_H 1 ++ ++struct dvbcfg_setting { ++ const char *name; ++ unsigned int value; ++}; ++ ++extern int dvbcfg_parse_int(char **text, char *tokens); ++extern int dvbcfg_parse_char(char **text, char *tokens); ++extern int dvbcfg_parse_setting(char **text, char *tokens, const struct dvbcfg_setting *settings); ++extern void dvbcfg_parse_string(char **text, char *tokens, char *dest, unsigned long size); ++extern const char *dvbcfg_lookup_setting(unsigned int setting, const struct dvbcfg_setting *settings); ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_scanfile.c dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_scanfile.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,282 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * scan channel file support ++ * ++ * Copyright (C) 2006 Christoph Pfister ++ * Copyright (C) 2005 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++ ++#include "dvbcfg_scanfile.h" ++#include "dvbcfg_common.h" ++ ++static const struct dvbcfg_setting dvbcfg_fec_list[] = { ++ { "1/2", DVBFE_FEC_1_2 }, ++ { "2/3", DVBFE_FEC_2_3 }, ++ { "3/4", DVBFE_FEC_3_4 }, ++ { "4/5", DVBFE_FEC_4_5 }, ++ { "5/6", DVBFE_FEC_5_6 }, ++ { "6/7", DVBFE_FEC_6_7 }, ++ { "7/8", DVBFE_FEC_7_8 }, ++ { "8/9", DVBFE_FEC_8_9 }, ++ { "AUTO", DVBFE_FEC_AUTO }, ++ { "NONE", DVBFE_FEC_NONE }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_dvbc_modulation_list[] = { ++ { "QAM16", DVBFE_DVBC_MOD_QAM_16 }, ++ { "QAM32", DVBFE_DVBC_MOD_QAM_32 }, ++ { "QAM64", DVBFE_DVBC_MOD_QAM_64 }, ++ { "QAM128", DVBFE_DVBC_MOD_QAM_128 }, ++ { "QAM256", DVBFE_DVBC_MOD_QAM_256 }, ++ { "AUTO", DVBFE_DVBC_MOD_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_bandwidth_list[] = { ++ { "6MHz", DVBFE_DVBT_BANDWIDTH_6_MHZ }, ++ { "7MHz", DVBFE_DVBT_BANDWIDTH_7_MHZ }, ++ { "8MHz", DVBFE_DVBT_BANDWIDTH_8_MHZ }, ++ { "AUTO", DVBFE_DVBT_BANDWIDTH_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_constellation_list[] = { ++ { "QAM16", DVBFE_DVBT_CONST_QAM_16 }, ++ { "QAM32", DVBFE_DVBT_CONST_QAM_32 }, ++ { "QAM64", DVBFE_DVBT_CONST_QAM_64 }, ++ { "QAM128", DVBFE_DVBT_CONST_QAM_128 }, ++ { "QAM256", DVBFE_DVBT_CONST_QAM_256 }, ++ { "QPSK", DVBFE_DVBT_CONST_QPSK }, ++ { "AUTO", DVBFE_DVBT_CONST_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_transmission_mode_list[] = { ++ { "2k", DVBFE_DVBT_TRANSMISSION_MODE_2K }, ++ { "8k", DVBFE_DVBT_TRANSMISSION_MODE_8K }, ++ { "AUTO", DVBFE_DVBT_TRANSMISSION_MODE_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_guard_interval_list[] = { ++ { "1/32", DVBFE_DVBT_GUARD_INTERVAL_1_32 }, ++ { "1/16", DVBFE_DVBT_GUARD_INTERVAL_1_16 }, ++ { "1/8", DVBFE_DVBT_GUARD_INTERVAL_1_8 }, ++ { "1/4", DVBFE_DVBT_GUARD_INTERVAL_1_4 }, ++ { "AUTO", DVBFE_DVBT_GUARD_INTERVAL_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_hierarchy_list[] = { ++ { "1", DVBFE_DVBT_HIERARCHY_1 }, ++ { "2", DVBFE_DVBT_HIERARCHY_2 }, ++ { "4", DVBFE_DVBT_HIERARCHY_4 }, ++ { "AUTO", DVBFE_DVBT_HIERARCHY_AUTO }, ++ { "NONE", DVBFE_DVBT_HIERARCHY_NONE }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_atsc_modulation_list[] = { ++ { "8VSB", DVBFE_ATSC_MOD_VSB_8 }, ++ { "16VSB", DVBFE_ATSC_MOD_VSB_16 }, ++ { "QAM64", DVBFE_ATSC_MOD_QAM_64 }, ++ { "QAM256", DVBFE_ATSC_MOD_QAM_256 }, ++ { NULL, 0 } ++}; ++ ++int dvbcfg_scanfile_parse(FILE *file, dvbcfg_scancallback callback, void *private_data) ++{ ++ char *line_buf = NULL; ++ size_t line_size = 0; ++ int line_len = 0; ++ int ret_val = 0; ++ ++ while ((line_len = getline(&line_buf, &line_size, file)) > 0) { ++ char *line_tmp = line_buf; ++ char *line_pos = line_buf; ++ struct dvbcfg_scanfile tmp; ++ ++ /* remove newline and comments (started with hashes) */ ++ while ((*line_tmp != '\0') && (*line_tmp != '\n') && (*line_tmp != '#')) ++ line_tmp++; ++ *line_tmp = '\0'; ++ ++ /* always use inversion auto */ ++ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO; ++ ++ /* parse frontend type */ ++ switch(dvbcfg_parse_char(&line_pos, " ")) { ++ case 'T': ++ tmp.fe_type = DVBFE_TYPE_DVBT; ++ break; ++ case 'C': ++ tmp.fe_type = DVBFE_TYPE_DVBC; ++ break; ++ case 'S': ++ tmp.fe_type = DVBFE_TYPE_DVBS; ++ break; ++ case 'A': ++ tmp.fe_type = DVBFE_TYPE_ATSC; ++ break; ++ default: ++ continue; ++ } ++ ++ /* parse frontend specific settings */ ++ switch (tmp.fe_type) { ++ case DVBFE_TYPE_ATSC: ++ ++ /* parse frequency */ ++ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* modulation */ ++ tmp.fe_params.u.atsc.modulation = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_atsc_modulation_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBC: ++ ++ /* parse frequency */ ++ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* symbol rate */ ++ tmp.fe_params.u.dvbc.symbol_rate = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* fec */ ++ tmp.fe_params.u.dvbc.fec_inner = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* modulation */ ++ tmp.fe_params.u.dvbc.modulation = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_dvbc_modulation_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBS: ++ ++ /* parse frequency */ ++ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* polarization */ ++ tmp.polarization = tolower(dvbcfg_parse_char(&line_pos, " ")); ++ if (!line_pos) ++ continue; ++ if ((tmp.polarization != 'h') && ++ (tmp.polarization != 'v') && ++ (tmp.polarization != 'l') && ++ (tmp.polarization != 'r')) ++ continue; ++ ++ /* symbol rate */ ++ tmp.fe_params.u.dvbs.symbol_rate = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* fec */ ++ tmp.fe_params.u.dvbc.fec_inner = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBT: ++ ++ /* parse frequency */ ++ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " "); ++ if (!line_pos) ++ continue; ++ ++ /* bandwidth */ ++ tmp.fe_params.u.dvbt.bandwidth = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_bandwidth_list); ++ if (!line_pos) ++ continue; ++ ++ /* fec hp */ ++ tmp.fe_params.u.dvbt.code_rate_HP = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* fec lp */ ++ tmp.fe_params.u.dvbt.code_rate_LP = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* constellation */ ++ tmp.fe_params.u.dvbt.constellation = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_constellation_list); ++ if (!line_pos) ++ continue; ++ ++ /* transmission mode */ ++ tmp.fe_params.u.dvbt.transmission_mode = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_transmission_mode_list); ++ if (!line_pos) ++ continue; ++ ++ /* guard interval */ ++ tmp.fe_params.u.dvbt.guard_interval = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_guard_interval_list); ++ if (!line_pos) ++ continue; ++ ++ /* hierarchy */ ++ tmp.fe_params.u.dvbt.hierarchy_information = ++ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_hierarchy_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ } ++ ++ /* invoke callback */ ++ if ((ret_val = callback(&tmp, private_data)) != 0) { ++ if (ret_val < 0) ++ ret_val = 0; ++ break; ++ } ++ } ++ ++ if (line_buf) ++ free(line_buf); ++ ++ return ret_val; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_scanfile.h dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_scanfile.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,61 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * scan channel file support ++ * ++ * Copyright (C) 2006 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef DVBCFG_SCANFILE_H ++#define DVBCFG_SCANFILE_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++ ++struct dvbcfg_scanfile { ++ enum dvbfe_type fe_type; ++ struct dvbfe_parameters fe_params; ++ char polarization; /* l,r,v,h - only used for dvb-s */ ++}; ++ ++/** ++ * Callback used in dvbcfg_scanfile_parse() ++ * ++ * @param channel Selected channel ++ * @param private_data Private data for the callback ++ * @return 0 to continue, other values to stop (values > 0 are forwarded; see below) ++ */ ++typedef int (*dvbcfg_scancallback)(struct dvbcfg_scanfile *channel, void *private_data); ++ ++/** ++ * Parse a linuxtv scan file ++ * ++ * @param file Linuxtv scan file ++ * @param callback Callback called for each scan entry ++ * @param private_data Private data for the callback ++ * @return on success 0 or value from the callback if it's > 0, error code on failure ++ */ ++extern int dvbcfg_scanfile_parse(FILE *file, dvbcfg_scancallback callback, void *private_data); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* DVBCFG_SCANFILE_H */ +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_zapchannel.c dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_zapchannel.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,384 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * zap channel file support ++ * ++ * Copyright (C) 2006 Christoph Pfister ++ * Copyright (C) 2005 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++ ++#include "dvbcfg_zapchannel.h" ++#include "dvbcfg_common.h" ++ ++static const struct dvbcfg_setting dvbcfg_inversion_list[] = { ++ { "INVERSION_ON", DVBFE_INVERSION_ON }, ++ { "INVERSION_OFF", DVBFE_INVERSION_OFF }, ++ { "INVERSION_AUTO", DVBFE_INVERSION_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_fec_list[] = { ++ { "FEC_1_2", DVBFE_FEC_1_2 }, ++ { "FEC_2_3", DVBFE_FEC_2_3 }, ++ { "FEC_3_4", DVBFE_FEC_3_4 }, ++ { "FEC_4_5", DVBFE_FEC_4_5 }, ++ { "FEC_5_6", DVBFE_FEC_5_6 }, ++ { "FEC_6_7", DVBFE_FEC_6_7 }, ++ { "FEC_7_8", DVBFE_FEC_7_8 }, ++ { "FEC_8_9", DVBFE_FEC_8_9 }, ++ { "FEC_AUTO", DVBFE_FEC_AUTO }, ++ { "FEC_NONE", DVBFE_FEC_NONE }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_dvbc_modulation_list[] = { ++ { "QAM_16", DVBFE_DVBC_MOD_QAM_16 }, ++ { "QAM_32", DVBFE_DVBC_MOD_QAM_32 }, ++ { "QAM_64", DVBFE_DVBC_MOD_QAM_64 }, ++ { "QAM_128", DVBFE_DVBC_MOD_QAM_128 }, ++ { "QAM_256", DVBFE_DVBC_MOD_QAM_256 }, ++ { "QAM_AUTO", DVBFE_DVBC_MOD_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_bandwidth_list[] = { ++ { "BANDWIDTH_6_MHZ", DVBFE_DVBT_BANDWIDTH_6_MHZ }, ++ { "BANDWIDTH_7_MHZ", DVBFE_DVBT_BANDWIDTH_7_MHZ }, ++ { "BANDWIDTH_8_MHZ", DVBFE_DVBT_BANDWIDTH_8_MHZ }, ++ { "BANDWIDTH_AUTO", DVBFE_DVBT_BANDWIDTH_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_constellation_list[] = { ++ { "QAM_16", DVBFE_DVBT_CONST_QAM_16 }, ++ { "QAM_32", DVBFE_DVBT_CONST_QAM_32 }, ++ { "QAM_64", DVBFE_DVBT_CONST_QAM_64 }, ++ { "QAM_128", DVBFE_DVBT_CONST_QAM_128 }, ++ { "QAM_256", DVBFE_DVBT_CONST_QAM_256 }, ++ { "QPSK", DVBFE_DVBT_CONST_QPSK }, ++ { "QAM_AUTO", DVBFE_DVBT_CONST_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_transmission_mode_list[] = { ++ { "TRANSMISSION_MODE_2K", DVBFE_DVBT_TRANSMISSION_MODE_2K }, ++ { "TRANSMISSION_MODE_8K", DVBFE_DVBT_TRANSMISSION_MODE_8K }, ++ { "TRANSMISSION_MODE_AUTO", DVBFE_DVBT_TRANSMISSION_MODE_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_guard_interval_list[] = { ++ { "GUARD_INTERVAL_1_32", DVBFE_DVBT_GUARD_INTERVAL_1_32 }, ++ { "GUARD_INTERVAL_1_16", DVBFE_DVBT_GUARD_INTERVAL_1_16 }, ++ { "GUARD_INTERVAL_1_8", DVBFE_DVBT_GUARD_INTERVAL_1_8 }, ++ { "GUARD_INTERVAL_1_4", DVBFE_DVBT_GUARD_INTERVAL_1_4 }, ++ { "GUARD_INTERVAL_AUTO", DVBFE_DVBT_GUARD_INTERVAL_AUTO }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_hierarchy_list[] = { ++ { "HIERARCHY_1", DVBFE_DVBT_HIERARCHY_1 }, ++ { "HIERARCHY_2", DVBFE_DVBT_HIERARCHY_2 }, ++ { "HIERARCHY_4", DVBFE_DVBT_HIERARCHY_4 }, ++ { "HIERARCHY_AUTO", DVBFE_DVBT_HIERARCHY_AUTO }, ++ { "HIERARCHY_NONE", DVBFE_DVBT_HIERARCHY_NONE }, ++ { NULL, 0 } ++}; ++ ++static const struct dvbcfg_setting dvbcfg_atsc_modulation_list[] = { ++ { "8VSB", DVBFE_ATSC_MOD_VSB_8 }, ++ { "16VSB", DVBFE_ATSC_MOD_VSB_16 }, ++ { "QAM_64", DVBFE_ATSC_MOD_QAM_64 }, ++ { "QAM_256", DVBFE_ATSC_MOD_QAM_256 }, ++ { NULL, 0 } ++}; ++ ++int dvbcfg_zapchannel_parse(FILE *file, dvbcfg_zapcallback callback, void *private_data) ++{ ++ char *line_buf = NULL; ++ size_t line_size = 0; ++ int line_len = 0; ++ int ret_val = 0; ++ ++ while ((line_len = getline(&line_buf, &line_size, file)) > 0) { ++ char *line_tmp = line_buf; ++ char *line_pos = line_buf; ++ struct dvbcfg_zapchannel tmp; ++ ++ /* remove newline and comments (started with hashes) */ ++ while ((*line_tmp != '\0') && (*line_tmp != '\n') && (*line_tmp != '#')) ++ line_tmp++; ++ *line_tmp = '\0'; ++ ++ /* parse name */ ++ dvbcfg_parse_string(&line_pos, ":", tmp.name, sizeof(tmp.name)); ++ if (!line_pos) ++ continue; ++ ++ /* parse frequency */ ++ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) ++ continue; ++ ++ /* try to determine frontend type */ ++ if (strstr(line_pos, ":FEC_")) { ++ if (strstr(line_pos, ":HIERARCHY_")) ++ tmp.fe_type = DVBFE_TYPE_DVBT; ++ else ++ tmp.fe_type = DVBFE_TYPE_DVBC; ++ } else { ++ if (strstr(line_pos, "VSB:") || strstr(line_pos, "QAM_")) ++ tmp.fe_type = DVBFE_TYPE_ATSC; ++ else ++ tmp.fe_type = DVBFE_TYPE_DVBS; ++ } ++ ++ /* parse frontend specific settings */ ++ switch (tmp.fe_type) { ++ case DVBFE_TYPE_ATSC: ++ /* inversion */ ++ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO; ++ ++ /* modulation */ ++ tmp.fe_params.u.atsc.modulation = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_atsc_modulation_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBC: ++ /* inversion */ ++ tmp.fe_params.inversion = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_inversion_list); ++ if (!line_pos) ++ continue; ++ ++ /* symbol rate */ ++ tmp.fe_params.u.dvbc.symbol_rate = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) ++ continue; ++ ++ /* fec */ ++ tmp.fe_params.u.dvbc.fec_inner = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* modulation */ ++ tmp.fe_params.u.dvbc.modulation = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_dvbc_modulation_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBS: ++ /* adjust frequency */ ++ tmp.fe_params.frequency *= 1000; ++ ++ /* inversion */ ++ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO; ++ ++ /* fec */ ++ tmp.fe_params.u.dvbs.fec_inner = DVBFE_FEC_AUTO; ++ ++ /* polarization */ ++ tmp.polarization = tolower(dvbcfg_parse_char(&line_pos, ":")); ++ if (!line_pos) ++ continue; ++ if ((tmp.polarization != 'h') && ++ (tmp.polarization != 'v') && ++ (tmp.polarization != 'l') && ++ (tmp.polarization != 'r')) ++ continue; ++ ++ /* satellite switch position */ ++ tmp.diseqc_switch = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) ++ continue; ++ ++ /* symbol rate */ ++ tmp.fe_params.u.dvbs.symbol_rate = ++ dvbcfg_parse_int(&line_pos, ":") * 1000; ++ if (!line_pos) ++ continue; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBT: ++ /* inversion */ ++ tmp.fe_params.inversion = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_inversion_list); ++ if (!line_pos) ++ continue; ++ ++ /* bandwidth */ ++ tmp.fe_params.u.dvbt.bandwidth = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_bandwidth_list); ++ if (!line_pos) ++ continue; ++ ++ /* fec hp */ ++ tmp.fe_params.u.dvbt.code_rate_HP = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* fec lp */ ++ tmp.fe_params.u.dvbt.code_rate_LP = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list); ++ if (!line_pos) ++ continue; ++ ++ /* constellation */ ++ tmp.fe_params.u.dvbt.constellation = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_constellation_list); ++ if (!line_pos) ++ continue; ++ ++ /* transmission mode */ ++ tmp.fe_params.u.dvbt.transmission_mode = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_transmission_mode_list); ++ if (!line_pos) ++ continue; ++ ++ /* guard interval */ ++ tmp.fe_params.u.dvbt.guard_interval = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_guard_interval_list); ++ if (!line_pos) ++ continue; ++ ++ /* hierarchy */ ++ tmp.fe_params.u.dvbt.hierarchy_information = ++ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_hierarchy_list); ++ if (!line_pos) ++ continue; ++ ++ break; ++ } ++ ++ /* parse video and audio pids and service id */ ++ tmp.video_pid = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) ++ continue; ++ tmp.audio_pid = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) ++ continue; ++ tmp.service_id = dvbcfg_parse_int(&line_pos, ":"); ++ if (!line_pos) /* old files don't have a service id */ ++ tmp.service_id = 0; ++ ++ /* invoke callback */ ++ if ((ret_val = callback(&tmp, private_data)) != 0) { ++ if (ret_val < 0) ++ ret_val = 0; ++ break; ++ } ++ } ++ ++ if (line_buf) ++ free(line_buf); ++ ++ return ret_val; ++} ++ ++int dvbcfg_zapchannel_save(FILE *file, dvbcfg_zapcallback callback, void *private_data) ++{ ++ int ret_val = 0; ++ struct dvbcfg_zapchannel tmp; ++ ++ while ((ret_val = callback(&tmp, private_data)) == 0) { ++ /* name */ ++ if ((ret_val = fprintf(file, "%s:", tmp.name)) < 0) ++ return ret_val; ++ ++ /* frontend specific settings */ ++ switch (tmp.fe_type) { ++ case DVBFE_TYPE_ATSC: ++ if ((ret_val = fprintf(file, "%i:%s:", ++ tmp.fe_params.frequency, ++ dvbcfg_lookup_setting(tmp.fe_params.u.atsc.modulation, ++ dvbcfg_atsc_modulation_list))) < 0) ++ return ret_val; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBC: ++ if ((ret_val = fprintf(file, "%i:%s:%i:%s:%s:", ++ tmp.fe_params.frequency, ++ dvbcfg_lookup_setting(tmp.fe_params.inversion, ++ dvbcfg_inversion_list), ++ tmp.fe_params.u.dvbc.symbol_rate, ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbc.fec_inner, ++ dvbcfg_fec_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbc.modulation, ++ dvbcfg_dvbc_modulation_list))) < 0) ++ return ret_val; ++ ++ break; ++ ++ case DVBFE_TYPE_DVBS: ++ if ((ret_val = fprintf(file, "%i:%c:%i:%i:", ++ tmp.fe_params.frequency / 1000, ++ tolower(tmp.polarization), ++ tmp.diseqc_switch, ++ tmp.fe_params.u.dvbs.symbol_rate / 1000)) < 0) ++ return ret_val; ++ ++ break; ++ case DVBFE_TYPE_DVBT: ++ if ((ret_val = fprintf(file, "%i:%s:%s:%s:%s:%s:%s:%s:%s:", ++ tmp.fe_params.frequency, ++ dvbcfg_lookup_setting(tmp.fe_params.inversion, ++ dvbcfg_inversion_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.bandwidth, ++ dvbcfg_bandwidth_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.code_rate_HP, ++ dvbcfg_fec_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.code_rate_LP, ++ dvbcfg_fec_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.constellation, ++ dvbcfg_constellation_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.transmission_mode, ++ dvbcfg_transmission_mode_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.guard_interval, ++ dvbcfg_guard_interval_list), ++ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.hierarchy_information, ++ dvbcfg_hierarchy_list))) < 0) ++ return ret_val; ++ ++ break; ++ } ++ ++ /* video and audio pids and service id */ ++ if ((ret_val = fprintf(file, "%i:%i:%i\n", ++ tmp.video_pid, tmp.audio_pid, tmp.service_id)) < 0) ++ return ret_val; ++ ++ } ++ ++ if (ret_val < 0) ++ ret_val = 0; ++ ++ return ret_val; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_zapchannel.h dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/dvbcfg_zapchannel.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * dvbcfg - support for linuxtv configuration files ++ * zap channel file support ++ * ++ * Copyright (C) 2006 Christoph Pfister ++ * Copyright (C) 2005 Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef DVBCFG_ZAPCHANNEL_H ++#define DVBCFG_ZAPCHANNEL_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++ ++struct dvbcfg_zapchannel { ++ char name[128]; ++ int video_pid; ++ int audio_pid; ++ int service_id; ++ enum dvbfe_type fe_type; ++ struct dvbfe_parameters fe_params; ++ char polarization; /* l,r,v,h - only used for dvb-s */ ++ int diseqc_switch; /* only used for dvb-s */ ++}; ++ ++/** ++ * Callback used in dvbcfg_zapchannel_parse() and dvbcfg_zapchannel_save() ++ * ++ * @param channel Selected channel ++ * @param private_data Private data for the callback ++ * @return 0 to continue, other values to stop (values > 0 are forwarded; see below) ++ */ ++typedef int (*dvbcfg_zapcallback)(struct dvbcfg_zapchannel *channel, void *private_data); ++ ++/** ++ * Parse a linuxtv channel file ++ * ++ * @param file Linuxtv channel file ++ * @param callback Callback called for each channel ++ * @param private_data Private data for the callback ++ * @return on success 0 or value from the callback if it's > 0, error code on failure ++ */ ++extern int dvbcfg_zapchannel_parse(FILE *file, dvbcfg_zapcallback callback, void *private_data); ++ ++/** ++ * Save to a linuxtv channel file ++ * ++ * @param file Linuxtv channel file ++ * @param callback Callback called for each channel ++ * @param private_data Private data for the callback ++ * @return on success 0 or value from the callback if it's > 0, error code on failure ++ */ ++extern int dvbcfg_zapchannel_save(FILE *file, dvbcfg_zapcallback callback, void *private_data); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* DVBCFG_ZAPCHANNEL_H */ +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/Makefile dvb-apps/lib/libdvbcfg/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,18 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libdvbcfg ++ ++includes = dvbcfg_zapchannel.h \ ++ dvbcfg_scanfile.h ++ ++objects = dvbcfg_zapchannel.o \ ++ dvbcfg_scanfile.o \ ++ dvbcfg_common.o ++ ++lib_name = libdvbcfg ++ ++CPPFLAGS += -I../../lib ++ ++.PHONY: all ++ ++all: library ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/zapchannel.txt dvb-apps/lib/libdvbcfg/zapchannel.txt +--- linuxtv-dvb-apps-1.1.1/lib/libdvbcfg/zapchannel.txt 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbcfg/zapchannel.txt 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,72 @@ ++/** ++ * The zapchannel file format specifies tuning parameters for channels. Each line describes ++ * a single channel, and consists of multiple options separated by ':'. The exact ++ * format of each line depends on the DVB type of the channel (i.e. DVBS, DVBT, DVBC, or ATSC). ++ * ++ * Note: the lines have been split across multiple lines in the following due to length issues. ++ * ++ * The format for DVBT channels is: ++ * ++ * :::::: ++ * :::: ++ * :: ++ * ++ * name: name of the channel ++ * frequency: frequency in Hz ++ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO. ++ * bandwidth: one of BANDWIDTH_6_MHZ, BANDWIDTH_7_MHZ, or BANDWIDTH_8_MHZ. ++ * fec_hp: FEC of the high priority stream, one of: FEC_1_2, FEC_2_3, ++ * FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8, FEC_8_9, or FEC_AUTO. ++ * fec_lp: FEC of the low priority stream, one of: FEC_1_2, FEC_2_3, ++ * FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8, FEC_8_9, FEC_AUTO, or FEC_NONE. ++ * constellation: one of QPSK, QAM_128, QAM_16, QAM_256, QAM_32, or QAM_64. ++ * transmission: one of TRANSMISSION_MODE_2K, or TRANSMISSION_MODE_8K. ++ * guard_interval: one of GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, or GUARD_INTERVAL_1_4. ++ * hierarchy: one of HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, or HIERARCHY_4. ++ * video_pid: PID of the video stream. ++ * audio_pid: PID of the audio stream. ++ * channel_number: Transport stream channel number of the program. ++ * ++ * DVBC: ++ * ++ * ::::: ++ * ::: ++ * ++ * name: name of the channel ++ * frequency: frequency in Hz ++ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO. ++ * symbol_rate: Symbol rate of the channel in ksyms. ++ * fec: One of: FEC_1_2, FEC_2_3, FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, ++ * FEC_7_8, FEC_8_9, or FEC_AUTO. ++ * modulation: one of QAM_16, QAM_32, QAM_64, QAM_128, QAM_256, QAM_AUTO. ++ * video_pid: PID of the video stream. ++ * audio_pid: PID of the audio stream. ++ * channel_number: Transport stream channel number of the program. ++ * ++ * DVBS: ++ * ++ * ::::::: ++ * ++ * name: name of the channel ++ * frequency: frequency in kHz ++ * polarization: one of H,V,L, or R. ++ * satellite_switches: Treated as a 2 bit value controlling switches in SEC equipment: ++ * bit 0: controls "satellite switch", 0: A, 1: B ++ * bit 1: controls "switch option", 0: A, 1: B ++ * symbol_rate: Symbol rate of the channel in ksyms. ++ * video_pid: PID of the video stream. ++ * audio_pid: PID of the audio stream. ++ * channel_number: Transport stream channel number of the program. ++ * ++ * ATSC: ++ * ++ * :::::: ++ * ++ * name: name of the channel ++ * frequency: frequency in GHz ++ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO. ++ * modulation: one of 8VSB, 16VSB, QAM_64, or QAM_256. ++ * video_pid: PID of the video stream. ++ * audio_pid: PID of the audio stream. ++ * channel_number: Transport stream channel number of the program. ++ */ +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/asn_1.c dvb-apps/lib/libdvben50221/asn_1.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/asn_1.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/asn_1.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,83 @@ ++/* ++ ASN.1 routines, implementation for libdvben50221 ++ an implementation for the High Level Common Interface ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include "asn_1.h" ++ ++int asn_1_decode(uint16_t * length, uint8_t * asn_1_array, ++ uint32_t asn_1_array_len) ++{ ++ uint8_t length_field; ++ ++ if (asn_1_array_len < 1) ++ return -1; ++ length_field = asn_1_array[0]; ++ ++ if (length_field < 0x80) { ++ // there is only one word ++ *length = length_field & 0x7f; ++ return 1; ++ } else if (length_field == 0x81) { ++ if (asn_1_array_len < 2) ++ return -1; ++ ++ *length = asn_1_array[1]; ++ return 2; ++ } else if (length_field == 0x82) { ++ if (asn_1_array_len < 3) ++ return -1; ++ ++ *length = (asn_1_array[1] << 8) | asn_1_array[2]; ++ return 3; ++ } ++ ++ return -1; ++} ++ ++int asn_1_encode(uint16_t length, uint8_t * asn_1_array, ++ uint32_t asn_1_array_len) ++{ ++ if (length < 0x80) { ++ if (asn_1_array_len < 1) ++ return -1; ++ ++ asn_1_array[0] = length & 0x7f; ++ return 1; ++ } else if (length < 0x100) { ++ if (asn_1_array_len < 2) ++ return -1; ++ ++ asn_1_array[0] = 0x81; ++ asn_1_array[1] = length; ++ return 2; ++ } else { ++ if (asn_1_array_len < 3) ++ return -1; ++ ++ asn_1_array[0] = 0x82; ++ asn_1_array[1] = length >> 8; ++ asn_1_array[2] = length; ++ return 3; ++ } ++ ++ // never reached ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/asn_1.h dvb-apps/lib/libdvben50221/asn_1.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/asn_1.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/asn_1.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,41 @@ ++/* ++ ASN.1 routines, implementation for libdvben50221 ++ an implementation for the High Level Common Interface ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __ASN_1_H__ ++#define __ASN_1_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++ ++int asn_1_decode(uint16_t * length, uint8_t * asn_1_array, ++ uint32_t asn_1_array_len); ++int asn_1_encode(uint16_t length, uint8_t * asn_1_array, ++ uint32_t asn_1_array_len); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ai.c dvb-apps/lib/libdvben50221/en50221_app_ai.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ai.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_ai.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,191 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_ai.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_ai { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_ai_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_ai_parse_app_info(struct en50221_app_ai *ai, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++struct en50221_app_ai *en50221_app_ai_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_ai *ai = NULL; ++ ++ // create structure and set it up ++ ai = malloc(sizeof(struct en50221_app_ai)); ++ if (ai == NULL) { ++ return NULL; ++ } ++ ai->funcs = funcs; ++ ai->callback = NULL; ++ ++ pthread_mutex_init(&ai->lock, NULL); ++ ++ // done ++ return ai; ++} ++ ++void en50221_app_ai_destroy(struct en50221_app_ai *ai) ++{ ++ pthread_mutex_destroy(&ai->lock); ++ free(ai); ++} ++ ++void en50221_app_ai_register_callback(struct en50221_app_ai *ai, ++ en50221_app_ai_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&ai->lock); ++ ai->callback = callback; ++ ai->callback_arg = arg; ++ pthread_mutex_unlock(&ai->lock); ++} ++ ++int en50221_app_ai_enquiry(struct en50221_app_ai *ai, ++ uint16_t session_number) ++{ ++ uint8_t data[4]; ++ ++ data[0] = (TAG_APP_INFO_ENQUIRY >> 16) & 0xFF; ++ data[1] = (TAG_APP_INFO_ENQUIRY >> 8) & 0xFF; ++ data[2] = TAG_APP_INFO_ENQUIRY & 0xFF; ++ data[3] = 0; ++ ++ return ai->funcs->send_data(ai->funcs->arg, session_number, data, 4); ++} ++ ++int en50221_app_ai_entermenu(struct en50221_app_ai *ai, ++ uint16_t session_number) ++{ ++ uint8_t data[4]; ++ ++ data[0] = (TAG_ENTER_MENU >> 16) & 0xFF; ++ data[1] = (TAG_ENTER_MENU >> 8) & 0xFF; ++ data[2] = TAG_ENTER_MENU & 0xFF; ++ data[3] = 0; ++ ++ return ai->funcs->send_data(ai->funcs->arg, session_number, data, 4); ++} ++ ++int en50221_app_ai_message(struct en50221_app_ai *ai, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_APP_INFO: ++ return en50221_app_ai_parse_app_info(ai, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++ ++ ++ ++ ++static int en50221_app_ai_parse_app_info(struct en50221_app_ai *ai, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // parse the length field ++ int length_field_len; ++ uint16_t asn_data_length; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return -1; ++ } ++ // check it ++ if (asn_data_length < 6) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *app_info = data + length_field_len; ++ ++ // parse the fields ++ uint8_t application_type = app_info[0]; ++ uint16_t application_manufacturer = (app_info[1] << 8) | app_info[2]; ++ uint16_t manufacturer_code = (app_info[3] << 8) | app_info[4]; ++ uint8_t menu_string_length = app_info[5]; ++ uint8_t *menu_string = app_info + 6; ++ ++ // check the menu_string_length ++ if (menu_string_length > (asn_data_length - 6)) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received bad menu string length - adjusting\n"); ++ menu_string_length = asn_data_length - 6; ++ } ++ // tell the app ++ pthread_mutex_lock(&ai->lock); ++ en50221_app_ai_callback cb = ai->callback; ++ void *cb_arg = ai->callback_arg; ++ pthread_mutex_unlock(&ai->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ application_type, application_manufacturer, ++ manufacturer_code, menu_string_length, ++ menu_string); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ai.h dvb-apps/lib/libdvben50221/en50221_app_ai.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ai.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_ai.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,136 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_AI_H__ ++#define __EN50221_APPLICATION_AI_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_AI_RESOURCEID MKRID(2,1,1) ++ ++#define APPLICATION_TYPE_CA 0x01 ++#define APPLICATION_TYPE_EPG 0x02 ++ ++/** ++ * Type definition for application callback function - called when we receive ++ * an application info object. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Resource id concerned. ++ * @param application_type Type of application. ++ * @param application_manufacturer Manufacturer of application. ++ * @param manufacturer_code Manufacturer specific code. ++ * @param menu_string_length Length of menu string. ++ * @param menu_string The menu string itself. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_ai_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t application_type, ++ uint16_t application_manufacturer, ++ uint16_t manufacturer_code, ++ uint8_t menu_string_length, ++ uint8_t * menu_string); ++ ++/** ++ * Opaque type representing an application information resource. ++ */ ++struct en50221_app_ai; ++ ++/** ++ * Create an instance of an application information resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_ai *en50221_app_ai_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of an application information resource. ++ * ++ * @param ai Instance to destroy. ++ */ ++extern void en50221_app_ai_destroy(struct en50221_app_ai *ai); ++ ++/** ++ * Register a callback for reception of application_info objects. ++ * ++ * @param ai Application information instance. ++ * @param callback Callback function. ++ * @param arg Private argument passed during calls to the callback. ++ */ ++extern void en50221_app_ai_register_callback(struct en50221_app_ai *ai, ++ en50221_app_ai_callback, ++ void *arg); ++ ++/** ++ * send a enquiry for the app_info provided by a module ++ * ++ * @param ai Application information instance. ++ * @param session_number Session to send on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ai_enquiry(struct en50221_app_ai *ai, ++ uint16_t session_number); ++ ++/** ++ * send a enter_menu tag, this will make the application ++ * open a new MMI session to provide a Menu, or so. ++ * ++ * @param ai Application information instance. ++ * @param session_number Session to send on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ai_entermenu(struct en50221_app_ai *ai, ++ uint16_t session_number); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param ai Application information instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ai_message(struct en50221_app_ai *ai, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_auth.c dvb-apps/lib/libdvben50221/en50221_app_auth.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_auth.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_auth.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,180 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_auth.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_auth { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_auth_request_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_auth_parse_request(struct en50221_app_auth *private, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++struct en50221_app_auth *en50221_app_auth_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_auth *auth = NULL; ++ ++ // create structure and set it up ++ auth = malloc(sizeof(struct en50221_app_auth)); ++ if (auth == NULL) { ++ return NULL; ++ } ++ auth->funcs = funcs; ++ auth->callback = NULL; ++ ++ pthread_mutex_init(&auth->lock, NULL); ++ ++ // done ++ return auth; ++} ++ ++void en50221_app_auth_destroy(struct en50221_app_auth *auth) ++{ ++ pthread_mutex_destroy(&auth->lock); ++ free(auth); ++} ++ ++void en50221_app_auth_register_request_callback(struct en50221_app_auth *auth, ++ en50221_app_auth_request_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&auth->lock); ++ auth->callback = callback; ++ auth->callback_arg = arg; ++ pthread_mutex_unlock(&auth->lock); ++} ++ ++int en50221_app_auth_send(struct en50221_app_auth *auth, ++ uint16_t session_number, ++ uint16_t auth_protocol_id, uint8_t * auth_data, ++ uint32_t auth_data_length) ++{ ++ uint8_t buf[10]; ++ ++ // the header ++ buf[0] = (TAG_AUTH_RESP >> 16) & 0xFF; ++ buf[1] = (TAG_AUTH_RESP >> 8) & 0xFF; ++ buf[2] = TAG_AUTH_RESP & 0xFF; ++ ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(auth_data_length + 2, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ // the phase_id ++ buf[3 + length_field_len] = auth_protocol_id >> 8; ++ buf[3 + length_field_len + 1] = auth_protocol_id; ++ ++ // build the iovecs ++ struct iovec iov[2]; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len + 2; ++ iov[1].iov_base = auth_data; ++ iov[1].iov_len = auth_data_length; ++ ++ // sendit ++ return auth->funcs->send_datav(auth->funcs->arg, session_number, ++ iov, 2); ++} ++ ++int en50221_app_auth_message(struct en50221_app_auth *auth, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_AUTH_REQ: ++ return en50221_app_auth_parse_request(auth, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++static int en50221_app_auth_parse_request(struct en50221_app_auth *auth, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *auth_data = data + length_field_len; ++ ++ // process it ++ uint16_t auth_protocol_id = (auth_data[0] << 8) | auth_data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&auth->lock); ++ en50221_app_auth_request_callback cb = auth->callback; ++ void *cb_arg = auth->callback_arg; ++ pthread_mutex_unlock(&auth->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ auth_protocol_id, auth_data + 2, ++ asn_data_length - 2); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_auth.h dvb-apps/lib/libdvben50221/en50221_app_auth.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_auth.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_auth.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,123 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_auth_H__ ++#define __EN50221_APPLICATION_auth_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_AUTH_RESOURCEID MKRID(16,1,1) ++ ++/** ++ * Type definition for request - called when we receive a auth request from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param auth_protocol_id Auth protocol id. ++ * @param auth_data Data for the request. ++ * @param auth_data_lenghth Number of bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_auth_request_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint16_t auth_protcol_id, ++ uint8_t *auth_data, ++ uint32_t auth_data_length); ++ ++/** ++ * Opaque type representing a auth resource. ++ */ ++struct en50221_app_auth; ++ ++/** ++ * Create an instance of the auth resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_auth *en50221_app_auth_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the auth resource. ++ * ++ * @param auth Instance to destroy. ++ */ ++extern void en50221_app_auth_destroy(struct en50221_app_auth *auth); ++ ++/** ++ * Register the callback for when we receive a request. ++ * ++ * @param auth auth resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_auth_register_request_callback(struct en50221_app_auth *auth, ++ en50221_app_auth_request_callback callback, ++ void *arg); ++ ++/** ++ * Send an auth response to the CAM. ++ * ++ * @param auth auth resource instance. ++ * @param session_number Session number to send it on. ++ * @param auth_protocol_id Auth protocol id. ++ * @param auth_data Auth data. ++ * @param auth_data_length Number of bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_auth_send(struct en50221_app_auth *auth, ++ uint16_t session_number, ++ uint16_t auth_protocol_id, ++ uint8_t *auth_data, ++ uint32_t auth_data_length); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param auth Authentication instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_auth_message(struct en50221_app_auth *auth, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ca.c dvb-apps/lib/libdvben50221/en50221_app_ca.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ca.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_ca.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,631 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "en50221_app_ca.h" ++#include "asn_1.h" ++ ++// tags supported by this resource ++#define TAG_CA_INFO_ENQUIRY 0x9f8030 ++#define TAG_CA_INFO 0x9f8031 ++#define TAG_CA_PMT 0x9f8032 ++#define TAG_CA_PMT_REPLY 0x9f8033 ++ ++struct en50221_app_ca { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_ca_info_callback ca_info_callback; ++ void *ca_info_callback_arg; ++ ++ en50221_app_ca_pmt_reply_callback ca_pmt_reply_callback; ++ void *ca_pmt_reply_callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++struct ca_pmt_descriptor { ++ uint8_t *descriptor; ++ uint16_t length; ++ ++ struct ca_pmt_descriptor *next; ++}; ++ ++struct ca_pmt_stream { ++ uint8_t stream_type; ++ uint16_t pid; ++ struct ca_pmt_descriptor *descriptors; ++ uint32_t descriptors_length; ++ uint32_t descriptors_count; ++ ++ struct ca_pmt_stream *next; ++}; ++ ++static int en50221_ca_extract_pmt_descriptors(struct mpeg_pmt_section *pmt, ++ struct ca_pmt_descriptor **outdescriptors); ++static int en50221_ca_extract_streams(struct mpeg_pmt_section *pmt, ++ struct ca_pmt_stream **outstreams); ++static void en50221_ca_try_move_pmt_descriptors(struct ca_pmt_descriptor **pmt_descriptors, ++ struct ca_pmt_stream **pmt_streams); ++static uint32_t en50221_ca_calculate_length(struct ca_pmt_descriptor *pmt_descriptors, ++ uint32_t *pmt_descriptors_length, ++ struct ca_pmt_stream *pmt_streams); ++static int en50221_app_ca_parse_info(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length); ++static int en50221_app_ca_parse_reply(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_ca *en50221_app_ca_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_ca *ca = NULL; ++ ++ // create structure and set it up ++ ca = malloc(sizeof(struct en50221_app_ca)); ++ if (ca == NULL) { ++ return NULL; ++ } ++ ca->funcs = funcs; ++ ca->ca_info_callback = NULL; ++ ca->ca_pmt_reply_callback = NULL; ++ ++ pthread_mutex_init(&ca->lock, NULL); ++ ++ // done ++ return ca; ++} ++ ++void en50221_app_ca_destroy(struct en50221_app_ca *ca) ++{ ++ pthread_mutex_destroy(&ca->lock); ++ free(ca); ++} ++ ++void en50221_app_ca_register_info_callback(struct en50221_app_ca *ca, ++ en50221_app_ca_info_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&ca->lock); ++ ca->ca_info_callback = callback; ++ ca->ca_info_callback_arg = arg; ++ pthread_mutex_unlock(&ca->lock); ++} ++ ++void en50221_app_ca_register_pmt_reply_callback(struct en50221_app_ca *ca, ++ en50221_app_ca_pmt_reply_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&ca->lock); ++ ca->ca_pmt_reply_callback = callback; ++ ca->ca_pmt_reply_callback_arg = arg; ++ pthread_mutex_unlock(&ca->lock); ++} ++ ++int en50221_app_ca_info_enq(struct en50221_app_ca *ca, ++ uint16_t session_number) ++{ ++ uint8_t data[4]; ++ ++ data[0] = (TAG_CA_INFO_ENQUIRY >> 16) & 0xFF; ++ data[1] = (TAG_CA_INFO_ENQUIRY >> 8) & 0xFF; ++ data[2] = TAG_CA_INFO_ENQUIRY & 0xFF; ++ data[3] = 0; ++ return ca->funcs->send_data(ca->funcs->arg, session_number, data, 4); ++} ++ ++int en50221_app_ca_pmt(struct en50221_app_ca *ca, ++ uint16_t session_number, ++ uint8_t * ca_pmt, uint32_t ca_pmt_length) ++{ ++ uint8_t buf[10]; ++ ++ // set up the tag ++ buf[0] = (TAG_CA_PMT >> 16) & 0xFF; ++ buf[1] = (TAG_CA_PMT >> 8) & 0xFF; ++ buf[2] = TAG_CA_PMT & 0xFF; ++ ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(ca_pmt_length, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ // build the iovecs ++ struct iovec iov[2]; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len; ++ iov[1].iov_base = ca_pmt; ++ iov[1].iov_len = ca_pmt_length; ++ ++ // create the data and send it ++ return ca->funcs->send_datav(ca->funcs->arg, session_number, iov, 2); ++} ++ ++int en50221_app_ca_message(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_CA_INFO: ++ return en50221_app_ca_parse_info(ca, slot_id, ++ session_number, data + 3, ++ data_length - 3); ++ case TAG_CA_PMT_REPLY: ++ return en50221_app_ca_parse_reply(ca, slot_id, ++ session_number, data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++int en50221_ca_format_pmt(struct mpeg_pmt_section *pmt, uint8_t * data, ++ uint32_t data_length, int move_ca_descriptors, ++ uint8_t ca_pmt_list_management, ++ uint8_t ca_pmt_cmd_id) ++{ ++ struct ca_pmt_descriptor *pmt_descriptors = NULL; ++ uint32_t pmt_descriptors_length = 0; ++ struct ca_pmt_stream *pmt_streams = NULL; ++ uint32_t total_required_length = 0; ++ struct ca_pmt_descriptor *cur_d; ++ struct ca_pmt_stream *cur_s; ++ int result = -1; ++ ++ // extract the descriptors and streams ++ if (en50221_ca_extract_pmt_descriptors(pmt, &pmt_descriptors)) ++ goto cleanup; ++ if (en50221_ca_extract_streams(pmt, &pmt_streams)) ++ goto cleanup; ++ ++ // try and merge them if we have no PMT descriptors ++ if ((pmt_descriptors == NULL) && move_ca_descriptors) { ++ en50221_ca_try_move_pmt_descriptors(&pmt_descriptors, ++ &pmt_streams); ++ } ++ // calculate the length of all descriptors/streams and the total length required ++ total_required_length = ++ en50221_ca_calculate_length(pmt_descriptors, ++ &pmt_descriptors_length, ++ pmt_streams); ++ ++ // ensure we were supplied with enough data ++ if (total_required_length > data_length) { ++ goto cleanup; ++ } ++ // format the start of the PMT ++ uint32_t data_pos = 0; ++ data[data_pos++] = ca_pmt_list_management; ++ data[data_pos++] = mpeg_pmt_section_program_number(pmt) >> 8; ++ data[data_pos++] = mpeg_pmt_section_program_number(pmt); ++ data[data_pos++] = ++ (pmt->head.version_number << 1) | pmt->head. ++ current_next_indicator; ++ data[data_pos++] = (pmt_descriptors_length >> 8) & 0x0f; ++ data[data_pos++] = pmt_descriptors_length; ++ ++ // append the PMT descriptors ++ if (pmt_descriptors_length) { ++ data[data_pos++] = ca_pmt_cmd_id; ++ cur_d = pmt_descriptors; ++ while (cur_d) { ++ memcpy(data + data_pos, cur_d->descriptor, ++ cur_d->length); ++ data_pos += cur_d->length; ++ cur_d = cur_d->next; ++ } ++ } ++ // now, append the streams ++ cur_s = pmt_streams; ++ while (cur_s) { ++ data[data_pos++] = cur_s->stream_type; ++ data[data_pos++] = (cur_s->pid >> 8) & 0x1f; ++ data[data_pos++] = cur_s->pid; ++ data[data_pos++] = (cur_s->descriptors_length >> 8) & 0x0f; ++ data[data_pos++] = cur_s->descriptors_length; ++ ++ // append the stream descriptors ++ if (cur_s->descriptors_length) { ++ data[data_pos++] = ca_pmt_cmd_id; ++ cur_d = cur_s->descriptors; ++ while (cur_d) { ++ memcpy(data + data_pos, cur_d->descriptor, ++ cur_d->length); ++ data_pos += cur_d->length; ++ cur_d = cur_d->next; ++ } ++ } ++ cur_s = cur_s->next; ++ } ++ result = data_pos; ++ ++ ++ cleanup: ++ // free the PMT descriptors ++ cur_d = pmt_descriptors; ++ while (cur_d) { ++ struct ca_pmt_descriptor *next = cur_d->next; ++ free(cur_d); ++ cur_d = next; ++ } ++ ++ // free the streams ++ cur_s = pmt_streams; ++ while (cur_s) { ++ struct ca_pmt_stream *next_s = cur_s->next; ++ ++ // free the stream descriptors ++ cur_d = cur_s->descriptors; ++ while (cur_d) { ++ struct ca_pmt_descriptor *next_d = cur_d->next; ++ free(cur_d); ++ cur_d = next_d; ++ } ++ ++ free(cur_s); ++ cur_s = next_s; ++ } ++ return result; ++} ++ ++ ++ ++ ++ ++ ++ ++static int en50221_ca_extract_pmt_descriptors(struct mpeg_pmt_section *pmt, ++ struct ca_pmt_descriptor **outdescriptors) ++{ ++ struct ca_pmt_descriptor *descriptors = NULL; ++ struct ca_pmt_descriptor *descriptors_tail = NULL; ++ struct ca_pmt_descriptor *cur_d; ++ ++ struct descriptor *cur_descriptor; ++ mpeg_pmt_section_descriptors_for_each(pmt, cur_descriptor) { ++ if (cur_descriptor->tag == dtag_mpeg_ca) { ++ // create a new structure for this one ++ struct ca_pmt_descriptor *new_d = ++ malloc(sizeof(struct ca_pmt_descriptor)); ++ if (new_d == NULL) { ++ goto error_exit; ++ } ++ new_d->descriptor = (uint8_t *) cur_descriptor; ++ new_d->length = cur_descriptor->len + 2; ++ new_d->next = NULL; ++ ++ // append it to the list ++ if (descriptors == NULL) { ++ descriptors = new_d; ++ } else { ++ descriptors_tail->next = new_d; ++ } ++ descriptors_tail = new_d; ++ } ++ } ++ *outdescriptors = descriptors; ++ return 0; ++ ++error_exit: ++ cur_d = descriptors; ++ while (cur_d) { ++ struct ca_pmt_descriptor *next = cur_d->next; ++ free(cur_d); ++ cur_d = next; ++ } ++ return -1; ++} ++ ++static int en50221_ca_extract_streams(struct mpeg_pmt_section *pmt, ++ struct ca_pmt_stream **outstreams) ++{ ++ struct ca_pmt_stream *streams = NULL; ++ struct ca_pmt_stream *streams_tail = NULL; ++ struct mpeg_pmt_stream *cur_stream; ++ struct descriptor *cur_descriptor; ++ struct ca_pmt_stream *cur_s; ++ ++ mpeg_pmt_section_streams_for_each(pmt, cur_stream) { ++ struct ca_pmt_descriptor *descriptors_tail = NULL; ++ ++ // create a new structure ++ struct ca_pmt_stream *new_s = ++ malloc(sizeof(struct ca_pmt_stream)); ++ if (new_s == NULL) { ++ goto exit_cleanup; ++ } ++ new_s->stream_type = cur_stream->stream_type; ++ new_s->pid = cur_stream->pid; ++ new_s->descriptors = NULL; ++ new_s->next = NULL; ++ new_s->descriptors_count = 0; ++ ++ // append it to the list ++ if (streams == NULL) { ++ streams = new_s; ++ } else { ++ streams_tail->next = new_s; ++ } ++ streams_tail = new_s; ++ ++ // now process the descriptors ++ mpeg_pmt_stream_descriptors_for_each(cur_stream, ++ cur_descriptor) { ++ if (cur_descriptor->tag == dtag_mpeg_ca) { ++ // create a new structure ++ struct ca_pmt_descriptor *new_d = ++ malloc(sizeof(struct ca_pmt_descriptor)); ++ if (new_d == NULL) { ++ goto exit_cleanup; ++ } ++ new_d->descriptor = ++ (uint8_t *) cur_descriptor; ++ new_d->length = cur_descriptor->len + 2; ++ new_d->next = NULL; ++ ++ // append it to the list ++ if (new_s->descriptors == NULL) { ++ new_s->descriptors = new_d; ++ } else { ++ descriptors_tail->next = new_d; ++ } ++ descriptors_tail = new_d; ++ new_s->descriptors_count++; ++ } ++ } ++ } ++ *outstreams = streams; ++ return 0; ++ ++exit_cleanup: ++ // free the streams ++ cur_s = streams; ++ while (cur_s) { ++ struct ca_pmt_stream *next_s = cur_s->next; ++ ++ // free the stream descriptors ++ struct ca_pmt_descriptor *cur_d = cur_s->descriptors; ++ while (cur_d) { ++ struct ca_pmt_descriptor *next_d = cur_d->next; ++ free(cur_d); ++ cur_d = next_d; ++ } ++ ++ free(cur_s); ++ cur_s = next_s; ++ } ++ return -1; ++} ++ ++static void en50221_ca_try_move_pmt_descriptors(struct ca_pmt_descriptor **pmt_descriptors, ++ struct ca_pmt_stream **pmt_streams) ++{ ++ // get the first stream ++ struct ca_pmt_stream *first_stream = *pmt_streams; ++ if (first_stream == NULL) ++ return; ++ ++ // Check that all the other streams with CA descriptors have exactly the same CA descriptors ++ struct ca_pmt_stream *cur_stream = first_stream->next; ++ while (cur_stream) { ++ // if there are differing numbers of descriptors, exit right now ++ if (cur_stream->descriptors_count != first_stream->descriptors_count) ++ return; ++ ++ // now verify the descriptors match ++ struct ca_pmt_descriptor *cur_descriptor = cur_stream->descriptors; ++ struct ca_pmt_descriptor *first_cur_descriptor = first_stream->descriptors; ++ while (cur_descriptor) { ++ // check the descriptors are the same length ++ if (cur_descriptor->length != first_cur_descriptor->length) ++ return; ++ ++ // check their contents match ++ if (memcmp(cur_descriptor->descriptor, ++ first_cur_descriptor->descriptor, ++ cur_descriptor->length)) { ++ return; ++ } ++ // move to next ++ cur_descriptor = cur_descriptor->next; ++ first_cur_descriptor = first_cur_descriptor->next; ++ } ++ ++ // move to next ++ cur_stream = cur_stream->next; ++ } ++ ++ // if we end up here, all descriptors in all streams matched ++ ++ // hook the first stream's descriptors into the PMT's ++ *pmt_descriptors = first_stream->descriptors; ++ first_stream->descriptors = NULL; ++ first_stream->descriptors_count = 0; ++ ++ // now free up all the descriptors in the other streams ++ cur_stream = first_stream->next; ++ while (cur_stream) { ++ struct ca_pmt_descriptor *cur_descriptor = cur_stream->descriptors; ++ while (cur_descriptor) { ++ struct ca_pmt_descriptor *next = cur_descriptor->next; ++ free(cur_descriptor); ++ cur_descriptor = next; ++ } ++ cur_stream->descriptors = NULL; ++ cur_stream->descriptors_count = 0; ++ cur_stream = cur_stream->next; ++ } ++} ++ ++static uint32_t en50221_ca_calculate_length(struct ca_pmt_descriptor *pmt_descriptors, ++ uint32_t *pmt_descriptors_length, ++ struct ca_pmt_stream *pmt_streams) ++{ ++ uint32_t total_required_length = 6; // header ++ struct ca_pmt_stream *cur_s; ++ ++ // calcuate the PMT descriptors length ++ (*pmt_descriptors_length) = 0; ++ struct ca_pmt_descriptor *cur_d = pmt_descriptors; ++ while (cur_d) { ++ (*pmt_descriptors_length) += cur_d->length; ++ cur_d = cur_d->next; ++ } ++ ++ // add on 1 byte for the ca_pmt_cmd_id if we have some descriptors. ++ if (*pmt_descriptors_length) ++ (*pmt_descriptors_length)++; ++ ++ // update the total required length ++ total_required_length += *pmt_descriptors_length; ++ ++ // calculate the length of descriptors in the streams ++ cur_s = pmt_streams; ++ while (cur_s) { ++ // calculate the size of descriptors in this stream ++ cur_s->descriptors_length = 0; ++ cur_d = cur_s->descriptors; ++ while (cur_d) { ++ cur_s->descriptors_length += cur_d->length; ++ cur_d = cur_d->next; ++ } ++ ++ // add on 1 byte for the ca_pmt_cmd_id if we have some descriptors. ++ if (cur_s->descriptors_length) ++ cur_s->descriptors_length++; ++ ++ // update the total required length; ++ total_required_length += 5 + cur_s->descriptors_length; ++ ++ cur_s = cur_s->next; ++ } ++ ++ // done ++ return total_required_length; ++} ++ ++static int en50221_app_ca_parse_info(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ data += length_field_len; ++ ++ // parse ++ uint32_t ca_id_count = asn_data_length / 2; ++ ++ // byteswap the IDs ++ uint16_t *ids = (uint16_t *) data; ++ uint32_t i; ++ for (i = 0; i < ca_id_count; i++) { ++ bswap16(data); ++ data += 2; ++ } ++ ++ // tell the app ++ pthread_mutex_lock(&ca->lock); ++ en50221_app_ca_info_callback cb = ca->ca_info_callback; ++ void *cb_arg = ca->ca_info_callback_arg; ++ pthread_mutex_unlock(&ca->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ca_id_count, ++ ids); ++ } ++ return 0; ++} ++ ++static int en50221_app_ca_parse_reply(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length < 4) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ data += length_field_len; ++ data_length -= length_field_len; ++ ++ // process the reply table to fix endian issues ++ uint32_t pos = 4; ++ bswap16(data); ++ while (pos < asn_data_length) { ++ bswap16(data + pos); ++ pos += 3; ++ } ++ ++ // tell the app ++ pthread_mutex_lock(&ca->lock); ++ en50221_app_ca_pmt_reply_callback cb = ca->ca_pmt_reply_callback; ++ void *cb_arg = ca->ca_pmt_reply_callback_arg; ++ pthread_mutex_unlock(&ca->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ (struct en50221_app_pmt_reply *) data, ++ asn_data_length); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ca.h dvb-apps/lib/libdvben50221/en50221_app_ca.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_ca.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_ca.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,264 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_ca_H__ ++#define __EN50221_APPLICATION_ca_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define CA_LIST_MANAGEMENT_MORE 0x00 ++#define CA_LIST_MANAGEMENT_FIRST 0x01 ++#define CA_LIST_MANAGEMENT_LAST 0x02 ++#define CA_LIST_MANAGEMENT_ONLY 0x03 ++#define CA_LIST_MANAGEMENT_ADD 0x04 ++#define CA_LIST_MANAGEMENT_UPDATE 0x05 ++ ++#define CA_PMT_CMD_ID_OK_DESCRAMBLING 0x01 ++#define CA_PMT_CMD_ID_OK_MMI 0x02 ++#define CA_PMT_CMD_ID_QUERY 0x03 ++#define CA_PMT_CMD_ID_NOT_SELECTED 0x04 ++ ++#define CA_ENABLE_DESCRAMBLING_POSSIBLE 0x01 ++#define CA_ENABLE_DESCRAMBLING_POSSIBLE_PURCHASE 0x02 ++#define CA_ENABLE_DESCRAMBLING_POSSIBLE_TECHNICAL 0x03 ++#define CA_ENABLE_DESCRAMBLING_NOT_POSSIBLE_NO_ENTITLEMENT 0x71 ++#define CA_ENABLE_DESCRAMBLING_NOT_POSSIBLE_TECHNICAL 0x73 ++ ++ ++#define EN50221_APP_CA_RESOURCEID MKRID(3,1,1) ++ ++/** ++ * PMT reply structure. ++ */ ++struct en50221_app_pmt_reply { ++ uint16_t program_number; ++ EBIT3(uint8_t reserved_1 : 2;, ++ uint8_t version_number : 5;, ++ uint8_t current_next_indicator : 1;); ++ EBIT2(uint8_t CA_enable_flag : 1;, ++ uint8_t CA_enable : 7;); ++ /* struct en50221_app_pmt_stream streams[] */ ++} __attribute__ ((packed)); ++ ++/** ++ * A stream within a pmt reply structure. ++ */ ++struct en50221_app_pmt_stream { ++ EBIT2(uint16_t reserved_1 : 3;, ++ uint16_t es_pid :13;); ++ EBIT2(uint8_t CA_enable_flag : 1;, ++ uint8_t CA_enable : 7;); ++} __attribute__ ((packed)); ++ ++/** ++ * Convenience iterator for the streams field of the en50221_app_pmt_reply structure. ++ * ++ * @param pmt Pointer to the en50221_app_pmt_reply structure. ++ * @param pos Variable holding a pointer to the current en50221_app_pmt_stream. ++ * @param size Total size of the PMT reply. ++ */ ++#define en50221_app_pmt_reply_streams_for_each(pmt, pos, size) \ ++ for ((pos) = en50221_app_pmt_reply_streams_first(pmt, size); \ ++ (pos); \ ++ (pos) = en50221_app_pmt_reply_streams_next(pmt, pos, size)) ++ ++ ++/** ++ * Type definition for command - called when we receive a ca info response. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param ca_id_count Number of ca_system_ids. ++ * @param ca_ids Pointer to list of ca_system_ids. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_ca_info_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t ca_id_count, ++ uint16_t * ca_ids); ++ ++/** ++ * Type definition for pmt_reply - called when we receive a pmt_reply. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param reply Pointer to a struct en50221_app_pmt_reply. ++ * @param reply_size Total size of the struct en50221_app_pmt_reply in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_ca_pmt_reply_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ struct en50221_app_pmt_reply *reply, ++ uint32_t reply_size); ++ ++/** ++ * Opaque type representing a ca resource. ++ */ ++struct en50221_app_ca; ++ ++/** ++ * Create an instance of the ca resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_ca *en50221_app_ca_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the ca resource. ++ * ++ * @param ca Instance to destroy. ++ */ ++extern void en50221_app_ca_destroy(struct en50221_app_ca *ca); ++ ++/** ++ * Register the callback for when we receive a ca info. ++ * ++ * @param ca ca resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_ca_register_info_callback(struct en50221_app_ca *ca, ++ en50221_app_ca_info_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a pmt_reply. ++ * ++ * @param ca ca resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_ca_register_pmt_reply_callback(struct en50221_app_ca *ca, ++ en50221_app_ca_pmt_reply_callback callback, ++ void *arg); ++ ++/** ++ * Send a ca_info_req to the CAM. ++ * ++ * @param ca ca resource instance. ++ * @param session_number Session number to send it on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ca_info_enq(struct en50221_app_ca *ca, ++ uint16_t session_number); ++ ++/** ++ * Send a ca_pmt structure to the CAM. ++ * ++ * @param ca ca resource instance. ++ * @param session_number Session number to send it on. ++ * @param ca_pmt A ca_pmt structure formatted with the en50221_ca_format_pmt() function. ++ * @param ca_pmt_length Length of ca_pmt structure in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ca_pmt(struct en50221_app_ca *ca, ++ uint16_t session_number, ++ uint8_t * ca_pmt, ++ uint32_t ca_pmt_length); ++ ++/** ++ * Transform a libucsi PMT into a binary structure for sending to a CAM. ++ * ++ * @param pmt The source PMT structure. ++ * @param data Pointer to data buffer to write it to. ++ * @param data_length Number of bytes available in data buffer. ++ * @param move_ca_descriptors If non-zero, will attempt to move CA descriptors ++ * in order to reduce the size of the formatted CAPMT. ++ * @param ca_pmt_list_management One of the CA_LIST_MANAGEMENT_*. ++ * @param ca_pmt_cmd_id One of the CA_PMT_CMD_ID_*. ++ * @return Number of bytes used, or -1 on error. ++ */ ++extern int en50221_ca_format_pmt(struct mpeg_pmt_section *pmt, ++ uint8_t * data, ++ uint32_t data_length, ++ int move_ca_descriptors, ++ uint8_t ca_pmt_list_management, ++ uint8_t ca_pmt_cmd_id); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param ca CA instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_ca_message(struct en50221_app_ca *ca, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++ ++ ++ ++static inline struct en50221_app_pmt_stream * ++ en50221_app_pmt_reply_streams_first(struct en50221_app_pmt_reply *reply, ++ uint32_t reply_size) ++{ ++ uint32_t pos = sizeof(struct en50221_app_pmt_reply); ++ ++ if (pos >= reply_size) ++ return NULL; ++ ++ return (struct en50221_app_pmt_stream *) ((uint8_t *) reply + pos); ++} ++ ++static inline struct en50221_app_pmt_stream * ++ en50221_app_pmt_reply_streams_next(struct en50221_app_pmt_reply *reply, ++ struct en50221_app_pmt_stream *pos, ++ uint32_t reply_size) ++{ ++ uint8_t *end = (uint8_t *) reply + reply_size; ++ uint8_t *next = ++ (uint8_t *) pos + ++ sizeof(struct en50221_app_pmt_stream); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct en50221_app_pmt_stream *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_datetime.c dvb-apps/lib/libdvben50221/en50221_app_datetime.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_datetime.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_datetime.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,173 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "en50221_app_datetime.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_datetime { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_datetime_enquiry_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_datetime_parse_enquiry(struct en50221_app_datetime *datetime, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_datetime *en50221_app_datetime_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_datetime *datetime = NULL; ++ ++ // create structure and set it up ++ datetime = malloc(sizeof(struct en50221_app_datetime)); ++ if (datetime == NULL) { ++ return NULL; ++ } ++ datetime->funcs = funcs; ++ datetime->callback = NULL; ++ ++ pthread_mutex_init(&datetime->lock, NULL); ++ ++ // done ++ return datetime; ++} ++ ++void en50221_app_datetime_destroy(struct en50221_app_datetime *datetime) ++{ ++ pthread_mutex_destroy(&datetime->lock); ++ free(datetime); ++} ++ ++void en50221_app_datetime_register_enquiry_callback(struct en50221_app_datetime *datetime, ++ en50221_app_datetime_enquiry_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&datetime->lock); ++ datetime->callback = callback; ++ datetime->callback_arg = arg; ++ pthread_mutex_unlock(&datetime->lock); ++} ++ ++int en50221_app_datetime_send(struct en50221_app_datetime *datetime, ++ uint16_t session_number, ++ time_t utc_time, int time_offset) ++{ ++ uint8_t data[11]; ++ int data_length; ++ ++ data[0] = (TAG_DATE_TIME >> 16) & 0xFF; ++ data[1] = (TAG_DATE_TIME >> 8) & 0xFF; ++ data[2] = TAG_DATE_TIME & 0xFF; ++ if (time_offset != -1) { ++ data[3] = 7; ++ unixtime_to_dvbdate(utc_time, data + 4); ++ data[9] = time_offset >> 8; ++ data[10] = time_offset; ++ data_length = 11; ++ } else { ++ data[3] = 5; ++ unixtime_to_dvbdate(utc_time, data + 4); ++ data_length = 9; ++ } ++ return datetime->funcs->send_data(datetime->funcs->arg, ++ session_number, data, ++ data_length); ++} ++ ++int en50221_app_datetime_message(struct en50221_app_datetime *datetime, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_DATE_TIME_ENQUIRY: ++ return en50221_app_datetime_parse_enquiry(datetime, ++ slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++static int en50221_app_datetime_parse_enquiry(struct en50221_app_datetime *datetime, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t response_interval = data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&datetime->lock); ++ en50221_app_datetime_enquiry_callback cb = datetime->callback; ++ void *cb_arg = datetime->callback_arg; ++ pthread_mutex_unlock(&datetime->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ response_interval); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_datetime.h dvb-apps/lib/libdvben50221/en50221_app_datetime.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_datetime.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_datetime.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,119 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_DATETIME_H__ ++#define __EN50221_APPLICATION_DATETIME_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_DATETIME_RESOURCEID MKRID(36,1,1) ++ ++/** ++ * Type definition for enquiry - called when we receive a date/time enquiry from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param response_interval Response interval requested by CAM. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_datetime_enquiry_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t response_interval); ++ ++/** ++ * Opaque type representing a datetime resource. ++ */ ++struct en50221_app_datetime; ++ ++/** ++ * Create an instance of the datetime resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_datetime ++ *en50221_app_datetime_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the datetime resource. ++ * ++ * @param datetime Instance to destroy. ++ */ ++extern void en50221_app_datetime_destroy(struct en50221_app_datetime *datetime); ++ ++/** ++ * Register the callback for when we receive a enquiry request. ++ * ++ * @param datetime datetime resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_datetime_register_enquiry_callback(struct en50221_app_datetime *datetime, ++ en50221_app_datetime_enquiry_callback callback, ++ void *arg); ++ ++/** ++ * Send the time to the CAM. ++ * ++ * @param datetime datetime resource instance. ++ * @param session_number Session number to send it on. ++ * @param utc_time UTC time in unix time format. ++ * @param time_offset If -1, the field will not be transmitted, otherwise it is the offset between ++ * UTC and local time in minutes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_datetime_send(struct en50221_app_datetime *datetime, ++ uint16_t session_number, ++ time_t utc_time, ++ int time_offset); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param datetime datetime instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_datetime_message(struct en50221_app_datetime *datetime, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_dvb.c dvb-apps/lib/libdvben50221/en50221_app_dvb.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_dvb.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_dvb.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,282 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_dvb.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_dvb { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_dvb_tune_callback tune_callback; ++ void *tune_callback_arg; ++ ++ en50221_app_dvb_replace_callback replace_callback; ++ void *replace_callback_arg; ++ ++ en50221_app_dvb_clear_replace_callback clear_replace_callback; ++ void *clear_replace_callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_dvb_parse_tune(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++static int en50221_app_dvb_parse_replace(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++static int en50221_app_dvb_parse_clear_replace(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_dvb *en50221_app_dvb_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_dvb *dvb = NULL; ++ ++ // create structure and set it up ++ dvb = malloc(sizeof(struct en50221_app_dvb)); ++ if (dvb == NULL) { ++ return NULL; ++ } ++ dvb->funcs = funcs; ++ dvb->tune_callback = NULL; ++ dvb->replace_callback = NULL; ++ dvb->clear_replace_callback = NULL; ++ ++ pthread_mutex_init(&dvb->lock, NULL); ++ ++ // done ++ return dvb; ++} ++ ++void en50221_app_dvb_destroy(struct en50221_app_dvb *dvb) ++{ ++ pthread_mutex_destroy(&dvb->lock); ++ free(dvb); ++} ++ ++void en50221_app_dvb_register_tune_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_tune_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&dvb->lock); ++ dvb->tune_callback = callback; ++ dvb->tune_callback_arg = arg; ++ pthread_mutex_unlock(&dvb->lock); ++} ++ ++void en50221_app_dvb_register_replace_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_replace_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&dvb->lock); ++ dvb->replace_callback = callback; ++ dvb->replace_callback_arg = arg; ++ pthread_mutex_unlock(&dvb->lock); ++} ++ ++void en50221_app_dvb_register_clear_replace_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_clear_replace_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&dvb->lock); ++ dvb->clear_replace_callback = callback; ++ dvb->clear_replace_callback_arg = arg; ++ pthread_mutex_unlock(&dvb->lock); ++} ++ ++int en50221_app_dvb_ask_release(struct en50221_app_dvb *dvb, ++ uint16_t session_number) ++{ ++ uint8_t data[4]; ++ ++ data[0] = (TAG_ASK_RELEASE >> 16) & 0xFF; ++ data[1] = (TAG_ASK_RELEASE >> 8) & 0xFF; ++ data[2] = TAG_ASK_RELEASE & 0xFF; ++ data[3] = 0; ++ ++ return dvb->funcs->send_data(dvb->funcs->arg, session_number, data, 4); ++} ++ ++int en50221_app_dvb_message(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_TUNE: ++ return en50221_app_dvb_parse_tune(dvb, slot_id, ++ session_number, data + 3, ++ data_length - 3); ++ case TAG_REPLACE: ++ return en50221_app_dvb_parse_replace(dvb, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_CLEAR_REPLACE: ++ return en50221_app_dvb_parse_clear_replace(dvb, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++static int en50221_app_dvb_parse_tune(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length) ++{ ++ // validate data ++ if (data_length < 9) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 8) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *tune_data = data + 1; ++ ++ // parse it ++ uint16_t network_id = (tune_data[0] << 8) | tune_data[1]; ++ uint16_t original_network_id = (tune_data[2] << 8) | tune_data[3]; ++ uint16_t transport_stream_id = (tune_data[4] << 8) | tune_data[5]; ++ uint16_t service_id = (tune_data[6] << 8) | tune_data[7]; ++ ++ // tell the app ++ pthread_mutex_lock(&dvb->lock); ++ en50221_app_dvb_tune_callback cb = dvb->tune_callback; ++ void *cb_arg = dvb->tune_callback_arg; ++ pthread_mutex_unlock(&dvb->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, network_id, ++ original_network_id, transport_stream_id, ++ service_id); ++ } ++ return 0; ++} ++ ++static int en50221_app_dvb_parse_replace(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length < 6) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 5) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *replace_data = data + 1; ++ ++ // parse it ++ uint8_t replacement_ref = replace_data[0]; ++ uint16_t replace_pid = ++ ((replace_data[1] & 0x1f) << 8) | replace_data[2]; ++ uint16_t replacement_pid = ++ ((replace_data[3] & 0x1f) << 8) | replace_data[4]; ++ ++ // tell the app ++ pthread_mutex_lock(&dvb->lock); ++ en50221_app_dvb_replace_callback cb = dvb->replace_callback; ++ void *cb_arg = dvb->replace_callback_arg; ++ pthread_mutex_unlock(&dvb->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, replacement_ref, ++ replace_pid, replacement_pid); ++ } ++ return 0; ++} ++ ++static int en50221_app_dvb_parse_clear_replace(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *replace_data = data + 1; ++ ++ // parse it ++ uint8_t replacement_ref = replace_data[0]; ++ ++ // tell the app ++ pthread_mutex_lock(&dvb->lock); ++ en50221_app_dvb_clear_replace_callback cb = ++ dvb->clear_replace_callback; ++ void *cb_arg = dvb->clear_replace_callback_arg; ++ pthread_mutex_unlock(&dvb->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ replacement_ref); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_dvb.h dvb-apps/lib/libdvben50221/en50221_app_dvb.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_dvb.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_dvb.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,176 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_DVB_H__ ++#define __EN50221_APPLICATION_DVB_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_DVB_RESOURCEID MKRID(32,1,1) ++ ++ ++/** ++ * Type definition for tune - called when we receive a tune request from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param network_id Network id requested by CAM. ++ * @param original_network_id Original Network id requested by CAM. ++ * @param transport_stream_id Transport stream id requested by CAM. ++ * @param service_id Service id requested by CAM. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_dvb_tune_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint16_t network_id, ++ uint32_t original_network_id, ++ uint16_t transport_stream_id, ++ uint16_t service_id); ++ ++/** ++ * Type definition for replace - called when we receive a replace request from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param replacement_ref Replacement ref. ++ * @param replaced_pid PID to replace. ++ * @param replacement_pid PID to replace it with. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_dvb_replace_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t replacement_ref, ++ uint16_t replaced_pid, ++ uint16_t replacement_pid); ++ ++ ++/** ++ * Type definition for clear_replace - called when we receive a clear_replace request from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param replacement_ref Replacement ref. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_dvb_clear_replace_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t replacement_ref); ++ ++ ++/** ++ * Opaque type representing a dvb resource. ++ */ ++struct en50221_app_dvb; ++ ++/** ++ * Create an instance of the dvb resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_dvb *en50221_app_dvb_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the dvb resource. ++ * ++ * @param dvb Instance to destroy. ++ */ ++extern void en50221_app_dvb_destroy(struct en50221_app_dvb *dvb); ++ ++/** ++ * Register the callback for when we receive a tune request. ++ * ++ * @param dvb DVB resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_dvb_register_tune_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_tune_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a replace request. ++ * ++ * @param dvb DVB resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_dvb_register_replace_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_replace_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a clear replace request. ++ * ++ * @param dvb DVB resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_dvb_register_clear_replace_callback(struct en50221_app_dvb *dvb, ++ en50221_app_dvb_clear_replace_callback callback, ++ void *arg); ++ ++/** ++ * Send an ask release request to the CAM. ++ * ++ * @param dvb DVB resource instance. ++ * @param session_number Session number to send it on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_dvb_ask_release(struct en50221_app_dvb *dvb, ++ uint16_t session_number); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param dvb dvb instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_dvb_message(struct en50221_app_dvb *dvb, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_epg.c dvb-apps/lib/libdvben50221/en50221_app_epg.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_epg.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_epg.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,167 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "en50221_app_epg.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_epg { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_epg_reply_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_epg_parse_reply(struct en50221_app_epg *private, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_epg *en50221_app_epg_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_epg *epg = NULL; ++ ++ // create structure and set it up ++ epg = malloc(sizeof(struct en50221_app_epg)); ++ if (epg == NULL) { ++ return NULL; ++ } ++ epg->funcs = funcs; ++ epg->callback = NULL; ++ ++ pthread_mutex_init(&epg->lock, NULL); ++ ++ // done ++ return epg; ++} ++ ++void en50221_app_epg_destroy(struct en50221_app_epg *epg) ++{ ++ pthread_mutex_destroy(&epg->lock); ++ free(epg); ++} ++ ++void en50221_app_epg_register_enquiry_callback(struct en50221_app_epg *epg, ++ en50221_app_epg_reply_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&epg->lock); ++ epg->callback = callback; ++ epg->callback_arg = arg; ++ pthread_mutex_unlock(&epg->lock); ++} ++ ++int en50221_app_epg_enquire(struct en50221_app_epg *epg, ++ uint16_t session_number, ++ uint8_t command_id, ++ uint16_t network_id, ++ uint16_t original_network_id, ++ uint16_t transport_stream_id, ++ uint16_t service_id, uint16_t event_id) ++{ ++ uint8_t data[15]; ++ ++ data[0] = (TAG_EPG_ENQUIRY >> 16) & 0xFF; ++ data[1] = (TAG_EPG_ENQUIRY >> 8) & 0xFF; ++ data[2] = TAG_EPG_ENQUIRY & 0xFF; ++ data[3] = 11; ++ data[4] = command_id; ++ data[5] = network_id >> 8; ++ data[6] = network_id; ++ data[7] = original_network_id >> 8; ++ data[8] = original_network_id; ++ data[9] = transport_stream_id >> 8; ++ data[10] = transport_stream_id; ++ data[11] = service_id >> 8; ++ data[12] = service_id; ++ data[13] = event_id >> 8; ++ data[14] = event_id; ++ return epg->funcs->send_data(epg->funcs->arg, session_number, data, 15); ++} ++ ++int en50221_app_epg_message(struct en50221_app_epg *epg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ struct en50221_app_epg *private = (struct en50221_app_epg *) epg; ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_EPG_REPLY: ++ return en50221_app_epg_parse_reply(private, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++static int en50221_app_epg_parse_reply(struct en50221_app_epg *epg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t event_status = data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&epg->lock); ++ en50221_app_epg_reply_callback cb = epg->callback; ++ void *cb_arg = epg->callback_arg; ++ pthread_mutex_unlock(&epg->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, event_status); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_epg.h dvb-apps/lib/libdvben50221/en50221_app_epg.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_epg.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_epg.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,138 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_epg_H__ ++#define __EN50221_APPLICATION_epg_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EPG_COMMAND_ID_MMI 0x02 ++#define EPG_COMMAND_ID_QUERY 0x03 ++ ++#define EPG_EVENTSTATUS_ENTITLEMENT_UNKNOWN 0x00 ++#define EPG_EVENTSTATUS_ENTITLEMENT_AVAILABLE 0x01 ++#define EPG_EVENTSTATUS_ENTITLEMENT_NOT_AVAILABLE 0x02 ++#define EPG_EVENTSTATUS_MMI_DIALOGUE_REQUIRED 0x03 ++#define EPG_EVENTSTATUS_MMI_COMPLETE_UNKNOWN 0x04 ++#define EPG_EVENTSTATUS_MMI_COMPLETE_AVAILABLE 0x05 ++#define EPG_EVENTSTATUS_MMI_COMPLETE_NOT_AVAILABLE 0x06 ++ ++#define EN50221_APP_EPG_RESOURCEID(INSTANCE_NUM) MKRID(120,(INSTANCE_NUM),1) ++ ++ ++ ++/** ++ * Type definition for reply - called when we receive an EPG reply from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param event_status One of the EPG_EVENTSTATUS_* values. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_epg_reply_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t event_status); ++ ++/** ++ * Opaque type representing a epg resource. ++ */ ++struct en50221_app_epg; ++ ++/** ++ * Create an instance of the epg resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_epg *en50221_app_epg_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the epg resource. ++ * ++ * @param epg Instance to destroy. ++ */ ++extern void en50221_app_epg_destroy(struct en50221_app_epg *epg); ++ ++/** ++ * Register the callback for when we receive a enquiry response. ++ * ++ * @param epg epg resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_epg_register_reply_callback(struct en50221_app_epg *epg, ++ en50221_app_epg_reply_callback callback, ++ void *arg); ++ ++/** ++ * Enquire about the entitlement status for an EPG entry. ++ * ++ * @param epg epg resource instance. ++ * @param session_number Session number to send it on. ++ * @param command_id One of the EPG_COMMAND_ID_* fields. ++ * @param network_id Network ID concerned. ++ * @param original_network_id Original network ID concerned. ++ * @param transport_stream_id Transport stream ID concerned. ++ * @param service_id Service ID concerned. ++ * @param event_id Event ID concerned. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_epg_enquire(struct en50221_app_epg *epg, ++ uint16_t session_number, ++ uint8_t command_id, ++ uint16_t network_id, ++ uint16_t original_network_id, ++ uint16_t transport_stream_id, ++ uint16_t service_id, ++ uint16_t event_id); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param epg epg instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_epg_message(struct en50221_app_epg *epg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_lowspeed.c dvb-apps/lib/libdvben50221/en50221_app_lowspeed.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_lowspeed.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_lowspeed.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,533 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_lowspeed.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_lowspeed_session { ++ uint16_t session_number; ++ uint8_t *block_chain; ++ uint32_t block_length; ++ ++ struct en50221_app_lowspeed_session *next; ++}; ++ ++struct en50221_app_lowspeed { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_lowspeed_command_callback command_callback; ++ void *command_callback_arg; ++ ++ en50221_app_lowspeed_send_callback send_callback; ++ void *send_callback_arg; ++ ++ struct en50221_app_lowspeed_session *sessions; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_lowspeed_parse_connect_on_channel(struct en50221_app_lowspeed_command *command, ++ uint8_t *data, ++ int data_length); ++static int en50221_app_lowspeed_parse_command(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length); ++static int en50221_app_lowspeed_parse_send(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ int more_last, ++ uint8_t *data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_lowspeed *en50221_app_lowspeed_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_lowspeed *lowspeed = NULL; ++ ++ // create structure and set it up ++ lowspeed = malloc(sizeof(struct en50221_app_lowspeed)); ++ if (lowspeed == NULL) { ++ return NULL; ++ } ++ lowspeed->funcs = funcs; ++ lowspeed->command_callback = NULL; ++ lowspeed->send_callback = NULL; ++ lowspeed->sessions = NULL; ++ ++ pthread_mutex_init(&lowspeed->lock, NULL); ++ ++ // done ++ return lowspeed; ++} ++ ++void en50221_app_lowspeed_destroy(struct en50221_app_lowspeed *lowspeed) ++{ ++ struct en50221_app_lowspeed_session *cur_s = lowspeed->sessions; ++ while (cur_s) { ++ struct en50221_app_lowspeed_session *next = cur_s->next; ++ if (cur_s->block_chain) ++ free(cur_s->block_chain); ++ free(cur_s); ++ cur_s = next; ++ } ++ ++ pthread_mutex_destroy(&lowspeed->lock); ++ free(lowspeed); ++} ++ ++void en50221_app_lowspeed_clear_session(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number) ++{ ++ pthread_mutex_lock(&lowspeed->lock); ++ struct en50221_app_lowspeed_session *cur_s = lowspeed->sessions; ++ struct en50221_app_lowspeed_session *prev_s = NULL; ++ while (cur_s) { ++ if (cur_s->session_number == session_number) { ++ if (cur_s->block_chain) ++ free(cur_s->block_chain); ++ if (prev_s) { ++ prev_s->next = cur_s->next; ++ } else { ++ lowspeed->sessions = cur_s->next; ++ } ++ free(cur_s); ++ return; ++ } ++ ++ prev_s = cur_s; ++ cur_s = cur_s->next; ++ } ++ pthread_mutex_unlock(&lowspeed->lock); ++} ++ ++void en50221_app_lowspeed_register_command_callback(struct en50221_app_lowspeed *lowspeed, ++ en50221_app_lowspeed_command_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&lowspeed->lock); ++ lowspeed->command_callback = callback; ++ lowspeed->command_callback_arg = arg; ++ pthread_mutex_unlock(&lowspeed->lock); ++} ++ ++void en50221_app_lowspeed_register_send_callback(struct en50221_app_lowspeed *lowspeed, ++ en50221_app_lowspeed_send_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&lowspeed->lock); ++ lowspeed->send_callback = callback; ++ lowspeed->send_callback_arg = arg; ++ pthread_mutex_unlock(&lowspeed->lock); ++} ++ ++int en50221_app_lowspeed_send_comms_reply(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number, ++ uint8_t comms_reply_id, ++ uint8_t return_value) ++{ ++ uint8_t data[6]; ++ ++ data[0] = (TAG_COMMS_REPLY >> 16) & 0xFF; ++ data[1] = (TAG_COMMS_REPLY >> 8) & 0xFF; ++ data[2] = TAG_COMMS_REPLY & 0xFF; ++ data[3] = 2; ++ data[4] = comms_reply_id; ++ data[5] = return_value; ++ return lowspeed->funcs->send_data(lowspeed->funcs->arg, ++ session_number, data, 6); ++} ++ ++int en50221_app_lowspeed_send_comms_data(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number, ++ uint8_t phase_id, ++ uint32_t tx_data_length, ++ uint8_t * tx_data) ++{ ++ uint8_t buf[10]; ++ ++ // the spec defines this limit ++ if (tx_data_length > 254) { ++ return -1; ++ } ++ // set up the tag ++ buf[0] = (TAG_COMMS_RECV_LAST >> 16) & 0xFF; ++ buf[1] = (TAG_COMMS_RECV_LAST >> 8) & 0xFF; ++ buf[2] = TAG_COMMS_RECV_LAST & 0xFF; ++ ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(tx_data_length + 1, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ // the phase_id ++ buf[3 + length_field_len] = phase_id; ++ ++ // build the iovecs ++ struct iovec iov[2]; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len + 1; ++ iov[1].iov_base = tx_data; ++ iov[1].iov_len = tx_data_length; ++ ++ // create the data and send it ++ return lowspeed->funcs->send_datav(lowspeed->funcs->arg, ++ session_number, iov, 2); ++} ++ ++int en50221_app_lowspeed_message(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_COMMS_COMMAND: ++ return en50221_app_lowspeed_parse_command(lowspeed, ++ slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_COMMS_SEND_LAST: ++ return en50221_app_lowspeed_parse_send(lowspeed, slot_id, ++ session_number, 1, ++ data + 3, ++ data_length - 3); ++ case TAG_COMMS_SEND_MORE: ++ return en50221_app_lowspeed_parse_send(lowspeed, slot_id, ++ session_number, 0, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++static int en50221_app_lowspeed_parse_connect_on_channel(struct en50221_app_lowspeed_command *command, ++ uint8_t *data, ++ int data_length) ++{ ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // check the tag ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ if (tag != TAG_CONNECTION_DESCRIPTOR) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received bad CONNECT_ON_CHANNEL\n"); ++ return -1; ++ } ++ data += 3; ++ data_length -= 3; ++ ++ // parse the descriptor-length-field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ data += length_field_len; ++ data_length -= length_field_len; ++ ++ // check length field ++ if (asn_data_length > data_length) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length < 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // get the descriptor type ++ command->u.connect_on_channel.descriptor_type = data[0]; ++ data++; ++ data_length--; ++ asn_data_length--; ++ ++ // deal with the descriptor itself ++ switch (command->u.connect_on_channel.descriptor_type) { ++ case CONNECTION_DESCRIPTOR_TYPE_TELEPHONE: ++ { ++ // get the raw descriptor and validate length ++ struct descriptor *d = (struct descriptor *) data; ++ if (asn_data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length != (2 + d->len)) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ if (d->tag != dtag_dvb_telephone) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received invalid telephone descriptor\n"); ++ return -1; ++ } ++ // parse the telephone descriptor ++ command->u.connect_on_channel.descriptor.telephone = dvb_telephone_descriptor_codec(d); ++ if (command->u.connect_on_channel.descriptor.telephone == NULL) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received invalid telephone descriptor\n"); ++ return -1; ++ } ++ data += 2 + d->len; ++ data_length -= 2 + d->len; ++ break; ++ } ++ ++ case CONNECTION_DESCRIPTOR_TYPE_CABLE: ++ if (asn_data_length != 1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ command->u.connect_on_channel.descriptor.cable_channel_id = data[0]; ++ data++; ++ data_length--; ++ break; ++ default: ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unknown connection descriptor %02x\n", ++ command->u.connect_on_channel.descriptor_type); ++ return -1; ++ } ++ ++ // parse the last bit ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ command->u.connect_on_channel.retry_count = data[0]; ++ command->u.connect_on_channel.timeout = data[1]; ++ ++ // ok ++ return 0; ++} ++ ++static int en50221_app_lowspeed_parse_command(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length < 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ data += length_field_len; ++ ++ // get command id ++ uint8_t command_id = data[0]; ++ data++; ++ asn_data_length--; ++ ++ // parse the command ++ struct en50221_app_lowspeed_command command; ++ switch (command_id) { ++ case COMMS_COMMAND_ID_CONNECT_ON_CHANNEL: ++ if (en50221_app_lowspeed_parse_connect_on_channel ++ (&command, data, asn_data_length)) { ++ return -1; ++ } ++ break; ++ case COMMS_COMMAND_ID_SET_PARAMS: ++ if (asn_data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ command.u.set_params.buffer_size = data[0]; ++ command.u.set_params.timeout = data[1]; ++ break; ++ case COMMS_COMMAND_ID_GET_NEXT_BUFFER: ++ if (asn_data_length != 1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ command.u.get_next_buffer.phase_id = data[0]; ++ break; ++ ++ case COMMS_COMMAND_ID_DISCONNECT_ON_CHANNEL: ++ case COMMS_COMMAND_ID_ENQUIRE_STATUS: ++ break; ++ ++ default: ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected command_id %02x\n", command_id); ++ return -1; ++ } ++ ++ // tell the app ++ pthread_mutex_lock(&lowspeed->lock); ++ en50221_app_lowspeed_command_callback cb = lowspeed->command_callback; ++ void *cb_arg = lowspeed->command_callback_arg; ++ pthread_mutex_unlock(&lowspeed->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, command_id, ++ &command); ++ } ++ return 0; ++} ++ ++static int en50221_app_lowspeed_parse_send(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ int more_last, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // skip over the length field ++ data += length_field_len; ++ ++ // find previous session ++ pthread_mutex_lock(&lowspeed->lock); ++ struct en50221_app_lowspeed_session *cur_s = lowspeed->sessions; ++ while (cur_s) { ++ if (cur_s->session_number == session_number) ++ break; ++ cur_s = cur_s->next; ++ } ++ ++ // more data is still to come ++ if (!more_last) { ++ // if there was no previous session, create one ++ if (cur_s == NULL) { ++ cur_s = malloc(sizeof(struct en50221_app_lowspeed_session)); ++ if (cur_s == NULL) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Ran out of memory\n"); ++ pthread_mutex_unlock(&lowspeed->lock); ++ return -1; ++ } ++ cur_s->session_number = session_number; ++ cur_s->block_chain = NULL; ++ cur_s->block_length = 0; ++ cur_s->next = lowspeed->sessions; ++ lowspeed->sessions = cur_s; ++ } ++ // append the data ++ uint8_t *new_data = realloc(cur_s->block_chain, ++ cur_s->block_length + asn_data_length); ++ if (new_data == NULL) { ++ print(LOG_LEVEL, ERROR, 1, "Ran out of memory\n"); ++ pthread_mutex_unlock(&lowspeed->lock); ++ return -1; ++ } ++ memcpy(new_data + cur_s->block_length, data, asn_data_length); ++ cur_s->block_chain = new_data; ++ cur_s->block_length += asn_data_length; ++ ++ // done ++ pthread_mutex_unlock(&lowspeed->lock); ++ return 0; ++ } ++ // we hit the last of a possible chain of fragments ++ int do_free = 0; ++ if (cur_s != NULL) { ++ // we have a preceding fragment - need to append ++ uint8_t *new_data = realloc(cur_s->block_chain, ++ cur_s->block_length + asn_data_length); ++ if (new_data == NULL) { ++ print(LOG_LEVEL, ERROR, 1, "Ran out of memory\n"); ++ pthread_mutex_unlock(&lowspeed->lock); ++ return -1; ++ } ++ memcpy(new_data + cur_s->block_length, data, asn_data_length); ++ asn_data_length = cur_s->block_length + asn_data_length; ++ data = new_data; ++ cur_s->block_chain = NULL; ++ cur_s->block_length = 0; ++ do_free = 1; ++ } ++ // check the reassembled data length ++ if (asn_data_length < 1) { ++ pthread_mutex_unlock(&lowspeed->lock); ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ if (do_free) ++ free(data); ++ return -1; ++ } ++ // now, parse the data ++ uint8_t phase_id = data[0]; ++ ++ // tell the app ++ en50221_app_lowspeed_send_callback cb = lowspeed->send_callback; ++ void *cb_arg = lowspeed->send_callback_arg; ++ pthread_mutex_unlock(&lowspeed->lock); ++ int cbstatus = 0; ++ if (cb) { ++ cbstatus = ++ cb(cb_arg, slot_id, session_number, phase_id, data + 1, asn_data_length - 1); ++ } ++ // done ++ if (do_free) ++ free(data); ++ return cbstatus; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_lowspeed.h dvb-apps/lib/libdvben50221/en50221_app_lowspeed.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_lowspeed.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_lowspeed.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,219 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_LOWSPEED_H__ ++#define __EN50221_APPLICATION_LOWSPEED_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++#include ++ ++#define COMMS_COMMAND_ID_CONNECT_ON_CHANNEL 0x01 ++#define COMMS_COMMAND_ID_DISCONNECT_ON_CHANNEL 0x02 ++#define COMMS_COMMAND_ID_SET_PARAMS 0x03 ++#define COMMS_COMMAND_ID_ENQUIRE_STATUS 0x04 ++#define COMMS_COMMAND_ID_GET_NEXT_BUFFER 0x05 ++ ++#define CONNECTION_DESCRIPTOR_TYPE_TELEPHONE 0x01 ++#define CONNECTION_DESCRIPTOR_TYPE_CABLE 0x02 ++ ++#define COMMS_REPLY_ID_CONNECT_ACK 0x01 ++#define COMMS_REPLY_ID_DISCONNECT_ACK 0x02 ++#define COMMS_REPLY_ID_SET_PARAMS_ACK 0x03 ++#define COMMS_REPLY_ID_STATUS_REPLY 0x04 ++#define COMMS_REPLY_ID_GET_NEXT_BUFFER_ACK 0x05 ++#define COMMS_REPLY_ID_SEND_ACK 0x06 ++ ++#define EN50221_APP_LOWSPEED_RESOURCEID(DEVICE_TYPE, DEVICE_NUMBER) MKRID(96,((DEVICE_TYPE)<<2)|((DEVICE_NUMBER) & 0x03),1) ++ ++ ++/** ++ * Structure holding information on a received comms command. ++ */ ++struct en50221_app_lowspeed_command { ++ union { ++ struct { ++ uint8_t descriptor_type; // CONNECTION_DESCRIPTOR_TYPE_* ++ uint8_t retry_count; ++ uint8_t timeout; ++ union { ++ struct dvb_telephone_descriptor *telephone; ++ uint8_t cable_channel_id; ++ } descriptor; ++ } connect_on_channel; ++ ++ struct { ++ uint8_t buffer_size; ++ uint8_t timeout; ++ } set_params; ++ ++ struct { ++ uint8_t phase_id; ++ } get_next_buffer; ++ } u; ++}; ++ ++/** ++ * Type definition for command - called when we receive a comms command. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param command_id One of the COMMS_COMMAND_ID_* values ++ * @param command Pointer to a lowspeed command structure containing the command data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_lowspeed_command_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t command_id, ++ struct en50221_app_lowspeed_command *command); ++ ++/** ++ * Type definition for send - called when we receive data to send. The block can be segmented into ++ * multiple pieces - last_more indicates the details of this. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param phase_id Comms phase id. ++ * @param data The data. ++ * @param length Number of bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_lowspeed_send_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t phase_id, ++ uint8_t *data, ++ uint32_t length); ++ ++/** ++ * Opaque type representing a lowspeed resource. ++ */ ++struct en50221_app_lowspeed; ++ ++/** ++ * Create an instance of the lowspeed resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_lowspeed * ++ en50221_app_lowspeed_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the lowspeed resource. ++ * ++ * @param lowspeed Instance to destroy. ++ */ ++extern void en50221_app_lowspeed_destroy(struct en50221_app_lowspeed *lowspeed); ++ ++/** ++ * Informs the lowspeed object that a session to it has been closed - cleans up internal state. ++ * ++ * @param lowspeed lowspeed resource instance. ++ * @param session_number The session concerned. ++ */ ++extern void en50221_app_lowspeed_clear_session(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number); ++ ++/** ++ * Register the callback for when we receive a comms command. ++ * ++ * @param lowspeed lowspeed resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_lowspeed_register_command_callback(struct en50221_app_lowspeed *lowspeed, ++ en50221_app_lowspeed_command_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive data to send. ++ * ++ * @param lowspeed lowspeed resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_lowspeed_register_send_callback(struct en50221_app_lowspeed *lowspeed, ++ en50221_app_lowspeed_send_callback callback, ++ void *arg); ++ ++/** ++ * Send a comms reply to the CAM. ++ * ++ * @param lowspeed lowspeed resource instance. ++ * @param session_number Session number to send it on. ++ * @param comms_reply_id One of the COMMS_REPLY_ID_* values. ++ * @param return_value Comms reply specific value. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_lowspeed_send_comms_reply(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number, ++ uint8_t comms_reply_id, ++ uint8_t return_value); ++ ++/** ++ * Send received data to the CAM. ++ * ++ * @param lowspeed lowspeed resource instance. ++ * @param session_number Session number to send it on. ++ * @param phase_id Comms phase id. ++ * @param tx_data_length Length of data in bytes (max 254 bytes as per spec). ++ * @param tx_data Data. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_lowspeed_send_comms_data(struct en50221_app_lowspeed *lowspeed, ++ uint16_t session_number, ++ uint8_t phase_id, ++ uint32_t tx_data_length, ++ uint8_t * tx_data); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param lowspeed lowspeed instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_lowspeed_message(struct en50221_app_lowspeed *lowspeed, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_mmi.c dvb-apps/lib/libdvben50221/en50221_app_mmi.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_mmi.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_mmi.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,1397 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "en50221_app_mmi.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_mmi_session { ++ uint16_t session_number; ++ ++ uint8_t *menu_block_chain; ++ uint32_t menu_block_length; ++ ++ uint8_t *list_block_chain; ++ uint32_t list_block_length; ++ ++ uint8_t *subtitlesegment_block_chain; ++ uint32_t subtitlesegment_block_length; ++ ++ uint8_t *subtitledownload_block_chain; ++ uint32_t subtitledownload_block_length; ++ ++ struct en50221_app_mmi_session *next; ++}; ++ ++struct en50221_app_mmi { ++ struct en50221_app_send_functions *funcs; ++ struct en50221_app_mmi_session *sessions; ++ ++ en50221_app_mmi_close_callback closecallback; ++ void *closecallback_arg; ++ ++ en50221_app_mmi_display_control_callback displaycontrolcallback; ++ void *displaycontrolcallback_arg; ++ ++ en50221_app_mmi_keypad_control_callback keypadcontrolcallback; ++ void *keypadcontrolcallback_arg; ++ ++ en50221_app_mmi_subtitle_segment_callback subtitlesegmentcallback; ++ void *subtitlesegmentcallback_arg; ++ ++ en50221_app_mmi_scene_end_mark_callback sceneendmarkcallback; ++ void *sceneendmarkcallback_arg; ++ ++ en50221_app_mmi_scene_control_callback scenecontrolcallback; ++ void *scenecontrolcallback_arg; ++ ++ en50221_app_mmi_subtitle_download_callback subtitledownloadcallback; ++ void *subtitledownloadcallback_arg; ++ ++ en50221_app_mmi_flush_download_callback flushdownloadcallback; ++ void *flushdownloadcallback_arg; ++ ++ en50221_app_mmi_enq_callback enqcallback; ++ void *enqcallback_arg; ++ ++ en50221_app_mmi_menu_callback menucallback; ++ void *menucallback_arg; ++ ++ en50221_app_mmi_list_callback listcallback; ++ void *listcallback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_mmi_parse_close(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_display_control(struct en50221_app_mmi ++ *mmi, uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_keypad_control(struct en50221_app_mmi ++ *mmi, uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_enq(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length); ++static int en50221_app_mmi_parse_list_menu(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_subtitle(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_scene_end_mark(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_scene_control(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_subtitle(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_parse_flush_download(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_mmi_defragment(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * indata, ++ uint32_t indata_length, ++ uint8_t ** outdata, ++ uint32_t * outdata_length); ++static int en50221_app_mmi_defragment_text(uint8_t * data, ++ uint32_t data_length, ++ uint8_t ** outdata, ++ uint32_t * outdata_length, ++ uint32_t * outconsumed); ++ ++ ++ ++struct en50221_app_mmi *en50221_app_mmi_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_mmi *mmi = NULL; ++ ++ // create structure and set it up ++ mmi = malloc(sizeof(struct en50221_app_mmi)); ++ if (mmi == NULL) { ++ return NULL; ++ } ++ mmi->funcs = funcs; ++ mmi->closecallback = NULL; ++ mmi->displaycontrolcallback = NULL; ++ mmi->keypadcontrolcallback = NULL; ++ mmi->subtitlesegmentcallback = NULL; ++ mmi->sceneendmarkcallback = NULL; ++ mmi->scenecontrolcallback = NULL; ++ mmi->subtitledownloadcallback = NULL; ++ mmi->flushdownloadcallback = NULL; ++ mmi->enqcallback = NULL; ++ mmi->menucallback = NULL; ++ mmi->listcallback = NULL; ++ mmi->sessions = NULL; ++ ++ pthread_mutex_init(&mmi->lock, NULL); ++ ++ // done ++ return mmi; ++} ++ ++void en50221_app_mmi_destroy(struct en50221_app_mmi *mmi) ++{ ++ struct en50221_app_mmi_session *cur_s = mmi->sessions; ++ while (cur_s) { ++ struct en50221_app_mmi_session *next = cur_s->next; ++ if (cur_s->menu_block_chain) ++ free(cur_s->menu_block_chain); ++ if (cur_s->list_block_chain) ++ free(cur_s->list_block_chain); ++ if (cur_s->subtitlesegment_block_chain) ++ free(cur_s->subtitlesegment_block_chain); ++ if (cur_s->subtitledownload_block_chain) ++ free(cur_s->subtitledownload_block_chain); ++ free(cur_s); ++ cur_s = next; ++ } ++ ++ pthread_mutex_destroy(&mmi->lock); ++ free(mmi); ++} ++ ++void en50221_app_mmi_clear_session(struct en50221_app_mmi *mmi, ++ uint16_t session_number) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ struct en50221_app_mmi_session *cur_s = mmi->sessions; ++ struct en50221_app_mmi_session *prev_s = NULL; ++ while (cur_s) { ++ if (cur_s->session_number == session_number) { ++ if (cur_s->menu_block_chain) ++ free(cur_s->menu_block_chain); ++ if (cur_s->list_block_chain) ++ free(cur_s->list_block_chain); ++ if (cur_s->subtitlesegment_block_chain) ++ free(cur_s->subtitlesegment_block_chain); ++ if (cur_s->subtitledownload_block_chain) ++ free(cur_s->subtitledownload_block_chain); ++ if (prev_s) { ++ prev_s->next = cur_s->next; ++ } else { ++ mmi->sessions = cur_s->next; ++ } ++ free(cur_s); ++ return; ++ } ++ ++ prev_s = cur_s; ++ cur_s = cur_s->next; ++ } ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_close_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_close_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->closecallback = callback; ++ mmi->closecallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_display_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_display_control_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->displaycontrolcallback = callback; ++ mmi->displaycontrolcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_keypad_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_keypad_control_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->keypadcontrolcallback = callback; ++ mmi->keypadcontrolcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_subtitle_segment_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_subtitle_segment_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->subtitlesegmentcallback = callback; ++ mmi->subtitlesegmentcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_scene_end_mark_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_scene_end_mark_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->sceneendmarkcallback = callback; ++ mmi->sceneendmarkcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_scene_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_scene_control_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->scenecontrolcallback = callback; ++ mmi->scenecontrolcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_subtitle_download_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_subtitle_download_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->subtitledownloadcallback = callback; ++ mmi->subtitledownloadcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_flush_download_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_flush_download_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->flushdownloadcallback = callback; ++ mmi->flushdownloadcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_enq_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_enq_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->enqcallback = callback; ++ mmi->enqcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_menu_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_menu_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->menucallback = callback; ++ mmi->menucallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++void en50221_app_mmi_register_list_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_list_callback callback, ++ void *arg) ++{ ++ pthread_mutex_lock(&mmi->lock); ++ mmi->listcallback = callback; ++ mmi->listcallback_arg = arg; ++ pthread_mutex_unlock(&mmi->lock); ++} ++ ++int en50221_app_mmi_close(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t cmd_id, uint8_t delay) ++{ ++ uint8_t data[6]; ++ int data_length = 5; ++ ++ data[0] = (TAG_CLOSE_MMI >> 16) & 0xFF; ++ data[1] = (TAG_CLOSE_MMI >> 8) & 0xFF; ++ data[2] = TAG_CLOSE_MMI & 0xFF; ++ data[3] = 1; ++ data[4] = cmd_id; ++ if (cmd_id == MMI_CLOSE_MMI_CMD_ID_DELAY) { ++ data[3] = 2; ++ data[5] = delay; ++ data_length = 6; ++ } ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, ++ data_length); ++} ++ ++int en50221_app_mmi_display_reply(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t reply_id, ++ struct en50221_app_mmi_display_reply_details *details) ++{ ++ uint8_t data[32]; ++ struct iovec iov[2]; ++ uint32_t iov_count; ++ int length_field_len; ++ ++ // fill out the start of the header ++ data[0] = (TAG_DISPLAY_REPLY >> 16) & 0xFF; ++ data[1] = (TAG_DISPLAY_REPLY >> 8) & 0xFF; ++ data[2] = TAG_DISPLAY_REPLY & 0xFF; ++ ++ switch (reply_id) { ++ case MMI_DISPLAY_REPLY_ID_MMI_MODE_ACK: ++ data[3] = 2; ++ data[4] = reply_id; ++ data[5] = details->u.mode_ack.mmi_mode; ++ iov[0].iov_base = data; ++ iov[0].iov_len = 6; ++ iov_count = 1; ++ break; ++ ++ case MMI_DISPLAY_REPLY_ID_LIST_DISPLAY_CHAR_TABLES: ++ case MMI_DISPLAY_REPLY_ID_LIST_INPUT_CHAR_TABLES: ++ if ((length_field_len = ++ asn_1_encode(details->u.char_table.table_length + 1, data + 3, 3)) < 0) { ++ return -1; ++ } ++ data[3 + length_field_len] = reply_id; ++ iov[0].iov_base = data; ++ iov[0].iov_len = 3 + length_field_len + 1; ++ iov[1].iov_base = details->u.char_table.table; ++ iov[1].iov_len = details->u.char_table.table_length; ++ iov_count = 2; ++ break; ++ ++ case MMI_DISPLAY_REPLY_ID_LIST_OVERLAY_GFX_CHARACTERISTICS: ++ case MMI_DISPLAY_REPLY_ID_LIST_FULLSCREEN_GFX_CHARACTERISTICS: ++ { ++ if ((length_field_len = ++ asn_1_encode(1 + 9 + (details->u.gfx.num_pixel_depths * 2), data + 3, 3)) < 0) { ++ return -1; ++ } ++ data[3 + length_field_len] = reply_id; ++ data[3 + length_field_len + 1] = details->u.gfx.width >> 8; ++ data[3 + length_field_len + 2] = details->u.gfx.width; ++ data[3 + length_field_len + 3] = details->u.gfx.height >> 8; ++ data[3 + length_field_len + 4] = details->u.gfx.height; ++ data[3 + length_field_len + 5] = ++ ((details->u.gfx.aspect_ratio & 0x0f) << 4) | ++ ((details->u.gfx.gfx_relation_to_video & 0x07) << 1) | ++ (details->u.gfx.multiple_depths & 1); ++ data[3 + length_field_len + 6] = details->u.gfx.display_bytes >> 4; ++ data[3 + length_field_len + 7] = ++ ((details->u.gfx.display_bytes & 0x0f) << 4) | ++ ((details->u.gfx.composition_buffer_bytes & 0xf0) >> 4); ++ data[3 + length_field_len + 8] = ++ ((details->u.gfx.composition_buffer_bytes & 0x0f) << 4) | ++ ((details->u.gfx.object_cache_bytes & 0xf0) >> 4); ++ data[3 + length_field_len + 9] = ++ ((details->u.gfx.object_cache_bytes & 0x0f) << 4) | ++ (details->u.gfx.num_pixel_depths & 0x0f); ++ ++ // render the pixel depths themselves ++ uint8_t *pixdepths = ++ alloca(details->u.gfx.num_pixel_depths * 2); ++ if (pixdepths == NULL) { ++ return -1; ++ } ++ uint32_t i; ++ for (i = 0; i < details->u.gfx.num_pixel_depths; i++) { ++ pixdepths[0] = ++ ((details->u.gfx.pixel_depths[i].display_depth & 0x07) << 5) | ++ ((details->u.gfx.pixel_depths[i].pixels_per_byte & 0x07) << 2); ++ pixdepths[1] = ++ details->u.gfx.pixel_depths[i].region_overhead; ++ pixdepths += 2; ++ } ++ ++ // make up the iovs ++ iov[0].iov_base = data; ++ iov[0].iov_len = 3 + length_field_len + 10; ++ iov[1].iov_base = pixdepths; ++ iov[1].iov_len = ++ details->u.gfx.num_pixel_depths * 2; ++ iov_count = 2; ++ break; ++ } ++ ++ default: ++ data[3] = 1; ++ data[4] = reply_id; ++ iov[0].iov_base = data; ++ iov[0].iov_len = 5; ++ iov_count = 1; ++ break; ++ } ++ ++ // sendit ++ return mmi->funcs->send_datav(mmi->funcs->arg, session_number, iov, iov_count); ++} ++ ++int en50221_app_mmi_keypress(struct en50221_app_mmi *mmi, ++ uint16_t session_number, uint8_t keycode) ++{ ++ uint8_t data[5]; ++ ++ data[0] = (TAG_KEYPRESS >> 16) & 0xFF; ++ data[1] = (TAG_KEYPRESS >> 8) & 0xFF; ++ data[2] = TAG_KEYPRESS & 0xFF; ++ data[3] = 1; ++ data[4] = keycode; ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, 5); ++} ++ ++int en50221_app_mmi_display_message(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t display_message_id) ++{ ++ uint8_t data[5]; ++ ++ data[0] = (TAG_DISPLAY_MESSAGE >> 16) & 0xFF; ++ data[1] = (TAG_DISPLAY_MESSAGE >> 8) & 0xFF; ++ data[2] = TAG_DISPLAY_MESSAGE & 0xFF; ++ data[3] = 1; ++ data[4] = display_message_id; ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, 5); ++} ++ ++int en50221_app_mmi_scene_done(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t decoder_continue, ++ uint8_t scene_reveal, uint8_t scene_tag) ++{ ++ uint8_t data[5]; ++ ++ data[0] = (TAG_SCENE_DONE >> 16) & 0xFF; ++ data[1] = (TAG_SCENE_DONE >> 8) & 0xFF; ++ data[2] = TAG_SCENE_DONE & 0xFF; ++ data[3] = 1; ++ data[4] = ++ (decoder_continue ? 0x80 : 0x00) | ++ (scene_reveal ? 0x40 : 0x00) | ++ (scene_tag & 0x0f); ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, 5); ++} ++ ++int en50221_app_mmi_download_reply(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint16_t object_id, ++ uint8_t download_reply_id) ++{ ++ uint8_t data[7]; ++ ++ data[0] = (TAG_DOWNLOAD_REPLY >> 16) & 0xFF; ++ data[1] = (TAG_DOWNLOAD_REPLY >> 8) & 0xFF; ++ data[2] = TAG_DOWNLOAD_REPLY & 0xFF; ++ data[3] = 3; ++ data[4] = object_id >> 8; ++ data[5] = object_id; ++ data[6] = download_reply_id; ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, 7); ++} ++ ++int en50221_app_mmi_answ(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t answ_id, ++ uint8_t * text, uint32_t text_count) ++{ ++ uint8_t buf[10]; ++ ++ // set up the tag ++ buf[0] = (TAG_ANSWER >> 16) & 0xFF; ++ buf[1] = (TAG_ANSWER >> 8) & 0xFF; ++ buf[2] = TAG_ANSWER & 0xFF; ++ ++ // encode the length field ++ struct iovec iov[2]; ++ int length_field_len = 0; ++ int iov_count = 1; ++ if (answ_id == MMI_ANSW_ID_ANSWER) { ++ if ((length_field_len = asn_1_encode(text_count + 1, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ buf[3 + length_field_len] = answ_id; ++ ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len + 1; ++ iov[1].iov_base = text; ++ iov[1].iov_len = text_count; ++ iov_count = 2; ++ } else { ++ buf[3] = 1; ++ buf[4] = answ_id; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 5; ++ iov_count = 1; ++ } ++ ++ // create the data and send it ++ return mmi->funcs->send_datav(mmi->funcs->arg, session_number, iov, ++ iov_count); ++} ++ ++int en50221_app_mmi_menu_answ(struct en50221_app_mmi *mmi, ++ uint16_t session_number, uint8_t choice_ref) ++{ ++ uint8_t data[5]; ++ ++ data[0] = (TAG_MENU_ANSWER >> 16) & 0xFF; ++ data[1] = (TAG_MENU_ANSWER >> 8) & 0xFF; ++ data[2] = TAG_MENU_ANSWER & 0xFF; ++ data[3] = 1; ++ data[4] = choice_ref; ++ return mmi->funcs->send_data(mmi->funcs->arg, session_number, data, 5); ++} ++ ++int en50221_app_mmi_message(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_CLOSE_MMI: ++ return en50221_app_mmi_parse_close(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_DISPLAY_CONTROL: ++ return en50221_app_mmi_parse_display_control(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_KEYPAD_CONTROL: ++ return en50221_app_mmi_parse_keypad_control(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_ENQUIRY: ++ return en50221_app_mmi_parse_enq(mmi, slot_id, ++ session_number, data + 3, ++ data_length - 3); ++ case TAG_MENU_LAST: ++ return en50221_app_mmi_parse_list_menu(mmi, slot_id, ++ session_number, tag, ++ 1, data + 3, ++ data_length - 3); ++ case TAG_MENU_MORE: ++ return en50221_app_mmi_parse_list_menu(mmi, slot_id, ++ session_number, tag, ++ 0, data + 3, ++ data_length - 3); ++ case TAG_LIST_LAST: ++ return en50221_app_mmi_parse_list_menu(mmi, slot_id, ++ session_number, tag, ++ 1, data + 3, ++ data_length - 3); ++ case TAG_LIST_MORE: ++ return en50221_app_mmi_parse_list_menu(mmi, slot_id, ++ session_number, tag, ++ 0, data + 3, ++ data_length - 3); ++ case TAG_SUBTITLE_SEGMENT_LAST: ++ return en50221_app_mmi_parse_subtitle(mmi, slot_id, ++ session_number, tag, ++ 1, data + 3, ++ data_length - 3); ++ case TAG_SUBTITLE_SEGMENT_MORE: ++ return en50221_app_mmi_parse_subtitle(mmi, slot_id, ++ session_number, tag, ++ 0, data + 3, ++ data_length - 3); ++ case TAG_SCENE_END_MARK: ++ return en50221_app_mmi_parse_scene_end_mark(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_SCENE_CONTROL: ++ return en50221_app_mmi_parse_scene_control(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_SUBTITLE_DOWNLOAD_LAST: ++ return en50221_app_mmi_parse_subtitle(mmi, slot_id, ++ session_number, tag, ++ 1, data + 3, ++ data_length - 3); ++ case TAG_SUBTITLE_DOWNLOAD_MORE: ++ return en50221_app_mmi_parse_subtitle(mmi, slot_id, ++ session_number, tag, ++ 0, data + 3, ++ data_length - 3); ++ case TAG_FLUSH_DOWNLOAD: ++ return en50221_app_mmi_parse_flush_download(mmi, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++ ++ ++static int en50221_app_mmi_parse_close(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] > (data_length - 1)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t cmd_id = data[1]; ++ uint8_t delay = 0; ++ if (cmd_id == MMI_CLOSE_MMI_CMD_ID_DELAY) { ++ if (data[0] != 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ delay = data[2]; ++ } ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_close_callback cb = mmi->closecallback; ++ void *cb_arg = mmi->closecallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, cmd_id, delay); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_display_control(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] > (data_length - 1)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t cmd_id = data[1]; ++ uint8_t mmi_mode = 0; ++ if (cmd_id == MMI_DISPLAY_CONTROL_CMD_ID_SET_MMI_MODE) { ++ if (data[0] != 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received short data\n"); ++ return -1; ++ } ++ mmi_mode = data[2]; ++ } ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_display_control_callback cb = mmi->displaycontrolcallback; ++ void *cb_arg = mmi->displaycontrolcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, cmd_id, mmi_mode); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_keypad_control(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length < 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // skip over the length field ++ data += length_field_len; ++ ++ // extract the information ++ uint8_t cmd_id = data[0]; ++ uint8_t *keycodes = data + 1; ++ ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_keypad_control_callback cb = mmi->keypadcontrolcallback; ++ void *cb_arg = mmi->keypadcontrolcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, cmd_id, ++ keycodes, asn_data_length - 1); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_enq(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length < 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // skip over the length field ++ data += length_field_len; ++ ++ // extract the information ++ uint8_t blind_answer = (data[0] & 0x01) ? 1 : 0; ++ uint8_t answer_length = data[1]; ++ uint8_t *text = data + 2; ++ ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_enq_callback cb = mmi->enqcallback; ++ void *cb_arg = mmi->enqcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, blind_answer, ++ answer_length, text, asn_data_length - 2); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_list_menu(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ int result = 0; ++ uint8_t *text_flags = NULL; ++ struct en50221_app_mmi_text *text_data = NULL; ++ uint32_t i; ++ uint8_t text_count = 0; ++ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // skip over the length field ++ data += length_field_len; ++ ++ // defragment ++ pthread_mutex_lock(&mmi->lock); ++ uint8_t *outdata; ++ uint32_t outdata_length; ++ int dfstatus = ++ en50221_app_mmi_defragment(mmi, session_number, tag_id, ++ more_last, ++ data, asn_data_length, ++ &outdata, &outdata_length); ++ if (dfstatus <= 0) { ++ pthread_mutex_unlock(&mmi->lock); ++ return dfstatus; ++ } ++ data = outdata; ++ data_length = outdata_length; ++ ++ // check the reassembled data length ++ if (data_length < 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ pthread_mutex_unlock(&mmi->lock); ++ result = -1; ++ goto exit_cleanup; ++ } ++ // now, parse the data ++ uint8_t choice_nb = data[0]; ++ text_count = choice_nb + 3; ++ if (choice_nb == 0xff) ++ text_count = 3; ++ data++; ++ data_length--; ++ ++ // variables for extracted text state ++ text_flags = alloca(text_count); ++ if (text_flags == NULL) { ++ pthread_mutex_unlock(&mmi->lock); ++ result = -1; ++ goto exit_cleanup; ++ } ++ memset(text_flags, 0, text_count); ++ text_data = (struct en50221_app_mmi_text *) ++ alloca(sizeof(struct en50221_app_mmi_text) * text_count); ++ if (text_data == NULL) { ++ pthread_mutex_unlock(&mmi->lock); ++ result = -1; ++ goto exit_cleanup; ++ } ++ memset(text_data, 0, ++ sizeof(struct en50221_app_mmi_text) * text_count); ++ ++ // extract the text! ++ for (i = 0; i < text_count; i++) { ++ uint32_t consumed = 0; ++ int cur_status = ++ en50221_app_mmi_defragment_text(data, data_length, ++ &text_data[i].text, ++ &text_data[i].text_length, ++ &consumed); ++ if (cur_status < 0) { ++ pthread_mutex_unlock(&mmi->lock); ++ result = -1; ++ goto exit_cleanup; ++ } ++ ++ text_flags[i] = cur_status; ++ data += consumed; ++ data_length -= consumed; ++ } ++ ++ // work out what to pass to the user ++ struct en50221_app_mmi_text *text_data_for_user = (struct en50221_app_mmi_text *) ++ alloca(sizeof(struct en50221_app_mmi_text) * text_count); ++ if (text_data_for_user == NULL) { ++ result = -1; ++ goto exit_cleanup; ++ } ++ memcpy(text_data_for_user, text_data, ++ sizeof(struct en50221_app_mmi_text) * text_count); ++ struct en50221_app_mmi_text *text_ptr = NULL; ++ if (text_count > 3) { ++ text_ptr = &text_data_for_user[3]; ++ } ++ uint8_t *items_raw = NULL; ++ uint32_t items_raw_length = 0; ++ if (choice_nb == 0xff) { ++ items_raw = data; ++ items_raw_length = data_length; ++ } ++ // do callback ++ result = 0; ++ switch (tag_id) { ++ case TAG_MENU_LAST: ++ { ++ en50221_app_mmi_menu_callback cb = mmi->menucallback; ++ void *cb_arg = mmi->menucallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ result = ++ cb(cb_arg, slot_id, session_number, ++ &text_data_for_user[0], ++ &text_data_for_user[1], ++ &text_data_for_user[2], ++ text_count - 3, text_ptr, ++ items_raw_length, items_raw); ++ } ++ break; ++ } ++ ++ case TAG_LIST_LAST: ++ { ++ en50221_app_mmi_list_callback cb = mmi->listcallback; ++ void *cb_arg = mmi->listcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ result = ++ cb(cb_arg, slot_id, session_number, ++ &text_data_for_user[0], ++ &text_data_for_user[1], ++ &text_data_for_user[2], ++ text_count - 3, text_ptr, ++ items_raw_length, items_raw); ++ } ++ break; ++ } ++ ++ default: ++ pthread_mutex_unlock(&mmi->lock); ++ break; ++ } ++ ++exit_cleanup: ++ if ((dfstatus == 2) && outdata) ++ free(outdata); ++ if (text_flags && text_data) { ++ for (i = 0; i < text_count; i++) { ++ if ((text_flags[i] == 2) && text_data[i].text) { ++ free(text_data[i].text); ++ } ++ } ++ } ++ return result; ++} ++ ++static int en50221_app_mmi_parse_subtitle(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t tag_id, int more_last, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // skip over the length field ++ data += length_field_len; ++ ++ // defragment ++ pthread_mutex_lock(&mmi->lock); ++ uint8_t *outdata; ++ uint32_t outdata_length; ++ int dfstatus = ++ en50221_app_mmi_defragment(mmi, session_number, tag_id, ++ more_last, ++ data, asn_data_length, ++ &outdata, &outdata_length); ++ if (dfstatus <= 0) { ++ pthread_mutex_unlock(&mmi->lock); ++ return dfstatus; ++ } ++ // do callback ++ int cbstatus = 0; ++ switch (tag_id) { ++ case TAG_SUBTITLE_SEGMENT_LAST: ++ { ++ en50221_app_mmi_subtitle_segment_callback cb = ++ mmi->subtitlesegmentcallback; ++ void *cb_arg = mmi->subtitlesegmentcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ cbstatus = ++ cb(cb_arg, slot_id, session_number, outdata, outdata_length); ++ } ++ break; ++ } ++ ++ case TAG_SUBTITLE_DOWNLOAD_LAST: ++ { ++ en50221_app_mmi_subtitle_download_callback cb = ++ mmi->subtitledownloadcallback; ++ void *cb_arg = mmi->subtitledownloadcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ cbstatus = ++ cb(cb_arg, slot_id, session_number, outdata, outdata_length); ++ } ++ break; ++ } ++ } ++ ++ // free the data returned by the defragment call if asked to ++ if (dfstatus == 2) { ++ free(outdata); ++ } ++ // done ++ return cbstatus; ++} ++ ++static int en50221_app_mmi_parse_scene_end_mark(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t flags = data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_scene_end_mark_callback cb = ++ mmi->sceneendmarkcallback; ++ void *cb_arg = mmi->sceneendmarkcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ (flags & 0x80) ? 1 : 0, ++ (flags & 0x40) ? 1 : 0, ++ (flags & 0x20) ? 1 : 0, flags & 0x0f); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_scene_control(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t flags = data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_scene_control_callback cb = mmi->scenecontrolcallback; ++ void *cb_arg = mmi->scenecontrolcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, ++ (flags & 0x80) ? 1 : 0, ++ (flags & 0x40) ? 1 : 0, flags & 0x0f); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_parse_flush_download(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ // validate data ++ if (data_length != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 0) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ // tell the app ++ pthread_mutex_lock(&mmi->lock); ++ en50221_app_mmi_flush_download_callback cb = mmi->flushdownloadcallback; ++ void *cb_arg = mmi->flushdownloadcallback_arg; ++ pthread_mutex_unlock(&mmi->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number); ++ } ++ return 0; ++} ++ ++static int en50221_app_mmi_defragment(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint32_t tag_id, ++ int more_last, ++ uint8_t * indata, ++ uint32_t indata_length, ++ uint8_t ** outdata, ++ uint32_t * outdata_length) ++{ ++ struct en50221_app_mmi_session *cur_s = mmi->sessions; ++ while (cur_s) { ++ if (cur_s->session_number == session_number) ++ break; ++ cur_s = cur_s->next; ++ } ++ ++ // more data is still to come ++ if (!more_last) { ++ // if there was no previous session, create one ++ if (cur_s == NULL) { ++ cur_s = malloc(sizeof(struct en50221_app_mmi_session)); ++ if (cur_s == NULL) { ++ print(LOG_LEVEL, ERROR, 1, "Ran out of memory\n"); ++ return -1; ++ } ++ cur_s->session_number = session_number; ++ cur_s->menu_block_chain = NULL; ++ cur_s->menu_block_length = 0; ++ cur_s->list_block_chain = NULL; ++ cur_s->list_block_length = 0; ++ cur_s->subtitlesegment_block_chain = NULL; ++ cur_s->subtitlesegment_block_length = 0; ++ cur_s->subtitledownload_block_chain = NULL; ++ cur_s->subtitledownload_block_length = 0; ++ cur_s->next = mmi->sessions; ++ mmi->sessions = cur_s; ++ } ++ // find the block/block_length to use ++ uint8_t **block_chain; ++ uint32_t *block_length; ++ switch (tag_id) { ++ case TAG_MENU_LAST: ++ case TAG_MENU_MORE: ++ block_chain = &cur_s->menu_block_chain; ++ block_length = &cur_s->menu_block_length; ++ break; ++ case TAG_LIST_LAST: ++ case TAG_LIST_MORE: ++ block_chain = &cur_s->list_block_chain; ++ block_length = &cur_s->list_block_length; ++ break; ++ case TAG_SUBTITLE_SEGMENT_LAST: ++ case TAG_SUBTITLE_SEGMENT_MORE: ++ block_chain = &cur_s->subtitlesegment_block_chain; ++ block_length = &cur_s->subtitlesegment_block_length; ++ break; ++ case TAG_SUBTITLE_DOWNLOAD_LAST: ++ case TAG_SUBTITLE_DOWNLOAD_MORE: ++ block_chain = &cur_s->subtitledownload_block_chain; ++ block_length = &cur_s->subtitledownload_block_length; ++ break; ++ default: ++ return -1; ++ } ++ ++ // append the data ++ uint8_t *new_data = ++ realloc(*block_chain, *block_length + indata_length); ++ if (new_data == NULL) { ++ print(LOG_LEVEL, ERROR, 1, "Ran out of memory\n"); ++ return -1; ++ } ++ memcpy(new_data + *block_length, indata, indata_length); ++ *block_chain = new_data; ++ *block_length += indata_length; ++ ++ // success, but block not complete yet ++ return 0; ++ } ++ // we hit the last of a possible chain of fragments ++ if (cur_s != NULL) { ++ // find the block/block_length to use ++ uint8_t **block_chain; ++ uint32_t *block_length; ++ switch (tag_id) { ++ case TAG_MENU_LAST: ++ case TAG_MENU_MORE: ++ block_chain = &cur_s->menu_block_chain; ++ block_length = &cur_s->menu_block_length; ++ break; ++ case TAG_LIST_LAST: ++ case TAG_LIST_MORE: ++ block_chain = &cur_s->list_block_chain; ++ block_length = &cur_s->list_block_length; ++ break; ++ case TAG_SUBTITLE_SEGMENT_LAST: ++ case TAG_SUBTITLE_SEGMENT_MORE: ++ block_chain = &cur_s->subtitlesegment_block_chain; ++ block_length = &cur_s->subtitlesegment_block_length; ++ break; ++ case TAG_SUBTITLE_DOWNLOAD_LAST: ++ case TAG_SUBTITLE_DOWNLOAD_MORE: ++ block_chain = &cur_s->subtitledownload_block_chain; ++ block_length = &cur_s->subtitledownload_block_length; ++ break; ++ default: ++ return -1; ++ } ++ ++ // we have a preceding fragment - need to append ++ uint8_t *new_data = ++ realloc(*block_chain, *block_length + indata_length); ++ if (new_data == NULL) { ++ print(LOG_LEVEL, ERROR, 1, "Ran out of memory\n"); ++ return -1; ++ } ++ memcpy(new_data + *block_length, indata, indata_length); ++ *outdata_length = *block_length + indata_length; ++ *outdata = new_data; ++ *block_chain = NULL; ++ *block_length = 0; ++ ++ // success, and indicate to free the block when done ++ return 2; ++ } ++ // success, but indicate it is not to be freed ++ *outdata_length = indata_length; ++ *outdata = indata; ++ return 1; ++} ++ ++static int en50221_app_mmi_defragment_text(uint8_t * data, ++ uint32_t data_length, ++ uint8_t ** outdata, ++ uint32_t * outdata_length, ++ uint32_t * outconsumed) ++{ ++ uint8_t *text = NULL; ++ uint32_t text_length = 0; ++ uint32_t consumed = 0; ++ ++ while (1) { ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Short data\n"); ++ if (text) ++ free(text); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ data += 3; ++ data_length -= 3; ++ consumed += 3; ++ ++ // get the length of the data and adjust ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = ++ asn_1_decode(&asn_data_length, data, ++ data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ if (text) ++ free(text); ++ return -1; ++ } ++ data += length_field_len; ++ data_length -= length_field_len; ++ consumed += length_field_len; ++ ++ // deal with the tags ++ if (tag == TAG_TEXT_LAST) { ++ if (text == NULL) { ++ *outdata = data; ++ *outdata_length = asn_data_length; ++ *outconsumed = consumed + asn_data_length; ++ return 1; ++ } else { ++ // append the data ++ uint8_t *new_text = realloc(text, ++ text_length + asn_data_length); ++ if (new_text == NULL) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Ran out of memory\n"); ++ if (text) ++ free(text); ++ return -1; ++ } ++ memcpy(new_text + text_length, data, ++ asn_data_length); ++ *outdata = new_text; ++ *outdata_length = ++ text_length + asn_data_length; ++ *outconsumed = consumed + asn_data_length; ++ return 2; ++ } ++ ++ } else if (tag == TAG_TEXT_MORE) { ++ // append the data ++ uint8_t *new_text = ++ realloc(text, text_length + asn_data_length); ++ if (new_text == NULL) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Ran out of memory\n"); ++ if (text) ++ free(text); ++ return -1; ++ } ++ memcpy(new_text + text_length, data, ++ asn_data_length); ++ text = new_text; ++ text_length += asn_data_length; ++ ++ // consume the data ++ data += asn_data_length; ++ data_length -= asn_data_length; ++ consumed += asn_data_length; ++ } else { ++ // unknown tag ++ print(LOG_LEVEL, ERROR, 1, ++ "Unknown MMI text tag\n"); ++ if (text) ++ free(text); ++ return -1; ++ } ++ } ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_mmi.h dvb-apps/lib/libdvben50221/en50221_app_mmi.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_mmi.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_mmi.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,618 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_mmi_H__ ++#define __EN50221_APPLICATION_mmi_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_MMI_RESOURCEID MKRID(64,1,1) ++ ++#define MMI_CLOSE_MMI_CMD_ID_IMMEDIATE 0x00 ++#define MMI_CLOSE_MMI_CMD_ID_DELAY 0x01 ++ ++#define MMI_DISPLAY_CONTROL_CMD_ID_SET_MMI_MODE 0x01 ++#define MMI_DISPLAY_CONTROL_CMD_ID_GET_DISPLAY_CHAR_TABLES 0x02 ++#define MMI_DISPLAY_CONTROL_CMD_ID_GET_INPUT_CHAR_TABLES 0x03 ++#define MMI_DISPLAY_CONTROL_CMD_ID_GET_OVERLAY_GFX_CHARACTERISTICS 0x04 ++#define MMI_DISPLAY_CONTROL_CMD_ID_GET_FULLSCREEN_GFX_CHARACTERISTICS 0x05 ++ ++#define MMI_DISPLAY_REPLY_ID_MMI_MODE_ACK 0x01 ++#define MMI_DISPLAY_REPLY_ID_LIST_DISPLAY_CHAR_TABLES 0x02 ++#define MMI_DISPLAY_REPLY_ID_LIST_INPUT_CHAR_TABLES 0x03 ++#define MMI_DISPLAY_REPLY_ID_LIST_OVERLAY_GFX_CHARACTERISTICS 0x04 ++#define MMI_DISPLAY_REPLY_ID_LIST_FULLSCREEN_GFX_CHARACTERISTICS 0x05 ++#define MMI_DISPLAY_REPLY_ID_UNKNOWN_CMD_ID 0xF0 ++#define MMI_DISPLAY_REPLY_ID_UNKNOWN_MMI_MODE 0xF1 ++#define MMI_DISPLAY_REPLY_ID_UNKNOWN_CHAR_TABLE 0xF2 ++ ++#define MMI_MODE_HIGH_LEVEL 0x01 ++#define MMI_MODE_LOW_LEVEL_OVERLAY_GFX 0x02 ++#define MMI_MODE_LOW_LEVEL_FULLSCREEN_GFX 0x03 ++ ++#define MMI_KEYPAD_CONTROL_CMD_ID_INTERCEPT_ALL 0x01 ++#define MMI_KEYPAD_CONTROL_CMD_ID_IGNORE_ALL 0x02 ++#define MMI_KEYPAD_CONTROL_CMD_ID_INTERCEPT_SELECTED 0x03 ++#define MMI_KEYPAD_CONTROL_CMD_ID_IGNORE_SELECTED 0x04 ++#define MMI_KEYPAD_CONTROL_CMD_ID_REJECT_KEYPRESS 0x05 ++ ++#define MMI_GFX_VIDEO_RELATION_NONE 0x00 ++#define MMI_GFX_VIDEO_RELATION_MATCHES_EXACTLY 0x07 ++ ++#define MMI_DISPLAY_MESSAGE_ID_OK 0x00 ++#define MMI_DISPLAY_MESSAGE_ID_ERROR 0x01 ++#define MMI_DISPLAY_MESSAGE_ID_OUT_OF_MEMORY 0x02 ++#define MMI_DISPLAY_MESSAGE_ID_SUBTITLE_SYNTAX_ERROR 0x03 ++#define MMI_DISPLAY_MESSAGE_ID_UNDEFINED_REGION 0x04 ++#define MMI_DISPLAY_MESSAGE_ID_UNDEFINED_CLUT 0x05 ++#define MMI_DISPLAY_MESSAGE_ID_UNDEFINED_OBJECT 0x06 ++#define MMI_DISPLAY_MESSAGE_ID_INCOMPATABLE_OBJECT 0x07 ++#define MMI_DISPLAY_MESSAGE_ID_UNKNOWN_CHARACTER 0x08 ++#define MMI_DISPLAY_MESSAGE_ID_DISPLAY_CHANGED 0x09 ++ ++#define MMI_DOWNLOAD_REPLY_ID_OK 0x00 ++#define MMI_DOWNLOAD_REPLY_ID_NOT_OBJECT_SEGMENT 0x01 ++#define MMI_DOWNLOAD_REPLY_ID_OUT_OF_MEMORY 0x02 ++ ++#define MMI_ANSW_ID_CANCEL 0x00 ++#define MMI_ANSW_ID_ANSWER 0x01 ++ ++/** ++ * A pixel depth as supplied with display_reply details ++ */ ++struct en50221_app_mmi_pixel_depth { ++ uint8_t display_depth; ++ uint8_t pixels_per_byte; ++ uint8_t region_overhead; ++}; ++ ++/** ++ * Details returned with a display_reply ++ */ ++struct en50221_app_mmi_display_reply_details { ++ union { ++ struct { ++ uint16_t width; ++ uint16_t height; ++ uint8_t aspect_ratio; ++ uint8_t gfx_relation_to_video; /* one of MMI_GFX_VIDEO_RELATION_* */ ++ uint8_t multiple_depths; ++ uint16_t display_bytes; ++ uint8_t composition_buffer_bytes; ++ uint8_t object_cache_bytes; ++ uint8_t num_pixel_depths; ++ struct en50221_app_mmi_pixel_depth *pixel_depths; ++ } gfx; /* MMI_DISPLAY_REPLY_ID_LIST_OVERLAY_GFX_CHARACTERISTICS or ++ MMI_DISPLAY_REPLY_ID_LIST_FULLSCREEN_GFX_CHARACTERISTICS */ ++ ++ struct { ++ uint32_t table_length; ++ uint8_t *table; ++ } char_table; /* MMI_DISPLAY_REPLY_ID_LIST_DISPLAY_CHAR_TABLES or ++ MMI_DISPLAY_REPLY_ID_LIST_INPUT_CHAR_TABLES */ ++ ++ struct { ++ uint8_t mmi_mode; /* one of the MMI_MODE_* values */ ++ } mode_ack; /* for MMI_DISPLAY_REPLY_ID_MMI_MODE_ACK */ ++ } u; ++}; ++ ++/** ++ * Pointer to a text string. ++ */ ++struct en50221_app_mmi_text { ++ uint8_t *text; ++ uint32_t text_length; ++}; ++ ++/** ++ * Type definition for close - called when we receive an mmi_close from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param cmd_id One of the MMI_CLOSE_MMI_CMD_ID_* values. ++ * @param delay Delay supplied with MMI_CLOSE_MMI_CMD_ID_DELAY. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_close_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t cmd_id, ++ uint8_t delay); ++ ++/** ++ * Type definition for display_control callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param cmd_id One of the MMI_DISPLAY_CONTROL_CMD_ID_* values. ++ * @param delay One of the MMI_MODE_* values. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_display_control_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t cmd_id, ++ uint8_t mmi_mode); ++ ++/** ++ * Type definition for keypad_control callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param cmd_id One of the MMI_KEYPAD_CONTROL_CMD_ID_* values. ++ * @param key_codes Pointer to the key codes. ++ * @param key_codes_count Number of key codes. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_keypad_control_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t cmd_id, ++ uint8_t *key_codes, ++ uint32_t key_codes_count); ++ ++/** ++ * Type definition for subtitle_segment callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param segment Pointer to the segment data. ++ * @param segment_size Size of segment data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_subtitle_segment_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *segment, ++ uint32_t segment_size); ++ ++/** ++ * Type definition for scene_end_mark callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param decoder_continue_flag ++ * @param scene_reveal_flag ++ * @param send_scene_done ++ * @param scene_tag ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_scene_end_mark_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t decoder_continue_flag, ++ uint8_t scene_reveal_flag, ++ uint8_t send_scene_done, ++ uint8_t scene_tag); ++ ++/** ++ * Type definition for scene_control callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param decoder_continue_flag ++ * @param scene_reveal_flag ++ * @param scene_tag ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_scene_control_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t decoder_continue_flag, ++ uint8_t scene_reveal_flag, ++ uint8_t scene_tag); ++ ++/** ++ * Type definition for subtitle_download callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param segment Pointer to the segment data. ++ * @param segment_size Size of segment data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_subtitle_download_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *segment, ++ uint32_t segment_size); ++ ++/** ++ * Type definition for flush_download callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_flush_download_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number); ++ ++/** ++ * Type definition for enq callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param blind_answer 1=>Obscure text input in some manner, ++ * @param expected_answer_length Expected max number of characters to be returned. ++ * @param text Pointer to the text data. ++ * @param text_size Size of text data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_enq_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t blind_answer, ++ uint8_t expected_answer_length, ++ uint8_t * text, ++ uint32_t text_size); ++ ++/** ++ * Type definition for menu callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param title Title text. ++ * @param sub_title Sub-Title text. ++ * @param bottom Bottom text. ++ * @param item_count Number of text elements in items. ++ * @param items Pointer to array of en50221_app_mmi_text structures which are standard menu choices, ++ * @param item_raw_length Length of item raw data. ++ * @param items_raw If nonstandard items were supplied, pointer to their data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_menu_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ struct en50221_app_mmi_text *title, ++ struct en50221_app_mmi_text *sub_title, ++ struct en50221_app_mmi_text *bottom, ++ uint32_t item_count, ++ struct en50221_app_mmi_text *items, ++ uint32_t item_raw_length, ++ uint8_t *items_raw); ++ ++/** ++ * Type definition for list callback. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param title Title text. ++ * @param sub_title Sub-Title text. ++ * @param bottom Bottom text. ++ * @param item_count Number of text elements in items. ++ * @param items Pointer to array of en50221_app_mmi_text structures which are standard menu choices, ++ * @param item_raw_length Length of item raw data. ++ * @param items_raw If nonstandard items were supplied, pointer to their data. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_mmi_list_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ struct en50221_app_mmi_text *title, ++ struct en50221_app_mmi_text *sub_title, ++ struct en50221_app_mmi_text *bottom, ++ uint32_t item_count, ++ struct en50221_app_mmi_text *items, ++ uint32_t item_raw_length, ++ uint8_t *items_raw); ++ ++/** ++ * Opaque type representing a mmi resource. ++ */ ++struct en50221_app_mmi; ++ ++/** ++ * Create an instance of the mmi resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_mmi *en50221_app_mmi_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the mmi resource. ++ * ++ * @param mmi Instance to destroy. ++ */ ++extern void en50221_app_mmi_destroy(struct en50221_app_mmi *mmi); ++ ++/** ++ * Informs the mmi object that a session to it has been closed - cleans up internal state. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number The session concerned. ++ */ ++extern void en50221_app_mmi_clear_session(struct en50221_app_mmi *mmi, ++ uint16_t session_number); ++ ++/** ++ * Register the callback for when we receive an mmi_close request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_close_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_close_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a display control request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_display_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_display_control_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a keypad control request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_keypad_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_keypad_control_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a subtitle segment request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_subtitle_segment_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_subtitle_segment_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a scene end mark request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_scene_end_mark_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_scene_end_mark_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a scene control request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_scene_control_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_scene_control_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a subtitle download request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_subtitle_download_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_subtitle_download_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a flush download request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_flush_download_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_flush_download_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive an enq request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_enq_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_enq_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a menu request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_menu_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_menu_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a list request. ++ * ++ * @param mmi mmi resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_mmi_register_list_callback(struct en50221_app_mmi *mmi, ++ en50221_app_mmi_list_callback callback, ++ void *arg); ++ ++/** ++ * Send an mmi_close to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param cmd_id One of the MMI_CLOSE_MMI_CMD_ID_* values. ++ * @param delay Delay to use if MMI_CLOSE_MMI_CMD_ID_DELAY specified. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_close(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t cmd_id, uint8_t delay); ++ ++/** ++ * Send a display_reply to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param reply_id One of the MMI_DISPLAY_REPLY_ID_* values. ++ * @param details The details of the reply - can be NULL if the chosen reply_id does not need it. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_display_reply(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t reply_id, ++ struct en50221_app_mmi_display_reply_details *details); ++ ++/** ++ * Send a keypress to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param keycode The keycode. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_keypress(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t keycode); ++ ++/** ++ * Send a display message to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param display_message_id One of the MMI_DISPLAY_MESSAGE_ID_* values. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_display_message(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t display_message_id); ++ ++/** ++ * Send a scene done message to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param decoder_continue Copy of flag in scene_end_mark. ++ * @param scene_reveal Copy of flag in scene_end_mark. ++ * @param scene_tag Scene tag this responds to. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_scene_done(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t decoder_continue, ++ uint8_t scene_reveal, ++ uint8_t scene_tag); ++ ++/** ++ * Send a download reply to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param object_id Object id. ++ * @param download_reply_id One of the MMI_DOWNLOAD_REPLY_ID_* values. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_download_reply(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint16_t object_id, ++ uint8_t download_reply_id); ++ ++/** ++ * Send an answ to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param answ_id One of the MMI_ANSW_ID_* values. ++ * @param text The text if MMI_ANSW_ID_ANSWER. ++ * @param text_count Length of text. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_answ(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t answ_id, ++ uint8_t * text, ++ uint32_t text_count); ++ ++/** ++ * Send a menu answ to the cam. ++ * ++ * @param mmi mmi resource instance. ++ * @param session_number Session number to send it on. ++ * @param choice_ref Option chosen by user (0=>canceled). ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_menu_answ(struct en50221_app_mmi *mmi, ++ uint16_t session_number, ++ uint8_t choice_ref); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param mmi mmi instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_mmi_message(struct en50221_app_mmi *mmi, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_rm.c dvb-apps/lib/libdvben50221/en50221_app_rm.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_rm.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_rm.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,307 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "en50221_app_rm.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_rm { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_rm_enq_callback enqcallback; ++ void *enqcallback_arg; ++ ++ en50221_app_rm_reply_callback replycallback; ++ void *replycallback_arg; ++ ++ en50221_app_rm_changed_callback changedcallback; ++ void *changedcallback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_rm_parse_profile_enq(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_rm_parse_profile_reply(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_app_rm_parse_profile_change(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++struct en50221_app_rm *en50221_app_rm_create(struct ++ en50221_app_send_functions ++ *funcs) ++{ ++ struct en50221_app_rm *rm = NULL; ++ ++ // create structure and set it up ++ rm = malloc(sizeof(struct en50221_app_rm)); ++ if (rm == NULL) { ++ return NULL; ++ } ++ rm->funcs = funcs; ++ rm->enqcallback = NULL; ++ rm->replycallback = NULL; ++ rm->changedcallback = NULL; ++ ++ pthread_mutex_init(&rm->lock, NULL); ++ ++ // done ++ return rm; ++} ++ ++void en50221_app_rm_destroy(struct en50221_app_rm *rm) ++{ ++ pthread_mutex_destroy(&rm->lock); ++ free(rm); ++} ++ ++void en50221_app_rm_register_enq_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_enq_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&rm->lock); ++ rm->enqcallback = callback; ++ rm->enqcallback_arg = arg; ++ pthread_mutex_unlock(&rm->lock); ++} ++ ++void en50221_app_rm_register_reply_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_reply_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&rm->lock); ++ rm->replycallback = callback; ++ rm->replycallback_arg = arg; ++ pthread_mutex_unlock(&rm->lock); ++} ++ ++void en50221_app_rm_register_changed_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_changed_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&rm->lock); ++ rm->changedcallback = callback; ++ rm->changedcallback_arg = arg; ++ pthread_mutex_unlock(&rm->lock); ++} ++ ++int en50221_app_rm_enq(struct en50221_app_rm *rm, uint16_t session_number) ++{ ++ uint8_t buf[4]; ++ ++ // set up the tag ++ buf[0] = (TAG_PROFILE_ENQUIRY >> 16) & 0xFF; ++ buf[1] = (TAG_PROFILE_ENQUIRY >> 8) & 0xFF; ++ buf[2] = TAG_PROFILE_ENQUIRY & 0xFF; ++ buf[3] = 0; ++ ++ // create the data and send it ++ return rm->funcs->send_data(rm->funcs->arg, session_number, buf, 4); ++} ++ ++int en50221_app_rm_reply(struct en50221_app_rm *rm, ++ uint16_t session_number, ++ uint32_t resource_id_count, ++ uint32_t * resource_ids) ++{ ++ uint8_t buf[10]; ++ ++ // set up the tag ++ buf[0] = (TAG_PROFILE >> 16) & 0xFF; ++ buf[1] = (TAG_PROFILE >> 8) & 0xFF; ++ buf[2] = TAG_PROFILE & 0xFF; ++ ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(resource_id_count * 4, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ // copy the data and byteswap it ++ uint32_t *copy_resource_ids = alloca(4 * resource_id_count); ++ if (copy_resource_ids == NULL) { ++ return -1; ++ } ++ uint8_t *data = (uint8_t *) copy_resource_ids; ++ memcpy(data, resource_ids, resource_id_count * 4); ++ uint32_t i; ++ for (i = 0; i < resource_id_count; i++) { ++ bswap32(data); ++ data += 4; ++ } ++ ++ // build the iovecs ++ struct iovec iov[2]; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len; ++ iov[1].iov_base = (uint8_t *) copy_resource_ids; ++ iov[1].iov_len = resource_id_count * 4; ++ ++ // create the data and send it ++ return rm->funcs->send_datav(rm->funcs->arg, session_number, iov, 2); ++} ++ ++int en50221_app_rm_changed(struct en50221_app_rm *rm, ++ uint16_t session_number) ++{ ++ uint8_t buf[4]; ++ ++ // set up the tag ++ buf[0] = (TAG_PROFILE_CHANGE >> 16) & 0xFF; ++ buf[1] = (TAG_PROFILE_CHANGE >> 8) & 0xFF; ++ buf[2] = TAG_PROFILE_CHANGE & 0xFF; ++ buf[3] = 0; ++ ++ // create the data and send it ++ return rm->funcs->send_data(rm->funcs->arg, session_number, buf, 4); ++} ++ ++int en50221_app_rm_message(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ // dispatch it ++ switch (tag) { ++ case TAG_PROFILE_ENQUIRY: ++ return en50221_app_rm_parse_profile_enq(rm, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_PROFILE: ++ return en50221_app_rm_parse_profile_reply(rm, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_PROFILE_CHANGE: ++ return en50221_app_rm_parse_profile_change(rm, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++static int en50221_app_rm_parse_profile_enq(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ (void) data; ++ (void) data_length; ++ ++ pthread_mutex_lock(&rm->lock); ++ en50221_app_rm_enq_callback cb = rm->enqcallback; ++ void *cb_arg = rm->enqcallback_arg; ++ pthread_mutex_unlock(&rm->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number); ++ } ++ return 0; ++} ++ ++static int en50221_app_rm_parse_profile_reply(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t resources_count = asn_data_length / 4; ++ uint32_t *resource_ids = (uint32_t *) (data + length_field_len); ++ data += length_field_len; ++ ++ // byteswap it ++ uint32_t i; ++ for (i = 0; i < resources_count; i++) { ++ bswap32(data); ++ data += 4; ++ } ++ ++ // inform observer ++ pthread_mutex_lock(&rm->lock); ++ en50221_app_rm_reply_callback cb = rm->replycallback; ++ void *cb_arg = rm->replycallback_arg; ++ pthread_mutex_unlock(&rm->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, resources_count, resource_ids); ++ } ++ return 0; ++} ++ ++static int en50221_app_rm_parse_profile_change(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ (void) data; ++ (void) data_length; ++ ++ pthread_mutex_lock(&rm->lock); ++ en50221_app_rm_changed_callback cb = rm->changedcallback; ++ void *cb_arg = rm->changedcallback_arg; ++ pthread_mutex_unlock(&rm->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_rm.h dvb-apps/lib/libdvben50221/en50221_app_rm.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_rm.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_rm.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,187 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_RM_H__ ++#define __EN50221_APPLICATION_RM_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_RM_RESOURCEID MKRID(1,1,1) ++ ++/** ++ * Type definition for profile_enq callback function - called when we receive ++ * a profile_enq from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_rm_enq_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number); ++ ++/** ++ * Type definition for profile_reply callback function - called when we receive ++ * a profile_reply from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id_count Number of resource_ids. ++ * @param resource_ids The resource ids themselves. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_rm_reply_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id_count, ++ uint32_t *resource_ids); ++/** ++ * Type definition for profile_changed callback function - called when we receive ++ * a profile_changed from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_rm_changed_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number); ++ ++ ++ ++/** ++ * Opaque type representing a resource manager. ++ */ ++struct en50221_app_rm; ++ ++/** ++ * Create an instance of the resource manager. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_rm *en50221_app_rm_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the resource manager. ++ * ++ * @param rm Instance to destroy. ++ */ ++extern void en50221_app_rm_destroy(struct en50221_app_rm *rm); ++ ++/** ++ * Register the callback for when we receive a profile_enq from a CAM. ++ * ++ * @param rm Resource manager instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_rm_register_enq_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_enq_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a profile_reply from a CAM. ++ * ++ * @param rm Resource manager instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_rm_register_reply_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_reply_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive a profile_changed from a CAM. ++ * ++ * @param rm Resource manager instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_rm_register_changed_callback(struct en50221_app_rm *rm, ++ en50221_app_rm_changed_callback callback, ++ void *arg); ++ ++/** ++ * Send a profile_enq to a CAM. ++ * ++ * @param rm Resource manager resource instance. ++ * @param session_number Session number to send it on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_rm_enq(struct en50221_app_rm *rm, uint16_t session_number); ++ ++/** ++ * Send a profile_reply to a CAM. ++ * ++ * @param rm Resource manager resource instance. ++ * @param session_number Session number to send it on. ++ * @param resource_id_count Number of resource ids. ++ * @param resource_ids The resource IDs themselves ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_rm_reply(struct en50221_app_rm *rm, ++ uint16_t session_number, ++ uint32_t resource_id_count, ++ uint32_t * resource_ids); ++ ++/** ++ * Send a profile_changed to a CAM. ++ * ++ * @param rm Resource manager resource instance. ++ * @param session_number Session number to send it on. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_rm_changed(struct en50221_app_rm *rm, uint16_t session_number); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param rm rm instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_rm_message(struct en50221_app_rm *rm, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_smartcard.c dvb-apps/lib/libdvben50221/en50221_app_smartcard.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_smartcard.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_smartcard.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,296 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_smartcard.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_smartcard { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_smartcard_command_callback command_callback; ++ void *command_callback_arg; ++ ++ en50221_app_smartcard_send_callback send_callback; ++ void *send_callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_smartcard_parse_command(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++static int en50221_app_smartcard_parse_send(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++struct en50221_app_smartcard *en50221_app_smartcard_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_smartcard *smartcard = NULL; ++ ++ // create structure and set it up ++ smartcard = malloc(sizeof(struct en50221_app_smartcard)); ++ if (smartcard == NULL) { ++ return NULL; ++ } ++ smartcard->funcs = funcs; ++ smartcard->command_callback = NULL; ++ smartcard->send_callback = NULL; ++ ++ pthread_mutex_init(&smartcard->lock, NULL); ++ ++ // done ++ return smartcard; ++} ++ ++void en50221_app_smartcard_destroy(struct en50221_app_smartcard *smartcard) ++{ ++ pthread_mutex_destroy(&smartcard->lock); ++ free(smartcard); ++} ++ ++void en50221_app_smartcard_register_command_callback(struct en50221_app_smartcard *smartcard, ++ en50221_app_smartcard_command_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&smartcard->lock); ++ smartcard->command_callback = callback; ++ smartcard->command_callback_arg = arg; ++ pthread_mutex_unlock(&smartcard->lock); ++} ++ ++void en50221_app_smartcard_register_send_callback(struct en50221_app_smartcard *smartcard, ++ en50221_app_smartcard_send_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&smartcard->lock); ++ smartcard->send_callback = callback; ++ smartcard->send_callback_arg = arg; ++ pthread_mutex_unlock(&smartcard->lock); ++} ++ ++int en50221_app_smartcard_command_reply(struct en50221_app_smartcard *smartcard, ++ uint16_t session_number, ++ uint8_t reply_id, uint8_t status, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ uint8_t hdr[10]; ++ struct iovec iovec[2]; ++ int iov_count = 0; ++ ++ // the tag ++ hdr[0] = (TAG_SMARTCARD_REPLY >> 16) & 0xFF; ++ hdr[1] = (TAG_SMARTCARD_REPLY >> 8) & 0xFF; ++ hdr[2] = TAG_SMARTCARD_REPLY & 0xFF; ++ ++ // the rest of the data ++ if (reply_id == SMARTCARD_REPLY_ID_ANSW_TO_RESET) { ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(data_length + 2, data + 3, 3)) < 0) { ++ return -1; ++ } ++ // the rest of the header ++ hdr[3 + length_field_len] = reply_id; ++ hdr[3 + length_field_len + 1] = status; ++ iovec[0].iov_base = hdr; ++ iovec[0].iov_len = 3 + length_field_len + 2; ++ ++ // the data ++ iovec[1].iov_base = data; ++ iovec[1].iov_len = data_length; ++ iov_count = 2; ++ } else { ++ hdr[3] = 2; ++ hdr[4] = reply_id; ++ hdr[5] = status; ++ iovec[0].iov_base = data; ++ iovec[0].iov_len = 6; ++ iov_count = 1; ++ } ++ ++ return smartcard->funcs->send_datav(smartcard->funcs->arg, session_number, iovec, iov_count); ++} ++ ++int en50221_app_smartcard_receive(struct en50221_app_smartcard *smartcard, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length, ++ uint8_t SW1, uint8_t SW2) ++{ ++ uint8_t buf[10]; ++ uint8_t trailer[10]; ++ ++ // set up the tag ++ buf[0] = (TAG_SMARTCARD_RCV >> 16) & 0xFF; ++ buf[1] = (TAG_SMARTCARD_RCV >> 8) & 0xFF; ++ buf[2] = TAG_SMARTCARD_RCV & 0xFF; ++ ++ // encode the length field ++ int length_field_len; ++ if ((length_field_len = asn_1_encode(data_length + 2, buf + 3, 3)) < 0) { ++ return -1; ++ } ++ // set up the trailer ++ trailer[0] = SW1; ++ trailer[1] = SW2; ++ ++ // build the iovecs ++ struct iovec iov[3]; ++ iov[0].iov_base = buf; ++ iov[0].iov_len = 3 + length_field_len; ++ iov[1].iov_base = data; ++ iov[1].iov_len = data_length; ++ iov[2].iov_base = trailer; ++ iov[2].iov_len = 2; ++ ++ // create the data and send it ++ return smartcard->funcs->send_datav(smartcard->funcs->arg, ++ session_number, iov, 3); ++} ++ ++int en50221_app_smartcard_message(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t *data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_SMARTCARD_COMMAND: ++ return en50221_app_smartcard_parse_command(smartcard, ++ slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ case TAG_SMARTCARD_SEND: ++ return en50221_app_smartcard_parse_send(smartcard, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++ ++ ++ ++ ++ ++static int en50221_app_smartcard_parse_command(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ if (data_length != 2) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (data[0] != 1) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t command_id = data[1]; ++ ++ // tell the app ++ pthread_mutex_lock(&smartcard->lock); ++ en50221_app_smartcard_command_callback cb = smartcard->command_callback; ++ void *cb_arg = smartcard->command_callback_arg; ++ pthread_mutex_unlock(&smartcard->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, command_id); ++ } ++ return 0; ++} ++ ++static int en50221_app_smartcard_parse_send(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ // check it ++ if (asn_data_length < 8) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ data += length_field_len; ++ ++ // parse ++ uint8_t CLA = data[0]; ++ uint8_t INS = data[1]; ++ uint8_t P1 = data[2]; ++ uint8_t P2 = data[3]; ++ uint16_t length_in = (data[4] << 8) | data[5]; ++ uint8_t *data_in = data + 6; ++ ++ // validate the length ++ if ((length_in + 8) != asn_data_length) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint16_t length_out = ++ (data[6 + length_in] << 8) | data[6 + length_in + 1]; ++ ++ // tell the app ++ pthread_mutex_lock(&smartcard->lock); ++ en50221_app_smartcard_send_callback cb = smartcard->send_callback; ++ void *cb_arg = smartcard->send_callback_arg; ++ pthread_mutex_unlock(&smartcard->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, CLA, INS, P1, ++ P2, data_in, length_in, length_out); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_smartcard.h dvb-apps/lib/libdvben50221/en50221_app_smartcard.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_smartcard.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_smartcard.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,200 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_smartcard_H__ ++#define __EN50221_APPLICATION_smartcard_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define SMARTCARD_COMMAND_ID_CONNECT 0x01 ++#define SMARTCARD_COMMAND_ID_DISCONNECT 0x02 ++#define SMARTCARD_COMMAND_ID_POWERON_CARD 0x03 ++#define SMARTCARD_COMMAND_ID_POWEROFF_CARD 0x04 ++#define SMARTCARD_COMMAND_ID_RESET_CARD 0x05 ++#define SMARTCARD_COMMAND_ID_RESET_STATUS 0x06 ++#define SMARTCARD_COMMAND_ID_READ_ANSW_TO_RESET 0x07 ++ ++#define SMARTCARD_REPLY_ID_CONNECTED 0x01 ++#define SMARTCARD_REPLY_ID_FREE 0x02 ++#define SMARTCARD_REPLY_ID_BUSY 0x03 ++#define SMARTCARD_REPLY_ID_ANSW_TO_RESET 0x04 ++#define SMARTCARD_REPLY_ID_NO_ANSW_TO_RESET 0x05 ++ ++#define SMARTCARD_STATUS_CARD_INSERTED 0x01 ++#define SMARTCARD_STATUS_CARD_REMOVED 0x02 ++#define SMARTCARD_STATUS_CARD_IN_PLACE_POWEROFF 0x03 ++#define SMARTCARD_STATUS_CARD_IN_PLACE_POWERON 0x04 ++#define SMARTCARD_STATUS_CARD_NO_CARD 0x05 ++#define SMARTCARD_STATUS_CARD_UNRESPONSIVE_CARD 0x06 ++#define SMARTCARD_STATUS_CARD_REFUSED_CARD 0x07 ++ ++#define EN50221_APP_SMARTCARD_RESOURCEID(DEVICE_NUMBER) MKRID(112, ((DEVICE_NUMBER)& 0x0f), 1) ++ ++ ++ ++/** ++ * Type definition for command - called when we receive a command. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param command_id One of the SMARTCARD_COMMAND_ID_* values ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_smartcard_command_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t command_id); ++ ++/** ++ * Type definition for command - called when we receive a send command. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param CLA CLA value. ++ * @param INS INS value. ++ * @param P1 P1 value. ++ * @param P2 P2 value. ++ * @param in Data to send to the card ++ * @param in_length Number of bytes to send. ++ * @param out_length Number of bytes expected. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_smartcard_send_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t CLA, ++ uint8_t INS, ++ uint8_t P1, ++ uint8_t P2, ++ uint8_t *in, ++ uint32_t in_length, ++ uint32_t out_length); ++ ++/** ++ * Opaque type representing a smartcard resource. ++ */ ++struct en50221_app_smartcard; ++ ++/** ++ * Create an instance of the smartcard resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_smartcard * ++ en50221_app_smartcard_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the smartcard resource. ++ * ++ * @param smartcard Instance to destroy. ++ */ ++extern void en50221_app_smartcard_destroy(struct en50221_app_smartcard *smartcard); ++ ++/** ++ * Register the callback for when we receive a comms command. ++ * ++ * @param smartcard smartcard resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_smartcard_register_command_callback(struct en50221_app_smartcard *smartcard, ++ en50221_app_smartcard_command_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for when we receive data to send. ++ * ++ * @param smartcard smartcard resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_smartcard_register_send_callback(struct en50221_app_smartcard *smartcard, ++ en50221_app_smartcard_send_callback callback, ++ void *arg); ++ ++/** ++ * Send a command response to the CAM. ++ * ++ * @param smartcard smartcard resource instance. ++ * @param session_number Session number to send it on. ++ * @param reply_id One of the SMARTCARD_REPLY_ID_* values. ++ * @param status One of the SMARTCARD_STATUS_* values. ++ * @param data Data to send when it is a SMARTCARD_REPLY_ID_ANSW_TO_RESET. ++ * @param data_length Length of data to send. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_smartcard_command_reply(struct en50221_app_smartcard *smartcard, ++ uint16_t session_number, ++ uint8_t reply_id, ++ uint8_t status, ++ uint8_t * data, ++ uint32_t data_length); ++ ++/** ++ * Send data received from a smartcart to the CAM. ++ * ++ * @param smartcard smartcard resource instance. ++ * @param session_number Session number to send it on. ++ * @param data Data to send when it is a SMARTCARD_REPLY_ID_ANSW_TO_RESET. ++ * @param data_length Length of data to send. ++ * @param SW1 SW1 value. ++ * @param SW2 SW2 value. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_smartcard_receive(struct en50221_app_smartcard *smartcard, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length, ++ uint8_t SW1, uint8_t SW2); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param smartcard smartcard instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_smartcard_message(struct en50221_app_smartcard *smartcard, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_tags.h dvb-apps/lib/libdvben50221/en50221_app_tags.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_tags.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_tags.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,104 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APP_TAGS_H__ ++#define __EN50221_APP_TAGS_H__ ++ ++/* Resource Manager */ ++#define TAG_PROFILE_ENQUIRY 0x9f8010 ++#define TAG_PROFILE 0x9f8011 ++#define TAG_PROFILE_CHANGE 0x9f8012 ++ ++/* Application Info */ ++#define TAG_APP_INFO_ENQUIRY 0x9f8020 ++#define TAG_APP_INFO 0x9f8021 ++#define TAG_ENTER_MENU 0x9f8022 ++ ++/* CA Support */ ++#define TAG_CA_INFO_ENQUIRY 0x9f8030 ++#define TAG_CA_INFO 0x9f8031 ++#define TAG_CA_PMT 0x9f8032 ++#define TAG_CA_PMT_REPLY 0x9f8033 ++ ++/* Host Control */ ++#define TAG_TUNE 0x9f8400 ++#define TAG_REPLACE 0x9f8401 ++#define TAG_CLEAR_REPLACE 0x9f8402 ++#define TAG_ASK_RELEASE 0x9f8403 ++ ++/* Date and Time */ ++#define TAG_DATE_TIME_ENQUIRY 0x9f8440 ++#define TAG_DATE_TIME 0x9f8441 ++ ++/* Man Machine Interface (MMI) */ ++#define TAG_CLOSE_MMI 0x9f8800 ++#define TAG_DISPLAY_CONTROL 0x9f8801 ++#define TAG_DISPLAY_REPLY 0x9f8802 ++#define TAG_TEXT_LAST 0x9f8803 ++#define TAG_TEXT_MORE 0x9f8804 ++#define TAG_KEYPAD_CONTROL 0x9f8805 ++#define TAG_KEYPRESS 0x9f8806 ++#define TAG_ENQUIRY 0x9f8807 ++#define TAG_ANSWER 0x9f8808 ++#define TAG_MENU_LAST 0x9f8809 ++#define TAG_MENU_MORE 0x9f880a ++#define TAG_MENU_ANSWER 0x9f880b ++#define TAG_LIST_LAST 0x9f880c ++#define TAG_LIST_MORE 0x9f880d ++#define TAG_SUBTITLE_SEGMENT_LAST 0x9f880e ++#define TAG_SUBTITLE_SEGMENT_MORE 0x9f880f ++#define TAG_DISPLAY_MESSAGE 0x9f8810 ++#define TAG_SCENE_END_MARK 0x9f8811 ++#define TAG_SCENE_DONE 0x9f8812 ++#define TAG_SCENE_CONTROL 0x9f8813 ++#define TAG_SUBTITLE_DOWNLOAD_LAST 0x9f8814 ++#define TAG_SUBTITLE_DOWNLOAD_MORE 0x9f8815 ++#define TAG_FLUSH_DOWNLOAD 0x9f8816 ++#define TAG_DOWNLOAD_REPLY 0x9f8817 ++ ++/* Low Speed Communications */ ++#define TAG_COMMS_COMMAND 0x9f8c00 ++#define TAG_CONNECTION_DESCRIPTOR 0x9f8c01 ++#define TAG_COMMS_REPLY 0x9f8c02 ++#define TAG_COMMS_SEND_LAST 0x9f8c03 ++#define TAG_COMMS_SEND_MORE 0x9f8c04 ++#define TAG_COMMS_RECV_LAST 0x9f8c05 ++#define TAG_COMMS_RECV_MORE 0x9f8c06 ++ ++/* Authentication */ ++#define TAG_AUTH_REQ 0x9f8200 ++#define TAG_AUTH_RESP 0x9f8201 ++ ++/* Teletext */ ++#define TAG_TELETEXT_EBU 0x9f9000 ++ ++/* Smartcard */ ++#define TAG_SMARTCARD_COMMAND 0x9f8e00 ++#define TAG_SMARTCARD_REPLY 0x9f8e01 ++#define TAG_SMARTCARD_SEND 0x9f8e02 ++#define TAG_SMARTCARD_RCV 0x9f8e03 ++ ++/* EPG */ ++#define TAG_EPG_ENQUIRY 0x9f8f00 ++#define TAG_EPG_REPLY 0x9f8f01 ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_teletext.c dvb-apps/lib/libdvben50221/en50221_app_teletext.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_teletext.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_teletext.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,141 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include "en50221_app_teletext.h" ++#include "en50221_app_tags.h" ++#include "asn_1.h" ++ ++struct en50221_app_teletext { ++ struct en50221_app_send_functions *funcs; ++ ++ en50221_app_teletext_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t lock; ++}; ++ ++static int en50221_app_teletext_parse_ebu(struct en50221_app_teletext *teletext, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t * data, ++ uint32_t data_length); ++ ++ ++ ++struct en50221_app_teletext * ++ en50221_app_teletext_create(struct en50221_app_send_functions *funcs) ++{ ++ struct en50221_app_teletext *teletext = NULL; ++ ++ // create structure and set it up ++ teletext = malloc(sizeof(struct en50221_app_teletext)); ++ if (teletext == NULL) { ++ return NULL; ++ } ++ teletext->funcs = funcs; ++ teletext->callback = NULL; ++ ++ pthread_mutex_init(&teletext->lock, NULL); ++ ++ // done ++ return teletext; ++} ++ ++void en50221_app_teletext_destroy(struct en50221_app_teletext *teletext) ++{ ++ pthread_mutex_destroy(&teletext->lock); ++ free(teletext); ++} ++ ++void en50221_app_teletext_register_callback(struct en50221_app_teletext *teletext, ++ en50221_app_teletext_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&teletext->lock); ++ teletext->callback = callback; ++ teletext->callback_arg = arg; ++ pthread_mutex_unlock(&teletext->lock); ++} ++ ++int en50221_app_teletext_message(struct en50221_app_teletext *teletext, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ (void) resource_id; ++ ++ // get the tag ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2]; ++ ++ switch (tag) { ++ case TAG_TELETEXT_EBU: ++ return en50221_app_teletext_parse_ebu(teletext, slot_id, ++ session_number, ++ data + 3, ++ data_length - 3); ++ } ++ ++ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag); ++ return -1; ++} ++ ++ ++static int en50221_app_teletext_parse_ebu(struct en50221_app_teletext *teletext, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *data, ++ uint32_t data_length) ++{ ++ // first of all, decode the length field ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n"); ++ return -1; ++ } ++ ++ // check it ++ if (asn_data_length > (data_length - length_field_len)) { ++ print(LOG_LEVEL, ERROR, 1, "Received short data\n"); ++ return -1; ++ } ++ uint8_t *teletext_data = data + length_field_len; ++ ++ // tell the app ++ pthread_mutex_lock(&teletext->lock); ++ en50221_app_teletext_callback cb = teletext->callback; ++ void *cb_arg = teletext->callback_arg; ++ pthread_mutex_unlock(&teletext->lock); ++ if (cb) { ++ return cb(cb_arg, slot_id, session_number, teletext_data, ++ asn_data_length); ++ } ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_teletext.h dvb-apps/lib/libdvben50221/en50221_app_teletext.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_teletext.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_teletext.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,107 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APPLICATION_teletext_H__ ++#define __EN50221_APPLICATION_teletext_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define EN50221_APP_TELETEXT_RESOURCEID MKRID(128, 1, 1) ++ ++ ++/** ++ * Type definition for request - called when we receive teletext from a CAM. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number concerned. ++ * @param teletext_data Data for the request. ++ * @param teletext_data_lenghth Number of bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++typedef int (*en50221_app_teletext_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint8_t *teletext_data, ++ uint32_t teletext_data_length); ++ ++/** ++ * Opaque type representing a teletext resource. ++ */ ++struct en50221_app_teletext; ++ ++/** ++ * Create an instance of the teletext resource. ++ * ++ * @param funcs Send functions to use. ++ * @return Instance, or NULL on failure. ++ */ ++extern struct en50221_app_teletext * ++ en50221_app_teletext_create(struct en50221_app_send_functions *funcs); ++ ++/** ++ * Destroy an instance of the teletext resource. ++ * ++ * @param teletext Instance to destroy. ++ */ ++extern void en50221_app_teletext_destroy(struct en50221_app_teletext *teletext); ++ ++/** ++ * Register the callback for when we receive a request. ++ * ++ * @param teletext teletext resource instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_app_teletext_register_callback(struct en50221_app_teletext *teletext, ++ en50221_app_teletext_callback callback, ++ void *arg); ++ ++/** ++ * Pass data received for this resource into it for parsing. ++ * ++ * @param teletext teletext instance. ++ * @param slot_id Slot ID concerned. ++ * @param session_number Session number concerned. ++ * @param resource_id Resource ID concerned. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, -1 on failure. ++ */ ++extern int en50221_app_teletext_message(struct en50221_app_teletext *teletext, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, ++ uint32_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_utils.c dvb-apps/lib/libdvben50221/en50221_app_utils.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_utils.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_utils.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,38 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include "en50221_app_utils.h" ++ ++struct en50221_app_public_resource_id ++ *en50221_app_decode_public_resource_id(struct en50221_app_public_resource_id *idf, ++ uint32_t resource_id) ++{ ++ // reject private resources ++ if ((resource_id & 0xc0000000) == 0xc0000000) ++ return NULL; ++ ++ idf->resource_class = (resource_id >> 16) & 0xffff; // use the resource_id as the MSBs of class ++ idf->resource_type = (resource_id >> 6) & 0x3ff; ++ idf->resource_version = resource_id & 0x3f; ++ return idf; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_utils.h dvb-apps/lib/libdvben50221/en50221_app_utils.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_app_utils.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_app_utils.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,112 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef __EN50221_APP_UTILS_H__ ++#define __EN50221_APP_UTILS_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * A decomposed public resource structure. ++ * ++ * we will ignore private resource (resource_id_type==3), ++ * because they are not used by any modules at all and ++ * would need special code for any private resource anyway. ++ */ ++struct en50221_app_public_resource_id { ++ uint16_t resource_class; ++ uint16_t resource_type; ++ uint8_t resource_version; ++}; ++ ++typedef int (*en50221_send_data) (void *arg, ++ uint16_t session_number, ++ uint8_t * data, ++ uint16_t data_length); ++typedef int (*en50221_send_datav) (void *arg, ++ uint16_t session_number, ++ struct iovec * vector, ++ int iov_count); ++ ++/** ++ * An abstraction away from hardcoded send functions so different layers may be ++ * slotted in under the application layer. ++ */ ++struct en50221_app_send_functions { ++ /** ++ * Argument to pass to these functions. ++ */ ++ void *arg; ++ ++ /** ++ * Send data. ++ */ ++ en50221_send_data send_data; ++ ++ /** ++ * Send vector data. ++ */ ++ en50221_send_datav send_datav; ++}; ++ ++/** ++ * Make a host-endian uint32_t formatted resource id. ++ * ++ * @param CLASS Class of resource. ++ * @param TYPE Type of resource. ++ * @param VERSION Version of resource. ++ * @return Formatted resource id. ++ */ ++#define MKRID(CLASS, TYPE, VERSION) ((((CLASS)&0xffff)<<16) | (((TYPE)&0x3ff)<<6) | ((VERSION)&0x3f)) ++ ++/** ++ * Decode a host-endian public resource_id into an en50221_app_public_resource_id structure. ++ * ++ * @param idf Structure to write decoded resource_id into. ++ * @param resource_id ID to decode. ++ * @return Pointer to idf on success, or NULL if this is not a public resource. ++ */ ++struct en50221_app_public_resource_id * ++ en50221_app_decode_public_resource_id(struct en50221_app_public_resource_id *idf, ++ uint32_t resource_id); ++ ++/** ++ * Encode an en50221_app_public_resource_id structure into a host-endian uint32_t. ++ * ++ * @param idf Structure to encode. ++ * @return The encoded value ++ */ ++static inline uint32_t en50221_app_encode_public_resource_id(struct en50221_app_public_resource_id *idf) { ++ return MKRID(idf->resource_class, idf->resource_type, idf->resource_version); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_errno.h dvb-apps/lib/libdvben50221/en50221_errno.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_errno.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_errno.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,49 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 session layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef EN50221_ERRNO ++#define EN50221_ERRNO 1 ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define EN50221ERR_CAREAD -1 /* error during read from CA device. */ ++#define EN50221ERR_CAWRITE -2 /* error during write to CA device. */ ++#define EN50221ERR_TIMEOUT -3 /* timeout occured waiting for a response from a device. */ ++#define EN50221ERR_BADSLOTID -4 /* bad slot ID supplied by user - the offending slot_id will not be set. */ ++#define EN50221ERR_BADCONNECTIONID -5 /* bad connection ID supplied by user. */ ++#define EN50221ERR_BADSTATE -6 /* slot/connection in the wrong state. */ ++#define EN50221ERR_BADCAMDATA -7 /* CAM supplied an invalid request. */ ++#define EN50221ERR_OUTOFMEMORY -8 /* memory allocation failed. */ ++#define EN50221ERR_ASNENCODE -9 /* ASN.1 encode failure - indicates library bug. */ ++#define EN50221ERR_OUTOFCONNECTIONS -10 /* no more connections available. */ ++#define EN50221ERR_OUTOFSLOTS -11 /* no more slots available - the offending slot_id will not be set. */ ++#define EN50221ERR_IOVLIMIT -12 /* Too many struct iovecs were used. */ ++#define EN50221ERR_BADSESSIONNUMBER -13 /* Bad session number suppplied by user. */ ++#define EN50221ERR_OUTOFSESSIONS -14 /* no more sessions available. */ ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_session.c dvb-apps/lib/libdvben50221/en50221_session.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_session.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_session.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,1055 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "en50221_transport.h" ++#include "en50221_session.h" ++#include "en50221_errno.h" ++#include "asn_1.h" ++ ++ ++// these are the possible session statuses ++#define S_STATUS_OPEN 0x00 // session is opened ++#define S_STATUS_CLOSE_NO_RES 0xF0 // could not open session, no proper resource available ++#define S_STATUS_CLOSE_RES_UNAVAILABLE 0xF1 // could not open session, resource unavailable ++#define S_STATUS_CLOSE_RES_LOW_VERSION 0xF2 // could not open session, resource version too low ++#define S_STATUS_CLOSE_RES_BUSY 0xF3 // could not open session, resource is busy ++ ++#define ST_OPEN_SESSION_REQ 0x91 // h<--m ++#define ST_OPEN_SESSION_RES 0x92 // h-->m ++#define ST_CREATE_SESSION 0x93 // h-->m ++#define ST_CREATE_SESSION_RES 0x94 // h<--m ++#define ST_CLOSE_SESSION_REQ 0x95 // h<->m ++#define ST_CLOSE_SESSION_RES 0x96 // h<->m ++#define ST_SESSION_NUMBER 0x90 // h<->m ++ ++#define S_STATE_IDLE 0x01 // this session is not in use ++#define S_STATE_ACTIVE 0x02 // this session is in use ++#define S_STATE_IN_CREATION 0x04 // this session waits for a ST_CREATE_SESSION_RES to become active ++#define S_STATE_IN_DELETION 0x08 // this session waits for ST_CLOSE_SESSION_RES to become idle again ++ ++ ++// for each session we store its identifier, the resource-id ++// it is linked to and the callback of the specific resource ++struct en50221_session { ++ uint8_t state; ++ uint32_t resource_id; ++ uint8_t slot_id; ++ uint8_t connection_id; ++ ++ en50221_sl_resource_callback callback; ++ void *callback_arg; ++ ++ pthread_mutex_t session_lock; ++}; ++ ++struct en50221_session_layer { ++ uint32_t max_sessions; ++ struct en50221_transport_layer *tl; ++ ++ en50221_sl_lookup_callback lookup; ++ void *lookup_arg; ++ ++ en50221_sl_session_callback session; ++ void *session_arg; ++ ++ pthread_mutex_t global_lock; ++ pthread_mutex_t setcallback_lock; ++ ++ int error; ++ ++ struct en50221_session *sessions; ++}; ++ ++static void en50221_sl_transport_callback(void *arg, int reason, ++ uint8_t * data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id); ++static int en50221_sl_alloc_new_session(struct en50221_session_layer *sl, ++ uint32_t resource_id, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ en50221_sl_resource_callback ++ callback, void *arg); ++ ++ ++ ++ ++struct en50221_session_layer *en50221_sl_create(struct en50221_transport_layer *tl, ++ uint32_t max_sessions) ++{ ++ struct en50221_session_layer *sl = NULL; ++ uint32_t i; ++ ++ // setup structure ++ sl = (struct en50221_session_layer *) ++ malloc(sizeof(struct en50221_session_layer)); ++ if (sl == NULL) ++ goto error_exit; ++ sl->max_sessions = max_sessions; ++ sl->lookup = NULL; ++ sl->session = NULL; ++ sl->tl = tl; ++ sl->error = 0; ++ ++ // init the mutex ++ pthread_mutex_init(&sl->global_lock, NULL); ++ pthread_mutex_init(&sl->setcallback_lock, NULL); ++ ++ // create the slots ++ sl->sessions = malloc(sizeof(struct en50221_session) * max_sessions); ++ if (sl->sessions == NULL) ++ goto error_exit; ++ ++ // set them up ++ for (i = 0; i < max_sessions; i++) { ++ sl->sessions[i].state = S_STATE_IDLE; ++ sl->sessions[i].callback = NULL; ++ ++ pthread_mutex_init(&sl->sessions[i].session_lock, NULL); ++ } ++ ++ // register ourselves with the transport layer ++ en50221_tl_register_callback(tl, en50221_sl_transport_callback, sl); ++ ++ return sl; ++ ++error_exit: ++ en50221_sl_destroy(sl); ++ return NULL; ++} ++ ++void en50221_sl_destroy(struct en50221_session_layer *sl) ++{ ++ uint32_t i; ++ ++ if (sl) { ++ if (sl->sessions) { ++ for (i = 0; i < sl->max_sessions; i++) { ++ pthread_mutex_destroy(&sl->sessions[i].session_lock); ++ } ++ free(sl->sessions); ++ } ++ ++ pthread_mutex_destroy(&sl->setcallback_lock); ++ pthread_mutex_destroy(&sl->global_lock); ++ ++ free(sl); ++ } ++} ++ ++int en50221_sl_get_error(struct en50221_session_layer *sl) ++{ ++ return sl->error; ++} ++ ++void en50221_sl_register_lookup_callback(struct en50221_session_layer *sl, ++ en50221_sl_lookup_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&sl->setcallback_lock); ++ sl->lookup = callback; ++ sl->lookup_arg = arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++} ++ ++void en50221_sl_register_session_callback(struct en50221_session_layer *sl, ++ en50221_sl_session_callback ++ callback, void *arg) ++{ ++ pthread_mutex_lock(&sl->setcallback_lock); ++ sl->session = callback; ++ sl->session_arg = arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++} ++ ++int en50221_sl_create_session(struct en50221_session_layer *sl, ++ int slot_id, uint8_t connection_id, ++ uint32_t resource_id, ++ en50221_sl_resource_callback callback, ++ void *arg) ++{ ++ // lookup next free session_id: ++ pthread_mutex_lock(&sl->global_lock); ++ int session_number = ++ en50221_sl_alloc_new_session(sl, resource_id, slot_id, ++ connection_id, callback, arg); ++ if (session_number == -1) { ++ pthread_mutex_unlock(&sl->global_lock); ++ return -1; ++ } ++ pthread_mutex_unlock(&sl->global_lock); ++ ++ // make up the header ++ uint8_t hdr[8]; ++ hdr[0] = ST_CREATE_SESSION; ++ hdr[1] = 6; ++ hdr[2] = resource_id >> 24; ++ hdr[3] = resource_id >> 16; ++ hdr[4] = resource_id >> 8; ++ hdr[5] = resource_id; ++ hdr[6] = session_number >> 8; ++ hdr[7] = session_number; ++ ++ // send this command ++ if (en50221_tl_send_data(sl->tl, slot_id, connection_id, hdr, 8)) { ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (sl->sessions[session_number].state == S_STATE_IN_CREATION) { ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ } ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ sl->error = en50221_tl_get_error(sl->tl); ++ return -1; ++ } ++ // ok. ++ return session_number; ++} ++ ++int en50221_sl_destroy_session(struct en50221_session_layer *sl, ++ uint16_t session_number) ++{ ++ if (session_number >= sl->max_sessions) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (!(sl->sessions[session_number].state & (S_STATE_ACTIVE | S_STATE_IN_DELETION))) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return -1; ++ } ++ // set the state ++ sl->sessions[session_number].state = S_STATE_IN_DELETION; ++ ++ // get essential details ++ uint8_t slot_id = sl->sessions[session_number].slot_id; ++ uint8_t connection_id = sl->sessions[session_number].connection_id; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // sendit ++ uint8_t hdr[4]; ++ hdr[0] = ST_CLOSE_SESSION_REQ; ++ hdr[1] = 2; ++ hdr[2] = session_number >> 8; ++ hdr[3] = session_number; ++ if (en50221_tl_send_data(sl->tl, slot_id, connection_id, hdr, 4)) { ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (sl->sessions[session_number].state == S_STATE_IN_DELETION) { ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ } ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ sl->error = en50221_tl_get_error(sl->tl); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++int en50221_sl_send_data(struct en50221_session_layer *sl, ++ uint16_t session_number, ++ uint8_t *data, ++ uint16_t data_length) ++{ ++ if (session_number >= sl->max_sessions) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (sl->sessions[session_number].state != S_STATE_ACTIVE) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return -1; ++ } ++ // get essential details ++ uint8_t slot_id = sl->sessions[session_number].slot_id; ++ uint8_t connection_id = sl->sessions[session_number].connection_id; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // sendit ++ struct iovec iov[2]; ++ uint8_t hdr[4]; ++ hdr[0] = ST_SESSION_NUMBER; ++ hdr[1] = 2; ++ hdr[2] = session_number >> 8; ++ hdr[3] = session_number; ++ iov[0].iov_base = hdr; ++ iov[0].iov_len = 4; ++ iov[1].iov_base = data; ++ iov[1].iov_len = data_length; ++ if (en50221_tl_send_datav(sl->tl, slot_id, connection_id, iov, 2)) { ++ sl->error = en50221_tl_get_error(sl->tl); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++int en50221_sl_send_datav(struct en50221_session_layer *sl, ++ uint16_t session_number, ++ struct iovec *vector, ++ int iov_count) ++{ ++ if (session_number >= sl->max_sessions) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (sl->sessions[session_number].state != S_STATE_ACTIVE) { ++ sl->error = EN50221ERR_BADSESSIONNUMBER; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return -1; ++ } ++ if (iov_count > 9) { ++ sl->error = EN50221ERR_IOVLIMIT; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return -1; ++ } ++ uint8_t slot_id = sl->sessions[session_number].slot_id; ++ uint8_t connection_id = sl->sessions[session_number].connection_id; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // make up the header ++ struct iovec out_iov[10]; ++ uint8_t hdr[4]; ++ hdr[0] = ST_SESSION_NUMBER; ++ hdr[1] = 2; ++ hdr[2] = session_number >> 8; ++ hdr[3] = session_number; ++ out_iov[0].iov_base = hdr; ++ out_iov[0].iov_len = 4; ++ ++ // make up the data ++ memcpy(&out_iov[1], vector, iov_count * sizeof(struct iovec)); ++ ++ // send this command ++ if (en50221_tl_send_datav(sl->tl, slot_id, connection_id, out_iov, iov_count + 1)) { ++ sl->error = en50221_tl_get_error(sl->tl); ++ return -1; ++ } ++ return 0; ++} ++ ++int en50221_sl_broadcast_data(struct en50221_session_layer *sl, ++ int slot_id, uint32_t resource_id, ++ uint8_t *data, uint16_t data_length) ++{ ++ uint32_t i; ++ ++ for (i = 0; i < sl->max_sessions; i++) { ++ pthread_mutex_lock(&sl->sessions[i].session_lock); ++ ++ if (sl->sessions[i].state != S_STATE_ACTIVE) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ if ((slot_id != -1) ++ && (slot_id != sl->sessions[i].slot_id)) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ ++ if (sl->sessions[i].resource_id == resource_id) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ en50221_sl_send_data(sl, i, data, data_length); ++ } else { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ } ++ } ++ ++ return 0; ++} ++ ++ ++ ++static void en50221_sl_handle_open_session_request(struct en50221_session_layer *sl, ++ uint8_t *data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (data_length < 5) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ if (data[0] != 4) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ // get the resource id ++ uint32_t requested_resource_id = ++ (data[1] << 24) | (data[2] << 16) | (data[3] << 8) | data[4]; ++ ++ // get lookup callback details ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_lookup_callback lcb = sl->lookup; ++ void *lcb_arg = sl->lookup_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ // first of all, lookup this resource id ++ int status = S_STATUS_CLOSE_NO_RES; ++ en50221_sl_resource_callback resource_callback = NULL; ++ void *resource_arg = NULL; ++ uint32_t connected_resource_id; ++ if (lcb) { ++ status = ++ lcb(lcb_arg, slot_id, requested_resource_id, ++ &resource_callback, &resource_arg, ++ &connected_resource_id); ++ switch (status) { ++ case 0: ++ status = S_STATUS_OPEN; ++ break; ++ ++ case -1: ++ status = S_STATUS_CLOSE_NO_RES; ++ break; ++ ++ case -2: ++ status = S_STATUS_CLOSE_RES_LOW_VERSION; ++ break; ++ ++ case -3: ++ status = S_STATUS_CLOSE_RES_UNAVAILABLE; ++ break; ++ } ++ } ++ // if we found it, get a new session for it ++ int session_number = -1; ++ if (status == S_STATUS_OPEN) { ++ // lookup next free session_id: ++ pthread_mutex_lock(&sl->global_lock); ++ session_number = ++ en50221_sl_alloc_new_session(sl, connected_resource_id, ++ slot_id, connection_id, ++ resource_callback, ++ resource_arg); ++ pthread_mutex_unlock(&sl->global_lock); ++ ++ if (session_number == -1) { ++ status = S_STATUS_CLOSE_NO_RES; ++ } else { ++ // inform upper layers/ check availability ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ if (cb) { ++ if (cb(cb_arg, S_SCALLBACK_REASON_CAMCONNECTING, ++ slot_id, session_number, ++ connected_resource_id)) { ++ status = S_STATUS_CLOSE_RES_BUSY; ++ } ++ } else { ++ status = S_STATUS_CLOSE_RES_UNAVAILABLE; ++ } ++ } ++ } ++ // send response ++ uint8_t hdr[9]; ++ hdr[0] = ST_OPEN_SESSION_RES; ++ hdr[1] = 7; ++ hdr[2] = status; ++ hdr[3] = connected_resource_id >> 24; ++ hdr[4] = connected_resource_id >> 16; ++ hdr[5] = connected_resource_id >> 8; ++ hdr[6] = connected_resource_id; ++ hdr[7] = session_number >> 8; ++ hdr[8] = session_number; ++ if (en50221_tl_send_data(sl->tl, slot_id, connection_id, hdr, 9)) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Transport layer error %i occurred\n", ++ en50221_tl_get_error(sl->tl)); ++ status = S_STATUS_CLOSE_NO_RES; ++ // fallthrough ++ } ++ // inform upper layers what happened ++ if (session_number != -1) { ++ // setup session state apppropriately from upper layer response ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (status != S_STATUS_OPEN) { ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ } else { ++ sl->sessions[session_number].state = S_STATE_ACTIVE; ++ } ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // tell upper layers ++ if (sl->sessions[session_number].state == S_STATE_ACTIVE) { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ if (status == S_STATUS_OPEN) { ++ if (cb) ++ cb(cb_arg, ++ S_SCALLBACK_REASON_CAMCONNECTED, ++ slot_id, session_number, ++ connected_resource_id); ++ } else { ++ sl->sessions[session_number].state = ++ S_STATE_IDLE; ++ if (cb) ++ cb(cb_arg, ++ S_SCALLBACK_REASON_CAMCONNECTFAIL, ++ slot_id, session_number, ++ connected_resource_id); ++ } ++ } ++ } ++} ++ ++static void en50221_sl_handle_close_session_request(struct en50221_session_layer *sl, ++ uint8_t * data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ if (data[0] != 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ // extract session number ++ uint16_t session_number = (data[1] << 8) | data[2]; ++ ++ // check session number is ok ++ uint8_t code = 0x00; ++ uint32_t resource_id = 0; ++ if (session_number >= sl->max_sessions) { ++ code = 0xF0; // session close error ++ print(LOG_LEVEL, ERROR, 1, "Received bad session id %i\n", ++ slot_id); ++ } else { ++ pthread_mutex_lock(&sl->sessions[session_number]. ++ session_lock); ++ if (slot_id != sl->sessions[session_number].slot_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ code = 0xF0; // session close error ++ } ++ if (connection_id != sl->sessions[session_number].connection_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ code = 0xF0; // session close error ++ } ++ if (!(sl->sessions[session_number].state & (S_STATE_ACTIVE | S_STATE_IN_DELETION))) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ code = 0xF0; // session close error ++ } ++ ++ if (code == 0x00) { ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ code = 0x00; // close ok ++ } ++ resource_id = sl->sessions[session_number].resource_id; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ } ++ ++ // make up the response ++ uint8_t hdr[5]; ++ hdr[0] = ST_CLOSE_SESSION_RES; ++ hdr[1] = 3; ++ hdr[2] = code; ++ hdr[3] = session_number >> 8; ++ hdr[4] = session_number; ++ ++ // sendit ++ if (en50221_tl_send_data(sl->tl, slot_id, connection_id, hdr, 5)) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Transport layer reports error %i on slot %i\n", ++ en50221_tl_get_error(sl->tl), slot_id); ++ } ++ // callback to announce destruction to resource if it was ok ++ if (code == 0x00) { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_CLOSE, slot_id, ++ session_number, resource_id); ++ } ++} ++ ++static void en50221_sl_handle_create_session_response(struct en50221_session_layer *sl, ++ uint8_t * data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (data_length < 8) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ if (data[0] != 7) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ // extract session number ++ uint16_t session_number = (data[5] << 8) | data[6]; ++ ++ // check session number is ok ++ if (session_number >= sl->max_sessions) { ++ print(LOG_LEVEL, ERROR, 1, "Received bad session id %i\n", ++ slot_id); ++ return; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (slot_id != sl->sessions[session_number].slot_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (connection_id != sl->sessions[session_number].connection_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (sl->sessions[session_number].state != S_STATE_IN_CREATION) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ // extract status ++ if (data[1] != S_STATUS_OPEN) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Session creation failed 0x%02x\n", data[1]); ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // inform upper layers ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_CONNECTFAIL, slot_id, ++ session_number, ++ sl->sessions[session_number].resource_id); ++ return; ++ } ++ // set it active ++ sl->sessions[session_number].state = S_STATE_ACTIVE; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // inform upper layers ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_CONNECTED, slot_id, ++ session_number, ++ sl->sessions[session_number].resource_id); ++} ++ ++static void en50221_sl_handle_close_session_response(struct en50221_session_layer *sl, ++ uint8_t *data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (data_length < 5) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ if (data[0] != 4) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ return; ++ } ++ // extract session number ++ uint16_t session_number = (data[2] << 8) | data[3]; ++ ++ // check session number is ok ++ if (session_number >= sl->max_sessions) { ++ print(LOG_LEVEL, ERROR, 1, "Received bad session id %i\n", slot_id); ++ return; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (slot_id != sl->sessions[session_number].slot_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (connection_id != sl->sessions[session_number].connection_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (sl->sessions[session_number].state != S_STATE_IN_DELETION) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ // extract status ++ if (data[1] != 0x00) { ++ print(LOG_LEVEL, ERROR, 1, "Session close failed 0x%02x\n", data[1]); ++ // just fallthrough anyway ++ } ++ // completed ++ sl->sessions[session_number].state = S_STATE_IDLE; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++} ++ ++static void en50221_sl_handle_session_package(struct en50221_session_layer *sl, ++ uint8_t *data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %i\n", ++ slot_id); ++ return; ++ } ++ if (data[0] != 2) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %i\n", ++ slot_id); ++ return; ++ } ++ // get session number ++ uint16_t session_number = (data[1] << 8) | data[2]; ++ ++ // check it ++ if (session_number >= sl->max_sessions) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with bad session_number from module on slot %i\n", ++ slot_id); ++ return; ++ } ++ ++ pthread_mutex_lock(&sl->sessions[session_number].session_lock); ++ if (slot_id != sl->sessions[session_number].slot_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (connection_id != sl->sessions[session_number].connection_id) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unexpected session on invalid slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ if (sl->sessions[session_number].state != S_STATE_ACTIVE) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with bad session_number from module on slot %i\n", ++ slot_id); ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ return; ++ } ++ ++ en50221_sl_resource_callback cb = sl->sessions[session_number].callback; ++ void *cb_arg = sl->sessions[session_number].callback_arg; ++ uint32_t resource_id = sl->sessions[session_number].resource_id; ++ pthread_mutex_unlock(&sl->sessions[session_number].session_lock); ++ ++ // there can be > 1 APDU following the package - all for the same session/resource_id tho. ++ data += 3; ++ data_length -= 3; ++ while (data_length) { ++ // check length field ++ if (data_length < 3) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received invalid sized session package from slot %i\n", ++ slot_id); ++ return; ++ } ++ // parse the APDU's length field ++ int length_field_len; ++ uint16_t asn_data_length; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data + 3, data_length - 3)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received invalid sized session package from slot %i\n", ++ slot_id); ++ return; ++ } ++ uint32_t apdu_length = 3 + length_field_len + asn_data_length; ++ ++ // check there is enough data ++ if (apdu_length > data_length) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received invalid sized session package from slot %i\n", ++ slot_id); ++ return; ++ } ++ // pass the APDU up to the higher layers ++ if (cb) ++ cb(cb_arg, slot_id, session_number, resource_id, data, apdu_length); ++ ++ // next! ++ data += apdu_length; ++ data_length -= apdu_length; ++ } ++ ++} ++ ++static void en50221_sl_transport_callback(void *arg, int reason, ++ uint8_t *data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ struct en50221_session_layer *sl = ++ (struct en50221_session_layer *) arg; ++ uint32_t i; ++ ++ // deal with the reason for this callback ++ switch (reason) { ++ case T_CALLBACK_REASON_DATA: ++ // fallthrough into rest of this function ++ break; ++ ++ case T_CALLBACK_REASON_CONNECTIONOPEN: ++ { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_TC_CONNECT, ++ slot_id, connection_id, 0); ++ return; ++ } ++ ++ case T_CALLBACK_REASON_CAMCONNECTIONOPEN: ++ { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ if (cb) ++ cb(cb_arg, ++ S_SCALLBACK_REASON_TC_CAMCONNECT, ++ slot_id, connection_id, 0); ++ return; ++ } ++ ++ case T_CALLBACK_REASON_CONNECTIONCLOSE: ++ { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ for (i = 0; i < sl->max_sessions; i++) { ++ pthread_mutex_lock(&sl->sessions[i].session_lock); ++ ++ if (sl->sessions[i].state == S_STATE_IDLE) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ if (sl->sessions[i].connection_id != connection_id) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ ++ sl->sessions[i].state = S_STATE_IDLE; ++ ++ uint8_t _slot_id = sl->sessions[i].slot_id; ++ uint32_t resource_id = sl->sessions[i].resource_id; ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_CLOSE, _slot_id, i, resource_id); ++ } ++ return; ++ } ++ ++ case T_CALLBACK_REASON_SLOTCLOSE: ++ { ++ pthread_mutex_lock(&sl->setcallback_lock); ++ en50221_sl_session_callback cb = sl->session; ++ void *cb_arg = sl->session_arg; ++ pthread_mutex_unlock(&sl->setcallback_lock); ++ ++ for (i = 0; i < sl->max_sessions; i++) { ++ pthread_mutex_lock(&sl->sessions[i].session_lock); ++ ++ if (sl->sessions[i].state == S_STATE_IDLE) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ if (sl->sessions[i].slot_id != slot_id) { ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ continue; ++ } ++ sl->sessions[i].state = S_STATE_IDLE; ++ ++ uint32_t resource_id = sl->sessions[i].resource_id; ++ pthread_mutex_unlock(&sl->sessions[i].session_lock); ++ ++ if (cb) ++ cb(cb_arg, S_SCALLBACK_REASON_CLOSE, slot_id, i, resource_id); ++ ++ } ++ return; ++ } ++ } ++ ++ // sanity check data length ++ if (data_length < 1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %i\n", ++ slot_id); ++ return; ++ } ++ // deal with the data ++ uint8_t spdu_tag = data[0]; ++ switch (spdu_tag) { ++ case ST_OPEN_SESSION_REQ: ++ en50221_sl_handle_open_session_request(sl, data + 1, ++ data_length - 1, ++ slot_id, ++ connection_id); ++ break; ++ ++ case ST_CLOSE_SESSION_REQ: ++ en50221_sl_handle_close_session_request(sl, data + 1, ++ data_length - 1, ++ slot_id, ++ connection_id); ++ break; ++ ++ case ST_SESSION_NUMBER: ++ en50221_sl_handle_session_package(sl, data + 1, ++ data_length - 1, slot_id, ++ connection_id); ++ break; ++ ++ case ST_CREATE_SESSION_RES: ++ en50221_sl_handle_create_session_response(sl, data + 1, ++ data_length - 1, ++ slot_id, ++ connection_id); ++ break; ++ ++ case ST_CLOSE_SESSION_RES: ++ en50221_sl_handle_close_session_response(sl, data + 1, ++ data_length - 1, ++ slot_id, ++ connection_id); ++ break; ++ ++ default: ++ print(LOG_LEVEL, ERROR, 1, ++ "Received unknown session tag %02x from module on slot %i", ++ spdu_tag, slot_id); ++ break; ++ } ++} ++ ++static int en50221_sl_alloc_new_session(struct en50221_session_layer *sl, ++ uint32_t resource_id, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ en50221_sl_resource_callback ++ callback, void *arg) ++{ ++ int session_number = -1; ++ uint32_t i; ++ for (i = 1; i < sl->max_sessions; i++) { ++ if (sl->sessions[i].state == S_STATE_IDLE) { ++ session_number = i; ++ break; ++ } ++ } ++ if (session_number == -1) { ++ sl->error = EN50221ERR_OUTOFSESSIONS; ++ return -1; ++ } ++ // setup the session ++ sl->sessions[session_number].state = S_STATE_IN_CREATION; ++ sl->sessions[session_number].resource_id = resource_id; ++ sl->sessions[session_number].slot_id = slot_id; ++ sl->sessions[session_number].connection_id = connection_id; ++ sl->sessions[session_number].callback = callback; ++ sl->sessions[session_number].callback_arg = arg; ++ ++ // ok ++ return session_number; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_session.h dvb-apps/lib/libdvben50221/en50221_session.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_session.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_session.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,232 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 session layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian@jusst.de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++ ++#ifndef __EN50221_SESSION_H__ ++#define __EN50221_SESSION_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define S_SCALLBACK_REASON_CAMCONNECTING 0x00 // CAM originated session connecting to resource (check for availability) ++#define S_SCALLBACK_REASON_CAMCONNECTED 0x01 // CAM originated session connection established succesfully ++#define S_SCALLBACK_REASON_CAMCONNECTFAIL 0x02 // CAM originated session connection failed ++#define S_SCALLBACK_REASON_CONNECTED 0x03 // Host originated session ACKed by CAM. ++#define S_SCALLBACK_REASON_CONNECTFAIL 0x04 // Host originated session NACKed by CAM. ++#define S_SCALLBACK_REASON_CLOSE 0x05 // Session closed ++#define S_SCALLBACK_REASON_TC_CONNECT 0x06 // A host originated transport connection has been established. ++#define S_SCALLBACK_REASON_TC_CAMCONNECT 0x07 // A CAM originated transport connection has been established. ++ ++ ++/** ++ * Opaque type representing a session layer. ++ */ ++struct en50221_session_layer; ++ ++/** ++ * Type definition for resource callback function - called by session layer when data ++ * arrives for a particular resource. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number. ++ * @param resource_id Resource id. ++ * @param data The data. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, or -1 on failure. ++ */ ++typedef int (*en50221_sl_resource_callback) (void *arg, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id, ++ uint8_t * data, ++ uint32_t data_length); ++ ++/** ++ * Type definition for resource lookup callback function - used by the session layer to ++ * look up requested resources. ++ * ++ * @param arg Private argument. ++ * @param slot_id Slot id the request came from. ++ * @param requested_resource_id Resource id requested. ++ * @param callback_out Output parameter for pointer to resource callback function. ++ * @param arg_out Output parameter for arg to pass to resource callback. ++ * @param resource_id_out Set this to the resource_id connected to (e.g. may differ from resource_id due to versions). ++ * @return 0 on success, ++ * -1 if the resource was not found, ++ * -2 if it exists, but had a lower version, or ++ * -3 if it exists, but was unavailable. ++ */ ++typedef int (*en50221_sl_lookup_callback) (void *arg, ++ uint8_t slot_id, ++ uint32_t requested_resource_id, ++ en50221_sl_resource_callback * callback_out, ++ void **arg_out, ++ uint32_t *resource_id_out); ++ ++ ++/** ++ * Type definition for session callback function - used to inform top level code when a CAM ++ * modifies a session to a resource. ++ * ++ * @param arg Private argument. ++ * @param reason One of the S_CCALLBACK_REASON_* values above. ++ * @param slot_id Slot id concerned. ++ * @param session_number Session number. ++ * @param resource_id Resource id. ++ * @return 0 on sucess, or -1 on error. ++ */ ++typedef int (*en50221_sl_session_callback) (void *arg, int reason, ++ uint8_t slot_id, ++ uint16_t session_number, ++ uint32_t resource_id); ++ ++/** ++ * Construct a new instance of the session layer. ++ * ++ * @param tl The en50221_transport_layer instance to use. ++ * @param max_sessions Maximum number of sessions supported. ++ * @return The en50221_session_layer instance, or NULL on error. ++ */ ++extern struct en50221_session_layer *en50221_sl_create(struct en50221_transport_layer *tl, ++ uint32_t max_sessions); ++ ++/** ++ * Destroy an instance of the session layer. ++ * ++ * @param tl The en50221_session_layer instance. ++ */ ++extern void en50221_sl_destroy(struct en50221_session_layer *sl); ++ ++/** ++ * Gets the last error. ++ * ++ * @param tl The en50221_session_layer instance. ++ * @return One of the EN50221ERR_* values. ++ */ ++extern int en50221_sl_get_error(struct en50221_session_layer *tl); ++ ++/** ++ * Register the callback for resource lookup. ++ * ++ * @param sl The en50221_session_layer instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_sl_register_lookup_callback(struct en50221_session_layer *sl, ++ en50221_sl_lookup_callback callback, ++ void *arg); ++ ++/** ++ * Register the callback for informing about session from a cam. ++ * ++ * @param sl The en50221_session_layer instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_sl_register_session_callback(struct en50221_session_layer *sl, ++ en50221_sl_session_callback callback, ++ void *arg); ++ ++/** ++ * Create a new session to a module in a slot. ++ * ++ * @param sl The en50221_session_layer instance. ++ * @param slot The slot to connect to. ++ * @param resource_id The resource_id to connect to. ++ * @param callback The callback for received data. ++ * @param arg Argument to pass to the callback. ++ * @return The new session_number, or -1 on error. ++ */ ++extern int en50221_sl_create_session(struct en50221_session_layer *sl, int slot_id, ++ uint8_t connection_id, ++ uint32_t resource_id, ++ en50221_sl_resource_callback callback, ++ void *arg); ++ ++/** ++ * Destroy a session. ++ * ++ * @param sl The en50221_session_layer instance. ++ * @param session_number The session to destroy. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_sl_destroy_session(struct en50221_session_layer *sl, ++ uint16_t session_number); ++ ++/** ++ * this function is used to take a data-block, pack into ++ * into a SPDU (SESSION_NUMBER) and send it to the transport layer ++ * ++ * @param sl The en50221_session_layer instance to use. ++ * @param session_number Session number concerned. ++ * @param data Data to send. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_sl_send_data(struct en50221_session_layer *sl, ++ uint16_t session_number, ++ uint8_t * data, ++ uint16_t data_length); ++ ++/** ++ * this function is used to take a data-block, pack into ++ * into a SPDU (SESSION_NUMBER) and send it to the transport layer ++ * ++ * @param sl The en50221_session_layer instance to use. ++ * @param session_number Session number concerned. ++ * @param vector IOVEC to send. ++ * @param iov_count Number of elements in io vector. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_sl_send_datav(struct en50221_session_layer *sl, ++ uint16_t session_number, ++ struct iovec *vector, ++ int iov_count); ++ ++/** ++ * this is used to send a message to all sessions, linked ++ * to resource res ++ * ++ * @param tl The en50221_session_layer instance to use. ++ * @param slot_id Set to -1 to send to any slot. Other values will send to only that slot. ++ * @param resource_id Resource id concerned. ++ * @param data Data to send. ++ * @param data_length Length of data in bytes. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_sl_broadcast_data(struct en50221_session_layer *sl, ++ int slot_id, ++ uint32_t resource_id, ++ uint8_t * data, ++ uint16_t data_length); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam.c dvb-apps/lib/libdvben50221/en50221_stdcam.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_stdcam.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "en50221_stdcam.h" ++ ++struct en50221_stdcam *en50221_stdcam_create(int adapter, int slotnum, ++ struct en50221_transport_layer *tl, ++ struct en50221_session_layer *sl) ++{ ++ struct en50221_stdcam *result = NULL; ++ ++ int cafd = dvbca_open(adapter, 0); ++ if (cafd == -1) ++ return NULL; ++ ++ int ca_type = dvbca_get_interface_type(cafd, slotnum); ++ switch(ca_type) { ++ case DVBCA_INTERFACE_LINK: ++ result = en50221_stdcam_llci_create(cafd, slotnum, tl, sl); ++ break; ++ ++ case DVBCA_INTERFACE_HLCI: ++ result = en50221_stdcam_hlci_create(cafd, slotnum); ++ break; ++ } ++ ++ if (result == NULL) ++ close(cafd); ++ return result; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam.h dvb-apps/lib/libdvben50221/en50221_stdcam.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_stdcam.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,102 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#ifndef EN50221_STDCAM_H ++#define EN50221_STDCAM_H 1 ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++enum en50221_stdcam_status { ++ EN50221_STDCAM_CAM_NONE, ++ EN50221_STDCAM_CAM_INRESET, ++ EN50221_STDCAM_CAM_OK, ++ EN50221_STDCAM_CAM_BAD, ++}; ++ ++struct en50221_stdcam { ++ /* one of more of the following may be NULL if a CAM does not support it */ ++ struct en50221_app_ai *ai_resource; ++ struct en50221_app_ca *ca_resource; ++ struct en50221_app_mmi *mmi_resource; ++ ++ /* if any of these are -1, no connection is in place to this resource yet */ ++ int ai_session_number; ++ int ca_session_number; ++ int mmi_session_number; ++ ++ /* poll the stdcam instance */ ++ enum en50221_stdcam_status (*poll)(struct en50221_stdcam *stdcam); ++ ++ /* inform the stdcam of the current DVB time */ ++ void (*dvbtime)(struct en50221_stdcam *stdcam, time_t dvbtime); ++ ++ /* destroy the stdcam instance */ ++ void (*destroy)(struct en50221_stdcam *stdcam, int closefd); ++}; ++ ++/** ++ * Create an instance of the STDCAM for an LLCI interface. ++ * ++ * @param cafd FD of the CA device. ++ * @param slotnum Slotnum on that CA device. ++ * @param tl Transport layer instance to use. ++ * @param sl Session layer instance to use. ++ * @return en50221_stdcam instance, or NULL on error. ++ */ ++extern struct en50221_stdcam *en50221_stdcam_llci_create(int cafd, int slotnum, ++ struct en50221_transport_layer *tl, ++ struct en50221_session_layer *sl); ++ ++/** ++ * Create an instance of the STDCAM for an HLCI interface. ++ * ++ * @param cafd FD of the CA device. ++ * @param slotnum Slotnum on that CA device. ++ * @return en50221_stdcam instance, or NULL on error. ++ */ ++extern struct en50221_stdcam *en50221_stdcam_hlci_create(int cafd, int slotnum); ++ ++/** ++ * Convenience method to create a STDCAM interface for a ca device on a particular adapter. ++ * ++ * @param adapter The DVB adapter concerned. ++ * @param slotnum The ca slot number on that adapter. ++ * @param tl Transport layer instance to use (unused for HLCI cams). ++ * @param sl Session layer instance to use (unused for HLCI cams). ++ * @return en50221_stdcam instance, or NULL on error. ++ */ ++extern struct en50221_stdcam *en50221_stdcam_create(int adapter, int slotnum, ++ struct en50221_transport_layer *tl, ++ struct en50221_session_layer *sl); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam_hlci.c dvb-apps/lib/libdvben50221/en50221_stdcam_hlci.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam_hlci.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_stdcam_hlci.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,216 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "en50221_app_utils.h" ++#include "en50221_app_tags.h" ++#include "en50221_stdcam.h" ++ ++ ++struct en50221_stdcam_hlci { ++ struct en50221_stdcam stdcam; ++ ++ int cafd; ++ int slotnum; ++ int initialised; ++ struct en50221_app_send_functions sendfuncs; ++}; ++ ++static void en50221_stdcam_hlci_destroy(struct en50221_stdcam *stdcam, int closefd); ++static enum en50221_stdcam_status en50221_stdcam_hlci_poll(struct en50221_stdcam *stdcam); ++static int hlci_cam_added(struct en50221_stdcam_hlci *hlci); ++static int hlci_send_data(void *arg, uint16_t session_number, ++ uint8_t * data, uint16_t data_length); ++static int hlci_send_datav(void *arg, uint16_t session_number, ++ struct iovec *vector, int iov_count); ++ ++ ++ ++ ++struct en50221_stdcam *en50221_stdcam_hlci_create(int cafd, int slotnum) ++{ ++ // try and allocate space for the HLCI stdcam ++ struct en50221_stdcam_hlci *hlci = ++ malloc(sizeof(struct en50221_stdcam_hlci)); ++ if (hlci == NULL) { ++ return NULL; ++ } ++ memset(hlci, 0, sizeof(struct en50221_stdcam_hlci)); ++ ++ // create the sendfuncs ++ hlci->sendfuncs.arg = hlci; ++ hlci->sendfuncs.send_data = hlci_send_data; ++ hlci->sendfuncs.send_datav = hlci_send_datav; ++ ++ // create the resources (NOTE: we just use fake session numbers here) ++ hlci->stdcam.ai_resource = en50221_app_ai_create(&hlci->sendfuncs); ++ hlci->stdcam.ai_session_number = 0; ++ hlci->stdcam.ca_resource = en50221_app_ca_create(&hlci->sendfuncs); ++ hlci->stdcam.ca_session_number = 1; ++// hlci->stdcam.mmi_resource = en50221_app_mmi_create(&hlci->sendfuncs); ++ hlci->stdcam.mmi_session_number = -1; ++ ++ // done ++ hlci->stdcam.destroy = en50221_stdcam_hlci_destroy; ++ hlci->stdcam.poll = en50221_stdcam_hlci_poll; ++ hlci->slotnum = slotnum; ++ hlci->cafd = cafd; ++ return &hlci->stdcam; ++} ++ ++static void en50221_stdcam_hlci_destroy(struct en50221_stdcam *stdcam, int closefd) ++{ ++ struct en50221_stdcam_hlci *hlci = (struct en50221_stdcam_hlci *) stdcam; ++ ++ if (hlci->stdcam.ai_resource) ++ en50221_app_ai_destroy(hlci->stdcam.ai_resource); ++ if (hlci->stdcam.ca_resource) ++ en50221_app_ca_destroy(hlci->stdcam.ca_resource); ++ if (hlci->stdcam.mmi_resource) ++ en50221_app_mmi_destroy(hlci->stdcam.mmi_resource); ++ ++ if (closefd) ++ close(hlci->cafd); ++ ++ free(hlci); ++} ++ ++static enum en50221_stdcam_status en50221_stdcam_hlci_poll(struct en50221_stdcam *stdcam) ++{ ++ struct en50221_stdcam_hlci *hlci = (struct en50221_stdcam_hlci *) stdcam; ++ ++ switch(dvbca_get_cam_state(hlci->cafd, hlci->slotnum)) { ++ case DVBCA_CAMSTATE_MISSING: ++ hlci->initialised = 0; ++ break; ++ ++ case DVBCA_CAMSTATE_READY: ++ case DVBCA_CAMSTATE_INITIALISING: ++ if (!hlci->initialised) ++ hlci_cam_added(hlci); ++ break; ++ } ++ ++ // delay to prevent busy loop ++ usleep(10); ++ ++ if (!hlci->initialised) { ++ return EN50221_STDCAM_CAM_NONE; ++ } ++ return EN50221_STDCAM_CAM_OK; ++} ++ ++ ++ ++static int hlci_cam_added(struct en50221_stdcam_hlci *hlci) ++{ ++ uint8_t buf[256]; ++ int size; ++ ++ // get application information ++ if (en50221_app_ai_enquiry(hlci->stdcam.ai_resource, 0)) { ++ return -EIO; ++ } ++ if ((size = dvbca_hlci_read(hlci->cafd, TAG_APP_INFO, buf, sizeof(buf))) < 0) { ++ return size; ++ } ++ if (en50221_app_ai_message(hlci->stdcam.ai_resource, 0, 0, EN50221_APP_AI_RESOURCEID, buf, size)) { ++ return -EIO; ++ } ++ ++ // we forge a fake CA_INFO here so the main app works - since it will expect a CA_INFO ++ // this will be replaced with a proper call (below) when the driver support is there ++ buf[0] = TAG_CA_INFO >> 16; ++ buf[1] = (uint8_t) (TAG_CA_INFO >> 8); ++ buf[2] = (uint8_t) TAG_CA_INFO; ++ buf[3] = 0; ++ if (en50221_app_ca_message(hlci->stdcam.ca_resource, 0, 0, EN50221_APP_CA_RESOURCEID, buf, 4)) { ++ return -EIO; ++ } ++ ++ /* ++ // get CA information ++ if (en50221_app_ca_info_enq(ca_resource, 0)) { ++ fprintf(stderr, "Failed to send CA INFO enquiry\n"); ++ cafd = -1; ++ return -1; ++ } ++ if ((size = dvbca_hlci_read(cafd, TAG_CA_INFO, buf, sizeof(buf))) < 0) { ++ fprintf(stderr, "Failed to read CA INFO\n"); ++ cafd = -1; ++ return -1; ++ } ++ if (en50221_app_ca_message(ca_resource, 0, 0, EN50221_APP_CA_RESOURCEID, buf, size)) { ++ fprintf(stderr, "Failed to parse CA INFO\n"); ++ cafd = -1; ++ return -1; ++ } ++ */ ++ ++ // done ++ hlci->initialised = 1; ++ return 0; ++} ++ ++static int hlci_send_data(void *arg, uint16_t session_number, ++ uint8_t * data, uint16_t data_length) ++{ ++ (void) session_number; ++ struct en50221_stdcam_hlci *hlci = arg; ++ ++ return dvbca_hlci_write(hlci->cafd, data, data_length); ++} ++ ++static int hlci_send_datav(void *arg, uint16_t session_number, ++ struct iovec *vector, int iov_count) ++{ ++ (void) session_number; ++ struct en50221_stdcam_hlci *hlci = arg; ++ ++ // calculate the total length of the data to send ++ uint32_t data_size = 0; ++ int i; ++ for (i = 0; i < iov_count; i++) { ++ data_size += vector[i].iov_len; ++ } ++ ++ // allocate memory for it ++ uint8_t *buf = malloc(data_size); ++ if (buf == NULL) { ++ return -1; ++ } ++ // merge the iovecs ++ uint32_t pos = 0; ++ for (i = 0; i < iov_count; i++) { ++ memcpy(buf + pos, vector[i].iov_base, vector[i].iov_len); ++ pos += vector[i].iov_len; ++ } ++ ++ // sendit and cleanup ++ int status = dvbca_hlci_write(hlci->cafd, buf, data_size); ++ free(buf); ++ return status; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam_llci.c dvb-apps/lib/libdvben50221/en50221_stdcam_llci.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_stdcam_llci.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_stdcam_llci.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,437 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "en50221_app_rm.h" ++#include "en50221_app_datetime.h" ++#include "en50221_app_utils.h" ++#include "en50221_app_tags.h" ++#include "en50221_stdcam.h" ++ ++#define LLCI_RESPONSE_TIMEOUT_MS 1000 ++#define LLCI_POLL_DELAY_MS 100 ++ ++/* resource IDs we support */ ++static uint32_t resource_ids[] = ++{ EN50221_APP_RM_RESOURCEID, ++ EN50221_APP_CA_RESOURCEID, ++ EN50221_APP_AI_RESOURCEID, ++ EN50221_APP_MMI_RESOURCEID, ++ EN50221_APP_DATETIME_RESOURCEID, ++}; ++#define RESOURCE_IDS_COUNT sizeof(resource_ids)/4 ++ ++struct llci_resource { ++ struct en50221_app_public_resource_id resid; ++ uint32_t binary_resource_id; ++ en50221_sl_resource_callback callback; ++ void *arg; ++}; ++ ++struct en50221_stdcam_llci { ++ struct en50221_stdcam stdcam; ++ ++ int cafd; ++ int slotnum; ++ int state; ++ ++ struct llci_resource resources[RESOURCE_IDS_COUNT]; ++ ++ struct en50221_transport_layer *tl; ++ struct en50221_session_layer *sl; ++ struct en50221_app_send_functions sendfuncs; ++ int tl_slot_id; ++ ++ struct en50221_app_rm *rm_resource; ++ ++ struct en50221_app_datetime *datetime_resource; ++ int datetime_session_number; ++ uint8_t datetime_response_interval; ++ time_t datetime_next_send; ++ time_t datetime_dvbtime; ++}; ++ ++static enum en50221_stdcam_status en50221_stdcam_llci_poll(struct en50221_stdcam *stdcam); ++static void en50221_stdcam_llci_dvbtime(struct en50221_stdcam *stdcam, time_t dvbtime); ++static void en50221_stdcam_llci_destroy(struct en50221_stdcam *stdcam, int closefd); ++static void llci_cam_added(struct en50221_stdcam_llci *llci); ++static void llci_cam_in_reset(struct en50221_stdcam_llci *llci); ++static void llci_cam_removed(struct en50221_stdcam_llci *llci); ++ ++ ++static int llci_lookup_callback(void *arg, uint8_t _slot_id, uint32_t requested_resource_id, ++ en50221_sl_resource_callback *callback_out, void **arg_out, ++ uint32_t *connected_resource_id); ++static int llci_session_callback(void *arg, int reason, uint8_t _slot_id, uint16_t session_number, uint32_t resource_id); ++static int llci_rm_enq_callback(void *arg, uint8_t _slot_id, uint16_t session_number); ++static int llci_rm_reply_callback(void *arg, uint8_t _slot_id, uint16_t session_number, uint32_t resource_id_count, uint32_t *_resource_ids); ++static int llci_rm_changed_callback(void *arg, uint8_t _slot_id, uint16_t session_number); ++ ++static int llci_datetime_enquiry_callback(void *arg, uint8_t _slot_id, uint16_t session_number, uint8_t response_interval); ++ ++ ++struct en50221_stdcam *en50221_stdcam_llci_create(int cafd, int slotnum, ++ struct en50221_transport_layer *tl, ++ struct en50221_session_layer *sl) ++{ ++ // try and allocate space for the LLCI stdcam ++ struct en50221_stdcam_llci *llci = ++ malloc(sizeof(struct en50221_stdcam_llci)); ++ if (llci == NULL) { ++ return NULL; ++ } ++ memset(llci, 0, sizeof(struct en50221_stdcam_llci)); ++ ++ // create the sendfuncs ++ llci->sendfuncs.arg = sl; ++ llci->sendfuncs.send_data = (en50221_send_data) en50221_sl_send_data; ++ llci->sendfuncs.send_datav = (en50221_send_datav) en50221_sl_send_datav; ++ ++ // create the resource manager resource ++ int resource_idx = 0; ++ llci->rm_resource = en50221_app_rm_create(&llci->sendfuncs); ++ en50221_app_decode_public_resource_id(&llci->resources[resource_idx].resid, EN50221_APP_RM_RESOURCEID); ++ llci->resources[resource_idx].binary_resource_id = EN50221_APP_RM_RESOURCEID; ++ llci->resources[resource_idx].callback = (en50221_sl_resource_callback) en50221_app_rm_message; ++ llci->resources[resource_idx].arg = llci->rm_resource; ++ en50221_app_rm_register_enq_callback(llci->rm_resource, llci_rm_enq_callback, llci); ++ en50221_app_rm_register_reply_callback(llci->rm_resource, llci_rm_reply_callback, llci); ++ en50221_app_rm_register_changed_callback(llci->rm_resource, llci_rm_changed_callback, llci); ++ resource_idx++; ++ ++ // create the datetime resource ++ llci->datetime_resource = en50221_app_datetime_create(&llci->sendfuncs); ++ en50221_app_decode_public_resource_id(&llci->resources[resource_idx].resid, EN50221_APP_DATETIME_RESOURCEID); ++ llci->resources[resource_idx].binary_resource_id = EN50221_APP_DATETIME_RESOURCEID; ++ llci->resources[resource_idx].callback = (en50221_sl_resource_callback) en50221_app_datetime_message; ++ llci->resources[resource_idx].arg = llci->datetime_resource; ++ en50221_app_datetime_register_enquiry_callback(llci->datetime_resource, llci_datetime_enquiry_callback, llci); ++ resource_idx++; ++ llci->datetime_session_number = -1; ++ llci->datetime_response_interval = 0; ++ llci->datetime_next_send = 0; ++ llci->datetime_dvbtime = 0; ++ ++ // create the application information resource ++ llci->stdcam.ai_resource = en50221_app_ai_create(&llci->sendfuncs); ++ en50221_app_decode_public_resource_id(&llci->resources[resource_idx].resid, EN50221_APP_AI_RESOURCEID); ++ llci->resources[resource_idx].binary_resource_id = EN50221_APP_AI_RESOURCEID; ++ llci->resources[resource_idx].callback = (en50221_sl_resource_callback) en50221_app_ai_message; ++ llci->resources[resource_idx].arg = llci->stdcam.ai_resource; ++ llci->stdcam.ai_session_number = -1; ++ resource_idx++; ++ ++ // create the CA resource ++ llci->stdcam.ca_resource = en50221_app_ca_create(&llci->sendfuncs); ++ en50221_app_decode_public_resource_id(&llci->resources[resource_idx].resid, EN50221_APP_CA_RESOURCEID); ++ llci->resources[resource_idx].binary_resource_id = EN50221_APP_CA_RESOURCEID; ++ llci->resources[resource_idx].callback = (en50221_sl_resource_callback) en50221_app_ca_message; ++ llci->resources[resource_idx].arg = llci->stdcam.ca_resource; ++ llci->stdcam.ca_session_number = -1; ++ resource_idx++; ++ ++ // create the MMI resource ++ llci->stdcam.mmi_resource = en50221_app_mmi_create(&llci->sendfuncs); ++ en50221_app_decode_public_resource_id(&llci->resources[resource_idx].resid, EN50221_APP_MMI_RESOURCEID); ++ llci->resources[resource_idx].binary_resource_id = EN50221_APP_MMI_RESOURCEID; ++ llci->resources[resource_idx].callback = (en50221_sl_resource_callback) en50221_app_mmi_message; ++ llci->resources[resource_idx].arg = llci->stdcam.mmi_resource; ++ llci->stdcam.mmi_session_number = -1; ++ resource_idx++; ++ ++ // register session layer callbacks ++ en50221_sl_register_lookup_callback(sl, llci_lookup_callback, llci); ++ en50221_sl_register_session_callback(sl, llci_session_callback, llci); ++ ++ // done ++ llci->stdcam.destroy = en50221_stdcam_llci_destroy; ++ llci->stdcam.poll = en50221_stdcam_llci_poll; ++ llci->stdcam.dvbtime = en50221_stdcam_llci_dvbtime; ++ llci->cafd = cafd; ++ llci->slotnum = slotnum; ++ llci->tl = tl; ++ llci->sl = sl; ++ llci->tl_slot_id = -1; ++ llci->state = EN50221_STDCAM_CAM_NONE; ++ return &llci->stdcam; ++} ++ ++static void en50221_stdcam_llci_dvbtime(struct en50221_stdcam *stdcam, time_t dvbtime) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) stdcam; ++ ++ llci->datetime_dvbtime = dvbtime; ++} ++ ++static void en50221_stdcam_llci_destroy(struct en50221_stdcam *stdcam, int closefd) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) stdcam; ++ ++ // "remove" the cam ++ llci_cam_removed(llci); ++ ++ // destroy resources ++ if (llci->rm_resource) ++ en50221_app_rm_destroy(llci->rm_resource); ++ if (llci->datetime_resource) ++ en50221_app_datetime_destroy(llci->datetime_resource); ++ if (llci->stdcam.ai_resource) ++ en50221_app_ai_destroy(llci->stdcam.ai_resource); ++ if (llci->stdcam.ca_resource) ++ en50221_app_ca_destroy(llci->stdcam.ca_resource); ++ if (llci->stdcam.mmi_resource) ++ en50221_app_mmi_destroy(llci->stdcam.mmi_resource); ++ ++ if (closefd) ++ close(llci->cafd); ++ ++ free(llci); ++} ++ ++ ++ ++ ++static enum en50221_stdcam_status en50221_stdcam_llci_poll(struct en50221_stdcam *stdcam) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) stdcam; ++ ++ switch(dvbca_get_cam_state(llci->cafd, llci->slotnum)) { ++ case DVBCA_CAMSTATE_MISSING: ++ if (llci->state != EN50221_STDCAM_CAM_NONE) ++ llci_cam_removed(llci); ++ break; ++ ++ case DVBCA_CAMSTATE_READY: ++ if (llci->state == EN50221_STDCAM_CAM_NONE) ++ llci_cam_added(llci); ++ else if (llci->state == EN50221_STDCAM_CAM_INRESET) ++ llci_cam_in_reset(llci); ++ break; ++ } ++ ++ // poll the stack ++ int error; ++ if ((error = en50221_tl_poll(llci->tl)) != 0) { ++ print(LOG_LEVEL, ERROR, 1, "Error reported by stack:%i\n", en50221_tl_get_error(llci->tl)); ++ } ++ ++ // send date/time response ++ if (llci->datetime_session_number != -1) { ++ time_t cur_time = time(NULL); ++ if (llci->datetime_response_interval && (cur_time > llci->datetime_next_send)) { ++ en50221_app_datetime_send(llci->datetime_resource, ++ llci->datetime_session_number, ++ llci->datetime_dvbtime, 0); ++ llci->datetime_next_send = cur_time + llci->datetime_response_interval; ++ } ++ } ++ ++ return llci->state; ++} ++ ++static void llci_cam_added(struct en50221_stdcam_llci *llci) ++{ ++ // clear down any old structures ++ if (llci->tl_slot_id != -1) { ++ llci_cam_removed(llci); ++ } ++ ++ // reset the CAM ++ dvbca_reset(llci->cafd, llci->slotnum); ++ llci->state = EN50221_STDCAM_CAM_INRESET; ++} ++ ++static void llci_cam_in_reset(struct en50221_stdcam_llci *llci) ++{ ++ if (dvbca_get_cam_state(llci->cafd, llci->slotnum) != DVBCA_CAMSTATE_READY) { ++ return; ++ } ++ ++ // register the slot ++ if ((llci->tl_slot_id = en50221_tl_register_slot(llci->tl, llci->cafd, llci->slotnum, ++ LLCI_RESPONSE_TIMEOUT_MS, LLCI_POLL_DELAY_MS)) < 0) { ++ llci->state = EN50221_STDCAM_CAM_BAD; ++ return; ++ } ++ ++ // create a new connection on the slot ++ if (en50221_tl_new_tc(llci->tl, llci->tl_slot_id) < 0) { ++ llci->state = EN50221_STDCAM_CAM_BAD; ++ llci->tl_slot_id = -1; ++ en50221_tl_destroy_slot(llci->tl, llci->tl_slot_id); ++ return; ++ } ++ ++ llci->state = EN50221_STDCAM_CAM_OK; ++} ++ ++static void llci_cam_removed(struct en50221_stdcam_llci *llci) ++{ ++ if (llci->tl_slot_id != -1) { ++ en50221_tl_destroy_slot(llci->tl, llci->tl_slot_id); ++ llci->tl_slot_id = -1; ++ llci->datetime_session_number = -1; ++ llci->stdcam.ai_session_number = -1; ++ llci->stdcam.ca_session_number = -1; ++ llci->stdcam.mmi_session_number = -1; ++ } ++ llci->state = EN50221_STDCAM_CAM_NONE; ++} ++ ++ ++ ++static int llci_lookup_callback(void *arg, uint8_t _slot_id, uint32_t requested_resource_id, ++ en50221_sl_resource_callback *callback_out, void **arg_out, ++ uint32_t *connected_resource_id) ++{ ++ struct en50221_app_public_resource_id resid; ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ ++ // decode the resource id ++ if (!en50221_app_decode_public_resource_id(&resid, requested_resource_id)) { ++ return -1; ++ } ++ ++ // try and find an instance of the resource ++ uint32_t i; ++ for(i=0; iresources[i].resid.resource_class) && ++ (resid.resource_type == llci->resources[i].resid.resource_type)) { ++ ++ // limit sessions to certain resources ++ switch(requested_resource_id) { ++ case EN50221_APP_DATETIME_RESOURCEID: ++ if (llci->datetime_session_number != -1) ++ return -3; ++ break; ++ case EN50221_APP_AI_RESOURCEID: ++ if (llci->stdcam.ai_session_number != -1) ++ return -3; ++ break; ++ case EN50221_APP_CA_RESOURCEID: ++ if (llci->stdcam.ca_session_number != -1) ++ return -3; ++ break; ++ case EN50221_APP_MMI_RESOURCEID: ++ if (llci->stdcam.mmi_session_number != -1) ++ return -3; ++ break; ++ } ++ ++ // resource is ok. ++ *callback_out = llci->resources[i].callback; ++ *arg_out = llci->resources[i].arg; ++ *connected_resource_id = llci->resources[i].binary_resource_id; ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++static int llci_session_callback(void *arg, int reason, uint8_t _slot_id, uint16_t session_number, uint32_t resource_id) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ ++ switch(reason) { ++ case S_SCALLBACK_REASON_CAMCONNECTED: ++ if (resource_id == EN50221_APP_RM_RESOURCEID) { ++ en50221_app_rm_enq(llci->rm_resource, session_number); ++ } else if (resource_id == EN50221_APP_DATETIME_RESOURCEID) { ++ llci->datetime_session_number = session_number; ++ } else if (resource_id == EN50221_APP_AI_RESOURCEID) { ++ en50221_app_ai_enquiry(llci->stdcam.ai_resource, session_number); ++ llci->stdcam.ai_session_number = session_number; ++ } else if (resource_id == EN50221_APP_CA_RESOURCEID) { ++ en50221_app_ca_info_enq(llci->stdcam.ca_resource, session_number); ++ llci->stdcam.ca_session_number = session_number; ++ } else if (resource_id == EN50221_APP_MMI_RESOURCEID) { ++ llci->stdcam.mmi_session_number = session_number; ++ } ++ ++ break; ++ case S_SCALLBACK_REASON_CLOSE: ++ if (resource_id == EN50221_APP_MMI_RESOURCEID) { ++ llci->stdcam.mmi_session_number = -1; ++ } ++ ++ break; ++ } ++ return 0; ++} ++ ++static int llci_rm_enq_callback(void *arg, uint8_t _slot_id, uint16_t session_number) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ ++ if (en50221_app_rm_reply(llci->rm_resource, session_number, RESOURCE_IDS_COUNT, resource_ids)) { ++ print(LOG_LEVEL, ERROR, 1, "Failed to send RM ENQ on slot %02x\n", _slot_id); ++ } ++ return 0; ++} ++ ++static int llci_rm_reply_callback(void *arg, uint8_t _slot_id, uint16_t session_number, uint32_t resource_id_count, uint32_t *_resource_ids) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ (void) resource_id_count; ++ (void) _resource_ids; ++ ++ if (en50221_app_rm_changed(llci->rm_resource, session_number)) { ++ print(LOG_LEVEL, ERROR, 1, "Failed to send RM REPLY on slot %02x\n", _slot_id); ++ } ++ return 0; ++} ++ ++static int llci_rm_changed_callback(void *arg, uint8_t _slot_id, uint16_t session_number) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ ++ if (en50221_app_rm_enq(llci->rm_resource, session_number)) { ++ print(LOG_LEVEL, ERROR, 1, "Failed to send RM CHANGED on slot %02x\n", _slot_id); ++ } ++ return 0; ++} ++ ++static int llci_datetime_enquiry_callback(void *arg, uint8_t _slot_id, uint16_t session_number, uint8_t response_interval) ++{ ++ struct en50221_stdcam_llci *llci = (struct en50221_stdcam_llci *) arg; ++ (void) _slot_id; ++ ++ llci->datetime_response_interval = response_interval; ++ llci->datetime_next_send = 0; ++ if (response_interval) { ++ llci->datetime_next_send = time(NULL) + response_interval; ++ } ++ en50221_app_datetime_send(llci->datetime_resource, session_number, llci->datetime_dvbtime, 0); ++ ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_transport.c dvb-apps/lib/libdvben50221/en50221_transport.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_transport.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_transport.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,1296 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "en50221_errno.h" ++#include "en50221_transport.h" ++#include "asn_1.h" ++ ++// these are the Transport Tags, like ++// described in EN50221, Annex A.4.1.13 (pg70) ++#define T_SB 0x80 // sb primitive h<--m ++#define T_RCV 0x81 // receive primitive h-->m ++#define T_CREATE_T_C 0x82 // create transport connection primitive h-->m ++#define T_C_T_C_REPLY 0x83 // ctc reply primitive h<--m ++#define T_DELETE_T_C 0x84 // delete tc primitive h<->m ++#define T_D_T_C_REPLY 0x85 // dtc reply primitive h<->m ++#define T_REQUEST_T_C 0x86 // request transport connection primitive h<--m ++#define T_NEW_T_C 0x87 // new tc / reply to t_request primitive h-->m ++#define T_T_C_ERROR 0x77 // error creating tc primitive h-->m ++#define T_DATA_LAST 0xA0 // convey data from higher constructed h<->m ++ // layers ++#define T_DATA_MORE 0xA1 // convey data from higher constructed h<->m ++ // layers ++ ++struct en50221_message { ++ struct en50221_message *next; ++ uint32_t length; ++ uint8_t data[0]; ++}; ++ ++struct en50221_connection { ++ uint32_t state; // the current state: idle/in_delete/in_create/active ++ struct timeval tx_time; // time last request was sent from host->module, or 0 if ok ++ struct timeval last_poll_time; // time of last poll transmission ++ uint8_t *chain_buffer; // used to save parts of chained packets ++ uint32_t buffer_length; ++ ++ struct en50221_message *send_queue; ++ struct en50221_message *send_queue_tail; ++}; ++ ++struct en50221_slot { ++ int ca_hndl; ++ uint8_t slot; // CAM slot ++ struct en50221_connection *connections; ++ ++ pthread_mutex_t slot_lock; ++ ++ uint32_t response_timeout; ++ uint32_t poll_delay; ++}; ++ ++struct en50221_transport_layer { ++ uint8_t max_slots; ++ uint8_t max_connections_per_slot; ++ struct en50221_slot *slots; ++ struct pollfd *slot_pollfds; ++ int slots_changed; ++ ++ pthread_mutex_t global_lock; ++ pthread_mutex_t setcallback_lock; ++ ++ int error; ++ int error_slot; ++ ++ en50221_tl_callback callback; ++ void *callback_arg; ++}; ++ ++static int en50221_tl_process_data(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t * data, ++ uint32_t data_length); ++static int en50221_tl_poll_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id); ++static int en50221_tl_alloc_new_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id); ++static void queue_message(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ struct en50221_message *msg); ++static int en50221_tl_handle_create_tc_reply(struct en50221_transport_layer ++ *tl, uint8_t slot_id, ++ uint8_t connection_id); ++static int en50221_tl_handle_delete_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id); ++static int en50221_tl_handle_delete_tc_reply(struct en50221_transport_layer ++ *tl, uint8_t slot_id, ++ uint8_t connection_id); ++static int en50221_tl_handle_request_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id); ++static int en50221_tl_handle_data_more(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_tl_handle_data_last(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ uint8_t * data, ++ uint32_t data_length); ++static int en50221_tl_handle_sb(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ uint8_t * data, uint32_t data_length); ++ ++ ++struct en50221_transport_layer *en50221_tl_create(uint8_t max_slots, ++ uint8_t ++ max_connections_per_slot) ++{ ++ struct en50221_transport_layer *tl = NULL; ++ int i; ++ int j; ++ ++ // setup structure ++ tl = (struct en50221_transport_layer *) ++ malloc(sizeof(struct en50221_transport_layer)); ++ if (tl == NULL) ++ goto error_exit; ++ tl->max_slots = max_slots; ++ tl->max_connections_per_slot = max_connections_per_slot; ++ tl->slots = NULL; ++ tl->slot_pollfds = NULL; ++ tl->slots_changed = 1; ++ tl->callback = NULL; ++ tl->callback_arg = NULL; ++ tl->error_slot = 0; ++ tl->error = 0; ++ pthread_mutex_init(&tl->global_lock, NULL); ++ pthread_mutex_init(&tl->setcallback_lock, NULL); ++ ++ // create the slots ++ tl->slots = malloc(sizeof(struct en50221_slot) * max_slots); ++ if (tl->slots == NULL) ++ goto error_exit; ++ ++ // set them up ++ for (i = 0; i < max_slots; i++) { ++ tl->slots[i].ca_hndl = -1; ++ ++ // create the connections for this slot ++ tl->slots[i].connections = ++ malloc(sizeof(struct en50221_connection) * max_connections_per_slot); ++ if (tl->slots[i].connections == NULL) ++ goto error_exit; ++ ++ // create a mutex for the slot ++ pthread_mutex_init(&tl->slots[i].slot_lock, NULL); ++ ++ // set them up ++ for (j = 0; j < max_connections_per_slot; j++) { ++ tl->slots[i].connections[j].state = T_STATE_IDLE; ++ tl->slots[i].connections[j].tx_time.tv_sec = 0; ++ tl->slots[i].connections[j].last_poll_time.tv_sec = 0; ++ tl->slots[i].connections[j].last_poll_time.tv_usec = 0; ++ tl->slots[i].connections[j].chain_buffer = NULL; ++ tl->slots[i].connections[j].buffer_length = 0; ++ tl->slots[i].connections[j].send_queue = NULL; ++ tl->slots[i].connections[j].send_queue_tail = NULL; ++ } ++ } ++ ++ // create the pollfds ++ tl->slot_pollfds = malloc(sizeof(struct pollfd) * max_slots); ++ if (tl->slot_pollfds == NULL) { ++ goto error_exit; ++ } ++ memset(tl->slot_pollfds, 0, sizeof(struct pollfd) * max_slots); ++ ++ return tl; ++ ++ error_exit: ++ en50221_tl_destroy(tl); ++ return NULL; ++} ++ ++// Destroy an instance of the transport layer ++void en50221_tl_destroy(struct en50221_transport_layer *tl) ++{ ++ int i, j; ++ ++ if (tl) { ++ if (tl->slots) { ++ for (i = 0; i < tl->max_slots; i++) { ++ if (tl->slots[i].connections) { ++ for (j = 0; j < tl->max_connections_per_slot; j++) { ++ if (tl->slots[i].connections[j].chain_buffer) { ++ free(tl->slots[i].connections[j].chain_buffer); ++ } ++ ++ struct en50221_message *cur_msg = ++ tl->slots[i].connections[j].send_queue; ++ while (cur_msg) { ++ struct en50221_message *next_msg = cur_msg->next; ++ free(cur_msg); ++ cur_msg = next_msg; ++ } ++ tl->slots[i].connections[j].send_queue = NULL; ++ tl->slots[i].connections[j].send_queue_tail = NULL; ++ } ++ free(tl->slots[i].connections); ++ pthread_mutex_destroy(&tl->slots[i].slot_lock); ++ } ++ } ++ free(tl->slots); ++ } ++ if (tl->slot_pollfds) { ++ free(tl->slot_pollfds); ++ } ++ pthread_mutex_destroy(&tl->setcallback_lock); ++ pthread_mutex_destroy(&tl->global_lock); ++ free(tl); ++ } ++} ++ ++// this can be called from the user-space app to ++// register new slots that we should work with ++int en50221_tl_register_slot(struct en50221_transport_layer *tl, ++ int ca_hndl, uint8_t slot, ++ uint32_t response_timeout, ++ uint32_t poll_delay) ++{ ++ // lock ++ pthread_mutex_lock(&tl->global_lock); ++ ++ // we browse through the array of slots ++ // to look for the first unused one ++ int i; ++ int16_t slot_id = -1; ++ for (i = 0; i < tl->max_slots; i++) { ++ if (tl->slots[i].ca_hndl == -1) { ++ slot_id = i; ++ break; ++ } ++ } ++ if (slot_id == -1) { ++ tl->error = EN50221ERR_OUTOFSLOTS; ++ pthread_mutex_unlock(&tl->global_lock); ++ return -1; ++ } ++ // set up the slot struct ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ tl->slots[slot_id].ca_hndl = ca_hndl; ++ tl->slots[slot_id].slot = slot; ++ tl->slots[slot_id].response_timeout = response_timeout; ++ tl->slots[slot_id].poll_delay = poll_delay; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ ++ tl->slots_changed = 1; ++ pthread_mutex_unlock(&tl->global_lock); ++ return slot_id; ++} ++ ++void en50221_tl_destroy_slot(struct en50221_transport_layer *tl, ++ uint8_t slot_id) ++{ ++ int i; ++ ++ if (slot_id >= tl->max_slots) ++ return; ++ ++ // lock ++ pthread_mutex_lock(&tl->global_lock); ++ ++ // clear the slot ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ tl->slots[slot_id].ca_hndl = -1; ++ for (i = 0; i < tl->max_connections_per_slot; i++) { ++ tl->slots[slot_id].connections[i].state = T_STATE_IDLE; ++ tl->slots[slot_id].connections[i].tx_time.tv_sec = 0; ++ tl->slots[slot_id].connections[i].last_poll_time.tv_sec = 0; ++ tl->slots[slot_id].connections[i].last_poll_time.tv_usec = 0; ++ if (tl->slots[slot_id].connections[i].chain_buffer) { ++ free(tl->slots[slot_id].connections[i]. ++ chain_buffer); ++ } ++ tl->slots[slot_id].connections[i].chain_buffer = NULL; ++ tl->slots[slot_id].connections[i].buffer_length = 0; ++ ++ struct en50221_message *cur_msg = ++ tl->slots[slot_id].connections[i].send_queue; ++ while (cur_msg) { ++ struct en50221_message *next_msg = cur_msg->next; ++ free(cur_msg); ++ cur_msg = next_msg; ++ } ++ tl->slots[slot_id].connections[i].send_queue = NULL; ++ tl->slots[slot_id].connections[i].send_queue_tail = NULL; ++ } ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ ++ // tell upper layers ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, T_CALLBACK_REASON_SLOTCLOSE, NULL, 0, slot_id, 0); ++ ++ tl->slots_changed = 1; ++ pthread_mutex_unlock(&tl->global_lock); ++} ++ ++int en50221_tl_poll(struct en50221_transport_layer *tl) ++{ ++ uint8_t data[4096]; ++ int slot_id; ++ int j; ++ ++ // make up pollfds if the slots have changed ++ pthread_mutex_lock(&tl->global_lock); ++ if (tl->slots_changed) { ++ for (slot_id = 0; slot_id < tl->max_slots; slot_id++) { ++ if (tl->slots[slot_id].ca_hndl != -1) { ++ tl->slot_pollfds[slot_id].fd = tl->slots[slot_id].ca_hndl; ++ tl->slot_pollfds[slot_id].events = POLLIN | POLLPRI | POLLERR; ++ tl->slot_pollfds[slot_id].revents = 0; ++ } else { ++ tl->slot_pollfds[slot_id].fd = 0; ++ tl->slot_pollfds[slot_id].events = 0; ++ tl->slot_pollfds[slot_id].revents = 0; ++ } ++ } ++ tl->slots_changed = 0; ++ } ++ pthread_mutex_unlock(&tl->global_lock); ++ ++ // anything happened? ++ if (poll(tl->slot_pollfds, tl->max_slots, 10) < 0) { ++ tl->error_slot = -1; ++ tl->error = EN50221ERR_CAREAD; ++ return -1; ++ } ++ // go through all slots (even though poll may not have reported any events ++ for (slot_id = 0; slot_id < tl->max_slots; slot_id++) { ++ ++ // check if this slot is still used and get its handle ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ continue; ++ } ++ int ca_hndl = tl->slots[slot_id].ca_hndl; ++ ++ if (tl->slot_pollfds[slot_id].revents & (POLLPRI | POLLIN)) { ++ // read data ++ uint8_t r_slot_id; ++ uint8_t connection_id; ++ int readcnt = dvbca_link_read(ca_hndl, &r_slot_id, ++ &connection_id, ++ data, sizeof(data)); ++ if (readcnt < 0) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAREAD; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // process it if we got some ++ if (readcnt > 0) { ++ if (tl->slots[slot_id].slot != r_slot_id) { ++ // this message is for an other CAM of the same CA ++ int new_slot_id; ++ for (new_slot_id = 0; new_slot_id < tl->max_slots; new_slot_id++) { ++ if ((tl->slots[new_slot_id].ca_hndl == ca_hndl) && ++ (tl->slots[new_slot_id].slot == r_slot_id)) ++ break; ++ } ++ if (new_slot_id != tl->max_slots) { ++ // we found the requested CAM ++ pthread_mutex_lock(&tl->slots[new_slot_id].slot_lock); ++ if (en50221_tl_process_data(tl, new_slot_id, data, readcnt)) { ++ pthread_mutex_unlock(&tl->slots[new_slot_id].slot_lock); ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ pthread_mutex_unlock(&tl->slots[new_slot_id].slot_lock); ++ } else { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ } else ++ if (en50221_tl_process_data(tl, slot_id, data, readcnt)) { ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ } ++ } else if (tl->slot_pollfds[slot_id].revents & POLLERR) { ++ // an error was reported ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAREAD; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // poll the connections on this slot + check for timeouts ++ for (j = 0; j < tl->max_connections_per_slot; j++) { ++ // ignore connection if idle ++ if (tl->slots[slot_id].connections[j].state == T_STATE_IDLE) { ++ continue; ++ } ++ // send queued data ++ if (tl->slots[slot_id].connections[j].state & ++ (T_STATE_IN_CREATION | T_STATE_ACTIVE | T_STATE_ACTIVE_DELETEQUEUED)) { ++ // send data if there is some to go and we're not waiting for a response already ++ if (tl->slots[slot_id].connections[j].send_queue && ++ (tl->slots[slot_id].connections[j].tx_time.tv_sec == 0)) { ++ ++ // get the message ++ struct en50221_message *msg = ++ tl->slots[slot_id].connections[j].send_queue; ++ if (msg->next != NULL) { ++ tl->slots[slot_id].connections[j].send_queue = msg->next; ++ } else { ++ tl->slots[slot_id].connections[j].send_queue = NULL; ++ tl->slots[slot_id].connections[j].send_queue_tail = NULL; ++ } ++ ++ // send the message ++ if (dvbca_link_write(tl->slots[slot_id].ca_hndl, ++ tl->slots[slot_id].slot, ++ j, ++ msg->data, msg->length) < 0) { ++ free(msg); ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ print(LOG_LEVEL, ERROR, 1, "CAWrite failed"); ++ return -1; ++ } ++ gettimeofday(&tl->slots[slot_id].connections[j].tx_time, 0); ++ ++ // fixup connection state for T_DELETE_T_C ++ if (msg->length && (msg->data[0] == T_DELETE_T_C)) { ++ tl->slots[slot_id].connections[j].state = T_STATE_IN_DELETION; ++ if (tl->slots[slot_id].connections[j].chain_buffer) { ++ free(tl->slots[slot_id].connections[j].chain_buffer); ++ } ++ tl->slots[slot_id].connections[j].chain_buffer = NULL; ++ tl->slots[slot_id].connections[j].buffer_length = 0; ++ } ++ ++ free(msg); ++ } ++ } ++ // poll it if we're not expecting a reponse and the poll time has elapsed ++ if (tl->slots[slot_id].connections[j].state & T_STATE_ACTIVE) { ++ if ((tl->slots[slot_id].connections[j].tx_time.tv_sec == 0) && ++ (time_after(tl->slots[slot_id].connections[j].last_poll_time, ++ tl->slots[slot_id].poll_delay))) { ++ ++ gettimeofday(&tl->slots[slot_id].connections[j].last_poll_time, 0); ++ if (en50221_tl_poll_tc(tl, slot_id, j)) { ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ } ++ } ++ ++ // check for timeouts - in any state ++ if (tl->slots[slot_id].connections[j].tx_time.tv_sec && ++ (time_after(tl->slots[slot_id].connections[j].tx_time, ++ tl->slots[slot_id].response_timeout))) { ++ ++ if (tl->slots[slot_id].connections[j].state & ++ (T_STATE_IN_CREATION |T_STATE_IN_DELETION)) { ++ tl->slots[slot_id].connections[j].state = T_STATE_IDLE; ++ } else if (tl->slots[slot_id].connections[j].state & ++ (T_STATE_ACTIVE | T_STATE_ACTIVE_DELETEQUEUED)) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_TIMEOUT; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ } ++ } ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ } ++ ++ return 0; ++} ++ ++void en50221_tl_register_callback(struct en50221_transport_layer *tl, ++ en50221_tl_callback callback, void *arg) ++{ ++ pthread_mutex_lock(&tl->setcallback_lock); ++ tl->callback = callback; ++ tl->callback_arg = arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++} ++ ++int en50221_tl_get_error_slot(struct en50221_transport_layer *tl) ++{ ++ return tl->error_slot; ++} ++ ++int en50221_tl_get_error(struct en50221_transport_layer *tl) ++{ ++ return tl->error; ++} ++ ++int en50221_tl_send_data(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ uint8_t * data, uint32_t data_size) ++{ ++#ifdef DEBUG_TXDATA ++ printf("[[[[[[[[[[[[[[[[[[[[\n"); ++ uint32_t ii = 0; ++ for (ii = 0; ii < data_size; ii++) { ++ printf("%02x: %02x\n", ii, data[ii]); ++ } ++ printf("]]]]]]]]]]]]]]]]]]]]\n"); ++#endif ++ ++ if (slot_id >= tl->max_slots) { ++ tl->error = EN50221ERR_BADSLOTID; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (connection_id >= tl->max_connections_per_slot) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (tl->slots[slot_id].connections[connection_id].state != T_STATE_ACTIVE) { ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // allocate msg structure ++ struct en50221_message *msg = ++ malloc(sizeof(struct en50221_message) + data_size + 10); ++ if (msg == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // make up data to send ++ int length_field_len; ++ msg->data[0] = T_DATA_LAST; ++ if ((length_field_len = asn_1_encode(data_size + 1, msg->data + 1, 3)) < 0) { ++ free(msg); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_ASNENCODE; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ msg->data[1 + length_field_len] = connection_id; ++ memcpy(msg->data + 1 + length_field_len + 1, data, data_size); ++ msg->length = 1 + length_field_len + 1 + data_size; ++ ++ // queue it for transmission ++ queue_message(tl, slot_id, connection_id, msg); ++ ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return 0; ++} ++ ++int en50221_tl_send_datav(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ struct iovec *vector, int iov_count) ++{ ++#ifdef DEBUG_TXDATA ++ printf("[[[[[[[[[[[[[[[[[[[[\n"); ++ uint32_t ii = 0; ++ uint32_t iipos = 0; ++ for (ii = 0; ii < (uint32_t) iov_count; ii++) { ++ uint32_t jj; ++ for (jj = 0; jj < vector[ii].iov_len; jj++) { ++ printf("%02x: %02x\n", jj + iipos, ++ *((uint8_t *) (vector[ii].iov_base) + jj)); ++ } ++ iipos += vector[ii].iov_len; ++ } ++ printf("]]]]]]]]]]]]]]]]]]]]\n"); ++#endif ++ ++ if (slot_id >= tl->max_slots) { ++ tl->error = EN50221ERR_BADSLOTID; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (connection_id >= tl->max_connections_per_slot) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (tl->slots[slot_id].connections[connection_id].state != T_STATE_ACTIVE) { ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // calculate the total length of the data to send ++ uint32_t data_size = 0; ++ int i; ++ for (i = 0; i < iov_count; i++) { ++ data_size += vector[i].iov_len; ++ } ++ ++ // allocate msg structure ++ struct en50221_message *msg = ++ malloc(sizeof(struct en50221_message) + data_size + 10); ++ if (msg == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // make up data to send ++ int length_field_len; ++ msg->data[0] = T_DATA_LAST; ++ if ((length_field_len = asn_1_encode(data_size + 1, msg->data + 1, 3)) < 0) { ++ free(msg); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_ASNENCODE; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ msg->data[1 + length_field_len] = connection_id; ++ msg->length = 1 + length_field_len + 1 + data_size; ++ msg->next = NULL; ++ ++ // merge the iovecs ++ uint32_t pos = 1 + length_field_len + 1; ++ for (i = 0; i < iov_count; i++) { ++ memcpy(msg->data + pos, vector[i].iov_base, ++ vector[i].iov_len); ++ pos += vector[i].iov_len; ++ } ++ ++ // queue it for transmission ++ queue_message(tl, slot_id, connection_id, msg); ++ ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return 0; ++} ++ ++int en50221_tl_new_tc(struct en50221_transport_layer *tl, uint8_t slot_id) ++{ ++ // check ++ if (slot_id >= tl->max_slots) { ++ tl->error = EN50221ERR_BADSLOTID; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // allocate a new connection if possible ++ int conid = en50221_tl_alloc_new_tc(tl, slot_id); ++ if (conid == -1) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFCONNECTIONS; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // allocate msg structure ++ struct en50221_message *msg = ++ malloc(sizeof(struct en50221_message) + 3); ++ if (msg == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // make up the data to send ++ msg->data[0] = T_CREATE_T_C; ++ msg->data[1] = 1; ++ msg->data[2] = conid; ++ msg->length = 3; ++ msg->next = NULL; ++ ++ // queue it for transmission ++ queue_message(tl, slot_id, conid, msg); ++ ++ // done ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return conid; ++} ++ ++int en50221_tl_del_tc(struct en50221_transport_layer *tl, uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // check ++ if (slot_id >= tl->max_slots) { ++ tl->error = EN50221ERR_BADSLOTID; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (connection_id >= tl->max_connections_per_slot) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (!(tl->slots[slot_id].connections[connection_id].state & ++ (T_STATE_ACTIVE | T_STATE_IN_DELETION))) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADSTATE; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // allocate msg structure ++ struct en50221_message *msg = ++ malloc(sizeof(struct en50221_message) + 3); ++ if (msg == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ // make up the data to send ++ msg->data[0] = T_DELETE_T_C; ++ msg->data[1] = 1; ++ msg->data[2] = connection_id; ++ msg->length = 3; ++ msg->next = NULL; ++ ++ // queue it for transmission ++ queue_message(tl, slot_id, connection_id, msg); ++ tl->slots[slot_id].connections[connection_id].state = ++ T_STATE_ACTIVE_DELETEQUEUED; ++ ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return 0; ++} ++ ++int en50221_tl_get_connection_state(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id) ++{ ++ if (slot_id >= tl->max_slots) { ++ tl->error = EN50221ERR_BADSLOTID; ++ return -1; ++ } ++ ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ if (tl->slots[slot_id].ca_hndl == -1) { ++ tl->error = EN50221ERR_BADSLOTID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ if (connection_id >= tl->max_connections_per_slot) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ return -1; ++ } ++ int state = tl->slots[slot_id].connections[connection_id].state; ++ pthread_mutex_unlock(&tl->slots[slot_id].slot_lock); ++ ++ return state; ++} ++ ++ ++ ++ ++// ask the module for new data ++static int en50221_tl_poll_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id) ++{ ++ gettimeofday(&tl->slots[slot_id].connections[connection_id]. ++ tx_time, 0); ++ ++ // send command ++ uint8_t hdr[3]; ++ hdr[0] = T_DATA_LAST; ++ hdr[1] = 1; ++ hdr[2] = connection_id; ++ if (dvbca_link_write(tl->slots[slot_id].ca_hndl, ++ tl->slots[slot_id].slot, ++ connection_id, hdr, 3) < 0) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ return 0; ++} ++ ++// handle incoming data ++static int en50221_tl_process_data(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t * data, ++ uint32_t data_length) ++{ ++ int result; ++ ++#ifdef DEBUG_RXDATA ++ printf("-------------------\n"); ++ uint32_t ii = 0; ++ for (ii = 0; ii < data_length; ii++) { ++ printf("%02x: %02x\n", ii, data[ii]); ++ } ++ printf("+++++++++++++++++++\n"); ++#endif ++ ++ // process the received data ++ while (data_length) { ++ // parse the header ++ uint8_t tpdu_tag = data[0]; ++ uint16_t asn_data_length; ++ int length_field_len; ++ if ((length_field_len = asn_1_decode(&asn_data_length, data + 1, data_length - 1)) < 0) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid asn from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ if ((asn_data_length < 1) || ++ (asn_data_length > (data_length - (1 + length_field_len)))) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received data with invalid length from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ uint8_t connection_id = data[1 + length_field_len]; ++ data += 1 + length_field_len + 1; ++ data_length -= (1 + length_field_len + 1); ++ asn_data_length--; ++ ++ // check the connection_id ++ if (connection_id >= tl->max_connections_per_slot) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received bad connection id %02x from module on slot %02x\n", ++ connection_id, slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCONNECTIONID; ++ return -1; ++ } ++ // process the TPDUs ++ switch (tpdu_tag) { ++ case T_C_T_C_REPLY: ++ if ((result = en50221_tl_handle_create_tc_reply(tl, slot_id, connection_id)) < 0) { ++ return -1; ++ } ++ break; ++ case T_DELETE_T_C: ++ if ((result = en50221_tl_handle_delete_tc(tl, slot_id, connection_id)) < 0) { ++ return -1; ++ } ++ break; ++ case T_D_T_C_REPLY: ++ if ((result = en50221_tl_handle_delete_tc_reply(tl, slot_id, connection_id)) < 0) { ++ return -1; ++ } ++ break; ++ case T_REQUEST_T_C: ++ if ((result = en50221_tl_handle_request_tc(tl, slot_id, connection_id)) < 0) { ++ return -1; ++ } ++ break; ++ case T_DATA_MORE: ++ if ((result = en50221_tl_handle_data_more(tl, slot_id, ++ connection_id, ++ data, ++ asn_data_length)) < 0) { ++ return -1; ++ } ++ break; ++ case T_DATA_LAST: ++ if ((result = en50221_tl_handle_data_last(tl, slot_id, ++ connection_id, ++ data, ++ asn_data_length)) < 0) { ++ return -1; ++ } ++ break; ++ case T_SB: ++ if ((result = en50221_tl_handle_sb(tl, slot_id, ++ connection_id, ++ data, ++ asn_data_length)) < 0) { ++ return -1; ++ } ++ break; ++ default: ++ print(LOG_LEVEL, ERROR, 1, ++ "Recieved unexpected TPDU tag %02x from module on slot %02x\n", ++ tpdu_tag, slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ ++ // skip over the consumed data ++ data += asn_data_length; ++ data_length -= asn_data_length; ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_create_tc_reply(struct en50221_transport_layer ++ *tl, uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // set this connection to state active ++ if (tl->slots[slot_id].connections[connection_id].state == T_STATE_IN_CREATION) { ++ tl->slots[slot_id].connections[connection_id].state = T_STATE_ACTIVE; ++ tl->slots[slot_id].connections[connection_id].tx_time.tv_sec = 0; ++ ++ // tell upper layers ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, T_CALLBACK_REASON_CONNECTIONOPEN, NULL, 0, slot_id, connection_id); ++ } else { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_C_T_C_REPLY for connection not in " ++ "T_STATE_IN_CREATION from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_delete_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // immediately delete this connection and send D_T_C_REPLY ++ if (tl->slots[slot_id].connections[connection_id].state & ++ (T_STATE_ACTIVE | T_STATE_IN_DELETION)) { ++ // clear down the slot ++ tl->slots[slot_id].connections[connection_id].state = T_STATE_IDLE; ++ if (tl->slots[slot_id].connections[connection_id].chain_buffer) { ++ free(tl->slots[slot_id].connections[connection_id].chain_buffer); ++ } ++ tl->slots[slot_id].connections[connection_id].chain_buffer = NULL; ++ tl->slots[slot_id].connections[connection_id].buffer_length = 0; ++ ++ // send the reply ++ uint8_t hdr[3]; ++ hdr[0] = T_D_T_C_REPLY; ++ hdr[1] = 1; ++ hdr[2] = connection_id; ++ if (dvbca_link_write(tl->slots[slot_id].ca_hndl, ++ tl->slots[slot_id].slot, ++ connection_id, hdr, 3) < 0) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ // tell upper layers ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, T_CALLBACK_REASON_CONNECTIONCLOSE, NULL, 0, slot_id, connection_id); ++ } else { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_DELETE_T_C for inactive connection from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_delete_tc_reply(struct en50221_transport_layer ++ *tl, uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // delete this connection, should be in T_STATE_IN_DELETION already ++ if (tl->slots[slot_id].connections[connection_id].state == T_STATE_IN_DELETION) { ++ tl->slots[slot_id].connections[connection_id].state = T_STATE_IDLE; ++ } else { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_D_T_C_REPLY received for connection not in " ++ "T_STATE_IN_DELETION from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_request_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id) ++{ ++ // allocate a new connection if possible ++ int conid = en50221_tl_alloc_new_tc(tl, slot_id); ++ int ca_hndl = tl->slots[slot_id].ca_hndl; ++ if (conid == -1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Too many connections requested by module on slot %02x\n", ++ slot_id); ++ ++ // send the error ++ uint8_t hdr[4]; ++ hdr[0] = T_T_C_ERROR; ++ hdr[1] = 2; ++ hdr[2] = connection_id; ++ hdr[3] = 1; ++ if (dvbca_link_write(ca_hndl, tl->slots[slot_id].slot, connection_id, hdr, 4) < 0) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ tl->slots[slot_id].connections[connection_id].tx_time. ++ tv_sec = 0; ++ } else { ++ // send the NEW_T_C on the connection we received it on ++ uint8_t hdr[4]; ++ hdr[0] = T_NEW_T_C; ++ hdr[1] = 2; ++ hdr[2] = connection_id; ++ hdr[3] = conid; ++ if (dvbca_link_write(ca_hndl, tl->slots[slot_id].slot, connection_id, hdr, 4) < 0) { ++ tl->slots[slot_id].connections[conid].state = T_STATE_IDLE; ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ tl->slots[slot_id].connections[connection_id].tx_time.tv_sec = 0; ++ ++ // send the CREATE_T_C on the new connnection ++ hdr[0] = T_CREATE_T_C; ++ hdr[1] = 1; ++ hdr[2] = conid; ++ if (dvbca_link_write(ca_hndl, tl->slots[slot_id].slot, conid, hdr, 3) < 0) { ++ tl->slots[slot_id].connections[conid].state = T_STATE_IDLE; ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ gettimeofday(&tl->slots[slot_id].connections[conid].tx_time, 0); ++ ++ // tell upper layers ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ if (cb) ++ cb(cb_arg, T_CALLBACK_REASON_CAMCONNECTIONOPEN, NULL, 0, slot_id, conid); ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_data_more(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // connection in correct state? ++ if (tl->slots[slot_id].connections[connection_id].state != T_STATE_ACTIVE) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_DATA_MORE for connection not in " ++ "T_STATE_ACTIVE from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ // a chained data packet is coming in, save ++ // it to the buffer and wait for more ++ tl->slots[slot_id].connections[connection_id].tx_time.tv_sec = 0; ++ int new_data_length = ++ tl->slots[slot_id].connections[connection_id].buffer_length + data_length; ++ uint8_t *new_data_buffer = ++ realloc(tl->slots[slot_id].connections[connection_id].chain_buffer, new_data_length); ++ if (new_data_buffer == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ return -1; ++ } ++ tl->slots[slot_id].connections[connection_id].chain_buffer = new_data_buffer; ++ ++ memcpy(tl->slots[slot_id].connections[connection_id].chain_buffer + ++ tl->slots[slot_id].connections[connection_id].buffer_length, ++ data, data_length); ++ tl->slots[slot_id].connections[connection_id].buffer_length = new_data_length; ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_data_last(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ uint8_t * data, ++ uint32_t data_length) ++{ ++ // connection in correct state? ++ if (tl->slots[slot_id].connections[connection_id].state != T_STATE_ACTIVE) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_DATA_LAST received for connection not in " ++ "T_STATE_ACTIVE from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ // last package of a chain or single package comes in ++ tl->slots[slot_id].connections[connection_id].tx_time.tv_sec = 0; ++ if (tl->slots[slot_id].connections[connection_id].chain_buffer == NULL) { ++ // single package => dispatch immediately ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ ++ if (cb && data_length) { ++ pthread_mutex_unlock(&tl->slots[slot_id]. ++ slot_lock); ++ cb(cb_arg, T_CALLBACK_REASON_DATA, data, data_length, slot_id, connection_id); ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ } ++ } else { ++ int new_data_length = ++ tl->slots[slot_id].connections[connection_id].buffer_length + data_length; ++ uint8_t *new_data_buffer = ++ realloc(tl->slots[slot_id].connections[connection_id].chain_buffer, new_data_length); ++ if (new_data_buffer == NULL) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_OUTOFMEMORY; ++ return -1; ++ } ++ ++ memcpy(new_data_buffer + ++ tl->slots[slot_id].connections[connection_id]. ++ buffer_length, data, data_length); ++ ++ // clean the buffer position ++ tl->slots[slot_id].connections[connection_id].chain_buffer = NULL; ++ tl->slots[slot_id].connections[connection_id].buffer_length = 0; ++ ++ // tell the upper layers ++ pthread_mutex_lock(&tl->setcallback_lock); ++ en50221_tl_callback cb = tl->callback; ++ void *cb_arg = tl->callback_arg; ++ pthread_mutex_unlock(&tl->setcallback_lock); ++ if (cb && data_length) { ++ pthread_mutex_unlock(&tl->slots[slot_id]. ++ slot_lock); ++ cb(cb_arg, T_CALLBACK_REASON_DATA, new_data_buffer, ++ new_data_length, slot_id, connection_id); ++ pthread_mutex_lock(&tl->slots[slot_id].slot_lock); ++ } ++ ++ free(new_data_buffer); ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_handle_sb(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ uint8_t * data, uint32_t data_length) ++{ ++ // is the connection id ok? ++ if (tl->slots[slot_id].connections[connection_id].state != T_STATE_ACTIVE) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Received T_SB for connection not in T_STATE_ACTIVE from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ // did we get enough data in the T_SB? ++ if (data_length != 1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "Recieved T_SB with invalid length from module on slot %02x\n", ++ slot_id); ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_BADCAMDATA; ++ return -1; ++ } ++ // tell it to send the data if it says there is some ++ if (data[0] & 0x80) { ++ int ca_hndl = tl->slots[slot_id].ca_hndl; ++ ++ // send the RCV ++ uint8_t hdr[3]; ++ hdr[0] = T_RCV; ++ hdr[1] = 1; ++ hdr[2] = connection_id; ++ if (dvbca_link_write(ca_hndl, tl->slots[slot_id].slot, connection_id, hdr, 3) < 0) { ++ tl->error_slot = slot_id; ++ tl->error = EN50221ERR_CAWRITE; ++ return -1; ++ } ++ gettimeofday(&tl->slots[slot_id].connections[connection_id].tx_time, 0); ++ ++ } else { ++ // no data - indicate not waiting for anything now ++ tl->slots[slot_id].connections[connection_id].tx_time.tv_sec = 0; ++ } ++ ++ return 0; ++} ++ ++static int en50221_tl_alloc_new_tc(struct en50221_transport_layer *tl, ++ uint8_t slot_id) ++{ ++ // we browse through the array of connection ++ // types, to look for the first unused one ++ int i, conid = -1; ++ for (i = 1; i < tl->max_connections_per_slot; i++) { ++ if (tl->slots[slot_id].connections[i].state == T_STATE_IDLE) { ++ conid = i; ++ break; ++ } ++ } ++ if (conid == -1) { ++ print(LOG_LEVEL, ERROR, 1, ++ "CREATE_T_C failed: no more connections available\n"); ++ return -1; ++ } ++ // set up the connection struct ++ tl->slots[slot_id].connections[conid].state = T_STATE_IN_CREATION; ++ tl->slots[slot_id].connections[conid].chain_buffer = NULL; ++ tl->slots[slot_id].connections[conid].buffer_length = 0; ++ ++ return conid; ++} ++ ++static void queue_message(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ struct en50221_message *msg) ++{ ++ msg->next = NULL; ++ if (tl->slots[slot_id].connections[connection_id].send_queue_tail) { ++ tl->slots[slot_id].connections[connection_id].send_queue_tail->next = msg; ++ tl->slots[slot_id].connections[connection_id].send_queue_tail = msg; ++ } else { ++ tl->slots[slot_id].connections[connection_id].send_queue = msg; ++ tl->slots[slot_id].connections[connection_id].send_queue_tail = msg; ++ } ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_transport.h dvb-apps/lib/libdvben50221/en50221_transport.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/en50221_transport.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/en50221_transport.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,234 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 session layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++ ++#ifndef __EN50221_TRANSPORT_H__ ++#define __EN50221_TRANSPORT_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Callback reasons. ++ */ ++#define T_CALLBACK_REASON_CONNECTIONOPEN 0x00 // A connection we opened _to_ the cam has been ACKed ++#define T_CALLBACK_REASON_CAMCONNECTIONOPEN 0x01 // The cam has opened a connection to _us_. ++#define T_CALLBACK_REASON_DATA 0x02 // Data received ++#define T_CALLBACK_REASON_CONNECTIONCLOSE 0x03 // The cam has told us to close a connection. ++#define T_CALLBACK_REASON_SLOTCLOSE 0x04 // The cam in the supplied slot id has been removed. ++ ++// these are the states a TC can be in ++#define T_STATE_IDLE 0x01 // this transport connection is not in use ++#define T_STATE_ACTIVE 0x02 // this transport connection is in use ++#define T_STATE_ACTIVE_DELETEQUEUED 0x04 // this transport connection is about to be deleted ++#define T_STATE_IN_CREATION 0x08 // this transport waits for a T_C_T_C_REPLY to become active ++#define T_STATE_IN_DELETION 0x10 // this transport waits for T_D_T_C_REPLY to become idle again ++ ++/** ++ * Opaque type representing a transport layer. ++ */ ++struct en50221_transport_layer; ++ ++/** ++ * Type definition for callback function - used when events are received from a module. ++ * ++ * **IMPORTANT** For all callback reasons except T_CALLBACK_REASON_DATA, an internal lock is held in the ++ * transport layer. Therefore, to avoid deadlock, you *must not* call back into the transport layer for ++ * these reasons. ++ * ++ * However, for T_CALLBACK_REASON_DATA, the internal lock is not held, so calling back into the transport ++ * layer is fine in this case. ++ * ++ * @param arg Private data. ++ * @param reason One of the T_CALLBACK_REASON_* values. ++ * @param data The data. ++ * @param data_length Length of the data. ++ * @param slot_id Slot_id the data was received from. ++ * @param connection_id Connection_id the data was received from. ++ */ ++typedef void (*en50221_tl_callback) (void *arg, int reason, ++ uint8_t * data, ++ uint32_t data_length, ++ uint8_t slot_id, ++ uint8_t connection_id); ++ ++ ++/** ++ * Construct a new instance of the transport layer. ++ * ++ * @param max_slots Maximum number of slots to support. ++ * @param max_connections_per_slot Maximum connections per slot. ++ * @return The en50221_transport_layer instance, or NULL on error. ++ */ ++extern struct en50221_transport_layer *en50221_tl_create(uint8_t max_slots, ++ uint8_t max_connections_per_slot); ++ ++/** ++ * Destroy an instance of the transport layer. ++ * ++ * @param tl The en50221_transport_layer instance. ++ */ ++extern void en50221_tl_destroy(struct en50221_transport_layer *tl); ++ ++/** ++ * Register a new slot with the library. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param ca_hndl FD for talking to the slot. ++ * @param slot CAM slot where the requested CAM of the CA is in. ++ * @param response_timeout Maximum timeout in ms to a response we send before signalling a timeout. ++ * @param poll_delay Interval between polls in ms. ++ * @return slot_id on sucess, or -1 on error. ++ */ ++extern int en50221_tl_register_slot(struct en50221_transport_layer *tl, ++ int ca_hndl, uint8_t slot, ++ uint32_t response_timeout, ++ uint32_t poll_delay); ++ ++/** ++ * Destroy a registered slot - e.g. if a CAM is removed, or an error occurs. Does ++ * not attempt to reset the CAM. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id Slot to destroy. ++ */ ++extern void en50221_tl_destroy_slot(struct en50221_transport_layer *tl, uint8_t slot_id); ++ ++/** ++ * Performs one iteration of the transport layer poll - ++ * checking for incoming data furthermore it will handle ++ * the timeouts of certain commands like T_DELETE_T_C it ++ * should be called by the application regularly, generally ++ * faster than the poll delay. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @return 0 on succes, or -1 if there was an error of some sort. ++ */ ++extern int en50221_tl_poll(struct en50221_transport_layer *tl); ++ ++/** ++ * Register the callback for data reception. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param callback The callback. Set to NULL to remove the callback completely. ++ * @param arg Private data passed as arg0 of the callback. ++ */ ++extern void en50221_tl_register_callback(struct en50221_transport_layer *tl, ++ en50221_tl_callback callback, void *arg); ++ ++/** ++ * Gets the ID of the slot an error occurred on. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @return The offending slot id. ++ */ ++extern int en50221_tl_get_error_slot(struct en50221_transport_layer *tl); ++ ++/** ++ * Gets the last error. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @return One of the EN50221ERR_* values. ++ */ ++extern int en50221_tl_get_error(struct en50221_transport_layer *tl); ++ ++/** ++ * This function is used to take a data-block, pack into ++ * into a TPDU (DATA_LAST) and send it to the device ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id ID of the slot. ++ * @param connection_id Connection id. ++ * @param data Data to send. ++ * @param data_length Number of bytes to send. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_tl_send_data(struct en50221_transport_layer *tl, ++ uint8_t slot_id, ++ uint8_t connection_id, ++ uint8_t * data, ++ uint32_t data_length); ++ ++/** ++ * This function is used to take a data-block, pack into ++ * into a TPDU (DATA_LAST) and send it to the device ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id ID of the slot. ++ * @param connection_id Connection id. ++ * @param vector iov to send. ++ * @param io_count Number of elements in vector. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_tl_send_datav(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id, ++ struct iovec *vector, int iov_count); ++ ++/** ++ * Create a new transport connection to the cam. ++ * ++ * **IMPORTANT** When this function returns, it means the request to create a connection ++ * has been submitted. You will need to poll using en50221_tl_get_connection_state() to find out ++ * if/when the connection is established. A callback with T_CALLBACK_REASON_CONNECTIONOPEN reason ++ * will also be sent when it is acked by the CAM. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id ID of the slot. ++ * @return The allocated connection id on success, or -1 on error. ++ */ ++extern int en50221_tl_new_tc(struct en50221_transport_layer *tl, uint8_t slot_id); ++ ++/** ++ * Deallocates a transport connection. ++ * ++ * **IMPORTANT** When this function returns, it means the request to destroy a connection ++ * has been submitted. You will need to poll using en50221_tl_get_connection_state() to find out ++ * if/when the connection is destroyed. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id ID of the slot. ++ * @param connection_id Connection id to send the request _on_. ++ * @return 0 on success, or -1 on error. ++ */ ++extern int en50221_tl_del_tc(struct en50221_transport_layer *tl, uint8_t slot_id, uint8_t connection_id); ++ ++/** ++ * Checks the state of a connection. ++ * ++ * @param tl The en50221_transport_layer instance. ++ * @param slot_id ID of the slot. ++ * @param connection_id Connection id to send the request _on_. ++ * @return One of the T_STATE_* values. ++ */ ++extern int en50221_tl_get_connection_state(struct en50221_transport_layer *tl, ++ uint8_t slot_id, uint8_t connection_id); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvben50221/Makefile dvb-apps/lib/libdvben50221/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libdvben50221/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvben50221/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,49 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libdvben50221 ++ ++includes = asn_1.h \ ++ en50221_app_ai.h \ ++ en50221_app_auth.h \ ++ en50221_app_ca.h \ ++ en50221_app_datetime.h \ ++ en50221_app_dvb.h \ ++ en50221_app_epg.h \ ++ en50221_app_lowspeed.h \ ++ en50221_app_mmi.h \ ++ en50221_app_rm.h \ ++ en50221_app_smartcard.h \ ++ en50221_app_tags.h \ ++ en50221_app_teletext.h \ ++ en50221_app_utils.h \ ++ en50221_errno.h \ ++ en50221_session.h \ ++ en50221_stdcam.h \ ++ en50221_transport.h ++ ++objects = asn_1.o \ ++ en50221_app_ai.o \ ++ en50221_app_auth.o \ ++ en50221_app_ca.o \ ++ en50221_app_datetime.o \ ++ en50221_app_dvb.o \ ++ en50221_app_epg.o \ ++ en50221_app_lowspeed.o \ ++ en50221_app_mmi.o \ ++ en50221_app_rm.o \ ++ en50221_app_smartcard.o \ ++ en50221_app_teletext.o \ ++ en50221_app_utils.o \ ++ en50221_session.o \ ++ en50221_stdcam.o \ ++ en50221_stdcam_hlci.o \ ++ en50221_stdcam_llci.o \ ++ en50221_transport.o ++ ++lib_name = libdvben50221 ++ ++CPPFLAGS += -I../../lib -DLOG_LEVEL=1 # FIXME ++ ++.PHONY: all ++ ++all: library ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbmisc/dvbmisc.h dvb-apps/lib/libdvbmisc/dvbmisc.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbmisc/dvbmisc.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbmisc/dvbmisc.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,72 @@ ++/* ++ libdvbmisc - DVB miscellaneous library ++ ++ Copyright (C) 2005 Manu Abraham ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ This library 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 ++ Lesser General Public License for more details. ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++*/ ++ ++#ifndef DVB_MISC_H ++#define DVB_MISC_H ++ ++#include ++#include ++#include ++#include ++ ++#define ERROR 0 ++#define NOTICE 1 ++#define INFO 2 ++#define DEBUG 3 ++ ++#define print(x, y, z, fmt, arg...) do { \ ++ if (z) { \ ++ if ((x > ERROR) && (x > y)) \ ++ vprint("%s: " fmt "\n", __func__ , ##arg); \ ++ else if ((x > NOTICE) && (x > y)) \ ++ vprint("%s: " fmt "\n",__func__ , ##arg); \ ++ else if ((x > INFO) && (x > y)) \ ++ vprint("%s: " fmt "\n", __func__ , ##arg); \ ++ else if ((x > DEBUG) && (x > y)) \ ++ vprint("%s: " fmt "\n", __func__ , ##arg); \ ++ } else { \ ++ if (x > y) \ ++ vprint(fmt, ##arg); \ ++ } \ ++} while(0) ++ ++static inline void vprint(char *fmt, ...) ++{ ++ va_list args; ++ ++ va_start(args, fmt); ++ vfprintf(stderr, fmt, args); ++ va_end(args); ++} ++ ++static inline int time_after(struct timeval oldtime, uint32_t delta_ms) ++{ ++ // calculate the oldtime + add on the delta ++ uint64_t oldtime_ms = (oldtime.tv_sec * 1000) + (oldtime.tv_usec / 1000); ++ oldtime_ms += delta_ms; ++ ++ // calculate the nowtime ++ struct timeval nowtime; ++ gettimeofday(&nowtime, 0); ++ uint64_t nowtime_ms = (nowtime.tv_sec * 1000) + (nowtime.tv_usec / 1000); ++ ++ // check ++ return nowtime_ms > oldtime_ms; ++} ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_api.c dvb-apps/lib/libdvbsec/dvbsec_api.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_api.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbsec/dvbsec_api.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,951 @@ ++/* ++ libdvbsec - an SEC library ++ ++ Copyright (C) 2005 Manu Abraham ++ Copyright (C) 2006 Andrew de Quincey ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ This library 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 ++ Lesser General Public License for more details. ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbsec_api.h" ++ ++// uncomment this to make dvbsec_command print out debug instead of talking to a frontend ++// #define TEST_SEC_COMMAND 1 ++ ++int dvbsec_set(struct dvbfe_handle *fe, ++ struct dvbsec_config *sec_config, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option, ++ struct dvbfe_parameters *params, ++ int timeout) ++{ ++ int tmp; ++ struct dvbfe_parameters localparams; ++ struct dvbfe_parameters *topass = params; ++ ++ // perform SEC ++ if (sec_config != NULL) { ++ switch(sec_config->config_type) { ++ case DVBSEC_CONFIG_NONE: ++ break; ++ ++ case DVBSEC_CONFIG_POWER: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_13); ++ break; ++ ++ case DVBSEC_CONFIG_STANDARD: ++ { ++ // calculate the correct oscillator value ++ enum dvbsec_diseqc_oscillator osc = DISEQC_OSCILLATOR_LOW; ++ if (sec_config->switch_frequency && (sec_config->switch_frequency < params->frequency)) ++ osc = DISEQC_OSCILLATOR_HIGH; ++ ++ if ((tmp = dvbsec_std_sequence(fe, ++ osc, ++ polarization, ++ sat_pos, ++ switch_option)) < 0) ++ return tmp; ++ break; ++ } ++ ++ case DVBSEC_CONFIG_ADVANCED: ++ { ++ // are we high or not? ++ int high = 0; ++ if (sec_config->switch_frequency && (sec_config->switch_frequency < params->frequency)) ++ high = 1; ++ ++ // determine correct string ++ char *cmd = NULL; ++ switch(polarization) { ++ case DISEQC_POLARIZATION_H: ++ if (!high) ++ cmd = sec_config->adv_cmd_lo_h; ++ else ++ cmd = sec_config->adv_cmd_hi_h; ++ break; ++ case DISEQC_POLARIZATION_V: ++ if (!high) ++ cmd = sec_config->adv_cmd_lo_v; ++ else ++ cmd = sec_config->adv_cmd_hi_v; ++ break; ++ case DISEQC_POLARIZATION_L: ++ if (!high) ++ cmd = sec_config->adv_cmd_lo_l; ++ else ++ cmd = sec_config->adv_cmd_hi_l; ++ break; ++ case DISEQC_POLARIZATION_R: ++ if (!high) ++ cmd = sec_config->adv_cmd_lo_r; ++ else ++ cmd = sec_config->adv_cmd_hi_r; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ // do it ++ if (cmd) ++ if ((tmp = dvbsec_command(fe, cmd)) < 0) ++ return tmp; ++ break; ++ } ++ } ++ ++ // work out the correct LOF value ++ uint32_t lof = 0; ++ if ((sec_config->switch_frequency == 0) || (params->frequency < sec_config->switch_frequency)) { ++ // LOW band ++ switch(polarization) { ++ case DISEQC_POLARIZATION_H: ++ lof = sec_config->lof_lo_h; ++ break; ++ case DISEQC_POLARIZATION_V: ++ lof = sec_config->lof_lo_v; ++ break; ++ case DISEQC_POLARIZATION_L: ++ lof = sec_config->lof_lo_l; ++ break; ++ case DISEQC_POLARIZATION_R: ++ lof = sec_config->lof_lo_r; ++ break; ++ case DISEQC_POLARIZATION_UNCHANGED: ++ break; ++ } ++ } else { ++ // HIGH band ++ switch(polarization) { ++ case DISEQC_POLARIZATION_H: ++ lof = sec_config->lof_hi_h; ++ break; ++ case DISEQC_POLARIZATION_V: ++ lof = sec_config->lof_hi_v; ++ break; ++ case DISEQC_POLARIZATION_L: ++ lof = sec_config->lof_hi_l; ++ break; ++ case DISEQC_POLARIZATION_R: ++ lof = sec_config->lof_hi_r; ++ break; ++ case DISEQC_POLARIZATION_UNCHANGED: ++ break; ++ } ++ } ++ ++ // do frequency adjustment ++ if (lof) { ++ memcpy(&localparams, params, sizeof(struct dvbfe_parameters)); ++ int tmpfreq = localparams.frequency - lof; ++ ++ if (tmpfreq < 0) ++ tmpfreq *= -1; ++ localparams.frequency = (uint32_t) tmpfreq; ++ topass = &localparams; ++ } ++ } ++ ++ // set the frontend! ++ return dvbfe_set(fe, topass, timeout); ++} ++ ++int dvbsec_std_sequence(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_oscillator oscillator, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option) ++{ ++ dvbfe_set_22k_tone(fe, DVBFE_SEC_TONE_OFF); ++ ++ switch(polarization) { ++ case DISEQC_POLARIZATION_V: ++ case DISEQC_POLARIZATION_R: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_13); ++ break; ++ case DISEQC_POLARIZATION_H: ++ case DISEQC_POLARIZATION_L: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_18); ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ dvbsec_diseqc_set_committed_switches(fe, ++ DISEQC_ADDRESS_ANY_DEVICE, ++ oscillator, ++ polarization, ++ sat_pos, ++ switch_option); ++ ++ usleep(15000); ++ ++ switch(sat_pos) { ++ case DISEQC_SWITCH_A: ++ dvbfe_set_tone_data_burst(fe, DVBFE_SEC_MINI_A); ++ break; ++ case DISEQC_SWITCH_B: ++ dvbfe_set_tone_data_burst(fe, DVBFE_SEC_MINI_B); ++ break; ++ default: ++ break; ++ } ++ ++ if (sat_pos != DISEQC_SWITCH_UNCHANGED) ++ usleep(15000); ++ ++ switch(oscillator) { ++ case DISEQC_OSCILLATOR_LOW: ++ dvbfe_set_22k_tone(fe, DVBFE_SEC_TONE_OFF); ++ break; ++ case DISEQC_OSCILLATOR_HIGH: ++ dvbfe_set_22k_tone(fe, DVBFE_SEC_TONE_ON); ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++int dvbsec_diseqc_set_reset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_reset state) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x00 }; ++ ++ if (state == DISEQC_RESET_CLEAR) ++ data[2] = 0x01; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_power(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_power state) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x02 }; ++ ++ if (state == DISEQC_POWER_ON) ++ data[2] = 0x03; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_listen(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_listen state) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x30 }; ++ ++ if (state == DISEQC_LISTEN_AWAKE) ++ data[2] = 0x31; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_committed_switches(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_oscillator oscillator, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x38, 0x00 }; ++ ++ switch(oscillator) { ++ case DISEQC_OSCILLATOR_LOW: ++ data[3] |= 0x10; ++ break; ++ case DISEQC_OSCILLATOR_HIGH: ++ data[3] |= 0x11; ++ break; ++ case DISEQC_OSCILLATOR_UNCHANGED: ++ break; ++ } ++ switch(polarization) { ++ case DISEQC_POLARIZATION_V: ++ case DISEQC_POLARIZATION_R: ++ data[3] |= 0x20; ++ break; ++ case DISEQC_POLARIZATION_H: ++ case DISEQC_POLARIZATION_L: ++ data[3] |= 0x22; ++ break; ++ default: ++ break; ++ } ++ switch(sat_pos) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x40; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x44; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ switch(switch_option) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x80; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x88; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ ++ if (data[3] == 0) ++ return 0; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_uncommitted_switches(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_switch s1, ++ enum dvbsec_diseqc_switch s2, ++ enum dvbsec_diseqc_switch s3, ++ enum dvbsec_diseqc_switch s4) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x39, 0x00 }; ++ ++ switch(s1) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x10; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x11; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ switch(s2) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x20; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x22; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ switch(s3) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x40; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x44; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ switch(s4) { ++ case DISEQC_SWITCH_A: ++ data[3] |= 0x80; ++ break; ++ case DISEQC_SWITCH_B: ++ data[3] |= 0x88; ++ break; ++ case DISEQC_SWITCH_UNCHANGED: ++ break; ++ } ++ ++ if (data[3] == 0) ++ return 0; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_analog_value(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_analog_id id, ++ uint8_t value) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x48, value }; ++ ++ if (id == DISEQC_ANALOG_ID_A1) ++ data[2] = 0x49; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_frequency(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint32_t frequency) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x58, 0x00, 0x00, 0x00 }; ++ int len = 5; ++ ++ uint32_t bcdval = 0; ++ int i; ++ for(i=0; i<=24;i+=4) { ++ bcdval |= ((frequency % 10) << i); ++ frequency /= 10; ++ } ++ ++ data[3] = bcdval >> 16; ++ data[4] = bcdval >> 8; ++ if (bcdval & 0xff) { ++ data[5] = bcdval; ++ len++; ++ } ++ ++ return dvbfe_do_diseqc_command(fe, data, len); ++} ++ ++int dvbsec_diseqc_set_channel(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint16_t channel) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x59, 0x00, 0x00}; ++ ++ data[3] = channel >> 8; ++ data[4] = channel; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_halt_satpos(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x60}; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_disable_satpos_limits(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x63}; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_set_satpos_limit(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_direction direction) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x66}; ++ ++ if (direction == DISEQC_DIRECTION_WEST) ++ data[2] = 0x67; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_drive_satpos_motor(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_direction direction, ++ enum dvbsec_diseqc_drive_mode mode, ++ uint8_t value) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x68, 0x00}; ++ ++ if (direction == DISEQC_DIRECTION_WEST) ++ data[2] = 0x69; ++ ++ switch(mode) { ++ case DISEQC_DRIVE_MODE_STEPS: ++ data[3] = (value & 0x7f) | 0x80; ++ break; ++ case DISEQC_DRIVE_MODE_TIMEOUT: ++ data[3] = value & 0x7f; ++ break; ++ } ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_store_satpos_preset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint8_t id) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x6A, id}; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_goto_satpos_preset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint8_t id) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x6B, id}; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++int dvbsec_diseqc_recalculate_satpos_positions(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ int val1, ++ int val2) ++{ ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x6F, 0x00, 0x00}; ++ int len = 3; ++ ++ if (val1 != -1) { ++ data[3] = val1; ++ len++; ++ } ++ if (val2 != -1) { ++ data[4] = val2; ++ len = 5; ++ } ++ ++ return dvbfe_do_diseqc_command(fe, data, len); ++} ++ ++int dvbsec_diseqc_goto_rotator_bearing(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ float angle) ++{ ++ int integer = (int) angle; ++ uint8_t data[] = { DISEQC_FRAMING_MASTER_NOREPLY, address, 0x6e, 0x00, 0x00}; ++ ++ // transform the fraction into the correct representation ++ int fraction = (int) (((angle - integer) * 16.0) + 0.9) & 0x0f; ++ switch(fraction) { ++ case 1: ++ case 4: ++ case 7: ++ case 9: ++ case 12: ++ case 15: ++ fraction--; ++ break; ++ } ++ ++ // generate the command ++ if (integer < -256) { ++ return -EINVAL; ++ } else if (integer < 0) { ++ integer = -integer; ++ data[3] = 0xf0; ++ } else if (integer < 256) { ++ data[3] = 0x00; ++ } else if (integer < 512) { ++ integer -= 256; ++ data[3] = 0x10; ++ } else { ++ return -EINVAL; ++ } ++ data[3] |= ((integer / 16) & 0x0f); ++ integer = integer % 16; ++ data[4] |= ((integer & 0x0f) << 4) | fraction; ++ ++ return dvbfe_do_diseqc_command(fe, data, sizeof(data)); ++} ++ ++static int skipwhite(char **line, char *end) ++{ ++ while(**line) { ++ if (end && (*line >= end)) ++ return -1; ++ if (!isspace(**line)) ++ return 0; ++ (*line)++; ++ } ++ ++ return -1; ++} ++ ++static int getstringupto(char **line, char *end, char *matches, char **ptrdest, int *ptrlen) ++{ ++ char *start = *line; ++ ++ while(**line) { ++ if (end && (*line >= end)) ++ break; ++ if (strchr(matches, **line)) { ++ *ptrdest = start; ++ *ptrlen = *line - start; ++ return 0; ++ } ++ (*line)++; ++ } ++ ++ *ptrdest = start; ++ *ptrlen = *line - start; ++ return 0; ++} ++ ++static int parsefunction(char **line, ++ char **nameptr, int *namelen, ++ char **argsptr, int *argslen) ++{ ++ if (skipwhite(line, NULL)) ++ return -1; ++ ++ if (getstringupto(line, NULL, "(", nameptr, namelen)) ++ return -1; ++ if ((*line) == 0) ++ return -1; ++ (*line)++; // skip the '(' ++ if (getstringupto(line, NULL, ")", argsptr, argslen)) ++ return -1; ++ if ((*line) == 0) ++ return -1; ++ (*line)++; // skip the ')' ++ ++ return 0; ++} ++ ++static int parseintarg(char **args, char *argsend, int *result) ++{ ++ char tmp[32]; ++ char *arg; ++ int arglen; ++ ++ // skip whitespace ++ if (skipwhite(args, argsend)) ++ return -1; ++ ++ // get the arg ++ if (getstringupto(args, argsend, ",", &arg, &arglen)) ++ return -1; ++ if ((**args) == ',') ++ (*args)++; // skip the ',' if present ++ if (arglen > 31) ++ arglen = 31; ++ strncpy(tmp, arg, arglen); ++ tmp[arglen] = 0; ++ ++ if (sscanf(tmp, "%i", result) != 1) ++ return -1; ++ ++ return 0; ++} ++ ++static int parsechararg(char **args, char *argsend, int *result) ++{ ++ char *arg; ++ int arglen; ++ ++ // skip whitespace ++ if (skipwhite(args, argsend)) ++ return -1; ++ ++ // get the arg ++ if (getstringupto(args, argsend, ",", &arg, &arglen)) ++ return -1; ++ if ((**args) == ',') ++ (*args)++; // skip the ',' if present ++ if (arglen > 0) ++ *result = arg[0]; ++ ++ return 0; ++} ++ ++static int parsefloatarg(char **args, char *argsend, float *result) ++{ ++ char tmp[32]; ++ char *arg; ++ int arglen; ++ ++ // skip whitespace ++ if (skipwhite(args, argsend)) ++ return -1; ++ ++ // get the arg ++ if (getstringupto(args, argsend, ",", &arg, &arglen)) ++ return -1; ++ if ((**args) == ',') ++ (*args)++; // skip the ',' if present ++ if (arglen > 31) ++ arglen = 31; ++ strncpy(tmp, arg, arglen); ++ arg[arglen] = 0; ++ ++ if (sscanf(tmp, "%f", result) != 1) ++ return -1; ++ ++ return 0; ++} ++ ++static enum dvbsec_diseqc_switch parse_switch(int c) ++{ ++ switch(toupper(c)) { ++ case 'A': ++ return DISEQC_SWITCH_A; ++ case 'B': ++ return DISEQC_SWITCH_B; ++ default: ++ return DISEQC_SWITCH_UNCHANGED; ++ } ++} ++ ++int dvbsec_command(struct dvbfe_handle *fe, char *command) ++{ ++ char *name; ++ char *args; ++ int namelen; ++ int argslen; ++ int address; ++ int iarg; ++ int iarg2; ++ int iarg3; ++ int iarg4; ++ float farg; ++ ++ while(!parsefunction(&command, &name, &namelen, &args, &argslen)) { ++ char *argsend = args+argslen; ++ ++ if (!strncasecmp(name, "tone", namelen)) { ++ if (parsechararg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("tone: %c\n", iarg); ++#else ++ if (toupper(iarg) == 'B') { ++ dvbfe_set_22k_tone(fe, DVBFE_SEC_TONE_ON); ++ } else { ++ dvbfe_set_22k_tone(fe, DVBFE_SEC_TONE_OFF); ++ } ++#endif ++ } else if (!strncasecmp(name, "voltage", namelen)) { ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("voltage: %i\n", iarg); ++#else ++ switch(iarg) { ++ case 0: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_OFF); ++ break; ++ case 13: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_13); ++ break; ++ case 18: ++ dvbfe_set_voltage(fe, DVBFE_SEC_VOLTAGE_18); ++ break; ++ default: ++ return -1; ++ } ++#endif ++ } else if (!strncasecmp(name, "toneburst", namelen)) { ++ if (parsechararg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("toneburst: %c\n", iarg); ++#else ++ if (toupper(iarg) == 'B') { ++ dvbfe_set_tone_data_burst(fe, DVBFE_SEC_MINI_B); ++ } else { ++ dvbfe_set_tone_data_burst(fe, DVBFE_SEC_MINI_A); ++ } ++#endif ++ } else if (!strncasecmp(name, "highvoltage", namelen)) { ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("highvoltage: %i\n", iarg); ++#else ++ dvbfe_set_high_lnb_voltage(fe, iarg ? 1 : 0); ++#endif ++ } else if (!strncasecmp(name, "dishnetworks", namelen)) { ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("dishnetworks: %i\n", iarg); ++#else ++ dvbfe_do_dishnetworks_legacy_command(fe, iarg); ++#endif ++ } else if (!strncasecmp(name, "wait", namelen)) { ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("wait: %i\n", iarg); ++#else ++ if (iarg) ++ usleep(iarg * 1000); ++#endif ++ } else if (!strncasecmp(name, "Dreset", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dreset: %i %i\n", address, iarg); ++#else ++ if (iarg) { ++ dvbsec_diseqc_set_reset(fe, address, DISEQC_RESET); ++ } else { ++ dvbsec_diseqc_set_reset(fe, address, DISEQC_RESET_CLEAR); ++ } ++#endif ++ } else if (!strncasecmp(name, "Dpower", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dpower: %i %i\n", address, iarg); ++#else ++ if (iarg) { ++ dvbsec_diseqc_set_power(fe, address, DISEQC_POWER_ON); ++ } else { ++ dvbsec_diseqc_set_power(fe, address, DISEQC_POWER_OFF); ++ } ++#endif ++ } else if (!strncasecmp(name, "Dcommitted", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg2)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg3)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg4)) ++ return -1; ++ ++ enum dvbsec_diseqc_oscillator oscillator; ++ switch(toupper(iarg)) { ++ case 'H': ++ oscillator = DISEQC_OSCILLATOR_HIGH; ++ break; ++ case 'L': ++ oscillator = DISEQC_OSCILLATOR_LOW; ++ break; ++ default: ++ oscillator = DISEQC_OSCILLATOR_UNCHANGED; ++ break; ++ } ++ ++ int polarization = -1; ++ switch(toupper(iarg2)) { ++ case 'H': ++ polarization = DISEQC_POLARIZATION_H; ++ break; ++ case 'V': ++ polarization = DISEQC_POLARIZATION_V; ++ break; ++ case 'L': ++ polarization = DISEQC_POLARIZATION_L; ++ break; ++ case 'R': ++ polarization = DISEQC_POLARIZATION_R; ++ break; ++ default: ++ polarization = -1; ++ break; ++ } ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dcommitted: %i %i %i %i %i\n", address, ++ oscillator, ++ polarization, ++ parse_switch(iarg3), ++ parse_switch(iarg4)); ++#else ++ dvbsec_diseqc_set_committed_switches(fe, address, ++ oscillator, ++ polarization, ++ parse_switch(iarg3), ++ parse_switch(iarg4)); ++#endif ++ } else if (!strncasecmp(name, "Duncommitted", namelen)) { ++ if (parsechararg(&args, argsend, &address)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg2)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg3)) ++ return -1; ++ if (parsechararg(&args, argsend, &iarg4)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Duncommitted: %i %i %i %i %i\n", address, ++ parse_switch(iarg), ++ parse_switch(iarg2), ++ parse_switch(iarg3), ++ parse_switch(iarg4)); ++#else ++ dvbsec_diseqc_set_uncommitted_switches(fe, address, ++ parse_switch(iarg), ++ parse_switch(iarg2), ++ parse_switch(iarg3), ++ parse_switch(iarg4)); ++#endif ++ } else if (!strncasecmp(name, "Dfrequency", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dfrequency: %i %i\n", address, iarg); ++#else ++ dvbsec_diseqc_set_frequency(fe, address, iarg); ++#endif ++ } else if (!strncasecmp(name, "Dchannel", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dchannel: %i %i\n", address, iarg); ++#else ++ dvbsec_diseqc_set_channel(fe, address, iarg); ++#endif ++ } else if (!strncasecmp(name, "Dgotopreset", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parseintarg(&args, argsend, &iarg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dgotopreset: %i %i\n", address, iarg); ++#else ++ dvbsec_diseqc_goto_satpos_preset(fe, address, iarg); ++#endif ++ } else if (!strncasecmp(name, "Dgotobearing", namelen)) { ++ if (parseintarg(&args, argsend, &address)) ++ return -1; ++ if (parsefloatarg(&args, argsend, &farg)) ++ return -1; ++ ++#ifdef TEST_SEC_COMMAND ++ printf("Dgotobearing: %i %f\n", address, farg); ++#else ++ dvbsec_diseqc_goto_rotator_bearing(fe, address, farg); ++#endif ++ } else { ++ return -1; ++ } ++ } ++ ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_api.h dvb-apps/lib/libdvbsec/dvbsec_api.h +--- linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_api.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbsec/dvbsec_api.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,436 @@ ++/* ++ libdvbsec - an SEC library ++ ++ Copyright (C) 2005 Manu Abraham ++ Copyright (C) 2006 Andrew de Quincey ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ This library 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 ++ Lesser General Public License for more details. ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++*/ ++ ++#ifndef DVBSEC_API_H ++#define DVBSEC_API_H 1 ++ ++#include ++ ++struct dvbfe_handle; ++struct dvbfe_parameters; ++ ++enum dvbsec_diseqc_framing { ++ DISEQC_FRAMING_MASTER_NOREPLY = 0xE0, ++ DISEQC_FRAMING_MASTER_NOREPLY_REPEAT = 0xE1, ++ DISEQC_FRAMING_MASTER_REPLY = 0xE2, ++ DISEQC_FRAMING_MASTER_REPLY_REPEAT = 0xE3, ++ DISEQC_FRAMING_SLAVE_OK = 0xE4, ++ DISEQC_FRAMING_SLAVE_UNSUPPORTED = 0xE5, ++ DISEQC_FRAMING_SLAVE_PARITY_ERROR = 0xE6, ++ DISEQC_FRAMING_SLAVE_UNRECOGNISED = 0xE7, ++}; ++ ++enum dvbsec_diseqc_address { ++ DISEQC_ADDRESS_ANY_DEVICE = 0x00, ++ ++ DISEQC_ADDRESS_ANY_LNB_SWITCHER_SMATV = 0x10, ++ DISEQC_ADDRESS_LNB = 0x11, ++ DISEQC_ADDRESS_LNB_WITH_LOOP = 0x12, ++ DISEQC_ADDRESS_SWITCHER = 0x14, ++ DISEQC_ADDRESS_SWITCHER_WITH_LOOP = 0x15, ++ DISEQC_ADDRESS_SMATV = 0x18, ++ ++ DISEQC_ADDRESS_ANY_POLARISER = 0x20, ++ DISEQC_ADDRESS_LINEAR_POLARISER = 0x21, ++ ++ DISEQC_ADDRESS_ANY_POSITIONER = 0x30, ++ DISEQC_ADDRESS_POLAR_AZIMUTH_POSITIONER = 0x31, ++ DISEQC_ADDRESS_ELEVATION_POSITIONER = 0x32, ++ ++ DISEQC_ADDRESS_ANY_INSTALLER_AID = 0x40, ++ DISEQC_ADDRESS_SIGNAL_STRENGTH = 0x41, ++ ++ DISEQC_ADDRESS_ANY_INTERFACE = 0x70, ++ DISEQC_ADDRESS_HEADEND_INTERFACE = 0x71, ++ ++ DISEQC_ADDRESS_REALLOC_BASE = 0x60, ++ DISEQC_ADDRESS_OEM_BASE = 0xf0, ++}; ++ ++enum dvbsec_diseqc_reset { ++ DISEQC_RESET, ++ DISEQC_RESET_CLEAR, ++}; ++ ++enum dvbsec_diseqc_power { ++ DISEQC_POWER_OFF, ++ DISEQC_POWER_ON, ++}; ++ ++enum dvbsec_diseqc_listen { ++ DISEQC_LISTEN_SLEEP, ++ DISEQC_LISTEN_AWAKE, ++}; ++ ++enum dvbsec_diseqc_polarization { ++ DISEQC_POLARIZATION_UNCHANGED = 0, ++ DISEQC_POLARIZATION_H = 'h', ++ DISEQC_POLARIZATION_V = 'v', ++ DISEQC_POLARIZATION_L = 'l', ++ DISEQC_POLARIZATION_R = 'r', ++}; ++ ++enum dvbsec_diseqc_oscillator { ++ DISEQC_OSCILLATOR_UNCHANGED = 0, ++ DISEQC_OSCILLATOR_LOW, ++ DISEQC_OSCILLATOR_HIGH, ++}; ++ ++enum dvbsec_diseqc_switch { ++ DISEQC_SWITCH_UNCHANGED = 0, ++ DISEQC_SWITCH_A, ++ DISEQC_SWITCH_B, ++}; ++ ++enum dvbsec_diseqc_analog_id { ++ DISEQC_ANALOG_ID_A0, ++ DISEQC_ANALOG_ID_A1, ++}; ++ ++enum dvbsec_diseqc_drive_mode { ++ DISEQC_DRIVE_MODE_STEPS, ++ DISEQC_DRIVE_MODE_TIMEOUT, ++}; ++ ++enum dvbsec_diseqc_direction { ++ DISEQC_DIRECTION_EAST, ++ DISEQC_DIRECTION_WEST, ++}; ++ ++enum dvbsec_config_type { ++ DVBSEC_CONFIG_NONE = 0, ++ DVBSEC_CONFIG_POWER, ++ DVBSEC_CONFIG_STANDARD, ++ DVBSEC_CONFIG_ADVANCED, ++}; ++ ++ ++#define MAX_SEC_CMD_LEN 100 ++ ++struct dvbsec_config ++{ ++ char id[32]; /* ID of this SEC config structure */ ++ uint32_t switch_frequency; /* switching frequency - supply 0 for none. */ ++ uint32_t lof_lo_v; /* frequency to subtract for V + LOW band channels - or for switch_frequency == 0 */ ++ uint32_t lof_lo_h; /* frequency to subtract for H + LOW band channels - or for switch_frequency == 0 */ ++ uint32_t lof_lo_l; /* frequency to subtract for L + LOW band channels - or for switch_frequency == 0 */ ++ uint32_t lof_lo_r; /* frequency to subtract for R + LOW band channels - or for switch_frequency == 0 */ ++ uint32_t lof_hi_v; /* frequency to subtract for V + HIGH band channels */ ++ uint32_t lof_hi_h; /* frequency to subtract for H + HIGH band channels */ ++ uint32_t lof_hi_l; /* frequency to subtract for L + HIGH band channels */ ++ uint32_t lof_hi_r; /* frequency to subtract for R + HIGH band channels */ ++ ++ /** ++ * The SEC control to be used depends on the type: ++ * ++ * NONE - no SEC commands will be issued. (Frequency adjustment will still be performed). ++ * ++ * POWER - only the SEC power will be turned on. ++ * ++ * STANDARD - the standard DISEQC back compatable sequence is used. ++ * ++ * ADVANCED - SEC strings are supplied by the user describing the exact sequence ++ * of operations to use. ++ */ ++ enum dvbsec_config_type config_type; ++ ++ /* stuff for type == dvbsec_config_ADVANCED */ ++ char adv_cmd_lo_h[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for LOW/H. */ ++ char adv_cmd_lo_v[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for LOW/V. */ ++ char adv_cmd_lo_l[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for LOW/L. */ ++ char adv_cmd_lo_r[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for LOW/R. */ ++ char adv_cmd_hi_h[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for HI/H. */ ++ char adv_cmd_hi_v[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for HI/V. */ ++ char adv_cmd_hi_l[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for HI/L. */ ++ char adv_cmd_hi_r[MAX_SEC_CMD_LEN]; /* ADVANCED SEC command to use for HI/R. */ ++}; ++ ++/** ++ * Helper function for tuning adapters with SEC support. This function will do ++ * everything required, including frequency adjustment based on the parameters ++ * in sec_config. ++ * ++ * Note: Since the SEC configuration structure can be set to disable any SEC ++ * operations, this function can be reused for ALL DVB style devices (just ++ * set all LOF=0,type=dvbsec_config_NONE for devices which do not require ++ * SEC control). ++ * ++ * The sec configuration structures can be looked up using the dvbcfg_sec library. ++ * ++ * @param fe Frontend concerned. ++ * @param sec_config SEC configuration structure. May be NULL to disable SEC/frequency adjustment. ++ * @param polarization Polarization of signal. ++ * @param sat_pos Satellite position - only used if type == DISEQC_SEC_CONFIG_STANDARD. ++ * @param switch_option Switch option - only used if type == DISEQC_SEC_CONFIG_STANDARD. ++ * @param params Tuning parameters. ++ * @param timeout <0 => wait forever for lock. 0=>return immediately, >0=> ++ * number of milliseconds to wait for a lock. ++ * @return 0 on locked (or if timeout==0 and everything else worked), or ++ * nonzero on failure (including no lock). ++ */ ++extern int dvbsec_set(struct dvbfe_handle *fe, ++ struct dvbsec_config *sec_config, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option, ++ struct dvbfe_parameters *params, ++ int timeout); ++ ++/** ++ * This will issue the standardised back-compatable DISEQC/SEC command ++ * sequence as defined in the DISEQC spec: ++ * ++ * i.e. tone off, set voltage, wait15, DISEQC, wait15, toneburst, wait15, set tone. ++ * ++ * @param fe Frontend concerned. ++ * @param oscillator Value to set the lo/hi switch to. ++ * @param polarization Value to set the polarisation switch to. ++ * @param sat_pos Value to set the satellite position switch to. ++ * @param switch_option Value to set the "swtch option" switch to. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_std_sequence(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_oscillator oscillator, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option); ++ ++/** ++ * Execute an SEC command string on the provided frontend. Please see the documentation ++ * in dvbsec_cfg.h on the command format, ++ * ++ * @param fe Frontend concerned. ++ * @param command The command to execute. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_command(struct dvbfe_handle *fe, char *command); ++ ++/** ++ * Control the reset status of an attached DISEQC device. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param state The state to set. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_reset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_reset state); ++ ++/** ++ * Control the power status of an attached DISEQC peripheral. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param state The state to set. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_power(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_power state); ++ ++/** ++ * Control the listening status of an attached DISEQC peripheral. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param state The state to set. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_listen(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_listen state); ++ ++/** ++ * Set the state of the committed switches of a DISEQC device. ++ * These are switches which are defined to have a standard name. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param oscillator Value to set the lo/hi switch to. ++ * @param polarization Value to set the polarization switch to. ++ * @param sat_pos Value to set the satellite position switch to. ++ * @param switch_option Value to set the switch option switch to. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_committed_switches(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_oscillator oscillator, ++ enum dvbsec_diseqc_polarization polarization, ++ enum dvbsec_diseqc_switch sat_pos, ++ enum dvbsec_diseqc_switch switch_option); ++ ++/** ++ * Set the state of the uncommitted switches of a DISEQC device. ++ * These provide another four switching possibilities. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param s1 Value to set the S1 switch to. ++ * @param s2 Value to set the S2 switch to. ++ * @param s3 Value to set the S3 switch to. ++ * @param s3 Value to set the S4 switch to. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_uncommitted_switches(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_switch s1, ++ enum dvbsec_diseqc_switch s2, ++ enum dvbsec_diseqc_switch s3, ++ enum dvbsec_diseqc_switch s4); ++ ++/** ++ * Set an analogue value. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param id The id of the analogue value to set. ++ * @param value The value to set. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_analog_value(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_analog_id id, ++ uint8_t value); ++ ++/** ++ * Set the desired frequency. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param frequency The frequency to set in GHz. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_frequency(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint32_t frequency); ++ ++/** ++ * Set the desired channel. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param channel ID of the channel to set. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_channel(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint16_t channel); ++ ++/** ++ * Halt the satellite positioner. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_halt_satpos(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address); ++ ++/** ++ * Disable satellite positioner limits. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_disable_satpos_limits(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address); ++ ++/** ++ * Set satellite positioner limits. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_set_satpos_limit(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_direction direction); ++ ++/** ++ * Drive satellite positioner motor. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param direction Direction to drive in. ++ * @param mode Drive mode to use ++ * (TIMEOUT=>value is a timeout in seconds, or STEPS=>value is a count of steps to use) ++ * @param value Value associated with the drive mode (range 0->127) ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_drive_satpos_motor(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ enum dvbsec_diseqc_direction direction, ++ enum dvbsec_diseqc_drive_mode mode, ++ uint8_t value); ++ ++/** ++ * Store satellite positioner preset id at current position. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param id ID of the preset. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_store_satpos_preset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint8_t id); ++ ++/** ++ * Send a satellite positioner to a pre-set position. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param id ID of the preset. ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_goto_satpos_preset(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ uint8_t id); ++ ++/** ++ * Recalculate satellite positions based on the current position, using ++ * magic positioner specific values. ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param val1 value1 (range 0->255, pass -1 to ignore). ++ * @param val2 value2 (range 0->255, pass -1 to ignore). ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_recalculate_satpos_positions(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ int val1, ++ int val2); ++ ++/** ++ * Send a terrestrial aerial rotator to a particular bearing ++ * (0 degrees = north, fractional angles allowed). ++ * ++ * @param fe Frontend concerned. ++ * @param address Address of the device. ++ * @param angle Angle to rotate to (-256.0 -> 512.0) ++ * @return 0 on success, or nonzero on error. ++ */ ++extern int dvbsec_diseqc_goto_rotator_bearing(struct dvbfe_handle *fe, ++ enum dvbsec_diseqc_address address, ++ float angle); ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_cfg.c dvb-apps/lib/libdvbsec/dvbsec_cfg.c +--- linuxtv-dvb-apps-1.1.1/lib/libdvbsec/dvbsec_cfg.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbsec/dvbsec_cfg.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,366 @@ ++/** ++ * dvbsec_cfg (i.e. linuxtv sec format) configuration file support. ++ * ++ * Copyright (c) 2005 by Andrew de Quincey ++ * ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dvbsec_cfg.h" ++ ++int dvbcfg_issection(char* line, char* sectionname) ++{ ++ int len; ++ ++ len = strlen(line); ++ if (len < 2) ++ return 0; ++ ++ if ((line[0] != '[') || (line[len-1] != ']')) ++ return 0; ++ ++ line++; ++ while(isspace(*line)) ++ line++; ++ ++ if (strncmp(line, sectionname, strlen(sectionname))) ++ return 0; ++ ++ return 1; ++} ++ ++char* dvbcfg_iskey(char* line, char* keyname) ++{ ++ int len = strlen(keyname); ++ ++ /* does the key match? */ ++ if (strncmp(line, keyname, len)) ++ return NULL; ++ ++ /* skip keyname & any whitespace */ ++ line += len; ++ while(isspace(*line)) ++ line++; ++ ++ /* should be the '=' sign */ ++ if (*line != '=') ++ return 0; ++ ++ /* more whitespace skipping */ ++ line++; ++ while(isspace(*line)) ++ line++; ++ ++ /* finally, return the value */ ++ return line; ++} ++ ++int dvbsec_cfg_load(FILE *f, ++ void *arg, ++ dvbsec_cfg_callback cb) ++{ ++ struct dvbsec_config tmpsec; ++ char *linebuf = NULL; ++ size_t line_size = 0; ++ int len; ++ int insection = 0; ++ char *value; ++ ++ /* process each line */ ++ while((len = getline(&linebuf, &line_size, f)) > 0) { ++ char *line = linebuf; ++ ++ /* chop any comments */ ++ char *hashpos = strchr(line, '#'); ++ if (hashpos) ++ *hashpos = 0; ++ char *lineend = line + strlen(line); ++ ++ /* trim the line */ ++ while(*line && isspace(*line)) ++ line++; ++ while((lineend != line) && isspace(*(lineend-1))) ++ lineend--; ++ *lineend = 0; ++ ++ /* skip blank lines */ ++ if (*line == 0) ++ continue; ++ ++ if (dvbcfg_issection(line, "sec")) { ++ if (insection) { ++ if (cb(arg, &tmpsec)) ++ return 0; ++ } ++ insection = 1; ++ memset(&tmpsec, 0, sizeof(tmpsec)); ++ ++ } else if ((value = dvbcfg_iskey(line, "name")) != NULL) { ++ strncpy(tmpsec.id, value, sizeof(tmpsec.id)); ++ } else if ((value = dvbcfg_iskey(line, "switch-frequency")) != NULL) { ++ tmpsec.switch_frequency = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-lo-v")) != NULL) { ++ tmpsec.lof_lo_v = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-lo-h")) != NULL) { ++ tmpsec.lof_lo_h = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-lo-l")) != NULL) { ++ tmpsec.lof_lo_l = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-lo-r")) != NULL) { ++ tmpsec.lof_lo_r = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-hi-v")) != NULL) { ++ tmpsec.lof_hi_v = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-hi-h")) != NULL) { ++ tmpsec.lof_hi_h = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-hi-l")) != NULL) { ++ tmpsec.lof_hi_l = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "lof-hi-r")) != NULL) { ++ tmpsec.lof_hi_r = atoi(value); ++ } else if ((value = dvbcfg_iskey(line, "config-type")) != NULL) { ++ if (!strcasecmp(value, "none")) { ++ tmpsec.config_type = DVBSEC_CONFIG_NONE; ++ } else if (!strcasecmp(value, "power")) { ++ tmpsec.config_type = DVBSEC_CONFIG_POWER; ++ } else if (!strcasecmp(value, "standard")) { ++ tmpsec.config_type = DVBSEC_CONFIG_STANDARD; ++ } else if (!strcasecmp(value, "advanced")) { ++ tmpsec.config_type = DVBSEC_CONFIG_ADVANCED; ++ } else { ++ insection = 0; ++ } ++ } else if ((value = dvbcfg_iskey(line, "cmd-lo-v")) != NULL) { ++ strncpy(tmpsec.adv_cmd_lo_v, value, sizeof(tmpsec.adv_cmd_lo_v)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-lo-h")) != NULL) { ++ strncpy(tmpsec.adv_cmd_lo_h, value, sizeof(tmpsec.adv_cmd_lo_h)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-lo-r")) != NULL) { ++ strncpy(tmpsec.adv_cmd_lo_r, value, sizeof(tmpsec.adv_cmd_lo_r)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-lo-l")) != NULL) { ++ strncpy(tmpsec.adv_cmd_lo_l, value, sizeof(tmpsec.adv_cmd_lo_l)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-hi-v")) != NULL) { ++ strncpy(tmpsec.adv_cmd_hi_v, value, sizeof(tmpsec.adv_cmd_hi_v)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-hi-h")) != NULL) { ++ strncpy(tmpsec.adv_cmd_hi_h, value, sizeof(tmpsec.adv_cmd_hi_h)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-hi-r")) != NULL) { ++ strncpy(tmpsec.adv_cmd_hi_r, value, sizeof(tmpsec.adv_cmd_hi_r)); ++ } else if ((value = dvbcfg_iskey(line, "cmd-hi-l")) != NULL) { ++ strncpy(tmpsec.adv_cmd_hi_l, value, sizeof(tmpsec.adv_cmd_hi_l)); ++ } else { ++ insection = 0; ++ } ++ } ++ ++ // output the final section if there is one ++ if (insection) { ++ if (cb(arg, &tmpsec)) ++ return 0; ++ } ++ ++ if (linebuf) ++ free(linebuf); ++ return 0; ++} ++ ++static int dvbsec_cfg_find_callback(void *arg, struct dvbsec_config *sec); ++static int dvbsec_cfg_find_default(const char *sec_id, struct dvbsec_config *sec); ++ ++struct findparams { ++ const char *sec_id; ++ struct dvbsec_config *sec_dest; ++}; ++ ++int dvbsec_cfg_find(const char *config_file, ++ const char *sec_id, ++ struct dvbsec_config *sec) ++{ ++ struct findparams findp; ++ ++ // clear the structure ++ memset(sec, 0, sizeof(struct dvbsec_config)); ++ ++ // open the file ++ if (config_file != NULL) { ++ FILE *f = fopen(config_file, "r"); ++ if (f == NULL) ++ return -EIO; ++ ++ // parse each entry ++ findp.sec_id = sec_id; ++ findp.sec_dest = sec; ++ dvbsec_cfg_load(f, &findp, dvbsec_cfg_find_callback); ++ ++ // done ++ fclose(f); ++ ++ // find it? ++ if (sec->id[0]) ++ return 0; ++ } ++ ++ return dvbsec_cfg_find_default(sec_id, sec); ++} ++ ++static int dvbsec_cfg_find_callback(void *arg, struct dvbsec_config *sec) ++{ ++ struct findparams *findp = arg; ++ ++ if (strcmp(findp->sec_id, sec->id)) ++ return 0; ++ ++ memcpy(findp->sec_dest, sec, sizeof(struct dvbsec_config)); ++ return 1; ++} ++ ++int dvbsec_cfg_save(FILE *f, ++ struct dvbsec_config *secs, ++ int count) ++{ ++ int i; ++ ++ for(i=0; i ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/** ++ * This library allows SEC (Satellite Equipment Control) configurations ++ * to be retrieved. Each configuration is identified by a unique satellite_id. ++ * ++ * In order to make things as easy as possible for users, there are a set of ++ * defaults hardcoded into the library covering the majority of LNB types. When ++ * these are used, the standard back-compatable sequence defined in the DISEQC ++ * standard will be used - this will suffice for _most_ situations. ++ * ++ * UNIVERSAL - Europe, 10800 to 11800 MHz and 11600 to 12700 Mhz, Dual LO, loband 9750, hiband 10600 MHz. ++ * DBS - Expressvu, North America, 12200 to 12700 MHz, Single LO, 11250 MHz. ++ * STANDARD - 10945 to 11450 Mhz, Single LO, 10000Mhz. ++ * ENHANCED - Astra, 10700 to 11700 MHz, Single LO, 9750MHz. ++ * C-BAND - Big Dish, 3700 to 4200 MHz, Single LO, 5150Mhz. ++ * C-MULTI - Big Dish - Multipoint LNBf, 3700 to 4200 MHz, Dual LO, H:5150MHz, V:5750MHz. ++ * ++ * However, for the power user with a more complex setup, these simple defaults ++ * are not enough. Therefore, it is also possible to define additional SEC ++ * configurations in an external configuration file. This file consists of multiple ++ * entries in the following format: ++ * ++ * [sec] ++ * name= ++ * switch-frequency= ++ * lof-lo-v= ++ * lof-lo-h= ++ * lof-lo-l= ++ * lof-lo-r= ++ * lof-hi-v= ++ * lof-hi-h= ++ * lof-hi-l= ++ * lof-hi-r= ++ * config-type= ++ * cmd-lo-v= ++ * cmd-lo-h= ++ * cmd-lo-r= ++ * cmd-lo-l= ++ * cmd-hi-v= ++ * cmd-hi-h= ++ * cmd-hi-r= ++ * cmd-hi-l= ++ * ++ * The sec_id is whatever unique value you wish. If it is the same as one of the hardcoded defaults, the configuration ++ * details from the file will be used instead of the hardcoded ones. ++ * The switch-frequency (or SLOF) indicates the point seperating low band frequencies from high band frequencies. ++ * Set this value to 0 if there is only one frequency band. ++ * The lof-lo-v is the frequency adjustment for V + low band (i.e. less than SLOF), or is used if switch-frequency==0. ++ * The lof-lo-h is the frequency adjustment for H + low band (i.e. less than SLOF), or is used if switch-frequency==0. ++ * The lof-lo-l is the frequency adjustment for L + low band (i.e. less than SLOF), or is used if switch-frequency==0. ++ * The lof-lo-r is the frequency adjustment for R + low band (i.e. less than SLOF), or is used if switch-frequency==0. ++ * The lof-hi-v is the frequency adjustment for V + high band (unused if switch-frequency==0). ++ * The lof-hi-h is the frequency adjustment for H + high band (unused if switch-frequency==0). ++ * The lof-hi-l is the frequency adjustment for L + high band (unused if switch-frequency==0). ++ * The lof-hi-r is the frequency adjustment for R + high band (unused if switch-frequency==0). ++ * ++ * config-type indicates the desired type of SEC command to use, it may be: ++ * none - No SEC commands will be issued (frequency adjustment will still be performed). ++ * power - Only the SEC power is turned on. ++ * standard - The standard DISEQC back compatable sequence will be issued. ++ * advanced - The DISEQC sequence described in the appropriate sec cmd string will be used. ++ * ++ * The cmd-- describes the SEC cmd string to use in advanced mode for each of the possible combinations of ++ * frequency band and polarisation. If a certain combination is not required, it may be omitted. It consists of a ++ * space seperated combination of commands - those available are as follows: ++ * ++ * tone(<0|1>) - control the 22kHz tone 0:off, 1:on ++ * voltage(<0|13|18>) - control the LNB voltage 0v, 13v, or 18v ++ * toneburst() - issue a toneburst (mini command) for position A or B. ++ * highvoltage(<0|1>) - control high lnb voltage for long cable runs 0: normal, 1:add 1v to LNB voltage. ++ * dishnetworks() - issue a dishnetworks legacy command. ++ * wait() - wait for the given number of milliseconds. ++ * Dreset(
, <0|1>) - control the reset state of a DISEC device, 0:disable reset, 1:enable reset. ++ * Dpower(
, <0|1>) - control the power of a DISEC device, 0:off, 1:on. ++ * Dcommitted(
, , , , ) - Write to the committed switches of a DISEC device. ++ * The parameters are for band, polarisation, satelliteposition, switchoption: ++ * band - h:high band, l:low band ++ * polarisation - v: vertical, h:horizontal,r:right,l:left ++ * satelliteposition - a:position A, b: position B ++ * switchoption - a:position A, b: position B ++ * The special value 'x' means "no change to this switch". ++ * ++ * Duncommitted(
, , , , ) - Write to the uncommitted switches of the a DISEC device. ++ * The parameters are for switch1, switch2, switch3, switch4, and may be set to position a or b. ++ * The special value 'x' means "no change to this switch". ++ * ++ * Dfrequency(
, ) - set the frequency of a DISEC device. ++ * Dchannel(
, ) - set the desired channel id of a DISEC device. ++ * Dgotopreset(
, ) - tell a DISEC satellite positioner to move to the given preset id. ++ * Dgotobearing(
, ) - tell a DISEQC terrestrial rotator to go to the ++ * given bearing (range -256.0 -> 512.0 degrees, fractions allowed). ++ * ++ * In the above DISEQC commands,
is the integer (normally in hex format) address of the ++ * diseqc device to communicate with. A list of possiblities is as follows: ++ * ++ * DISEQC_ADDRESS_ANY_DEVICE = 0x00 ++ * ++ * DISEQC_ADDRESS_ANY_LNB_SWITCHER_SMATV = 0x10 ++ * DISEQC_ADDRESS_LNB = 0x11 ++ * DISEQC_ADDRESS_LNB_WITH_LOOP = 0x12 ++ * DISEQC_ADDRESS_SWITCHER = 0x14 ++ * DISEQC_ADDRESS_SWITCHER_WITH_LOOP = 0x15 ++ * DISEQC_ADDRESS_SMATV = 0x18 ++ * ++ * DISEQC_ADDRESS_ANY_POLARISER = 0x20 ++ * DISEQC_ADDRESS_LINEAR_POLARISER = 0x21 ++ * ++ * DISEQC_ADDRESS_ANY_POSITIONER = 0x30 ++ * DISEQC_ADDRESS_POLAR_AZIMUTH_POSITIONER = 0x31 ++ * DISEQC_ADDRESS_ELEVATION_POSITIONER = 0x32 ++ * ++ * DISEQC_ADDRESS_ANY_INSTALLER_AID = 0x40 ++ * DISEQC_ADDRESS_SIGNAL_STRENGTH = 0x41 ++ * ++ * DISEQC_ADDRESS_ANY_INTERFACE = 0x70 ++ * DISEQC_ADDRESS_HEADEND_INTERFACE = 0x71 ++ * ++ * DISEQC_ADDRESS_REALLOC_BASE = 0x60 ++ * DISEQC_ADDRESS_OEM_BASE = 0xf0 ++ */ ++ ++#ifndef DVBSEC_CFG_H ++#define DVBSEC_CFG_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Callback function used in dvbsec_cfg_load(). ++ * ++ * @param arg Private information to caller. ++ * @param channel The current channel details. ++ * @return 0 to continue, 1 to stop loading. ++ */ ++typedef int (*dvbsec_cfg_callback)(void *arg, struct dvbsec_config *sec); ++ ++/** ++ * Load an SEC file. ++ * ++ * @param f File to load from. ++ * @param arg Value to pass to 'arg' in callback above. ++ * @param cb Callback function called for each sec loaded from the file. ++ * @return 0 on success, or nonzero error code on failure. ++ */ ++extern int dvbsec_cfg_load(FILE *f, void *arg, ++ dvbsec_cfg_callback cb); ++ ++/** ++ * Convenience function to parse an SEC config file. This will also consult the set ++ * of hardcoded defaults if no config file was supplied, or a match was not found in ++ * the config file. ++ * ++ * @param config_file Config filename to load, or NULL to just check defaults. ++ * @param sec_id ID of SEC configuration. ++ * @param sec Where to put the details if found. ++ * @return 0 on success, nonzero on error. ++ */ ++extern int dvbsec_cfg_find(const char *config_file, ++ const char *sec_id, ++ struct dvbsec_config *sec); ++ ++/** ++ * Save SEC format config file. ++ * ++ * @param f File to save to. ++ * @param secs Pointer to array of SECs to save. ++ * @param count Number of entries in the above array. ++ * @return 0 on success, or nonzero error code on failure. ++ */ ++extern int dvbsec_cfg_save(FILE *f, ++ struct dvbsec_config *secs, ++ int count); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libdvbsec/Makefile dvb-apps/lib/libdvbsec/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libdvbsec/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libdvbsec/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,17 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libdvbsec ++ ++includes = dvbsec_api.h \ ++ dvbsec_cfg.h ++ ++objects = dvbsec_api.o \ ++ dvbsec_cfg.o ++ ++lib_name = libdvbsec ++ ++CPPFLAGS += -I../../lib ++ ++.PHONY: all ++ ++all: library ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/access_descriptor.c dvb-apps/lib/libesg/bootstrap/access_descriptor.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/access_descriptor.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/bootstrap/access_descriptor.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,115 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_access_descriptor *esg_access_descriptor_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_access_descriptor *access_descriptor; ++ struct esg_entry *entry; ++ struct esg_entry *last_entry; ++ uint32_t entry_length; ++ uint16_t entry_index; ++ uint8_t ip_index; ++ ++ if ((buffer == NULL) || (size <= 2)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ access_descriptor = (struct esg_access_descriptor *) malloc(sizeof(struct esg_access_descriptor)); ++ memset(access_descriptor, 0, sizeof(struct esg_access_descriptor)); ++ access_descriptor->entry_list = NULL; ++ ++ access_descriptor->n_o_entries = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ last_entry = NULL; ++ for (entry_index = 0; entry_index < access_descriptor->n_o_entries; entry_index++) { ++ entry = (struct esg_entry *) malloc(sizeof(struct esg_entry)); ++ memset(entry, 0, sizeof(struct esg_entry)); ++ entry->_next = NULL; ++ ++ if (last_entry == NULL) { ++ access_descriptor->entry_list = entry; ++ } else { ++ last_entry->_next = entry; ++ } ++ last_entry = entry; ++ ++ entry->version = buffer[pos]; ++ pos += 1; ++ ++ pos += vluimsbf8(buffer + pos, size - pos, &entry_length); ++ ++ if (size < pos + entry_length) { ++ esg_access_descriptor_free(access_descriptor); ++ return NULL; ++ } ++ ++ entry->multiple_stream_transport = (buffer[pos] & 0x80) ? 1 : 0; ++ entry->ip_version_6 = (buffer[pos] & 0x40) ? 1 : 0; ++ pos += 1; ++ ++ entry->provider_id = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ if (entry->ip_version_6) { ++ for (ip_index = 0; ip_index < 16; ip_index++) { ++ entry->source_ip.ipv6[ip_index] = buffer[pos+ip_index]; ++ entry->destination_ip.ipv6[ip_index] = buffer[pos+16+ip_index]; ++ } ++ pos += 32; ++ } else { ++ for (ip_index = 0; ip_index < 4; ip_index++) { ++ entry->source_ip.ipv4[ip_index] = buffer[pos+ip_index]; ++ entry->destination_ip.ipv4[ip_index] = buffer[pos+4+ip_index]; ++ } ++ pos += 8; ++ } ++ entry->port = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ entry->tsi = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ } ++ ++ return access_descriptor; ++} ++ ++void esg_access_descriptor_free(struct esg_access_descriptor *access_descriptor) { ++ struct esg_entry *entry; ++ struct esg_entry *next_entry; ++ ++ if (access_descriptor == NULL) { ++ return; ++ } ++ ++ for(entry = access_descriptor->entry_list; entry; entry = next_entry) { ++ next_entry = entry->_next; ++ free(entry); ++ } ++ ++ free(access_descriptor); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/access_descriptor.h dvb-apps/lib/libesg/bootstrap/access_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/access_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/bootstrap/access_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,86 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_BOOTSTRAP_ACCESS_DESCRIPTOR_H ++#define _ESG_BOOTSTRAP_ACCESS_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_entry structure. ++ */ ++struct esg_entry { ++ uint8_t version; ++ uint8_t multiple_stream_transport; ++ uint8_t ip_version_6; ++ uint16_t provider_id; ++ union esg_ip_address source_ip; ++ union esg_ip_address destination_ip; ++ uint16_t port; ++ uint16_t tsi; ++ ++ struct esg_entry *_next; ++}; ++ ++/** ++ * esg_access_descriptor structure. ++ */ ++struct esg_access_descriptor { ++ uint16_t n_o_entries; ++ struct esg_entry *entry_list; ++}; ++ ++/** ++ * Process an esg_access_descriptor. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_access_descriptor structure, or NULL on error. ++ */ ++extern struct esg_access_descriptor *esg_access_descriptor_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_access_descriptor. ++ * ++ * @param esg Pointer to an esg_access_descriptor structure. ++ */ ++extern void esg_access_descriptor_free(struct esg_access_descriptor *access_descriptor); ++ ++/** ++ * Convenience iterator for esg_entry_list field of an esg_access_descriptor. ++ * ++ * @param access_descriptor The esg_access_descriptor pointer. ++ * @param entry Variable holding a pointer to the current esg_entry. ++ */ ++#define esg_access_descriptor_entry_list_for_each(access_descriptor, entry) \ ++ for ((entry) = (access_descriptor)->entry_list; \ ++ (entry); \ ++ (entry) = (entry)->_next) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/Makefile dvb-apps/lib/libesg/bootstrap/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/bootstrap/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,24 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libesg/bootstrap ++ ++.PHONY: sub-error-bootstrap ++ ++sub-error-bootstrap: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += bootstrap/access_descriptor.o \ ++ bootstrap/provider_discovery_descriptor.o ++ ++sub-install += bootstrap ++ ++else ++ ++includes = access_descriptor.h \ ++ provider_discovery_descriptor.h ++ ++include ../../../Make.rules ++ ++lib_name = libesg/bootstrap ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/provider_discovery_descriptor.c dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/provider_discovery_descriptor.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,50 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_provider_discovery_descriptor *esg_esg_provider_discovery_descriptor_decode(uint8_t *buffer, uint32_t size) { ++ struct esg_provider_discovery_descriptor *provider; ++ ++ provider = (struct esg_provider_discovery_descriptor *) malloc(sizeof(struct esg_provider_discovery_descriptor)); ++ memset(provider, 0, sizeof(struct esg_provider_discovery_descriptor)); ++ ++ provider->xml = (uint8_t *) malloc(size); ++ memcpy(provider->xml, buffer, size); ++ ++ provider->size = size; ++ ++ return provider; ++} ++ ++void esg_provider_discovery_descriptor_free(struct esg_provider_discovery_descriptor *provider) { ++ if (provider == NULL) { ++ return; ++ } ++ ++ if (provider->xml) { ++ free(provider->xml); ++ } ++ ++ free(provider); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/provider_discovery_descriptor.h dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/bootstrap/provider_discovery_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,59 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_BOOTSTRAP_PROVIDER_DISCOVERY_DESCRIPTOR_H ++#define _ESG_BOOTSTRAP_PROVIDER_DISCOVERY_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_provider_discovery_descriptor structure. ++ */ ++struct esg_provider_discovery_descriptor { ++ uint8_t *xml; ++ uint32_t size; ++}; ++ ++/** ++ * Process an esg_provider_discovery_descriptor. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_provider_discovery_descriptor structure, or NULL on error. ++ */ ++extern struct esg_provider_discovery_descriptor *esg_esg_provider_discovery_descriptor_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_provider_discovery_descriptor. ++ * ++ * @param esg Pointer to an esg_provider_discovery_descriptor structure. ++ */ ++extern void esg_provider_discovery_descriptor_free(struct esg_provider_discovery_descriptor *provider); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/auxiliary_data.h dvb-apps/lib/libesg/encapsulation/auxiliary_data.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/auxiliary_data.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/auxiliary_data.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,62 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_ENCAPSULATION_AUXILIARY_DATA_H ++#define _ESG_ENCAPSULATION_AUXILIARY_DATA_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_any_attribute structure. ++ */ ++struct esg_any_attribute { ++ uint8_t version_id; ++ uint8_t *extension; ++ ++ struct esg_any_attribure *_next; ++}; ++ ++/** ++ * esg_binary_header structure. ++ */ ++struct esg_binary_header { ++ uint16_t encoding_metadatauri_mimetype; ++ struct esg_any_attribute *any_attribute_list; ++}; ++ ++/** ++ * esg_encapsulated_aux_data struct. ++ */ ++struct esg_encapsulated_aux_data { ++ struct esg_binary_header *binary_header; ++ uint32_t aux_data_length; ++ uint8_t aux_data; ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/container.c dvb-apps/lib/libesg/encapsulation/container.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/container.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/container.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,206 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++struct esg_container *esg_container_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_container *container; ++ struct esg_container_structure *structure; ++ struct esg_container_structure *last_structure; ++ uint8_t structure_index; ++ ++ if ((buffer == NULL) || (size <= 1)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ container = (struct esg_container *) malloc(sizeof(struct esg_container)); ++ memset(container, 0, sizeof(struct esg_container)); ++ ++ // Container header ++ container->header = (struct esg_container_header *) malloc(sizeof(struct esg_container_header)); ++ memset(container->header, 0, sizeof(struct esg_container_header)); ++ ++ container->header->num_structures = buffer[pos]; ++ pos += 1; ++ ++ if (size < pos + (container->header->num_structures * 8)) { ++ esg_container_free(container); ++ return NULL; ++ } ++ ++ last_structure = NULL; ++ for (structure_index = 0; structure_index < container->header->num_structures; structure_index++) { ++ structure = (struct esg_container_structure *) malloc(sizeof(struct esg_container_structure)); ++ memset(structure, 0, sizeof(struct esg_container_structure)); ++ structure->_next = NULL; ++ ++ if (last_structure == NULL) { ++ container->header->structure_list = structure; ++ } else { ++ last_structure->_next = structure; ++ } ++ last_structure = structure; ++ ++ structure->type = buffer[pos]; ++ pos += 1; ++ ++ structure->id = buffer[pos]; ++ pos += 1; ++ ++ structure->ptr = (buffer[pos] << 16) | (buffer[pos+1] << 8) | buffer[pos+2]; ++ pos += 3; ++ ++ structure->length = (buffer[pos] << 16) | (buffer[pos+1] << 8) | buffer[pos+2]; ++ pos += 3; ++ ++ if (size < (structure->ptr + structure->length)) { ++ esg_container_free(container); ++ return NULL; ++ } ++ ++ // Decode structure ++ switch (structure->type) { ++ case 0x01: { ++ switch (structure->id) { ++ case 0x00: { ++ structure->data = (void *) esg_encapsulation_structure_decode(buffer + structure->ptr, structure->length); ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ break; ++ } ++ case 0x02: { ++ switch (structure->id) { ++ case 0x00: { ++ structure->data = (void *) esg_string_repository_decode(buffer + structure->ptr, structure->length); ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ break; ++ } ++ case 0x03: { ++ //TODO ++ break; ++ } ++ case 0x04: { ++ //TODO ++ break; ++ } ++ case 0x05: { ++ //TODO ++ break; ++ } ++ case 0xE0: { ++ switch (structure->id) { ++ case 0x00: { ++ structure->data = (void *) esg_data_repository_decode(buffer + structure->ptr, structure->length); ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ break; ++ } ++ case 0xE1: { ++ switch (structure->id) { ++ case 0xFF: { ++ structure->data = (void *) esg_session_partition_declaration_decode(buffer + structure->ptr, structure->length); ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ break; ++ } ++ case 0xE2: { ++ switch (structure->id) { ++ case 0x00: { ++ structure->data = (void *) esg_init_message_decode(buffer + structure->ptr, structure->length); ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ break; ++ } ++ default: { ++ esg_container_free(container); ++ return NULL; ++ } ++ } ++ } ++ ++ // Container structure body ++ container->structure_body_ptr = pos; ++ container->structure_body_length = size - pos; ++ container->structure_body = (uint8_t *) malloc(size - pos); ++ memcpy(container->structure_body, buffer + pos, size - pos); ++ ++ return container; ++} ++ ++void esg_container_free(struct esg_container *container) { ++ struct esg_container_structure *structure; ++ struct esg_container_structure *next_structure; ++ ++ if (container == NULL) { ++ return; ++ } ++ ++ if (container->header) { ++ for(structure = container->header->structure_list; structure; structure = next_structure) { ++ next_structure = structure->_next; ++ free(structure); ++ } ++ ++ free(container->header); ++ } ++ ++ if (container->structure_body) { ++ free(container->structure_body); ++ } ++ ++ free(container); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/container.h dvb-apps/lib/libesg/encapsulation/container.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/container.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/container.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,94 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_ENCAPSULATION_CONTAINER_H ++#define _ESG_ENCAPSULATION_CONTAINER_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_container_structure structure. ++ */ ++struct esg_container_structure { ++ uint8_t type; ++ uint8_t id; ++ uint32_t ptr; ++ uint32_t length; ++ ++ void *data; ++ ++ struct esg_container_structure *_next; ++}; ++ ++/** ++ * esg_container_header structure. ++ */ ++struct esg_container_header { ++ uint8_t num_structures; ++ struct esg_container_structure *structure_list; ++}; ++ ++/** ++ * esg_container structure ++ */ ++struct esg_container { ++ struct esg_container_header *header; ++ uint32_t structure_body_ptr; ++ uint32_t structure_body_length; ++ uint8_t *structure_body; ++}; ++ ++/** ++ * Process an esg_container. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_container structure, or NULL on error. ++ */ ++extern struct esg_container *esg_container_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_container. ++ * ++ * @param container Pointer to an esg_container structure. ++ */ ++extern void esg_container_free(struct esg_container *container); ++ ++/** ++ * Convenience iterator for structure_list field of an esg_container_header. ++ * ++ * @param container The esg_container_header pointer. ++ * @param structure Variable holding a pointer to the current esg_container_structure. ++ */ ++#define esg_container_header_structure_list_for_each(header, structure) \ ++ for ((structure) = (header)->structure_list; \ ++ (structure); \ ++ (structure) = (structure)->_next) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/data_repository.c dvb-apps/lib/libesg/encapsulation/data_repository.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/data_repository.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/data_repository.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,53 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_data_repository *esg_data_repository_decode(uint8_t *buffer, uint32_t size) { ++ struct esg_data_repository *data_repository; ++ ++ if ((buffer == NULL) || (size <= 0)) { ++ return NULL; ++ } ++ ++ data_repository = (struct esg_data_repository *) malloc(sizeof(struct esg_data_repository)); ++ memset(data_repository, 0, sizeof(struct esg_data_repository)); ++ ++ data_repository->length = size; ++ data_repository->data = (uint8_t *) malloc(size); ++ memcpy(data_repository->data, buffer, size); ++ ++ return data_repository; ++} ++ ++void esg_data_repository_free(struct esg_data_repository *data_repository) { ++ if (data_repository == NULL) { ++ return; ++ } ++ ++ if (data_repository->data) { ++ free(data_repository->data); ++ } ++ ++ free(data_repository); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/data_repository.h dvb-apps/lib/libesg/encapsulation/data_repository.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/data_repository.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/data_repository.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,59 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_ENCAPSULATION_DATA_REPOSITORY_H ++#define _ESG_ENCAPSULATION_DATA_REPOSITORY_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_data_repository structure. ++ */ ++struct esg_data_repository { ++ uint32_t length; ++ uint8_t *data; ++}; ++ ++/** ++ * Process an esg_data_repository. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_data_repository structure, or NULL on error. ++ */ ++extern struct esg_data_repository *esg_data_repository_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_data_repository. ++ * ++ * @param data_repository Pointer to an esg_data_repository structure. ++ */ ++extern void esg_data_repository_free(struct esg_data_repository *data_repository); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/fragment_management_information.c dvb-apps/lib/libesg/encapsulation/fragment_management_information.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/fragment_management_information.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/fragment_management_information.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,118 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_encapsulation_structure *esg_encapsulation_structure_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_encapsulation_structure *structure; ++ struct esg_encapsulation_entry *entry; ++ struct esg_encapsulation_entry *last_entry; ++ ++ if ((buffer == NULL) || (size <= 2)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ structure = (struct esg_encapsulation_structure *) malloc(sizeof(struct esg_encapsulation_structure)); ++ memset(structure, 0, sizeof(struct esg_encapsulation_structure)); ++ structure->entry_list = NULL; ++ ++ // Encapsulation header ++ structure->header = (struct esg_encapsulation_header *) malloc(sizeof(struct esg_encapsulation_header)); ++ // buffer[pos] reserved ++ structure->header->fragment_reference_format = buffer[pos+1]; ++ pos += 2; ++ ++ // Encapsulation entry list ++ last_entry = NULL; ++ while (size > pos) { ++ entry = (struct esg_encapsulation_entry *) malloc(sizeof(struct esg_encapsulation_entry)); ++ memset(entry, 0, sizeof(struct esg_encapsulation_entry)); ++ entry->_next = NULL; ++ ++ if (last_entry == NULL) { ++ structure->entry_list = entry; ++ } else { ++ last_entry->_next = entry; ++ } ++ last_entry = entry; ++ ++ // Fragment reference ++ switch (structure->header->fragment_reference_format) { ++ case 0x21: { ++ entry->fragment_reference = (struct esg_fragment_reference *) malloc(sizeof(struct esg_fragment_reference)); ++ memset(entry->fragment_reference, 0, sizeof(struct esg_fragment_reference)); ++ ++ entry->fragment_reference->fragment_type = buffer[pos]; ++ pos += 1; ++ ++ entry->fragment_reference->data_repository_offset = (buffer[pos] << 16) | (buffer[pos+1] << 8) | buffer[pos+2]; ++ pos += 3; ++ ++ break; ++ } ++ default: { ++ esg_encapsulation_structure_free(structure); ++ return NULL; ++ } ++ } ++ ++ // Fragment version & id ++ entry->fragment_version = buffer[pos]; ++ pos += 1; ++ ++ entry->fragment_id = (buffer[pos] << 16) | (buffer[pos+1] << 8) | buffer[pos+2]; ++ pos += 3; ++ } ++ ++ return structure; ++} ++ ++void esg_encapsulation_structure_free(struct esg_encapsulation_structure *structure) { ++ struct esg_encapsulation_entry *entry; ++ struct esg_encapsulation_entry *next_entry; ++ ++ if (structure == NULL) { ++ return; ++ } ++ ++ if (structure->header) { ++ free(structure->header); ++ } ++ ++ if (structure->entry_list) { ++ for(entry = structure->entry_list; entry; entry = next_entry) { ++ next_entry = entry->_next; ++ if (entry->fragment_reference) { ++ free(entry->fragment_reference); ++ } ++ free(entry); ++ } ++ ++ free(structure->entry_list); ++ } ++ ++ free(structure); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/fragment_management_information.h dvb-apps/lib/libesg/encapsulation/fragment_management_information.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/fragment_management_information.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/fragment_management_information.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,96 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_ENCAPSULATION_FRAGMENT_MANAGEMENT_INFORMATION_H ++#define _ESG_ENCAPSULATION_FRAGMENT_MANAGEMENT_INFORMATION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_encapsulation_header structure. ++ */ ++struct esg_encapsulation_header { ++ uint8_t fragment_reference_format; ++}; ++ ++/** ++ * esg_fragment_reference structure. ++ */ ++struct esg_fragment_reference { ++ uint8_t fragment_type; ++ uint32_t data_repository_offset; ++}; ++ ++/** ++ * esg_encapsulation_entry structure. ++ */ ++struct esg_encapsulation_entry { ++ struct esg_fragment_reference *fragment_reference; ++ uint8_t fragment_version; ++ uint32_t fragment_id; ++ ++ struct esg_encapsulation_entry *_next; ++}; ++ ++/** ++ * esg_encapsulation_structure structure. ++ */ ++struct esg_encapsulation_structure { ++ struct esg_encapsulation_header *header; ++ struct esg_encapsulation_entry *entry_list; ++}; ++ ++/** ++ * Process an esg_encapsulation_structure. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_encapsulation_structure structure, or NULL on error. ++ */ ++extern struct esg_encapsulation_structure *esg_encapsulation_structure_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_encapsulation_structure. ++ * ++ * @param container Pointer to an esg_container structure. ++ */ ++extern void esg_encapsulation_structure_free(struct esg_encapsulation_structure *structure); ++ ++/** ++ * Convenience iterator for entry_list field of an esg_encapsulation_structure. ++ * ++ * @param structure The esg_encapsulation_structure pointer. ++ * @param entry Variable holding a pointer to the current esg_encapsulation_entry. ++ */ ++#define esg_encapsulation_structure_entry_list_for_each(structure, entry) \ ++ for ((entry) = (structure)->entry_list; \ ++ (entry); \ ++ (entry) = (entry)->_next) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/Makefile dvb-apps/lib/libesg/encapsulation/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,28 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libesg/encapsulation ++ ++.PHONY: sub-error-encapsulation ++ ++sub-error-encapsulation: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += encapsulation/container.o \ ++ encapsulation/fragment_management_information.o \ ++ encapsulation/data_repository.o \ ++ encapsulation/string_repository.o ++ ++sub-install += encapsulation ++ ++else ++ ++includes = container.h \ ++ fragment_management_information.h \ ++ data_repository.h \ ++ string_repository.h ++ ++include ../../../Make.rules ++ ++lib_name = libesg/encapsulation ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/string_repository.c dvb-apps/lib/libesg/encapsulation/string_repository.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/string_repository.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/string_repository.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_string_repository *esg_string_repository_decode(uint8_t *buffer, uint32_t size) { ++ struct esg_string_repository *string_repository; ++ ++ if ((buffer == NULL) || (size <= 1)) { ++ return NULL; ++ } ++ ++ string_repository = (struct esg_string_repository *) malloc(sizeof(struct esg_string_repository)); ++ memset(string_repository, 0, sizeof(struct esg_string_repository)); ++ ++ string_repository->encoding_type = buffer[0]; ++ string_repository->length = size-1; ++ string_repository->data = (uint8_t *) malloc(size-1); ++ memcpy(string_repository->data, buffer+1, size-1); ++ ++ return string_repository; ++} ++ ++void esg_string_repository_free(struct esg_string_repository *string_repository) { ++ if (string_repository == NULL) { ++ return; ++ } ++ ++ if (string_repository->data) { ++ free(string_repository->data); ++ } ++ ++ free(string_repository); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/string_repository.h dvb-apps/lib/libesg/encapsulation/string_repository.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/encapsulation/string_repository.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/encapsulation/string_repository.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,60 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_ENCAPSULATION_STRING_REPOSITORY_H ++#define _ESG_ENCAPSULATION_STRING_REPOSITORY_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_string_repository structure. ++ */ ++struct esg_string_repository { ++ uint8_t encoding_type; ++ uint32_t length; ++ uint8_t *data; ++}; ++ ++/** ++ * Process an esg_string_repository. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_string_repository structure, or NULL on error. ++ */ ++extern struct esg_string_repository *esg_string_repository_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_string_repository. ++ * ++ * @param data_repository Pointer to an esg_string_repository structure. ++ */ ++extern void esg_string_repository_free(struct esg_string_repository *string_repository); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/Makefile dvb-apps/lib/libesg/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libesg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,27 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libesg ++ ++includes = types.h ++ ++objects = types.o ++ ++lib_name = libesg ++ ++CPPFLAGS += -I../../lib ++ ++.PHONY: all ++ ++all: library ++ ++include bootstrap/Makefile ++include encapsulation/Makefile ++include representation/Makefile ++include transport/Makefile ++ ++.PHONY: $(sub-install) ++ ++install:: $(sub-install) ++ ++$(sub-install): ++ $(MAKE) -C $@ install ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/bim_decoder_init.h dvb-apps/lib/libesg/representation/bim_decoder_init.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/bim_decoder_init.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/bim_decoder_init.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,40 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_REPRESENTATION_BIM_DECODER_INIT_H ++#define _ESG_REPRESENTATION_BIM_DECODER_INIT_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/** ++ * esg_bim_decoder_init structure. ++ */ ++struct esg_bim_decoder_init { ++// TODO ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h dvb-apps/lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,40 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_REPRESENTATION_ENCAPSULATED_BIM_ESG_XML_FRAGMENT_H ++#define _ESG_REPRESENTATION_ENCAPSULATED_BIM_ESG_XML_FRAGMENT_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/** ++ * esg_encapsulated_bim_esg_xml_fragment structure. ++ */ ++struct esg_encapsulated_bim_esg_xml_fragment { ++ //TODO ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,70 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++#include ++ ++struct esg_encapsulated_textual_esg_xml_fragment *esg_encapsulated_textual_esg_xml_fragment_decode(uint8_t *buffer, uint32_t size) { ++ struct esg_encapsulated_textual_esg_xml_fragment *esg_xml_fragment; ++ uint32_t pos; ++ uint32_t length; ++ uint8_t offset_pos; ++ ++ if ((buffer == NULL) || (size <= 0)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ esg_xml_fragment = (struct esg_encapsulated_textual_esg_xml_fragment *) malloc(sizeof(struct esg_encapsulated_textual_esg_xml_fragment)); ++ memset(esg_xml_fragment, 0, sizeof(struct esg_encapsulated_textual_esg_xml_fragment)); ++ ++ offset_pos = vluimsbf8(buffer+pos+2, size-pos-2, &length); ++ ++ if (size-pos-2 < offset_pos+length) { ++ esg_encapsulated_textual_esg_xml_fragment_free(esg_xml_fragment); ++ return NULL; ++ } ++ ++ esg_xml_fragment->esg_xml_fragment_type = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2+offset_pos; ++ ++ esg_xml_fragment->data_length = length; ++ esg_xml_fragment->data = (uint8_t *) malloc(length); ++ memcpy(esg_xml_fragment->data, buffer+pos, length); ++ pos += length; ++ ++ return esg_xml_fragment; ++} ++ ++void esg_encapsulated_textual_esg_xml_fragment_free(struct esg_encapsulated_textual_esg_xml_fragment *esg_xml_fragment) { ++ if (esg_xml_fragment == NULL) { ++ return; ++ } ++ ++ if (esg_xml_fragment->data) { ++ free(esg_xml_fragment->data); ++ } ++ ++ free(esg_xml_fragment); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,60 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_REPRESENTATION_ENCAPSULATED_TEXTUAL_ESG_XML_FRAGMENT_H ++#define _ESG_REPRESENTATION_ENCAPSULATED_TEXTUAL_ESG_XML_FRAGMENT_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_encapsulated_textual_esg_xml_fragment structure. ++ */ ++struct esg_encapsulated_textual_esg_xml_fragment { ++ uint16_t esg_xml_fragment_type; ++ uint32_t data_length; ++ uint8_t *data; ++}; ++ ++/** ++ * Process an esg_encapsulated_textual_esg_xml_fragment. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_encapsulated_textual_esg_xml_fragment structure, or NULL on error. ++ */ ++extern struct esg_encapsulated_textual_esg_xml_fragment *esg_encapsulated_textual_esg_xml_fragment_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_encapsulated_textual_esg_xml_fragment. ++ * ++ * @param data_repository Pointer to an esg_encapsulated_textual_esg_xml_fragment structure. ++ */ ++extern void esg_encapsulated_textual_esg_xml_fragment_free(struct esg_encapsulated_textual_esg_xml_fragment *esg_xml_fragment); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/init_message.c dvb-apps/lib/libesg/representation/init_message.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/init_message.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/init_message.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,112 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++struct esg_init_message *esg_init_message_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_init_message *init_message; ++ ++ if ((buffer == NULL) || (size <= 3)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ init_message = (struct esg_init_message *) malloc(sizeof(struct esg_init_message)); ++ memset(init_message, 0, sizeof(struct esg_init_message)); ++ ++ init_message->encoding_version = buffer[pos]; ++ pos += 1; ++ ++ init_message->indexing_flag = (buffer[pos] & 0x80) >> 7; ++ pos += 1; ++ ++ init_message->decoder_init_ptr = buffer[pos]; ++ pos += 1; ++ ++ if (init_message->indexing_flag) { ++ init_message->indexing_version = buffer[pos]; ++ pos += 1; ++ } ++ ++ switch (init_message->encoding_version) { ++ case 0xF1: { ++ struct esg_bim_encoding_parameters *encoding_parameters = (struct esg_bim_encoding_parameters *) malloc(sizeof(struct esg_bim_encoding_parameters)); ++ memset(encoding_parameters, 0, sizeof(struct esg_bim_encoding_parameters)); ++ init_message->encoding_parameters = (void *) encoding_parameters; ++ ++ encoding_parameters->buffer_size_flag = (buffer[pos] & 0x80) >> 7; ++ encoding_parameters->position_code_flag = (buffer[pos] & 0x40) >> 6; ++ pos += 1; ++ ++ encoding_parameters->character_encoding = buffer[pos]; ++ pos += 1; ++ ++ if (encoding_parameters->buffer_size_flag) { ++ encoding_parameters->buffer_size = (buffer[pos] << 16) | (buffer[pos+1] << 8) | buffer[pos+2]; ++ pos += 3; ++ } ++ ++// TODO ++// init_message->decoder_init = (void *) esg_bim_decoder_init_decode(buffer + init_message->decoder_init_ptr, size - init_message->decoder_init_ptr); ++ break; ++ } ++ case 0xF2: ++ case 0xF3: { ++ struct esg_textual_encoding_parameters *encoding_parameters = (struct esg_textual_encoding_parameters *) malloc(sizeof(struct esg_textual_encoding_parameters)); ++ memset(encoding_parameters, 0, sizeof(struct esg_textual_encoding_parameters)); ++ init_message->encoding_parameters = (void *) encoding_parameters; ++ ++ encoding_parameters->character_encoding = buffer[pos]; ++ pos += 1; ++ ++ init_message->decoder_init = (void *) esg_textual_decoder_init_decode(buffer + init_message->decoder_init_ptr, size - init_message->decoder_init_ptr); ++ break; ++ } ++ default: { ++ esg_init_message_free(init_message); ++ return NULL; ++ } ++ } ++ ++ return init_message; ++} ++ ++void esg_init_message_free(struct esg_init_message *init_message) { ++ if (init_message == NULL) { ++ return; ++ } ++ ++ if (init_message->encoding_parameters) { ++ free(init_message->encoding_parameters); ++ } ++ ++ if (init_message->decoder_init) { ++ free(init_message->decoder_init); ++ } ++ ++ free(init_message); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/init_message.h dvb-apps/lib/libesg/representation/init_message.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/init_message.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/init_message.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,80 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_REPRESENTATION_INIT_MESSAGE_H ++#define _ESG_REPRESENTATION_INIT_MESSAGE_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_textual_encoding_parameters structure. ++ */ ++struct esg_textual_encoding_parameters { ++ uint8_t character_encoding; ++}; ++ ++/** ++ * esg_bim_encoding_parameters structure. ++ */ ++struct esg_bim_encoding_parameters { ++ uint8_t buffer_size_flag; ++ uint8_t position_code_flag; ++ uint8_t character_encoding; ++ uint32_t buffer_size; // if buffer_size_flag ++}; ++ ++/** ++ * esg_init_message structure. ++ */ ++struct esg_init_message { ++ uint8_t encoding_version; ++ uint8_t indexing_flag; ++ uint8_t decoder_init_ptr; ++ uint8_t indexing_version; // if indexing_flag ++ void *encoding_parameters; ++ void *decoder_init; ++}; ++ ++/** ++ * Process an esg_init_message. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_string_repository structure, or NULL on error. ++ */ ++extern struct esg_init_message *esg_init_message_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_init_message. ++ * ++ * @param init_message Pointer to an esg_init_message structure. ++ */ ++extern void esg_init_message_free(struct esg_init_message *init_message); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/Makefile dvb-apps/lib/libesg/representation/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,26 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libesg/representation ++ ++.PHONY: sub-error-representation ++ ++sub-error-representation: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += representation/encapsulated_textual_esg_xml_fragment.o \ ++ representation/init_message.o \ ++ representation/textual_decoder_init.o ++ ++sub-install += representation ++ ++else ++ ++includes = encapsulated_textual_esg_xml_fragment.h \ ++ init_message.h \ ++ textual_decoder_init.h ++ ++include ../../../Make.rules ++ ++lib_name = libesg/representation ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/textual_decoder_init.c dvb-apps/lib/libesg/representation/textual_decoder_init.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/textual_decoder_init.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/textual_decoder_init.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,128 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++#include ++ ++struct esg_textual_decoder_init *esg_textual_decoder_init_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_textual_decoder_init *decoder_init; ++ struct esg_namespace_prefix *namespace_prefix; ++ struct esg_namespace_prefix *last_namespace_prefix; ++ struct esg_xml_fragment_type *xml_fragment_type; ++ struct esg_xml_fragment_type *last_xml_fragment_type; ++ uint32_t decoder_init_length; ++ uint8_t num_index; ++ ++ if ((buffer == NULL) || (size <= 1)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ decoder_init = (struct esg_textual_decoder_init *) malloc(sizeof(struct esg_textual_decoder_init)); ++ memset(decoder_init, 0, sizeof(struct esg_textual_decoder_init)); ++ decoder_init->namespace_prefix_list = NULL; ++ decoder_init->xml_fragment_type_list = NULL; ++ ++ decoder_init->version = buffer[pos]; ++ pos += 1; ++ ++ pos += vluimsbf8(buffer+pos, size-pos, &decoder_init_length); ++ ++ if (size < pos + decoder_init_length) { ++ esg_textual_decoder_init_free(decoder_init); ++ return NULL; ++ } ++ ++ decoder_init->num_namespace_prefixes = buffer[pos]; ++ pos += 1; ++ ++ last_namespace_prefix = NULL; ++ for (num_index = 0; num_index < decoder_init->num_namespace_prefixes; num_index++) { ++ namespace_prefix = (struct esg_namespace_prefix *) malloc(sizeof(struct esg_namespace_prefix)); ++ memset(namespace_prefix, 0, sizeof(struct esg_namespace_prefix)); ++ namespace_prefix->_next = NULL; ++ ++ if (last_namespace_prefix == NULL) { ++ decoder_init->namespace_prefix_list = namespace_prefix; ++ } else { ++ last_namespace_prefix->_next = namespace_prefix; ++ } ++ last_namespace_prefix = namespace_prefix; ++ ++ namespace_prefix->prefix_string_ptr = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ namespace_prefix->namespace_uri_ptr = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ } ++ ++ decoder_init->num_fragment_types = buffer[pos]; ++ pos += 1; ++ ++ last_xml_fragment_type = NULL; ++ for (num_index = 0; num_index < decoder_init->num_fragment_types; num_index++) { ++ xml_fragment_type = (struct esg_xml_fragment_type *) malloc(sizeof(struct esg_xml_fragment_type)); ++ memset(xml_fragment_type, 0, sizeof(struct esg_xml_fragment_type)); ++ xml_fragment_type->_next = NULL; ++ ++ if (last_xml_fragment_type == NULL) { ++ decoder_init->xml_fragment_type_list = xml_fragment_type; ++ } else { ++ last_xml_fragment_type->_next = xml_fragment_type; ++ } ++ last_xml_fragment_type = xml_fragment_type; ++ ++ xml_fragment_type->xpath_ptr = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ xml_fragment_type->xml_fragment_type = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ } ++ ++ return decoder_init; ++} ++ ++void esg_textual_decoder_init_free(struct esg_textual_decoder_init *decoder_init) { ++ struct esg_namespace_prefix *namespace_prefix; ++ struct esg_namespace_prefix *next_namespace_prefix; ++ struct esg_xml_fragment_type *xml_fragment_type; ++ struct esg_xml_fragment_type *next_xml_fragment_type; ++ ++ if (decoder_init == NULL) { ++ return; ++ } ++ ++ for(namespace_prefix = decoder_init->namespace_prefix_list; namespace_prefix; namespace_prefix = next_namespace_prefix) { ++ next_namespace_prefix = namespace_prefix->_next; ++ free(namespace_prefix); ++ } ++ ++ for(xml_fragment_type = decoder_init->xml_fragment_type_list; xml_fragment_type; xml_fragment_type = next_xml_fragment_type) { ++ next_xml_fragment_type = xml_fragment_type->_next; ++ free(xml_fragment_type); ++ } ++ ++ free(decoder_init); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/representation/textual_decoder_init.h dvb-apps/lib/libesg/representation/textual_decoder_init.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/representation/textual_decoder_init.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/representation/textual_decoder_init.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,104 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_REPRESENTATION_TEXTUAL_DECODER_INIT_H ++#define _ESG_REPRESENTATION_TEXTUAL_DECODER_INIT_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_namespace_prefix structure. ++ */ ++struct esg_namespace_prefix { ++ uint16_t prefix_string_ptr; ++ uint16_t namespace_uri_ptr; ++ ++ struct esg_namespace_prefix *_next; ++}; ++ ++/** ++ * esg_fragment_type structure. ++ */ ++struct esg_xml_fragment_type { ++ uint16_t xpath_ptr; ++ uint16_t xml_fragment_type; ++ ++ struct esg_xml_fragment_type *_next; ++}; ++ ++/** ++ * esg_textual_decoder_init structure. ++ */ ++struct esg_textual_decoder_init { ++ uint8_t version; ++ uint8_t num_namespace_prefixes; ++ struct esg_namespace_prefix *namespace_prefix_list; ++ uint8_t num_fragment_types; ++ struct esg_xml_fragment_type *xml_fragment_type_list; ++}; ++ ++/** ++ * Process an esg_textual_decoder_init. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_textual_decoder_init structure, or NULL on error. ++ */ ++extern struct esg_textual_decoder_init *esg_textual_decoder_init_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_textual_decoder_init. ++ * ++ * @param decoder_init Pointer to an esg_textual_decoder_init structure. ++ */ ++extern void esg_textual_decoder_init_free(struct esg_textual_decoder_init *decoder_init); ++ ++/** ++ * Convenience iterator for namespace_prefix_list field of an esg_textual_decoder_init. ++ * ++ * @param decoder_init The esg_textual_decoder_init pointer. ++ * @param namespace_prefix Variable holding a pointer to the current esg_namespace_prefix. ++ */ ++#define esg_textual_decoder_namespace_prefix_list_for_each(decoder_init, namespace_prefix) \ ++ for ((namespace_prefix) = (decoder_init)->namespace_prefix_list; \ ++ (namespace_prefix); \ ++ (namespace_prefix) = (namespace_prefix)->_next) ++ ++/** ++ * Convenience iterator for xml_fragment_type_list field of an esg_textual_decoder_init. ++ * ++ * @param decoder_init The esg_textual_decoder_init pointer. ++ * @param xml_fragment_type Variable holding a pointer to the current esg_xml_fragment_type. ++ */ ++#define esg_textual_decoder_xml_fragment_type_list_for_each(decoder_init, xml_fragment_type) \ ++ for ((xml_fragment_type) = (decoder_init)->xml_fragment_type_list; \ ++ (xml_fragment_type); \ ++ (xml_fragment_type) = (xml_fragment_type)->_next) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/TODO dvb-apps/lib/libesg/TODO +--- linuxtv-dvb-apps-1.1.1/lib/libesg/TODO 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/TODO 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,18 @@ ++*** General ++- Add enums for constants ++ ++*** EncodingVersion ++- GZIP : use zlib ++- BiM : ??? ++ ++*** BOOTSTRAP ++- ESGProviderDiscoveryDescriptor : XML parsing with libexpat ? ++ ++*** TRANSPORT ++- Indexation ++ ++*** ENCAPSULATION ++- Auxiliary Data ++ ++*** REPRESENTATION ++- BiM Decoder Init +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/transport/Makefile dvb-apps/lib/libesg/transport/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libesg/transport/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/transport/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,22 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libesg/transport ++ ++.PHONY: sub-error-transport ++ ++sub-error-transport: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += transport/session_partition_declaration.o ++ ++sub-install += transport ++ ++else ++ ++includes = session_partition_declaration.h ++ ++include ../../../Make.rules ++ ++lib_name = libesg/transport ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/transport/session_partition_declaration.c dvb-apps/lib/libesg/transport/session_partition_declaration.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/transport/session_partition_declaration.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/transport/session_partition_declaration.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,253 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++#include ++ ++struct esg_session_partition_declaration *esg_session_partition_declaration_decode(uint8_t *buffer, uint32_t size) { ++ uint32_t pos; ++ struct esg_session_partition_declaration *partition; ++ struct esg_session_field *field; ++ struct esg_session_field *last_field; ++ uint8_t field_index; ++ struct esg_session_ip_stream *ip_stream; ++ struct esg_session_ip_stream *last_ip_stream; ++ uint8_t ip_stream_index; ++ uint8_t ip_index; ++ struct esg_session_ip_stream_field *ip_stream_field; ++ struct esg_session_ip_stream_field *last_ip_stream_field; ++ uint8_t *field_buffer; ++ uint32_t field_length; ++ union esg_session_ip_stream_field_value *field_value; ++ ++ if ((buffer == NULL) || (size <= 2)) { ++ return NULL; ++ } ++ ++ pos = 0; ++ ++ partition = (struct esg_session_partition_declaration *) malloc(sizeof(struct esg_session_partition_declaration)); ++ memset(partition, 0, sizeof(struct esg_session_partition_declaration)); ++ partition->field_list = NULL; ++ partition->ip_stream_list = NULL; ++ ++ partition->num_fields = buffer[pos]; ++ pos += 1; ++ ++ partition->overlapping = (buffer[pos] & 0x80) ? 1 : 0; ++ pos += 1; ++ ++ if (size < (pos + 5*(partition->num_fields))) { ++ esg_session_partition_declaration_free(partition); ++ return NULL; ++ } ++ ++ last_field = NULL; ++ for (field_index = 0; field_index < partition->num_fields; field_index++) { ++ field = (struct esg_session_field *) malloc(sizeof(struct esg_session_field)); ++ memset(field, 0, sizeof(struct esg_session_field)); ++ field->_next = NULL; ++ ++ if (last_field == NULL) { ++ partition->field_list = field; ++ } else { ++ last_field->_next = field; ++ } ++ last_field = field; ++ ++ field->identifier = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ field->encoding = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ field->length = buffer[pos]; ++ pos += 1; ++ } ++ ++ partition->n_o_ip_streams = buffer[pos]; ++ pos += 1; ++ ++ partition->ip_version_6 = (buffer[pos] & 0x80) ? 1 : 0; ++ pos += 1; ++ ++ last_ip_stream = NULL; ++ for (ip_stream_index = 0; ip_stream_index < partition->n_o_ip_streams; ip_stream_index++) { ++ ip_stream = (struct esg_session_ip_stream *) malloc(sizeof(struct esg_session_ip_stream)); ++ memset(ip_stream, 0, sizeof(struct esg_session_ip_stream)); ++ ip_stream->_next = NULL; ++ ++ if (last_ip_stream == NULL) { ++ partition->ip_stream_list = ip_stream; ++ } else { ++ last_ip_stream->_next = ip_stream; ++ } ++ last_ip_stream = ip_stream; ++ ++ ip_stream->id = buffer[pos]; ++ pos += 1; ++ ++ if (partition->ip_version_6) { ++ for (ip_index = 0; ip_index < 16; ip_index++) { ++ ip_stream->source_ip.ipv6[ip_index] = buffer[pos+ip_index]; ++ ip_stream->destination_ip.ipv6[ip_index] = buffer[pos+16+ip_index]; ++ } ++ pos += 32; ++ } else { ++ for (ip_index = 0; ip_index < 4; ip_index++) { ++ ip_stream->source_ip.ipv4[ip_index] = buffer[pos+ip_index]; ++ ip_stream->destination_ip.ipv4[ip_index] = buffer[pos+4+ip_index]; ++ } ++ pos += 8; ++ } ++ ip_stream->port = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ ip_stream->session_id = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += 2; ++ ++ last_ip_stream_field = NULL; ++ esg_session_partition_declaration_field_list_for_each(partition, field) { ++ ip_stream_field = (struct esg_session_ip_stream_field *) malloc(sizeof(struct esg_session_ip_stream_field)); ++ memset(ip_stream_field, 0, sizeof(struct esg_session_ip_stream_field)); ++ ip_stream_field->_next = NULL; ++ ip_stream_field->start_field_value = NULL; ++ ip_stream_field->end_field_value = NULL; ++ ++ if (last_ip_stream_field == NULL) { ++ ip_stream->field_list = ip_stream_field; ++ } else { ++ last_ip_stream_field->_next = ip_stream_field; ++ } ++ last_ip_stream_field = ip_stream_field; ++ ++ field_length = field->length; ++ if (field->length != 0) { ++ field_length = field->length; ++ } else { ++ pos += vluimsbf8(buffer + pos, size - pos, &field_length); ++ } ++ ++ switch (field->encoding) { ++ case 0x0000: { ++ if (partition->overlapping == 1) { ++ field_value = (union esg_session_ip_stream_field_value *) malloc(sizeof(union esg_session_ip_stream_field_value)); ++ memset(field_value, 0, sizeof(union esg_session_ip_stream_field_value)); ++ ip_stream_field->start_field_value = field_value; ++ ++ field_buffer = (uint8_t *) malloc(field_length); ++ memset(field_buffer, 0, field_length); ++ memcpy(field_buffer, buffer + pos, field_length); ++ ++ ip_stream_field->start_field_value->string = field_buffer; ++ pos += field_length; ++ } ++ field_value = (union esg_session_ip_stream_field_value *) malloc(sizeof(union esg_session_ip_stream_field_value)); ++ memset(field_value, 0, sizeof(union esg_session_ip_stream_field_value)); ++ ip_stream_field->end_field_value = field_value; ++ ++ field_buffer = (uint8_t *) malloc(field_length); ++ memset(field_buffer, 0, field_length); ++ memcpy(field_buffer, buffer + pos, field_length); ++ ++ ip_stream_field->end_field_value->string = field_buffer; ++ pos += field_length; ++ ++ break; ++ } ++ case 0x0101: { ++ if (partition->overlapping == 1) { ++ field_value = (union esg_session_ip_stream_field_value *) malloc(sizeof(union esg_session_ip_stream_field_value)); ++ memset(field_value, 0, sizeof(union esg_session_ip_stream_field_value)); ++ ip_stream_field->start_field_value = field_value; ++ ++ ip_stream_field->start_field_value->unsigned_short = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += field_length; ++ } ++ field_value = (union esg_session_ip_stream_field_value *) malloc(sizeof(union esg_session_ip_stream_field_value)); ++ memset(field_value, 0, sizeof(union esg_session_ip_stream_field_value)); ++ ip_stream_field->end_field_value = field_value; ++ ++ ip_stream_field->end_field_value->unsigned_short = (buffer[pos] << 8) | buffer[pos+1]; ++ pos += field_length; ++ ++ break; ++ } ++ default: { ++ esg_session_partition_declaration_free(partition); ++ return NULL; ++ } ++ } ++ } ++ } ++ ++ return partition; ++} ++ ++void esg_session_partition_declaration_free(struct esg_session_partition_declaration *partition) { ++ struct esg_session_field *field; ++ struct esg_session_field *next_field; ++ struct esg_session_ip_stream *ip_stream; ++ struct esg_session_ip_stream *next_ip_stream; ++ struct esg_session_ip_stream_field *ip_stream_field; ++ struct esg_session_ip_stream_field *next_ip_stream_field; ++ ++ if (partition == NULL) { ++ return; ++ } ++ ++ for(ip_stream = partition->ip_stream_list; ip_stream; ip_stream = next_ip_stream) { ++ next_ip_stream = ip_stream->_next; ++ ++ field = partition->field_list; ++ for(ip_stream_field = next_ip_stream->field_list; ip_stream_field; ip_stream_field = next_ip_stream_field) { ++ next_ip_stream_field = ip_stream_field->_next; ++ ++ switch (field->encoding) { ++ case 0x0000: { ++ if (ip_stream_field->start_field_value != NULL) { ++ free(ip_stream_field->start_field_value->string); ++ } ++ free(ip_stream_field->end_field_value->string); ++ break; ++ } ++ case 0x0101: { ++ // Nothing to free ++ break; ++ } ++ } ++ ++ free(ip_stream_field); ++ ++ field = field->_next; ++ } ++ ++ free(ip_stream); ++ } ++ ++ for(field = partition->field_list; field; field = next_field) { ++ next_field = field->_next; ++ free(field); ++ } ++ ++ free(partition); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/transport/session_partition_declaration.h dvb-apps/lib/libesg/transport/session_partition_declaration.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/transport/session_partition_declaration.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/transport/session_partition_declaration.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,139 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_TRANSPORT_SESSION_PARTITION_DECLARATION_H ++#define _ESG_TRANSPORT_SESSION_PARTITION_DECLARATION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_session_field structure. ++ */ ++struct esg_session_field { ++ uint16_t identifier; ++ uint16_t encoding; ++ uint8_t length; ++ ++ struct esg_session_field *_next; ++}; ++ ++/** ++ * esg_session_ip_stream_field_value union. ++ */ ++union esg_session_ip_stream_field_value { ++ uint8_t *string; ++ uint16_t unsigned_short; ++}; ++ ++/** ++ * esg_session_ip_stream_field structure. ++ */ ++struct esg_session_ip_stream_field { ++ union esg_session_ip_stream_field_value *start_field_value; ++ union esg_session_ip_stream_field_value *end_field_value; ++ ++ struct esg_session_ip_stream_field *_next; ++}; ++ ++/** ++ * esg_session_ip_stream structure. ++ */ ++struct esg_session_ip_stream { ++ uint8_t id; ++ union esg_ip_address source_ip; ++ union esg_ip_address destination_ip; ++ uint16_t port; ++ uint16_t session_id; ++ struct esg_session_ip_stream_field *field_list; ++ ++ struct esg_session_ip_stream *_next; ++}; ++ ++/** ++ * esg_session_partition_declaration structure. ++ */ ++struct esg_session_partition_declaration { ++ uint8_t num_fields; ++ uint8_t overlapping; ++ struct esg_session_field *field_list; ++ uint8_t n_o_ip_streams; ++ uint8_t ip_version_6; ++ struct esg_session_ip_stream *ip_stream_list; ++}; ++ ++/** ++ * Process an esg_session_partition_declaration. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @return Pointer to an esg_session_partition_declaration structure, or NULL on error. ++ */ ++extern struct esg_session_partition_declaration *esg_session_partition_declaration_decode(uint8_t *buffer, uint32_t size); ++ ++/** ++ * Free an esg_session_partition_declaration. ++ * ++ * @param esg Pointer to an esg_session_partition_declaration structure. ++ */ ++extern void esg_session_partition_declaration_free(struct esg_session_partition_declaration *partition); ++ ++/** ++ * Convenience iterator for field_list field of an esg_session_partition_declaration. ++ * ++ * @param partition The esg_session_partition_declaration pointer. ++ * @param field Variable holding a pointer to the current esg_session_field. ++ */ ++#define esg_session_partition_declaration_field_list_for_each(partition, field) \ ++ for ((field) = (partition)->field_list; \ ++ (field); \ ++ (field) = (field)->_next) ++ ++/** ++ * Convenience iterator for ip_stream_list field of an esg_session_partition_declaration. ++ * ++ * @param partition The esg_session_partition_declaration pointer. ++ * @param ip_stream Variable holding a pointer to the current esg_session_ip_stream. ++ */ ++#define esg_session_partition_declaration_ip_stream_list_for_each(partition, ip_stream) \ ++ for ((ip_stream) = (partition)->ip_stream_list; \ ++ (ip_stream); \ ++ (ip_stream) = (ip_stream)->_next) ++ ++/** ++ * Convenience iterator for field_list field of an esg_session_ip_stream. ++ * ++ * @param ip_stream The esg_session_ip_stream pointer. ++ * @param field Variable holding a pointer to the current esg_session_ip_stream. ++ */ ++#define esg_session_ip_stream_field_list_for_each(ip_stream, field) \ ++ for ((field) = (ip_stream)->field_list; \ ++ (field); \ ++ (field) = (field)->_next) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/types.c dvb-apps/lib/libesg/types.c +--- linuxtv-dvb-apps-1.1.1/lib/libesg/types.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/types.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,37 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++uint8_t vluimsbf8(uint8_t *buffer, uint32_t size, uint32_t *length) { ++ uint8_t offset = 0; ++ *length = 0; ++ ++ do { ++ if (size < offset) { ++ offset = 0; ++ *length = 0; ++ break; ++ } ++ *length = (*length << 7) + (buffer[offset] & 0x7F); ++ } while (buffer[offset++] & 0x80); ++ ++ return offset; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/types.h dvb-apps/lib/libesg/types.h +--- linuxtv-dvb-apps-1.1.1/lib/libesg/types.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/types.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,53 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _ESG_TYPES_H ++#define _ESG_TYPES_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * esg_ip_address ++ */ ++union esg_ip_address { ++ uint8_t ipv4[4]; ++ uint8_t ipv6[16]; ++}; ++ ++/** ++ * Process a vluimsbf8 length. ++ * ++ * @param buffer Binary buffer to decode. ++ * @param size Binary buffer size. ++ * @param length Read length value ++ * @return vluimsbf8 size ++ */ ++extern uint8_t vluimsbf8(uint8_t *buffer, uint32_t size, uint32_t *length); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libesg/xml/provider_discovery_descriptor.xsd dvb-apps/lib/libesg/xml/provider_discovery_descriptor.xsd +--- linuxtv-dvb-apps-1.1.1/lib/libesg/xml/provider_discovery_descriptor.xsd 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libesg/xml/provider_discovery_descriptor.xsd 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,22 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ac3_descriptor.h dvb-apps/lib/libucsi/atsc/ac3_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ac3_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/ac3_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,112 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_atsc@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_AC3_DESCRIPTOR ++#define _UCSI_ATSC_AC3_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++enum atsc_ac3_channels { ++ ATSC_AC3_CHANNELS_1_PLUS_1 = 0x0, ++ ATSC_AC3_CHANNELS_1_0 = 0x1, ++ ATSC_AC3_CHANNELS_2_0 = 0x2, ++ ATSC_AC3_CHANNELS_3_0 = 0x3, ++ ATSC_AC3_CHANNELS_2_1 = 0x4, ++ ATSC_AC3_CHANNELS_3_1 = 0x5, ++ ATSC_AC3_CHANNELS_2_2 = 0x6, ++ ATSC_AC3_CHANNELS_3_2 = 0x7, ++ ATSC_AC3_CHANNELS_1 = 0x8, ++ ATSC_AC3_CHANNELS_LTEQ_2 = 0x9, ++ ATSC_AC3_CHANNELS_LTEQ_3 = 0xa, ++ ATSC_AC3_CHANNELS_LTEQ_4 = 0xb, ++ ATSC_AC3_CHANNELS_LTEQ_5 = 0xc, ++ ATSC_AC3_CHANNELS_LTEQ_6 = 0xd, ++}; ++ ++/** ++ * atsc_ac3_descriptor structure. ++ */ ++struct atsc_ac3_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t sample_rate_code : 3; , ++ uint8_t bsid : 5; ); ++ EBIT2(uint8_t bit_rate_code : 6; , ++ uint8_t surround_mode : 2; ); ++ EBIT3(uint8_t bsmod : 3; , ++ uint8_t num_channels : 4; , ++ uint8_t full_svc : 1; ); ++ /* uint8_t additional_info[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_ac3_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return atsc_ac3_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_ac3_descriptor* ++ atsc_ac3_descriptor_codec(struct descriptor* d) ++{ ++ int pos = 0; ++ ++ if (d->len < (pos+4)) ++ return NULL; ++ pos += 4; ++ ++ return (struct atsc_ac3_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to additional_info field of a atsc_ac3_descriptor. ++ * ++ * @param d atsc_ac3_descriptor pointer. ++ * @return Pointer to additional_info field. ++ */ ++static inline uint8_t *atsc_ac3_descriptor_additional_info(struct atsc_ac3_descriptor *d) ++{ ++ int pos = sizeof(struct atsc_ac3_descriptor); ++ ++ return ((uint8_t *) d) + pos; ++} ++ ++/** ++ * Determine length of additional_info field of a atsc_ac3_descriptor. ++ * ++ * @param d atsc_ac3_descriptor pointer. ++ * @return Length of field in bytes. ++ */ ++static inline int atsc_ac3_descriptor_additional_info_length(struct atsc_ac3_descriptor* d) ++{ ++ return d->d.len - 3; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/atsc_text.c dvb-apps/lib/libucsi/atsc/atsc_text.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/atsc_text.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/atsc_text.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,743 @@ ++/* ++* section and descriptor parser ++* ++* Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++* ++* This library is free software; you can redistribute it and/or ++* modify it under the terms of the GNU Lesser General Public ++* License as published by the Free Software Foundation; either ++* version 2.1 of the License, or (at your option) any later version. ++* ++* This library 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 ++* Lesser General Public License for more details. ++* ++* You should have received a copy of the GNU Lesser General Public ++* License along with this library; if not, write to the Free Software ++* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include "libucsi/endianops.h" ++#include "libucsi/atsc/types.h" ++ ++#define HUFFTREE_LITERAL_MASK 0x80 ++#define HUFFSTRING_END 0x00 ++#define HUFFSTRING_ESCAPE 0x1b ++ ++#define DEST_ALLOC_DELTA 20 ++ ++struct hufftree_entry { ++ uint8_t left_idx; ++ uint8_t right_idx; ++} __ucsi_packed; ++ ++struct huffbuff { ++ uint8_t *buf; ++ uint32_t buf_len; ++ ++ uint32_t cur_byte; ++ uint8_t cur_bit; ++}; ++ ++ ++static struct hufftree_entry program_description_hufftree[][128] = { ++ { {0x14, 0x15}, {0x9b, 0xd6}, {0xc9, 0xcf}, {0xd7, 0xc7}, {0x01, 0xa2}, ++ {0xce, 0xcb}, {0x02, 0x03}, {0xc5, 0xcc}, {0xc6, 0xc8}, {0x04, 0xc4}, ++ {0x05, 0xc2}, {0x06, 0xc3}, {0xd2, 0x07}, {0xd3, 0x08}, {0xca, 0xd4}, ++ {0x09, 0xcd}, {0xd0, 0x0a}, {0xc1, 0x0b}, {0x0c, 0x0d}, {0x0e, 0x0f}, ++ {0x10, 0x11}, {0x12, 0x13}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x38, 0x39}, {0xad, 0xaf}, {0xb7, 0xda}, {0xa8, 0xb3}, {0xb5, 0x01}, ++ {0x02, 0x9b}, {0xb4, 0xf1}, {0xa2, 0xd5}, {0xd6, 0xd9}, {0x03, 0x04}, ++ {0x05, 0xcf}, {0x06, 0xc9}, {0xf9, 0xea}, {0xeb, 0xf5}, {0xf6, 0x07}, ++ {0x08, 0x09}, {0xb2, 0xc5}, {0xc6, 0xb1}, {0x0a, 0xee}, {0xcb, 0x0b}, ++ {0xd4, 0x0c}, {0xc4, 0xc8}, {0xd2, 0x0d}, {0x0e, 0x0f}, {0xc7, 0xca}, ++ {0xce, 0xd0}, {0xd7, 0x10}, {0xc2, 0x11}, {0xcc, 0xec}, {0xe5, 0xe7}, ++ {0x12, 0xcd}, {0x13, 0x14}, {0xc3, 0x15}, {0x16, 0x17}, {0xed, 0x18}, ++ {0x19, 0xf2}, {0x1a, 0xd3}, {0x1b, 0x1c}, {0xe4, 0x1d}, {0xc1, 0xe3}, ++ {0x1e, 0xe9}, {0xf0, 0xe2}, {0xf7, 0x1f}, {0xf3, 0xe6}, {0x20, 0x21}, ++ {0x22, 0xe8}, {0xef, 0x23}, {0x24, 0x25}, {0x26, 0x27}, {0x28, 0x29}, ++ {0x2a, 0xf4}, {0x2b, 0x2c}, {0x2d, 0x2e}, {0x2f, 0xe1}, {0x30, 0x31}, ++ {0x32, 0x33}, {0x34, 0x35}, {0x36, 0x37}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x03, 0x04}, {0x80, 0xae}, {0xc8, 0xd4}, {0x01, 0x02}, {0x9b, 0xa0}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x02, 0xf3}, {0xa0, 0xf4}, {0x9b, 0x01}, }, ++ { {0x9b, 0x9b}, }, ++ { {0xac, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x01, 0xa0}, {0x9b, 0xa2}, }, ++ { {0x07, 0x08}, {0xe2, 0xe4}, {0xe5, 0xe6}, {0xa0, 0xf2}, {0xe1, 0x01}, ++ {0x02, 0xf3}, {0xe3, 0x03}, {0x04, 0x05}, {0x9b, 0x06}, }, ++ { {0x04, 0x80}, {0xca, 0xd3}, {0xa2, 0x01}, {0x9b, 0x02}, {0x03, 0xa0}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x03, 0x04}, {0x9b, 0xb7}, {0xf4, 0xa0}, {0xb0, 0xf3}, {0x01, 0x02}, }, ++ { {0xb9, 0x02}, {0xb8, 0x9b}, {0xa0, 0x01}, }, ++ { {0xae, 0x02}, {0xb6, 0x9b}, {0x01, 0xa0}, }, ++ { {0xa0, 0x01}, {0x9b, 0xb0}, }, ++ { {0xae, 0x01}, {0x9b, 0xa0}, }, ++ { {0xae, 0x01}, {0xa0, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x01}, {0xac, 0xae}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x02, 0x03}, {0x9b, 0xa0}, {0xb5, 0xb6}, {0xb8, 0x01}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x08, 0x09}, {0xe6, 0xf5}, {0xf3, 0xf4}, {0x9b, 0xe4}, {0x01, 0xed}, ++ {0x02, 0x03}, {0x04, 0xf2}, {0x05, 0x06}, {0xec, 0xee}, {0x07, 0xa0}, }, ++ { {0x05, 0x06}, {0x9b, 0xec}, {0xf5, 0x01}, {0x02, 0xe1}, {0xef, 0xe5}, ++ {0xe9, 0xf2}, {0x03, 0x04}, }, ++ { {0x06, 0x07}, {0x9b, 0xe9}, {0xf9, 0xf2}, {0xf5, 0x01}, {0x02, 0x03}, ++ {0xec, 0xef}, {0xe1, 0x04}, {0xe8, 0x05}, }, ++ { {0x05, 0x06}, {0xf9, 0xf2}, {0xf5, 0x9b}, {0xe5, 0xef}, {0x01, 0x02}, ++ {0xe9, 0xe1}, {0x03, 0x04}, }, ++ { {0x06, 0x07}, {0xe1, 0xe9}, {0xee, 0xf6}, {0xe4, 0xec}, {0xf3, 0x01}, ++ {0x02, 0xf2}, {0x03, 0x04}, {0x9b, 0x05}, }, ++ { {0x02, 0x03}, {0xe5, 0xec}, {0x9b, 0xef}, {0x01, 0xf2}, }, ++ { {0x05, 0x06}, {0xf5, 0xef}, {0x9b, 0xec}, {0xe9, 0x01}, {0xe1, 0xf2}, ++ {0x02, 0xe5}, {0x03, 0x04}, }, ++ { {0x03, 0x04}, {0x9b, 0xe5}, {0xe9, 0xf5}, {0xe1, 0x01}, {0xef, 0x02}, }, ++ { {0x04, 0x05}, {0xa0, 0xc9}, {0xf3, 0x9b}, {0xae, 0xf2}, {0x01, 0x02}, ++ {0x03, 0xee}, }, ++ { {0xef, 0x05}, {0x9b, 0xae}, {0xe9, 0xe5}, {0x01, 0xf5}, {0x02, 0xe1}, ++ {0x03, 0x04}, }, ++ { {0xe5, 0x03}, {0xe1, 0xe9}, {0xf2, 0x9b}, {0x01, 0x02}, }, ++ { {0x03, 0x04}, {0x9b, 0xe9}, {0xf5, 0x01}, {0xe5, 0x02}, {0xef, 0xe1}, }, ++ { {0xe1, 0x05}, {0x9b, 0xe3}, {0xef, 0x01}, {0xf5, 0xe5}, {0x02, 0x03}, ++ {0xe9, 0x04}, }, ++ { {0xe5, 0x03}, {0x9b, 0xe9}, {0x01, 0xe1}, {0xef, 0x02}, }, ++ { {0x03, 0x04}, {0xa7, 0xee}, {0xec, 0xf2}, {0xf3, 0x01}, {0x9b, 0x02}, }, ++ { {0xe1, 0x06}, {0x9b, 0xe8}, {0xe9, 0x01}, {0xf2, 0xec}, {0x02, 0xef}, ++ {0x03, 0xe5}, {0x04, 0x05}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x03, 0x04}, {0x9b, 0xae}, {0x01, 0xe9}, {0x02, 0xe1}, {0xe5, 0xef}, }, ++ { {0x09, 0x0a}, {0xf6, 0xf9}, {0x01, 0xae}, {0xe3, 0xe9}, {0xf5, 0x9b}, ++ {0xe5, 0xef}, {0x02, 0x03}, {0xe1, 0x04}, {0xe8, 0x05}, {0x06, 0xf4}, ++ {0x07, 0x08}, }, ++ { {0xe8, 0x07}, {0xe5, 0xf7}, {0xd6, 0xe1}, {0x9b, 0xe9}, {0xf2, 0x01}, ++ {0x02, 0x03}, {0x04, 0xef}, {0x05, 0x06}, }, ++ { {0xae, 0x01}, {0x9b, 0xee}, }, ++ { {0xe9, 0x02}, {0xe5, 0x9b}, {0xa0, 0x01}, }, ++ { {0x03, 0x04}, {0x9b, 0xe8}, {0xe5, 0xe1}, {0xef, 0x01}, {0xe9, 0x02}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0xef}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x18, 0x19}, {0xe8, 0xef}, {0xf8, 0x9b}, {0xa7, 0xf7}, {0xfa, 0x01}, ++ {0x02, 0x03}, {0x04, 0xe5}, {0xae, 0x05}, {0xe6, 0xe2}, {0x06, 0xf6}, ++ {0xeb, 0xf5}, {0xe9, 0x07}, {0xf0, 0xf9}, {0xe7, 0x08}, {0x09, 0xe4}, ++ {0x0a, 0xe3}, {0x0b, 0xed}, {0x0c, 0xf3}, {0x0d, 0x0e}, {0x0f, 0xec}, ++ {0x10, 0xf4}, {0x11, 0x12}, {0xf2, 0xa0}, {0x13, 0x14}, {0x15, 0xee}, ++ {0x16, 0x17}, }, ++ { {0x0b, 0x0c}, {0xe4, 0xf3}, {0x9b, 0xae}, {0xe2, 0x01}, {0x02, 0x03}, ++ {0xec, 0xa0}, {0x04, 0xe9}, {0xf2, 0xf5}, {0x05, 0xf9}, {0xe1, 0x06}, ++ {0xef, 0x07}, {0xe5, 0x08}, {0x09, 0x0a}, }, ++ { {0x0f, 0x10}, {0xf1, 0xae}, {0xc4, 0xf9}, {0xac, 0x01}, {0xe3, 0x02}, ++ {0x9b, 0xf2}, {0x03, 0x04}, {0xa0, 0xec}, {0xf5, 0x05}, {0x06, 0xe9}, ++ {0x07, 0xeb}, {0x08, 0xf4}, {0x09, 0xe5}, {0x0a, 0xef}, {0xe1, 0xe8}, ++ {0x0b, 0x0c}, {0x0d, 0x0e}, }, ++ { {0x13, 0x14}, {0xa7, 0xbb}, {0xe6, 0xed}, {0xf7, 0xe7}, {0xf6, 0x01}, ++ {0x02, 0x9b}, {0xee, 0x03}, {0x04, 0xec}, {0x05, 0xf5}, {0x06, 0xac}, ++ {0xe4, 0xf9}, {0xf2, 0x07}, {0x08, 0x09}, {0xae, 0x0a}, {0xef, 0x0b}, ++ {0xe1, 0xf3}, {0x0c, 0xe9}, {0x0d, 0x0e}, {0x0f, 0x10}, {0xe5, 0x11}, ++ {0x12, 0xa0}, }, ++ { {0x1d, 0x1e}, {0xa9, 0xe8}, {0xf5, 0x9b}, {0x01, 0xad}, {0xbb, 0xeb}, ++ {0xfa, 0x02}, {0xa7, 0xe6}, {0xe2, 0xe7}, {0x03, 0x04}, {0x05, 0x06}, ++ {0xe9, 0xf8}, {0x07, 0xac}, {0xef, 0xf0}, {0x08, 0xed}, {0xf6, 0xf9}, ++ {0x09, 0xf7}, {0x0a, 0x0b}, {0xae, 0x0c}, {0xe3, 0x0d}, {0xe5, 0xf4}, ++ {0x0e, 0x0f}, {0xe4, 0x10}, {0xec, 0x11}, {0xe1, 0x12}, {0x13, 0x14}, ++ {0x15, 0x16}, {0xee, 0xf3}, {0x17, 0x18}, {0xf2, 0xa0}, {0x19, 0x1a}, ++ {0x1b, 0x1c}, }, ++ { {0x09, 0x0a}, {0xae, 0x9b}, {0xec, 0x01}, {0xf5, 0x02}, {0xf4, 0xe6}, ++ {0x03, 0xe1}, {0xe5, 0xe9}, {0x04, 0xf2}, {0xef, 0x05}, {0x06, 0x07}, ++ {0xa0, 0x08}, }, ++ { {0x0e, 0x0f}, {0xad, 0xe7}, {0x9b, 0xa7}, {0xf9, 0x01}, {0xec, 0x02}, ++ {0xac, 0xf2}, {0x03, 0xae}, {0xf3, 0xf5}, {0x04, 0x05}, {0xef, 0x06}, ++ {0x07, 0xe9}, {0xe1, 0x08}, {0x09, 0xe8}, {0x0a, 0x0b}, {0xe5, 0x0c}, ++ {0xa0, 0x0d}, }, ++ { {0x0d, 0x0e}, {0xa7, 0xac}, {0xf3, 0xad}, {0x01, 0x02}, {0x9b, 0xf9}, ++ {0xf5, 0xae}, {0x03, 0xee}, {0x04, 0xf2}, {0x05, 0x06}, {0xf4, 0x07}, ++ {0x08, 0x09}, {0xef, 0xe1}, {0xa0, 0x0a}, {0xe9, 0x0b}, {0x0c, 0xe5}, }, ++ { {0x14, 0x15}, {0xac, 0xe2}, {0xf8, 0x9b}, {0xae, 0xfa}, {0x01, 0xeb}, ++ {0x02, 0xa0}, {0x03, 0x04}, {0xf0, 0x05}, {0x06, 0xe6}, {0xf6, 0x07}, ++ {0xe4, 0xed}, {0xe7, 0x08}, {0xe1, 0xef}, {0xf2, 0x09}, {0x0a, 0x0b}, ++ {0xec, 0x0c}, {0xe5, 0xe3}, {0x0d, 0xf4}, {0x0e, 0xf3}, {0x0f, 0x10}, ++ {0x11, 0xee}, {0x12, 0x13}, }, ++ { {0x03, 0xef}, {0x9b, 0xe1}, {0xe5, 0xf5}, {0x01, 0x02}, }, ++ { {0x08, 0x09}, {0xec, 0xf9}, {0xa7, 0xee}, {0x01, 0xac}, {0x9b, 0xae}, ++ {0x02, 0x03}, {0x04, 0xf3}, {0x05, 0xe9}, {0x06, 0xa0}, {0x07, 0xe5}, }, ++ { {0x16, 0x17}, {0xa7, 0xad}, {0xee, 0xe3}, {0xeb, 0xf2}, {0x9b, 0xe2}, ++ {0x01, 0x02}, {0xf5, 0x03}, {0xf4, 0xac}, {0x04, 0x05}, {0xe6, 0xed}, ++ {0xf6, 0x06}, {0xae, 0xf0}, {0x07, 0x08}, {0xf3, 0x09}, {0x0a, 0xe4}, ++ {0x0b, 0x0c}, {0xf9, 0x0d}, {0xef, 0x0e}, {0xe1, 0x0f}, {0x10, 0xe9}, ++ {0xec, 0x11}, {0xa0, 0xe5}, {0x12, 0x13}, {0x14, 0x15}, }, ++ { {0x0c, 0x0d}, {0xa7, 0xbb}, {0x9b, 0x01}, {0xf9, 0xae}, {0xe2, 0x02}, ++ {0xed, 0xf3}, {0x03, 0xf5}, {0xef, 0xf0}, {0x04, 0x05}, {0xe9, 0x06}, ++ {0x07, 0x08}, {0x09, 0xa0}, {0xe1, 0xe5}, {0x0a, 0x0b}, }, ++ { {0x19, 0x1a}, {0xad, 0xbb}, {0xe2, 0xea}, {0xed, 0xf2}, {0xfa, 0xe6}, ++ {0xec, 0x01}, {0x02, 0x03}, {0x9b, 0xf5}, {0x04, 0xa7}, {0xf6, 0xf9}, ++ {0x05, 0x06}, {0xeb, 0xef}, {0x07, 0x08}, {0x09, 0x0a}, {0xac, 0x0b}, ++ {0x0c, 0xe3}, {0xae, 0x0d}, {0xee, 0xe9}, {0x0e, 0xe1}, {0x0f, 0xf3}, ++ {0x10, 0x11}, {0xf4, 0x12}, {0xe7, 0xe5}, {0x13, 0x14}, {0xe4, 0x15}, ++ {0x16, 0x17}, {0xa0, 0x18}, }, ++ { {0x1a, 0x1b}, {0xc2, 0x9b}, {0xad, 0xac}, {0xf8, 0x01}, {0xae, 0x02}, ++ {0x03, 0xe5}, {0xe7, 0xe8}, {0xf9, 0xe9}, {0xeb, 0x04}, {0xe3, 0xe1}, ++ {0x05, 0xf6}, {0x06, 0xe4}, {0x07, 0xe2}, {0xf0, 0x08}, {0x09, 0xf3}, ++ {0xf4, 0xf7}, {0xef, 0x0a}, {0x0b, 0x0c}, {0x0d, 0xec}, {0x0e, 0x0f}, ++ {0x10, 0xf5}, {0xed, 0x11}, {0xe6, 0xa0}, {0x12, 0xf2}, {0x13, 0x14}, ++ {0x15, 0xee}, {0x16, 0x17}, {0x18, 0x19}, }, ++ { {0x0e, 0x0f}, {0xad, 0xed}, {0xf9, 0x9b}, {0xae, 0x01}, {0xf3, 0x02}, ++ {0x03, 0xf5}, {0xf4, 0xf0}, {0x04, 0xef}, {0x05, 0xe9}, {0x06, 0xe8}, ++ {0xa0, 0xe1}, {0xec, 0x07}, {0xf2, 0x08}, {0xe5, 0x09}, {0x0a, 0x0b}, ++ {0x0c, 0x0d}, }, ++ { {0x9b, 0xf5}, }, ++ { {0x19, 0x1a}, {0xa9, 0xbb}, {0xf6, 0xe6}, {0x01, 0x9b}, {0xad, 0xe2}, ++ {0xf0, 0x02}, {0xa7, 0x03}, {0x04, 0x05}, {0xf5, 0xe3}, {0xac, 0xe7}, ++ {0xf2, 0x06}, {0xeb, 0x07}, {0xec, 0xed}, {0xee, 0xf9}, {0x08, 0xae}, ++ {0x09, 0x0a}, {0xe4, 0x0b}, {0x0c, 0xf4}, {0x0d, 0xf3}, {0x0e, 0x0f}, ++ {0x10, 0xe1}, {0xef, 0x11}, {0xe9, 0x12}, {0x13, 0xe5}, {0x14, 0xa0}, ++ {0x15, 0x16}, {0x17, 0x18}, }, ++ { {0xa0, 0x16}, {0xa2, 0xa7}, {0xe2, 0xeb}, {0xed, 0xee}, {0x9b, 0xf7}, ++ {0x01, 0x02}, {0x03, 0xbb}, {0xf9, 0xf0}, {0x04, 0x05}, {0xec, 0x06}, ++ {0x07, 0x08}, {0xf5, 0xe1}, {0x09, 0xac}, {0xe3, 0x0a}, {0xe8, 0x0b}, ++ {0xe9, 0x0c}, {0xef, 0xf3}, {0xae, 0x0d}, {0x0e, 0xe5}, {0x0f, 0x10}, ++ {0x11, 0xf4}, {0x12, 0x13}, {0x14, 0x15}, }, ++ { {0x14, 0x15}, {0xbb, 0xe2}, {0xad, 0xed}, {0x01, 0x9b}, {0xa7, 0xe3}, ++ {0xac, 0xec}, {0xee, 0x02}, {0xf7, 0x03}, {0x04, 0xf9}, {0x05, 0x06}, ++ {0x07, 0x08}, {0xf4, 0xae}, {0xf5, 0x09}, {0x0a, 0xf2}, {0xe1, 0xf3}, ++ {0x0b, 0x0c}, {0x0d, 0xe9}, {0x0e, 0x0f}, {0xef, 0xe5}, {0x10, 0xa0}, ++ {0xe8, 0x11}, {0x12, 0x13}, }, ++ { {0x11, 0x12}, {0xef, 0xf6}, {0x9b, 0xeb}, {0xf9, 0x01}, {0xa0, 0xe2}, ++ {0x02, 0xe1}, {0x03, 0xed}, {0x04, 0xe3}, {0xe9, 0x05}, {0xe4, 0xe5}, ++ {0xe7, 0x06}, {0xec, 0xf0}, {0x07, 0x08}, {0x09, 0x0a}, {0x0b, 0xf3}, ++ {0x0c, 0xf4}, {0xee, 0x0d}, {0xf2, 0x0e}, {0x0f, 0x10}, }, ++ { {0x05, 0xe5}, {0xf3, 0xf9}, {0x9b, 0x01}, {0xef, 0x02}, {0x03, 0xe1}, ++ {0x04, 0xe9}, }, ++ { {0x0a, 0x0b}, {0xae, 0x9b}, {0xec, 0xed}, {0x01, 0x02}, {0xf3, 0xee}, ++ {0xf2, 0x03}, {0xe5, 0x04}, {0xe8, 0xa0}, {0xe1, 0x05}, {0xef, 0x06}, ++ {0x07, 0x08}, {0xe9, 0x09}, }, ++ { {0x05, 0x06}, {0xa0, 0xac}, {0xad, 0xf4}, {0xe9, 0x01}, {0x02, 0xe1}, ++ {0xe5, 0x03}, {0x9b, 0x04}, }, ++ { {0x11, 0xa0}, {0xbf, 0xe1}, {0xe2, 0xe6}, {0xed, 0xe4}, {0xe9, 0xf7}, ++ {0xa7, 0x01}, {0x02, 0xbb}, {0x03, 0x04}, {0xec, 0x05}, {0x9b, 0xee}, ++ {0x06, 0xef}, {0x07, 0xac}, {0xe5, 0xf3}, {0x08, 0x09}, {0x0a, 0xae}, ++ {0x0b, 0x0c}, {0x0d, 0x0e}, {0x0f, 0x10}, }, ++ { {0x06, 0x07}, {0xa0, 0xae}, {0xe1, 0xe5}, {0xec, 0xfa}, {0x9b, 0xef}, ++ {0xe9, 0x01}, {0x02, 0x03}, {0x04, 0x05}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++}; ++ ++static struct hufftree_entry program_title_hufftree[][128] = { ++ { {0x1b, 0x1c}, {0xb4, 0xa4}, {0xb2, 0xb7}, {0xda, 0x01}, {0xd1, 0x02}, ++ {0x03, 0x9b}, {0x04, 0xd5}, {0xd9, 0x05}, {0xcb, 0xd6}, {0x06, 0xcf}, ++ {0x07, 0x08}, {0xca, 0x09}, {0xc9, 0xc5}, {0xc6, 0x0a}, {0xd2, 0xc4}, ++ {0xc7, 0xcc}, {0xd0, 0xc8}, {0xd7, 0xce}, {0x0b, 0xc1}, {0x0c, 0xc2}, ++ {0xcd, 0xc3}, {0x0d, 0x0e}, {0x0f, 0x10}, {0xd3, 0x11}, {0xd4, 0x12}, ++ {0x13, 0x14}, {0x15, 0x16}, {0x17, 0x18}, {0x19, 0x1a}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x29, 0x2a}, {0xd8, 0xe5}, {0xb9, 0x01}, {0xa7, 0xb1}, {0xec, 0xd1}, ++ {0x02, 0xad}, {0xb2, 0xda}, {0xe3, 0xb3}, {0x03, 0xe4}, {0xe6, 0x04}, ++ {0x9b, 0xe2}, {0x05, 0x06}, {0x07, 0x08}, {0x09, 0xd5}, {0x0a, 0xd6}, ++ {0x0b, 0xd9}, {0x0c, 0xa6}, {0xe9, 0xcb}, {0xc5, 0xcf}, {0x0d, 0x0e}, ++ {0xca, 0xc9}, {0x0f, 0xc7}, {0x10, 0x11}, {0xe1, 0x12}, {0x13, 0xc6}, ++ {0xd2, 0xc8}, {0xce, 0xc1}, {0xc4, 0xd0}, {0xcc, 0x14}, {0x15, 0xef}, ++ {0xc2, 0xd7}, {0x16, 0xcd}, {0x17, 0xf4}, {0xd4, 0x18}, {0x19, 0x1a}, ++ {0xc3, 0xd3}, {0x1b, 0x1c}, {0x1d, 0x1e}, {0x1f, 0x20}, {0x21, 0x22}, ++ {0x23, 0x24}, {0x25, 0x26}, {0x27, 0x28}, }, ++ { {0x01, 0x80}, {0xa0, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0xb1, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x04, 0xf3}, {0xe4, 0xb9}, {0x01, 0xf4}, {0xa0, 0x9b}, {0x02, 0x03}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x01, 0x02}, {0x9b, 0xc1}, {0xc8, 0xd3}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x07, 0x08}, {0xb1, 0xd2}, {0xd3, 0xd4}, {0xd5, 0xad}, {0xcd, 0xc1}, ++ {0x01, 0x02}, {0x03, 0xa0}, {0x04, 0x9b}, {0x05, 0x06}, }, ++ { {0xa0, 0x05}, {0xc9, 0xd7}, {0xd3, 0x01}, {0x02, 0x9b}, {0xae, 0x80}, ++ {0x03, 0x04}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x02, 0x03}, {0xad, 0x9b}, {0x01, 0x80}, {0xa0, 0xb0}, }, ++ { {0x04, 0x05}, {0x80, 0x9b}, {0xb1, 0xb2}, {0xa0, 0xb0}, {0xb9, 0x01}, ++ {0x02, 0x03}, }, ++ { {0x02, 0x03}, {0xb1, 0xba}, {0x01, 0xb0}, {0x9b, 0x80}, }, ++ { {0x80, 0x01}, {0xb0, 0x9b}, }, ++ { {0x9b, 0xb8}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0xb0}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x02, 0x03}, {0xb1, 0xb3}, {0xb9, 0xb0}, {0x01, 0x9b}, }, ++ { {0x9b, 0xa0}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x80}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x13, 0x14}, {0xaa, 0xad}, {0xae, 0xf6}, {0xe7, 0xf4}, {0xe2, 0xe9}, ++ {0x01, 0x02}, {0xc2, 0xf0}, {0x9b, 0xf3}, {0xe3, 0xe6}, {0xf7, 0x03}, ++ {0xf5, 0x04}, {0x05, 0x06}, {0xf2, 0x07}, {0x08, 0x09}, {0x0a, 0x0b}, ++ {0x0c, 0xe4}, {0xa0, 0x0d}, {0xec, 0xee}, {0x0e, 0xed}, {0x0f, 0x10}, ++ {0x11, 0x12}, }, ++ { {0x08, 0x09}, {0xc1, 0xd3}, {0x9b, 0x01}, {0xc3, 0x02}, {0xe9, 0xec}, ++ {0x03, 0xf2}, {0xf5, 0x04}, {0xef, 0xe1}, {0x05, 0xe5}, {0x06, 0x07}, }, ++ { {0x0b, 0x0c}, {0xc1, 0xf9}, {0x01, 0xc2}, {0xcf, 0xe5}, {0xf5, 0x9b}, ++ {0xe9, 0x02}, {0xa0, 0x03}, {0x04, 0x05}, {0xf2, 0x06}, {0xec, 0x07}, ++ {0xe1, 0x08}, {0x09, 0xe8}, {0x0a, 0xef}, }, ++ { {0x05, 0x06}, {0xf9, 0x9b}, {0x01, 0xf5}, {0x02, 0xf2}, {0xe9, 0xe5}, ++ {0xef, 0x03}, {0xe1, 0x04}, }, ++ { {0x0a, 0x0b}, {0xf1, 0xf5}, {0xf3, 0x01}, {0xed, 0xf9}, {0xc3, 0x02}, ++ {0xec, 0xee}, {0xe4, 0xf8}, {0x03, 0x9b}, {0xf6, 0x04}, {0x05, 0xe1}, ++ {0x06, 0x07}, {0x08, 0x09}, }, ++ { {0x07, 0x08}, {0xa0, 0x9b}, {0xcc, 0x01}, {0xe5, 0x02}, {0xec, 0xf5}, ++ {0xef, 0x03}, {0xe9, 0xf2}, {0x04, 0x05}, {0xe1, 0x06}, }, ++ { {0x09, 0x0a}, {0xae, 0xec}, {0xf9, 0xc1}, {0xe8, 0x01}, {0x9b, 0x02}, ++ {0x03, 0x04}, {0xe1, 0xf5}, {0xe9, 0x05}, {0xe5, 0x06}, {0xf2, 0xef}, ++ {0x07, 0x08}, }, ++ { {0xef, 0x05}, {0x80, 0x9b}, {0xf5, 0x01}, {0x02, 0xe9}, {0xe1, 0x03}, ++ {0xe5, 0x04}, }, ++ { {0xee, 0x0b}, {0xba, 0xd4}, {0xae, 0xf2}, {0xe3, 0x01}, {0xa0, 0x02}, ++ {0x80, 0x9b}, {0xed, 0x03}, {0xc9, 0xf3}, {0xf4, 0x04}, {0x05, 0x06}, ++ {0x07, 0x08}, {0x09, 0x0a}, }, ++ { {0x02, 0x03}, {0x9b, 0xf5}, {0x01, 0xe1}, {0xef, 0xe5}, }, ++ { {0x05, 0xe9}, {0xe1, 0xef}, {0xf5, 0xee}, {0x9b, 0xe5}, {0x01, 0x02}, ++ {0x03, 0x04}, }, ++ { {0x04, 0x05}, {0xa0, 0x9b}, {0x01, 0xf5}, {0x02, 0xe5}, {0xef, 0x03}, ++ {0xe1, 0xe9}, }, ++ { {0x08, 0x09}, {0xaa, 0xd4}, {0x01, 0x9b}, {0xe3, 0x02}, {0xf2, 0x03}, ++ {0xe5, 0x04}, {0xf5, 0xf9}, {0xe9, 0x05}, {0xef, 0x06}, {0x07, 0xe1}, }, ++ { {0xe5, 0x08}, {0xce, 0xa0}, {0xc6, 0xf5}, {0x01, 0x02}, {0x9b, 0xc2}, ++ {0x03, 0xe1}, {0x04, 0xef}, {0x05, 0xe9}, {0x06, 0x07}, }, ++ { {0x09, 0x0a}, {0xe4, 0xf3}, {0xe6, 0xf6}, {0xf7, 0xf0}, {0xf2, 0x01}, ++ {0xec, 0x02}, {0x03, 0xa0}, {0x9b, 0x04}, {0x05, 0xf5}, {0x06, 0x07}, ++ {0xee, 0x08}, }, ++ { {0x0b, 0x0c}, {0xa0, 0xf3}, {0xf9, 0xae}, {0xd2, 0xc7}, {0x01, 0x9b}, ++ {0x02, 0xf5}, {0x03, 0x04}, {0x05, 0xe9}, {0xec, 0x06}, {0xe5, 0x07}, ++ {0xef, 0x08}, {0xe1, 0x09}, {0xf2, 0x0a}, }, ++ { {0x01, 0xf5}, {0x9b, 0xd6}, }, ++ { {0x04, 0x05}, {0xe8, 0x9b}, {0x01, 0xf5}, {0x02, 0xe1}, {0xe9, 0xef}, ++ {0x03, 0xe5}, }, ++ { {0x10, 0x11}, {0xaa, 0xec}, {0xf1, 0xae}, {0xa0, 0xf7}, {0xed, 0xee}, ++ {0x01, 0x02}, {0x9b, 0xeb}, {0x03, 0x04}, {0x05, 0x06}, {0xe3, 0x07}, ++ {0xef, 0x08}, {0xe9, 0xf5}, {0x09, 0xe1}, {0xe5, 0xf0}, {0xe8, 0x0a}, ++ {0x0b, 0x0c}, {0x0d, 0xf4}, {0x0e, 0x0f}, }, ++ { {0xe8, 0x0a}, {0xad, 0xce}, {0x9b, 0x01}, {0xd6, 0x02}, {0xf5, 0xf7}, ++ {0x03, 0x04}, {0xe1, 0xe5}, {0xe9, 0x05}, {0xf2, 0x06}, {0xef, 0x07}, ++ {0x08, 0x09}, }, ++ { {0xee, 0x03}, {0xec, 0xae}, {0x01, 0x9b}, {0x02, 0xf0}, }, ++ { {0x06, 0xe9}, {0xa0, 0xc3}, {0xef, 0x9b}, {0xe5, 0x01}, {0x80, 0x02}, ++ {0x03, 0xe1}, {0x04, 0x05}, }, ++ { {0x06, 0x07}, {0xc6, 0xd7}, {0x01, 0x9b}, {0xf2, 0x02}, {0x03, 0xe8}, ++ {0xe5, 0xe1}, {0x04, 0xe9}, {0xef, 0x05}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x02, 0xef}, {0xe1, 0x9b}, {0x01, 0xe5}, }, ++ { {0x01, 0xef}, {0x9b, 0xe1}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x19, 0x1a}, {0x9b, 0xba}, {0xe5, 0xea}, {0xf8, 0x01}, {0x02, 0xe6}, ++ {0xa7, 0x03}, {0xfa, 0xe8}, {0x04, 0xf7}, {0x05, 0xf5}, {0xe2, 0x06}, ++ {0xeb, 0x07}, {0xf0, 0x08}, {0x80, 0xf6}, {0xe7, 0x09}, {0xe4, 0x0a}, ++ {0xa0, 0xe9}, {0x0b, 0xe3}, {0xf9, 0x0c}, {0x0d, 0xed}, {0x0e, 0x0f}, ++ {0xf3, 0x10}, {0x11, 0xec}, {0x12, 0xf4}, {0xf2, 0x13}, {0xee, 0x14}, ++ {0x15, 0x16}, {0x17, 0x18}, }, ++ { {0x0a, 0x0b}, {0xf3, 0x9b}, {0xf5, 0xe2}, {0x01, 0x80}, {0xa0, 0x02}, ++ {0xe5, 0xf2}, {0xe9, 0x03}, {0xec, 0x04}, {0xf9, 0x05}, {0xef, 0x06}, ++ {0xe1, 0x07}, {0x08, 0x09}, }, ++ { {0x10, 0x11}, {0xc3, 0xcc}, {0xc7, 0x9b}, {0xe3, 0x01}, {0x80, 0xec}, ++ {0xf9, 0x02}, {0xf3, 0x03}, {0xf5, 0x04}, {0x05, 0xf2}, {0x06, 0xe9}, ++ {0xa0, 0x07}, {0x08, 0xef}, {0xf4, 0x09}, {0x0a, 0xe1}, {0x0b, 0xe8}, ++ {0xeb, 0xe5}, {0x0c, 0x0d}, {0x0e, 0x0f}, }, ++ { {0x0e, 0x0f}, {0xae, 0xf5}, {0xf7, 0x01}, {0xec, 0x02}, {0xe4, 0xe7}, ++ {0xf2, 0x03}, {0x9b, 0xef}, {0x04, 0xf6}, {0x05, 0x06}, {0xf9, 0xf3}, ++ {0x07, 0xe9}, {0xe1, 0x08}, {0x09, 0x80}, {0x0a, 0x0b}, {0xe5, 0x0c}, ++ {0x0d, 0xa0}, }, ++ { {0x1e, 0x1f}, {0x9b, 0xa1}, {0xad, 0xe8}, {0xea, 0xf1}, {0xf5, 0xfa}, ++ {0x01, 0x02}, {0x03, 0x04}, {0xba, 0xf8}, {0xa7, 0xe2}, {0xe9, 0x05}, ++ {0x06, 0x07}, {0xe6, 0xed}, {0xe7, 0xeb}, {0x08, 0x09}, {0xf6, 0xf0}, ++ {0x0a, 0xef}, {0x0b, 0xe3}, {0x0c, 0x0d}, {0x0e, 0xf9}, {0x0f, 0xe4}, ++ {0xec, 0x10}, {0xe5, 0x11}, {0xf4, 0xf7}, {0x12, 0x13}, {0xe1, 0x14}, ++ {0x15, 0x16}, {0xee, 0xf3}, {0x17, 0x80}, {0x18, 0x19}, {0xf2, 0x1a}, ++ {0x1b, 0xa0}, {0x1c, 0x1d}, }, ++ { {0xa0, 0x0b}, {0xf5, 0x9b}, {0x01, 0xec}, {0xf3, 0xf2}, {0x80, 0xe1}, ++ {0x02, 0x03}, {0xf4, 0xe9}, {0xef, 0xe6}, {0x04, 0x05}, {0x06, 0x07}, ++ {0xe5, 0x08}, {0x09, 0x0a}, }, ++ { {0x0f, 0x10}, {0xba, 0xf9}, {0xa7, 0xf4}, {0x9b, 0x01}, {0xe7, 0xec}, ++ {0x02, 0xee}, {0x03, 0xef}, {0xf5, 0x04}, {0xf2, 0x05}, {0x06, 0xe9}, ++ {0x07, 0xf3}, {0xe1, 0x08}, {0x09, 0x0a}, {0x0b, 0xe5}, {0x80, 0x0c}, ++ {0xe8, 0xa0}, {0x0d, 0x0e}, }, ++ { {0xe5, 0x0d}, {0xe2, 0xf5}, {0xf7, 0x9b}, {0xec, 0x01}, {0xf9, 0xee}, ++ {0x02, 0x03}, {0x04, 0xf2}, {0x05, 0x80}, {0x06, 0xa0}, {0xe1, 0xef}, ++ {0x07, 0xf4}, {0xe9, 0x08}, {0x09, 0x0a}, {0x0b, 0x0c}, }, ++ { {0x15, 0x16}, {0xa1, 0xf8}, {0xe9, 0xeb}, {0x01, 0x80}, {0x9b, 0xfa}, ++ {0xe2, 0x02}, {0x03, 0x04}, {0xa0, 0xf0}, {0x05, 0x06}, {0x07, 0xe1}, ++ {0x08, 0xe6}, {0xf2, 0xed}, {0xf6, 0x09}, {0xe4, 0x0a}, {0xef, 0xf4}, ++ {0xec, 0xf3}, {0xe7, 0xe5}, {0x0b, 0xe3}, {0x0c, 0x0d}, {0x0e, 0x0f}, ++ {0x10, 0x11}, {0x12, 0x13}, {0xee, 0x14}, }, ++ { {0xef, 0x01}, {0x9b, 0xe1}, }, ++ { {0x0b, 0x0c}, {0xd4, 0xef}, {0xe6, 0xec}, {0xf7, 0xe1}, {0x01, 0xba}, ++ {0x02, 0x9b}, {0xf9, 0x03}, {0x04, 0x05}, {0xf3, 0x06}, {0x07, 0x08}, ++ {0xe9, 0xa0}, {0x09, 0x80}, {0xe5, 0x0a}, }, ++ { {0x15, 0x16}, {0xa7, 0xba}, {0xe3, 0xf7}, {0xf2, 0xad}, {0xe2, 0x01}, ++ {0x02, 0x9b}, {0xe6, 0x03}, {0xed, 0xf6}, {0x04, 0xeb}, {0x05, 0xf4}, ++ {0x06, 0x07}, {0x08, 0xf3}, {0x09, 0xf5}, {0x0a, 0xef}, {0x0b, 0x0c}, ++ {0x80, 0xf9}, {0xe1, 0x0d}, {0xe4, 0xe9}, {0xa0, 0x0e}, {0x0f, 0xec}, ++ {0xe5, 0x10}, {0x11, 0x12}, {0x13, 0x14}, }, ++ { {0x0a, 0x0b}, {0xf9, 0x9b}, {0xf5, 0xf3}, {0x01, 0x02}, {0xe2, 0xed}, ++ {0x80, 0x03}, {0xf0, 0xef}, {0x04, 0xa0}, {0x05, 0xe9}, {0x06, 0xe1}, ++ {0x07, 0x08}, {0x09, 0xe5}, }, ++ { {0x18, 0x19}, {0xe2, 0xea}, {0xf2, 0xe8}, {0xec, 0xed}, {0xfa, 0x9b}, ++ {0x01, 0xf5}, {0x02, 0x03}, {0xf6, 0x04}, {0xba, 0xe6}, {0x05, 0x06}, ++ {0xeb, 0xef}, {0x07, 0xa7}, {0xf9, 0x08}, {0x09, 0x0a}, {0x0b, 0xe3}, ++ {0x0c, 0xee}, {0xe1, 0x0d}, {0xf3, 0x0e}, {0xe9, 0x0f}, {0x10, 0xf4}, ++ {0x80, 0xe4}, {0xe5, 0x11}, {0x12, 0xe7}, {0xa0, 0x13}, {0x14, 0x15}, ++ {0x16, 0x17}, }, ++ { {0x1b, 0x1c}, {0xae, 0xfa}, {0xbf, 0x01}, {0xa7, 0x9b}, {0x02, 0xe9}, ++ {0xf8, 0xf9}, {0x03, 0xe5}, {0xe8, 0x04}, {0xe1, 0xeb}, {0x05, 0xe2}, ++ {0x06, 0x07}, {0xe3, 0x08}, {0xe7, 0xf4}, {0x09, 0x80}, {0xf6, 0xf0}, ++ {0x0a, 0xe4}, {0x0b, 0xf3}, {0xf7, 0x0c}, {0x0d, 0xef}, {0xec, 0xa0}, ++ {0x0e, 0x0f}, {0xed, 0xe6}, {0x10, 0xf5}, {0x11, 0x12}, {0x13, 0x14}, ++ {0x15, 0xf2}, {0x16, 0xee}, {0x17, 0x18}, {0x19, 0x1a}, }, ++ { {0x0e, 0x0f}, {0xed, 0xa7}, {0x9b, 0xe4}, {0x01, 0xf9}, {0xf3, 0xf2}, ++ {0xf4, 0x02}, {0xe8, 0x03}, {0xec, 0xf0}, {0x04, 0xe1}, {0xe9, 0x05}, ++ {0x06, 0x80}, {0xa0, 0x07}, {0x08, 0x09}, {0x0a, 0xe5}, {0xef, 0x0b}, ++ {0x0c, 0x0d}, }, ++ { {0x9b, 0xf5}, }, ++ { {0x18, 0x19}, {0xba, 0xac}, {0xf6, 0x9b}, {0xf0, 0xe2}, {0x01, 0xe6}, ++ {0x02, 0xa7}, {0xae, 0xe7}, {0x03, 0xe3}, {0xf5, 0x04}, {0xed, 0x05}, ++ {0x06, 0x07}, {0xeb, 0x08}, {0x09, 0xee}, {0xf2, 0x0a}, {0xe4, 0x0b}, ++ {0xf9, 0xec}, {0x0c, 0x0d}, {0xf4, 0x80}, {0x0e, 0xef}, {0xf3, 0xa0}, ++ {0xe1, 0x0f}, {0xe9, 0x10}, {0x11, 0xe5}, {0x12, 0x13}, {0x14, 0x15}, ++ {0x16, 0x17}, }, ++ { {0x19, 0x1a}, {0xa7, 0xac}, {0xbf, 0xc3}, {0xc8, 0xe4}, {0xe6, 0xed}, ++ {0xf2, 0xae}, {0xec, 0xee}, {0xf9, 0x01}, {0x02, 0x03}, {0x04, 0xba}, ++ {0x05, 0x9b}, {0xf5, 0x06}, {0x07, 0x08}, {0x09, 0xeb}, {0xf0, 0x0a}, ++ {0x0b, 0x0c}, {0xe1, 0xe3}, {0x0d, 0xe8}, {0x0e, 0x0f}, {0xef, 0x10}, ++ {0x11, 0xf3}, {0x12, 0xe9}, {0x13, 0xe5}, {0x14, 0x15}, {0xf4, 0x16}, ++ {0x17, 0xa0}, {0x18, 0x80}, }, ++ { {0x14, 0x15}, {0xba, 0xbf}, {0xe4, 0xf7}, {0x9b, 0xa7}, {0x01, 0xee}, ++ {0x02, 0x03}, {0x04, 0xe3}, {0xe2, 0xed}, {0x05, 0xf9}, {0x06, 0xf4}, ++ {0x07, 0xec}, {0x08, 0xf5}, {0xf2, 0x09}, {0xe1, 0xf3}, {0x0a, 0xef}, ++ {0x0b, 0x0c}, {0x0d, 0xe9}, {0x80, 0xe5}, {0x0e, 0xa0}, {0x0f, 0xe8}, ++ {0x10, 0x11}, {0x12, 0x13}, }, ++ { {0x11, 0x12}, {0xeb, 0xfa}, {0x80, 0xe6}, {0x9b, 0x01}, {0xa0, 0x02}, ++ {0x03, 0xe9}, {0xe1, 0x04}, {0xe4, 0xf0}, {0xed, 0xe2}, {0xe3, 0xe7}, ++ {0xec, 0x05}, {0xe5, 0x06}, {0x07, 0x08}, {0x09, 0xf4}, {0x0a, 0x0b}, ++ {0x0c, 0xf3}, {0xee, 0x0d}, {0x0e, 0xf2}, {0x0f, 0x10}, }, ++ { {0x04, 0xe5}, {0xf3, 0xef}, {0x9b, 0x01}, {0xe1, 0x02}, {0x03, 0xe9}, }, ++ { {0x0b, 0x0c}, {0xa7, 0xe2}, {0xec, 0xe3}, {0xf2, 0x01}, {0x9b, 0x02}, ++ {0x03, 0x04}, {0xe9, 0xef}, {0xee, 0xe5}, {0xe1, 0x80}, {0x05, 0xa0}, ++ {0x06, 0x07}, {0x08, 0x09}, {0xf3, 0x0a}, }, ++ { {0x05, 0x06}, {0x9b, 0xa0}, {0xe1, 0xe5}, {0xe9, 0x01}, {0x80, 0xf0}, ++ {0x02, 0xf4}, {0x03, 0x04}, }, ++ { {0xa0, 0x13}, {0xe3, 0xad}, {0xe4, 0xe9}, {0xee, 0xef}, {0xf0, 0xf4}, ++ {0xf6, 0xa1}, {0xe1, 0xed}, {0x01, 0xe2}, {0x02, 0x03}, {0x04, 0xa7}, ++ {0x05, 0x06}, {0xf7, 0x07}, {0x9b, 0xec}, {0x08, 0xe5}, {0x09, 0x0a}, ++ {0x0b, 0x0c}, {0x0d, 0x0e}, {0xf3, 0x0f}, {0x10, 0x11}, {0x80, 0x12}, }, ++ { {0x05, 0x06}, {0xe5, 0xfa}, {0xa0, 0xf9}, {0x9b, 0x01}, {0x80, 0xe9}, ++ {0x02, 0xe1}, {0x03, 0x04}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++ { {0x9b, 0x9b}, }, ++}; ++ ++ ++ ++static inline void huffbuff_init(struct huffbuff *hbuf, uint8_t *buf, uint32_t buf_len) ++{ ++ memset(hbuf, 0, sizeof(struct huffbuff)); ++ hbuf->buf = buf; ++ hbuf->buf_len = buf_len; ++} ++ ++static inline int huffbuff_bits(struct huffbuff *hbuf, uint8_t nbits) ++{ ++ uint8_t result = 0; ++ ++ if (nbits > 8) ++ return -1; ++ ++ while(nbits--) { ++ if (hbuf->cur_byte >= hbuf->buf_len) { ++ return -1; ++ } ++ ++ result <<= 1; ++ if (hbuf->buf[hbuf->cur_byte] & (0x80 >> hbuf->cur_bit)) ++ result |= 1; ++ ++ if (++hbuf->cur_bit > 7) { ++ hbuf->cur_byte++; ++ hbuf->cur_bit = 0; ++ } ++ } ++ ++ return result; ++} ++ ++static inline int append_unicode_char(uint8_t **destbuf, size_t *destbuflen, size_t *destbufpos, ++ uint32_t c) ++{ ++ uint8_t tmp[3]; ++ int tmplen = 0; ++ ++ // encode the unicode character first of all ++ if (c < 0x80) { ++ tmp[0] = c; ++ tmplen = 1; ++ } else if (c < 0x800) { ++ tmp[0] = 0xc0 | ((c >> 6) & 0x1f); ++ tmp[1] = 0x80 | (c & 0x3f); ++ tmplen = 2; ++ } else if (c < 0x10000) { ++ tmp[0] = 0xe0 | ((c >> 12) & 0x0f); ++ tmp[1] = 0x80 | ((c >> 6) & 0x3f); ++ tmp[2] = 0x80 | (c & 0x3f); ++ tmplen = 3; ++ } else { ++ return -1; ++ } ++ ++ // do we have enough buffer space? ++ if ((*destbufpos + tmplen) >= *destbuflen) { ++ uint8_t *new_dest = realloc(*destbuf, *destbuflen + DEST_ALLOC_DELTA); ++ if (new_dest == NULL) ++ return -ENOMEM; ++ *destbuf = new_dest; ++ *destbuflen += DEST_ALLOC_DELTA; ++ } ++ ++ // copy it into position ++ memcpy(*destbuf + *destbufpos, tmp, tmplen); ++ *destbufpos += tmplen; ++ ++ return 0; ++} ++ ++static inline int unicode_decode(uint8_t *srcbuf, size_t srcbuflen, int mode, ++ uint8_t **destbuf, size_t *destbuflen, size_t *destbufpos) ++{ ++ size_t i; ++ uint32_t msb = mode << 8; ++ ++ for(i=0; i< srcbuflen; i++) { ++ if (append_unicode_char(destbuf, destbuflen, destbufpos, msb + srcbuf[i])) ++ return -1; ++ } ++ ++ return *destbufpos; ++} ++ ++static int huffman_decode_uncompressed(struct huffbuff *hbuf, ++ uint8_t **destbuf, size_t *destbuflen, size_t *destbufpos) ++{ ++ int c; ++ ++ while(hbuf->cur_byte < hbuf->buf_len) { ++ // get next byte ++ if ((c = huffbuff_bits(hbuf, 8)) < 0) ++ return -1; ++ ++ switch(c) { ++ case HUFFSTRING_END: ++ return 0; ++ ++ case HUFFSTRING_ESCAPE: ++ return HUFFSTRING_ESCAPE; ++ ++ default: ++ if (append_unicode_char(destbuf, destbuflen, destbufpos, c)) ++ return -1; ++ ++ // if it is 7 bit, we swap back to the compressed context ++ if ((c & 0x80) == 0) ++ return c; ++ ++ // characters following an 8 bit uncompressed char are uncompressed as well ++ break; ++ } ++ } ++ ++ // ran out of string; pretend we saw an end of string char ++ return HUFFSTRING_END; ++} ++ ++static int huffman_decode(uint8_t *src, size_t srclen, ++ uint8_t **destbuf, size_t *destbuflen, size_t *destbufpos, ++ struct hufftree_entry hufftree[][128]) ++{ ++ struct huffbuff hbuf; ++ int bit; ++ struct hufftree_entry *tree = hufftree[0]; ++ uint8_t treeidx = 0; ++ uint8_t treeval; ++ int tmp; ++ ++ huffbuff_init(&hbuf, src, srclen); ++ ++ while(hbuf.cur_byte < hbuf.buf_len) { ++ // get the next bit ++ if ((bit = huffbuff_bits(&hbuf, 1)) < 0) ++ return *destbufpos; ++ ++ if (!bit) { ++ treeval = tree[treeidx].left_idx; ++ } else { ++ treeval = tree[treeidx].right_idx; ++ } ++ ++ if (treeval & HUFFTREE_LITERAL_MASK) { ++ switch(treeval & ~HUFFTREE_LITERAL_MASK) { ++ case HUFFSTRING_END: ++ return 0; ++ ++ case HUFFSTRING_ESCAPE: ++ if ((tmp = ++ huffman_decode_uncompressed(&hbuf, ++ destbuf, destbuflen, destbufpos)) < 0) ++ return tmp; ++ if (tmp == 0) ++ return *destbufpos; ++ ++ tree = hufftree[tmp]; ++ treeidx = 0; ++ break; ++ ++ default: ++ // stash it ++ if (append_unicode_char(destbuf, destbuflen, destbufpos, ++ treeval & ~HUFFTREE_LITERAL_MASK)) ++ return -1; ++ tree = hufftree[treeval & ~HUFFTREE_LITERAL_MASK]; ++ treeidx = 0; ++ break; ++ } ++ } else { ++ treeidx = treeval; ++ } ++ } ++ ++ return *destbufpos; ++} ++ ++int atsc_text_segment_decode(struct atsc_text_string_segment *segment, ++ uint8_t **destbuf, size_t *destbufsize, size_t *destbufpos) ++{ ++ if (segment->mode > ATSC_TEXT_SEGMENT_MODE_UNICODE_RANGE_MAX) ++ return -1; ++ ++ // mode==0 MUST be used for compressed text ++ if ((segment->mode) && (segment->compression_type)) ++ return -1; ++ ++ uint8_t *buf = atsc_text_string_segment_bytes(segment); ++ ++ switch(segment->compression_type) { ++ case ATSC_TEXT_COMPRESS_NONE: ++ return unicode_decode(buf, segment->number_bytes, segment->mode, ++ destbuf, destbufsize, destbufpos); ++ ++ case ATSC_TEXT_COMPRESS_PROGRAM_TITLE: ++ return huffman_decode(buf, segment->number_bytes, ++ destbuf, destbufsize, destbufpos, ++ program_title_hufftree); ++ ++ case ATSC_TEXT_COMPRESS_PROGRAM_DESCRIPTION: ++ return huffman_decode(buf, segment->number_bytes, ++ destbuf, destbufsize, destbufpos, ++ program_description_hufftree); ++ } ++ ++ return -1; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/caption_service_descriptor.h dvb-apps/lib/libucsi/atsc/caption_service_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/caption_service_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/caption_service_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,137 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_CAPTION_SERVICE_DESCRIPTOR ++#define _UCSI_ATSC_CAPTION_SERVICE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * atsc_caption_service_descriptor structure. ++ */ ++struct atsc_caption_service_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 3; , ++ uint8_t number_of_services : 5; ); ++ /* struct atsc_caption_service_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a atsc_caption_service_descriptor. ++ */ ++struct atsc_caption_service_entry { ++ iso639lang_t language_code; ++ EBIT3(uint8_t digital_cc : 1; , ++ uint8_t reserved : 1; , ++ uint8_t value : 6; ); ++ EBIT3(uint16_t easy_reader : 1; , ++ uint16_t wide_aspect_ratio : 1; , ++ uint16_t reserved1 :14; ); ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_caption_service_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_caption_service_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_caption_service_descriptor* ++ atsc_caption_service_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_caption_service_descriptor *ret = ++ (struct atsc_caption_service_descriptor *) d; ++ uint8_t *buf = (uint8_t*) d + 2; ++ int pos = 0; ++ int idx; ++ ++ if (d->len < 1) ++ return NULL; ++ pos++; ++ ++ for(idx = 0; idx < ret->number_of_services; idx++) { ++ if (d->len < (pos + sizeof(struct atsc_caption_service_entry))) ++ return NULL; ++ ++ bswap16(buf+pos+4); ++ ++ pos += sizeof(struct atsc_caption_service_entry); ++ } ++ ++ return (struct atsc_caption_service_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a atsc_caption_service_descriptor. ++ * ++ * @param d atsc_caption_service_descriptor pointer. ++ * @param pos Variable holding a pointer to the current atsc_caption_service_entry. ++ * @param idx Field iterator integer. ++ */ ++#define atsc_caption_service_descriptor_entries_for_each(d, pos, idx) \ ++ for ((pos) = atsc_caption_service_descriptor_entries_first(d), idx=0; \ ++ (pos); \ ++ (pos) = atsc_caption_service_descriptor_entries_next(d, pos, ++idx)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_caption_service_entry* ++ atsc_caption_service_descriptor_entries_first(struct atsc_caption_service_descriptor *d) ++{ ++ if (d->number_of_services == 0) ++ return NULL; ++ ++ return (struct atsc_caption_service_entry *) ++ ((uint8_t*) d + sizeof(struct atsc_caption_service_descriptor)); ++} ++ ++static inline struct atsc_caption_service_entry* ++ atsc_caption_service_descriptor_entries_next(struct atsc_caption_service_descriptor *d, ++ struct atsc_caption_service_entry *pos, ++ int idx) ++{ ++ if (idx >= d->number_of_services) ++ return NULL; ++ ++ return (struct atsc_caption_service_entry *) ++ ((uint8_t *) pos + sizeof(struct atsc_caption_service_entry)); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/component_name_descriptor.h dvb-apps/lib/libucsi/atsc/component_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/component_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/component_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,92 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_COMPONENT_NAME_DESCRIPTOR ++#define _UCSI_ATSC_COMPONENT_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++ ++/** ++ * atsc_component_name_descriptor structure. ++ */ ++struct atsc_component_name_descriptor { ++ struct descriptor d; ++ ++ /* struct atsc_text text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_component_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_component_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_component_name_descriptor* ++ atsc_component_name_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t *txt = ((uint8_t*) d) + sizeof(struct atsc_component_name_descriptor); ++ ++ if (atsc_text_validate(txt, d->len)) ++ return NULL; ++ ++ return (struct atsc_component_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of an atsc_component_name_descriptor. ++ * ++ * @param d atsc_component_name_descriptor pointer. ++ * @return Pointer to the atsc_text data, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_component_name_descriptor_text(struct atsc_component_name_descriptor *d) ++{ ++ uint8_t *txt = ((uint8_t*) d) + sizeof(struct atsc_component_name_descriptor); ++ ++ return (struct atsc_text*) txt; ++} ++ ++/** ++ * Accessor for the length of the text field of an atsc_component_name_descriptor_text. ++ * ++ * @param d atsc_component_name_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ atsc_component_name_descriptor_text_length(struct atsc_component_name_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/content_advisory_descriptor.h dvb-apps/lib/libucsi/atsc/content_advisory_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/content_advisory_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/content_advisory_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,235 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_CONTENT_ADVISORY_DESCRIPTOR ++#define _UCSI_ATSC_CONTENT_ADVISORY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * atsc_content_advisory_descriptor structure. ++ */ ++struct atsc_content_advisory_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 2; , ++ uint8_t rating_region_count : 6; ); ++ /* struct atsc_content_advisory_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a atsc_content_advisory_descriptor. ++ */ ++struct atsc_content_advisory_entry { ++ uint8_t rating_region; ++ uint8_t rated_dimensions; ++ /* struct atsc_content_advisory_entry_dimension dimensions[] */ ++ /* struct atsc_content_advisory_entry_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a atsc_content_advisory_descriptor. ++ */ ++struct atsc_content_advisory_entry_dimension { ++ uint8_t rating_dimension_j; ++ EBIT2(uint8_t reserved : 4; , ++ uint8_t rating_value : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Part2 of an atsc_content_advisory_entry. ++ */ ++struct atsc_content_advisory_entry_part2 { ++ uint8_t rating_description_length; ++ /* struct atsc_text description */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_content_advisory_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_content_advisory_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_content_advisory_descriptor* ++ atsc_content_advisory_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_content_advisory_descriptor *ret = ++ (struct atsc_content_advisory_descriptor *) d; ++ uint8_t *buf = (uint8_t*) d + 2; ++ int pos = 0; ++ int idx; ++ ++ if (d->len < 1) ++ return NULL; ++ pos++; ++ ++ for(idx = 0; idx < ret->rating_region_count; idx++) { ++ if (d->len < (pos + sizeof(struct atsc_content_advisory_entry))) ++ return NULL; ++ struct atsc_content_advisory_entry *entry = ++ (struct atsc_content_advisory_entry *) (buf + pos); ++ pos += sizeof(struct atsc_content_advisory_entry); ++ ++ if (d->len < (pos + (sizeof(struct atsc_content_advisory_entry_dimension) * ++ entry->rated_dimensions))) ++ return NULL; ++ pos += sizeof(struct atsc_content_advisory_entry_dimension) * entry->rated_dimensions; ++ ++ if (d->len < (pos + sizeof(struct atsc_content_advisory_entry_part2))) ++ return NULL; ++ struct atsc_content_advisory_entry_part2 *part2 = ++ (struct atsc_content_advisory_entry_part2 *) (buf + pos); ++ pos += sizeof(struct atsc_content_advisory_entry_part2); ++ ++ if (d->len < (pos + part2->rating_description_length)) ++ return NULL; ++ ++ if (atsc_text_validate(buf+pos, part2->rating_description_length)) ++ return NULL; ++ ++ pos += part2->rating_description_length; ++ } ++ ++ return (struct atsc_content_advisory_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a atsc_content_advisory_descriptor. ++ * ++ * @param d atsc_content_advisory_descriptor pointer. ++ * @param pos Variable holding a pointer to the current atsc_content_advisory_entry. ++ * @param idx Integer used to count which entry we are in. ++ */ ++#define atsc_content_advisory_descriptor_entries_for_each(d, pos, idx) \ ++ for ((pos) = atsc_content_advisory_descriptor_entries_first(d), idx=0; \ ++ (pos); \ ++ (pos) = atsc_content_advisory_descriptor_entries_next(d, pos, ++idx)) ++ ++/** ++ * Iterator for dimensions field of a atsc_content_advisory_entry. ++ * ++ * @param d atsc_content_advisory_entry pointer. ++ * @param pos Variable holding a pointer to the current atsc_content_advisory_entry_dimension. ++ * @param idx Integer used to count which dimension we are in. ++ */ ++#define atsc_content_advisory_entry_dimensions_for_each(d, pos, idx) \ ++ for ((pos) = atsc_content_advisory_entry_dimensions_first(d), idx=0; \ ++ (pos); \ ++ (pos) = atsc_content_advisory_entry_dimensions_next(d, pos, ++idx)) ++ ++/** ++ * Accessor for the part2 field of an atsc_content_advisory_entry. ++ * ++ * @param entry atsc_content_advisory_entry pointer. ++ * @return struct atsc_content_advisory_entry_part2 pointer. ++ */ ++static inline struct atsc_content_advisory_entry_part2 * ++ atsc_content_advisory_entry_part2(struct atsc_content_advisory_entry *entry) ++{ ++ int pos = sizeof(struct atsc_content_advisory_entry); ++ pos += entry->rated_dimensions * sizeof(struct atsc_content_advisory_entry_dimension); ++ ++ return (struct atsc_content_advisory_entry_part2 *) (((uint8_t*) entry) + pos); ++} ++ ++ ++/** ++ * Accessor for the description field of an atsc_content_advisory_entry_part2. ++ * ++ * @param part2 atsc_content_advisory_entry_part2 pointer. ++ * @return Pointer to the atsc_text data, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_content_advisory_entry_part2_description(struct atsc_content_advisory_entry_part2 *part2) ++{ ++ uint8_t *txt = ((uint8_t*) part2) + sizeof(struct atsc_content_advisory_entry_part2); ++ ++ return (struct atsc_text *) txt; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_content_advisory_entry* ++ atsc_content_advisory_descriptor_entries_first(struct atsc_content_advisory_descriptor *d) ++{ ++ if (d->rating_region_count == 0) ++ return NULL; ++ ++ return (struct atsc_content_advisory_entry *) ++ ((uint8_t*) d + sizeof(struct atsc_content_advisory_descriptor)); ++} ++ ++static inline struct atsc_content_advisory_entry* ++ atsc_content_advisory_descriptor_entries_next(struct atsc_content_advisory_descriptor *d, ++ struct atsc_content_advisory_entry *pos, ++ int idx) ++{ ++ if (idx >= d->rating_region_count) ++ return NULL; ++ struct atsc_content_advisory_entry_part2 *part2 = ++ atsc_content_advisory_entry_part2(pos); ++ ++ return (struct atsc_content_advisory_entry *) ++ ((uint8_t *) part2 + ++ sizeof(struct atsc_content_advisory_entry_part2) + ++ part2->rating_description_length); ++} ++ ++static inline struct atsc_content_advisory_entry_dimension* ++ atsc_content_advisory_entry_dimensions_first(struct atsc_content_advisory_entry *e) ++{ ++ if (e->rated_dimensions == 0) ++ return NULL; ++ ++ return (struct atsc_content_advisory_entry_dimension *) ++ ((uint8_t*) e + sizeof(struct atsc_content_advisory_entry)); ++} ++ ++static inline struct atsc_content_advisory_entry_dimension* ++ atsc_content_advisory_entry_dimensions_next(struct atsc_content_advisory_entry *e, ++ struct atsc_content_advisory_entry_dimension *pos, ++ int idx) ++{ ++ uint8_t *next = (uint8_t *) pos + sizeof(struct atsc_content_advisory_entry_dimension); ++ ++ if (idx >= e->rated_dimensions) ++ return NULL; ++ return (struct atsc_content_advisory_entry_dimension *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/cvct_section.c dvb-apps/lib/libucsi/atsc/cvct_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/cvct_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/cvct_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_cvct_section *atsc_cvct_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = sizeof(struct atsc_section_psip); ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int idx; ++ ++ if (len < sizeof(struct atsc_cvct_section)) ++ return NULL; ++ struct atsc_cvct_section *cvct = (struct atsc_cvct_section *) psip; ++ ++ pos++; ++ for(idx =0; idx < cvct->num_channels_in_section; idx++) { ++ if ((pos + sizeof(struct atsc_cvct_channel)) > len) ++ return NULL; ++ struct atsc_cvct_channel *channel = (struct atsc_cvct_channel *) (buf+pos); ++ ++ pos += 7*2; ++ ++ bswap32(buf+pos); ++ bswap32(buf+pos+4); ++ bswap16(buf+pos+8); ++ bswap16(buf+pos+10); ++ bswap16(buf+pos+12); ++ bswap16(buf+pos+14); ++ bswap16(buf+pos+16); ++ pos+=18; ++ ++ if ((pos + channel->descriptors_length) > len) ++ return NULL; ++ if (verify_descriptors(buf + pos, channel->descriptors_length)) ++ return NULL; ++ ++ pos += channel->descriptors_length; ++ } ++ ++ if ((pos + sizeof(struct atsc_cvct_section_part2)) > len) ++ return NULL; ++ struct atsc_cvct_section_part2 *part2 = (struct atsc_cvct_section_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ pos+=2; ++ ++ if ((pos + part2->descriptors_length) > len) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ ++ pos += part2->descriptors_length; ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_cvct_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/cvct_section.h dvb-apps/lib/libucsi/atsc/cvct_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/cvct_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/cvct_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,228 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_CVCT_SECTION_H ++#define _UCSI_ATSC_CVCT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * atsc_cvct_section structure. ++ */ ++struct atsc_cvct_section { ++ struct atsc_section_psip head; ++ ++ uint8_t num_channels_in_section; ++ /* struct atsc_cvct_channel channels[] */ ++ /* struct atsc_cvct_channel_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_cvct_channel { ++ uint16_t short_name[7]; // UTF-16 network ordered ++ EBIT4(uint32_t reserved : 4; , ++ uint32_t major_channel_number :10; , ++ uint32_t minor_channel_number :10; , ++ uint32_t modulation_mode : 8; ); ++ uint32_t carrier_frequency; ++ uint16_t channel_TSID; ++ uint16_t program_number; ++ EBIT8(uint16_t ETM_location : 2; , ++ uint16_t access_controlled : 1; , ++ uint16_t hidden : 1; , ++ uint16_t path_select : 1; , ++ uint16_t out_of_band : 1; , ++ uint16_t hide_guide : 1; , ++ uint16_t reserved2 : 3; , ++ uint16_t service_type : 6; ); ++ uint16_t source_id; ++ EBIT2(uint16_t reserved3 : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_cvct_section_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++static inline struct atsc_cvct_channel *atsc_cvct_section_channels_first(struct atsc_cvct_section *cvct); ++static inline struct atsc_cvct_channel * ++ atsc_cvct_section_channels_next(struct atsc_cvct_section *cvct, struct atsc_cvct_channel *pos, int idx); ++ ++/** ++ * Process a atsc_cvct_section. ++ * ++ * @param section Pointer to anj atsc_section_psip structure. ++ * @return atsc_cvct_section pointer, or NULL on error. ++ */ ++struct atsc_cvct_section *atsc_cvct_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the transport_stream_id field of a CVCT. ++ * ++ * @param cvdt CVDT pointer. ++ * @return The transport_stream_id. ++ */ ++static inline uint16_t atsc_cvct_section_transport_stream_id(struct atsc_cvct_section *cvct) ++{ ++ return cvct->head.ext_head.table_id_ext; ++} ++ ++/** ++ * Iterator for the tables field in an atsc_cvct_section. ++ * ++ * @param mgt atsc_cvct_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_cvct_channel. ++ * @param idx Integer used to count which table we in. ++ */ ++#define atsc_cvct_section_channels_for_each(mgt, pos, idx) \ ++ for ((pos) = atsc_cvct_section_channels_first(mgt), idx=0; \ ++ (pos); \ ++ (pos) = atsc_cvct_section_channels_next(mgt, pos, ++idx)) ++ ++/** ++ * Iterator for the descriptors field in a atsc_cvct_channel structure. ++ * ++ * @param table atsc_cvct_channel pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_cvct_channel_descriptors_for_each(table, pos) \ ++ for ((pos) = atsc_cvct_channel_descriptors_first(table); \ ++ (pos); \ ++ (pos) = atsc_cvct_channel_descriptors_next(table, pos)) ++ ++/** ++ * Accessor for the second part of an atsc_cvct_section. ++ * ++ * @param mgt atsc_cvct_section pointer. ++ * @return atsc_cvct_section_part2 pointer. ++ */ ++static inline struct atsc_cvct_section_part2 * ++ atsc_cvct_section_part2(struct atsc_cvct_section *mgt) ++{ ++ int pos = sizeof(struct atsc_cvct_section); ++ ++ struct atsc_cvct_channel *cur_table; ++ int idx; ++ atsc_cvct_section_channels_for_each(mgt, cur_table, idx) { ++ pos += sizeof(struct atsc_cvct_channel); ++ pos += cur_table->descriptors_length; ++ } ++ ++ return (struct atsc_cvct_section_part2 *) (((uint8_t*) mgt) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_cvct_section structure. ++ * ++ * @param part2 atsc_cvct_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_cvct_section_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_cvct_section_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_cvct_section_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_cvct_channel * ++ atsc_cvct_section_channels_first(struct atsc_cvct_section *cvct) ++{ ++ size_t pos = sizeof(struct atsc_cvct_section); ++ ++ if (cvct->num_channels_in_section == 0) ++ return NULL; ++ ++ return (struct atsc_cvct_channel*) (((uint8_t *) cvct) + pos); ++} ++ ++static inline struct atsc_cvct_channel * ++ atsc_cvct_section_channels_next(struct atsc_cvct_section *cvct, ++ struct atsc_cvct_channel *pos, ++ int idx) ++{ ++ if (idx >= cvct->num_channels_in_section) ++ return NULL; ++ ++ return (struct atsc_cvct_channel *) ++ (((uint8_t*) pos) + sizeof(struct atsc_cvct_channel) + pos->descriptors_length); ++} ++ ++static inline struct descriptor * ++ atsc_cvct_channel_descriptors_first(struct atsc_cvct_channel *table) ++{ ++ size_t pos = sizeof(struct atsc_cvct_channel); ++ ++ if (table->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) table) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_cvct_channel_descriptors_next(struct atsc_cvct_channel *table, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) table + sizeof(struct atsc_cvct_channel), ++ table->descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_cvct_section_part2_descriptors_first(struct atsc_cvct_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_cvct_section_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_cvct_section_part2_descriptors_next(struct atsc_cvct_section_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_cvct_section_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcc_arriving_request_descriptor.h dvb-apps/lib/libucsi/atsc/dcc_arriving_request_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcc_arriving_request_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dcc_arriving_request_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,107 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_DCC_ARRIVING_REQUEST_DESCRIPTOR ++#define _UCSI_ATSC_DCC_ARRIVING_REQUEST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++enum atsc_dcc_arriving_request_type { ++ DCC_ARRIVAL_TYPE_DEFER_10SEC = 0x01, ++ DCC_ARRIVAL_TYPE_DEFER = 0x02, ++}; ++ ++/** ++ * atsc_dcc_arriving_request_descriptor structure. ++ */ ++struct atsc_dcc_arriving_request_descriptor { ++ struct descriptor d; ++ ++ uint8_t dcc_arriving_request_type; ++ uint8_t dcc_arriving_request_text_length; ++ /* struct atsc_text text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_dcc_arriving_request_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_dcc_arriving_request_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_dcc_arriving_request_descriptor* ++ atsc_dcc_arriving_request_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_dcc_arriving_request_descriptor *ret = ++ (struct atsc_dcc_arriving_request_descriptor *) d; ++ ++ if (d->len < 2) ++ return NULL; ++ ++ if (d->len != 2 + ret->dcc_arriving_request_text_length) ++ return NULL; ++ ++ if (atsc_text_validate((uint8_t*) d + sizeof(struct atsc_dcc_arriving_request_descriptor), ++ ret->dcc_arriving_request_text_length)) ++ return NULL; ++ ++ return (struct atsc_dcc_arriving_request_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of an atsc_dcc_arriving_request_descriptor. ++ * ++ * @param d atsc_dcc_arriving_request_descriptor pointer. ++ * @return Pointer to the atsc_text data, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_dcc_arriving_request_descriptor_text(struct atsc_dcc_arriving_request_descriptor *d) ++{ ++ uint8_t *txt = ((uint8_t*) d) + sizeof(struct atsc_dcc_arriving_request_descriptor); ++ ++ return (struct atsc_text*) txt; ++} ++ ++/** ++ * Accessor for the length of the text field of an atsc_dcc_arriving_request_descriptor. ++ * ++ * @param d atsc_dcc_arriving_request_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ atsc_dcc_arriving_request_descriptor_text_length(struct ++ atsc_dcc_arriving_request_descriptor *d) ++{ ++ return d->d.len - 2; ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcc_departing_request_descriptor.h dvb-apps/lib/libucsi/atsc/dcc_departing_request_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcc_departing_request_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dcc_departing_request_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,108 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_DCC_DEPARTING_REQUEST_DESCRIPTOR ++#define _UCSI_ATSC_DCC_DEPARTING_REQUEST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++enum atsc_dcc_departing_request_type { ++ DCC_DEPART_TYPE_IMMEDIATE = 0x01, ++ DCC_DEPART_TYPE_DEFER_10SEC = 0x02, ++ DCC_DEPART_TYPE_DEFER = 0x03, ++}; ++ ++/** ++ * atsc_dcc_departing_request_descriptor structure. ++ */ ++struct atsc_dcc_departing_request_descriptor { ++ struct descriptor d; ++ ++ uint8_t dcc_departing_request_type; ++ uint8_t dcc_departing_request_text_length; ++ /* struct atsc_text text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_dcc_departing_request_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_dcc_departing_request_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_dcc_departing_request_descriptor* ++ atsc_dcc_departing_request_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_dcc_departing_request_descriptor *ret = ++ (struct atsc_dcc_departing_request_descriptor *) d; ++ ++ if (d->len < 2) ++ return NULL; ++ ++ if (d->len != 2 + ret->dcc_departing_request_text_length) ++ return NULL; ++ ++ if (atsc_text_validate(((uint8_t*) d) + sizeof(struct atsc_dcc_departing_request_descriptor), ++ ret->dcc_departing_request_text_length)) ++ return NULL; ++ ++ return (struct atsc_dcc_departing_request_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of an atsc_dcc_departing_request_descriptor. ++ * ++ * @param d atsc_dcc_departing_request_descriptor pointer. ++ * @return Pointer to the atsc_text data, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_dcc_departing_request_descriptor_text(struct atsc_dcc_departing_request_descriptor *d) ++{ ++ uint8_t *txt = ((uint8_t*) d) + sizeof(struct atsc_dcc_departing_request_descriptor); ++ ++ return (struct atsc_text*) txt; ++} ++ ++/** ++ * Accessor for the length of the text field of an atsc_dcc_departing_request_descriptor. ++ * ++ * @param d atsc_dcc_departing_request_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ atsc_dcc_departing_request_descriptor_text_length(struct ++ atsc_dcc_departing_request_descriptor *d) ++{ ++ return d->d.len - 2; ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dccsct_section.c dvb-apps/lib/libucsi/atsc/dccsct_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dccsct_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dccsct_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,109 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_dccsct_section *atsc_dccsct_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = 0; ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int idx; ++ ++ if (len < sizeof(struct atsc_dccsct_section)) ++ return NULL; ++ struct atsc_dccsct_section *dccsct = (struct atsc_dccsct_section *) psip; ++ ++ pos += sizeof(struct atsc_dccsct_section); ++ for(idx =0; idx < dccsct->updates_defined; idx++) { ++ if (len < (pos + sizeof(struct atsc_dccsct_update))) ++ return NULL; ++ struct atsc_dccsct_update *update = (struct atsc_dccsct_update *) (buf+pos); ++ ++ pos += sizeof(struct atsc_dccsct_update); ++ if (len < (pos + update->update_data_length)) ++ return NULL; ++ ++ switch(update->update_type) { ++ case ATSC_DCCST_UPDATE_NEW_GENRE: { ++ int sublen = sizeof(struct atsc_dccsct_update_new_genre); ++ if (update->update_data_length < sublen) ++ return NULL; ++ ++ if (atsc_text_validate(buf+pos+sublen, update->update_data_length - sublen)) ++ return NULL; ++ break; ++ } ++ case ATSC_DCCST_UPDATE_NEW_STATE: { ++ int sublen = sizeof(struct atsc_dccsct_update_new_state); ++ if (update->update_data_length < sublen) ++ return NULL; ++ ++ if (atsc_text_validate(buf+pos+sublen, update->update_data_length - sublen)) ++ return NULL; ++ break; ++ } ++ case ATSC_DCCST_UPDATE_NEW_COUNTY: { ++ int sublen = sizeof(struct atsc_dccsct_update_new_county); ++ if (update->update_data_length < sublen) ++ return NULL; ++ bswap16(buf+pos+1); ++ ++ if (atsc_text_validate(buf+pos+sublen, update->update_data_length - sublen)) ++ return NULL; ++ break; ++ } ++ } ++ ++ pos += update->update_data_length; ++ if (len < (pos + sizeof(struct atsc_dccsct_update_part2))) ++ return NULL; ++ struct atsc_dccsct_update_part2 *part2 = (struct atsc_dccsct_update_part2 *) buf + pos; ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_dccsct_update_part2); ++ if (len < (pos + part2->descriptors_length)) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ ++ pos += part2->descriptors_length; ++ } ++ ++ if (len < (pos + sizeof(struct atsc_dccsct_section_part2))) ++ return NULL; ++ struct atsc_dccsct_section_part2 *part2 = (struct atsc_dccsct_section_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_dccsct_section_part2); ++ if (len < (pos + part2->descriptors_length)) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ ++ pos += part2->descriptors_length; ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_dccsct_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dccsct_section.h dvb-apps/lib/libucsi/atsc/dccsct_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dccsct_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dccsct_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,327 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_DCCSCT_SECTION_H ++#define _UCSI_ATSC_DCCSCT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++enum atsc_dccst_update_types { ++ ATSC_DCCST_UPDATE_NEW_GENRE = 0x01, ++ ATSC_DCCST_UPDATE_NEW_STATE = 0x02, ++ ATSC_DCCST_UPDATE_NEW_COUNTY = 0x03, ++}; ++ ++/** ++ * atsc_dccsct_section structure. ++ */ ++struct atsc_dccsct_section { ++ struct atsc_section_psip head; ++ ++ uint8_t updates_defined; ++ /* struct atsc_dccsct_update updates */ ++ /* struct atsc_dccsct_section_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_update { ++ uint8_t update_type; ++ uint8_t update_data_length; ++ /* struct atsc_dccsct_update_XXX data -- depends on update_type */ ++ /* struct atsc_dccsct_update_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_update_new_genre { ++ uint8_t genre_category_code; ++ /* atsc_text name */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_update_new_state { ++ uint8_t dcc_state_location_code; ++ /* atsc_text name */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_update_new_county { ++ uint8_t state_code; ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t dcc_county_location_code :10; ); ++ /* atsc_text name */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_update_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_dccsct_section_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_dccsct_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_dccsct_section pointer, or NULL on error. ++ */ ++struct atsc_dccsct_section *atsc_dccsct_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the dccsct_type field of a dccsct. ++ * ++ * @param dccsct dccsct pointer. ++ * @return The dccsct_type. ++ */ ++static inline uint16_t atsc_dccsct_section_dccsct_type(struct atsc_dccsct_section *dccsct) ++{ ++ return dccsct->head.ext_head.table_id_ext; ++} ++ ++/** ++ * Iterator for the updates field in an atsc_dccsct_section. ++ * ++ * @param dccsct atsc_dccsct_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_dccsct_update. ++ * @param idx Integer used to count which test we are in. ++ */ ++#define atsc_dccsct_section_updates_for_each(dccsct, pos, idx) \ ++ for ((pos) = atsc_dccsct_section_updates_first(dccsct), idx=0; \ ++ (pos); \ ++ (pos) = atsc_dccsct_section_updates_next(dccsct, pos, ++idx)) ++ ++/** ++ * Accessor for the data field of a new genre atsc_dccsct_update. ++ * ++ * @param update atsc_dccsct_update pointer. ++ * @return struct atsc_dccsct_update_new_genre pointer. ++ */ ++static inline struct atsc_dccsct_update_new_genre *atsc_dccsct_update_new_genre(struct atsc_dccsct_update *update) ++{ ++ if (update->update_type != ATSC_DCCST_UPDATE_NEW_GENRE) ++ return NULL; ++ ++ return (struct atsc_dccsct_update_new_genre *) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update)); ++} ++ ++/** ++ * Accessor for the name field of an atsc_dccsct_update_new_genre. ++ * ++ * @param update atsc_dccsct_update_new_genre pointer. ++ * @return text pointer. ++ */ ++static inline struct atsc_text *atsc_dccsct_update_new_genre_name(struct atsc_dccsct_update *update) ++{ ++ if ((update->update_data_length - 1) == 0) ++ return NULL; ++ ++ return (struct atsc_text *) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update_new_genre)); ++} ++ ++/** ++ * Accessor for the data field of a new state atsc_dccsct_update. ++ * ++ * @param update atsc_dccsct_update pointer. ++ * @return struct atsc_dccsct_update_new_state pointer. ++ */ ++static inline struct atsc_dccsct_update_new_state * ++ atsc_dccsct_update_new_state(struct atsc_dccsct_update *update) ++{ ++ if (update->update_type != ATSC_DCCST_UPDATE_NEW_STATE) ++ return NULL; ++ ++ return (struct atsc_dccsct_update_new_state *) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update)); ++} ++ ++/** ++ * Accessor for the name field of an atsc_dccsct_update_new_state. ++ * ++ * @param update atsc_dccsct_update_new_state pointer. ++ * @return text pointer. ++ */ ++static inline struct atsc_text *atsc_dccsct_update_new_state_name(struct atsc_dccsct_update *update) ++{ ++ if ((update->update_data_length - 1) == 0) ++ return NULL; ++ ++ return (struct atsc_text *) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update_new_state)); ++} ++ ++/** ++ * Accessor for the data field of a new county atsc_dccsct_update. ++ * ++ * @param update atsc_dccsct_update pointer. ++ * @return struct atsc_dccsct_update_new_county pointer. ++ */ ++static inline struct atsc_dccsct_update_new_county * ++ atsc_dccsct_update_new_county(struct atsc_dccsct_update *update) ++{ ++ if (update->update_type != ATSC_DCCST_UPDATE_NEW_COUNTY) ++ return NULL; ++ ++ return (struct atsc_dccsct_update_new_county *) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update)); ++} ++ ++/** ++ * Accessor for the name field of an atsc_dccsct_update_new_county. ++ * ++ * @param update atsc_dccsct_update_new_county pointer. ++ * @return text pointer. ++ */ ++static inline struct atsc_text *atsc_dccsct_update_new_county_name(struct atsc_dccsct_update *update) ++{ ++ if ((update->update_data_length - 3) == 0) ++ return NULL; ++ ++ return (struct atsc_text*) ++ (((uint8_t*) update) + sizeof(struct atsc_dccsct_update_new_county)); ++} ++ ++/** ++ * Accessor for the part2 field of an atsc_dccsct_update. ++ * ++ * @param update atsc_dccsct_update pointer. ++ * @return struct atsc_dccsct_test_part2 pointer. ++ */ ++static inline struct atsc_dccsct_update_part2 *atsc_dccsct_update_part2(struct atsc_dccsct_update *update) ++{ ++ int pos = sizeof(struct atsc_dccsct_update); ++ pos += update->update_data_length; ++ ++ return (struct atsc_dccsct_update_part2 *) (((uint8_t*) update) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in an atsc_dccsct_update_part2 structure. ++ * ++ * @param part2 atsc_dccsct_update_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_dccsct_update_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_dccsct_update_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_dccsct_update_part2_descriptors_next(part2, pos)) ++ ++/** ++ * Iterator for the descriptors field in a atsc_dccsct_section_part2 structure. ++ * ++ * @param part2 atsc_dccsct_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_dccsct_section_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_dccsct_section_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_dccsct_section_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_dccsct_update * ++ atsc_dccsct_section_updates_first(struct atsc_dccsct_section *dccsct) ++{ ++ size_t pos = sizeof(struct atsc_dccsct_section); ++ ++ if (dccsct->updates_defined == 0) ++ return NULL; ++ ++ return (struct atsc_dccsct_update*) (((uint8_t *) dccsct) + pos); ++} ++ ++static inline struct atsc_dccsct_update* ++ atsc_dccsct_section_updates_next(struct atsc_dccsct_section *dccsct, ++ struct atsc_dccsct_update *pos, ++ int idx) ++{ ++ if (idx >= dccsct->updates_defined) ++ return NULL; ++ ++ struct atsc_dccsct_update_part2 *part2 = atsc_dccsct_update_part2(pos); ++ int len = sizeof(struct atsc_dccsct_update_part2); ++ len += part2->descriptors_length; ++ ++ return (struct atsc_dccsct_update *) (((uint8_t*) part2) + len); ++} ++ ++static inline struct descriptor * ++ atsc_dccsct_update_part2_descriptors_first(struct atsc_dccsct_update_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_dccsct_update_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_dccsct_update_part2_descriptors_next(struct atsc_dccsct_update_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_dccsct_update_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_dccsct_section_part2_descriptors_first(struct atsc_dccsct_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_dccsct_section_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_dccsct_section_part2_descriptors_next(struct atsc_dccsct_section_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_dccsct_section_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcct_section.c dvb-apps/lib/libucsi/atsc/dcct_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcct_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dcct_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,96 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_dcct_section *atsc_dcct_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = 0; ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int testidx; ++ int termidx; ++ ++ if (len < sizeof(struct atsc_dcct_section)) ++ return NULL; ++ struct atsc_dcct_section *dcct = (struct atsc_dcct_section *) psip; ++ ++ pos += sizeof(struct atsc_dcct_section); ++ for(testidx =0; testidx < dcct->dcc_test_count; testidx++) { ++ if (len < (pos + sizeof(struct atsc_dcct_test))) ++ return NULL; ++ struct atsc_dcct_test *test = (struct atsc_dcct_test *) (buf+pos); ++ ++ bswap24(buf+pos); ++ bswap24(buf+pos+3); ++ bswap32(buf+pos+6); ++ bswap32(buf+pos+10); ++ ++ pos += sizeof(struct atsc_dcct_test); ++ for(termidx =0; termidx < test->dcc_term_count; termidx++) { ++ if (len < (pos + sizeof(struct atsc_dcct_term))) ++ return NULL; ++ struct atsc_dcct_term *term = (struct atsc_dcct_term *) (buf+pos); ++ ++ bswap64(buf+pos+1); ++ bswap16(buf+pos+9); ++ ++ pos += sizeof(struct atsc_dcct_term); ++ if (len < (pos + term->descriptors_length)) ++ return NULL; ++ if (verify_descriptors(buf + pos, term->descriptors_length)) ++ return NULL; ++ ++ pos += term->descriptors_length; ++ } ++ ++ if (len < (pos + sizeof(struct atsc_dcct_test_part2))) ++ return NULL; ++ struct atsc_dcct_test_part2 *part2 = (struct atsc_dcct_test_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_dcct_test_part2); ++ if (len < (pos + part2->descriptors_length)) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ pos += part2->descriptors_length; ++ } ++ ++ if (len < (pos + sizeof(struct atsc_dcct_section_part2))) ++ return NULL; ++ struct atsc_dcct_section_part2 *part2 = (struct atsc_dcct_section_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_dcct_section_part2); ++ if (len < (pos + part2->descriptors_length)) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ ++ pos += part2->descriptors_length; ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_dcct_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcct_section.h dvb-apps/lib/libucsi/atsc/dcct_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/dcct_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/dcct_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,380 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_DCCT_SECTION_H ++#define _UCSI_ATSC_DCCT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++enum atsc_dcc_context { ++ ATSC_DCC_CONTEXT_TEMPORARY_RETUNE = 0, ++ ATSC_DCC_CONTEXT_CHANNEL_REDIRECT = 1, ++}; ++ ++enum atsc_dcc_selection_type { ++ ATSC_DCC_SELECTION_UNCONDITIONAL_CHANNEL_CHANGE = 0x00, ++ ATSC_DCC_SELECTION_NUMERIC_POSTAL_CODE_INCLUSION = 0x01, ++ ATSC_DCC_SELECTION_ALPHANUMERIC_POSTAL_CODE_INCLUSION = 0x02, ++ ATSC_DCC_SELECTION_DEMOGRAPHIC_CATEGORY_ONE_OR_MORE = 0x05, ++ ATSC_DCC_SELECTION_DEMOGRAPHIC_CATEGORY_ALL = 0x06, ++ ATSC_DCC_SELECTION_GENRE_CATEGORY_ONE_OR_MORE = 0x07, ++ ATSC_DCC_SELECTION_GENRE_CATEGORY_ALL = 0x08, ++ ATSC_DCC_SELECTION_CANNOT_BE_AUTHORIZED = 0x09, ++ ATSC_DCC_SELECTION_GEOGRAPHIC_LOCATION_INCLUSION = 0x0c, ++ ATSC_DCC_SELECTION_RATING_BLOCKED = 0x0d, ++ ATSC_DCC_SELECTION_RETURN_TO_ORIGINAL_CHANNEL = 0x0f, ++ ATSC_DCC_SELECTION_NUMERIC_POSTAL_CODE_EXCLUSION = 0x11, ++ ATSC_DCC_SELECTION_ALPHANUMERIC_POSTAL_CODE_EXCLUSION = 0x12, ++ ATSC_DCC_SELECTION_DEMOGRAPHIC_CATEGORY_NOT_ONE_OR_MORE = 0x15, ++ ATSC_DCC_SELECTION_DEMOGRAPHIC_CATEGORY_NOT_ALL = 0x16, ++ ATSC_DCC_SELECTION_GENRE_CATEGORY_NOT_ONE_OR_MORE = 0x17, ++ ATSC_DCC_SELECTION_GENRE_CATEGORY_NOT_ALL = 0x18, ++ ATSC_DCC_SELECTION_GEOGRAPHIC_LOCATION_EXCLUSION = 0x1c, ++ ATSC_DCC_SELECTION_VIEWER_DIRECT_SELECT_A = 0x20, ++ ATSC_DCC_SELECTION_VIEWER_DIRECT_SELECT_B = 0x21, ++ ATSC_DCC_SELECTION_VIEWER_DIRECT_SELECT_C = 0x22, ++ ATSC_DCC_SELECTION_VIEWER_DIRECT_SELECT_D = 0x23, ++}; ++ ++/** ++ * atsc_dcct_section structure. ++ */ ++struct atsc_dcct_section { ++ struct atsc_section_psip head; ++ ++ uint8_t dcc_test_count; ++ /* struct atsc_dcct_test tests */ ++ /* struct atsc_dcct_section_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_dcct_test { ++ EBIT4(uint32_t dcc_context : 1; , ++ uint32_t reserved : 3; , ++ uint32_t dcc_from_major_channel_number :10; , ++ uint32_t dcc_from_minor_channel_number :10; ); ++ EBIT3(uint32_t reserved1 : 4; , ++ uint32_t dcc_to_major_channel_number :10; , ++ uint32_t dcc_to_minor_channel_number :10; ); ++ atsctime_t start_time; ++ atsctime_t end_time; ++ uint8_t dcc_term_count; ++ /* struct atsc_dcct_term terms */ ++ /* struct atsc_dcct_test_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_dcct_term { ++ uint8_t dcc_selection_type; ++ uint64_t dcc_selection_id; ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_dcct_test_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_dcct_section_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++static inline struct atsc_dcct_test * ++ atsc_dcct_section_tests_first(struct atsc_dcct_section *dcct); ++static inline struct atsc_dcct_test * ++ atsc_dcct_section_tests_next(struct atsc_dcct_section *dcct, ++ struct atsc_dcct_test *pos, ++ int idx); ++static inline struct atsc_dcct_term * ++ atsc_dcct_test_terms_first(struct atsc_dcct_test *test); ++static inline struct atsc_dcct_term * ++ atsc_dcct_test_terms_next(struct atsc_dcct_test *test, ++ struct atsc_dcct_term *pos, ++ int idx); ++ ++ ++/** ++ * Process an atsc_dcct_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_dcct_section pointer, or NULL on error. ++ */ ++struct atsc_dcct_section *atsc_dcct_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the dcc_subtype field of a dcct. ++ * ++ * @param dcct dcct pointer. ++ * @return The dcc_subtype. ++ */ ++static inline uint8_t atsc_dcct_section_dcc_subtype(struct atsc_dcct_section *dcct) ++{ ++ return dcct->head.ext_head.table_id_ext >> 8; ++} ++ ++/** ++ * Accessor for the dcc_id field of a dcct. ++ * ++ * @param dcct dcct pointer. ++ * @return The dcc_id. ++ */ ++static inline uint8_t atsc_dcct_section_dcc_id(struct atsc_dcct_section *dcct) ++{ ++ return dcct->head.ext_head.table_id_ext & 0xff; ++} ++ ++/** ++ * Iterator for the tests field in an atsc_dcct_section. ++ * ++ * @param dcct atsc_dcct_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_dcct_test. ++ * @param idx Integer used to count which test we are in. ++ */ ++#define atsc_dcct_section_tests_for_each(dcct, pos, idx) \ ++ for ((pos) = atsc_dcct_section_tests_first(dcct), idx=0; \ ++ (pos); \ ++ (pos) = atsc_dcct_section_tests_next(dcct, pos, ++idx)) ++ ++/** ++ * Iterator for the terms field in an atsc_dcct_test. ++ * ++ * @param test atsc_dcct_test pointer. ++ * @param pos Variable containing a pointer to the current atsc_dcct_term. ++ * @param idx Integer used to count which test we are in. ++ */ ++#define atsc_dcct_test_terms_for_each(test, pos, idx) \ ++ for ((pos) = atsc_dcct_test_terms_first(test), idx=0; \ ++ (pos); \ ++ (pos) = atsc_dcct_test_terms_next(test, pos, ++idx)) ++ ++/** ++ * Iterator for the descriptors field in a atsc_dcct_term structure. ++ * ++ * @param term atsc_dcct_term pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_dcct_term_descriptors_for_each(term, pos) \ ++ for ((pos) = atsc_dcct_term_descriptors_first(term); \ ++ (pos); \ ++ (pos) = atsc_dcct_term_descriptors_next(term, pos)) ++ ++/** ++ * Accessor for the part2 field of an atsc_dcct_test. ++ * ++ * @param test atsc_dcct_test pointer. ++ * @return struct atsc_dcct_test_part2 pointer. ++ */ ++static inline struct atsc_dcct_test_part2 *atsc_dcct_test_part2(struct atsc_dcct_test *test) ++{ ++ int pos = sizeof(struct atsc_dcct_test); ++ ++ struct atsc_dcct_term *cur_term; ++ int idx; ++ atsc_dcct_test_terms_for_each(test, cur_term, idx) { ++ pos += sizeof(struct atsc_dcct_term); ++ pos += cur_term->descriptors_length; ++ } ++ ++ return (struct atsc_dcct_test_part2 *) (((uint8_t*) test) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_dcct_test_part2 structure. ++ * ++ * @param term atsc_dcct_test_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_dcct_test_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_dcct_test_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_dcct_test_part2_descriptors_next(part2, pos)) ++ ++/** ++ * Accessor for the part2 field of an atsc_dcct_section. ++ * ++ * @param dcct atsc_dcct_section pointer. ++ * @return struct atsc_dcct_section_part2 pointer. ++ */ ++static inline struct atsc_dcct_section_part2 *atsc_dcct_section_part2(struct atsc_dcct_section *dcct) ++{ ++ int pos = sizeof(struct atsc_dcct_section); ++ ++ struct atsc_dcct_test *cur_test; ++ int testidx; ++ atsc_dcct_section_tests_for_each(dcct, cur_test, testidx) { ++ struct atsc_dcct_test_part2 *part2 = atsc_dcct_test_part2(cur_test); ++ pos += ((uint8_t*) part2 - (uint8_t*) cur_test); ++ ++ pos += sizeof(struct atsc_dcct_test_part2); ++ pos += part2->descriptors_length; ++ } ++ ++ return (struct atsc_dcct_section_part2 *) (((uint8_t*) dcct) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_dcct_section_part2 structure. ++ * ++ * @param part2 atsc_dcct_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_dcct_section_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_dcct_section_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_dcct_section_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_dcct_test * ++ atsc_dcct_section_tests_first(struct atsc_dcct_section *dcct) ++{ ++ size_t pos = sizeof(struct atsc_dcct_section); ++ ++ if (dcct->dcc_test_count == 0) ++ return NULL; ++ ++ return (struct atsc_dcct_test*) (((uint8_t *) dcct) + pos); ++} ++ ++static inline struct atsc_dcct_test * ++ atsc_dcct_section_tests_next(struct atsc_dcct_section *dcct, ++ struct atsc_dcct_test *pos, ++ int idx) ++{ ++ if (idx >= dcct->dcc_test_count) ++ return NULL; ++ ++ struct atsc_dcct_test_part2 *part2 = atsc_dcct_test_part2(pos); ++ int len = sizeof(struct atsc_dcct_test_part2); ++ len += part2->descriptors_length; ++ ++ return (struct atsc_dcct_test *) (((uint8_t*) part2) + len); ++} ++ ++static inline struct atsc_dcct_term * ++ atsc_dcct_test_terms_first(struct atsc_dcct_test *test) ++{ ++ size_t pos = sizeof(struct atsc_dcct_test); ++ ++ if (test->dcc_term_count == 0) ++ return NULL; ++ ++ return (struct atsc_dcct_term*) (((uint8_t *) test) + pos); ++} ++ ++static inline struct atsc_dcct_term * ++ atsc_dcct_test_terms_next(struct atsc_dcct_test *test, ++ struct atsc_dcct_term *pos, ++ int idx) ++{ ++ if (idx >= test->dcc_term_count) ++ return NULL; ++ ++ int len = sizeof(struct atsc_dcct_term); ++ len += pos->descriptors_length; ++ ++ return (struct atsc_dcct_term *) (((uint8_t*) pos) + len); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_term_descriptors_first(struct atsc_dcct_term *term) ++{ ++ size_t pos = sizeof(struct atsc_dcct_term); ++ ++ if (term->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) term) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_term_descriptors_next(struct atsc_dcct_term *term, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) term + sizeof(struct atsc_dcct_term), ++ term->descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_test_part2_descriptors_first(struct atsc_dcct_test_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_dcct_test_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_test_part2_descriptors_next(struct atsc_dcct_test_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_dcct_test_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_section_part2_descriptors_first(struct atsc_dcct_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_dcct_section_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_dcct_section_part2_descriptors_next(struct atsc_dcct_section_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_dcct_section_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/descriptor.h dvb-apps/lib/libucsi/atsc/descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,68 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_DESCRIPTOR_H ++#define _UCSI_ATSC_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/** ++ * Enumeration of ATSC descriptor tags. ++ */ ++enum atsc_descriptor_tag { ++ dtag_atsc_stuffing = 0x80, ++ dtag_atsc_ac3_audio = 0x81, ++ dtag_atsc_caption_service = 0x86, ++ dtag_atsc_content_advisory = 0x87, ++ dtag_atsc_extended_channel_name = 0xa0, ++ dtag_atsc_service_location = 0xa1, ++ dtag_atsc_time_shifted_service = 0xa2, ++ dtag_atsc_component_name = 0xa3, ++ dtag_atsc_dcc_departing_request = 0xa8, ++ dtag_atsc_dcc_arriving_request = 0xa9, ++ dtag_atsc_redistribution_control = 0xaa, ++ dtag_atsc_private_information = 0xad, ++ dtag_atsc_content_identifier = 0xb6, ++ dtag_atsc_genre = 0xab, ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/eit_section.c dvb-apps/lib/libucsi/atsc/eit_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/eit_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/eit_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,71 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_eit_section *atsc_eit_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = 0; ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int idx; ++ ++ if (len < sizeof(struct atsc_eit_section)) ++ return NULL; ++ struct atsc_eit_section *eit = (struct atsc_eit_section *) psip; ++ ++ pos += sizeof(struct atsc_eit_section); ++ for(idx =0; idx < eit->num_events_in_section; idx++) { ++ if (len < (pos + sizeof(struct atsc_eit_event))) ++ return NULL; ++ struct atsc_eit_event *event = (struct atsc_eit_event *) (buf+pos); ++ ++ bswap16(buf+pos); ++ bswap32(buf+pos+2); ++ bswap32(buf+pos+6); ++ ++ pos += sizeof(struct atsc_eit_event); ++ if (len < (pos + event->title_length)) ++ return NULL; ++ if (atsc_text_validate(buf+pos, event->title_length)) ++ return NULL; ++ ++ pos += event->title_length; ++ if (len < (pos + sizeof(struct atsc_eit_event_part2))) ++ return NULL; ++ struct atsc_eit_event_part2 *part2 = (struct atsc_eit_event_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_eit_event_part2); ++ if (len < (pos + part2->descriptors_length)) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ pos += part2->descriptors_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_eit_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/eit_section.h dvb-apps/lib/libucsi/atsc/eit_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/eit_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/eit_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,191 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_EIT_SECTION_H ++#define _UCSI_ATSC_EIT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * atsc_eit_section structure. ++ */ ++struct atsc_eit_section { ++ struct atsc_section_psip head; ++ ++ uint8_t num_events_in_section; ++ /* struct atsc_eit_event events[] */ ++} __ucsi_packed; ++ ++struct atsc_eit_event { ++ EBIT2(uint16_t reserved : 2; , ++ uint16_t event_id :14; ); ++ atsctime_t start_time; ++ EBIT4(uint32_t reserved1 : 2; , ++ uint32_t ETM_location : 2; , ++ uint32_t length_in_seconds :20; , ++ uint32_t title_length : 8; ); ++ /* struct atsc_text title_text */ ++ /* struct atsc_eit_event_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_eit_event_part2 { ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++ ++/** ++ * Process a atsc_eit_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_eit_section pointer, or NULL on error. ++ */ ++struct atsc_eit_section *atsc_eit_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the source_id field of an EIT. ++ * ++ * @param eit EIT pointer. ++ * @return The source_id . ++ */ ++static inline uint16_t atsc_eit_section_source_id(struct atsc_eit_section *eit) ++{ ++ return eit->head.ext_head.table_id_ext; ++} ++ ++/** ++ * Iterator for the events field in an atsc_eit_section. ++ * ++ * @param eit atsc_eit_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_eit_event. ++ * @param idx Integer used to count which event we are in. ++ */ ++#define atsc_eit_section_events_for_each(eit, pos, idx) \ ++ for ((pos) = atsc_eit_section_events_first(eit), idx=0; \ ++ (pos); \ ++ (pos) = atsc_eit_section_events_next(eit, pos, ++idx)) ++ ++/** ++ * Accessor for the title_text field of an atsc_eit_event. ++ * ++ * @param event atsc_eit_event pointer. ++ * @return struct atsc_text pointer, or NULL on error. ++ */ ++static inline struct atsc_text *atsc_eit_event_name_title_text(struct atsc_eit_event *event) ++{ ++ if (event->title_length == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) event) + sizeof(struct atsc_eit_event)); ++} ++ ++/** ++ * Accessor for the part2 field of an atsc_eit_event. ++ * ++ * @param event atsc_eit_event pointer. ++ * @return struct atsc_eit_event_part2 pointer. ++ */ ++static inline struct atsc_eit_event_part2 *atsc_eit_event_part2(struct atsc_eit_event *event) ++{ ++ return (struct atsc_eit_event_part2 *) ++ (((uint8_t*) event) + sizeof(struct atsc_eit_event) + event->title_length); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_eit_section structure. ++ * ++ * @param part2 atsc_eit_event_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_eit_event_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_eit_event_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_eit_event_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_eit_event * ++ atsc_eit_section_events_first(struct atsc_eit_section *eit) ++{ ++ size_t pos = sizeof(struct atsc_eit_section); ++ ++ if (eit->num_events_in_section == 0) ++ return NULL; ++ ++ return (struct atsc_eit_event*) (((uint8_t *) eit) + pos); ++} ++ ++static inline struct atsc_eit_event * ++ atsc_eit_section_events_next(struct atsc_eit_section *eit, ++ struct atsc_eit_event *pos, ++ int idx) ++{ ++ if (idx >= eit->num_events_in_section) ++ return NULL; ++ ++ struct atsc_eit_event_part2 *part2 = atsc_eit_event_part2(pos); ++ int len = sizeof(struct atsc_eit_event_part2); ++ len += part2->descriptors_length; ++ ++ return (struct atsc_eit_event *) (((uint8_t*) part2) + len); ++} ++ ++static inline struct descriptor * ++ atsc_eit_event_part2_descriptors_first(struct atsc_eit_event_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_eit_event_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_eit_event_part2_descriptors_next(struct atsc_eit_event_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_eit_event_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ett_section.c dvb-apps/lib/libucsi/atsc/ett_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ett_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/ett_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,42 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++struct atsc_ett_section *atsc_ett_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = sizeof(struct atsc_section_psip); ++ size_t len = section_ext_length(&(psip->ext_head)); ++ ++ if (len < sizeof(struct atsc_ett_section)) ++ return NULL; ++ ++ bswap32(buf + pos); ++ pos += 4; ++ ++ if (atsc_text_validate(buf + pos, ++ section_ext_length(&psip->ext_head) - sizeof(struct atsc_ett_section))) ++ return NULL; ++ ++ return (struct atsc_ett_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ett_section.h dvb-apps/lib/libucsi/atsc/ett_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/ett_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/ett_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,91 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_ETT_SECTION_H ++#define _UCSI_ATSC_ETT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++enum atsc_etm_type { ++ ATSC_ETM_CHANNEL = 0x00, ++ ATSC_ETM_EVENT = 0x02, ++}; ++ ++/** ++ * atsc_ett_section structure. ++ */ ++struct atsc_ett_section { ++ struct atsc_section_psip head; ++ ++ EBIT3(uint32_t ETM_source_id :16; , ++ uint32_t ETM_sub_id :14; , ++ uint32_t ETM_type : 2; ); ++ /* struct atsc_text extended_text_message */ ++} __ucsi_packed; ++ ++/** ++ * Process a atsc_ett_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_ett_section pointer, or NULL on error. ++ */ ++struct atsc_ett_section *atsc_ett_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the extended_text_message part of an atsc_ett_section. ++ * ++ * @param ett atsc_ett_section pointer. ++ * @return atsc_text pointer, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_ett_section_extended_text_message(struct atsc_ett_section *ett) ++{ ++ int pos = sizeof(struct atsc_ett_section); ++ int len = section_ext_length(&ett->head.ext_head) - sizeof(struct atsc_ett_section); ++ ++ if (len == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) ett) + pos); ++} ++ ++/** ++ * Accessor for the extended_text_message part of an atsc_ett_section. ++ * ++ * @param ett atsc_ett_section pointer. ++ * @return The length. ++ */ ++static inline int ++ atsc_ett_section_extended_text_message_length(struct atsc_ett_section *ett) ++{ ++ return section_ext_length(&ett->head.ext_head) - sizeof(struct atsc_ett_section); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/extended_channel_name_descriptor.h dvb-apps/lib/libucsi/atsc/extended_channel_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/extended_channel_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/extended_channel_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,92 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_EXTENDED_CHANNEL_NAME_DESCRIPTOR ++#define _UCSI_ATSC_EXTENDED_CHANNEL_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++ ++/** ++ * atsc_extended_channel_name_descriptor structure. ++ */ ++struct atsc_extended_channel_name_descriptor { ++ struct descriptor d; ++ ++ /* struct atsc_text text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_extended_channel_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_extended_channel_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_extended_channel_name_descriptor* ++ atsc_extended_channel_name_descriptor_codec(struct descriptor* d) ++{ ++ if (atsc_text_validate(((uint8_t*) d) + sizeof(struct atsc_extended_channel_name_descriptor), ++ d->len)) ++ return NULL; ++ ++ return (struct atsc_extended_channel_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of an atsc_extended_channel_name_descriptor. ++ * ++ * @param d atsc_extended_channel_name_descriptor pointer. ++ * @return Pointer to the atsc_text data, or NULL on error. ++ */ ++static inline struct atsc_text* ++ atsc_extended_channel_name_descriptor_text(struct atsc_extended_channel_name_descriptor *d) ++{ ++ uint8_t *txt = ((uint8_t*) d) + sizeof(struct atsc_extended_channel_name_descriptor); ++ ++ return (struct atsc_text*) txt; ++} ++ ++/** ++ * Accessor for the length of the text field of an atsc_extended_channel_name_descriptor. ++ * ++ * @param d atsc_extended_channel_name_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ atsc_extended_channel_name_descriptor_text_length(struct ++ atsc_extended_channel_name_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/genre_descriptor.h dvb-apps/lib/libucsi/atsc/genre_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/genre_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/genre_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_GENRE_DESCRIPTOR ++#define _UCSI_ATSC_GENRE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * atsc_genre_descriptor structure. ++ */ ++struct atsc_genre_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 3; , ++ uint8_t attribute_count : 5; ); ++ /* uint8_t attributes[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_genre_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_genre_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_genre_descriptor* ++ atsc_genre_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_genre_descriptor *ret = ++ (struct atsc_genre_descriptor *) d; ++ ++ if (d->len < 1) ++ return NULL; ++ ++ if (d->len != (1 + ret->attribute_count)) ++ return NULL; ++ ++ return (struct atsc_genre_descriptor*) d; ++} ++ ++/** ++ * Accessor for the attributes field of an atsc_genre_descriptor. ++ * ++ * @param d atsc_genre_descriptor pointer. ++ * @return Pointer to the attributes. ++ */ ++static inline uint8_t* ++ atsc_genre_descriptor_attributes(struct atsc_genre_descriptor *d) ++{ ++ return ((uint8_t*) d) + sizeof(struct atsc_genre_descriptor); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/Makefile dvb-apps/lib/libucsi/atsc/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,55 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libucsi/atsc ++ ++.PHONY: sub-error-atsc ++ ++sub-error-atsc: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += atsc/atsc_text.o \ ++ atsc/cvct_section.o \ ++ atsc/dccsct_section.o \ ++ atsc/dcct_section.o \ ++ atsc/eit_section.o \ ++ atsc/ett_section.o \ ++ atsc/mgt_section.o \ ++ atsc/rrt_section.o \ ++ atsc/stt_section.o \ ++ atsc/tvct_section.o \ ++ atsc/types.o ++ ++sub-install += atsc ++ ++else ++ ++includes = ac3_descriptor.h \ ++ caption_service_descriptor.h \ ++ component_name_descriptor.h \ ++ content_advisory_descriptor.h \ ++ cvct_section.h \ ++ dcc_arriving_request_descriptor.h \ ++ dcc_departing_request_descriptor.h \ ++ dccsct_section.h \ ++ dcct_section.h \ ++ descriptor.h \ ++ eit_section.h \ ++ ett_section.h \ ++ extended_channel_name_descriptor.h \ ++ genre_descriptor.h \ ++ mgt_section.h \ ++ rc_descriptor.h \ ++ rrt_section.h \ ++ section.h \ ++ service_location_descriptor.h \ ++ stt_section.h \ ++ stuffing_descriptor.h \ ++ time_shifted_service_descriptor.h \ ++ tvct_section.h \ ++ types.h ++ ++include ../../../Make.rules ++ ++lib_name = libucsi/atsc ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/mgt_section.c dvb-apps/lib/libucsi/atsc/mgt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/mgt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/mgt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,76 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_mgt_section *atsc_mgt_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = sizeof(struct atsc_section_psip); ++ size_t len = section_ext_length(&(psip->ext_head)); ++ struct atsc_mgt_section *mgt = (struct atsc_mgt_section *) psip; ++ int i; ++ ++ if (len < sizeof(struct atsc_mgt_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ ++ // we cannot use the tables_defined value here because of the braindead ATSC spec! ++ for(i=0; i < mgt->tables_defined; i++) { ++ // we think we're still in the tables - process as normal ++ if ((pos + sizeof(struct atsc_mgt_table)) > len) ++ return NULL; ++ struct atsc_mgt_table *table = (struct atsc_mgt_table *) (buf+pos); ++ ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap32(buf+pos+5); ++ bswap16(buf+pos+9); ++ ++ pos += sizeof(struct atsc_mgt_table); ++ if ((pos + table->table_type_descriptors_length) > len) ++ return NULL; ++ if (verify_descriptors(buf + pos, table->table_type_descriptors_length)) ++ return NULL; ++ ++ pos += table->table_type_descriptors_length; ++ } ++ ++ if ((pos + sizeof(struct atsc_mgt_section_part2)) > len) ++ return NULL; ++ struct atsc_mgt_section_part2 *part2 = (struct atsc_mgt_section_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ ++ pos += sizeof(struct atsc_mgt_section_part2); ++ if ((pos + part2->descriptors_length) > len) ++ return NULL; ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ pos += part2->descriptors_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_mgt_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/mgt_section.h dvb-apps/lib/libucsi/atsc/mgt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/mgt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/mgt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,215 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_MGT_SECTION_H ++#define _UCSI_ATSC_MGT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++enum atsc_mgt_section_table_type { ++ ATSC_MGT_TABLE_TYPE_TVCT_CURRENT = 0, ++ ATSC_MGT_TABLE_TYPE_TVCT_NEXT = 1, ++ ATSC_MGT_TABLE_TYPE_CVCT_CURRENT = 2, ++ ATSC_MGT_TABLE_TYPE_CVCT_NEXT = 3, ++ ATSC_MGT_TABLE_TYPE_CHANNEL_ETT = 4, ++ ATSC_MGT_TABLE_TYPE_DCCSCT = 5, ++}; ++ ++/** ++ * atsc_mgt_section structure. ++ */ ++struct atsc_mgt_section { ++ struct atsc_section_psip head; ++ ++ uint16_t tables_defined; ++ /* struct atsc_mgt_table tables[] */ ++ /* struct atsc_mgt_section_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_mgt_table { ++ uint16_t table_type; ++ EBIT2(uint16_t reserved : 3; , ++ uint16_t table_type_PID :13; ); ++ EBIT2(uint8_t reserved1 : 3; , ++ uint8_t table_type_version_number : 5; ); ++ uint32_t number_bytes; ++ EBIT2(uint16_t reserved2 : 4; , ++ uint16_t table_type_descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_mgt_section_part2 { ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++static inline struct atsc_mgt_table * atsc_mgt_section_tables_first(struct atsc_mgt_section *mgt); ++static inline struct atsc_mgt_table * ++ atsc_mgt_section_tables_next(struct atsc_mgt_section *mgt, struct atsc_mgt_table *pos, int idx); ++ ++/** ++ * Process a atsc_mgt_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_mgt_section pointer, or NULL on error. ++ */ ++struct atsc_mgt_section *atsc_mgt_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Iterator for the tables field in an atsc_mgt_section. ++ * ++ * @param mgt atsc_mgt_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_mgt_table. ++ * @param idx Integer used to count which table we in. ++ */ ++#define atsc_mgt_section_tables_for_each(mgt, pos, idx) \ ++ for ((pos) = atsc_mgt_section_tables_first(mgt), idx=0; \ ++ (pos); \ ++ (pos) = atsc_mgt_section_tables_next(mgt, pos, ++idx)) ++ ++/** ++ * Iterator for the descriptors field in a atsc_mgt_table structure. ++ * ++ * @param table atsc_mgt_table pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_mgt_table_descriptors_for_each(table, pos) \ ++ for ((pos) = atsc_mgt_table_descriptors_first(table); \ ++ (pos); \ ++ (pos) = atsc_mgt_table_descriptors_next(table, pos)) ++ ++/** ++ * Accessor for the second part of an atsc_mgt_section. ++ * ++ * @param mgt atsc_mgt_section pointer. ++ * @return atsc_mgt_section_part2 pointer. ++ */ ++static inline struct atsc_mgt_section_part2 * ++ atsc_mgt_section_part2(struct atsc_mgt_section *mgt) ++{ ++ int pos = sizeof(struct atsc_mgt_section); ++ ++ struct atsc_mgt_table *cur_table; ++ int idx; ++ atsc_mgt_section_tables_for_each(mgt, cur_table, idx) { ++ pos += sizeof(struct atsc_mgt_table); ++ pos += cur_table->table_type_descriptors_length; ++ } ++ ++ return (struct atsc_mgt_section_part2 *) (((uint8_t*) mgt) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_mgt_section structure. ++ * ++ * @param part2 atsc_mgt_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_mgt_section_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_mgt_section_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_mgt_section_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_mgt_table * ++ atsc_mgt_section_tables_first(struct atsc_mgt_section *mgt) ++{ ++ size_t pos = sizeof(struct atsc_mgt_section); ++ ++ if (mgt->tables_defined == 0) ++ return NULL; ++ ++ return (struct atsc_mgt_table*) (((uint8_t *) mgt) + pos); ++} ++ ++static inline struct atsc_mgt_table * ++ atsc_mgt_section_tables_next(struct atsc_mgt_section *mgt, ++ struct atsc_mgt_table *pos, ++ int idx) ++{ ++ if (idx >= mgt->tables_defined) ++ return NULL; ++ ++ return (struct atsc_mgt_table *) ++ (((uint8_t*) pos) + sizeof(struct atsc_mgt_table) + pos->table_type_descriptors_length); ++} ++ ++static inline struct descriptor * ++ atsc_mgt_table_descriptors_first(struct atsc_mgt_table *table) ++{ ++ size_t pos = sizeof(struct atsc_mgt_table); ++ ++ if (table->table_type_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) table) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_mgt_table_descriptors_next(struct atsc_mgt_table *table, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) table + sizeof(struct atsc_mgt_table), ++ table->table_type_descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_mgt_section_part2_descriptors_first(struct atsc_mgt_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_mgt_section_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_mgt_section_part2_descriptors_next(struct atsc_mgt_section_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_mgt_section_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rc_descriptor.h dvb-apps/lib/libucsi/atsc/rc_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rc_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/rc_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,83 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_RC_DESCRIPTOR ++#define _UCSI_ATSC_RC_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * atsc_rc_descriptor structure. ++ */ ++struct atsc_rc_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t info[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_rc_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_rc_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_rc_descriptor* ++ atsc_rc_descriptor_codec(struct descriptor* d) ++{ ++ return (struct atsc_rc_descriptor*) d; ++} ++ ++/** ++ * Accessor for the info field of an atsc_rc_descriptor. ++ * ++ * @param d atsc_rc_descriptor pointer. ++ * @return Pointer to the atsc_text data. ++ */ ++static inline uint8_t* ++ atsc_rc_descriptor_info(struct atsc_rc_descriptor *d) ++{ ++ return ((uint8_t*) d) + sizeof(struct atsc_rc_descriptor); ++} ++ ++/** ++ * Accessor for the length of the info field of an atsc_rc_descriptor. ++ * ++ * @param d atsc_rc_descriptor pointer. ++ * @return The length ++ */ ++static inline int ++ atsc_rc_descriptor_info_length(struct atsc_rc_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rrt_section.c dvb-apps/lib/libucsi/atsc/rrt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rrt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/rrt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,108 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_rrt_section *atsc_rrt_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = 0; ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int idx; ++ int vidx; ++ struct atsc_rrt_section *rrt = (struct atsc_rrt_section *) psip; ++ ++ if (len < sizeof(struct atsc_rrt_section)) ++ return NULL; ++ pos += sizeof(struct atsc_rrt_section); ++ ++ if (len < (pos + rrt->rating_region_name_length)) ++ return NULL; ++ if (atsc_text_validate(buf+pos, rrt->rating_region_name_length)) ++ return NULL; ++ ++ pos += rrt->rating_region_name_length; ++ if (len < (pos + sizeof(struct atsc_rrt_section_part2))) ++ return NULL; ++ struct atsc_rrt_section_part2 *rrtpart2 = (struct atsc_rrt_section_part2 *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_section_part2); ++ for(idx =0; idx < rrtpart2->dimensions_defined; idx++) { ++ if (len < (pos + sizeof(struct atsc_rrt_dimension))) ++ return NULL; ++ struct atsc_rrt_dimension *dimension = (struct atsc_rrt_dimension *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_dimension); ++ if (len < (pos + dimension->dimension_name_length)) ++ return NULL; ++ if (atsc_text_validate(buf+pos, dimension->dimension_name_length)) ++ return NULL; ++ ++ pos += dimension->dimension_name_length; ++ if (len < (pos + sizeof(struct atsc_rrt_dimension_part2))) ++ return NULL; ++ struct atsc_rrt_dimension_part2 *dpart2 = (struct atsc_rrt_dimension_part2 *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_dimension_part2); ++ for(vidx =0; vidx < dpart2->values_defined; vidx++) { ++ if (len < (pos + sizeof(struct atsc_rrt_dimension_value))) ++ return NULL; ++ struct atsc_rrt_dimension_value *value = (struct atsc_rrt_dimension_value *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_dimension_value); ++ if (len < (pos + value->abbrev_rating_value_length)) ++ return NULL; ++ if (atsc_text_validate(buf+pos, value->abbrev_rating_value_length)) ++ return NULL; ++ ++ pos += value->abbrev_rating_value_length; ++ if (len < (pos + sizeof(struct atsc_rrt_dimension_value_part2))) ++ return NULL; ++ struct atsc_rrt_dimension_value_part2 *vpart2 = ++ (struct atsc_rrt_dimension_value_part2 *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_dimension_value_part2); ++ if (len < (pos + vpart2->rating_value_length)) ++ return NULL; ++ if (atsc_text_validate(buf+pos, vpart2->rating_value_length)) ++ return NULL; ++ ++ pos+= vpart2->rating_value_length; ++ } ++ } ++ ++ if (len < (pos + sizeof(struct atsc_rrt_section_part3))) ++ return NULL; ++ struct atsc_rrt_section_part3 *part3 = (struct atsc_rrt_section_part3 *) (buf+pos); ++ ++ pos += sizeof(struct atsc_rrt_section_part3); ++ if (len < (pos + part3->descriptors_length)) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, part3->descriptors_length)) ++ return NULL; ++ ++ pos += part3->descriptors_length; ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_rrt_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rrt_section.h dvb-apps/lib/libucsi/atsc/rrt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/rrt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/rrt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,379 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_RRT_SECTION_H ++#define _UCSI_ATSC_RRT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * atsc_rrt_section structure. ++ */ ++struct atsc_rrt_section { ++ struct atsc_section_psip head; ++ ++ uint8_t rating_region_name_length; ++ /* struct atsc_text rating_region_name_text */ ++ /* struct atsc_rrt_section_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_rrt_section_part2 { ++ uint8_t dimensions_defined; ++ /* struct atsc_rrt_dimension dimensions[] */ ++ /* struct atsc_rrt_section_part3 part3 */ ++} __ucsi_packed; ++ ++struct atsc_rrt_dimension { ++ uint8_t dimension_name_length; ++ /* struct atsc_text dimension_name_text */ ++ /* struct atsc_rrt_dimension_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_rrt_dimension_part2 { ++ EBIT3(uint8_t reserved : 3; , ++ uint8_t graduated_scale : 1; , ++ uint8_t values_defined : 4; ); ++ /* struct atsc_rrt_dimension_value values[] */ ++} __ucsi_packed; ++ ++struct atsc_rrt_dimension_value { ++ uint8_t abbrev_rating_value_length; ++ /* struct atsc_text abbrev_rating_value_text */ ++ /* struct atsc_rrt_dimension_value_part2 */ ++} __ucsi_packed; ++ ++struct atsc_rrt_dimension_value_part2 { ++ uint8_t rating_value_length; ++ /* struct atsc_text rating_value_text */ ++} __ucsi_packed; ++ ++struct atsc_rrt_section_part3 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++ ++static inline struct atsc_rrt_dimension * ++ atsc_rrt_section_dimensions_first(struct atsc_rrt_section_part2 *part2); ++static inline struct atsc_rrt_dimension * ++ atsc_rrt_section_dimensions_next(struct atsc_rrt_section_part2 *part2, ++ struct atsc_rrt_dimension *pos, ++ int idx); ++static inline struct atsc_rrt_dimension_value * ++ atsc_rrt_dimension_part2_values_first(struct atsc_rrt_dimension_part2 *part2); ++static inline struct atsc_rrt_dimension_value * ++ atsc_rrt_dimension_part2_values_next(struct atsc_rrt_dimension_part2 *part2, ++ struct atsc_rrt_dimension_value *pos, ++ int idx); ++ ++/** ++ * Process a atsc_rrt_section. ++ * ++ * @param section Pointer to anj atsc_section_psip structure. ++ * @return atsc_rrt_section pointer, or NULL on error. ++ */ ++struct atsc_rrt_section *atsc_rrt_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the rating_region field of an RRT. ++ * ++ * @param rrt RRT pointer. ++ * @return The transport_stream_id. ++ */ ++static inline uint8_t atsc_rrt_section_rating_region(struct atsc_rrt_section *rrt) ++{ ++ return rrt->head.ext_head.table_id_ext & 0xff; ++} ++ ++/** ++ * Accessor for the rating_region_name_text field of an RRT. ++ * ++ * @param rrt RRT pointer. ++ * @return struct atsc_text pointer, or NULL. ++ */ ++static inline struct atsc_text *atsc_rrt_section_rating_region_name_text(struct atsc_rrt_section *rrt) ++{ ++ if (rrt->rating_region_name_length == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) rrt) + sizeof(struct atsc_rrt_section)); ++} ++ ++/** ++ * Accessor for the part2 field of an RRT. ++ * ++ * @param rrt RRT pointer. ++ * @return struct atsc_rrt_section_part2 pointer. ++ */ ++static inline struct atsc_rrt_section_part2 *atsc_rrt_section_part2(struct atsc_rrt_section *rrt) ++{ ++ return (struct atsc_rrt_section_part2 *) ++ (((uint8_t*) rrt) + sizeof(struct atsc_rrt_section) + ++ rrt->rating_region_name_length); ++} ++ ++/** ++ * Iterator for the dimensions field in an atsc_rrt_section_part2. ++ * ++ * @param rrt atsc_rrt_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_rrt_dimension. ++ * @param idx Integer used to count which dimension we are in. ++ */ ++#define atsc_rrt_section_dimensions_for_each(rrt, pos, idx) \ ++ for ((pos) = atsc_rrt_section_dimensions_first(rrt), idx=0; \ ++ (pos); \ ++ (pos) = atsc_rrt_section_dimensions_next(rrt, pos, ++idx)) ++ ++/** ++ * Accessor for the dimension_name_text field of an atsc_rrt_dimension. ++ * ++ * @param dimension atsc_rrt_dimension pointer. ++ * @return struct atsc_text pointer, or NULL on error. ++ */ ++static inline struct atsc_text *atsc_rrt_dimension_name_text(struct atsc_rrt_dimension *dimension) ++{ ++ if (dimension->dimension_name_length == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) dimension) + sizeof(struct atsc_rrt_dimension)); ++} ++ ++/** ++ * Accessor for the part2 field of an atsc_rrt_dimension. ++ * ++ * @param dimension atsc_rrt_dimension pointer. ++ * @return struct atsc_rrt_dimension_part2 pointer. ++ */ ++static inline struct atsc_rrt_dimension_part2 *atsc_rrt_dimension_part2(struct atsc_rrt_dimension *dimension) ++{ ++ return (struct atsc_rrt_dimension_part2 *) ++ (((uint8_t*) dimension) + ++ sizeof(struct atsc_rrt_dimension) + ++ dimension->dimension_name_length); ++} ++ ++/** ++ * Iterator for the values field in a atsc_rrt_dimension_part2 structure. ++ * ++ * @param part2 atsc_rrt_dimension_part2 pointer. ++ * @param pos Variable containing a pointer to the current value. ++ * @param idx Integer used to count which value we are in ++ */ ++#define atsc_rrt_dimension_part2_values_for_each(part2, pos, idx) \ ++ for ((pos) = atsc_rrt_dimension_part2_values_first(part2), idx=0; \ ++ (pos); \ ++ (pos) = atsc_rrt_dimension_part2_values_next(part2, pos, ++idx)) ++ ++/** ++ * Accessor for the dimension_name_text field of an atsc_rrt_dimension. ++ * ++ * @param dimension atsc_rrt_dimension pointer. ++ * @return struct atsc_text pointer. ++ */ ++static inline struct atsc_text * ++ atsc_rrt_dimension_value_abbrev_rating_value_text(struct atsc_rrt_dimension_value *value) ++{ ++ if (value->abbrev_rating_value_length == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) value) + sizeof(struct atsc_rrt_dimension_value)); ++} ++ ++/** ++ * Accessor for the part2 field of an atsc_rrt_dimension_value. ++ * ++ * @param value atsc_rrt_dimension_value pointer. ++ * @return struct atsc_rrt_dimension_value_part2 pointer. ++ */ ++static inline struct atsc_rrt_dimension_value_part2 *atsc_rrt_dimension_value_part2(struct atsc_rrt_dimension_value *value) ++{ ++ return (struct atsc_rrt_dimension_value_part2 *) ++ (((uint8_t*) value) + ++ sizeof(struct atsc_rrt_dimension_value) + ++ value->abbrev_rating_value_length); ++} ++ ++/** ++ * Accessor for the rating_value_text field of an atsc_rrt_dimension_value_part2. ++ * ++ * @param part2 atsc_rrt_dimension_value_part2 pointer. ++ * @return struct atsc_text pointer. ++ */ ++static inline struct atsc_text *atsc_rrt_dimension_value_part2_rating_value_text(struct atsc_rrt_dimension_value_part2 *part2) ++{ ++ if (part2->rating_value_length == 0) ++ return NULL; ++ ++ return (struct atsc_text*)(((uint8_t*) part2) + sizeof(struct atsc_rrt_dimension_value_part2)); ++} ++ ++/** ++ * Accessor for the third part of an atsc_rrt_section. ++ * ++ * @param part2 atsc_rrt_section_part2 pointer. ++ * @return atsc_rrt_section_part3 pointer. ++ */ ++static inline struct atsc_rrt_section_part3 * ++ atsc_rrt_section_part3(struct atsc_rrt_section_part2 *part2) ++{ ++ int pos = sizeof(struct atsc_rrt_section_part2); ++ ++ struct atsc_rrt_dimension *cur_dimension; ++ int idx; ++ atsc_rrt_section_dimensions_for_each(part2, cur_dimension, idx) { ++ pos += sizeof(struct atsc_rrt_dimension); ++ pos += cur_dimension->dimension_name_length; ++ pos += sizeof(struct atsc_rrt_dimension_part2); ++ ++ // now we need to iterate over the values. yuck ++ struct atsc_rrt_dimension_part2 *dpart2 = atsc_rrt_dimension_part2(cur_dimension); ++ struct atsc_rrt_dimension_value *cur_value; ++ int vidx; ++ atsc_rrt_dimension_part2_values_for_each(dpart2, cur_value, vidx) { ++ pos += sizeof(struct atsc_rrt_dimension_value); ++ pos += cur_value->abbrev_rating_value_length; ++ ++ struct atsc_rrt_dimension_value_part2 *vpart2 = atsc_rrt_dimension_value_part2(cur_value); ++ pos += sizeof(struct atsc_rrt_dimension_value_part2); ++ pos += vpart2->rating_value_length; ++ } ++ } ++ ++ return (struct atsc_rrt_section_part3 *) (((uint8_t*) part2) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_rrt_section structure. ++ * ++ * @param part3 atsc_rrt_section_part3 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_rrt_section_part3_descriptors_for_each(part3, pos) \ ++ for ((pos) = atsc_rrt_section_part3_descriptors_first(part3); \ ++ (pos); \ ++ (pos) = atsc_rrt_section_part3_descriptors_next(part3, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_rrt_dimension * ++ atsc_rrt_section_dimensions_first(struct atsc_rrt_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_rrt_section_part2); ++ ++ if (part2->dimensions_defined == 0) ++ return NULL; ++ ++ return (struct atsc_rrt_dimension*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct atsc_rrt_dimension * ++ atsc_rrt_section_dimensions_next(struct atsc_rrt_section_part2 *part2, ++ struct atsc_rrt_dimension *pos, ++ int idx) ++{ ++ if (idx >= part2->dimensions_defined) ++ return NULL; ++ ++ struct atsc_rrt_dimension_part2 *dpart2 = atsc_rrt_dimension_part2(pos); ++ int len = sizeof(struct atsc_rrt_dimension_part2); ++ ++ // now we need to iterate over the values. yuck ++ struct atsc_rrt_dimension_value *cur_value; ++ int vidx; ++ atsc_rrt_dimension_part2_values_for_each(dpart2, cur_value, vidx) { ++ len += sizeof(struct atsc_rrt_dimension_value); ++ len += cur_value->abbrev_rating_value_length; ++ ++ struct atsc_rrt_dimension_value_part2 *vpart2 = atsc_rrt_dimension_value_part2(cur_value); ++ len += sizeof(struct atsc_rrt_dimension_value_part2); ++ len += vpart2->rating_value_length; ++ } ++ ++ return (struct atsc_rrt_dimension *) (((uint8_t*) dpart2) + len); ++} ++ ++static inline struct atsc_rrt_dimension_value * ++ atsc_rrt_dimension_part2_values_first(struct atsc_rrt_dimension_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_rrt_dimension_part2); ++ ++ if (part2->values_defined == 0) ++ return NULL; ++ ++ return (struct atsc_rrt_dimension_value*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct atsc_rrt_dimension_value * ++ atsc_rrt_dimension_part2_values_next(struct atsc_rrt_dimension_part2 *part2, ++ struct atsc_rrt_dimension_value *pos, ++ int idx) ++{ ++ if (idx >= part2->values_defined) ++ return NULL; ++ ++ struct atsc_rrt_dimension_value_part2 *vpart2 = atsc_rrt_dimension_value_part2(pos); ++ int len = sizeof(struct atsc_rrt_dimension_value_part2); ++ len += vpart2->rating_value_length; ++ ++ return (struct atsc_rrt_dimension_value *) (((uint8_t*) vpart2) + len); ++} ++ ++static inline struct descriptor * ++ atsc_rrt_section_part3_descriptors_first(struct atsc_rrt_section_part3 *part3) ++{ ++ size_t pos = sizeof(struct atsc_rrt_section_part3); ++ ++ if (part3->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part3) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_rrt_section_part3_descriptors_next(struct atsc_rrt_section_part3 *part3, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part3 + sizeof(struct atsc_rrt_section_part3), ++ part3->descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/section.h dvb-apps/lib/libucsi/atsc/section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,84 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifndef _UCSI_ATSC_SECTION_H ++#define _UCSI_ATSC_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#define ATSC_BASE_PID 0x1ffb ++ ++/** ++ * Enumeration of ATSC section tags. ++ */ ++enum atsc_section_tag { ++ stag_atsc_master_guide = 0xc7, ++ stag_atsc_terrestrial_virtual_channel = 0xc8, ++ stag_atsc_cable_virtual_channel = 0xc9, ++ stag_atsc_rating_region = 0xca, ++ stag_atsc_event_information = 0xcb, ++ stag_atsc_extended_text = 0xcc, ++ stag_atsc_system_time = 0xcd, ++}; ++ ++/** ++ * ATSC specific PSIP section structure. ++ */ ++struct atsc_section_psip { ++ struct section_ext ext_head; ++ uint8_t protocol_version; ++} __ucsi_packed; ++ ++/** ++ * Decode a PSIP section structure. ++ * ++ * @param section_ext Pointer to the processed section_ext structure. ++ * @return Pointer to the parsed section_psip structure, or NULL if invalid. ++ */ ++static inline struct atsc_section_psip *atsc_section_psip_decode(struct section_ext *section_ext) ++{ ++ size_t len = section_ext_length(section_ext); ++ if (len < sizeof(struct atsc_section_psip)) { ++ return NULL; ++ } ++ ++ return (struct atsc_section_psip *) section_ext; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/service_location_descriptor.h dvb-apps/lib/libucsi/atsc/service_location_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/service_location_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/service_location_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,141 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_SERVICE_LOCATION_DESCRIPTOR ++#define _UCSI_ATSC_SERVICE_LOCATION_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++enum atsc_stream_types { ++ ATSC_STREAM_TYPE_VIDEO = 0x02, ++ ATSC_STREAM_TYPE_AUDIO = 0x81, ++}; ++ ++/** ++ * atsc_service_location_descriptor structure. ++ */ ++struct atsc_service_location_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint16_t reserved : 3; , ++ uint16_t PCR_PID :13; ); ++ uint8_t number_elements; ++ /* struct atsc_service_location_element elements[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the elements field of an atsc_service_location_descriptor. ++ */ ++struct atsc_caption_service_location_element { ++ uint8_t stream_type; ++ EBIT2(uint16_t reserved : 3; , ++ uint16_t elementary_PID :13; ); ++ iso639lang_t language_code; ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_service_location_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_service_location_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_service_location_descriptor* ++ atsc_service_location_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_service_location_descriptor *ret = ++ (struct atsc_service_location_descriptor *) d; ++ uint8_t *buf = (uint8_t*) d + 2; ++ int pos = 0; ++ int idx; ++ ++ if (d->len < 3) ++ return NULL; ++ bswap16(buf + pos); ++ pos+=3; ++ ++ for(idx = 0; idx < ret->number_elements; idx++) { ++ if (d->len < (pos + sizeof(struct atsc_caption_service_entry))) ++ return NULL; ++ ++ bswap16(buf+pos+1); ++ ++ pos += sizeof(struct atsc_caption_service_entry); ++ } ++ ++ return (struct atsc_service_location_descriptor*) d; ++} ++ ++/** ++ * Iterator for elements field of a atsc_service_location_descriptor. ++ * ++ * @param d atsc_service_location_descriptor pointer. ++ * @param pos Variable holding a pointer to the current atsc_service_location_element. ++ * @param idx Integer used to count which dimension we are in. ++ */ ++#define atsc_service_location_descriptor_elements_for_each(d, pos, idx) \ ++ for ((pos) = atsc_service_location_descriptor_elements_first(d), idx=0; \ ++ (pos); \ ++ (pos) = atsc_service_location_descriptor_elements_next(d, pos, ++idx)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_caption_service_location_element* ++ atsc_service_location_descriptor_elements_first(struct atsc_service_location_descriptor *d) ++{ ++ if (d->number_elements == 0) ++ return NULL; ++ ++ return (struct atsc_caption_service_location_element *) ++ ((uint8_t*) d + sizeof(struct atsc_service_location_descriptor)); ++} ++ ++static inline struct atsc_caption_service_location_element* ++ atsc_service_location_descriptor_elements_next(struct atsc_service_location_descriptor *d, ++ struct atsc_caption_service_location_element *pos, ++ int idx) ++{ ++ uint8_t *next = (uint8_t *) pos + sizeof(struct atsc_caption_service_location_element); ++ ++ if (idx >= d->number_elements) ++ return NULL; ++ return (struct atsc_caption_service_location_element *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stt_section.c dvb-apps/lib/libucsi/atsc/stt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/stt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,42 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_stt_section *atsc_stt_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t *buf = (uint8_t *) psip; ++ size_t pos = sizeof(struct atsc_section_psip); ++ size_t len = section_ext_length(&(psip->ext_head)); ++ ++ if (len < sizeof(struct atsc_stt_section)) ++ return NULL; ++ ++ bswap32(buf + pos); ++ pos += 5; ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if (verify_descriptors(buf + pos, len - sizeof(struct atsc_stt_section))) ++ return NULL; ++ ++ return (struct atsc_stt_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stt_section.h dvb-apps/lib/libucsi/atsc/stt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/stt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,105 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_STT_SECTION_H ++#define _UCSI_ATSC_STT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * atsc_stt_section structure. ++ */ ++struct atsc_stt_section { ++ struct atsc_section_psip head; ++ ++ atsctime_t system_time; ++ uint8_t gps_utc_offset; ++ EBIT4(uint16_t DS_status : 1; , ++ uint16_t reserved : 2; , ++ uint16_t DS_day_of_month : 5; , ++ uint16_t DS_hour : 8; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a atsc_stt_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_stt_section pointer, or NULL on error. ++ */ ++struct atsc_stt_section *atsc_stt_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Iterator for the services field in a atsc_stt_section. ++ * ++ * @param stt atsc_stt_section pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_stt_section_descriptors_for_each(stt, pos) \ ++ for ((pos) = atsc_stt_section_descriptors_first(stt); \ ++ (pos); \ ++ (pos) = atsc_stt_section_descriptors_next(stt, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ atsc_stt_section_descriptors_first(struct atsc_stt_section *stt) ++{ ++ size_t pos = sizeof(struct atsc_stt_section); ++ ++ if (pos >= section_ext_length(&stt->head.ext_head)) ++ return NULL; ++ ++ return (struct descriptor*) ((uint8_t *) stt + pos); ++} ++ ++static inline struct descriptor * ++ atsc_stt_section_descriptors_next(struct atsc_stt_section *stt, ++ struct descriptor *pos) ++{ ++ int len = section_ext_length(&stt->head.ext_head); ++ len -= sizeof(struct atsc_stt_section); ++ ++ return next_descriptor((uint8_t*) stt + sizeof(struct atsc_stt_section), ++ len, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stuffing_descriptor.h dvb-apps/lib/libucsi/atsc/stuffing_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/stuffing_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/stuffing_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_atsc@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_STUFFING_DESCRIPTOR ++#define _UCSI_ATSC_STUFFING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * atsc_stuffing_descriptor. ++ */ ++struct atsc_stuffing_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a atsc_stuffing_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return atsc_stuffing_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_stuffing_descriptor* ++ atsc_stuffing_descriptor_codec(struct descriptor* d) ++{ ++ return (struct atsc_stuffing_descriptor*) d; ++} ++ ++/** ++ * Retrieve a pointer to the data field of a atsc_stuffing_descriptor. ++ * ++ * @param d atsc_stuffing_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ atsc_stuffing_descriptor_data(struct atsc_stuffing_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct atsc_stuffing_descriptor); ++} ++ ++/** ++ * Calculate length of the data field of a atsc_stuffing_descriptor. ++ * ++ * @param d atsc_stuffing_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ atsc_stuffing_descriptor_data_length(struct atsc_stuffing_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/time_shifted_service_descriptor.h dvb-apps/lib/libucsi/atsc/time_shifted_service_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/time_shifted_service_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/time_shifted_service_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,136 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_TIME_SHIFTED_SERVICE_DESCRIPTOR ++#define _UCSI_ATSC_TIME_SHIFTED_SERVICE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * atsc_time_shifted_service_descriptor structure. ++ */ ++struct atsc_time_shifted_service_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 3; , ++ uint8_t number_of_services : 5; ); ++ /* struct atsc_time_shifted_service services[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the services field of an atsc_time_shifted_service_descriptor. ++ */ ++struct atsc_time_shifted_service { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t time_shift :10; ); ++ EBIT3(uint32_t reserved2 : 4; , ++ uint32_t major_channel_number :10; , ++ uint32_t minor_channel_number :10; ); ++} __ucsi_packed; ++ ++/** ++ * Process an atsc_time_shifted_service_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return atsc_time_shifted_service_descriptor pointer, or NULL on error. ++ */ ++static inline struct atsc_time_shifted_service_descriptor* ++ atsc_time_shifted_service_descriptor_codec(struct descriptor* d) ++{ ++ struct atsc_time_shifted_service_descriptor *ret = ++ (struct atsc_time_shifted_service_descriptor *) d; ++ uint8_t *buf = (uint8_t*) d + 2; ++ int pos = 0; ++ int idx; ++ ++ if (d->len < 1) ++ return NULL; ++ pos++; ++ ++ for(idx = 0; idx < ret->number_of_services; idx++) { ++ if (d->len < (pos + sizeof(struct atsc_time_shifted_service))) ++ return NULL; ++ ++ bswap16(buf+pos); ++ bswap24(buf+pos+2); ++ ++ pos += sizeof(struct atsc_time_shifted_service); ++ } ++ ++ return (struct atsc_time_shifted_service_descriptor*) d; ++} ++ ++/** ++ * Iterator for services field of a atsc_time_shifted_service_descriptor. ++ * ++ * @param d atsc_time_shifted_service_descriptor pointer. ++ * @param pos Variable holding a pointer to the current atsc_service_location_element. ++ * @param idx Integer used to count which service we are in. ++ */ ++#define atsc_time_shifted_service_descriptor_services_for_each(d, pos, idx) \ ++ for ((pos) = atsc_time_shifted_service_descriptor_services_first(d), idx=0; \ ++ (pos); \ ++ (pos) = atsc_time_shifted_service_descriptor_services_next(d, pos, ++idx)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_time_shifted_service* ++ atsc_time_shifted_service_descriptor_services_first(struct atsc_time_shifted_service_descriptor *d) ++{ ++ if (d->number_of_services == 0) ++ return NULL; ++ ++ return (struct atsc_time_shifted_service *) ++ ((uint8_t*) d + sizeof(struct atsc_time_shifted_service_descriptor)); ++} ++ ++static inline struct atsc_time_shifted_service* ++ atsc_time_shifted_service_descriptor_services_next(struct atsc_time_shifted_service_descriptor *d, ++ struct atsc_time_shifted_service *pos, ++ int idx) ++{ ++ uint8_t *next = (uint8_t *) pos + sizeof(struct atsc_time_shifted_service); ++ ++ if (idx >= d->number_of_services) ++ return NULL; ++ return (struct atsc_time_shifted_service *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/tvct_section.c dvb-apps/lib/libucsi/atsc/tvct_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/tvct_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/tvct_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,81 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct atsc_tvct_section *atsc_tvct_section_codec(struct atsc_section_psip *psip) ++{ ++ uint8_t * buf = (uint8_t *) psip; ++ size_t pos = sizeof(struct atsc_section_psip); ++ size_t len = section_ext_length(&(psip->ext_head)); ++ int idx; ++ struct atsc_tvct_section *tvct = (struct atsc_tvct_section *) psip; ++ ++ if (len < sizeof(struct atsc_tvct_section)) ++ return NULL; ++ ++ pos++; ++ ++ for(idx =0; idx < tvct->num_channels_in_section; idx++) { ++ ++ if ((pos + sizeof(struct atsc_tvct_channel)) > len) ++ return NULL; ++ struct atsc_tvct_channel *channel = (struct atsc_tvct_channel *) (buf+pos); ++ ++ pos += 7*2; ++ ++ bswap32(buf+pos); ++ bswap32(buf+pos+4); ++ bswap16(buf+pos+8); ++ bswap16(buf+pos+10); ++ bswap16(buf+pos+12); ++ bswap16(buf+pos+14); ++ bswap16(buf+pos+16); ++ pos+=18; ++ ++ if ((pos + channel->descriptors_length) > len) ++ return NULL; ++ if (verify_descriptors(buf + pos, channel->descriptors_length)) ++ return NULL; ++ ++ pos += channel->descriptors_length; ++ } ++ ++ if ((pos + sizeof(struct atsc_tvct_section_part2)) > len) ++ return NULL; ++ struct atsc_tvct_section_part2 *part2 = (struct atsc_tvct_section_part2 *) (buf+pos); ++ ++ bswap16(buf+pos); ++ pos+=2; ++ ++ if ((pos + part2->descriptors_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, part2->descriptors_length)) ++ return NULL; ++ ++ pos += part2->descriptors_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct atsc_tvct_section *) psip; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/tvct_section.h dvb-apps/lib/libucsi/atsc/tvct_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/tvct_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/tvct_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,227 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_TVCT_SECTION_H ++#define _UCSI_ATSC_TVCT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * atsc_tvct_section structure. ++ */ ++struct atsc_tvct_section { ++ struct atsc_section_psip head; ++ ++ uint8_t num_channels_in_section; ++ /* struct atsc_tvct_channel channels[] */ ++ /* struct atsc_tvct_channel_part2 part2 */ ++} __ucsi_packed; ++ ++struct atsc_tvct_channel { ++ uint16_t short_name[7]; // UTF-16 network ordered ++ EBIT4(uint32_t reserved : 4; , ++ uint32_t major_channel_number :10; , ++ uint32_t minor_channel_number :10; , ++ uint32_t modulation_mode : 8; ); ++ uint32_t carrier_frequency; ++ uint16_t channel_TSID; ++ uint16_t program_number; ++ EBIT7(uint16_t ETM_location : 2; , ++ uint16_t access_controlled : 1; , ++ uint16_t hidden : 1; , ++ uint16_t reserved1 : 2; , ++ uint16_t hide_guide : 1; , ++ uint16_t reserved2 : 3; , ++ uint16_t service_type : 6; ); ++ uint16_t source_id; ++ EBIT2(uint16_t reserved3 : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct atsc_tvct_section_part2 { ++ EBIT2(uint16_t reserved : 6; , ++ uint16_t descriptors_length :10; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++static inline struct atsc_tvct_channel *atsc_tvct_section_channels_first(struct atsc_tvct_section *tvct); ++static inline struct atsc_tvct_channel * ++ atsc_tvct_section_channels_next(struct atsc_tvct_section *tvct, struct atsc_tvct_channel *pos, int idx); ++ ++/** ++ * Process a atsc_tvct_section. ++ * ++ * @param section Pointer to an atsc_section_psip structure. ++ * @return atsc_tvct_section pointer, or NULL on error. ++ */ ++struct atsc_tvct_section *atsc_tvct_section_codec(struct atsc_section_psip *section); ++ ++/** ++ * Accessor for the transport_stream_id field of a TVCT. ++ * ++ * @param tvct TVCT pointer. ++ * @return The transport_stream_id. ++ */ ++static inline uint16_t atsc_tvct_section_transport_stream_id(struct atsc_tvct_section *tvct) ++{ ++ return tvct->head.ext_head.table_id_ext; ++} ++ ++/** ++ * Iterator for the channels field in an atsc_tvct_section. ++ * ++ * @param mgt atsc_tvct_section pointer. ++ * @param pos Variable containing a pointer to the current atsc_tvct_channel. ++ * @param idx Integer used to count which channel we in. ++ */ ++#define atsc_tvct_section_channels_for_each(mgt, pos, idx) \ ++ for ((pos) = atsc_tvct_section_channels_first(mgt), idx=0; \ ++ (pos); \ ++ (pos) = atsc_tvct_section_channels_next(mgt, pos, ++idx)) ++ ++/** ++ * Iterator for the descriptors field in a atsc_tvct_channel structure. ++ * ++ * @param channel atsc_tvct_channel pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_tvct_channel_descriptors_for_each(channel, pos) \ ++ for ((pos) = atsc_tvct_channel_descriptors_first(channel); \ ++ (pos); \ ++ (pos) = atsc_tvct_channel_descriptors_next(channel, pos)) ++ ++/** ++ * Accessor for the second part of an atsc_tvct_section. ++ * ++ * @param mgt atsc_tvct_section pointer. ++ * @return atsc_tvct_section_part2 pointer. ++ */ ++static inline struct atsc_tvct_section_part2 * ++ atsc_tvct_section_part2(struct atsc_tvct_section *mgt) ++{ ++ int pos = sizeof(struct atsc_tvct_section); ++ ++ struct atsc_tvct_channel *cur_channel; ++ int idx; ++ atsc_tvct_section_channels_for_each(mgt, cur_channel, idx) { ++ pos += sizeof(struct atsc_tvct_channel); ++ pos += cur_channel->descriptors_length; ++ } ++ ++ return (struct atsc_tvct_section_part2 *) (((uint8_t*) mgt) + pos); ++} ++ ++/** ++ * Iterator for the descriptors field in a atsc_tvct_section structure. ++ * ++ * @param part2 atsc_tvct_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define atsc_tvct_section_part2_descriptors_for_each(part2, pos) \ ++ for ((pos) = atsc_tvct_section_part2_descriptors_first(part2); \ ++ (pos); \ ++ (pos) = atsc_tvct_section_part2_descriptors_next(part2, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_tvct_channel * ++ atsc_tvct_section_channels_first(struct atsc_tvct_section *tvct) ++{ ++ size_t pos = sizeof(struct atsc_tvct_section); ++ ++ if (tvct->num_channels_in_section == 0) ++ return NULL; ++ ++ return (struct atsc_tvct_channel*) (((uint8_t *) tvct) + pos); ++} ++ ++static inline struct atsc_tvct_channel * ++ atsc_tvct_section_channels_next(struct atsc_tvct_section *tvct, ++ struct atsc_tvct_channel *pos, ++ int idx) ++{ ++ if (idx >= tvct->num_channels_in_section) ++ return NULL; ++ ++ return (struct atsc_tvct_channel *) ++ (((uint8_t*) pos) + sizeof(struct atsc_tvct_channel) + pos->descriptors_length); ++} ++ ++static inline struct descriptor * ++ atsc_tvct_channel_descriptors_first(struct atsc_tvct_channel *channel) ++{ ++ size_t pos = sizeof(struct atsc_tvct_channel); ++ ++ if (channel->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) channel) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_tvct_channel_descriptors_next(struct atsc_tvct_channel *channel, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) channel + sizeof(struct atsc_tvct_channel), ++ channel->descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ atsc_tvct_section_part2_descriptors_first(struct atsc_tvct_section_part2 *part2) ++{ ++ size_t pos = sizeof(struct atsc_tvct_section_part2); ++ ++ if (part2->descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor*) (((uint8_t *) part2) + pos); ++} ++ ++static inline struct descriptor * ++ atsc_tvct_section_part2_descriptors_next(struct atsc_tvct_section_part2 *part2, ++ struct descriptor *pos) ++{ ++ return next_descriptor((uint8_t*) part2 + sizeof(struct atsc_tvct_section_part2), ++ part2->descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/types.c dvb-apps/lib/libucsi/atsc/types.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/types.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/types.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,71 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include "libucsi/atsc/types.h" ++ ++/* GPS epoch == unix time_t at 06/Jan/1980 */ ++#define GPS_EPOCH 315964800 ++ ++ ++int atsc_text_validate(uint8_t *buf, int len) ++{ ++ int i; ++ int j; ++ int number_strings; ++ int number_segments; ++ int number_bytes; ++ int pos = 0; ++ ++ if (len == 0) ++ return 0; ++ number_strings = buf[pos]; ++ pos++; ++ ++ for(i=0; i< number_strings; i++) { ++ if (len < (pos+4)) ++ return -1; ++ number_segments = buf[pos+3]; ++ pos+=4; ++ ++ for(j=0; j < number_segments; j++) { ++ if (len < (pos+3)) ++ return -1; ++ number_bytes = buf[pos+2]; ++ pos+=3; ++ ++ if (len < (pos + number_bytes)) ++ return -1; ++ pos += number_bytes; ++ } ++ } ++ ++ return 0; ++} ++ ++time_t atsctime_to_unixtime(atsctime_t atsc) ++{ ++ return atsc + GPS_EPOCH; ++} ++ ++atsctime_t unixtime_to_atsctime(time_t t) ++{ ++ return t - GPS_EPOCH; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/types.h dvb-apps/lib/libucsi/atsc/types.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/atsc/types.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/atsc/types.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,227 @@ ++ /* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_ATSC_TYPES_H ++#define _UCSI_ATSC_TYPES_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++enum atsc_vct_modulation { ++ ATSC_VCT_MODULATION_ANALOG = 0x01, ++ ATSC_VCT_MODULATION_SCTE_MODE1 = 0x02, ++ ATSC_VCT_MODULATION_SCTE_MODE2 = 0x03, ++ ATSC_VCT_MODULATION_8VSB = 0x04, ++ ATSC_VCT_MODULATION_16VSB = 0x05, ++}; ++ ++enum atsc_vct_service_type { ++ ATSC_VCT_SERVICE_TYPE_ANALOG = 0x01, ++ ATSC_VCT_SERVICE_TYPE_TV = 0x02, ++ ATSC_VCT_SERVICE_TYPE_AUDIO = 0x03, ++ ATSC_VCT_SERVICE_TYPE_DATA = 0x04, ++}; ++ ++enum atsc_etm_location { ++ ATSC_VCT_ETM_NONE = 0x00, ++ ATSC_VCT_ETM_IN_THIS_PTC = 0x01, ++ ATSC_VCT_ETM_IN_CHANNEL_TSID = 0x02, ++}; ++ ++enum atsc_text_compress_type { ++ ATSC_TEXT_COMPRESS_NONE = 0x00, ++ ATSC_TEXT_COMPRESS_PROGRAM_TITLE = 0x01, ++ ATSC_TEXT_COMPRESS_PROGRAM_DESCRIPTION = 0x02, ++}; ++ ++enum atsc_text_segment_mode { ++ ATSC_TEXT_SEGMENT_MODE_UNICODE_RANGE_MIN = 0x00, ++ ATSC_TEXT_SEGMENT_MODE_UNICODE_RANGE_MAX = 0x33, ++ ATSC_TEXT_SEGMENT_MODE_SCSU = 0x3e, ++ ATSC_TEXT_SEGMENT_MODE_UTF16 = 0x3f, ++ ATSC_TEXT_SEGMENT_MODE_TAIWAN_BITMAP = 0x40, ++ ATSC_TEXT_SEGMENT_MODE_TAIWAN_CODEWORD_BITMAP = 0x41, ++}; ++ ++typedef uint32_t atsctime_t; ++ ++struct atsc_text { ++ uint8_t number_strings; ++ /* struct atsc_text_string strings[] */ ++}; ++ ++struct atsc_text_string { ++ iso639lang_t language_code; ++ uint8_t number_segments; ++ /* struct atsc_text_string_segment segments[] */ ++}; ++ ++struct atsc_text_string_segment { ++ uint8_t compression_type; ++ uint8_t mode; ++ uint8_t number_bytes; ++ /* uint8_t bytes[] */ ++}; ++ ++/** ++ * Iterator for strings field of an atsc_text structure. ++ * ++ * @param txt atsc_text pointer. ++ * @param pos Variable holding a pointer to the current atsc_text_string. ++ * @param idx Iterator variable. ++ */ ++#define atsc_text_strings_for_each(txt, pos, idx) \ ++ for ((pos) = atsc_text_strings_first(txt), idx=0; \ ++ (pos); \ ++ (pos) = atsc_text_strings_next(txt, pos, ++idx)) ++ ++/** ++ * Iterator for segments field of an atsc_text_string structure. ++ * ++ * @param str atsc_text_string pointer. ++ * @param pos Variable holding a pointer to the current atsc_text_string_segment. ++ * @param idx Iterator variable. ++ */ ++#define atsc_text_string_segments_for_each(str, pos, idx) \ ++ for ((pos) = atsc_text_string_segments_first(str), idx=0; \ ++ (pos); \ ++ (pos) = atsc_text_string_segments_next(str, pos, ++idx)) ++ ++/** ++ * Accessor for the bytes field of an atsc_text_string_segment. ++ * ++ * @param seg atsc_text_string_segment pointer. ++ * @return Pointer to the bytes. ++ */ ++static inline uint8_t* ++ atsc_text_string_segment_bytes(struct atsc_text_string_segment *d) ++{ ++ return ((uint8_t*) d) + sizeof(struct atsc_text_string_segment); ++} ++ ++/** ++ * Validate a buffer containing an atsc_text structure. ++ * ++ * @param buf Start of the atsc_text structure. ++ * @param len Length in bytes of the buffer. ++ * @return 0 if valid, nonzero if not. ++ */ ++extern int atsc_text_validate(uint8_t *buf, int len); ++ ++/** ++ * Decodes an atsc_text_segment with mode < 0x3e. Decompression of the ATSC text encoding IS ++ * supported. The output text will be in the UTF-8 encoding. ++ * ++ * @param segment Pointer to the segment to decode. ++ * @param destbuf Pointer to the malloc()ed buffer to append text to (pass NULL if none). ++ * @param destbufsize Size of destbuf in bytes. ++ * @param destbufpos Position within destbuf. This will be updated to point after the end of the ++ * string on exit. ++ * @return New value of destbufpos, or < 0 on error. ++ */ ++extern int atsc_text_segment_decode(struct atsc_text_string_segment *segment, ++ uint8_t **destbuf, size_t *destbufsize, size_t *destbufpos); ++ ++/** ++ * Convert from ATSC time to unix time_t. ++ * ++ * @param atsc ATSC time. ++ * @return The time value. ++ */ ++extern time_t atsctime_to_unixtime(atsctime_t atsc); ++ ++/** ++ * Convert from unix time_t to atsc time. ++ * ++ * @param t unix time_t. ++ * @return The atsc time value. ++ */ ++extern atsctime_t unixtime_to_atsctime(time_t t); ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct atsc_text_string* ++ atsc_text_strings_first(struct atsc_text *txt) ++{ ++ if (txt->number_strings == 0) ++ return NULL; ++ ++ return (struct atsc_text_string *) ++ ((uint8_t*) txt + sizeof(struct atsc_text)); ++} ++ ++static inline struct atsc_text_string* ++ atsc_text_strings_next(struct atsc_text *txt, struct atsc_text_string *pos, int idx) ++{ ++ int i; ++ uint8_t *buf; ++ ++ if (idx >= txt->number_strings) ++ return NULL; ++ ++ buf = ((uint8_t*) pos) + sizeof(struct atsc_text_string); ++ for(i=0; i < pos->number_segments; i++) { ++ struct atsc_text_string_segment *seg = ++ (struct atsc_text_string_segment *) buf; ++ ++ buf += sizeof(struct atsc_text_string_segment); ++ buf += seg->number_bytes; ++ } ++ ++ return (struct atsc_text_string *) buf; ++} ++ ++static inline struct atsc_text_string_segment* ++ atsc_text_string_segments_first(struct atsc_text_string *str) ++{ ++ if (str->number_segments == 0) ++ return NULL; ++ ++ return (struct atsc_text_string_segment *) ++ ((uint8_t*) str + sizeof(struct atsc_text_string)); ++} ++ ++static inline struct atsc_text_string_segment* ++ atsc_text_string_segments_next(struct atsc_text_string *str, ++ struct atsc_text_string_segment *pos, int idx) ++{ ++ if (idx >= str->number_segments) ++ return NULL; ++ ++ return (struct atsc_text_string_segment *) ++ (((uint8_t*) pos) + sizeof(struct atsc_text_string_segment) + pos->number_bytes); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/crc32.c dvb-apps/lib/libucsi/crc32.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/crc32.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/crc32.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,89 @@ ++/** ++ * crc32 calculation routines. ++ * ++ * Copyright (c) 2005 by Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++uint32_t crc32tbl[] = ++{ ++ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, ++ 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, ++ 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, ++ 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, ++ 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, ++ 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, ++ 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, ++ 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, ++ 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, ++ 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, ++ 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, ++ 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, ++ 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, ++ 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, ++ 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, ++ 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, ++ 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, ++ 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, ++ 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, ++ 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, ++ 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, ++ 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, ++ 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, ++ 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, ++ 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, ++ 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, ++ 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, ++ 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, ++ 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, ++ 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, ++ 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, ++ 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, ++ 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, ++ 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, ++ 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, ++ 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, ++ 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, ++ 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, ++ 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, ++ 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, ++ 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, ++ 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, ++ 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, ++ 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, ++ 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, ++ 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, ++ 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, ++ 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, ++ 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, ++ 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, ++ 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, ++ 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, ++ 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, ++ 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, ++ 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, ++ 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, ++ 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, ++ 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, ++ 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, ++ 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, ++ 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, ++ 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, ++ 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, ++ 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 ++}; +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/crc32.h dvb-apps/lib/libucsi/crc32.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/crc32.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/crc32.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,58 @@ ++/** ++ * crc32 calculation routines. ++ * ++ * Copyright (c) 2005 by Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_CRC32_H ++#define _UCSI_CRC32_H 1 ++ ++#include ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#define CRC32_INIT (~0) ++ ++extern uint32_t crc32tbl[]; ++ ++/** ++ * Calculate a CRC32 over a piece of data. ++ * ++ * @param crc Current CRC value (use CRC32_INIT for first call). ++ * @param buf Buffer to calculate over. ++ * @param len Number of bytes. ++ * @return Calculated CRC. ++ */ ++static inline uint32_t crc32(uint32_t crc, uint8_t* buf, size_t len) ++{ ++ size_t i; ++ ++ for (i=0; i< len; i++) { ++ crc = (crc << 8) ^ crc32tbl[((crc >> 24) ^ buf[i]) & 0xff]; ++ } ++ ++ return crc; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/descriptor.h dvb-apps/lib/libucsi/descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,129 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DESCRIPTOR_H ++#define _UCSI_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Generic descriptor header. ++ */ ++struct descriptor { ++ uint8_t tag; ++ uint8_t len; ++} __ucsi_packed; ++ ++/** ++ * Retreive pointer to the next descriptor structure. ++ * ++ * @param buf The buffer of descriptors. ++ * @param len Size of the buffer. ++ * @param pos Current descriptor. ++ * @return Pointer to next descriptor, or NULL if there are none. ++ */ ++static inline struct descriptor * ++ next_descriptor(uint8_t * buf, size_t len, struct descriptor * pos) ++{ ++ uint8_t* next; ++ ++ if (pos == NULL) ++ return NULL; ++ ++ next = (uint8_t*) pos + 2 + pos->len; ++ if (next >= buf + len) ++ return NULL; ++ ++ return (struct descriptor *) next; ++} ++ ++ ++/** ++ * The unknown descriptor. ++ */ ++struct unknown_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t data [] */ ++} __ucsi_packed; ++ ++/** ++ * Retrieve pointer to the unknown descriptor's data field. ++ * ++ * @param d The descriptor. ++ * @return Pointer to the data field. ++ */ ++static inline uint8_t * ++ unknown_descriptor_data(struct unknown_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct unknown_descriptor); ++} ++ ++/** ++ * Retrieve size of unknown descriptor's data field. ++ * ++ * @param d The descriptor. ++ * @return Size of data field in bytes. ++ */ ++static inline int ++ unknown_descriptor_data_size(struct unknown_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline int verify_descriptors(uint8_t * buf, size_t len) ++{ ++ size_t pos = 0; ++ ++ while (pos < len) { ++ if ((pos + 2) > len) ++ return -1; ++ ++ pos += 2 + buf[pos+1]; ++ } ++ ++ if (pos != len) ++ return -1; ++ ++ return 0; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ac3_descriptor.h dvb-apps/lib/libucsi/dvb/ac3_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ac3_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ac3_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,88 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_AC3_DESCRIPTOR ++#define _UCSI_DVB_AC3_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ac3_descriptor structure. ++ */ ++struct dvb_ac3_descriptor { ++ struct descriptor d; ++ ++ EBIT5(uint8_t ac3_type_flag : 1; , ++ uint8_t bsid_flag : 1; , ++ uint8_t mainid_flag : 1; , ++ uint8_t asvc_flag : 1; , ++ uint8_t reserved : 4; ); ++ /* uint8_t additional_info[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ac3_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_ac3_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ac3_descriptor* ++ dvb_ac3_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_ac3_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_ac3_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to additional_info field of a dvb_ac3_descriptor. ++ * ++ * @param d dvb_ac3_descriptor pointer. ++ * @return Pointer to additional_info field. ++ */ ++static inline uint8_t *dvb_ac3_descriptor_additional_info(struct dvb_ac3_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_ac3_descriptor); ++} ++ ++/** ++ * Determine length of additional_info field of a dvb_ac3_descriptor. ++ * ++ * @param d dvb_ac3_descriptor pointer. ++ * @return Length of field in bytes. ++ */ ++static inline int dvb_ac3_descriptor_additional_info_length(struct dvb_ac3_descriptor *d) ++{ ++ return d->d.len - 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/adaptation_field_data_descriptor.h dvb-apps/lib/libucsi/dvb/adaptation_field_data_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/adaptation_field_data_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/adaptation_field_data_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,62 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_ADAPTATION_FIELD_DATA_DESCRIPTOR ++#define _UCSI_DVB_ADAPTATION_FIELD_DATA_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_adaptation_field_data_descriptor structure. ++ */ ++struct dvb_adaptation_field_data_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 7; , ++ uint8_t announcement_switching_data : 1; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_adaptation_field_data_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to dvb_adaptation_field_data_descriptor, or NULL on error. ++ */ ++static inline struct dvb_adaptation_field_data_descriptor* ++ dvb_adaptation_field_data_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_adaptation_field_data_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_adaptation_field_data_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_descriptor.h dvb-apps/lib/libucsi/dvb/ait_application_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ait_application_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,204 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_AIT_APPLICATION_DESCRIPTOR ++#define _UCSI_DVB_AIT_APPLICATION_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for the visibility field. ++ */ ++enum { ++ AVB_AIT_APPLICATION_VISIBILITY_HIDDEN = 0x00, ++ AVB_AIT_APPLICATION_VISIBILITY_APPSONLY = 0x01, ++ AVB_AIT_APPLICATION_VISIBILITY_VISIBLE = 0x03, ++}; ++ ++/** ++ * dvb_ait_application_descriptor structure. ++ */ ++struct dvb_ait_application_descriptor { ++ struct descriptor d; ++ ++ uint8_t application_profiles_length; ++ /* struct dvb_ait_application_profile profiles [] */ ++ /* struct dvb_ait_application_descriptor_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the profiles field of a dvb_ait_application_descriptor. ++ */ ++struct dvb_ait_application_profile { ++ uint16_t application_profile; ++ uint8_t version_major; ++ uint8_t version_minor; ++ uint8_t version_micro; ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_ait_application_descriptor structure. ++ */ ++struct dvb_ait_application_descriptor_part2 { ++ EBIT3(uint8_t service_bound_flag : 1; , ++ uint8_t visibility : 2; , ++ uint8_t reserved : 5; ); ++ uint8_t application_priority; ++ /* uint8_t transport_protocol_label[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ait_application_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ait_application_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ait_application_descriptor* ++ dvb_ait_application_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t pos2 = 0; ++ uint32_t len = d->len + 2; ++ uint8_t* buf = (uint8_t*) d; ++ struct dvb_ait_application_descriptor *ret = ++ (struct dvb_ait_application_descriptor*) d; ++ ++ if (len < sizeof(struct dvb_ait_application_descriptor)) ++ return NULL; ++ ++ if (len < (sizeof(struct dvb_ait_application_descriptor) + ret->application_profiles_length)) ++ return NULL; ++ ++ if (ret->application_profiles_length % sizeof(struct dvb_ait_application_profile)) ++ return NULL; ++ ++ pos += sizeof(struct dvb_ait_application_descriptor); ++ pos2 = 0; ++ while(pos2 < ret->application_profiles_length) { ++ bswap16(buf + pos + pos2); ++ pos2 += sizeof(struct dvb_ait_application_descriptor); ++ } ++ pos += pos2; ++ ++ if (len < (pos + sizeof(struct dvb_ait_application_descriptor_part2))) ++ return NULL; ++ ++ return ret; ++} ++ ++/** ++ * Iterator for the profiles field of a dvb_ait_application_descriptor. ++ * ++ * @param d dvb_ait_application_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ait_application_profile. ++ */ ++#define dvb_ait_application_descriptor_profiles_for_each(d, pos) \ ++ for ((pos) = dvb_ait_application_descriptor_profiles_first(d); \ ++ (pos); \ ++ (pos) = dvb_ait_application_descriptor_profiles_next(d, pos)) ++ ++/** ++ * Accessor for the part2 field of a dvb_ait_application_descriptor. ++ * ++ * @param d dvb_ait_application_descriptor pointer. ++ * @return dvb_ait_application_descriptor_part2 pointer. ++ */ ++static inline struct dvb_ait_application_descriptor_part2* ++ dvb_ait_application_descriptor_part2(struct dvb_ait_application_descriptor* d) ++{ ++ return (struct dvb_ait_application_descriptor_part2*) ++ ((uint8_t*) d + ++ sizeof(struct dvb_ait_application_descriptor) + ++ d->application_profiles_length); ++} ++ ++/** ++ * Accessor for the transport_protocol_label field of a dvb_ait_application_descriptor_part2. ++ * ++ * @param d dvb_ait_application_descriptor_part2 pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_ait_application_descriptor_part2_transport_protocol_label(struct dvb_ait_application_descriptor_part2* d) ++{ ++ return (uint8_t*) d + ++ sizeof(struct dvb_ait_application_descriptor_part2); ++} ++ ++/** ++ * Calculate the number of bytes in the transport_protocol_label field of a dvb_ait_application_descriptor_part2. ++ * ++ * @param d dvb_ait_application_descriptor pointer. ++ * @param part2 dvb_ait_application_descriptor_part2 pointer. ++ * @return Number of bytes. ++ */ ++static inline int ++ dvb_ait_application_descriptor_part2_transport_protocol_label_length(struct dvb_ait_application_descriptor *d, ++ struct dvb_ait_application_descriptor_part2* part2) ++{ ++ uint8_t *ptr = (uint8_t*) part2 + sizeof(struct dvb_ait_application_descriptor_part2); ++ uint8_t *end = (uint8_t*) d + d->d.len + 2; ++ ++ return (int) (end - ptr); ++} ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ait_application_profile* ++ dvb_ait_application_descriptor_profiles_first(struct dvb_ait_application_descriptor *d) ++{ ++ if (d->application_profiles_length == 0) ++ return NULL; ++ ++ return (struct dvb_ait_application_profile *) ++ ((uint8_t*) d + sizeof(struct dvb_ait_application_descriptor)); ++} ++ ++static inline struct dvb_ait_application_profile* ++ dvb_ait_application_descriptor_profiles_next(struct dvb_ait_application_descriptor *d, ++ struct dvb_ait_application_profile *pos) ++{ ++ uint8_t *end = (uint8_t*) d + ++ sizeof(struct dvb_ait_application_descriptor) + ++ d->application_profiles_length; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ait_application_profile); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ait_application_profile *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_icons_descriptor.h dvb-apps/lib/libucsi/dvb/ait_application_icons_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_icons_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ait_application_icons_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,157 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_AIT_APPLICATION_ICONS_DESCRIPTOR ++#define _UCSI_DVB_AIT_APPLICATION_ICONS_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Possible values for the icon_flags field. ++ */ ++enum { ++ AIT_APPLICATION_ICON_FLAG_32_32 = 0x001, ++ AIT_APPLICATION_ICON_FLAG_32_32_43 = 0x002, ++ AIT_APPLICATION_ICON_FLAG_24_32_169 = 0x004, ++ ++ AIT_APPLICATION_ICON_FLAG_64_64 = 0x008, ++ AIT_APPLICATION_ICON_FLAG_64_64_43 = 0x010, ++ AIT_APPLICATION_ICON_FLAG_48_64_169 = 0x020, ++ ++ AIT_APPLICATION_ICON_FLAG_128_128 = 0x040, ++ AIT_APPLICATION_ICON_FLAG_128_128_43 = 0x080, ++ AIT_APPLICATION_ICON_FLAG_96_128_169 = 0x100, ++}; ++ ++/** ++ * dvb_ait_application_icons_descriptor structure. ++ */ ++struct dvb_ait_application_icons_descriptor { ++ struct descriptor d; ++ ++ uint8_t icon_locator_length; ++ /* uint8_t icon_locator[] */ ++ /* struct dvb_ait_application_icons_descriptor_part2 */ ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_ait_application_icons_descriptor. ++ */ ++struct dvb_ait_application_icons_descriptor_part2 { ++ uint16_t icon_flags; ++ /* uint8_t reserved[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ait_application_icons_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ait_application_icons_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ait_application_icons_descriptor* ++ dvb_ait_application_icons_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d; ++ uint32_t pos = 0; ++ uint32_t len = d->len + 2; ++ struct dvb_ait_application_icons_descriptor *ret = ++ (struct dvb_ait_application_icons_descriptor *) d; ++ ++ if (len < sizeof(struct dvb_ait_application_icons_descriptor)) ++ return NULL; ++ if (len < (sizeof(struct dvb_ait_application_icons_descriptor) + ret->icon_locator_length)) ++ return NULL; ++ ++ pos += sizeof(struct dvb_ait_application_icons_descriptor) + ret->icon_locator_length; ++ ++ if ((len - pos) < sizeof(struct dvb_ait_application_icons_descriptor_part2)) ++ return NULL; ++ bswap16(buf + pos); ++ ++ return ret; ++} ++/** ++ * Accessor for the icon_locator field of a dvb_ait_application_icons_descriptor. ++ * ++ * @param e dvb_ait_application_icons_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_ait_application_icons_descriptor_icon_locator(struct dvb_ait_application_icons_descriptor *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_ait_application_icons_descriptor); ++} ++ ++/** ++ * Accessor for the part2 field of a dvb_ait_application_icons_descriptor. ++ * ++ * @param e dvb_ait_application_icons_descriptor Pointer. ++ * @return dvb_ait_application_icons_descriptor_part2 pointer. ++ */ ++static inline struct dvb_ait_application_icons_descriptor_part2 * ++ dvb_ait_application_icons_descriptor_part2(struct dvb_ait_application_icons_descriptor *e) ++{ ++ return (struct dvb_ait_application_icons_descriptor_part2 *) ++ ((uint8_t *) e + sizeof(struct dvb_ait_application_icons_descriptor) + ++ e->icon_locator_length); ++} ++ ++/** ++ * Accessor for the reserved field of a dvb_ait_application_icons_descriptor_part2. ++ * ++ * @param e dvb_ait_application_icons_part2 pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_ait_application_icons_descriptor_part2_reserved(struct dvb_ait_application_icons_descriptor_part2 *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_ait_application_icons_descriptor_part2); ++} ++ ++/** ++ * Calculate the number of bytes in the reserved field of a dvb_ait_application_icons_descriptor_part2. ++ * ++ * @param d dvb_ait_application_icons_descriptorpointer. ++ * @param part2 dvb_ait_application_icons_descriptor_part2 pointer. ++ * @return Number of bytes. ++ */ ++static inline int ++ dvb_ait_application_icons_descriptor_part2_reserved_length(struct dvb_ait_application_icons_descriptor *d, ++ struct dvb_ait_application_icons_descriptor_part2* part2) ++{ ++ uint8_t *ptr = (uint8_t*) part2 + sizeof(struct dvb_ait_application_icons_descriptor_part2); ++ uint8_t *end = (uint8_t*) d + d->d.len + 2; ++ ++ return (int) (end - ptr); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_name_descriptor.h dvb-apps/lib/libucsi/dvb/ait_application_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_application_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ait_application_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,145 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_AIT_APPLICATION_NAME_DESCRIPTOR ++#define _UCSI_DVB_AIT_APPLICATION_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_ait_application_name_descriptor structure. ++ */ ++struct dvb_ait_application_name_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ait_application_name names[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the names field of a dvb_ait_application_name_descriptor. ++ */ ++struct dvb_ait_application_name { ++ iso639lang_t language_code; ++ uint8_t application_name_length; ++ /* uint8_t name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ait_application_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ait_application_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ait_application_name_descriptor* ++ dvb_ait_application_name_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_ait_application_name *e = ++ (struct dvb_ait_application_name*) (buf + pos); ++ ++ pos += sizeof(struct dvb_ait_application_name); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->application_name_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_ait_application_name_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the names field of a dvb_ait_application_name_descriptor. ++ * ++ * @param d dvb_ait_application_name_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ait_application_name. ++ */ ++#define dvb_ait_application_name_descriptor_names_for_each(d, pos) \ ++ for ((pos) = dvb_ait_application_name_descriptor_names_first(d); \ ++ (pos); \ ++ (pos) = dvb_ait_application_name_descriptor_names_next(d, pos)) ++ ++/** ++ * Accessor for the name field of a dvb_ait_application_name. ++ * ++ * @param e dvb_ait_application_name pointer. ++ * @return Pointer to the name field. ++ */ ++static inline uint8_t * ++ dvb_ait_application_name_name(struct dvb_ait_application_name *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_ait_application_name); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ait_application_name* ++ dvb_ait_application_name_descriptor_names_first(struct dvb_ait_application_name_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ait_application_name *) ++ ((uint8_t*) d + sizeof(struct dvb_ait_application_name_descriptor)); ++} ++ ++static inline struct dvb_ait_application_name* ++ dvb_ait_application_name_descriptor_names_next(struct dvb_ait_application_name_descriptor *d, ++ struct dvb_ait_application_name *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_ait_application_name) + ++ pos->application_name_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ait_application_name *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h dvb-apps/lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,125 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_AIT_EXTERNAL_APPLICATION_AUTHORISATION_DESCRIPTOR ++#define _UCSI_DVB_AIT_EXTERNAL_APPLICATION_AUTHORISATION_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_ait_external_application_authorisation_descriptor structure. ++ */ ++struct dvb_ait_external_application_authorisation_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ait_external_application_authorisation auths[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the auths field of a dvb_ait_external_application_authorisation_descriptor. ++ */ ++struct dvb_ait_external_application_authorisation { ++ uint32_t organization_id; ++ uint16_t application_id; ++ uint8_t application_priority; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ait_external_application_authorisation_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ait_external_application_authorisation_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ait_external_application_authorisation_descriptor* ++ dvb_ait_external_application_authorisation_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_ait_external_application_authorisation)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap32(buf + pos); ++ bswap32(buf + pos + 4); ++ pos += sizeof(struct dvb_ait_external_application_authorisation); ++ } ++ ++ return (struct dvb_ait_external_application_authorisation_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the auths field of a dvb_ait_external_application_authorisation_descriptor. ++ * ++ * @param d dvb_ait_external_application_authorisation_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ait_external_application_authorisation. ++ */ ++#define dvb_ait_external_application_authorisation_descriptor_auths_for_each(d, pos) \ ++ for ((pos) = dvb_ait_external_application_authorisation_descriptor_auths_first(d); \ ++ (pos); \ ++ (pos) = dvb_ait_external_application_authorisation_descriptor_auths_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ait_external_application_authorisation* ++ dvb_ait_external_application_authorisation_descriptor_auths_first(struct dvb_ait_external_application_authorisation_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ait_external_application_authorisation *) ++ ((uint8_t*) d + sizeof(struct dvb_ait_external_application_authorisation_descriptor)); ++} ++ ++static inline struct dvb_ait_external_application_authorisation* ++ dvb_ait_external_application_authorisation_descriptor_auths_next(struct dvb_ait_external_application_authorisation_descriptor *d, ++ struct dvb_ait_external_application_authorisation *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_ait_external_application_authorisation); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ait_external_application_authorisation *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ancillary_data_descriptor.h dvb-apps/lib/libucsi/dvb/ancillary_data_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ancillary_data_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ancillary_data_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,67 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_ANCILLARY_DATA_DESCRIPTOR ++#define _UCSI_DVB_ANCILLARY_DATA_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ancillary_data_descriptor structure. ++ */ ++struct dvb_ancillary_data_descriptor { ++ struct descriptor d; ++ EBIT8(uint8_t reserved : 1; , ++ uint8_t rds_via_udcp : 1; , ++ uint8_t mpeg4_ancillary_data : 1; , ++ uint8_t scale_factor_error_check : 1; , ++ uint8_t dab_ancillary_data : 1; , ++ uint8_t announcement_switching_data : 1; , ++ uint8_t extended_ancillary_data : 1; , ++ uint8_t dvd_video_ancillary_data : 1; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ancillary_data_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ancillary_data_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ancillary_data_descriptor* ++ dvb_ancillary_data_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_ancillary_data_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_ancillary_data_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/announcement_support_descriptor.h dvb-apps/lib/libucsi/dvb/announcement_support_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/announcement_support_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/announcement_support_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,219 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_ANNOUNCEMENT_SUPPORT_DESCRIPTOR ++#define _UCSI_DVB_ANNOUNCEMENT_SUPPORT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for announcement_support_indicator. ++ */ ++enum { ++ DVB_ANNOUNCEMENT_SUPPORT_EMERGENCY = 0x01, ++ DVB_ANNOUNCEMENT_SUPPORT_ROAD_TRAFFIC_FLASH = 0x02, ++ DVB_ANNOUNCEMENT_SUPPORT_PUBLIC_TRANSPORT_FLASH = 0x04, ++ DVB_ANNOUNCEMENT_SUPPORT_WARNING_MESSAGE = 0x08, ++ DVB_ANNOUNCEMENT_SUPPORT_NEWS_FLASH = 0x10, ++ DVB_ANNOUNCEMENT_SUPPORT_WEATHER_FLASH = 0x20, ++ DVB_ANNOUNCEMENT_SUPPORT_EVENT_ANNOUNCEMENT = 0x40, ++ DVB_ANNOUNCEMENT_SUPPORT_PERSONAL_CALL = 0x80, ++}; ++ ++/** ++ * Possible values for announcement_type. ++ */ ++enum { ++ DVB_ANNOUNCEMENT_TYPE_EMERGENCY = 0x00, ++ DVB_ANNOUNCEMENT_TYPE_ROAD_TRAFFIC_FLASH = 0x01, ++ DVB_ANNOUNCEMENT_TYPE_PUBLIC_TRANSPORT_FLASH = 0x02, ++ DVB_ANNOUNCEMENT_TYPE_WARNING_MESSAGE = 0x03, ++ DVB_ANNOUNCEMENT_TYPE_NEWS_FLASH = 0x04, ++ DVB_ANNOUNCEMENT_TYPE_WEATHER_FLASH = 0x05, ++ DVB_ANNOUNCEMENT_TYPE_EVENT_ANNOUNCEMENT = 0x06, ++ DVB_ANNOUNCEMENT_TYPE_PERSONAL_CALL = 0x07, ++}; ++ ++/** ++ * Possible values for reference_type. ++ */ ++enum { ++ DVB_REFERENCE_TYPE_AUDIO = 0x00, ++ DVB_REFERENCE_TYPE_OTHER_AUDIO = 0x01, ++ DVB_REFERENCE_TYPE_OTHER_SERVICE = 0x02, ++ DVB_REFERENCE_TYPE_OTHER_TS = 0x03, ++}; ++ ++/** ++ * dvb_announcement_support_descriptor structure. ++ */ ++struct dvb_announcement_support_descriptor { ++ struct descriptor d; ++ uint16_t announcement_support_indicator; ++ /* struct dvb_announcement_support_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_announcement_support_descriptor. ++ */ ++struct dvb_announcement_support_entry { ++ EBIT3(uint8_t announcement_type : 4; , ++ uint8_t reserved : 1; , ++ uint8_t reference_type : 3; ); ++ /* Only if reference_type == 1, 2 or 3: ++ * struct dvb_announcement_support_reference reference */ ++} __ucsi_packed; ++ ++/** ++ * The optional reference field only present in a dvb_announcement_support_descriptor if ++ * its reference_type field is 1,2 or 3. ++ */ ++struct dvb_announcement_support_reference { ++ uint16_t original_network_id; ++ uint16_t transport_stream_id; ++ uint16_t service_id; ++ uint8_t component_tag; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_announcement_support_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_announcement_support_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_announcement_support_descriptor* ++ dvb_announcement_support_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ if (len < (sizeof(struct dvb_announcement_support_descriptor) - 2)) ++ return NULL; ++ ++ bswap16(buf+pos); ++ ++ pos += 2; ++ ++ while(pos < len) { ++ struct dvb_announcement_support_entry *e = ++ (struct dvb_announcement_support_entry*) (buf+pos); ++ ++ pos += sizeof(struct dvb_announcement_support_entry); ++ ++ if (pos > len) ++ return NULL; ++ ++ if ((e->reference_type == 1) || ++ (e->reference_type == 2) || ++ (e->reference_type == 3)) { ++ if ((pos + sizeof(struct dvb_announcement_support_reference)) > len) ++ return NULL; ++ ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ ++ pos += sizeof(struct dvb_announcement_support_reference); ++ } ++ } ++ ++ return (struct dvb_announcement_support_descriptor*) d; ++} ++ ++/** ++ * Iterator for the entries field of a dvb_announcement_support_descriptor. ++ * ++ * @param d dvb_announcement_support_descriptor pointer. ++ * @param pod Variable holding a pointer to the current dvb_announcement_support_entry. ++ */ ++#define dvb_announcement_support_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_announcement_support_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_announcement_support_descriptor_entries_next(d, pos)) ++ ++/** ++ * Accessor for the reference field of a dvb_announcement_support_entry if present. ++ * ++ * @param entry dvb_announcement_support_entry pointer. ++ * @return dvb_announcement_support_reference pointer, or NULL on error. ++ */ ++static inline struct dvb_announcement_support_reference* ++ dvb_announcement_support_entry_reference(struct dvb_announcement_support_entry* entry) ++{ ++ if ((entry->reference_type != 0x01) && ++ (entry->reference_type != 0x02) && ++ (entry->reference_type != 0x03)) ++ return NULL; ++ ++ return (struct dvb_announcement_support_reference*) ++ ((uint8_t*) entry + sizeof(struct dvb_announcement_support_entry)); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_announcement_support_entry* ++ dvb_announcement_support_descriptor_entries_first(struct dvb_announcement_support_descriptor *d) ++{ ++ if (d->d.len == 2) ++ return NULL; ++ ++ return (struct dvb_announcement_support_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_announcement_support_descriptor)); ++} ++ ++static inline struct dvb_announcement_support_entry* ++ dvb_announcement_support_descriptor_entries_next(struct dvb_announcement_support_descriptor *d, ++ struct dvb_announcement_support_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t* next = (uint8_t*) pos + sizeof(struct dvb_announcement_support_entry); ++ struct dvb_announcement_support_reference* reference = ++ dvb_announcement_support_entry_reference(pos); ++ ++ if (reference) ++ next += sizeof(struct dvb_announcement_support_reference); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_announcement_support_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/application_signalling_descriptor.h dvb-apps/lib/libucsi/dvb/application_signalling_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/application_signalling_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/application_signalling_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,124 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_APPLICATION_SIGNALLING_DESCRIPTOR ++#define _UCSI_DVB_APPLICATION_SIGNALLING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_application_signalling_descriptor structure. ++ */ ++struct dvb_application_signalling_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_application_signalling_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_application_signalling_descriptor. ++ */ ++struct dvb_application_signalling_entry { ++ uint16_t application_type; ++ EBIT2(uint8_t reserved : 3; , ++ uint8_t AIT_version_number : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_application_signalling_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_application_signalling_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_application_signalling_descriptor* ++ dvb_application_signalling_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ uint8_t* buf = (uint8_t*) d + 2; ++ ++ pos += sizeof(struct dvb_application_signalling_descriptor) - 2; ++ if (len % sizeof(struct dvb_application_signalling_entry)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos+=3; ++ } ++ ++ return (struct dvb_application_signalling_descriptor*) d; ++} ++ ++/** ++ * Iterator for the entries field of a dvb_application_signalling_descriptor. ++ * ++ * @param d dvb_application_signalling_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_application_signalling_entry. ++ */ ++#define dvb_application_signalling_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_application_signalling_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_application_signalling_descriptor_entries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_application_signalling_entry* ++ dvb_application_signalling_descriptor_entries_first(struct dvb_application_signalling_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_application_signalling_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_application_signalling_descriptor)); ++} ++ ++static inline struct dvb_application_signalling_entry* ++ dvb_application_signalling_descriptor_entries_next(struct dvb_application_signalling_descriptor *d, ++ struct dvb_application_signalling_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_application_signalling_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_application_signalling_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bat_section.c dvb-apps/lib/libucsi/dvb/bat_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bat_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/bat_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_bat_section * dvb_bat_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ struct dvb_bat_section * ret = (struct dvb_bat_section *) ext; ++ ++ if (len < sizeof(struct dvb_bat_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if ((pos + ret->bouquet_descriptors_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ret->bouquet_descriptors_length)) ++ return NULL; ++ pos += ret->bouquet_descriptors_length; ++ ++ if ((pos + sizeof(struct dvb_bat_section_part2)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += sizeof(struct dvb_bat_section_part2); ++ ++ while (pos < len) { ++ struct dvb_bat_transport * transport = ++ (struct dvb_bat_transport *) (buf + pos); ++ ++ if ((pos + sizeof(struct dvb_bat_transport)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 2); ++ bswap16(buf + pos + 4); ++ ++ pos += sizeof(struct dvb_bat_transport); ++ ++ if ((pos + transport->transport_descriptors_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ++ transport->transport_descriptors_length)) ++ return NULL; ++ ++ pos += transport->transport_descriptors_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bat_section.h dvb-apps/lib/libucsi/dvb/bat_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bat_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/bat_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,211 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_BAT_SECTION_H ++#define _UCSI_DVB_BAT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_bat_section structure. ++ */ ++struct dvb_bat_section { ++ struct section_ext head; ++ ++ EBIT2(uint16_t reserved_1 : 4; , ++ uint16_t bouquet_descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++ /* struct dvb_bat_section_part2 part2 */ ++}; ++ ++/** ++ * Second part of a dvb_bat_section, following the variable length descriptors field. ++ */ ++struct dvb_bat_section_part2 { ++ EBIT2(uint16_t reserved_2 : 4; , ++ uint16_t transport_stream_loop_length :12; ); ++ /* struct dvb_bat_transport transports[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the transports field of a dvb_bat_section_part2. ++ */ ++struct dvb_bat_transport { ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t transport_descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++}; ++ ++/** ++ * Process a dvb_bat_section. ++ * ++ * @param section Generic section pointer. ++ * @return dvb_bat_section pointer, or NULL on error. ++ */ ++struct dvb_bat_section *dvb_bat_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the bouquet_id field of a BAT. ++ * ++ * @param bat BAT pointer. ++ * @return The bouquet_id. ++ */ ++static inline uint16_t dvb_bat_section_bouquet_id(struct dvb_bat_section *bat) ++{ ++ return bat->head.table_id_ext; ++} ++ ++/** ++ * Iterator for the descriptors field in a dvb_bat_section. ++ * ++ * @param bat dvb_bat_section pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define dvb_bat_section_descriptors_for_each(bat, pos) \ ++ for ((pos) = dvb_bat_section_descriptors_first(bat); \ ++ (pos); \ ++ (pos) = dvb_bat_section_descriptors_next(bat, pos)) ++ ++/** ++ * Accessor for the second part of a dvb_bat_section. ++ * ++ * @param bat dvb_bat_section pointer. ++ * @return dvb_bat_section_part2 pointer. ++ */ ++static inline struct dvb_bat_section_part2 * ++ dvb_bat_section_part2(struct dvb_bat_section *bat) ++{ ++ return (struct dvb_bat_section_part2 *) ++ ((uint8_t*) bat + ++ sizeof(struct dvb_bat_section) + ++ bat->bouquet_descriptors_length); ++ ++} ++ ++/** ++ * Iterator for the transports field of a dvb_bat_section_part2. ++ * ++ * @param part2 dvb_bat_section_part2 pointer. ++ * @param pos Variable containing a pointer to the current dvb_bat_transport. ++ */ ++#define dvb_bat_section_transports_for_each(part2, pos) \ ++ for ((pos) = dvb_bat_section_transports_first(part2); \ ++ (pos); \ ++ (pos) = dvb_bat_section_transports_next(part2, pos)) ++ ++/** ++ * Iterator for the descriptors field of a dvb_bat_transport. ++ * ++ * @param transport dvb_bat_transport pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define dvb_bat_transport_descriptors_for_each(transport, pos) \ ++ for ((pos) = dvb_bat_transport_descriptors_first(transport); \ ++ (pos); \ ++ (pos) = dvb_bat_transport_descriptors_next(transport, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ dvb_bat_section_descriptors_first(struct dvb_bat_section *bat) ++{ ++ if (bat->bouquet_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) bat + sizeof(struct dvb_bat_section)); ++} ++ ++static inline struct descriptor * ++ dvb_bat_section_descriptors_next(struct dvb_bat_section *bat, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) bat + sizeof(struct dvb_bat_section), ++ bat->bouquet_descriptors_length, ++ pos); ++} ++ ++static inline struct dvb_bat_transport * ++ dvb_bat_section_transports_first(struct dvb_bat_section_part2 *part2) ++{ ++ if (part2->transport_stream_loop_length == 0) ++ return NULL; ++ ++ return (struct dvb_bat_transport *) ++ ((uint8_t *) part2 + sizeof(struct dvb_bat_section_part2)); ++} ++ ++static inline struct dvb_bat_transport * ++ dvb_bat_section_transports_next(struct dvb_bat_section_part2 *part2, ++ struct dvb_bat_transport *pos) ++{ ++ uint8_t *end = (uint8_t*) part2 + sizeof(struct dvb_bat_section_part2) + ++ part2->transport_stream_loop_length; ++ uint8_t *next = (uint8_t*) pos + sizeof(struct dvb_bat_transport) + ++ pos->transport_descriptors_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_bat_transport *) next; ++} ++ ++static inline struct descriptor * ++ dvb_bat_transport_descriptors_first(struct dvb_bat_transport *t) ++{ ++ if (t->transport_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*)t + sizeof(struct dvb_bat_transport)); ++} ++ ++static inline struct descriptor * ++ dvb_bat_transport_descriptors_next(struct dvb_bat_transport *t, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) t + sizeof(struct dvb_bat_transport), ++ t->transport_descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bouquet_name_descriptor.h dvb-apps/lib/libucsi/dvb/bouquet_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/bouquet_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/bouquet_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_BOUQUET_NAME_DESCRIPTOR ++#define _UCSI_DVB_BOUQUET_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_bouquet_name_descriptor structure. ++ */ ++struct dvb_bouquet_name_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_bouquet_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_bouquet_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_bouquet_name_descriptor* ++ dvb_bouquet_name_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_bouquet_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the name field of a dvb_bouquet_name_descriptor. ++ * ++ * @param d dvb_bouquet_name_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_bouquet_name_descriptor_name(struct dvb_bouquet_name_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_bouquet_name_descriptor); ++} ++ ++/** ++ * Determine the length of the name field of a dvb_bouquet_name_descriptor in bytes. ++ * ++ * @param d dvb_bouquet_name_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_bouquet_name_descriptor_name_length(struct dvb_bouquet_name_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cable_delivery_descriptor.h dvb-apps/lib/libucsi/dvb/cable_delivery_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cable_delivery_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/cable_delivery_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,70 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CABLE_DELIVERY_DESCRIPTOR ++#define _UCSI_DVB_CABLE_DELIVERY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_cable_delivery_descriptor structure. ++ */ ++struct dvb_cable_delivery_descriptor { ++ struct descriptor d; ++ ++ uint32_t frequency; // BCD, units 100Hz ++ EBIT2(uint16_t reserved : 12; , ++ uint16_t fec_outer : 4; ); ++ uint8_t modulation; ++ EBIT2(uint32_t symbol_rate : 28; , // BCD, units 100Hz ++ uint32_t fec_inner : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_cable_delivery_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_cable_delivery_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_cable_delivery_descriptor* ++ dvb_cable_delivery_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_cable_delivery_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 6); ++ bswap32((uint8_t*) d + 9); ++ ++ return (struct dvb_cable_delivery_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ca_identifier_descriptor.h dvb-apps/lib/libucsi/dvb/ca_identifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ca_identifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ca_identifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,94 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CA_IDENTIFIER_DESCRIPTOR ++#define _UCSI_DVB_CA_IDENTIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ca_identifier_descriptor structure. ++ */ ++struct dvb_ca_identifier_descriptor { ++ struct descriptor d; ++ ++ /* uint16_t ca_system_ids[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ca_identifier_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ca_identifier_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ca_identifier_descriptor* ++ dvb_ca_identifier_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ uint8_t *buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ ++ if (len % 2) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos+=2; ++ } ++ ++ return (struct dvb_ca_identifier_descriptor*) d; ++} ++ ++/** ++ * Accessor for the ca_system_ids field of a dvb_ca_identifier_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint16_t * ++ dvb_ca_identifier_descriptor_ca_system_ids(struct dvb_ca_identifier_descriptor *d) ++{ ++ return (uint16_t *) ((uint8_t *) d + sizeof(struct dvb_ca_identifier_descriptor)); ++} ++ ++/** ++ * Calculate the number of entries in the ca_system_ids field of a dvb_ca_identifier_descriptor. ++ * ++ * @param d dvb_ca_identifier_descriptor pointer. ++ * @return Number of entries. ++ */ ++static inline int ++ dvb_ca_identifier_descriptor_ca_system_ids_count(struct dvb_ca_identifier_descriptor *d) ++{ ++ return d->d.len >> 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cell_frequency_link_descriptor.h dvb-apps/lib/libucsi/dvb/cell_frequency_link_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cell_frequency_link_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/cell_frequency_link_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,190 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CELL_FREQUENCY_LINK_DESCRIPTOR ++#define _UCSI_DVB_CELL_FREQUENCY_LINK_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_cell_frequency_link_descriptor structure. ++ */ ++struct dvb_cell_frequency_link_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_cell_frequency_link_cell cells[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the cells field of a dvb_cell_frequency_link_descriptor. ++ */ ++struct dvb_cell_frequency_link_cell { ++ uint16_t cell_id; ++ uint32_t frequency; ++ uint8_t subcell_loop_info_length; ++ /* struct dvb_cell_frequency_link_subcell subcells[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the subcells field of a dvb_cell_frequency_link_cell. ++ */ ++struct dvb_cell_frequency_link_cell_subcell { ++ uint8_t cell_id_extension; ++ uint32_t transposer_frequency; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_cell_frequency_link_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_cell_frequency_link_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_cell_frequency_link_descriptor* ++ dvb_cell_frequency_link_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t pos2 = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_cell_frequency_link_cell *e = ++ (struct dvb_cell_frequency_link_cell*) (buf+pos); ++ ++ if ((pos + sizeof(struct dvb_cell_frequency_link_cell)) > len) ++ return NULL; ++ ++ bswap16(buf+pos); ++ bswap32(buf+pos+2); ++ ++ pos += sizeof(struct dvb_cell_frequency_link_cell); ++ ++ if ((pos + e->subcell_loop_info_length) > len) ++ return NULL; ++ ++ if (e->subcell_loop_info_length % sizeof(struct dvb_cell_frequency_link_cell_subcell)) ++ return NULL; ++ ++ pos2 = 0; ++ while(pos2 < e->subcell_loop_info_length) { ++ bswap32(buf+pos+pos2+1); ++ ++ pos2 += sizeof(struct dvb_cell_frequency_link_cell_subcell); ++ } ++ ++ pos += e->subcell_loop_info_length; ++ } ++ ++ return (struct dvb_cell_frequency_link_descriptor*) d; ++} ++ ++/** ++ * Iterator for the cells field of a dvb_cell_frequency_link_descriptor. ++ * ++ * @param d dvb_cell_frequency_link_descriptor pointer. ++ * @param pos Variable holding a pointer to the current dvb_cell_frequency_link_cell. ++ */ ++#define dvb_cell_frequency_link_descriptor_cells_for_each(d, pos) \ ++ for ((pos) = dvb_cell_frequency_link_descriptor_cells_first(d); \ ++ (pos); \ ++ (pos) = dvb_cell_frequency_link_descriptor_cells_next(d, pos)) ++ ++/** ++ * Iterator for the subcells field of a dvb_cell_frequency_link_cell. ++ * ++ * @param cell dvb_cell_frequency_link_cell pointer. ++ * @param pos Variable holding a pointer to the current dvb_cell_frequency_link_cell_subcell. ++ */ ++#define dvb_cell_frequency_link_cell_subcells_for_each(cell, pos) \ ++ for ((pos) = dvb_cell_frequency_link_cell_subcells_first(cell); \ ++ (pos); \ ++ (pos) = dvb_cell_frequency_link_cell_subcells_next(cell, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_cell_frequency_link_cell* ++ dvb_cell_frequency_link_descriptor_cells_first(struct dvb_cell_frequency_link_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_cell_frequency_link_cell *) ++ ((uint8_t*) d + sizeof(struct dvb_cell_frequency_link_descriptor)); ++} ++ ++static inline struct dvb_cell_frequency_link_cell* ++ dvb_cell_frequency_link_descriptor_cells_next(struct dvb_cell_frequency_link_descriptor *d, ++ struct dvb_cell_frequency_link_cell *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_cell_frequency_link_cell) + ++ pos->subcell_loop_info_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_cell_frequency_link_cell *) next; ++} ++ ++static inline struct dvb_cell_frequency_link_cell_subcell* ++ dvb_cell_frequency_link_cell_subcells_first(struct dvb_cell_frequency_link_cell *d) ++{ ++ if (d->subcell_loop_info_length == 0) ++ return NULL; ++ ++ return (struct dvb_cell_frequency_link_cell_subcell*) ++ ((uint8_t*) d + sizeof(struct dvb_cell_frequency_link_cell)); ++} ++ ++static inline struct dvb_cell_frequency_link_cell_subcell* ++ dvb_cell_frequency_link_cell_subcells_next(struct dvb_cell_frequency_link_cell *cell, ++ struct dvb_cell_frequency_link_cell_subcell *pos) ++{ ++ uint8_t *end = (uint8_t*) cell + cell->subcell_loop_info_length; ++ uint8_t *next = (uint8_t*) pos + ++ sizeof(struct dvb_cell_frequency_link_cell_subcell); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_cell_frequency_link_cell_subcell *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cell_list_descriptor.h dvb-apps/lib/libucsi/dvb/cell_list_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/cell_list_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/cell_list_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,201 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CELL_LIST_DESCRIPTOR ++#define _UCSI_DVB_CELL_LIST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_cell_list_descriptor structure. ++ */ ++struct dvb_cell_list_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_cell_list_entry cells[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the cells field of a dvb_cell_list_descriptor. ++ */ ++struct dvb_cell_list_entry { ++ uint16_t cell_id; ++ uint16_t cell_latitude; ++ uint16_t cell_longitude; ++ EBIT3(uint32_t cell_extend_of_latitude :12; , ++ uint32_t cell_extend_of_longitude :12; , ++ uint32_t subcell_info_loop_length : 8; ); ++ /* struct dvb_subcell_list_entry subcells[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the subcells field of a dvb_cell_list_entry. ++ */ ++struct dvb_subcell_list_entry { ++ uint8_t cell_id_extension; ++ uint16_t subcell_latitude; ++ uint16_t subcell_longitude; ++ EBIT2(uint32_t subcell_extend_of_latitude :12; , ++ uint32_t subcell_extend_of_longitude :12; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_cell_list_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_cell_list_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_cell_list_descriptor* ++ dvb_cell_list_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t pos2 = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_cell_list_entry *e = ++ (struct dvb_cell_list_entry*) (buf+pos); ++ ++ if ((pos + sizeof(struct dvb_cell_list_entry)) > len) ++ return NULL; ++ ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ bswap32(buf+pos+6); ++ ++ pos += sizeof(struct dvb_cell_list_entry); ++ ++ if ((pos + e->subcell_info_loop_length) > len) ++ return NULL; ++ ++ if (e->subcell_info_loop_length % sizeof(struct dvb_subcell_list_entry)) ++ return NULL; ++ ++ pos2 = 0; ++ while(pos2 < e->subcell_info_loop_length) { ++ bswap16(buf+pos+pos2+1); ++ bswap16(buf+pos+pos2+3); ++ bswap24(buf+pos+pos2+5); ++ ++ pos2 += sizeof(struct dvb_subcell_list_entry); ++ } ++ ++ pos += e->subcell_info_loop_length; ++ } ++ ++ return (struct dvb_cell_list_descriptor*) d; ++} ++ ++/** ++ * Iterator for the cells field of a dvb_cell_list_descriptor. ++ * ++ * @param d dvb_cell_list_descriptor pointer. ++ * @param pos Variable holding a pointer to the current dvb_cell_list_entry. ++ */ ++#define dvb_cell_list_descriptor_cells_for_each(d, pos) \ ++ for ((pos) = dvb_cell_list_descriptor_cells_first(d); \ ++ (pos); \ ++ (pos) = dvb_cell_list_descriptor_cells_next(d, pos)) ++ ++/** ++ * Iterator for the subcells field of a dvb_cell_list_entry. ++ * ++ * @param cell dvb_cell_list_entry pointer. ++ * @param pos Variable holding a pointer to the current dvb_subcell_list_entry. ++ */ ++#define dvb_cell_list_entry_subcells_for_each(cell, pos) \ ++ for ((pos) = dvb_cell_list_entry_subcells_first(cell); \ ++ (pos); \ ++ (pos) = dvb_cell_list_entry_subcells_next(cell, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_cell_list_entry* ++ dvb_cell_list_descriptor_cells_first(struct dvb_cell_list_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_cell_list_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_cell_list_descriptor)); ++} ++ ++static inline struct dvb_cell_list_entry* ++ dvb_cell_list_descriptor_cells_next(struct dvb_cell_list_descriptor *d, ++ struct dvb_cell_list_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_cell_list_entry) + ++ pos->subcell_info_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_cell_list_entry *) next; ++} ++ ++static inline struct dvb_subcell_list_entry* ++ dvb_cell_list_entry_subcells_first(struct dvb_cell_list_entry *d) ++{ ++ if (d->subcell_info_loop_length == 0) ++ return NULL; ++ ++ return (struct dvb_subcell_list_entry*) ++ ((uint8_t*) d + sizeof(struct dvb_cell_list_entry)); ++} ++ ++static inline struct dvb_subcell_list_entry* ++ dvb_cell_list_entry_subcells_next(struct dvb_cell_list_entry *d, ++ struct dvb_subcell_list_entry *pos) ++{ ++ uint8_t *next = (uint8_t*) pos + sizeof(struct dvb_subcell_list_entry); ++ uint8_t *end = (uint8_t*) d + ++ sizeof(struct dvb_cell_list_entry) + ++ d->subcell_info_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_subcell_list_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/component_descriptor.h dvb-apps/lib/libucsi/dvb/component_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/component_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/component_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,147 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_COMPONENT_DESCRIPTOR ++#define _UCSI_DVB_COMPONENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Possible values for stream_content. ++ */ ++enum { ++ DVB_STREAM_CONTENT_VIDEO = 0x01, ++ DVB_STREAM_CONTENT_AUDIO = 0x02, ++ DVB_STREAM_CONTENT_SUBTITLE = 0x03, ++ DVB_STREAM_CONTENT_AC3 = 0x04, ++}; ++ ++/** ++ * Possible values for component_type. ++ */ ++enum { ++ DVB_COMPONENT_TYPE_VIDEO_43_25Hz = 0x01, ++ DVB_COMPONENT_TYPE_VIDEO_169_PAN_25Hz = 0x02, ++ DVB_COMPONENT_TYPE_VIDEO_169_NOPAN_25Hz = 0x03, ++ DVB_COMPONENT_TYPE_VIDEO_GT169_25Hz = 0x04, ++ ++ DVB_COMPONENT_TYPE_VIDEO_43_30Hz = 0x05, ++ DVB_COMPONENT_TYPE_VIDEO_169_PAN_30Hz = 0x06, ++ DVB_COMPONENT_TYPE_VIDEO_169_NOPAN_30Hz = 0x07, ++ DVB_COMPONENT_TYPE_VIDEO_GT169_30Hz = 0x08, ++ ++ DVB_COMPONENT_TYPE_HDVIDEO_43_25Hz = 0x09, ++ DVB_COMPONENT_TYPE_HDVIDEO_169_PAN_25Hz = 0x0a, ++ DVB_COMPONENT_TYPE_HDVIDEO_169_NOPAN_25Hz = 0x0b, ++ DVB_COMPONENT_TYPE_HDVIDEO_GT169_25Hz = 0x0c, ++ ++ DVB_COMPONENT_TYPE_HDVIDEO_43_30Hz = 0x0d, ++ DVB_COMPONENT_TYPE_HDVIDEO_169_PAN_30Hz = 0x0e, ++ DVB_COMPONENT_TYPE_HDVIDEO_169_NOPAN_30Hz = 0x0f, ++ DVB_COMPONENT_TYPE_HDVIDEO_GT169_30Hz = 0x10, ++ ++ DVB_COMPONENT_TYPE_AUDIO_SINGLE_MONO = 0x01, ++ DVB_COMPONENT_TYPE_AUDIO_DUAL_MONO = 0x02, ++ DVB_COMPONENT_TYPE_AUDIO_STEREO = 0x03, ++ DVB_COMPONENT_TYPE_AUDIO_MULTI_LINGUAL_MULTI_CHAN= 0x04, ++ DVB_COMPONENT_TYPE_AUDIO_SURROUND = 0x05, ++ DVB_COMPONENT_TYPE_AUDIO_VISUAL_IMPAIRED = 0x40, ++ DVB_COMPONENT_TYPE_AUDIO_HARDHEAR = 0x41, ++ DVB_COMPONENT_TYPE_AUDIO_SUPPLEMENTARY = 0x42, ++ ++ DVB_COMPONENT_TYPE_SUBTITLE_TELETEXT = 0x01, ++ DVB_COMPONENT_TYPE_SUBTITLE_ASSOC_TELETEXT = 0x02, ++ DVB_COMPONENT_TYPE_SUBTITLE_VBI = 0x03, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB = 0x10, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_43 = 0x11, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_169 = 0x12, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_2211 = 0x13, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_HARDHEAR = 0x20, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_HARDHEAR_43 = 0x21, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_HARDHEAR_169 = 0x22, ++ DVB_COMPONENT_TYPE_SUBTITLE_DVB_HARDHEAR_2211 = 0x23, ++}; ++ ++/** ++ * dvb_component_descriptor structure. ++ */ ++struct dvb_component_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 4; , ++ uint8_t stream_content : 4; ); ++ uint8_t component_type; ++ uint8_t component_tag; ++ iso639lang_t language_code; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_component_descriptor. ++ * ++ * @param d Pointer to a generic descriptor. ++ * @return dvb_component_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_component_descriptor* ++ dvb_component_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_component_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_component_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of a dvb_component_descriptor. ++ * ++ * @param d dvb_component_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_component_descriptor_text(struct dvb_component_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_component_descriptor); ++} ++ ++/** ++ * Determine the length of the text field of a dvb_component_descriptor. ++ * ++ * @param d dvb_component_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_component_descriptor_text_length(struct dvb_component_descriptor *d) ++{ ++ return d->d.len - 6; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/content_descriptor.h dvb-apps/lib/libucsi/dvb/content_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/content_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/content_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CONTENT_DESCRIPTOR ++#define _UCSI_DVB_CONTENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++// FIXME: the nibbles ++ ++/** ++ * dvb_content_descriptor structure. ++ */ ++struct dvb_content_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_content_nibble nibbles[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the nibbles field of a dvb_content_descriptor. ++ */ ++struct dvb_content_nibble { ++ EBIT2(uint8_t content_nibble_level_1 : 4; , ++ uint8_t content_nibble_level_2 : 4; ); ++ EBIT2(uint8_t user_nibble_1 : 4; , ++ uint8_t user_nibble_2 : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_content_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_content_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_content_descriptor* ++ dvb_content_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len % sizeof(struct dvb_content_nibble)) ++ return NULL; ++ ++ return (struct dvb_content_descriptor*) d; ++} ++ ++/** ++ * Iterator for the nibbles field of a dvb_content_descriptor. ++ * ++ * @param d dvb_content_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_content_nibble. ++ */ ++#define dvb_content_descriptor_nibbles_for_each(d, pos) \ ++ for ((pos) = dvb_content_descriptor_nibbles_first(d); \ ++ (pos); \ ++ (pos) = dvb_content_descriptor_nibbles_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_content_nibble* ++ dvb_content_descriptor_nibbles_first(struct dvb_content_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_content_nibble *) ++ ((uint8_t*) d + sizeof(struct dvb_content_descriptor)); ++} ++ ++static inline struct dvb_content_nibble* ++ dvb_content_descriptor_nibbles_next(struct dvb_content_descriptor *d, ++ struct dvb_content_nibble *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_content_nibble); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_content_nibble *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/content_identifier_descriptor.h dvb-apps/lib/libucsi/dvb/content_identifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/content_identifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/content_identifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,233 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_CONTENT_IDENTIFIER_DESCRIPTOR ++#define _UCSI_DVB_CONTENT_IDENTIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++ ++/** ++ * Possible values for the crid_type. ++ */ ++enum { ++ DVB_CRID_TYPE_NONE = 0x00, ++ DVB_CRID_TYPE_ITEM = 0x01, ++ DVB_CRID_TYPE_SERIES = 0x02, ++ DVB_CRID_TYPE_RECOMMENDATION = 0x03, ++}; ++ ++/** ++ * Possible values for the crid_location. ++ */ ++enum { ++ DVB_CRID_LOCATION_THIS_DESCRIPTOR = 0x00, ++ DVB_CRID_LOCATION_CIT = 0x01, ++}; ++ ++/** ++ * dvb_content_identifier_descriptor structure. ++ */ ++struct dvb_content_identifier_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_content_identifier_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_content_identifier_descriptor. ++ */ ++struct dvb_content_identifier_entry { ++ EBIT2(uint8_t crid_type : 6; , ++ uint8_t crid_location : 2; ); ++ /* struct dvb_content_identifier_data_00 data0 */ ++ /* struct dvb_content_identifier_data_01 data1 */ ++} __ucsi_packed; ++ ++/** ++ * The data if crid_location == 0 ++ */ ++struct dvb_content_identifier_entry_data_0 { ++ uint8_t crid_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * The data if crid_location == 1 ++ */ ++struct dvb_content_identifier_entry_data_1 { ++ uint16_t crid_ref; ++} __ucsi_packed; ++ ++ ++/** ++ * Process a dvb_content_identifier_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_content_identifier_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_content_identifier_descriptor* ++ dvb_content_identifier_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len + 2; ++ uint32_t pos = 2; ++ uint8_t *buf = (uint8_t*) d; ++ ++ while(pos < len) { ++ struct dvb_content_identifier_entry *e = ++ (struct dvb_content_identifier_entry*) (buf + pos); ++ ++ if (len < (pos+1)) ++ return NULL; ++ pos++; ++ ++ switch(e->crid_location) { ++ case 0: ++ if (len < (pos + 1)) ++ return NULL; ++ if (len < (pos + 1 + buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ break; ++ ++ case 1: ++ if (len < (pos+2)) ++ return NULL; ++ bswap16(buf+pos); ++ break; ++ } ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct dvb_content_identifier_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a dvb_content_identifier_descriptor. ++ * ++ * @param d dvb_content_identifier_descriptor pointer. ++ * @param pos Variable holding a pointer to the current dvb_content_identifier_entry. ++ */ ++#define dvb_content_identifier_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_content_identifier_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_content_identifier_descriptor_entries_next(d, pos)) ++ ++/** ++ * Accessor for the data0 field of a dvb_content_identifier_entry. ++ * ++ * @param d dvb_content_identifier_entry pointer. ++ * @return Pointer, or NULL on error. ++ */ ++static inline struct dvb_content_identifier_entry_data_0* ++ dvb_content_identifier_entry_data_0(struct dvb_content_identifier_entry *d) ++{ ++ if (d->crid_location != 0) ++ return NULL; ++ return (struct dvb_content_identifier_entry_data_0*) ++ ((uint8_t*) d + sizeof(struct dvb_content_identifier_entry)); ++} ++/** ++ * Accessor for the data field of a dvb_content_identifier_entry_data_0. ++ * ++ * @param d dvb_content_identifier_entry_data_0 pointer. ++ * @return Pointer, or NULL on error. ++ */ ++static inline uint8_t* ++ dvb_content_identifier_entry_data_0_data(struct dvb_content_identifier_entry_data_0 *d) ++{ ++ return ((uint8_t*) d + sizeof(struct dvb_content_identifier_entry_data_0)); ++} ++ ++/** ++ * Accessor for the data1 field of a dvb_content_identifier_entry. ++ * ++ * @param d dvb_content_identifier_entry pointer. ++ * @return Pointer, or NULL on error. ++ */ ++static inline struct dvb_content_identifier_entry_data_1* ++ dvb_content_identifier_entry_data_1(struct dvb_content_identifier_entry *d) ++{ ++ if (d->crid_location != 1) ++ return NULL; ++ return (struct dvb_content_identifier_entry_data_1*) ++ ((uint8_t*) d + sizeof(struct dvb_content_identifier_entry)); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_content_identifier_entry* ++ dvb_content_identifier_descriptor_entries_first(struct dvb_content_identifier_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_content_identifier_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_content_identifier_descriptor)); ++} ++ ++static inline struct dvb_content_identifier_entry* ++ dvb_content_identifier_descriptor_entries_next(struct dvb_content_identifier_descriptor *d, ++ struct dvb_content_identifier_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_content_identifier_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ switch(pos->crid_location) { ++ case 0: ++ if ((next+2) >= end) ++ return NULL; ++ if ((next+2+next[1]) >= end) ++ return NULL; ++ break; ++ ++ case 1: ++ if ((next+3) >= end) ++ return NULL; ++ break; ++ } ++ ++ return (struct dvb_content_identifier_entry*) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/country_availability_descriptor.h dvb-apps/lib/libucsi/dvb/country_availability_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/country_availability_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/country_availability_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,120 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_COUNTRY_AVAILABILITY_DESCRIPTOR ++#define _UCSI_DVB_COUNTRY_AVAILABILITY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_country_availability_descriptor structure. ++ */ ++struct dvb_country_availability_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t country_availability_flag : 1; , ++ uint8_t reserved : 7; ); ++ /* struct dvb_country_availability_entry countries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the countries field of a dvb_country_availability_descriptor. ++ */ ++struct dvb_country_availability_entry { ++ iso639country_t country_code; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_country_availability_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_country_availability_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_country_availability_descriptor* ++ dvb_country_availability_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ ++ if (len < (sizeof(struct dvb_country_availability_descriptor) - 2)) ++ return NULL; ++ ++ if ((len - 1) % sizeof(struct dvb_country_availability_entry)) ++ return NULL; ++ ++ return (struct dvb_country_availability_descriptor*) d; ++} ++ ++/** ++ * Iterator for the countries field of a dvb_country_availability_descriptor. ++ * ++ * @param d dvb_country_availability_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_country_availability_entry. ++ */ ++#define dvb_country_availability_descriptor_countries_for_each(d, pos) \ ++ for ((pos) = dvb_country_availability_descriptor_countries_first(d); \ ++ (pos); \ ++ (pos) = dvb_country_availability_descriptor_countries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_country_availability_entry* ++ dvb_country_availability_descriptor_countries_first(struct dvb_country_availability_descriptor *d) ++{ ++ if (d->d.len == 1) ++ return NULL; ++ ++ return (struct dvb_country_availability_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_country_availability_descriptor)); ++} ++ ++static inline struct dvb_country_availability_entry* ++ dvb_country_availability_descriptor_countries_next(struct dvb_country_availability_descriptor *d, ++ struct dvb_country_availability_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_country_availability_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_country_availability_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/data_broadcast_descriptor.h dvb-apps/lib/libucsi/dvb/data_broadcast_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/data_broadcast_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/data_broadcast_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,139 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DATA_BROADCAST_DESCRIPTOR ++#define _UCSI_DVB_DATA_BROADCAST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_data_broadcast_descriptor structure. ++ */ ++struct dvb_data_broadcast_descriptor { ++ struct descriptor d; ++ ++ uint16_t data_broadcast_id; ++ uint8_t component_tag; ++ uint8_t selector_length; ++ /* uint8_t selector[] */ ++ /* struct dvb_data_broadcast_descriptor_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_data_broadcast_descriptor following the variable length selector field. ++ */ ++struct dvb_data_broadcast_descriptor_part2 { ++ iso639lang_t language_code; ++ uint8_t text_length; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_data_broadcast_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_data_broadcast_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_data_broadcast_descriptor* ++ dvb_data_broadcast_descriptor_codec(struct descriptor* d) ++{ ++ struct dvb_data_broadcast_descriptor *p = ++ (struct dvb_data_broadcast_descriptor *) d; ++ struct dvb_data_broadcast_descriptor_part2 *p2; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = sizeof(struct dvb_data_broadcast_descriptor) - 2; ++ uint32_t len = d->len; ++ ++ if (pos > len) ++ return NULL; ++ ++ bswap16(buf + 2); ++ ++ pos += p->selector_length; ++ ++ if (pos > len) ++ return NULL; ++ ++ p2 = (struct dvb_data_broadcast_descriptor_part2*) (buf + 2 + pos); ++ ++ pos += sizeof(struct dvb_data_broadcast_descriptor_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p2->text_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return p; ++} ++ ++/** ++ * Accessor for the selector field of a dvb_data_broadcast_descriptor. ++ * ++ * @param d dvb_data_broadcast_descriptor pointer. ++ * @return pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_data_broadcast_descriptor_selector(struct dvb_data_broadcast_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_data_broadcast_descriptor); ++} ++ ++/** ++ * Accessor for the second part of a dvb_data_broadcast_descriptor. ++ * ++ * @param d dvb_data_broadcast_descriptor pointer. ++ * @return dvb_data_broadcast_descriptor_part2 pointer. ++ */ ++static inline struct dvb_data_broadcast_descriptor_part2 * ++ dvb_data_broadcast_descriptor_part2(struct dvb_data_broadcast_descriptor *d) ++{ ++ return (struct dvb_data_broadcast_descriptor_part2*) ++ ((uint8_t*) d + sizeof(struct dvb_data_broadcast_descriptor) + ++ d->selector_length); ++} ++ ++/** ++ * Accessor for the text field in a dvb_data_broadcast_descriptor_part2. ++ * ++ * @param d dvb_data_broadcast_descriptor_part2 pointer. ++ * @return pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_data_broadcast_descriptor_part2_text(struct dvb_data_broadcast_descriptor_part2 *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_data_broadcast_descriptor_part2); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/data_broadcast_id_descriptor.h dvb-apps/lib/libucsi/dvb/data_broadcast_id_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/data_broadcast_id_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/data_broadcast_id_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,221 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DATA_BROADCAST_ID_DESCRIPTOR ++#define _UCSI_DVB_DATA_BROADCAST_ID_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for data_broadcast_id. ++ */ ++enum { ++ DVB_BROADCAST_ID_DATA_PIPE = 0X0001, ++ DVB_BROADCAST_ID_ASYNCHRONOUS_DATA_STREAM = 0X0002, ++ DVB_BROADCAST_ID_SYNCHRONOUS_DATA_STREAM = 0X0003, ++ DVB_BROADCAST_ID_SYNCHRONISED_DATA_STREAM = 0X0004, ++ DVB_BROADCAST_ID_MULTI_PROTOCOL_ENCAPSULATION = 0X0005, ++ DVB_BROADCAST_ID_DATA_CAROUSEL = 0X0006, ++ DVB_BROADCAST_ID_OBJECT_CAROUSEL = 0X0007, ++ DVB_BROADCAST_ID_DVB_ATM_STREAMS = 0X0008, ++ DVB_BROADCAST_ID_HIGHER_PROTOCOLS = 0X0009, ++ DVB_BROADCAST_ID_SOFTWARE_UPDATE = 0x000A, ++ DVB_BROADCAST_ID_IP_MAC_NOTIFICATION_TABLE = 0x000B, ++}; ++ ++/** ++ * dvb_data_broadcast_id_descriptor structure. ++ */ ++struct dvb_data_broadcast_id_descriptor { ++ struct descriptor d; ++ ++ uint16_t data_broadcast_id; ++ /* uint8_t id_selector_byte[] */ ++} __ucsi_packed; ++ ++/** ++ * id_selector_byte for 0x000b data_broadcast_id (IP/MAC Notification Table). ++ */ ++struct dvb_id_selector_byte_000b { ++ uint8_t platform_id_data_length; ++ /* struct dvb_ip_mac_notification_info infos[] */ ++ /* uint8_t private_data[] */ ++} __ucsi_packed; ++ ++/** ++ * Entries in the infos field of a dvb_id_selector_byte_0b. ++ */ ++struct dvb_ip_mac_notification_info { ++ EBIT2(uint32_t platform_id : 24; , ++ uint8_t action_type : 8; ); ++ EBIT3(uint8_t reserved : 2; , ++ uint8_t INT_versioning_flag : 1; , ++ uint8_t INT_version : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_data_broadcast_id_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_data_broadcast_id_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_data_broadcast_id_descriptor* ++ dvb_data_broadcast_id_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_data_broadcast_id_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ ++ return (struct dvb_data_broadcast_id_descriptor*) d; ++} ++ ++/** ++ * Accessor for the selector_byte field of a dvb_data_broadcast_id_descriptor. ++ * ++ * @param d dvb_data_broadcast_id_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_data_broadcast_id_descriptor_id_selector_byte(struct dvb_data_broadcast_id_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_data_broadcast_id_descriptor); ++} ++ ++/** ++ * Determine the length of the selector_byte field of a dvb_data_broadcast_id_descriptor. ++ * ++ * @param d dvb_data_broadcast_id_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_data_broadcast_id_descriptor_id_selector_byte_length(struct dvb_data_broadcast_id_descriptor *d) ++{ ++ return d->d.len - 2; ++} ++ ++/** ++ * Accessor for a dvb_id_selector_byte_000b pointer. ++ * ++ * @param d dvb_data_broadcast_id_descriptor pointer. ++ * @return Pointer to the data field. ++ */ ++static inline struct dvb_id_selector_byte_000b * ++ dvb_id_selector_byte_000b(struct dvb_data_broadcast_id_descriptor *d) ++{ ++ if (d->data_broadcast_id != DVB_BROADCAST_ID_IP_MAC_NOTIFICATION_TABLE) ++ return NULL; ++ return (struct dvb_id_selector_byte_000b *) dvb_data_broadcast_id_descriptor_id_selector_byte(d); ++} ++ ++/** ++ * Iterator for the dvb_ip_mac_notification_info field of a dvb_id_selector_byte_000b. ++ * ++ * @param id_selector_byte dvb_id_selector_byte_000b pointer. ++ * @param pos Variable containing a pointer to the current dvb_ip_mac_notification_info. ++ */ ++#define dvb_id_selector_byte_000b_ip_mac_notification_info_for_each(id_selector_byte, pos) \ ++ for ((pos) = dvb_ip_mac_notification_info_first(id_selector_byte); \ ++ (pos); \ ++ (pos) = dvb_ip_mac_notification_info_next(id_selector_byte, pos)) ++ ++/** ++ * Length of the private_data field of a dvb_id_selector_byte_000b. ++ * ++ * @param d descriptor pointer. ++ * @param i dvb_id_selector_byte_000b pointer. ++ * @return Length of the field. ++ */ ++static inline uint8_t ++ dvb_id_selector_byte_000b_private_data_length(struct descriptor *d, ++ struct dvb_id_selector_byte_000b *i) ++{ ++ return (uint8_t) (d->len - ++ sizeof(struct descriptor) - ++ i->platform_id_data_length - ++ sizeof(struct dvb_id_selector_byte_000b)); ++} ++ ++/** ++ * Accessor for the private_data field of a dvb_id_selector_byte_000b. ++ * ++ * @param d descriptor pointer. ++ * @param i dvb_id_selector_byte_000b pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_id_selector_byte_000b_private_data(struct descriptor *d, ++ struct dvb_id_selector_byte_000b *i) ++{ ++ if (dvb_id_selector_byte_000b_private_data_length(d, i) <= 0) ++ return NULL; ++ ++ return (uint8_t *) i + i->platform_id_data_length + sizeof(struct dvb_id_selector_byte_000b); ++} ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ip_mac_notification_info * ++ dvb_ip_mac_notification_info_first(struct dvb_id_selector_byte_000b *d) ++{ ++ if (d->platform_id_data_length == 0) ++ return NULL; ++ ++ bswap32((uint8_t *) d + sizeof(struct dvb_id_selector_byte_000b)); ++ ++ return (struct dvb_ip_mac_notification_info *) ((uint8_t *) d + sizeof(struct dvb_id_selector_byte_000b)); ++} ++ ++static inline struct dvb_ip_mac_notification_info * ++ dvb_ip_mac_notification_info_next(struct dvb_id_selector_byte_000b *d, ++ struct dvb_ip_mac_notification_info *pos) ++{ ++ uint8_t *end = (uint8_t *) d + d->platform_id_data_length; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_id_selector_byte_000b) + ++ sizeof(struct dvb_ip_mac_notification_info); ++ ++ if (next >= end) ++ return NULL; ++ ++ bswap32(next); ++ ++ return (struct dvb_ip_mac_notification_info *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif ++ ++#include +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/default_authority_descriptor.h dvb-apps/lib/libucsi/dvb/default_authority_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/default_authority_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/default_authority_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DEFAULT_AUTHORITY_DESCRIPTOR ++#define _UCSI_DVB_DEFAULT_AUTHORITY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_default_authority_descriptor structure. ++ */ ++struct dvb_default_authority_descriptor { ++ struct descriptor d; ++ ++ /* char name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_default_authority_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_default_authority_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_default_authority_descriptor* ++ dvb_default_authority_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_default_authority_descriptor*) d; ++} ++ ++/** ++ * Accessor for the name field in a dvb_default_authority_descriptor. ++ * ++ * @param d dvb_default_authority_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_default_authority_descriptor_name(struct dvb_default_authority_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_default_authority_descriptor); ++} ++ ++/** ++ * Calculate the length of the name field in a dvb_default_authority_descriptor. ++ * ++ * @param d dvb_default_authority_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_default_authority_descriptor_name_length(struct dvb_default_authority_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/descriptor.h dvb-apps/lib/libucsi/dvb/descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,230 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DESCRIPTOR_H ++#define _UCSI_DVB_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/** ++ * The following are disabled because support is incomplete just now. ++ */ ++/* ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++*/ ++ ++/** ++ * The following are not implemented just now ++ */ ++/* ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++*/ ++ ++/** ++ * Enumeration of DVB descriptor tags. ++ */ ++enum dvb_descriptor_tag { ++ dtag_dvb_network_name = 0x40, ++ dtag_dvb_service_list = 0x41, ++ dtag_dvb_stuffing = 0x42, ++ dtag_dvb_satellite_delivery_system = 0x43, ++ dtag_dvb_cable_delivery_system = 0x44, ++ dtag_dvb_vbi_data = 0x45, ++ dtag_dvb_vbi_teletext = 0x46, ++ dtag_dvb_bouquet_name = 0x47, ++ dtag_dvb_service = 0x48, ++ dtag_dvb_country_availability = 0x49, ++ dtag_dvb_linkage = 0x4a, ++ dtag_dvb_nvod_reference = 0x4b, ++ dtag_dvb_time_shifted_service = 0x4c, ++ dtag_dvb_short_event = 0x4d, ++ dtag_dvb_extended_event = 0x4e, ++ dtag_dvb_time_shifted_event = 0x4f, ++ dtag_dvb_component = 0x50, ++ dtag_dvb_mosaic = 0x51, ++ dtag_dvb_stream_identifier = 0x52, ++ dtag_dvb_ca_identifier = 0x53, ++ dtag_dvb_content = 0x54, ++ dtag_dvb_parental_rating = 0x55, ++ dtag_dvb_teletext = 0x56, ++ dtag_dvb_telephone = 0x57, ++ dtag_dvb_local_time_offset = 0x58, ++ dtag_dvb_subtitling = 0x59, ++ dtag_dvb_terrestial_delivery_system = 0x5a, ++ dtag_dvb_multilingual_network_name = 0x5b, ++ dtag_dvb_multilingual_bouquet_name = 0x5c, ++ dtag_dvb_multilingual_service_name = 0x5d, ++ dtag_dvb_multilingual_component = 0x5e, ++ dtag_dvb_private_data_specifier = 0x5f, ++ dtag_dvb_service_move = 0x60, ++ dtag_dvb_short_smoothing_buffer = 0x61, ++ dtag_dvb_frequency_list = 0x62, ++ dtag_dvb_partial_transport_stream = 0x63, ++ dtag_dvb_data_broadcast = 0x64, ++ dtag_dvb_scrambling = 0x65, ++ dtag_dvb_data_broadcast_id = 0x66, ++ dtag_dvb_transport_stream = 0x67, ++ dtag_dvb_dsng = 0x68, ++ dtag_dvb_pdc = 0x69, ++ dtag_dvb_ac3 = 0x6a, ++ dtag_dvb_ancillary_data = 0x6b, ++ dtag_dvb_cell_list = 0x6c, ++ dtag_dvb_cell_frequency_link = 0x6d, ++ dtag_dvb_announcement_support = 0x6e, ++ dtag_dvb_application_signalling = 0x6f, ++ dtag_dvb_adaptation_field_data = 0x70, ++ dtag_dvb_service_identifier = 0x71, ++ dtag_dvb_service_availability = 0x72, ++ dtag_dvb_default_authority = 0x73, ++ dtag_dvb_related_content = 0x74, ++ dtag_dvb_tva_id = 0x75, ++ dtag_dvb_content_identifier = 0x76, ++ dtag_dvb_time_slice_fec_identifier = 0x77, ++ dtag_dvb_ecm_repetition_rate = 0x78, ++ dtag_dvb_s2_satellite_delivery_descriptor= 0x79, ++ dtag_dvb_enhanced_ac3_descriptor = 0x7a, ++ dtag_dvb_dts_descriptor = 0x7b, ++ dtag_dvb_aac_descriptor = 0x7c, ++ dtag_dvb_extension_descriptor = 0x7f, ++ ++ /* descriptors which may only appear in an RNT */ ++ dtag_dvb_rnt_rar_over_dvb_stream = 0x40, ++ dtag_dvb_rnt_rar_over_ip = 0x41, ++ dtag_dvb_rnt_rnt_scan = 0x42, ++ ++ /* descriptors which may only appear in an AIT */ ++ dtag_dvb_ait_application = 0x00, ++ dtag_dvb_ait_application_name = 0x01, ++ dtag_dvb_ait_transport_protocol = 0x02, ++ dtag_dvb_ait_dvb_j_application = 0x03, ++ dtag_dvb_ait_dvb_j_application_location = 0x04, ++ dtag_dvb_ait_external_application_authorisation = 0x05, ++ dtag_dvb_ait_dvb_html_application = 0x08, ++ dtag_dvb_ait_dvb_html_application_location = 0x09, ++ dtab_dvb_ait_dvb_html_application_boundary = 0x0a, ++ dtag_dvb_ait_application_icons = 0x0b, ++ dtag_dvb_ait_prefetch = 0x0c, ++ dtag_dvb_ait_dii_location = 0x0d, ++ dtag_dvb_ait_ip_signalling = 0x11, ++ ++ /* descriptors which may only appear in INT */ ++ dtag_dvb_target_ip_address = 0x09, ++ dtag_dvb_target_ipv6_address = 0x0a, ++ dtag_dvb_ip_mac_platform_name = 0x0c, ++ dtag_dvb_ip_mac_platform_provider_name = 0x0d, ++ dtag_dvb_target_ip_slash = 0x0f, ++ dtag_dvb_target_ip_source_slash = 0x10, ++ dtag_dvb_target_ipv6_slash = 0x11, ++ dtag_dvb_target_ipv6_source_slash = 0x12, ++ dtag_dvb_ip_mac_stream_location = 0x13, ++ ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dit_section.c dvb-apps/lib/libucsi/dvb/dit_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dit_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/dit_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,32 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_dit_section * dvb_dit_section_codec(struct section * section) ++{ ++ struct dvb_dit_section * ret = (struct dvb_dit_section *)section; ++ ++ if (section->length < 1) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dit_section.h dvb-apps/lib/libucsi/dvb/dit_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dit_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/dit_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DIT_SECTION_H ++#define _UCSI_DVB_DIT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_dit_section structure. ++ */ ++struct dvb_dit_section { ++ struct section head; ++ ++ EBIT2(uint8_t transition_flag : 1; , ++ uint8_t reserved : 7; ); ++}; ++ ++/** ++ * Process a dvb_dit_section. ++ * ++ * @param section Pointer to a generic section header. ++ * @return Pointer to a dvb_dit_section, or NULL on error. ++ */ ++struct dvb_dit_section * dvb_dit_section_codec(struct section *section); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dsng_descriptor.h dvb-apps/lib/libucsi/dvb/dsng_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/dsng_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/dsng_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,80 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_DSNG_DESCRIPTOR ++#define _UCSI_DVB_DSNG_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_dsng_descriptor structure. ++ */ ++struct dvb_dsng_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_dsng_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to a dvb_dsng_descriptor, or NULL on error. ++ */ ++static inline struct dvb_dsng_descriptor* ++ dvb_dsng_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_dsng_descriptor*) d; ++} ++ ++/** ++ * Accessor for the data field in a dvb_dsng_descriptor. ++ * ++ * @param d dvb_dsng_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t *dvb_dsng_descriptor_data(struct dvb_dsng_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_dsng_descriptor); ++} ++ ++/** ++ * Determine the length of the data field in a dvb_dsng_descriptor. ++ * ++ * @param d dvb_dsng_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int dvb_dsng_descriptor_data_length(struct dvb_dsng_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/eit_section.c dvb-apps/lib/libucsi/dvb/eit_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/eit_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/eit_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_eit_section *dvb_eit_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct dvb_eit_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ bswap16(buf + pos); ++ pos += 4; ++ ++ while (pos < len) { ++ struct dvb_eit_event * event = ++ (struct dvb_eit_event *) (buf + pos); ++ ++ if ((pos + sizeof(struct dvb_eit_event)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 10); ++ ++ pos += sizeof(struct dvb_eit_event); ++ ++ if ((pos + event->descriptors_loop_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, event->descriptors_loop_length)) ++ return NULL; ++ ++ pos += event->descriptors_loop_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct dvb_eit_section *) ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/eit_section.h dvb-apps/lib/libucsi/dvb/eit_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/eit_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/eit_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,160 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_EIT_SECTION_H ++#define _UCSI_DVB_EIT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++ ++/** ++ * dvb_eit_section structure. ++ */ ++struct dvb_eit_section { ++ struct section_ext head; ++ ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint8_t segment_last_section_number; ++ uint8_t last_table_id; ++ /* struct eit_event events[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the events field of a dvb_eit_section. ++ */ ++struct dvb_eit_event { ++ uint16_t event_id; ++ dvbdate_t start_time; ++ dvbduration_t duration; ++ EBIT3(uint16_t running_status : 3; , ++ uint16_t free_ca_mode : 1; , ++ uint16_t descriptors_loop_length:12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_eit_section. ++ * ++ * @param section Pointer to a generic section_ext structure. ++ * @return Pointer to a dvb_eit_section, or NULL on error. ++ */ ++struct dvb_eit_section *dvb_eit_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the service_id field of an EIT. ++ * ++ * @param eit EIT pointer. ++ * @return The service_id. ++ */ ++static inline uint16_t dvb_eit_section_service_id(struct dvb_eit_section *eit) ++{ ++ return eit->head.table_id_ext; ++} ++ ++/** ++ * Iterator for the events field of a dvb_eit_section. ++ * ++ * @param eit dvb_eit_section pointer. ++ * @param pos Variable containing a pointer to the current dvb_eit_event. ++ */ ++#define dvb_eit_section_events_for_each(eit, pos) \ ++ for ((pos) = dvb_eit_section_events_first(eit); \ ++ (pos); \ ++ (pos) = dvb_eit_section_events_next(eit, pos)) ++ ++/** ++ * Iterator for the descriptors field of a dvb_eit_event. ++ * ++ * @param eit dvb_eit_event pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define dvb_eit_event_descriptors_for_each(event, pos) \ ++ for ((pos) = dvb_eit_event_descriptors_first(event); \ ++ (pos); \ ++ (pos) = dvb_eit_event_descriptors_next(event, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_eit_event * ++ dvb_eit_section_events_first(struct dvb_eit_section *eit) ++{ ++ size_t pos = sizeof(struct dvb_eit_section); ++ ++ if (pos >= section_ext_length(&eit->head)) ++ return NULL; ++ ++ return (struct dvb_eit_event*) ((uint8_t *) eit + pos); ++} ++ ++static inline struct dvb_eit_event * ++ dvb_eit_section_events_next(struct dvb_eit_section *eit, ++ struct dvb_eit_event *pos) ++{ ++ uint8_t *end = (uint8_t*) eit + section_ext_length(&eit->head); ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_eit_event) + ++ pos->descriptors_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_eit_event *) next; ++} ++ ++static inline struct descriptor * ++ dvb_eit_event_descriptors_first(struct dvb_eit_event * t) ++{ ++ if (t->descriptors_loop_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) t + sizeof(struct dvb_eit_event)); ++} ++ ++static inline struct descriptor * ++ dvb_eit_event_descriptors_next(struct dvb_eit_event * t, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) t + sizeof(struct dvb_eit_event), ++ t->descriptors_loop_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/extended_event_descriptor.h dvb-apps/lib/libucsi/dvb/extended_event_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/extended_event_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/extended_event_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,232 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_EXTENDED_EVENT_DESCRIPTOR ++#define _UCSI_DVB_EXTENDED_EVENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_extended_event_descriptor structure. ++ */ ++struct dvb_extended_event_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t descriptor_number : 4; , ++ uint8_t last_descriptor_number : 4; ); ++ iso639lang_t language_code; ++ uint8_t length_of_items; ++ /* struct dvb_extended_event_item items[] */ ++ /* struct dvb_extended_event_descriptor_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the items field of a dvb_extended_event_descriptor. ++ */ ++struct dvb_extended_event_item { ++ uint8_t item_description_length; ++ /* uint8_t item_description[] */ ++ /* struct dvb_extended_event_item_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * The second part of a dvb_extended_event_item, following the variable length ++ * description field. ++ */ ++struct dvb_extended_event_item_part2 { ++ uint8_t item_length; ++ /* uint8_t item[] */ ++} __ucsi_packed; ++ ++/** ++ * The second part of a dvb_extended_event_descriptor, following the variable ++ * length items field. ++ */ ++struct dvb_extended_event_descriptor_part2 { ++ uint8_t text_length; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_extended_event_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_extended_event_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_extended_event_descriptor* ++ dvb_extended_event_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ struct dvb_extended_event_descriptor * p = ++ (struct dvb_extended_event_descriptor *) d; ++ struct dvb_extended_event_descriptor_part2 *p2; ++ ++ pos += sizeof(struct dvb_extended_event_descriptor) - 2; ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p->length_of_items; ++ ++ if (pos > len) ++ return NULL; ++ ++ p2 = (struct dvb_extended_event_descriptor_part2*) (buf+pos); ++ ++ pos += sizeof(struct dvb_extended_event_descriptor_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p2->text_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return p; ++} ++ ++/** ++ * Iterator for the items field of a dvb_extended_event_descriptor. ++ * ++ * @param d dvb_extended_event_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_extended_event_item. ++ */ ++#define dvb_extended_event_descriptor_items_for_each(d, pos) \ ++ for ((pos) = dvb_extended_event_descriptor_items_first(d); \ ++ (pos); \ ++ (pos) = dvb_extended_event_descriptor_items_next(d, pos)) ++ ++/** ++ * Accessor for the description field of a dvb_extended_event_item. ++ * ++ * @param d dvb_extended_event_item pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_extended_event_item_description(struct dvb_extended_event_item *d) ++{ ++ return (uint8_t*) d + sizeof(struct dvb_extended_event_item); ++} ++ ++/** ++ * Accessor for the second part of a dvb_extended_event_item. ++ * ++ * @param dvb_extended_event_item pointer. ++ * @return dvb_extended_event_item_part2 pointer. ++ */ ++static inline struct dvb_extended_event_item_part2* ++ dvb_extended_event_item_part2(struct dvb_extended_event_item *d) ++{ ++ return (struct dvb_extended_event_item_part2*) ++ ((uint8_t*) d + sizeof(struct dvb_extended_event_item) + ++ d->item_description_length); ++} ++ ++/** ++ * Accessor for the item field of a dvb_extended_event_item_part2. ++ * ++ * @param d dvb_extended_event_item_part2 pointer. ++ * @return Pointer to the item field. ++ */ ++static inline uint8_t* ++ dvb_extended_event_item_part2_item(struct dvb_extended_event_item_part2 *d) ++{ ++ return (uint8_t*) d + sizeof(struct dvb_extended_event_item_part2); ++} ++ ++/** ++ * Accessor for the second part of a dvb_extended_event_descriptor. ++ * ++ * @param d dvb_extended_event_descriptor pointer. ++ * @return dvb_extended_event_descriptor_part2 pointer. ++ */ ++static inline struct dvb_extended_event_descriptor_part2* ++ dvb_extended_event_descriptor_part2(struct dvb_extended_event_descriptor *d) ++{ ++ return (struct dvb_extended_event_descriptor_part2*) ++ ((uint8_t*) d + sizeof(struct dvb_extended_event_descriptor) + ++ d->length_of_items); ++} ++ ++/** ++ * Accessor for the text field of an dvb_extended_event_descriptor_part2. ++ * ++ * @param d dvb_extended_event_descriptor_part2 pointer. ++ * @return Pointer to the text field. ++ */ ++static inline uint8_t* ++ dvb_extended_event_descriptor_part2_text(struct dvb_extended_event_descriptor_part2 *d) ++{ ++ return (uint8_t*) ++ ((uint8_t*) d + sizeof(struct dvb_extended_event_descriptor_part2)); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_extended_event_item* ++ dvb_extended_event_descriptor_items_first(struct dvb_extended_event_descriptor *d) ++{ ++ if (d->length_of_items == 0) ++ return NULL; ++ ++ return (struct dvb_extended_event_item *) ++ ((uint8_t*) d + sizeof(struct dvb_extended_event_descriptor)); ++} ++ ++static inline struct dvb_extended_event_item* ++ dvb_extended_event_descriptor_items_next(struct dvb_extended_event_descriptor *d, ++ struct dvb_extended_event_item *pos) ++{ ++ struct dvb_extended_event_item_part2* part2 = ++ dvb_extended_event_item_part2(pos); ++ uint8_t *end = (uint8_t*) d + sizeof(struct dvb_extended_event_descriptor) + d->length_of_items; ++ uint8_t *next = (uint8_t *) part2 + ++ sizeof(struct dvb_extended_event_item_part2) + ++ part2->item_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_extended_event_item *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/frequency_list_descriptor.h dvb-apps/lib/libucsi/dvb/frequency_list_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/frequency_list_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/frequency_list_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,107 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_FREQUENCY_LIST_DESCRIPTOR ++#define _UCSI_DVB_FREQUENCY_LIST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for coding_type. ++ */ ++enum { ++ DVB_CODING_TYPE_SATELLITE = 0x01, ++ DVB_CODING_TYPE_CABLE = 0x02, ++ DVB_CODING_TYPE_TERRESTRIAL = 0x03, ++}; ++ ++/** ++ * dvb_frequency_list_descriptor structure. ++ */ ++struct dvb_frequency_list_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 6; , ++ uint8_t coding_type : 2; ); ++ /* uint32_t centre_frequencies [] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_frequency_list_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return dvb_frequency_list_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_frequency_list_descriptor* ++ dvb_frequency_list_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ pos += sizeof(struct dvb_frequency_list_descriptor) - 2; ++ ++ if ((len - pos) % 4) ++ return NULL; ++ ++ while(pos < len) { ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ return (struct dvb_frequency_list_descriptor*) d; ++} ++ ++/** ++ * Accessor for the centre_frequencies field of a dvb_frequency_list_descriptor. ++ * ++ * @param d dvb_frequency_list_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint32_t * ++ dvb_frequency_list_descriptor_centre_frequencies(struct dvb_frequency_list_descriptor *d) ++{ ++ return (uint32_t *) ((uint8_t *) d + sizeof(struct dvb_frequency_list_descriptor)); ++} ++ ++/** ++ * Determine the number of entries in the centre_frequencies field of a dvb_frequency_list_descriptor. ++ * ++ * @param d dvb_frequency_list_descriptor pointer. ++ * @return The number of entries. ++ */ ++static inline int ++ dvb_frequency_list_descriptor_centre_frequencies_count(struct dvb_frequency_list_descriptor *d) ++{ ++ return (d->d.len - 1) >> 2; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/int_section.c dvb-apps/lib/libucsi/dvb/int_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/int_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/int_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,79 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2005 Patrick Boettcher (pb@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_int_section * dvb_int_section_codec(struct section_ext *ext) ++{ ++ uint8_t *buf = (uint8_t *) ext; ++ struct dvb_int_section *in = (struct dvb_int_section *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct dvb_int_section)) ++ return NULL; ++ ++ bswap32(buf+8); ++ bswap16(buf+12); ++ pos += 6; ++ ++ if (len - pos < in->platform_descriptors_length) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, in->platform_descriptors_length)) ++ return NULL; ++ ++ pos += in->platform_descriptors_length; ++ ++ while (pos < len) { ++ struct dvb_int_target *s2 = (struct dvb_int_target *) (buf + pos); ++ struct dvb_int_operational_loop *s3; ++ ++ bswap16(buf + pos); /* target_descriptor_loop_length swap */ ++ ++ if (len - pos < s2->target_descriptors_length) ++ return NULL; ++ ++ pos += sizeof(struct dvb_int_target); ++ ++ if (verify_descriptors(buf + pos, s2->target_descriptors_length)) ++ return NULL; ++ ++ pos += s2->target_descriptors_length; ++ ++ s3 = (struct dvb_int_operational_loop *) (buf + pos); ++ ++ bswap16(buf + pos); /* operational_descriptor_loop_length swap */ ++ ++ if (len - pos < s3->operational_descriptors_length) ++ return NULL; ++ ++ pos += sizeof(struct dvb_int_operational_loop); ++ ++ if (verify_descriptors(buf + pos, s3->operational_descriptors_length)) ++ return NULL; ++ ++ pos += s3->operational_descriptors_length; ++ } ++ ++ return (struct dvb_int_section *) ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/int_section.h dvb-apps/lib/libucsi/dvb/int_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/int_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/int_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,245 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2005 Patrick Boettcher (pb@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++#ifndef _UCSI_DVB_INT_SECTION_H ++#define _UCSI_DVB_INT_SECTION_H ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_int_section structure - IP/MAC notification section. ++ */ ++struct dvb_int_section { ++ struct section_ext head; ++ ++ EBIT2(uint32_t platform_id :24; , ++ uint32_t processing_order : 8; ); ++ EBIT2(uint16_t reserved2 : 4; , ++ uint16_t platform_descriptors_length :12; ); ++ /* struct descriptor platform_descriptors[] */ ++ /* struct dvb_int_target target_loop[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the target_loop field of a dvb_int_section. ++ */ ++struct dvb_int_target { ++ EBIT2(uint16_t reserved3 : 4; , ++ uint16_t target_descriptors_length :12; ); ++ /* struct descriptor target_descriptors[] */ ++ /* struct dvb_int_operational_loop operational_loop */ ++} __ucsi_packed; ++ ++/** ++ * The operational_loop field in a dvb_int_target. ++ */ ++struct dvb_int_operational_loop { ++ EBIT2(uint16_t reserved4 : 4; , ++ uint16_t operational_descriptors_length :12; ); ++ /* struct descriptor operational_descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_int_section. ++ * ++ * @param section Generic section_ext pointer. ++ * @return dvb_int_section pointer, or NULL on error. ++ */ ++extern struct dvb_int_section * dvb_int_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the action_type field of an INT. ++ * ++ * @param intp INT pointer. ++ * @return The action_type. ++ */ ++static inline uint8_t dvb_int_section_action_type(struct dvb_int_section *intp) ++{ ++ return intp->head.table_id_ext >> 8; ++} ++ ++/** ++ * Accessor for the platform_id_hash field of an INT. ++ * ++ * @param intp INT pointer. ++ * @return The platform_id_hash. ++ */ ++static inline uint8_t dvb_int_section_platform_id_hash(struct dvb_int_section *intp) ++{ ++ return intp->head.table_id_ext & 0xff; ++} ++ ++/** ++ * Iterator for platform_descriptors field in a dvb_int_section. ++ * ++ * @param intp dvb_int_section pointer. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define dvb_int_section_platform_descriptors_for_each(intp, pos) \ ++ for ((pos) = dvb_int_section_platform_descriptors_first(intp); \ ++ (pos); \ ++ (pos) = dvb_int_section_platform_descriptors_next(intp, pos)) ++ ++/** ++ * Iterator for the target_loop field in a dvb_int_section. ++ * ++ * @param intp dvb_int_section pointer. ++ * @param pos Variable holding a pointer to the current dvb_int_target. ++ */ ++#define dvb_int_section_target_loop_for_each(intp,pos) \ ++ for ((pos) = dvb_int_section_target_loop_first(intp); \ ++ (pos); \ ++ (pos) = dvb_int_section_target_loop_next(intp, pos)) ++ ++/** ++ * Iterator for the target_descriptors field in a dvb_int_target. ++ * ++ * @param target dvb_int_target pointer. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define dvb_int_target_target_descriptors_for_each(target, pos) \ ++ for ((pos) = dvb_int_target_target_descriptors_first(target); \ ++ (pos); \ ++ (pos) = dvb_int_target_target_descriptors_next(target, pos)) ++ ++/** ++ * Accessor for the operational_loop field of a dvb_int_target. ++ * ++ * @param target dvb_int_target pointer. ++ * @return Pointer to a dvb_int_operational_loop. ++ */ ++static inline struct dvb_int_operational_loop * ++ dvb_int_target_operational_loop(struct dvb_int_target *target) ++{ ++ return (struct dvb_int_operational_loop *) ++ ((uint8_t *) target + sizeof(struct dvb_int_target) + target->target_descriptors_length); ++} ++ ++/** ++ * Iterator for the operational_descriptors field in a dvb_int_operational_loop. ++ * ++ * @param oploop dvb_int_operational_loop pointer. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define dvb_int_operational_loop_operational_descriptors_for_each(oploop, pos) \ ++ for ((pos) = dvb_int_operational_loop_operational_descriptors_first(oploop); \ ++ (pos); \ ++ (pos) = dvb_int_operational_loop_operational_descriptors_next(oploop, pos)) ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ dvb_int_section_platform_descriptors_first(struct dvb_int_section *in) ++{ ++ if (in->platform_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) in + sizeof(struct dvb_int_section)); ++} ++ ++static inline struct descriptor * ++ dvb_int_section_platform_descriptors_next(struct dvb_int_section *in, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) in + sizeof(struct dvb_int_section), ++ in->platform_descriptors_length, ++ pos); ++} ++ ++static inline struct dvb_int_target * ++ dvb_int_section_target_loop_first(struct dvb_int_section *in) ++{ ++ if (sizeof(struct dvb_int_section) + in->platform_descriptors_length >= (uint32_t) section_ext_length((struct section_ext *) in)) ++ return NULL; ++ ++ return (struct dvb_int_target *) ++ ((uint8_t *) in + sizeof(struct dvb_int_section) + in->platform_descriptors_length); ++} ++ ++static inline struct dvb_int_target * ++ dvb_int_section_target_loop_next(struct dvb_int_section *in, ++ struct dvb_int_target *pos) ++{ ++ struct dvb_int_operational_loop *ol = dvb_int_target_operational_loop(pos); ++ struct dvb_int_target *next = ++ (struct dvb_int_target *) ( (uint8_t *) pos + ++ sizeof(struct dvb_int_target) + pos->target_descriptors_length + ++ sizeof(struct dvb_int_operational_loop) + ol->operational_descriptors_length); ++ struct dvb_int_target *end = ++ (struct dvb_int_target *) ((uint8_t *) in + section_ext_length((struct section_ext *) in) ); ++ ++ if (next >= end) ++ return 0; ++ return next; ++} ++ ++static inline struct descriptor * ++ dvb_int_target_target_descriptors_first(struct dvb_int_target *tl) ++{ ++ if (tl->target_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) tl + sizeof(struct dvb_int_target)); ++} ++ ++static inline struct descriptor * ++ dvb_int_target_target_descriptors_next(struct dvb_int_target *tl, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) tl + sizeof(struct dvb_int_target), ++ tl->target_descriptors_length, ++ pos); ++} ++ ++static inline struct descriptor * ++ dvb_int_operational_loop_operational_descriptors_first(struct dvb_int_operational_loop *ol) ++{ ++ if (ol->operational_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) ol + sizeof(struct dvb_int_operational_loop)); ++} ++ ++static inline struct descriptor * ++ dvb_int_operational_loop_operational_descriptors_next(struct dvb_int_operational_loop *ol, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) ol + sizeof(struct dvb_int_operational_loop), ++ ol->operational_descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_platform_name_descriptor.h dvb-apps/lib/libucsi/dvb/ip_mac_platform_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_platform_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ip_mac_platform_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_IP_MAC_PLATFORM_NAME_DESCRIPTOR ++#define _UCSI_DVB_IP_MAC_PLATFORM_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ip_platform_name_descriptor structure. ++ */ ++struct dvb_ip_platform_name_descriptor { ++ struct descriptor d; ++ ++ iso639lang_t language_code; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ip_platform_name_descriptor. ++ * ++ * @param d Pointer to a generic descriptor. ++ * @return dvb_ip_platform_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ip_platform_name_descriptor* ++ dvb_ip_platform_name_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_ip_platform_name_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_ip_platform_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of a dvb_ip_platform_name_descriptor. ++ * ++ * @param d dvb_ip_platform_name_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_ip_platform_name_descriptor_text(struct dvb_ip_platform_name_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_ip_platform_name_descriptor); ++} ++ ++/** ++ * Determine the length of the text field of a dvb_ip_platform_name_descriptor. ++ * ++ * @param d dvb_ip_platform_name_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_ip_platform_name_descriptor_text_length(struct dvb_ip_platform_name_descriptor *d) ++{ ++ return d->d.len - 3; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h dvb-apps/lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_IP_MAC_PLATFORM_PROVIDER_NAME_DESCRIPTOR ++#define _UCSI_DVB_IP_MAC_PLATFORM_PROVIDER_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ip_platform_provider_name_descriptor structure. ++ */ ++struct dvb_ip_platform_provider_name_descriptor { ++ struct descriptor d; ++ ++ iso639lang_t language_code; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ip_platform_provider_name_descriptor. ++ * ++ * @param d Pointer to a generic descriptor. ++ * @return dvb_ip_platform_provider_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ip_platform_provider_name_descriptor* ++ dvb_ip_platform_provider_name_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_ip_platform_provider_name_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_ip_platform_provider_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the text field of a dvb_ip_platform_provider_name_descriptor. ++ * ++ * @param d dvb_ip_platform_provider_name_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_ip_platform_provider_name_descriptor_text(struct dvb_ip_platform_provider_name_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_ip_platform_provider_name_descriptor); ++} ++ ++/** ++ * Determine the length of the text field of a dvb_ip_platform_provider_name_descriptor. ++ * ++ * @param d dvb_ip_platform_provider_name_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_ip_platform_provider_name_descriptor_text_length(struct dvb_ip_platform_provider_name_descriptor *d) ++{ ++ return d->d.len - 3; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_stream_location_descriptor.h dvb-apps/lib/libucsi/dvb/ip_mac_stream_location_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/ip_mac_stream_location_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/ip_mac_stream_location_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,73 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_IP_MAC_STREAM_LOCATION_DESCRIPTOR ++#define _UCSI_DVB_IP_MAC_PLATFORM_PROVIDER_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_ip_mac_stream_location_descriptor structure. ++ */ ++struct dvb_ip_mac_stream_location_descriptor { ++ struct descriptor d; ++ ++ uint16_t network_id; ++ uint16_t original_network_id; ++ uint16_t transport_stream_id; ++ uint16_t service_id; ++ uint8_t component_tag; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_ip_mac_stream_location_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_ip_mac_stream_location_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_ip_mac_stream_location_descriptor* ++ dvb_ip_mac_stream_location_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ ++ if (d->len != (sizeof(struct dvb_ip_mac_stream_location_descriptor) - 2)) ++ return NULL; ++ ++ bswap16(buf); ++ bswap16(buf+2); ++ bswap16(buf+4); ++ bswap16(buf+6); ++ ++ return (struct dvb_ip_mac_stream_location_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/linkage_descriptor.h dvb-apps/lib/libucsi/dvb/linkage_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/linkage_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/linkage_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,480 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_LINKAGE_DESCRIPTOR ++#define _UCSI_DVB_LINKAGE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Possible values for linkage_type. ++ */ ++enum { ++ DVB_LINKAGE_TYPE_INFORMATION = 0x01, ++ DVB_LINKAGE_TYPE_EPG = 0x02, ++ DVB_LINKAGE_TYPE_CA_REPLACEMENT = 0x03, ++ DVB_LINKAGE_TYPE_TS_WITH_BAT_NIT = 0x04, ++ DVB_LINKAGE_TYPE_SERVICE_REPLACMENT = 0x05, ++ DVB_LINKAGE_TYPE_DATA_BCAST = 0x06, ++ DVB_LINKAGE_TYPE_RCS_MAP = 0x07, ++ DVB_LINKAGE_TYPE_MOBILE_HANDOVER = 0x08, ++ DVB_LINKAGE_TYPE_SOFTWARE_UPDATE = 0x09, ++ DVB_LINKAGE_TYPE_TS_WITH_SSU_BAT_NIT = 0x0a, ++ DVB_LINKAGE_TYPE_IP_MAC_NOTIFICATION = 0x0b, ++ DVB_LINKAGE_TYPE_TS_WITH_INT_BAT_NIT = 0x0c, ++}; ++ ++/** ++ * Possible values for hand_over_type. ++ */ ++enum { ++ DVB_HAND_OVER_TYPE_IDENTICAL_NEIGHBOURING_COUNTRY = 0x01, ++ DVB_HAND_OVER_TYPE_LOCAL_VARIATION = 0x02, ++ DVB_HAND_OVER_TYPE_ASSOCIATED_SERVICE = 0x03, ++}; ++ ++/** ++ * Possible values for origin_type. ++ */ ++enum { ++ DVB_ORIGIN_TYPE_NIT = 0x00, ++ DVB_ORIGIN_TYPE_SDT = 0x01, ++}; ++ ++/** ++ * dvb_linkage_descriptor structure. ++ */ ++struct dvb_linkage_descriptor { ++ struct descriptor d; ++ ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint16_t service_id; ++ uint8_t linkage_type; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Data for a linkage_type of 0x08. ++ */ ++struct dvb_linkage_data_08 { ++ EBIT3(uint8_t hand_over_type : 4; , ++ uint8_t reserved : 3; , ++ uint8_t origin_type : 1; ); ++ /* uint16_t network_id if hand_over_type == 1,2,3 */ ++ /* uint16_t initial_service_id if origin_type = 0 */ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Data for an linkage_type of 0x0b (IP/MAC Notification Table). ++ */ ++struct dvb_linkage_data_0b { ++ uint8_t platform_id_data_length; ++ /* struct platform_id ids[] */ ++} __ucsi_packed; ++ ++/** ++ * Entries in the ids field of a dvb_linkage_data_0b. ++ */ ++struct dvb_platform_id { ++ EBIT2(uint32_t platform_id : 24; , ++ uint8_t platform_name_loop_length : 8; ); ++ /* struct platform_name names[] */ ++} __ucsi_packed; ++ ++/** ++ * Entries in the names field of a dvb_platform_id. ++ */ ++struct dvb_platform_name { ++ iso639lang_t language_code; ++ uint8_t platform_name_length; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Data for a linkage_type of 0x0c (IP/MAC Notification Table). ++ */ ++struct dvb_linkage_data_0c { ++ uint8_t table_type; ++ /* uint16_t bouquet_id if table_type == 0x02 */ ++} __ucsi_packed; ++ ++ ++/** ++ * Process a dvb_linkage_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_linkage_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_linkage_descriptor* ++ dvb_linkage_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ struct dvb_linkage_descriptor *p = ++ (struct dvb_linkage_descriptor*) d; ++ ++ if (len < (sizeof(struct dvb_linkage_descriptor) - 2)) ++ return NULL; ++ ++ bswap16(buf); ++ bswap16(buf+2); ++ bswap16(buf+4); ++ ++ pos += sizeof(struct dvb_linkage_descriptor) - 2; ++ ++ if (p->linkage_type == 0x08) { ++ struct dvb_linkage_data_08 *d08; ++ ++ if ((len - pos) < sizeof(struct dvb_linkage_data_08)) ++ return NULL; ++ d08 = (struct dvb_linkage_data_08 *) (buf+pos); ++ pos += sizeof(struct dvb_linkage_data_08); ++ ++ switch(d08->hand_over_type) { ++ case 1: ++ case 2: ++ case 3: ++ if ((len - pos) < 2) ++ return NULL; ++ bswap16(buf+pos); ++ pos += 2; ++ break; ++ } ++ if (d08->origin_type == 0) { ++ if ((len - pos) < 2) ++ return NULL; ++ bswap16(buf+pos); ++ pos+=2; ++ } ++ ++ } else if (p->linkage_type == 0x0b) { ++ uint32_t pos2=0; ++ struct dvb_linkage_data_0b *l_0b = (struct dvb_linkage_data_0b *) (buf + pos); ++ ++ if ((len - pos) < sizeof(struct dvb_linkage_data_0b)) ++ return NULL; ++ ++ pos += sizeof(struct dvb_linkage_data_0b); ++ if ((len - pos) < l_0b->platform_id_data_length) ++ return NULL; ++ ++ while (pos2 < l_0b->platform_id_data_length) { ++ bswap32(buf + pos + pos2); ++ ++ struct dvb_platform_id *p_id = (struct dvb_platform_id *) (buf + pos + pos2); ++ if ((len - pos - pos2) < p_id->platform_name_loop_length) ++ return NULL; ++ ++ pos2 += sizeof(struct dvb_platform_id) + p_id->platform_name_loop_length; ++ } ++ ++ pos += pos2; ++ } else if (p->linkage_type == 0x0c) { ++ struct dvb_linkage_data_0c *l_0c = (struct dvb_linkage_data_0c *) (buf + pos); ++ ++ if ((len - pos) < sizeof(struct dvb_linkage_data_0c)) ++ return NULL; ++ pos += sizeof(struct dvb_linkage_data_0c); ++ ++ if (l_0c->table_type == 0x02) { ++ if ((len - pos) < 2) ++ return NULL; ++ bswap16(buf+pos); ++ } ++ } ++ ++ return (struct dvb_linkage_descriptor*) d; ++} ++ ++/** ++ * Accessor for the data field of a dvb_linkage_descriptor. ++ * ++ * @param d dvb_linkage_descriptor pointer. ++ * @return Pointer to the data field. ++ */ ++static inline uint8_t * ++ dvb_linkage_descriptor_data(struct dvb_linkage_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_linkage_descriptor); ++} ++ ++/** ++ * Determine the length of the data field of a dvb_linkage_descriptor. ++ * ++ * @param d dvb_linkage_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_linkage_descriptor_data_length(struct dvb_linkage_descriptor *d) ++{ ++ return d->d.len - 7; ++} ++ ++/** ++ * Accessor for a dvb_linkage_data_08 pointer. ++ * ++ * @param d dvb_linkage_descriptor pointer. ++ * @return Pointer to the data field. ++ */ ++static inline struct dvb_linkage_data_08 * ++ dvb_linkage_data_08(struct dvb_linkage_descriptor *d) ++{ ++ if (d->linkage_type != 0x08) ++ return NULL; ++ return (struct dvb_linkage_data_08 *) dvb_linkage_descriptor_data(d); ++} ++ ++/** ++ * Accessor for the network_id field of a dvb_linkage_data_08. ++ * ++ * @param d dvb_linkage_descriptor pointer ++ * @param d08 dvb_linkage_data_08 pointer. ++ * @return network_id, or -1 if not present ++ */ ++static inline int ++ dvb_linkage_data_08_network_id(struct dvb_linkage_descriptor *d, struct dvb_linkage_data_08 *d08) ++{ ++ if (d->linkage_type != 0x08) ++ return -1; ++ ++ switch(d08->hand_over_type) { ++ case 1: ++ case 2: ++ case 3: ++ return *((uint16_t*) ((uint8_t*) d08 + sizeof(struct dvb_linkage_data_08))); ++ } ++ ++ return -1; ++} ++ ++/** ++ * Accessor for the initial_service_id field of a dvb_linkage_data_08. ++ * ++ * @param d dvb_linkage_descriptor pointer ++ * @param d08 dvb_linkage_data_08 pointer. ++ * @return initial_service_id, or -1 if not present ++ */ ++static inline int ++ dvb_linkage_data_08_initial_service_id(struct dvb_linkage_descriptor *d, struct dvb_linkage_data_08 *d08) ++{ ++ uint8_t *pos; ++ ++ if (d->linkage_type != 0x08) ++ return -1; ++ if (d08->origin_type != 0) ++ return -1; ++ ++ pos = ((uint8_t*) d08) + sizeof(struct dvb_linkage_data_08); ++ switch(d08->hand_over_type) { ++ case 1: ++ case 2: ++ case 3: ++ pos +=2; ++ break; ++ } ++ ++ return *((uint16_t*) pos); ++} ++ ++/** ++ * Accessor for the data field of a dvb_linkage_data_08. ++ * ++ * @param d dvb_linkage_descriptor pointer ++ * @param d08 dvb_linkage_data_08 pointer. ++ * @param length Pointer to int destination for data length. ++ * @return Pointer to the data field, or NULL if invalid ++ */ ++static inline uint8_t * ++ dvb_linkage_data_08_data(struct dvb_linkage_descriptor *d, struct dvb_linkage_data_08 *d08, int *length) ++{ ++ uint8_t *pos; ++ int used = 0; ++ ++ if (d->linkage_type != 0x08) { ++ *length = 0; ++ return NULL; ++ } ++ ++ pos = ((uint8_t*) d08) + sizeof(struct dvb_linkage_data_08); ++ switch(d08->hand_over_type) { ++ case 1: ++ case 2: ++ case 3: ++ pos += 2; ++ used += 2; ++ break; ++ } ++ if (d08->origin_type == 0) { ++ pos+=2; ++ used+=2; ++ } ++ ++ *length = dvb_linkage_descriptor_data_length(d) - (sizeof(struct dvb_linkage_data_08) + used); ++ return pos; ++} ++ ++/** ++ * Accessor for a dvb_linkage_data_0b pointer. ++ * ++ * @param d dvb_linkage_descriptor pointer. ++ * @return Pointer to the data field. ++ */ ++static inline struct dvb_linkage_data_0b * ++ dvb_linkage_data_0b(struct dvb_linkage_descriptor *d) ++{ ++ if (d->linkage_type != 0x0b) ++ return NULL; ++ return (struct dvb_linkage_data_0b *) dvb_linkage_descriptor_data(d); ++} ++ ++/** ++ * Iterator for the platform_id field of a dvb_linkage_data_0b. ++ * ++ * @param linkage dvb_linkage_data_0b pointer. ++ * @param pos Variable containing a pointer to the current dvb_platform_id. ++ */ ++#define dvb_linkage_data_0b_platform_id_for_each(linkage, pos) \ ++ for ((pos) = dvb_platform_id_first(linkage); \ ++ (pos); \ ++ (pos) = dvb_platform_id_next(linkage, pos)) ++ ++/** ++ * Iterator for the platform_name field of a dvb_platform_id. ++ * ++ * @param platid dvb_platform_id pointer. ++ * @param pos Variable containing a pointer to the current dvb_platform_name. ++ */ ++#define dvb_platform_id_platform_name_for_each(platid, pos) \ ++ for ((pos) = dvb_platform_name_first(platid); \ ++ (pos); \ ++ (pos) = dvb_platform_name_next(platid, pos)) ++ ++/** ++ * Accessor for the text field of a dvb_platform_name. ++ * ++ * @param p dvb_platform_name pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_platform_name_text(struct dvb_platform_name *p) ++{ ++ return (uint8_t *) p + sizeof(struct dvb_platform_name); ++} ++ ++/** ++ * Accessor for a dvb_linkage_data_0c pointer. ++ * ++ * @param d dvb_linkage_descriptor pointer. ++ * @return Pointer to the data field. ++ */ ++static inline struct dvb_linkage_data_0c * ++ dvb_linkage_data_0c(struct dvb_linkage_descriptor *d) ++{ ++ if (d->linkage_type != 0x0c) ++ return NULL; ++ return (struct dvb_linkage_data_0c *) dvb_linkage_descriptor_data(d); ++} ++ ++/** ++ * Accessor for the bouquet_id field of a dvb_linkage_data_0c if table_id == 0x02. ++ * ++ * @param l_0c dvb_linkage_data_0c pointer. ++ * @return The bouquet field, or -1 on error. ++ */ ++static inline int ++ dvb_linkage_data_0c_bouquet_id(struct dvb_linkage_data_0c *l_0c) ++{ ++ if (l_0c->table_type != 0x02) ++ return -1; ++ ++ return *((uint16_t *) ((uint8_t*) l_0c + 1)); ++} ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_platform_id * ++ dvb_platform_id_first(struct dvb_linkage_data_0b *d) ++{ ++ if (d->platform_id_data_length == 0) ++ return NULL; ++ ++ return (struct dvb_platform_id *) ((uint8_t *) d + sizeof(struct dvb_linkage_data_0b)); ++} ++ ++static inline struct dvb_platform_id * ++ dvb_platform_id_next(struct dvb_linkage_data_0b *d, ++ struct dvb_platform_id *pos) ++{ ++ uint8_t *end = (uint8_t *) d + d->platform_id_data_length; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_platform_id) + ++ pos->platform_name_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_platform_id *) next; ++} ++ ++static inline struct dvb_platform_name * ++ dvb_platform_name_first(struct dvb_platform_id *p) ++{ ++ if (p->platform_name_loop_length == 0) ++ return NULL; ++ ++ return (struct dvb_platform_name *) ((uint8_t *) p + sizeof(struct dvb_platform_id)); ++} ++ ++static inline struct dvb_platform_name * ++ dvb_platform_name_next(struct dvb_platform_id *p, ++ struct dvb_platform_name *pos) ++{ ++ uint8_t *end = (uint8_t *) p + p->platform_name_loop_length; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_platform_name) + ++ pos->platform_name_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_platform_name *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/local_time_offset_descriptor.h dvb-apps/lib/libucsi/dvb/local_time_offset_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/local_time_offset_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/local_time_offset_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,127 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_LOCAL_TIME_OFFSET_DESCRIPTOR ++#define _UCSI_DVB_LOCAL_TIME_OFFSET_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++ ++/** ++ * dvb_local_time_offset_descriptor parameter. ++ */ ++struct dvb_local_time_offset_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_local_time_offset offsets[] */ ++} __ucsi_packed; ++ ++/** ++ * Entry in the offsets field of dvb_local_time_offset_descriptor. ++ */ ++struct dvb_local_time_offset { ++ iso639country_t country_code; ++ EBIT3(uint8_t country_region_id : 6; , ++ uint8_t reserved : 1; , ++ uint8_t local_time_offset_polarity : 1; ); ++ dvbhhmm_t local_time_offset; ++ dvbdate_t time_of_change; ++ dvbhhmm_t next_time_offset; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_local_time_offset_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_local_time_offset_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_local_time_offset_descriptor* ++ dvb_local_time_offset_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ uint32_t pos = 0; ++ ++ if (len % sizeof(struct dvb_local_time_offset)) ++ return NULL; ++ ++ while(pos < len) { ++ pos += sizeof(struct dvb_local_time_offset); ++ } ++ ++ return (struct dvb_local_time_offset_descriptor*) d; ++} ++ ++/** ++ * Iterator for the offsets field of a dvb_local_time_offset_descriptor. ++ * ++ * @param d dvb_local_time_offset_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_local_time_offset. ++ */ ++#define dvb_local_time_offset_descriptor_offsets_for_each(d, pos) \ ++ for ((pos) = dvb_local_time_offset_descriptor_offsets_first(d); \ ++ (pos); \ ++ (pos) = dvb_local_time_offset_descriptor_offsets_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_local_time_offset* ++ dvb_local_time_offset_descriptor_offsets_first(struct dvb_local_time_offset_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_local_time_offset *) ++ ((uint8_t*) d + sizeof(struct dvb_local_time_offset_descriptor)); ++} ++ ++static inline struct dvb_local_time_offset* ++ dvb_local_time_offset_descriptor_offsets_next(struct dvb_local_time_offset_descriptor *d, ++ struct dvb_local_time_offset *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_local_time_offset); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_local_time_offset *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/Makefile dvb-apps/lib/libucsi/dvb/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,123 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libucsi/dvb ++ ++.PHONY: sub-error-dvb ++ ++sub-error-dvb: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += dvb/bat_section.o \ ++ dvb/dit_section.o \ ++ dvb/eit_section.o \ ++ dvb/int_section.o \ ++ dvb/nit_section.o \ ++ dvb/rst_section.o \ ++ dvb/sdt_section.o \ ++ dvb/sit_section.o \ ++ dvb/st_section.o \ ++ dvb/tdt_section.o \ ++ dvb/tot_section.o \ ++ dvb/tva_container_section.o \ ++ dvb/types.o ++ ++sub-install += dvb ++ ++else ++ ++includes = ac3_descriptor.h \ ++ adaptation_field_data_descriptor.h \ ++ ait_application_descriptor.h \ ++ ait_application_icons_descriptor.h \ ++ ait_application_name_descriptor.h \ ++ ait_external_application_authorisation_descriptor.h \ ++ ancillary_data_descriptor.h \ ++ announcement_support_descriptor.h \ ++ application_signalling_descriptor.h \ ++ bat_section.h \ ++ bouquet_name_descriptor.h \ ++ ca_identifier_descriptor.h \ ++ cable_delivery_descriptor.h \ ++ cell_frequency_link_descriptor.h \ ++ cell_list_descriptor.h \ ++ component_descriptor.h \ ++ content_descriptor.h \ ++ content_identifier_descriptor.h \ ++ country_availability_descriptor.h \ ++ data_broadcast_descriptor.h \ ++ data_broadcast_id_descriptor.h \ ++ default_authority_descriptor.h \ ++ descriptor.h \ ++ dit_section.h \ ++ dsng_descriptor.h \ ++ eit_section.h \ ++ extended_event_descriptor.h \ ++ frequency_list_descriptor.h \ ++ int_section.h \ ++ ip_mac_platform_name_descriptor.h \ ++ ip_mac_platform_provider_name_descriptor.h \ ++ ip_mac_stream_location_descriptor.h \ ++ linkage_descriptor.h \ ++ local_time_offset_descriptor.h \ ++ mhp_data_broadcast_id_descriptor.h \ ++ mosaic_descriptor.h \ ++ mpe_fec_section.h \ ++ multilingual_bouquet_name_descriptor.h \ ++ multilingual_component_descriptor.h \ ++ multilingual_network_name_descriptor.h \ ++ multilingual_service_name_descriptor.h \ ++ network_name_descriptor.h \ ++ nit_section.h \ ++ nvod_reference_descriptor.h \ ++ parental_rating_descriptor.h \ ++ partial_transport_stream_descriptor.h \ ++ pdc_descriptor.h \ ++ private_data_specifier_descriptor.h \ ++ related_content_descriptor.h \ ++ rnt_rar_over_dvb_stream_descriptor.h \ ++ rnt_rar_over_ip_descriptor.h \ ++ rnt_rnt_scan_descriptor.h \ ++ rst_section.h \ ++ s2_satellite_delivery_descriptor.h \ ++ satellite_delivery_descriptor.h \ ++ scrambling_descriptor.h \ ++ sdt_section.h \ ++ section.h \ ++ service_availability_descriptor.h \ ++ service_descriptor.h \ ++ service_identifier_descriptor.h \ ++ service_list_descriptor.h \ ++ service_move_descriptor.h \ ++ short_event_descriptor.h \ ++ short_smoothing_buffer_descriptor.h \ ++ sit_section.h \ ++ st_section.h \ ++ stream_identifier_descriptor.h \ ++ stuffing_descriptor.h \ ++ subtitling_descriptor.h \ ++ target_ip_address_descriptor.h \ ++ target_ipv6_address_descriptor.h \ ++ target_ip_slash_descriptor.h \ ++ target_ip_source_slash_descriptor.h \ ++ target_ipv6_slash_descriptor.h \ ++ target_ipv6_source_slash_descriptor.h \ ++ tdt_section.h \ ++ telephone_descriptor.h \ ++ teletext_descriptor.h \ ++ terrestrial_delivery_descriptor.h \ ++ time_shifted_event_descriptor.h \ ++ time_shifted_service_descriptor.h \ ++ time_slice_fec_identifier_descriptor.h \ ++ tot_section.h \ ++ transport_stream_descriptor.h \ ++ tva_container_section.h \ ++ tva_id_descriptor.h \ ++ types.h \ ++ vbi_data_descriptor.h \ ++ vbi_teletext_descriptor.h ++ ++include ../../../Make.rules ++ ++lib_name = libucsi/dvb ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h dvb-apps/lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,110 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MHP_DATA_BROADCAST_ID_DESCRIPTOR ++#define _UCSI_DVB_MHP_DATA_BROADCAST_ID_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#ifndef _UCSI_DVB_DATA_BROADCAST_ID_DESCRIPTOR ++#error Must include dvb/data_broadcast_id_descriptor.h first ++#endif ++ ++/** ++ * Broadcast IDs for MHP. ++ */ ++enum { ++ DVB_BROADCAST_ID_MHP_OBJECT_CAROUSEL = 0x00f0, ++ DVB_BROADCAST_ID_MHP_MPE = 0x00f1, ++}; ++ ++/** ++ * dvb_mhp_data_broadcast_id_descriptor structure. ++ */ ++struct dvb_mhp_data_broadcast_id_descriptor { ++ struct dvb_data_broadcast_id_descriptor d; ++ /* uint16_t application_type[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_mhp_data_broadcast_id_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_mhp_data_broadcast_id_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_mhp_data_broadcast_id_descriptor* ++ dvb_mhp_data_broadcast_id_descriptor_codec(struct dvb_data_broadcast_id_descriptor* d) ++{ ++ uint8_t * buf; ++ int len; ++ int pos = 0; ++ struct dvb_mhp_data_broadcast_id_descriptor *res = ++ (struct dvb_mhp_data_broadcast_id_descriptor *) d; ++ ++ if ((res->d.data_broadcast_id < 0xf0) || (res->d.data_broadcast_id > 0xfe)) ++ return NULL; ++ ++ buf = dvb_data_broadcast_id_descriptor_id_selector_byte(d); ++ len = dvb_data_broadcast_id_descriptor_id_selector_byte_length(d); ++ ++ if (len % 2) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos+=2; ++ } ++ ++ return res; ++} ++ ++/** ++ * Accessor for the application_type field of a dvb_mhp_data_broadcast_id_descriptor. ++ * ++ * @param d dvb_mhp_data_broadcast_id_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint16_t * ++ dvb_mhp_data_broadcast_id_descriptor_id_application_type(struct dvb_mhp_data_broadcast_id_descriptor *d) ++{ ++ return (uint16_t *) dvb_data_broadcast_id_descriptor_id_selector_byte((struct dvb_data_broadcast_id_descriptor*) d); ++} ++ ++/** ++ * Determine the number of entries in the application_type field of a dvb_mhp_data_broadcast_id_descriptor. ++ * ++ * @param d dvb_data_broadcast_id_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_mhp_data_broadcast_id_descriptor_id_application_type_count(struct dvb_mhp_data_broadcast_id_descriptor *d) ++{ ++ return dvb_data_broadcast_id_descriptor_id_selector_byte_length((struct dvb_data_broadcast_id_descriptor*) d) >> 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mosaic_descriptor.h dvb-apps/lib/libucsi/dvb/mosaic_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mosaic_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/mosaic_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,324 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MOSAIC_DESCRIPTOR ++#define _UCSI_DVB_MOSAIC_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_mosaic_descriptor structure. ++ */ ++struct dvb_mosaic_descriptor { ++ struct descriptor d; ++ ++ EBIT4(uint8_t mosaic_entry_point : 1; , ++ uint8_t number_of_horiz_elementary_cells: 3; , ++ uint8_t reserved : 1; , ++ uint8_t number_of_vert_elementary_cells : 3; ); ++ /* struct dvb_mosaic_info infos[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the infos field of a dvb_mosaic_descriptor. ++ */ ++struct dvb_mosaic_info { ++ EBIT3(uint16_t logical_cell_id : 6; , ++ uint16_t reserved : 7; , ++ uint16_t logical_cell_presentation_info : 3; ); ++ uint8_t elementary_cell_field_length; ++ /* struct dvb_mosaic_elementary_cell_field fields[] */ ++ /* struct dvb_mosaic_info_part2 part2 */ ++ /* struct dvb_mosaic_linkage linkage */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the fields field of a dvb_mosaic_info. ++ */ ++struct dvb_mosaic_elementary_cell_field { ++ EBIT2(uint8_t reserved : 2; , ++ uint8_t elementary_cell_id : 6; ); ++} __ucsi_packed; ++ ++/** ++ * Part2 of dvb_mosaic_info, following the variable length fields field. ++ */ ++struct dvb_mosaic_info_part2 { ++ uint8_t cell_linkage_info; ++} __ucsi_packed; ++ ++struct dvb_mosaic_linkage_01 { ++ uint16_t bouquet_id; ++} __ucsi_packed; ++ ++struct dvb_mosaic_linkage_02 { ++ uint16_t original_network_id; ++ uint16_t transport_stream_id; ++ uint16_t service_id; ++} __ucsi_packed; ++ ++struct dvb_mosaic_linkage_03 { ++ uint16_t original_network_id; ++ uint16_t transport_stream_id; ++ uint16_t service_id; ++} __ucsi_packed; ++ ++struct dvb_mosaic_linkage_04 { ++ uint16_t original_network_id; ++ uint16_t transport_stream_id; ++ uint16_t service_id; ++ uint16_t event_id; ++} __ucsi_packed; ++ ++/** ++ * Structure describing the linkage field of a dvb_mosaic_info ++ */ ++struct dvb_mosaic_linkage { ++ union { ++ struct dvb_mosaic_linkage_01 linkage_01; ++ struct dvb_mosaic_linkage_02 linkage_02; ++ struct dvb_mosaic_linkage_03 linkage_03; ++ struct dvb_mosaic_linkage_04 linkage_04; ++ } u; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_mosaic_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ */ ++static inline struct dvb_mosaic_descriptor* ++ dvb_mosaic_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ struct dvb_mosaic_descriptor * p = ++ (struct dvb_mosaic_descriptor *) d; ++ ++ pos += (sizeof(struct dvb_mosaic_descriptor) - 2); ++ ++ if (pos > len) ++ return NULL; ++ ++ while(pos < len) { ++ struct dvb_mosaic_info *e = ++ (struct dvb_mosaic_info*) (buf+pos); ++ struct dvb_mosaic_info_part2 *e2; ++ struct dvb_mosaic_linkage *linkage; ++ ++ if ((pos + sizeof(struct dvb_mosaic_info)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ ++ pos += sizeof(struct dvb_mosaic_info) + ++ e->elementary_cell_field_length; ++ ++ if (pos > len) ++ return NULL; ++ ++ e2 = (struct dvb_mosaic_info_part2*) (buf+pos); ++ ++ pos += sizeof(struct dvb_mosaic_info_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ linkage = (struct dvb_mosaic_linkage*) (buf+pos); ++ ++ switch(e2->cell_linkage_info) { ++ case 0x01: ++ if ((pos + sizeof(struct dvb_mosaic_linkage_01)) > len) ++ return NULL; ++ bswap16(buf+pos); ++ pos += sizeof(struct dvb_mosaic_linkage_01); ++ break; ++ ++ case 0x02: ++ if ((pos + sizeof(struct dvb_mosaic_linkage_02)) > len) ++ return NULL; ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ pos += sizeof(struct dvb_mosaic_linkage_02); ++ break; ++ ++ case 0x03: ++ if ((pos + sizeof(struct dvb_mosaic_linkage_03)) > len) ++ return NULL; ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ pos += sizeof(struct dvb_mosaic_linkage_03); ++ break; ++ ++ case 0x04: ++ if ((pos + sizeof(struct dvb_mosaic_linkage_04)) > len) ++ return NULL; ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ bswap16(buf+pos+6); ++ pos += sizeof(struct dvb_mosaic_linkage_04); ++ break; ++ } ++ } ++ ++ return p; ++} ++ ++/** ++ * Iterator over the infos field of a dvb_mosaic_descriptor. ++ * ++ * @param d dvb_mosaic_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_mosaic_info. ++ */ ++#define dvb_mosaic_descriptor_infos_for_each(d, pos) \ ++ for ((pos) = dvb_mosaic_descriptor_infos_first(d); \ ++ (pos); \ ++ (pos) = dvb_mosaic_descriptor_infos_next(d, pos)) ++ ++/** ++ * Iterator over the fields field of a dvb_mosaic_info. ++ * ++ * @param info dvb_mosaic_info pointer. ++ * @param pos Variable containing a pointer to the current dvb_mosaic_elementary_cell_field. ++ */ ++#define dvb_mosaic_info_fields_for_each(info, pos) \ ++ for ((pos) = dvb_mosaic_info_fields_first(info); \ ++ (pos); \ ++ (pos) = dvb_mosaic_info_fields_next(info, pos)) ++ ++/** ++ * Accessor for the second part of the dvb_mosaic_info structure. ++ * ++ * @param entry dvb_mosaic_info pointer. ++ * @return dvb_mosaic_info_part2 pointer. ++ */ ++static inline struct dvb_mosaic_info_part2* ++ dvb_mosaic_info_part2(struct dvb_mosaic_info* entry) ++{ ++ return (struct dvb_mosaic_info_part2*) ++ ((uint8_t*) entry + sizeof(struct dvb_mosaic_info) + ++ entry->elementary_cell_field_length); ++} ++ ++/** ++ * Accessor for the linkage field a dvb_mosaic_info structure. ++ * ++ * @param entry dvb_mosaic_info_part2 pointer. ++ * @return dvb_mosaic_linkage pointer, or NULL on error. ++ */ ++static inline struct dvb_mosaic_linkage* ++ dvb_mosaic_linkage(struct dvb_mosaic_info_part2* entry) ++{ ++ if ((entry->cell_linkage_info != 0x01) && ++ (entry->cell_linkage_info != 0x02) && ++ (entry->cell_linkage_info != 0x03) && ++ (entry->cell_linkage_info != 0x04)) ++ return NULL; ++ ++ return (struct dvb_mosaic_linkage*) ++ ((uint8_t*) entry + sizeof(struct dvb_mosaic_info_part2)); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_mosaic_info* ++ dvb_mosaic_descriptor_infos_first(struct dvb_mosaic_descriptor *d) ++{ ++ if (d->d.len == 1) ++ return NULL; ++ ++ return (struct dvb_mosaic_info *) ++ ((uint8_t*) d + sizeof(struct dvb_mosaic_descriptor)); ++} ++ ++static inline struct dvb_mosaic_info* ++ dvb_mosaic_descriptor_infos_next(struct dvb_mosaic_descriptor *d, ++ struct dvb_mosaic_info *pos) ++{ ++ struct dvb_mosaic_info_part2* part2 = dvb_mosaic_info_part2(pos); ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_mosaic_info) + ++ pos->elementary_cell_field_length + ++ sizeof(struct dvb_mosaic_info_part2); ++ ++ if (part2->cell_linkage_info == 0x01) ++ next += sizeof(struct dvb_mosaic_linkage_01); ++ else if (part2->cell_linkage_info == 0x02) ++ next += sizeof(struct dvb_mosaic_linkage_02); ++ else if (part2->cell_linkage_info == 0x03) ++ next += sizeof(struct dvb_mosaic_linkage_03); ++ else if (part2->cell_linkage_info == 0x04) ++ next += sizeof(struct dvb_mosaic_linkage_04); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_mosaic_info *) next; ++} ++ ++static inline struct dvb_mosaic_elementary_cell_field* ++ dvb_mosaic_info_fields_first(struct dvb_mosaic_info *d) ++{ ++ if (d->elementary_cell_field_length == 0) ++ return NULL; ++ ++ return (struct dvb_mosaic_elementary_cell_field*) ++ ((uint8_t*) d + sizeof(struct dvb_mosaic_info)); ++} ++ ++static inline struct dvb_mosaic_elementary_cell_field* ++ dvb_mosaic_info_fields_next(struct dvb_mosaic_info *d, ++ struct dvb_mosaic_elementary_cell_field* pos) ++{ ++ uint8_t *end = (uint8_t*) d + sizeof(struct dvb_mosaic_info) + ++ d->elementary_cell_field_length; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_mosaic_elementary_cell_field); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_mosaic_elementary_cell_field *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mpe_fec_section.h dvb-apps/lib/libucsi/dvb/mpe_fec_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/mpe_fec_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/mpe_fec_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,73 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2008 Patrick Boettcher (pb@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MPE_FEC_SECTION_H ++#define _UCSI_DVB_MPE_FEC_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpe_fec_section structure. TODO ++ */ ++struct mpe_fec_section { ++ struct section head; ++}; ++ ++ ++/** ++ * real_time_paramters ++ * can also be found in datagram_section in MAC4-1-bytes */ ++struct real_time_parameters { ++ EBIT4(uint32_t delta_t : 12; , ++ uint32_t table_boundary : 1; , ++ uint32_t frame_boundary : 1; , ++ uint32_t address : 18; ) ++}; ++ ++ ++static inline struct real_time_parameters * datagram_section_real_time_parameters_codec(struct datagram_section *d) ++{ ++ struct real_time_parameters *rt = (struct real_time_parameters *) &d->MAC_address_4; ++ uint8_t b[4]; ++ b[0] = d->MAC_address_4; ++ b[1] = d->MAC_address_3; ++ b[2] = d->MAC_address_2; ++ b[3] = d->MAC_address_1; ++ ++ rt->delta_t = (b[0] << 4) | ((b[1] >> 4) & 0x0f); ++ rt->table_boundary = (b[1] >> 3) & 0x1; ++ rt->frame_boundary = (b[1] >> 2) & 0x1; ++ rt->address = ((b[1] & 0x3) << 16) | (b[2] << 8) | b[3]; ++ ++ return rt; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h dvb-apps/lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,145 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MULTILINGUAL_BOUQUET_NAME_DESCRIPTOR ++#define _UCSI_DVB_MULTILINGUAL_BOUQUET_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_multilingual_bouquet_name_descriptor structure. ++ */ ++struct dvb_multilingual_bouquet_name_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_multilingual_bouquet_name names[]*/ ++} __ucsi_packed; ++ ++/** ++ * An entry in the names field of a dvb_multilingual_bouquet_name_descriptor. ++ */ ++struct dvb_multilingual_bouquet_name { ++ iso639lang_t language_code; ++ uint8_t bouquet_name_length; ++ /* uint8_t name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_multilingual_bouquet_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_multilingual_bouquet_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_multilingual_bouquet_name_descriptor* ++ dvb_multilingual_bouquet_name_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_multilingual_bouquet_name *e = ++ (struct dvb_multilingual_bouquet_name*) (buf+pos); ++ ++ pos += sizeof(struct dvb_multilingual_bouquet_name); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->bouquet_name_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_multilingual_bouquet_name_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the names field of a dvb_multilingual_bouquet_name_descriptor. ++ * ++ * @param d dvb_multilingual_bouquet_name_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_multilingual_bouquet_name. ++ */ ++#define dvb_multilingual_bouquet_name_descriptor_names_for_each(d, pos) \ ++ for ((pos) = dvb_multilingual_bouquet_name_descriptor_names_first(d); \ ++ (pos); \ ++ (pos) = dvb_multilingual_bouquet_name_descriptor_names_next(d, pos)) ++ ++/** ++ * Accessor for the name field of a dvb_multilingual_bouquet_name. ++ * ++ * @param e dvb_multilingual_bouquet_name pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_multilingual_bouquet_name_name(struct dvb_multilingual_bouquet_name *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_multilingual_bouquet_name); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_multilingual_bouquet_name* ++ dvb_multilingual_bouquet_name_descriptor_names_first(struct dvb_multilingual_bouquet_name_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_multilingual_bouquet_name *) ++ ((uint8_t*) d + sizeof(struct dvb_multilingual_bouquet_name_descriptor)); ++} ++ ++static inline struct dvb_multilingual_bouquet_name* ++ dvb_multilingual_bouquet_name_descriptor_names_next(struct dvb_multilingual_bouquet_name_descriptor *d, ++ struct dvb_multilingual_bouquet_name *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_multilingual_bouquet_name) + ++ pos->bouquet_name_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_multilingual_bouquet_name *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_component_descriptor.h dvb-apps/lib/libucsi/dvb/multilingual_component_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_component_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/multilingual_component_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,149 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MULTILINGUAL_COMPONENT_DESCRIPTOR ++#define _UCSI_DVB_MULTILINGUAL_COMPONENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_multilingual_component_descriptor structure. ++ */ ++struct dvb_multilingual_component_descriptor { ++ struct descriptor d; ++ ++ uint8_t component_tag; ++ /* struct dvb_multilingual_component components[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the components field of a dvb_multilingual_component_descriptor. ++ */ ++struct dvb_multilingual_component { ++ iso639lang_t language_code; ++ uint8_t text_description_length; ++ /* uint8_t text_char[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_multilingual_component_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_multilingual_component_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_multilingual_component_descriptor* ++ dvb_multilingual_component_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = sizeof(struct dvb_multilingual_component_descriptor) - 2; ++ uint32_t len = d->len; ++ ++ if (pos > len) ++ return NULL; ++ ++ while(pos < len) { ++ struct dvb_multilingual_component *e = ++ (struct dvb_multilingual_component*) (buf+pos); ++ ++ pos += sizeof(struct dvb_multilingual_component); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->text_description_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_multilingual_component_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the components field of a dvb_multilingual_component_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_multilingual_component. ++ */ ++#define dvb_multilingual_component_descriptor_components_for_each(d, pos) \ ++ for ((pos) = dvb_multilingual_component_descriptor_components_first(d); \ ++ (pos); \ ++ (pos) = dvb_multilingual_component_descriptor_components_next(d, pos)) ++ ++/** ++ * Accessor for the text_char field in a dvb_multilingual_component. ++ * ++ * @param e dvb_multilingual_component pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_multilingual_component_text_char(struct dvb_multilingual_component *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_multilingual_component); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_multilingual_component* ++ dvb_multilingual_component_descriptor_components_first(struct dvb_multilingual_component_descriptor *d) ++{ ++ if (d->d.len == 1) ++ return NULL; ++ ++ return (struct dvb_multilingual_component *) ++ ((uint8_t*) d + sizeof(struct dvb_multilingual_component_descriptor)); ++} ++ ++static inline struct dvb_multilingual_component* ++ dvb_multilingual_component_descriptor_components_next(struct dvb_multilingual_component_descriptor *d, ++ struct dvb_multilingual_component *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_multilingual_component) + ++ pos->text_description_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_multilingual_component *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_network_name_descriptor.h dvb-apps/lib/libucsi/dvb/multilingual_network_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_network_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/multilingual_network_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,145 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MULTILINGUAL_NETWORK_NAME_DESCRIPTOR ++#define _UCSI_DVB_MULTILINGUAL_NETWORK_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_multilingual_network_name_descriptor structure. ++ */ ++struct dvb_multilingual_network_name_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_multilingual_network_name names[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the names field of a dvb_multilingual_network_name_descriptor. ++ */ ++struct dvb_multilingual_network_name { ++ iso639lang_t language_code; ++ uint8_t network_name_length; ++ /* uint8_t name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_multilingual_network_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_multilingual_network_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_multilingual_network_name_descriptor* ++ dvb_multilingual_network_name_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_multilingual_network_name *e = ++ (struct dvb_multilingual_network_name*) (buf + pos); ++ ++ pos += sizeof(struct dvb_multilingual_network_name); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->network_name_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_multilingual_network_name_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the names field of a dvb_multilingual_network_name_descriptor. ++ * ++ * @param d dvb_multilingual_network_name_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_multilingual_network_name. ++ */ ++#define dvb_multilingual_network_name_descriptor_names_for_each(d, pos) \ ++ for ((pos) = dvb_multilingual_network_name_descriptor_names_first(d); \ ++ (pos); \ ++ (pos) = dvb_multilingual_network_name_descriptor_names_next(d, pos)) ++ ++/** ++ * Accessor for the name field of a dvb_multilingual_network_name. ++ * ++ * @param e dvb_multilingual_network_name pointer. ++ * @return Pointer to the name field. ++ */ ++static inline uint8_t * ++ dvb_multilingual_network_name_name(struct dvb_multilingual_network_name *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_multilingual_network_name); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_multilingual_network_name* ++ dvb_multilingual_network_name_descriptor_names_first(struct dvb_multilingual_network_name_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_multilingual_network_name *) ++ ((uint8_t*) d + sizeof(struct dvb_multilingual_network_name_descriptor)); ++} ++ ++static inline struct dvb_multilingual_network_name* ++ dvb_multilingual_network_name_descriptor_names_next(struct dvb_multilingual_network_name_descriptor *d, ++ struct dvb_multilingual_network_name *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + ++ sizeof(struct dvb_multilingual_network_name) + ++ pos->network_name_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_multilingual_network_name *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_service_name_descriptor.h dvb-apps/lib/libucsi/dvb/multilingual_service_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/multilingual_service_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/multilingual_service_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,197 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_MULTILINGUAL_SERVICE_NAME_DESCRIPTOR ++#define _UCSI_DVB_MULTILINGUAL_SERVICE_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_multilingual_service_name_descriptor structure. ++ */ ++struct dvb_multilingual_service_name_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_multilingual_service_name names[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the service_names field of a dvb_multilingual_service_name_descriptor. ++ */ ++struct dvb_multilingual_service_name { ++ iso639lang_t language_code; ++ uint8_t service_provider_name_length; ++ /* uint8_t service_provider_name[] */ ++ /* struct dvb_multilingual_service_name_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_multilingual_service_name following the variable length ++ * service_provider_name. ++ */ ++struct dvb_multilingual_service_name_part2 { ++ uint8_t service_name_length; ++ /* uint8_t service_name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_multilingual_service_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_multilingual_service_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_multilingual_service_name_descriptor* ++ dvb_multilingual_service_name_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_multilingual_service_name *e = ++ (struct dvb_multilingual_service_name*) (buf+pos); ++ struct dvb_multilingual_service_name_part2 *e2; ++ ++ pos += sizeof(struct dvb_multilingual_service_name); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->service_provider_name_length; ++ ++ if (pos > len) ++ return NULL; ++ ++ e2 = (struct dvb_multilingual_service_name_part2*) (buf+pos); ++ ++ pos += sizeof(struct dvb_multilingual_service_name_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e2->service_name_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_multilingual_service_name_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the service_name field of a dvb_multilingual_service_name_descriptor. ++ * ++ * @param d dvb_multilingual_service_name_descriptor pointer, ++ * @param pos Variable containing pointer to the current dvb_multilingual_service_name. ++ */ ++#define dvb_multilingual_service_name_descriptor_names_for_each(d, pos) \ ++ for ((pos) = dvb_multilingual_service_name_descriptor_names_first(d); \ ++ (pos); \ ++ (pos) = dvb_multilingual_service_name_descriptor_names_next(d, pos)) ++ ++/** ++ * Accessor for the service_provider_name field of a dvb_multilingual_service_name. ++ * ++ * @param e dvb_multilingual_service_name pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_multilingual_service_name_service_provider_name(struct dvb_multilingual_service_name *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_multilingual_service_name); ++} ++ ++/** ++ * Accessor for the dvb_multilingual_service_name_part2 - second part of a ++ * dvb_multilingual_service_name following the service_name field. ++ * ++ * @param e dvb_multilingual_service_name Pointer. ++ * @return dvb_multilingual_service_name_part2 pointer. ++ */ ++static inline struct dvb_multilingual_service_name_part2 * ++ dvb_multilingual_service_name_part2(struct dvb_multilingual_service_name *e) ++{ ++ return (struct dvb_multilingual_service_name_part2 *) ++ ((uint8_t *) e + sizeof(struct dvb_multilingual_service_name) + ++ e->service_provider_name_length); ++} ++ ++/** ++ * Accessor for the service_name field of a dvb_multilingual_service_name_part2. ++ * ++ * @param e dvb_multilingual_service_name_part2 pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_multilingual_service_name_service_name(struct dvb_multilingual_service_name_part2 *e) ++{ ++ return (uint8_t *) e + sizeof(struct dvb_multilingual_service_name_part2); ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_multilingual_service_name* ++ dvb_multilingual_service_name_descriptor_names_first(struct dvb_multilingual_service_name_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_multilingual_service_name *) ++ ((uint8_t*) d + sizeof(struct dvb_multilingual_service_name_descriptor)); ++} ++ ++static inline struct dvb_multilingual_service_name* ++ dvb_multilingual_service_name_descriptor_names_next(struct dvb_multilingual_service_name_descriptor *d, ++ struct dvb_multilingual_service_name *pos) ++{ ++ struct dvb_multilingual_service_name_part2 * part2 = ++ dvb_multilingual_service_name_part2(pos); ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) part2+ ++ sizeof(struct dvb_multilingual_service_name_part2) + ++ part2->service_name_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_multilingual_service_name *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/network_name_descriptor.h dvb-apps/lib/libucsi/dvb/network_name_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/network_name_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/network_name_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_NETWORK_NAME_DESCRIPTOR ++#define _UCSI_DVB_NETWORK_NAME_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_network_name_descriptor structure. ++ */ ++struct dvb_network_name_descriptor { ++ struct descriptor d; ++ ++ /* char name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_network_name_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_network_name_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_network_name_descriptor* ++ dvb_network_name_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_network_name_descriptor*) d; ++} ++ ++/** ++ * Accessor for the name field in a dvb_network_name_descriptor. ++ * ++ * @param d dvb_network_name_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_network_name_descriptor_name(struct dvb_network_name_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_network_name_descriptor); ++} ++ ++/** ++ * Calculate the length of the name field in a dvb_network_name_descriptor. ++ * ++ * @param d dvb_network_name_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_network_name_descriptor_name_length(struct dvb_network_name_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nit_section.c dvb-apps/lib/libucsi/dvb/nit_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nit_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/nit_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,78 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_nit_section *dvb_nit_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ struct dvb_nit_section * ret = (struct dvb_nit_section *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct dvb_nit_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if ((pos + ret->network_descriptors_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ret->network_descriptors_length)) ++ return NULL; ++ ++ pos += ret->network_descriptors_length; ++ ++ if ((pos + sizeof(struct dvb_nit_section_part2)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ ++ while (pos < len) { ++ struct dvb_nit_transport *transport = ++ (struct dvb_nit_transport *)(buf + pos); ++ ++ if ((pos + sizeof(struct dvb_nit_transport)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 2); ++ bswap16(buf + pos + 4); ++ ++ pos += sizeof(struct dvb_nit_transport); ++ ++ if ((pos + transport->transport_descriptors_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ++ transport->transport_descriptors_length)) ++ return NULL; ++ ++ pos += transport->transport_descriptors_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nit_section.h dvb-apps/lib/libucsi/dvb/nit_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nit_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/nit_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,207 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_NIT_SECTION_H ++#define _UCSI_DVB_NIT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_nit_section structure. ++ */ ++struct dvb_nit_section { ++ struct section_ext head; ++ ++ EBIT2(uint16_t reserved_1 : 4; , ++ uint16_t network_descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++ /* struct dvb_nit_section_part2 part2 */ ++}; ++ ++/** ++ * Second part of a dvb_nit_section, following the variable length descriptors field. ++ */ ++struct dvb_nit_section_part2 { ++ EBIT2(uint16_t reserved_2 : 4; , ++ uint16_t transport_stream_loop_length :12; ); ++ /* struct dvb_nit_transport transports[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the transports field of a dvb_nit_section_part2 ++ */ ++struct dvb_nit_transport { ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t transport_descriptors_length :12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_nit_section. ++ * ++ * @param section Generic section_ext pointer. ++ * @return dvb_nit_section pointer, or NULL on error. ++ */ ++struct dvb_nit_section * dvb_nit_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the network_id field of a NIT. ++ * ++ * @param nit NIT pointer. ++ * @return The network_id. ++ */ ++static inline uint16_t dvb_nit_section_network_id(struct dvb_nit_section *nit) ++{ ++ return nit->head.table_id_ext; ++} ++ ++/** ++ * Iterator over the descriptors field in a dvb_nit_section. ++ * ++ * @param nit dvb_nit_section pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define dvb_nit_section_descriptors_for_each(nit, pos) \ ++ for ((pos) = dvb_nit_section_descriptors_first(nit); \ ++ (pos); \ ++ (pos) = dvb_nit_section_descriptors_next(nit, pos)) ++ ++/** ++ * Accessor for a pointer to the dvb_nit_section_part2 structure. ++ * ++ * @param nit dvb_nit_section pointer. ++ * @return dvb_nit_section_part2 pointer. ++ */ ++static inline struct dvb_nit_section_part2 *dvb_nit_section_part2(struct dvb_nit_section * nit) ++{ ++ return (struct dvb_nit_section_part2 *) ++ ((uint8_t*) nit + sizeof(struct dvb_nit_section) + ++ nit->network_descriptors_length); ++} ++ ++/** ++ * Iterator over the transports field in a dvb_nit_section_part2. ++ * ++ * @param nit dvb_nit_section pointer. ++ * @param part2 dvb_nit_section_part2 pointer. ++ * @param pos Pointer to the current dvb_nit_transport. ++ */ ++#define dvb_nit_section_transports_for_each(nit, part2, pos) \ ++ for ((pos) = dvb_nit_section_transports_first(part2); \ ++ (pos); \ ++ (pos) = dvb_nit_section_transports_next(part2, pos)) ++ ++/** ++ * Iterator over the descriptors field in a dvb_nit_transport. ++ * ++ * @param transport dvb_nit_transport pointer. ++ * @param pos Pointer to the current descriptor. ++ */ ++#define dvb_nit_transport_descriptors_for_each(transport, pos) \ ++ for ((pos) = dvb_nit_transport_descriptors_first(transport); \ ++ (pos); \ ++ (pos) = dvb_nit_transport_descriptors_next(transport, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ dvb_nit_section_descriptors_first(struct dvb_nit_section * nit) ++{ ++ if (nit->network_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) nit + sizeof(struct dvb_nit_section)); ++} ++ ++static inline struct descriptor * ++ dvb_nit_section_descriptors_next(struct dvb_nit_section * nit, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) nit + sizeof(struct dvb_nit_section), ++ nit->network_descriptors_length, ++ pos); ++} ++ ++static inline struct dvb_nit_transport * ++ dvb_nit_section_transports_first(struct dvb_nit_section_part2 *part2) ++{ ++ if (part2->transport_stream_loop_length == 0) ++ return NULL; ++ ++ return (struct dvb_nit_transport *) ++ ((uint8_t *)part2 + sizeof(struct dvb_nit_section_part2)); ++} ++ ++static inline struct dvb_nit_transport * ++ dvb_nit_section_transports_next(struct dvb_nit_section_part2 *part2, ++ struct dvb_nit_transport *pos) ++{ ++ uint8_t *end = (uint8_t*) part2 + sizeof(struct dvb_nit_section_part2) + ++ part2->transport_stream_loop_length; ++ uint8_t *next = (uint8_t*) pos + sizeof(struct dvb_nit_transport) + ++ pos->transport_descriptors_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_nit_transport *) next; ++} ++ ++static inline struct descriptor * ++ dvb_nit_transport_descriptors_first(struct dvb_nit_transport *t) ++{ ++ if (t->transport_descriptors_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*) t + sizeof(struct dvb_nit_transport)); ++} ++ ++static inline struct descriptor * ++ dvb_nit_transport_descriptors_next(struct dvb_nit_transport *t, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) t + sizeof(struct dvb_nit_transport), ++ t->transport_descriptors_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nvod_reference_descriptor.h dvb-apps/lib/libucsi/dvb/nvod_reference_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/nvod_reference_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/nvod_reference_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,125 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_NVOD_REFERENCE_DESCRIPTOR ++#define _UCSI_DVB_NVOD_REFERENCE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_nvod_reference_descriptor structure. ++ */ ++struct dvb_nvod_reference_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_nvod_reference references[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the references field of a dvb_nvod_reference_descriptor. ++ */ ++struct dvb_nvod_reference { ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint16_t service_id; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_nvod_reference_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure pointer. ++ * @return dvb_nvod_reference_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_nvod_reference_descriptor* ++ dvb_nvod_reference_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_nvod_reference)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ bswap16(buf+pos+4); ++ pos += sizeof(struct dvb_nvod_reference); ++ } ++ ++ return (struct dvb_nvod_reference_descriptor*) d; ++} ++ ++/** ++ * Iterator over the references field in a dvb_nvod_reference_descriptor. ++ * ++ * @param d dvb_nvod_reference_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_nvod_reference. ++ */ ++#define dvb_nvod_reference_descriptor_references_for_each(d, pos) \ ++ for ((pos) = dvb_nvod_reference_descriptor_references_first(d); \ ++ (pos); \ ++ (pos) = dvb_nvod_reference_descriptor_references_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_nvod_reference* ++ dvb_nvod_reference_descriptor_references_first(struct dvb_nvod_reference_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_nvod_reference *) ++ ((uint8_t*) d + sizeof(struct dvb_nvod_reference_descriptor)); ++} ++ ++static inline struct dvb_nvod_reference* ++ dvb_nvod_reference_descriptor_references_next(struct dvb_nvod_reference_descriptor *d, ++ struct dvb_nvod_reference *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_nvod_reference); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_nvod_reference *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/parental_rating_descriptor.h dvb-apps/lib/libucsi/dvb/parental_rating_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/parental_rating_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/parental_rating_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,135 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_PARENTAL_RATING_DESCRIPTOR ++#define _UCSI_DVB_PARENTAL_RATING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Defined values for the rating field. ++ */ ++enum { ++ DVB_PARENTAL_RATING_MIN_3YEARS = 0x01, ++ DVB_PARENTAL_RATING_MIN_4YEARS = 0x02, ++ DVB_PARENTAL_RATING_MIN_5YEARS = 0x03, ++ DVB_PARENTAL_RATING_MIN_6YEARS = 0x04, ++ DVB_PARENTAL_RATING_MIN_7YEARS = 0x05, ++ DVB_PARENTAL_RATING_MIN_8YEARS = 0x06, ++ DVB_PARENTAL_RATING_MIN_9YEARS = 0x07, ++ DVB_PARENTAL_RATING_MIN_10YEARS = 0x08, ++ DVB_PARENTAL_RATING_MIN_11YEARS = 0x09, ++ DVB_PARENTAL_RATING_MIN_12YEARS = 0x0a, ++ DVB_PARENTAL_RATING_MIN_13YEARS = 0x0b, ++ DVB_PARENTAL_RATING_MIN_14YEARS = 0x0c, ++ DVB_PARENTAL_RATING_MIN_15YEARS = 0x0d, ++ DVB_PARENTAL_RATING_MIN_16YEARS = 0x0e, ++ DVB_PARENTAL_RATING_MIN_17YEARS = 0x0f, ++}; ++ ++/** ++ * dvb_parental_rating_descriptor structure. ++ */ ++struct dvb_parental_rating_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_parental_rating ratings[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ratings field of a dvb_parental_rating_descriptor. ++ */ ++struct dvb_parental_rating { ++ iso639country_t country_code; ++ uint8_t rating; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_parental_rating_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_parental_rating_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_parental_rating_descriptor* ++ dvb_parental_rating_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len % sizeof(struct dvb_parental_rating)) ++ return NULL; ++ ++ return (struct dvb_parental_rating_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ratings field of a dvb_parental_rating_descriptor. ++ * ++ * @param d dvb_parental_rating_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_parental_rating. ++ */ ++#define dvb_parental_rating_descriptor_ratings_for_each(d, pos) \ ++ for ((pos) = dvb_parental_rating_descriptor_ratings_first(d); \ ++ (pos); \ ++ (pos) = dvb_parental_rating_descriptor_ratings_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_parental_rating* ++ dvb_parental_rating_descriptor_ratings_first(struct dvb_parental_rating_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_parental_rating *) ++ ((uint8_t*) d + sizeof(struct dvb_parental_rating_descriptor)); ++} ++ ++static inline struct dvb_parental_rating* ++ dvb_parental_rating_descriptor_ratings_next(struct dvb_parental_rating_descriptor *d, ++ struct dvb_parental_rating *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_parental_rating); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_parental_rating *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/partial_transport_stream_descriptor.h dvb-apps/lib/libucsi/dvb/partial_transport_stream_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/partial_transport_stream_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/partial_transport_stream_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,68 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_PARTIAL_TRANSPORT_STREAM_DESCRIPTOR ++#define _UCSI_DVB_PARTIAL_TRANSPORT_STREAM_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_partial_transport_stream_descriptor structure. ++ */ ++struct dvb_partial_transport_stream_descriptor { ++ struct descriptor d; ++ ++ EBIT6(uint64_t reserved : 2; , ++ uint64_t peak_rate :22; , ++ uint64_t reserved_2 : 2; , ++ uint64_t minimum_overall_smoothing_rate :22; , ++ uint64_t reserved_3 : 2; , ++ uint64_t maximum_overall_smoothing_rate :14; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_partial_transport_stream_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_partial_transport_stream_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_partial_transport_stream_descriptor* ++ dvb_partial_transport_stream_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_partial_transport_stream_descriptor) - 2)) ++ return NULL; ++ ++ bswap64((uint8_t*) d + 2); ++ ++ return (struct dvb_partial_transport_stream_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/pdc_descriptor.h dvb-apps/lib/libucsi/dvb/pdc_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/pdc_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/pdc_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,64 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_PDC_DESCRIPTOR ++#define _UCSI_DVB_PDC_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_pdc_descriptor structure. ++ */ ++struct dvb_pdc_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint32_t reserved : 4; , ++ uint32_t programme_id_label :20; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_pdc_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return dvb_pdc_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_pdc_descriptor* ++ dvb_pdc_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_pdc_descriptor) - 2)) ++ return NULL; ++ ++ bswap24((uint8_t*) d + 2); ++ ++ return (struct dvb_pdc_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/private_data_specifier_descriptor.h dvb-apps/lib/libucsi/dvb/private_data_specifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/private_data_specifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/private_data_specifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_PRIVATE_DATA_SPECIFIER_DESCRIPTOR ++#define _UCSI_DVB_PRIVATE_DATA_SPECIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_private_data_specifier_descriptor structure. ++ */ ++struct dvb_private_data_specifier_descriptor { ++ struct descriptor d; ++ ++ uint32_t private_data_specifier; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_private_data_specifier_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_private_data_specifier_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_private_data_specifier_descriptor* ++ dvb_private_data_specifier_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_private_data_specifier_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct dvb_private_data_specifier_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/related_content_descriptor.h dvb-apps/lib/libucsi/dvb/related_content_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/related_content_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/related_content_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,56 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_RELATED_CONTENT_DESCRIPTOR ++#define _UCSI_DVB_RELATED_CONTENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_related_content_descriptor structure. ++ */ ++struct dvb_related_content_descriptor { ++ struct descriptor d; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_related_content_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_related_content_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_related_content_descriptor* ++ dvb_related_content_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_related_content_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h dvb-apps/lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,110 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_RNT_RAR_OVER_DVB_STREAM_DESCRIPTOR ++#define _UCSI_DVB_RNT_RAR_OVER_DVB_STREAM_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_rnt_rar_over_dvb_stream_descriptor structure. ++ */ ++struct dvb_rnt_rar_over_dvb_stream_descriptor { ++ struct descriptor d; ++ ++ dvbdate_t first_valid_date; ++ dvbdate_t last_valid_date; ++ EBIT3(uint8_t weighting : 6; , ++ uint8_t complete_flag : 1; , ++ uint8_t scheduled_flag : 1; ); ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint16_t service_id; ++ uint8_t component_tag; ++ /* struct dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info scheduled_info */ ++} __ucsi_packed; ++ ++/** ++ * The scheduled_info field of a dvb_rnt_rar_over_dvb_stream_descriptor (only appears ++ * if scheduled_flag = 1). ++ */ ++struct dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info { ++ dvbdate_t download_start_time; ++ uint8_t download_period_duration; ++ uint8_t download_cycle_time; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_rnt_rar_over_dvb_stream_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_rnt_rar_over_dvb_stream_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_rnt_rar_over_dvb_stream_descriptor* ++ dvb_rnt_rar_over_dvb_stream_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len + 2; ++ struct dvb_rnt_rar_over_dvb_stream_descriptor *ret = ++ (struct dvb_rnt_rar_over_dvb_stream_descriptor *) buf; ++ ++ if (len < sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor)) ++ return NULL; ++ ++ bswap16(buf + 13); ++ bswap16(buf + 15); ++ bswap16(buf + 17); ++ ++ if (ret->scheduled_flag == 1) { ++ if (len < (sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor)+ ++ sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info))) ++ return NULL; ++ } ++ ++ return ret; ++} ++ ++/** ++ * Accessor for the scheduled_info field of a dvb_rnt_rar_over_dvb_stream_descriptor. ++ * ++ * @param d dvb_rnt_rar_over_dvb_stream_descriptor pointer. ++ * @return Pointer, or NULL on error. ++ */ ++static inline struct dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info* ++ dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info(struct dvb_rnt_rar_over_dvb_stream_descriptor *d) ++{ ++ if (d->scheduled_flag != 1) ++ return NULL; ++ return (struct dvb_rnt_rar_over_dvb_stream_descriptor_scheduled_info*) ++ ((uint8_t*) d + sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor)); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h dvb-apps/lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_RNT_RAR_OVER_IP_DESCRIPTOR ++#define _UCSI_DVB_RNT_RAR_OVER_IP_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_rnt_rar_over_ip_descriptor structure. ++ */ ++struct dvb_rnt_rar_over_ip_descriptor { ++ struct descriptor d; ++ ++ dvbdate_t first_valid_date; ++ dvbdate_t last_valid_date; ++ EBIT3(uint8_t weighting : 6; , ++ uint8_t complete_flag : 1; , ++ uint8_t reserved : 1; ); ++ uint8_t url_length; ++ /* uint8_t url[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_rnt_rar_over_ip_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_rnt_rar_over_ip_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_rnt_rar_over_ip_descriptor* ++ dvb_rnt_rar_over_ip_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len + 2; ++ struct dvb_rnt_rar_over_ip_descriptor *ret = ++ (struct dvb_rnt_rar_over_ip_descriptor *) buf; ++ ++ if (len < sizeof(struct dvb_rnt_rar_over_ip_descriptor)) ++ return NULL; ++ if (len < (sizeof(struct dvb_rnt_rar_over_ip_descriptor) + buf[13])) ++ return NULL; ++ ++ return ret; ++} ++ ++/** ++ * Accessor for the url field of a dvb_rnt_rar_over_ip_descriptor. ++ * ++ * @param d dvb_rnt_rar_over_ip_descriptor pointer. ++ * @return Pointer. ++ */ ++static inline uint8_t* ++ dvb_rnt_rar_over_ip_descriptor_url(struct dvb_rnt_rar_over_ip_descriptor *d) ++{ ++ return (uint8_t*) ++ ((uint8_t*) d + sizeof(struct dvb_rnt_rar_over_ip_descriptor)); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rnt_scan_descriptor.h dvb-apps/lib/libucsi/dvb/rnt_rnt_scan_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rnt_rnt_scan_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/rnt_rnt_scan_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,125 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_RNT_RNT_SCAN_DESCRIPTOR ++#define _UCSI_DVB_RNT_RNT_SCAN_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_rnt_rnt_scan_descriptor structure. ++ */ ++struct dvb_rnt_rnt_scan_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_rnt_rnt_scan_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_rnt_rnt_scan_descriptor. ++ */ ++struct dvb_rnt_rnt_scan_entry { ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint8_t scan_weighting; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_rnt_rnt_scan_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_rnt_rnt_scan_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_rnt_rnt_scan_descriptor* ++ dvb_rnt_rnt_scan_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len +2; ++ uint32_t pos = 2; ++ ++ if ((len-2) % sizeof(struct dvb_rnt_rnt_scan_entry)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ pos += sizeof(struct dvb_rnt_rnt_scan_entry); ++ } ++ ++ return (struct dvb_rnt_rnt_scan_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a dvb_rnt_rnt_scan_descriptor. ++ * ++ * @param d dvb_rnt_rnt_scan_descriptor pointer. ++ * @param pos Variable holding a pointer to the current dvb_rnt_rnt_scan_entry. ++ */ ++#define dvb_rnt_rnt_scan_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_rnt_rnt_scan_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_rnt_rnt_scan_descriptor_entries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_rnt_rnt_scan_entry* ++ dvb_rnt_rnt_scan_descriptor_entries_first(struct dvb_rnt_rnt_scan_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_rnt_rnt_scan_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_rnt_rnt_scan_descriptor)); ++} ++ ++static inline struct dvb_rnt_rnt_scan_entry* ++ dvb_rnt_rnt_scan_descriptor_entries_next(struct dvb_rnt_rnt_scan_descriptor *d, ++ struct dvb_rnt_rnt_scan_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_rnt_rnt_scan_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_rnt_rnt_scan_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rst_section.c dvb-apps/lib/libucsi/dvb/rst_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rst_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/rst_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,47 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_rst_section * dvb_rst_section_codec(struct section *section) ++{ ++ uint8_t * buf = (uint8_t *) section; ++ size_t pos = sizeof(struct section); ++ size_t len = section_length(section); ++ struct dvb_rst_section * ret = (struct dvb_rst_section *) section; ++ ++ while (pos < len) { ++ if ((pos + sizeof(struct dvb_rst_status)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 2); ++ bswap16(buf + pos + 4); ++ bswap16(buf + pos + 6); ++ ++ pos += sizeof(struct dvb_rst_status); ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rst_section.h dvb-apps/lib/libucsi/dvb/rst_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/rst_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/rst_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,110 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_RST_SECTION_H ++#define _UCSI_DVB_RST_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_rst_section structure. ++ */ ++struct dvb_rst_section { ++ struct section head; ++ ++ /* struct dvb_rst_status statuses[] */ ++}; ++ ++/** ++ * An entry in the statuses field of a dvb_rst_section structure. ++ */ ++struct dvb_rst_status { ++ uint16_t transport_stream_id; ++ uint16_t original_network_id; ++ uint16_t service_id; ++ uint16_t event_id; ++ EBIT2(uint8_t reserved : 5; , ++ uint8_t running_status : 3; ); ++}; ++ ++/** ++ * Process a dvb_rst_section. ++ * ++ * @param section Pointer to a generic section strcuture. ++ * @return dvb_rst_section pointer, or NULL on error. ++ */ ++struct dvb_rst_section *dvb_rst_section_codec(struct section *section); ++ ++/** ++ * Iterator for entries in the statuses field of a dvb_rst_section. ++ * ++ * @param rst dvb_rst_section pointer. ++ * @param pos Variable containing a pointer to the current dvb_rst_status. ++ */ ++#define dvb_rst_section_statuses_for_each(rst, pos) \ ++ for ((pos) = dvb_rst_section_statuses_first(rst); \ ++ (pos); \ ++ (pos) = dvb_rst_section_statuses_next(rst, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_rst_status * ++ dvb_rst_section_statuses_first(struct dvb_rst_section *rst) ++{ ++ size_t pos = sizeof(struct dvb_rst_section); ++ ++ if (pos >= section_length(&rst->head)) ++ return NULL; ++ ++ return (struct dvb_rst_status*) ((uint8_t *) rst + pos); ++} ++ ++static inline struct dvb_rst_status * ++ dvb_rst_section_statuses_next(struct dvb_rst_section * rst, ++ struct dvb_rst_status * pos) ++{ ++ uint8_t *end = (uint8_t*) rst + section_length(&rst->head); ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_rst_status); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_rst_status *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/s2_satellite_delivery_descriptor.h dvb-apps/lib/libucsi/dvb/s2_satellite_delivery_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/s2_satellite_delivery_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/s2_satellite_delivery_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_S2_SATELLITE_DELIVERY_DESCRIPTOR ++#define _UCSI_DVB_S2_SATELLITE_DELIVERY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_s2_satellite_delivery_descriptor structure. ++ */ ++struct dvb_s2_satellite_delivery_descriptor { ++ struct descriptor d; ++ ++ EBIT4(uint8_t scrambling_sequence_selector : 1; , ++ uint8_t multiple_input_stream : 1; , ++ uint8_t backwards_compatability : 1; , ++ uint8_t reserved : 5; ); ++ /* uint32_t scrambling_sequence_index if scrambling_sequence_selector = 1 */ ++ /* uint8_t input_stream_id if multiple_input_stream = 1 */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_s2_satellite_delivery_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return dvb_s2_satellite_delivery_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_s2_satellite_delivery_descriptor* ++ dvb_s2_satellite_delivery_descriptor_codec(struct descriptor* d) ++{ ++ struct dvb_s2_satellite_delivery_descriptor *s2 = ++ (struct dvb_s2_satellite_delivery_descriptor*) d; ++ ++ if (d->len < (sizeof(struct dvb_s2_satellite_delivery_descriptor) - 2)) ++ return NULL; ++ ++ int len = sizeof(struct dvb_s2_satellite_delivery_descriptor); ++ if (s2->scrambling_sequence_selector) { ++ len += 3; ++ } ++ if (s2->multiple_input_stream) { ++ len += 1; ++ } ++ ++ if (d->len < len) ++ return NULL; ++ ++ return s2; ++} ++ ++/** ++ * Accessor for the scrambling_sequence_index field of a dvb_s2_satellite_delivery_descriptor. ++ * ++ * @param s2 dvb_s2_satellite_delivery_descriptor pointer. ++ * @return The scrambling_sequence_index. ++ */ ++static inline uint32_t dvb_s2_satellite_delivery_descriptor_scrambling_sequence_index(struct dvb_s2_satellite_delivery_descriptor *s2) ++{ ++ uint8_t *tmp = (uint8_t*) s2; ++ ++ if (s2->scrambling_sequence_selector) { ++ return ((tmp[4] & 0x03) << 16) | (tmp[5] << 8) | tmp[6]; ++ } ++ return 0; ++} ++ ++/** ++ * Accessor for the input_stream_id field of a dvb_s2_satellite_delivery_descriptor. ++ * ++ * @param s2 dvb_s2_satellite_delivery_descriptor pointer. ++ * @return The input_stream_id. ++ */ ++static inline uint8_t dvb_s2_satellite_delivery_descriptor_input_stream_id(struct dvb_s2_satellite_delivery_descriptor *s2) ++{ ++ uint8_t *tmp = (uint8_t*) s2; ++ ++ if (!s2->multiple_input_stream) ++ return 0; ++ ++ int off = 3; ++ if (s2->scrambling_sequence_selector) { ++ off += 3; ++ } ++ return tmp[off]; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/satellite_delivery_descriptor.h dvb-apps/lib/libucsi/dvb/satellite_delivery_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/satellite_delivery_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/satellite_delivery_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,73 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SATELLITE_DELIVERY_DESCRIPTOR ++#define _UCSI_DVB_SATELLITE_DELIVERY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_satellite_delivery_descriptor structure. ++ */ ++struct dvb_satellite_delivery_descriptor { ++ struct descriptor d; ++ ++ uint32_t frequency; // BCD, units 10kHz ++ uint16_t orbital_position; ++ EBIT5(uint8_t west_east_flag : 1; , ++ uint8_t polarization : 2; , ++ uint8_t roll_off : 2; , ++ uint8_t modulation_system : 1; , ++ uint8_t modulation_type : 2; ); ++ EBIT2(uint32_t symbol_rate : 28; , // BCD, units 100Hz ++ uint32_t fec_inner : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_satellite_delivery_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return dvb_satellite_delivery_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_satellite_delivery_descriptor* ++ dvb_satellite_delivery_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_satellite_delivery_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 6); ++ bswap32((uint8_t*) d + 9); ++ ++ return (struct dvb_satellite_delivery_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/scrambling_descriptor.h dvb-apps/lib/libucsi/dvb/scrambling_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/scrambling_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/scrambling_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,61 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SCRAMBLING_DESCRIPTOR ++#define _UCSI_DVB_SCRAMBLING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_scrambling_descriptor structure. ++ */ ++struct dvb_scrambling_descriptor { ++ struct descriptor d; ++ ++ uint8_t scrambling_mode; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_scrambling_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to dvb_scrambling_descriptor, or NULL on error. ++ */ ++static inline struct dvb_scrambling_descriptor* ++ dvb_scrambling_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_scrambling_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_scrambling_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sdt_section.c dvb-apps/lib/libucsi/dvb/sdt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sdt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/sdt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,60 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_sdt_section * dvb_sdt_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct dvb_sdt_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 3; ++ ++ while (pos < len) { ++ struct dvb_sdt_service * service = ++ (struct dvb_sdt_service *)(buf + pos); ++ ++ if ((pos + sizeof(struct dvb_sdt_service)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 3); ++ pos += sizeof(struct dvb_sdt_service); ++ ++ if ((pos + service->descriptors_loop_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, service->descriptors_loop_length)) ++ return NULL; ++ ++ pos += service->descriptors_loop_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct dvb_sdt_section *) ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sdt_section.h dvb-apps/lib/libucsi/dvb/sdt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sdt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/sdt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,157 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SDT_SECTION_H ++#define _UCSI_DVB_SDT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_sdt_section structure. ++ */ ++struct dvb_sdt_section { ++ struct section_ext head; ++ ++ uint16_t original_network_id; ++ uint8_t reserved; ++ /* struct dvb_sdt_service services[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the services field of a dvb_sdt_section. ++ */ ++struct dvb_sdt_service { ++ uint16_t service_id; ++ EBIT3(uint8_t reserved : 6; , ++ uint8_t eit_schedule_flag : 1; , ++ uint8_t eit_present_following_flag : 1; ); ++ EBIT3(uint16_t running_status : 3; , ++ uint16_t free_ca_mode : 1; , ++ uint16_t descriptors_loop_length :12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_sdt_section. ++ * ++ * @param section Pointer to a generic section_ext structure. ++ * @return dvb_sdt_section pointer, or NULL on error. ++ */ ++struct dvb_sdt_section * dvb_sdt_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the transport_stream_id field of an SDT. ++ * ++ * @param sdt SDT pointer. ++ * @return The transport_stream_id. ++ */ ++static inline uint16_t dvb_sdt_section_transport_stream_id(struct dvb_sdt_section *sdt) ++{ ++ return sdt->head.table_id_ext; ++} ++ ++/** ++ * Iterator for the services field in a dvb_sdt_section. ++ * ++ * @param sdt dvb_sdt_section pointer. ++ * @param pos Variable containing a pointer to the current dvb_sdt_service. ++ */ ++#define dvb_sdt_section_services_for_each(sdt, pos) \ ++ for ((pos) = dvb_sdt_section_services_first(sdt); \ ++ (pos); \ ++ (pos) = dvb_sdt_section_services_next(sdt, pos)) ++ ++/** ++ * Iterator for the descriptors field in a dvb_sdt_service. ++ * ++ * @param service dvb_sdt_service pointer. ++ * @param pos Variable containing a pointer to the current descriptor. ++ */ ++#define dvb_sdt_service_descriptors_for_each(service, pos) \ ++ for ((pos) = dvb_sdt_service_descriptors_first(service); \ ++ (pos); \ ++ (pos) = dvb_sdt_service_descriptors_next(service, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_sdt_service * ++ dvb_sdt_section_services_first(struct dvb_sdt_section * sdt) ++{ ++ size_t pos = sizeof(struct dvb_sdt_section); ++ ++ if (pos >= section_ext_length(&sdt->head)) ++ return NULL; ++ ++ return (struct dvb_sdt_service*) ((uint8_t *) sdt + pos); ++} ++ ++static inline struct dvb_sdt_service * ++ dvb_sdt_section_services_next(struct dvb_sdt_section * sdt, ++ struct dvb_sdt_service * pos) ++{ ++ uint8_t *end = (uint8_t*) sdt + section_ext_length(&sdt->head); ++ uint8_t *next = (uint8_t*) pos + sizeof(struct dvb_sdt_service) + ++ pos->descriptors_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_sdt_service *) next; ++} ++ ++static inline struct descriptor * ++ dvb_sdt_service_descriptors_first(struct dvb_sdt_service *svc) ++{ ++ if (svc->descriptors_loop_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*) svc + sizeof(struct dvb_sdt_service)); ++} ++ ++static inline struct descriptor * ++ dvb_sdt_service_descriptors_next(struct dvb_sdt_service *svc, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) svc + sizeof(struct dvb_sdt_service), ++ svc->descriptors_loop_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/section.h dvb-apps/lib/libucsi/dvb/section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,108 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SECTION_H ++#define _UCSI_DVB_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/** ++ * The following are not implemented just now. ++ */ ++/* ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++*/ ++ ++#define TRANSPORT_NIT_PID 0x10 ++#define TRANSPORT_SDT_PID 0x11 ++#define TRANSPORT_BAT_PID 0x11 ++#define TRANSPORT_EIT_PID 0x12 ++#define TRANSPORT_CIT_PID 0x12 ++#define TRANSPORT_RST_PID 0x13 ++#define TRANSPORT_TDT_PID 0x14 ++#define TRANSPORT_TOT_PID 0x14 ++#define TRANSPORT_RNT_PID 0x16 ++#define TRANSPORT_DIT_PID 0x1e ++#define TRANSPORT_SIT_PID 0x1f ++ ++/** ++ * Enumeration of DVB section tags. ++ */ ++enum dvb_section_tag { ++ stag_dvb_network_information_actual = 0x40, ++ stag_dvb_network_information_other = 0x41, ++ ++ stag_dvb_service_description_actual = 0x42, ++ stag_dvb_service_description_other = 0x46, ++ ++ stag_dvb_bouquet_association = 0x4a, ++ stag_dvb_update_notification = 0x4b, /* same syntax as IP_MAC */ ++ stag_dvb_ip_mac_notification = 0x4c, ++ ++ stag_dvb_event_information_nownext_actual = 0x4e, ++ stag_dvb_event_information_nownext_other = 0x4f, ++ stag_dvb_event_information_schedule_actual = 0x50, /* 0x50->0x5f */ ++ stag_dvb_event_information_schedule_other = 0x60, /* 0x60->0x6f */ ++ ++ stag_dvb_time_date = 0x70, ++ stag_dvb_running_status = 0x71, ++ stag_dvb_stuffing = 0x72, ++ stag_dvb_time_offset = 0x73, ++ stag_dvb_application_information = 0x74, ++ stag_dvb_tva_container = 0x75, ++ stag_dvb_tva_related_content = 0x76, ++ stag_dvb_tva_content_identifier = 0x77, ++ stag_dvb_mpe_fec = 0x78, ++ stag_dvb_tva_resolution_provider_notification = 0x79, ++ ++ stag_dvb_discontinuity_information = 0x7e, ++ stag_dvb_selection_information = 0x7f, ++ ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_availability_descriptor.h dvb-apps/lib/libucsi/dvb/service_availability_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_availability_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/service_availability_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,98 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SERVICE_AVAILABILITY_DESCRIPTOR ++#define _UCSI_DVB_SERVICE_AVAILABILITY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_service_availability_descriptor structure. ++ */ ++struct dvb_service_availability_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t availability_flag : 1; , ++ uint8_t reserved : 7; ); ++ /* uint16_t cell_ids[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_service_availability_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return dvb_service_availability_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_service_availability_descriptor* ++ dvb_service_availability_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* buf = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ pos += sizeof(struct dvb_service_availability_descriptor) - 2; ++ ++ if ((len - pos) % 2) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos += 2; ++ } ++ ++ return (struct dvb_service_availability_descriptor*) d; ++} ++ ++/** ++ * Accessor for the cell_ids field of a dvb_service_availability_descriptor. ++ * ++ * @param d dvb_service_availability_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint16_t * ++ dvb_service_availability_descriptor_cell_ids(struct dvb_service_availability_descriptor *d) ++{ ++ return (uint16_t *) ((uint8_t *) d + sizeof(struct dvb_service_availability_descriptor)); ++} ++ ++/** ++ * Determine the number of entries in the cell_ids field of a dvb_service_availability_descriptor. ++ * ++ * @param d dvb_service_availability_descriptor pointer. ++ * @return The number of entries. ++ */ ++static inline int ++ dvb_service_availability_descriptor_cell_ids_count(struct dvb_service_availability_descriptor *d) ++{ ++ return (d->d.len - 1) >> 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_descriptor.h dvb-apps/lib/libucsi/dvb/service_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/service_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,163 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SERVICE_DESCRIPTOR ++#define _UCSI_DVB_SERVICE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for service_type. ++ */ ++enum { ++ DVB_SERVICE_TYPE_DIGITAL_TV = 0x01, ++ DVB_SERVICE_TYPE_DIGITAL_RADIO = 0x02, ++ DVB_SERVICE_TYPE_TELETEXT = 0x03, ++ DVB_SERVICE_TYPE_NVOD_REF = 0x04, ++ DVB_SERVICE_TYPE_NVOD_TIMESHIFT = 0x05, ++ DVB_SERVICE_TYPE_MOSAIC = 0x06, ++ DVB_SERVICE_TYPE_PAL = 0x07, ++ DVB_SERVICE_TYPE_SECAM = 0x08, ++ DVB_SERVICE_TYPE_D_D2_MAC = 0x09, ++ DVB_SERVICE_TYPE_FM_RADIO = 0x0a, ++ DVB_SERVICE_TYPE_NTSC = 0x0b, ++ DVB_SERVICE_TYPE_DATA_BCAST = 0x0c, ++ DVB_SERVICE_TYPE_EN50221 = 0x0d, ++ DVB_SERVICE_TYPE_RCS_MAP = 0x0e, ++ DVB_SERVICE_TYPE_RCS_FLS = 0x0f, ++ DVB_SERVICE_TYPE_MHP = 0x10, ++ DVB_SERVICE_TYPE_MPEG2_HD_DIGITAL_TV = 0x11, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_SD_DIGITAL_TV = 0x16, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_SD_NVOD_TIMESHIFT = 0x17, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_SD_NVOD_REF = 0x18, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_HD_DIGITAL_TV = 0x19, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_HD_NVOD_TIMESHIFT = 0x1a, ++ DVB_SERVICE_TYPE_ADVANCED_CODEC_HD_NVOD_REF = 0x1b, ++}; ++ ++/** ++ * dvb_service_descriptor structure. ++ */ ++struct dvb_service_descriptor { ++ struct descriptor d; ++ ++ uint8_t service_type; ++ uint8_t service_provider_name_length; ++ /* uint8_t service_provider_name[] */ ++ /* struct dvb_service_descriptor_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_service_descriptor following the variable length ++ * service_provider_name field. ++ */ ++struct dvb_service_descriptor_part2 { ++ uint8_t service_name_length; ++ /* uint8_t service_name[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_service_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_service_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_service_descriptor* ++ dvb_service_descriptor_codec(struct descriptor* d) ++{ ++ struct dvb_service_descriptor *p = ++ (struct dvb_service_descriptor *) d; ++ struct dvb_service_descriptor_part2 *p2; ++ uint32_t pos = sizeof(struct dvb_service_descriptor) - 2; ++ uint32_t len = d->len; ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p->service_provider_name_length; ++ ++ if (pos > len) ++ return NULL; ++ ++ p2 = (struct dvb_service_descriptor_part2*) ((uint8_t*) d + 2 + pos); ++ ++ pos += sizeof(struct dvb_service_descriptor_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p2->service_name_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return p; ++} ++ ++/** ++ * Accessor for the service_provider_name field of a dvb_service_descriptor. ++ * ++ * @param d dvb_service_descriptor pointer. ++ * @return Pointer to the service_provider_name field. ++ */ ++static inline uint8_t * ++ dvb_service_descriptor_service_provider_name(struct dvb_service_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_service_descriptor); ++} ++ ++/** ++ * Accessor for the second part of a dvb_service_descriptor. ++ * ++ * @param d dvb_service_descriptor pointer. ++ * @return dvb_service_descriptor_part2 pointer. ++ */ ++static inline struct dvb_service_descriptor_part2 * ++ dvb_service_descriptor_part2(struct dvb_service_descriptor *d) ++{ ++ return (struct dvb_service_descriptor_part2 *) ++ ((uint8_t*) d + sizeof(struct dvb_service_descriptor) + ++ d->service_provider_name_length); ++} ++ ++/** ++ * Accessor for the service_name field of a dvb_service_descriptor_part2. ++ * ++ * @param d dvb_service_descriptor_part2 pointer. ++ * @return Pointer to the service_name field. ++ */ ++static inline uint8_t * ++ dvb_service_descriptor_service_name(struct dvb_service_descriptor_part2 *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_service_descriptor_part2); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_identifier_descriptor.h dvb-apps/lib/libucsi/dvb/service_identifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_identifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/service_identifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SERVICE_IDENTIFIER_DESCRIPTOR ++#define _UCSI_DVB_SERVICE_IDENTIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_service_identifier_descriptor. ++ */ ++struct dvb_service_identifier_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t identifier[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_service_identifier_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_service_identifier_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_service_identifier_descriptor* ++ dvb_service_identifier_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_service_identifier_descriptor*) d; ++} ++ ++/** ++ * Retrieve a pointer to the identifier field of a dvb_service_identifier_descriptor. ++ * ++ * @param d dvb_service_identifier_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_service_identifier_descriptor_identifier(struct dvb_service_identifier_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_service_identifier_descriptor); ++} ++ ++/** ++ * Calculate length of the identifier field of a dvb_service_identifier_descriptor. ++ * ++ * @param d dvb_service_identifier_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ dvb_service_identifier_descriptor_identifier_length(struct dvb_service_identifier_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_list_descriptor.h dvb-apps/lib/libucsi/dvb/service_list_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_list_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/service_list_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,122 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SERVICE_LIST_DESCRIPTOR ++#define _UCSI_DVB_SERVICE_LIST_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_service_list_descriptor structure. ++ */ ++struct dvb_service_list_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_service_list_service services[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the services field of a dvb_service_list_descriptor. ++ */ ++struct dvb_service_list_service { ++ uint16_t service_id; ++ uint8_t service_type; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_service_list_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_service_list_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_service_list_descriptor* ++ dvb_service_list_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ uint8_t *p = (uint8_t*) d + 2; ++ ++ if (len % sizeof(struct dvb_service_list_service)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(p+pos); ++ pos += sizeof(struct dvb_service_list_service); ++ } ++ ++ return (struct dvb_service_list_descriptor*) d; ++} ++ ++/** ++ * Iterator for services field in a dvb_service_list_descriptor. ++ * ++ * @param d dvb_service_list_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_service_list_service. ++ */ ++#define dvb_service_list_descriptor_services_for_each(d, pos) \ ++ for ((pos) = dvb_service_list_descriptor_services_first(d); \ ++ (pos); \ ++ (pos) = dvb_service_list_descriptor_services_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_service_list_service* ++ dvb_service_list_descriptor_services_first(struct dvb_service_list_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_service_list_service *) ++ ((uint8_t*) d + sizeof(struct dvb_service_list_descriptor)); ++} ++ ++static inline struct dvb_service_list_service* ++ dvb_service_list_descriptor_services_next(struct dvb_service_list_descriptor *d, ++ struct dvb_service_list_service *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_service_list_service); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_service_list_service *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_move_descriptor.h dvb-apps/lib/libucsi/dvb/service_move_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/service_move_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/service_move_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,67 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SERVICE_MOVE_DESCRIPTOR ++#define _UCSI_DVB_SERVICE_MOVE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_service_move_descriptor structure. ++ */ ++struct dvb_service_move_descriptor { ++ struct descriptor d; ++ ++ uint16_t new_original_network_id; ++ uint16_t new_transport_stream_id; ++ uint16_t new_service_id; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_service_move_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to dvb_service_move_descriptor, or NULL on error. ++ */ ++static inline struct dvb_service_move_descriptor* ++ dvb_service_move_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_service_move_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 4); ++ bswap16((uint8_t*) d + 6); ++ ++ return (struct dvb_service_move_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/short_event_descriptor.h dvb-apps/lib/libucsi/dvb/short_event_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/short_event_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/short_event_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,135 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SHORT_EVENT_DESCRIPTOR ++#define _UCSI_DVB_SHORT_EVENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_short_event_descriptor structure. ++ */ ++struct dvb_short_event_descriptor { ++ struct descriptor d; ++ ++ iso639lang_t language_code; ++ uint8_t event_name_length; ++ /* uint8_t event_name[] */ ++ /* struct dvb_short_event_descriptor_part2 part2 */ ++} __ucsi_packed; ++ ++/** ++ * Second part of a dvb_short_event_descriptor, following the variable length ++ * name field. ++ */ ++struct dvb_short_event_descriptor_part2 { ++ uint8_t text_length; ++ /* uint8_t text[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_short_event_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_short_event_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_short_event_descriptor* ++ dvb_short_event_descriptor_codec(struct descriptor* d) ++{ ++ struct dvb_short_event_descriptor *p = ++ (struct dvb_short_event_descriptor*) d; ++ struct dvb_short_event_descriptor_part2 *p2; ++ uint32_t pos = sizeof(struct dvb_short_event_descriptor) - 2; ++ uint32_t len = d->len; ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p->event_name_length; ++ ++ if (pos > len) ++ return NULL; ++ ++ p2 = (struct dvb_short_event_descriptor_part2*) ((uint8_t*) d + 2 + pos); ++ ++ pos += sizeof(struct dvb_short_event_descriptor_part2); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p2->text_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return p; ++} ++ ++/** ++ * Accessor for name field in a dvb_short_event_descriptor. ++ * ++ * @param d dvb_short_event_descriptor pointer. ++ * @return Pointer to name field. ++ */ ++static inline uint8_t * ++ dvb_short_event_descriptor_event_name(struct dvb_short_event_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_short_event_descriptor); ++} ++ ++/** ++ * Accessor for second part of a dvb_short_event_descriptor. ++ * ++ * @param d dvb_short_event_descriptor pointer. ++ * @return dvb_short_event_descriptor_part2 pointer. ++ */ ++static inline struct dvb_short_event_descriptor_part2 * ++ dvb_short_event_descriptor_part2(struct dvb_short_event_descriptor *d) ++{ ++ return (struct dvb_short_event_descriptor_part2 *) ++ ((uint8_t*) d + sizeof(struct dvb_short_event_descriptor) + ++ d->event_name_length); ++} ++ ++/** ++ * Accessor for text field in a dvb_short_event_descriptor_part2. ++ * ++ * @param d dvb_short_event_descriptor_part2 pointer. ++ * @return Pointer to text field. ++ */ ++static inline uint8_t * ++ dvb_short_event_descriptor_text(struct dvb_short_event_descriptor_part2 *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_short_event_descriptor_part2); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/short_smoothing_buffer_descriptor.h dvb-apps/lib/libucsi/dvb/short_smoothing_buffer_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/short_smoothing_buffer_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/short_smoothing_buffer_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SHORT_SMOOTHING_BUFFER_DESCRIPTOR ++#define _UCSI_DVB_SHORT_SMOOTHING_BUFFER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_short_smoothing_buffer_descriptor structure. ++ */ ++struct dvb_short_smoothing_buffer_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t sb_size : 2; , ++ uint8_t sb_leak_rate : 6; ); ++ /* uint8_t reserved [] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_short_smoothing_buffer_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_short_smoothing_buffer_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_short_smoothing_buffer_descriptor* ++ dvb_short_smoothing_buffer_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct dvb_short_smoothing_buffer_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_short_smoothing_buffer_descriptor*) d; ++} ++ ++/** ++ * Accessor for reserved field in a dvb_short_smoothing_buffer_descriptor. ++ * ++ * @param d dvb_short_smoothing_buffer_descriptor pointer. ++ * @return Pointer to reserved field. ++ */ ++static inline uint8_t * ++ dvb_short_smoothing_buffer_descriptor_reserved(struct dvb_short_smoothing_buffer_descriptor *d) ++{ ++ return (uint8_t*) d + sizeof(struct dvb_short_smoothing_buffer_descriptor); ++} ++ ++/** ++ * Calculate length of reserved field in a dvb_short_smoothing_buffer_descriptor. ++ * ++ * @param d dvb_short_smoothing_buffer_descriptor pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ dvb_short_smoothing_buffer_descriptor_reserved_length(struct dvb_short_smoothing_buffer_descriptor *d) ++{ ++ return d->d.len - 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sit_section.c dvb-apps/lib/libucsi/dvb/sit_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sit_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/sit_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,69 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_sit_section * dvb_sit_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ struct dvb_sit_section * ret = (struct dvb_sit_section *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct dvb_sit_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if ((pos + ret->transmission_info_loop_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ret->transmission_info_loop_length)) ++ return NULL; ++ ++ pos += ret->transmission_info_loop_length; ++ ++ while (pos < len) { ++ struct dvb_sit_service * service = (void*)(buf + pos); ++ ++ if ((pos + sizeof(struct dvb_sit_service)) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 2); ++ bswap16(buf + pos + 4); ++ pos += sizeof(struct dvb_sit_service); ++ ++ if ((pos + service->service_loop_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, service->service_loop_length)) ++ return NULL; ++ ++ pos += service->service_loop_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sit_section.h dvb-apps/lib/libucsi/dvb/sit_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/sit_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/sit_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,173 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SIT_SECTION_H ++#define _UCSI_DVB_SIT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_sit_section structure. ++ */ ++struct dvb_sit_section { ++ struct section_ext head; ++ ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t transmission_info_loop_length :12; ); ++ /* struct descriptor descriptors[] */ ++ /* struct dvb_sit_service services[] */ ++}; ++ ++/** ++ * An entry in the services field of a dvb_sit_section. ++ */ ++struct dvb_sit_service { ++ uint16_t service_id; ++ EBIT3(uint16_t reserved : 1; , ++ uint16_t running_status : 3; , ++ uint16_t service_loop_length :12; ); ++ /* struct descriptor descriptors[] */ ++}; ++ ++/** ++ * Process a dvb_sit_section. ++ * ++ * @param section Generic section_ext structure. ++ * @return dvb_sit_section pointer, or NULL on error. ++ */ ++struct dvb_sit_section * dvb_sit_section_codec(struct section_ext *section); ++ ++/** ++ * Iterator for descriptors field in a dvb_sit_section. ++ * ++ * @param sit dvb_sit_section Pointer. ++ * @param pos Variable holding pointer to current descriptor. ++ */ ++#define dvb_sit_section_descriptors_for_each(sit, pos) \ ++ for ((pos) = dvb_sit_section_descriptors_first(sit); \ ++ (pos); \ ++ (pos) = dvb_sit_section_descriptors_first(sit)) ++ ++/** ++ * Iterator for services field in a dvb_sit_section. ++ * ++ * @param sit dvb_sit_section Pointer. ++ * @param pos Variable holding pointer to current dvb_sit_service. ++ */ ++#define dvb_sit_section_services_for_each(sit, pos) \ ++ for ((pos) = dvb_sit_section_services_first(sit); \ ++ (pos); \ ++ (pos) = dvb_sit_section_services_next(sit, pos)) ++ ++/** ++ * Iterator for descriptors field in a dvb_sit_service. ++ * ++ * @param service dvb_sit_service Pointer. ++ * @param pos Variable holding pointer to current descriptor. ++ */ ++#define dvb_sit_service_descriptors_for_each(service, pos) \ ++ for ((pos) = dvb_sit_service_descriptors_first(service); \ ++ (pos); \ ++ (pos) = dvb_sit_service_descriptors_next(service, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ dvb_sit_section_descriptors_first(struct dvb_sit_section *sit) ++{ ++ if (sit->transmission_info_loop_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) sit + sizeof(struct dvb_sit_section)); ++} ++ ++static inline struct descriptor * ++ dvb_sit_section_descriptors_next(struct dvb_sit_section *sit, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) sit + sizeof(struct dvb_sit_section), ++ sit->transmission_info_loop_length, ++ pos); ++} ++ ++static inline struct dvb_sit_service * ++ dvb_sit_section_services_first(struct dvb_sit_section *sit) ++{ ++ size_t pos = sizeof(struct dvb_sit_section) + sit->transmission_info_loop_length; ++ ++ if (pos >= section_ext_length(&sit->head)) ++ return NULL; ++ ++ return (struct dvb_sit_service*) ((uint8_t *) sit + pos); ++} ++ ++static inline struct dvb_sit_service * ++ dvb_sit_section_services_next(struct dvb_sit_section *sit, ++ struct dvb_sit_service *pos) ++{ ++ uint8_t *end = (uint8_t*) sit + section_ext_length(&sit->head); ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_sit_service) + ++ pos->service_loop_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_sit_service *) next; ++} ++ ++static inline struct descriptor * ++ dvb_sit_service_descriptors_first(struct dvb_sit_service * t) ++{ ++ if (t->service_loop_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) t + sizeof(struct dvb_sit_service)); ++} ++ ++static inline struct descriptor * ++ dvb_sit_service_descriptors_next(struct dvb_sit_service *t, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t*) t + sizeof(struct dvb_sit_service), ++ t->service_loop_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/stream_identifier_descriptor.h dvb-apps/lib/libucsi/dvb/stream_identifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/stream_identifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/stream_identifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,61 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_STREAM_IDENTIFIER_DESCRIPTOR ++#define _UCSI_DVB_STREAM_IDENTIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_stream_identifier_descriptor structure. ++ */ ++struct dvb_stream_identifier_descriptor { ++ struct descriptor d; ++ ++ uint8_t component_tag; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_stream_identifier_descriptor. ++ * ++ * @param d Pointer to generic descriptor structure. ++ * @return dvb_stream_identifier_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_stream_identifier_descriptor* ++ dvb_stream_identifier_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_stream_identifier_descriptor) - 2)) ++ return NULL; ++ ++ return (struct dvb_stream_identifier_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/st_section.c dvb-apps/lib/libucsi/dvb/st_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/st_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/st_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,29 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_st_section * dvb_st_section_codec(struct section * section) ++{ ++ struct dvb_st_section * ret = (struct dvb_st_section *)section; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/st_section.h dvb-apps/lib/libucsi/dvb/st_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/st_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/st_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_ST_SECTION_H ++#define _UCSI_DVB_ST_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * dvb_st_section structure. ++ */ ++struct dvb_st_section { ++ struct section head; ++ ++ /* uint8_t data[] */ ++}; ++ ++/** ++ * Process a dvb_st_section. ++ * ++ * @param section Generic section header. ++ * @return dvb_st_section pointer, or NULL on error. ++ */ ++struct dvb_st_section *dvb_st_section_codec(struct section *section); ++ ++/** ++ * Accessor for data field of dvb_st_section. ++ * ++ * @param st dvb_st_section Pointer. ++ * @return Pointer to field. ++ */ ++static inline uint8_t* ++ dvb_st_section_data(struct dvb_st_section* st) ++{ ++ return (uint8_t*) st + sizeof(struct dvb_st_section); ++} ++ ++/** ++ * Calculate length of data field of dvb_st_section. ++ * ++ * @param st dvb_st_section Pointer. ++ * @return Length in bytes. ++ */ ++static inline int ++ dvb_st_section_data_length(struct dvb_st_section* st) ++{ ++ return st->head.length; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/stuffing_descriptor.h dvb-apps/lib/libucsi/dvb/stuffing_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/stuffing_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/stuffing_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_STUFFING_DESCRIPTOR ++#define _UCSI_DVB_STUFFING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_stuffing_descriptor. ++ */ ++struct dvb_stuffing_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_stuffing_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_stuffing_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_stuffing_descriptor* ++ dvb_stuffing_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_stuffing_descriptor*) d; ++} ++ ++/** ++ * Retrieve a pointer to the data field of a dvb_stuffing_descriptor. ++ * ++ * @param d dvb_stuffing_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ dvb_stuffing_descriptor_data(struct dvb_stuffing_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_stuffing_descriptor); ++} ++ ++/** ++ * Calculate length of the data field of a dvb_stuffing_descriptor. ++ * ++ * @param d dvb_stuffing_descriptor pointer. ++ * @return The length in bytes. ++ */ ++static inline int ++ dvb_stuffing_descriptor_data_length(struct dvb_stuffing_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/subtitling_descriptor.h dvb-apps/lib/libucsi/dvb/subtitling_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/subtitling_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/subtitling_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,126 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_SUBTITLING_DESCRIPTOR ++#define _UCSI_DVB_SUBTITLING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_subtitling_descriptor structure. ++ */ ++struct dvb_subtitling_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_subtitling_entry subtitles[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the subtitles field of the a dvb_subtitling_descriptor. ++ */ ++struct dvb_subtitling_entry { ++ iso639lang_t language_code; ++ uint8_t subtitling_type; ++ uint16_t composition_page_id; ++ uint16_t ancillary_page_id; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_subtitling_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_subtitling_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_subtitling_descriptor* ++ dvb_subtitling_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint8_t* ptr = (uint8_t*) d + 2; ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_subtitling_entry)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(ptr+pos+4); ++ bswap16(ptr+pos+6); ++ pos += sizeof(struct dvb_subtitling_entry); ++ } ++ ++ return (struct dvb_subtitling_descriptor*) d; ++} ++ ++/** ++ * Iterator for subtitles field in dvb_subtitling_descriptor. ++ * ++ * @param d dvb_subtitling_descriptor pointer. ++ * @param pos Variable containing a pointer to current dvb_subtitling_entry. ++ */ ++#define dvb_subtitling_descriptor_subtitles_for_each(d, pos) \ ++ for ((pos) = dvb_subtitling_descriptor_subtitles_first(d); \ ++ (pos); \ ++ (pos) = dvb_subtitling_descriptor_subtitles_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_subtitling_entry* ++ dvb_subtitling_descriptor_subtitles_first(struct dvb_subtitling_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_subtitling_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_subtitling_descriptor)); ++} ++ ++static inline struct dvb_subtitling_entry* ++ dvb_subtitling_descriptor_subtitles_next(struct dvb_subtitling_descriptor *d, ++ struct dvb_subtitling_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_subtitling_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_subtitling_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_address_descriptor.h dvb-apps/lib/libucsi/dvb/target_ip_address_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_address_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ip_address_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IP_ADDRESS_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IP_ADDRESS_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ip_address_descriptor structure. ++ */ ++struct dvb_target_ip_address_descriptor { ++ struct descriptor d; ++ ++ uint8_t ipv4_addr_mask[4]; ++ /* struct dvb_ipv4_addr ipv4_addr[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv4_addr field of a dvb_target_ip_address_descriptor. ++ */ ++struct dvb_ipv4_addr { ++ uint8_t ipv4_addr[4]; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ip_address_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ip_address_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ip_address_descriptor* ++ dvb_target_ip_address_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len - 4; ++ ++ if (len % sizeof(struct dvb_ipv4_addr)) ++ return NULL; ++ ++ return (struct dvb_target_ip_address_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv4_addr field of a dvb_target_ip_address_descriptor. ++ * ++ * @param d dvb_target_ip_address_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv4_addr. ++ */ ++#define dvb_target_ip_address_descriptor_ipv4_addr_for_each(d, pos) \ ++ for ((pos) = dvb_target_ip_address_descriptor_ipv4_addr_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ip_address_descriptor_ipv4_addr_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv4_addr* ++ dvb_target_ip_address_descriptor_ipv4_addr_first(struct dvb_target_ip_address_descriptor *d) ++{ ++ if (d->d.len == 4) ++ return NULL; ++ ++ return (struct dvb_ipv4_addr *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ip_address_descriptor)); ++} ++ ++static inline struct dvb_ipv4_addr* ++ dvb_target_ip_address_descriptor_ipv4_addr_next(struct dvb_target_ip_address_descriptor *d, ++ struct dvb_ipv4_addr *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len - 4; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv4_addr); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv4_addr *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_slash_descriptor.h dvb-apps/lib/libucsi/dvb/target_ip_slash_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_slash_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ip_slash_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IP_SLASH_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IP_SLASH_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ip_slash_descriptor structure. ++ */ ++struct dvb_target_ip_slash_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ipv4_slash ipv4_slash[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv4_slash field of a dvb_target_ip_slash_descriptor. ++ */ ++struct dvb_ipv4_slash { ++ uint8_t ipv4_addr[4]; ++ uint8_t ipv4_slash; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ip_slash_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ip_slash_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ip_slash_descriptor* ++ dvb_target_ip_slash_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_ipv4_slash)) ++ return NULL; ++ ++ return (struct dvb_target_ip_slash_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv4_slash field of a dvb_target_ip_slash_descriptor. ++ * ++ * @param d dvb_target_ip_slash_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv4_slash. ++ */ ++#define dvb_target_ip_slash_descriptor_ipv4_slash_for_each(d, pos) \ ++ for ((pos) = dvb_target_ip_slash_descriptor_ipv4_slash_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ip_slash_descriptor_ipv4_slash_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv4_slash* ++ dvb_target_ip_slash_descriptor_ipv4_slash_first(struct dvb_target_ip_slash_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ipv4_slash *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ip_slash_descriptor)); ++} ++ ++static inline struct dvb_ipv4_slash* ++ dvb_target_ip_slash_descriptor_ipv4_slash_next(struct dvb_target_ip_slash_descriptor *d, ++ struct dvb_ipv4_slash *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv4_slash); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv4_slash *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_source_slash_descriptor.h dvb-apps/lib/libucsi/dvb/target_ip_source_slash_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ip_source_slash_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ip_source_slash_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,118 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IP_SOURCE_SLASH_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IP_SOURCE_SLASH_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ip_source_slash_descriptor structure. ++ */ ++struct dvb_target_ip_source_slash_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ipv4_source_slash ipv4_source_slash[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv4_source_slash field of a dvb_target_ip_source_slash_descriptor. ++ */ ++struct dvb_ipv4_source_slash { ++ uint8_t ipv4_source_addr[4]; ++ uint8_t ipv4_source_slash; ++ uint8_t ipv4_dest_addr[4]; ++ uint8_t ipv4_dest_slash; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ip_source_slash_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ip_source_slash_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ip_source_slash_descriptor* ++ dvb_target_ip_source_slash_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_ipv4_source_slash)) ++ return NULL; ++ ++ return (struct dvb_target_ip_source_slash_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv4_source_slash field of a dvb_target_ip_source_slash_descriptor. ++ * ++ * @param d dvb_target_ip_source_slash_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv4_source_slash. ++ */ ++#define dvb_target_ip_source_slash_descriptor_ipv4_source_slash_for_each(d, pos) \ ++ for ((pos) = dvb_target_ip_source_slash_descriptor_ipv4_source_slash_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ip_source_slash_descriptor_ipv4_source_slash_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv4_source_slash* ++ dvb_target_ip_source_slash_descriptor_ipv4_source_slash_first(struct dvb_target_ip_source_slash_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ipv4_source_slash *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ip_source_slash_descriptor)); ++} ++ ++static inline struct dvb_ipv4_source_slash* ++ dvb_target_ip_source_slash_descriptor_ipv4_source_slash_next(struct dvb_target_ip_source_slash_descriptor *d, ++ struct dvb_ipv4_source_slash *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv4_source_slash); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv4_source_slash *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_address_descriptor.h dvb-apps/lib/libucsi/dvb/target_ipv6_address_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_address_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ipv6_address_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IPV6_ADDRESS_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IPV6_ADDRESS_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ipv6_address_descriptor structure. ++ */ ++struct dvb_target_ipv6_address_descriptor { ++ struct descriptor d; ++ ++ uint8_t ipv6_addr_mask[16]; ++ /* struct dvb_ipv6_addr ipv6_addr[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv6_addr field of a dvb_target_ipv6_address_descriptor. ++ */ ++struct dvb_ipv6_addr { ++ uint8_t ipv6_addr[16]; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ipv6_address_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ipv6_address_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ipv6_address_descriptor* ++ dvb_target_ipv6_address_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len - 16; ++ ++ if (len % sizeof(struct dvb_ipv6_addr)) ++ return NULL; ++ ++ return (struct dvb_target_ipv6_address_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv6_addr field of a dvb_target_ipv6_address_descriptor. ++ * ++ * @param d dvb_target_ipv6_address_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv6_addr. ++ */ ++#define dvb_target_ipv6_address_descriptor_ipv6_addr_for_each(d, pos) \ ++ for ((pos) = dvb_target_ipv6_address_descriptor_ipv6_addr_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ipv6_address_descriptor_ipv6_addr_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv6_addr* ++ dvb_target_ipv6_address_descriptor_ipv6_addr_first(struct dvb_target_ipv6_address_descriptor *d) ++{ ++ if (d->d.len == 16) ++ return NULL; ++ ++ return (struct dvb_ipv6_addr *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ipv6_address_descriptor)); ++} ++ ++static inline struct dvb_ipv6_addr* ++ dvb_target_ipv6_address_descriptor_ipv6_addr_next(struct dvb_target_ipv6_address_descriptor *d, ++ struct dvb_ipv6_addr *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len - 16; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv6_addr); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv6_addr *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_slash_descriptor.h dvb-apps/lib/libucsi/dvb/target_ipv6_slash_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_slash_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ipv6_slash_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IPV6_SLASH_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IPV6_SLASH_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ipv6_slash_descriptor structure. ++ */ ++struct dvb_target_ipv6_slash_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ipv6_slash ipv6_slash[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv6_slash field of a dvb_target_ipv6_slash_descriptor. ++ */ ++struct dvb_ipv6_slash { ++ uint8_t ipv6_addr[16]; ++ uint8_t ipv6_slash; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ipv6_slash_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ipv6_slash_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ipv6_slash_descriptor* ++ dvb_target_ipv6_slash_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_ipv6_slash)) ++ return NULL; ++ ++ return (struct dvb_target_ipv6_slash_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv6_slash field of a dvb_target_ipv6_slash_descriptor. ++ * ++ * @param d dvb_target_ipv6_slash_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv6_slash. ++ */ ++#define dvb_target_ipv6_slash_descriptor_ipv6_slash_for_each(d, pos) \ ++ for ((pos) = dvb_target_ipv6_slash_descriptor_ipv6_slash_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ipv6_slash_descriptor_ipv6_slash_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv6_slash* ++ dvb_target_ipv6_slash_descriptor_ipv6_slash_first(struct dvb_target_ipv6_slash_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ipv6_slash *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ipv6_slash_descriptor)); ++} ++ ++static inline struct dvb_ipv6_slash* ++ dvb_target_ipv6_slash_descriptor_ipv6_slash_next(struct dvb_target_ipv6_slash_descriptor *d, ++ struct dvb_ipv6_slash *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv6_slash); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv6_slash *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h dvb-apps/lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,118 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TARGET_IPV6_SOURCE_SLASH_DESCRIPTOR ++#define _UCSI_DVB_TARGET_IPV6_SOURCE_SLASH_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_target_ipv6_source_slash_descriptor structure. ++ */ ++struct dvb_target_ipv6_source_slash_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_ipv6_source_slash ipv6_source_slash[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the ipv6_source_slash field of a dvb_target_ipv6_source_slash_descriptor. ++ */ ++struct dvb_ipv6_source_slash { ++ uint8_t ipv6_source_addr[16]; ++ uint8_t ipv6_source_slash; ++ uint8_t ipv6_dest_addr[16]; ++ uint8_t ipv6_dest_slash; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_target_ipv6_source_slash_descriptor. ++ * ++ * @param d Generic descriptor structure pointer. ++ * @return dvb_target_ipv6_source_slash_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_target_ipv6_source_slash_descriptor* ++ dvb_target_ipv6_source_slash_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t len = d->len; ++ ++ if (len % sizeof(struct dvb_ipv6_source_slash)) ++ return NULL; ++ ++ return (struct dvb_target_ipv6_source_slash_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries in the ipv6_source_slash field of a dvb_target_ipv6_source_slash_descriptor. ++ * ++ * @param d dvb_target_ipv6_source_slash_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_ipv6_source_slash. ++ */ ++#define dvb_target_ipv6_source_slash_descriptor_ipv6_source_slash_for_each(d, pos) \ ++ for ((pos) = dvb_target_ipv6_source_slash_descriptor_ipv6_source_slash_first(d); \ ++ (pos); \ ++ (pos) = dvb_target_ipv6_source_slash_descriptor_ipv6_source_slash_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_ipv6_source_slash* ++ dvb_target_ipv6_source_slash_descriptor_ipv6_source_slash_first(struct dvb_target_ipv6_source_slash_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_ipv6_source_slash *) ++ ((uint8_t*) d + sizeof(struct dvb_target_ipv6_source_slash_descriptor)); ++} ++ ++static inline struct dvb_ipv6_source_slash* ++ dvb_target_ipv6_source_slash_descriptor_ipv6_source_slash_next(struct dvb_target_ipv6_source_slash_descriptor *d, ++ struct dvb_ipv6_source_slash *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_ipv6_source_slash); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_ipv6_source_slash *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tdt_section.c dvb-apps/lib/libucsi/dvb/tdt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tdt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tdt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,33 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_tdt_section * dvb_tdt_section_codec(struct section * section) ++{ ++ size_t len = section_length(section); ++ struct dvb_tdt_section * ret = (struct dvb_tdt_section *) section; ++ ++ if (len != sizeof(struct dvb_tdt_section)) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tdt_section.h dvb-apps/lib/libucsi/dvb/tdt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tdt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tdt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,54 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TDT_SECTION_H ++#define _UCSI_DVB_TDT_SECTION_H ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_tdt_section structure. ++ */ ++struct dvb_tdt_section { ++ struct section head; ++ ++ dvbdate_t utc_time; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_tdt_section. ++ * ++ * @param section Generic section header. ++ * @return dvb_tdt_section pointer, or NULL on error. ++ */ ++struct dvb_tdt_section *dvb_tdt_section_codec(struct section *section); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/telephone_descriptor.h dvb-apps/lib/libucsi/dvb/telephone_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/telephone_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/telephone_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,150 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TELEPHONE_DESCRIPTOR ++#define _UCSI_DVB_TELEPHONE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_telephone_descriptor stucture. ++ */ ++struct dvb_telephone_descriptor { ++ struct descriptor d; ++ ++ EBIT3(uint8_t reserved_1 : 2; , ++ uint8_t foreign_availability : 1; , ++ uint8_t connection_type : 5; ); ++ EBIT4(uint8_t reserved_2 : 1; , ++ uint8_t country_prefix_length : 2; , ++ uint8_t international_area_code_length : 3; , ++ uint8_t operator_code_length : 2; ); ++ EBIT3(uint8_t reserved_3 : 1; , ++ uint8_t national_area_code_length : 3; , ++ uint8_t core_number_length : 4; ); ++ /* uint8_t country_prefix[] */ ++ /* uint8_t international_area_code[] */ ++ /* uint8_t operator_code[] */ ++ /* uint8_t national_area_code[] */ ++ /* uint8_t core_number[] */ ++} __ucsi_packed; ++ ++ ++/** ++ * Process a dvb_telephone_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_telephone_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_telephone_descriptor* ++ dvb_telephone_descriptor_codec(struct descriptor* d) ++{ ++ struct dvb_telephone_descriptor* p = ++ (struct dvb_telephone_descriptor*) d; ++ uint32_t pos = sizeof(struct dvb_telephone_descriptor) - 2; ++ uint32_t len = d->len; ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += p->country_prefix_length + ++ p->international_area_code_length + ++ p->operator_code_length + ++ p->national_area_code_length + ++ p->core_number_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return p; ++} ++ ++/** ++ * Retrieve pointer to country_prefix field of a dvb_telephone_descriptor. ++ * ++ * @param d dvb_telephone_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_telephone_descriptor_country_prefix(struct dvb_telephone_descriptor* d) ++{ ++ return (uint8_t*) d + sizeof(struct dvb_telephone_descriptor); ++} ++ ++/** ++ * Retrieve pointer to international_area_code field of a dvb_telephone_descriptor. ++ * ++ * @param d dvb_telephone_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_telephone_descriptor_international_area_code(struct dvb_telephone_descriptor* d) ++{ ++ return dvb_telephone_descriptor_country_prefix(d) + d->country_prefix_length; ++} ++ ++/** ++ * Retrieve pointer to operator_code field of a dvb_telephone_descriptor. ++ * ++ * @param d dvb_telephone_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_telephone_descriptor_operator_code(struct dvb_telephone_descriptor* d) ++{ ++ return dvb_telephone_descriptor_international_area_code(d) + d->international_area_code_length; ++} ++ ++/** ++ * Retrieve pointer to national_area_code field of a dvb_telephone_descriptor. ++ * ++ * @param d dvb_telephone_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_telephone_descriptor_national_area_code(struct dvb_telephone_descriptor* d) ++{ ++ return dvb_telephone_descriptor_operator_code(d) + d->operator_code_length; ++} ++ ++/** ++ * Retrieve pointer to core_number field of a dvb_telephone_descriptor. ++ * ++ * @param d dvb_telephone_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ dvb_telephone_descriptor_core_number(struct dvb_telephone_descriptor* d) ++{ ++ return dvb_telephone_descriptor_national_area_code(d) + d->national_area_code_length; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/teletext_descriptor.h dvb-apps/lib/libucsi/dvb/teletext_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/teletext_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/teletext_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,127 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TELETEXT_DESCRIPTOR ++#define _UCSI_DVB_TELETEXT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Possible values for the type field. ++ */ ++enum { ++ DVB_TELETEXT_TYPE_INITIAL = 0x01, ++ DVB_TELETEXT_TYPE_SUBTITLE = 0x02, ++ DVB_TELETEXT_TYPE_ADDITIONAL = 0x03, ++ DVB_TELETEXT_TYPE_SCHEDULE = 0x04, ++ DVB_TELETEXT_TYPE_SUBTITLE_HEARING_IMPAIRED= 0x05, ++}; ++ ++/** ++ * dvb_teletext_descriptor structure. ++ */ ++struct dvb_teletext_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_teletext_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_teletext_descriptor. ++ */ ++struct dvb_teletext_entry { ++ iso639lang_t language_code; ++ EBIT2(uint8_t type : 5; , ++ uint8_t magazine_number: 3; ); ++ uint8_t page_number; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_teletext_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_teletext_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_teletext_descriptor* ++ dvb_teletext_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len % sizeof(struct dvb_teletext_entry)) ++ return NULL; ++ ++ return (struct dvb_teletext_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a dvb_teletext_descriptor. ++ * ++ * @param d dvb_teletext_descriptor pointer. ++ * @param pos Variable holding a pointer to the current dvb_teletext_entry. ++ */ ++#define dvb_teletext_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_teletext_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_teletext_descriptor_entries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_teletext_entry* ++ dvb_teletext_descriptor_entries_first(struct dvb_teletext_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_teletext_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_teletext_descriptor)); ++} ++ ++static inline struct dvb_teletext_entry* ++ dvb_teletext_descriptor_entries_next(struct dvb_teletext_descriptor *d, ++ struct dvb_teletext_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_teletext_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_teletext_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/terrestrial_delivery_descriptor.h dvb-apps/lib/libucsi/dvb/terrestrial_delivery_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/terrestrial_delivery_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/terrestrial_delivery_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,77 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TERRESTRIAL_DELIVERY_DESCRIPTOR ++#define _UCSI_DVB_TERRESTRIAL_DELIVERY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_terrestrial_delivery_descriptor structure. ++ */ ++struct dvb_terrestrial_delivery_descriptor { ++ struct descriptor d; ++ ++ uint32_t centre_frequency; // Normal integer, units 10Hz ++ EBIT5(uint8_t bandwidth : 3; , ++ uint8_t priority : 1; , ++ uint8_t time_slicing_indicator : 1; , ++ uint8_t mpe_fec_indicator : 1; , ++ uint8_t reserved_1 : 2; ); ++ EBIT3(uint8_t constellation : 2; , ++ uint8_t hierarchy_information : 3; , ++ uint8_t code_rate_hp_stream : 3; ); ++ EBIT4(uint8_t code_rate_lp_stream : 3; , ++ uint8_t guard_interval : 2; , ++ uint8_t transmission_mode : 2; , ++ uint8_t other_frequency_flag : 1; ); ++ uint32_t reserved_2; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_terrestrial_delivery_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_terrestrial_delivery_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_terrestrial_delivery_descriptor* ++ dvb_terrestrial_delivery_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_terrestrial_delivery_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ bswap32((uint8_t*) d + 9); ++ ++ return (struct dvb_terrestrial_delivery_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_shifted_event_descriptor.h dvb-apps/lib/libucsi/dvb/time_shifted_event_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_shifted_event_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/time_shifted_event_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TIME_SHIFTED_EVENT_DESCRIPTOR ++#define _UCSI_DVB_TIME_SHIFTED_EVENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_time_shifted_event_descriptor structure. ++ */ ++struct dvb_time_shifted_event_descriptor { ++ struct descriptor d; ++ ++ uint16_t reference_service_id; ++ uint16_t reference_event_id; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_time_shifted_event_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_time_shifted_event_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_time_shifted_event_descriptor* ++ dvb_time_shifted_event_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_time_shifted_event_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 4); ++ ++ return (struct dvb_time_shifted_event_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_shifted_service_descriptor.h dvb-apps/lib/libucsi/dvb/time_shifted_service_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_shifted_service_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/time_shifted_service_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TIME_SHIFTED_SERVICE_DESCRIPTOR ++#define _UCSI_DVB_TIME_SHIFTED_SERVICE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_time_shifted_service_descriptor structure. ++ */ ++struct dvb_time_shifted_service_descriptor { ++ struct descriptor d; ++ ++ uint16_t reference_service_id; ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_time_shifted_service_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return Pointer to dvb_time_shifted_service_descriptor, or NULL on error. ++ */ ++static inline struct dvb_time_shifted_service_descriptor* ++ dvb_time_shifted_service_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct dvb_time_shifted_service_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ ++ return (struct dvb_time_shifted_service_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h dvb-apps/lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,94 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2008 Patrick Boettcher (pb@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TIME_SLICE_FEC_IDENTIFIER_DESCRIPTOR ++#define _UCSI_DVB_TIME_SLICE_FEC_IDENTIFIER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/* ++ * dvb_time_slice_fec_identifier_descriptor structure. ++ */ ++struct dvb_time_slice_fec_identifier_descriptor { ++ struct descriptor d; ++ ++ EBIT4(uint8_t time_slicing :1; , ++ uint8_t mpe_fec :2; , ++ uint8_t reserved :2; , ++ uint8_t frame_size :3; ); ++ ++ uint8_t max_burst_duration; ++ ++ EBIT2(uint8_t max_average_rate :4; , ++ uint8_t time_slice_fec_id :4; ); ++ /* id_selector_bytes[] */ ++}; ++ ++static inline struct dvb_time_slice_fec_identifier_descriptor * ++ dvb_time_slice_fec_identifier_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < 3) ++ return NULL; ++ return (struct dvb_time_slice_fec_identifier_descriptor *) d; ++} ++ ++static inline uint8_t dvb_time_slice_fec_identifier_selector_byte_length(struct dvb_time_slice_fec_identifier_descriptor *d) ++{ ++ return d->d.len - 3; ++} ++ ++static inline uint8_t * dvb_time_slice_fec_identifier_selector_bytes(struct dvb_time_slice_fec_identifier_descriptor *d) ++{ ++ if (d->d.len < 3) ++ return NULL; ++ else ++ return ((uint8_t *) d) + 2 + 3; ++} ++ ++static inline uint16_t dvb_time_slice_fec_identifier_max_burst_duration_msec(struct dvb_time_slice_fec_identifier_descriptor *d) ++{ ++ return (d->max_burst_duration + 1) * 20; ++} ++ ++static inline uint16_t dvb_time_slice_fec_identifier_frame_size_kbits(struct dvb_time_slice_fec_identifier_descriptor *d) ++{ ++ if (d->frame_size > 3) ++ return 0; ++ return (d->frame_size+1) * 512; ++} ++ ++static inline uint16_t dvb_time_slice_fec_identifier_frame_size_rows(struct dvb_time_slice_fec_identifier_descriptor *d) ++{ ++ return dvb_time_slice_fec_identifier_frame_size_kbits(d) / 2; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tot_section.c dvb-apps/lib/libucsi/dvb/tot_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tot_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tot_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,50 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_tot_section *dvb_tot_section_codec(struct section *section) ++{ ++ uint8_t * buf = (uint8_t *)section; ++ size_t pos = sizeof(struct section); ++ size_t len = section_length(section) - CRC_SIZE; ++ struct dvb_tot_section * ret = (struct dvb_tot_section *)section; ++ ++ if (len < sizeof(struct dvb_tot_section)) ++ return NULL; ++ ++ pos += 5; ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if ((pos + ret->descriptors_loop_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ret->descriptors_loop_length)) ++ return NULL; ++ ++ pos += ret->descriptors_loop_length; ++ ++ if (pos != len) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tot_section.h dvb-apps/lib/libucsi/dvb/tot_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tot_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tot_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,97 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TOT_SECTION_H ++#define _UCSI_DVB_TOT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_tot_section structure. ++ */ ++struct dvb_tot_section { ++ struct section head; ++ ++ dvbdate_t utc_time; ++ EBIT2(uint16_t reserved : 4; , ++ uint16_t descriptors_loop_length:12; ); ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_tot_section. ++ * ++ * @param section Pointer to generic section structure. ++ * @return dvb_tot_section pointer, or NULL on error. ++ */ ++struct dvb_tot_section * dvb_tot_section_codec(struct section *section); ++ ++/** ++ * Iterator for descriptors field of dvb_tot_section. ++ * ++ * @param tot dvb_tot_section pointer. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define dvb_tot_section_descriptors_for_each(tot, pos) \ ++ for ((pos) = dvb_tot_section_descriptors_first(tot); \ ++ (pos); \ ++ (pos) = dvb_tot_section_descriptors_next(tot, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ dvb_tot_section_descriptors_first(struct dvb_tot_section * tot) ++{ ++ if (tot->descriptors_loop_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) tot + sizeof(struct dvb_tot_section)); ++} ++ ++static inline struct descriptor * ++ dvb_tot_section_descriptors_next(struct dvb_tot_section *tot, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t *) tot + sizeof(struct dvb_tot_section), ++ tot->descriptors_loop_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/transport_stream_descriptor.h dvb-apps/lib/libucsi/dvb/transport_stream_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/transport_stream_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/transport_stream_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TRANSPORT_STREAM_DESCRIPTOR ++#define _UCSI_DVB_TRANSPORT_STREAM_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_transport_stream_descriptor structure. ++ */ ++struct dvb_transport_stream_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process dvb_transport_stream_descriptor structure. ++ * ++ * @param d Pointer to generic descriptor. ++ * @return dvb_transport_stream_descriptor structure or NULL on error. ++ */ ++static inline struct dvb_transport_stream_descriptor* ++ dvb_transport_stream_descriptor_codec(struct descriptor* d) ++{ ++ return (struct dvb_transport_stream_descriptor*) d; ++} ++ ++/** ++ * Retrieve a pointer to the data field of a dvb_transport_stream_descriptor. ++ * ++ * @param d dvb_transport_stream_descriptor structure. ++ * @return Pointer to data field. ++ */ ++static inline uint8_t * ++ dvb_transport_stream_descriptor_data(struct dvb_transport_stream_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_transport_stream_descriptor); ++} ++ ++/** ++ * Calculate the length of the data field of a dvb_transport_stream_descriptor. ++ * ++ * @param d dvb_transport_stream_descriptor structure. ++ * @return length of data field in bytes. ++ */ ++static inline int ++ dvb_transport_stream_descriptor_data_length(struct dvb_transport_stream_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_container_section.c dvb-apps/lib/libucsi/dvb/tva_container_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_container_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tva_container_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,33 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct dvb_tva_container_section *dvb_tva_container_section_codec(struct section_ext *ext) ++{ ++ size_t len = section_ext_length(ext); ++ struct dvb_tva_container_section* ret = (struct dvb_tva_container_section*) ext; ++ ++ if (len < sizeof(struct dvb_tva_container_section)) ++ return NULL; ++ ++ return ret; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_container_section.h dvb-apps/lib/libucsi/dvb/tva_container_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_container_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tva_container_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,90 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TVA_CONTAINER_SECTION_H ++#define _UCSI_DVB_TVA_CONTAINER_SECTION_H ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_tva_container_section structure. ++ */ ++struct dvb_tva_container_section { ++ struct section_ext head; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_tva_container_section. ++ * ++ * @param section Generic section header. ++ * @return dvb_tdt_section pointer, or NULL on error. ++ */ ++struct dvb_tva_container_section *dvb_tva_container_section_codec(struct section_ext *ext); ++ ++/** ++ * Accessor for the container_id field of a tva container section. ++ * ++ * @param container dvb_tva_container_section pointer. ++ * @return The container_id. ++ */ ++static inline uint16_t dvb_tva_container_section_container_id(struct dvb_tva_container_section *container) ++{ ++ return container->head.table_id_ext; ++} ++ ++/** ++ * Accessor for the data field of a dvb_data_broadcast_id_descriptor. ++ * ++ * @param d dvb_data_broadcast_id_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++dvb_tva_container_section_data(struct dvb_tva_container_section *s) ++{ ++ return (uint8_t *) s + sizeof(struct dvb_tva_container_section); ++} ++ ++/** ++ * Determine the number of bytes in the data field of a dvb_tva_container_section. ++ * ++ * @param d dvb_tva_container_section pointer. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++dvb_tva_container_section_data_length(struct dvb_tva_container_section *s) ++{ ++ return section_ext_length(&s->head) - sizeof(struct dvb_tva_container_section); ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_id_descriptor.h dvb-apps/lib/libucsi/dvb/tva_id_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/tva_id_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/tva_id_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,124 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TVA_ID_DESCRIPTOR ++#define _UCSI_DVB_TVA_ID_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * dvb_tva_id_descriptor structure. ++ */ ++struct dvb_tva_id_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_tva_id_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the entries field of a dvb_tva_id_descriptor. ++ */ ++struct dvb_tva_id_entry { ++ uint16_t tva_id; ++ EBIT2(uint8_t reserved : 5; , ++ uint8_t running_status : 3; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_tva_id_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return dvb_tva_id_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_tva_id_descriptor* ++ dvb_tva_id_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ uint8_t* buf = (uint8_t*) d + 2; ++ ++ pos += sizeof(struct dvb_tva_id_descriptor) - 2; ++ if (len % sizeof(struct dvb_tva_id_entry)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos+=3; ++ } ++ ++ return (struct dvb_tva_id_descriptor*) d; ++} ++ ++/** ++ * Iterator for the entries field of a dvb_tva_id_descriptor. ++ * ++ * @param d dvb_tva_id_descriptor pointer. ++ * @param pos Variable containing a pointer to the current dvb_tva_id_entry. ++ */ ++#define dvb_tva_id_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_tva_id_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_tva_id_descriptor_entries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_tva_id_entry* ++ dvb_tva_id_descriptor_entries_first(struct dvb_tva_id_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_tva_id_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_tva_id_descriptor)); ++} ++ ++static inline struct dvb_tva_id_entry* ++ dvb_tva_id_descriptor_entries_next(struct dvb_tva_id_descriptor *d, ++ struct dvb_tva_id_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_tva_id_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_tva_id_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/types.c dvb-apps/lib/libucsi/dvb/types.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/types.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/types.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,270 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include "types.h" ++ ++time_t dvbdate_to_unixtime(dvbdate_t dvbdate) ++{ ++ int k = 0; ++ struct tm tm; ++ double mjd; ++ ++ /* check for the undefined value */ ++ if ((dvbdate[0] == 0xff) && ++ (dvbdate[1] == 0xff) && ++ (dvbdate[2] == 0xff) && ++ (dvbdate[3] == 0xff) && ++ (dvbdate[4] == 0xff)) { ++ return -1; ++ } ++ ++ memset(&tm, 0, sizeof(tm)); ++ mjd = (dvbdate[0] << 8) | dvbdate[1]; ++ ++ tm.tm_year = (int) ((mjd - 15078.2) / 365.25); ++ tm.tm_mon = (int) (((mjd - 14956.1) - (int) (tm.tm_year * 365.25)) / 30.6001); ++ tm.tm_mday = (int) mjd - 14956 - (int) (tm.tm_year * 365.25) - (int) (tm.tm_mon * 30.6001); ++ if ((tm.tm_mon == 14) || (tm.tm_mon == 15)) k = 1; ++ tm.tm_year += k; ++ tm.tm_mon = tm.tm_mon - 2 - k * 12; ++ tm.tm_sec = bcd_to_integer(dvbdate[4]); ++ tm.tm_min = bcd_to_integer(dvbdate[3]); ++ tm.tm_hour = bcd_to_integer(dvbdate[2]); ++ ++ return mktime(&tm); ++} ++ ++void unixtime_to_dvbdate(time_t unixtime, dvbdate_t dvbdate) ++{ ++ struct tm tm; ++ double l = 0; ++ int mjd; ++ ++ /* the undefined value */ ++ if (unixtime == -1) { ++ memset(dvbdate, 0xff, 5); ++ return; ++ } ++ ++ gmtime_r(&unixtime, &tm); ++ tm.tm_mon++; ++ if ((tm.tm_mon == 1) || (tm.tm_mon == 2)) l = 1; ++ mjd = 14956 + tm.tm_mday + (int) ((tm.tm_year - l) * 365.25) + (int) ((tm.tm_mon + 1 + l * 12) * 30.6001); ++ ++ dvbdate[0] = (mjd & 0xff00) >> 8; ++ dvbdate[1] = mjd & 0xff; ++ dvbdate[2] = integer_to_bcd(tm.tm_hour); ++ dvbdate[3] = integer_to_bcd(tm.tm_min); ++ dvbdate[4] = integer_to_bcd(tm.tm_sec); ++} ++ ++int dvbduration_to_seconds(dvbduration_t dvbduration) ++{ ++ int seconds = 0; ++ ++ seconds += (bcd_to_integer(dvbduration[0]) * 60 * 60); ++ seconds += (bcd_to_integer(dvbduration[1]) * 60); ++ seconds += bcd_to_integer(dvbduration[2]); ++ ++ return seconds; ++} ++ ++void seconds_to_dvbduration(int seconds, dvbduration_t dvbduration) ++{ ++ int hours, mins; ++ ++ hours = seconds / (60*60); ++ seconds -= (hours * 60 * 60); ++ mins = seconds / 60; ++ seconds -= (mins * 60); ++ ++ dvbduration[0] = integer_to_bcd(hours); ++ dvbduration[1] = integer_to_bcd(mins); ++ dvbduration[2] = integer_to_bcd(seconds); ++} ++ ++int dvbhhmm_to_seconds(dvbhhmm_t dvbhhmm) ++{ ++ int seconds = 0; ++ ++ seconds += (bcd_to_integer(dvbhhmm[0]) * 60 * 60); ++ seconds += (bcd_to_integer(dvbhhmm[1]) * 60); ++ ++ return seconds; ++} ++ ++void seconds_to_dvbhhmm(int seconds, dvbhhmm_t dvbhhmm) ++{ ++ int hours, mins; ++ ++ hours = seconds / (60*60); ++ seconds -= (hours * 60 * 60); ++ mins = seconds / 60; ++ ++ dvbhhmm[0] = integer_to_bcd(hours); ++ dvbhhmm[1] = integer_to_bcd(mins); ++} ++ ++uint32_t integer_to_bcd(uint32_t intval) ++{ ++ uint32_t val = 0; ++ ++ int i; ++ for(i=0; i<=28;i+=4) { ++ val |= ((intval % 10) << i); ++ intval /= 10; ++ } ++ ++ return val; ++} ++ ++uint32_t bcd_to_integer(uint32_t bcdval) ++{ ++ uint32_t val = 0; ++ ++ int i; ++ for(i=28; i>=0;i-=4) { ++ val += ((bcdval >> i) & 0x0f); ++ if (i != 0) val *= 10; ++ } ++ ++ return val; ++} ++ ++const char *dvb_charset(char *dvb_text, int dvb_text_length, int *consumed) ++{ ++ char *charset = "ISO6937"; ++ int used = 0; ++ ++ if (dvb_text_length == 0) ++ goto exit; ++ if (dvb_text[0] >= 32) ++ goto exit; ++ if (dvb_text[0] == 0x10) { ++ if (dvb_text_length < 3) ++ goto exit; ++ ++ used = 3; ++ uint16_t ext = (dvb_text[1] << 8) | dvb_text[2]; ++ switch(ext) { ++ case 0x01: ++ charset = "ISO8859-1"; ++ break; ++ case 0x02: ++ charset = "ISO8859-2"; ++ break; ++ case 0x03: ++ charset = "ISO8859-3"; ++ break; ++ case 0x04: ++ charset = "ISO8859-4"; ++ break; ++ case 0x05: ++ charset = "ISO8859-5"; ++ break; ++ case 0x06: ++ charset = "ISO8859-6"; ++ break; ++ case 0x07: ++ charset = "ISO8859-7"; ++ break; ++ case 0x08: ++ charset = "ISO8859-8"; ++ break; ++ case 0x09: ++ charset = "ISO8859-9"; ++ break; ++ case 0x0a: ++ charset = "ISO8859-10"; ++ break; ++ case 0x0b: ++ charset = "ISO8859-11"; ++ break; ++ case 0x0d: ++ charset = "ISO8859-13"; ++ break; ++ case 0x0e: ++ charset = "ISO8859-14"; ++ break; ++ case 0x0f: ++ charset = "ISO8859-15"; ++ break; ++ default: ++ used = 0; ++ break; ++ } ++ } else { ++ used = 1; ++ switch(dvb_text[0]) { ++ case 0x01: ++ charset = "ISO8859-5"; ++ break; ++ case 0x02: ++ charset = "ISO8859-6"; ++ break; ++ case 0x03: ++ charset = "ISO8859-7"; ++ break; ++ case 0x04: ++ charset = "ISO8859-8"; ++ break; ++ case 0x05: ++ charset = "ISO8859-9"; ++ break; ++ case 0x06: ++ charset = "ISO8859-10"; ++ break; ++ case 0x07: ++ charset = "ISO8859-11"; ++ break; ++ case 0x09: ++ charset = "ISO8859-13"; ++ break; ++ case 0x0a: ++ charset = "ISO8859-14"; ++ break; ++ case 0x0b: ++ charset = "ISO8859-15"; ++ break; ++ case 0x11: ++ charset = "UTF16"; ++ break; ++ case 0x12: ++ charset = "EUC-KR"; ++ break; ++ case 0x13: ++ charset = "GB2312"; ++ break; ++ case 0x14: ++ charset = "GBK"; ++ break; ++ case 0x15: ++ charset = "UTF8"; ++ break; ++ default: ++ used = 0; ++ break; ++ } ++ } ++exit: ++ *consumed = used; ++ return charset; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/types.h dvb-apps/lib/libucsi/dvb/types.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/types.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/types.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,127 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_TYPES_H ++#define _UCSI_DVB_TYPES_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++typedef uint8_t dvbdate_t[5]; ++typedef uint8_t dvbduration_t[3]; ++typedef uint8_t dvbhhmm_t[2]; ++ ++/** ++ * Running status values. ++ */ ++enum { ++ DVB_RUNNING_STATUS_NOT_RUNNING = 0x01, ++ DVB_RUNNING_STATUS_FEW_SECONDS = 0x02, ++ DVB_RUNNING_STATUS_PAUSING = 0x03, ++ DVB_RUNNING_STATUS_RUNNING = 0x04, ++}; ++ ++/** ++ * Convert from a 5 byte DVB UTC date to unix time. ++ * Note: this functions expects the DVB date in network byte order. ++ * ++ * @param d Pointer to DVB date. ++ * @return The unix timestamp, or -1 if the dvbdate was set to the 'undefined' value ++ */ ++extern time_t dvbdate_to_unixtime(dvbdate_t dvbdate); ++ ++/** ++ * Convert from a unix timestemp to a 5 byte DVB UTC date. ++ * Note: this function will always output the DVB date in ++ * network byte order. ++ * ++ * @param unixtime The unix timestamp, or -1 for the 'undefined' value. ++ * @param utc Pointer to 5 byte DVB date. ++ */ ++extern void unixtime_to_dvbdate(time_t unixtime, dvbdate_t dvbdate); ++ ++/** ++ * Convert from a DVB BCD duration to a number of seconds. ++ * ++ * @param dvbduration Pointer to 3 byte DVB duration. ++ * @return Number of seconds. ++ */ ++extern int dvbduration_to_seconds(dvbduration_t dvbduration); ++ ++/** ++ * Convert from a number of seconds to a DVB 3 byte BCD duration. ++ * ++ * @param seconds The number of seconds. ++ * @param dvbduration Pointer to 3 byte DVB duration. ++ */ ++extern void seconds_to_dvbduration(int seconds, dvbduration_t dvbduration); ++ ++/** ++ * Convert from a DVB BCD HHMM to a number of seconds. ++ * ++ * @param dvbduration Pointer to 2 byte DVB HHMM. ++ * @return Number of seconds. ++ */ ++extern int dvbhhmm_to_seconds(dvbhhmm_t dvbhhmm); ++ ++/** ++ * Convert from a number of seconds to a DVB 2 byte BCD HHMM. ++ * ++ * @param seconds The number of seconds. ++ * @param dvbduration Pointer to 2 byte DVB HHMM. ++ */ ++extern void seconds_to_dvbhhmm(int seconds, dvbhhmm_t dvbhhmm); ++ ++/** ++ * Convert a __ucsi_packed BCD value into a normal integer. ++ * ++ * @param bcd The value to convert. ++ * @return The value. ++ */ ++extern uint32_t bcd_to_integer(uint32_t bcd); ++ ++/** ++ * Convert a normal integer into a __ucsi_packed BCD value. ++ * ++ * @param integer The value to convert. ++ * @return The value. ++ */ ++extern uint32_t integer_to_bcd(uint32_t integer); ++ ++/** ++ * Determine the (iconv compatable) character set of a dvb string. ++ * ++ * @param dvb_text DVB text concerned. ++ * @param dvb_text_length Length of text. ++ * @param consumed Out parameter of number of bytes used to encode the character set. ++ * @return Name of the character set. ++ */ ++extern const char *dvb_charset(char *dvb_text, int dvb_text_length, int *consumed); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/vbi_data_descriptor.h dvb-apps/lib/libucsi/dvb/vbi_data_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/vbi_data_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/vbi_data_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,186 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_VBI_DATA_DESCRIPTOR ++#define _UCSI_DVB_VBI_DATA_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for the data_service_id field. ++ */ ++enum { ++ DVB_VBI_DATA_SERVICE_ID_EBU = 0x01, ++ DVB_VBI_DATA_SERVICE_ID_INVERTED = 0x02, ++ DVB_VBI_DATA_SERVICE_ID_VPS = 0x04, ++ DVB_VBI_DATA_SERVICE_ID_WSS = 0x05, ++ DVB_VBI_DATA_SERVICE_ID_CC = 0x06, ++ DVB_VBI_DATA_SERVICE_ID_MONO_422 = 0x07, ++}; ++ ++/** ++ * dvb_vbi_data_descriptor structure ++ */ ++struct dvb_vbi_data_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_vbi_data_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the dvb_vbi_data_descriptor entries field. ++ */ ++struct dvb_vbi_data_entry { ++ uint8_t data_service_id; ++ uint8_t data_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Format of the dvb_vbi_data_entry data field, if data_service_id == 1,2,4,5,6,7. ++ */ ++struct dvb_vbi_data_x { ++ EBIT3(uint8_t reserved : 2; , ++ uint8_t field_parity : 1; , ++ uint8_t line_offset : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Process a dvb_vbi_data_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return dvb_vbi_data_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_vbi_data_descriptor* ++ dvb_vbi_data_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* p = (uint8_t*) d + 2; ++ uint32_t pos = 0; ++ uint32_t len = d->len; ++ ++ while(pos < len) { ++ struct dvb_vbi_data_entry *e = ++ (struct dvb_vbi_data_entry*) (p+pos); ++ ++ pos += sizeof(struct dvb_vbi_data_entry); ++ ++ if (pos > len) ++ return NULL; ++ ++ pos += e->data_length; ++ ++ if (pos > len) ++ return NULL; ++ } ++ ++ return (struct dvb_vbi_data_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field in a dvb_vbi_data_descriptor structure. ++ * ++ * @param d Pointer to dvb_vbi_data_descriptor structure. ++ * @param pos Variable holding pointer to the current dvb_vbi_data_entry structure. ++ */ ++#define dvb_vbi_data_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_vbi_data_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_vbi_data_descriptor_entries_next(d, pos)) ++ ++/** ++ * Get a pointer to the data field of a dvb_vbi_data_entry. ++ * ++ * @param d dvb_vbi_data_entry structure. ++ * @return Pointer to the data field. ++ */ ++static inline uint8_t * ++ dvb_vbi_data_entry_data(struct dvb_vbi_data_entry *d) ++{ ++ return (uint8_t *) d + sizeof(struct dvb_vbi_data_entry); ++} ++ ++/** ++ * Get a pointer to the data field of a dvb_vbi_data_x for id 1,2,4,5,6,7. ++ * ++ * @param d dvb_vbi_data_entry structure. ++ * @return Pointer to the data field, or NULL if invalid ++ */ ++static inline struct dvb_vbi_data_x* ++ dvb_vbi_data_entry_data_x(struct dvb_vbi_data_entry *d) ++{ ++ switch(d->data_service_id) { ++ case 1: ++ case 2: ++ case 4: ++ case 5: ++ case 6: ++ case 7: ++ return (struct dvb_vbi_data_x*) ((uint8_t *) d + sizeof(struct dvb_vbi_data_entry)); ++ } ++ ++ return NULL; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_vbi_data_entry* ++ dvb_vbi_data_descriptor_entries_first(struct dvb_vbi_data_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_vbi_data_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_vbi_data_descriptor)); ++} ++ ++static inline struct dvb_vbi_data_entry* ++ dvb_vbi_data_descriptor_entries_next(struct dvb_vbi_data_descriptor *d, ++ struct dvb_vbi_data_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_vbi_data_entry) + ++ pos->data_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_vbi_data_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/vbi_teletext_descriptor.h dvb-apps/lib/libucsi/dvb/vbi_teletext_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/dvb/vbi_teletext_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/dvb/vbi_teletext_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,116 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_DVB_VBI_TELETEXT_DESCRIPTOR ++#define _UCSI_DVB_VBI_TELETEXT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * dvb_vbi_teletext_descriptor structure ++ */ ++struct dvb_vbi_teletext_descriptor { ++ struct descriptor d; ++ ++ /* struct dvb_vbi_teletext_entry entries[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in a dvb_vbi_teletext_descriptor structure. ++ */ ++struct dvb_vbi_teletext_entry { ++ iso639lang_t language_code; ++ EBIT2(uint8_t type : 5; , ++ uint8_t magazine_number: 3; ); ++ uint8_t page_number; ++} __ucsi_packed; ++ ++/** ++ * Process an dvb_vbi_teletext_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return dvb_vbi_teletext_descriptor pointer, or NULL on error. ++ */ ++static inline struct dvb_vbi_teletext_descriptor* ++ dvb_vbi_teletext_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len % sizeof(struct dvb_vbi_teletext_entry)) ++ return NULL; ++ ++ return (struct dvb_vbi_teletext_descriptor*) d; ++} ++ ++/** ++ * Iterator for entries field of a dvb_vbi_teletext_descriptor. ++ * ++ * @param d Pointer to dvb_vbi_teletext_descriptor. ++ * @param pos Variable holding a pointer to the current dvb_vbi_teletext_entry. ++ */ ++#define dvb_vbi_teletext_descriptor_entries_for_each(d, pos) \ ++ for ((pos) = dvb_vbi_teletext_descriptor_entries_first(d); \ ++ (pos); \ ++ (pos) = dvb_vbi_teletext_descriptor_entries_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct dvb_vbi_teletext_entry* ++ dvb_vbi_teletext_descriptor_entries_first(struct dvb_vbi_teletext_descriptor *d) ++{ ++ if (d->d.len == 0) ++ return NULL; ++ ++ return (struct dvb_vbi_teletext_entry *) ++ ((uint8_t*) d + sizeof(struct dvb_vbi_teletext_descriptor)); ++} ++ ++static inline struct dvb_vbi_teletext_entry* ++ dvb_vbi_teletext_descriptor_entries_next(struct dvb_vbi_teletext_descriptor *d, ++ struct dvb_vbi_teletext_entry *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct dvb_vbi_teletext_entry); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct dvb_vbi_teletext_entry *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/endianops.h dvb-apps/lib/libucsi/endianops.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/endianops.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/endianops.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,128 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_COMMON_H ++#define _UCSI_COMMON_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++#define __ucsi_packed __attribute__((packed)) ++ ++ ++ ++ ++#if __BYTE_ORDER == __BIG_ENDIAN ++#define EBIT2(x1,x2) x1 x2 ++#define EBIT3(x1,x2,x3) x1 x2 x3 ++#define EBIT4(x1,x2,x3,x4) x1 x2 x3 x4 ++#define EBIT5(x1,x2,x3,x4,x5) x1 x2 x3 x4 x5 ++#define EBIT6(x1,x2,x3,x4,x5,x6) x1 x2 x3 x4 x5 x6 ++#define EBIT7(x1,x2,x3,x4,x5,x6,x7) x1 x2 x3 x4 x5 x6 x7 ++#define EBIT8(x1,x2,x3,x4,x5,x6,x7,x8) x1 x2 x3 x4 x5 x6 x7 x8 ++ ++static inline void bswap16(uint8_t *buf) { ++ (void) buf; ++} ++ ++static inline void bswap32(uint8_t *buf) { ++ (void) buf; ++} ++ ++static inline void bswap64(uint8_t *buf) { ++ (void) buf; ++} ++ ++static inline void bswap24(uint8_t *buf) { ++ (void) buf; ++} ++ ++static inline void bswap40(uint8_t *buf) { ++ (void) buf; ++} ++ ++static inline void bswap48(uint8_t *buf) { ++ (void) buf; ++} ++ ++#else ++#define EBIT2(x1,x2) x2 x1 ++#define EBIT3(x1,x2,x3) x3 x2 x1 ++#define EBIT4(x1,x2,x3,x4) x4 x3 x2 x1 ++#define EBIT5(x1,x2,x3,x4,x5) x5 x4 x3 x2 x1 ++#define EBIT6(x1,x2,x3,x4,x5,x6) x6 x5 x4 x3 x2 x1 ++#define EBIT7(x1,x2,x3,x4,x5,x6,x7) x7 x6 x5 x4 x3 x2 x1 ++#define EBIT8(x1,x2,x3,x4,x5,x6,x7,x8) x8 x7 x6 x5 x4 x3 x2 x1 ++ ++static inline void bswap16(uint8_t * buf) { ++ *((uint16_t*)buf) = bswap_16((*(uint16_t*)buf)); ++} ++ ++static inline void bswap32(uint8_t * buf) { ++ *((uint32_t*)buf) = bswap_32((*(uint32_t*)buf)); ++} ++ ++static inline void bswap64(uint8_t * buf) { ++ *((uint64_t*)buf) = bswap_64((*(uint64_t*)buf)); ++} ++ ++static inline void bswap24(uint8_t * buf) { ++ uint8_t tmp0 = buf[0]; ++ ++ buf[0] = buf[2]; ++ buf[2] = tmp0; ++} ++ ++static inline void bswap40(uint8_t * buf) { ++ uint8_t tmp0 = buf[0]; ++ uint8_t tmp1 = buf[1]; ++ ++ buf[0] = buf[4]; ++ buf[1] = buf[3]; ++ buf[3] = tmp1; ++ buf[4] = tmp0; ++} ++ ++static inline void bswap48(uint8_t * buf) { ++ uint8_t tmp0 = buf[0]; ++ uint8_t tmp1 = buf[1]; ++ uint8_t tmp2 = buf[2]; ++ ++ buf[0] = buf[5]; ++ buf[1] = buf[4]; ++ buf[2] = buf[3]; ++ buf[3] = tmp2; ++ buf[4] = tmp1; ++ buf[5] = tmp0; ++} ++ ++#endif // __BYTE_ORDER ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/Makefile dvb-apps/lib/libucsi/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,34 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libucsi ++ ++includes = crc32.h \ ++ descriptor.h \ ++ endianops.h \ ++ section.h \ ++ section_buf.h \ ++ transport_packet.h \ ++ types.h ++ ++objects = crc32.o \ ++ section_buf.o \ ++ transport_packet.o ++ ++lib_name = libucsi ++ ++CPPFLAGS += -I../../lib ++ ++.PHONY: all ++ ++all: library ++ ++include atsc/Makefile ++include dvb/Makefile ++include mpeg/Makefile ++ ++.PHONY: $(sub-install) ++ ++install:: $(sub-install) ++ ++$(sub-install): ++ $(MAKE) -C $@ install ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/audio_stream_descriptor.h dvb-apps/lib/libucsi/mpeg/audio_stream_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/audio_stream_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/audio_stream_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_AUDIO_STREAM_DESCRIPTOR ++#define _UCSI_MPEG_AUDIO_STREAM_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_audio_stream_descriptor structure ++ */ ++struct mpeg_audio_stream_descriptor { ++ struct descriptor d; ++ ++ EBIT5(uint8_t free_format_flag : 1; , ++ uint8_t id : 1; , ++ uint8_t layer : 2; , ++ uint8_t variable_rate_audio_indicator : 1; , ++ uint8_t reserved : 3; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_audio_stream_descriptor. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_audio_stream_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_audio_stream_descriptor* ++ mpeg_audio_stream_descriptor_codec(struct descriptor *d) ++{ ++ if (d->len != (sizeof(struct mpeg_audio_stream_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_audio_stream_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/ca_descriptor.h dvb-apps/lib/libucsi/mpeg/ca_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/ca_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/ca_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,91 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_CA_DESCRIPTOR ++#define _UCSI_MPEG_CA_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_ca_descriptor structure ++ */ ++struct mpeg_ca_descriptor { ++ struct descriptor d; ++ ++ uint16_t ca_system_id; ++ EBIT2(uint16_t reserved : 3; , ++ uint16_t ca_pid : 13; ); ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_ca_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return Pointer to an mpeg_ca_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_ca_descriptor* ++ mpeg_ca_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct mpeg_ca_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 4); ++ ++ return (struct mpeg_ca_descriptor*) d; ++} ++ ++/** ++ * Accessor for pointer to data field of an mpeg_ca_descriptor. ++ * ++ * @param d The mpeg_ca_descriptor structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ mpeg_ca_descriptor_data(struct mpeg_ca_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_ca_descriptor); ++} ++ ++/** ++ * Determine length of data field of an mpeg_ca_descriptor. ++ * ++ * @param d The mpeg_ca_descriptor structure. ++ * @return Length of the field in bytes. ++ */ ++static inline int ++ mpeg_ca_descriptor_data_length(struct mpeg_ca_descriptor *d) ++{ ++ return d->d.len - 4; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/cat_section.c dvb-apps/lib/libucsi/mpeg/cat_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/cat_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/cat_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,34 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_cat_section * mpeg_cat_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *)ext; ++ size_t pos = sizeof(struct section_ext); ++ ++ if (verify_descriptors(buf + pos, ++ section_ext_length(ext) - sizeof(struct mpeg_cat_section))) ++ return NULL; ++ ++ return (struct mpeg_cat_section *)ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/cat_section.h dvb-apps/lib/libucsi/mpeg/cat_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/cat_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/cat_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,94 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_CAT_SECTION_H ++#define _UCSI_MPEG_CAT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_cat_section structure. ++ */ ++struct mpeg_cat_section { ++ struct section_ext head; ++ ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_cat_section. ++ * ++ * @param section The generic section_ext structure. ++ * @return Pointer to an mpeg_cat_section structure, or NULL on error. ++ */ ++extern struct mpeg_cat_section *mpeg_cat_section_codec(struct section_ext *section); ++ ++/** ++ * Convenience iterator for descriptors field of an mpeg_cat_section. ++ * ++ * @param cat The mpeg_cat_section pointer. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define mpeg_cat_section_descriptors_for_each(cat, pos) \ ++ for ((pos) = mpeg_cat_section_descriptors_first(cat); \ ++ (pos); \ ++ (pos) = mpeg_cat_section_descriptors_next(cat, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ mpeg_cat_section_descriptors_first(struct mpeg_cat_section *cat) ++{ ++ size_t pos = sizeof(struct mpeg_cat_section); ++ ++ if (pos >= section_ext_length(&cat->head)) ++ return NULL; ++ ++ return (struct descriptor*)((uint8_t *) cat + pos); ++} ++ ++ ++static inline struct descriptor * ++ mpeg_cat_section_descriptors_next(struct mpeg_cat_section *cat, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t *) cat + sizeof(struct mpeg_cat_section), ++ section_ext_length(&cat->head) - sizeof(struct mpeg_cat_section), ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/content_labelling_descriptor.h dvb-apps/lib/libucsi/mpeg/content_labelling_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/content_labelling_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/content_labelling_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,356 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_CONTENT_LABELLING_DESCRIPTOR ++#define _UCSI_MPEG_CONTENT_LABELLING_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for content_time_base_indicator. ++ */ ++enum { ++ MPEG_CONTENT_TIME_BASE_STC = 0x01, ++ MPEG_CONTENT_TIME_BASE_NPT = 0x02, ++}; ++ ++/** ++ * mpeg_content_labelling_descriptor structure. ++ */ ++struct mpeg_content_labelling_descriptor { ++ struct descriptor d; ++ ++ uint16_t metadata_application_format; ++ /* struct mpeg_content_labelling_descriptor_application_format_identifier id */ ++ /* struct mpeg_content_labelling_descriptor_flags flags */ ++ /* struct mpeg_content_labelling_descriptor_reference_id reference_id */ ++ /* struct mpeg_content_labelling_descriptor_time_base time_base */ ++ /* struct mpeg_content_labelling_descriptor_content_id content_id */ ++ /* struct mpeg_content_labelling_descriptor_time_base_association time_base_assoc */ ++ /* uint8_t private_data[] */ ++} __ucsi_packed; ++ ++/** ++ * id field of a content_labelling_descriptor. ++ */ ++struct mpeg_content_labelling_descriptor_application_format_identifier { ++ uint32_t id; ++} __ucsi_packed; ++ ++/** ++ * Flags field of a content_labelling_descriptor ++ */ ++struct mpeg_content_labelling_descriptor_flags { ++ EBIT3(uint8_t content_reference_id_record_flag : 1; , ++ uint8_t content_time_base_indicator : 4; , ++ uint8_t reserved : 3; ); ++} __ucsi_packed; ++ ++/** ++ * Reference_id field of a content_labelling_descriptor. ++ */ ++struct mpeg_content_labelling_descriptor_reference_id { ++ uint8_t content_reference_id_record_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * time_base field of a content_labelling_descriptor. ++ */ ++struct mpeg_content_labelling_descriptor_time_base { ++ EBIT2(uint64_t reserved_1 : 7; , ++ uint64_t content_time_base_value :33; ); ++ EBIT2(uint64_t reserved_2 : 7; , ++ uint64_t metadata_time_base_value :33; ); ++} __ucsi_packed; ++ ++/** ++ * content_id field of a content_labelling_descriptor. ++ */ ++struct mpeg_content_labelling_descriptor_content_id { ++ EBIT2(uint8_t reserved : 1; , ++ uint8_t contentId : 7; ); ++} __ucsi_packed; ++ ++/** ++ * time_base_assoc field of a content_labelling_descriptor. ++ */ ++struct mpeg_content_labelling_descriptor_time_base_association { ++ uint8_t time_base_association_data_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++ ++ ++/** ++ * Process an mpeg_content_labelling_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return Pointer to an mpeg_content_labelling_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor* ++ mpeg_content_labelling_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 2; ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len + 2; ++ struct mpeg_content_labelling_descriptor_flags *flags; ++ int id; ++ ++ if (len < sizeof(struct mpeg_content_labelling_descriptor)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ id = *((uint16_t*) (buf+pos)); ++ pos += 2; ++ ++ if (id == 0xffff) { ++ if (len < (pos+4)) ++ return NULL; ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ if (len < (pos + sizeof(struct mpeg_content_labelling_descriptor_flags))) ++ return NULL; ++ flags = (struct mpeg_content_labelling_descriptor_flags*) (buf+pos); ++ pos += sizeof(struct mpeg_content_labelling_descriptor_flags); ++ ++ if (flags->content_reference_id_record_flag == 1) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if ((flags->content_time_base_indicator == 1) || ++ (flags->content_time_base_indicator == 2)) { ++ if (len < (pos + sizeof(struct mpeg_content_labelling_descriptor_time_base))) ++ return NULL; ++ bswap40(buf+pos); ++ bswap40(buf+pos+5); ++ pos += sizeof(struct mpeg_content_labelling_descriptor_time_base); ++ } ++ ++ if (flags->content_time_base_indicator == 2) { ++ if (len < (pos + sizeof(struct mpeg_content_labelling_descriptor_content_id))) ++ return NULL; ++ pos += sizeof(struct mpeg_content_labelling_descriptor_content_id); ++ } ++ ++ if (flags->content_time_base_indicator > 2) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (len < pos) ++ return NULL; ++ ++ return (struct mpeg_content_labelling_descriptor*) d; ++} ++ ++/** ++ * Accessor for pointer to id field of an mpeg_content_labelling_descriptor. ++ * ++ * @param d The mpeg_content_labelling_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_application_format_identifier* ++ mpeg_content_labelling_descriptor_id(struct mpeg_content_labelling_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d; ++ ++ if (d->metadata_application_format != 0xffff) ++ return NULL; ++ return (struct mpeg_content_labelling_descriptor_application_format_identifier*) ++ (buf + sizeof(struct mpeg_content_labelling_descriptor)); ++} ++ ++/** ++ * Accessor for pointer to flags field of an mpeg_content_labelling_descriptor. ++ * ++ * @param d The mpeg_content_labelling_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_flags* ++ mpeg_content_labelling_descriptor_flags(struct mpeg_content_labelling_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_content_labelling_descriptor); ++ ++ if (d->metadata_application_format != 0xffff) ++ buf += 4; ++ ++ return (struct mpeg_content_labelling_descriptor_flags *) buf; ++} ++ ++/** ++ * Accessor for reference_id field of an mpeg_content_labelling_descriptor. ++ * ++ * @param flags Pointer to the mpeg_content_labelling_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_reference_id* ++ mpeg_content_labelling_descriptor_reference_id(struct mpeg_content_labelling_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_content_labelling_descriptor_flags); ++ ++ if (flags->content_reference_id_record_flag != 1) ++ return NULL; ++ ++ return (struct mpeg_content_labelling_descriptor_reference_id *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_content_reference_id. ++ * ++ * @param d The mpeg_content_reference_id structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_content_reference_id_data(struct mpeg_content_labelling_descriptor_reference_id *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_content_labelling_descriptor_reference_id); ++} ++ ++/** ++ * Accessor for time_base field of an mpeg_content_labelling_descriptor. ++ * ++ * @param flags Pointer to the mpeg_content_labelling_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_time_base* ++ mpeg_content_labelling_descriptor_time_base(struct mpeg_content_labelling_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_content_labelling_descriptor_flags); ++ ++ if ((flags->content_time_base_indicator!=1) && (flags->content_time_base_indicator!=2)) ++ return NULL; ++ ++ if (flags->content_reference_id_record_flag == 1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_content_labelling_descriptor_time_base *) buf; ++} ++ ++/** ++ * Accessor for content_id field of an mpeg_content_labelling_descriptor. ++ * ++ * @param flags Pointer to the mpeg_content_labelling_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_content_id* ++ mpeg_content_labelling_descriptor_content_id(struct mpeg_content_labelling_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_content_labelling_descriptor_flags); ++ ++ if (flags->content_time_base_indicator!=2) ++ return NULL; ++ ++ if (flags->content_reference_id_record_flag == 1) ++ buf += 1 + buf[1]; ++ if ((flags->content_time_base_indicator==1) || (flags->content_time_base_indicator==2)) ++ buf += sizeof(struct mpeg_content_labelling_descriptor_time_base); ++ ++ return (struct mpeg_content_labelling_descriptor_content_id *) buf; ++} ++ ++/** ++ * Accessor for time_base_association field of an mpeg_content_labelling_descriptor. ++ * ++ * @param flags Pointer to the mpeg_content_labelling_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_content_labelling_descriptor_time_base_association* ++ mpeg_content_labelling_descriptor_time_base_assoc(struct mpeg_content_labelling_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_content_labelling_descriptor_flags); ++ ++ if (flags->content_time_base_indicator<3) ++ return NULL; ++ ++ if (flags->content_reference_id_record_flag == 1) ++ buf += 1 + buf[1]; ++ if ((flags->content_time_base_indicator==1) || (flags->content_time_base_indicator==2)) ++ buf += sizeof(struct mpeg_content_labelling_descriptor_time_base); ++ if (flags->content_time_base_indicator==2) ++ buf += sizeof(struct mpeg_content_labelling_descriptor_content_id); ++ ++ return (struct mpeg_content_labelling_descriptor_time_base_association *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_time_base_association. ++ * ++ * @param d The mpeg_time_base_association structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_time_base_association_data(struct mpeg_content_labelling_descriptor_time_base_association *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_content_labelling_descriptor_time_base_association); ++} ++ ++ ++/** ++ * Accessor for private_data field of an mpeg_content_labelling_descriptor. ++ * ++ * @param d The mpeg_content_labelling_descriptor structure. ++ * @param flags Pointer to the mpeg_content_labelling_descriptor_flags. ++ * @param length Where the number of bytes in the field should be stored. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_content_labelling_descriptor_data(struct mpeg_content_labelling_descriptor *d, ++ struct mpeg_content_labelling_descriptor_flags *flags, ++ int *length) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_content_labelling_descriptor_flags); ++ uint8_t *end = (uint8_t*) d + d->d.len + 2; ++ ++ if (flags->content_reference_id_record_flag == 1) ++ buf += 1 + buf[1]; ++ if ((flags->content_time_base_indicator==1) || (flags->content_time_base_indicator==2)) ++ buf += sizeof(struct mpeg_content_labelling_descriptor_time_base); ++ if (flags->content_time_base_indicator==2) ++ buf += sizeof(struct mpeg_content_labelling_descriptor_content_id); ++ if (flags->content_time_base_indicator<3) ++ buf += 1 + buf[1]; ++ ++ *length = end - buf; ++ ++ return buf; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/copyright_descriptor.h dvb-apps/lib/libucsi/mpeg/copyright_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/copyright_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/copyright_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,89 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_COPYRIGHT_DESCRIPTOR ++#define _UCSI_MPEG_COPYRIGHT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_copyright_descriptor structure. ++ */ ++struct mpeg_copyright_descriptor { ++ struct descriptor d; ++ ++ uint32_t copyright_identifier; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_copyright_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return mpeg_copyright_descriptor pointer, or NULL on error. ++ */ ++static inline struct mpeg_copyright_descriptor* ++ mpeg_copyright_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct mpeg_copyright_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct mpeg_copyright_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to data field of an mpeg_copyright_descriptor. ++ * ++ * @param d mpeg_copyright_descriptor pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ mpeg_copyright_descriptor_data(struct mpeg_copyright_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_copyright_descriptor); ++} ++ ++ ++/** ++ * Determine length of the data field of an mpeg_copyright_descriptor. ++ * ++ * @param d mpeg_copyright_descriptor pointer. ++ * @return Length of field in bytes. ++ */ ++static inline int ++ mpeg_copyright_descriptor_data_length(struct mpeg_copyright_descriptor *d) ++{ ++ return d->d.len - 4; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/datagram_section.h dvb-apps/lib/libucsi/mpeg/datagram_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/datagram_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/datagram_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,81 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * Copyright (C) 2008 Patrick Boettcher (pb@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_DATAGRAM_SECTION_H ++#define _UCSI_MPEG_DATAGRAM_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * datagram_section structure. ++ */ ++struct datagram_section { ++ struct section head; ++ ++ uint8_t MAC_address_6; ++ uint8_t MAC_address_5; ++ EBIT5(uint8_t reserved : 2; , ++ uint8_t payload_scrambling_control : 2; , ++ uint8_t address_scrambling_control : 2; , ++ uint8_t LLC_SNAP_flag : 1; , ++ uint8_t current_next_indicator : 1; ); ++ uint8_t section_number; ++ uint8_t last_section_number; ++ uint8_t MAC_address_4; ++ uint8_t MAC_address_3; ++ uint8_t MAC_address_2; ++ uint8_t MAC_address_1; ++ ++ /* LLC_SNAP or IP-data */ ++ /* if last section stuffing */ ++ /* CRC */ ++} __ucsi_packed; ++ ++/** ++ */ ++static inline struct datagram_section *datagram_section_codec(struct section *section) ++{ ++ /* something to do here ? */ ++ return (struct datagram_section *) section; ++} ++ ++static inline uint8_t *datagram_section_ip_data(struct datagram_section *d) ++{ ++ return (uint8_t *) d + sizeof(struct section) + 2 + 1 + 1 + 1 + 4; ++} ++ ++static inline size_t datagram_section_ip_data_length(struct datagram_section *d) ++{ ++ return section_length(&d->head) - (sizeof(struct section) + 2 + 1 + 1 + 1 + 4) - CRC_SIZE; ++} ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/data_stream_alignment_descriptor.h dvb-apps/lib/libucsi/mpeg/data_stream_alignment_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/data_stream_alignment_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/data_stream_alignment_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,73 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_DATA_STREAM_ALIGNMENT_DESCRIPTOR ++#define _UCSI_MPEG_DATA_STREAM_ALIGNMENT_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for alignment_type. ++ */ ++enum { ++ MPEG_DATA_STREAM_ALIGNMENT_VIDEO_SLICE_OR_AU = 0x01, ++ MPEG_DATA_STREAM_ALIGNMENT_VIDEO_AU = 0x02, ++ MPEG_DATA_STREAM_ALIGNMENT_VIDEO_GOP_OR_SEQ = 0x03, ++ MPEG_DATA_STREAM_ALIGNMENT_VIDEO_SEQ = 0x04, ++ ++ MPEG_DATA_STREAM_ALIGNMENT_AUDIO_SYNC_WORD = 0x01, ++}; ++ ++/** ++ * mpeg_data_stream_alignment_descriptor structure. ++ */ ++struct mpeg_data_stream_alignment_descriptor { ++ struct descriptor d; ++ ++ uint8_t alignment_type; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_data_stream_alignment_descriptor. ++ * ++ * @param d Pointer to generic descriptor structure. ++ * @return Pointer to mpeg_data_stream_alignment_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_data_stream_alignment_descriptor* ++ mpeg_data_stream_alignment_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_data_stream_alignment_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_data_stream_alignment_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/descriptor.h dvb-apps/lib/libucsi/mpeg/descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,102 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_DESCRIPTOR_H ++#define _UCSI_MPEG_DESCRIPTOR_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/** ++ * Enumeration of MPEG descriptor tags. ++ */ ++enum mpeg_descriptor_tag { ++ dtag_mpeg_video_stream = 0x02, ++ dtag_mpeg_audio_stream = 0x03, ++ dtag_mpeg_hierarchy = 0x04, ++ dtag_mpeg_registration = 0x05, ++ dtag_mpeg_data_stream_alignment = 0x06, ++ dtag_mpeg_target_background_grid = 0x07, ++ dtag_mpeg_video_window = 0x08, ++ dtag_mpeg_ca = 0x09, ++ dtag_mpeg_iso_639_language = 0x0a, ++ dtag_mpeg_system_clock = 0x0b, ++ dtag_mpeg_multiplex_buffer_utilization = 0x0c, ++ dtag_mpeg_copyright = 0x0d, ++ dtag_mpeg_maximum_bitrate = 0x0e, ++ dtag_mpeg_private_data_indicator = 0x0f, ++ dtag_mpeg_smoothing_buffer = 0x10, ++ dtag_mpeg_std = 0x11, ++ dtag_mpeg_ibp = 0x12, ++ dtag_mpeg_4_video = 0x1b, ++ dtag_mpeg_4_audio = 0x1c, ++ dtag_mpeg_iod = 0x1d, ++ dtag_mpeg_sl = 0x1e, ++ dtag_mpeg_fmc = 0x1f, ++ dtag_mpeg_external_es_id = 0x20, ++ dtag_mpeg_muxcode = 0x21, ++ dtag_mpeg_fmxbuffer_size = 0x22, ++ dtag_mpeg_multiplex_buffer = 0x23, ++ dtag_mpeg_content_labelling = 0x24, ++ dtag_mpeg_metadata_pointer = 0x25, ++ dtag_mpeg_metadata = 0x26, ++ dtag_mpeg_metadata_std = 0x27, ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/external_es_id_descriptor.h dvb-apps/lib/libucsi/mpeg/external_es_id_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/external_es_id_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/external_es_id_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_EXTERNAL_ES_ID_DESCRIPTOR ++#define _UCSI_MPEG_EXTERNAL_ES_ID_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_external_es_id_descriptor structure. ++ */ ++struct mpeg_external_es_id_descriptor { ++ struct descriptor d; ++ ++ uint16_t external_es_id; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_external_es_id_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @return mpeg_external_es_id_descriptor pointer, or NULL on error. ++ */ ++static inline struct mpeg_external_es_id_descriptor* ++ mpeg_external_es_id_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_external_es_id_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ ++ return (struct mpeg_external_es_id_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/fmc_descriptor.h dvb-apps/lib/libucsi/mpeg/fmc_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/fmc_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/fmc_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,122 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_FMC_DESCRIPTOR ++#define _UCSI_MPEG_FMC_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_fmc_descriptor structure. ++ */ ++struct mpeg_fmc_descriptor { ++ struct descriptor d; ++ ++ /* struct mpeg_flex_mux muxes[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the muxes field of an mpeg_fmc_descriptor structure. ++ */ ++struct mpeg_flex_mux { ++ uint16_t es_id; ++ uint8_t flex_mux_channel; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_fmc_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to an mpeg_fmc_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_fmc_descriptor* ++ mpeg_fmc_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t* buf = (uint8_t*) d + 2; ++ int pos = 0; ++ int len = d->len; ++ ++ if (len % sizeof(struct mpeg_flex_mux)) ++ return NULL; ++ ++ while(pos < len) { ++ bswap16(buf+pos); ++ pos += sizeof(struct mpeg_flex_mux); ++ } ++ ++ return (struct mpeg_fmc_descriptor*) d; ++} ++ ++/** ++ * Convenience iterator for the muxes field of an mpeg_fmc_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @param pos Variable holding a pointer to the the current entry within the muxes field. ++ */ ++#define mpeg_fmc_descriptor_muxes_for_each(d, pos) \ ++ for ((pos) = mpeg_fmc_descriptor_muxes_first(d); \ ++ (pos); \ ++ (pos) = mpeg_fmc_descriptor_muxes_next(d, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct mpeg_flex_mux* ++ mpeg_fmc_descriptor_muxes_first(struct mpeg_fmc_descriptor *d) ++{ ++ if (d->d.len < sizeof(struct mpeg_flex_mux)) ++ return NULL; ++ ++ return (struct mpeg_flex_mux *) ++ ((uint8_t*) d + sizeof(struct mpeg_fmc_descriptor)); ++} ++ ++static inline struct mpeg_flex_mux* ++ mpeg_fmc_descriptor_muxes_next(struct mpeg_fmc_descriptor *d, ++ struct mpeg_flex_mux *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct mpeg_flex_mux); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct mpeg_flex_mux *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/fmxbuffer_size_descriptor.h dvb-apps/lib/libucsi/mpeg/fmxbuffer_size_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/fmxbuffer_size_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/fmxbuffer_size_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,83 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_FMXBUFFER_SIZE_DESCRIPTOR ++#define _UCSI_MPEG_FMXBUFFER_SIZE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++ ++/** ++ * mpeg_fmxbuffer_size_descriptor structure. ++ */ ++struct mpeg_fmxbuffer_size_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_fmxbuffer_size_descriptor structure. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return Pointer to an mpeg_fmxbuffer_size_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_fmxbuffer_size_descriptor* ++ mpeg_fmxbuffer_size_descriptor_codec(struct descriptor* d) ++{ ++ return (struct mpeg_fmxbuffer_size_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to descriptors field of mpeg_fmxbuffer_size_descriptor structure. ++ * ++ * @param d mpeg_fmxbuffer_size_descriptor structure pointer. ++ * @return Pointer to the descriptors. ++ */ ++static inline uint8_t * ++ mpeg_fmxbuffer_size_descriptor_descriptors(struct mpeg_fmxbuffer_size_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_fmxbuffer_size_descriptor); ++} ++ ++/** ++ * Calculate the length of the descriptors field of an mpeg_fmxbuffer_size_descriptor structure. ++ * ++ * @param d mpeg_fmxbuffer_size_descriptor structure pointer. ++ * @return Length of descriptors in bytes. ++ */ ++static inline int ++ mpeg_fmxbuffer_size_descriptor_descriptors_length(struct mpeg_fmxbuffer_size_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/hierarchy_descriptor.h dvb-apps/lib/libucsi/mpeg/hierarchy_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/hierarchy_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/hierarchy_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,83 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_HIERARCHY_DESCRIPTOR ++#define _UCSI_MPEG_HIERARCHY_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Hierarchy type values. ++ */ ++enum { ++ MPEG_HIERARCHY_TYPE_ISO13818_2_SPATIAL_SCALABILITY = 0x01, ++ MPEG_HIERARCHY_TYPE_ISO13818_2_SNR_SCALABILITY = 0x02, ++ MPEG_HIERARCHY_TYPE_ISO13818_2_TEMPORAL_SCALABILITY = 0x03, ++ MPEG_HIERARCHY_TYPE_ISO13818_2_DATA_PARTITIONING = 0x04, ++ MPEG_HIERARCHY_TYPE_ISO13818_3_EXTENSION_BITSTREAM = 0x05, ++ MPEG_HIERARCHY_TYPE_ISO13818_1_PRIVATE_BITSTREAM = 0x06, ++ MPEG_HIERARCHY_TYPE_ISO13818_2_MULTI_VIEW_PROFILE = 0x07, ++ MPEG_HIERARCHY_TYPE_BASE_LAYER = 0x0f, ++}; ++ ++ ++/** ++ * mpeg_hierarchy_descriptor structure. ++ */ ++struct mpeg_hierarchy_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved_1 : 4; , ++ uint8_t hierarchy_type : 4; ); ++ EBIT2(uint8_t reserved_2 : 2; , ++ uint8_t hierarchy_layer_index : 6; ); ++ EBIT2(uint8_t reserved_3 : 2; , ++ uint8_t hierarchy_embedded_layer_index : 6; ); ++ EBIT2(uint8_t reserved_4 : 2; , ++ uint8_t hierarchy_channel : 6; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_hierarchy_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to mpeg_hierarchy_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_hierarchy_descriptor* ++ mpeg_hierarchy_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_hierarchy_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_hierarchy_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/ibp_descriptor.h dvb-apps/lib/libucsi/mpeg/ibp_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/ibp_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/ibp_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_IBP_DESCRIPTOR ++#define _UCSI_MPEG_IBP_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_ibp_descriptor structure. ++ */ ++struct mpeg_ibp_descriptor { ++ struct descriptor d; ++ ++ EBIT3(uint16_t closed_gop_flag : 1; , ++ uint16_t identical_gop_flag : 1; , ++ uint16_t max_gop_length : 14; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_ibp_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to the mpeg_ibp_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_ibp_descriptor* ++ mpeg_ibp_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_ibp_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ ++ return (struct mpeg_ibp_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/iod_descriptor.h dvb-apps/lib/libucsi/mpeg/iod_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/iod_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/iod_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_IOD_DESCRIPTOR ++#define _UCSI_MPEG_IOD_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_iod_descriptor structure. ++ */ ++struct mpeg_iod_descriptor { ++ struct descriptor d; ++ ++ uint8_t scope_of_iod_label; ++ uint8_t iod_label; ++ /* uint8_t iod[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_iod_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to an mpeg_iod_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_iod_descriptor* ++ mpeg_iod_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct mpeg_iod_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_iod_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to iod field of an mpeg_iod_descriptor structure. ++ * ++ * @param d Pointer to mpeg_iod_descriptor structure. ++ * @return Pointer to the iod field. ++ */ ++static inline uint8_t * ++ mpeg_iod_descriptor_iod(struct mpeg_iod_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_iod_descriptor); ++} ++ ++/** ++ * Calculate the length of the iod field of an mpeg_iod_descriptor structure. ++ * ++ * @param d Pointer to mpeg_iod_descriptor structure. ++ * @return The number of bytes. ++ */ ++static inline int ++ mpeg_iod_descriptor_iod_length(struct mpeg_iod_descriptor *d) ++{ ++ return d->d.len - 2; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/iso_639_language_descriptor.h dvb-apps/lib/libucsi/mpeg/iso_639_language_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/iso_639_language_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/iso_639_language_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,124 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_ISO_639_LANGUAGE_DESCRIPTOR ++#define _UCSI_MPEG_ISO_639_LANGUAGE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++ ++/** ++ * Possible values for audio_type. ++ */ ++enum { ++ MPEG_AUDIO_TYPE_CLEAN_EFFECTS = 0x01, ++ MPEG_AUDIO_TYPE_HEARING_IMPAIRED = 0x02, ++ MPEG_AUDIO_TYPE_VISUAL_IMPAIRED_COMMENTARY = 0x03, ++}; ++ ++/** ++ * mpeg_iso_639_language_descriptor structure. ++ */ ++struct mpeg_iso_639_language_descriptor { ++ struct descriptor d; ++ ++ /* struct mpeg_iso_639_language_code languages[] */ ++} __ucsi_packed; ++ ++/** ++ * An entry in the mpeg_iso_639_language_descriptor languages field. ++ */ ++struct mpeg_iso_639_language_code { ++ iso639lang_t language_code; ++ uint8_t audio_type; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_iso_639_language_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to an mpeg_iso_639_language_descriptor structure, or NULL ++ * on error. ++ */ ++static inline struct mpeg_iso_639_language_descriptor* ++ mpeg_iso_639_language_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len % sizeof(struct mpeg_iso_639_language_code)) ++ return NULL; ++ ++ return (struct mpeg_iso_639_language_descriptor*) d; ++} ++ ++/** ++ * Convenience iterator for the languages field of an mpeg_iso_639_language_descriptor ++ * ++ * @param d Pointer to the mpeg_iso_639_language_descriptor structure. ++ * @param pos Variable holding a pointer to the current entry. ++ */ ++#define mpeg_iso_639_language_descriptor_languages_for_each(_d, _pos) \ ++ for ((_pos) = mpeg_iso_639_language_descriptor_languages_first(_d); \ ++ (_pos); \ ++ (_pos) = mpeg_iso_639_language_descriptor_languages_next(_d, _pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct mpeg_iso_639_language_code* ++ mpeg_iso_639_language_descriptor_languages_first(struct mpeg_iso_639_language_descriptor *d) ++{ ++ if (d->d.len < sizeof(struct mpeg_iso_639_language_code)) ++ return NULL; ++ ++ return (struct mpeg_iso_639_language_code *) ++ ((uint8_t*) d + sizeof(struct mpeg_iso_639_language_descriptor)); ++} ++ ++static inline struct mpeg_iso_639_language_code* ++ mpeg_iso_639_language_descriptor_languages_next(struct mpeg_iso_639_language_descriptor *d, ++ struct mpeg_iso_639_language_code *pos) ++{ ++ uint8_t *end = (uint8_t*) d + 2 + d->d.len; ++ uint8_t *next = (uint8_t *) pos + sizeof(struct mpeg_iso_639_language_code); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct mpeg_iso_639_language_code *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/Makefile dvb-apps/lib/libucsi/mpeg/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,66 @@ ++# Makefile for linuxtv.org dvb-apps/lib/libucsi/mpeg ++ ++.PHONY: sub-error-mpeg ++ ++sub-error-mpeg: ++ $(error You can't use this makefile directly.) ++ ++ifneq ($(lib_name),) ++ ++objects += mpeg/cat_section.o \ ++ mpeg/metadata_section.o \ ++ mpeg/odsmt_section.o \ ++ mpeg/pat_section.o \ ++ mpeg/pmt_section.o \ ++ mpeg/tsdt_section.o ++ ++sub-install += mpeg ++ ++else ++ ++includes = audio_stream_descriptor.h \ ++ ca_descriptor.h \ ++ cat_section.h \ ++ content_labelling_descriptor.h \ ++ copyright_descriptor.h \ ++ data_stream_alignment_descriptor.h \ ++ datagram_section.h \ ++ descriptor.h \ ++ external_es_id_descriptor.h \ ++ fmc_descriptor.h \ ++ fmxbuffer_size_descriptor.h \ ++ hierarchy_descriptor.h \ ++ ibp_descriptor.h \ ++ iod_descriptor.h \ ++ iso_639_language_descriptor.h \ ++ maximum_bitrate_descriptor.h \ ++ metadata_descriptor.h \ ++ metadata_pointer_descriptor.h \ ++ metadata_section.h \ ++ metadata_std_descriptor.h \ ++ mpeg4_audio_descriptor.h \ ++ mpeg4_video_descriptor.h \ ++ multiplex_buffer_descriptor.h \ ++ multiplex_buffer_utilization_descriptor.h \ ++ muxcode_descriptor.h \ ++ odsmt_section.h \ ++ pat_section.h \ ++ pmt_section.h \ ++ private_data_indicator_descriptor.h \ ++ registration_descriptor.h \ ++ section.h \ ++ sl_descriptor.h \ ++ smoothing_buffer_descriptor.h \ ++ std_descriptor.h \ ++ system_clock_descriptor.h \ ++ target_background_grid_descriptor.h \ ++ tsdt_section.h \ ++ types.h \ ++ video_stream_descriptor.h \ ++ video_window_descriptor.h ++ ++include ../../../Make.rules ++ ++lib_name = libucsi/mpeg ++ ++endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/maximum_bitrate_descriptor.h dvb-apps/lib/libucsi/mpeg/maximum_bitrate_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/maximum_bitrate_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/maximum_bitrate_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,64 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_MAXIMUM_BITRATE_DESCRIPTOR ++#define _UCSI_MPEG_MAXIMUM_BITRATE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_maximum_bitrate_descriptor structure. ++ */ ++struct mpeg_maximum_bitrate_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint32_t reserved : 2; , ++ uint32_t maximum_bitrate : 22; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_maximum_bitrate_descriptor. ++ * ++ * @param d Pointer to generic descriptor structure. ++ * @return Pointer to mpeg_maximum_bitrate_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_maximum_bitrate_descriptor* ++ mpeg_maximum_bitrate_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_maximum_bitrate_descriptor) - 2)) ++ return NULL; ++ ++ bswap24((uint8_t*) d + 2); ++ ++ return (struct mpeg_maximum_bitrate_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_descriptor.h dvb-apps/lib/libucsi/mpeg/metadata_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/metadata_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,472 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_METADATA_DESCRIPTOR ++#define _UCSI_MPEG_METADATA_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Values for the decoder_config_flags field. ++ */ ++enum { ++ MPEG_DECODER_CONFIG_NONE = 0x00, ++ MPEG_DECODER_CONFIG_IN_DECODER_CONFIG = 0x01, ++ MPEG_DECODER_CONFIG_SAME_METADATA_SERVICE = 0x02, ++ MPEG_DECODER_CONFIG_DSMCC = 0x03, ++ MPEG_DECODER_CONFIG_SAME_PROGRAM = 0x04, ++}; ++ ++/** ++ * mpeg_metadata_descriptor structure. ++ */ ++struct mpeg_metadata_descriptor { ++ struct descriptor d; ++ ++ uint16_t metadata_application_format; ++ /* struct mpeg_metadata_descriptor_application_format_identifier appid */ ++ /* uint8_t metadata_format */ ++ /* struct mpeg_metadata_descriptor_format_identifier formid */ ++ /* struct mpeg_metadata_descriptor_flags flags */ ++ /* struct mpeg_metadata_descriptor_service_identifier service_identifier */ ++ /* struct mpeg_metadata_descriptor_decoder_config decoder_config */ ++ /* struct mpeg_metadata_descriptor_decoder_config_id_record decoder_config_id_record */ ++ /* struct mpeg_metadata_descriptor_decoder_config_service_id decoder_config_service_id */ ++ /* struct mpeg_metadata_descriptor_decoder_config_reserved decoder_config_reserved */ ++ /* uint8_t private_data[] */ ++} __ucsi_packed; ++ ++/** ++ * appid field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_application_format_identifier { ++ uint32_t id; ++} __ucsi_packed; ++ ++/** ++ * formid field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_format_identifier { ++ uint32_t id; ++} __ucsi_packed; ++ ++/** ++ * Flags field of a metadata_descriptor ++ */ ++struct mpeg_metadata_descriptor_flags { ++ uint8_t metadata_service_id; ++ EBIT3(uint8_t decoder_config_flags : 3; , ++ uint8_t dsm_cc_flag : 1; , ++ uint8_t reserved : 4; ); ++} __ucsi_packed; ++ ++/** ++ * service_identifier field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_service_identifier { ++ uint8_t service_identification_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * decoder_config field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_decoder_config { ++ uint8_t decoder_config_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * decoder_config_id_record field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_decoder_config_id_record { ++ uint8_t decoder_config_id_record_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * decoder_config_service_id field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_decoder_config_service_id { ++ uint8_t decoder_config_metadata_service_id; ++} __ucsi_packed; ++ ++/** ++ * decoder_config_reserved field of a metadata_descriptor. ++ */ ++struct mpeg_metadata_descriptor_decoder_config_reserved { ++ uint8_t reserved_data_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++ ++ ++ ++/** ++ * Process an mpeg_metadata_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return Pointer to an mpeg_metadata_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor* ++ mpeg_metadata_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 2; ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len + 2; ++ struct mpeg_metadata_descriptor_flags *flags; ++ int id; ++ ++ if (len < sizeof(struct mpeg_metadata_descriptor)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ id = *((uint16_t*) (buf+pos)); ++ pos += 2; ++ ++ if (id == 0xffff) { ++ if (len < (pos+4)) ++ return NULL; ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ if (len < (pos+1)) ++ return NULL; ++ ++ id = buf[pos]; ++ pos++; ++ if (id == 0xff) { ++ if (len < (pos+4)) ++ return NULL; ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ if (len < (pos + sizeof(struct mpeg_metadata_descriptor_flags))) ++ return NULL; ++ flags = (struct mpeg_metadata_descriptor_flags*) (buf+pos); ++ pos += sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if (flags->dsm_cc_flag == 1) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (flags->decoder_config_flags == 1) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (flags->decoder_config_flags == 3) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (flags->decoder_config_flags == 4) { ++ if (len < (pos+1)) ++ return NULL; ++ pos++; ++ } ++ ++ if ((flags->decoder_config_flags == 5) || ++ (flags->decoder_config_flags == 6)) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (len < pos) ++ return NULL; ++ ++ return (struct mpeg_metadata_descriptor*) d; ++} ++ ++/** ++ * Accessor for pointer to appid field of an mpeg_metadata_descriptor. ++ * ++ * @param d The mpeg_metadata_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_application_format_identifier* ++ mpeg_metadata_descriptor_appid(struct mpeg_metadata_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor); ++ ++ if (d->metadata_application_format != 0xffff) ++ return NULL; ++ return (struct mpeg_metadata_descriptor_application_format_identifier*) buf; ++} ++ ++/** ++ * Accessor for metadata_format field of an mpeg_metadata_descriptor. ++ * ++ * @param d The mpeg_metadata_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline uint8_t ++ mpeg_metadata_descriptor_metadata_format(struct mpeg_metadata_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ return *buf; ++} ++ ++/** ++ * Accessor for pointer to formid field of an mpeg_metadata_descriptor. ++ * ++ * @param d The mpeg_metadata_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_format_identifier* ++ mpeg_metadata_descriptor_formid(struct mpeg_metadata_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ if (*buf != 0xff) ++ return NULL; ++ ++ return (struct mpeg_metadata_descriptor_format_identifier*) (buf+1); ++} ++ ++/** ++ * Accessor for flags field of an mpeg_metadata_descriptor. ++ * ++ * @param d The mpeg_metadata_descriptor structure. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_flags* ++ mpeg_metadata_descriptor_flags(struct mpeg_metadata_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ if (*buf == 0xff) ++ buf+=4; ++ ++ return (struct mpeg_metadata_descriptor_flags*) buf; ++} ++ ++ ++/** ++ * Accessor for service_identifier field of an mpeg_metadata_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_service_identifier* ++ mpeg_metadata_descriptor_sevice_identifier(struct mpeg_metadata_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if (flags->dsm_cc_flag!=1) ++ return NULL; ++ ++ return (struct mpeg_metadata_descriptor_service_identifier *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_metadata_descriptor_service_identifier. ++ * ++ * @param d The mpeg_metadata_descriptor_service_identifier structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_descriptor_service_identifier_data(struct mpeg_metadata_descriptor_service_identifier *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor_service_identifier); ++} ++ ++/** ++ * Accessor for decoder_config field of an mpeg_metadata_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_decoder_config* ++ mpeg_metadata_descriptor_decoder_config(struct mpeg_metadata_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if (flags->decoder_config_flags != 1) ++ return NULL; ++ ++ if (flags->dsm_cc_flag==1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_metadata_descriptor_decoder_config*) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_metadata_descriptor_service_identifier. ++ * ++ * @param d The mpeg_metadata_descriptor_service_identifier structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_descriptor_decoder_config_data(struct mpeg_metadata_descriptor_decoder_config *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor_decoder_config); ++} ++ ++/** ++ * Accessor for decoder_config_id_record field of an mpeg_metadata_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_decoder_config_id_record* ++ mpeg_metadata_descriptor_decoder_config_id_record(struct mpeg_metadata_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if (flags->decoder_config_flags != 3) ++ return NULL; ++ ++ if (flags->dsm_cc_flag==1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_metadata_descriptor_decoder_config_id_record *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_metadata_descriptor_decoder_config_id_record. ++ * ++ * @param d The mpeg_metadata_descriptor_decoder_config_id_record structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_descriptor_decoder_config_id_record_data(struct mpeg_metadata_descriptor_decoder_config_id_record *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor_decoder_config_id_record); ++} ++ ++/** ++ * Accessor for decoder_config_service_id field of an mpeg_metadata_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_decoder_config_service_id* ++ mpeg_metadata_descriptor_decoder_config_service_id(struct mpeg_metadata_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if (flags->decoder_config_flags != 4) ++ return NULL; ++ ++ if (flags->dsm_cc_flag==1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_metadata_descriptor_decoder_config_service_id *) buf; ++} ++ ++/** ++ * Accessor for decoder_config_reserved field of an mpeg_metadata_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_descriptor_decoder_config_reserved* ++ mpeg_metadata_descriptor_decoder_config_reserved(struct mpeg_metadata_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ ++ if ((flags->decoder_config_flags != 5) && (flags->decoder_config_flags != 6)) ++ return NULL; ++ ++ if (flags->dsm_cc_flag==1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_metadata_descriptor_decoder_config_reserved *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_metadata_descriptor_decoder_config_reserved. ++ * ++ * @param d The mpeg_metadata_descriptor_decoder_config_reserved structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_descriptor_decoder_config_reserved_data(struct mpeg_metadata_descriptor_decoder_config_reserved *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_metadata_descriptor_decoder_config_reserved); ++} ++ ++/** ++ * Accessor for private_data field of an mpeg_metadata_descriptor. ++ * ++ * @param d The mpeg_metadata_descriptor structure. ++ * @param flags Pointer to the mpeg_metadata_descriptor_flags. ++ * @param length Where the number of bytes in the field should be stored. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_descriptor_private_data(struct mpeg_metadata_descriptor *d, ++ struct mpeg_metadata_descriptor_flags *flags, ++ int *length) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_descriptor_flags); ++ uint8_t *end = (uint8_t*) d + d->d.len + 2; ++ ++ ++ if (flags->dsm_cc_flag==1) ++ buf += 1 + buf[1]; ++ if (flags->decoder_config_flags==1) ++ buf += 1 + buf[1]; ++ if (flags->decoder_config_flags==3) ++ buf += 1 + buf[1]; ++ if (flags->decoder_config_flags==4) ++ buf++; ++ if ((flags->decoder_config_flags==5)||(flags->decoder_config_flags==6)) ++ buf += 1 + buf[1]; ++ ++ *length = end - buf; ++ return buf; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_pointer_descriptor.h dvb-apps/lib/libucsi/mpeg/metadata_pointer_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_pointer_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/metadata_pointer_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,360 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_METADATA_POINTER_DESCRIPTOR ++#define _UCSI_MPEG_METADATA_POINTER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * Possible values for the mpeg_carriage_flags field. ++ */ ++enum { ++ MPEG_CARRIAGE_SAME_TS = 0x00, ++ MPEG_CARRIAGE_DIFFERENT_TS = 0x01, ++ MPEG_CARRIAGE_PS = 0x02, ++ MPEG_CARRIAGE_OTHER = 0x03, ++}; ++ ++/** ++ * mpeg_metadata_pointer_descriptor structure. ++ */ ++struct mpeg_metadata_pointer_descriptor { ++ struct descriptor d; ++ ++ uint16_t metadata_application_format; ++ /* struct mpeg_metadata_pointer_descriptor_application_format_identifier appid */ ++ /* uint8_t metadata_format */ ++ /* struct mpeg_metadata_pointer_descriptor_format_identifier formid */ ++ /* struct mpeg_metadata_pointer_descriptor_flags flags */ ++ /* struct mpeg_metadata_pointer_descriptor_locator locator */ ++ /* struct mpeg_metadata_pointer_descriptor_program_number program_number */ ++ /* struct mpeg_metadata_pointer_descriptor_carriage carriage */ ++ /* uint8_t private_data[] */ ++} __ucsi_packed; ++ ++/** ++ * appid field of a metadata_pointer_descriptor. ++ */ ++struct mpeg_metadata_pointer_descriptor_application_format_identifier { ++ uint32_t id; ++} __ucsi_packed; ++ ++/** ++ * formid field of a metadata_pointer_descriptor. ++ */ ++struct mpeg_metadata_pointer_descriptor_format_identifier { ++ uint32_t id; ++} __ucsi_packed; ++ ++/** ++ * Flags field of a metadata_pointer_descriptor ++ */ ++struct mpeg_metadata_pointer_descriptor_flags { ++ uint8_t metadata_service_id; ++ EBIT3(uint8_t metadata_locator_record_flag : 1; , ++ uint8_t mpeg_carriage_flags : 2; , ++ uint8_t reserved : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Reference_id field of a metadata_pointer_descriptor. ++ */ ++struct mpeg_metadata_pointer_descriptor_locator { ++ uint8_t metadata_locator_record_length; ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * program_number field of a metadata_pointer_descriptor. ++ */ ++struct mpeg_metadata_pointer_descriptor_program_number { ++ uint16_t number; ++} __ucsi_packed; ++ ++/** ++ * carriage field of a metadata_pointer_descriptor. ++ */ ++struct mpeg_metadata_pointer_descriptor_carriage { ++ uint16_t transport_stream_location; ++ uint16_t transport_stream_id; ++} __ucsi_packed; ++ ++ ++ ++ ++/** ++ * Process an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d Generic descriptor. ++ * @return Pointer to an mpeg_metadata_pointer_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor* ++ mpeg_metadata_pointer_descriptor_codec(struct descriptor* d) ++{ ++ uint32_t pos = 2; ++ uint8_t *buf = (uint8_t*) d; ++ uint32_t len = d->len + 2; ++ struct mpeg_metadata_pointer_descriptor_flags *flags; ++ int id; ++ ++ if (len < sizeof(struct mpeg_metadata_pointer_descriptor)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ id = *((uint16_t*) (buf+pos)); ++ pos += 2; ++ ++ if (id == 0xffff) { ++ if (len < (pos+4)) ++ return NULL; ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ if (len < (pos+1)) ++ return NULL; ++ ++ id = buf[pos]; ++ pos++; ++ if (id == 0xff) { ++ if (len < (pos+4)) ++ return NULL; ++ bswap32(buf+pos); ++ pos += 4; ++ } ++ ++ if (len < (pos + sizeof(struct mpeg_metadata_pointer_descriptor_flags))) ++ return NULL; ++ flags = (struct mpeg_metadata_pointer_descriptor_flags*) (buf+pos); ++ pos += sizeof(struct mpeg_metadata_pointer_descriptor_flags); ++ ++ if (flags->metadata_locator_record_flag == 1) { ++ if (len < (pos+1)) ++ return NULL; ++ if (len < (pos+1+buf[pos])) ++ return NULL; ++ pos += 1 + buf[pos]; ++ } ++ ++ if (flags->mpeg_carriage_flags < 3) { ++ if (len < (pos + 2)) ++ return NULL; ++ bswap16(buf+pos); ++ pos += 2; ++ } ++ ++ if (flags->mpeg_carriage_flags == 1) { ++ if (len < (pos + 4)) ++ return NULL; ++ bswap16(buf+pos); ++ bswap16(buf+pos+2); ++ pos += 4; ++ } ++ ++ if (len < pos) ++ return NULL; ++ ++ return (struct mpeg_metadata_pointer_descriptor*) d; ++} ++ ++/** ++ * Accessor for pointer to appid field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_application_format_identifier* ++ mpeg_metadata_pointer_descriptor_appid(struct mpeg_metadata_pointer_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_pointer_descriptor); ++ ++ if (d->metadata_application_format != 0xffff) ++ return NULL; ++ return (struct mpeg_metadata_pointer_descriptor_application_format_identifier*) buf; ++} ++ ++/** ++ * Accessor for metadata_format field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline uint8_t ++ mpeg_metadata_pointer_descriptor_metadata_format(struct mpeg_metadata_pointer_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_pointer_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ return *buf; ++} ++ ++/** ++ * Accessor for pointer to formid field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor structure. ++ * @return The pointer, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_format_identifier* ++ mpeg_metadata_pointer_descriptor_formid(struct mpeg_metadata_pointer_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_pointer_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ if (*buf != 0xff) ++ return NULL; ++ ++ return (struct mpeg_metadata_pointer_descriptor_format_identifier*) (buf+1); ++} ++ ++/** ++ * Accessor for flags field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor structure. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_flags* ++ mpeg_metadata_pointer_descriptor_flags(struct mpeg_metadata_pointer_descriptor *d) ++{ ++ uint8_t *buf = (uint8_t*) d + sizeof(struct mpeg_metadata_pointer_descriptor); ++ ++ if (d->metadata_application_format == 0xffff) ++ buf+=4; ++ if (*buf == 0xff) ++ buf+=4; ++ ++ return (struct mpeg_metadata_pointer_descriptor_flags*) buf; ++} ++ ++ ++/** ++ * Accessor for locator field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_pointer_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_locator* ++ mpeg_metadata_pointer_descriptor_locator(struct mpeg_metadata_pointer_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_pointer_descriptor_flags); ++ ++ if (flags->metadata_locator_record_flag!=1) ++ return NULL; ++ ++ return (struct mpeg_metadata_pointer_descriptor_locator *) buf; ++} ++ ++/** ++ * Accessor for data field of an mpeg_metadata_pointer_descriptor_locator. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor_locator structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_pointer_descriptor_locator_data(struct mpeg_metadata_pointer_descriptor_locator *d) ++{ ++ return (uint8_t*) d + sizeof(struct mpeg_metadata_pointer_descriptor_locator); ++} ++ ++ ++/** ++ * Accessor for program_number field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_pointer_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_program_number* ++ mpeg_metadata_pointer_descriptor_program_number(struct mpeg_metadata_pointer_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_pointer_descriptor_flags); ++ ++ if (flags->mpeg_carriage_flags < 3) ++ return NULL; ++ ++ if (flags->metadata_locator_record_flag==1) ++ buf += 1 + buf[1]; ++ ++ return (struct mpeg_metadata_pointer_descriptor_program_number*) buf; ++} ++ ++/** ++ * Accessor for carriage field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param flags Pointer to the mpeg_metadata_pointer_descriptor_flags. ++ * @return Pointer to the field, or NULL on error. ++ */ ++static inline struct mpeg_metadata_pointer_descriptor_carriage* ++ mpeg_metadata_pointer_descriptor_carriage(struct mpeg_metadata_pointer_descriptor_flags *flags) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_pointer_descriptor_flags); ++ ++ if (flags->mpeg_carriage_flags != 1) ++ return NULL; ++ ++ if (flags->metadata_locator_record_flag==1) ++ buf += 1 + buf[1]; ++ if (flags->mpeg_carriage_flags < 3) ++ buf += sizeof(struct mpeg_metadata_pointer_descriptor_program_number); ++ ++ return (struct mpeg_metadata_pointer_descriptor_carriage *) buf; ++} ++ ++/** ++ * Accessor for private_data field of an mpeg_metadata_pointer_descriptor. ++ * ++ * @param d The mpeg_metadata_pointer_descriptor structure. ++ * @param flags Pointer to the mpeg_metadata_pointer_descriptor_flags. ++ * @param length Where the number of bytes in the field should be stored. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t* ++ mpeg_metadata_pointer_descriptor_private_data(struct mpeg_metadata_pointer_descriptor *d, ++ struct mpeg_metadata_pointer_descriptor_flags *flags, ++ int *length) ++{ ++ uint8_t *buf = (uint8_t*) flags + sizeof(struct mpeg_metadata_pointer_descriptor_flags); ++ uint8_t *end = (uint8_t*) d + d->d.len + 2; ++ ++ ++ if (flags->metadata_locator_record_flag==1) ++ buf += 1 + buf[1]; ++ if (flags->mpeg_carriage_flags < 3) ++ buf += sizeof(struct mpeg_metadata_pointer_descriptor_program_number); ++ if (flags->mpeg_carriage_flags != 1) ++ buf += sizeof(struct mpeg_metadata_pointer_descriptor_carriage); ++ ++ *length = end - buf; ++ return buf; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_section.c dvb-apps/lib/libucsi/mpeg/metadata_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/metadata_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,27 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_metadata_section * mpeg_metadata_section_codec(struct section_ext * ext) ++{ ++ return (struct mpeg_metadata_section *)ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_section.h dvb-apps/lib/libucsi/mpeg/metadata_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/metadata_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,122 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_METADATA_SECTION_H ++#define _UCSI_MPEG_METADATA_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_metadata_section structure. ++ */ ++struct mpeg_metadata_section { ++ struct section_ext head; ++ ++ /* uint8_t data[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_metadata_section structure. ++ * ++ * @param section Pointer to the section_ext structure. ++ * @return Pointer to the mpeg_metadata_section structure, or NULL on error. ++ */ ++extern struct mpeg_metadata_section *mpeg_metadata_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the random_access_indicator field of a metadata section. ++ * ++ * @param metadata metadata section pointer. ++ * @return The random_access_indicator. ++ */ ++static inline uint8_t mpeg_metadata_section_random_access_indicator(struct mpeg_metadata_section *metadata) ++{ ++ return metadata->head.reserved >> 1; ++} ++ ++/** ++ * Accessor for the decoder_config_flag field of a metadata section. ++ * ++ * @param metadata metadata section pointer. ++ * @return The decoder_config_flag. ++ */ ++static inline uint8_t mpeg_metadata_section_decoder_config_flag(struct mpeg_metadata_section *metadata) ++{ ++ return metadata->head.reserved & 1; ++} ++ ++/** ++ * Accessor for the fragment_indicator field of a metadata section. ++ * ++ * @param metadata metadata section pointer. ++ * @return The fragment_indicator. ++ */ ++static inline uint8_t mpeg_metadata_section_fragment_indicator(struct mpeg_metadata_section *metadata) ++{ ++ return metadata->head.reserved1; ++} ++ ++/** ++ * Accessor for the service_id field of a metadata section. ++ * ++ * @param metadata metadata section pointer. ++ * @return The service_id. ++ */ ++static inline uint16_t mpeg_metadata_section_service_id(struct mpeg_metadata_section *metadata) ++{ ++ return metadata->head.table_id_ext >> 8; ++} ++ ++/** ++ * Retrieve pointer to data field of an mpeg_metadata_section. ++ * ++ * @param s mpeg_metadata_section pointer. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ mpeg_metadata_section_data(struct mpeg_metadata_section *s) ++{ ++ return (uint8_t *) s + sizeof(struct mpeg_metadata_section); ++} ++ ++ ++/** ++ * Determine length of the data field of an mpeg_copyright_descriptor. ++ * ++ * @param s mpeg_metadata_section_data pointer. ++ * @return Length of field in bytes. ++ */ ++static inline int ++ mpeg_metadata_section_data_length(struct mpeg_metadata_section *s) ++{ ++ return section_ext_length(&s->head) - sizeof(struct mpeg_metadata_section); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_std_descriptor.h dvb-apps/lib/libucsi/mpeg/metadata_std_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/metadata_std_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/metadata_std_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,72 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_METADATA_STD_DESCRIPTOR ++#define _UCSI_MPEG_METADATA_STD_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_metadata_std_descriptor structure. ++ */ ++struct mpeg_metadata_std_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint32_t reserved_1 : 2; , ++ uint32_t metadata_input_leak_rate :22; ); ++ EBIT2(uint32_t reserved_2 : 2; , ++ uint32_t metadata_buffer_size :22; ); ++ EBIT2(uint32_t reserved_3 : 2; , ++ uint32_t metadata_output_leak_rate :22; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_metadata_std_descriptor. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_metadata_std_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_metadata_std_descriptor* ++ mpeg_metadata_std_descriptor_codec(struct descriptor* d) ++{ ++ uint8_t *buf = (uint8_t*) d; ++ ++ if (d->len != (sizeof(struct mpeg_metadata_std_descriptor) - 2)) ++ return NULL; ++ ++ bswap24(buf + 2); ++ bswap24(buf + 5); ++ bswap24(buf + 8); ++ ++ return (struct mpeg_metadata_std_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/mpeg4_audio_descriptor.h dvb-apps/lib/libucsi/mpeg/mpeg4_audio_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/mpeg4_audio_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/mpeg4_audio_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,61 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG4_AUDIO_DESCRIPTOR ++#define _UCSI_MPEG4_AUDIO_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg4_audio_descriptor structure. ++ */ ++struct mpeg4_audio_descriptor { ++ struct descriptor d; ++ ++ uint8_t mpeg4_audio_profile_and_level; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg4_audio_descriptor. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to an mpeg4_audio_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg4_audio_descriptor* ++ mpeg4_audio_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg4_audio_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg4_audio_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/mpeg4_video_descriptor.h dvb-apps/lib/libucsi/mpeg/mpeg4_video_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/mpeg4_video_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/mpeg4_video_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,61 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG4_VIDEO_DESCRIPTOR ++#define _UCSI_MPEG4_VIDEO_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg4_video_descriptor structure. ++ */ ++struct mpeg4_video_descriptor { ++ struct descriptor d; ++ ++ uint8_t mpeg4_visual_profile_and_level; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg4_video_descriptor structure. ++ * ++ * @param d Pointer to generic descriptor structure. ++ * @return Pointer to mpeg4_video_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg4_video_descriptor* ++ mpeg4_video_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg4_video_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg4_video_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/multiplex_buffer_descriptor.h dvb-apps/lib/libucsi/mpeg/multiplex_buffer_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/multiplex_buffer_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/multiplex_buffer_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_MULTIPLEX_BUFFER_DESCRIPTOR ++#define _UCSI_MPEG_MULTIPLEX_BUFFER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_multiplex_buffer_descriptor descriptor. ++ */ ++struct mpeg_multiplex_buffer_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint64_t mb_buffer_size : 24; , ++ uint64_t tb_leak_rate : 24; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_multiplex_buffer_descriptor. ++ * ++ * @param d Pointer to generic descriptor structure. ++ * @return Pointer to an mpeg_multiplex_buffer_descriptor structure, or NULL on ++ * error. ++ */ ++static inline struct mpeg_multiplex_buffer_descriptor* ++ mpeg_multiplex_buffer_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_multiplex_buffer_descriptor) - 2)) ++ return NULL; ++ ++ bswap48((uint8_t*) d + 2); ++ ++ return (struct mpeg_multiplex_buffer_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h dvb-apps/lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,67 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_MULTIPLEX_BUFFER_UTILIZATION_DESCRIPTOR ++#define _UCSI_MPEG_MULTIPLEX_BUFFER_UTILIZATION_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_multiplex_buffer_utilization_descriptor structure. ++ */ ++struct mpeg_multiplex_buffer_utilization_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint16_t bound_valid_flag : 1; , ++ uint16_t ltw_offset_lower_bound : 15; ); ++ EBIT2(uint16_t reserved : 1; , ++ uint16_t ltw_offset_upper_bound : 15; ); ++} __ucsi_packed; ++ ++/** ++ * Process a mpeg_multiplex_buffer_utilization_descriptor. ++ * ++ * @param d Generic descriptor pointer. ++ * @return mpeg_multiplex_buffer_utilization_descriptor pointer, or NULL on error. ++ */ ++static inline struct mpeg_multiplex_buffer_utilization_descriptor* ++ mpeg_multiplex_buffer_utilization_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_multiplex_buffer_utilization_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ bswap16((uint8_t*) d + 4); ++ ++ return (struct mpeg_multiplex_buffer_utilization_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/muxcode_descriptor.h dvb-apps/lib/libucsi/mpeg/muxcode_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/muxcode_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/muxcode_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,82 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_MUXCODE_DESCRIPTOR ++#define _UCSI_MPEG_MUXCODE_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_muxcode_descriptor structure ++ */ ++struct mpeg_muxcode_descriptor { ++ struct descriptor d; ++ ++ /* uint8_t entries[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_muxcode_descriptor. ++ * ++ * @param d Pointer to a generic descriptor structure. ++ * @return Pointer to an mpeg_muxcode_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_muxcode_descriptor* ++ mpeg_muxcode_descriptor_codec(struct descriptor* d) ++{ ++ return (struct mpeg_muxcode_descriptor*) d; ++} ++ ++/** ++ * Retrieve pointer to entries field of an mpeg_muxcode_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @return Pointer to the entries field. ++ */ ++static inline uint8_t * ++ mpeg_muxcode_descriptor_entries(struct mpeg_muxcode_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_muxcode_descriptor); ++} ++ ++/** ++ * Determine length of entries field of an mpeg_muxcode_descriptor structure. ++ * ++ * @param d Generic descriptor structure. ++ * @return Number of bytes in the entries field. ++ */ ++static inline int ++ mpeg_muxcode_descriptor_entries_length(struct mpeg_muxcode_descriptor *d) ++{ ++ return d->d.len; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/odsmt_section.c dvb-apps/lib/libucsi/mpeg/odsmt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/odsmt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/odsmt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,80 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_odsmt_section *mpeg_odsmt_section_codec(struct section_ext * ext) ++{ ++ struct mpeg_odsmt_section * odsmt = (struct mpeg_odsmt_section *)ext; ++ uint8_t * buf = (uint8_t *)ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ int i; ++ ++ if (len < sizeof(struct mpeg_odsmt_section)) ++ return NULL; ++ ++ pos++; ++ ++ if (odsmt->stream_count == 0) { ++ struct mpeg_odsmt_stream * stream = ++ (struct mpeg_odsmt_stream *) (buf + pos); ++ ++ if ((pos + sizeof(struct mpeg_odsmt_stream_single)) > len) ++ return NULL; ++ ++ bswap16(buf+pos); ++ pos+=3; ++ ++ if ((pos + stream->u.single.es_info_length) >= len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, stream->u.single.es_info_length)) ++ return NULL; ++ ++ pos += stream->u.single.es_info_length; ++ } else { ++ for (i=0; i< odsmt->stream_count; i++) { ++ struct mpeg_odsmt_stream * stream = ++ (struct mpeg_odsmt_stream *)(buf + pos); ++ ++ if ((pos + sizeof(struct mpeg_odsmt_stream_multi)) > len) ++ return NULL; ++ ++ bswap16(buf+pos); ++ pos += sizeof(struct mpeg_odsmt_stream_multi); ++ ++ if ((pos + stream->u.multi.es_info_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, ++ stream->u.multi.es_info_length)) ++ return NULL; ++ ++ pos += stream->u.multi.es_info_length; ++ } ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct mpeg_odsmt_section *) ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/odsmt_section.h dvb-apps/lib/libucsi/mpeg/odsmt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/odsmt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/odsmt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,224 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_ODSMT_SECTION_H ++#define _UCSI_MPEG_ODSMT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_odsmt_section structure. ++ */ ++struct mpeg_odsmt_section { ++ struct section_ext head; ++ ++ uint8_t stream_count; ++ /* stream_count==0 => struct mpeg_odsmt_stream_single streams ++ stream_count>0 => struct mpeg_odsmt_stream_multi streams[] */ ++ /* uint8_t object_descriptors[] */ ++} __ucsi_packed; ++ ++struct mpeg_odsmt_stream_single ++{ ++ uint16_t esid; ++ uint8_t es_info_length; ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++struct mpeg_odsmt_stream_multi ++{ ++ uint16_t esid; ++ uint8_t fmc; ++ uint8_t es_info_length; ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Structure describing the stream information held in an mpeg_odsmt_section. ++ */ ++struct mpeg_odsmt_stream { ++ union { ++ struct mpeg_odsmt_stream_single single; ++ struct mpeg_odsmt_stream_multi multi; ++ } u; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_odsmt_section. ++ * ++ * @param section Pointer to the generic section_ext structure. ++ * @return Pointer to a mpeg_odsmt_section structure, or NULL on error. ++ */ ++extern struct mpeg_odsmt_section *mpeg_odsmt_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the PID field of an ODSMT. ++ * ++ * @param odsmt odsmt pointer. ++ * @return The pid. ++ */ ++static inline uint16_t mpeg_odsmt_section_pid(struct mpeg_odsmt_section *odsmt) ++{ ++ return odsmt->head.table_id_ext & 0x1fff; ++} ++ ++/** ++ * Convenience iterator for the streams field of an mpeg_odsmt_section. ++ * ++ * @param osdmt Pointer to the mpeg_odsmt_section structure. ++ * @param pos Variable holding pointer to the current mpeg_odsmt_stream structure. ++ * @param index Variable holding the stream index. ++ */ ++#define mpeg_odsmt_section_streams_for_each(osdmt, pos, index) \ ++ for (index=0, (pos) = mpeg_odsmt_section_streams_first(odsmt); \ ++ (pos); \ ++ (pos) = mpeg_odsmt_section_streams_next(odsmt, pos, ++index)) ++ ++/** ++ * Convenience iterator for the descriptors field of an mpeg_odsmt_stream. ++ * ++ * @param osdmt Pointer to the mpeg_odsmt_section structure. ++ * @param stream Pointer to the mpeg_odsmt_stream structure. ++ * @param pos Variable holding pointer to the current descriptor structure. ++ */ ++#define mpeg_odsmt_stream_descriptors_for_each(osdmt, stream, pos) \ ++ for ((pos) = mpeg_odsmt_stream_descriptors_first(odsmt, stream); \ ++ (pos); \ ++ (pos) = mpeg_odsmt_stream_descriptors_next(odsmt, stream, pos)) ++ ++/** ++ * Retrieve a pointer to the object_descriptors field of an mpeg_odsmt_section. ++ * ++ * @param osdmt Pointer to the mpeg_odsmt_section structure. ++ * @param len On return, will contain the number of bytes in the object descriptors field. ++ * @return Pointer to the object_descriptors field, or NULL on error. ++ */ ++static inline uint8_t* ++ mpeg_odsmt_section_object_descriptors(struct mpeg_odsmt_section * odsmt, ++ size_t* len); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct mpeg_odsmt_stream * ++ mpeg_odsmt_section_streams_first(struct mpeg_odsmt_section *odsmt) ++{ ++ size_t pos = sizeof(struct mpeg_odsmt_section); ++ ++ if (pos >= section_ext_length(&odsmt->head)) ++ return NULL; ++ ++ return (struct mpeg_odsmt_stream *) ((uint8_t *) odsmt + pos); ++} ++ ++static inline struct mpeg_odsmt_stream * ++ mpeg_odsmt_section_streams_next(struct mpeg_odsmt_section *odsmt, ++ struct mpeg_odsmt_stream *pos, ++ int _index) ++{ ++ uint8_t *end = (uint8_t*) odsmt + section_ext_length(&odsmt->head); ++ uint8_t *next; ++ ++ if (_index > odsmt->stream_count) ++ return NULL; ++ ++ next = (uint8_t *) pos + sizeof(struct mpeg_odsmt_stream_multi) + ++ pos->u.multi.es_info_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct mpeg_odsmt_stream *) next; ++} ++ ++static inline struct descriptor * ++ mpeg_odsmt_stream_descriptors_first(struct mpeg_odsmt_section *odsmt, ++ struct mpeg_odsmt_stream *stream) ++{ ++ if (odsmt->stream_count == 0) { ++ if (stream->u.single.es_info_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*) stream + sizeof(struct mpeg_odsmt_stream_single)); ++ } else { ++ if (stream->u.multi.es_info_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*) stream + sizeof(struct mpeg_odsmt_stream_multi)); ++ } ++} ++ ++static inline struct descriptor * ++ mpeg_odsmt_stream_descriptors_next(struct mpeg_odsmt_section *odsmt, ++ struct mpeg_odsmt_stream *stream, ++ struct descriptor* pos) ++{ ++ if (odsmt->stream_count == 0) { ++ return next_descriptor((uint8_t *) stream + sizeof(struct mpeg_odsmt_stream_single), ++ stream->u.single.es_info_length, ++ pos); ++ } else { ++ return next_descriptor((uint8_t *) stream + sizeof(struct mpeg_odsmt_stream_multi), ++ stream->u.multi.es_info_length, ++ pos); ++ } ++} ++ ++static inline uint8_t* ++ mpeg_odsmt_section_object_descriptors(struct mpeg_odsmt_section * odsmt, ++ size_t* len) ++{ ++ struct mpeg_odsmt_stream* pos; ++ size_t size = sizeof(struct mpeg_odsmt_section); ++ int _index; ++ ++ mpeg_odsmt_section_streams_for_each(odsmt, pos, _index) { ++ if (odsmt->stream_count == 0) ++ size += sizeof(struct mpeg_odsmt_stream_single) + ++ pos->u.single.es_info_length; ++ else ++ size += sizeof(struct mpeg_odsmt_stream_multi) + ++ pos->u.multi.es_info_length; ++ } ++ ++ *len = section_ext_length(&odsmt->head) - size; ++ return (uint8_t*) odsmt + size; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pat_section.c dvb-apps/lib/libucsi/mpeg/pat_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pat_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/pat_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,46 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_pat_section *mpeg_pat_section_codec(struct section_ext * ext) ++{ ++ uint8_t *buf = (uint8_t *)ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct mpeg_pat_section)) ++ return NULL; ++ ++ while (pos < len) { ++ if ((pos + 4) > len) ++ return NULL; ++ ++ bswap16(buf + pos); ++ bswap16(buf + pos + 2); ++ pos += 4; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct mpeg_pat_section *)ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pat_section.h dvb-apps/lib/libucsi/mpeg/pat_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pat_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/pat_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,118 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_PAT_SECTION_H ++#define _UCSI_MPEG_PAT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_pat_section structure. ++ */ ++struct mpeg_pat_section { ++ struct section_ext head; /* table_id_ext == transport_stream_id */ ++ ++ /* struct mpeg_pat_program programs[] */ ++} __ucsi_packed; ++ ++/** ++ * A program within an mpeg_pat_section. ++ */ ++struct mpeg_pat_program { ++ uint16_t program_number; ++ EBIT2(uint16_t reserved : 3; , ++ uint16_t pid :13; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_pat_section. ++ * ++ * @param section Pointer to the generic section_ext structure. ++ * @return Pointer to the mpeg_pat_section structure, or NULL on error. ++ */ ++extern struct mpeg_pat_section *mpeg_pat_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for the transport_stream_id field of a PAT. ++ * ++ * @param pat PAT pointer. ++ * @return The transport_stream_id. ++ */ ++static inline uint16_t mpeg_pat_section_transport_stream_id(struct mpeg_pat_section *pat) ++{ ++ return pat->head.table_id_ext; ++} ++ ++/** ++ * Conveience iterator for the programs field of an mpeg_pat_section. ++ * ++ * @param pat Pointer to the mpeg_pat_section structure. ++ * @param pos Variable holding a pointer to the current mpeg_pat_program structure. ++ */ ++#define mpeg_pat_section_programs_for_each(pat, pos) \ ++ for ((pos) = mpeg_pat_section_programs_first(pat); \ ++ (pos); \ ++ (pos) = mpeg_pat_section_programs_next(pat, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct mpeg_pat_program * ++ mpeg_pat_section_programs_first(struct mpeg_pat_section * pat) ++{ ++ size_t pos = sizeof(struct mpeg_pat_section); ++ ++ if (pos >= section_ext_length(&pat->head)) ++ return NULL; ++ ++ return (struct mpeg_pat_program*)((uint8_t *) pat + pos); ++} ++ ++static inline ++ struct mpeg_pat_program *mpeg_pat_section_programs_next(struct mpeg_pat_section * pat, ++ struct mpeg_pat_program * pos) ++{ ++ uint8_t *end = (uint8_t*) pat + section_ext_length(&pat->head); ++ uint8_t *next= (uint8_t *) pos + sizeof(struct mpeg_pat_program); ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct mpeg_pat_program *) next; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pmt_section.c dvb-apps/lib/libucsi/mpeg/pmt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pmt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/pmt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,71 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_pmt_section * mpeg_pmt_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *) ext; ++ struct mpeg_pmt_section * pmt = (struct mpeg_pmt_section *) ext; ++ size_t pos = sizeof(struct section_ext); ++ size_t len = section_ext_length(ext); ++ ++ if (len < sizeof(struct mpeg_pmt_section)) ++ return NULL; ++ ++ bswap16(buf + pos); ++ pos += 2; ++ bswap16(buf + pos); ++ pos += 2; ++ ++ if ((pos + pmt->program_info_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, pmt->program_info_length)) ++ return NULL; ++ ++ pos += pmt->program_info_length; ++ ++ while (pos < len) { ++ struct mpeg_pmt_stream * stream = ++ (struct mpeg_pmt_stream *) (buf + pos); ++ ++ if ((pos + sizeof(struct mpeg_pmt_stream)) > len) ++ return NULL; ++ ++ bswap16(buf + pos + 1); ++ bswap16(buf + pos + 3); ++ pos += sizeof(struct mpeg_pmt_stream); ++ ++ if ((pos + stream->es_info_length) > len) ++ return NULL; ++ ++ if (verify_descriptors(buf + pos, stream->es_info_length)) ++ return NULL; ++ ++ pos += stream->es_info_length; ++ } ++ ++ if (pos != len) ++ return NULL; ++ ++ return (struct mpeg_pmt_section *) ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pmt_section.h dvb-apps/lib/libucsi/mpeg/pmt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/pmt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/pmt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,188 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_PMT_SECTION_H ++#define _UCSI_MPEG_PMT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_pmt_section structure. ++ */ ++struct mpeg_pmt_section { ++ struct section_ext head; ++ ++ EBIT2(uint16_t reserved_1 : 3; , ++ uint16_t pcr_pid :13; ); ++ EBIT2(uint16_t reserved_2 : 4; , ++ uint16_t program_info_length :12; ); ++ /* struct descriptor descriptors[] */ ++ /* struct mpeg_pmt_stream streams[] */ ++} __ucsi_packed; ++ ++/** ++ * A stream within an mpeg_pmt_section. ++ */ ++struct mpeg_pmt_stream { ++ uint8_t stream_type; ++ EBIT2(uint16_t reserved_1 : 3; , ++ uint16_t pid :13; ); ++ EBIT2(uint16_t reserved_2 : 4; , ++ uint16_t es_info_length :12; ); ++ ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_pmt_section section. ++ * ++ * @param section Pointer to the generic section header. ++ * @return Pointer to the mpeg_pmt_section structure, or NULL on error. ++ */ ++extern struct mpeg_pmt_section *mpeg_pmt_section_codec(struct section_ext *section); ++ ++/** ++ * Accessor for program_number field of a PMT. ++ * ++ * @param pmt PMT pointer. ++ * @return The program_number. ++ */ ++static inline uint16_t mpeg_pmt_section_program_number(struct mpeg_pmt_section *pmt) ++{ ++ return pmt->head.table_id_ext; ++} ++ ++/** ++ * Convenience iterator for the descriptors field of the mpeg_pmt_section structure. ++ * ++ * @param pmt Pointer to the mpeg_pmt_section structure. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define mpeg_pmt_section_descriptors_for_each(pmt, pos) \ ++ for ((pos) = mpeg_pmt_section_descriptors_first(pmt); \ ++ (pos); \ ++ (pos) = mpeg_pmt_section_descriptors_next(pmt, pos)) ++ ++/** ++ * Convenience iterator for the streams field of the mpeg_pmt_section structure. ++ * ++ * @param pmt Pointer to the mpeg_pmt_section structure. ++ * @param pos Variable holding a pointer to the current mpeg_pmt_stream. ++ */ ++#define mpeg_pmt_section_streams_for_each(pmt, pos) \ ++ for ((pos) = mpeg_pmt_section_streams_first(pmt); \ ++ (pos); \ ++ (pos) = mpeg_pmt_section_streams_next(pmt, pos)) ++ ++/** ++ * Convenience iterator for the descriptors field of an mpeg_pmt_stream structure. ++ * ++ * @param stream Pointer to the mpeg_pmt_stream structure. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define mpeg_pmt_stream_descriptors_for_each(stream, pos) \ ++ for ((pos) = mpeg_pmt_stream_descriptors_first(stream); \ ++ (pos); \ ++ (pos) = mpeg_pmt_stream_descriptors_next(stream, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ mpeg_pmt_section_descriptors_first(struct mpeg_pmt_section * pmt) ++{ ++ if (pmt->program_info_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t *) pmt + sizeof(struct mpeg_pmt_section)); ++} ++ ++static inline struct descriptor * ++ mpeg_pmt_section_descriptors_next(struct mpeg_pmt_section *pmt, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t *) pmt + sizeof(struct mpeg_pmt_section), ++ pmt->program_info_length, ++ pos); ++} ++ ++static inline struct mpeg_pmt_stream * ++ mpeg_pmt_section_streams_first(struct mpeg_pmt_section * pmt) ++{ ++ size_t pos = sizeof(struct mpeg_pmt_section) + pmt->program_info_length; ++ ++ if (pos >= section_ext_length(&pmt->head)) ++ return NULL; ++ ++ return (struct mpeg_pmt_stream *)((uint8_t *)pmt + pos); ++} ++ ++static inline struct mpeg_pmt_stream * ++ mpeg_pmt_section_streams_next(struct mpeg_pmt_section * pmt, ++ struct mpeg_pmt_stream * pos) ++{ ++ uint8_t *end = (uint8_t*) pmt + section_ext_length(&pmt->head); ++ uint8_t *next = (uint8_t *) pos + sizeof(struct mpeg_pmt_stream) + ++ pos->es_info_length; ++ ++ if (next >= end) ++ return NULL; ++ ++ return (struct mpeg_pmt_stream *) next; ++} ++ ++static inline struct descriptor * ++ mpeg_pmt_stream_descriptors_first(struct mpeg_pmt_stream *stream) ++{ ++ if (stream->es_info_length == 0) ++ return NULL; ++ ++ return (struct descriptor *) ++ ((uint8_t*) stream + sizeof(struct mpeg_pmt_stream)); ++} ++ ++static inline struct descriptor * ++ mpeg_pmt_stream_descriptors_next(struct mpeg_pmt_stream *stream, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t *) stream + sizeof(struct mpeg_pmt_stream), ++ stream->es_info_length, ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/private_data_indicator_descriptor.h dvb-apps/lib/libucsi/mpeg/private_data_indicator_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/private_data_indicator_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/private_data_indicator_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_PRIVATE_DATA_INDICATOR_DESCRIPTOR ++#define _UCSI_MPEG_PRIVATE_DATA_INDICATOR_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_private_data_indicator_descriptor structure ++ */ ++struct mpeg_private_data_indicator_descriptor { ++ struct descriptor d; ++ ++ uint32_t private_data_indicator; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_private_data_indicator_descriptor structure. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_private_data_indicator_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_private_data_indicator_descriptor* ++ mpeg_private_data_indicator_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_private_data_indicator_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct mpeg_private_data_indicator_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/registration_descriptor.h dvb-apps/lib/libucsi/mpeg/registration_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/registration_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/registration_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,91 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_REGISTRATION_DESCRIPTOR ++#define _UCSI_MPEG_REGISTRATION_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_registration_descriptor structure. ++ */ ++struct mpeg_registration_descriptor { ++ struct descriptor d; ++ ++ uint32_t format_identifier; ++ /* uint8_t additional_id_info[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_registration_descriptor. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_registration_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_registration_descriptor* ++ mpeg_registration_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len < (sizeof(struct mpeg_registration_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct mpeg_registration_descriptor*) d; ++} ++ ++/** ++ * Retrieve a pointer to the additional_id_info field of the ++ * mpeg_registration_descriptor structure. ++ * ++ * @param d Pointer to the mpeg_registration_descriptor structure. ++ * @return Pointer to the field. ++ */ ++static inline uint8_t * ++ mpeg_registration_descriptor_additional_id_info(struct mpeg_registration_descriptor *d) ++{ ++ return (uint8_t *) d + sizeof(struct mpeg_registration_descriptor); ++} ++ ++/** ++ * Determine number of bytes in the additional_id_info field of the ++ * mpeg_registration_descriptor structure. ++ * ++ * @param d Pointer to the mpeg_registration_descriptor structure. ++ * @return Number of bytes. ++ */ ++ ++static inline int ++ mpeg_registration_descriptor_additional_id_info_length(struct mpeg_registration_descriptor *d) ++{ ++ return d->d.len - 4; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/section.h dvb-apps/lib/libucsi/mpeg/section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,60 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_SECTION_H ++#define _UCSI_MPEG_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define TRANSPORT_PAT_PID 0x00 ++#define TRANSPORT_CAT_PID 0x01 ++#define TRANSPORT_TSDT_PID 0x02 ++ ++/** ++ * Enumeration of MPEG section tags. ++ */ ++enum mpeg_section_tag { ++ stag_mpeg_program_association = 0x00, ++ stag_mpeg_conditional_access = 0x01, ++ stag_mpeg_program_map = 0x02, ++ stag_mpeg_transport_stream_description = 0x03, ++ stag_mpeg_iso14496_scene_description = 0x04, ++ stag_mpeg_iso14496_object_description = 0x05, ++ stag_mpeg_metadata = 0x06, ++ stag_mpeg_datagram = 0x3e, ++}; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/sl_descriptor.h dvb-apps/lib/libucsi/mpeg/sl_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/sl_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/sl_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_SL_DESCRIPTOR ++#define _UCSI_MPEG_SL_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_sl_descriptor structure. ++ */ ++struct mpeg_sl_descriptor { ++ struct descriptor d; ++ ++ uint16_t es_id; ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_sl_descriptor. ++ * ++ * @param d The generic descriptor structure. ++ * @return Pointer to an mpeg_sl_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_sl_descriptor* ++ mpeg_sl_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_sl_descriptor) - 2)) ++ return NULL; ++ ++ bswap16((uint8_t*) d + 2); ++ ++ return (struct mpeg_sl_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/smoothing_buffer_descriptor.h dvb-apps/lib/libucsi/mpeg/smoothing_buffer_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/smoothing_buffer_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/smoothing_buffer_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,66 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_SMOOTHING_BUFFER_DESCRIPTOR ++#define _UCSI_MPEG_SMOOTHING_BUFFER_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_smoothing_buffer_descriptor structure. ++ */ ++struct mpeg_smoothing_buffer_descriptor { ++ struct descriptor d; ++ ++ EBIT4(uint64_t reserved_1 : 2; , ++ uint64_t sb_leak_rate :22; , ++ uint64_t reserved_2 : 2; , ++ uint64_t sb_size :22; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_smoothing_buffer_descriptor. ++ * ++ * @param d The generic descriptor structure. ++ * @return Pointer to mpeg_smoothing_buffer_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_smoothing_buffer_descriptor* ++ mpeg_smoothing_buffer_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_smoothing_buffer_descriptor) - 2)) ++ return NULL; ++ ++ bswap48((uint8_t*) d + 2); ++ ++ return (struct mpeg_smoothing_buffer_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/std_descriptor.h dvb-apps/lib/libucsi/mpeg/std_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/std_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/std_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,62 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_STD_DESCRIPTOR ++#define _UCSI_MPEG_STD_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_std_descriptor structure. ++ */ ++struct mpeg_std_descriptor { ++ struct descriptor d; ++ ++ EBIT2(uint8_t reserved : 7; , ++ uint8_t leak_valid_flag : 1; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_std_descriptor. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_std_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_std_descriptor* ++ mpeg_std_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_std_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_std_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/system_clock_descriptor.h dvb-apps/lib/libucsi/mpeg/system_clock_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/system_clock_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/system_clock_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_SYSTEM_CLOCK_DESCRIPTOR ++#define _UCSI_MPEG_SYSTEM_CLOCK_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_system_clock_descriptor structure. ++ */ ++struct mpeg_system_clock_descriptor { ++ struct descriptor d; ++ ++ EBIT3(uint8_t external_clock_reference_indicator : 1; , ++ uint8_t reserved_1 : 1; , ++ uint8_t clock_accuracy_integer : 6; ); ++ EBIT2(uint8_t clock_accuracy_exponent : 3; , ++ uint8_t reserved_2 : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_system_clock_descriptor. ++ * ++ * @param d The generic descriptor structure. ++ * @return Pointer to a mpeg_system_clock_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_system_clock_descriptor* ++ mpeg_system_clock_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_system_clock_descriptor) - 2)) ++ return NULL; ++ ++ return (struct mpeg_system_clock_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/target_background_grid_descriptor.h dvb-apps/lib/libucsi/mpeg/target_background_grid_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/target_background_grid_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/target_background_grid_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,66 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_TARGET_BACKGROUND_GRID_DESCRIPTOR ++#define _UCSI_MPEG_TARGET_BACKGROUND_GRID_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * mpeg_target_background_grid_descriptor structure. ++ */ ++struct mpeg_target_background_grid_descriptor { ++ struct descriptor d; ++ ++ EBIT3(uint32_t horizontal_size : 14; , ++ uint32_t vertical_size : 14; , ++ uint32_t aspect_ratio_information : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_target_background_grid_descriptor structure. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_target_background_grid_descriptor structure, or ++ * NULL on error. ++ */ ++static inline struct mpeg_target_background_grid_descriptor* ++ mpeg_target_background_grid_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_target_background_grid_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct mpeg_target_background_grid_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/tsdt_section.c dvb-apps/lib/libucsi/mpeg/tsdt_section.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/tsdt_section.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/tsdt_section.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,34 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++ ++struct mpeg_tsdt_section * mpeg_tsdt_section_codec(struct section_ext * ext) ++{ ++ uint8_t * buf = (uint8_t *)ext; ++ size_t pos = sizeof(struct section_ext); ++ ++ if (verify_descriptors(buf + pos, ++ section_ext_length(ext) - sizeof(struct mpeg_tsdt_section))) ++ return NULL; ++ ++ return (struct mpeg_tsdt_section *)ext; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/tsdt_section.h dvb-apps/lib/libucsi/mpeg/tsdt_section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/tsdt_section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/tsdt_section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,94 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_TSDT_SECTION_H ++#define _UCSI_MPEG_TSDT_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_tsdt_section structure. ++ */ ++struct mpeg_tsdt_section { ++ struct section_ext head; ++ ++ /* struct descriptor descriptors[] */ ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_tsdt_section structure. ++ * ++ * @param section Pointer to the section_ext structure. ++ * @return Pointer to the mpeg_tsdt_section structure, or NULL on error. ++ */ ++extern struct mpeg_tsdt_section *mpeg_tsdt_section_codec(struct section_ext *section); ++ ++/** ++ * Convenience iterator for descriptors field. ++ * ++ * @param tsdt Pointer to the mpeg_tsdt_section structure. ++ * @param pos Variable holding a pointer to the current descriptor. ++ */ ++#define mpeg_tsdt_section_descriptors_for_each(tsdt, pos) \ ++ for ((pos) = mpeg_tsdt_section_descriptors_first(tsdt); \ ++ (pos); \ ++ (pos) = mpeg_tsdt_section_descriptors_next(tsdt, pos)) ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/******************************** PRIVATE CODE ********************************/ ++static inline struct descriptor * ++ mpeg_tsdt_section_descriptors_first(struct mpeg_tsdt_section * tsdt) ++{ ++ size_t pos = sizeof(struct mpeg_tsdt_section); ++ ++ if (pos >= section_ext_length(&tsdt->head)) ++ return NULL; ++ ++ return (struct descriptor*)((uint8_t *) tsdt + pos); ++} ++ ++static inline struct descriptor * ++ mpeg_tsdt_section_descriptors_next(struct mpeg_tsdt_section *tsdt, ++ struct descriptor* pos) ++{ ++ return next_descriptor((uint8_t *) tsdt + sizeof(struct mpeg_tsdt_section), ++ section_ext_length(&tsdt->head) - sizeof(struct mpeg_tsdt_section), ++ pos); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/types.h dvb-apps/lib/libucsi/mpeg/types.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/types.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/types.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,127 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_TYPES_H ++#define _UCSI_MPEG_TYPES_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/** ++ * Known stream types. ++ */ ++enum { ++ MPEG_STREAM_TYPE_ISO11172_VIDEO = 0x01, ++ MPEG_STREAM_TYPE_ISO13818_2_VIDEO = 0x02, ++ MPEG_STREAM_TYPE_ISO11172_AUDIO = 0x03, ++ MPEG_STREAM_TYPE_ISO13818_3_AUDIO = 0x04, ++ MPEG_STREAM_TYPE_ISO13818_1_PRIVATE_SECTIONS = 0x05, ++ MPEG_STREAM_TYPE_ISO13818_1_PRIVATE_PES = 0x06, ++ MPEG_STREAM_TYPE_ISO13522_MHEG = 0x07, ++ MPEG_STREAM_TYPE_ISO13818_DSMCC = 0x08, ++ MPEG_STREAM_TYPE_ITUH222_1 = 0x09, ++ MPEG_STREAM_TYPE_ISO13818_6_A = 0x0a, ++ MPEG_STREAM_TYPE_ISO13818_6_B = 0x0b, ++ MPEG_STREAM_TYPE_ISO13818_6_C = 0x0c, ++ MPEG_STREAM_TYPE_ISO13818_6_D = 0x0d, ++ MPEG_STREAM_TYPE_ISO13818_1_AUX = 0x0e, ++ MPEG_STREAM_TYPE_ISO13818_7_AUDIO_ADTS = 0x0f, ++ MPEG_STREAM_TYPE_ISO14496_2_VISUAL = 0x10, ++ MPEG_STREAM_TYPE_ISO14496_3_AUDIO_LATM = 0x11, ++ MPEG_STREAM_TYPE_ISO14496_1_PES = 0x12, ++ MPEG_STREAM_TYPE_ISO14496_1_SECTIONS = 0x13, ++ MPEG_STREAM_TYPE_ISO14496_6_SYNCDOWNLOAD = 0x14, ++ MPEG_STREAM_TYPE_METADATA_PES = 0x15, ++ MPEG_STREAM_TYPE_METADATA_SECTIONS = 0x16, ++ MPEG_STREAM_TYPE_METADATA_DSMCC_DATA = 0x17, ++ MPEG_STREAM_TYPE_METADATA_DSMCC_OBJECT = 0x18, ++ MPEG_STREAM_TYPE_METADATA_SYNCDOWNLOAD = 0x19, ++}; ++ ++/** ++ * Metadata formats ++ */ ++enum { ++ MPEG_METADATA_FORMAT_ISO15938_1_TEM = 0x01, ++ MPEG_METADATA_FORMAT_ISO15938_1_BIM = 0x02, ++ MPEG_METADATA_FORMAT_METADATA_APPLICATION_FORMAT = 0x3F, ++ MPEG_METADATA_FORMAT_METADATA_APPLICATION_FORMAT_ID = 0xFF, ++}; ++ ++/** ++ * MPEG 4 audio profile and levels. ++ */ ++enum { ++ MPEG4_AUDIO_PROFILE_MAIN_LEVEL_1 = 0x10, ++ MPEG4_AUDIO_PROFILE_MAIN_LEVEL_2 = 0x11, ++ MPEG4_AUDIO_PROFILE_MAIN_LEVEL_3 = 0x12, ++ MPEG4_AUDIO_PROFILE_MAIN_LEVEL_4 = 0x13, ++ ++ MPEG4_AUDIO_PROFILE_SCALABLE_LEVEL_1 = 0x18, ++ MPEG4_AUDIO_PROFILE_SCALABLE_LEVEL_2 = 0x19, ++ MPEG4_AUDIO_PROFILE_SCALABLE_LEVEL_3 = 0x1a, ++ MPEG4_AUDIO_PROFILE_SCALABLE_LEVEL_4 = 0x1b, ++ ++ MPEG4_AUDIO_PROFILE_SPEECH_LEVEL_1 = 0x20, ++ MPEG4_AUDIO_PROFILE_SPEECH_LEVEL_2 = 0x21, ++ ++ MPEG4_AUDIO_PROFILE_SYNTHESIS_LEVEL_1 = 0x28, ++ MPEG4_AUDIO_PROFILE_SYNTHESIS_LEVEL_2 = 0x29, ++ MPEG4_AUDIO_PROFILE_SYNTHESIS_LEVEL_3 = 0x2a, ++ ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_1 = 0x30, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_2 = 0x31, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_3 = 0x32, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_4 = 0x33, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_5 = 0x34, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_6 = 0x35, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_7 = 0x36, ++ MPEG4_AUDIO_PROFILE_HQ_LEVEL_8 = 0x37, ++ ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_1 = 0x38, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_2 = 0x39, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_3 = 0x3a, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_4 = 0x3b, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_5 = 0x3c, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_6 = 0x3d, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_7 = 0x3e, ++ MPEG4_AUDIO_PROFILE_LOW_DELAY_LEVEL_8 = 0x3f, ++ ++ MPEG4_AUDIO_PROFILE_NATURAL_LEVEL_1 = 0x40, ++ MPEG4_AUDIO_PROFILE_NATURAL_LEVEL_2 = 0x41, ++ MPEG4_AUDIO_PROFILE_NATURAL_LEVEL_3 = 0x42, ++ MPEG4_AUDIO_PROFILE_NATURAL_LEVEL_4 = 0x43, ++ ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_1 = 0x48, ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_2 = 0x49, ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_3 = 0x4a, ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_4 = 0x4b, ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_5 = 0x4c, ++ MPEG4_AUDIO_PROFILE_MOBILE_LEVEL_6 = 0x4d, ++}; ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/video_stream_descriptor.h dvb-apps/lib/libucsi/mpeg/video_stream_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/video_stream_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/video_stream_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,101 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_VIDEO_STREAM_DESCRIPTOR ++#define _UCSI_MPEG_VIDEO_STREAM_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++ ++/** ++ * The mpeg_video_stream_descriptor structure ++ */ ++struct mpeg_video_stream_descriptor { ++ struct descriptor d; ++ ++ EBIT5(uint8_t multiple_frame_rate_flag : 1; , ++ uint8_t frame_rate_code : 4; , ++ uint8_t mpeg_1_only_flag : 1; , ++ uint8_t constrained_parameter_flag : 1; , ++ uint8_t still_picture_flag : 1; ); ++ /* if (mpeg_1_only_flag == 0) struct mpeg_video_stream_extra extra */ ++} __ucsi_packed; ++ ++/** ++ * The mpeg_video_stream_extra - only present in non-MPEG1-only streams. ++ */ ++struct mpeg_video_stream_extra { ++ uint8_t profile_and_level_indication; ++ EBIT3(uint8_t chroma_format : 2; , ++ uint8_t frame_rate_extension : 1; , ++ uint8_t reserved : 5; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_video_stream_descriptor structure. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_video_stream_descriptor, or NULL on error. ++ */ ++static inline struct mpeg_video_stream_descriptor* ++ mpeg_video_stream_descriptor_codec(struct descriptor* d) ++{ ++ struct mpeg_video_stream_descriptor* vsd = ++ (struct mpeg_video_stream_descriptor*) d; ++ ++ if (d->len < (sizeof(struct mpeg_video_stream_descriptor) - 2)) ++ return NULL; ++ ++ if (!vsd->mpeg_1_only_flag) { ++ if (d->len != (sizeof(struct mpeg_video_stream_descriptor) + ++ sizeof(struct mpeg_video_stream_extra) - 2)) ++ return NULL; ++ } ++ ++ return (struct mpeg_video_stream_descriptor*) d; ++} ++ ++/** ++ * Get a pointer to the mpeg_video_stream_extra structure. ++ * ++ * @param d Pointer to the mpeg_video_stream_descriptor structure. ++ * @return Pointer to the mpeg_video_stream_extra structure, or NULL on error. ++ */ ++static inline struct mpeg_video_stream_extra* ++ mpeg_video_stream_descriptor_extra(struct mpeg_video_stream_descriptor* d) ++{ ++ if (d->mpeg_1_only_flag != 0) ++ return NULL; ++ ++ return (struct mpeg_video_stream_extra*) ++ ((uint8_t*) d + sizeof(struct mpeg_video_stream_descriptor)); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/video_window_descriptor.h dvb-apps/lib/libucsi/mpeg/video_window_descriptor.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/mpeg/video_window_descriptor.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/mpeg/video_window_descriptor.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,64 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_MPEG_VIDEO_WINDOW_DESCRIPTOR ++#define _UCSI_MPEG_VIDEO_WINDOW_DESCRIPTOR 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++/** ++ * mpeg_video_window_descriptor structure. ++ */ ++struct mpeg_video_window_descriptor { ++ struct descriptor d; ++ ++ EBIT3(uint32_t horizontal_offset : 14; , ++ uint32_t vertical_offset : 14; , ++ uint32_t window_priority : 4; ); ++} __ucsi_packed; ++ ++/** ++ * Process an mpeg_video_window_descriptor. ++ * ++ * @param d Pointer to the generic descriptor structure. ++ * @return Pointer to the mpeg_video_window_descriptor structure, or NULL on error. ++ */ ++static inline struct mpeg_video_window_descriptor* ++ mpeg_video_window_descriptor_codec(struct descriptor* d) ++{ ++ if (d->len != (sizeof(struct mpeg_video_window_descriptor) - 2)) ++ return NULL; ++ ++ bswap32((uint8_t*) d + 2); ++ ++ return (struct mpeg_video_window_descriptor*) d; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/section_buf.c dvb-apps/lib/libucsi/section_buf.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/section_buf.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/section_buf.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,173 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include "section_buf.h" ++ ++#define SECTION_HDR_SIZE 3 ++#define SECTION_PAD 0xff ++ ++int section_buf_init(struct section_buf *section, int max) ++{ ++ if (max < SECTION_HDR_SIZE) ++ return -EINVAL; ++ ++ memset(section, 0, sizeof(struct section_buf)); ++ section->max = max; /* max size of data */ ++ section->len = SECTION_HDR_SIZE; ++ section->wait_pdu = 1; ++ ++ return 0; ++} ++ ++int section_buf_add(struct section_buf *section, uint8_t* frag, int len, int *section_status) ++{ ++ int copy; ++ int used = 0; ++ uint8_t *data; ++ uint8_t *pos = (uint8_t*) section + sizeof(struct section_buf) + section->count; ++ ++ /* have we finished? */ ++ if (section->header && (section->len == section->count)) { ++ *section_status = 1; ++ return 0; ++ } ++ ++ /* skip over section padding bytes */ ++ *section_status = 0; ++ if (section->count == 0) { ++ while(len && (*frag == SECTION_PAD)) { ++ frag++; ++ len--; ++ used++; ++ } ++ ++ if (len == 0) ++ return used; ++ } ++ ++ /* grab the header to get the section length */ ++ if (!section->header) { ++ /* copy the header frag */ ++ copy = SECTION_HDR_SIZE - section->count; ++ if (copy > len) ++ copy = len; ++ memcpy(pos, frag, copy); ++ section->count += copy; ++ pos += copy; ++ frag += copy; ++ used += copy; ++ len -= copy; ++ ++ /* we need 3 bytes for the section header */ ++ if (section->count != SECTION_HDR_SIZE) ++ return used; ++ ++ /* work out the length & check it isn't too big */ ++ data = (uint8_t*) section + sizeof(struct section_buf); ++ section->len = SECTION_HDR_SIZE + (((data[1] & 0x0f) << 8) | data[2]); ++ if (section->len > section->max) { ++ *section_status = -ERANGE; ++ return len + used; ++ } ++ ++ /* update fields */ ++ section->header = 1; ++ } ++ ++ /* accumulate frag */ ++ copy = section->len - section->count; ++ if (copy > len) ++ copy = len; ++ memcpy(pos, frag, copy); ++ section->count += copy; ++ used += copy; ++ ++ /* have we finished? */ ++ if (section->header && (section->len == section->count)) ++ *section_status = 1; ++ ++ /* return number of bytes used */ ++ return used; ++} ++ ++int section_buf_add_transport_payload(struct section_buf *section, ++ uint8_t* payload, int len, ++ int pdu_start, int *section_status) ++{ ++ int used = 0; ++ int tmp; ++ ++ /* have we finished? */ ++ if (section->header && (section->len == section->count)) { ++ *section_status = 1; ++ return 0; ++ } ++ ++ /* don't bother if we're waiting for a PDU */ ++ *section_status = 0; ++ if (section->wait_pdu && (!pdu_start)) ++ return len; ++ ++ /* if we're at a PDU start, we need extra handling for the extra first ++ * byte giving the offset to the start of the next section. */ ++ if (pdu_start) { ++ /* we have received a pdu */ ++ section->wait_pdu = 0; ++ ++ /* work out the offset to the _next_ payload */ ++ int offset = payload[0]; ++ if ((offset+1) > len) { ++ section->wait_pdu = 1; ++ *section_status = -EINVAL; ++ return len; ++ } ++ ++ /* accumulate the end if we need to */ ++ if (section->count != 0) { ++ /* add the final fragment. */ ++ tmp = section_buf_add(section, payload + 1, offset, section_status); ++ ++ /* the stream said this was the final fragment ++ * (PDU START bit) - check that it really was! */ ++ if ((tmp != offset) || section_buf_remaining(section) || (*section_status != 1)) { ++ *section_status = -ERANGE; ++ section->wait_pdu = 1; ++ return 1 + tmp; ++ } ++ ++ /* it is complete - return the number of bytes we used */ ++ return 1 + tmp; ++ } ++ ++ /* otherwise, we skip the end of the previous section, and ++ * start accumulating the new data. */ ++ used = 1 + offset; ++ } ++ ++ /* ok, just accumulate the data as normal */ ++ tmp = section_buf_add(section, payload+used, len - used, section_status); ++ if (*section_status < 0) { ++ section->wait_pdu = 1; ++ } ++ ++ return used + tmp; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/section_buf.h dvb-apps/lib/libucsi/section_buf.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/section_buf.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/section_buf.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,124 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_SECTION_BUF_H ++#define _UCSI_SECTION_BUF_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++ ++#define DVB_MAX_SECTION_BYTES 4096 ++ ++/** ++ * Buffer used to keep track of section fragments. You should allocate an ++ * area of memory of size (sizeof(section_buf) + ), and pass that area ++ * to section_buf_init() to set it up. ++ */ ++struct section_buf { ++ uint32_t max; /* maximum size of section - setup by section_buf_init() */ ++ uint32_t count; /* number of bytes currently accumulated */ ++ uint32_t len; /* total number of bytes expected in the complete section */ ++ uint8_t header:1; /* flag indicating the section header has been commpletely received */ ++ uint8_t wait_pdu:1;/* flag indicating to wait till the next PDU start */ ++ /* uint8_t data[] */ ++}; ++ ++/** ++ * Initialise a section_buf structure. ++ * ++ * @param section The section_buf to initialise. ++ * @param max Maximum number of bytes in section (must be > 3) ++ * @return 0 on success, nonzero on error. ++ */ ++extern int section_buf_init(struct section_buf *section, int max); ++ ++/** ++ * Reset a section_buf structure (e.g. if a discontinuity occurred). The ++ * section_buf will wait for the first PDU start indicator. ++ * ++ * @param section The section_buf to reset. ++ */ ++static inline void section_buf_reset(struct section_buf *section) ++{ ++ int tmp = section->wait_pdu; ++ section_buf_init(section, section->max); ++ section->wait_pdu = tmp; ++} ++ ++/** ++ * Add a data fragment to a section_buf. ++ * ++ * @param section section_buf to add to. ++ * @param frag Pointer to data fragment. ++ * @param len Number of bytes of data. ++ * @param section_status 0: nothing special. 1: section complete. -ERANGE indicates that the ++ * section is larger than section->max. ++ * @return Number of bytes which were consumed. ++ */ ++extern int section_buf_add(struct section_buf *section, uint8_t* frag, int len, int *section_status); ++ ++/** ++ * Add a transport packet PSI payload to a section_buf. This takes into account ++ * the extra byte present in PDU_START flagged packets. ++ * ++ * @param section section_buf to add to. ++ * @param payload Pointer to packet payload data. ++ * @param len Number of bytes of data. ++ * @param pdu_start True if the payload_unit_start_indicator flag was set in the ++ * TS packet. ++ * @param section_status 0: nothing special. 1: section complete. -ERANGE indicates that the ++ * section is larger than section->max. -EINVAL indicates the pointer_field was completely ++ * invalid (too large). ++ */ ++extern int section_buf_add_transport_payload(struct section_buf *section, ++ uint8_t* payload, int len, ++ int pdu_start, int *section_status); ++ ++/** ++ * Get the number of bytes left to be received in a section_buf. ++ * ++ * @param section The section_buf concerned. ++ * @return The number of bytes. ++ */ ++static inline int section_buf_remaining(struct section_buf *section) ++{ ++ return section->len - section->count; ++} ++ ++/** ++ * Return a pointer to the start of the data in the section_buf. ++ * ++ * @param section The section_buf concerned. ++ * @return The data. ++ */ ++static inline uint8_t* section_buf_data(struct section_buf *section) ++{ ++ return (uint8_t*) section + sizeof(struct section_buf); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/section.h dvb-apps/lib/libucsi/section.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/section.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/section.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,253 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_SECTION_H ++#define _UCSI_SECTION_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define CRC_SIZE 4 ++ ++ ++/** ++ * Generic section header. ++ */ ++struct section { ++ uint8_t table_id; ++ EBIT4(uint16_t syntax_indicator : 1; , ++ uint16_t private_indicator : 1; , /* 2.4.4.10 */ ++ uint16_t reserved : 2; , ++ uint16_t length :12; ); ++} __ucsi_packed; ++ ++/** ++ * Generic extended section header structure. ++ */ ++struct section_ext { ++ uint8_t table_id; ++ EBIT4(uint16_t syntax_indicator : 1; , ++ uint16_t private_indicator : 1; , /* 2.4.4.10 */ ++ uint16_t reserved : 2; , ++ uint16_t length :12; ); ++ ++ uint16_t table_id_ext; ++ EBIT3(uint8_t reserved1 : 2; , ++ uint8_t version_number : 5; , ++ uint8_t current_next_indicator : 1; ); ++ uint8_t section_number; ++ uint8_t last_section_number; ++} __ucsi_packed; ++ ++/** ++ * Structure for keeping track of sections of a PSI table. ++ */ ++struct psi_table_state { ++ uint8_t version_number; ++ uint16_t next_section_number; ++ uint8_t complete:1; ++ uint8_t new_table:1; ++} __ucsi_packed; ++ ++ ++/** ++ * Determine the total length of a section, including the header. ++ * ++ * @param section The parsed section structure. ++ * @return The length. ++ */ ++static inline size_t section_length(struct section *section) ++{ ++ return section->length + sizeof(struct section); ++} ++ ++/** ++ * Determine the total length of an extended section, including the header, ++ * but omitting the CRC. ++ * ++ * @param section The parsed section_ext structure. ++ * @return The length. ++ */ ++static inline size_t section_ext_length(struct section_ext * section) ++{ ++ return section->length + sizeof(struct section) - CRC_SIZE; ++} ++ ++/** ++ * Process a section structure in-place. ++ * ++ * @param buf Pointer to the data. ++ * @param len Length of data. ++ * @return Pointer to the section structure, or NULL if invalid. ++ */ ++static inline struct section * section_codec(uint8_t * buf, size_t len) ++{ ++ struct section * ret = (struct section *)buf; ++ ++ if (len < 3) ++ return NULL; ++ ++ bswap16(buf+1); ++ ++ if (len != ret->length + 3U) ++ return NULL; ++ ++ return ret; ++} ++ ++/** ++ * Some sections have a CRC even though they are not section_exts. ++ * This function is to allow checking of them. ++ * ++ * @param section Pointer to the processed section structure. ++ * @return Nonzero on error, or 0 if the CRC was correct. ++ */ ++static inline int section_check_crc(struct section *section) ++{ ++ uint8_t * buf = (uint8_t *) section; ++ size_t len = section_length(section); ++ uint32_t crc; ++ ++ /* the crc check has to be performed on the unswapped data */ ++ bswap16(buf+1); ++ crc = crc32(CRC32_INIT, buf, len); ++ bswap16(buf+1); ++ ++ /* the crc check includes the crc value, ++ * the result should therefore be zero. ++ */ ++ if (crc) ++ return -1; ++ return 0; ++} ++ ++ ++/** ++ * Decode an extended section structure. ++ * ++ * @param section Pointer to the processed section structure. ++ * @param check_crc If 1, the CRC of the section will also be checked. ++ * @return Pointer to the parsed section_ext structure, or NULL if invalid. ++ */ ++static inline struct section_ext * section_ext_decode(struct section * section, ++ int check_crc) ++{ ++ if (section->syntax_indicator == 0) ++ return NULL; ++ ++ if (check_crc) { ++ if (section_check_crc(section)) ++ return NULL; ++ } ++ ++ bswap16((uint8_t *)section + sizeof(struct section)); ++ ++ return (struct section_ext *)section; ++} ++ ++/** ++ * Encode an extended section structure for transmission. ++ * ++ * @param section Pointer to the section_ext structure. ++ * @param update_crc If 1, the CRC of the section will also be updated. ++ * @return Pointer to the encoded section_ext structure, or NULL if invalid. ++ */ ++static inline struct section_ext * section_ext_encode(struct section_ext* section, ++ int update_crc) ++{ ++ if (section->syntax_indicator == 0) ++ return NULL; ++ ++ bswap16((uint8_t *)section + sizeof(struct section)); ++ ++ if (update_crc) { ++ uint8_t * buf = (uint8_t *) section; ++ int len = sizeof(struct section) + section->length; ++ uint32_t crc; ++ ++ /* the crc has to be performed on the swapped data */ ++ bswap16(buf+1); ++ crc = crc32(CRC32_INIT, buf, len-4); ++ bswap16(buf+1); ++ ++ /* update the CRC */ ++ *((uint32_t*) (buf+len-4)) = crc; ++ bswap32(buf+len-4); ++ } ++ ++ return (struct section_ext *)section; ++} ++ ++/** ++ * Reset a psi_table_state structure. ++ * ++ * @param tstate The structure to reset. ++ */ ++static inline void psi_table_state_reset(struct psi_table_state *tstate) ++{ ++ tstate->version_number = 0xff; ++} ++ ++/** ++ * Check if a supplied section_ext is something we want to process. ++ * ++ * @param section The parsed section_ext structure. ++ * @param tstate The state structure for this PSI table. ++ * @return 0=> not useful. nonzero => useful. ++ */ ++static inline int section_ext_useful(struct section_ext *section, struct psi_table_state *tstate) ++{ ++ if ((section->version_number == tstate->version_number) && tstate->complete) ++ return 0; ++ if (section->version_number != tstate->version_number) { ++ if (section->section_number != 0) ++ return 0; ++ ++ tstate->next_section_number = 0; ++ tstate->complete = 0; ++ tstate->version_number = section->version_number; ++ tstate->new_table = 1; ++ } else if (section->section_number == tstate->next_section_number) { ++ tstate->new_table = 0; ++ } else { ++ return 0; ++ } ++ ++ tstate->next_section_number++; ++ if (section->last_section_number < tstate->next_section_number) { ++ tstate->complete = 1; ++ } ++ ++ return 1; ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/testrecord.txt dvb-apps/lib/libucsi/testrecord.txt +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/testrecord.txt 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/testrecord.txt 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,146 @@ ++libucsi test record. Anything without PASS is either not tested, or is ++currently broken. ++ ++Testing means (a) ensure there are no segfaults etc. (b) dump the raw hex, ++decode it by hand, and check it matches the output. ++ ++Sections: ++PASS mpeg/cat_section.h ++ mpeg/odsmt_section.h ++PASS mpeg/pat_section.h ++PASS mpeg/pmt_section.h ++ mpeg/tsdt_section.h ++ mpeg/metadata_section.h ++ ++PASS dvb/bat_section.h ++ dvb/dit_section.h ++PASS dvb/eit_section.h ++ dvb/int_section.h ++PASS dvb/nit_section.h ++ dvb/rst_section.h ++PASS dvb/sdt_section.h ++ dvb/sit_section.h ++PASS dvb/st_section.h ++PASS dvb/tdt_section.h ++PASS dvb/tot_section.h ++ dvb/tva_container_section.h ++ ++PASS atsc/cvct_section.h ++ atsc/dccsct_section.h ++ atsc/dcct_section.h ++PASS atsc/eit_section.h ++PASS atsc/ett_section.h ++PASS atsc/mgt_section.h ++ atsc/rrt_section.h ++PASS atsc/stt_section.h ++PASS atsc/tvct_section.h ++ ++Descriptors: ++PASS mpeg/audio_stream_descriptor.h ++PASS mpeg/ca_descriptor.h ++ mpeg/content_labelling_descriptor.h ++PASS mpeg/copyright_descriptor.h ++PASS mpeg/data_stream_alignment_descriptor.h ++PASS mpeg/external_es_id_descriptor.h ++ mpeg/fmc_descriptor.h ++PASS mpeg/fmxbuffer_size_descriptor.h ++ mpeg/hierarchy_descriptor.h ++ mpeg/ibp_descriptor.h ++ mpeg/iod_descriptor.h ++PASS mpeg/iso_639_language_descriptor.h ++PASS mpeg/maximum_bitrate_descriptor.h ++ mpeg/metadata_descriptor.h ++ mpeg/metadata_pointer_descriptor.h ++ mpeg/metadata_std_descriptor.h ++ mpeg/mpeg4_audio_descriptor.h ++ mpeg/mpeg4_video_descriptor.h ++ mpeg/multiplex_buffer_descriptor.h ++PASS mpeg/multiplex_buffer_utilization_descriptor.h ++ mpeg/muxcode_descriptor.h ++PASS mpeg/private_data_indicator_descriptor.h ++PASS mpeg/registration_descriptor.h ++ mpeg/sl_descriptor.h ++PASS mpeg/smoothing_buffer_descriptor.h ++PASS mpeg/std_descriptor.h ++PASS mpeg/system_clock_descriptor.h ++ mpeg/target_background_grid_descriptor.h ++PASS mpeg/video_stream_descriptor.h ++ mpeg/video_window_descriptor.h ++ ++ dvb/ac3_descriptor.h ++ dvb/adaptation_field_data_descriptor.h ++ dvb/ait_application_descriptor.h ++ dvb/ait_application_icons_descriptor.h ++ dvb/ait_application_name_descriptor.h ++ dvb/ait_external_application_authorisation_descriptor.h ++ dvb/ancillary_data_descriptor.h ++ dvb/announcement_support_descriptor.h ++ dvb/application_signalling_descriptor.h ++PASS dvb/bouquet_name_descriptor.h ++PASS dvb/ca_identifier_descriptor.h ++ dvb/cable_delivery_descriptor.h ++ dvb/cell_frequency_link_descriptor.h ++ dvb/cell_list_descriptor.h ++PASS dvb/component_descriptor.h ++PASS dvb/content_descriptor.h ++ dvb/content_identifier_descriptor.h ++ dvb/country_availability_descriptor.h ++ dvb/data_broadcast_descriptor.h ++PASS dvb/data_broadcast_id_descriptor.h ++ dvb/default_authority_descriptor.h ++ dvb/dsng_descriptor.h ++ dvb/extended_event_descriptor.h ++PASS dvb/frequency_list_descriptor.h ++PASS dvb/linkage_descriptor.h ++PASS dvb/local_time_offset_descriptor.h ++ dvb/mhp_data_broadcast_id_descriptor.h ++ dvb/mosaic_descriptor.h ++ dvb/multilingual_bouquet_name_descriptor.h ++PASS dvb/multilingual_component_descriptor.h ++ dvb/multilingual_network_name_descriptor.h ++ dvb/multilingual_service_name_descriptor.h ++PASS dvb/network_name_descriptor.h ++ dvb/nvod_reference_descriptor.h ++PASS dvb/parental_rating_descriptor.h ++ dvb/partial_transport_stream_descriptor.h ++ dvb/pdc_descriptor.h ++PASS dvb/private_data_specifier_descriptor.h ++ dvb/related_content_descriptor.h ++ dvb/rnt_rar_over_dvb_stream_descriptor.h ++ dvb/rnt_rar_over_ip_descriptor.h ++ dvb/rnt_rnt_scan_descriptor.h ++ dvb/s2_satellite_delivery_descriptor.h ++PASS dvb/satellite_delivery_descriptor.h ++ dvb/scrambling_descriptor.h ++ dvb/service_availablility_descriptor.h ++PASS dvb/service_descriptor.h ++ dvb/service_identifier_descriptor.h ++PASS dvb/service_list_descriptor.h ++ dvb/service_move_descriptor.h ++PASS dvb/short_event_descriptor.h ++ dvb/short_smoothing_buffer_descriptor.h ++PASS dvb/stream_identifier_descriptor.h ++PASS dvb/stuffing_descriptor.h ++PASS dvb/subtitling_descriptor.h ++ dvb/telephone_descriptor.h ++ dvb/teletext_descriptor.h ++PASS dvb/terrestrial_delivery_descriptor.h ++ dvb/time_shifted_event_descriptor.h ++ dvb/time_shifted_service_descriptor.h ++ dvb/transport_stream_descriptor.h ++ dvb/tva_id_descriptor.h ++ dvb/vbi_data_descriptor.h ++ dvb/vbi_teletext_descriptor.h ++ ++PASS atsc/ac3_descriptor.h ++PASS atsc/caption_service_descriptor.h ++ atsc/component_name_descriptor.h ++PASS atsc/content_advisory_descriptor.h ++ atsc/dcc_arriving_request_descriptor.h ++ atsc/dcc_departing_request_descriptor.h ++PASS atsc/extended_channel_name_descriptor.h ++ atsc/genre_descriptor.h ++ atsc/rc_descriptor.h ++PASS atsc/service_location_descriptor.h ++PASS atsc/stuffing_descriptor.h ++ atsc/time_shifted_service_descriptor.h +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/transport_packet.c dvb-apps/lib/libucsi/transport_packet.c +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/transport_packet.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/transport_packet.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,256 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "transport_packet.h" ++ ++#define CONTINUITY_VALID 0x80 ++#define CONTINUITY_DUPESEEN 0x40 ++ ++int transport_packet_values_extract(struct transport_packet *pkt, ++ struct transport_values *out, ++ enum transport_value extract) ++{ ++ uint8_t *end = (uint8_t*) pkt + TRANSPORT_PACKET_LENGTH; ++ uint8_t *adapend; ++ uint8_t *pos = (uint8_t*) pkt + sizeof(struct transport_packet); ++ enum transport_value extracted = 0; ++ enum transport_adaptation_flags adapflags = 0; ++ enum transport_adaptation_extension_flags adapextflags = 0; ++ int adaplength = 0; ++ int adapextlength = 0; ++ ++ /* does the packet contain an adaptation field ? */ ++ if ((pkt->adaptation_field_control & 2) == 0) ++ goto extract_payload; ++ ++ /* get the adaptation field length and skip the byte */ ++ adaplength = *pos++; ++ ++ /* do we actually have any adaptation data? */ ++ if (adaplength == 0) ++ goto extract_payload; ++ ++ /* sanity check */ ++ adapend = pos + adaplength; ++ if (adapend > end) ++ return -1; ++ ++ /* extract the adaptation flags (we must have at least 1 byte to be here) */ ++ adapflags = *pos++; ++ ++ /* do we actually want anything else? */ ++ if ((extract & 0xffff) == 0) ++ goto extract_payload; ++ ++ /* PCR? */ ++ if (adapflags & transport_adaptation_flag_pcr) { ++ if ((pos+6) > adapend) ++ return -1; ++ ++ if (extract & transport_value_pcr) { ++ uint64_t base = ((uint64_t) pos[0] << 25) | ++ ((uint64_t) pos[1] << 17) | ++ ((uint64_t) pos[2] << 9) | ++ ((uint64_t) pos[3] << 1) | ++ ((uint64_t) pos[4] >> 7); ++ uint64_t ext = (((uint64_t) pos[4] & 1) << 8) | ++ (uint64_t) pos[5]; ++ out->pcr= base * 300ULL + ext; ++ extracted |= transport_value_pcr; ++ } ++ pos += 6; ++ } ++ ++ /* OPCR? */ ++ if (adapflags & transport_adaptation_flag_opcr) { ++ if ((pos+6) > adapend) ++ return -1; ++ ++ if (extract & transport_value_opcr) { ++ uint64_t base = ((uint64_t) pos[0] << 25) | ++ ((uint64_t) pos[1] << 17) | ++ ((uint64_t) pos[2] << 9) | ++ ((uint64_t) pos[3] << 1) | ++ ((uint64_t) pos[4] >> 7); ++ uint64_t ext = (((uint64_t) pos[4] & 1) << 8) | ++ (uint64_t) pos[5]; ++ out->opcr= base * 300ULL + ext; ++ extracted |= transport_value_opcr; ++ } ++ pos += 6; ++ } ++ ++ /* splice countdown? */ ++ if (adapflags & transport_adaptation_flag_splicing_point) { ++ if ((pos+1) > adapend) ++ return -1; ++ ++ if (extract & transport_value_splice_countdown) { ++ out->splice_countdown = *pos; ++ extracted |= transport_value_splice_countdown; ++ } ++ pos++; ++ } ++ ++ /* private data? */ ++ if (adapflags & transport_adaptation_flag_private_data) { ++ if ((pos+1) > adapend) ++ return -1; ++ if ((pos+1+*pos) > adapend) ++ return -1; ++ ++ if (extract & transport_value_private_data) { ++ out->private_data_length = *pos; ++ out->private_data = pos + 1; ++ extracted |= transport_value_private_data; ++ } ++ pos += 1 + *pos; ++ } ++ ++ /* is there an adaptation extension? */ ++ if (!(adapflags & transport_adaptation_flag_extension)) ++ goto extract_payload; ++ ++ /* get/check the length */ ++ if (pos >= adapend) ++ return -1; ++ adapextlength = *pos++; ++ if ((pos + adapextlength) > adapend) ++ return -1; ++ ++ /* do we want/have anything in the adaptation extension? */ ++ if (((extract & 0xff00) == 0) || (adapextlength == 0)) ++ goto extract_payload; ++ ++ /* extract the adaptation extension flags (we must have at least 1 byte ++ * to be here) */ ++ adapextflags = *pos++; ++ ++ /* LTW? */ ++ if (adapextflags & transport_adaptation_extension_flag_ltw) { ++ if ((pos+2) > adapend) ++ return -1; ++ ++ if (extract & transport_value_ltw) { ++ if (*pos & 0x80) { ++ out->ltw_offset = ((pos[0] & 0x7f) << 8) | ++ (pos[1]); ++ extracted |= transport_value_ltw; ++ } ++ } ++ pos += 2; ++ } ++ ++ /* piecewise_rate? */ ++ if (adapextflags & transport_adaptation_extension_flag_piecewise_rate) { ++ if ((pos+3) > adapend) ++ return -1; ++ ++ if (extract & transport_value_piecewise_rate) { ++ out->piecewise_rate = ((pos[0] & 0x3f) << 16) | ++ (pos[1] << 8) | ++ pos[2]; ++ extracted |= transport_value_piecewise_rate; ++ } ++ pos += 3; ++ } ++ ++ /* seamless_splice? */ ++ if (adapextflags & transport_adaptation_extension_flag_seamless_splice) { ++ if ((pos+5) > adapend) ++ return -1; ++ ++ if (extract & transport_value_piecewise_rate) { ++ out->splice_type = pos[0] >> 4; ++ out->dts_next_au = ((pos[0] & 0x0e) << 29) | ++ (pos[1] << 22) | ++ ((pos[2] & 0xfe) << 14) | ++ (pos[3] << 7) | ++ ((pos[4] & 0xfe) >> 1); ++ extracted |= transport_value_seamless_splice; ++ } ++ pos += 5; ++ } ++ ++ ++ ++extract_payload: ++ /* does the packet contain a payload? */ ++ if (pkt->adaptation_field_control & 1) { ++ int off = sizeof(struct transport_packet); ++ if (pkt->adaptation_field_control & 2) ++ off++; ++ off += adaplength; ++ ++ out->payload = (uint8_t*) pkt + off; ++ out->payload_length = TRANSPORT_PACKET_LENGTH - off; ++ } else { ++ out->payload = NULL; ++ out->payload_length = 0; ++ } ++ ++ out->flags = adapflags; ++ return extracted; ++} ++ ++int transport_packet_continuity_check(struct transport_packet *pkt, ++ int discontinuity_indicator, unsigned char *cstate) ++{ ++ unsigned char pktcontinuity = pkt->continuity_counter; ++ unsigned char prevcontinuity = *cstate & 0x0f; ++ unsigned char nextcontinuity; ++ ++ /* NULL packets have undefined continuity */ ++ if (transport_packet_pid(pkt) == TRANSPORT_NULL_PID) ++ return 0; ++ ++ /* is the state valid? */ ++ if (!(*cstate & CONTINUITY_VALID)) { ++ *cstate = pktcontinuity | CONTINUITY_VALID; ++ return 0; ++ } ++ ++ /* check for discontinuity_indicator */ ++ if (discontinuity_indicator) { ++ *cstate = pktcontinuity | CONTINUITY_VALID; ++ return 0; ++ } ++ ++ /* only packets with a payload should increment the counter */ ++ if (pkt->adaptation_field_control & 1) ++ nextcontinuity = (prevcontinuity + 1) & 0xf; ++ else ++ nextcontinuity = prevcontinuity; ++ ++ /* check for a normal continuity progression */ ++ if (nextcontinuity == pktcontinuity) { ++ *cstate = pktcontinuity | CONTINUITY_VALID; ++ return 0; ++ } ++ ++ /* one dupe is allowed */ ++ if ((prevcontinuity == pktcontinuity) && (!(*cstate & CONTINUITY_DUPESEEN))) { ++ *cstate = pktcontinuity | (CONTINUITY_VALID|CONTINUITY_DUPESEEN); ++ return 0; ++ } ++ ++ /* continuity error */ ++ return -1; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/transport_packet.h dvb-apps/lib/libucsi/transport_packet.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/transport_packet.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/transport_packet.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,195 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_TRANSPORT_PACKET_H ++#define _UCSI_TRANSPORT_PACKET_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#include ++#include "descriptor.h" ++ ++#define TRANSPORT_PACKET_LENGTH 188 ++#define TRANSPORT_PACKET_SYNC 0x47 ++#define TRANSPORT_MAX_PIDS 0x2000 ++#define TRANSPORT_NULL_PID 0x1fff ++ ++ ++/** ++ * Enumeration of adaptation field control values. ++ */ ++enum transport_adaptation_field_control { ++ transport_adaptation_field_control_reserved = 0x00, ++ transport_adaptation_field_control_payload_only = 0x01, ++ transport_adaptation_field_control_adaptation_only = 0x02, ++ transport_adaptation_field_control_adaptation_payload = 0x03, ++}; ++ ++/** ++ * Enumeration of scrambling control values. ++ */ ++enum transport_scrambling_control { ++ transport_scrambling_control_unscrambled = 0x00, ++ transport_scrambling_control_user_1 = 0x01, ++ transport_scrambling_control_user_2 = 0x02, ++ transport_scrambling_control_user_3 = 0x03, ++}; ++ ++/** ++ * Enumeration of adaptation flags. ++ */ ++enum transport_adaptation_flags { ++ transport_adaptation_flag_discontinuity = 0x80, ++ transport_adaptation_flag_random_access = 0x40, ++ transport_adaptation_flag_es_priority = 0x20, ++ transport_adaptation_flag_pcr = 0x10, ++ transport_adaptation_flag_opcr = 0x08, ++ transport_adaptation_flag_splicing_point = 0x04, ++ transport_adaptation_flag_private_data = 0x02, ++ transport_adaptation_flag_extension = 0x01, ++}; ++ ++/** ++ * Enumeration of adaptation extension flags. ++ */ ++enum transport_adaptation_extension_flags { ++ transport_adaptation_extension_flag_ltw = 0x80, ++ transport_adaptation_extension_flag_piecewise_rate = 0x40, ++ transport_adaptation_extension_flag_seamless_splice = 0x20, ++}; ++ ++/** ++ * Enumeration of flags controlling which values to extract using the ++ * transport_packet_values_extract() function. ++ */ ++enum transport_value { ++ /* normal adaptation */ ++ transport_value_pcr = 0x0001, ++ transport_value_opcr = 0x0002, ++ transport_value_splice_countdown = 0x0004, ++ transport_value_private_data = 0x0008, ++ ++ /* extension adaptation */ ++ transport_value_ltw = 0x0100, ++ transport_value_piecewise_rate = 0x0200, ++ transport_value_seamless_splice = 0x0400, ++}; ++ ++/** ++ * Structure describing a transport packet header. ++ */ ++struct transport_packet { ++ uint8_t sync_byte; ++ EBIT4(uint8_t transport_error_indicator : 1; , ++ uint8_t payload_unit_start_indicator : 1; , ++ uint8_t transport_priority : 1; , ++ uint8_t pid_hi : 5; ); ++ uint8_t pid_lo; ++ EBIT3(uint8_t transport_scrambling_control : 2; , ++ uint8_t adaptation_field_control : 2; , ++ uint8_t continuity_counter : 4; ); ++ /* values */ ++} __ucsi_packed; ++ ++/** ++ * Structure to extract values into using the transport_packet_values_extract() ++ * function. ++ */ ++struct transport_values { ++ enum transport_adaptation_flags flags; /* always extracted */ ++ uint8_t *payload; /* always extracted */ ++ uint16_t payload_length; /* always extracted */ ++ ++ uint64_t pcr; ++ uint64_t opcr; ++ uint8_t splice_countdown; ++ uint8_t private_data_length; ++ uint8_t *private_data; ++ uint16_t ltw_offset; ++ uint32_t piecewise_rate; ++ uint8_t splice_type; ++ uint64_t dts_next_au; ++}; ++ ++/** ++ * Extract the PID from a transport packet. ++ * ++ * @param pkt The packet. ++ * @return The PID. ++ */ ++static inline int transport_packet_pid(struct transport_packet *pkt) ++{ ++ return (pkt->pid_hi << 8) | (pkt->pid_lo); ++} ++ ++/** ++ * Process a buffer into a transport packet. ++ * ++ * @param buf Raw buffer. Note, this function assumes there are 188 bytes available. ++ * @return transport_packet pointer, or NULL on error. ++ */ ++static inline struct transport_packet *transport_packet_init(unsigned char *buf) ++{ ++ struct transport_packet *pkt = (struct transport_packet*) buf; ++ ++ if (pkt->sync_byte != TRANSPORT_PACKET_SYNC) ++ return NULL; ++ ++ if (transport_packet_pid(pkt) >= TRANSPORT_MAX_PIDS) ++ return NULL; ++ ++ return pkt; ++} ++ ++/** ++ * Check the continuity counter for a packet in a PID stream. ++ * ++ * @param pkt transport_packet to check. ++ * @param discontinuity_indicator Set to 1 if the packet's discontinuity_indicator flag is set. ++ * @param cstate Pointer to a single 8 bit character, used to store state for validating ++ * continuity. To initialise the state, simply set it to 0 before the first call. ++ * @return 0 if the continuity was correct, or nonzero on error. cstate will not be updated on error, ++ * it is up to the caller to clear it to accept the next packet. ++ */ ++extern int transport_packet_continuity_check(struct transport_packet *pkt, ++ int discontinuity_indicator, unsigned char *cstate); ++ ++/** ++ * Extract selected fields from a transport packet. ++ * ++ * @param pkt The packet. ++ * @param out Destination structure for values. ++ * @param extract Orred bitmask of enum transport_value - tells it what fields ++ * to extract if they are available. ++ * @return < 0 => error. Otherwise, an orred bitmask of enum transport_value ++ * telling you what fields were successfully extracted. ++ */ ++extern int transport_packet_values_extract(struct transport_packet *pkt, ++ struct transport_values *out, ++ enum transport_value extract); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/libucsi/types.h dvb-apps/lib/libucsi/types.h +--- linuxtv-dvb-apps-1.1.1/lib/libucsi/types.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/libucsi/types.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,36 @@ ++/* ++ * section and descriptor parser ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _UCSI_TYPES_H ++#define _UCSI_TYPES_H 1 ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++typedef uint8_t iso639lang_t[3]; ++typedef uint8_t iso639country_t[3]; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nurd linuxtv-dvb-apps-1.1.1/lib/Makefile dvb-apps/lib/Makefile +--- linuxtv-dvb-apps-1.1.1/lib/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/lib/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,11 @@ ++# Makefile for linuxtv.org dvb-apps/lib ++ ++.PHONY: all clean install ++ ++all clean install: ++ $(MAKE) -C libdvbapi $@ ++ $(MAKE) -C libdvbcfg $@ ++ $(MAKE) -C libdvben50221 $@ ++ $(MAKE) -C libdvbsec $@ ++ $(MAKE) -C libesg $@ ++ $(MAKE) -C libucsi $@ +diff -Nurd linuxtv-dvb-apps-1.1.1/libdvb2/README dvb-apps/libdvb2/README +--- linuxtv-dvb-apps-1.1.1/libdvb2/README 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/libdvb2/README 1970-01-01 01:00:00.000000000 +0100 +@@ -1,23 +0,0 @@ +-Late in 2003 the idea to create a simple DVB library from the code snippets +-in the test/utility programs was discussed on the linux-dvb mailing list. +-Hopefully someone will invest some time in this project to turn the idea into +-reality... +- +-Here is an outline of what libdvb2 should be, according to my recollection: +-(For first hand information search the linux-dvb list archives for "libdvb2".) +- +-- C +-- small: The goal is to make the library usable in *any* DVB project, which +- is easier if the library sticks to the basics. Advanced stuff can be +- done in a second library. What exacty "basic" and "advanced" means +- is subject of discussion, but I want avoid to impose a certain programming +- model (e.g. multi-threaded vw. event-loop) on users of the library. +-- a prime target is to establish a standard DVB config and service list +- format, to make this sharable between different applications +-- LGPL +- +-About the name: There already is a libdvb written by the Metzler Bros., +-but the main drawback is that it is written in C++ and thus rejected +-by many projects. +- +-Johannes Stezenbach +diff -Nurd linuxtv-dvb-apps-1.1.1/Makefile dvb-apps/Makefile +--- linuxtv-dvb-apps-1.1.1/Makefile 2004-02-04 19:41:55.000000000 +0100 ++++ dvb-apps/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -1,28 +1,12 @@ + # Makefile for linuxtv.org dvb-apps + +-VERSION := 1.1.0 +-PACKAGE := linuxtv-dvb-apps-$(VERSION) +-CVSROOT := $(shell cat CVS/Root) +-RELEASE_TAG := LINUXTV-DVB-$(subst .,_,$(subst -,_,$(VERSION))) +- +-all: ++.PHONY: all clean install update + +-release dist: +- rm -rf release-tmp $(PACKAGE).tar.gz +- mkdir release-tmp +- ( cd release-tmp; cvs -d$(CVSROOT) export -r$(RELEASE_TAG) -d$(PACKAGE) dvb-apps ) +- find release-tmp -name .cvsignore | xargs rm -v +- ( cd release-tmp; tar cjf ../$(PACKAGE).tar.bz2 $(PACKAGE) ) +- rm -rf release-tmp +- @echo +- @echo -------------------------------------------------------------------------------- +- @echo +- @echo "dist package: ./$(PACKAGE).tar.bz2" +- @echo +- @echo -------------------------------------------------------------------------------- +- @echo ++all clean install: ++ $(MAKE) -C lib $@ ++ $(MAKE) -C test $@ ++ $(MAKE) -C util $@ + +-%:: +-# $(MAKE) -C libdvb2 $(MAKECMDGOALS) +- $(MAKE) -C util $(MAKECMDGOALS) +- $(MAKE) -C test $(MAKECMDGOALS) ++update: ++ @echo "Pulling changes & updating from master repository" ++ hg pull -u +diff -Nurd linuxtv-dvb-apps-1.1.1/Make.rules dvb-apps/Make.rules +--- linuxtv-dvb-apps-1.1.1/Make.rules 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/Make.rules 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,104 @@ ++# build rules for linuxtv.org dvb-apps ++ ++CFLAGS ?= -g -Wall -W -Wshadow -Wpointer-arith -Wstrict-prototypes ++ ++ifneq ($(lib_name),) ++ ++# additional rules for libraries ++ ++CFLAGS_LIB ?= -fPIC ++CFLAGS += $(CFLAGS_LIB) ++ ++libraries = $(lib_name).so $(lib_name).a ++ ++.PHONY: library ++ ++library: $(libraries) ++ ++$(libraries): $(objects) ++ ++endif ++ ++prerequisites = $(subst .o,.d,$(objects)) $(addsuffix .d,$(binaries)) ++ ++.PHONY: clean install ++ ++ifeq ($(static),1) ++LDFLAGS += -static ++endif ++ ++prefix ?= /usr ++ ++bindir ?= $(prefix)/bin ++includedir ?= $(prefix)/include ++libdir ?= $(prefix)/lib ++sharedir ?= $(prefix)/share ++ ++ifneq ($(DESTDIR),) ++DESTDIR = $(DESTDIR)/ ++endif ++ ++ifeq ($(V),1) ++%.o: %.c ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) -MMD -o $@ $< $(filter-out %.h %.c,$^) ++%: %.o ++ $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) ++%: %.c ++ $(CC) $(CPPFLAGS) $(CFLAGS) -MMD $(LDFLAGS) -o $@ $< $(filter-out %.h %.c,$^) $(LOADLIBES) $(LDLIBS) ++%.so: ++ $(CC) -shared -o $@ $^ ++%.a: ++ $(AR) rcs $@ $^ ++clean:: ++ $(RM) -f $(prerequisites) $(objects) $(libraries) $(binaries) $(removing) *~ ++install:: ++ifneq ($(includes),) ++ mkdir -p $(DESTDIR)$(includedir)/$(lib_name) ++ install -m 644 $(includes) $(DESTDIR)$(includedir)/$(lib_name)/ ++endif ++ifneq ($(libraries),) ++ mkdir -p $(DESTDIR)$(libdir) ++ install -m 644 $(libraries) $(DESTDIR)$(libdir)/ ++endif ++ifneq ($(inst_bin),) ++ mkdir -p $(DESTDIR)$(bindir) ++ install -m 755 $(inst_bin) $(DESTDIR)$(bindir)/ ++endif ++else ++%.o: %.c ++ @echo CC $@ ++ @$(CC) -c $(CPPFLAGS) $(CFLAGS) -MMD -o $@ $< $(filter-out %.h %.c,$^) ++%: %.o ++ @echo CC $@ ++ @$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS) ++%: %.c ++ @echo CC $@ ++ @$(CC) $(CPPFLAGS) $(CFLAGS) -MMD $(LDFLAGS) -o $@ $< $(filter-out %.h %.c,$^) $(LOADLIBES) $(LDLIBS) ++%.so: ++ @echo CC $@ ++ @$(CC) -shared -o $@ $^ ++%.a: ++ @echo AR $@ ++ @$(AR) rcs $@ $^ ++clean:: ++ @echo cleaning ++ @$(RM) -f $(prerequisites) $(objects) $(libraries) $(binaries) $(removing) *~ ++install:: ++ifneq ($(includes),) ++ @echo installing headers ++ @mkdir -p $(DESTDIR)$(includedir)/$(lib_name) ++ @install -m 644 $(includes) $(DESTDIR)$(includedir)/$(lib_name)/ ++endif ++ifneq ($(libraries),) ++ @echo installing libraries ++ @mkdir -p $(DESTDIR)$(libdir) ++ @install -m 644 $(libraries) $(DESTDIR)$(libdir)/ ++endif ++ifneq ($(inst_bin),) ++ @echo installing binaries ++ @mkdir -p $(DESTDIR)$(bindir) ++ @install -m 755 $(inst_bin) $(DESTDIR)$(bindir)/ ++endif ++endif ++ ++-include $(prerequisites) +diff -Nurd linuxtv-dvb-apps-1.1.1/README dvb-apps/README +--- linuxtv-dvb-apps-1.1.1/README 2006-05-18 01:37:39.000000000 +0200 ++++ dvb-apps/README 2009-06-21 13:29:06.000000000 +0200 +@@ -1,28 +1,40 @@ +-linuxtv-dvb-apps-1.1.1 ++linuxtv-dvb-apps-1.? + ====================== + +-Linux DVB API test/demo applications and utilities. ++Linux DVB API applications and utilities. + +-You find a README in each subdirectory explaining what the code there does. +-For beginners utils/szap/ and utils/scan/ are probably most useful. ++All applications support the DVB-S, DVB-C, DVB-T, and ATSC standards. + +-For convenience, dvb-apps contains a copy of the DVB API include +-files as they are contained in the linuxtv-dvb-1.1.0 realease +-and the 2.6.x Linux kernel. However, since the DVB API hasn't changed, +-the apps will still work with the old "DVB" drivers, should you decide not +-to use linuxtv-dvb-1.1.0 (or the dvb-kernel CVS). ++Main User Applications: ++util/scan - Scan for channels on your digital TV device. ++util/gnutv - Tune, watch and stream your TV. + ++General Utilities: ++util/dvbdate - Set your clock from digital TV. ++util/dvbnet - Control digital data network interfaces. ++util/dvbtraffic - Monitor traffic on a digital device. ++util/femon - Monitor the tuning on a digital TV device. ++util/zap - *Just* tunes a digital device - really intended for developers. + +-Historical note: +-The apps have been copied from the "DVB" CVS tree, which means that +-the stuff in "DVB" is now unmaintained and out of date. ++Hardware Specific Utilities: ++util/av7110_loadkeys - Load remote keys into an av7110 based card ++util/dib3000-watch - Monitor DIB3000 demodulators ++util/dst-utils - Utilities for DST based cards. ++util/ttusb_dec_reset - Reset a TechnoTrends TTUSB DEC device. + ++Libraries: ++lib/libdvbapi - Interface library to digital TV devices. ++lib/libdvbcfg - Library to parse/create digital TV channel configuration files. ++lib/libdvbsec - Library for Satellite Equipment Control operations. ++lib/libucsi - Fast MPEG2 Transport Stream SI table parsing library. ++lib/libdvben50221- Complete implementation of a Cenelec EN 50221 CAM stack. ++lib/libdvbmisc - Miscellaneous utilities used by the other libraries. + +-Johannes Stezenbach ++Various testing applications also live in test. + +-This is an interim point release adding support for ATSC to the 1.1.0 release. +-dvb-apps is currently being rewritten completely with new standardised DVB +-libraries for all aspects of DVB, ca support etc, so expect a 1.2.0 release +-at some point soon. ++For convenience, dvb-apps contains a copy of the DVB API include ++files as they are contained in the linuxtv-dvb-1.? release ++and the 2.6.x Linux kernel. + ++Johannes Stezenbach + Andrew de Quincey +diff -Nurd linuxtv-dvb-apps-1.1.1/test/dia dvb-apps/test/dia +--- linuxtv-dvb-apps-1.1.1/test/dia 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/dia 2009-06-21 13:29:06.000000000 +0200 +@@ -4,4 +4,4 @@ + do /usr/X11R6/bin/convert -geomtry 702x576 $f test.mpg + test_video test.mpg + rm test.mpg +-done +\ No newline at end of file ++done +diff -Nurd linuxtv-dvb-apps-1.1.1/test/diseqc.c dvb-apps/test/diseqc.c +--- linuxtv-dvb-apps-1.1.1/test/diseqc.c 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/diseqc.c 2009-06-21 13:29:06.000000000 +0200 +@@ -1,11 +1,13 @@ +-/* +- * Test sending DiSEqC commands on a SAT frontend. +- * +- * usage: FRONTEND=/dev/dvb/adapterX/frontendX diseqc [test_seq_no] +- */ ++#define USAGE \ ++"\n" \ ++"\nTest sending DiSEqC commands on a SAT frontend." \ ++"\n" \ ++"\nusage: FRONTEND=/dev/dvb/adapterX/frontendX diseqc [test_seq_no|'all']" \ ++"\n" + + #include + #include ++#include + #include + #include + #include +@@ -109,7 +111,10 @@ + return -1; + } + +- if (argc > 1) { ++ if (argc != 2) { ++ fprintf (stderr, "usage: %s [number|'all']\n" USAGE, argv[0]); ++ return 1; ++ } else if (strcmp(argv[1], "all")) { + int i = atol(argv[1]); + cmd[0] = &switch_cmds[i]; + diseqc_send_msg(fd, +@@ -136,5 +141,3 @@ + + return 0; + } +- +- +diff -Nurd linuxtv-dvb-apps-1.1.1/test/evtest.c dvb-apps/test/evtest.c +--- linuxtv-dvb-apps-1.1.1/test/evtest.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/evtest.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,251 @@ ++/* ++ * $Id: evtest.c,v 1.3 2005/08/15 20:43:52 js Exp $ ++ * ++ * Copyright (c) 1999-2000 Vojtech Pavlik ++ * ++ * Event device test program ++ */ ++ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Should you need to contact me, the author, you can do so either by ++ * e-mail - mail your message to , or by paper mail: ++ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic ++ */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++char *events[EV_MAX + 1] = { "Sync", "Key", "Relative", "Absolute", "Misc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++NULL, NULL, NULL, "LED", "Sound", NULL, "Repeat", "ForceFeedback", "Power", "ForceFeedbackStatus"}; ++char *syncs[2] = { "Sync", "Config"}; ++char *keys[KEY_MAX + 1] = { ++ // 0x000 ++ "Reserved", "Esc", "1", "2", "3", "4", "5", "6", ++ "7", "8", "9", "0", "Minus", "Equal", "Backspace", "Tab", ++ // 0x010 ++ "Q", "W", "E", "R", "T", "Y", "U", "I", ++ "O", "P", "LeftBrace", "RightBrace", "Enter", "LeftControl", "A", "S", ++ // 0x020 ++ "D", "F", "G", "H", "J", "K", "L", "Semicolon", ++ "Apostrophe", "Grave", "LeftShift", "BackSlash", "Z", "X", "C", "V", ++ // 0x030 ++ "B", "N", "M", "Comma", "Dot", "Slash", "RightShift", "KPAsterisk", ++ "LeftAlt", "Space", "CapsLock", "F1", "F2", "F3", "F4", "F5", ++ // 0x040 ++ "F6", "F7", "F8", "F9", "F10", "NumLock", "ScrollLock", "KP7", ++ "KP8", "KP9", "KPMinus", "KP4", "KP5", "KP6", "KPPlus", "KP1", ++ // 0x050 ++ "KP2", "KP3", "KP0", "KPDot", NULL, "ZENKAKUHANKAKU", "102nd", "F11", ++ "F12", "RO", "KATAKANA", "HIRAGANA", "HENKAN", "KATAKANAHIRAGANA", "MUHENKAN", "KPJPCOMMA", ++ // 0x060 ++ "KPEnter", "RightCtrl", "KPSlash", "SysRq", "RightAlt", "LineFeed", "Home", "Up", ++ "PageUp", "Left", "Right", "End", "Down", "PageDown", "Insert", "Delete", ++ // 0x070 ++ "Macro", "Mute", "VolumeDown", "VolumeUp", "Power", "KPEqual", "KPPlusMinus", "Pause", ++ NULL, "KPComma", "HANGUEL", "HANJA", "YEN", "LeftMeta", "RightMeta", "Compose", ++ // 0x080 ++ "Stop", "Again", "Props", "Undo", "Front", "Copy", "Open", "Paste", ++ "Find", "Cut", "Help", "Menu", "Calc", "Setup", "Sleep", "WakeUp", ++ // 0x090 ++ "File", "SendFile", "DeleteFile", "X-fer", "Prog1", "Prog2", "WWW", "MSDOS", ++ "Coffee", "Direction", "CycleWindows", "Mail", "Bookmarks", "Computer", "Back", "Forward", ++ // 0x0A0 ++ "CloseCD", "EjectCD", "EjectCloseCD", "NextSong", "PlayPause", "PreviousSong", "StopCD", "Record", ++ "Rewind", "Phone", "ISOKey", "Config", "HomePage", "Refresh", "Exit", "Move", ++ // 0x0B0 ++ "Edit", "ScrollUp", "ScrollDown", "KPLeftParenthesis", "KPRightParenthesis", NULL, NULL, "F13", ++ "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", ++ // 0x0C0 ++ "F22", "F23", "F24", NULL, NULL, NULL, NULL, NULL, ++ "PlayCD", "PauseCD", "Prog3", "Prog4", NULL, "Suspend", "Close", "Play", ++ // 0x0D0 ++ "FastForward", "BassBoost", "Print", "HP", "Camera", "Sound", "Question", "EMail", ++ "Chat", "Search", "Connect", "Finance", "Sport", "Shop", "AltErase", "Cancel", ++ // 0x0E0 ++ "BrightnessDown", "BrightnessUp", "Media", NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x0F0 ++ "Unknown", NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x100 ++ "Btn0", "Btn1", "Btn2", "Btn3", "Btn4", "Btn5", "Btn6", "Btn7", ++ "Btn8", "Btn9", NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x110 ++ "LeftBtn", "RightBtn", "MiddleBtn", "SideBtn", "ExtraBtn", "ForwardBtn", "BackBtn", "TaskBtn", ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x120 ++ "Trigger", "ThumbBtn", "ThumbBtn2", "TopBtn", "TopBtn2", "PinkieBtn", "BaseBtn", "BaseBtn2", ++ "BaseBtn3", "BaseBtn4", "BaseBtn5", "BaseBtn6", NULL, NULL, NULL, "BtnDead", ++ // 0x130 ++ "BtnA", "BtnB", "BtnC", "BtnX", "BtnY", "BtnZ", "BtnTL", "BtnTR", ++ "BtnTL2", "BtnTR2", "BtnSelect", "BtnStart", "BtnMode", "BtnThumbL", "BtnThumbR", NULL, ++ // 0x140 ++ "ToolPen", "ToolRubber", "ToolBrush", "ToolPencil", "ToolAirbrush", "ToolFinger", "ToolMouse", "ToolLens", ++ NULL, NULL, "Touch", "Stylus", "Stylus2", "ToolDoubleTap", "ToolTripleTap", NULL, ++ // 0x150 ++ "GearDown", "GearUp", NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x160 ++ "Ok", "Select", "Goto", "Clear", "Power2", "Option", "Info", "Time", ++ "Vendor", "Archive", "Program", "Channel", "Favorites", "EPG", "PVR", "MHP", ++ // 0x170 ++ "Language", "Title", "Subtitle", "Angle", "Zoom", "Mode", "Keyboard", "Screen", ++ "PC", "TV", "TV2", "VCR", "VCR2", "Sat", "Sat2", "CD", ++ // 0x180 ++ "Tape", "Radio", "Tuner", "Player", "Text", "DVD", "Aux", "MP3", ++ "Audio", "Video", "Directory", "List", "Memo", "Calendar", "Red", "Green", ++ // 0x190 ++ "Yellow", "Blue", "ChannelUp", "ChannelDown", "First", "Last", "AB", "Next", ++ "Restart", "Slow", "Shuffle", "Break", "Previous", "Digits", "Teen", "Twen", ++ // 0x1A0 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x1B0 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x1C0 ++ "DelEOL", "DelEOS", "InsLine", "DelLine", NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x1D0 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x1E0 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x1F0 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++}; ++ ++char *absval[5] = { "Value", "Min ", "Max ", "Fuzz ", "Flat " }; ++char *relatives[REL_MAX + 1] = { ++ "X", "Y", "Z", NULL, NULL, NULL, "HWheel", "Dial", ++ "Wheel", "Misc", NULL, NULL, NULL, NULL, NULL, NULL, ++}; ++char *absolutes[ABS_MAX + 1] = { ++ // 0x00 ++ "X", "Y", "Z", "Rx", "Ry", "Rz", "Throttle", "Rudder", ++ "Wheel", "Gas", "Brake", NULL, NULL, NULL, NULL, NULL, ++ // 0x10 ++ "Hat0X", "Hat0Y", "Hat1X", "Hat1Y", "Hat2X", "Hat2Y", "Hat3X", "Hat 3Y", ++ "Pressure", "Distance", "XTilt", "YTilt", "ToolWidth", NULL, NULL, NULL, ++ // 0x20 ++ "Volume", NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ "Misc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ // 0x30 ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++}; ++char *leds[LED_MAX + 1] = { "NumLock", "CapsLock", "ScrollLock", "Compose", "Kana", "Sleep", "Suspend", "Mute" }; ++char *repeats[REP_MAX + 1] = { "Delay", "Period" }; ++char *sounds[SND_MAX + 1] = { "Bell", "Click" }; ++ ++char **names[EV_MAX + 1] = { syncs, keys, relatives, absolutes, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ++NULL, NULL, leds, sounds, NULL, repeats, NULL, NULL, NULL }; ++ ++#ifndef BITS_PER_LONG ++#define BITS_PER_LONG (sizeof(long) * 8) ++#endif ++#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) ++#define OFF(x) ((x)%BITS_PER_LONG) ++#define BIT(x) (1UL<> OFF(bit)) & 1) ++ ++int main (int argc, char **argv) ++{ ++ int fd, rd, i, j, k; ++ struct input_event ev[64]; ++ int version; ++ unsigned short id[4]; ++ unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; ++ char name[256] = "Unknown"; ++ int _abs[5]; ++ ++ if (argc < 2) { ++ printf("Usage: evtest /dev/input/eventX\n"); ++ printf("Where X = input device number\n"); ++ exit(1); ++ } ++ ++ if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) { ++ perror("evtest"); ++ exit(1); ++ } ++ ++ if (ioctl(fd, EVIOCGVERSION, &version)) { ++ perror("evtest: can't get version"); ++ exit(1); ++ } ++ ++ printf("Input driver version is %d.%d.%d\n", ++ version >> 16, (version >> 8) & 0xff, version & 0xff); ++ ++ ioctl(fd, EVIOCGID, id); ++ printf("Input device ID: bus 0x%x vendor 0x%x product 0x%x version 0x%x\n", ++ id[ID_BUS], id[ID_VENDOR], id[ID_PRODUCT], id[ID_VERSION]); ++ ++ ioctl(fd, EVIOCGNAME(sizeof(name)), name); ++ printf("Input device name: \"%s\"\n", name); ++ ++ memset(bit, 0, sizeof(bit)); ++ ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]); ++ printf("Supported events:\n"); ++ ++ for (i = 0; i < EV_MAX; i++) ++ if (test_bit(i, bit[0])) { ++ printf(" Event type %d (%s)\n", i, events[i] ? events[i] : "?"); ++ ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]); ++ for (j = 0; j < KEY_MAX; j++) ++ if (test_bit(j, bit[i])) { ++ printf(" Event code %d (%s)\n", j, names[i] ? (names[i][j] ? names[i][j] : "?") : "?"); ++ if (i == EV_ABS) { ++ ioctl(fd, EVIOCGABS(j), _abs); ++ for (k = 0; k < 5; k++) ++ if ((k < 3) || _abs[k]) ++ printf(" %s %6d\n", absval[k], _abs[k]); ++ } ++ } ++ } ++ ++ ++ printf("Testing ... (interrupt to exit)\n"); ++ ++ while (1) { ++ rd = read(fd, ev, sizeof(struct input_event) * 64); ++ ++ if (rd < (int) sizeof(struct input_event)) { ++ printf("yyy\n"); ++ perror("\nevtest: error reading"); ++ exit (1); ++ } ++ ++ for (i = 0; i < rd / (int) sizeof(struct input_event); i++) ++ printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n", ++ ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].type, ++ events[ev[i].type] ? events[ev[i].type] : "?", ++ ev[i].code, ++ names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", ++ ev[i].value); ++ ++ } ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/hex_dump.c dvb-apps/test/hex_dump.c +--- linuxtv-dvb-apps-1.1.1/test/hex_dump.c 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/hex_dump.c 2009-06-21 13:29:06.000000000 +0200 +@@ -60,4 +60,3 @@ + } + printf("\n"); + } +- +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvbcfg/dvbcfg_test.c dvb-apps/test/libdvbcfg/dvbcfg_test.c +--- linuxtv-dvb-apps-1.1.1/test/libdvbcfg/dvbcfg_test.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvbcfg/dvbcfg_test.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,100 @@ ++/** ++ * dvbcfg testing. ++ * ++ * Copyright (c) 2005 by Andrew de Quincey ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++ ++void syntax(void); ++ ++struct dvbcfg_zapchannel *channels = NULL; ++int zapcount = 0; ++int zappos = 0; ++ ++int zapload_callback(struct dvbcfg_zapchannel *channel, void *private); ++int zapsave_callback(struct dvbcfg_zapchannel *channel, void *private); ++ ++int main(int argc, char *argv[]) ++{ ++ if (argc != 4) { ++ syntax(); ++ } ++ ++ if (!strcmp(argv[1], "-zapchannel")) { ++ ++ FILE *f = fopen(argv[2], "r"); ++ if (!f) { ++ fprintf(stderr, "Unable to load %s\n", argv[2]); ++ exit(1); ++ } ++ dvbcfg_zapchannel_parse(f, zapload_callback, NULL); ++ fclose(f); ++ ++ f = fopen(argv[3], "w"); ++ if (!f) { ++ fprintf(stderr, "Unable to write %s\n", argv[3]); ++ exit(1); ++ } ++ dvbcfg_zapchannel_save(f, zapsave_callback, NULL); ++ fclose(f); ++ ++ } else { ++ syntax(); ++ } ++ ++ exit(0); ++} ++ ++int zapload_callback(struct dvbcfg_zapchannel *channel, void *private) ++{ ++ (void) private; ++ ++ struct dvbcfg_zapchannel *tmp = realloc(channels, (zapcount+1) * sizeof(struct dvbcfg_zapchannel)); ++ if (tmp == NULL) { ++ fprintf(stderr, "Out of memory\n"); ++ exit(1); ++ } ++ channels = tmp; ++ ++ memcpy(&channels[zapcount++], channel, sizeof(struct dvbcfg_zapchannel)); ++ ++ return 0; ++} ++ ++int zapsave_callback(struct dvbcfg_zapchannel *channel, void *private) ++{ ++ (void) private; ++ ++ if (zappos >= zapcount) ++ return 1; ++ ++ memcpy(channel, channels + zappos, sizeof(struct dvbcfg_zapchannel)); ++ zappos++; ++ ++ return 0; ++} ++ ++void syntax() ++{ ++ fprintf(stderr, ++ "Syntax: dvbcfg_test <-zapchannel> \n"); ++ exit(1); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvbcfg/Makefile dvb-apps/test/libdvbcfg/Makefile +--- linuxtv-dvb-apps-1.1.1/test/libdvbcfg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvbcfg/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,12 @@ ++# Makefile for linuxtv.org dvb-apps/test/libdvbcfg ++ ++binaries = dvbcfg_test ++ ++CPPFLAGS += -I../../lib ++LDLIBS += ../../lib/libdvbcfg/libdvbcfg.a ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvbcfg/test_zapchannels.txt dvb-apps/test/libdvbcfg/test_zapchannels.txt +--- linuxtv-dvb-apps-1.1.1/test/libdvbcfg/test_zapchannels.txt 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvbcfg/test_zapchannels.txt 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,446 @@ ++# Most of the major channels in the Raleigh Durham Area. Frequencies the NTSC center freq. ++WRAL:707000000:8VSB:33:36 ++WNCN:719000000:8VSB:49:52 ++WTVD:701000000:8VSB:49:52 ++WRAZ:683000000:8VSB:49:52 ++WUNC:743000000:8VSB:49:52 ++WRDU:551000000:8VSB:33:36 ++WLFL:731000000:8VSB:33:36 ++3sat:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:210:220 ++ARD-Online-Kanal:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1805 ++CNBC:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:510:520 ++DLF-Köln:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:810 ++DLR-Berlin:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:710 ++EinsExtra:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:101:102 ++EinsFestival:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:201:202 ++EinsMuXx:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:301:302 ++EuroNews:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2221:2233 ++Eurosport:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:410:420 ++Fritz:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:901 ++KiKa:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:310:320 ++MDR FERNSEHEN:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:401:402 ++MDR KULTUR:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:801 ++MDR info:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1101 ++MHP ARD Online-Kanal:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:102 ++NDR Fernsehen:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2401:2402 ++ORB-Fernsehen:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:501:502 ++RADIOmultikulti:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1301 ++Radio 3:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:701 ++SFB1:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:601:602 ++SWR2:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1401 ++SÜDWEST BW:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:801:802 ++SÜDWEST RP:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:3101:3102 ++WDR 3:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1501 ++WDR 5:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1601 ++ZDF:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:110:120 ++ZDFdigitext:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++ZDFdokukanal:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:660:670 ++ZDFinfokanal:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:610:620 ++ZDFtheaterkanal:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++JUMP:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1001 ++SPUTNIK:426000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:1201 ++Österreich 1:394000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:169 ++ATV 2:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:631:632 ++ATV 2:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:631:632 ++Adagio:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++All Jazz:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Avante:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:741:743 ++B5 aktuell:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3101 ++BBC Prime:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:761:762 ++BData3:402000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++BData4:402000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++BData5:402000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++BR-alpha:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:701:702 ++Barock Fantasie:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Bayerisches FS:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:201:202 ++Bayern 1:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3601 ++Bayern 4 Klassik:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3001 ++BibelTV:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:731:732 ++Bloomberg:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++CLASSICA:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:767:768 ++COUNTRY:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:656 ++Canal 24 Horas:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:991:992 ++Club:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:711:713 ++Cristal New Age:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++DANCE:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:304 ++DW-tv:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:634:632 ++Das Erste:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:101:102 ++Detskij Mir:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:931:932 ++ERT-Sat:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:691:692 ++Einstein TV:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:701:702 ++Euronews:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:597:596 ++Eurosport News:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:771:772 ++Extreme Sports:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:791:793 ++Extreme Sports:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Fashion TV:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Fox Kids:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:671:672 ++Fox Kids:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:671:673 ++GOLD:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:320 ++HITLISTE:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:784 ++HR XXL:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3501 ++JAZZ:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:640 ++Jazz legends:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Kabel Wizard:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Kanal 7:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Kanal 7:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:49:52 ++Kanal D:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:651:652 ++Kanal D:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:651:652 ++LATIN:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:368 ++Landscape:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Leitseite:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2254:0 ++Liberty TV:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:721:723 ++MTV Base:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:781:782 ++MV-Test:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Modem-Setup:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Movie Sounds:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Musica Antica:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Musica Camerata:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++NDR Info:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3701 ++NTV international:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++NTVI:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:611:612 ++Nashe Kino:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:621:622 ++NordwestRadio:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3801 ++OLD GOLD:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:336 ++Opernfestival:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++PCNE:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:681:682 ++PREMIERE SPORT INTERACTIVE:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++PREMIERE DIREKT 1:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++PREMIERE DIREKT 2:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++PREMIERE DIREKT 3:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++PREMIERE DIREKT 4:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2815:2816 ++PREMIERE EROTIK:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1279:1280 ++PREMIERE NOSTALGIE:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2559:2560 ++PREMIERE SERIE:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1023:1024 ++PREMIERE SPORT 1:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:255:258 ++PREMIERE SPORT 2:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:3839:3840 ++PREMIERE START:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:255:256 ++Parlamentsfernsehen:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:33:36 ++Phoenix:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:901:902 ++Portal:402000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++RTP Internacional:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:661:662 ++Rai 1:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:951:952 ++Rai 2:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:961:962 ++Rai 3:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:971:972 ++SCHLAGER:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:384 ++SR 1:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3901 ++SR Fernsehen Suedwest:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:501:502 ++Show TV:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:911:912 ++Sinfonica:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++TGRT:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:921:922 ++TM V1.0:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++TV Polonia:434000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:641:642 ++TVEi:121000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:981:982 ++TW1:113000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:751:752 ++Test-R:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:701:702 ++Travel:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:595:594 ++VCR-Setup:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++VH1 Classic:610000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:604:603 ++Videotext:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++WDR FERNSEHEN:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:601:602 ++ZEE TV:442000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++arte:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:401:403 ++hessen fernsehen:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:301:302 ++hr-chronos:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3201 ++hr-klassik:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3401 ++hr2:410000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:3301 ++13 TH STREET:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2303:2304 ++ALTERNATIVE ROCK:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:544 ++BEATE-UHSE.TV:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1023:1024 ++CHILLOUT:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:400 ++CLASSIC ROCK:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:352 ++DISCOVERY CHANNEL:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1791:1792 ++DISNEY CHANNEL:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2559:2560 ++DEUTSCHE HITS:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:800 ++EASY LISTENING:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:608 ++Einstein:346000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++FILM & MUSICAL:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:592 ++FOX KIDS:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1279:1280 ++GOLDSTAR TV:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:3839:3840 ++HARD ROCK:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:816 ++HEIMATKANAL:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1535:1536 ++HIP HOP/R&B:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:576 ++JUNIOR:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:255:256 ++K-TOON:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++KLASSIK POPULÄR:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:624 ++KRIMI &CO:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1535:1536 ++LOVE SONGS:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:592 ++NEW COUNTRY:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:384 ++ORCHESTRALE WERKE:378000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:560 ++PLANET:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1791:1792 ++PREMIERE 1:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:511:512 ++PREMIERE 2:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1791:1793 ++PREMIERE 3:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2303:2304 ++PREMIERE 4:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:767:768 ++PREMIERE 5:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1279:1280 ++PREMIERE 6:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1535:1536 ++PREMIERE 7:370000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:1023:1024 ++SOUL CLASSICS:362000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:352 ++STUDIO UNIVERSAL:354000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:2047:2048 ++Sonnenklar TV:402000000:INVERSION_OFF:6900000:FEC_NONE:QAM_64:0:0 ++Das Erste:11837:h:0:27500:101:102:28106 ++ZDF:11954:h:0:27500:110:120:28006 ++3sat:11954:h:0:27500:210:220:28007 ++EinsMuXx:12110:h:0:27500:301:302:28203 ++EinsFestival:12110:h:0:27500:201:202:28202 ++EinsExtra:12110:h:0:27500:101:102:28201 ++MDR FERNSEHEN:12110:h:0:27500:401:402:28204 ++ORB-Fernsehen:12110:h:0:27500:501:502:28205 ++B1 Berlin:12110:h:0:27500:601:602:28206 ++SWR Fernsehen:11837:h:0:27500:801:802:28113 ++SR Fernsehen Suedwes:11837:h:0:27500:501:502:28110 ++hessen fernsehen:11837:h:0:27500:301:302:28108 ++WDR FERNSEHEN:11837:h:0:27500:601:602:28111 ++Bayerisches FS:11837:h:0:27500:201:202:28107 ++N3:12110:h:0:27500:2401:2402:28224 ++BR-alpha:11837:h:0:27500:701:702:28112 ++KiKa:11954:h:0:27500:310:320:28008 ++arte:11836:h:0:27500:401:402:28109 ++ZDF Theaterkanal:11954:h:0:27500:1110:1120:28016 ++ZDF.info:11954:h:0:27500:610:620:28011 ++ZDF.doku:11954:h:0:27500:660:670:28014 ++Phoenix:11837:h:0:27500:901:902:28114 ++DW-tv:10786:v:0:21997:305:306:9005 ++RTL Television:12188:h:0:27500:163:104:12003 ++SAT.1:12480:v:0:27500:1791:1792:46 ++ProSieben:12480:v:0:27500:255:256:898 ++RTL2:12188:h:0:27500:166:128:12020 ++Super RTL:12188:h:0:27500:165:120:12040 ++KABEL1:12480:v:0:27500:511:512:899 ++VOX:12188:h:0:27500:167:136:12060 ++tm3:12480:v:0:27500:767:768:897 ++Bloomberg TV Germany:12552:v:0:22000:162:99:12160 ++EuroNews:11954:h:0:27500:2221:2233:28015 ++N24:12480:v:0:27500:2047:2048:47 ++n-tv:12670:v:0:22000:162:96:12730 ++DSF:12480:v:0:27500:1023:1024:900 ++Eurosport:11954:h:0:27500:410:420:28009 ++Via 1 - Sch ner Re:12148:h:0:27500:511:512:44 ++Home Order Tel:12480:v:0:27500:1279:1280:40 ++QVC GERMANY:12552:v:0:22000:165:166:12100 ++TW 1:12692:h:0:22000:166:167:13013 ++Canal Canarias:12441:v:0:27500:513:681:29700 ++ProSieben A:12051:v:0:27500:161:84:20002 ++ProSieben CH:12051:v:0:27500:289:290:20001 ++Kabel 1 Austria:12051:v:0:27500:166:167:20004 ++Kabel 1 Schweiz:12051:v:0:27500:162:163:20003 ++CNN Int.:12168:v:0:27500:165:100:28512 ++Sky News:12552:v:0:22000:305:306:3995 ++Travel:12168:v:0:27500:163:92:28001 ++AB SAT / XXL:12266:h:0:27500:164:96:17004 ++MOTEURS:12266:h:0:27500:160:80:17000 ++HOT GM:12148:h:0:27500:767:768:45 ++KTO:12129:v:0:27500:170:120:8411 ++LA CINQUIEME:12207:v:0:27500:160:80:8501 ++LCP:12207:v:0:27500:165:100:8506 ++LibertyTV.com:12611:v:0:22000:941:942:12280 ++TV5 Europe:12611:v:0:22000:45:46:12240 ++Motors TV:12611:v:0:22000:191:194:12300 ++Wishline:12611:v:0:22000:214:216:12320 ++TV 5:10786:v:0:21997:164:112:9001 ++RTM - MAROC:10786:v:0:21997:162:96:9002 ++ESC1 - EGYPTE:10786:v:0:21997:163:104:9003 ++RAI 1:10786:v:0:21997:289:290:9004 ++RTPI:10786:v:0:21997:300:301:9006 ++TV7:10786:v:0:21997:166:128:9007 ++ARTE:10786:v:0:21997:167:136:9009 ++Colourbars:12611:v:0:22000:48:49:3982 ++Alice:12611:v:0:22000:162:96:12200 ++Video Italia:12611:v:0:22000:121:122:12220 ++ANDALUCIA TV:11934:v:0:27500:166:104:29011 ++TVC INT.:12441:v:0:27500:512:660:29701 ++TV4:11992:h:0:27500:165:98:20365 ++TV Niepokalanow:11876:h:0:27500:161:82:20601 ++VIVA:12670:v:0:22000:309:310:12732 ++VIVA ZWEI:12552:v:0:22000:171:172:12120 ++MTV Central:12699:v:0:22000:3031:3032:28643 ++ONYX:12692:h:1:27500:161:84:502 ++VIVA polska:11603:h:1:27500:190:191:611 ++DeeJay TV:11603:h:1:27500:160:161:602 ++NBC:11053:h:1:27500:550:551:8008 ++EWTN:10722:h:1:29900:1001:1201:4601 ++MTA INTL:10722:h:1:29900:1004:1204:4604 ++VOX:11053:h:1:27500:500:501:8002 ++SAT.1 A:11053:h:1:27500:511:512:8003 ++RTL2 AUSTRIA:11053:h:1:27500:520:521:8004 ++ZDF:11053:h:1:27500:570:571:8011 ++K-TV:11053:h:1:27500:580:581:8012 ++RTL Television:11053:h:1:27500:160:80:8001 ++ARTE:11059:v:1:6510:98:99:1 ++HOT Italia:11095:h:1:27500:4194:4195:3714 ++Olisat:11095:h:1:27500:33:34:3718 ++VIVA-POLSKA:11128:h:1:4340:98:99:1 ++DW-tv:11195:v:1:9099:101:102:5301 ++Canal 24 Horas:11203:h:1:3999:4130:4131:5301 ++TV5:11337:v:1:5631:512:640:1 ++SAT.1 CH:11603:h:1:27500:101:102:601 ++KurdSat:11603:h:1:27500:111:112:603 ++ARD "Das Erste":11603:h:1:27500:172:173:606 ++RTL 2 CH:11603:h:1:27500:175:176:609 ++Super RTL A:11603:h:1:27500:180:181:610 ++TV ROMANIA:11622:v:1:27500:227:247:10707 ++MRTV:11622:v:1:27500:222:242:10702 ++102.5 HIT Ch:11622:v:1:27500:224:244:10704 ++TLC SAT:11622:v:1:27500:225:245:10705 ++PRO-SAT:11622:v:1:27500:246:226:10706 ++Channel SUN:11622:v:1:27500:229:249:10709 ++Racing Channel:11622:v:1:27500:228:248:10708 ++3 ABN:11622:v:1:27500:221:241:10701 ++Bloom.Germany:11642:h:1:27500:1460:1420:4 ++Bloomberg TV UK:11642:h:1:27500:1560:1520:4 ++Sat 7:11642:h:1:27500:1660:1620:4 ++EDTV 1:11746:h:1:27500:4130:4131:9501 ++EDTV SPORT:11746:h:1:27500:4386:4387:9502 ++EDTV BUSINESS:11746:h:1:27500:4642:4643:9503 ++EDTV DRAMA:11746:h:1:27500:4898:4899:9504 ++RAI1:11765:v:1:27499:160:80:3401 ++RAI2:11765:v:1:27499:161:84:3402 ++RAI3:11765:v:1:27499:162:88:3403 ++RaiWayTEST2:11765:v:1:27499:516:654:3405 ++RAIMOSAICO:11765:v:1:27499:518:8191:3407 ++RAINews24:11803:v:1:27500:516:654:3301 ++CAMERA DEPUTATI:11803:v:1:27500:517:655:3302 ++TELEPACE:11803:v:1:27500:515:653:3304 ++RAISPORTSAT:11803:v:1:27500:512:650:3305 ++RAINettunoSAT2:11803:v:1:27500:513:651:3306 ++RAIeducational:11803:v:1:27500:514:652:3307 ++RAINettunoSAT1:11803:v:1:27500:519:657:3308 ++SAT2000:11803:v:1:27500:518:656:3309 ++I1:11918:v:1:27499:512:650:1 ++C5:11918:v:1:27499:513:660:2 ++R4:11918:v:1:27499:514:670:3 ++Telesierra:12091:h:1:27500:4160:4161:8704 ++C. Milagro:12091:h:1:27500:4368:4369:8711 ++Italia Sat:12091:h:1:27500:4600:4601:8728 ++TVE Internacional:12091:h:1:27500:4208:4209:8707 ++Fiesta:12091:h:1:27500:4432:4433:8720 ++Retelsat:12091:h:1:27500:4464:4465:8722 ++ART EUROPE:12013:h:1:27495:164:96:450 ++EGYPT SAT. CH. 2:12013:h:1:27495:166:104:470 ++IQRA:12013:h:1:27495:168:112:474 ++MAURITANIA TV:12110:v:1:27500:230:231:704 ++ARMENIA TV:12110:v:1:27500:240:241:705 ++SAILING CHANNEL:12110:v:1:27500:260:261:707 ++AL JAZEERA:12110:v:1:27500:270:271:708 ++Coming Soon TV:12110:v:1:27500:310:311:717 ++SaluteBenessere:12110:v:1:27500:320:321:718 ++AH-EDP1:12148:v:1:27499:96:97:7201 ++AH-EDP2:12148:v:1:27499:112:113:7202 ++Espresso:12148:v:1:27499:192:193:7203 ++Alice:12148:v:1:27499:160:161:7220 ++Nuvolari:12148:v:1:27499:176:177:7221 ++Leonardo:12148:v:1:27499:128:129:7222 ++AH-EDP3:12148:v:1:27499:36:37:7205 ++OTE Promo:12187:v:1:27500:517:655:1001 ++RTS SAT:12187:v:1:27500:519:657:1022 ++ERT SAT:12187:v:1:27500:514:652:1102 ++EXTRA:12187:v:1:27500:516:654:1106 ++TRIAL:12187:v:1:27500:513:651:1108 ++Minimax:11303:h:1:19540:300:301:3 ++TVN1:12209:h:1:5631:4194:4195:1 ++RR TEST:10978:v:1:8998:33:34:1 ++TV 5 Thailand:10978:v:1:8998:1057:1058:2 ++TEST-1:10978:v:1:8998:3105:3106:4 ++FASHION:12244:h:1:27500:123:133:103 ++AJARA TV:12244:h:1:27500:127:137:107 ++SLO-TV1:12300:v:1:27495:200:201:3201 ++POLONIA 1:12302:v:1:27500:205:206:3203 ++SUPER 1:12302:v:1:27500:207:208:3207 ++NAPOLI INT.:12302:v:1:27500:240:241:3210 ++MAGIC:12302:v:1:27500:245:246:3211 ++COUNTDOWN:12302:v:1:27500:235:236:3212 ++TBNE:12302:v:1:27500:230:231:3213 ++NAPOLI CHANNEL:12302:v:1:27500:227:228:3215 ++KURDISTAN TV:12302:v:1:27500:225:226:3214 ++ATLAS TV:12379:v:1:27500:3022:3032:3002 ++TELE 24 SWITZERLAND:12379:v:1:27500:3023:3033:3003 ++Abu Dhabi TV:12379:v:1:27500:3024:3034:3004 ++RTV MONTENEGRO:12379:v:1:27500:3026:3036:3006 ++JAAM-E-JAM 1:12436:h:1:27500:160:80:1 ++JAAM-E-JAM 2:12436:h:1:27500:161:82:2 ++SAHAR:12436:h:1:27500:162:84:3 ++SAHAR 2:12436:h:1:27500:163:86:4 ++IRINN:12436:h:1:27500:164:88:5 ++Musicmax:11303:h:1:19540:500:501:6 ++TEST:12474:h:1:27500:771:8191:10608 ++EbS:12474:h:1:27500:101:201:10601 ++MOU.2:12474:h:1:27500:42:43:10602 ++PINK PLUS:12474:h:1:27500:308:256:10605 ++LibertyTV.com:12474:h:1:27500:941:942:10603 ++2M Maroc:12474:h:1:27500:601:602:10607 ++ZEE TV:12474:h:1:27500:910:911:10604 ++WorldNet Europe:12483:v:1:8299:4260:4220:1 ++WorldNet:12483:v:1:8299:4560:4520:4 ++SICILIA INTERNATIONA:12519:v:1:27499:501:502:8309 ++SARDEGNA UNO:12519:v:1:27499:503:504:8310 ++EuroMed:12519:v:1:27499:510:511:8312 ++TGRT:12519:v:1:27499:505:506:8313 ++VIDEOLINA:12519:v:1:27499:515:516:8318 ++MEDIOLANUM:12538:h:1:27500:1131:1132:8987 ++www.travel:12538:h:1:27500:1180:1183:8992 ++MonteCarloSat:12538:h:1:27500:5126:5122:8877 ++Bulgaria TV:12538:h:1:27500:4612:4613:8827 ++TVN1:12571:h:1:5631:4194:4195:1 ++JSTV 1:12595:v:1:27500:2000:2001:8213 ++JSTV 2:12595:v:1:27500:2011:2013:8214 ++MBC:12595:v:1:27500:160:80:8201 ++ANN:12595:v:1:27500:161:84:8202 ++BET:12595:v:1:27500:167:108:8208 ++EuroNews:12595:v:1:27500:2221:2231:8211 ++Sharjah Arabs:12653:h:1:27500:1160:1120:1 ++Qatar Arabs:12653:h:1:27500:1260:1220:2 ++Saudi 1 Arabs:12653:h:1:27500:1360:1320:3 ++Kuwait Arabs:12653:h:1:27500:1460:1420:4 ++Libya Arabs:12653:h:1:27500:1560:1520:5 ++Sudan Arabs:12653:h:1:27500:1660:1620:6 ++Oman Arabs:12653:h:1:27500:1760:1720:7 ++Jordan Arabs:12653:h:1:27500:1860:1820:8 ++IRAQ TV:12653:h:1:27500:1960:1920:9 ++Dubai Sport:12653:h:1:27500:1060:1020:10 ++Digitaly:12672:v:1:27500:220:221:4203 ++Telemarket:12672:v:1:27500:350:351:4211 ++eVision:12672:v:1:27500:360:361:4214 ++Thai TV5:12672:v:1:27500:200:201:4201 ++Studio Europa:12672:v:1:27500:230:231:4204 ++Video Italia:12672:v:1:27500:340:341:4210 ++GAME NETWORK:12672:v:1:27500:291:292:4213 ++BBC-Choice:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:620:621 ++BBC-Knowledge:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:630:631 ++BBC-News24:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:640:641 ++BBC-1:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601 ++BBC-Parliament:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:660 ++BBC-2:578000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:610:611 ++ITV-1:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:513:651 ++ITV-2:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2818:2819 ++ITV-Sport:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2836:2837 ++FilmFour:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2822:2823 ++C4:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2826:2827 ++E4:850000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2831:2832 ++C5:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6017:6018 ++Shop:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6049:6050 ++ITVSelect-Info:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6065:6066 ++ITVSelect-1:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6081:6082 ++ITVSelect-2:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6097:6098 ++ITVSelect-3:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6113:6114 ++ITVSelect-4:713833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:6129:6130 ++Carlton-Cinema:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:288:289 ++Sky-One:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:544:545 ++Sky-Sports-1:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:800:801 ++Sky-Premier:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1056:1057 ++CartoonNetwork:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1312:1313 ++UK-Horizons:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2336:2337 ++ITV-Sport-Plus:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2592:2593 ++ITVSportSelect:721833334:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:2596 ++BreezeMen&Mtrs:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:800:801 ++Granada-Plus:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:544:545 ++MTV:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1568:1569 ++Sky-Movie-Max:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1312:1313 ++Sky-Sports-2:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2080:2081 ++UK-Gold:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:288:289 ++Wellbeing:690000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1824:1825 ++PLAY-uk:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:288:289 ++UK-Style:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:544:545 ++no-name:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:800:801 ++Discovery:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:1312:1313 ++Nick/Paramount:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2080:2081 ++Sky-Sports-3:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2336:2337 ++Brit-Eurosport:538000000:INVERSION_OFF:BANDWIDTH_8_MHZ:FEC_2_3:FEC_NONE:QAM_64:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:2592:2593 +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvben50221/Makefile dvb-apps/test/libdvben50221/Makefile +--- linuxtv-dvb-apps-1.1.1/test/libdvben50221/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvben50221/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,14 @@ ++# Makefile for linuxtv.org dvb-apps/test/libdvben50221 ++ ++binaries = test-app \ ++ test-session \ ++ test-transport ++ ++CPPFLAGS += -I../../lib ++LDLIBS += ../../lib/libdvbapi/libdvbapi.a ../../lib/libdvben50221/libdvben50221.a ../../lib/libucsi/libucsi.a -lpthread ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvben50221/test-app.c dvb-apps/test/libdvben50221/test-app.c +--- linuxtv-dvb-apps-1.1.1/test/libdvben50221/test-app.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvben50221/test-app.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,854 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com) ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define DEFAULT_SLOT 0 ++ ++#define MAX_SESSIONS 256 ++#define MAX_TC 32 ++ ++void *stackthread_func(void* arg); ++void *pmtthread_func(void* arg); ++int test_lookup_callback(void *arg, uint8_t slot_id, uint32_t requested_resource_id, ++ en50221_sl_resource_callback *callback_out, void **arg_out, uint32_t *connected_resource_id); ++int test_session_callback(void *arg, int reason, uint8_t slot_id, uint16_t session_number, uint32_t resource_id); ++ ++int test_datetime_enquiry_callback(void *arg, uint8_t slot_id, uint16_t session_number, uint8_t response_interval); ++ ++int test_rm_enq_callback(void *arg, uint8_t slot_id, uint16_t session_number); ++int test_rm_reply_callback(void *arg, uint8_t slot_id, uint16_t session_number, uint32_t resource_id_count, uint32_t *resource_ids); ++int test_rm_changed_callback(void *arg, uint8_t slot_id, uint16_t session_number); ++ ++int test_ai_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t application_type, uint16_t application_manufacturer, ++ uint16_t manufacturer_code, uint8_t menu_string_length, ++ uint8_t *menu_string); ++ ++int test_ca_info_callback(void *arg, uint8_t slot_id, uint16_t session_number, uint32_t ca_id_count, uint16_t *ca_ids); ++int test_ca_pmt_reply_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ struct en50221_app_pmt_reply *reply, uint32_t reply_size); ++ ++int test_mmi_close_callback(void *arg, uint8_t slot_id, uint16_t session_number, uint8_t cmd_id, uint8_t delay); ++ ++int test_mmi_display_control_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t cmd_id, uint8_t mmi_mode); ++ ++int test_mmi_keypad_control_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t cmd_id, uint8_t *key_codes, uint32_t key_codes_count); ++ ++int test_mmi_subtitle_segment_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t *segment, uint32_t segment_size); ++ ++int test_mmi_scene_end_mark_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t decoder_continue_flag, uint8_t scene_reveal_flag, ++ uint8_t send_scene_done, uint8_t scene_tag); ++ ++int test_mmi_scene_control_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t decoder_continue_flag, uint8_t scene_reveal_flag, ++ uint8_t scene_tag); ++ ++int test_mmi_subtitle_download_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t *segment, uint32_t segment_size); ++ ++int test_mmi_flush_download_callback(void *arg, uint8_t slot_id, uint16_t session_number); ++ ++int test_mmi_enq_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ uint8_t blind_answer, uint8_t expected_answer_length, ++ uint8_t *text, uint32_t text_size); ++ ++int test_mmi_menu_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ struct en50221_app_mmi_text *title, ++ struct en50221_app_mmi_text *sub_title, ++ struct en50221_app_mmi_text *bottom, ++ uint32_t item_count, struct en50221_app_mmi_text *items, ++ uint32_t item_raw_length, uint8_t *items_raw); ++ ++int test_app_mmi_list_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ struct en50221_app_mmi_text *title, ++ struct en50221_app_mmi_text *sub_title, ++ struct en50221_app_mmi_text *bottom, ++ uint32_t item_count, struct en50221_app_mmi_text *items, ++ uint32_t item_raw_length, uint8_t *items_raw); ++ ++struct section_ext *read_section_ext(char *buf, int buflen, int adapter, int demux, int pid, int table_id); ++ ++ ++ ++ ++ ++ ++ ++int adapterid; ++ ++int shutdown_stackthread = 0; ++int shutdown_pmtthread = 0; ++int in_menu = 0; ++int in_enq = 0; ++int ca_connected = 0; ++int pmt_pid = -1; ++int ca_session_number = 0; ++ ++ ++// instances of resources we actually implement here ++struct en50221_app_rm *rm_resource; ++struct en50221_app_datetime *datetime_resource; ++struct en50221_app_ai *ai_resource; ++struct en50221_app_ca *ca_resource; ++struct en50221_app_mmi *mmi_resource; ++ ++// lookup table used in resource manager implementation ++struct resource { ++ struct en50221_app_public_resource_id resid; ++ uint32_t binary_resource_id; ++ en50221_sl_resource_callback callback; ++ void *arg; ++}; ++struct resource resources[20]; ++int resources_count = 0; ++ ++// this contains all known resource ids so we can see if the cam asks for something exotic ++uint32_t resource_ids[] = { EN50221_APP_TELETEXT_RESOURCEID, ++ EN50221_APP_SMARTCARD_RESOURCEID(1), ++ EN50221_APP_RM_RESOURCEID, ++ EN50221_APP_MMI_RESOURCEID, ++ EN50221_APP_LOWSPEED_RESOURCEID(1,1), ++ EN50221_APP_EPG_RESOURCEID(1), ++ EN50221_APP_DVB_RESOURCEID, ++ EN50221_APP_CA_RESOURCEID, ++ EN50221_APP_DATETIME_RESOURCEID, ++ EN50221_APP_AUTH_RESOURCEID, ++ EN50221_APP_AI_RESOURCEID, }; ++int resource_ids_count = sizeof(resource_ids)/4; ++ ++ ++uint16_t ai_session_numbers[5]; ++ ++uint16_t mmi_session_number; ++ ++int main(int argc, char * argv[]) ++{ ++ pthread_t stackthread; ++ pthread_t pmtthread; ++ struct en50221_app_send_functions sendfuncs; ++ ++ if ((argc < 2) || (argc > 3)) { ++ fprintf(stderr, "Syntax: test-app []\n"); ++ exit(1); ++ } ++ adapterid = atoi(argv[1]); ++ if (argc == 3) { ++ if (sscanf(argv[2], "%i", &pmt_pid) != 1) { ++ fprintf(stderr, "Unable to parse PMT PID\n"); ++ exit(1); ++ } ++ } ++ ++ // create transport layer ++ struct en50221_transport_layer *tl = en50221_tl_create(5, 32); ++ if (tl == NULL) { ++ fprintf(stderr, "Failed to create transport layer\n"); ++ exit(1); ++ } ++ ++ // find CAMs ++ int cafd; ++ if (((cafd = dvbca_open(adapterid, 0)) < 0) || (dvbca_get_cam_state(cafd, DEFAULT_SLOT) == DVBCA_CAMSTATE_MISSING)) { ++ fprintf(stderr, "Unable to open CAM on adapter %i\n", adapterid); ++ exit(1); ++ } ++ ++ // reset it and wait ++ dvbca_reset(cafd, DEFAULT_SLOT); ++ printf("Found a CAM on adapter%i... waiting...\n", adapterid); ++ while(dvbca_get_cam_state(cafd, DEFAULT_SLOT) != DVBCA_CAMSTATE_READY) { ++ usleep(1000); ++ } ++ ++ // register it with the CA stack ++ int slot_id = 0; ++ if ((slot_id = en50221_tl_register_slot(tl, cafd, DEFAULT_SLOT, 1000, 100)) < 0) { ++ fprintf(stderr, "Slot registration failed\n"); ++ exit(1); ++ } ++ printf("slotid: %i\n", slot_id); ++ ++ // create session layer ++ struct en50221_session_layer *sl = en50221_sl_create(tl, 256); ++ if (sl == NULL) { ++ fprintf(stderr, "Failed to create session layer\n"); ++ exit(1); ++ } ++ ++ // create the sendfuncs ++ sendfuncs.arg = sl; ++ sendfuncs.send_data = (en50221_send_data) en50221_sl_send_data; ++ sendfuncs.send_datav = (en50221_send_datav) en50221_sl_send_datav; ++ ++ // create the resource manager resource ++ rm_resource = en50221_app_rm_create(&sendfuncs); ++ en50221_app_decode_public_resource_id(&resources[resources_count].resid, EN50221_APP_RM_RESOURCEID); ++ resources[resources_count].binary_resource_id = EN50221_APP_RM_RESOURCEID; ++ resources[resources_count].callback = (en50221_sl_resource_callback) en50221_app_rm_message; ++ resources[resources_count].arg = rm_resource; ++ en50221_app_rm_register_enq_callback(rm_resource, test_rm_enq_callback, NULL); ++ en50221_app_rm_register_reply_callback(rm_resource, test_rm_reply_callback, NULL); ++ en50221_app_rm_register_changed_callback(rm_resource, test_rm_changed_callback, NULL); ++ resources_count++; ++ ++ // create the datetime resource ++ datetime_resource = en50221_app_datetime_create(&sendfuncs); ++ en50221_app_decode_public_resource_id(&resources[resources_count].resid, EN50221_APP_DATETIME_RESOURCEID); ++ resources[resources_count].binary_resource_id = EN50221_APP_DATETIME_RESOURCEID; ++ resources[resources_count].callback = (en50221_sl_resource_callback) en50221_app_datetime_message; ++ resources[resources_count].arg = datetime_resource; ++ en50221_app_datetime_register_enquiry_callback(datetime_resource, test_datetime_enquiry_callback, NULL); ++ resources_count++; ++ ++ // create the application information resource ++ ai_resource = en50221_app_ai_create(&sendfuncs); ++ en50221_app_decode_public_resource_id(&resources[resources_count].resid, EN50221_APP_AI_RESOURCEID); ++ resources[resources_count].binary_resource_id = EN50221_APP_AI_RESOURCEID; ++ resources[resources_count].callback = (en50221_sl_resource_callback) en50221_app_ai_message; ++ resources[resources_count].arg = ai_resource; ++ en50221_app_ai_register_callback(ai_resource, test_ai_callback, NULL); ++ resources_count++; ++ ++ // create the CA resource ++ ca_resource = en50221_app_ca_create(&sendfuncs); ++ en50221_app_decode_public_resource_id(&resources[resources_count].resid, EN50221_APP_CA_RESOURCEID); ++ resources[resources_count].binary_resource_id = EN50221_APP_CA_RESOURCEID; ++ resources[resources_count].callback = (en50221_sl_resource_callback) en50221_app_ca_message; ++ resources[resources_count].arg = ca_resource; ++ en50221_app_ca_register_info_callback(ca_resource, test_ca_info_callback, NULL); ++ en50221_app_ca_register_pmt_reply_callback(ca_resource, test_ca_pmt_reply_callback, NULL); ++ resources_count++; ++ ++ // create the MMI resource ++ mmi_resource = en50221_app_mmi_create(&sendfuncs); ++ en50221_app_decode_public_resource_id(&resources[resources_count].resid, EN50221_APP_MMI_RESOURCEID); ++ resources[resources_count].binary_resource_id = EN50221_APP_MMI_RESOURCEID; ++ resources[resources_count].callback = (en50221_sl_resource_callback) en50221_app_mmi_message; ++ resources[resources_count].arg = mmi_resource; ++ en50221_app_mmi_register_close_callback(mmi_resource, test_mmi_close_callback, NULL); ++ en50221_app_mmi_register_display_control_callback(mmi_resource, test_mmi_display_control_callback, NULL); ++ en50221_app_mmi_register_keypad_control_callback(mmi_resource, test_mmi_keypad_control_callback, NULL); ++ en50221_app_mmi_register_subtitle_segment_callback(mmi_resource, test_mmi_subtitle_segment_callback, NULL); ++ en50221_app_mmi_register_scene_end_mark_callback(mmi_resource, test_mmi_scene_end_mark_callback, NULL); ++ en50221_app_mmi_register_scene_control_callback(mmi_resource, test_mmi_scene_control_callback, NULL); ++ en50221_app_mmi_register_subtitle_download_callback(mmi_resource, test_mmi_subtitle_download_callback, NULL); ++ en50221_app_mmi_register_flush_download_callback(mmi_resource, test_mmi_flush_download_callback, NULL); ++ en50221_app_mmi_register_enq_callback(mmi_resource, test_mmi_enq_callback, NULL); ++ en50221_app_mmi_register_menu_callback(mmi_resource, test_mmi_menu_callback, NULL); ++ en50221_app_mmi_register_list_callback(mmi_resource, test_app_mmi_list_callback, NULL); ++ resources_count++; ++ ++ // start another thread running the stack ++ pthread_create(&stackthread, NULL, stackthread_func, tl); ++ ++ // start another thread parsing PMT ++ if (pmt_pid != -1) { ++ pthread_create(&pmtthread, NULL, pmtthread_func, tl); ++ } ++ ++ // register callbacks ++ en50221_sl_register_lookup_callback(sl, test_lookup_callback, sl); ++ en50221_sl_register_session_callback(sl, test_session_callback, sl); ++ ++ // create a new connection on each slot ++ int tc = en50221_tl_new_tc(tl, slot_id); ++ printf("tcid: %i\n", tc); ++ ++ printf("Press a key to enter menu\n"); ++ getchar(); ++ en50221_app_ai_entermenu(ai_resource, ai_session_numbers[slot_id]); ++ ++ // wait ++ char tmp[256]; ++ while(1) { ++ fgets(tmp, sizeof(tmp), stdin); ++ int choice = atoi(tmp); ++ ++ if (in_menu) { ++ en50221_app_mmi_menu_answ(mmi_resource, mmi_session_number, choice); ++ in_menu = 0; ++ } ++ if (in_enq) { ++ uint32_t i; ++ uint32_t len = strlen(tmp); ++ for(i=0; i< len; i++) { ++ if (!isdigit(tmp[i])) { ++ len = i; ++ break; ++ } ++ } ++ en50221_app_mmi_answ(mmi_resource, mmi_session_number, MMI_ANSW_ID_ANSWER, (uint8_t*) tmp, len); ++ in_enq = 0; ++ } ++ } ++ printf("Press a key to exit\n"); ++ getchar(); ++ ++ // destroy slots ++ en50221_tl_destroy_slot(tl, slot_id); ++ shutdown_stackthread = 1; ++ shutdown_pmtthread = 1; ++ pthread_join(stackthread, NULL); ++ if (pmt_pid != -1) { ++ pthread_join(pmtthread, NULL); ++ } ++ ++ // destroy session layer ++ en50221_sl_destroy(sl); ++ ++ // destroy transport layer ++ en50221_tl_destroy(tl); ++ ++ return 0; ++} ++ ++int test_lookup_callback(void *arg, uint8_t slot_id, uint32_t requested_resource_id, ++ en50221_sl_resource_callback *callback_out, void **arg_out, uint32_t *connected_resource_id) ++{ ++ struct en50221_app_public_resource_id resid; ++ (void)arg; ++ ++ // decode the resource id ++ if (en50221_app_decode_public_resource_id(&resid, requested_resource_id)) { ++ printf("%02x:Public resource lookup callback %i %i %i\n", slot_id, ++ resid.resource_class, resid.resource_type, resid.resource_version); ++ } else { ++ printf("%02x:Private resource lookup callback %08x\n", slot_id, requested_resource_id); ++ return -1; ++ } ++ ++ // FIXME: need better comparison ++ // FIXME: return resourceid we actually connected to ++ ++ // try and find an instance of the resource ++ int i; ++ for(i=0; itext_length, title->text); ++ printf(" sub_title: %.*s\n", sub_title->text_length, sub_title->text); ++ printf(" bottom: %.*s\n", bottom->text_length, bottom->text); ++ ++ uint32_t i; ++ for(i=0; i< item_count; i++) { ++ printf(" item %i: %.*s\n", i+1, items[i].text_length, items[i].text); ++ } ++ printf(" raw_length: %i\n", item_raw_length); ++ ++ mmi_session_number = session_number; ++ in_menu = 1; ++ ++ return 0; ++} ++ ++int test_app_mmi_list_callback(void *arg, uint8_t slot_id, uint16_t session_number, ++ struct en50221_app_mmi_text *title, ++ struct en50221_app_mmi_text *sub_title, ++ struct en50221_app_mmi_text *bottom, ++ uint32_t item_count, struct en50221_app_mmi_text *items, ++ uint32_t item_raw_length, uint8_t *items_raw) ++{ ++ (void)arg; ++ (void)items_raw; ++ (void)arg; ++ ++ printf("%02x:%s\n", slot_id, __func__); ++ ++ printf(" title: %.*s\n", title->text_length, title->text); ++ printf(" sub_title: %.*s\n", sub_title->text_length, sub_title->text); ++ printf(" bottom: %.*s\n", bottom->text_length, bottom->text); ++ ++ uint32_t i; ++ for(i=0; i< item_count; i++) { ++ printf(" item %i: %.*s\n", i+1, items[i].text_length, items[i].text); ++ } ++ printf(" raw_length: %i\n", item_raw_length); ++ ++ mmi_session_number = session_number; ++ in_menu = 1; ++ ++ return 0; ++} ++ ++ ++ ++ ++ ++ ++ ++void *stackthread_func(void* arg) { ++ struct en50221_transport_layer *tl = arg; ++ int lasterror = 0; ++ ++ while(!shutdown_stackthread) { ++ int error; ++ if ((error = en50221_tl_poll(tl)) != 0) { ++ if (error != lasterror) { ++ fprintf(stderr, "Error reported by stack slot:%i error:%i\n", ++ en50221_tl_get_error_slot(tl), ++ en50221_tl_get_error(tl)); ++ } ++ lasterror = error; ++ } ++ } ++ ++ shutdown_stackthread = 0; ++ return 0; ++} ++ ++void *pmtthread_func(void* arg) { ++ (void)arg; ++ char buf[4096]; ++ uint8_t capmt[4096]; ++ int pmtversion = -1; ++ ++ while(!shutdown_pmtthread) { ++ ++ if (!ca_connected) { ++ sleep(1); ++ continue; ++ } ++ ++ // read the PMT ++ struct section_ext *section_ext = read_section_ext(buf, sizeof(buf), adapterid, 0, pmt_pid, stag_mpeg_program_map); ++ if (section_ext == NULL) { ++ fprintf(stderr, "Failed to read PMT\n"); ++ exit(1); ++ } ++ struct mpeg_pmt_section *pmt = mpeg_pmt_section_codec(section_ext); ++ if (pmt == NULL) { ++ fprintf(stderr, "Bad PMT received\n"); ++ exit(1); ++ } ++ if (pmt->head.version_number == pmtversion) { ++ continue; ++ } ++ ++ // translate it into a CA PMT ++ int listmgmt = CA_LIST_MANAGEMENT_ONLY; ++ if (pmtversion != -1) { ++ listmgmt = CA_LIST_MANAGEMENT_UPDATE; ++ } ++ int size; ++ if ((size = en50221_ca_format_pmt(pmt, ++ capmt, ++ sizeof(capmt), ++ listmgmt, ++ 0, ++ CA_PMT_CMD_ID_OK_DESCRAMBLING)) < 0) { ++ fprintf(stderr, "Failed to format CA PMT object\n"); ++ exit(1); ++ } ++ ++ // set it ++ if (en50221_app_ca_pmt(ca_resource, ca_session_number, capmt, size)) { ++ fprintf(stderr, "Failed to send CA PMT object\n"); ++ exit(1); ++ } ++ pmtversion = pmt->head.version_number; ++ } ++ shutdown_pmtthread = 0; ++ return 0; ++} ++ ++ ++struct section_ext *read_section_ext(char *buf, int buflen, int adapter, int demux, int pid, int table_id) ++{ ++ int demux_fd = -1; ++ uint8_t filter[18]; ++ uint8_t mask[18]; ++ int size; ++ struct section *section; ++ struct section_ext *result = NULL; ++ ++ // open the demuxer ++ if ((demux_fd = dvbdemux_open_demux(adapter, demux, 0)) < 0) { ++ goto exit; ++ } ++ ++ // create a section filter ++ memset(filter, 0, sizeof(filter)); ++ memset(mask, 0, sizeof(mask)); ++ filter[0] = table_id; ++ mask[0] = 0xFF; ++ if (dvbdemux_set_section_filter(demux_fd, pid, filter, mask, 1, 1)) { ++ goto exit; ++ } ++ ++ // read the section ++ if ((size = read(demux_fd, buf, buflen)) < 0) { ++ goto exit; ++ } ++ ++ // parse it as a section ++ section = section_codec((uint8_t*) buf, size); ++ if (section == NULL) { ++ goto exit; ++ } ++ ++ // parse it as a section_ext ++ result = section_ext_decode(section, 0); ++ ++exit: ++ if (demux_fd != -1) ++ close(demux_fd); ++ return result; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvben50221/test-session.c dvb-apps/test/libdvben50221/test-session.c +--- linuxtv-dvb-apps-1.1.1/test/libdvben50221/test-session.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvben50221/test-session.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,171 @@ ++/* ++ en50221 encoder An implementation for libdvb ++ an implementation for the en50221 transport layer ++ ++ Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com) ++ Copyright (C) 2005 Julian Scheel (julian at jusst dot de) ++ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of ++ the License, or (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++void *stackthread_func(void* arg); ++int test_lookup_callback(void *arg, uint8_t slot_id, uint32_t requested_resource_id, ++ en50221_sl_resource_callback *callback_out, void **arg_out, uint32_t *connected_resource_id); ++int test_session_callback(void *arg, int reason, uint8_t slot_id, uint16_t session_number, uint32_t resource_id); ++ ++ ++int shutdown_stackthread = 0; ++ ++#define DEFAULT_SLOT 0 ++ ++int main(int argc, char * argv[]) ++{ ++ (void)argc; ++ (void)argv; ++ ++ int i; ++ pthread_t stackthread; ++ ++ // create transport layer ++ struct en50221_transport_layer *tl = en50221_tl_create(5, 32); ++ if (tl == NULL) { ++ fprintf(stderr, "Failed to create transport layer\n"); ++ exit(1); ++ } ++ ++ // find CAMs ++ int slot_count = 0; ++ int cafd= -1; ++ for(i=0; i<20; i++) { ++ if ((cafd = dvbca_open(i, 0)) > 0) { ++ if (dvbca_get_cam_state(cafd, DEFAULT_SLOT) == DVBCA_CAMSTATE_MISSING) { ++ close(cafd); ++ continue; ++ } ++ ++ // reset it and wait ++ dvbca_reset(cafd, DEFAULT_SLOT); ++ printf("Found a CAM on adapter%i... waiting...\n", i); ++ while(dvbca_get_cam_state(cafd, DEFAULT_SLOT) != DVBCA_CAMSTATE_READY) { ++ usleep(1000); ++ } ++ ++ // register it with the CA stack ++ int slot_id = 0; ++ if ((slot_id = en50221_tl_register_slot(tl, cafd, DEFAULT_SLOT, 1000, 100)) < 0) { ++ fprintf(stderr, "Slot registration failed\n"); ++ exit(1); ++ } ++ printf("slotid: %i\n", slot_id); ++ slot_count++; ++ } ++ } ++ ++ // create session layer ++ struct en50221_session_layer *sl = en50221_sl_create(tl, 256); ++ if (sl == NULL) { ++ fprintf(stderr, "Failed to create session layer\n"); ++ exit(1); ++ } ++ ++ // start another thread running the stack ++ pthread_create(&stackthread, NULL, stackthread_func, tl); ++ ++ // register callbacks ++ en50221_sl_register_lookup_callback(sl, test_lookup_callback, sl); ++ en50221_sl_register_session_callback(sl, test_session_callback, sl); ++ ++ // create a new connection ++ for(i=0; i ++#include ++#include ++#include ++#include ++ ++void *stackthread_func(void* arg); ++void test_callback(void *arg, int reason, ++ uint8_t *data, uint32_t data_length, ++ uint8_t slot_id, uint8_t connection_id); ++ ++int shutdown_stackthread = 0; ++ ++#define DEFAULT_SLOT 0 ++ ++int main(int argc, char * argv[]) ++{ ++ (void)argc; ++ (void)argv; ++ ++ int i; ++ pthread_t stackthread; ++ ++ // create transport layer ++ struct en50221_transport_layer *tl = en50221_tl_create(5, 32); ++ if (tl == NULL) { ++ fprintf(stderr, "Failed to create transport layer\n"); ++ exit(1); ++ } ++ ++ // find CAMs ++ int slot_count = 0; ++ int cafd= -1; ++ for(i=0; i<20; i++) { ++ if ((cafd = dvbca_open(i, 0)) > 0) { ++ if (dvbca_get_cam_state(cafd, DEFAULT_SLOT) == DVBCA_CAMSTATE_MISSING) { ++ close(cafd); ++ continue; ++ } ++ ++ // reset it and wait ++ dvbca_reset(cafd, DEFAULT_SLOT); ++ printf("Found a CAM on adapter%i... waiting...\n", i); ++ while(dvbca_get_cam_state(cafd, DEFAULT_SLOT) != DVBCA_CAMSTATE_READY) { ++ usleep(1000); ++ } ++ ++ // register it with the CA stack ++ int slot_id = 0; ++ if ((slot_id = en50221_tl_register_slot(tl, cafd, DEFAULT_SLOT, 1000, 100)) < 0) { ++ fprintf(stderr, "Slot registration failed\n"); ++ exit(1); ++ } ++ printf("slotid: %i\n", slot_id); ++ slot_count++; ++ } ++ } ++ ++ // start another thread to running the stack ++ pthread_create(&stackthread, NULL, stackthread_func, tl); ++ ++ // register callback ++ en50221_tl_register_callback(tl, test_callback, tl); ++ ++ // create a new connection ++ for(i=0; i ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as ++ * published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++ ++void syntax(void); ++ ++struct dvbsec_config *secconfigs = NULL; ++int seccount = 0; ++ ++int secload_callback(void *private, struct dvbsec_config *sec); ++ ++int main(int argc, char *argv[]) ++{ ++ if (argc != 4) { ++ syntax(); ++ } ++ ++ if (!strcmp(argv[1], "-sec")) { ++ ++ FILE *f = fopen(argv[2], "r"); ++ if (!f) { ++ fprintf(stderr, "Unable to load %s\n", argv[2]); ++ exit(1); ++ } ++ dvbsec_cfg_load(f, NULL, secload_callback); ++ fclose(f); ++ ++ f = fopen(argv[3], "w"); ++ if (!f) { ++ fprintf(stderr, "Unable to write %s\n", argv[3]); ++ exit(1); ++ } ++ dvbsec_cfg_save(f, secconfigs, seccount); ++ fclose(f); ++ ++ } else { ++ syntax(); ++ } ++ ++ exit(0); ++} ++ ++int secload_callback(void *private, struct dvbsec_config *sec) ++{ ++ (void) private; ++ ++ struct dvbsec_config *tmp = realloc(secconfigs, (seccount+1) * sizeof(struct dvbsec_config)); ++ if (tmp == NULL) { ++ fprintf(stderr, "Out of memory\n"); ++ exit(1); ++ } ++ secconfigs = tmp; ++ ++ memcpy(&secconfigs[seccount++], sec, sizeof(struct dvbsec_config)); ++ ++ return 0; ++} ++ ++void syntax() ++{ ++ fprintf(stderr, ++ "Syntax: dvbcfg_test <-zapchannel|-sec> \n"); ++ exit(1); ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvbsec/Makefile dvb-apps/test/libdvbsec/Makefile +--- linuxtv-dvb-apps-1.1.1/test/libdvbsec/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvbsec/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,12 @@ ++# Makefile for linuxtv.org dvb-apps/test/libdvbsec ++ ++binaries = dvbsec_test ++ ++CPPFLAGS += -I../../lib ++LDLIBS += ../../lib/libdvbsec/libdvbsec.a ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libdvbsec/test_sec.txt dvb-apps/test/libdvbsec/test_sec.txt +--- linuxtv-dvb-apps-1.1.1/test/libdvbsec/test_sec.txt 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libdvbsec/test_sec.txt 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,28 @@ ++[sec] ++name=test1 ++switch-frequency=100000 ++lof-lo-v=20 ++lof-lo-h=30 ++lof-lo-l=40 ++lof-lo-r=50 ++lof-hi-v=60 ++lof-hi-h=70 ++lof-hi-l=80 ++lof-hi-r=90 ++config-type=none ++ ++[sec] ++name=test2 ++switch-frequency=200 ++lof-lo-v=40 ++lof-hi-h=50 ++config-type=simple ++ ++[sec] ++name=test3 ++switch-frequency=100000 ++lof-lo-l=20 ++lof-hi-r=30 ++config-type=advanced ++cmd-lo-v=MOOVH ++cmd-lo-h=MOOLH +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libesg/Makefile dvb-apps/test/libesg/Makefile +--- linuxtv-dvb-apps-1.1.1/test/libesg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libesg/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,12 @@ ++# Makefile for linuxtv.org dvb-apps/test/libucsi ++ ++binaries = testesg ++ ++CPPFLAGS += -I../../lib ++LDLIBS += ../../lib/libesg/libesg.a ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libesg/samples/ESGProviderDiscoveryDescriptor.xml dvb-apps/test/libesg/samples/ESGProviderDiscoveryDescriptor.xml +--- linuxtv-dvb-apps-1.1.1/test/libesg/samples/ESGProviderDiscoveryDescriptor.xml 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libesg/samples/ESGProviderDiscoveryDescriptor.xml 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,13 @@ ++ ++ ++ ++ http://www.sidsa.com ++ SIDSA (Multiple Stream) ++ 1 ++ ++ ++ http://www.sidsa.com ++ SIDSA (Single Stream) ++ 2 ++ ++ +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libesg/testesg.c dvb-apps/test/libesg/testesg.c +--- linuxtv-dvb-apps-1.1.1/test/libesg/testesg.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libesg/testesg.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,563 @@ ++/* ++ * ESG parser ++ * ++ * Copyright (C) 2006 Stephane Este-Gracias (sestegra@free.fr) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MAX_FILENAME 256 ++ ++void usage(void) { ++ static const char *_usage = ++ "Usage: testesg [-a ]\n" ++ " [-c ]\n" ++ " [-X XXXX]\n"; ++ ++ fprintf(stderr, "%s", _usage); ++ exit(1); ++} ++ ++void read_from_file(const char *filename, char **buffer, int *size) { ++ int fd; ++ struct stat fs; ++ ++ if ((fd = open(filename, O_RDONLY)) <= 0) { ++ fprintf(stderr, "File not found\n"); ++ exit(1); ++ } ++ ++ if (fstat(fd, &fs) < 0) { ++ fprintf(stderr, "File not readable\n"); ++ exit(1); ++ } ++ *size = fs.st_size; ++ ++ *buffer = (char *) malloc(*size); ++ if (read(fd, *buffer, *size) != *size) { ++ fprintf(stderr, "File read error\n"); ++ exit(1); ++ } ++ ++ close(fd); ++ ++ return; ++} ++ ++int main(int argc, char *argv[]) { ++ char access_descriptor_filename[MAX_FILENAME] = ""; ++ char container_filename[MAX_FILENAME] = ""; ++ int c; ++ char *buffer = NULL; ++ int size; ++ ++ // Read command line options ++ while ((c = getopt(argc, argv, "a:c:")) != -1) { ++ switch (c) { ++ case 'a': ++ strncpy(access_descriptor_filename, optarg, MAX_FILENAME); ++ break; ++ case 'c': ++ strncpy(container_filename, optarg, MAX_FILENAME); ++ break; ++ default: ++ usage(); ++ } ++ } ++ ++ // ESGAccessDescriptor ++ if (strncmp(access_descriptor_filename, "", MAX_FILENAME) != 0) { ++ fprintf(stdout, "**************************************************\n"); ++ fprintf(stdout, "Reading ESG Access Descriptor = %s\n", access_descriptor_filename); ++ fprintf(stdout, "**************************************************\n\n"); ++ ++ read_from_file(access_descriptor_filename, &buffer, &size); ++ ++ struct esg_access_descriptor *access_descriptor = esg_access_descriptor_decode((uint8_t *) buffer, size); ++ free(buffer); ++ if (access_descriptor == NULL) { ++ fprintf(stderr, "ESG Access Descriptor decode error\n"); ++ exit(1); ++ } ++ fprintf(stdout, "n_o_ESGEntries %d\n\n", access_descriptor->n_o_entries); ++ ++ struct esg_entry *entry; ++ esg_access_descriptor_entry_list_for_each(access_descriptor, entry) { ++ fprintf(stdout, " ESGEntryVersion %d\n", entry->version); ++ fprintf(stdout, " MultipleStreamTransport %d\n", entry->multiple_stream_transport); ++ fprintf(stdout, " IPVersion6 %d\n", entry->ip_version_6); ++ fprintf(stdout, " ProviderID %d\n", entry->provider_id); ++ if (entry->ip_version_6 == 0) { ++ fprintf(stdout, " SourceIPAddress %d.%d.%d.%d\n", ++ entry->source_ip.ipv4[0], ++ entry->source_ip.ipv4[1], ++ entry->source_ip.ipv4[2], ++ entry->source_ip.ipv4[3]); ++ fprintf(stdout, " DestinationIPAddress %d.%d.%d.%d\n", ++ entry->destination_ip.ipv4[0], ++ entry->destination_ip.ipv4[1], ++ entry->destination_ip.ipv4[2], ++ entry->destination_ip.ipv4[3]); ++ } else if (entry->ip_version_6 == 1) { ++ fprintf(stdout, " SourceIPAddress %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", ++ entry->source_ip.ipv6[0], ++ entry->source_ip.ipv6[1], ++ entry->source_ip.ipv6[2], ++ entry->source_ip.ipv6[3], ++ entry->source_ip.ipv6[4], ++ entry->source_ip.ipv6[5], ++ entry->source_ip.ipv6[6], ++ entry->source_ip.ipv6[7], ++ entry->source_ip.ipv6[8], ++ entry->source_ip.ipv6[9], ++ entry->source_ip.ipv6[10], ++ entry->source_ip.ipv6[11], ++ entry->source_ip.ipv6[12], ++ entry->source_ip.ipv6[13], ++ entry->source_ip.ipv6[14], ++ entry->source_ip.ipv6[15]); ++ fprintf(stdout, " DestinationIPAddress %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", ++ entry->destination_ip.ipv6[0], ++ entry->destination_ip.ipv6[1], ++ entry->destination_ip.ipv6[2], ++ entry->destination_ip.ipv6[3], ++ entry->destination_ip.ipv6[4], ++ entry->destination_ip.ipv6[5], ++ entry->destination_ip.ipv6[6], ++ entry->destination_ip.ipv6[7], ++ entry->destination_ip.ipv6[8], ++ entry->destination_ip.ipv6[9], ++ entry->destination_ip.ipv6[10], ++ entry->destination_ip.ipv6[11], ++ entry->destination_ip.ipv6[12], ++ entry->destination_ip.ipv6[13], ++ entry->destination_ip.ipv6[14], ++ entry->destination_ip.ipv6[15]); ++ } ++ fprintf(stdout, "Port %d\n", entry->port); ++ fprintf(stdout, "TSI %d\n", entry->tsi); ++ fprintf(stdout, "\n"); ++ } ++ } ++ ++ // ESGContainer ++ if (strncmp(container_filename, "", MAX_FILENAME) != 0) { ++ fprintf(stdout, "**************************************************\n"); ++ fprintf(stdout, "Reading ESG Container = %s\n", container_filename); ++ fprintf(stdout, "**************************************************\n\n"); ++ ++ read_from_file(container_filename, &buffer, &size); ++ ++ struct esg_container *container = esg_container_decode((uint8_t *) buffer, size); ++ free(buffer); ++ if (container == NULL) { ++ fprintf(stderr, "ESG Container decode error\n"); ++ exit(1); ++ } ++ if (container->header == NULL) { ++ fprintf(stderr, "ESG Container no header found\n"); ++ exit(1); ++ } ++ ++ struct esg_encapsulation_structure *fragment_management_information = NULL; ++ struct esg_data_repository *data_repository = NULL; ++ struct esg_string_repository *string_repository = NULL; ++ struct esg_container_structure *structure = NULL; ++ struct esg_init_message *init_message = NULL; ++ struct esg_textual_encoding_parameters *textual_encoding_parameters = NULL; ++ struct esg_textual_decoder_init *textual_decoder_init = NULL; ++ struct esg_namespace_prefix *namespace_prefix = NULL; ++ struct esg_xml_fragment_type *xml_fragment_type = NULL; ++ struct esg_bim_encoding_parameters *bim_encoding_parameters = NULL; ++ struct esg_bim_decoder_init *bim_decoder_init = NULL; ++ struct esg_session_partition_declaration *partition = NULL; ++ struct esg_session_field *field = NULL; ++ struct esg_session_ip_stream *ip_stream = NULL; ++ struct esg_session_ip_stream_field *ip_stream_field = NULL; ++ esg_container_header_structure_list_for_each(container->header, structure) { ++ fprintf(stdout, " structure_type %d [0x%02x]\n", structure->type, structure->type); ++ fprintf(stdout, " structure_id %d [0x%02x]\n", structure->id, structure->id); ++ fprintf(stdout, " structure_ptr %d\n", structure->ptr); ++ fprintf(stdout, " structure_length %d\n\n", structure->length); ++ switch (structure->type) { ++ case 0x01: { ++ switch (structure->id) { ++ case 0x00: { ++ fprintf(stdout, " ESG Fragment Management Information\n"); ++ ++ fragment_management_information = (struct esg_encapsulation_structure *) structure->data; ++ if (fragment_management_information == NULL) { ++ fprintf(stderr, "ESG Fragment Management Information decode error\n"); ++ exit(1); ++ } ++ ++ fprintf(stdout, " fragment_reference_format %d [0x%02x]\n\n", fragment_management_information->header->fragment_reference_format, fragment_management_information->header->fragment_reference_format); ++ ++ struct esg_encapsulation_entry *entry; ++ esg_encapsulation_structure_entry_list_for_each(fragment_management_information, entry) { ++ fprintf(stdout, " fragment_type %d [0x%02x]\n", entry->fragment_reference->fragment_type, entry->fragment_reference->fragment_type); ++ fprintf(stdout, " data_repository_offset %d\n", entry->fragment_reference->data_repository_offset); ++ fprintf(stdout, " fragment_version %d\n", entry->fragment_version); ++ fprintf(stdout, " fragment_id %d\n\n", entry->fragment_id); ++ } ++ ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_id\n"); ++ } ++ } ++ break; ++ } ++ case 0x02: { ++ switch (structure->id) { ++ case 0x00: { ++ fprintf(stdout, " ESG String Repository / "); ++ ++ string_repository = (struct esg_string_repository *) structure->data; ++ if (string_repository == NULL) { ++ fprintf(stderr, "ESG String Repository decode error\n"); ++ exit(1); ++ } ++ ++ fprintf(stdout, "encoding_type %d / length %d\n\n", string_repository->encoding_type, string_repository->length); ++ ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_id\n"); ++ } ++ } ++ break; ++ } ++ case 0x03: { ++ //TODO ++ break; ++ } ++ case 0x04: { ++ //TODO ++ break; ++ } ++ case 0x05: { ++ //TODO ++ break; ++ } ++ case 0xE0: { ++ switch (structure->id) { ++ case 0x00: { ++ fprintf(stdout, " ESG Data Repository / "); ++ ++ data_repository = (struct esg_data_repository *) structure->data; ++ if (data_repository == NULL) { ++ fprintf(stderr, "ESG Data Repository decode error\n"); ++ exit(1); ++ } ++ ++ fprintf(stdout, "length %d\n\n", data_repository->length); ++ ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_id\n"); ++ } ++ } ++ break; ++ } ++ case 0xE1: { ++ switch (structure->id) { ++ case 0xFF: { ++ fprintf(stdout, " ESG Session Partition Declaration\n"); ++ ++ partition = (struct esg_session_partition_declaration *) structure->data; ++ fprintf(stdout, " num_fields %d\n", partition->num_fields); ++ fprintf(stdout, " overlapping %d\n\n", partition->overlapping); ++ esg_session_partition_declaration_field_list_for_each(partition, field) { ++ fprintf(stdout, " identifier %d\n", field->identifier); ++ fprintf(stdout, " encoding %d\n",field->encoding); ++ fprintf(stdout, " length %d\n\n",field->length); ++ } ++ fprintf(stdout, " n_o_IPStreams %d\n", partition->n_o_ip_streams); ++ fprintf(stdout, " IPVersion6 %d\n\n", partition->ip_version_6); ++ esg_session_partition_declaration_ip_stream_list_for_each(partition, ip_stream) { ++ fprintf(stdout, " IPStreamID %d\n", ip_stream->id); ++ if (partition->ip_version_6 == 0) { ++ fprintf(stdout, " SourceIPAddress %d.%d.%d.%d\n", ++ ip_stream->source_ip.ipv4[0], ++ ip_stream->source_ip.ipv4[1], ++ ip_stream->source_ip.ipv4[2], ++ ip_stream->source_ip.ipv4[3]); ++ fprintf(stdout, " DestinationIPAddress %d.%d.%d.%d\n", ++ ip_stream->destination_ip.ipv4[0], ++ ip_stream->destination_ip.ipv4[1], ++ ip_stream->destination_ip.ipv4[2], ++ ip_stream->destination_ip.ipv4[3]); ++ } else if (partition->ip_version_6 == 1) { ++ fprintf(stdout, " SourceIPAddress %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", ++ ip_stream->source_ip.ipv6[0], ++ ip_stream->source_ip.ipv6[1], ++ ip_stream->source_ip.ipv6[2], ++ ip_stream->source_ip.ipv6[3], ++ ip_stream->source_ip.ipv6[4], ++ ip_stream->source_ip.ipv6[5], ++ ip_stream->source_ip.ipv6[6], ++ ip_stream->source_ip.ipv6[7], ++ ip_stream->source_ip.ipv6[8], ++ ip_stream->source_ip.ipv6[9], ++ ip_stream->source_ip.ipv6[10], ++ ip_stream->source_ip.ipv6[11], ++ ip_stream->source_ip.ipv6[12], ++ ip_stream->source_ip.ipv6[13], ++ ip_stream->source_ip.ipv6[14], ++ ip_stream->source_ip.ipv6[15]); ++ fprintf(stdout, " DestinationIPAddress %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", ++ ip_stream->destination_ip.ipv6[0], ++ ip_stream->destination_ip.ipv6[1], ++ ip_stream->destination_ip.ipv6[2], ++ ip_stream->destination_ip.ipv6[3], ++ ip_stream->destination_ip.ipv6[4], ++ ip_stream->destination_ip.ipv6[5], ++ ip_stream->destination_ip.ipv6[6], ++ ip_stream->destination_ip.ipv6[7], ++ ip_stream->destination_ip.ipv6[8], ++ ip_stream->destination_ip.ipv6[9], ++ ip_stream->destination_ip.ipv6[10], ++ ip_stream->destination_ip.ipv6[11], ++ ip_stream->destination_ip.ipv6[12], ++ ip_stream->destination_ip.ipv6[13], ++ ip_stream->destination_ip.ipv6[14], ++ ip_stream->destination_ip.ipv6[15]); ++ } ++ fprintf(stdout, " Port %d\n", ip_stream->port); ++ fprintf(stdout, " SessionID %d\n", ip_stream->session_id); ++ ++ field = partition->field_list; ++ esg_session_ip_stream_field_list_for_each(ip_stream, ip_stream_field) { ++ switch (field->encoding) { ++ case 0x0000: { ++ if (ip_stream_field->start_field_value != NULL) { ++ fprintf(stdout, " start_field_value %s\n", ip_stream_field->start_field_value->string); ++ } ++ fprintf(stdout, " end_field_value %s\n", ip_stream_field->end_field_value->string); ++ break; ++ } ++ case 0x0101: { ++ if (ip_stream_field->start_field_value != NULL) { ++ fprintf(stdout, " start_field_value %d\n", ip_stream_field->start_field_value->unsigned_short); ++ } ++ fprintf(stdout, " end_field_value %d\n", ip_stream_field->end_field_value->unsigned_short); ++ break; ++ } ++ } ++ ++ field = field->_next; ++ } ++ fprintf(stdout, "\n"); ++ } ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_id\n"); ++ } ++ } ++ break; ++ } ++ case 0xE2: { ++ switch (structure->id) { ++ case 0x00: { ++ fprintf(stdout, " ESG Init Message\n"); ++ ++ init_message = (struct esg_init_message *) structure->data; ++ if (init_message == NULL) { ++ fprintf(stderr, "ESG Init Message decode error\n"); ++ exit(1); ++ } ++ ++ fprintf(stdout, " EncodingVersion %d [0x%02x]\n", init_message->encoding_version, init_message->encoding_version); ++ fprintf(stdout, " IndexingFlag %d\n", init_message->indexing_flag); ++ fprintf(stdout, " DecoderInitptr %d\n", init_message->decoder_init_ptr); ++ if (init_message->indexing_flag) { ++ fprintf(stdout, " IndexingVersion %d\n", init_message->indexing_version); ++ } ++ ++ switch (init_message->encoding_version) { ++ case 0xF1: { ++ bim_encoding_parameters = (struct esg_bim_encoding_parameters *) init_message->encoding_parameters; ++ if (bim_encoding_parameters == NULL) { ++ fprintf(stderr, "ESG Init Message decode error / bim_encoding_parameters\n"); ++ exit(1); ++ } ++ fprintf(stdout, " BufferSizeFlag %d\n", bim_encoding_parameters->buffer_size_flag); ++ fprintf(stdout, " PositionCodeFlag %d\n", bim_encoding_parameters->position_code_flag); ++ fprintf(stdout, " CharacterEncoding %d\n", bim_encoding_parameters->character_encoding); ++ if (bim_encoding_parameters->buffer_size_flag) { ++ fprintf(stdout, " BufferSize %d\n", bim_encoding_parameters->buffer_size); ++ } ++ ++ // TODO BimDecoderInit ++ break; ++ } ++ case 0xF2: ++ case 0xF3: { ++ textual_encoding_parameters = (struct esg_textual_encoding_parameters *) init_message->encoding_parameters; ++ if (textual_encoding_parameters == NULL) { ++ fprintf(stderr, "ESG Init Message decode error / textual_encoding_parameters\n"); ++ exit(1); ++ } ++ fprintf(stdout, " CharacterEncoding %d\n\n", textual_encoding_parameters->character_encoding); ++ ++ // TextualDecoderInit ++ textual_decoder_init = (struct esg_textual_decoder_init *) init_message->decoder_init; ++ if (textual_decoder_init == NULL) { ++ fprintf(stderr, "ESG Init Message decode error / textual_decoder_init\n"); ++ exit(1); ++ } ++ fprintf(stdout, " Textual DecoderInit\n"); ++ fprintf(stdout, " num_namespaces_prefixes %d\n\n", textual_decoder_init->num_namespace_prefixes); ++ esg_textual_decoder_namespace_prefix_list_for_each(textual_decoder_init, namespace_prefix) { ++ fprintf(stdout, " prefix_string_ptr %d\n", namespace_prefix->prefix_string_ptr); ++ fprintf(stdout, " namespace_URI_ptr %d\n\n", namespace_prefix->namespace_uri_ptr); ++ } ++ fprintf(stdout, " num_fragment_types %d\n\n", textual_decoder_init->num_fragment_types); ++ esg_textual_decoder_xml_fragment_type_list_for_each(textual_decoder_init, xml_fragment_type) { ++ fprintf(stdout, " xpath_ptr %d\n", xml_fragment_type->xpath_ptr); ++ fprintf(stdout, " ESG_XML_fragment_type %d\n\n", xml_fragment_type->xml_fragment_type); ++ } ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown EncodingVersion\n"); ++ } ++ } ++ ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_id\n"); ++ } ++ } ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown structure_type\n"); ++ } ++ } ++ } ++ fprintf(stdout, "\n"); ++ ++ fprintf(stdout, "structure_body_ptr %d\n", container->structure_body_ptr); ++ fprintf(stdout, "structure_body_length %d\n\n", container->structure_body_length); ++ ++ // ESG XML Fragment ++ if (fragment_management_information) { ++ fprintf(stdout, "**************************************************\n"); ++ fprintf(stdout, "ESG XML Fragment\n"); ++ fprintf(stdout, "**************************************************\n\n"); ++ ++ struct esg_encapsulation_entry *entry; ++ esg_encapsulation_structure_entry_list_for_each(fragment_management_information, entry) { ++ switch (entry->fragment_reference->fragment_type) { ++ case 0x00: { ++ if (data_repository) { ++ struct esg_encapsulated_textual_esg_xml_fragment *esg_xml_fragment = esg_encapsulated_textual_esg_xml_fragment_decode(data_repository->data + entry->fragment_reference->data_repository_offset, data_repository->length); ++ ++ fprintf(stdout, "ESG_XML_fragment_type %d\n", esg_xml_fragment->esg_xml_fragment_type); ++ fprintf(stdout, "data_length %d\n", esg_xml_fragment->data_length); ++ fprintf(stdout, "fragment_version %d\n", entry->fragment_version); ++ fprintf(stdout, "fragment_id %d\n\n", entry->fragment_id); ++ char *string = (char *) malloc(esg_xml_fragment->data_length + 1); ++ memcpy(string, esg_xml_fragment->data, esg_xml_fragment->data_length); ++ string[esg_xml_fragment->data_length] = 0; ++ fprintf(stdout, "%s\n", string); ++ ++ } else { ++ fprintf(stderr, "ESG Data Repository not found"); ++ } ++ break; ++ } ++ case 0x01: { ++ // TODO ++ break; ++ } ++ case 0x02: { ++ // TODO ++ break; ++ } ++ default: { ++ } ++ } ++ } ++ } ++ ++ // String ++ if (init_message) { ++ fprintf(stdout, "**************************************************\n"); ++ fprintf(stdout, "String\n"); ++ fprintf(stdout, "**************************************************\n\n"); ++ ++ switch (init_message->encoding_version) { ++ case 0xF1: { ++ // TODO Bim ++ break; ++ } ++ case 0xF2: { ++ // TODO GZIP ++ break; ++ } ++ case 0xF3: { ++ // RAW ++ if (string_repository) { ++ textual_decoder_init = (struct esg_textual_decoder_init *) init_message->decoder_init; ++ esg_textual_decoder_namespace_prefix_list_for_each(textual_decoder_init, namespace_prefix) { ++ fprintf(stdout, "prefix_string_ptr %d\n", namespace_prefix->prefix_string_ptr); ++ fprintf(stdout, "%s\n", string_repository->data + namespace_prefix->prefix_string_ptr); ++ fprintf(stdout, "namespace_URI_ptr %d\n", namespace_prefix->namespace_uri_ptr); ++ fprintf(stdout, "%s\n\n", string_repository->data + namespace_prefix->namespace_uri_ptr - 1); // TODO -1 ++ } ++ ++ esg_textual_decoder_xml_fragment_type_list_for_each(textual_decoder_init, xml_fragment_type) { ++ fprintf(stdout, "xpath_ptr %d\n", xml_fragment_type->xpath_ptr); ++ fprintf(stdout, "ESG_XML_fragment_type %d\n", xml_fragment_type->xml_fragment_type); ++ fprintf(stdout, "%s\n\n", string_repository->data + xml_fragment_type->xpath_ptr - 1); // TODO -1 ++ } ++ } ++ break; ++ } ++ default: { ++ fprintf(stdout, " Unknown EncodingVersion\n"); ++ } ++ } ++ } ++ } ++ ++ return 0; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libucsi/Makefile dvb-apps/test/libucsi/Makefile +--- linuxtv-dvb-apps-1.1.1/test/libucsi/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libucsi/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,13 @@ ++# Makefile for linuxtv.org dvb-apps/test/libucsi ++ ++binaries = testucsi ++ ++CPPFLAGS += -I../../lib ++LDLIBS += ../../lib/libdvbapi/libdvbapi.a ../../lib/libdvbcfg/libdvbcfg.a \ ++ ../../lib/libdvbsec/libdvbsec.a ../../lib/libucsi/libucsi.a ++ ++.PHONY: all ++ ++all: $(binaries) ++ ++include ../../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/libucsi/testucsi.c dvb-apps/test/libucsi/testucsi.c +--- linuxtv-dvb-apps-1.1.1/test/libucsi/testucsi.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/libucsi/testucsi.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,3528 @@ ++/* ++ * section and descriptor parser test/sample application. ++ * ++ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net) ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++void receive_data(int dvrfd, int timeout, int data_type); ++void parse_section(uint8_t *buf, int len, int pid, int data_type); ++void parse_dvb_section(uint8_t *buf, int len, int pid, int data_type, struct section *section); ++void parse_atsc_section(uint8_t *buf, int len, int pid, int data_type, struct section *section); ++void parse_descriptor(struct descriptor *d, int indent, int data_type); ++void parse_dvb_descriptor(struct descriptor *d, int indent, int data_type); ++void parse_atsc_descriptor(struct descriptor *d, int indent, int data_type); ++void iprintf(int indent, char *fmt, ...); ++void hexdump(int indent, char *prefix, uint8_t *buf, int buflen); ++void atsctextdump(char *header, int indent, struct atsc_text *atext, int len); ++int channels_cb(struct dvbcfg_zapchannel *channel, void *private); ++void ts_from_file(char *filename, int data_type); ++ ++#define TIME_CHECK_VAL 1131835761 ++#define DURATION_CHECK_VAL 5643 ++ ++#define MAX_TUNE_TIME 3000 ++#define MAX_DUMP_TIME 60 ++ ++#define DATA_TYPE_MPEG 0 ++#define DATA_TYPE_DVB 1 ++#define DATA_TYPE_ATSC 2 ++ ++ ++struct dvbfe_handle *fe; ++struct dvbfe_info feinfo; ++int demuxfd; ++int dvrfd; ++ ++int main(int argc, char *argv[]) ++{ ++ int adapter; ++ char *channelsfile; ++ int pidlimit = -1; ++ dvbdate_t dvbdate; ++ dvbduration_t dvbduration; ++ ++ // process arguments ++ if ((argc < 3) || (argc > 4)) { ++ fprintf(stderr, "Syntax: testucsi |-atscfile []\n"); ++ exit(1); ++ } ++ if (!strcmp(argv[1], "-atscfile")) { ++ ts_from_file(argv[2], DATA_TYPE_ATSC); ++ exit(0); ++ } ++ adapter = atoi(argv[1]); ++ channelsfile = argv[2]; ++ if (argc == 4) ++ sscanf(argv[3], "%i", &pidlimit); ++ printf("Using adapter %i\n", adapter); ++ ++ // check the dvbdate conversion functions ++ unixtime_to_dvbdate(TIME_CHECK_VAL, dvbdate); ++ if (dvbdate_to_unixtime(dvbdate) != TIME_CHECK_VAL) { ++ fprintf(stderr, "XXXX dvbdate function check failed (%i!=%i)\n", ++ TIME_CHECK_VAL, (int) dvbdate_to_unixtime(dvbdate)); ++ exit(1); ++ } ++ seconds_to_dvbduration(DURATION_CHECK_VAL, dvbduration); ++ if (dvbduration_to_seconds(dvbduration) != DURATION_CHECK_VAL) { ++ fprintf(stderr, "XXXX dvbduration function check failed (%i!=%i)\n", ++ DURATION_CHECK_VAL, (int) dvbduration_to_seconds(dvbduration)); ++ exit(1); ++ } ++ ++ // open the frontend ++ if ((fe = dvbfe_open(adapter, 0, 0)) == NULL) { ++ perror("open frontend"); ++ exit(1); ++ } ++ dvbfe_get_info(fe, 0, &feinfo, DVBFE_INFO_QUERYTYPE_IMMEDIATE, 0); ++ int data_type = DATA_TYPE_MPEG; ++ switch(feinfo.type) { ++ case DVBFE_TYPE_DVBS: ++ case DVBFE_TYPE_DVBC: ++ case DVBFE_TYPE_DVBT: ++ data_type = DATA_TYPE_DVB; ++ break; ++ ++ case DVBFE_TYPE_ATSC: ++ data_type = DATA_TYPE_ATSC; ++ break; ++ } ++ ++ // open demux devices ++ if ((demuxfd = dvbdemux_open_demux(adapter, 0, 0)) < 0) { ++ perror("demux"); ++ exit(1); ++ } ++ if ((dvrfd = dvbdemux_open_dvr(adapter, 0, 1, 1)) < 0) { ++ perror("dvr"); ++ exit(1); ++ } ++ ++ // make the demux buffer a bit larger ++ if (dvbdemux_set_buffer(demuxfd, 1024*1024)) { ++ perror("set buffer"); ++ exit(1); ++ } ++ ++ // setup filter to capture stuff ++ if (dvbdemux_set_pid_filter(demuxfd, pidlimit, DVBDEMUX_INPUT_FRONTEND, DVBDEMUX_OUTPUT_DVR, 1)) { ++ perror("set pid filter"); ++ exit(1); ++ } ++ ++ // process all the channels ++ FILE *channels = fopen(channelsfile, "r"); ++ if (channels == NULL) { ++ fprintf(stderr, "Unable to open %s\n", channelsfile); ++ exit(1); ++ } ++ dvbcfg_zapchannel_parse(channels, channels_cb, (void*) (long) data_type); ++ return 0; ++} ++ ++void ts_from_file(char *filename, int data_type) { ++ int fd = open(filename, O_RDONLY); ++ if (fd < 0) { ++ fprintf(stderr, "Unable to open file %s\n", filename); ++ exit(1); ++ } ++ receive_data(fd, 1000000000, data_type); ++} ++ ++int channels_cb(struct dvbcfg_zapchannel *channel, void *private) ++{ ++ long data_type = (long) private; ++ struct dvbsec_config sec; ++ ++ if (dvbsec_cfg_find(NULL, "UNIVERSAL", &sec)) { ++ fprintf(stderr, "Unable to find SEC id\n"); ++ exit(1); ++ } ++ ++ if (dvbsec_set(fe, ++ &sec, ++ channel->polarization, ++ DISEQC_SWITCH_UNCHANGED, ++ DISEQC_SWITCH_UNCHANGED, ++ &channel->fe_params, ++ MAX_TUNE_TIME)) { ++ fprintf(stderr, "Failed to lock!\n"); ++ } else { ++ printf("Tuned successfully!\n"); ++ receive_data(dvrfd, MAX_DUMP_TIME, data_type); ++ } ++ ++ return 0; ++} ++ ++void receive_data(int _dvrfd, int timeout, int data_type) ++{ ++ unsigned char databuf[TRANSPORT_PACKET_LENGTH*20]; ++ int sz; ++ int pid; ++ int i; ++ int used; ++ int section_status; ++ time_t starttime; ++ unsigned char continuities[TRANSPORT_MAX_PIDS]; ++ struct section_buf *section_bufs[TRANSPORT_MAX_PIDS]; ++ struct transport_packet *tspkt; ++ struct transport_values tsvals; ++ ++ // process the data ++ starttime = time(NULL); ++ memset(continuities, 0, sizeof(continuities)); ++ memset(section_bufs, 0, sizeof(section_bufs)); ++ while((time(NULL) - starttime) < timeout) { ++ // got some! ++ if ((sz = read(_dvrfd, databuf, sizeof(databuf))) < 0) { ++ if (errno == EOVERFLOW) { ++ fprintf(stderr, "data overflow!\n"); ++ continue; ++ } else if (errno == EAGAIN) { ++ usleep(100); ++ continue; ++ } else { ++ perror("read error"); ++ exit(1); ++ } ++ } ++ for(i=0; i < sz; i+=TRANSPORT_PACKET_LENGTH) { ++ // parse the transport packet ++ tspkt = transport_packet_init(databuf + i); ++ if (tspkt == NULL) { ++ fprintf(stderr, "XXXX Bad sync byte\n"); ++ continue; ++ } ++ pid = transport_packet_pid(tspkt); ++ ++ // extract all TS packet values even though we don't need them (to check for ++ // library segfaults etc) ++ if (transport_packet_values_extract(tspkt, &tsvals, 0xffff) < 0) { ++ fprintf(stderr, "XXXX Bad packet received (pid:%04x)\n", pid); ++ continue; ++ } ++ ++ // check continuity ++ if (transport_packet_continuity_check(tspkt, ++ tsvals.flags & transport_adaptation_flag_discontinuity, ++ continuities + pid)) { ++ fprintf(stderr, "XXXX Continuity error (pid:%04x)\n", pid); ++ continuities[pid] = 0; ++ if (section_bufs[pid] != NULL) { ++ section_buf_reset(section_bufs[pid]); ++ } ++ continue; ++ } ++ ++ // allocate section buf if we don't have one already ++ if (section_bufs[pid] == NULL) { ++ section_bufs[pid] = (struct section_buf*) ++ malloc(sizeof(struct section_buf) + DVB_MAX_SECTION_BYTES); ++ if (section_bufs[pid] == NULL) { ++ fprintf(stderr, "Failed to allocate section buf (pid:%04x)\n", pid); ++ exit(1); ++ } ++ section_buf_init(section_bufs[pid], DVB_MAX_SECTION_BYTES); ++ } ++ ++ // process the payload data as a section ++ while(tsvals.payload_length) { ++ used = section_buf_add_transport_payload(section_bufs[pid], ++ tsvals.payload, ++ tsvals.payload_length, ++ tspkt->payload_unit_start_indicator, ++ §ion_status); ++ tspkt->payload_unit_start_indicator = 0; ++ tsvals.payload_length -= used; ++ tsvals.payload += used; ++ ++ if (section_status == 1) { ++ parse_section(section_buf_data(section_bufs[pid]), ++ section_bufs[pid]->len, pid, data_type); ++ section_buf_reset(section_bufs[pid]); ++ } else if (section_status < 0) { ++ // some kind of error - just discard ++ fprintf(stderr, "XXXX bad section %04x %i\n",pid, section_status); ++ section_buf_reset(section_bufs[pid]); ++ } ++ } ++ } ++ } ++} ++ ++void parse_section(uint8_t *buf, int len, int pid, int data_type) ++{ ++ struct section *section; ++ struct section_ext *section_ext = NULL; ++ ++ if ((section = section_codec(buf, len)) == NULL) { ++ return; ++ } ++ ++ switch(section->table_id) { ++ case stag_mpeg_program_association: ++ { ++ struct mpeg_pat_section *pat; ++ struct mpeg_pat_program *cur; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode PAT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((pat = mpeg_pat_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX PAT section decode error\n"); ++ return; ++ } ++ printf("SCT transport_stream_id:0x%04x\n", mpeg_pat_section_transport_stream_id(pat)); ++ mpeg_pat_section_programs_for_each(pat, cur) { ++ printf("\tSCT program_number:0x%04x pid:0x%04x\n", cur->program_number, cur->pid); ++ } ++ break; ++ } ++ ++ case stag_mpeg_conditional_access: ++ { ++ struct mpeg_cat_section *cat; ++ struct descriptor *curd; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode CAT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((cat = mpeg_cat_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX CAT section decode error\n"); ++ return; ++ } ++ mpeg_cat_section_descriptors_for_each(cat, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ break; ++ } ++ ++ case stag_mpeg_program_map: ++ { ++ struct mpeg_pmt_section *pmt; ++ struct descriptor *curd; ++ struct mpeg_pmt_stream *cur_stream; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode PMT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((pmt = mpeg_pmt_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX PMT section decode error\n"); ++ return; ++ } ++ printf("SCT program_number:0x%04x pcr_pid:0x%02x\n", mpeg_pmt_section_program_number(pmt), pmt->pcr_pid); ++ mpeg_pmt_section_descriptors_for_each(pmt, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ mpeg_pmt_section_streams_for_each(pmt, cur_stream) { ++ printf("\tSCT stream_type:0x%02x pid:0x%04x\n", cur_stream->stream_type, cur_stream->pid); ++ mpeg_pmt_stream_descriptors_for_each(cur_stream, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_mpeg_transport_stream_description: ++ { ++ struct mpeg_tsdt_section *tsdt; ++ struct descriptor *curd; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode TSDT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((tsdt = mpeg_tsdt_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX TSDT section decode error\n"); ++ return; ++ } ++ mpeg_tsdt_section_descriptors_for_each(tsdt, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ case stag_mpeg_metadata: ++ { ++ struct mpeg_metadata_section *metadata; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode metadata (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((metadata = mpeg_metadata_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX metadata section decode error\n"); ++ return; ++ } ++ printf("SCT random_access_indicator:%i decoder_config_flag:%i fragment_indicator:%i service_id:%02x\n", ++ mpeg_metadata_section_random_access_indicator(metadata), ++ mpeg_metadata_section_decoder_config_flag(metadata), ++ mpeg_metadata_section_fragment_indicator(metadata), ++ mpeg_metadata_section_service_id(metadata)); ++ hexdump(0, "SCT ", mpeg_metadata_section_data(metadata), mpeg_metadata_section_data_length(metadata)); ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ case stag_mpeg_iso14496_scene_description: ++ case stag_mpeg_iso14496_object_description: ++ { ++ struct mpeg_odsmt_section *odsmt; ++ struct mpeg_odsmt_stream *cur_stream; ++ struct descriptor *curd; ++ int _index; ++ uint8_t *objects; ++ size_t objects_length; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode ISO14496 (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((odsmt = mpeg_odsmt_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "XXXX ISO14496 section decode error\n"); ++ return; ++ } ++ printf("SCT PID:0x%04x\n", mpeg_odsmt_section_pid(odsmt)); ++ mpeg_odsmt_section_streams_for_each(osdmt, cur_stream, _index) { ++ if (odsmt->stream_count == 0) { ++ printf("\tSCT SINGLE 0x%04x\n", cur_stream->u.single.esid); ++ } else { ++ printf("\tSCT MULTI 0x%04x 0x%02x\n", cur_stream->u.multi.esid, cur_stream->u.multi.fmc); ++ } ++ mpeg_odsmt_stream_descriptors_for_each(osdmt, cur_stream, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ objects = mpeg_odsmt_section_object_descriptors(odsmt, &objects_length); ++ if (objects == NULL) { ++ printf("SCT XXXX OSDMT parse error\n"); ++ break; ++ } ++ hexdump(1, "SCT ", objects, objects_length); ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ default: ++ switch(data_type) { ++ case DATA_TYPE_DVB: ++ parse_dvb_section(buf, len, pid, data_type, section); ++ break; ++ ++ case DATA_TYPE_ATSC: ++ parse_atsc_section(buf, len, pid, data_type, section); ++ break; ++ ++ default: ++ fprintf(stderr, "SCT XXXX Unknown table_id:0x%02x (pid:0x%04x)\n", ++ section->table_id, pid); ++// hexdump(0, "SCT ", buf, len); ++ return; ++ } ++ } ++ ++ printf("\n"); ++} ++ ++void parse_dvb_section(uint8_t *buf, int len, int pid, int data_type, struct section *section) ++{ ++ struct section_ext *section_ext = NULL; ++ ++ switch(section->table_id) { ++ case stag_dvb_network_information_actual: ++ case stag_dvb_network_information_other: ++ { ++ struct dvb_nit_section *nit; ++ struct descriptor *curd; ++ struct dvb_nit_section_part2 *part2; ++ struct dvb_nit_transport *cur_transport; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode NIT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((nit = dvb_nit_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX NIT section decode error\n"); ++ return; ++ } ++ printf("SCT network_id:0x%04x\n", dvb_nit_section_network_id(nit)); ++ dvb_nit_section_descriptors_for_each(nit, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ part2 = dvb_nit_section_part2(nit); ++ dvb_nit_section_transports_for_each(nit, part2, cur_transport) { ++ printf("\tSCT transport_stream_id:0x%04x original_network_id:0x%04x\n", cur_transport->transport_stream_id, cur_transport->original_network_id); ++ dvb_nit_transport_descriptors_for_each(cur_transport, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_dvb_service_description_actual: ++ case stag_dvb_service_description_other: ++ { ++ struct dvb_sdt_section *sdt; ++ struct dvb_sdt_service *cur_service; ++ struct descriptor *curd; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode SDT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((sdt = dvb_sdt_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "XXXX SDT section decode error\n"); ++ return; ++ } ++ printf("SCT transport_stream_id:0x%04x original_network_id:0x%04x\n", dvb_sdt_section_transport_stream_id(sdt), sdt->original_network_id); ++ dvb_sdt_section_services_for_each(sdt, cur_service) { ++ printf("\tSCT service_id:0x%04x eit_schedule_flag:%i eit_present_following_flag:%i running_status:%i free_ca_mode:%i\n", ++ cur_service->service_id, ++ cur_service->eit_schedule_flag, ++ cur_service->eit_present_following_flag, ++ cur_service->running_status, ++ cur_service->free_ca_mode); ++ dvb_sdt_service_descriptors_for_each(cur_service, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_dvb_bouquet_association: ++ { ++ struct dvb_bat_section *bat; ++ struct descriptor *curd; ++ struct dvb_bat_section_part2 *part2; ++ struct dvb_bat_transport *cur_transport; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode BAT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((bat = dvb_bat_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX BAT section decode error\n"); ++ return; ++ } ++ printf("SCT bouquet_id:0x%04x\n", dvb_bat_section_bouquet_id(bat)); ++ dvb_bat_section_descriptors_for_each(bat, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ part2 = dvb_bat_section_part2(bat); ++ dvb_bat_section_transports_for_each(part2, cur_transport) { ++ printf("\tSCT transport_stream_id:0x%04x original_network_id:0x%04x\n", ++ cur_transport->transport_stream_id, ++ cur_transport->original_network_id); ++ dvb_bat_transport_descriptors_for_each(cur_transport, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_dvb_update_notification: ++ case stag_dvb_ip_mac_notification: ++ { ++ struct dvb_int_section *_int; ++ struct descriptor *curd; ++ struct dvb_int_target *cur_target; ++ struct dvb_int_operational_loop *operational_loop; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode INT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((_int = dvb_int_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "XXXX INT section decode error\n"); ++ return; ++ } ++ printf("SCT action_type:0x%02x platform_id_hash:0x%02x platform_id:0x%06x processing_order:0x%02x\n", ++ dvb_int_section_action_type(_int), ++ dvb_int_section_platform_id_hash(_int), ++ _int->platform_id, ++ _int->processing_order); ++ dvb_int_section_platform_descriptors_for_each(_int, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ dvb_int_section_target_loop_for_each(_int, cur_target) { ++ dvb_int_target_target_descriptors_for_each(cur_target, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ operational_loop = dvb_int_target_operational_loop(cur_target); ++ dvb_int_operational_loop_operational_descriptors_for_each(operational_loop, curd) { ++ parse_descriptor(curd, 3, data_type); ++ } ++ } ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ case stag_dvb_event_information_nownext_actual: ++ case stag_dvb_event_information_nownext_other: ++ case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: ++ case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: ++ case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: ++ case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: ++ { ++ struct dvb_eit_section *eit; ++ struct dvb_eit_event *cur_event; ++ struct descriptor *curd; ++ time_t start_time; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode EIT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((eit = dvb_eit_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "XXXX EIT section decode error\n"); ++ return; ++ } ++ printf("SCT service_id:0x%04x transport_stream_id:0x%04x original_network_id:0x%04x segment_last_section_number:0x%02x last_table_id:0x%02x\n", ++ dvb_eit_section_service_id(eit), ++ eit->transport_stream_id, ++ eit->original_network_id, ++ eit->segment_last_section_number, ++ eit->last_table_id); ++ dvb_eit_section_events_for_each(eit, cur_event) { ++ start_time = dvbdate_to_unixtime(cur_event->start_time); ++ printf("\tSCT event_id:0x%04x duration:%i running_status:%i free_ca_mode:%i start_time:%i -- %s", ++ cur_event->event_id, ++ dvbduration_to_seconds(cur_event->duration), ++ cur_event->running_status, ++ cur_event->free_ca_mode, ++ (int) start_time, ++ ctime(&start_time)); ++ dvb_eit_event_descriptors_for_each(cur_event, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_dvb_time_date: ++ { ++ struct dvb_tdt_section *tdt; ++ time_t dvbtime; ++ ++ printf("SCT Decode TDT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((tdt = dvb_tdt_section_codec(section)) == NULL) { ++ fprintf(stderr, "XXXX TDT section decode error\n"); ++ return; ++ } ++ dvbtime = dvbdate_to_unixtime(tdt->utc_time); ++ printf("SCT Time: %i -- %s", (int) dvbtime, ctime(&dvbtime)); ++ break; ++ } ++ ++ case stag_dvb_running_status: ++ { ++ struct dvb_rst_section *rst; ++ struct dvb_rst_status *cur_status; ++ ++ printf("SCT Decode RST (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((rst = dvb_rst_section_codec(section)) == NULL) { ++ fprintf(stderr, "SCT XXXX RST section decode error\n"); ++ return; ++ } ++ dvb_rst_section_statuses_for_each(rst, cur_status) { ++ printf("\tSCT transport_stream_id:0x%04x original_network_id:0x%04x service_id:0x%04x event_id:0x%04x running_status:%i\n", ++ cur_status->transport_stream_id, ++ cur_status->original_network_id, ++ cur_status->service_id, ++ cur_status->event_id, ++ cur_status->running_status); ++ } ++ ++// hexdump(0, "SCT ", buf, len); ++// getchar(); ++ break; ++ } ++ ++ case stag_dvb_stuffing: ++ { ++ struct dvb_st_section *st; ++ ++ printf("SCT Decode ST (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((st = dvb_st_section_codec(section)) == NULL) { ++ fprintf(stderr, "SCT XXXX ST section decode error\n"); ++ return; ++ } ++ printf("SCT Length: %i\n", dvb_st_section_data_length(st)); ++ break; ++ } ++ ++ case stag_dvb_time_offset: ++ { ++ struct dvb_tot_section *tot; ++ struct descriptor *curd; ++ time_t dvbtime; ++ ++ if (section_check_crc(section)) ++ return; ++ printf("SCT Decode TOT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((tot = dvb_tot_section_codec(section)) == NULL) { ++ fprintf(stderr, "SCT XXXX TOT section decode error\n"); ++ return; ++ } ++ dvbtime = dvbdate_to_unixtime(tot->utc_time); ++ printf("SCT utc_time: %i -- %s", (int) dvbtime, ctime(&dvbtime)); ++ dvb_tot_section_descriptors_for_each(tot, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ break; ++ } ++ ++ case stag_dvb_tva_container: ++ { ++ struct dvb_tva_container_section *tva; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode tva (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((tva = dvb_tva_container_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX tva section decode error\n"); ++ return; ++ } ++ printf("SCT container_id:%04x\n", ++ dvb_tva_container_section_container_id(tva)); ++ hexdump(0, "SCT ", dvb_tva_container_section_data(tva), dvb_tva_container_section_data_length(tva)); ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ case stag_dvb_discontinuity_information: ++ { ++ struct dvb_dit_section *dit; ++ ++ printf("SCT Decode DIT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((dit = dvb_dit_section_codec(section)) == NULL) { ++ fprintf(stderr, "SCT XXXX DIT section decode error\n"); ++ return; ++ } ++ printf("SCT transition_flag:%i\n", dit->transition_flag); ++ ++// hexdump(0, "SCT ", buf, len); ++// getchar(); ++ break; ++ } ++ ++ case stag_dvb_selection_information: ++ { ++ struct dvb_sit_section *sit; ++ struct descriptor *curd; ++ struct dvb_sit_service *cur_service; ++ ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ printf("SCT Decode SIT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((sit = dvb_sit_section_codec(section_ext)) == NULL) { ++ fprintf(stderr, "SCT XXXX SIT section decode error\n"); ++ return; ++ } ++ dvb_sit_section_descriptors_for_each(sit, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ dvb_sit_section_services_for_each(sit, cur_service) { ++ printf("\tSCT service_id:0x%04x running_status:%i\n", cur_service->service_id, cur_service->running_status); ++ dvb_sit_service_descriptors_for_each(cur_service, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ default: ++ fprintf(stderr, "SCT XXXX Unknown table_id:0x%02x (pid:0x%04x)\n", section->table_id, pid); ++// hexdump(0, "SCT ", buf, len); ++ return; ++ } ++} ++ ++void parse_atsc_section(uint8_t *buf, int len, int pid, int data_type, struct section *section) ++{ ++ struct section_ext *section_ext = NULL; ++ struct atsc_section_psip *section_psip = NULL; ++ if ((section_ext = section_ext_decode(section, 1)) == NULL) { ++ return; ++ } ++ if ((section_psip = atsc_section_psip_decode(section_ext)) == NULL) { ++ return; ++ } ++ ++ printf("SCT protocol_version:%i\n", section_psip->protocol_version); ++ ++ switch(section->table_id) { ++ case stag_atsc_master_guide: ++ { ++ struct atsc_mgt_section *mgt; ++ struct atsc_mgt_table *cur_table; ++ struct atsc_mgt_section_part2 *part2; ++ struct descriptor *curd; ++ int idx; ++ ++ printf("SCT Decode MGT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((mgt = atsc_mgt_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX MGT section decode error\n"); ++ return; ++ } ++ atsc_mgt_section_tables_for_each(mgt, cur_table, idx) { ++ printf("\tSCT table_type:0x%04x table_type_PID:%04x table_type_version_number:%i number_bytes:%i\n", ++ cur_table->table_type, ++ cur_table->table_type_PID, ++ cur_table->table_type_version_number, ++ cur_table->number_bytes); ++ atsc_mgt_table_descriptors_for_each(cur_table, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ ++ part2 = atsc_mgt_section_part2(mgt); ++ atsc_mgt_section_part2_descriptors_for_each(part2, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ break; ++ } ++ ++ case stag_atsc_terrestrial_virtual_channel: ++ { ++ struct atsc_tvct_section *tvct; ++ struct atsc_tvct_channel *cur_channel; ++ struct atsc_tvct_section_part2 *part2; ++ struct descriptor *curd; ++ int idx; ++ ++ printf("SCT Decode TVCT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((tvct = atsc_tvct_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX TVCT section decode error\n"); ++ return; ++ } ++ printf("\tSCT tranport_stream_id:0x%04x\n", ++ atsc_tvct_section_transport_stream_id(tvct)); ++ ++ atsc_tvct_section_channels_for_each(tvct, cur_channel, idx) { ++ hexdump(0, "SCT short_name ", (uint8_t*) cur_channel->short_name, 7*2); ++ ++ printf("\tSCT major_channel_number:%04x minor_channel_number:%04x modulation_mode:%02x carrier_frequency:%i channel_TSID:%04x program_number:%04x ETM_location:%i access_controlled:%i hidden:%i hide_guide:%i service_type:%02x source_id:%04x\n", ++ cur_channel->major_channel_number, ++ cur_channel->minor_channel_number, ++ cur_channel->modulation_mode, ++ cur_channel->carrier_frequency, ++ cur_channel->channel_TSID, ++ cur_channel->program_number, ++ cur_channel->ETM_location, ++ cur_channel->access_controlled, ++ cur_channel->hidden, ++ cur_channel->hide_guide, ++ cur_channel->service_type, ++ cur_channel->source_id); ++ atsc_tvct_channel_descriptors_for_each(cur_channel, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ ++ part2 = atsc_tvct_section_part2(tvct); ++ atsc_tvct_section_part2_descriptors_for_each(part2, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ break; ++ } ++ ++ case stag_atsc_cable_virtual_channel: ++ { ++ struct atsc_cvct_section *cvct; ++ struct atsc_cvct_channel *cur_channel; ++ struct atsc_cvct_section_part2 *part2; ++ struct descriptor *curd; ++ int idx; ++ ++ printf("SCT Decode CVCT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((cvct = atsc_cvct_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX CVCT section decode error\n"); ++ return; ++ } ++ printf("\tSCT tranport_stream_id:0x%04x\n", ++ atsc_cvct_section_transport_stream_id(cvct)); ++ ++ atsc_cvct_section_channels_for_each(cvct, cur_channel, idx) { ++ hexdump(0, "SCT short_name ", (uint8_t*) cur_channel->short_name, 7*2); ++ ++ printf("\tSCT major_channel_number:%04x minor_channel_number:%04x modulation_mode:%02x carrier_frequency:%i channel_TSID:%04x program_number:%04x ETM_location:%i access_controlled:%i hidden:%i path_select:%i out_of_band:%i hide_guide:%i service_type:%02x source_id:%04x\n", ++ cur_channel->major_channel_number, ++ cur_channel->minor_channel_number, ++ cur_channel->modulation_mode, ++ cur_channel->carrier_frequency, ++ cur_channel->channel_TSID, ++ cur_channel->program_number, ++ cur_channel->ETM_location, ++ cur_channel->access_controlled, ++ cur_channel->hidden, ++ cur_channel->path_select, ++ cur_channel->out_of_band, ++ cur_channel->hide_guide, ++ cur_channel->service_type, ++ cur_channel->source_id); ++ atsc_cvct_channel_descriptors_for_each(cur_channel, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ ++ part2 = atsc_cvct_section_part2(cvct); ++ atsc_cvct_section_part2_descriptors_for_each(part2, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ break; ++ } ++ ++ case stag_atsc_rating_region: ++ { ++ struct atsc_rrt_section *rrt; ++ struct atsc_rrt_section_part2 *part2; ++ struct atsc_rrt_dimension *cur_dimension; ++ struct atsc_rrt_dimension_part2 *dpart2; ++ struct atsc_rrt_dimension_value *cur_value; ++ struct atsc_rrt_dimension_value_part2 *vpart2; ++ struct atsc_rrt_section_part3 *part3; ++ struct descriptor *curd; ++ int didx; ++ int vidx; ++ ++ printf("SCT Decode RRT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((rrt = atsc_rrt_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX RRT section decode error\n"); ++ return; ++ } ++ printf("\tSCT rating_region:0x%02x\n", ++ atsc_rrt_section_rating_region(rrt)); ++ atsctextdump("SCT region_name:", 1, ++ atsc_rrt_section_rating_region_name_text(rrt), ++ rrt->rating_region_name_length); ++ ++ part2 = atsc_rrt_section_part2(rrt); ++ atsc_rrt_section_dimensions_for_each(part2, cur_dimension, didx) { ++ atsctextdump("SCT dimension_name:", 2, ++ atsc_rrt_dimension_name_text(cur_dimension), ++ cur_dimension->dimension_name_length); ++ ++ dpart2 = atsc_rrt_dimension_part2(cur_dimension); ++ printf("\tSCT graduated_scale:%i\n", ++ dpart2->graduated_scale); ++ ++ atsc_rrt_dimension_part2_values_for_each(dpart2, cur_value, vidx) { ++ atsctextdump("SCT value_abbrev_name:", 3, ++ atsc_rrt_dimension_value_abbrev_rating_value_text(cur_value), ++ cur_value->abbrev_rating_value_length); ++ ++ vpart2 = atsc_rrt_dimension_value_part2(cur_value); ++ atsctextdump("SCT value_text:", 3, ++ atsc_rrt_dimension_value_part2_rating_value_text(vpart2), ++ vpart2->rating_value_length); ++ } ++ } ++ ++ part3 = atsc_rrt_section_part3(part2); ++ atsc_rrt_section_part3_descriptors_for_each(part3, curd) { ++ parse_descriptor(curd, 1, data_type); ++ } ++ ++ hexdump(0, "SCT ", buf, len); ++ getchar(); ++ break; ++ } ++ ++ case stag_atsc_event_information: ++ { ++ struct atsc_eit_section *eit; ++ struct atsc_eit_event *cur_event; ++ struct atsc_eit_event_part2 *part2; ++ struct descriptor *curd; ++ int idx; ++ ++ printf("SCT Decode EIT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((eit = atsc_eit_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX EIT section decode error\n"); ++ return; ++ } ++ printf("\tSCT source_id:0x%04x\n", ++ atsc_eit_section_source_id(eit)); ++ ++ atsc_eit_section_events_for_each(eit, cur_event, idx) { ++ printf("\t\tSCT event_id:%04x start_time:%i ETM_location:%i length_in_secs:%i\n", ++ cur_event->event_id, ++ cur_event->start_time, ++ cur_event->ETM_location, ++ cur_event->length_in_seconds); ++ ++ atsctextdump("SCT title:", 2, ++ atsc_eit_event_name_title_text(cur_event), ++ cur_event->title_length); ++ ++ part2 = atsc_eit_event_part2(cur_event); ++ ++ atsc_eit_event_part2_descriptors_for_each(part2, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ } ++ break; ++ } ++ ++ case stag_atsc_extended_text: ++ { ++ struct atsc_ett_section *ett; ++ ++ printf("SCT Decode ETT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((ett = atsc_ett_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX ETT section decode error\n"); ++ return; ++ } ++ printf("\tSCT ETM_source_id:0x%04x ETM_sub_id:%04x ETM_type:%02x\n", ++ ett->ETM_source_id, ++ ett->ETM_sub_id, ++ ett->ETM_type); ++ atsctextdump("SCT text:", 1, ++ atsc_ett_section_extended_text_message(ett), ++ atsc_ett_section_extended_text_message_length(ett)); ++ break; ++ } ++ ++ case stag_atsc_system_time: ++ { ++ struct atsc_stt_section *stt; ++ struct descriptor *curd; ++ ++ printf("SCT Decode STT (pid:0x%04x) (table:0x%02x)\n", pid, section->table_id); ++ if ((stt = atsc_stt_section_codec(section_psip)) == NULL) { ++ fprintf(stderr, "SCT XXXX STT section decode error\n"); ++ return; ++ } ++ printf("\tSCT system_time:%i gps_utc_offset:%i DS_status:%i DS_day_of_month:%i DS_hour:%i\n", ++ stt->system_time, ++ stt->gps_utc_offset, ++ stt->DS_status, ++ stt->DS_day_of_month, ++ stt->DS_hour); ++ atsc_stt_section_descriptors_for_each(stt, curd) { ++ parse_descriptor(curd, 2, data_type); ++ } ++ break; ++ } ++ ++ default: ++ fprintf(stderr, "SCT XXXX Unknown table_id:0x%02x (pid:0x%04x)\n", section->table_id, pid); ++ hexdump(0, "SCT ", buf, len); ++ return; ++ } ++} ++ ++void parse_descriptor(struct descriptor *d, int indent, int data_type) ++{ ++ switch(d->tag) { ++ case dtag_mpeg_video_stream: ++ { ++ struct mpeg_video_stream_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_video_stream_descriptor\n"); ++ dx = mpeg_video_stream_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_video_stream_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC multiple_frame_rate_flag:%i frame_rate_code:%i mpeg_1_only_flag:%i constrained_parameter_flag:%i still_picture_flag:%i\n", ++ dx->multiple_frame_rate_flag, ++ dx->frame_rate_code, ++ dx->mpeg_1_only_flag, ++ dx->constrained_parameter_flag, ++ dx->still_picture_flag); ++ if (!dx->mpeg_1_only_flag) { ++ struct mpeg_video_stream_extra *extra = mpeg_video_stream_descriptor_extra(dx); ++ iprintf(indent, "DSC profile_and_level_indication:0x%02x chroma_format:%i frame_rate_extension:%i\n", ++ extra->profile_and_level_indication, ++ extra->chroma_format, ++ extra->frame_rate_extension); ++ } ++ break; ++ } ++ ++ case dtag_mpeg_audio_stream: ++ { ++ struct mpeg_audio_stream_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_audio_stream_descriptor\n"); ++ dx = mpeg_audio_stream_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_audio_stream_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC free_format_flag:%i id:%i layer:%i variable_rate_audio_indicator:%i\n", ++ dx->free_format_flag, ++ dx->id, ++ dx->layer, ++ dx->variable_rate_audio_indicator); ++ break; ++ } ++ ++ case dtag_mpeg_hierarchy: ++ { ++ struct mpeg_hierarchy_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_hierarchy_descriptor\n"); ++ dx = mpeg_hierarchy_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_hierarchy_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC hierarchy_type:%i hierarchy_layer_index:%i hierarchy_embedded_layer_index:%i hierarchy_channel:%i\n", ++ dx->hierarchy_type, ++ dx->hierarchy_layer_index, ++ dx->hierarchy_embedded_layer_index, ++ dx->hierarchy_channel); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_registration: ++ { ++ struct mpeg_registration_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_registration_descriptor\n"); ++ dx = mpeg_registration_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_registration_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC format_identifier:0x%x\n", ++ dx->format_identifier); ++ iprintf(indent, "DSC additional_id_info:\n"); ++ hexdump(indent, "DSC ", ++ mpeg_registration_descriptor_additional_id_info(dx), ++ mpeg_registration_descriptor_additional_id_info_length(dx)); ++ break; ++ } ++ ++ case dtag_mpeg_data_stream_alignment: ++ { ++ struct mpeg_data_stream_alignment_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_data_stream_alignment_descriptor\n"); ++ dx = mpeg_data_stream_alignment_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_data_stream_alignment_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC alignment_type:%i\n", ++ dx->alignment_type); ++ break; ++ } ++ ++ case dtag_mpeg_target_background_grid: ++ { ++ struct mpeg_target_background_grid_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_target_background_grid_descriptor\n"); ++ dx = mpeg_target_background_grid_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_target_background_grid_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC horizontal_size:%i vertical_size:%i aspect_ratio_information:%i\n", ++ dx->horizontal_size, ++ dx->vertical_size, ++ dx->aspect_ratio_information); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_video_window: ++ { ++ struct mpeg_video_window_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_video_window_descriptor\n"); ++ dx = mpeg_video_window_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_video_window_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC horizontal_offset:%i vertical_offset:%i window_priority:%i\n", ++ dx->horizontal_offset, ++ dx->vertical_offset, ++ dx->window_priority); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_ca: ++ { ++ struct mpeg_ca_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_ca_descriptor\n"); ++ dx = mpeg_ca_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_ca_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC ca_system_id:0x%04x ca_pid:0x%04x\n", ++ dx->ca_system_id, ++ dx->ca_pid); ++ iprintf(indent, "DSC data:\n"); ++ hexdump(indent, "DSC ", mpeg_ca_descriptor_data(dx), mpeg_ca_descriptor_data_length(dx)); ++ break; ++ } ++ ++ case dtag_mpeg_iso_639_language: ++ { ++ struct mpeg_iso_639_language_descriptor *dx; ++ struct mpeg_iso_639_language_code *cur_lang; ++ ++ iprintf(indent, "DSC Decode mpeg_iso_639_language_descriptor\n"); ++ dx = mpeg_iso_639_language_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_iso_639_language_descriptor decode error\n"); ++ return; ++ } ++ mpeg_iso_639_language_descriptor_languages_for_each(dx, cur_lang) { ++ iprintf(indent+1, "DSC language_code:%.3s audio_type:0x%02x\n", ++ cur_lang->language_code, ++ cur_lang->audio_type); ++ } ++ break; ++ } ++ ++ case dtag_mpeg_system_clock: ++ { ++ struct mpeg_system_clock_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_system_clock_descriptor\n"); ++ dx = mpeg_system_clock_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_system_clock_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC external_clock_reference_indicator:%i clock_accuracy_integer:%i clock_accuracy_exponent:%i\n", ++ dx->external_clock_reference_indicator, ++ dx->clock_accuracy_integer, ++ dx->clock_accuracy_exponent); ++ break; ++ } ++ ++ case dtag_mpeg_multiplex_buffer_utilization: ++ { ++ struct mpeg_multiplex_buffer_utilization_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_multiplex_buffer_utilization_descriptor\n"); ++ dx = mpeg_multiplex_buffer_utilization_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_multiplex_buffer_utilization_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC bound_valid_flag:%i ltw_offset_lower_bound:%i ltw_offset_upper_bound:%i\n", ++ dx->bound_valid_flag, ++ dx->ltw_offset_lower_bound, ++ dx->ltw_offset_upper_bound); ++ break; ++ } ++ ++ case dtag_mpeg_copyright: ++ { ++ struct mpeg_copyright_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_copyright_descriptor\n"); ++ dx = mpeg_copyright_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_copyright_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC copyright_identifier:0x%08x\n", ++ dx->copyright_identifier); ++ iprintf(indent, "DSC data:\n"); ++ hexdump(indent, "DSC ", mpeg_copyright_descriptor_data(dx), mpeg_copyright_descriptor_data_length(dx)); ++ break; ++ } ++ ++ case dtag_mpeg_maximum_bitrate: ++ { ++ struct mpeg_maximum_bitrate_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_maximum_bitrate_descriptor\n"); ++ dx = mpeg_maximum_bitrate_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_maximum_bitrate_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC maximum_bitrate:%i\n", ++ dx->maximum_bitrate); ++ break; ++ } ++ ++ case dtag_mpeg_private_data_indicator: ++ { ++ struct mpeg_private_data_indicator_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_private_data_indicator_descriptor\n"); ++ dx = mpeg_private_data_indicator_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_private_data_indicator_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC private_data_indicator:0x%x\n", ++ dx->private_data_indicator); ++ break; ++ } ++ ++ case dtag_mpeg_smoothing_buffer: ++ { ++ struct mpeg_smoothing_buffer_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_smoothing_buffer_descriptor\n"); ++ dx = mpeg_smoothing_buffer_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_smoothing_buffer_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC sb_leak_rate:%i sb_size:%i\n", ++ dx->sb_leak_rate, ++ dx->sb_size); ++ break; ++ } ++ ++ case dtag_mpeg_std: ++ { ++ struct mpeg_std_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_std_descriptor\n"); ++ dx = mpeg_std_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_std_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC leak_valid_flag:%i\n", ++ dx->leak_valid_flag); ++ break; ++ } ++ ++ case dtag_mpeg_ibp: ++ { ++ struct mpeg_ibp_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_ibp_descriptor\n"); ++ dx = mpeg_ibp_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_ibp_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC closed_gop_flag:%i identical_gop_flag:%i max_gop_length:%i\n", ++ dx->closed_gop_flag, dx->identical_gop_flag, dx->max_gop_length); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_4_video: ++ { ++ struct mpeg4_video_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg4_video_descriptor\n"); ++ dx = mpeg4_video_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg4_video_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC mpeg4_visual_profile_and_level:0x%02x\n", ++ dx->mpeg4_visual_profile_and_level); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_4_audio: ++ { ++ struct mpeg4_audio_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg4_audio_descriptor\n"); ++ dx = mpeg4_audio_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg4_audio_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC mpeg4_audio_profile_and_level:0x%02x\n", ++ dx->mpeg4_audio_profile_and_level); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_iod: ++ { ++ struct mpeg_iod_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_iod_descriptor\n"); ++ dx = mpeg_iod_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_iod_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC scope_of_iod_label:0x%08x iod_label:0x%02x\n", ++ dx->scope_of_iod_label, dx->iod_label); ++ iprintf(indent, "DSC iod:\n"); ++ hexdump(indent, "DSC ", mpeg_iod_descriptor_iod(dx), mpeg_iod_descriptor_iod_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_sl: ++ { ++ struct mpeg_sl_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_sl_descriptor\n"); ++ dx = mpeg_sl_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_sl_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC es_id:0x%04x\n", ++ dx->es_id); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_fmc: ++ { ++ struct mpeg_fmc_descriptor *dx; ++ struct mpeg_flex_mux *cur_fm; ++ ++ iprintf(indent, "DSC Decode mpeg_fmc_descriptor\n"); ++ dx = mpeg_fmc_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_fmc_descriptor_descriptor decode error\n"); ++ return; ++ } ++ mpeg_fmc_descriptor_muxes_for_each(dx, cur_fm) { ++ iprintf(indent+1, "DSC es_id:0x%04x flex_mux_channel:0x%02x\n", ++ cur_fm->es_id, ++ cur_fm->flex_mux_channel); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_external_es_id: ++ { ++ struct mpeg_external_es_id_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_external_es_id_descriptor\n"); ++ dx = mpeg_external_es_id_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_external_es_id_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC external_es_id:0x%04x\n", ++ dx->external_es_id); ++ break; ++ } ++ ++ case dtag_mpeg_muxcode: ++ { ++ struct mpeg_muxcode_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_muxcode_descriptor\n"); ++ dx = mpeg_muxcode_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_muxcode_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC entries:\n"); ++ hexdump(indent, "DSC ", mpeg_muxcode_descriptor_entries(dx), mpeg_muxcode_descriptor_entries_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_fmxbuffer_size: ++ { ++ struct mpeg_fmxbuffer_size_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_fmxbuffer_size_descriptor\n"); ++ dx = mpeg_fmxbuffer_size_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_fmxbuffer_size_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC descriptors:\n"); ++ hexdump(indent, "DSC ", mpeg_fmxbuffer_size_descriptor_descriptors(dx), mpeg_fmxbuffer_size_descriptor_descriptors_length(dx)); ++ break; ++ } ++ ++ case dtag_mpeg_multiplex_buffer: ++ { ++ struct mpeg_multiplex_buffer_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_multiplex_buffer_descriptor\n"); ++ dx = mpeg_multiplex_buffer_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_multiplex_buffer_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC mb_buffer_size:%i tb_leak_rate:%i\n", ++ dx->mb_buffer_size, dx->tb_leak_rate); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_content_labelling: ++ { ++ struct mpeg_content_labelling_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_content_labelling_descriptor\n"); ++ dx = mpeg_content_labelling_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_content_labelling_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC metadata_application_format:%04x\n", ++ dx->metadata_application_format); ++ struct mpeg_content_labelling_descriptor_application_format_identifier *id = ++ mpeg_content_labelling_descriptor_id(dx); ++ if (id != NULL) { ++ iprintf(indent, "DSC application_format_id:%04x\n", ++ id->id); ++ } ++ struct mpeg_content_labelling_descriptor_flags *flags = ++ mpeg_content_labelling_descriptor_flags(dx); ++ if (flags != NULL) { ++ iprintf(indent, "DSC content_reference_id_record_flag:%i content_time_base_indicator:%02x\n", ++ flags->content_reference_id_record_flag, ++ flags->content_time_base_indicator); ++ ++ struct mpeg_content_labelling_descriptor_reference_id *reference_id = ++ mpeg_content_labelling_descriptor_reference_id(flags); ++ if (reference_id != NULL) { ++ hexdump(indent, "DSC reference_id " , ++ mpeg_content_reference_id_data(reference_id), ++ reference_id->content_reference_id_record_length); ++ } ++ ++ struct mpeg_content_labelling_descriptor_time_base *time_base = ++ mpeg_content_labelling_descriptor_time_base(flags); ++ if (time_base != NULL) { ++ iprintf(indent, "DSC time_base content_time_base_value:%lli metadata_time_base_value:%lli\n", ++ time_base->content_time_base_value, ++ time_base->metadata_time_base_value); ++ } ++ ++ struct mpeg_content_labelling_descriptor_content_id *content_id = ++ mpeg_content_labelling_descriptor_content_id(flags); ++ if (content_id != NULL) { ++ iprintf(indent, "DSC content_id contentId:%i\n", ++ content_id->contentId); ++ } ++ ++ struct mpeg_content_labelling_descriptor_time_base_association *time_base_assoc = ++ mpeg_content_labelling_descriptor_time_base_assoc(flags); ++ if (time_base_assoc != NULL) { ++ hexdump(indent, "DSC time_base_assoc" , ++ mpeg_time_base_association_data(time_base_assoc), ++ time_base_assoc->time_base_association_data_length); ++ } ++ ++ uint8_t *priv; ++ int priv_length; ++ priv = mpeg_content_labelling_descriptor_data(dx, flags, &priv_length); ++ hexdump(indent, "DSC private_data", priv, priv_length); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_metadata_pointer: ++ { ++ struct mpeg_metadata_pointer_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_metadata_pointer_descriptor\n"); ++ dx = mpeg_metadata_pointer_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_metadata_pointer_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC metadata_application_format:%04x\n", ++ dx->metadata_application_format); ++ ++ struct mpeg_metadata_pointer_descriptor_application_format_identifier *id = ++ mpeg_metadata_pointer_descriptor_appid(dx); ++ if (id != NULL) { ++ iprintf(indent, "DSC application_format_id:%04x\n", ++ id->id); ++ } ++ ++ struct mpeg_metadata_pointer_descriptor_format_identifier *did = ++ mpeg_metadata_pointer_descriptor_formid(dx); ++ if (did != NULL) { ++ iprintf(indent, "DSC mpeg_metadata_pointer_descriptor_format_id:%04x\n", ++ did->id); ++ } ++ ++ struct mpeg_metadata_pointer_descriptor_flags *flags = ++ mpeg_metadata_pointer_descriptor_flags(dx); ++ if (flags != NULL) { ++ iprintf(indent, "DSC metadata_service_id:%i metadata_locator_record_flag:%i mpeg_carriage_flags:%x\n", ++ flags->metadata_service_id, ++ flags->metadata_locator_record_flag, ++ flags->mpeg_carriage_flags); ++ ++ struct mpeg_metadata_pointer_descriptor_locator *locator = ++ mpeg_metadata_pointer_descriptor_locator(flags); ++ if (locator != NULL) { ++ hexdump(indent, "DSC locator" , ++ mpeg_metadata_pointer_descriptor_locator_data(locator), ++ locator->metadata_locator_record_length); ++ } ++ ++ struct mpeg_metadata_pointer_descriptor_program_number *pnum= ++ mpeg_metadata_pointer_descriptor_program_number(flags); ++ if (pnum != NULL) { ++ iprintf(indent, "DSC program_number number:%04x\n", ++ pnum->number); ++ } ++ ++ struct mpeg_metadata_pointer_descriptor_carriage *carriage = ++ mpeg_metadata_pointer_descriptor_carriage(flags); ++ if (carriage != NULL) { ++ iprintf(indent, "DSC carriage transport_stream_location:%04x transport_stream_id:%04x\n", ++ carriage->transport_stream_location, ++ carriage->transport_stream_id); ++ } ++ ++ uint8_t *priv; ++ int priv_length; ++ priv = mpeg_metadata_pointer_descriptor_private_data(dx, flags, &priv_length); ++ hexdump(indent, "DSC private_data" , priv, priv_length); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_metadata: ++ { ++ struct mpeg_metadata_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_metadata_descriptor\n"); ++ dx = mpeg_metadata_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_metadata_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC metadata_application_format:%04x\n", ++ dx->metadata_application_format); ++ ++ struct mpeg_metadata_descriptor_application_format_identifier *id = ++ mpeg_metadata_descriptor_appid(dx); ++ if (id != NULL) { ++ iprintf(indent, "DSC application_format_id:%04x\n", ++ id->id); ++ } ++ ++ struct mpeg_metadata_descriptor_format_identifier *did = ++ mpeg_metadata_descriptor_formid(dx); ++ if (did != NULL) { ++ iprintf(indent, "DSC mpeg_metadata_descriptor_format_id:%04x\n", ++ did->id); ++ } ++ ++ struct mpeg_metadata_descriptor_flags *flags = ++ mpeg_metadata_descriptor_flags(dx); ++ if (flags != NULL) { ++ iprintf(indent, "DSC metadata_service_id:%i decoder_config_flags:%i dsm_cc_flag:%x\n", ++ flags->metadata_service_id, ++ flags->decoder_config_flags, ++ flags->dsm_cc_flag); ++ ++ struct mpeg_metadata_descriptor_service_identifier *serviceid= ++ mpeg_metadata_descriptor_sevice_identifier(flags); ++ if (serviceid != NULL) { ++ hexdump(indent, "DSC service_id" , ++ mpeg_metadata_descriptor_service_identifier_data(serviceid), ++ serviceid->service_identification_length); ++ } ++ ++ struct mpeg_metadata_descriptor_decoder_config *dconfig= ++ mpeg_metadata_descriptor_decoder_config(flags); ++ if (dconfig != NULL) { ++ hexdump(indent, "DSC decoder_config" , ++ mpeg_metadata_descriptor_decoder_config_data(dconfig), ++ dconfig->decoder_config_length); ++ } ++ ++ struct mpeg_metadata_descriptor_decoder_config_id_record *dconfigid= ++ mpeg_metadata_descriptor_decoder_config_id_record(flags); ++ if (dconfigid != NULL) { ++ hexdump(indent, "DSC decoder_config" , ++ mpeg_metadata_descriptor_decoder_config_id_record_data(dconfigid), ++ dconfigid->decoder_config_id_record_length); ++ } ++ ++ struct mpeg_metadata_descriptor_decoder_config_service_id *dserviceid= ++ mpeg_metadata_descriptor_decoder_config_service_id(flags); ++ if (dserviceid != NULL) { ++ iprintf(indent, "DSC decoder config service_id:%04x\n", ++ dserviceid->decoder_config_metadata_service_id); ++ } ++ ++ struct mpeg_metadata_descriptor_decoder_config_reserved *reserved= ++ mpeg_metadata_descriptor_decoder_config_reserved(flags); ++ if (reserved != NULL) { ++ hexdump(indent, "DSC reserved" , ++ mpeg_metadata_descriptor_decoder_config_reserved_data(reserved), ++ reserved->reserved_data_length); ++ } ++ ++ uint8_t *priv; ++ int priv_length; ++ priv = mpeg_metadata_descriptor_private_data(dx, flags, &priv_length); ++ hexdump(indent, "DSC private_data" , priv, priv_length); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_mpeg_metadata_std: ++ { ++ struct mpeg_metadata_std_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode mpeg_metadata_std_descriptor\n"); ++ dx = mpeg_metadata_std_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX mpeg_metadata_std_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC metadata_input_leak_rate:%i metadata_buffer_size:%i metadata_output_leak_rate:%i\n", ++ dx->metadata_input_leak_rate, ++ dx->metadata_buffer_size, ++ dx->metadata_output_leak_rate); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ default: ++ switch(data_type) { ++ case DATA_TYPE_DVB: ++ parse_dvb_descriptor(d, indent, data_type); ++ return; ++ ++ case DATA_TYPE_ATSC: ++ parse_atsc_descriptor(d, indent, data_type); ++ return; ++ ++ default: ++ fprintf(stderr, "DSC XXXX Unknown descriptor_tag:0x%02x\n", d->tag); ++ hexdump(0, "DSC ", (uint8_t*) d, d->len+2); ++ return; ++ } ++ } ++} ++ ++void parse_dvb_descriptor(struct descriptor *d, int indent, int data_type) ++{ ++ (void) data_type; ++ ++ switch(d->tag) { ++ case dtag_dvb_network_name: ++ { ++ struct dvb_network_name_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_network_name_descriptor\n"); ++ dx = dvb_network_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_network_name_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC name:%.*s\n", ++ dvb_network_name_descriptor_name_length(dx), ++ dvb_network_name_descriptor_name(dx)); ++ break; ++ } ++ ++ case dtag_dvb_service_list: ++ { ++ struct dvb_service_list_descriptor *dx; ++ struct dvb_service_list_service *curs; ++ ++ iprintf(indent, "DSC Decode dvb_service_list_descriptor\n"); ++ dx = dvb_service_list_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_service_list_descriptor decode error\n"); ++ return; ++ } ++ dvb_service_list_descriptor_services_for_each(dx, curs) { ++ iprintf(indent+1, "DSC service_id:0x%04x service_type:0x%02x\n", ++ curs->service_id, curs->service_type); ++ } ++ break; ++ } ++ ++ case dtag_dvb_stuffing: ++ { ++ struct dvb_stuffing_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_stuffing_descriptor\n"); ++ dx = dvb_stuffing_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_stuffing_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ dvb_stuffing_descriptor_data(dx), ++ dvb_stuffing_descriptor_data_length(dx)); ++ break; ++ } ++ ++ case dtag_dvb_satellite_delivery_system: ++ { ++ struct dvb_satellite_delivery_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_satellite_delivery_descriptor\n"); ++ dx = dvb_satellite_delivery_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_satellite_delivery_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC frequency:%i orbital_position:%i west_east:%i polarization:%i roll_off:%i modulation_system:%i modulation_type: %i symbol_rate:%i fec_inner:%i\n", ++ dx->frequency, ++ dx->orbital_position, ++ dx->west_east_flag, ++ dx->polarization, ++ dx->roll_off, ++ dx->modulation_system, ++ dx->modulation_type, ++ dx->symbol_rate, ++ dx->fec_inner); ++ break; ++ } ++ ++ case dtag_dvb_cable_delivery_system: ++ { ++ struct dvb_cable_delivery_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_cable_delivery_descriptor\n"); ++ dx = dvb_cable_delivery_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_cable_delivery_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC frequency:%i fec_outer:%i modulation:%i symbol_rate:%i fec_inner:%i\n", ++ dx->frequency, dx->fec_outer, dx->modulation, ++ dx->symbol_rate, dx->fec_inner); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_vbi_data: ++ { ++ struct dvb_vbi_data_descriptor *dx; ++ struct dvb_vbi_data_entry *cur; ++ struct dvb_vbi_data_x *curx; ++ ++ iprintf(indent, "DSC Decode dvb_vbi_data_descriptor\n"); ++ dx = dvb_vbi_data_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_vbi_data_descriptor decode error\n"); ++ return; ++ } ++ dvb_vbi_data_descriptor_entries_for_each(dx, cur) { ++ curx = dvb_vbi_data_entry_data_x(cur); ++ iprintf(indent+1, "DSC data_service_id:0x%04x\n", cur->data_service_id); ++ if (cur == NULL) { ++ hexdump(indent+1, "DSC", dvb_vbi_data_entry_data(cur), cur->data_length); ++ } else { ++ iprintf(indent+1, "DSC field_parity:%i line_offset:%i\n", ++ curx->field_parity, curx->line_offset); ++ } ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_vbi_teletext: ++ { ++ struct dvb_vbi_teletext_descriptor *dx; ++ struct dvb_vbi_teletext_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_vbi_teletext_descriptor\n"); ++ dx = dvb_vbi_teletext_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_vbi_teletext_descriptor decode error\n"); ++ return; ++ } ++ dvb_vbi_teletext_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, "DSC language_code:%.3s type:%i magazine_number:%i page_number:%i\n", ++ cur->language_code, ++ cur->type, cur->magazine_number, cur->page_number); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_bouquet_name: ++ { ++ struct dvb_bouquet_name_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_bouquet_name_descriptor\n"); ++ dx = dvb_bouquet_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_bouquet_name_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC name:%.*s\n", ++ dvb_bouquet_name_descriptor_name_length(dx), ++ dvb_bouquet_name_descriptor_name(dx)); ++ break; ++ } ++ ++ case dtag_dvb_service: ++ { ++ struct dvb_service_descriptor *dx; ++ struct dvb_service_descriptor_part2 *part2; ++ ++ iprintf(indent, "DSC Decode dvb_service_descriptor\n"); ++ dx = dvb_service_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_service_descriptor decode error\n"); ++ return; ++ } ++ part2 = dvb_service_descriptor_part2(dx); ++ iprintf(indent, "DSC service_type:%02x provider_name:%.*s service_name:%.*s\n", ++ dx->service_type, ++ dx->service_provider_name_length, ++ dvb_service_descriptor_service_provider_name(dx), ++ part2->service_name_length, ++ dvb_service_descriptor_service_name(part2)); ++ break; ++ } ++ ++ case dtag_dvb_country_availability: ++ { ++ struct dvb_country_availability_descriptor *dx; ++ struct dvb_country_availability_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_country_availability_descriptor\n"); ++ dx = dvb_country_availability_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_country_availability_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC country_availability_flag:%i\n", dx->country_availability_flag); ++ dvb_country_availability_descriptor_countries_for_each(dx, cur) { ++ iprintf(indent+1, "DSC country_code:%.3s\n", cur->country_code); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_linkage: ++ { ++ struct dvb_linkage_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_linkage_descriptor\n"); ++ dx = dvb_linkage_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_linkage_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC transport_stream_id:0x%04x original_network_id:0x%04x service_id:0x%04x linkage_type:0x%02x\n", ++ dx->transport_stream_id, dx->original_network_id, dx->service_id, dx->linkage_type); ++ switch(dx->linkage_type) { ++ case 0x08: ++ { ++ struct dvb_linkage_data_08 *d08 = dvb_linkage_data_08(dx); ++ int network_id = dvb_linkage_data_08_network_id(dx, d08); ++ int initial_service_id = dvb_linkage_data_08_initial_service_id(dx, d08); ++ int length = 0; ++ uint8_t *data; ++ ++ data = dvb_linkage_data_08_data(dx, d08, &length); ++ iprintf(indent, "DSC hand_over_type:%i origin_type:%i\n", ++ d08->hand_over_type, d08->origin_type); ++ if (network_id != -1) { ++ iprintf(indent, "DSC network_id:0x%04x\n", network_id); ++ } ++ if (initial_service_id != -1) { ++ iprintf(indent, "DSC initial_service_id:0x%04x\n", initial_service_id); ++ } ++ } ++ ++ case 0x0b: ++ { ++ struct dvb_linkage_data_0b *data = dvb_linkage_data_0b(dx); ++ struct dvb_platform_id *platid; ++ struct dvb_platform_name *curplatname; ++ ++ dvb_linkage_data_0b_platform_id_for_each(data, platid) { ++ iprintf(indent+1, "DSC platform_id:0x%06x\n", platid->platform_id); ++ dvb_platform_id_platform_name_for_each(platid, curplatname) { ++ iprintf(indent+2, "DSC language_code:%.3s platform_name:%.*s\n", ++ curplatname->language_code, ++ curplatname->platform_name_length, dvb_platform_name_text(curplatname)); ++ } ++ } ++ break; ++ } ++ ++ case 0x0c: ++ { ++ struct dvb_linkage_data_0c *data = dvb_linkage_data_0c(dx); ++ ++ iprintf(indent, "DSC table_type:0x%02x\n", data->table_type); ++ if (dvb_linkage_data_0c_bouquet_id(data)) { ++ iprintf(indent, "DSC bouquet_id:0x%04x\n", ++ dvb_linkage_data_0c_bouquet_id(data)); ++ } ++ break; ++ } ++ ++ default: ++ hexdump(indent+1, "DSC", dvb_linkage_descriptor_data(dx), dvb_linkage_descriptor_data_length(dx)); ++ break; ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_nvod_reference: ++ { ++ struct dvb_nvod_reference_descriptor *dx; ++ struct dvb_nvod_reference *cur; ++ ++ iprintf(indent, "DSC Decode dvb_nvod_reference_descriptor\n"); ++ dx = dvb_nvod_reference_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_nvod_reference_descriptor decode error\n"); ++ return; ++ } ++ dvb_nvod_reference_descriptor_references_for_each(dx, cur) { ++ iprintf(indent+1, "DSC transport_stream_id:0x%04x original_network_id:0x%04x service_id:0x%04x\n", ++ cur->transport_stream_id, cur->original_network_id, ++ cur->service_id); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_time_shifted_service: ++ { ++ struct dvb_time_shifted_service_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_time_shifted_service_descriptor\n"); ++ dx = dvb_time_shifted_service_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_time_shifted_service_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC reference_service_id:0x%04x\n", dx->reference_service_id); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_short_event: ++ { ++ struct dvb_short_event_descriptor *dx; ++ struct dvb_short_event_descriptor_part2 *part2; ++ ++ iprintf(indent, "DSC Decode dvb_short_event_descriptor\n"); ++ dx = dvb_short_event_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_short_event_descriptor decode error\n"); ++ return; ++ } ++ part2 = dvb_short_event_descriptor_part2(dx); ++ iprintf(indent, "DSC language_code:%.3s event_name:%.*s text:%.*s\n", ++ dx->language_code, ++ dx->event_name_length, dvb_short_event_descriptor_event_name(dx), ++ part2->text_length, dvb_short_event_descriptor_text(part2)); ++ break; ++ } ++ ++ case dtag_dvb_extended_event: ++ { ++ struct dvb_extended_event_descriptor *dx; ++ struct dvb_extended_event_descriptor_part2 *part2; ++ struct dvb_extended_event_item *cur; ++ ++ iprintf(indent, "DSC Decode dvb_extended_event_descriptor\n"); ++ dx = dvb_extended_event_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_extended_event_descriptor decode error\n"); ++ return; ++ } ++ part2 = dvb_extended_event_descriptor_part2(dx); ++ iprintf(indent, "DSC descriptor_number:%i last_descriptor_number:%i language_code:%.3s text:%.*s\n", ++ dx->descriptor_number, dx->last_descriptor_number, ++ dx->language_code, ++ part2->text_length, dvb_extended_event_descriptor_part2_text(part2)); ++ dvb_extended_event_descriptor_items_for_each(dx, cur) { ++ struct dvb_extended_event_item_part2 *ipart2 = ++ dvb_extended_event_item_part2(cur); ++ iprintf(indent+1, "DSC description:%.*s item:%.*s\n", ++ cur->item_description_length, dvb_extended_event_item_description(cur), ++ ipart2->item_length, dvb_extended_event_item_part2_item(ipart2)); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_time_shifted_event: ++ { ++ struct dvb_time_shifted_event_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_time_shifted_event_descriptor\n"); ++ dx = dvb_time_shifted_event_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_time_shifted_event_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC reference_service_id:0x%04x reference_event_id:0x%04x\n", ++ dx->reference_service_id, dx->reference_event_id); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_component: ++ { ++ struct dvb_component_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_component_descriptor\n"); ++ dx = dvb_component_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_component_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC stream_content:%i component_type:%i component_tag: %i language_code:%.3s, text:%.*s\n", ++ dx->stream_content, ++ dx->component_type, ++ dx->component_tag, ++ dx->language_code, ++ dvb_component_descriptor_text_length(dx), ++ dvb_component_descriptor_text(dx)); ++ break; ++ } ++ ++ case dtag_dvb_mosaic: ++ { ++ struct dvb_mosaic_descriptor *dx; ++ struct dvb_mosaic_info *curinfo; ++ ++ iprintf(indent, "DSC Decode dvb_mosaic_descriptor\n"); ++ dx = dvb_mosaic_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_mosaic_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC mosaic_entry_point:%i number_of_horiz_elementary_cells:%i number_of_vert_elementary_cells:%i\n", ++ dx->mosaic_entry_point, dx->number_of_horiz_elementary_cells, ++ dx->number_of_vert_elementary_cells); ++ dvb_mosaic_descriptor_infos_for_each(dx, curinfo) { ++ struct dvb_mosaic_info_part2 *part2; ++ struct dvb_mosaic_linkage *linkage; ++ struct dvb_mosaic_elementary_cell_field *curfield; ++ ++ part2 = dvb_mosaic_info_part2(curinfo); ++ linkage = dvb_mosaic_linkage(part2); ++ iprintf(indent+1, "DSC logical_cell_id:%i logical_cell_presentation_info:%i cell_linkage_info:0x%02x\n", ++ curinfo->logical_cell_id, curinfo->logical_cell_presentation_info, ++ part2->cell_linkage_info); ++ if (linkage) { ++ switch(part2->cell_linkage_info) { ++ case 0x01: ++ iprintf(indent+1, "DSC bouquet_id:0x%04x\n", ++ linkage->u.linkage_01.bouquet_id); ++ break; ++ ++ case 0x02: ++ iprintf(indent+1, "DSC original_network_id:0x%04x transport_stream_id:0x%04x service_id:0x%04x\n", ++ linkage->u.linkage_02.original_network_id, ++ linkage->u.linkage_02.transport_stream_id, ++ linkage->u.linkage_02.service_id); ++ break; ++ ++ case 0x03: ++ iprintf(indent+1, "DSC original_network_id:0x%04x transport_stream_id:0x%04x service_id:0x%04x\n", ++ linkage->u.linkage_03.original_network_id, ++ linkage->u.linkage_03.transport_stream_id, ++ linkage->u.linkage_03.service_id); ++ break; ++ ++ case 0x04: ++ iprintf(indent+1, "DSC original_network_id:0x%04x transport_stream_id:0x%04x service_id:0x%04x event_id:0x%04x\n", ++ linkage->u.linkage_04.original_network_id, ++ linkage->u.linkage_04.transport_stream_id, ++ linkage->u.linkage_04.service_id, ++ linkage->u.linkage_04.event_id); ++ break; ++ } ++ } ++ ++ dvb_mosaic_info_fields_for_each(curinfo, curfield) { ++ iprintf(indent+2, "DSC elementary_cell_id:0x%02x\n", ++ curfield->elementary_cell_id); ++ } ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_stream_identifier: ++ { ++ struct dvb_stream_identifier_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_stream_identifier_descriptor\n"); ++ dx = dvb_stream_identifier_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_stream_identifier_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC component_tag:%i\n", ++ dx->component_tag); ++ break; ++ } ++ ++ case dtag_dvb_ca_identifier: ++ { ++ struct dvb_ca_identifier_descriptor *dx; ++ int i; ++ uint16_t *ids; ++ ++ iprintf(indent, "DSC Decode dvb_ca_identifier_descriptor\n"); ++ dx = dvb_ca_identifier_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_ca_identifier_descriptor decode error\n"); ++ return; ++ } ++ ids = dvb_ca_identifier_descriptor_ca_system_ids(dx); ++ for(i=0; i< dvb_ca_identifier_descriptor_ca_system_ids_count(dx); i++) { ++ iprintf(indent+i, "DSC system_id:0x%04x\n", ids[i]); ++ } ++ break; ++ } ++ ++ case dtag_dvb_content: ++ { ++ struct dvb_content_descriptor *dx; ++ struct dvb_content_nibble *cur; ++ ++ iprintf(indent, "DSC Decode dvb_content_descriptor\n"); ++ dx = dvb_content_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_content_descriptor decode error\n"); ++ return; ++ } ++ dvb_content_descriptor_nibbles_for_each(dx, cur) { ++ iprintf(indent+1, "DSC content_nibble_level_1:%i content_nibble_level_2:%i user_nibble_1:%i user_nibble_2:%i\n", ++ cur->content_nibble_level_1, cur->content_nibble_level_2, ++ cur->user_nibble_1, cur->user_nibble_2); ++ } ++ break; ++ } ++ ++ case dtag_dvb_parental_rating: ++ { ++ struct dvb_parental_rating_descriptor *dx; ++ struct dvb_parental_rating *cur; ++ ++ iprintf(indent, "DSC Decode dvb_parental_rating_descriptor\n"); ++ dx = dvb_parental_rating_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_parental_rating_descriptor decode error\n"); ++ return; ++ } ++ dvb_parental_rating_descriptor_ratings_for_each(dx, cur) { ++ iprintf(indent+1, "DSC country_code:%.3s rating:%i\n", ++ cur->country_code, cur->rating); ++ } ++ break; ++ } ++ ++ case dtag_dvb_teletext: ++ { ++ struct dvb_teletext_descriptor *dx; ++ struct dvb_teletext_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_teletext_descriptor\n"); ++ dx = dvb_teletext_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_teletext_descriptor decode error\n"); ++ return; ++ } ++ dvb_teletext_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, "DSC language_code:%.3s type:%i magazine_number:%i page_number:%i\n", ++ cur->language_code, ++ cur->type, cur->magazine_number, cur->page_number); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_telephone: ++ { ++ struct dvb_telephone_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_telephone_descriptor\n"); ++ dx = dvb_telephone_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_telephone_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, ++ "DSC foreign_availability:%i connection_type:%i country_prefix:%.*s " ++ "international_area_code:%.*s operator_code:%.*s national_area_code:%.*s core_number:%.*s\n", ++ dx->foreign_availability, dx->connection_type, ++ dx->country_prefix_length, dvb_telephone_descriptor_country_prefix(dx), ++ dx->international_area_code_length, dvb_telephone_descriptor_international_area_code(dx), ++ dx->operator_code_length, dvb_telephone_descriptor_operator_code(dx), ++ dx->national_area_code_length, dvb_telephone_descriptor_national_area_code(dx), ++ dx->core_number_length, dvb_telephone_descriptor_core_number(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_local_time_offset: ++ { ++ struct dvb_local_time_offset_descriptor *dx; ++ struct dvb_local_time_offset *cur; ++ ++ iprintf(indent, "DSC Decode dvb_local_time_offset_descriptor\n"); ++ dx = dvb_local_time_offset_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_local_time_offset_descriptor decode error\n"); ++ return; ++ } ++ dvb_local_time_offset_descriptor_offsets_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC country_code:%.3s country_region_id:%i " ++ "local_time_offset_polarity:%i local_time_offset:%i " ++ "time_of_change:%i next_time_offset:%i\n", ++ cur->country_code, cur->country_region_id, ++ cur->local_time_offset_polarity, ++ dvbhhmm_to_seconds(cur->local_time_offset), ++ dvbdate_to_unixtime(cur->time_of_change), ++ dvbhhmm_to_seconds(cur->next_time_offset)); ++ } ++ break; ++ } ++ ++ case dtag_dvb_subtitling: ++ { ++ struct dvb_subtitling_descriptor *dx; ++ struct dvb_subtitling_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_subtitling_descriptor\n"); ++ dx = dvb_subtitling_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_subtitling_descriptor decode error\n"); ++ return; ++ } ++ dvb_subtitling_descriptor_subtitles_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC language_code:%.3s subtitling_type:0x%02x composition_page_id:0x%04x ancillary_page_id:0x%04x\n", ++ cur->language_code, cur->subtitling_type, ++ cur->composition_page_id, cur->ancillary_page_id); ++ } ++ break; ++ } ++ ++ case dtag_dvb_terrestial_delivery_system: ++ { ++ struct dvb_terrestrial_delivery_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_terrestrial_delivery_descriptor\n"); ++ dx = dvb_terrestrial_delivery_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_terrestrial_delivery_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC centre_frequency:%i bandwidth:%i priority:%i " ++ "time_slicing_indicator:%i mpe_fec_indicator:%i constellation:%i " ++ "hierarchy_information:%i code_rate_hp_stream:%i " ++ "code_rate_lp_stream:%i guard_interval:%i transmission_mode:%i " ++ "other_frequency_flag:%i\n", ++ dx->centre_frequency, dx->bandwidth, dx->priority, ++ dx->time_slicing_indicator, dx->mpe_fec_indicator, ++ dx->constellation, ++ dx->hierarchy_information, dx->code_rate_hp_stream, ++ dx->code_rate_lp_stream, dx->guard_interval, ++ dx->transmission_mode, dx->other_frequency_flag); ++ break; ++ } ++ ++ case dtag_dvb_multilingual_network_name: ++ { ++ struct dvb_multilingual_network_name_descriptor *dx; ++ struct dvb_multilingual_network_name *cur; ++ ++ iprintf(indent, "DSC Decode dvb_multilingual_network_name_descriptor\n"); ++ dx = dvb_multilingual_network_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_multilingual_network_name_descriptor decode error\n"); ++ return; ++ } ++ dvb_multilingual_network_name_descriptor_names_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC language_code:%.3s network_name:%.*s\n", ++ cur->language_code, ++ cur->network_name_length, ++ dvb_multilingual_network_name_name(cur)); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_multilingual_bouquet_name: ++ { ++ struct dvb_multilingual_bouquet_name_descriptor *dx; ++ struct dvb_multilingual_bouquet_name *cur; ++ ++ iprintf(indent, "DSC Decode dvb_multilingual_bouquet_name_descriptor\n"); ++ dx = dvb_multilingual_bouquet_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_multilingual_bouquet_name_descriptor decode error\n"); ++ return; ++ } ++ dvb_multilingual_bouquet_name_descriptor_names_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC language_code:%.3s bouquet_name:%.*s\n", ++ cur->language_code, ++ cur->bouquet_name_length, ++ dvb_multilingual_bouquet_name_name(cur)); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_multilingual_service_name: ++ { ++ struct dvb_multilingual_service_name_descriptor *dx; ++ struct dvb_multilingual_service_name *cur; ++ ++ iprintf(indent, "DSC Decode dvb_multilingual_service_name_descriptor\n"); ++ dx = dvb_multilingual_service_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_multilingual_service_name_descriptor decode error\n"); ++ return; ++ } ++ dvb_multilingual_service_name_descriptor_names_for_each(dx, cur) { ++ struct dvb_multilingual_service_name_part2 *part2; ++ part2 = dvb_multilingual_service_name_part2(cur); ++ ++ iprintf(indent+1, ++ "DSC language_code:%.3s provider_name:%.*s service_name:%.*s\n", ++ cur->language_code, ++ cur->service_provider_name_length, ++ dvb_multilingual_service_name_service_provider_name(cur), ++ part2->service_name_length, ++ dvb_multilingual_service_name_service_name(part2)); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_multilingual_component: ++ { ++ struct dvb_multilingual_component_descriptor *dx; ++ struct dvb_multilingual_component *cur; ++ ++ iprintf(indent, "DSC Decode dvb_multilingual_component_descriptor\n"); ++ dx = dvb_multilingual_component_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_multilingual_component_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC component_tag:%02x\n", dx->component_tag); ++ dvb_multilingual_component_descriptor_components_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC language_code:%.3s description:%.*s\n", ++ cur->language_code, ++ cur->text_description_length, ++ dvb_multilingual_component_text_char(cur)); ++ } ++ break; ++ } ++ ++ case dtag_dvb_private_data_specifier: ++ { ++ struct dvb_private_data_specifier_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_private_data_specifier_descriptor\n"); ++ dx = dvb_private_data_specifier_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_private_data_specifier_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC private_data_specifier:0x%08x\n", ++ dx->private_data_specifier); ++ break; ++ } ++ ++ case dtag_dvb_service_move: ++ { ++ struct dvb_service_move_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_service_move_descriptor\n"); ++ dx = dvb_service_move_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_service_move_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC new_original_network_id:0x%04x new_transport_stream_id:0x%04x new_service_id:0x%04x\n", ++ dx->new_original_network_id, dx->new_transport_stream_id, dx->new_service_id); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_short_smoothing_buffer: ++ { ++ struct dvb_short_smoothing_buffer_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_short_smoothing_buffer_descriptor\n"); ++ dx = dvb_short_smoothing_buffer_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_short_smoothing_buffer_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC sb_size:%i sb_leak_rate:%i\n", ++ dx->sb_size, dx->sb_leak_rate); ++ hexdump(indent, "DSC", ++ dvb_short_smoothing_buffer_descriptor_reserved(dx), ++ dvb_short_smoothing_buffer_descriptor_reserved_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_frequency_list: ++ { ++ struct dvb_frequency_list_descriptor *dx; ++ uint32_t *freqs; ++ int count; ++ int i; ++ ++ iprintf(indent, "DSC Decode dvb_frequency_list_descriptor\n"); ++ dx = dvb_frequency_list_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_frequency_list_descriptor decode error\n"); ++ return; ++ } ++ iprintf(0, "DSC coding_type=%i\n", dx->coding_type); ++ ++ freqs = dvb_frequency_list_descriptor_centre_frequencies(dx); ++ count = dvb_frequency_list_descriptor_centre_frequencies_count(dx); ++ for(i=0; i< count; i++) { ++ iprintf(indent+1, "DSC %i\n", freqs[i]); ++ } ++ break; ++ } ++ ++ case dtag_dvb_partial_transport_stream: ++ { ++ struct dvb_partial_transport_stream_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_partial_transport_stream_descriptor\n"); ++ dx = dvb_partial_transport_stream_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_partial_transport_stream_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC peak_rate:%i minimum_overall_smoothing_rate:%i maximum_overall_smoothing_rate:%i\n", ++ dx->peak_rate, dx->minimum_overall_smoothing_rate, dx->maximum_overall_smoothing_rate); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_data_broadcast: ++ { ++ struct dvb_data_broadcast_descriptor *dx; ++ struct dvb_data_broadcast_descriptor_part2 *part2; ++ ++ iprintf(indent, "DSC Decode dvb_data_broadcast_descriptor\n"); ++ dx = dvb_data_broadcast_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_data_broadcast_descriptor decode error\n"); ++ return; ++ } ++ part2 = dvb_data_broadcast_descriptor_part2(dx); ++ ++ iprintf(indent, "DSC data_broadcast_id:0x%04x component_tag:0x%02x selector:%.*s language_code:%.3s text:%.*s\n", ++ dx->data_broadcast_id, dx->component_tag, ++ dx->selector_length, dvb_data_broadcast_descriptor_selector(dx), ++ part2->language_code, ++ part2->text_length, dvb_data_broadcast_descriptor_part2_text(part2)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_scrambling: ++ { ++ struct dvb_scrambling_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_scrambling_descriptor\n"); ++ dx = dvb_scrambling_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_scrambling_descriptor decode error\n"); ++ return; ++ } ++ ++ iprintf(indent, "DSC scrambling_mode:0x%02x\n", ++ dx->scrambling_mode); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_data_broadcast_id: ++ { ++ struct dvb_data_broadcast_id_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_data_broadcast_id_descriptor\n"); ++ dx = dvb_data_broadcast_id_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_data_broadcast_id_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC data_broadcast_id:0x%04x\n", ++ dx->data_broadcast_id); ++ hexdump(indent+1, "DSC", ++ dvb_data_broadcast_id_descriptor_id_selector_byte(dx), ++ dvb_data_broadcast_id_descriptor_id_selector_byte_length(dx)); ++ break; ++ } ++ ++ case dtag_dvb_transport_stream: ++ { ++ struct dvb_transport_stream_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_transport_stream_descriptor\n"); ++ dx = dvb_transport_stream_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_transport_stream_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ dvb_transport_stream_descriptor_data(dx), ++ dvb_transport_stream_descriptor_data_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_dsng: ++ { ++ struct dvb_dsng_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_dsng_descriptor\n"); ++ dx = dvb_dsng_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_dsng_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ dvb_dsng_descriptor_data(dx), ++ dvb_dsng_descriptor_data_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_pdc: ++ { ++ struct dvb_pdc_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_pdc_descriptor\n"); ++ dx = dvb_pdc_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_pdc_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC programme_id_label:0x%06x\n", ++ dx->programme_id_label); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_ac3: ++ { ++ struct dvb_ac3_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_ac3_descriptor\n"); ++ dx = dvb_ac3_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_ac3_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC ac3_type_flag:%i bsid_flag:%i mainid_flag:%i asvc_flag:%i\n", ++ dx->ac3_type_flag, dx->bsid_flag, dx->mainid_flag, dx->asvc_flag); ++ hexdump(indent+1, "DSC", ++ dvb_ac3_descriptor_additional_info(dx), ++ dvb_ac3_descriptor_additional_info_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_ancillary_data: ++ { ++ struct dvb_ancillary_data_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_ancillary_data_descriptor\n"); ++ dx = dvb_ancillary_data_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_ancillary_data_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, "DSC scale_factor_error_check:%i dab_ancillary_data:%i announcement_switching_data:%i extended_ancillary_data:%i dvd_video_ancillary_data:%i\n", ++ dx->scale_factor_error_check, ++ dx->dab_ancillary_data, ++ dx->announcement_switching_data, ++ dx->extended_ancillary_data, ++ dx->dvd_video_ancillary_data); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_cell_list: ++ { ++ struct dvb_cell_list_descriptor *dx; ++ struct dvb_cell_list_entry *cur; ++ struct dvb_subcell_list_entry *cur_subcell; ++ ++ iprintf(indent, "DSC Decode dvb_cell_list_descriptor\n"); ++ dx = dvb_cell_list_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_cell_list_descriptor decode error\n"); ++ return; ++ } ++ dvb_cell_list_descriptor_cells_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC cell_id:%04x cell_latitude:%i cell_longitude:%i cell_extend_of_latitude:%i cell_extend_of_longitude:%i\n", ++ cur->cell_id, ++ cur->cell_latitude, ++ cur->cell_longitude, ++ cur->cell_extend_of_latitude, ++ cur->cell_extend_of_longitude); ++ ++ dvb_cell_list_entry_subcells_for_each(cur, cur_subcell) { ++ iprintf(indent+2, ++ "DSC cell_id_extension:%04x subcell_latitude:%i subcell_longitude:%i subcell_extend_of_latitude:%i subcell_extend_of_longitude:%i\n", ++ cur_subcell->cell_id_extension, ++ cur_subcell->subcell_latitude, ++ cur_subcell->subcell_longitude, ++ cur_subcell->subcell_extend_of_latitude, ++ cur_subcell->subcell_extend_of_longitude); ++ } ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_cell_frequency_link: ++ { ++ struct dvb_cell_frequency_link_descriptor *dx; ++ struct dvb_cell_frequency_link_cell *cur; ++ struct dvb_cell_frequency_link_cell_subcell *cur_subcell; ++ ++ iprintf(indent, "DSC Decode dvb_cell_frequency_link_descriptor\n"); ++ dx = dvb_cell_frequency_link_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_cell_frequency_link_descriptor decode error\n"); ++ return; ++ } ++ dvb_cell_frequency_link_descriptor_cells_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC cell_id:%04x frequency:%i\n", ++ cur->cell_id, ++ cur->frequency); ++ ++ dvb_cell_frequency_link_cell_subcells_for_each(cur, cur_subcell) { ++ iprintf(indent+2, ++ "DSC cell_id_extension:%04x transposer_frequency:%i\n", ++ cur_subcell->cell_id_extension, ++ cur_subcell->transposer_frequency); ++ } ++ } ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_announcement_support: ++ { ++ struct dvb_announcement_support_descriptor *dx; ++ struct dvb_announcement_support_entry *cur; ++ struct dvb_announcement_support_reference *ref; ++ ++ iprintf(indent, "DSC Decode dvb_announcement_support_descriptor\n"); ++ dx = dvb_announcement_support_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_announcement_support_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, ++ "DSC announcement_support_indicator:%04x\n", ++ dx->announcement_support_indicator); ++ ++ dvb_announcement_support_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC announcement_type:%i reference_type:%i\n", ++ cur->announcement_type, ++ cur->reference_type); ++ ++ ref = dvb_announcement_support_entry_reference(cur); ++ if (ref) { ++ iprintf(indent+1, ++ "DSC original_network_id:%04x transport_stream_id:%04x service_id:%04x component_tag:%02x\n", ++ ref->original_network_id, ++ ref->transport_stream_id, ++ ref->service_id, ++ ref->component_tag); ++ } ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_application_signalling: ++ { ++ struct dvb_application_signalling_descriptor *dx; ++ struct dvb_application_signalling_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_application_signalling_descriptor\n"); ++ dx = dvb_application_signalling_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_application_signalling_descriptor decode error\n"); ++ return; ++ } ++ ++ dvb_application_signalling_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC application_type:%i AIT_version_number:%i\n", ++ cur->application_type, ++ cur->AIT_version_number); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_adaptation_field_data: ++ { ++ struct dvb_adaptation_field_data_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_adaptation_field_data_descriptor\n"); ++ dx = dvb_adaptation_field_data_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_adaptation_field_data_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, ++ "DSC announcement_switching_data:%i\n", ++ dx->announcement_switching_data); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_service_identifier: ++ { ++ struct dvb_service_identifier_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_service_identifier_descriptor\n"); ++ dx = dvb_service_identifier_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_service_identifier_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ dvb_service_identifier_descriptor_identifier(dx), ++ dvb_service_identifier_descriptor_identifier_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_service_availability: ++ { ++ struct dvb_service_availability_descriptor *dx; ++ uint16_t *cellids; ++ int count; ++ int i; ++ ++ iprintf(indent, "DSC Decode dvb_service_availability_descriptor\n"); ++ dx = dvb_service_availability_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_service_availability_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent, ++ "DSC availability_flag:%i\n", ++ dx->availability_flag); ++ ++ cellids = dvb_service_availability_descriptor_cell_ids(dx); ++ count = dvb_service_availability_descriptor_cell_ids_count(dx); ++ for(i=0; i< count; i++) { ++ iprintf(indent+1, "DSC", "%04x\n", cellids[i]); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_default_authority: ++ { ++ struct dvb_default_authority_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_default_authority_descriptor\n"); ++ dx = dvb_default_authority_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_default_authority_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ dvb_default_authority_descriptor_name(dx), ++ dvb_default_authority_descriptor_name_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_related_content: ++ { ++ struct dvb_related_content_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_related_content_descriptor\n"); ++ dx = dvb_related_content_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_related_content_descriptor decode error\n"); ++ return; ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_tva_id: ++ { ++ struct dvb_tva_id_descriptor *dx; ++ struct dvb_tva_id_entry *cur; ++ ++ iprintf(indent, "DSC Decode dvb_tva_id_descriptor\n"); ++ dx = dvb_tva_id_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_tva_id_descriptor decode error\n"); ++ return; ++ } ++ ++ dvb_tva_id_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC tva_id:%04x running_status:%i\n", ++ cur->tva_id, ++ cur->running_status); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_content_identifier: ++ { ++ struct dvb_content_identifier_descriptor *dx; ++ struct dvb_content_identifier_entry *cur; ++ struct dvb_content_identifier_entry_data_0 *data0; ++ struct dvb_content_identifier_entry_data_1 *data1; ++ ++ iprintf(indent, "DSC Decode dvb_tva_id_descriptor\n"); ++ dx = dvb_content_identifier_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_content_identifier_descriptor decode error\n"); ++ return; ++ } ++ ++ dvb_content_identifier_descriptor_entries_for_each(dx, cur) { ++ iprintf(indent+1, ++ "DSC crid_type:%i crid_location:%i\n", ++ cur->crid_type, ++ cur->crid_location); ++ ++ data0 = dvb_content_identifier_entry_data_0(cur); ++ if (data0) { ++ hexdump(indent, "DSC data0", ++ dvb_content_identifier_entry_data_0_data(data0), ++ data0->crid_length); ++ } ++ ++ data1 = dvb_content_identifier_entry_data_1(cur); ++ if (data1) { ++ iprintf(indent+1, ++ "DSC crid_ref:%04x\n", ++ data1->crid_ref); ++ } ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_dvb_s2_satellite_delivery_descriptor: ++ { ++ struct dvb_s2_satellite_delivery_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode dvb_s2_satellite_delivery_descriptor\n"); ++ dx = dvb_s2_satellite_delivery_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX dvb_s2_satellite_delivery_descriptor decode error\n"); ++ return; ++ } ++ ++ iprintf(indent, ++ "DSC scrambling_sequence_selector:%i multiple_input_stream:%i backwards_compatability:%i\n", ++ dx->scrambling_sequence_selector, ++ dx->multiple_input_stream, ++ dx->backwards_compatability); ++ if (dx->scrambling_sequence_selector) { ++ iprintf(indent, ++ "DSC scrambling_sequence_index:%i\n", ++ dvb_s2_satellite_delivery_descriptor_scrambling_sequence_index(dx)); ++ } ++ if (dx->multiple_input_stream) { ++ iprintf(indent, ++ "DSC input_stream_id:%i\n", ++ dvb_s2_satellite_delivery_descriptor_input_stream_id(dx)); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ default: ++ fprintf(stderr, "DSC XXXX Unknown descriptor_tag:0x%02x\n", d->tag); ++ hexdump(0, "DSC ", (uint8_t*) d, d->len+2); ++ return; ++ } ++} ++ ++void parse_atsc_descriptor(struct descriptor *d, int indent, int data_type) ++{ ++ (void) data_type; ++ ++ switch(d->tag) { ++ case dtag_atsc_stuffing: ++ { ++ struct atsc_stuffing_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_stuffing_descriptor\n"); ++ dx = atsc_stuffing_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_stuffing_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ atsc_stuffing_descriptor_data(dx), ++ atsc_stuffing_descriptor_data_length(dx)); ++ break; ++ } ++ ++ case dtag_atsc_ac3_audio: ++ { ++ struct atsc_ac3_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_ac3_descriptor\n"); ++ dx = atsc_ac3_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_ac3_descriptor decode error\n"); ++ return; ++ } ++ ++ iprintf(indent, ++ "DSC sample_rate_code:%i bsid:%i bit_rate_code:%i surround_mode:%i bsmod:%i num_channels:%i full_svc:%i\n", ++ dx->sample_rate_code, ++ dx->bsid, ++ dx->bit_rate_code, ++ dx->surround_mode, ++ dx->bsmod, ++ dx->num_channels, ++ dx->full_svc); ++ ++ hexdump(indent+1, "DSC additional_info", ++ atsc_ac3_descriptor_additional_info(dx), ++ atsc_ac3_descriptor_additional_info_length(dx)); ++ break; ++ } ++ ++ case dtag_atsc_caption_service: ++ { ++ struct atsc_caption_service_descriptor *dx; ++ struct atsc_caption_service_entry *cur; ++ int idx; ++ ++ iprintf(indent, "DSC Decode atsc_caption_service_descriptor\n"); ++ dx = atsc_caption_service_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_caption_service_descriptor decode error\n"); ++ return; ++ } ++ ++ atsc_caption_service_descriptor_entries_for_each(dx, cur, idx) { ++ iprintf(indent+1, ++ "DSC language_code:%.3s digital_cc:%i value:%i easy_reader:%i wide_aspect_ratio:%i\n", ++ cur->language_code, ++ cur->digital_cc, ++ cur->value, ++ cur->easy_reader, ++ cur->wide_aspect_ratio); ++ } ++ break; ++ } ++ ++ case dtag_atsc_content_advisory: ++ { ++ struct atsc_content_advisory_descriptor *dx; ++ struct atsc_content_advisory_entry *cure; ++ struct atsc_content_advisory_entry_dimension *curd; ++ struct atsc_content_advisory_entry_part2 *part2; ++ int eidx; ++ int didx; ++ ++ iprintf(indent, "DSC Decode atsc_content_advisory_descriptor\n"); ++ dx = atsc_content_advisory_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_content_advisory_descriptor decode error\n"); ++ return; ++ } ++ ++ atsc_content_advisory_descriptor_entries_for_each(dx, cure, eidx) { ++ iprintf(indent+1, ++ "DSC rating_region:%i\n", ++ cure->rating_region); ++ ++ atsc_content_advisory_entry_dimensions_for_each(cure, curd, didx) { ++ iprintf(indent+2, ++ "DSC rating_dimension_j:%i rating_value:%i\n", ++ curd->rating_dimension_j, ++ curd->rating_value); ++ } ++ ++ part2 = atsc_content_advisory_entry_part2(cure); ++ ++ atsctextdump("DSC description:", ++ indent, ++ atsc_content_advisory_entry_part2_description(part2), ++ part2->rating_description_length); ++ } ++ ++ break; ++ } ++ ++ case dtag_atsc_extended_channel_name: ++ { ++ struct atsc_extended_channel_name_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_extended_channel_name_descriptor\n"); ++ dx = atsc_extended_channel_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_extended_channel_name_descriptor decode error\n"); ++ return; ++ } ++ ++ atsctextdump("SCT text:", 1, ++ atsc_extended_channel_name_descriptor_text(dx), ++ atsc_extended_channel_name_descriptor_text_length(dx)); ++ break; ++ } ++ ++ case dtag_atsc_service_location: ++ { ++ struct atsc_service_location_descriptor *dx; ++ struct atsc_caption_service_location_element *cur; ++ int idx; ++ ++ iprintf(indent, "DSC Decode atsc_service_location_descriptor\n"); ++ dx = atsc_service_location_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_service_location_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent+1, "DSC PCR_PID:%04x\n", dx->PCR_PID); ++ ++ atsc_service_location_descriptor_elements_for_each(dx, cur, idx) { ++ iprintf(indent+1, "DSC stream_type:%02x elementary_PID:%04x language_code:%.3s\n", ++ cur->stream_type, ++ cur->elementary_PID, ++ cur->language_code); ++ } ++ break; ++ } ++ ++ case dtag_atsc_time_shifted_service: ++ { ++ struct atsc_time_shifted_service_descriptor *dx; ++ struct atsc_time_shifted_service *cur; ++ int idx; ++ ++ iprintf(indent, "DSC Decode atsc_time_shifted_service_descriptor\n"); ++ dx = atsc_time_shifted_service_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_time_shifted_service_descriptor decode error\n"); ++ return; ++ } ++ ++ atsc_time_shifted_service_descriptor_services_for_each(dx, cur, idx) { ++ iprintf(indent+1, "DSC time_shift:%i major_channel_number:%04x minor_channel_number:%04x\n", ++ cur->time_shift, ++ cur->major_channel_number, ++ cur->minor_channel_number); ++ } ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_component_name: ++ { ++ struct atsc_component_name_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_component_name_descriptor\n"); ++ dx = atsc_component_name_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_component_name_descriptor decode error\n"); ++ return; ++ } ++ ++ atsctextdump("SCT name:", 1, ++ atsc_component_name_descriptor_text(dx), ++ atsc_component_name_descriptor_text_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_dcc_departing_request: ++ { ++ struct atsc_dcc_departing_request_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_dcc_departing_request_descriptor\n"); ++ dx = atsc_dcc_departing_request_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_dcc_departing_request_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent+1, "DSC dcc_departing_request_type:%02x\n", ++ dx->dcc_departing_request_type); ++ ++ atsctextdump("SCT text:", 1, ++ atsc_dcc_departing_request_descriptor_text(dx), ++ atsc_dcc_departing_request_descriptor_text_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_dcc_arriving_request: ++ { ++ struct atsc_dcc_arriving_request_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_dcc_arriving_request_descriptor\n"); ++ dx = atsc_dcc_arriving_request_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_dcc_arriving_request_descriptor decode error\n"); ++ return; ++ } ++ iprintf(indent+1, "DSC dcc_arriving_request_type:%02x\n", ++ dx->dcc_arriving_request_type); ++ ++ atsctextdump("SCT text:", 1, ++ atsc_dcc_arriving_request_descriptor_text(dx), ++ atsc_dcc_arriving_request_descriptor_text_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_redistribution_control: ++ { ++ struct atsc_rc_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_rc_descriptor\n"); ++ dx = atsc_rc_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_rc_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ atsc_rc_descriptor_info(dx), ++ atsc_rc_descriptor_info_length(dx)); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_genre: ++ { ++ struct atsc_genre_descriptor *dx; ++ ++ iprintf(indent, "DSC Decode atsc_genre_descriptor\n"); ++ dx = atsc_genre_descriptor_codec(d); ++ if (dx == NULL) { ++ fprintf(stderr, "DSC XXXX atsc_genre_descriptor decode error\n"); ++ return; ++ } ++ hexdump(indent, "DSC", ++ atsc_genre_descriptor_attributes(dx), ++ dx->attribute_count); ++ ++ hexdump(0, "XXX", (uint8_t*) d, d->len + 2); ++ getchar(); ++ break; ++ } ++ ++ case dtag_atsc_private_information: ++ // FIXME: whats the format? ++ ++ case dtag_atsc_content_identifier: ++ // FIXME: whats the format? ++ ++ default: ++ fprintf(stderr, "DSC XXXX Unknown descriptor_tag:0x%02x\n", d->tag); ++ hexdump(0, "DSC ", (uint8_t*) d, d->len+2); ++ return; ++ } ++} ++ ++void iprintf(int indent, char *fmt, ...) ++{ ++ va_list ap; ++ ++ while(indent--) { ++ printf("\t"); ++ } ++ ++ va_start(ap, fmt); ++ vprintf(fmt, ap); ++ va_end(ap); ++} ++ ++void hexdump(int indent, char *prefix, uint8_t *buf, int buflen) ++{ ++ int i; ++ int j; ++ int max; ++ char line[512]; ++ ++ for(i=0; i< buflen; i+=16) { ++ max = 16; ++ if ((i + max) > buflen) ++ max = buflen - i; ++ ++ memset(line, 0, sizeof(line)); ++ memset(line + 4 + 48 + 1, ' ', 16); ++ sprintf(line, "%02x: ", i); ++ for(j=0; j 31) && (buf[i+j] < 127)) ++ line[4 + 48 + 1 + j] = buf[i+j]; ++ else ++ line[4 + 48 + 1 + j] = '.'; ++ } ++ ++ for(j=0; j< 4 + 48; j++) { ++ if (!line[j]) ++ line[j] = ' '; ++ } ++ line[4+48] = '|'; ++ ++ for(j=0; j < indent; j++) { ++ printf("\t"); ++ } ++ printf("%s%s|\n", prefix, line); ++ } ++} ++ ++void atsctextdump(char *header, int indent, struct atsc_text *atext, int len) ++{ ++ struct atsc_text_string *cur_string; ++ struct atsc_text_string_segment *cur_segment; ++ int str_idx; ++ int seg_idx; ++ ++ if (len == 0) ++ return; ++ ++ atsc_text_strings_for_each(atext, cur_string, str_idx) { ++ iprintf(indent+1, "%s String %i language:%.3s\n", header, str_idx, cur_string->language_code); ++ ++ atsc_text_string_segments_for_each(cur_string, cur_segment, seg_idx) { ++ iprintf(indent+2, "Segment %i compression_type:%i mode:%i\n", ++ seg_idx, ++ cur_segment->compression_type, ++ cur_segment->mode); ++ ++ hexdump(indent+2, "rawbytes ", ++ atsc_text_string_segment_bytes(cur_segment), ++ cur_segment->number_bytes); ++ ++ if (cur_segment->compression_type < 0x3e) { ++ uint8_t *decoded = NULL; ++ size_t decodedlen = 0; ++ size_t decodedpos = 0; ++ ++ if (atsc_text_segment_decode(cur_segment, ++ &decoded, ++ &decodedlen, ++ &decodedpos) < 0) { ++ iprintf(indent+2, "Decode error\n"); ++ } else { ++ hexdump(indent+2, "decoded ", decoded, decodedpos); ++ } ++ if (decoded) ++ free(decoded); ++ } ++ } ++ } ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/lnb.c dvb-apps/test/lnb.c +--- linuxtv-dvb-apps-1.1.1/test/lnb.c 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/lnb.c 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,101 @@ ++#include ++#include ++#include ++#include "lnb.h" ++ ++static char *univ_desc[] = { ++ "Europe", ++ "10800 to 11800 MHz and 11600 to 12700 Mhz", ++ "Dual LO, loband 9750, hiband 10600 MHz", ++ (char *)NULL }; ++ ++static char *dbs_desc[] = { ++ "Expressvu, North America", ++ "12200 to 12700 MHz", ++ "Single LO, 11250 MHz", ++ (char *)NULL }; ++ ++static char *standard_desc[] = { ++ "10945 to 11450 Mhz", ++ "Single LO, 10000 Mhz", ++ (char *)NULL }; ++ ++static char *enhan_desc[] = { ++ "Astra", ++ "10700 to 11700 MHz", ++ "Single LO, 9750 MHz", ++ (char *)NULL }; ++ ++static char *cband_desc[] = { ++ "Big Dish", ++ "3700 to 4200 MHz", ++ "Single LO, 5150 Mhz", ++ (char *)NULL }; ++ ++static struct lnb_types_st lnbs[] = { ++ {"UNIVERSAL", univ_desc, 9750, 10600, 11700 }, ++ {"DBS", dbs_desc, 11250, 0, 0 }, ++ {"STANDARD", standard_desc, 10000, 0, 0 }, ++ {"ENHANCED", enhan_desc, 9750, 0, 0 }, ++ {"C-BAND", cband_desc, 5150, 0, 0 } ++}; ++ ++/* Enumerate through standard types of LNB's until NULL returned. ++ * Increment curno each time ++ */ ++ ++struct lnb_types_st * ++lnb_enum(int curno) ++{ ++ if (curno >= (int) (sizeof(lnbs) / sizeof(lnbs[0]))) ++ return (struct lnb_types_st *)NULL; ++ return &lnbs[curno]; ++} ++ ++/* Decode an lnb type, for example given on a command line ++ * If alpha and standard type, e.g. "Universal" then match that ++ * otherwise low[,high[,switch]] ++ */ ++ ++int ++lnb_decode(char *str, struct lnb_types_st *lnbp) ++{ ++int i; ++char *cp, *np; ++ ++ memset(lnbp, 0, sizeof(*lnbp)); ++ cp = str; ++ while(*cp && isspace(*cp)) ++ cp++; ++ if (isalpha(*cp)) { ++ for (i = 0; i < (int)(sizeof(lnbs) / sizeof(lnbs[0])); i++) { ++ if (!strcasecmp(lnbs[i].name, cp)) { ++ *lnbp = lnbs[i]; ++ return 1; ++ } ++ } ++ return -1; ++ } ++ if (*cp == '\0' || !isdigit(*cp)) ++ return -1; ++ lnbp->low_val = strtoul(cp, &np, 0); ++ if (lnbp->low_val == 0) ++ return -1; ++ cp = np; ++ while(*cp && (isspace(*cp) || *cp == ',')) ++ cp++; ++ if (*cp == '\0') ++ return 1; ++ if (!isdigit(*cp)) ++ return -1; ++ lnbp->high_val = strtoul(cp, &np, 0); ++ cp = np; ++ while(*cp && (isspace(*cp) || *cp == ',')) ++ cp++; ++ if (*cp == '\0') ++ return 1; ++ if (!isdigit(*cp)) ++ return -1; ++ lnbp->switch_val = strtoul(cp, NULL, 0); ++ return 1; ++} +diff -Nurd linuxtv-dvb-apps-1.1.1/test/lnb.h dvb-apps/test/lnb.h +--- linuxtv-dvb-apps-1.1.1/test/lnb.h 1970-01-01 01:00:00.000000000 +0100 ++++ dvb-apps/test/lnb.h 2009-06-21 13:29:06.000000000 +0200 +@@ -0,0 +1,22 @@ ++struct lnb_types_st { ++ char *name; ++ char **desc; ++ unsigned long low_val; ++ unsigned long high_val; /* zero indicates no hiband */ ++ unsigned long switch_val; /* zero indicates no hiband */ ++}; ++ ++/* Enumerate through standard types of LNB's until NULL returned. ++ * Increment curno each time ++ */ ++ ++struct lnb_types_st * ++lnb_enum(int curno); ++ ++/* Decode an lnb type, for example given on a command line ++ * If alpha and standard type, e.g. "Universal" then match that ++ * otherwise low[,high[,switch]] ++ */ ++ ++int ++lnb_decode(char *str, struct lnb_types_st *lnbp); +diff -Nurd linuxtv-dvb-apps-1.1.1/test/Makefile dvb-apps/test/Makefile +--- linuxtv-dvb-apps-1.1.1/test/Makefile 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/Makefile 2009-06-21 13:29:06.000000000 +0200 +@@ -1,37 +1,41 @@ +-# Makefile for Linux DVB API Version 3 test programs ++# Makefile for linuxtv.org dvb-apps/test + +-CC = gcc +-CFLAGS = -g -O2 -W -Wall -I../include ++objects = hex_dump.o lnb.o + +-TARGETS = \ +- diseqc \ +- set22k \ +- sendburst \ +- setvoltage \ +- setpid \ +- video \ +- test_sections \ +- test_sec_ne \ +- test_pes \ +- test_dvr \ +- test_dvr_play \ +- test_tt \ +- test_av \ +- test_av_play \ +- test_vevent \ +- test_stc \ +- test_stillimage ++binaries = diseqc \ ++ sendburst \ ++ set22k \ ++ setpid \ ++ setvoltage \ ++ test_av \ ++ test_av_play \ ++ test_dvr \ ++ test_dvr_play \ ++ test_pes \ ++ test_sec_ne \ ++ test_sections \ ++ test_stc \ ++ test_stillimage \ ++ test_tt \ ++ test_vevent \ ++ evtest \ ++ video \ ++ szap2 + +-# test \ +-# test_audio \ +-# test_front \ +-# test_switch \ +-# test_video \ ++.PHONY: all + +-all: $(TARGETS) ++all: $(binaries) ++ make -C libdvbcfg $@ ++ make -C libdvben50221 $@ ++ make -C libesg $@ ++ make -C libucsi $@ + +-test_sections test_sec_ne test_pes test_tt: hex_dump.o ++$(binaries): $(objects) + +-clean: +- rm -f $(TARGETS) *.o ++clean:: ++ make -C libdvbcfg $@ ++ make -C libdvben50221 $@ ++ make -C libesg $@ ++ make -C libucsi $@ + ++include ../Make.rules +diff -Nurd linuxtv-dvb-apps-1.1.1/test/README dvb-apps/test/README +--- linuxtv-dvb-apps-1.1.1/test/README 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/README 2009-06-21 13:29:06.000000000 +0200 +@@ -1,4 +1,4 @@ +-Various small test/sample programs for the Linux DVB API Version 2 ++Various small test/sample programs for the Linux DVB API Version 2/3 + + The default devices used by the test programs are generally + /dev/dvb/adapter0/*0, and can be overridden using environment +@@ -33,13 +33,13 @@ + test_stc : Test DMX_GET_STC. + + test_stillimage : Display single iframes as stillimages +- iframes can be created with the 'convert' tool from +- imagemagick and mpeg2encode from ftp.mpeg.org, and must ++ iframes can be created with the 'convert' tool from ++ imagemagick and mpeg2encode from ftp.mpeg.org, and must + have a supported size, e.g. 702x576 + ($ convert -sample 702x576\! test.jpg test.mpg) + +-(test_av_play : Test playing MPEG TS from a file (apparently broken)) +- ++test_av_play : Test playing MPEG PES (VDR format) from a file ++test_dvr_play : Test playing MPEG TS from a file (don't try, driver is broken) + + test : + test_audio : +@@ -48,4 +48,3 @@ + test_front : + test_switch : + test_video : +- +diff -Nurd linuxtv-dvb-apps-1.1.1/test/sendburst.c dvb-apps/test/sendburst.c +--- linuxtv-dvb-apps-1.1.1/test/sendburst.c 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/sendburst.c 2009-06-21 13:29:06.000000000 +0200 +@@ -1,8 +1,9 @@ +-/* +- * Test sending the burst mini command A/B on a SAT frontend. +- * +- * usage: FRONTEND=/dev/dvb/adapterX/frontendX sendburst {a|b} +- */ ++#define USAGE \ ++"\n" \ ++"\nTest sending the burst mini command A/B on a SAT frontend." \ ++"\n" \ ++"\nusage: FRONTEND=/dev/dvb/adapterX/frontendX sendburst {a|b}" \ ++"\n" + + #include + #include +@@ -22,7 +23,7 @@ + int fd, r; + + if (argc != 2 || (strcmp(argv[1], "a") && strcmp(argv[1], "b"))) { +- fprintf (stderr, "usage: %s \n", argv[0]); ++ fprintf (stderr, "usage: %s \n" USAGE, argv[0]); + return 1; + } + +@@ -52,4 +53,3 @@ + + return 0; + } +- +diff -Nurd linuxtv-dvb-apps-1.1.1/test/set22k.c dvb-apps/test/set22k.c +--- linuxtv-dvb-apps-1.1.1/test/set22k.c 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/set22k.c 2009-06-21 13:29:06.000000000 +0200 +@@ -1,10 +1,11 @@ +-/* +- * Test switching the 22kHz tone signal on and off on a SAT frontend. +- * (Note: DiSEqC equipment ignores this after it has once seen a diseqc +- * sequence; reload the driver or unplug/replug the SAT cable to reset.) +- * +- * usage: FRONTEND=/dev/dvb/adapterX/frontendX set22k {on|off} +- */ ++#define USAGE \ ++"\n" \ ++"\nTest switching the 22kHz tone signal on and off on a SAT frontend." \ ++"\n(Note: DiSEqC equipment ignores this after it has once seen a diseqc" \ ++"\n sequence; reload the driver or unplug/replug the SAT cable to reset.)" \ ++"\n" \ ++"\nusage: FRONTEND=/dev/dvb/adapterX/frontendX set22k {on|off}" \ ++"\n" + + #include + #include +@@ -24,7 +25,7 @@ + int fd, r; + + if (argc != 2 || (strcmp(argv[1], "on") && strcmp(argv[1], "off"))) { +- fprintf (stderr, "usage: %s \n", argv[0]); ++ fprintf (stderr, "usage: %s \n" USAGE, argv[0]); + return 1; + } + if (getenv("FRONTEND")) +@@ -47,4 +48,3 @@ + + return 0; + } +- +diff -Nurd linuxtv-dvb-apps-1.1.1/test/setpid.c dvb-apps/test/setpid.c +--- linuxtv-dvb-apps-1.1.1/test/setpid.c 2004-01-17 17:59:46.000000000 +0100 ++++ dvb-apps/test/setpid.c 2009-06-21 13:29:06.000000000 +0200 +@@ -1,9 +1,10 @@ +-/* +- * Set video and audio PIDs in the demux; useful only if you have +- * a hardware MPEG decoder and you're tuned to a transport stream. +- * +- * usage: DEMUX=/dev/dvb/adapterX/demuxX setpid video_pid audio_pid +- */ ++#define USAGE \ ++"\n" \ ++"\nSet video and audio PIDs in the demux; useful only if you have" \ ++"\na hardware MPEG decoder and you're tuned to a transport stream." \ ++"\n" \ ++"\nusage: DEMUX=/dev/dvb/adapterX/demuxX setpid video_pid audio_pid" \ ++"\n" + + #include + #include +@@ -69,7 +70,7 @@ + int video_pid, audio_pid; + + if (argc != 3) { +- printf ("\nusage: %s